aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--COPYING.NEWLIB58
-rw-r--r--ChangeLog37
-rw-r--r--Makefile.def4
-rw-r--r--Makefile.in308
-rw-r--r--Makefile.tpl8
-rw-r--r--bfd/ChangeLog79
-rw-r--r--bfd/acinclude.m410
-rw-r--r--bfd/bfd-in2.h4
-rw-r--r--bfd/coff-h8300.c125
-rw-r--r--bfd/elf32-arm.h11
-rw-r--r--bfd/elf32-frv.c2
-rw-r--r--bfd/elf32-h8300.c95
-rw-r--r--bfd/elf64-mips.c8
-rw-r--r--bfd/elf64-ppc.c18
-rw-r--r--bfd/elfxx-ia64.c96
-rw-r--r--bfd/libbfd.h1
-rw-r--r--bfd/opncls.c22
-rw-r--r--bfd/peXXigen.c18
-rw-r--r--bfd/reloc.c7
-rw-r--r--bfd/version.h2
-rw-r--r--config/ChangeLog7
-rwxr-xr-xconfig/acinclude.m480
-rwxr-xr-xconfigure2
-rw-r--r--configure.in4
-rw-r--r--cpu/ChangeLog7
-rw-r--r--cpu/frv.cpu5
-rw-r--r--cpu/frv.opc5
-rw-r--r--gdb/ChangeLog1576
-rw-r--r--gdb/MAINTAINERS8
-rw-r--r--gdb/Makefile.in464
-rw-r--r--gdb/NEWS11
-rw-r--r--gdb/PROBLEMS12
-rw-r--r--gdb/acconfig.h9
-rw-r--r--gdb/ada-lang.c3
-rw-r--r--gdb/alpha-tdep.c4
-rw-r--r--gdb/arm-tdep.c26
-rw-r--r--gdb/avr-tdep.c17
-rw-r--r--gdb/ax-gdb.c35
-rw-r--r--gdb/block.h4
-rw-r--r--gdb/blockframe.c23
-rw-r--r--gdb/breakpoint.c753
-rw-r--r--gdb/breakpoint.h18
-rw-r--r--gdb/buildsym.c26
-rw-r--r--gdb/c-exp.y15
-rw-r--r--gdb/c-lang.c6
-rw-r--r--gdb/cli/cli-cmds.c41
-rw-r--r--gdb/cli/cli-dump.c30
-rw-r--r--gdb/coffread.c12
-rw-r--r--gdb/config.in9
-rw-r--r--gdb/config/alpha/alpha-linux.mh3
-rw-r--r--gdb/config/djgpp/fnchange.lst2
-rw-r--r--gdb/config/i386/go32.mh5
-rw-r--r--gdb/config/i386/interix.mh3
-rw-r--r--gdb/config/i386/nm-i386.h4
-rw-r--r--gdb/config/nm-linux.h3
-rw-r--r--gdb/config/powerpc/xm-linux.h10
-rw-r--r--gdb/config/sparc/nm-nbsd.h12
-rwxr-xr-xgdb/configure718
-rw-r--r--gdb/configure.host8
-rw-r--r--gdb/configure.in29
-rw-r--r--gdb/configure.tgt10
-rw-r--r--gdb/core-sol2.c198
-rw-r--r--gdb/corelow.c60
-rw-r--r--gdb/cp-namespace.c121
-rw-r--r--gdb/cp-support.c229
-rw-r--r--gdb/cp-support.h7
-rw-r--r--gdb/cris-tdep.c34
-rw-r--r--gdb/d10v-tdep.c7
-rw-r--r--gdb/dbxread.c23
-rw-r--r--gdb/defs.h27
-rw-r--r--gdb/dink32-rom.c16
-rw-r--r--gdb/doc/ChangeLog138
-rw-r--r--gdb/doc/Makefile.in4
-rw-r--r--gdb/doc/gdb.texinfo535
-rw-r--r--gdb/doc/gdbint.texinfo90
-rw-r--r--gdb/dwarf2-frame.c204
-rw-r--r--gdb/dwarf2-frame.h52
-rw-r--r--gdb/dwarf2expr.c4
-rw-r--r--gdb/dwarf2loc.c6
-rw-r--r--gdb/dwarf2loc.h6
-rw-r--r--gdb/dwarf2read.c1410
-rw-r--r--gdb/dwarfread.c24
-rw-r--r--gdb/elfread.c10
-rw-r--r--gdb/f-lang.c3
-rw-r--r--gdb/findvar.c28
-rw-r--r--gdb/frame.c2
-rw-r--r--gdb/frv-tdep.c7
-rw-r--r--gdb/gcore.c24
-rw-r--r--gdb/gdbarch.c103
-rw-r--r--gdb/gdbarch.h69
-rwxr-xr-xgdb/gdbarch.sh46
-rw-r--r--gdb/gdbinit.in1
-rw-r--r--gdb/gdbserver/ChangeLog16
-rw-r--r--gdb/gdbserver/linux-low.c137
-rw-r--r--gdb/gdbserver/linux-low.h8
-rw-r--r--gdb/gdbserver/regcache.c7
-rw-r--r--gdb/gdbtypes.c20
-rw-r--r--gdb/gdbtypes.h10
-rw-r--r--gdb/h8300-tdep.c8
-rw-r--r--gdb/hppa-tdep.c37
-rw-r--r--gdb/hpread.c60
-rw-r--r--gdb/i386-interix-tdep.c1
-rw-r--r--gdb/i386-linux-tdep.c2
-rw-r--r--gdb/i386-nto-tdep.c3
-rw-r--r--gdb/i386-tdep.c19
-rw-r--r--gdb/ia64-tdep.c96
-rw-r--r--gdb/infcmd.c150
-rw-r--r--gdb/infrun.c241
-rw-r--r--gdb/inftarg.c26
-rw-r--r--gdb/jv-lang.c43
-rw-r--r--gdb/language.c5
-rw-r--r--gdb/language.h7
-rw-r--r--gdb/linespec.c20
-rw-r--r--gdb/linux-proc.c26
-rw-r--r--gdb/lynx-nat.c208
-rw-r--r--gdb/m2-lang.c3
-rw-r--r--gdb/m32r-rom.c57
-rw-r--r--gdb/m32r-tdep.c11
-rw-r--r--gdb/m68hc11-tdep.c11
-rw-r--r--gdb/m68k-tdep.c59
-rw-r--r--gdb/m68klinux-tdep.c3
-rw-r--r--gdb/main.c6
-rw-r--r--gdb/maint.c8
-rw-r--r--gdb/mcore-tdep.c33
-rw-r--r--gdb/mdebugread.c69
-rw-r--r--gdb/mi/mi-cmd-env.c3
-rw-r--r--gdb/mi/mi-cmd-stack.c61
-rw-r--r--gdb/mi/mi-cmd-var.c24
-rw-r--r--gdb/mi/mi-cmds.h8
-rw-r--r--gdb/mi/mi-interp.c23
-rw-r--r--gdb/mi/mi-out.c30
-rw-r--r--gdb/minsyms.c14
-rw-r--r--gdb/mips-linux-nat.c1
-rw-r--r--gdb/mips-tdep.c2039
-rw-r--r--gdb/mn10300-tdep.c18
-rw-r--r--gdb/monitor.c38
-rw-r--r--gdb/ns32k-tdep.c21
-rw-r--r--gdb/objc-lang.c3
-rw-r--r--gdb/objfiles.c378
-rw-r--r--gdb/objfiles.h40
-rw-r--r--gdb/ocd.c221
-rw-r--r--gdb/osabi.c153
-rw-r--r--gdb/p-lang.c3
-rw-r--r--gdb/pa64solib.c6
-rw-r--r--gdb/printcmd.c9
-rw-r--r--gdb/proc-api.c2
-rw-r--r--gdb/procfs.c596
-rw-r--r--gdb/regcache.c10
-rw-r--r--gdb/remote-fileio.c6
-rw-r--r--gdb/remote-mips.c177
-rw-r--r--gdb/remote-rdi.c4
-rw-r--r--gdb/remote-sds.c15
-rw-r--r--gdb/remote-sim.c6
-rw-r--r--gdb/remote.c730
-rw-r--r--gdb/rs6000-nat.c5
-rw-r--r--gdb/rs6000-tdep.c35
-rw-r--r--gdb/s390-tdep.c5
-rw-r--r--gdb/scm-lang.c3
-rw-r--r--gdb/ser-pipe.c2
-rw-r--r--gdb/sh-tdep.c5
-rw-r--r--gdb/sh64-tdep.c24
-rw-r--r--gdb/sol-thread.c117
-rw-r--r--gdb/solib-sunos.c12
-rw-r--r--gdb/somread.c18
-rw-r--r--gdb/somsolib.c6
-rw-r--r--gdb/source.c18
-rw-r--r--gdb/sparc-nat.c34
-rw-r--r--gdb/sparc-tdep.c124
-rw-r--r--gdb/sparc-tdep.h8
-rw-r--r--gdb/sparc64-tdep.c15
-rw-r--r--gdb/sparc64-tdep.h10
-rw-r--r--gdb/sparc64nbsd-tdep.c94
-rw-r--r--gdb/sparcnbsd-tdep.c151
-rw-r--r--gdb/stabsread.c80
-rw-r--r--gdb/stack.c7
-rw-r--r--gdb/symfile.c133
-rw-r--r--gdb/symfile.h4
-rw-r--r--gdb/symmisc.c10
-rw-r--r--gdb/symtab.c24
-rw-r--r--gdb/symtab.h87
-rw-r--r--gdb/target.c24
-rw-r--r--gdb/target.h61
-rw-r--r--gdb/testsuite/ChangeLog280
-rw-r--r--gdb/testsuite/config/gdbserver.exp144
-rw-r--r--gdb/testsuite/gdb.arch/Makefile.in3
-rwxr-xr-xgdb/testsuite/gdb.arch/gdb1291.c3
-rwxr-xr-xgdb/testsuite/gdb.arch/gdb1431.c4
-rw-r--r--gdb/testsuite/gdb.asm/asm-source.exp36
-rw-r--r--gdb/testsuite/gdb.base/Makefile.in2
-rw-r--r--gdb/testsuite/gdb.base/bang.exp14
-rw-r--r--gdb/testsuite/gdb.base/call-ar-st.exp15
-rw-r--r--gdb/testsuite/gdb.base/callfuncs.c24
-rw-r--r--gdb/testsuite/gdb.base/charset.c1
-rw-r--r--gdb/testsuite/gdb.base/completion.exp16
-rw-r--r--gdb/testsuite/gdb.base/dump.c2
-rw-r--r--gdb/testsuite/gdb.base/dump.exp4
-rw-r--r--gdb/testsuite/gdb.base/fileio.c2
-rw-r--r--gdb/testsuite/gdb.base/fileio.exp4
-rw-r--r--gdb/testsuite/gdb.base/finish.exp4
-rw-r--r--gdb/testsuite/gdb.base/gcore.exp4
-rw-r--r--gdb/testsuite/gdb.base/gdb1476.exp3
-rw-r--r--gdb/testsuite/gdb.base/huge.c2
-rw-r--r--gdb/testsuite/gdb.base/huge.exp4
-rw-r--r--gdb/testsuite/gdb.base/info-proc.exp4
-rw-r--r--gdb/testsuite/gdb.base/langs.exp11
-rw-r--r--gdb/testsuite/gdb.base/maint.exp5
-rw-r--r--gdb/testsuite/gdb.base/pending.exp4
-rw-r--r--gdb/testsuite/gdb.base/return2.exp4
-rw-r--r--gdb/testsuite/gdb.base/sepdebug.exp9
-rw-r--r--gdb/testsuite/gdb.base/setvar.exp7
-rw-r--r--gdb/testsuite/gdb.base/shlib-call.exp4
-rw-r--r--gdb/testsuite/gdb.cp/derivation.exp28
-rw-r--r--gdb/testsuite/gdb.cp/inherit.exp1485
-rw-r--r--gdb/testsuite/gdb.cp/local.exp182
-rw-r--r--gdb/testsuite/gdb.cp/member-ptr.cc21
-rw-r--r--gdb/testsuite/gdb.cp/member-ptr.exp798
-rw-r--r--gdb/testsuite/gdb.cp/namespace.cc16
-rw-r--r--gdb/testsuite/gdb.cp/namespace.exp37
-rw-r--r--gdb/testsuite/gdb.cp/namespace1.cc13
-rw-r--r--gdb/testsuite/gdb.cp/overload.cc28
-rw-r--r--gdb/testsuite/gdb.cp/overload.exp15
-rw-r--r--gdb/testsuite/gdb.cp/rtti.exp39
-rw-r--r--gdb/testsuite/gdb.cp/rtti1.cc26
-rw-r--r--gdb/testsuite/gdb.cp/templates.exp86
-rw-r--r--gdb/testsuite/gdb.cp/virtfunc.exp36
-rw-r--r--gdb/testsuite/gdb.mi/gdb669.exp4
-rw-r--r--gdb/testsuite/gdb.mi/mi-pthreads.exp4
-rw-r--r--gdb/testsuite/gdb.mi/mi-stack.exp7
-rw-r--r--gdb/testsuite/gdb.mi/mi-var-child.exp5
-rw-r--r--gdb/testsuite/gdb.mi/mi1-pthreads.exp4
-rw-r--r--gdb/testsuite/gdb.mi/mi2-basics.exp24
-rw-r--r--gdb/testsuite/gdb.mi/mi2-pthreads.exp4
-rw-r--r--gdb/testsuite/gdb.threads/gcore-thread.exp6
-rw-r--r--gdb/testsuite/lib/compiler.c57
-rw-r--r--gdb/testsuite/lib/compiler.cc40
-rw-r--r--gdb/testsuite/lib/gdb.exp246
-rw-r--r--gdb/testsuite/lib/mi-support.exp125
-rw-r--r--gdb/top.c33
-rw-r--r--gdb/top.h1
-rw-r--r--gdb/tui/tui-command.c31
-rw-r--r--gdb/tui/tui-data.c346
-rw-r--r--gdb/tui/tui-disasm.c92
-rw-r--r--gdb/tui/tui-file.c2
-rw-r--r--gdb/tui/tui-hooks.c30
-rw-r--r--gdb/tui/tui-interp.c8
-rw-r--r--gdb/tui/tui-io.c26
-rw-r--r--gdb/tui/tui-layout.c775
-rw-r--r--gdb/tui/tui-regs.c674
-rw-r--r--gdb/tui/tui-source.c140
-rw-r--r--gdb/tui/tui-stack.c16
-rw-r--r--gdb/tui/tui-win.c926
-rw-r--r--gdb/tui/tui-windata.c201
-rw-r--r--gdb/tui/tui-wingeneral.c28
-rw-r--r--gdb/tui/tui-winsource.c199
-rw-r--r--gdb/tui/tui.c117
-rw-r--r--gdb/tui/tui.h112
-rw-r--r--gdb/tui/tuiCommand.c138
-rw-r--r--gdb/tui/tuiCommand.h42
-rw-r--r--gdb/tui/tuiData.c1055
-rw-r--r--gdb/tui/tuiData.h383
-rw-r--r--gdb/tui/tuiDataWin.c349
-rw-r--r--gdb/tui/tuiDataWin.h47
-rw-r--r--gdb/tui/tuiDisassem.c415
-rw-r--r--gdb/tui/tuiDisassem.h41
-rw-r--r--gdb/tui/tuiGeneralWin.c285
-rw-r--r--gdb/tui/tuiGeneralWin.h49
-rw-r--r--gdb/tui/tuiIO.c694
-rw-r--r--gdb/tui/tuiIO.h69
-rw-r--r--gdb/tui/tuiLayout.c1148
-rw-r--r--gdb/tui/tuiLayout.h30
-rw-r--r--gdb/tui/tuiRegs.c1047
-rw-r--r--gdb/tui/tuiRegs.h47
-rw-r--r--gdb/tui/tuiSource.c356
-rw-r--r--gdb/tui/tuiSource.h33
-rw-r--r--gdb/tui/tuiSourceWin.c715
-rw-r--r--gdb/tui/tuiSourceWin.h68
-rw-r--r--gdb/tui/tuiStack.c435
-rw-r--r--gdb/tui/tuiStack.h33
-rw-r--r--gdb/tui/tuiWin.c1615
-rw-r--r--gdb/tui/tuiWin.h59
-rw-r--r--gdb/ui-out.c4
-rw-r--r--gdb/utils.c110
-rw-r--r--gdb/v850-tdep.c28
-rw-r--r--gdb/valops.c487
-rw-r--r--gdb/values.c6
-rw-r--r--gdb/vax-tdep.c19
-rw-r--r--gdb/version.in2
-rw-r--r--gdb/x86-64-tdep.c2
-rw-r--r--gdb/xcoffread.c28
-rw-r--r--gdb/xstormy16-tdep.c27
-rw-r--r--gettext.m48
-rw-r--r--include/ChangeLog1537
-rw-r--r--include/demangle.h2
-rw-r--r--include/elf/ChangeLog16
-rw-r--r--include/elf/common.h27
-rw-r--r--libiberty/ChangeLog28
-rw-r--r--libiberty/Makefile.in823
-rwxr-xr-xlibiberty/configure20
-rw-r--r--libiberty/configure.ac20
-rw-r--r--libiberty/cp-demangle.c2
-rw-r--r--libiberty/cp-demint.c2
-rw-r--r--libiberty/getpwd.c3
-rw-r--r--libiberty/maint-tool17
-rw-r--r--libiberty/strdup.c2
-rw-r--r--opcodes/ChangeLog33
-rw-r--r--opcodes/frv-desc.c7
-rw-r--r--opcodes/frv-desc.h6
-rw-r--r--opcodes/frv-opc.c3
-rw-r--r--opcodes/i386-dis.c6
-rw-r--r--opcodes/m10300-opc.c6
-rw-r--r--opcodes/sh-dis.c2
-rw-r--r--opcodes/sh-opc.h2
-rw-r--r--opcodes/sparc-opc.c14
-rw-r--r--readline/ChangeLog.gdb38
-rw-r--r--readline/bind.c2
-rw-r--r--readline/mbutil.c20
-rw-r--r--readline/readline.c1
-rw-r--r--readline/vi_mode.c7
-rw-r--r--sim/ChangeLog5
-rw-r--r--sim/common/ChangeLog4
-rw-r--r--sim/common/Makefile.in1
-rwxr-xr-xsim/configure8
-rw-r--r--sim/configure.in2
-rw-r--r--sim/m32r/ChangeLog7
-rw-r--r--sim/m32r/mloop2.in74
-rw-r--r--sim/m32r/mloopx.in74
-rw-r--r--sim/mips/ChangeLog8
-rw-r--r--sim/mips/mips.igen72
-rw-r--r--sim/ppc/ChangeLog5
-rw-r--r--sim/ppc/ppc-instructions4
-rw-r--r--sim/sh/ChangeLog8
-rw-r--r--sim/sh/gencode.c49
-rw-r--r--sim/testsuite/ChangeLog9
-rw-r--r--sim/testsuite/lib/sim-defs.exp2
-rw-r--r--sim/v850/ChangeLog4
-rw-r--r--sim/v850/simops.c2
-rw-r--r--src-release23
337 files changed, 15715 insertions, 20463 deletions
diff --git a/COPYING.NEWLIB b/COPYING.NEWLIB
index e0eff07..60b63df 100644
--- a/COPYING.NEWLIB
+++ b/COPYING.NEWLIB
@@ -670,14 +670,68 @@ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
-(27) Red Hat Incorporated
+(27) Konstantin Chuguev (--enable-newlib-iconv)
+
+Copyright (c) 1999, 2000
+ Konstantin Chuguev. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+
+ iconv (Charset Conversion Library) v2.0
+
+(27) Artem Bityuckiy (--enable-newlib-iconv)
+
+Copyright (c) 2003, Artem B. Bityuckiy, SoftMine Corporation.
+Rights transferred to Franklin Electronic Publishers.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+
+(28) Red Hat Incorporated
Unless otherwise stated in each remaining newlib file, the remaining
files in the newlib subdirectory default to the following copyright.
It should be noted that Red Hat Incorporated now owns copyrights
belonging to Cygnus Solutions and Cygnus Support.
-Copyright (c) 1994, 1997, 2001, 2002 Red Hat Incorporated.
+Copyright (c) 1994, 1997, 2001, 2002, 2003, 2004 Red Hat Incorporated.
All rights reserved.
Redistribution and use in source and binary forms, with or without
diff --git a/ChangeLog b/ChangeLog
index af149b1..b5b8778 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,40 @@
+2004-02-05 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * configure.in: Don't pass --with-stabs on IRIX 5 either.
+ * configure: Regenerate.
+
+2004-02-02 Jeff Johnston <jjohnstn@redhat.com>
+
+ * COPYING.NEWLIB: Update Red Hat license to 2004.
+
+2004-01-23 DJ Delorie <dj@redhat.com>
+
+ * Makefile.def (target_modules) [libiberty]: Don't stage.
+ * Makefile.in: Rebuilt.
+
+2004-01-23 Jeff Johnston <jjohnstn@redhat.com>
+
+ * COPYING.NEWLIB: Update to include copyrights for new
+ iconv code.
+
+2004-01-15 Andrew Cagney <cagney@redhat.com>
+
+ * src-release: Update copyright year.
+ (do-proto-toplev): Configure using i686-pc-linux-gnu.
+ (NEWLIB_SUPPORT_DIRS): Delete macro.
+ (newlib.tar.bz2): Delete rule.
+
+2004-01-14 Loren J. Rittle <ljrittle@acm.org>
+
+ * Makefile.def (target_modules) [libtermcap, libiberty, zlib]: Stage.
+ * Makefile.tpl (configure-target-[+module+]): Support stage.
+ * Makefile.in: Rebuilt.
+
+2003-01-14 Maciej W. Rozycki <macro@ds2.pg.gda.pl>
+
+ * gettext.m4: Quote names of macros to be defined by AC_DEFUN
+ throughout.
+
2004-01-04 Nathanael Nerode <neroden@gcc.gnu.org>
* configure.in: Use ./config.cache, not config.cache.
diff --git a/Makefile.def b/Makefile.def
index 1fd09ab..f9a7f2f 100644
--- a/Makefile.def
+++ b/Makefile.def
@@ -100,7 +100,7 @@ target_modules = { module= libstdc++-v3; raw_cxx=true; };
target_modules = { module= newlib; };
target_modules = { module= libf2c; };
target_modules = { module= libobjc; };
-target_modules = { module= libtermcap; no_check=true;
+target_modules = { module= libtermcap; no_check=true; stage=true;
missing=mostlyclean;
missing=clean;
missing=distclean;
@@ -112,7 +112,7 @@ target_modules = { module= gperf; };
target_modules = { module= examples; no_check=true; no_install=true; };
target_modules = { module= libffi; };
target_modules = { module= libjava; raw_cxx=true; };
-target_modules = { module= zlib; };
+target_modules = { module= zlib; stage=true; };
target_modules = { module= boehm-gc; };
target_modules = { module= qthreads; };
target_modules = { module= rda; };
diff --git a/Makefile.in b/Makefile.in
index 51d9dd4..e9fa3d7 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -21986,30 +21986,8 @@ configure-target-libstdc++-v3: $(TARGET_SUBDIR)/libstdc++-v3/multilib.out
*) topdir="../../$(srcdir)" ;; \
esac ;; \
esac; \
- if [ "$(srcdir)" = "." ] ; then \
- if [ "$(TARGET_SUBDIR)" != "." ] ; then \
- if $(SHELL) $$s/symlink-tree $${topdir}/libstdc++-v3 "no-such-file" ; then \
- if [ -f Makefile ]; then \
- if $(MAKE) distclean; then \
- true; \
- else \
- exit 1; \
- fi; \
- else \
- true; \
- fi; \
- else \
- exit 1; \
- fi; \
- else \
- true; \
- fi; \
- srcdiroption="--srcdir=."; \
- libsrcdir="."; \
- else \
srcdiroption="--srcdir=$${topdir}/libstdc++-v3"; \
libsrcdir="$$s/libstdc++-v3"; \
- fi; \
rm -f no-such-file || : ; \
CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
$(TARGET_CONFIGARGS) $${srcdiroption} \
@@ -22088,30 +22066,8 @@ configure-target-newlib: $(TARGET_SUBDIR)/newlib/multilib.out
*) topdir="../../$(srcdir)" ;; \
esac ;; \
esac; \
- if [ "$(srcdir)" = "." ] ; then \
- if [ "$(TARGET_SUBDIR)" != "." ] ; then \
- if $(SHELL) $$s/symlink-tree $${topdir}/newlib "no-such-file" ; then \
- if [ -f Makefile ]; then \
- if $(MAKE) distclean; then \
- true; \
- else \
- exit 1; \
- fi; \
- else \
- true; \
- fi; \
- else \
- exit 1; \
- fi; \
- else \
- true; \
- fi; \
- srcdiroption="--srcdir=."; \
- libsrcdir="."; \
- else \
srcdiroption="--srcdir=$${topdir}/newlib"; \
libsrcdir="$$s/newlib"; \
- fi; \
rm -f no-such-file || : ; \
CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
$(TARGET_CONFIGARGS) $${srcdiroption} \
@@ -22190,30 +22146,8 @@ configure-target-libf2c: $(TARGET_SUBDIR)/libf2c/multilib.out
*) topdir="../../$(srcdir)" ;; \
esac ;; \
esac; \
- if [ "$(srcdir)" = "." ] ; then \
- if [ "$(TARGET_SUBDIR)" != "." ] ; then \
- if $(SHELL) $$s/symlink-tree $${topdir}/libf2c "no-such-file" ; then \
- if [ -f Makefile ]; then \
- if $(MAKE) distclean; then \
- true; \
- else \
- exit 1; \
- fi; \
- else \
- true; \
- fi; \
- else \
- exit 1; \
- fi; \
- else \
- true; \
- fi; \
- srcdiroption="--srcdir=."; \
- libsrcdir="."; \
- else \
srcdiroption="--srcdir=$${topdir}/libf2c"; \
libsrcdir="$$s/libf2c"; \
- fi; \
rm -f no-such-file || : ; \
CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
$(TARGET_CONFIGARGS) $${srcdiroption} \
@@ -22292,30 +22226,8 @@ configure-target-libobjc: $(TARGET_SUBDIR)/libobjc/multilib.out
*) topdir="../../$(srcdir)" ;; \
esac ;; \
esac; \
- if [ "$(srcdir)" = "." ] ; then \
- if [ "$(TARGET_SUBDIR)" != "." ] ; then \
- if $(SHELL) $$s/symlink-tree $${topdir}/libobjc "no-such-file" ; then \
- if [ -f Makefile ]; then \
- if $(MAKE) distclean; then \
- true; \
- else \
- exit 1; \
- fi; \
- else \
- true; \
- fi; \
- else \
- exit 1; \
- fi; \
- else \
- true; \
- fi; \
- srcdiroption="--srcdir=."; \
- libsrcdir="."; \
- else \
srcdiroption="--srcdir=$${topdir}/libobjc"; \
libsrcdir="$$s/libobjc"; \
- fi; \
rm -f no-such-file || : ; \
CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
$(TARGET_CONFIGARGS) $${srcdiroption} \
@@ -22492,30 +22404,8 @@ configure-target-winsup: $(TARGET_SUBDIR)/winsup/multilib.out
*) topdir="../../$(srcdir)" ;; \
esac ;; \
esac; \
- if [ "$(srcdir)" = "." ] ; then \
- if [ "$(TARGET_SUBDIR)" != "." ] ; then \
- if $(SHELL) $$s/symlink-tree $${topdir}/winsup "no-such-file" ; then \
- if [ -f Makefile ]; then \
- if $(MAKE) distclean; then \
- true; \
- else \
- exit 1; \
- fi; \
- else \
- true; \
- fi; \
- else \
- exit 1; \
- fi; \
- else \
- true; \
- fi; \
- srcdiroption="--srcdir=."; \
- libsrcdir="."; \
- else \
srcdiroption="--srcdir=$${topdir}/winsup"; \
libsrcdir="$$s/winsup"; \
- fi; \
rm -f no-such-file || : ; \
CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
$(TARGET_CONFIGARGS) $${srcdiroption} \
@@ -22594,30 +22484,8 @@ configure-target-libgloss: $(TARGET_SUBDIR)/libgloss/multilib.out
*) topdir="../../$(srcdir)" ;; \
esac ;; \
esac; \
- if [ "$(srcdir)" = "." ] ; then \
- if [ "$(TARGET_SUBDIR)" != "." ] ; then \
- if $(SHELL) $$s/symlink-tree $${topdir}/libgloss "no-such-file" ; then \
- if [ -f Makefile ]; then \
- if $(MAKE) distclean; then \
- true; \
- else \
- exit 1; \
- fi; \
- else \
- true; \
- fi; \
- else \
- exit 1; \
- fi; \
- else \
- true; \
- fi; \
- srcdiroption="--srcdir=."; \
- libsrcdir="."; \
- else \
srcdiroption="--srcdir=$${topdir}/libgloss"; \
libsrcdir="$$s/libgloss"; \
- fi; \
rm -f no-such-file || : ; \
CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
$(TARGET_CONFIGARGS) $${srcdiroption} \
@@ -22692,30 +22560,8 @@ configure-target-libiberty: $(TARGET_SUBDIR)/libiberty/multilib.out
*) topdir="../../$(srcdir)" ;; \
esac ;; \
esac; \
- if [ "$(srcdir)" = "." ] ; then \
- if [ "$(TARGET_SUBDIR)" != "." ] ; then \
- if $(SHELL) $$s/symlink-tree $${topdir}/libiberty "no-such-file" ; then \
- if [ -f Makefile ]; then \
- if $(MAKE) distclean; then \
- true; \
- else \
- exit 1; \
- fi; \
- else \
- true; \
- fi; \
- else \
- exit 1; \
- fi; \
- else \
- true; \
- fi; \
- srcdiroption="--srcdir=."; \
- libsrcdir="."; \
- else \
srcdiroption="--srcdir=$${topdir}/libiberty"; \
libsrcdir="$$s/libiberty"; \
- fi; \
rm -f no-such-file || : ; \
CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
$(TARGET_CONFIGARGS) $${srcdiroption} \
@@ -22794,30 +22640,8 @@ configure-target-gperf: $(TARGET_SUBDIR)/gperf/multilib.out
*) topdir="../../$(srcdir)" ;; \
esac ;; \
esac; \
- if [ "$(srcdir)" = "." ] ; then \
- if [ "$(TARGET_SUBDIR)" != "." ] ; then \
- if $(SHELL) $$s/symlink-tree $${topdir}/gperf "no-such-file" ; then \
- if [ -f Makefile ]; then \
- if $(MAKE) distclean; then \
- true; \
- else \
- exit 1; \
- fi; \
- else \
- true; \
- fi; \
- else \
- exit 1; \
- fi; \
- else \
- true; \
- fi; \
- srcdiroption="--srcdir=."; \
- libsrcdir="."; \
- else \
srcdiroption="--srcdir=$${topdir}/gperf"; \
libsrcdir="$$s/gperf"; \
- fi; \
rm -f no-such-file || : ; \
CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
$(TARGET_CONFIGARGS) $${srcdiroption} \
@@ -22896,30 +22720,8 @@ configure-target-examples: $(TARGET_SUBDIR)/examples/multilib.out
*) topdir="../../$(srcdir)" ;; \
esac ;; \
esac; \
- if [ "$(srcdir)" = "." ] ; then \
- if [ "$(TARGET_SUBDIR)" != "." ] ; then \
- if $(SHELL) $$s/symlink-tree $${topdir}/examples "no-such-file" ; then \
- if [ -f Makefile ]; then \
- if $(MAKE) distclean; then \
- true; \
- else \
- exit 1; \
- fi; \
- else \
- true; \
- fi; \
- else \
- exit 1; \
- fi; \
- else \
- true; \
- fi; \
- srcdiroption="--srcdir=."; \
- libsrcdir="."; \
- else \
srcdiroption="--srcdir=$${topdir}/examples"; \
libsrcdir="$$s/examples"; \
- fi; \
rm -f no-such-file || : ; \
CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
$(TARGET_CONFIGARGS) $${srcdiroption} \
@@ -22990,30 +22792,8 @@ configure-target-libffi: $(TARGET_SUBDIR)/libffi/multilib.out
*) topdir="../../$(srcdir)" ;; \
esac ;; \
esac; \
- if [ "$(srcdir)" = "." ] ; then \
- if [ "$(TARGET_SUBDIR)" != "." ] ; then \
- if $(SHELL) $$s/symlink-tree $${topdir}/libffi "no-such-file" ; then \
- if [ -f Makefile ]; then \
- if $(MAKE) distclean; then \
- true; \
- else \
- exit 1; \
- fi; \
- else \
- true; \
- fi; \
- else \
- exit 1; \
- fi; \
- else \
- true; \
- fi; \
- srcdiroption="--srcdir=."; \
- libsrcdir="."; \
- else \
srcdiroption="--srcdir=$${topdir}/libffi"; \
libsrcdir="$$s/libffi"; \
- fi; \
rm -f no-such-file || : ; \
CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
$(TARGET_CONFIGARGS) $${srcdiroption} \
@@ -23093,30 +22873,8 @@ configure-target-libjava: $(TARGET_SUBDIR)/libjava/multilib.out
*) topdir="../../$(srcdir)" ;; \
esac ;; \
esac; \
- if [ "$(srcdir)" = "." ] ; then \
- if [ "$(TARGET_SUBDIR)" != "." ] ; then \
- if $(SHELL) $$s/symlink-tree $${topdir}/libjava "no-such-file" ; then \
- if [ -f Makefile ]; then \
- if $(MAKE) distclean; then \
- true; \
- else \
- exit 1; \
- fi; \
- else \
- true; \
- fi; \
- else \
- exit 1; \
- fi; \
- else \
- true; \
- fi; \
- srcdiroption="--srcdir=."; \
- libsrcdir="."; \
- else \
srcdiroption="--srcdir=$${topdir}/libjava"; \
libsrcdir="$$s/libjava"; \
- fi; \
rm -f no-such-file || : ; \
CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
$(TARGET_CONFIGARGS) $${srcdiroption} \
@@ -23297,30 +23055,8 @@ configure-target-boehm-gc: $(TARGET_SUBDIR)/boehm-gc/multilib.out
*) topdir="../../$(srcdir)" ;; \
esac ;; \
esac; \
- if [ "$(srcdir)" = "." ] ; then \
- if [ "$(TARGET_SUBDIR)" != "." ] ; then \
- if $(SHELL) $$s/symlink-tree $${topdir}/boehm-gc "no-such-file" ; then \
- if [ -f Makefile ]; then \
- if $(MAKE) distclean; then \
- true; \
- else \
- exit 1; \
- fi; \
- else \
- true; \
- fi; \
- else \
- exit 1; \
- fi; \
- else \
- true; \
- fi; \
- srcdiroption="--srcdir=."; \
- libsrcdir="."; \
- else \
srcdiroption="--srcdir=$${topdir}/boehm-gc"; \
libsrcdir="$$s/boehm-gc"; \
- fi; \
rm -f no-such-file || : ; \
CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
$(TARGET_CONFIGARGS) $${srcdiroption} \
@@ -23399,30 +23135,8 @@ configure-target-qthreads: $(TARGET_SUBDIR)/qthreads/multilib.out
*) topdir="../../$(srcdir)" ;; \
esac ;; \
esac; \
- if [ "$(srcdir)" = "." ] ; then \
- if [ "$(TARGET_SUBDIR)" != "." ] ; then \
- if $(SHELL) $$s/symlink-tree $${topdir}/qthreads "no-such-file" ; then \
- if [ -f Makefile ]; then \
- if $(MAKE) distclean; then \
- true; \
- else \
- exit 1; \
- fi; \
- else \
- true; \
- fi; \
- else \
- exit 1; \
- fi; \
- else \
- true; \
- fi; \
- srcdiroption="--srcdir=."; \
- libsrcdir="."; \
- else \
srcdiroption="--srcdir=$${topdir}/qthreads"; \
libsrcdir="$$s/qthreads"; \
- fi; \
rm -f no-such-file || : ; \
CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
$(TARGET_CONFIGARGS) $${srcdiroption} \
@@ -23501,30 +23215,8 @@ configure-target-rda: $(TARGET_SUBDIR)/rda/multilib.out
*) topdir="../../$(srcdir)" ;; \
esac ;; \
esac; \
- if [ "$(srcdir)" = "." ] ; then \
- if [ "$(TARGET_SUBDIR)" != "." ] ; then \
- if $(SHELL) $$s/symlink-tree $${topdir}/rda "no-such-file" ; then \
- if [ -f Makefile ]; then \
- if $(MAKE) distclean; then \
- true; \
- else \
- exit 1; \
- fi; \
- else \
- true; \
- fi; \
- else \
- exit 1; \
- fi; \
- else \
- true; \
- fi; \
- srcdiroption="--srcdir=."; \
- libsrcdir="."; \
- else \
srcdiroption="--srcdir=$${topdir}/rda"; \
libsrcdir="$$s/rda"; \
- fi; \
rm -f no-such-file || : ; \
CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
$(TARGET_CONFIGARGS) $${srcdiroption} \
diff --git a/Makefile.tpl b/Makefile.tpl
index 7a7e3eb..c82c818 100644
--- a/Makefile.tpl
+++ b/Makefile.tpl
@@ -983,7 +983,7 @@ ENDIF raw_cxx +]
.) topdir="../$(srcdir)" ;; \
*) topdir="../../$(srcdir)" ;; \
esac ;; \
- esac; \
+ esac; \[+ IF stage +]
if [ "$(srcdir)" = "." ] ; then \
if [ "$(TARGET_SUBDIR)" != "." ] ; then \
if $(SHELL) $$s/symlink-tree $${topdir}/[+module+] "no-such-file" ; then \
@@ -1004,10 +1004,10 @@ ENDIF raw_cxx +]
fi; \
srcdiroption="--srcdir=."; \
libsrcdir="."; \
- else \
+ else \[+ ENDIF stage +]
srcdiroption="--srcdir=$${topdir}/[+module+]"; \
- libsrcdir="$$s/[+module+]"; \
- fi; \
+ libsrcdir="$$s/[+module+]"; \[+ IF stage +]
+ fi; \[+ ENDIF stage +]
rm -f no-such-file || : ; \
CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
$(TARGET_CONFIGARGS) $${srcdiroption} \
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 811fb8f..72a2e2f 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,11 +1,84 @@
+2004-01-30 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elfxx-ia64.c (elfNN_ia64_relax_brl): New function.
+ (elfNN_ia64_relax_section): Optimize brl to br during the relax
+ finalize pass.
+
+2004-01-30 Alexandre Oliva <aoliva@redhat.com>
+
+ * elf32-frv.c (elf32_frv_always_size_sections): Initialize pointer
+ to bfd_link_hash_entry passed by reference to
+ _bfd_generic_link_add_one_symbol.
+
+2004-01-25 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elfxx-ia64.c (elfNN_ia64_relocate_section): Disallow imm
+ relocations against dynamic symbols.
+
+2004-01-23 Daniel Jacobowitz <drow@mvista.com>
+
+ * elf32-arm.h (elf32_arm_check_relocs): Revert part of 2004-01-13
+ change.
+
+2004-01-21 Tom Rix <tcrix@worldnet.att.net>
+
+ * reloc.c: New 5 bit reloc, BFD_RELOC_M68HC12_5B, for m68hc12 movb/movw.
+ * bfd-in2.h, libbfd.h: Rebuilt.
+
+2004-01-20 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Don't remove
+ IMAGE_SCN_MEM_WRITE flag from .text section if WP_TEXT
+ flag has been cleared.
+
+2004-01-19 Kazu Hirata <kazu@cs.umass.edu>
+
+ * coff-h8300.c: Add and adjust comments about relaxation.
+ * elf32-h8300.c: Likewise.
+
+2004-01-16 Kazu Hirata <kazu@cs.umass.edu>
+
+ * coff-h8300.c: Fix comment typos.
+ * elf32-h8300.c: Likewise.
+
+2004-01-16 Kazu Hirata <kazu@cs.umass.edu>
+
+ * coff-h8300.c: Add comments about relaxation.
+ * elf32-h8300.c: Likewise.
+
+2004-01-14 Maciej W. Rozycki <macro@ds2.pg.gda.pl>
+
+ * acinclude.m4: Quote names of macros to be defined by AC_DEFUN
+ throughout.
+ * aclocal.m4: Regenerate.
+ * configure: Regenerate.
+
+2004-01-13 Ian Lance Taylor <ian@wasabisystems.com>
+
+ * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Call
+ mips_elf64_rtype_to_howto instead of using howto_table.
+
+2004-01-13 Daniel Jacobowitz <drow@mvista.com>
+
+ * elf32-arm.h (elf32_arm_final_link_relocate): Check that we created
+ the .plt section.
+ (elf32_arm_check_relocs): Don't increment the PLT refcount for
+ relocs which would not use the PLT.
+
+2004-01-13 Alan Modra <amodra@bigpond.net.au>
+
+ * elf64-ppc.c (ppc64_elf_check_relocs): Ignore !SEC_ALLOC relocs.
+ (ppc64_elf_gc_sweep_hook): Likewise.
+ (ppc64_elf_size_dynamic_sections): Test for .plt directly.
+
2004-01-12 Anil Paranjpe <anilp1@KPITCummins.com>
Adds linker relaxation support for bit manipulation insns like
- band, bclr, biand, bild, bior, bist, bixor, bld, bnot, bor, bset,
+ band, bclr, biand, bild, bior, bist, bixor, bld, bnot, bor, bset,
bst, btst, bxor.
- * elf32-h8300.c : Opcode for bit manipulation insn is checked in
+ * elf32-h8300.c: Opcode for bit manipulation insn is checked in
elf32_h8_relax_section function while relxation for aa:16 and aa:32.
- * coff-h8300.c : Opcode for bit manipulation insn is checked in
+ * coff-h8300.c: Opcode for bit manipulation insn is checked in
h8300_reloc16_extra_cases function while relxation for aa:16 and aa:32.
2004-01-12 Alan Modra <amodra@bigpond.net.au>
diff --git a/bfd/acinclude.m4 b/bfd/acinclude.m4
index b1bd1be..63b4bf9 100644
--- a/bfd/acinclude.m4
+++ b/bfd/acinclude.m4
@@ -1,7 +1,7 @@
sinclude(../config/accross.m4)
dnl See whether we need to use fopen-bin.h rather than fopen-same.h.
-AC_DEFUN(BFD_BINARY_FOPEN,
+AC_DEFUN([BFD_BINARY_FOPEN],
[AC_REQUIRE([AC_CANONICAL_SYSTEM])
case "${host}" in
changequote(,)dnl
@@ -11,7 +11,7 @@ changequote([,])dnl
esac])dnl
dnl Get a default for CC_FOR_BUILD to put into Makefile.
-AC_DEFUN(BFD_CC_FOR_BUILD,
+AC_DEFUN([BFD_CC_FOR_BUILD],
[# Put a plausible default for CC_FOR_BUILD in Makefile.
if test -z "$CC_FOR_BUILD"; then
if test "x$cross_compiling" = "xno"; then
@@ -44,7 +44,7 @@ fi
AC_SUBST(EXEEXT_FOR_BUILD)])dnl
dnl See whether we need a declaration for a function.
-AC_DEFUN(BFD_NEED_DECLARATION,
+AC_DEFUN([BFD_NEED_DECLARATION],
[AC_MSG_CHECKING([whether $1 must be declared])
AC_CACHE_VAL(bfd_cv_decl_needed_$1,
[AC_TRY_COMPILE([
@@ -73,7 +73,7 @@ fi
dnl Check for existence of a type $1 in sys/procfs.h
-AC_DEFUN(BFD_HAVE_SYS_PROCFS_TYPE,
+AC_DEFUN([BFD_HAVE_SYS_PROCFS_TYPE],
[AC_MSG_CHECKING([for $1 in sys/procfs.h])
AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_$1,
[AC_TRY_COMPILE([
@@ -93,7 +93,7 @@ AC_DEFUN(BFD_HAVE_SYS_PROCFS_TYPE,
dnl Check for existence of member $2 in type $1 in sys/procfs.h
-AC_DEFUN(BFD_HAVE_SYS_PROCFS_TYPE_MEMBER,
+AC_DEFUN([BFD_HAVE_SYS_PROCFS_TYPE_MEMBER],
[AC_MSG_CHECKING([for $1.$2 in sys/procfs.h])
AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_member_$1_$2,
[AC_TRY_COMPILE([
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 4cc59e0..f66c29c 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -3377,6 +3377,10 @@ value and a 8-bit page number. The symbol address is transformed
to follow the 16K memory bank of 68HC12 (seen as mapped in the window). */
BFD_RELOC_M68HC11_24,
+/* Motorola 68HC12 reloc.
+This is the 5 bits of a value. */
+ BFD_RELOC_M68HC12_5B,
+
/* These relocs are only used within the CRIS assembler. They are not
(at present) written to any object files. */
BFD_RELOC_CRIS_BDISP8,
diff --git a/bfd/coff-h8300.c b/bfd/coff-h8300.c
index dc35ea9..bd798a6 100644
--- a/bfd/coff-h8300.c
+++ b/bfd/coff-h8300.c
@@ -265,8 +265,8 @@ static reloc_howto_type howto_table[] = {
the function vector's entry in the jsr instruction. */
HOWTO (R_MEM_INDIRECT, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, special, "8/indirect", FALSE, 0x000000ff, 0x000000ff, FALSE),
- /* Internal reloc for relaxing. This is created when a 16bit pc-relative
- branch is turned into an 8bit pc-relative branch. */
+ /* Internal reloc for relaxing. This is created when a 16-bit pc-relative
+ branch is turned into an 8-bit pc-relative branch. */
HOWTO (R_PCRWORD_B, 0, 0, 8, TRUE, 0, complain_overflow_bitfield, special, "relaxed bCC:16", FALSE, 0x000000ff, 0x000000ff, FALSE),
HOWTO (R_MOVL1, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,special, "32/24 relaxable move", FALSE, 0xffffffff, 0xffffffff, FALSE),
@@ -458,8 +458,8 @@ h8300_reloc16_estimate (bfd *abfd, asection *input_section, arelent *reloc,
/* Only examine the relocs which might be relaxable. */
switch (reloc->howto->type)
{
- /* This is the 16/24 bit absolute branch which could become an 8 bit
- pc-relative branch. */
+ /* This is the 16-/24-bit absolute branch which could become an
+ 8-bit pc-relative branch. */
case R_JMP1:
case R_JMPL1:
/* Get the address of the target of this branch. */
@@ -547,7 +547,7 @@ h8300_reloc16_estimate (bfd *abfd, asection *input_section, arelent *reloc,
}
break;
- /* This is the 16 bit pc-relative branch which could become an 8 bit
+ /* This is the 16-bit pc-relative branch which could become an 8-bit
pc-relative branch. */
case R_PCRWORD:
/* Get the address of the target of this branch, add one to the value
@@ -575,8 +575,8 @@ h8300_reloc16_estimate (bfd *abfd, asection *input_section, arelent *reloc,
}
break;
- /* This is a 16 bit absolute address in a mov.b insn, which can
- become an 8 bit absolute address if it's in the right range. */
+ /* This is a 16-bit absolute address in a mov.b insn, which can
+ become an 8-bit absolute address if it's in the right range. */
case R_MOV16B1:
/* Get the address of the data referenced by this mov.b insn. */
value = bfd_coff_reloc16_get_value (reloc, link_info, input_section);
@@ -595,9 +595,9 @@ h8300_reloc16_estimate (bfd *abfd, asection *input_section, arelent *reloc,
}
break;
- /* Similarly for a 24 bit absolute address in a mov.b. Note that
- if we can't relax this into an 8 bit absolute, we'll fall through
- and try to relax it into a 16bit absolute. */
+ /* Similarly for a 24-bit absolute address in a mov.b. Note that
+ if we can't relax this into an 8-bit absolute, we'll fall through
+ and try to relax it into a 16-bit absolute. */
case R_MOV24B1:
/* Get the address of the data referenced by this mov.b insn. */
value = bfd_coff_reloc16_get_value (reloc, link_info, input_section);
@@ -616,11 +616,11 @@ h8300_reloc16_estimate (bfd *abfd, asection *input_section, arelent *reloc,
break;
}
- /* FALLTHROUGH and try to turn the 32/24 bit reloc into a 16 bit
+ /* FALLTHROUGH and try to turn the 24-/32-bit reloc into a 16-bit
reloc. */
- /* This is a 24/32 bit absolute address in a mov insn, which can
- become an 16 bit absolute address if it's in the right range. */
+ /* This is a 24-/32-bit absolute address in a mov insn, which can
+ become an 16-bit absolute address if it's in the right range. */
case R_MOVL1:
/* Get the address of the data referenced by this mov insn. */
value = bfd_coff_reloc16_get_value (reloc, link_info, input_section);
@@ -670,7 +670,7 @@ h8300_reloc16_extra_cases (bfd *abfd, struct bfd_link_info *link_info,
switch (reloc->howto->type)
{
- /* Generic 8bit pc-relative relocation. */
+ /* Generic 8-bit pc-relative relocation. */
case R_PCRBYTE:
/* Get the address of the target of this branch. */
value = bfd_coff_reloc16_get_value (reloc, link_info, input_section);
@@ -700,7 +700,7 @@ h8300_reloc16_extra_cases (bfd *abfd, struct bfd_link_info *link_info,
/* All done. */
break;
- /* Generic 16bit pc-relative relocation. */
+ /* Generic 16-bit pc-relative relocation. */
case R_PCRWORD:
/* Get the address of the target of this branch. */
value = bfd_coff_reloc16_get_value (reloc, link_info, input_section);
@@ -731,7 +731,7 @@ h8300_reloc16_extra_cases (bfd *abfd, struct bfd_link_info *link_info,
/* All done. */
break;
- /* Generic 8bit absolute relocation. */
+ /* Generic 8-bit absolute relocation. */
case R_RELBYTE:
/* Get the address of the object referenced by this insn. */
value = bfd_coff_reloc16_get_value (reloc, link_info, input_section);
@@ -743,7 +743,7 @@ h8300_reloc16_extra_cases (bfd *abfd, struct bfd_link_info *link_info,
/* All done. */
break;
- /* Various simple 16bit absolute relocations. */
+ /* Various simple 16-bit absolute relocations. */
case R_MOV16B1:
case R_JMP1:
case R_RELWORD:
@@ -753,7 +753,7 @@ h8300_reloc16_extra_cases (bfd *abfd, struct bfd_link_info *link_info,
src_address += 2;
break;
- /* Various simple 24/32bit absolute relocations. */
+ /* Various simple 24-/32-bit absolute relocations. */
case R_MOV24B1:
case R_MOVL1:
case R_RELLONG:
@@ -764,7 +764,7 @@ h8300_reloc16_extra_cases (bfd *abfd, struct bfd_link_info *link_info,
src_address += 4;
break;
- /* Another 24/32bit absolute relocation. */
+ /* Another 24-/32-bit absolute relocation. */
case R_JMPL1:
/* Get the address of the target of this branch. */
value = bfd_coff_reloc16_get_value (reloc, link_info, input_section);
@@ -776,8 +776,15 @@ h8300_reloc16_extra_cases (bfd *abfd, struct bfd_link_info *link_info,
src_address += 4;
break;
- /* A 16bit absolute relocation that was formerly a 24/32bit
- absolute relocation. */
+ /* This is a 24-/32-bit absolute address in one of the following
+ instructions:
+
+ "band", "bclr", "biand", "bild", "bior", "bist", "bixor",
+ "bld", "bnot", "bor", "bset", "bst", "btst", "bxor", and
+ "mov.[bwl]"
+
+ We may relax this into an 16-bit absolute address if it's in
+ the right range. */
case R_MOVL2:
value = bfd_coff_reloc16_get_value (reloc, link_info, input_section);
value = bfd_h8300_pad_address (abfd, value);
@@ -785,11 +792,12 @@ h8300_reloc16_extra_cases (bfd *abfd, struct bfd_link_info *link_info,
/* Sanity check. */
if (value <= 0x7fff || value >= 0xffff8000u)
{
- /* Insert the 16bit value into the proper location. */
+ /* Insert the 16-bit value into the proper location. */
bfd_put_16 (abfd, value, data + dst_address);
- /* Fix the opcode. For all the move insns, we simply
- need to turn off bit 0x20 in the previous byte. */
+ /* Fix the opcode. For all the instructions that belong to
+ this relaxation, we simply need to turn off bit 0x20 in
+ the previous byte. */
data[dst_address - 1] &= ~0x20;
dst_address += 2;
src_address += 4;
@@ -804,7 +812,7 @@ h8300_reloc16_extra_cases (bfd *abfd, struct bfd_link_info *link_info,
}
break;
- /* A 16bit absolute branch that is now an 8-bit pc-relative branch. */
+ /* A 16-bit absolute branch that is now an 8-bit pc-relative branch. */
case R_JMP2:
/* Get the address of the target of this branch. */
value = bfd_coff_reloc16_get_value (reloc, link_info, input_section);
@@ -834,7 +842,7 @@ h8300_reloc16_extra_cases (bfd *abfd, struct bfd_link_info *link_info,
bfd_put_8 (abfd, 0x55, data + dst_address - 1);
break;
case 0x5a:
- /* jmp ->bra */
+ /* jmp -> bra */
bfd_put_8 (abfd, 0x40, data + dst_address - 1);
break;
@@ -842,7 +850,7 @@ h8300_reloc16_extra_cases (bfd *abfd, struct bfd_link_info *link_info,
abort ();
}
- /* Write out the 8bit value. */
+ /* Write out the 8-bit value. */
bfd_put_8 (abfd, gap, data + dst_address);
dst_address += 1;
@@ -850,7 +858,7 @@ h8300_reloc16_extra_cases (bfd *abfd, struct bfd_link_info *link_info,
break;
- /* A 16bit pc-relative branch that is now an 8-bit pc-relative branch. */
+ /* A 16-bit pc-relative branch that is now an 8-bit pc-relative branch. */
case R_PCRWORD_B:
/* Get the address of the target of this branch. */
value = bfd_coff_reloc16_get_value (reloc, link_info, input_section);
@@ -877,12 +885,15 @@ h8300_reloc16_extra_cases (bfd *abfd, struct bfd_link_info *link_info,
{
case 0x58:
/* bCC:16 -> bCC:8 */
- /* Get the condition code from the original insn. */
+ /* Get the second byte of the original insn, which contains
+ the condition code. */
tmp = data[dst_address - 1];
+
+ /* Compute the fisrt byte of the relaxed instruction. The
+ original sequence 0x58 0xX0 is relaxed to 0x4X, where X
+ represents the condition code. */
tmp &= 0xf0;
tmp >>= 4;
-
- /* Now or in the high nibble of the opcode. */
tmp |= 0x40;
/* Write it. */
@@ -901,13 +912,13 @@ h8300_reloc16_extra_cases (bfd *abfd, struct bfd_link_info *link_info,
/* Output the target. */
bfd_put_8 (abfd, gap, data + dst_address - 1);
- /* We don't advance dst_address -- the 8bit reloc is applied at
+ /* We don't advance dst_address -- the 8-bit reloc is applied at
dst_address - 1, so the next insn should begin at dst_address. */
src_address += 2;
break;
- /* Similarly for a 24bit absolute that is now 8 bits. */
+ /* Similarly for a 24-bit absolute that is now 8 bits. */
case R_JMPL2:
/* Get the address of the target of this branch. */
value = bfd_coff_reloc16_get_value (reloc, link_info, input_section);
@@ -940,15 +951,26 @@ h8300_reloc16_extra_cases (bfd *abfd, struct bfd_link_info *link_info,
break;
- /* A 16bit absolute mov.b that is now an 8bit absolute mov.b. */
+ /* This is a 16-bit absolute address in one of the following
+ instructions:
+
+ "band", "bclr", "biand", "bild", "bior", "bist", "bixor",
+ "bld", "bnot", "bor", "bset", "bst", "btst", "bxor", and
+ "mov.b"
+
+ We may relax this into an 8-bit absolute address if it's in
+ the right range. */
case R_MOV16B2:
value = bfd_coff_reloc16_get_value (reloc, link_info, input_section);
- /* Sanity check. */
+ /* All instructions with R_H8_DIR16B2 start with 0x6a. */
if (data[dst_address - 2] != 0x6a)
abort ();
temp_code = data[src_address - 1];
+
+ /* If this is a mov.b instruction, clear the lower nibble, which
+ contains the source/destination register number. */
if ((temp_code & 0x10) != 0x10)
temp_code &= 0xf0;
@@ -956,15 +978,23 @@ h8300_reloc16_extra_cases (bfd *abfd, struct bfd_link_info *link_info,
switch (temp_code)
{
case 0x00:
+ /* This is mov.b @aa:16,Rd. */
data[dst_address - 2] = (data[src_address - 1] & 0xf) | 0x20;
break;
case 0x80:
+ /* This is mov.b Rs,@aa:16. */
data[dst_address - 2] = (data[src_address - 1] & 0xf) | 0x30;
break;
case 0x18:
+ /* This is a bit-maniputation instruction that stores one
+ bit into memory, one of "bclr", "bist", "bnot", "bset",
+ and "bst". */
data[dst_address - 2] = 0x7f;
break;
case 0x10:
+ /* This is a bit-maniputation instruction that loads one bit
+ from memory, one of "band", "biand", "bild", "bior",
+ "bixor", "bld", "bor", "btst", and "bxor". */
data[dst_address - 2] = 0x7e;
break;
default:
@@ -975,15 +1005,26 @@ h8300_reloc16_extra_cases (bfd *abfd, struct bfd_link_info *link_info,
src_address += 2;
break;
- /* Similarly for a 24bit mov.b */
+ /* This is a 24-bit absolute address in one of the following
+ instructions:
+
+ "band", "bclr", "biand", "bild", "bior", "bist", "bixor",
+ "bld", "bnot", "bor", "bset", "bst", "btst", "bxor", and
+ "mov.b"
+
+ We may relax this into an 8-bit absolute address if it's in
+ the right range. */
case R_MOV24B2:
value = bfd_coff_reloc16_get_value (reloc, link_info, input_section);
- /* Sanity check. */
+ /* All instructions with R_MOV24B2 start with 0x6a. */
if (data[dst_address - 2] != 0x6a)
abort ();
temp_code = data[src_address - 1];
+
+ /* If this is a mov.b instruction, clear the lower nibble, which
+ contains the source/destination register number. */
if ((temp_code & 0x30) != 0x30)
temp_code &= 0xf0;
@@ -991,15 +1032,23 @@ h8300_reloc16_extra_cases (bfd *abfd, struct bfd_link_info *link_info,
switch (temp_code)
{
case 0x20:
+ /* This is mov.b @aa:24/32,Rd. */
data[dst_address - 2] = (data[src_address - 1] & 0xf) | 0x20;
break;
case 0xa0:
+ /* This is mov.b Rs,@aa:24/32. */
data[dst_address - 2] = (data[src_address - 1] & 0xf) | 0x30;
break;
case 0x38:
+ /* This is a bit-maniputation instruction that stores one
+ bit into memory, one of "bclr", "bist", "bnot", "bset",
+ and "bst". */
data[dst_address - 2] = 0x7f;
break;
case 0x30:
+ /* This is a bit-maniputation instruction that loads one bit
+ from memory, one of "band", "biand", "bild", "bior",
+ "bixor", "bld", "bor", "btst", and "bxor". */
data[dst_address - 2] = 0x7e;
break;
default:
@@ -1046,7 +1095,7 @@ h8300_reloc16_extra_cases (bfd *abfd, struct bfd_link_info *link_info,
src_address += 4;
break;
- /* An 8bit memory indirect instruction (jmp/jsr).
+ /* An 8-bit memory indirect instruction (jmp/jsr).
There's several things that need to be done to handle
this relocation.
diff --git a/bfd/elf32-arm.h b/bfd/elf32-arm.h
index a684546..7c284c1 100644
--- a/bfd/elf32-arm.h
+++ b/bfd/elf32-arm.h
@@ -1317,9 +1317,12 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd,
branches in this object should go to it. */
if ((r_type != R_ARM_ABS32 && r_type != R_ARM_REL32)
&& h != NULL
+ && splt != NULL
&& h->plt.offset != (bfd_vma) -1)
{
- BFD_ASSERT (splt != NULL);
+ /* If we've created a .plt section, and assigned a PLT entry to
+ this function, it should not be known to bind locally. If
+ it were, we would have cleared the PLT entry. */
BFD_ASSERT (!SYMBOL_CALLS_LOCAL (info, h));
value = (splt->output_section->vma
@@ -2937,11 +2940,15 @@ elf32_arm_check_relocs (abfd, info, sec, relocs)
h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF;
/* We may need a .plt entry if the function this reloc
- refers to is in a different object. */
+ refers to is in a different object. We can't tell for
+ sure yet, because something later might force the
+ symbol local. */
if (ELF32_R_TYPE (rel->r_info) == R_ARM_PC24
|| ELF32_R_TYPE (rel->r_info) == R_ARM_PLT32)
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
+ /* If we create a PLT entry, this relocation will reference
+ it, even if it's an ABS32 relocation. */
h->plt.refcount += 1;
}
diff --git a/bfd/elf32-frv.c b/bfd/elf32-frv.c
index 016f233..488438e 100644
--- a/bfd/elf32-frv.c
+++ b/bfd/elf32-frv.c
@@ -3454,7 +3454,7 @@ elf32_frv_always_size_sections (bfd *output_bfd,
|| h->type != STT_OBJECT
|| !(h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
{
- struct bfd_link_hash_entry *bh;
+ struct bfd_link_hash_entry *bh = NULL;
if (!(_bfd_generic_link_add_one_symbol
(info, output_bfd, "__stacksize",
diff --git a/bfd/elf32-h8300.c b/bfd/elf32-h8300.c
index c803af1..1a17621 100644
--- a/bfd/elf32-h8300.c
+++ b/bfd/elf32-h8300.c
@@ -348,7 +348,7 @@ elf32_h8_final_link_relocate (unsigned long r_type, bfd *input_bfd,
value += addend;
/* HIT_DATA is the address for the first byte for the relocated
- value. Subtract 1 so that we can manipulate the data in 32bit
+ value. Subtract 1 so that we can manipulate the data in 32-bit
hunks. */
hit_data--;
@@ -358,7 +358,7 @@ elf32_h8_final_link_relocate (unsigned long r_type, bfd *input_bfd,
/* Retrieve the type byte for value from the section contents. */
value |= (bfd_get_32 (input_bfd, hit_data) & 0xff000000);
- /* Now scribble it out in one 32bit hunk. */
+ /* Now scribble it out in one 32-bit hunk. */
bfd_put_32 (input_bfd, value, hit_data);
return bfd_reloc_ok;
@@ -659,9 +659,16 @@ elf32_h8_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
bCC:16 -> bCC:8 2 bytes
bsr:16 -> bsr:8 2 bytes
+ bset:16 -> bset:8 2 bytes
+ bset:24/32 -> bset:8 4 bytes
+ (also applicable to other bit manipulation instructions)
+
mov.b:16 -> mov.b:8 2 bytes
mov.b:24/32 -> mov.b:8 4 bytes
+ bset:24/32 -> bset:16 2 bytes
+ (also applicable to other bit manipulation instructions)
+
mov.[bwl]:24/32 -> mov.[bwl]:16 2 bytes */
static bfd_boolean
@@ -804,7 +811,7 @@ elf32_h8_relax_section (bfd *abfd, asection *sec,
the linker is run. */
switch (ELF32_R_TYPE (irel->r_info))
{
- /* Try to turn a 24 bit absolute branch/call into an 8 bit
+ /* Try to turn a 24-bit absolute branch/call into an 8-bit
pc-relative branch/call. */
case R_H8_DIR24R8:
{
@@ -915,8 +922,10 @@ elf32_h8_relax_section (bfd *abfd, asection *sec,
}
if (code == 0x5e)
+ /* This is jsr. */
bfd_put_8 (abfd, 0x55, contents + irel->r_offset - 1);
else if (code == 0x5a)
+ /* This is jmp. */
bfd_put_8 (abfd, 0x40, contents + irel->r_offset - 1);
else
abort ();
@@ -937,7 +946,7 @@ elf32_h8_relax_section (bfd *abfd, asection *sec,
break;
}
- /* Try to turn a 16bit pc-relative branch into a 8bit pc-relative
+ /* Try to turn a 16-bit pc-relative branch into a 8-bit pc-relative
branch. */
case R_H8_PCREL16:
{
@@ -971,14 +980,21 @@ elf32_h8_relax_section (bfd *abfd, asection *sec,
if (code == 0x58)
{
/* bCC:16 -> bCC:8 */
- /* Get the condition code from the original insn. */
+ /* Get the second byte of the original insn, which
+ contains the condition code. */
code = bfd_get_8 (abfd, contents + irel->r_offset - 1);
+
+ /* Compute the fisrt byte of the relaxed
+ instruction. The original sequence 0x58 0xX0
+ is relaxed to 0x4X, where X represents the
+ condition code. */
code &= 0xf0;
code >>= 4;
code |= 0x40;
bfd_put_8 (abfd, code, contents + irel->r_offset - 2);
}
else if (code == 0x5c)
+ /* This is bsr. */
bfd_put_8 (abfd, 0x55, contents + irel->r_offset - 2);
else
abort ();
@@ -1000,8 +1016,15 @@ elf32_h8_relax_section (bfd *abfd, asection *sec,
break;
}
- /* This is a 16 bit absolute address in a "mov.b" insn, which may
- become an 8 bit absolute address if its in the right range. */
+ /* This is a 16-bit absolute address in one of the following
+ instructions:
+
+ "band", "bclr", "biand", "bild", "bior", "bist", "bixor",
+ "bld", "bnot", "bor", "bset", "bst", "btst", "bxor", and
+ "mov.b"
+
+ We may relax this into an 8-bit absolute address if it's in
+ the right range. */
case R_H8_DIR16A8:
{
bfd_vma value;
@@ -1021,28 +1044,41 @@ elf32_h8_relax_section (bfd *abfd, asection *sec,
/* Get the opcode. */
code = bfd_get_8 (abfd, contents + irel->r_offset - 2);
- /* Sanity check. */
+ /* All instructions with R_H8_DIR16A8 start with
+ 0x6a. */
if (code != 0x6a)
abort ();
temp_code = code = bfd_get_8 (abfd, contents + irel->r_offset - 1);
+ /* If this is a mov.b instruction, clear the lower
+ nibble, which contains the source/destination
+ register number. */
if ((temp_code & 0x10) != 0x10)
temp_code &= 0xf0;
switch (temp_code)
{
case 0x00:
+ /* This is mov.b @aa:16,Rd. */
bfd_put_8 (abfd, (code & 0xf) | 0x20,
contents + irel->r_offset - 2);
break;
case 0x80:
+ /* This is mov.b Rs,@aa:16. */
bfd_put_8 (abfd, (code & 0xf) | 0x30,
contents + irel->r_offset - 2);
break;
case 0x18:
+ /* This is a bit-maniputation instruction that
+ stores one bit into memory, one of "bclr",
+ "bist", "bnot", "bset", and "bst". */
bfd_put_8 (abfd, 0x7f, contents + irel->r_offset - 2);
break;
case 0x10:
+ /* This is a bit-maniputation instruction that
+ loads one bit from memory, one of "band",
+ "biand", "bild", "bior", "bixor", "bld", "bor",
+ "btst", and "bxor". */
bfd_put_8 (abfd, 0x7e, contents + irel->r_offset - 2);
break;
default:
@@ -1068,8 +1104,15 @@ elf32_h8_relax_section (bfd *abfd, asection *sec,
break;
}
- /* This is a 24 bit absolute address in a "mov.b" insn, which may
- become an 8 bit absolute address if its in the right range. */
+ /* This is a 24-bit absolute address in one of the following
+ instructions:
+
+ "band", "bclr", "biand", "bild", "bior", "bist", "bixor",
+ "bld", "bnot", "bor", "bset", "bst", "btst", "bxor", and
+ "mov.b"
+
+ We may relax this into an 8-bit absolute address if it's in
+ the right range. */
case R_H8_DIR24A8:
{
bfd_vma value;
@@ -1089,29 +1132,42 @@ elf32_h8_relax_section (bfd *abfd, asection *sec,
/* Get the opcode. */
code = bfd_get_8 (abfd, contents + irel->r_offset - 2);
- /* Sanity check. */
+ /* All instructions with R_H8_DIR24A8 start with
+ 0x6a. */
if (code != 0x6a)
abort ();
temp_code = code = bfd_get_8 (abfd, contents + irel->r_offset - 1);
+ /* If this is a mov.b instruction, clear the lower
+ nibble, which contains the source/destination
+ register number. */
if ((temp_code & 0x30) != 0x30)
temp_code &= 0xf0;
switch (temp_code)
{
case 0x20:
+ /* This is mov.b @aa:24/32,Rd. */
bfd_put_8 (abfd, (code & 0xf) | 0x20,
contents + irel->r_offset - 2);
break;
case 0xa0:
+ /* This is mov.b Rs,@aa:24/32. */
bfd_put_8 (abfd, (code & 0xf) | 0x30,
contents + irel->r_offset - 2);
break;
case 0x38:
+ /* This is a bit-maniputation instruction that
+ stores one bit into memory, one of "bclr",
+ "bist", "bnot", "bset", and "bst". */
bfd_put_8 (abfd, 0x7f, contents + irel->r_offset - 2);
break;
case 0x30:
+ /* This is a bit-maniputation instruction that
+ loads one bit from memory, one of "band",
+ "biand", "bild", "bior", "bixor", "bld", "bor",
+ "btst", and "bxor". */
bfd_put_8 (abfd, 0x7e, contents + irel->r_offset - 2);
break;
default:
@@ -1135,10 +1191,17 @@ elf32_h8_relax_section (bfd *abfd, asection *sec,
}
}
- /* Fall through. */
+ /* Fall through. */
+
+ /* This is a 24-/32-bit absolute address in one of the
+ following instructions:
+
+ "band", "bclr", "biand", "bild", "bior", "bist",
+ "bixor", "bld", "bnot", "bor", "bset", "bst", "btst",
+ "bxor", and "mov.[bwl]"
- /* This is a 24/32bit absolute address in a "mov" insn, which may
- become a 16-bit absolute address if it is in the right range. */
+ We may relax this into an 16-bit absolute address if it's
+ in the right range. */
case R_H8_DIR32A16:
{
bfd_vma value;
@@ -1157,7 +1220,9 @@ elf32_h8_relax_section (bfd *abfd, asection *sec,
/* Get the opcode. */
code = bfd_get_8 (abfd, contents + irel->r_offset - 1);
- /* We just need to turn off bit 0x20. */
+ /* Fix the opcode. For all the instructions that
+ belong to this relaxation, we simply need to turn
+ off bit 0x20 in the previous byte. */
code &= ~0x20;
bfd_put_8 (abfd, code, contents + irel->r_offset - 1);
diff --git a/bfd/elf64-mips.c b/bfd/elf64-mips.c
index 71c3425..fa3b494 100644
--- a/bfd/elf64-mips.c
+++ b/bfd/elf64-mips.c
@@ -2015,7 +2015,7 @@ mips_elf64_slurp_one_reloc_table (bfd *abfd, asection *asect,
arelent *relent;
bfd_vma i;
int entsize;
- reloc_howto_type *howto_table;
+ bfd_boolean rela_p;
allocated = bfd_malloc (rel_hdr->sh_size);
if (allocated == NULL)
@@ -2033,9 +2033,9 @@ mips_elf64_slurp_one_reloc_table (bfd *abfd, asection *asect,
|| entsize == sizeof (Elf64_Mips_External_Rela));
if (entsize == sizeof (Elf64_Mips_External_Rel))
- howto_table = mips_elf64_howto_table_rel;
+ rela_p = FALSE;
else
- howto_table = mips_elf64_howto_table_rela;
+ rela_p = TRUE;
for (i = 0, relent = relents;
i < reloc_count;
@@ -2148,7 +2148,7 @@ mips_elf64_slurp_one_reloc_table (bfd *abfd, asection *asect,
relent->addend = rela.r_addend;
- relent->howto = &howto_table[(int) type];
+ relent->howto = mips_elf64_rtype_to_howto (type, rela_p);
++relent;
}
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index 3ed9042..304a635 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -3590,6 +3590,15 @@ ppc64_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
if (info->relocatable)
return TRUE;
+ /* Don't do anything special with non-loaded, non-alloced sections.
+ In particular, any relocs in such sections should not affect GOT
+ and PLT reference counting (ie. we don't allow them to create GOT
+ or PLT entries), there's no possibility or desire to optimize TLS
+ relocs, and there's not much point in propagating relocs to shared
+ libs that the dynamic linker won't relocate. */
+ if ((sec->flags & SEC_ALLOC) == 0)
+ return TRUE;
+
htab = ppc_hash_table (info);
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
@@ -3947,10 +3956,6 @@ ppc64_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
if (NO_OPD_RELOCS && opd_sym_map != NULL)
break;
- /* Don't propagate relocs that the dynamic linker won't relocate. */
- if ((sec->flags & SEC_ALLOC) == 0)
- break;
-
/* If we are creating a shared library, and this is a reloc
against a global symbol, or a non PC relative reloc
against a local symbol, then we need to copy the reloc
@@ -4166,6 +4171,9 @@ ppc64_elf_gc_sweep_hook (bfd *abfd, struct bfd_link_info *info,
struct got_entry **local_got_ents;
const Elf_Internal_Rela *rel, *relend;
+ if ((sec->flags & SEC_ALLOC) == 0)
+ return TRUE;
+
elf_section_data (sec)->local_dynrel = NULL;
htab = ppc_hash_table (info);
@@ -6001,7 +6009,7 @@ ppc64_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
}
/* .plt is in the bss section. We don't initialise it. */
- if ((s->flags & SEC_LOAD) == 0)
+ if (s == htab->plt)
continue;
/* Allocate memory for the section contents. We use bfd_zalloc
diff --git a/bfd/elfxx-ia64.c b/bfd/elfxx-ia64.c
index c699922..e223a10 100644
--- a/bfd/elfxx-ia64.c
+++ b/bfd/elfxx-ia64.c
@@ -672,6 +672,36 @@ bfd_elfNN_ia64_after_parse (int itanium)
oor_branch_size = itanium ? sizeof (oor_ip) : sizeof (oor_brl);
}
+static void
+elfNN_ia64_relax_brl (bfd *abfd, bfd_byte *contents, bfd_vma off)
+{
+ int template;
+ bfd_byte *hit_addr;
+ bfd_vma t0, t1, i0, i1, i2;
+
+ hit_addr = (bfd_byte *) (contents + off);
+ hit_addr -= (long) hit_addr & 0x3;
+ t0 = bfd_get_64 (abfd, hit_addr);
+ t1 = bfd_get_64 (abfd, hit_addr + 8);
+
+ /* Keep the instruction in slot 0. */
+ i0 = (t0 >> 5) & 0x1ffffffffffLL;
+ /* Use nop.b for slot 1. */
+ i1 = 0x4000000000LL;
+ /* For slot 2, turn brl into br by masking out bit 40. */
+ i2 = (t1 >> 23) & 0x0ffffffffffLL;
+
+ /* Turn a MLX bundle into a MBB bundle with the same stop-bit
+ variety. */
+ template = 0x12;
+ if ((t0 & 0x1fLL) == 5)
+ template += 1;
+ t0 = (i1 << 46) | (i0 << 5) | template;
+ t1 = (i2 << 23) | (i1 >> 18);
+
+ bfd_put_64 (abfd, t0, hit_addr);
+ bfd_put_64 (abfd, t1, hit_addr + 8);
+}
/* These functions do relaxation for IA-64 ELF. */
@@ -765,13 +795,30 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again)
case R_IA64_PCREL21BI:
case R_IA64_PCREL21M:
case R_IA64_PCREL21F:
+ /* In the finalize pass, all br relaxations are done. We can
+ skip it. */
if (!link_info->need_relax_finalize)
continue;
is_branch = TRUE;
break;
+ case R_IA64_PCREL60B:
+ /* We can't optimize brl to br before the finalize pass since
+ br relaxations will increase the code size. Defer it to
+ the finalize pass. */
+ if (link_info->need_relax_finalize)
+ {
+ sec->need_finalize_relax = 1;
+ continue;
+ }
+ is_branch = TRUE;
+ break;
+
case R_IA64_LTOFF22X:
case R_IA64_LDXMOV:
+ /* We can't relax ldx/mov before the finalize pass since
+ br relaxations will increase the code size. Defer it to
+ the finalize pass. */
if (link_info->need_relax_finalize)
{
sec->need_finalize_relax = 1;
@@ -885,6 +932,25 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again)
/* If the branch is in range, no need to do anything. */
if ((bfd_signed_vma) (symaddr - reladdr) >= -0x1000000
&& (bfd_signed_vma) (symaddr - reladdr) <= 0x0FFFFF0)
+ {
+ /* If the 60-bit branch is in 21-bit range, optimize it. */
+ if (r_type == R_IA64_PCREL60B)
+ {
+ elfNN_ia64_relax_brl (abfd, contents, roff);
+
+ irel->r_info
+ = ELF64_R_INFO (ELF64_R_SYM (irel->r_info),
+ R_IA64_PCREL21B);
+
+ /* If the original relocation offset points to slot
+ 1, change it to slot 2. */
+ if ((irel->r_offset & 3) == 1)
+ irel->r_offset += 1;
+ }
+
+ continue;
+ }
+ else if (r_type == R_IA64_PCREL60B)
continue;
/* If the branch and target are in the same section, you've
@@ -3951,6 +4017,24 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section,
BFD_ASSERT (srel != NULL);
+ switch (r_type)
+ {
+ case R_IA64_IMM14:
+ case R_IA64_IMM22:
+ case R_IA64_IMM64:
+ /* ??? People shouldn't be doing non-pic code in
+ shared libraries nor dynamic executables. */
+ (*_bfd_error_handler)
+ (_("%s: non-pic code with imm relocation against dynamic symbol `%s'"),
+ bfd_archive_filename (input_bfd),
+ h->root.root.string);
+ ret_val = FALSE;
+ continue;
+
+ default:
+ break;
+ }
+
/* If we don't need dynamic symbol lookup, find a
matching RELATIVE relocation. */
dyn_r_type = r_type;
@@ -3978,17 +4062,7 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section,
break;
default:
- /* We can't represent this without a dynamic symbol.
- Adjust the relocation to be against an output
- section symbol, which are always present in the
- dynamic symbol table. */
- /* ??? People shouldn't be doing non-pic code in
- shared libraries. Hork. */
- (*_bfd_error_handler)
- (_("%s: linking non-pic code in a shared library"),
- bfd_archive_filename (input_bfd));
- ret_val = FALSE;
- continue;
+ break;
}
dynindx = 0;
addend = value;
diff --git a/bfd/libbfd.h b/bfd/libbfd.h
index d6ee8f3..40e1b78 100644
--- a/bfd/libbfd.h
+++ b/bfd/libbfd.h
@@ -1430,6 +1430,7 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
"BFD_RELOC_M68HC11_LO16",
"BFD_RELOC_M68HC11_PAGE",
"BFD_RELOC_M68HC11_24",
+ "BFD_RELOC_M68HC12_5B",
"BFD_RELOC_CRIS_BDISP8",
"BFD_RELOC_CRIS_UNSIGNED_5",
"BFD_RELOC_CRIS_SIGNED_6",
diff --git a/bfd/opncls.c b/bfd/opncls.c
index 96f1e14..6abd405 100644
--- a/bfd/opncls.c
+++ b/bfd/opncls.c
@@ -70,8 +70,7 @@ _bfd_new_bfd (void)
nbfd->direction = no_direction;
nbfd->iostream = NULL;
nbfd->where = 0;
- if (!bfd_hash_table_init_n (&nbfd->section_htab,
- bfd_section_hash_newfunc,
+ if (!bfd_hash_table_init_n (& nbfd->section_htab, bfd_section_hash_newfunc,
251))
{
free (nbfd);
@@ -923,7 +922,7 @@ find_separate_debug_file (bfd *abfd, const char *debug_file_directory)
for (i = strlen (dir) - 1; i >= 0; i--)
if (IS_DIR_SEPARATOR (dir[i]))
break;
-
+
dir[i + 1] = '\0';
BFD_ASSERT (dir[i] == '/' || dir[0] == '\0')
@@ -996,23 +995,26 @@ SYNOPSIS
DESCRIPTION
Takes a BFD and searches it for a .gnu_debuglink section. If this
- section is found, examines the section for the name and checksum of
- a '.debug' file containing auxiliary debugging
- information. Searches filesystem for .debug file in some standard
+ section is found, it examines the section for the name and checksum
+ of a '.debug' file containing auxiliary debugging information. It
+ then searches the filesystem for this .debug file in some standard
locations, including the directory tree rooted at @var{dir}, and if
- found returns the full filename. If @var{dir} is NULL, will search
- default path configured into libbfd at build time.
+ found returns the full filename.
+
+ If @var{dir} is NULL, it will search a default path configured into
+ libbfd at build time. [XXX this feature is not currently
+ implemented].
RETURNS
<<NULL>> on any errors or failure to locate the .debug file,
otherwise a pointer to a heap-allocated string containing the
- filename. The caller is responsible for freeing this string.
+ filename. The caller is responsible for freeing this string.
*/
char *
bfd_follow_gnu_debuglink (bfd *abfd, const char *dir)
{
-#if 0 /* Disabled until DEBUGDIR can be defined by configure.in */
+#if 0 /* Disabled until DEBUGDIR can be defined by configure.in. */
if (dir == NULL)
dir = DEBUGDIR;
#endif
diff --git a/bfd/peXXigen.c b/bfd/peXXigen.c
index 2fe294f..559f2a2 100644
--- a/bfd/peXXigen.c
+++ b/bfd/peXXigen.c
@@ -1,5 +1,5 @@
/* Support for the generic parts of PE/PEI; the common executable parts.
- Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+ Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
Written by Cygnus Solutions.
@@ -985,13 +985,21 @@ _bfd_XXi_swap_scnhdr_out (abfd, in, out)
pe_required_section_flags * p;
int flags = scnhdr_int->s_flags;
+ /* We have defaulted to adding the IMAGE_SCN_MEM_WRITE flag, but now
+ we know exactly what this specific section wants so we remove it
+ and then allow the must_have field to add it back in if necessary.
+ However, we don't remove IMAGE_SCN_MEM_WRITE flag from .text if the
+ default WP_TEXT file flag has been cleared. WP_TEXT may be cleared
+ by ld --enable-auto-import (if auto-import is actually needed),
+ by ld --omagic, or by obcopy --writable-text. */
+
+ if (strcmp (scnhdr_int->s_name, ".text")
+ || (bfd_get_file_flags (abfd) & WP_TEXT))
+ flags &= ~IMAGE_SCN_MEM_WRITE;
+
for (p = known_sections; p->section_name; p++)
if (strcmp (scnhdr_int->s_name, p->section_name) == 0)
{
- /* We have defaulted to adding the IMAGE_SCN_MEM_WRITE flag, but now
- we know exactly what this specific section wants so we remove it
- and then allow the must_have field to add it back in if necessary. */
- flags &= ~IMAGE_SCN_MEM_WRITE;
flags |= p->must_have;
break;
}
diff --git a/bfd/reloc.c b/bfd/reloc.c
index d3a6534..9bffaa3 100644
--- a/bfd/reloc.c
+++ b/bfd/reloc.c
@@ -1,6 +1,6 @@
/* BFD support for handling relocation entries.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003
+ 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
Written by Cygnus Support.
@@ -3764,6 +3764,11 @@ ENUMDOC
This is a 24-bit reloc that represents the address with a 16-bit
value and a 8-bit page number. The symbol address is transformed
to follow the 16K memory bank of 68HC12 (seen as mapped in the window).
+ENUM
+ BFD_RELOC_M68HC12_5B
+ENUMDOC
+ Motorola 68HC12 reloc.
+ This is the 5 bits of a value.
ENUM
BFD_RELOC_CRIS_BDISP8
diff --git a/bfd/version.h b/bfd/version.h
index 0e98715..970afc6 100644
--- a/bfd/version.h
+++ b/bfd/version.h
@@ -1,3 +1,3 @@
-#define BFD_VERSION_DATE 20040113
+#define BFD_VERSION_DATE 20040208
#define BFD_VERSION @bfd_version@
#define BFD_VERSION_STRING @bfd_version_string@
diff --git a/config/ChangeLog b/config/ChangeLog
index 92eb902..85868b4 100644
--- a/config/ChangeLog
+++ b/config/ChangeLog
@@ -1,3 +1,10 @@
+2004-01-14 Maciej W. Rozycki <macro@ds2.pg.gda.pl>
+
+ * acinclude.m4: Quote names of macros to be defined by AC_DEFUN
+ throughout.
+ * aclocal.m4: Regenerate.
+ * configure: Regenerate.
+
2003-10-14 Nathanael Nerode <neroden@gcc.gnu.org>
* gettext.m4: Properly quote arguments to AC_DEFUN.
diff --git a/config/acinclude.m4 b/config/acinclude.m4
index c60373a..c7c0ab5 100755
--- a/config/acinclude.m4
+++ b/config/acinclude.m4
@@ -6,7 +6,7 @@ dnl and doesn't call AC_PROG_CXX_GNU, cause we test for that in AC_PROG_CC_WORK
dnl We are probably using a cross compiler, which will not be able to fully
dnl link an executable. This should really be fixed in autoconf itself.
dnl Find a working G++ cross compiler. This only works for the GNU C++ compiler.
-AC_DEFUN(CYG_AC_PROG_CXX_CROSS,
+AC_DEFUN([CYG_AC_PROG_CXX_CROSS],
[AC_BEFORE([$0], [AC_PROG_CXXCPP])
AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx cc++, gcc)
@@ -35,7 +35,7 @@ fi
])
dnl See if the G++ compiler we found works.
-AC_DEFUN(CYG_AC_PROG_GXX_WORKS,
+AC_DEFUN([CYG_AC_PROG_GXX_WORKS],
[AC_MSG_CHECKING([whether the G++ compiler ($CXX $CXXFLAGS $LDFLAGS) actually works])
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
@@ -103,7 +103,7 @@ AC_SUBST(CXX)
dnl ====================================================================
dnl Find a working GCC cross compiler. This only works for the GNU gcc compiler.
dnl This is based on the macros above for G++.
-AC_DEFUN(CYG_AC_PROG_CC_CROSS,
+AC_DEFUN([CYG_AC_PROG_CC_CROSS],
[AC_BEFORE([$0], [AC_PROG_CCPP])
AC_CHECK_PROGS(CC, cc, gcc)
@@ -132,7 +132,7 @@ fi
])
dnl See if the GCC compiler we found works.
-AC_DEFUN(CYG_AC_PROG_GCC_WORKS,
+AC_DEFUN([CYG_AC_PROG_GCC_WORKS],
[AC_MSG_CHECKING([whether the Gcc compiler ($CC $CFLAGS $LDFLAGS) actually works])
AC_LANG_SAVE
AC_LANG_C
@@ -199,7 +199,7 @@ AC_SUBST(CC)
dnl ====================================================================
dnl Find the BFD library in the build tree. This is used to access and
dnl manipulate object or executable files.
-AC_DEFUN(CYG_AC_PATH_BFD, [
+AC_DEFUN([CYG_AC_PATH_BFD], [
AC_MSG_CHECKING(for the bfd header in the build tree)
dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
dnl Look for the header file
@@ -241,7 +241,7 @@ AC_SUBST(BFDLIB)
dnl ====================================================================
dnl Find the libiberty library. This defines many commonly used C
dnl functions that exists in various states based on the underlying OS.
-AC_DEFUN(CYG_AC_PATH_LIBERTY, [
+AC_DEFUN([CYG_AC_PATH_LIBERTY], [
AC_MSG_CHECKING(for the liberty library in the build tree)
dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
AC_CACHE_VAL(ac_cv_c_liberty,[
@@ -262,7 +262,7 @@ AC_SUBST(LIBERTY)
dnl ====================================================================
dnl Find the opcodes library. This is used to do dissasemblies.
-AC_DEFUN(CYG_AC_PATH_OPCODES, [
+AC_DEFUN([CYG_AC_PATH_OPCODES], [
AC_MSG_CHECKING(for the opcodes library in the build tree)
dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
AC_CACHE_VAL(ac_cv_c_opc,[
@@ -284,7 +284,7 @@ AC_SUBST(OPCODESLIB)
dnl ====================================================================
dnl Look for the DejaGnu header file in the source tree. This file
dnl defines the functions used to testing support.
-AC_DEFUN(CYG_AC_PATH_DEJAGNU, [
+AC_DEFUN([CYG_AC_PATH_DEJAGNU], [
AC_MSG_CHECKING(for the testing support files in the source tree)
dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
AC_CACHE_VAL(ac_cv_c_dejagnu,[
@@ -335,7 +335,7 @@ AC_SUBST(DEJAGNUHDIR)
dnl ====================================================================
dnl Find the libintl library in the build tree. This is for
dnl internationalization support.
-AC_DEFUN(CYG_AC_PATH_INTL, [
+AC_DEFUN([CYG_AC_PATH_INTL], [
AC_MSG_CHECKING(for the intl header in the build tree)
dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
dnl Look for the header file
@@ -375,7 +375,7 @@ AC_SUBST(INTLLIB)
dnl ====================================================================
dnl Find the simulator library.
-AC_DEFUN(CYG_AC_PATH_SIM, [
+AC_DEFUN([CYG_AC_PATH_SIM], [
dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.. ../../../../../../../../../.."
case "$target_cpu" in
powerpc) target_dir=ppc ;;
@@ -457,7 +457,7 @@ AC_SUBST(SIMLIB)
dnl ====================================================================
dnl Find the libiberty library.
-AC_DEFUN(CYG_AC_PATH_LIBIBERTY, [
+AC_DEFUN([CYG_AC_PATH_LIBIBERTY], [
AC_MSG_CHECKING(for the libiberty library in the build tree)
dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
AC_CACHE_VAL(ac_cv_c_libib,[
@@ -477,7 +477,7 @@ AC_SUBST(LIBIBERTY)
])
dnl ====================================================================
-AC_DEFUN(CYG_AC_PATH_DEVO, [
+AC_DEFUN([CYG_AC_PATH_DEVO], [
AC_MSG_CHECKING(for devo headers in the source tree)
dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
AC_CACHE_VAL(ac_cv_c_devoh,[
@@ -498,7 +498,7 @@ AC_SUBST(DEVOHDIR)
dnl ====================================================================
dnl find the IDE library and headers.
-AC_DEFUN(CYG_AC_PATH_IDE, [
+AC_DEFUN([CYG_AC_PATH_IDE], [
AC_MSG_CHECKING(for IDE headers in the source tree)
dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
IDEHDIR=
@@ -591,7 +591,7 @@ AC_SUBST(IDETCLLIB)
dnl ====================================================================
dnl Find all the ILU headers and libraries
-AC_DEFUN(CYG_AC_PATH_ILU, [
+AC_DEFUN([CYG_AC_PATH_ILU], [
AC_MSG_CHECKING(for ILU kernel headers in the source tree)
dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
AC_CACHE_VAL(ac_cv_c_iluh,[
@@ -752,7 +752,7 @@ dnl ====================================================================
dnl This defines the byte order for the host. We can't use
dnl AC_C_BIGENDIAN, cause we want to create a config file and
dnl substitue the real value, so the header files work right
-AC_DEFUN(CYG_AC_C_ENDIAN, [
+AC_DEFUN([CYG_AC_C_ENDIAN], [
AC_MSG_CHECKING(to see if this is a little endian host)
AC_CACHE_VAL(ac_cv_c_little_endian, [
ac_cv_c_little_endian=unknown
@@ -809,7 +809,7 @@ AC_SUBST(ENDIAN)
dnl ====================================================================
dnl Look for the path to libgcc, so we can use it to directly link
dnl in libgcc.a with LD.
-AC_DEFUN(CYG_AC_PATH_LIBGCC,
+AC_DEFUN([CYG_AC_PATH_LIBGCC],
[AC_MSG_CHECKING([Looking for the path to libgcc.a])
AC_LANG_SAVE
AC_LANG_C
@@ -844,12 +844,12 @@ dnl Warning: transition of version 9 to 10 will break this algorithm
dnl because 10 sorts before 9. We also look for just tcl. We have to
dnl be careful that we don't match stuff like tclX by accident.
dnl the alternative search directory is involked by --with-tclinclude
-AC_DEFUN(CYG_AC_PATH_TCL, [
+AC_DEFUN([CYG_AC_PATH_TCL], [
CYG_AC_PATH_TCLH
CYG_AC_PATH_TCLCONFIG
CYG_AC_LOAD_TCLCONFIG
])
-AC_DEFUN(CYG_AC_PATH_TCLH, [
+AC_DEFUN([CYG_AC_PATH_TCLH], [
dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
no_tcl=true
AC_MSG_CHECKING(for Tcl headers in the source tree)
@@ -935,7 +935,7 @@ AC_SUBST(TCLHDIR)
dnl ====================================================================
dnl Ok, lets find the tcl configuration
-AC_DEFUN(CYG_AC_PATH_TCLCONFIG, [
+AC_DEFUN([CYG_AC_PATH_TCLCONFIG], [
dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
dnl First, look for one uninstalled.
dnl the alternative search directory is invoked by --with-tclconfig
@@ -1024,7 +1024,7 @@ AC_SUBST(TCLCONFIG)
dnl Defined as a separate macro so we don't have to cache the values
dnl from PATH_TCLCONFIG (because this can also be cached).
-AC_DEFUN(CYG_AC_LOAD_TCLCONFIG, [
+AC_DEFUN([CYG_AC_LOAD_TCLCONFIG], [
. $TCLCONFIG
dnl AC_SUBST(TCL_VERSION)
@@ -1070,12 +1070,12 @@ dnl AC_SUBST(TCL_UNSHARED_LIB_SUFFIX)
])
dnl ====================================================================
-AC_DEFUN(CYG_AC_PATH_TK, [
+AC_DEFUN([CYG_AC_PATH_TK], [
CYG_AC_PATH_TKH
CYG_AC_PATH_TKCONFIG
CYG_AC_LOAD_TKCONFIG
])
-AC_DEFUN(CYG_AC_PATH_TKH, [
+AC_DEFUN([CYG_AC_PATH_TKH], [
#
# Ok, lets find the tk source trees so we can use the headers
# If the directory (presumably symlink) named "tk" exists, use that one
@@ -1168,7 +1168,7 @@ fi
AC_SUBST(TKHDIR)
])
-AC_DEFUN(CYG_AC_PATH_TKCONFIG, [
+AC_DEFUN([CYG_AC_PATH_TKCONFIG], [
dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
dnl First, look for one uninstalled.
dnl the alternative search directory is invoked by --with-tkconfig
@@ -1257,7 +1257,7 @@ AC_SUBST(TKCONFIG)
dnl Defined as a separate macro so we don't have to cache the values
dnl from PATH_TKCONFIG (because this can also be cached).
-AC_DEFUN(CYG_AC_LOAD_TKCONFIG, [
+AC_DEFUN([CYG_AC_LOAD_TKCONFIG], [
if test -f "$TKCONFIG" ; then
. $TKCONFIG
fi
@@ -1287,13 +1287,13 @@ dnl AC_SUBST(TK_EXEC_PREFIX)
dnl ====================================================================
dnl Ok, lets find the itcl source trees so we can use the headers
dnl the alternative search directory is involked by --with-itclinclude
-AC_DEFUN(CYG_AC_PATH_ITCL, [
+AC_DEFUN([CYG_AC_PATH_ITCL], [
CYG_AC_PATH_ITCLH
CYG_AC_PATH_ITCLLIB
CYG_AC_PATH_ITCLSH
CYG_AC_PATH_ITCLMKIDX
])
-AC_DEFUN(CYG_AC_PATH_ITCLH, [
+AC_DEFUN([CYG_AC_PATH_ITCLH], [
dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
no_itcl=true
AC_MSG_CHECKING(for Itcl headers in the source tree)
@@ -1367,7 +1367,7 @@ AC_SUBST(ITCLHDIR)
dnl Ok, lets find the itcl library
dnl First, look for one uninstalled.
dnl the alternative search directory is invoked by --with-itcllib
-AC_DEFUN(CYG_AC_PATH_ITCLLIB, [
+AC_DEFUN([CYG_AC_PATH_ITCLLIB], [
dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
if test x"${no_itcl}" = x ; then
dnl we reset no_itcl incase something fails here
@@ -1454,7 +1454,7 @@ AC_SUBST(ITCLLIB)
dnl ====================================================================
dnl Ok, lets find the itcl source trees so we can use the itcl_sh script
dnl the alternative search directory is involked by --with-itclinclude
-AC_DEFUN(CYG_AC_PATH_ITCLSH, [
+AC_DEFUN([CYG_AC_PATH_ITCLSH], [
dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
no_itcl=true
AC_MSG_CHECKING(for the itcl_sh script)
@@ -1516,7 +1516,7 @@ AC_SUBST(ITCLSH)
dnl ====================================================================
dnl Ok, lets find the itcl source trees so we can use the itcl_sh script
dnl the alternative search directory is involked by --with-itclinclude
-AC_DEFUN(CYG_AC_PATH_ITCLMKIDX, [
+AC_DEFUN([CYG_AC_PATH_ITCLMKIDX], [
dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
no_itcl=true
AC_MSG_CHECKING(for itcl_mkindex.tcl script)
@@ -1582,11 +1582,11 @@ AC_SUBST(ITCLMKIDX)
dnl ====================================================================
dnl Ok, lets find the tix source trees so we can use the headers
dnl the alternative search directory is involked by --with-tixinclude
-AC_DEFUN(CYG_AC_PATH_TIX, [
+AC_DEFUN([CYG_AC_PATH_TIX], [
CYG_AC_PATH_TIXH
CYG_AC_PATH_TIXLIB
])
-AC_DEFUN(CYG_AC_PATH_TIXH, [
+AC_DEFUN([CYG_AC_PATH_TIXH], [
dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
no_tix=true
AC_MSG_CHECKING(for Tix headers in the source tree)
@@ -1663,7 +1663,7 @@ fi
AC_SUBST(TIXHDIR)
])
-AC_DEFUN(CYG_AC_PATH_TIXCONFIG, [
+AC_DEFUN([CYG_AC_PATH_TIXCONFIG], [
#
# Ok, lets find the tix configuration
# First, look for one uninstalled.
@@ -1737,7 +1737,7 @@ fi
# Defined as a separate macro so we don't have to cache the values
# from PATH_TIXCONFIG (because this can also be cached).
-AC_DEFUN(CYG_AC_LOAD_TIXCONFIG, [
+AC_DEFUN([CYG_AC_LOAD_TIXCONFIG], [
if test -f "$TIXCONFIG" ; then
. $TIXCONFIG
fi
@@ -1746,7 +1746,7 @@ AC_DEFUN(CYG_AC_LOAD_TIXCONFIG, [
AC_SUBST(TIX_LIB_FULL_PATH)
])
-AC_DEFUN(CYG_AC_PATH_ITCLCONFIG, [
+AC_DEFUN([CYG_AC_PATH_ITCLCONFIG], [
#
# Ok, lets find the itcl configuration
# First, look for one uninstalled.
@@ -1820,7 +1820,7 @@ fi
# Defined as a separate macro so we don't have to cache the values
# from PATH_ITCLCONFIG (because this can also be cached).
-AC_DEFUN(CYG_AC_LOAD_ITCLCONFIG, [
+AC_DEFUN([CYG_AC_LOAD_ITCLCONFIG], [
if test -f "$ITCLCONFIG" ; then
. $ITCLCONFIG
fi
@@ -1833,7 +1833,7 @@ AC_DEFUN(CYG_AC_LOAD_ITCLCONFIG, [
])
-AC_DEFUN(CYG_AC_PATH_ITKCONFIG, [
+AC_DEFUN([CYG_AC_PATH_ITKCONFIG], [
#
# Ok, lets find the itk configuration
# First, look for one uninstalled.
@@ -1907,7 +1907,7 @@ fi
# Defined as a separate macro so we don't have to cache the values
# from PATH_ITKCONFIG (because this can also be cached).
-AC_DEFUN(CYG_AC_LOAD_ITKCONFIG, [
+AC_DEFUN([CYG_AC_LOAD_ITKCONFIG], [
if test -f "$ITKCONFIG" ; then
. $ITKCONFIG
fi
@@ -1921,11 +1921,11 @@ AC_DEFUN(CYG_AC_LOAD_ITKCONFIG, [
dnl ====================================================================
dnl Ok, lets find the libgui source trees so we can use the headers
dnl the alternative search directory is involked by --with-libguiinclude
-AC_DEFUN(CYG_AC_PATH_LIBGUI, [
+AC_DEFUN([CYG_AC_PATH_LIBGUI], [
CYG_AC_PATH_LIBGUIH
CYG_AC_PATH_LIBGUILIB
])
-AC_DEFUN(CYG_AC_PATH_LIBGUIH, [
+AC_DEFUN([CYG_AC_PATH_LIBGUIH], [
dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../..../../../../../../../../../../.."
no_libgui=true
AC_MSG_CHECKING(for Libgui headers in the source tree)
@@ -1995,7 +1995,7 @@ AC_SUBST(LIBGUIHDIR)
dnl ====================================================================
dnl find the GUI library
-AC_DEFUN(CYG_AC_PATH_LIBGUILIB, [
+AC_DEFUN([CYG_AC_PATH_LIBGUILIB], [
AC_MSG_CHECKING(for GUI library in the build tree)
dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
dnl look for the library
diff --git a/configure b/configure
index 88d3753..71791ac 100755
--- a/configure
+++ b/configure
@@ -2011,7 +2011,7 @@ fi
# Default to using --with-stabs for certain targets.
if test x${with_stabs} = x ; then
case "${target}" in
- mips*-*-irix6*)
+ mips*-*-irix[56]*)
;;
mips*-*-* | alpha*-*-osf*)
with_stabs=yes;
diff --git a/configure.in b/configure.in
index b286f1a..eb374a4 100644
--- a/configure.in
+++ b/configure.in
@@ -1,5 +1,5 @@
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-# 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+# 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -1250,7 +1250,7 @@ fi
# Default to using --with-stabs for certain targets.
if test x${with_stabs} = x ; then
case "${target}" in
- mips*-*-irix6*)
+ mips*-*-irix[[56]]*)
;;
mips*-*-* | alpha*-*-osf*)
with_stabs=yes;
diff --git a/cpu/ChangeLog b/cpu/ChangeLog
index bae9ccc..00a4a1f 100644
--- a/cpu/ChangeLog
+++ b/cpu/ChangeLog
@@ -1,3 +1,10 @@
+2004-01-14 Richard Sandiford <rsandifo@redhat.com>
+
+ * frv.cpu (UNIT): Add IACC.
+ (iacc-multiply-r-r): Use it.
+ * frv.opc (fr400_unit_mapping): Add entry for IACC.
+ (fr500_unit_mapping, fr550_unit_mapping): Likewise.
+
2004-01-06 Alexandre Oliva <aoliva@redhat.com>
2003-12-19 Alexandre Oliva <aoliva@redhat.com>
diff --git a/cpu/frv.cpu b/cpu/frv.cpu
index f7bb296..28e7833 100644
--- a/cpu/frv.cpu
+++ b/cpu/frv.cpu
@@ -1,6 +1,6 @@
; Fujitsu FRV opcode support, for GNU Binutils. -*- Scheme -*-
;
-; Copyright 2000, 2001, 2003 Free Software Foundation, Inc.
+; Copyright 2000, 2001, 2003, 2004 Free Software Foundation, Inc.
;
; Contributed by Red Hat Inc; developed under contract from Fujitsu.
;
@@ -1388,6 +1388,7 @@
B0 B1 B01
C
MULT-DIV ; multiply/division slotted differently on different machines
+ IACC ; iacc multiply slotted differently on different machines
LOAD ; loads slotted differently on different machines
STORE ; store slotted differently on different machines
SCAN ; scan, scani slotted differently on different machines
@@ -3118,7 +3119,7 @@
(define-pmacro (iacc-multiply-r-r name operation op ope comment)
(dni name
(comment)
- ((UNIT MULT-DIV) (FR400-MAJOR I-1) (MACH fr400))
+ ((UNIT IACC) (FR400-MAJOR I-1) (MACH fr400))
(.str name "$pack $GRi,$GRj")
(+ pack (rd-null) op GRi ope GRj)
((.sym iacc- operation) (mul DI (ext DI GRi) (ext DI GRj)))
diff --git a/cpu/frv.opc b/cpu/frv.opc
index 92b5586..03c0f3e 100644
--- a/cpu/frv.opc
+++ b/cpu/frv.opc
@@ -1,6 +1,6 @@
/* Fujitsu FRV opcode support, for GNU Binutils. -*- C -*-
- Copyright 2000, 2001, 2003 Free Software Foundation, Inc.
+ Copyright 2000, 2001, 2003, 2004 Free Software Foundation, Inc.
Contributed by Red Hat Inc; developed under contract from Fujitsu.
@@ -285,6 +285,7 @@ static CGEN_ATTR_VALUE_TYPE fr400_unit_mapping[] =
/* B01 */ UNIT_B0,
/* C */ UNIT_C,
/* MULT-DIV */ UNIT_I0, /* multiply and divide only in I0 unit. */
+/* IACC */ UNIT_I01, /* iacc multiply in I0 or I1 unit. */
/* LOAD */ UNIT_I0, /* load only in I0 unit. */
/* STORE */ UNIT_I0, /* store only in I0 unit. */
/* SCAN */ UNIT_I0, /* scan only in I0 unit. */
@@ -315,6 +316,7 @@ static CGEN_ATTR_VALUE_TYPE fr500_unit_mapping[] =
/* B01 */ UNIT_B01,
/* C */ UNIT_C,
/* MULT-DIV */ UNIT_I01, /* multiply and divide in I0 or I1 unit. */
+/* IACC */ UNIT_NIL, /* iacc multiply not implemented */
/* LOAD */ UNIT_I01, /* load in I0 or I1 unit. */
/* STORE */ UNIT_I0, /* store only in I0 unit. */
/* SCAN */ UNIT_I01, /* scan in I0 or I1 unit. */
@@ -345,6 +347,7 @@ static CGEN_ATTR_VALUE_TYPE fr550_unit_mapping[] =
/* B01 */ UNIT_B01,
/* C */ UNIT_C,
/* MULT-DIV */ UNIT_I01, /* multiply and divide in I0 or I1 unit. */
+/* IACC */ UNIT_NIL, /* iacc multiply not implemented. */
/* LOAD */ UNIT_I01, /* load in I0 or I1 unit. */
/* STORE */ UNIT_I01, /* store in I0 or I1 unit. */
/* SCAN */ UNIT_IALL, /* scan in any integer unit. */
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index c5993ee..0c6b743 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,1567 @@
+2004-02-07 Elena Zannoni <ezannoni@redhat.com>
+
+ * buildsym.c (free_pending_blocks, finish_block)
+ (record_pending_block, make_blockvector, end_symtab): Replace
+ symbol_obstack with objfile_obstack.
+ * coffread.c (process_coff_symbol, coff_read_struct_type)
+ (coff_read_enum_type): Ditto.
+ * cp-namespace.c (initialize_namespace_symtab)
+ (check_one_possible_namespace_symbol): Ditto.
+ * dwarf2read.c (new_symbol, dwarf2_const_value, macro_start_file)
+ (dwarf2_symbol_mark_computed): Ditto.
+ * dwarfread.c (enum_type, new_symbol, synthesize_typedef): Ditto.
+ * elfread.c (elf_symtab_read): Ditto.
+ * hpread.c (hpread_symfile_init, hpread_symfile_init)
+ (hpread_read_enum_type, hpread_read_function_type)
+ (hpread_read_doc_function_type, hpread_process_one_debug_symbol):
+ Ditto.
+ * jv-lang.c (get_java_class_symtab, add_class_symbol)
+ (java_link_class_type): Ditto.
+ * mdebugread.c (parse_symbol, psymtab_to_symtab_1, new_symtab)
+ (new_symbol): Ditto.
+ * minsyms.c (install_minimal_symbols): Ditto.
+ * objfiles.c (allocate_objfile): Remove init of symbol_obstack.
+ (terminate_minimal_symbol_table): Replace symbol_obstack with
+ objfile_obstack.
+ (free_objfile): Remove freeing of symbol_obstack.
+ * objfiles.h: Remove symbol_obstack field.
+ * pa64solib.c (add_to_solist): Replace symbol_obstack with
+ objfile_obstack.
+ * solib-sunos.c (allocate_rt_common_objfile): Remove init of
+ symbol_obstack.
+ (solib_add_common_symbols): Replace symbol_obstack with
+ objfile_obstack.
+ * somsolib.c (som_solib_add): Ditto.
+ * stabsread.c (patch_block_stabs, define_symbol, read_enum_type)
+ (common_block_start, common_block_end): Ditto.
+ * symfile.c (reread_symbols): Remove freeing and init of
+ symbol_obstack.
+ (allocate_symtab): Rename symbol_obstack to objfile_obstack.
+ * symfile.h: Update comment.
+ * symmisc.c (print_objfile_statistics): Remove symbol_obstack
+ stats printing.
+ * symtab.c (symbol_set_names): Replace symbol_obstack with
+ objfile_obstack.
+ * symtab.h (struct general_symbol_info, struct minimal_symbol):
+ Update comments.
+ * xcoffread.c (read_xcoff_symtab, SYMBOL_DUP, SYMNAME_ALLOC)
+ (init_stringtab, xcoff_initial_scan): Replace symbol_obstack with
+ objfile_obstack.
+
+2004-02-07 Andrew Cagney <cagney@redhat.com>
+
+ * tui/tui.h: Do not include <stdarg.h>, <string.h>, and
+ "ansidecl.h". Do not undef "reg" and "chtype". Fix case of
+ fields and variables.
+ * tui/tui-wingeneral.h (m_beVisible): Delete macro.
+ (m_beInvisible): Delete macro.
+ * tui/tui-data.h: Fix case case fields and variables.
+ (m_genWinPtrIsNull): Delete macro.
+ (tui_win_list): Rename winList.
+ (TUI_SRC_WIN): Rename srcWin.
+ (TUI_DISASM_WIN): Rename disassemWin.
+ (TUI_DATA_WIN): Rename dataWin.
+ (TUI_CMD_WIN): Rename cmdWin.
+ (m_genWinPtrNotNull): Delete macro.
+ (m_winPtrIsNull): Delete macro.
+ (m_winPtrNotNull): Delete macro.
+ (tui_win_is_source_type): Replace m_winIsSourceType
+ (tui_win_is_auxillary): Replace m_winIsAuzillary.
+ (tui_win_has_locator): Replace m_hasLocator.
+ (tui_set_win_highlight): Replace m_setWinHighlightOn and
+ m_setWinHighlightOff.
+ * tui/tui-data.c: Update references.
+ (tui_win_is_source_type, tui_set_win_highlight): New functions.
+ (tui_win_has_locator, tui_win_is_auxillary): New functions.
+ * tui/tui-command.c, tui/tui-disasm.c: Update references.
+ * tui/tui-io.c, tui/tui-layout.c, tui/tui-regs.c: Ditto.
+ * tui/tui-regs.h, tui/tui-source.c, tui/tui-stack.c: Ditto.
+ * tui/tui-win.c, tui/tui-windata.c, tui/tui-wingeneral.c: Ditto.
+ * tui/tui-winsource.c, tui/tui.c: Ditto.
+
+2004-02-07 Mark Kettenis <kettenis@gnu.org>
+
+ * sparc-tdep.h (sparc_fetch_wcookie): New prototype.
+ * sparcnbsd-tdep.c (sparc32nbsd_sigcontext_saved_regs): Handle
+ StackGhost.
+
+ * sparc-tdep.c (sparc32_frame_prev_register): Rename local
+ variable `i6' to `i7'.
+ (sparc_supply_rwindow, sparc_collect_rwindow): Likewise.
+
+2004-02-07 Andrew Cagney <cagney@redhat.com>
+
+ * tui/tui.h (Opaque, OpaquePtr OpaqueList): Delete definition.
+ (TuiPoint, TuiPointPtr): Ditto.
+ (TuiStatus, TuiStatusPtr): Ditto.
+ (TuiWinType, TuiWinTypePtr): Ditto.
+ (struct tui_point): Rename _TuiPoint.
+ (tui_get_low_disassembly_address): Rename
+ tuiGetLowDisassemblyAddress.
+ (tui_update_all_exec_infos): Rename tuiUpdateAllExecInfos.
+ (tuiFree): Delete declaration.
+ (OpaqueFuncPtr, TuiOpaqueFuncPtr): Delete definitions.
+ (TuiVoidFuncPtr, TuiIntFuncPtr): Delete definitions.
+ * tui/tui.c (tuiFree): Delete function.
+ * cli/cli-cmds.c (disassemble_command): Update references.
+ * tui/tui-data.c, tui/tui-data.h, tui/tui-disasm.c: Ditto.
+ * tui/tui-layout.c, tui/tui-regs.c, tui/tui-source.c: Ditto.
+ * tui/tui-stack.c, tui/tui-win.c, tui/tui-wingeneral.c: Ditto.
+ * tui/tui-winsource.c: Ditto.
+
+2004-02-07 Elena Zannoni <ezannoni@redhat.com>
+
+ * dbxread.c (dbx_symfile_init, start_psymtab, end_psymtab,
+ coffstab_build_psymtabs, elfstab_build_psymtabs)
+ (stabsect_build_psymtabs): Replace psymbol_obstack with
+ objfile_obstack.
+ * dwarf2-frame.c (decode_frame_entry_1): Ditto.
+ * dwarf2read.c (dwarf2_build_psymtabs_hard, dwarf2_read_section):
+ Ditto.
+ * dwarfread.c (scan_compilation_units): Ditto.
+ * elfread.c (elfstab_offset_sections): Ditto.
+ * hppa-tdep.c (read_unwind_info): Ditto.
+ * hpread.c (hpread_build_psymtabs, hpread_start_psymtab)
+ (hpread_end_psymtab): Ditto.
+ * mdebugread.c (mdebug_build_psymtabs, add_pending)
+ (parse_partial_symbols, new_psymtab, elfmdebug_build_psymtabs):
+ Ditto.
+ * mips-tdep.c (non_heuristic_proc_desc): Ditto.
+ * objfiles.c (add_to_objfile_sections)
+ (build_objfile_section_table): Ditto.
+ (allocate_objfile): Remove init of psymbol_obstack.
+ (free_objfile): Remove freeing of psymbol_obstack.
+ * objfiles.h (struct objfile): Remove field
+ psymbol_obstack. Update comments.
+ * pa64solib.c (pa64_solib_add_solib_objfile): Replace
+ psymbol_obstack with objfile_obstack.
+ * solib-sunos.c (allocate_rt_common_objfile): Remove init of
+ psymbol_obstack.
+ * somread.c (som_symfile_offsets, init_import_symbols)
+ (init_export_symbols): Replace psymbol_obstack with
+ objfile_obstack.
+ * somsolib.c (som_solib_add_solib_objfile): Ditto.
+ * symfile.c (default_symfile_offsets, syms_from_objfile)
+ (reread_symbols): Remove freeing and init of psymbol_obstack.
+ (cashier_psymtab): Update comment.
+ * symmisc.c (print_objfile_statistics): Don't report stats for
+ psymbol obstack.
+ * symtab.h (struct general_symbol_info, struct partial_symtab):
+ Update comments.
+ * xcoffread.c (xcoff_start_psymtab, xcoff_end_psymtab, swap_sym)
+ (xcoff_symfile_offsets): Replace psymbol_obstack with
+ objfile_obstack.
+
+2004-02-07 Elena Zannoni <ezannoni@redhat.com>
+
+ * objfiles.h (struct objfile): Add objfile_obstack field.
+ Remove type_obstack field.
+
+ * dwarf2read.c (dwarf2_add_field,dwarf2_add_member_fn,
+ read_structure_scope read_enumeration, new_symbol): Replace
+ type_obstack with objfile_obstack.
+ * dwarfread.c (struct_type, enum_type): Ditto.
+ * gdbtypes.c (alloc_type, alloc_type_instance, init_type)
+ (lookup_fundamental_type): Ditto.
+ * gdbtypes.h (TYPE_ALLOC): Ditto.
+ * hpread.c (hpread_read_enum_type, hpread_read_function_type)
+ (hpread_read_doc_function_type, hpread_read_struct_type)
+ (fix_static_member_physnames, hpread_read_array_type)
+ (hpread_read_subrange_type, hpread_type_lookup): Ditto.
+ * jv-lang.c (java_lookup_class, type_from_class, type_from_class)
+ (java_link_class_type): Ditto.
+ * mdebugread.c (parse_type): Ditto.
+ * objfiles.c (allocate_objfile, free_objfile): Ditto.
+ * solib-sunos.c (solib_add_common_symbols): Ditto.
+ * stabsread.c (define_symbol, read_type, read_member_functions,
+ read_cpp_abbrev, read_one_struct_field): Ditto.
+ * symfile.c (reread_symbols): Ditto.
+ * symmisc.c (print_objfile_statistics): Ditto.
+
+2004-02-07 Andrew Cagney <cagney@redhat.com>
+
+ * tui/tui-data.h (tui_win_element): Rename TuiWinElement.
+ (tui_exec_info_content): Rename TuiExecInfoContent.
+ (TuiGenWinInfo, TuiGenWinInfoPtr): Delete definitions.
+ (TuiWinInfo, TuiWinInfoPtr): Ditto.
+ (TuiScrollDirection, TuiScrollDirectionPtr): Ditto.
+ (TuiList, TuiListPtr): Ditto.
+ (TuiLayoutType, TuiLayoutTypePtr): Ditto.
+ (TuiDataType, TuiDataTypePtr): Ditto.
+ (TuiRegisterDisplayType, TuiRegisterDisplayTypePtr): Ditto.
+ (TuiLineOrAddress, TuiLineOrAddressPtr): Ditto.
+ (TuiLayoutDef, TuiLayoutDefPtr): Ditto.
+ (TuiSourceElement, TuiSourceElementPtr): Ditto.
+ (TuiDataElement, TuiDataElementPtr): Ditto.
+ (TuiWinElement, TuiWinElementPtr): Ditto.
+ (TuiDataInfo, TuiDataInfoPtr): Ditto.
+ (TuiCommandElement, TuiCommandElementPtr): Ditto.
+ (TuiLocatorElement, TuiLocatorElementPtr): Ditto.
+ (TuiWhichElement, TuiWhichElementPtr): Ditto.
+ (TuiSourceInfo, TuiSourceInfoPtr): Ditto.
+ (TuiCommandInfo, TuiCommandInfoPtr): Ditto.
+ * tui/tui-command.c, tui/tui-data.c: Update references.
+ * tui/tui-data.h, tui/tui-disasm.c, tui/tui-layout.c: Ditto.
+ * tui/tui-regs.c, tui/tui-source.c, tui/tui-stack.c: Ditto.
+ * tui/tui-win.c, tui/tui-windata.c, tui/tui-wingeneral.c: Ditto.
+ * tui/tui-winsource.c, tui/tui.c: Ditto.
+
+2004-02-07 Mark Kettenis <kettenis@gnu.org>
+
+ * dwarf2-frame.h: Update copyright.
+ (enum dwarf2_frame_reg_rule): New.
+ (struct dwarf2_frame_state_reg): New.
+ (dwarf2_frame_sniffer, dwarf2_frame_base_sniffer): Make extern.
+ * dwarf2-frame.c: Update copyright.
+ (enum dwarf2_reg_rule): Remove.
+ (struct dwarf2_frame_state): Remove defenition of `struct
+ dwarf2_frame_state_reg'.
+ (read_reg): Call get_frame_arch to get the architecture instead of
+ using CURRENT_GDBARCH.
+ (execute_cfa_program): Prefix old `enum dwarf2_reg_rule' tags with
+ DWARF2_FRAME_.
+ (dwarf2_frame_init_reg): New function.
+ (dwarf2_frame_cache): Call get_frame_arch to get the architecture
+ instead of using CURRENT_GDBARCH. Call dwarf2_frame_init_reg to
+ initialize the register state. Prefix old `enum dwarf2_reg_rule'
+ tags with DWARF2_FRAME_.
+ (dwarf2_frame_prev_register): Call get_frame_arch to get the
+ architecture instead of using CURRENT_GDBARCH. Prefix old `enum
+ dwarf2_reg_rule' tags with DWARF2_FRAME_.
+
+2004-02-06 Andrew Cagney <cagney@redhat.com>
+
+ * tui/tui-data.h (struct tui_list): Rename _TuiList.
+ (enum tui_data_type): Rename _TuiDataType.
+ (struct tui_layout_def): Rename _TuiLayoutDef.
+ (struct tui_source_element): Rename _TuiSourceElement.
+ (struct tui_data_element): Rename _TuiDataElement.
+ (struct tui_command_element): Rename _TuiCommandElement.
+ (struct tui_locator_element): Rename _TuiLocatorElement.
+ (union tui_which_element): Define.
+ (struct tui_win_element): Rename _TuiWinElement.
+ (struct tui_data_info): Rename _TuiDataInfo.
+ (struct tui_source_info): Rename _TuiSourceInfo.
+ (struct tui_command_info): Rename _TuiCommandInfo.
+ (tui_initialize_static_data): Rename initializeStaticData.
+ (tui_alloc_generic_win_info): Rename allocGenericWinInfo.
+ (tui_alloc_win_info): Rename allocWinInfo.
+ (tui_init_generic_part): Rename initGenericPart.
+ (tui_init_win_info): Rename initWinInfo.
+ (tui_alloc_content): Rename allocContent.
+ (tui_add_content_elements): Rename addContentElements.
+ (tui_init_content_element): Rename initContentElement.
+ (tui_free_window): Rename freeWindow.
+ (tui_free_win_content): Rename freeWinContent.
+ (tui_free_data_content): Rename freeDataContent.
+ (tui_free_all_source_wins_content): Rename
+ freeAllSourceWinsContent.
+ (tui_del_window): Rename tuiDelWindow.
+ (tui_del_data_windows): Rename tuiDelDataWindows.
+ (tui_partial_win_by_name): Rename partialWinByName.
+ (tui_win_name): Rename winName.
+ (tui_current_layout): Rename currentLayout.
+ (tui_set_current_layout_to): Rename setCurrentLayoutTo.
+ (tui_term_height): Rename termHeight.
+ (tui_set_term_height_to): Rename setTermHeightTo.
+ (tui_term_width): Rename termWidth.
+ (tui_set_term_width_to): Rename setTermWidthTo.
+ (tui_set_gen_win_origin): Rename setGenWinOrigin.
+ (tui_locator_win_info_ptr): Rename locatorWinInfoPtr.
+ (tui_source_exec_info_win_ptr): Rename tui_gen_win_info.
+ (tui_disassem_exec_info_win_ptr): Rename disassemExecInfoWinPtr.
+ (tui_source_windows): Rename sourceWindows.
+ (tui_clear_source_windows): Rename clearSourceWindows.
+ (tui_clear_source_windows_detail): Rename
+ clearSourceWindowsDetail.
+ (tui_clear_win_detail): Rename clearWinDetail.
+ (tui_add_to_source_windows): Rename tuiAddToSourceWindows.
+ (tui_default_tab_len): Rename tuiDefaultTabLen.
+ (tui_set_default_tab_len): Rename tuiSetDefaultTabLen.
+ (tui_win_with_focus): Rename tuiWinWithFocus.
+ (tui_set_win_with_focus): Rename tuiSetWinWithFocus.
+ (tui_layout_def): Rename tuiLayoutDef.
+ (tui_win_resized): Rename tuiWinResized.
+ (tui_set_win_resized_to): Rename tuiSetWinResizedTo.
+ (tui_next_win): Rename tuiNextWin.
+ (tui_prev_win): Rename tuiPrevWin.
+ (tui_add_to_source_windows): Rename addToSourceWindows.
+ * tui/tui-winsource.c, tui/tui-win.c: Update references.
+ * tui/tui-layout.c, tui/tui-source.c: Ditto.
+ * tui/tui-stack.c, tui/tui-io.c: Ditto.
+ * tui/tui.c, tui/tui-data.c: Ditto.
+ * tui/tui-interp.c, tui/tui-data.c: Ditto.
+ * tui/tui-disasm.c, tui/tui-command.c: Ditto.
+
+ * tui/tui-source.h: Update copyright. Include "tui-data.h".
+ (struct symtab): Declare.
+ (tui_set_source_content): Rename tuiSetSourceContent.
+ (tui_show_symtab_source): Rename tuiShowSource.
+ (tui_source_is_displayed): Rename tuiSourceIsDisplayed.
+ (tui_vertical_source_scroll): Rename tuiVerticalSourceScroll.
+ * tui/tui-source.c: Update copyright. Update references.
+ * tui/tui-win.c, tui/tui-winsource.c: Update references.
+ * tui/tui-stack.c: Update references.
+
+ * tui/tui-win.h: Update copyright. Include "tui-data.h".
+ (struct tui_win_info): Declare.
+ (tui_scroll_forward): Rename tuiScrollForward.
+ (tui_scroll_backward): Rename tuiScrollBackward.
+ (tui_scroll_left): Rename tuiScrollLeft.
+ (tui_scroll_right): Rename tuiScrollRight.
+ (tui_set_win_focus_to): Rename tuiSetWinFocusTo.
+ (tui_resize_all): Rename tuiResizeAll.
+ (tui_refresh_all_win): Rename tuiRefreshAll.
+ (tui_sigwinch_handler): Rename tuiSigwinchHandler.
+ * tui/tui-layout.c, * tui/tui-io.c: Update references.
+ * tui/tui-wingeneral.h, * tui/tui.c: Update references.
+ * tui/tui-disasm.c, * tui/tui-command.c: Update references.
+
+ * tui/tui-windata.h: Update copyright. Include "tui-data.h".
+ (tui_erase_data_content): Rename tuiEraseDataContent.
+ (tui_display_all_data): Rename tuiDisplayAllData.
+ (tui_check_data_values): Rename tuiCheckDataValues.
+ (tui_display_data_from_line): Rename tuiDisplayDataFromLine.
+ (tui_first_data_item_displayed): Rename tuiFirstDataItemDisplayed.
+ (tui_first_data_element_no_in_line): Rename
+ tuiFirstDataElementNoInLine.
+ (tui_delete_data_content_windows): Rename
+ tuiDeleteDataContentWindows.
+ (tui_refresh_data_win): Rename tuiRefreshDataWin.
+ (tui_display_data_from): Rename tuiDisplayDataFrom.
+ (tui_vertical_data_scroll): Rename tuiVerticalDataScroll.
+ * tui/tui-windata.c, tui/tui-hooks.c: Update references.
+ * tui/tui-win.c, tui/tui-regs.c: Update references.
+ * tui/tui-layout.c, tui/tui.c: Update references.
+
+ * tui/tui-wingeneral.h: Update copyright.
+ (m_allBeVisible): Delete macro.
+ (m_allBeInvisible): Delete macro.
+ (struct tui_gen_win_info): Declare.
+ (struct tui_win_info): Declare.
+ (tui_unhighlight_win): Rename unhighlightWin.
+ (tui_make_visible, tui_make_invisible): Replace makeVisible.
+ (tui_make_all_visible, tui_make_all_invisible): Replace makeAllVisible.
+ (tui_make_window): Rename makeWindow.
+ (tui_copy_win): Rename copyWin.
+ (tui_box_win): Rename boxWin.
+ (tui_highlight_win): Rename highlightWin.
+ (tui_check_and_display_highlight_if_needed): Rename
+ checkAndDisplayHighlightIfNeeded.
+ (tui_refresh_all): Rename refreshAll.
+ (tui_delete_win): Rename tuiDelwin.
+ (tui_refresh_win): Rename tuiRefreshWin.
+ * tui/tui-wingeneral.c (make_visible): Rename makeVisible.
+ (tui_make_visible, tui_make_invisible): New functions.
+ (tui_make_all_visible, tui_make_all_invisible): New functions.
+ (make_all_visible): Rename makeAllVisible.
+ * tui/tui-winsource.c, tui/tui-windata.c: Update references.
+ * tui/tui-data.c, tui/tui-winsource.c: Update references.
+ * tui/tui-windata.c, tui/tui-win.c: Update references.
+ * tui/tui-regs.c, tui/tui-layout.c: Update references.
+ * tui/tui-data.h (struct tui_gen_win_info): Rename _TuiGenWinInfo.
+
+2004-02-06 Mark Kettenis <kettenis@gnu.org>
+
+ * proc-api.c (write_with_trace): Initialize local variable to
+ silence compiler warning.
+
+2004-02-06 Andrew Cagney <cagney@redhat.com>
+
+ * tui/tui-source.h: Do not include "defs.h".
+ (struct tui_win_info): Declare.
+ (tui_set_source_content_nil): Declare.
+ * tui/tui-data.h (struct tui_win_info): Rename _TuiWinInfo.
+ (union tui_line_or_address): Rename _TuiLineOrAddress.
+ * tui/tui-winsource.h: Update copyright. Include "tui-data.h".
+ (tui_update_source_window): Rename tuiUpdateSourceWindow.
+ (tui_update_source_window_as_is): Rename
+ tuiUpdateSourceWindowAsIs.
+ (tui_update_source_windows_with_addr): Rename
+ tuiUpdateSourceWindowsWithAddr.
+ (tui_update_source_windows_with_line): Rename
+ tuiUpdateSourceWindowsWithLine.
+ (tui_clear_source_content): Rename tuiClearSourceContent.
+ (tui_erase_source_content): Rename tuiEraseSourceContent.
+ (tui_set_source_content_nil): Rename tuiSetSourceContentNil.
+ (tui_show_source_content): Rename tuiShowSourceContent.
+ (tui_horizontal_source_scroll): Rename tuiHorizontalSourceScroll.
+ (tui_set_exec_info_content): Rename tuiSetExecInfoContent.
+ (tui_show_exec_info_content): Rename tuiShowExecInfoContent.
+ (tui_erase_exec_info_content): Rename tuiEraseExecInfoContent.
+ (tui_clear_exec_info_content): Rename tuiClearExecInfoContent.
+ (tui_update_exec_info): Rename tuiUpdateExecInfo.
+ (tui_set_is_exec_point_at): Rename tuiSetIsExecPointAt.
+ (tui_alloc_source_buffer): Rename tuiAllocSourceBuffer.
+ (tui_line_is_displayed): Rename tuiLineIsDisplayed.
+ (tui_addr_is_displayed): Rename tuiAddrIsDisplayed.
+ (struct tui_win_info): Declare.
+ * tui/tui-stack.c: Update references.
+ * tui/tui-layout.c, tui/tui-winsource.c: Ditto.
+ * tui/tui-win.c, tui/tui-source.c: Ditto.
+ * tui/tui.c, tui/tui-disasm.c: Ditto.
+
+2004-02-06 Mark Kettenis <kettenis@gnu.org>
+
+ * i386-linux-tdep.c (i386_linux_sigcontext_addr): Fix calculation
+ of UCONTEXT_ADDR. Fixes PR backtrace/1545.
+
+2004-02-05 Mark Kettenis <kettenis@gnu.org>
+
+ * infrun.c (handle_inferior_event): Allow for breakpoint
+ instructions to generate a SIGSEGV in addition to SIGTRAP, SIGILL
+ and SIGEMT. Update comments.
+ * NEWS (Revised SPARC target): Mention support for non-executable
+ stack.
+
+2004-02-04 Mark Kettenis <kettenis@gnu.org>
+
+ * target.h (target_object): Add TARGET_OBJECT_WCOOKIE.
+ * inftarg.c: Update copyright year.
+ (child_xfer_partial): Add support for TARGET_OBJECT_WCOOKIE.
+ * sparc-nat.c: Include "target.h" and "gdb_assert.h".
+ (sparc_xfer_wcookie): New function.
+ * sparc-tdep.c (sparc_fetch_wcookie): New function.
+ * Makefile.in (sparc-nat.o): Update dependencies.
+ * config/sparc/nm-nbsd.h: Include "target.h".
+ (NATIVE_XFER_WCOOKIE): New define.
+ (sparc_xfer_wcookie): New prototype.
+
+2004-02-04 Andrew Cagney <cagney@redhat.com>
+
+ * m68k-tdep.c (m68k_saved_pc_after_call): Delete #ifdef
+ SYSCALL_TRAP function.
+ (m68k_gdbarch_init): Delete #ifdef SYSCALL_TRAP code.
+
+2004-02-04 Andrew Cagney <cagney@redhat.com>
+ Daniel Jacobowitz <drow@mvista.com>
+
+ * objfiles.h: Delete comments refering to inside_entry_func and
+ DEPRECATED_FRAME_CHAIN_VALID.
+ * defs.h (inside_entry_func): Update prototype..
+ * blockframe.c (inside_entry_func): Rename to
+ legacy_inside_entry_func. Add new inside_entry_func taking a frame.
+ * frame.c (get_prev_frame): Pass the frame to inside_entry_func.
+
+2004-02-03 Jeff Johnston <jjohnstn@redhat.com>
+
+ * breakpoint.c (struct captured_parse_breakpoint_args): Move
+ outside of #ifdef SOLIB_ADD region.
+ (do_restore_lang_radix_cleanup): Ditto.
+ (resolve_pending_breakpoint): Ditto.
+
+2004-02-03 Andrew Cagney <cagney@redhat.com>
+
+ * ia64-tdep.c (read_sigcontext_register): Delete unused function.
+ (process_note_abi_tag_sections): Delete unused function.
+ (ia64_read_fp): Delete unused function.
+ (gdbarch_extract_struct_value_address): Delete declaration.
+
+2004-02-02 Andrew Cagney <cagney@redhat.com>
+
+ * vax-tdep.c (vax_frame_chain): Delete call to
+ deprecated_inside_entry_file.
+ * ns32k-tdep.c (ns32k_frame_chain): Ditto.
+
+2004-02-02 Mark Kettenis <kettenis@gnu.org>
+
+ * dwarf2-frame.c (dwarf2_frame_cache): Deal with a return address
+ column that's "empty" or "same value" when eliminating REG_RA
+ rules.
+
+2004-02-02 Jeff Johnston <jjohnstn@redhat.com>
+
+ * NEWS: Add information about new pending breakpoint support.
+
+2004-02-02 Jeff Johnston <jjohnstn@redhat.com>
+
+ * breakpoint.h (struct breakpoint): Add new flag, from_tty,
+ and pending fields for pending breakpoint support.
+ * breakpoint.c (breakpoint_enabled): Add check for not pending.
+ (condition_command): Only parse condition if not a pending
+ breakpoint.
+ (print_one_breakpoint): Add support for pending breakpoints.
+ (describe_other_breakpoints): Add checks to verify we are not
+ dealing with pending breakpoints.
+ (check_duplicates): Don't check pending breakpoints.
+ (set_raw_breakpoint): Initialize pending flag.
+ (do_restore_lang_radix_cleanup): New cleanup routine.
+ (resolve_pending_breakpoint): New function.
+ (re_enable_breakpoints_in_shlibs): Try and resolve any
+ pending breakpoints via resolve_pending_breakpoint.
+ (mention): Add pending breakpoint support.
+ (parse_breakpoint_sals): Add new parameter to pass to
+ decode_line_1 to indicate silent errors when files or functions
+ are not found. Change all callers.
+ (do_captured_parse_breakpoint): New function.
+ (break_command_1): Change prototype to return an rc value and to
+ take an optional pending breakpoint pointer. Support creating
+ a pending breakpoint if a "not found" form of error occurs when
+ parsing the breakpoint. Also support resolving an existing pending
+ breakpoint and be silent if the resolution fails.
+ (create_breakpoints): Change prototype to take pending breakpoint
+ pointer. When resolving a pending breakpoint, use the new pointer
+ to provide a conditional or commands added by the end-user.
+ (delete_breakpoint): Add appropriate check for pending.
+ (breakpoint_re_set_one): Ditto.
+ (do_enable_breakpoint): Ditto.
+
+2004-02-02 David Carlton <carlton@kealia.com>
+
+ * valops.c (enum oload_classification): New.
+ (find_overload_match): Break implementation into separate
+ functions; delete #if 0'd code; look for symbols within
+ namespaces.
+ (find_oload_champ_namespace,find_oload_champ_namespace_loop)
+ (find_oload_champ,oload_method_static,classify_oload_match): New.
+ * cp-support.h: Add declaration for cp_func_name; update
+ declaration for make_symbol_overload_list.
+ * cp-support.c (cp_func_name): New.
+ (overload_list_add_symbol): Fix comment, use
+ SYMBOL_LINKAGE_NAME and SYMBOL_NATURAL_NAME.
+ (make_symbol_overload_list): Take a function name and a namespace
+ instead of a symbol; change implementation.
+ (make_symbol_overload_list_using): New.
+ (make_symbol_overload_list_qualified, read_in_psymtabs): New.
+
+2004-02-02 Fred Fish <fnf@redhat.com>
+
+ * main.c (gdb_stdtarg): Move definition to group with other
+ gdb_stdtarg definitions and update copyright years.
+ * remote-sim.c (gdb_os_write_stderr): Write output to
+ gdb_stdtargerr stream instead of gdb_stdtarg stream.
+ (gdb_os_flush_stderr): Flush gdb_stdtargerr steam instead of
+ gdb_stderr stream and update copyright years.
+
+2004-02-01 Daniel Jacobowitz <drow@mvista.com>
+
+ * Makefile.in (mips-linux-nat.o): Update dependencies.
+ * mips-linux-nat.c: Include mips-tdep.h.
+
+2004-02-01 Roland McGrath <roland@redhat.com>
+
+ * sol-thread.c (sol_thread_xfer_partial): New function.
+ (init_sol_thread_ops): Use that for to_xfer_partial hook.
+ (init_sol_core_ops): Likewise.
+
+ * procfs.c (procfs_xfer_partial): New function.
+ (init_procfs_ops): Use that for procfs_ops.to_xfer_partial.
+ * Makefile.in (procfs.o): Add $(auxv_h) dep.
+
+ * config/nm-linux.h (NATIVE_XFER_AUXV): New macro, uses auxv.c's
+ procfs_xfer_auxv function.
+
+ * procfs.c (procfs_make_note_section): If we can read
+ TARGET_OBJECT_AUXV data, add an NT_AUXV note containing it.
+ * linux-proc.c (linux_make_note_section): Likewise.
+
+ * auxv.h: New file.
+ * auxv.c: New file.
+ * Makefile.in (auxv_h): New variable.
+ (COMMON_OBS): Add auxv.o here.
+ (auxv.o): New target.
+
+ * corelow.c (core_xfer_partial): New function.
+ (init_core_ops): Use it for core_ops.to_xfer_partial.
+
+ * target.h (enum target_object): Add TARGET_OBJECT_AUXV.
+ * inftarg.c (child_xfer_partial): Support it using NATIVE_XFER_AUXV
+ macro if that is defined.
+
+2004-02-01 Daniel Jacobowitz <drow@mvista.com>
+
+ * breakpoint.c (bpstat_stop_status): Take a ptid_t argument,
+ and check the specified thread for each breakpoint.
+ * breakpoint.h (bpstat_stop_status): Update prototype.
+ * infrun.c (handle_inferior_event): Update calls to
+ bpstat_stop_status.
+
+2004-02-01 Daniel Jacobowitz <drow@mvista.com>
+
+ * Makefile.in (cli-cmds.o): Add $(readline_h).
+
+2004-02-01 Daniel Jacobowitz <drow@mvista.com>
+
+ * cli/cli-cmds.c: Include readline.h.
+ (complete_command): Pass the start of the last word to
+ complete_line.
+
+2004-01-31 Daniel Jacobowitz <drow@mvista.com>
+
+ * breakpoint.c (bpstat_stop_status): Remove not_a_sw_breakpoint
+ argument, and change first argument to a CORE_ADDR.
+ * breakpoint.h (bpstat_stop_status): Update prototype.
+ * infrun.c (adjust_pc_after_break): Add a new comment.
+ (handle_inferior_event): Update calls to bpstat_stop_status.
+
+2004-01-31 Daniel Jacobowitz <drow@mvista.com>
+
+ * breakpoint.h: Update copyright years.
+
+2004-01-31 Daniel Jacobowitz <drow@mvista.com>
+
+ * breakpoint.c (software_breakpoint_inserted_here_p): New function.
+ (bpstat_stop_status): Don't decrement PC.
+ * breakpoint.h (software_breakpoint_inserted_here_p): Add
+ prototype.
+ * infrun.c (adjust_pc_after_break): New function.
+ (handle_inferior_event): Call it, early. Remove later references
+ to DECR_PC_AFTER_BREAK.
+ (normal_stop): Add commentary.
+
+2004-01-31 Daniel Jacobowitz <drow@mvista.com>
+
+ * breakpoint.c (breakpoint_re_set_one): Add missing chunk of
+ 2004-01-27 double-free fix.
+
+2004-01-31 Mark Kettenis <kettenis@gnu.org>
+
+ * sparc-tdep.c (sparc_fetch_wcookie): New function.
+ (sparc32_frame_prev_register): Handle StackGhost.
+ (sparc_supply_rwindow, sparc_collect_rwindow): Likewise.
+
+2004-01-29 Roland McGrath <roland@redhat.com>
+
+ * configure.in (NEW_PROC_API): Also match solaris2.9 for this test.
+ * configure: Regenerated.
+
+ * procfs.c: Include gdb_string.h for str* decls, otherwise warnings.
+ * Makefile.in (procfs.o): Add dep.
+
+2004-01-28 Andrew Cagney <cagney@redhat.com>
+
+ * tui/tui-stack.h: Update copyright.
+ (struct frame_info): Add opaque declaration.
+ (tui_update_locator_filename): Rename tuiUpdateLocatorFilename.
+ (tui_show_locator_content): Rename tuiShowLocatorContent.
+ (tui_show_frame_info): Rename tuiShowFrameInfo.
+ * tui/tui-stack.c: Update copyright. Update references.
+ * tui/tui-winsource.c: Update references.
+ * tui/tui-win.c: Update references.
+ * tui/tui-layout.c: Update references.
+ * tui/tui-hooks.c: Update copyright, update references.
+ * tui/tui.c: Update copyright, update references.
+ * tui/tui-disasm.c: Update references.
+
+2004-01-28 David Carlton <carlton@kealia.com>
+
+ * dwarf2read.c (add_partial_structure): Use demangled name if
+ namespace equals "".
+
+2004-01-27 Jim Blandy <jimb@redhat.com>
+
+ Clean up misapplied patch:
+ * dwarf2read.c (determine_prefix): Change one of the two forward
+ declarations for 'determine_prefix_aux' to a declaration for this.
+ (read_func_scope): Use cu->language, not cu_language. Pass 'cu'
+ argument to 'die_specification'.
+
+ * dwarf2read.c (read_func_scope): Re-indent comment.
+
+2004-01-27 Paul N. Hilfinger <hilfinger@gnat.com>
+
+ * breakpoint.c (breakpoint_re_set_one): Set b->cond, b->val, and
+ b->exp to NULL after freeing so that error during re-parsing or
+ evaluation of expressions associated with breakpoint don't
+ eventually lead to re-freeing of storage.
+ Committed by Andrew Cagney.
+
+2004-01-27 Andrew Cagney <cagney@redhat.com>
+
+ * source.c (ambiguous_line_spec): Delete undefined declaration.
+ * m32r-rom.c (m32r_set_board_address): Delete unused function.
+ (m32r_set_server_address, m32r_set_download_path): Ditto.
+ * remote-fileio.c (remote_fileio_to_fio_int): Ditto.
+
+2004-01-27 Daniel Jacobowitz <drow@mvista.com>
+
+ * dwarf2read.c: Update calls to changed and renamed functions, and
+ references to moved variables.
+
+ (struct dwarf2_cu): Add first_fn, last_fn, cached_fn,
+ language, language_defn, list_in_scope, and ftypes members.
+ (cu_first_fn, cu_last_fn, cu_cached_fn, cu_language)
+ (cu_language_defn, list_in_scope, ftypes, cu_header_offset)
+ (baseaddr): Remove globals.
+
+ (dwarf_attr): Renamed to dwarf2_attr. Add CU argument.
+ (set_cu_language, die_is_declaration, die_specification)
+ (determine_prefix, determin_prefix_aux, class_name, namespace_name)
+ (dwarf2_linkage_name, dwarf2_name, dwarf2_extension)
+ (dwarf2_get_ref_die_offset, dwarf2_fundamental_type)
+ (initialize_cu_func_list, add_to_cu_func_list): Add CU argument.
+
+ (dwarf2_build_psymtabs_hard): Add local baseaddr. Initialize
+ cu.list_in_scope. Don't initialize cu_header_offset.
+ (add_partial_symbol): Add local baseaddr.
+ (psymtab_to_symtab_1): Add local baseaddr. Use
+ objfile->section_offsets for consistency. Don't initialize
+ cu_header_offset; do initialize cu.header.offset and
+ cu.list_in_scope.
+ (read_file_scope, read_func_scope, read_lexical_block_scope)
+ (dwarf_decode_lines, new_symbol): Add local baseaddr.
+
+2004-01-27 Michael Chastain <mec.gnu@mindspring.com>
+
+ * PROBLEMS: Add gdb/1516.
+
+2003-12-29 Robert Millan <robertmh@gnu.org>
+
+ Patch committed by Andrw Cagney.
+ * configure.host: Match knetbsd*-gnu and kfreebsd*-gnu.
+ * configure.tgt: Match knetbsd*-gnu.
+
+2004-01-26 Andrew Cagney <cagney@redhat.com>
+
+ * breakpoint.c (catch_command_1): Delete #ifdef code.
+ (catch_fork_command_1): Delete #ifdef wrapper.
+ (catch_exec_command_1): Ditto.
+ (catch_load_command_1): Ditto.
+ (catch_unload_command_1): Ditto.
+
+ * breakpoint.c (watchpoint_check): Delete #if0ed variable.
+ (catch_breakpoint): Delete #if0ed function.
+ (disable_catch_breakpoint): Ditto.
+ (delete_catch_breakpoint, enable_catch_breakpoint): Ditto.
+ (disable_catch, enable_catch, delete_catch): Ditto.
+
+2004-01-26 Andrew Cagney <cagney@redhat.com>
+
+ * remote.c (echo_check, quit_flag): Delete variables.
+ (cisco_kernel_mode): Delete variable.
+ (minitelnet_return, tty_input, escape_count): Delete variables.
+ (remote_cisco_mode): Delete variable.
+ (remote_cisco_open, remote_cisco_close): Delete function.
+ (remote_cisco_mourn, remote_cisco_wait): Delete function.
+ (init_remote_cisco_ops): Delete function.
+ (_initialize_remote): Do not install "remote cisco" code.
+ (read_frame): Delete cisco specific code.
+ (remote_info_process): Delete function.
+ (remote_wait): Delete cisco specific code.
+ (remote_cisco_section_offsets): Delete function.
+ (remote_cisco_objfile_relocate): Delete function.
+ (remote_async_wait): Delete cisco specific code.
+ (minitelnet, readtty, readsocket): Delete function.
+
+2004-01-26 Andrew Cagney <cagney@redhat.com>
+
+ * gdbarch.sh (EXTRACT_STRUCT_VALUE_ADDRESS): Deprecate. Add
+ comments mentioning extract_returned_value_address.
+ * infcmd.c (print_return_value): Update. Add comments on
+ extract_returned_value_address.
+ * stack.c (return_command): Add comments on
+ extract_returned_value_address.
+ * values.c: Update comment.
+ * m32r-tdep.c: Update comment.
+ * sparc-tdep.c: Update comment.
+ * ia64-tdep.c (ia64_use_struct_convention): Update comment.
+ * xstormy16-tdep.c (xstormy16_gdbarch_init): Update.
+ * sh64-tdep.c (sh64_gdbarch_init): Update.
+ * sh-tdep.c (sh_gdbarch_init): Update.
+ * s390-tdep.c (s390_gdbarch_init): Update.
+ * rs6000-tdep.c (rs6000_gdbarch_init): Update.
+ * m68klinux-tdep.c (m68k_linux_init_abi): Update.
+ * m68k-tdep.c (m68k_gdbarch_init): Update.
+ * m68hc11-tdep.c (m68hc11_gdbarch_init): Update.
+ * m32r-tdep.c (m32r_gdbarch_init): Update.
+ * ia64-tdep.c (ia64_gdbarch_init): Update.
+ * h8300-tdep.c (h8300_gdbarch_init): Update.
+ * frv-tdep.c (frv_gdbarch_init): Update.
+ * arm-tdep.c (arm_gdbarch_init): Update.
+ * alpha-tdep.c (alpha_gdbarch_init): Update.
+
+2004-01-26 Andrew Cagney <cagney@redhat.com>
+
+ * dwarf2loc.c (dwarf_expr_frame_base): Use SYMBOL_OPS instead of
+ SYMBOL_LOCATION_FUNCS
+ (dwarf2_loclist_funcs, dwarf2_locexpr_funcs): Change type to
+ "struct symbol_ops".
+ * dwarf2loc.h (dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Change
+ type to "struct symbol_ops".
+ * symtab.h (struct symbol_ops): Rename "struct location_funcs".
+ (struct symbol): Replace ".aux_value.loc.funcs" and
+ ".aux_value.loc.baton" with ".ops" and ".aux_value.ptr".
+ (SYMBOL_OBJFILE): Delete macro.
+ (SYMBOL_LOCATION_FUNCS): Delete macro.
+ (SYMBOL_LOCATION_BATON): Update.
+ * dwarf2read.c (dwarf2_symbol_mark_computed): Set SYMBOL_OPS
+ intead of SYMBOL_LOCATION_FUNCS.
+ * ax-gdb.c (gen_var_ref): Ditto.
+ * printcmd.c (address_info): Ditto.
+ * findvar.c (read_var_value): Ditto.
+ (symbol_read_needs_frame): Ditto.
+
+2004-01-26 Andrew Cagney <cagney@redhat.com>
+
+ * dwarf2read.c (read_func_scope): Document frame-base hack.
+
+2004-01-25 Mark Kettenis <kettenis@gnu.org>
+
+ * infcmd.c (print_return_value): Plug memory leak; delete
+ ui_stream object. Rename argument `structure_return' to
+ `struct_return'.
+
+2004-01-25 Mark Kettenis <kettenis@gnu.org>
+
+ * infcmd.c (print_return_value): Wrap long lines.
+ (finish_command_continuation, finish_command): Remove unused
+ variable `funcaddr'. Fix some coding-standards problems.
+
+ * sparc-tdep.c (sparc_regset_from_core_section): Check whether
+ SECT_SIZE is large enough, not wheter it's exactly the right size.
+ (sparc32_gdbarch_init): Initialize TDEP->sizeof_gregset and
+ TDEP->fpregset to zero.
+
+ * sparcnbsd-tdep.c (sparc32nbsd_supply_gregset): Also supply the
+ floating-point registers for traditional NetBSD core files.
+ (sparc32nbsd_init_abi): Initialize TDEP->sizeof_gregset and
+ TDEP->sizeof_fpregset here.
+
+2004-01-25 Mark Kettenis <kettenis@gnu.org>
+
+ * sparc-tdep.h (sparc32nbsd_sigcontext_saved_regs): New prototype.
+ * sparcnbsd-tdep.c (sparc32nbsd_sigcontext_saved_regs): New
+ function with code split out from
+ sparc32nbsd_sigcontext_frame_cache.
+ (sparc32nbsd_sigcontext_frame_cache): Use
+ sparc32nbsd_sigcontext_saved_regs.
+ (_initialize_sparc32nbsd_tdep): Don't register OS ABI handler for
+ OpenBSD.
+ * sparcobsd-tdep.c: New file.
+ * Makefile.in (ALLDEPFILES): Add sparcobsd-tdep.c.
+ (sparcobsd-tdep.o): New dependency.
+ * configure.tgt (sparc-*-openbsd*): Set gdb_target to obsd.
+ * config/sparc/obsd.mt: New file.
+
+ * sparc-tdep.c (sparc32_gdbarch_init): Don't require
+ TDEP->fpregset to be initialized to enable core file register
+ sets.
+
+2004-01-24 Mark Kettenis <kettenis@gnu.org>
+
+ * sparc64-tdep.h (struct frame_info, struct trad_frame_saved_reg):
+ Add opaque declarations.
+ (sparc64nbsd_sigcontext_saved_regs): New prototype.
+ * sparc64nbsd-tdep.c (sparc64nbsd_sigcontext_saved_regs): New
+ function with code split out from
+ sparc64nbsd_sigcontext_frame_cache.
+ (sparc64nbsd_sigcontext_frame_cache): Use
+ sparc64nbsd_sigcontext_saved_regs.
+ (_initialize_sparc64nbsd_tdep): Don't register OS ABI handler for
+ OpenBSD.
+ * sparc64obsd-tdep.c: New file.
+ * Makefile.in (ALLDEPFILES): Add sparc64obsd-tdep.c.
+ (sparc64obsd-tdep.o): New dependency.
+ * configure.tgt (sparc64-*-openbsd*): Set gdb_target to obsd64 and
+ gdb_osabi to GDB_OSABI_OPENBSD_ELF.
+ * config/sparc/obsd64.mt: New file.
+
+ * sparc-tdep.c (sparc_fetch_instruction): Return zero if we can't
+ read the instruction at PC.
+
+ * sparcnbsd-tdep.c (GDB_OSABI_NETBSD_CORE): Define, based on the
+ value of GDB_OSABI_DEFAULT.
+ (sparcnbsd_core_osabi_sniffer): Return GDB_OSABI_NETBSD_CORE
+ instead of GDB_OSABI_NETBSD_AOUT.
+
+2004-01-24 Nick Roberts <nick@nick.uklinux.net>
+
+ * mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-cmds.h: Update
+ copyright.
+
+2004-01-23 Andrew Cagney <cagney@redhat.com>
+
+ * printcmd.c (display_command): Replace tui_set_display call with
+ tui_set_layout_for_display_command.
+ * tui/tui.h (enum tui_win_type): Define.
+ (tui_set_layout): Delete declaration.
+ (tui_set_layout_for_display_command): Rename set_tui_layout.
+ * tui/tui-data.h (enum tui_layout_type): Define.
+ * tui/tui-layout.h: Update copyright. Include "tui-data.h" and
+ "tui.h".
+ (tui_add_win_to_layout): Rename tuiAddWinToLayout.
+ (tui_default_win_height): Rename tuiDefaultWinHeight.
+ (tui_default_win_viewport_height): Rename
+ tuiDefaultWinViewportHeight.
+ (tui_set_layout): RenametuiSetLayout.
+ * tui/tui-layout.c: Update references.
+ * tui/tui.c: Update references.
+ * tui/tui-disasm.c: Update references.
+
+2004-01-23 David Carlton <carlton@kealia.com>
+
+ Partial workaround for PR c++/1511:
+ * cp-namespace.c: Include frame.h.
+ (cp_lookup_transparent_type): New
+ (cp_lookup_transparent_type_loop): New.
+ * cp-support.h: Declare cp_lookup_transparent_type.
+ * symtab.c (basic_lookup_transparent_type): Renamed from
+ lookup_transparent_type.
+ (lookup_transparent_type): Replace old body by a call to
+ current_language->la_lookup_transparent_type.
+ * symtab.h: Update copyright. Declare
+ basic_lookup_transparent_type.
+ * language.h: Update copyright.
+ (struct language_defn): Add la_lookup_transparent_type.
+ * language.c: Update copyright.
+ (unknown_language_defn): Add basic_lookup_transparent_type.
+ (auto_language_defn): Add basic_lookup_transparent_type.
+ (local_language_defn): Add basic_lookup_transparent_type.
+ * ada-lang.c: Update copyright.
+ (ada_language_defn): Add basic_lookup_transparent_type.
+ * c-lang.c: Update copyright.
+ (c_language_defn): Add basic_lookup_transparent_type.
+ (cplus_language_defn): Add basic_lookup_transparent_type.
+ (asm_language_defn): Add basic_lookup_transparent_type.
+ (minimal_language_defn): Add basic_lookup_transparent_type.
+ * f-lang.c: Update copyright.
+ (f_language_defn): Add basic_lookup_transparent_type.
+ * jv-lang.c: Update copyright.
+ (java_language_defn): Add basic_lookup_transparent_type.
+ * m2-lang.c: Update copyright.
+ (m2_language_defn): Add basic_lookup_transparent_type.
+ * objc-lang.c: Update copyright.
+ (objc_language_defn): Add basic_lookup_transparent_type.
+ * p-lang.c: Update copyright.
+ (p_language_defn): Add basic_lookup_transparent_type.
+ * scm-lang.c: Update copyright.
+ (scm_language_defn): Add basic_lookup_transparent_type.
+ * Makefile.in (cp-namespace.o): Depend on frame.h.
+
+2004-01-23 David Carlton <carlton@kealia.com>
+
+ Patch for PR c++/1520:
+ * dwarf2read.c (read_func_scope): Set processing_current_prefix
+ properly if we have a specification die.
+ (determine_prefix_aux): Rename from determine_prefix.
+ (determine_prefix): Like the old determine_prefix, but never
+ returns NULL.
+
+2004-01-23 Theodore A. Roth <troth@openavr.org>
+
+ * avr-tdep.c: Update copyright.
+ (avr_iaddr_p): Delete unused function.
+ (avr_saddr_p): Delete unused function.
+
+2004-01-23 David Carlton <carlton@kealia.com>
+
+ * symfile.c (reread_symbols): Clear objfile->cp_namespace_symtab.
+ Fix for PR symtab/1534.
+
+2004-01-23 Mark Kettenis <kettenis@gnu.org>
+
+ * NEWS (New native configurations): Mention OpenBSD/sparc and
+ OpenBSD/sparc64.
+ * configure.tgt: Add sparc-*-openbsd* and sparc64-*-openbsd*.
+ * configure.host: Likewise.
+ * sparcnbsd-tdep.c (_initialize_sparnbsd_tdep): Register OS ABI
+ handler for OpenBSD.
+ * sparc64nbsd-tdep.c (_initialize_sparc64nbsd_tdep): Likewise.
+
+2004-01-22 Mark Kettenis <kettenis@gnu.org>
+
+ * sparcnbsd-tdep.c (sparcnbsd_core_osabi_sniffer): New function.
+ (_initialize_sparnbsd_tdep): Register sparcnbsd_core_osabi_sniffer.
+
+ * ser-pipe.c (pipe_open): Use proper null pointer in execl call.
+ * cli/cli-cmds.c (shell_escape): Likewise.
+
+ * osabi.c (generic_elf_osabi_sniff_abi_tag_sections): Recognize
+ OpenBSD .note.openbsd.ident sections.
+
+2004-01-22 David Carlton <carlton@kealia.com>
+
+ * dwarf2read.c (psymtab_to_symtab_1): Calculate lowpc, highpc via
+ get_scope_pc_bounds.
+ (read_file_scope): Ditto.
+ (get_scope_pc_bounds): New function, produced by extracting code
+ from the above two functions, consolidating it, and adding support
+ for DW_TAG_namespace.
+
+2004-01-22 Mark Kettenis <kettenis@gnu.org>
+
+ * osabi.c (MAX_NOTESZ): New define.
+ (check_note): New function.
+ (generic_elf_osabi_sniff_abi_tag_sections): Reorganize code using
+ check_note.
+
+2004-01-21 Roland McGrath <roland@redhat.com>
+
+ * MAINTAINERS (write after approval): Add myself.
+
+2004-01-21 Eli Zaretskii <eliz@gnu.org>
+
+ * utils.c (init_page_info): Move declarations of `rows' and
+ `cols' before the __GO32__-specific code. Move the closing brace
+ outside the #ifdef __GO32__..#endif block.
+ [__GO32__]: Use `rows' and `cols' to avoid compiler warnings.
+
+2004-01-21 Paul Brook <paul@codesourcery.com>
+
+ * infrun.c (handle_inferior_event): Check stop_stack_dummy if handling
+ BPSTAT_WHAT_CHECK_SHLIBS.
+
+2004-01-21 Paul Brook <paul@codesourcery.com>
+
+ * MAINTAINERS: Add myself to write-after-approval.
+
+2004-01-20 Andrew Cagney <cagney@redhat.com>
+
+ * ax-gdb.c (print_axs_value): Delete unused function.
+ * jv-lang.c (java_lookup_type): Delete unused function.
+ * cli/cli-dump.c (dump_filetype): Delete unused function.
+ * remote-mips.c (remote_mips_insert_hw_breakpoint)
+ (remote_mips_remove_hw_breakpoint): Delete unused functions.
+ (mips_getstring): Delete unused function.
+ (pmon_insert_breakpoint): Delete #if0ed function.
+ (PMON_MAX_BP): Delete #if0ed MACRO.
+ (mips_pmon_bp_info): Delete #if0ed variable.
+ (pmon_remove_breakpoint): Delete #if0ed function.
+ * monitor.c (monitor_write_even_block): Delete unused function.
+ (monitor_write_memory_block): Delete #if0ed code.
+ * dink32-rom.c (dink32_load): Delete unused function.
+ (_initialize_dink32_rom): Delete #if0ed code.
+ * d10v-tdep.c (d10v_daddr_p): Delete unused function.
+
+ * tui/tui-command.c: Update references.
+ * tui/tui-io.c: Update references.
+ * tui/tui-command.h: Update copyright.
+ (tui_dispatch_ctrl_char): Rename tuiDispatchCtrlChar.
+
+ * source.c (ambiguous_line_spec): Delete never-defined function.
+ * remote-rdi.c (arm_rdi_mourn, arm_rdi_send): Ditto.
+ * gdbtypes.c (add_name, add_mangled_type): Ditto.
+ * cli/cli-cmds.c (validate_comname): Ditto.
+
+ * tui/tui-disasm.h: Update copyright. Include "tui.h" and
+ "tui-data.h".
+ (tui_set_disassem_content): Rename tuiSetDisassemContent.
+ (tui_show_disassem): Rename tuiShowDisassem.
+ (tui_show_disassem_and_update_source): Rename
+ tuiVerticalDisassemScroll.
+ (tui_vertical_disassem_scroll): Rename tuiVerticalDisassemScroll.
+ (tui_get_begin_asm_address): Rename tuiGetBeginAsmAddress.
+ * tui/tui.h: Update copyright.
+ (enum tui_status): Define.
+ * tui/tui-data.h (enum tui_scroll_direction): Define.
+ * tui/tui-disasm.c: Update copyright. Update references.
+ * tui/tui-winsource.c: Update copyright. Update references.
+ * tui/tui-win.c: Update references.
+ * tui/tui-layout.c: Update references.
+
+2004-01-20 Andrew Cagney <cagney@redhat.com>
+
+ * mi/mi-cmd-stack.c (list_args_or_locals): Move declaration of
+ sym2 to start of block.
+
+2004-01-19 Michael Chastain <mec.gnu@mindspring.com>
+
+ * MAINTAINERS: Delete mmalloc.
+ * Makefile.in: Delete MMALLOC, MMALLOC_CFLAGS, -lmmalloc, mmalloc_h.
+ * NEWS: Mention removal of --with-malloc.
+ * acconfig.h: Delete USE_MMALLOC, MMCHECK_FORCE.
+ * config.in: Regenerate.
+ * configure: Regenerate.
+ * configure.in: Delete MMALLOC_CFLAGS, MMALLOC, --with-mmalloc,
+ USE_MMALLOC, MMCHECK_FORCE.
+ * gdbinit.in: Remove mmalloc.
+ * utils.c: Delete USE_MMALLOC, NO_MMCHECK, MMCHECK_FORCE, malloc_botch.
+ * config/alpha/alpha-linux.mh: Delete MMALLOC, MMALLOC_CFLAGS.
+ * config/i386/go32.mh: Likewise.
+ * config/i386/interix.mh: Likewise.
+ * config/powerpc/xm-linux.h: Delete MMAP_BASE_ADDRESS, MMAP_INCREMENT.
+
+2004-01-19 Jeff Johnston <jjohnstn@redhat.com>
+
+ * linespec.c (decode_variable, symtab_from_filename): Call
+ error_silent with error message instead of throwing an exception
+ directly.
+ * defs.h (error_silent, error_output_message): Add prototypes.
+ (catch_exceptions_with_msg): Ditto.
+ * utils.c (error_silent, error_output_message): New functions.
+ * top.c (catch_exceptions_with_msg): New function.
+
+2004-01-20 Nick Roberts <nick@nick.uklinux.net>
+
+ * mi/mi-cmds.h (enum print_values): Add definition.
+
+ * mi/mi-cmd-stack.c (mi_cmd_stack_list_locals): Print the name,
+ type and value for simple data types and just the name and type
+ for complex ones, if required.
+
+ * mi/mi-cmd-var.c (mi_cmd_var_list_children): Print the values of the
+ children, if required.
+
+2004-01-19 Kevin Buettner <kevinb@redhat.com>
+
+ * frv-tdep.c (frv_push_arguments, frv_saved_pc_after_call): Delete
+ unused declarations.
+
+2004-01-19 Andrew Cagney <cagney@redhat.com>
+
+ * top.h (mapped_symbol_files): Delete declaration.
+ * main.c (captured_main): Delete option "m" and "mapped".
+ * objfiles.c (mapped_symbol_files): Delete variable.
+ * symfile.c (symbol_file_command): Delete mmap code.
+ (symbol_file_add_with_addrs_or_offsets): Ditto.
+ (add_symbol_file_command, reread_separate_symbols): Ditto.
+ * objfiles.h (OBJF_MAPPED): Delete.
+ * objfiles.c (allocate_objfile) [USE_MMALLOC]: Delete.
+ (free_objfile) [USE_MMALLOC]: Ditto.
+ (open_existing_mapped_file): Delete function.
+ (open_mapped_file): Delete function.
+ (map_to_file): Delete function.
+
+2004-01-19 Kevin Buettner <kevinb@redhat.com>
+
+ * infrun.c (step_into_function): Account for possible breakpoint
+ adjustment when computing ``stop_func_start''.
+
+2004-01-19 Kevin Buettner <kevinb@redhat.com>
+
+ * target.c (default_region_size_ok_for_hw_watchpoint): Compare
+ the region size against the size of a pointer, not the size of
+ a register as given by DEPRECATED_REGISTER_SIZE.
+
+2004-01-19 Andrew Cagney <cagney@redhat.com>
+
+ * tui/tui-regs.h: Include "tui-data.h".
+ (tuiFirstRegElementNoInLine): Delete declaration.
+ (tui_display_registers_from): Rename tuiDisplayRegistersFrom.
+ (tui_last_regs_line_no): Rename tuiLastRegsLineNo.
+ (tui_line_from_reg_element_no): Rename tuiLineFromRegElementNo.
+ (tui_calculate_regs_column_count): Rename
+ tuiCalculateRegsColumnCount.
+ (tui_check_register_values): Rename tuiCheckRegisterValues.
+ (tui_show_registers): Rename tuiShowRegisters.
+ (tui_display_registers_from_line): Rename
+ tuiDisplayRegistersFromLine.
+ (tui_first_reg_element_inline): Rename tuiFirstRegElementInLine.
+ (tui_toggle_float_regs): Rename tuiToggleFloatRegs.
+ (tui_first_reg_element_no_inline): Rename
+ tuiFirstRegElementNoInLine.
+ * tui/tui-data.h: Update copyright.
+ (enum tui_register_display_type): Rename _TuiRegisterDisplayType.
+ * tui/tui-windata.c: Update copyright, update references.
+ * tui/tui-regs.c: Update copyright, update references.
+ * tui/tui-win.c: Update copyright, update references.
+ * tui/tui-layout.c: Update copyright, update references.
+
+2004-01-18 Andrew Cagney <cagney@redhat.com>
+
+ * tui/tui-io.c: Update copyright.
+ (key_is_end_sequence, key_is_backspace): New functions.
+ (key_is_command_char, key_is_start_sequence): New function.
+ (tui_getc): Update references.
+ * tui/tui-io.h: Update copyright.
+ (m_tuiStartNewLine): Delete macro.
+ (m_isBackspace, m_isDeleteChar): Delete macros.
+ (m_isDeleteLine, m_isDeleteToEol): Delete macros.
+ (m_isNextPage, m_isPrevPage): Delete macros.
+ (m_isLeftArrow, m_isRightArrow): Delete macros.
+ (m_isXdbStyleCommandChar): Delete macro.
+ (key_is_start_sequence): Declare, replace m_isStartSequence.
+ (key_is_end_sequence): Declare, replace m_isEndSequence.
+ (key_is_backspace): Declare ,replace m_isBackspace.
+ (key_is_command_char): Declare, replace m_isCommandChar.
+ * tui/tui-command.c: Update copyright.
+ (tuiDispatchCtrlChar): Update references.
+
+ * config/djgpp/fnchange.lst: Delete tui/tuiSourceWin.c and
+ tuiSourceWin.h.
+
+ * tui/tui-command.c: Rename tui/tuiCommand.c.
+ * tui/tui-command.h: Rename tui/tuiCommand.h.
+ * tui/tui-data.c: Rename tui/tuiData.c.
+ * tui/tui-data.h: Rename tui/tuiData.h.
+ * tui/tui-disasm.c: Rename tui/tuiDisassem.c.
+ * tui/tui-disasm.h: Rename tui/tuiDisassem.h.
+ * tui/tui-io.c: Rename tui/tuiIO.c.
+ * tui/tui-io.h: Rename tui/tuiIO.h.
+ * tui/tui-layout.c: Rename tui/tuiLayout.c.
+ * tui/tui-layout.h: Rename tui/tuiLayout.h.
+ * tui/tui-regs.c: Rename tui/tuiRegs.c.
+ * tui/tui-regs.h: Rename tui/tuiRegs.h.
+ * tui/tui-source.c: Rename tui/tuiSource.c.
+ * tui/tui-source.h: Rename tui/tuiSource.h.
+ * tui/tui-stack.c: Rename tui/tuiStack.c.
+ * tui/tui-stack.h: Rename tui/tuiStack.h.
+ * tui/tui-win.c: Rename tui/tuiWin.c.
+ * tui/tui-win.h: Rename tui/tuiWin.h.
+ * tui/tui-windata.c: Rename tui/tuiDataWin.c.
+ * tui/tui-windata.h: Rename tui/tuiDataWin.h.
+ * tui/tui-wingeneral.c: Rename tui/tuiGeneralWin.c.
+ * tui/tui-wingeneral.h: Rename tui/tuiGeneralWin.h.
+ * tui/tui-winsource.c: Rename tui/tuiSourceWin.c.
+ * tui/tui-winsource.h: Rename tui/tuiSourceWin.h.
+ * tui/tui-file.c: Update includes.
+ * tui/tui-hooks.c: Update includes.
+ * tui/tui-interp.c: Update includes.
+ * tui/tui.c: Update includes.
+ * Makefile.in: Update all tui/ dependencies.
+ (SUBDIR_TUI_OBS, SUBDIR_TUI_SRCS): Update file names.
+
+ * Makefile.in: Update copyright. Update dependencies.
+
+ * tui/tuiSourceWin.c (tui_update_breakpoint_info): Fix compile
+ problem.
+
+2004-01-18 Andrew Cagney <cagney@redhat.com>
+
+ * mn10300-tdep.c (_initialize_mn10300_tdep): Call gdbarch_register
+ instead of register_gdbarch_init.
+
+ * remote-sds.c (tohex): Delete unused function. Update copyright.
+ * xstormy16-tdep.c (xstormy16_register_virtual_size): Ditto.
+ * v850-tdep.c (v850_register_virtual_size): Ditto.
+ * target.c (normal_target_post_startup_inferior): Ditto.
+ * source.c (ambiguous_line_spec): Ditto.
+ * remote.c (adapt_remote_get_threadinfo): Ditto.
+ * mi/mi-out.c (out_field_fmt): Ditto.
+ * mi/mi-interp.c (mi_interp_read_one_line_hook): Ditto.
+ (output_control_change_notification): Ditto.
+ * m68k-tdep.c (m68k_register_byte): Ditto.
+ (m68k_remote_breakpoint_from_pc): Ditto.
+ * ui-out.c (init_ui_out_state): Delete unused declaration.
+ * stabsread.c (search_value): Ditto.
+ * mi/mi-cmd-env.c (env_cli_command): Ditto.
+ * maint.c (print_section_table): Ditto.
+ * infrun.c (set_follow_fork_mode_command): Ditto.
+
+2004-01-18 Mark Kettenis <kettenis@gnu.org>
+
+ * dwarf2-frame.c (execute_cfa_program): Move DWA_CFA_nop before
+ DW_CFA_def_cfa_exporession. Add support for
+ DW_CFA_offset_extendend_sf, DW_CFA_def_cfa_sf and
+ DW_CFA_def_cfa_offset_sf. This should fix PR backtrace/1391.
+
+2004-01-18 Andrew Cagney <cagney@redhat.com>
+
+ * ocd.c: Update copyright.
+ (bdm_read_register_command): Delete unused function.
+ (_initialize_remote_ocd): Delete commented out reference.
+ (get_quoted_char, reset_packet): Delete #if0ed function.
+ (output_packet, put_quoted_char): Delete #if0ed function.
+ (stu_put_packet, stu_get_packet): Delete #if0ed function.
+ (ocd_start_remote): Delete #if0ed code, remove #if1 wrapper.
+ (BDM_BREAKPOINT): Delete #if0ed macro.
+ (remote_timeout): Delete #if0ed variable.
+
+2004-01-18 Mark Kettenis <kettenis@gnu.org>
+
+ * Makefile.in (ALLDEPFILES): Remove core-sol2.c.
+ (core-sol2.o): Remove dependency.
+ * core-sol2.c: Remove file.
+
+2004-01-17 Andrew Cagney <cagney@redhat.com>
+
+ * mdebugread.c (compare_blocks): Make addr_diff a LONGEST.
+ * block.h: Make GLOBAL_BLOCK, STATIC_BLOCK, FIRST_LOCAL_BLOOCK
+ enums.
+
+2004-01-17 Daniel Jacobowitz <drow@mvista.com>
+
+ * remote.c: Update copyright years.
+
+2004-01-17 Daniel Jacobowitz <drow@mvista.com>
+
+ * remote.c (remote_vcont_resume): Use xstrprintf instead of sprintf.
+
+2004-01-17 Andrew Cagney <cagney@redhat.com>
+
+ * mdebugread.c: Update copyright.
+ (parse_symbol): Replace DEPRECATED_STREQ with strcmp.
+ (parse_type, parse_procedure): Ditto.
+ (parse_partial_symbols, psymtab_to_symtab_1): Ditto.
+
+ * cris-tdep.c (cris_store_struct_return): Put back accidently
+ deleted function.
+
+ * gdbarch.sh: Update copyright year.
+ * gdbarch.h, gdbarch.c: Re-generate.
+
+2004-01-17 Daniel Jacobowitz <drow@mvista.com>
+
+ Suggested by George Anzinger.
+ * dwarf2expr.c (execute_stack_op): Fetch the second item from the
+ correct stack offset. Include unknown opcode numbers in the error
+ message.
+
+2004-01-17 Andrew Cagney <cagney@redhat.com>
+
+ * x86-64-tdep.c (x86_64_init_abi): No need to clear
+ extract_struct_value_address, i386 does not set it.
+ * sparc64-tdep.c (sparc64_init_abi): Do not set
+ extract_struct_value_address, never called.
+ (sparc64_extract_struct_value_address): Delete function.
+ * m68hc11-tdep.c: Update copyright.
+ (m68hc11_gdbarch_init): Delete redundant assignment of
+ extract_struct_value_address.
+ * i386-tdep.c: Update copyright.
+ (i386_gdbarch_init): Do not set extract_struct_value_address,
+ never called.
+ (i386_extract_struct_value_address): Delete function.
+ * sparc-tdep.c (sparc32_gdbarch_init): Do not set
+ extract_struct_value_address, never called.
+ (sparc32_extract_struct_value_address): #if 0 function. Add
+ comments explaining its future.
+
+2004-01-17 Daniel Jacobowitz <drow@mvista.com>
+
+ * arm-tdep.c (arm_write_pc): New function.
+ (arm_gdbarch_init): Call set_gdbarch_write_pc.
+
+2004-01-17 Daniel Jacobowitz <drow@mvista.com>
+
+ * breakpoint.c (must_shift_inst_regs): Delete.
+ (bpstat_stop_status): Delete references to DECR_PC_AFTER_HW_BREAK
+ and SHIFT_INST_REGS.
+ * infcmd.c (step_1, step_1_continuation): Delete references to
+ SHIFT_INST_REGS.
+ * infrun.c (keep_going): Likewise.
+ * target.h (DECR_PC_AFTER_HW_BREAK): Don't define.
+ * config/i386/nm-i386.h (DECR_PC_AFTER_HW_BREAK): Likewise.
+
+2004-01-17 Andrew Cagney <cagney@redhat.com>
+
+ * gdbarch.sh (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS): Delete.
+ * gdbarch.h, gdbarch.c: Re-generate.
+ * infcmd.c (print_return_value): Delete reference to
+ DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS.
+
+ * cris-tdep.c (cris_gdbarch_init): Do not set
+ deprecated_extract_struct_value_address.
+
+ * xstormy16-tdep.c: Update copyright.
+ (xstormy16_extract_struct_value_address): Update to current
+ extract struct value address interface.
+ (xstormy16_gdbarch_init): Set extract_struct_value_address.
+ * sh64-tdep.c (sh64_extract_struct_value_address): Update to
+ current extract struct value address interface.
+ (sh64_gdbarch_init): Set extract_struct_value_address.
+
+ * cris-tdep.c: Update copyright.
+ (cris_extract_struct_value_address): Delete function.
+ (struct_return_address): Delete variable.
+ (cris_store_struct_return): Do not set struct_return_address.
+
+ * mcore-tdep.c: Update copyright.
+ (mcore_extract_struct_value_address): Delete function. Update
+ comments.
+ (mcore_gdbarch_init): Update.
+ * mn10300-tdep.c: Update copyright.
+ (mn10300_extract_struct_value_address): Delete function.
+ (mn10300_gdbarch_init): Update.
+ * v850-tdep.c: Update copyright.
+ (v850_extract_struct_value_address): Delete.
+ (v850_gdbarch_init): Update.
+ * ns32k-tdep.c: Update copyright.
+ (ns32k_extract_struct_value_address): Delete.
+ (ns32k_gdbarch_init): Update.
+ * hppa-tdep.c (hppa_extract_struct_value_address): Delete.
+ (hppa_gdbarch_init): Update.
+ * vax-tdep.c: Update copyright.
+ (vax_extract_struct_value_address): Delete.
+ (vax_gdbarch_init): Update.
+
+ * gdbarch.sh (DEPRECATED_NPC_REGNUM): Delete.
+ * gdbarch.h, gdbarch.c: Re-generate.
+ * procfs.c (procfs_fetch_registers): Delete reference to
+ DEPRECATED_NPC_REGNUM.
+ (procfs_store_registers): Ditto.
+ * regcache.c (generic_target_write_pc): Simplify.
+ * lynx-nat.c: Delete #ifdef SPARC code. Not used.
+
+ * core-sol2.c (fetch_core_registers): Replace
+ DEPRECATED_NPC_REGNUM with equivalent tdep value.
+
+ * hppa-tdep.c: Update copyright year.
+ (hppa_target_write_pc): Use PCOQ_TAIL_REGNUM instead of
+ NPC_REGNUM.
+ (hppa_gdbarch_init): Do not set deprecated_npc_regnum.
+
+ * mips-tdep.c (mips_write_pc): New function.
+ (mips_gdbarch_init): Set "write_pc" to "mips_write_pc".
+ (mips_read_pc): Use mips_regnum instead of PC_REGNUM.
+ (mips_find_saved_regs, mips_software_single_step: Ditto.
+ (mips_frame_saved_pc, mips_frame_saved_pc): Ditto.
+ mips_init_extra_frame_info, mips_pop_frame): Ditto.
+
+2004-01-17 Andrew Cagney <cagney@redhat.com>
+
+ * mips-tdep.c: Re-indent. Group functions by ABI.
+
+2004-01-17 Andrew Cagney <cagney@redhat.com>
+
+ * gdbarch.sh (DECR_PC_AFTER_BREAK): Make zero the default.
+ * gdbarch.c: Re-generate.
+ * xstormy16-tdep.c (xstormy16_gdbarch_init): Do not set
+ DECR_PC_AFTER_BREAK to zero.
+ * vax-tdep.c (vax_gdbarch_init): Ditto.
+ * v850-tdep.c (v850_gdbarch_init): Ditto.
+ * sparc-tdep.c (sparc32_gdbarch_init): Ditto.
+ * sh64-tdep.c (sh64_gdbarch_init): Ditto.
+ * sh-tdep.c (sh_gdbarch_init): Ditto.
+ * rs6000-tdep.c (rs6000_gdbarch_init): Ditto.
+ * ns32k-tdep.c (ns32k_gdbarch_init): Ditto.
+ * mn10300-tdep.c (mn10300_gdbarch_init): Ditto.
+ * mips-tdep.c (mips_gdbarch_init): Ditto.
+ * mcore-tdep.c (mcore_gdbarch_init): Ditto.
+ * m68hc11-tdep.c (m68hc11_gdbarch_init): Ditto.
+ * m32r-tdep.c (m32r_gdbarch_init): Ditto.
+ * ia64-tdep.c (ia64_gdbarch_init): Ditto.
+ * i386-interix-tdep.c (i386_interix_init_abi): Ditto.
+ * hppa-tdep.c (hppa_gdbarch_init): Ditto.
+ * h8300-tdep.c (h8300_gdbarch_init): Ditto.
+ * frv-tdep.c (frv_gdbarch_init): Ditto.
+ * cris-tdep.c (cris_gdbarch_init): Ditto.
+ * avr-tdep.c (avr_gdbarch_init): Ditto.
+ * arm-tdep.c (arm_gdbarch_init): Ditto.
+ * i386-nto-tdep.c (i386nto_init_abi): Add comment.
+
+2004-01-17 J. Brobecker <brobecker@gnat.com>
+
+ * dwarf2read.c (dwarf2_non_const_array_bound_ignored_complaint):
+ Delete, no longer used.
+ (read_subrange_type): New function, mostly extracted from
+ read_array_type().
+ (read_array_type): Replace extracted code by call to
+ read_subrange_type().
+ (dwarf2_get_attr_constant_value): New function.
+ (scan_partial_symbols): Add handling for DW_TAG_subrange_type.
+ (add_partial_symbol): Likewise.
+ (process_die): Likewise.
+ (new_symbol): Likewise.
+ (read_type_die): Likewise.
+
+2004-01-16 Andrew Cagney <cagney@redhat.com>
+
+ * symfile.c: Update copyright year.
+ (compare_symbols): Delete unused function.
+ * stabsread.c: Update copyright year.
+ (lrs_general_complaint): Delete unused function.
+ (ref_search_value): Ditto.
+ (get_substring): Delete declaration.
+ * sh64-tdep.c: Update copyright year.
+ (sh64_get_gdb_regnum): Delete unused function.
+ * dwarf2read.c (dwarf2_unsupported_at_frame_base_complaint):
+ Delete unused function.
+
+2004-01-17 Mark Kettenis <kettenis@gnu.org>
+
+ * defs.h (gdb_osabi): Add GDB_OSABI_OPENBSD_ELF.
+ * osabi.c (gdb_osabi_names): Add "OpenBSD ELF".
+
+2004-01-16 Andrew Cagney <cagney@redhat.com>
+
+ Changes from Peter Schauer.
+ * rs6000-tdep.c: Update copyright year.
+ (rs6000_push_dummy_call): Update the stack pointer before
+ accessing the corresponding stack region.
+ * rs6000-nat.c: Update copyright year.
+ (set_host_arch): Set "info.abfd" to "exec_bfd".
+
+2004-01-15 Mark Kettenis <kettenis@gnu.org>
+
+ * blockframe.c: Update copyright year.
+ (inside_entry_func): Don't treat a zero PC specially.
+
+2004-01-14 Elena Zannoni <ezannoni@redhat.com>
+
+ * gcore.c (gcore_copy_callback): Use paddr_d to print size
+ variable.
+ (gcore_create_callback): Ditto. Skip any memory segment that has
+ no permissions set.
+
+2004-01-14 David Carlton <carlton@kealia.com>
+
+ Change symbols for C++ nested types to contain the fully qualified
+ name, if possible. (At least in the DWARF-2 case.) Partial fix
+ for PR's c++/57, c++/488, c++/539, c++/573, c++/609, c++/832,
+ c++/895.
+ * c-exp.y (qualified_type): Handle types nested within classes.
+ * cp-namespace.c: Update comments.
+ (cp_set_block_scope): Delete #if 0.
+ (cp_lookup_nested_type): Handle types nested within classes.
+ * dwarf2read.c: (scan_partial_symbols): Call add_partial_structure
+ when appropriate.
+ (add_partial_symbol): Add the name of the enclosing namespace to
+ types.
+ (pdi_needs_namespace): New.
+ (add_partial_namespace): Tweak comment.
+ (add_partial_structure): New.
+ (psymtab_to_symtab_1): Initialize processing_current_prefix
+ here...
+ (process_die): instead of here.
+ (read_structure_scope): Try to figure out the name of the class or
+ namespace that the structure might be defined within.
+ (read_enumeration): Generate fully-qualified names, if possible.
+ (read_namespace): Don't set name to NULL.
+ (die_specification): New.
+ (new_symbol): Generate fully-qualified names for types.
+ (read_type_die): Determine appropriate prefix.
+ (determine_prefix): New.
+ (typename_concat): New.
+ (class_name): New.
+ * valops.c (value_aggregate_elt): Pass NOSIDE to
+ value_struct_elt_for_reference.
+ (value_struct_elt_for_reference): Make static, add NOSIDE
+ parameter, call value_maybe_namespace_elt as a last resort.
+ (value_namespace_elt): Break out code into
+ value_maybe_namespace_elt.
+ (value_maybe_namespace_elt): New.
+
+2004-01-12 Andrew Cagney <cagney@redhat.com>
+
+ * mips-tdep.c (mips_convert_register_p): Handle both raw and
+ cooked floating-point registers.
+ (mips_gdbarch_init): Set convert_register_p, register_to_value,
+ and value_to_register.
+
+2004-01-13 Andrew Cagney <cagney@redhat.com>
+
+ * gdbarch.sh (FUNCTION_START_OFFSET): Make zero the default.
+ * gdbarch.c: Re-generate.
+ * xstormy16-tdep.c (xstormy16_gdbarch_init): Do not set
+ FUNCTION_START_OFFSET.
+ * v850-tdep.c (v850_gdbarch_init): Ditto.
+ * sparc-tdep.c (sparc32_gdbarch_init): Ditto.
+ * sh64-tdep.c (sh64_gdbarch_init): Ditto.
+ * sh-tdep.c (sh_gdbarch_init): Ditto.
+ * s390-tdep.c (s390_gdbarch_init): Ditto.
+ * rs6000-tdep.c (rs6000_gdbarch_init): Ditto.
+ * ns32k-tdep.c (ns32k_gdbarch_init): Ditto.
+ * mn10300-tdep.c (mn10300_gdbarch_init): Ditto.
+ * mips-tdep.c (mips_gdbarch_init): Ditto.
+ * mcore-tdep.c (mcore_gdbarch_init): Ditto.
+ * m68k-tdep.c (m68k_gdbarch_init): Ditto.
+ * m68hc11-tdep.c (m68hc11_gdbarch_init): Ditto.
+ * m32r-tdep.c (m32r_gdbarch_init): Ditto.
+ * ia64-tdep.c (ia64_gdbarch_init): Ditto.
+ * i386-tdep.c (i386_gdbarch_init): Ditto.
+ * hppa-tdep.c (hppa_gdbarch_init): Ditto.
+ * h8300-tdep.c (h8300_gdbarch_init): Ditto.
+ * frv-tdep.c (frv_gdbarch_init): Ditto.
+ * d10v-tdep.c (d10v_gdbarch_init): Ditto.
+ * cris-tdep.c (cris_gdbarch_init): Ditto.
+ * avr-tdep.c (avr_gdbarch_init): Ditto.
+ * arm-tdep.c (arm_gdbarch_init): Ditto.
+ * alpha-tdep.c (alpha_gdbarch_init): Ditto.
+
+2004-01-13 Daniel Jacobowitz <drow@mvista.com>
+
+ * infrun.c (follow_fork_mode_ask): Remove.
+ (follow_fork_mode_kind_names): Remove follow_fork_mode_ask.
+ (follow_fork): Simplify and remove internal error for
+ follow_fork_mode_ask.
+ (_initialize_infrun): Update "set follow-fork-mode" help text.
+
+2004-01-13 Andrew Cagney <cagney@redhat.com>
+
+ * configure.in: Update copyright year.
+ (build_warnings): Add -Wunused-label.
+ * configure: Re-generate.
+
2004-01-12 Andrew Cagney <cagney@redhat.com>
* exec.h (exec_ops): Make "extern".
@@ -21,7 +1585,7 @@
* mi/ChangeLog-1999-2003: New file.
* tui/ChangeLog: Delete file. Renamed to ...
* tui/ChangeLog-1998-2003: New file.
-
+
2004-01-11 Mark Kettenis <kettenis@gnu.org>
* sparc64nbsd-tdep.c: Include "regset.h".
@@ -132,7 +1696,7 @@
* cp-namespace.c: Rename processing_current_namespace to
processing_current_prefix.
Update copyright year.
-
+
2004-01-09 Andrew Cagney <cagney@redhat.com>
* jv-valprint.c, ser-unix.c: Add missing copyright years.
@@ -225,9 +1789,9 @@
* disasm.c: Update copyright to include 2004.
(do_mixed_source_and_assembly): For uiout asm list
and tuple cleanups, initialize to null_cleanup instead of
- NULL and do so prior to loop. Only reset when we close off
+ NULL and do so prior to loop. Only reset when we close off
the tuple/list. Move check for whether to close off the
- asm tuple/list to after dump_insns call where it will be run
+ asm tuple/list to after dump_insns call where it will be run
on each loop iteration.
2004-01-05 Andrew Cagney <cagney@redhat.com>
@@ -421,7 +1985,7 @@
tm-vxsparc.h.
* config/sparc/vxworks.mt: New file, based on recently removed
vxworks.mt.
-
+
2004-01-03 J. Brobecker <brobecker@gnat.com>
* infrun.c (handle_step_into_function): New function.
@@ -513,7 +2077,7 @@
(_initialize_sparc64fbsd_nat): Remove initialization of
sparcbsd_supply_reg, sparcbsd_fill_reg, sparcbsd_supply_fpreg,
sparcbsd_fill_fpreg, sparcbsd_reg_supplies_p,
- sparcbsd_fpreg_supplies_p. Initialize sparc_gregset.
+ sparcbsd_fpreg_supplies_p. Initialize sparc_gregset.
* sparc64fbsd-tdep.c: Update copyright year. Include "frame.h",
"frame-unwind.h", "trad-frame.h" and "gdb_assert.h".
(sparc64fbsd_r_global_offset, sparc64fbsd_r_out_offset)
diff --git a/gdb/MAINTAINERS b/gdb/MAINTAINERS
index 8548526..204338c 100644
--- a/gdb/MAINTAINERS
+++ b/gdb/MAINTAINERS
@@ -174,8 +174,8 @@ support - typically shared libraries and quirks to procfs/ptrace/...
The Native maintainer works with the Arch and Core maintainers when
resolving more generic problems.
-The host maintainer ensures that gdb (including mmalloc) can be built
-as a cross debugger on their platform.
+The host maintainer ensures that gdb can be built as a cross debugger on
+their platform.
AIX Peter Schauer Peter.Schauer@regent.e-technik.tu-muenchen.de
Kevin Buettner kevinb@redhat.com
@@ -316,6 +316,7 @@ Philip Blundell philb@gnu.org
Per Bothner per@bothner.com
Joel Brobecker brobecker@act-europe.fr
Dave Brolley brolley@redhat.com
+Paul Brook paul@codesourcery.com
Kevin Buettner kevinb@redhat.com
Andrew Cagney ac131313@redhat.com
David Carlton carlton@kealia.com
@@ -364,6 +365,7 @@ H.J. Lu hjl@lucon.org
Michal Ludvig mludvig@suse.cz
Glen McCready gkm@redhat.com
Greg McGary greg@mcgary.org
+Roland McGrath roland@redhat.com
Jason Merrill jason@redhat.com
David S. Miller davem@redhat.com
Mark Mitchell mark@codesourcery.com
@@ -377,7 +379,7 @@ David O'Brien obrien@freebsd.org
Alexandre Oliva aoliva@redhat.com
Tom Rix trix@redhat.com
Nick Roberts nick@nick.uklinux.net
-Bob Rossi bob_rossi@cox.net
+Bob Rossi bob_rossi@cox.net
Theodore A. Roth troth@openavr.org
Ian Roxborough irox@redhat.com
Grace Sainsbury graces@redhat.com
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index ed1da00..acaf7f5 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -1,5 +1,6 @@
-# Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-# 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+# Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
+# 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation,
+# Inc.
# This file is part of GDB.
@@ -7,12 +8,12 @@
# 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.
@@ -77,7 +78,7 @@ VPATH = @srcdir@
YACC=@YACC@
-# This is used to rebuild ada-lex.c from ada-lex.l. If the program is
+# This is used to rebuild ada-lex.c from ada-lex.l. If the program is
# not defined, but ada-lex.c is present, compilation will continue,
# possibly with a warning.
FLEX = flex
@@ -105,10 +106,6 @@ INCLUDE_CFLAGS = -I$(INCLUDE_DIR)
# Where is the "-liberty" library? Typically in ../libiberty.
LIBIBERTY = ../libiberty/libiberty.a
-# Configured by the --with-mmalloc option to configure.
-MMALLOC = @MMALLOC@
-MMALLOC_CFLAGS = @MMALLOC_CFLAGS@
-
# Where is the BFD library? Typically in ../bfd.
BFD_DIR = ../bfd
BFD = $(BFD_DIR)/libbfd.a
@@ -195,19 +192,40 @@ SUBDIR_MI_UNINSTALL=
# TUI sub directory definitions
#
SUBDIR_TUI_OBS = \
- tui-file.o tui.o tuiData.o tuiSource.o tuiStack.o tuiIO.o \
+ tui-command.o \
+ tui-data.o \
+ tui-disasm.o \
+ tui-file.o tui.o \
+ tui-hooks.o \
tui-interp.o \
- tuiGeneralWin.o tuiLayout.o tuiWin.o tuiCommand.o \
- tuiDisassem.o tuiSourceWin.o tuiRegs.o tuiDataWin.o \
- tui-out.o tui-hooks.o
+ tui-io.o \
+ tui-layout.o \
+ tui-out.o \
+ tui-regs.o \
+ tui-source.o \
+ tui-stack.o \
+ tui-win.o \
+ tui-windata.o \
+ tui-wingeneral.o \
+ tui-winsource.o
SUBDIR_TUI_SRCS = \
- tui/tui-file.c tui/tui.c tui/tuiData.c tui/tuiSource.c \
+ tui/tui-command.c \
+ tui/tui-data.c \
+ tui/tui-disasm.c \
+ tui/tui-file.c \
+ tui/tui-hooks.c \
tui/tui-interp.c \
- tui/tuiStack.c tui/tuiIO.c \
- tui/tuiGeneralWin.c tui/tuiLayout.c \
- tui/tuiWin.c tui/tuiCommand.c \
- tui/tuiDisassem.c tui/tuiSourceWin.c \
- tui/tuiRegs.c tui/tuiDataWin.c tui/tui-out.c tui/tui-hooks.c
+ tui/tui-io.c \
+ tui/tui-layout.c \
+ tui/tui-out.c \
+ tui/tui-regs.c \
+ tui/tui-source.c \
+ tui/tui-stack.c \
+ tui/tui-win.c \
+ tui/tui-windata.c \
+ tui/tui-wingeneral.c \
+ tui/tui-winsource.c \
+ tui/tui.c
SUBDIR_TUI_DEPS =
SUBDIR_TUI_INITS = \
$(SUBDIR_TUI_SRCS)
@@ -342,7 +360,7 @@ CXXFLAGS = -g -O
INTERNAL_WARN_CFLAGS = \
$(CFLAGS) $(GLOBAL_CFLAGS) $(PROFILE_CFLAGS) \
$(GDB_CFLAGS) $(OPCODES_CFLAGS) $(READLINE_CFLAGS) \
- $(BFD_CFLAGS) $(MMALLOC_CFLAGS) $(INCLUDE_CFLAGS) \
+ $(BFD_CFLAGS) $(INCLUDE_CFLAGS) \
$(INTL_CFLAGS) $(ENABLE_CFLAGS) \
$(GDB_WARN_CFLAGS)
INTERNAL_CFLAGS = $(INTERNAL_WARN_CFLAGS) $(GDB_WERROR_CFLAGS)
@@ -362,19 +380,18 @@ INTERNAL_LDFLAGS = $(CFLAGS) $(GLOBAL_CFLAGS) $(MH_LDFLAGS) $(LDFLAGS) $(CONFIG_
# Libraries and corresponding dependencies for compiling gdb.
# {X,T}M_CLIBS, defined in *config files, have host- and target-dependent libs.
-# MMALLOC comes after anything else that might want an allocation function.
# LIBIBERTY appears twice on purpose.
# If you have the Cygnus libraries installed,
# you can use 'CLIBS=$(INSTALLED_LIBS)' 'CDEPS='
INSTALLED_LIBS=-lbfd -lreadline -lopcodes -liberty \
$(XM_CLIBS) $(TM_CLIBS) $(NAT_CLIBS) $(GDBTKLIBS) @LIBS@ \
- -lmmalloc -lintl -liberty
+ -lintl -liberty
CLIBS = $(SIM) $(BFD) $(READLINE) $(OPCODES) $(INTL) $(LIBIBERTY) \
$(XM_CLIBS) $(TM_CLIBS) $(NAT_CLIBS) $(GDBTKLIBS) @LIBS@ \
$(LIBICONV) \
- $(MMALLOC) $(LIBIBERTY) $(WIN32LIBS)
+ $(LIBIBERTY) $(WIN32LIBS)
CDEPS = $(XM_CDEPS) $(TM_CDEPS) $(NAT_CDEPS) $(SIM) $(BFD) $(READLINE) \
- $(OPCODES) $(MMALLOC) $(INTL_DEPS) $(LIBIBERTY) $(CONFIG_DEPS)
+ $(OPCODES) $(INTL_DEPS) $(LIBIBERTY) $(CONFIG_DEPS)
ADD_FILES = $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES)
ADD_DEPS = $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES)
@@ -383,7 +400,7 @@ DIST=gdb
LINT=/usr/5bin/lint
LINTFLAGS= $(GDB_CFLAGS) $(OPCODES_CFLAGS) $(READLINE_CFLAGS) \
- $(BFD_CFLAGS) $(MMALLOC_CFLAGS) $(INCLUDE_CFLAGS) \
+ $(BFD_CFLAGS) $(INCLUDE_CFLAGS) \
$(INTL_CFLAGS)
RUNTEST = `if [ -f $${rootsrc}/../dejagnu/runtest ] ; then \
@@ -414,8 +431,8 @@ ANNOTATE_OBS = annotate.o
@target_makefile_frag@
# End of host and target-dependent makefile fragments
-# Possibly ignore the simulator. If the simulator is being ignored,
-# these expand into SIM= and SIM_OBJ=, overriding the entries from
+# Possibly ignore the simulator. If the simulator is being ignored,
+# these expand into SIM= and SIM_OBJ=, overriding the entries from
# target_makefile_frag
#
@IGNORE_SIM@
@@ -566,7 +583,7 @@ LINTFILES = $(SFILES) $(YYFILES) $(CONFIG_SRCS) init.c
# "system" headers. Using these in dependencies is a rather personal
# choice. (-rich, summer 1993)
-# (Why would we not want to depend on them? If one of these changes in a
+# (Why would we not want to depend on them? If one of these changes in a
# non-binary-compatible way, it is a real pain to remake the right stuff
# without these dependencies -kingdon, 13 Mar 1994)
aout_aout64_h = $(INCLUDE_DIR)/aout/aout64.h
@@ -638,6 +655,7 @@ amd64_nat_h = amd64-nat.h
annotate_h = annotate.h $(symtab_h) $(gdbtypes_h)
arch_utils_h = arch-utils.h
arm_tdep_h = arm-tdep.h
+auxv_h = auxv.h
ax_gdb_h = ax-gdb.h
ax_h = ax.h $(doublest_h)
bcache_h = bcache.h
@@ -711,7 +729,7 @@ interps_h = interps.h
jv_lang_h = jv-lang.h
kod_h = kod.h
language_h = language.h
-libunwind_frame_h = libunwind-frame.h
+libunwind_frame_h = libunwind-frame.h $(libunwind_h)
linespec_h = linespec.h
linux_nat_h = linux-nat.h
m2_lang_h = m2-lang.h
@@ -758,9 +776,9 @@ solib_svr4_h = solib-svr4.h
solist_h = solist.h
somsolib_h = somsolib.h
source_h = source.h
+sparc64_tdep_h = sparc64-tdep.h $(sparc_tdep_h)
sparc_nat_h = sparc-nat.h
sparc_tdep_h = sparc-tdep.h
-sparc64_tdep_h = sparc64-tdep.h
srec_h = srec.h
stabsread_h = stabsread.h
stack_h = stack.h
@@ -814,20 +832,20 @@ mi_parse_h = $(srcdir)/mi/mi-parse.h
# gdb/tui/ headers
#
-tuiCommand_h = $(srcdir)/tui/tuiCommand.h
-tuiDataWin_h = $(srcdir)/tui/tuiDataWin.h
-tuiData_h = $(srcdir)/tui/tuiData.h
-tuiDisassem_h = $(srcdir)/tui/tuiDisassem.h
-tuiGeneralWin_h = $(srcdir)/tui/tuiGeneralWin.h
-tuiIO_h = $(srcdir)/tui/tuiIO.h
-tuiLayout_h = $(srcdir)/tui/tuiLayout.h
-tuiRegs_h = $(srcdir)/tui/tuiRegs.h
-tuiSourceWin_h = $(srcdir)/tui/tuiSourceWin.h
-tuiSource_h = $(srcdir)/tui/tuiSource.h $(defs_h)
-tuiStack_h = $(srcdir)/tui/tuiStack.h
-tuiWin_h = $(srcdir)/tui/tuiWin.h
+tui_command_h = $(srcdir)/tui/tui-command.h
+tui_data_h = $(srcdir)/tui/tui-data.h
+tui_disasm_h = $(srcdir)/tui/tui-disasm.h
tui_file_h = $(srcdir)/tui/tui-file.h
tui_h = $(srcdir)/tui/tui.h $(ansidecl_h)
+tui_io_h = $(srcdir)/tui/tui-io.h
+tui_layout_h = $(srcdir)/tui/tui-layout.h
+tui_regs_h = $(srcdir)/tui/tui-regs.h
+tui_source_h = $(srcdir)/tui/tui-source.h $(defs_h)
+tui_stack_h = $(srcdir)/tui/tui-stack.h
+tui_windata_h = $(srcdir)/tui/tui-windata.h
+tui_wingeneral_h = $(srcdir)/tui/tui-wingeneral.h
+tui_win_h = $(srcdir)/tui/tui-win.h
+tui_winsource_h = $(srcdir)/tui/tui-winsource.h
# Header files that need to have srcdir added. Note that in the cases
# where we use a macro like $(gdbcmd_h), things are carefully arranged
@@ -877,6 +895,7 @@ TAGFILES_NO_SRCDIR = $(SFILES) $(HFILES_NO_SRCDIR) $(ALLDEPFILES) \
TAGFILES_WITH_SRCDIR = $(HFILES_WITH_SRCDIR)
COMMON_OBS = version.o \
+ auxv.o \
bfd-target.o \
blockframe.o breakpoint.o findvar.o regcache.o \
charset.o disasm.o dummy-frame.o \
@@ -965,12 +984,12 @@ info dvi install-info clean-info html install-html: force
@$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
gdb.z:gdb.1
- nroff -man $(srcdir)/gdb.1 | col -b > gdb.t
+ nroff -man $(srcdir)/gdb.1 | col -b > gdb.t
pack gdb.t ; rm -f gdb.t
mv gdb.t.z gdb.z
# Traditionally "install" depends on "all". But it may be useful
-# not to; for example, if the user has made some trivial change to a
+# not to; for example, if the user has made some trivial change to a
# source file and doesn't care about rebuilding or just wants to save the
# time it takes for make to check that all is up to date.
# install-only is intended to address that need.
@@ -990,7 +1009,7 @@ install-only: $(CONFIG_INSTALL)
$(DESTDIR)$(man1dir) ; \
$(INSTALL_DATA) $(srcdir)/gdb.1 \
$(DESTDIR)$(man1dir)/$$transformed_name.1
- @$(MAKE) DO=install "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do
+ @$(MAKE) DO=install "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do
uninstall: force $(CONFIG_UNINSTALL)
transformed_name=`t='$(program_transform_name)'; \
@@ -1002,7 +1021,7 @@ uninstall: force $(CONFIG_UNINSTALL)
fi ; \
rm -f $(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT) \
$(DESTDIR)$(man1dir)/$$transformed_name.1
- @$(MAKE) DO=uninstall "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do
+ @$(MAKE) DO=uninstall "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do
# We do this by grepping through sources. If that turns out to be too slow,
# maybe we could just require every .o file to have an initialization routine
@@ -1016,8 +1035,8 @@ uninstall: force $(CONFIG_UNINSTALL)
# object files that will be linked into gdb.
#
# FIXME: There are 2 problems with this approach. First, if the INIT_FILES
-# list includes a file twice (because of some mistake somewhere else)
-# the _initialize_* function will be included twice in init.c. Second,
+# list includes a file twice (because of some mistake somewhere else)
+# the _initialize_* function will be included twice in init.c. Second,
# init.c may force unnecessary files to be linked in.
# FIXME: cagney/2002-06-09: gdb/564: gdb/563: Force the order so that
@@ -1143,7 +1162,7 @@ TAGS: $(TAGFILES_NO_SRCDIR) $(TAGFILES_WITH_SRCDIR)
tags: TAGS
clean mostlyclean: $(CONFIG_CLEAN)
- @$(MAKE) $(FLAGS_TO_PASS) DO=clean "DODIRS=$(SUBDIRS)" subdir_do
+ @$(MAKE) $(FLAGS_TO_PASS) DO=clean "DODIRS=$(SUBDIRS)" subdir_do
rm -f *.o *.a $(ADD_FILES) *~ init.c-tmp init.l-tmp version.c-tmp
rm -f init.c version.c
rm -f gdb$(EXEEXT) core make.log
@@ -1157,7 +1176,7 @@ clean mostlyclean: $(CONFIG_CLEAN)
# NB: While GDBSERVER might be configured on native systems, it isn't
# always included in SUBDIRS. Remove the gdbserver files explictly.
distclean: clean
- @$(MAKE) $(FLAGS_TO_PASS) DO=distclean "DODIRS=$(SUBDIRS)" subdir_do
+ @$(MAKE) $(FLAGS_TO_PASS) DO=distclean "DODIRS=$(SUBDIRS)" subdir_do
rm -f gdbserver/config.status gdbserver/config.log
rm -f gdbserver/tm.h gdbserver/xm.h gdbserver/nm.h
rm -f gdbserver/Makefile gdbserver/config.cache
@@ -1273,7 +1292,7 @@ ALLDEPFILES = \
armnbsd-nat.c armnbsd-tdep.c \
avr-tdep.c \
coff-solib.c \
- core-sol2.c core-regset.c core-aout.c corelow.c \
+ core-regset.c core-aout.c corelow.c \
dcache.c delta68-nat.c dpx2-nat.c exec.c fork-child.c \
glibc-tdep.c \
go32-nat.c h8300-tdep.c \
@@ -1317,8 +1336,8 @@ ALLDEPFILES = \
sparc-tdep.c sparc-sol2-nat.c sparc-sol2-tdep.c sparc64-linux-nat.c \
sparc64-linux-tdep.c sparc64-nat.c sparc64-sol2-tdep.c \
sparc64-tdep.c sparc64fbsd-nat.c sparc64fbsd-tdep.c \
- sparc64nbsd-nat.c sparc64nbsd-tdep.c sparcnbsd-nat.c \
- sparcnbsd-tdep.c \
+ sparc64nbsd-nat.c sparc64nbsd-tdep.c sparc64obsd-tdep.c \
+ sparcnbsd-nat.c sparcnbsd-tdep.c sparcobsd-tdep.c \
sun3-nat.c \
symm-tdep.c symm-nat.c \
vax-tdep.c \
@@ -1400,7 +1419,7 @@ ada-exp.tab.o: ada-exp.tab.c $(defs_h) $(expression_h) $(value_h) \
$(objfiles_h) $(frame_h) $(block_h) $(ada_lex_c)
ada-exp.tab.c: ada-exp.y
$(SHELL) $(YLWRAP) "$(YACC)" \
- $(srcdir)/ada-exp.y y.tab.c ada-exp.tmp -- $(YFLAGS)
+ $(srcdir)/ada-exp.y y.tab.c ada-exp.tmp -- $(YFLAGS)
-sed -e '/extern.*malloc/d' \
-e '/extern.*realloc/d' \
-e '/extern.*free/d' \
@@ -1429,7 +1448,7 @@ c-exp.tab.o: c-exp.tab.c $(defs_h) $(gdb_string_h) $(expression_h) \
$(symfile_h) $(objfiles_h) $(charset_h) $(block_h) $(cp_support_h)
c-exp.tab.c: c-exp.y
$(SHELL) $(YLWRAP) "$(YACC)" \
- $(srcdir)/c-exp.y y.tab.c c-exp.tmp -- $(YFLAGS)
+ $(srcdir)/c-exp.y y.tab.c c-exp.tmp -- $(YFLAGS)
-sed -e '/extern.*malloc/d' \
-e '/extern.*realloc/d' \
-e '/extern.*free/d' \
@@ -1470,7 +1489,7 @@ f-exp.tab.o: f-exp.tab.c $(defs_h) $(gdb_string_h) $(expression_h) \
$(symfile_h) $(objfiles_h) $(block_h)
f-exp.tab.c: f-exp.y
$(SHELL) $(YLWRAP) "$(YACC)" \
- $(srcdir)/f-exp.y y.tab.c f-exp.tmp -- $(YFLAGS)
+ $(srcdir)/f-exp.y y.tab.c f-exp.tmp -- $(YFLAGS)
-sed -e '/extern.*malloc/d' \
-e '/extern.*realloc/d' \
-e '/extern.*free/d' \
@@ -1487,7 +1506,7 @@ jv-exp.tab.o: jv-exp.tab.c $(defs_h) $(gdb_string_h) $(expression_h) \
$(symfile_h) $(objfiles_h) $(block_h)
jv-exp.tab.c: jv-exp.y
$(SHELL) $(YLWRAP) "$(YACC)" \
- $(srcdir)/jv-exp.y y.tab.c jv-exp.tmp -- $(YFLAGS)
+ $(srcdir)/jv-exp.y y.tab.c jv-exp.tmp -- $(YFLAGS)
-sed -e '/extern.*malloc/d' \
-e '/extern.*realloc/d' \
-e '/extern.*free/d' \
@@ -1504,7 +1523,7 @@ m2-exp.tab.o: m2-exp.tab.c $(defs_h) $(gdb_string_h) $(expression_h) \
$(symfile_h) $(objfiles_h) $(block_h)
m2-exp.tab.c: m2-exp.y
$(SHELL) $(YLWRAP) "$(YACC)" \
- $(srcdir)/m2-exp.y y.tab.c m2-exp.tmp -- $(YFLAGS)
+ $(srcdir)/m2-exp.y y.tab.c m2-exp.tmp -- $(YFLAGS)
-sed -e '/extern.*malloc/d' \
-e '/extern.*realloc/d' \
-e '/extern.*free/d' \
@@ -1522,7 +1541,7 @@ objc-exp.tab.o: objc-exp.tab.c $(defs_h) $(gdb_string_h) $(expression_h) \
$(block_h)
objc-exp.tab.c: objc-exp.y
$(SHELL) $(YLWRAP) "$(YACC)" \
- $(srcdir)/objc-exp.y y.tab.c objc-exp.tmp -- $(YFLAGS)
+ $(srcdir)/objc-exp.y y.tab.c objc-exp.tmp -- $(YFLAGS)
-sed -e '/extern.*malloc/d' \
-e '/extern.*realloc/d' \
-e '/extern.*free/d' \
@@ -1539,7 +1558,7 @@ p-exp.tab.o: p-exp.tab.c $(defs_h) $(gdb_string_h) $(expression_h) \
$(symfile_h) $(objfiles_h) $(block_h)
p-exp.tab.c: p-exp.y
$(SHELL) $(YLWRAP) "$(YACC)" \
- $(srcdir)/p-exp.y y.tab.c p-exp.tmp -- $(YFLAGS)
+ $(srcdir)/p-exp.y y.tab.c p-exp.tmp -- $(YFLAGS)
-sed -e '/extern.*malloc/d' \
-e '/extern.*realloc/d' \
-e '/extern.*free/d' \
@@ -1603,27 +1622,28 @@ amd64bsd-nat.o: amd64bsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \
$(gdb_assert_h) $(x86_64_tdep_h) $(amd64_nat_h)
amd64fbsd-nat.o: amd64fbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \
$(gdb_assert_h) $(gregset_h) $(x86_64_tdep_h) $(amd64_nat_h)
-amd64nbsd-nat.o: amd64nbsd-nat.c $(defs_h) $(gdb_assert_h) \
- $(x86_64_tdep_h) $(amd64_nat_h)
amd64fbsd-tdep.o: amd64fbsd-tdep.c $(defs_h) $(arch_utils_h) $(frame_h) \
$(gdbcore_h) $(regcache_h) $(osabi_h) $(gdb_string_h) \
$(x86_64_tdep_h)
+amd64-nat.o: amd64-nat.c $(defs_h) $(gdbarch_h) $(regcache_h) \
+ $(gdb_assert_h) $(i386_tdep_h) $(x86_64_tdep_h)
+amd64nbsd-nat.o: amd64nbsd-nat.c $(defs_h) $(gdb_assert_h) $(x86_64_tdep_h) \
+ $(amd64_nat_h)
amd64nbsd-tdep.o: amd64nbsd-tdep.c $(defs_h) $(arch_utils_h) $(frame_h) \
$(gdbcore_h) $(osabi_h) $(gdb_assert_h) $(nbsd_tdep_h) \
$(x86_64_tdep_h)
-amd64-nat.o: amd64-nat.c $(defs_h) $(gdbarch_h) $(regcache_h) \
- $(gdb_assert_h) $(i386_tdep_h) $(x86_64_tdep_h)
annotate.o: annotate.c $(defs_h) $(annotate_h) $(value_h) $(target_h) \
$(gdbtypes_h) $(breakpoint_h)
arch-utils.o: arch-utils.c $(defs_h) $(arch_utils_h) $(buildsym_h) \
$(gdbcmd_h) $(inferior_h) $(gdb_string_h) $(regcache_h) \
- $(gdb_assert_h) $(sim_regno_h) $(version_h) $(floatformat_h)
+ $(gdb_assert_h) $(sim_regno_h) $(osabi_h) $(version_h) \
+ $(floatformat_h)
arm-linux-nat.o: arm-linux-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) \
- $(gdb_string_h) $(regcache_h) $(arm_tdep_h) $(glibc_tdep_h) $(gregset_h)
+ $(gdb_string_h) $(regcache_h) $(arm_tdep_h) $(gregset_h)
arm-linux-tdep.o: arm-linux-tdep.c $(defs_h) $(target_h) $(value_h) \
$(gdbtypes_h) $(floatformat_h) $(gdbcore_h) $(frame_h) $(regcache_h) \
- $(doublest_h) $(solib_svr4_h) $(osabi_h) $(arm_tdep_h) $(symtab_h) \
- $(symfile_h) $(objfiles_h)
+ $(doublest_h) $(solib_svr4_h) $(osabi_h) $(arm_tdep_h) \
+ $(glibc_tdep_h)
armnbsd-nat.o: armnbsd-nat.c $(defs_h) $(arm_tdep_h) $(inferior_h) \
$(regcache_h) $(gdbcore_h)
armnbsd-tdep.o: armnbsd-tdep.c $(defs_h) $(osabi_h) $(arm_tdep_h) \
@@ -1634,6 +1654,8 @@ arm-tdep.o: arm-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(gdbcmd_h) \
$(frame_unwind_h) $(frame_base_h) $(trad_frame_h) $(arm_tdep_h) \
$(gdb_sim_arm_h) $(elf_bfd_h) $(coff_internal_h) $(elf_arm_h) \
$(gdb_assert_h) $(bfd_in2_h) $(libcoff_h)
+auxv.o: $(defs_h) $(target_h) $(gdbtypes_h) $(command_h) $(gdb_assert_h) \
+ $(auxv_h) $(elf_common_h) $(valprint_h) $(inferior_h)
avr-tdep.o: avr-tdep.c $(defs_h) $(frame_h) $(frame_unwind_h) \
$(frame_base_h) $(trad_frame_h) $(gdbcmd_h) $(gdbcore_h) \
$(inferior_h) $(symfile_h) $(arch_utils_h) $(regcache_h) \
@@ -1643,8 +1665,8 @@ ax-gdb.o: ax-gdb.c $(defs_h) $(symtab_h) $(symfile_h) $(gdbtypes_h) \
$(target_h) $(ax_h) $(ax_gdb_h) $(gdb_string_h) $(block_h) \
$(regcache_h)
ax-general.o: ax-general.c $(defs_h) $(ax_h) $(value_h) $(gdb_string_h)
-bcache.o: bcache.c $(defs_h) $(gdb_obstack_h) $(bcache_h) \
- $(gdb_string_h) $(gdb_assert_h)
+bcache.o: bcache.c $(defs_h) $(gdb_obstack_h) $(bcache_h) $(gdb_string_h) \
+ $(gdb_assert_h)
bfd-target.o: bfd-target.c $(defs_h) $(target_h) $(bfd_target_h) \
$(gdb_assert_h) $(gdb_string_h)
block.o: block.c $(defs_h) $(block_h) $(symtab_h) $(symfile_h) \
@@ -1686,30 +1708,29 @@ coff-solib.o: coff-solib.c $(defs_h) $(frame_h) $(bfd_h) $(gdbcore_h) \
complaints.o: complaints.c $(defs_h) $(complaints_h) $(gdb_assert_h) \
$(command_h) $(gdbcmd_h)
completer.o: completer.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \
- $(filenames_h) $(cli_decode_h) $(gdbcmd_h) $(completer_h) \
- $(language_h)
+ $(filenames_h) $(language_h) $(cli_decode_h) $(gdbcmd_h) \
+ $(completer_h)
copying.o: copying.c $(defs_h) $(command_h) $(gdbcmd_h)
core-aout.o: core-aout.c $(defs_h) $(gdbcore_h) $(value_h) $(regcache_h) \
$(gdb_dirent_h) $(gdb_stat_h)
corefile.o: corefile.c $(defs_h) $(gdb_string_h) $(inferior_h) $(symtab_h) \
$(command_h) $(gdbcmd_h) $(bfd_h) $(target_h) $(gdbcore_h) \
$(dis_asm_h) $(gdb_stat_h) $(completer_h)
-corelow.o: corelow.c $(defs_h) $(gdb_string_h) $(frame_h) $(inferior_h) \
- $(symtab_h) $(command_h) $(bfd_h) $(target_h) $(gdbcore_h) \
- $(gdbthread_h) $(regcache_h) $(symfile_h) $(exec_h)
+corelow.o: corelow.c $(defs_h) $(arch_utils_h) $(gdb_string_h) $(frame_h) \
+ $(inferior_h) $(symtab_h) $(command_h) $(bfd_h) $(target_h) \
+ $(gdbcore_h) $(gdbthread_h) $(regcache_h) $(regset_h) $(symfile_h) \
+ $(exec_h) $(gdb_assert_h)
core-regset.o: core-regset.c $(defs_h) $(command_h) $(gdbcore_h) \
$(inferior_h) $(target_h) $(gdb_string_h) $(gregset_h)
-core-sol2.o: core-sol2.c $(defs_h) $(gdb_string_h) $(regcache_h) \
- $(inferior_h) $(target_h) $(command_h) $(gdbcore_h) $(gregset_h)
cp-abi.o: cp-abi.c $(defs_h) $(value_h) $(cp_abi_h) $(command_h) $(gdbcmd_h) \
$(ui_out_h) $(gdb_string_h)
cp-namespace.o: cp-namespace.c $(defs_h) $(cp_support_h) $(gdb_obstack_h) \
$(symtab_h) $(symfile_h) $(gdb_assert_h) $(block_h) $(objfiles_h) \
- $(gdbtypes_h) $(dictionary_h) $(command_h)
+ $(gdbtypes_h) $(dictionary_h) $(command_h) $(frame_h)
cp-support.o: cp-support.c $(defs_h) $(cp_support_h) $(gdb_string_h) \
$(demangle_h) $(gdb_assert_h) $(gdbcmd_h) $(dictionary_h) \
$(objfiles_h) $(frame_h) $(symtab_h) $(block_h) $(complaints_h) \
- $(demangle_h)
+ $(gdbtypes_h) $(demangle_h)
cpu32bug-rom.o: cpu32bug-rom.c $(defs_h) $(gdbcore_h) $(target_h) \
$(monitor_h) $(serial_h) $(regcache_h) $(m68k_tdep_h)
cp-valprint.o: cp-valprint.c $(defs_h) $(gdb_obstack_h) $(symtab_h) \
@@ -1725,8 +1746,8 @@ c-typeprint.o: c-typeprint.c $(defs_h) $(gdb_obstack_h) $(bfd_h) $(symtab_h) \
$(language_h) $(demangle_h) $(c_lang_h) $(typeprint_h) $(cp_abi_h) \
$(gdb_string_h)
c-valprint.o: c-valprint.c $(defs_h) $(gdb_string_h) $(symtab_h) \
- $(gdbtypes_h) $(expression_h) $(value_h) $(valprint_h) \
- $(language_h) $(c_lang_h) $(cp_abi_h) $(target_h)
+ $(gdbtypes_h) $(expression_h) $(value_h) $(valprint_h) $(language_h) \
+ $(c_lang_h) $(cp_abi_h) $(target_h)
d10v-tdep.o: d10v-tdep.c $(defs_h) $(frame_h) $(frame_unwind_h) \
$(frame_base_h) $(symtab_h) $(gdbtypes_h) $(gdbcmd_h) $(gdbcore_h) \
$(gdb_string_h) $(value_h) $(inferior_h) $(dis_asm_h) $(symfile_h) \
@@ -1795,8 +1816,7 @@ event-top.o: event-top.c $(defs_h) $(top_h) $(inferior_h) $(target_h) \
$(gdbcmd_h)
exec.o: exec.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) $(gdbcmd_h) \
$(language_h) $(symfile_h) $(objfiles_h) $(completer_h) $(value_h) \
- $(gdb_string_h) $(gdbcore_h) $(gdb_stat_h) $(xcoffsolib_h) \
- $(exec_h)
+ $(exec_h) $(gdb_string_h) $(gdbcore_h) $(gdb_stat_h) $(xcoffsolib_h)
expprint.o: expprint.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \
$(value_h) $(language_h) $(parser_defs_h) $(user_regs_h) $(target_h) \
$(gdb_string_h) $(block_h)
@@ -1823,7 +1843,8 @@ frame-unwind.o: frame-unwind.c $(defs_h) $(frame_h) $(frame_unwind_h) \
frv-tdep.o: frv-tdep.c $(defs_h) $(gdb_string_h) $(inferior_h) $(symfile_h) \
$(gdbcore_h) $(arch_utils_h) $(regcache_h) $(frame_h) \
$(frame_unwind_h) $(frame_base_h) $(trad_frame_h) $(dis_asm_h) \
- $(gdb_assert_h) $(sim_regno_h) $(gdb_sim_frv_h) $(frv_desc_h)
+ $(gdb_assert_h) $(sim_regno_h) $(gdb_sim_frv_h) \
+ $(opcodes_frv_desc_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)
@@ -1843,15 +1864,17 @@ gdbtypes.o: gdbtypes.c $(defs_h) $(gdb_string_h) $(bfd_h) $(symtab_h) \
$(symfile_h) $(objfiles_h) $(gdbtypes_h) $(expression_h) \
$(language_h) $(target_h) $(value_h) $(demangle_h) $(complaints_h) \
$(gdbcmd_h) $(wrapper_h) $(cp_abi_h) $(gdb_assert_h)
+glibc-tdep.o: glibc-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(symfile_h) \
+ $(objfiles_h) $(glibc_tdep_h)
gnu-nat.o: gnu-nat.c $(gdb_string_h) $(defs_h) $(inferior_h) $(symtab_h) \
$(value_h) $(language_h) $(target_h) $(gdb_wait_h) $(gdbcmd_h) \
$(gdbcore_h) $(gdbthread_h) $(gdb_assert_h) $(gdb_obstack_h) \
$(gnu_nat_h) $(exc_request_S_h) $(notify_S_h) $(process_reply_S_h) \
$(msg_reply_S_h) $(exc_request_U_h) $(msg_U_h)
gnu-v2-abi.o: gnu-v2-abi.c $(defs_h) $(gdb_string_h) $(symtab_h) \
- $(gdbtypes_h) $(value_h) $(demangle_h) $(cp_abi_h)
-gnu-v3-abi.o: gnu-v3-abi.c $(defs_h) $(value_h) $(cp_abi_h) $(demangle_h) \
- $(gdb_assert_h) $(gdb_string_h)
+ $(gdbtypes_h) $(value_h) $(demangle_h) $(cp_abi_h) $(cp_support_h)
+gnu-v3-abi.o: gnu-v3-abi.c $(defs_h) $(value_h) $(cp_abi_h) $(cp_support_h) \
+ $(demangle_h) $(gdb_assert_h) $(gdb_string_h)
go32-nat.o: go32-nat.c $(defs_h) $(inferior_h) $(gdb_wait_h) $(gdbcore_h) \
$(command_h) $(gdbcmd_h) $(floatformat_h) $(buildsym_h) \
$(i387_tdep_h) $(i386_tdep_h) $(value_h) $(regcache_h) \
@@ -1902,21 +1925,22 @@ i386-linux-nat.o: i386-linux-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) \
$(gregset_h) $(i387_tdep_h) $(i386_tdep_h) $(i386_linux_tdep_h) \
$(gdb_proc_service_h)
i386-linux-tdep.o: i386-linux-tdep.c $(defs_h) $(gdbcore_h) $(frame_h) \
- $(value_h) $(regcache_h) $(inferior_h) $(reggroups_h) $(symtab_h) \
- $(symfile_h) $(objfiles_h) $(solib_svr4_h) $(osabi_h) $(i386_tdep_h) \
- $(i386_linux_tdep_h) $(glibc_tdep_h)
+ $(value_h) $(regcache_h) $(inferior_h) $(osabi_h) $(reggroups_h) \
+ $(solib_svr4_h) $(gdb_string_h) $(i386_tdep_h) $(i386_linux_tdep_h) \
+ $(glibc_tdep_h)
i386ly-tdep.o: i386ly-tdep.c $(defs_h) $(gdbcore_h) $(inferior_h) \
$(regcache_h) $(target_h) $(osabi_h) $(i386_tdep_h)
i386-nat.o: i386-nat.c $(defs_h) $(breakpoint_h) $(command_h) $(gdbcmd_h)
-i386nbsd-tdep.o: i386nbsd-tdep.c $(defs_h) $(gdbtypes_h) $(gdbcore_h) \
- $(regcache_h) $(arch_utils_h) $(osabi_h) $(i386_tdep_h) \
- $(i387_tdep_h) $(nbsd_tdep_h) $(solib_svr4_h)
+i386nbsd-tdep.o: i386nbsd-tdep.c $(defs_h) $(arch_utils_h) $(gdbcore_h) \
+ $(regcache_h) $(regset_h) $(osabi_h) $(gdb_assert_h) $(gdb_string_h) \
+ $(i386_tdep_h) $(i387_tdep_h) $(nbsd_tdep_h) $(solib_svr4_h)
i386-nto-tdep.o: i386-nto-tdep.c $(gdb_string_h) $(gdb_assert_h) $(defs_h) \
$(frame_h) $(target_h) $(regcache_h) $(solib_svr4_h) $(i386_tdep_h) \
$(nto_tdep_h) $(osabi_h) $(i387_tdep_h)
i386obsd-nat.o: i386obsd-nat.c $(defs_h) $(i386_tdep_h)
i386obsd-tdep.o: i386obsd-tdep.c $(defs_h) $(arch_utils_h) $(gdbcore_h) \
- $(regcache_h) $(osabi_h) $(i386_tdep_h) $(i387_tdep_h)
+ $(regcache_h) $(regset_h) $(osabi_h) $(gdb_assert_h) $(gdb_string_h) \
+ $(i386_tdep_h) $(i387_tdep_h)
i386-sol2-tdep.o: i386-sol2-tdep.c $(defs_h) $(value_h) $(osabi_h) \
$(i386_tdep_h)
i386-stub.o: i386-stub.c
@@ -1941,12 +1965,13 @@ ia64-aix-nat.o: ia64-aix-nat.c $(defs_h) $(inferior_h) $(target_h) \
ia64-aix-tdep.o: ia64-aix-tdep.c $(defs_h)
ia64-linux-nat.o: ia64-linux-nat.c $(defs_h) $(gdb_string_h) $(inferior_h) \
$(target_h) $(gdbcore_h) $(regcache_h) $(gdb_wait_h) $(gregset_h)
-ia64-linux-tdep.o: ia64-linux-tdep.c $(defs_h) $(arch_utils_h)
+ia64-linux-tdep.o: ia64-linux-tdep.c $(defs_h) $(arch_utils_h) $(gdbcore_h)
ia64-tdep.o: ia64-tdep.c $(defs_h) $(inferior_h) $(symfile_h) $(gdbcore_h) \
$(arch_utils_h) $(floatformat_h) $(regcache_h) $(reggroups_h) \
$(frame_h) $(frame_base_h) $(frame_unwind_h) $(doublest_h) \
$(value_h) $(gdb_assert_h) $(objfiles_h) $(elf_common_h) \
- $(elf_bfd_h) $(dis_asm_h) $(libunwind_frame_h)
+ $(elf_bfd_h) $(elf_h) $(dis_asm_h) $(libunwind_frame_h) \
+ $(libunwind_ia64_h)
infcall.o: infcall.c $(defs_h) $(breakpoint_h) $(target_h) $(regcache_h) \
$(inferior_h) $(gdb_assert_h) $(block_h) $(gdbcore_h) $(language_h) \
$(symfile_h) $(gdbcmd_h) $(command_h) $(gdb_string_h) $(infcall_h)
@@ -1954,7 +1979,8 @@ infcmd.o: infcmd.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \
$(frame_h) $(inferior_h) $(environ_h) $(value_h) $(gdbcmd_h) \
$(symfile_h) $(gdbcore_h) $(target_h) $(language_h) $(symfile_h) \
$(objfiles_h) $(completer_h) $(ui_out_h) $(event_top_h) \
- $(parser_defs_h) $(regcache_h) $(reggroups_h) $(block_h)
+ $(parser_defs_h) $(regcache_h) $(reggroups_h) $(block_h) \
+ $(gdb_assert_h)
inf-loop.o: inf-loop.c $(defs_h) $(inferior_h) $(target_h) $(event_loop_h) \
$(event_top_h) $(inf_loop_h) $(remote_h)
inflow.o: inflow.c $(defs_h) $(frame_h) $(inferior_h) $(command_h) \
@@ -1977,7 +2003,7 @@ interps.o: interps.c $(defs_h) $(gdbcmd_h) $(ui_out_h) $(event_loop_h) \
$(event_top_h) $(interps_h) $(completer_h) $(gdb_string_h) \
$(gdb_events_h) $(gdb_assert_h) $(top_h)
irix5-nat.o: irix5-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) $(target_h) \
- $(regcache_h) $(gdb_string_h) $(gregset_h)
+ $(regcache_h) $(gdb_string_h) $(gregset_h) $(mips_tdep_h)
jv-lang.o: jv-lang.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \
$(parser_defs_h) $(language_h) $(gdbtypes_h) $(symtab_h) \
$(symfile_h) $(objfiles_h) $(gdb_string_h) $(value_h) $(c_lang_h) \
@@ -1994,10 +2020,10 @@ kod-cisco.o: kod-cisco.c $(defs_h) $(gdb_string_h) $(kod_h)
language.o: language.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \
$(value_h) $(gdbcmd_h) $(expression_h) $(language_h) $(target_h) \
$(parser_defs_h) $(jv_lang_h) $(demangle_h)
-libunwind-frame.o: libunwind-frame.c $(defs_h) \
- $(frame_h) $(frame_base_h) $(frame_unwind_h) $(gdbcore_h) \
- $(gdbtypes_h) $(symtab_h) $(objfiles_h) $(regcache_h) \
- $(gdb_assert_h) $(gdb_string_h) $(complaints_h) $(libunwind_frame_h)
+libunwind-frame.o: libunwind-frame.c $(defs_h) $(inferior_h) $(frame_h) \
+ $(frame_base_h) $(frame_unwind_h) $(gdbcore_h) $(gdbtypes_h) \
+ $(symtab_h) $(objfiles_h) $(regcache_h) $(gdb_assert_h) \
+ $(gdb_string_h) $(libunwind_frame_h) $(complaints_h)
linespec.o: linespec.c $(defs_h) $(symtab_h) $(frame_h) $(command_h) \
$(symfile_h) $(objfiles_h) $(source_h) $(demangle_h) $(value_h) \
$(completer_h) $(cp_abi_h) $(parser_defs_h) $(block_h) \
@@ -2027,7 +2053,7 @@ m32r-tdep.o: m32r-tdep.c $(defs_h) $(frame_h) $(frame_unwind_h) \
$(frame_base_h) $(symtab_h) $(gdbtypes_h) $(gdbcmd_h) $(gdbcore_h) \
$(gdb_string_h) $(value_h) $(inferior_h) $(symfile_h) $(objfiles_h) \
$(language_h) $(arch_utils_h) $(regcache_h) $(trad_frame_h) \
- $(gdb_assert_h) $(dis_asm_h)
+ $(dis_asm_h) $(gdb_assert_h)
m68hc11-tdep.o: m68hc11-tdep.c $(defs_h) $(frame_h) $(frame_unwind_h) \
$(frame_base_h) $(dwarf2_frame_h) $(trad_frame_h) $(symtab_h) \
$(gdbtypes_h) $(gdbcmd_h) $(gdbcore_h) $(gdb_string_h) $(value_h) \
@@ -2084,7 +2110,7 @@ mem-break.o: mem-break.c $(defs_h) $(symtab_h) $(breakpoint_h) $(inferior_h) \
minsyms.o: minsyms.c $(defs_h) $(gdb_string_h) $(symtab_h) $(bfd_h) \
$(symfile_h) $(objfiles_h) $(demangle_h) $(value_h) $(cp_abi_h)
mips-irix-tdep.o: mips-irix-tdep.c $(defs_h) $(osabi_h) $(elf_bfd_h)
-mips-linux-nat.o: mips-linux-nat.c $(defs_h)
+mips-linux-nat.o: mips-linux-nat.c $(defs_h) $(mips_tdep_h)
mips-linux-tdep.o: mips-linux-tdep.c $(defs_h) $(gdbcore_h) $(target_h) \
$(solib_svr4_h) $(osabi_h) $(mips_tdep_h) $(gdb_string_h) \
$(gdb_assert_h)
@@ -2138,13 +2164,11 @@ objc-lang.o: objc-lang.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \
objfiles.o: objfiles.c $(defs_h) $(bfd_h) $(symtab_h) $(symfile_h) \
$(objfiles_h) $(gdb_stabs_h) $(target_h) $(bcache_h) $(gdb_assert_h) \
$(gdb_stat_h) $(gdb_obstack_h) $(gdb_string_h) $(hashtab_h) \
- $(breakpoint_h) $(block_h) $(dictionary_h) $(mmalloc_h)
+ $(breakpoint_h) $(block_h) $(dictionary_h)
observer.o: observer.c $(defs_h) $(observer_h)
ocd.o: ocd.c $(defs_h) $(gdbcore_h) $(gdb_string_h) $(frame_h) $(inferior_h) \
$(bfd_h) $(symfile_h) $(target_h) $(gdbcmd_h) $(objfiles_h) \
$(gdb_stabs_h) $(serial_h) $(ocd_h) $(regcache_h)
-op50-rom.o: op50-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \
- $(serial_h)
osabi.o: osabi.c $(defs_h) $(gdb_assert_h) $(gdb_string_h) $(osabi_h) \
$(arch_utils_h) $(gdbcmd_h) $(command_h) $(elf_bfd_h)
pa64solib.o: pa64solib.c $(defs_h) $(frame_h) $(bfd_h) $(libhppa_h) \
@@ -2178,7 +2202,7 @@ ppcnbsd-tdep.o: ppcnbsd-tdep.c $(defs_h) $(gdbcore_h) $(regcache_h) \
$(ppcnbsd_tdep_h) $(nbsd_tdep_h) $(solib_svr4_h)
ppc-sysv-tdep.o: ppc-sysv-tdep.c $(defs_h) $(gdbcore_h) $(inferior_h) \
$(regcache_h) $(value_h) $(gdb_string_h) $(gdb_assert_h) \
- $(ppc_tdep_h) $(target_h)
+ $(ppc_tdep_h) $(target_h) $(objfiles_h)
printcmd.o: printcmd.c $(defs_h) $(gdb_string_h) $(frame_h) $(symtab_h) \
$(gdbtypes_h) $(value_h) $(language_h) $(expression_h) $(gdbcore_h) \
$(gdbcmd_h) $(target_h) $(breakpoint_h) $(demangle_h) $(valprint_h) \
@@ -2191,7 +2215,7 @@ proc-flags.o: proc-flags.c $(defs_h)
procfs.o: procfs.c $(defs_h) $(inferior_h) $(target_h) $(gdbcore_h) \
$(elf_bfd_h) $(gdbcmd_h) $(gdbthread_h) $(gdb_wait_h) \
$(gdb_assert_h) $(inflow_h) $(gdb_dirent_h) $(X_OK) $(gdb_stat_h) \
- $(proc_utils_h) $(gregset_h)
+ $(proc_utils_h) $(gregset_h) $(gdb_string_h) $(auxv_h)
proc-service.o: proc-service.c $(defs_h) $(gdb_proc_service_h) $(inferior_h) \
$(symtab_h) $(target_h) $(gregset_h)
proc-why.o: proc-why.c $(defs_h) $(proc_utils_h)
@@ -2242,7 +2266,7 @@ remote-sds.o: remote-sds.c $(defs_h) $(gdb_string_h) $(frame_h) \
remote-sim.o: remote-sim.c $(defs_h) $(inferior_h) $(value_h) \
$(gdb_string_h) $(terminal_h) $(target_h) $(gdbcore_h) \
$(gdb_callback_h) $(gdb_remote_sim_h) $(remote_utils_h) $(command_h) \
- $(regcache_h) $(gdb_assert_h) $(sim_regno_h)
+ $(regcache_h) $(gdb_assert_h) $(sim_regno_h) $(arch_utils_h)
remote-st.o: remote-st.c $(defs_h) $(gdbcore_h) $(target_h) $(gdb_string_h) \
$(serial_h) $(regcache_h)
remote-utils.o: remote-utils.c $(defs_h) $(gdb_string_h) $(gdbcmd_h) \
@@ -2263,17 +2287,14 @@ remote-vxmips.o: remote-vxmips.c $(defs_h) $(vx_share_regPacket_h) \
$(symtab_h) $(symfile_h) $(regcache_h) $(gdb_string_h) \
$(vx_share_ptrace_h) $(vx_share_xdr_ptrace_h) $(vx_share_xdr_ld_h) \
$(vx_share_xdr_rdb_h) $(vx_share_dbgRpcLib_h)
-remote-vxsparc.o: remote-vxsparc.c $(defs_h) $(vx_share_regPacket_h) \
- $(frame_h) $(inferior_h) $(target_h) $(gdbcore_h) $(command_h) \
- $(symtab_h) $(symfile_h) $(regcache_h) $(gdb_string_h) \
- $(vx_share_ptrace_h) $(vx_share_xdr_ptrace_h) $(vx_share_xdr_ld_h) \
- $(vx_share_xdr_rdb_h) $(vx_share_dbgRpcLib_h)
+remote-vxsparc.o: remote-vxsparc.c $(defs_h) $(regcache_h) $(gdb_string_h) \
+ $(sparc_tdep_h) $(vx_share_ptrace_h) $(vx_share_regPacket_h)
rom68k-rom.o: rom68k-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \
$(serial_h) $(regcache_h) $(value_h) $(m68k_tdep_h)
rs6000-nat.o: rs6000-nat.c $(defs_h) $(inferior_h) $(target_h) $(gdbcore_h) \
$(xcoffsolib_h) $(symfile_h) $(objfiles_h) $(libbfd_h) $(bfd_h) \
$(gdb_stabs_h) $(regcache_h) $(arch_utils_h) $(language_h) \
- $(ppc_tdep_h) $(gdb_stat_h)
+ $(ppc_tdep_h) $(exec_h) $(gdb_stat_h)
rs6000-tdep.o: rs6000-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(symtab_h) \
$(target_h) $(gdbcore_h) $(gdbcmd_h) $(symfile_h) $(objfiles_h) \
$(arch_utils_h) $(regcache_h) $(doublest_h) $(value_h) \
@@ -2331,7 +2352,7 @@ solib-aix5.o: solib-aix5.c $(defs_h) $(gdb_string_h) $(elf_external_h) \
solib.o: solib.c $(defs_h) $(gdb_string_h) $(symtab_h) $(bfd_h) $(symfile_h) \
$(objfiles_h) $(gdbcore_h) $(command_h) $(target_h) $(frame_h) \
$(gdb_regex_h) $(inferior_h) $(environ_h) $(language_h) $(gdbcmd_h) \
- $(completer_h) $(filenames_h) $(solist_h) $(exec_h)
+ $(completer_h) $(filenames_h) $(exec_h) $(solist_h)
solib-irix.o: solib-irix.c $(defs_h) $(symtab_h) $(bfd_h) $(symfile_h) \
$(objfiles_h) $(gdbcore_h) $(target_h) $(inferior_h) $(solist_h)
solib-legacy.o: solib-legacy.c $(defs_h) $(gdbcore_h) $(solib_svr4_h)
@@ -2359,29 +2380,28 @@ source.o: source.c $(defs_h) $(symtab_h) $(expression_h) $(language_h) \
$(gdb_string_h) $(gdb_stat_h) $(gdbcore_h) $(gdb_regex_h) \
$(symfile_h) $(objfiles_h) $(annotate_h) $(gdbtypes_h) $(linespec_h) \
$(filenames_h) $(completer_h) $(ui_out_h)
-sparc-linux-tdep.o: sparc-linux-tdep.c $(defs_h) $(floatformat_h) $(frame_h) \
- $(frame_unwind_h) $(gdbarch_h) $(gdbcore_h) $(osabi_h) $(regcache_h) \
- $(solib_svr4_h) $(symtab_h) $(trad_frame_h) $(gdb_assert_h) \
- $(gdb_string_h) $(sparc_tdep_h)
-sparc-nat.o: sparc-nat.c $(defs_h) $(inferior_h) $(regcache_h) \
- $(gdb_string_h) $(gdb_wait_h) $(sparc_tdep_h) $(sparc_nat_h)
-sparc-sol2-nat.o: sparc-sol2-nat.c $(defs_h) $(regcache_h) $(gregset_h) \
- $(sparc_tdep_h) $(sparc64_tdep_h)
-sparc-sol2-tdep.o: sparc-sol2-tdep.c $(defs_h) $(frame_h) $(frame_unwind_h) \
- $(gdbcore_h) $(symtab_h) $(objfiles_h) $(osabi_h) $(regcache_h) \
+sparc64fbsd-nat.o: sparc64fbsd-nat.c $(defs_h) $(sparc64_tdep_h) \
+ $(sparc_nat_h)
+sparc64fbsd-tdep.o: sparc64fbsd-tdep.c $(defs_h) $(frame_h) \
+ $(frame_unwind_h) $(gdbcore_h) $(osabi_h) $(regcache_h) $(regset_h) \
$(target_h) $(trad_frame_h) $(gdb_assert_h) $(gdb_string_h) \
- $(sparc_tdep_h)
-sparc-tdep.o: sparc-tdep.c $(defs_h) $(arch_utils_h) $(dis_asm_h) \
- $(float_format_h) $(frame_h) $(frame_base_h) $(frame_unwind_h) \
- $(gdbcore_h) $(gdbtypes_h) $(inferior_h) $(symtab_h) $(objfiles_h) \
- $(osabi_h) $(regcache_h) $(target_h) $(value_h) $(gdb_assert_h) \
- $(gdb_string_h) $(sparc_tdep_h)
-sparc64-linux-nat.o: sparc64-linux-nat.c $(defs_h) \
- $(sparc64_tdep_h) $(sparc_nat_h)
-sparc64-linux-tdep.o: sparc64-linux-tdep.c $(defs_h) $(gdbarch_h) \
- $(osabi_h) $(solib_svr4_h) $(sparc64_tdep_h)
-sparc64-nat.o: sparc-nat.c $(defs_h) $(gdbarch_h) \
- $(sparc64_tdep_h) $(sparc_nat_h)
+ $(sparc64_tdep_h)
+sparc64-linux-nat.o: sparc64-linux-nat.c $(defs_h) $(sparc64_tdep_h) \
+ $(sparc_nat_h)
+sparc64-linux-tdep.o: sparc64-linux-tdep.c $(defs_h) $(gdbarch_h) $(osabi_h) \
+ $(solib_svr4_h) $(sparc64_tdep_h)
+sparc64-nat.o: sparc64-nat.c $(defs_h) $(gdbarch_h) $(sparc64_tdep_h) \
+ $(sparc_nat_h)
+sparc64nbsd-nat.o: sparc64nbsd-nat.c $(defs_h) $(sparc64_tdep_h) \
+ $(sparc_nat_h)
+sparc64nbsd-tdep.o: sparc64nbsd-tdep.c $(defs_h) $(frame_h) \
+ $(frame_unwind_h) $(gdbcore_h) $(osabi_h) $(regcache_h) $(regset_h) \
+ $(symtab_h) $(solib_svr4_h) $(trad_frame_h) $(gdb_assert_h) \
+ $(gdb_string_h) $(sparc64_tdep_h) $(nbsd_tdep_h)
+sparc64obsd-tdep.o: sparc64obsd-tdep.c $(defs_h) $(frame_h) \
+ $(frame_unwind_h) $(osabi_h) $(regset_h) $(symtab_h) \
+ $(solib_svr4_h) $(trad_frame_h) $(gdb_assert_h) \
+ $(sparc64_tdep_h) $(nbsd_tdep_h)
sparc64-sol2-tdep.o: sparc64-sol2-tdep.c $(defs_h) $(frame_h) \
$(frame_unwind_h) $(gdbarch_h) $(symtab_h) $(objfiles_h) $(osabi_h) \
$(trad_frame_h) $(gdb_assert_h) $(sparc64_tdep_h)
@@ -2390,24 +2410,33 @@ sparc64-tdep.o: sparc64-tdep.c $(defs_h) $(arch_utils_h) $(floatformat_h) \
$(gdbtypes_h) $(inferior_h) $(symtab_h) $(objfiles_h) $(osabi_h) \
$(regcache_h) $(target_h) $(value_h) $(gdb_assert_h) $(gdb_string_h) \
$(sparc64_tdep_h)
-sparc64fbsd-nat.o: sparc64fbsd-nat.c $(defs_h) $(sparc64_tdep_h) \
- $(sparc_nat_h)
-sparc64fbsd-tdep.o: sparc64fbsd-tdep.c $(defs_h) $(frame_h) \
- $(frame_unwind_h) $(gdbcore_h) $(osabi_h) $(regcache_h) $(target_h) \
- $(trad_frame_h) $(gdb_assert_h) $(gdb_string_h) $(sparc64_tdep_h)
-sparc64nbsd-nat.o: sparc64nbsd-nat.c $(defs_h) $(sparc64_tdep_h) \
+sparc-linux-tdep.o: sparc-linux-tdep.c $(defs_h) $(floatformat_h) $(frame_h) \
+ $(frame_unwind_h) $(gdbarch_h) $(gdbcore_h) $(osabi_h) $(regcache_h) \
+ $(solib_svr4_h) $(symtab_h) $(trad_frame_h) $(gdb_assert_h) \
+ $(gdb_string_h) $(sparc_tdep_h)
+sparc-nat.o: sparc-nat.c $(defs_h) $(inferior_h) $(regcache_h) $(target_h) \
+ $(gdb_assert_h) $(gdb_string_h) $(gdb_wait_h) $(sparc_tdep_h) \
$(sparc_nat_h)
-sparc64nbsd-tdep.o: sparc64nbsd-tdep.c $(defs_h) $(frame_h) \
- $(frame_unwind_h) $(gdbcore_h) $(osabi_h) $(regcache_h) \
- $(solib_svr4_h) $(trad_frame_h) $(gdb_assert_h) $(gdb_string_h) \
- $(sparc64_tdep_h) $(nbsd_tdep_h)
sparcnbsd-nat.o: sparcnbsd-nat.c $(defs_h) $(sparc_tdep_h) $(sparc_nat_h)
sparcnbsd-tdep.o: sparcnbsd-tdep.c $(defs_h) $(floatformat_h) $(frame_h) \
- $(frame_unwind_h) $(gdbcore_h) $(osabi_h) $(regcache_h) \
+ $(frame_unwind_h) $(gdbcore_h) $(osabi_h) $(regcache_h) $(regset_h) \
$(solib_svr4_h) $(symtab_h) $(trad_frame_h) $(gdb_assert_h) \
$(gdb_string_h) $(sparc_tdep_h) $(nbsd_tdep_h)
+sparcobsd-tdep.o: sparcobsd-tdep.c $(defs_h) $(floatformat_h) $(frame_h) \
+ $(frame_unwind_h) $(osabi_h) $(solib_svr4_h) $(symtab_h) \
+ $(trad_frame_h) $(gdb_assert_h) $(sparc_tdep_h) $(nbsd_tdep_h)
+sparc-sol2-nat.o: sparc-sol2-nat.c $(defs_h) $(regcache_h) $(gregset_h) \
+ $(sparc_tdep_h) $(sparc64_tdep_h)
+sparc-sol2-tdep.o: sparc-sol2-tdep.c $(defs_h) $(frame_h) $(frame_unwind_h) \
+ $(gdbcore_h) $(symtab_h) $(objfiles_h) $(osabi_h) $(regcache_h) \
+ $(target_h) $(trad_frame_h) $(gdb_assert_h) $(gdb_string_h) \
+ $(sparc_tdep_h)
sparc-stub.o: sparc-stub.c
-
+sparc-tdep.o: sparc-tdep.c $(defs_h) $(arch_utils_h) $(dis_asm_h) \
+ $(floatformat_h) $(frame_h) $(frame_base_h) $(frame_unwind_h) \
+ $(gdbcore_h) $(gdbtypes_h) $(inferior_h) $(symtab_h) $(objfiles_h) \
+ $(osabi_h) $(regcache_h) $(target_h) $(value_h) $(gdb_assert_h) \
+ $(gdb_string_h) $(sparc_tdep_h)
stabsread.o: stabsread.c $(defs_h) $(gdb_string_h) $(bfd_h) $(gdb_obstack_h) \
$(symtab_h) $(gdbtypes_h) $(expression_h) $(symfile_h) $(objfiles_h) \
$(aout_stab_gnu_h) $(libaout_h) $(aout_aout64_h) $(gdb_stabs_h) \
@@ -2443,8 +2472,7 @@ symtab.o: symtab.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(gdbcore_h) \
$(block_h) $(dictionary_h) $(gdb_string_h) $(gdb_stat_h) $(cp_abi_h)
target.o: target.c $(defs_h) $(gdb_string_h) $(target_h) $(gdbcmd_h) \
$(symtab_h) $(inferior_h) $(bfd_h) $(symfile_h) $(objfiles_h) \
- $(gdb_wait_h) $(dcache_h) $(regcache_h) $(gdb_assert_h) \
- $(gdbcore_h)
+ $(gdb_wait_h) $(dcache_h) $(regcache_h) $(gdb_assert_h) $(gdbcore_h)
thread.o: thread.c $(defs_h) $(symtab_h) $(frame_h) $(inferior_h) \
$(environ_h) $(value_h) $(target_h) $(gdbthread_h) $(command_h) \
$(gdbcmd_h) $(regcache_h) $(gdb_h) $(gdb_string_h) $(ui_out_h)
@@ -2477,11 +2505,9 @@ user-regs.o: user-regs.c $(defs_h) $(user_regs_h) $(gdbtypes_h) \
utils.o: utils.c $(defs_h) $(gdb_assert_h) $(gdb_string_h) $(event_top_h) \
$(gdbcmd_h) $(serial_h) $(bfd_h) $(target_h) $(demangle_h) \
$(expression_h) $(language_h) $(charset_h) $(annotate_h) \
- $(filenames_h) $(inferior_h) $(mmalloc_h)
+ $(filenames_h) $(inferior_h)
uw-thread.o: uw-thread.c $(defs_h) $(gdbthread_h) $(target_h) $(inferior_h) \
$(regcache_h) $(gregset_h)
-glibc-tdep.o: glibc-tdep.c $(defs_h) $(frame_h) $(symtab_h) \
- $(symfile_h) $(objfiles_h) $(glibc_tdep_h)
v850ice.o: v850ice.c $(defs_h) $(gdb_string_h) $(frame_h) $(symtab_h) \
$(inferior_h) $(breakpoint_h) $(symfile_h) $(target_h) $(objfiles_h) \
$(gdbcore_h) $(value_h) $(command_h) $(regcache_h)
@@ -2508,12 +2534,10 @@ varobj.o: varobj.c $(defs_h) $(value_h) $(expression_h) $(frame_h) \
vax-tdep.o: vax-tdep.c $(defs_h) $(symtab_h) $(opcode_vax_h) $(gdbcore_h) \
$(inferior_h) $(regcache_h) $(frame_h) $(value_h) $(arch_utils_h) \
$(gdb_string_h) $(osabi_h) $(dis_asm_h) $(vax_tdep_h)
-w89k-rom.o: w89k-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \
- $(serial_h) $(xmodem_h) $(regcache_h)
win32-nat.o: win32-nat.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \
$(gdbcore_h) $(command_h) $(completer_h) $(regcache_h) $(top_h) \
- $(i386_tdep_h) $(buildsym_h) $(symfile_h) $(objfiles_h) \
- $(gdb_string_h) $(gdbthread_h) $(gdbcmd_h) $(exec_h)
+ $(buildsym_h) $(symfile_h) $(objfiles_h) $(gdb_string_h) \
+ $(gdbthread_h) $(gdbcmd_h) $(exec_h) $(i386_tdep_h) $(i387_tdep_h)
wince.o: wince.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) $(gdbcore_h) \
$(command_h) $(buildsym_h) $(symfile_h) $(objfiles_h) \
$(gdb_string_h) $(gdbthread_h) $(gdbcmd_h) $(wince_stub_h) \
@@ -2555,7 +2579,7 @@ cli-cmds.o: $(srcdir)/cli/cli-cmds.c $(defs_h) $(completer_h) $(target_h) \
$(linespec_h) $(expression_h) $(frame_h) $(value_h) $(language_h) \
$(filenames_h) $(objfiles_h) $(source_h) $(disasm_h) $(ui_out_h) \
$(top_h) $(cli_decode_h) $(cli_script_h) $(cli_setshow_h) \
- $(cli_cmds_h)
+ $(cli_cmds_h) $(readline_h)
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-cmds.c
cli-decode.o: $(srcdir)/cli/cli-decode.c $(defs_h) $(symtab_h) \
$(gdb_regex_h) $(gdb_string_h) $(ui_out_h) $(cli_cmds_h) \
@@ -2649,7 +2673,7 @@ gdbtk.o: $(srcdir)/gdbtk/generic/gdbtk.c \
$(srcdir)/gdbtk/generic/gdbtk.h $(defs_h) \
$(symtab_h) $(inferior_h) $(command_h) \
$(bfd_h) $(symfile_h) $(objfiles_h) $(target_h) $(gdb_string_h) \
- $(tracepoint_h) $(top_h)
+ $(tracepoint_h) $(top_h)
$(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) \
$(ITK_CFLAGS) \
$(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) $(GDBTK_CFLAGS)\
@@ -2820,80 +2844,86 @@ signals.o: $(srcdir)/signals/signals.c $(server_h) $(defs_h) $(target_h) \
# Need to explicitly specify the compile rule as make will do nothing
# or try to compile the object file into the sub-directory.
-tuiCommand.o: $(srcdir)/tui/tuiCommand.c $(defs_h) $(tui_h) $(tuiData_h) \
- $(tuiWin_h) $(tuiIO_h)
- $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tuiCommand.c
-tuiDataWin.o: $(srcdir)/tui/tuiDataWin.c $(defs_h) $(tui_h) $(tuiData_h) \
- $(tuiGeneralWin_h) $(tuiRegs_h)
- $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tuiDataWin.c
-tuiData.o: $(srcdir)/tui/tuiData.c $(defs_h) $(symtab_h) $(tui_h) \
- $(tuiData_h) $(tuiGeneralWin_h)
- $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tuiData.c
-tuiDisassem.o: $(srcdir)/tui/tuiDisassem.c $(defs_h) $(symtab_h) \
- $(breakpoint_h) $(frame_h) $(value_h) $(source_h) $(disasm_h) \
- $(tui_h) $(tuiData_h) $(tuiWin_h) $(tuiLayout_h) $(tuiSourceWin_h) \
- $(tuiStack_h) $(tui_file_h)
- $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tuiDisassem.c
-tuiGeneralWin.o: $(srcdir)/tui/tuiGeneralWin.c $(defs_h) $(tui_h) \
- $(tuiData_h) $(tuiGeneralWin_h) $(tuiWin_h)
- $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tuiGeneralWin.c
-tuiIO.o: $(srcdir)/tui/tuiIO.c $(defs_h) $(terminal_h) $(target_h) \
- $(event_loop_h) $(event_top_h) $(command_h) $(top_h) $(readline_h) \
- $(tui_h) $(tuiData_h) $(tuiIO_h) $(tuiCommand_h) $(tuiWin_h) \
- $(tuiGeneralWin_h) $(tui_file_h) $(ui_out_h) $(cli_out_h)
- $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tuiIO.c
-tuiLayout.o: $(srcdir)/tui/tuiLayout.c $(defs_h) $(command_h) $(symtab_h) \
- $(frame_h) $(source_h) $(tui_h) $(tuiData_h) $(tuiDataWin_h) \
- $(tuiGeneralWin_h) $(tuiStack_h) $(tuiRegs_h) $(tuiWin_h) \
- $(tuiSourceWin_h) $(tuiDisassem_h)
- $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tuiLayout.c
-tuiRegs.o: $(srcdir)/tui/tuiRegs.c $(defs_h) $(tui_h) $(tuiData_h) \
- $(symtab_h) $(gdbtypes_h) $(gdbcmd_h) $(frame_h) $(regcache_h) \
- $(inferior_h) $(target_h) $(tuiLayout_h) $(tuiWin_h) $(tuiDataWin_h) \
- $(tuiGeneralWin_h) $(tui_file_h)
- $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tuiRegs.c
tuiSourceWin.o: $(srcdir)/tui/tuiSourceWin.c $(defs_h) $(symtab_h) \
$(frame_h) $(breakpoint_h) $(value_h) $(source_h) $(tui_h) \
$(tuiData_h) $(tuiStack_h) $(tuiWin_h) $(tuiGeneralWin_h) \
$(tuiSourceWin_h) $(tuiSource_h) $(tuiDisassem_h)
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tuiSourceWin.c
-tuiSource.o: $(srcdir)/tui/tuiSource.c $(defs_h) $(symtab_h) $(frame_h) \
- $(breakpoint_h) $(source_h) $(symtab_h) $(tui_h) $(tuiData_h) \
- $(tuiStack_h) $(tuiSourceWin_h) $(tuiSource_h)
- $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tuiSource.c
-tuiStack.o: $(srcdir)/tui/tuiStack.c $(defs_h) $(symtab_h) $(breakpoint_h) \
- $(frame_h) $(command_h) $(inferior_h) $(target_h) $(top_h) $(tui_h) \
- $(tuiData_h) $(tuiStack_h) $(tuiGeneralWin_h) $(tuiSource_h) \
- $(tuiSourceWin_h) $(tui_file_h)
- $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tuiStack.c
-tuiWin.o: $(srcdir)/tui/tuiWin.c $(defs_h) $(command_h) $(symtab_h) \
- $(breakpoint_h) $(frame_h) $(cli_cmds_h) $(top_h) $(source_h) \
- $(tui_h) $(tuiData_h) $(tuiGeneralWin_h) $(tuiStack_h) $(tuiRegs_h) \
- $(tuiDisassem_h) $(tuiSource_h) $(tuiSourceWin_h) $(tuiDataWin_h)
- $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tuiWin.c
-tui.o: $(srcdir)/tui/tui.c $(defs_h) $(gdbcmd_h) $(tui_h) $(tuiData_h) \
- $(tuiLayout_h) $(tuiIO_h) $(tuiRegs_h) $(tuiStack_h) $(tuiWin_h) \
- $(tuiSourceWin_h) $(tuiDataWin_h) $(readline_h) $(target_h) \
- $(frame_h) $(breakpoint_h) $(inferior_h) $(symtab_h) $(source_h)
+tui.o: $(srcdir)/tui/tui.c $(defs_h) $(gdbcmd_h) $(tui_h) $(tui_data_h) \
+ $(tui_layout_h) $(tui_io_h) $(tui_regs_h) $(tui_stack_h) \
+ $(tui_win_h) $(tui_winsource_h) $(tui_windata_h) $(readline_h) \
+ $(target_h) $(frame_h) $(breakpoint_h) $(inferior_h) $(symtab_h) \
+ $(source_h)
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tui.c
+tui-command.o: $(srcdir)/tui/tui-command.c $(defs_h) $(tui_h) $(tui_data_h) \
+ $(tui_win_h) $(tui_io_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tui-command.c
+tui-data.o: $(srcdir)/tui/tui-data.c $(defs_h) $(symtab_h) $(tui_h) \
+ $(tui_data_h) $(tui_wingeneral_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tui-data.c
+tui-disasm.o: $(srcdir)/tui/tui-disasm.c $(defs_h) $(symtab_h) \
+ $(breakpoint_h) $(frame_h) $(value_h) $(source_h) $(disasm_h) \
+ $(tui_h) $(tui_data_h) $(tui_win_h) $(tui_layout_h) \
+ $(tui_winsource_h) $(tui_stack_h) $(tui_file_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tui-disasm.c
tui-file.o: $(srcdir)/tui/tui-file.c $(defs_h) $(ui_file_h) $(tui_file_h) \
- $(tui_tuiIO_h) $(tui_h)
+ $(tui_io_h) $(tui_h)
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tui-file.c
tui-hooks.o: $(srcdir)/tui/tui-hooks.c $(defs_h) $(symtab_h) $(inferior_h) \
$(command_h) $(bfd_h) $(symfile_h) $(objfiles_h) $(target_h) \
$(gdbcore_h) $(event_loop_h) $(event_top_h) $(frame_h) \
$(breakpoint_h) $(gdb_events_h) $(ui_out_h) $(top_h) $(tui_h) \
- $(tuiData_h) $(tuiLayout_h) $(tuiIO_h) $(tuiRegs_h) $(tuiWin_h) \
- $(tuiStack_h) $(tuiDataWin_h) $(tuiSourceWin_h)
+ $(tui_data_h) $(tui_layout_h) $(tui_io_h) $(tui_regs_h) $(tui_win_h) \
+ $(tui_stack_h) $(tui_windata_h) $(tui_winsource_h)
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tui-hooks.c
tui-interp.o: $(srcdir)/tui/tui-interp.c $(defs_h) $(interps_h) $(top_h) \
$(event_top_h) $(event_loop_h) $(ui_out_h) $(cli_out_h) \
- $(tui_tuiData_h) $(readline_h) $(tui_tuiWin_h) $(tui_h) \
- $(tui_tuiIO_h)
+ $(tui_data_h) $(readline_h) $(tui_win_h) $(tui_h) $(tui_io_h)
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tui-interp.c
+tui-io.o: $(srcdir)/tui/tui-io.c $(defs_h) $(terminal_h) $(target_h) \
+ $(event_loop_h) $(event_top_h) $(command_h) $(top_h) $(readline_h) \
+ $(tui_h) $(tui_data_h) $(tui_io_h) $(tui_command_h) $(tui_win_h) \
+ $(tui_wingeneral_h) $(tui_file_h) $(ui_out_h) $(cli_out_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tui-io.c
+tui-layout.o: $(srcdir)/tui/tui-layout.c $(defs_h) $(command_h) $(symtab_h) \
+ $(frame_h) $(source_h) $(tui_h) $(tui_data_h) $(tui_windata_h) \
+ $(tui_wingeneral_h) $(tui_stack_h) $(tui_regs_h) $(tui_win_h) \
+ $(tui_winsource_h) $(tui_disasm_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tui-layout.c
tui-out.o: $(srcdir)/tui/tui-out.c $(defs_h) $(ui_out_h) $(tui_h) \
$(gdb_string_h) $(gdb_assert_h)
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tui-out.c
+tui-regs.o: $(srcdir)/tui/tui-regs.c $(defs_h) $(tui_h) $(tui_data_h) \
+ $(symtab_h) $(gdbtypes_h) $(gdbcmd_h) $(frame_h) $(regcache_h) \
+ $(inferior_h) $(target_h) $(tui_layout_h) $(tui_win_h) \
+ $(tui_windata_h) $(tui_wingeneral_h) $(tui_file_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tui-regs.c
+tui-source.o: $(srcdir)/tui/tui-source.c $(defs_h) $(symtab_h) $(frame_h) \
+ $(breakpoint_h) $(source_h) $(symtab_h) $(tui_h) $(tui_data_h) \
+ $(tui_stack_h) $(tui_winsource_h) $(tui_source_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tui-source.c
+tui-stack.o: $(srcdir)/tui/tui-stack.c $(defs_h) $(symtab_h) $(breakpoint_h) \
+ $(frame_h) $(command_h) $(inferior_h) $(target_h) $(top_h) $(tui_h) \
+ $(tui_data_h) $(tui_stack_h) $(tui_wingeneral_h) $(tui_source_h) \
+ $(tui_winsource_h) $(tui_file_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tui-stack.c
+tui-win.o: $(srcdir)/tui/tui-win.c $(defs_h) $(command_h) $(symtab_h) \
+ $(breakpoint_h) $(frame_h) $(cli_cmds_h) $(top_h) $(source_h) \
+ $(tui_h) $(tui_data_h) $(tui_wingeneral_h) $(tui_stack_h) \
+ $(tui_regs_h) $(tui_disasm_h) $(tui_source_h) $(tui_winsource_h) \
+ $(tui_windata_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tui-win.c
+tui-windata.o: $(srcdir)/tui/tui-windata.c $(defs_h) $(tui_h) $(tui_data_h) \
+ $(tui_wingeneral_h) $(tui_regs_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tui-windata.c
+tui-wingeneral.o: $(srcdir)/tui/tui-wingeneral.c $(defs_h) $(tui_h) \
+ $(tui_data_h) $(tui_wingeneral_h) $(tui_win_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tui-wingeneral.c
+tui-winsource.o: $(srcdir)/tui/tui-winsource.c $(defs_h) $(symtab_h) \
+ $(frame_h) $(breakpoint_h) $(value_h) $(source_h) $(tui_h) \
+ $(tui_data_h) $(tui_stack_h) $(tui_win_h) $(tui_wingeneral_h) \
+ $(tui_winsource_h) $(tui_source_h) $(tui_disasm_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tui-winsource.c
#
# vx-share sub-directory
diff --git a/gdb/NEWS b/gdb/NEWS
index 6919ee6..9ee0cec9 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -3,6 +3,11 @@
*** Changes since GDB 6.0:
+* Removed --with-mmalloc
+
+Support for the mmalloc memory manager has been removed, as it
+conflicted with the internal gdb byte cache.
+
* Changes in AMD64 configurations
The AMD64 target now includes the %cs and %ss registers. As a result
@@ -14,7 +19,9 @@ you should upgrade gdbserver on the remote side.
The SPARC target has been completely revised, incorporating the
FreeBSD/sparc64 support that was added for GDB 6.0. As a result
-support for LynxOS and SunOS 4 has been dropped.
+support for LynxOS and SunOS 4 has been dropped. Calling functions
+from within GDB on operating systems with a non-executable stack
+(Solaris, OpenBSD) now works.
* New C++ demangler
@@ -32,6 +39,8 @@ encountered these.
* New native configurations
NetBSD/amd64 x86_64-*-netbsd*
+OpenBSD/sparc sparc-*-openbsd*
+OpenBSD/sparc64 sparc64-*-openbsd*
* New debugging protocols
diff --git a/gdb/PROBLEMS b/gdb/PROBLEMS
index cf60d53..7fd0eb5 100644
--- a/gdb/PROBLEMS
+++ b/gdb/PROBLEMS
@@ -23,6 +23,18 @@ Fortunately the ARM target, in the GDB's mainline sources, has been
updated so people encountering problems should consider downloading a
more current GDB (http://www.gnu.org/software/gdb/current).
+gdb/1516: [regression] local classes, gcc 2.95.3, dwarf-2
+
+With gcc 2.95.3 and the dwarf-2 debugging format, classes which are
+defined locally to a function include the demangled name of the function
+as part of their name. For example, if a function "foobar" contains a
+local class definition "Local", gdb will say that the name of the class
+type is "foobar__Fi.0:Local".
+
+This applies only to classes where the class type is defined inside a
+function, not to variables defined with types that are defined somewhere
+outside any function (which most types are).
+
gdb/1091: Constructor breakpoints ignored
gdb/1193: g++ 3.3 creates multiple constructors: gdb 5.3 can't set breakpoints
diff --git a/gdb/acconfig.h b/gdb/acconfig.h
index 3bef708..87560c7 100644
--- a/gdb/acconfig.h
+++ b/gdb/acconfig.h
@@ -108,15 +108,6 @@
/* Define if you have HPUX threads */
#undef HAVE_HPUX_THREAD_SUPPORT
-/* Define if you want to use the memory mapped malloc package (mmalloc). */
-#undef USE_MMALLOC
-
-/* Define if the runtime uses a routine from mmalloc before gdb has a chance
- to initialize mmalloc, and we want to force checking to be used anyway.
- This may cause spurious memory corruption messages if the runtime tries
- to explicitly deallocate that memory when gdb calls exit. */
-#undef MMCHECK_FORCE
-
/* Define to 1 if NLS is requested. */
#undef ENABLE_NLS
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index f05585f..b97321b 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -1,5 +1,5 @@
/* Ada language support routines for GDB, the GNU debugger. Copyright
- 1992, 1993, 1994, 1997, 1998, 1999, 2000, 2003
+ 1992, 1993, 1994, 1997, 1998, 1999, 2000, 2003, 2004
Free Software Foundation, Inc.
This file is part of GDB.
@@ -8019,6 +8019,7 @@ const struct language_defn ada_language_defn = {
NULL, /* Language specific skip_trampoline */
value_of_this, /* value_of_this */
basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
+ basic_lookup_transparent_type,/* lookup_transparent_type */
NULL, /* Language specific symbol demangler */
{"", "", "", ""}, /* Binary format info */
#if 0
diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c
index 325cf19..c777933 100644
--- a/gdb/alpha-tdep.c
+++ b/gdb/alpha-tdep.c
@@ -1537,8 +1537,7 @@ alpha_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_use_struct_convention (gdbarch, always_use_struct_convention);
set_gdbarch_extract_return_value (gdbarch, alpha_extract_return_value);
set_gdbarch_store_return_value (gdbarch, alpha_store_return_value);
- set_gdbarch_extract_struct_value_address (gdbarch,
- alpha_extract_struct_value_address);
+ set_gdbarch_deprecated_extract_struct_value_address (gdbarch, alpha_extract_struct_value_address);
/* Settings for calling functions in the inferior. */
set_gdbarch_push_dummy_call (gdbarch, alpha_push_dummy_call);
@@ -1555,7 +1554,6 @@ alpha_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_breakpoint_from_pc (gdbarch, alpha_breakpoint_from_pc);
set_gdbarch_decr_pc_after_break (gdbarch, 4);
- set_gdbarch_function_start_offset (gdbarch, 0);
set_gdbarch_frame_args_skip (gdbarch, 0);
/* Hook in ABI-specific overrides, if they have been registered. */
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index e7aef4a..b4f37be 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -1,6 +1,6 @@
/* Common target dependent code for GDB on ARM systems.
Copyright 1988, 1989, 1991, 1992, 1993, 1995, 1996, 1998, 1999, 2000,
- 2001, 2002, 2003 Free Software Foundation, Inc.
+ 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of GDB.
@@ -2689,6 +2689,21 @@ arm_coff_make_msymbol_special(int val, struct minimal_symbol *msym)
MSYMBOL_SET_SPECIAL (msym);
}
+static void
+arm_write_pc (CORE_ADDR pc, ptid_t ptid)
+{
+ write_register_pid (ARM_PC_REGNUM, pc, ptid);
+
+ /* If necessary, set the T bit. */
+ if (arm_apcs_32)
+ {
+ CORE_ADDR val = read_register_pid (ARM_PS_REGNUM, ptid);
+ if (arm_pc_is_thumb (pc))
+ write_register_pid (ARM_PS_REGNUM, val | 0x20, ptid);
+ else
+ write_register_pid (ARM_PS_REGNUM, val & ~(CORE_ADDR) 0x20, ptid);
+ }
+}
static enum gdb_osabi
arm_elf_osabi_sniffer (bfd *abfd)
@@ -2851,6 +2866,8 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_push_dummy_call (gdbarch, arm_push_dummy_call);
+ set_gdbarch_write_pc (gdbarch, arm_write_pc);
+
/* Frame handling. */
set_gdbarch_unwind_dummy_id (gdbarch, arm_unwind_dummy_id);
set_gdbarch_unwind_pc (gdbarch, arm_unwind_pc);
@@ -2866,9 +2883,6 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_smash_text_address (gdbarch, arm_smash_text_address);
set_gdbarch_addr_bits_remove (gdbarch, arm_addr_bits_remove);
- /* Offset from address of function to start of its code. */
- set_gdbarch_function_start_offset (gdbarch, 0);
-
/* Advance PC across function entry code. */
set_gdbarch_skip_prologue (gdbarch, arm_skip_prologue);
@@ -2880,7 +2894,6 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
/* Breakpoint manipulation. */
set_gdbarch_breakpoint_from_pc (gdbarch, arm_breakpoint_from_pc);
- set_gdbarch_decr_pc_after_break (gdbarch, 0);
/* Information about registers, etc. */
set_gdbarch_print_float_info (gdbarch, arm_print_float_info);
@@ -2910,8 +2923,7 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_extract_return_value (gdbarch, arm_extract_return_value);
set_gdbarch_store_return_value (gdbarch, arm_store_return_value);
set_gdbarch_use_struct_convention (gdbarch, arm_use_struct_convention);
- set_gdbarch_extract_struct_value_address (gdbarch,
- arm_extract_struct_value_address);
+ set_gdbarch_deprecated_extract_struct_value_address (gdbarch, arm_extract_struct_value_address);
/* Single stepping. */
/* XXX For an RDI target we should ask the target if it can single-step. */
diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c
index 9ef84c0..cf231fa 100644
--- a/gdb/avr-tdep.c
+++ b/gdb/avr-tdep.c
@@ -1,5 +1,5 @@
/* Target-dependent code for Atmel AVR, for GDB.
- Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+ Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
This file is part of GDB.
@@ -226,12 +226,6 @@ avr_make_iaddr (CORE_ADDR x)
return ((x) | AVR_IMEM_START);
}
-static int
-avr_iaddr_p (CORE_ADDR x)
-{
- return (((x) & AVR_MEM_MASK) == AVR_IMEM_START);
-}
-
/* FIXME: TRoth: Really need to use a larger mask for instructions. Some
devices are already up to 128KBytes of flash space.
@@ -251,12 +245,6 @@ avr_make_saddr (CORE_ADDR x)
return ((x) | AVR_SMEM_START);
}
-static int
-avr_saddr_p (CORE_ADDR x)
-{
- return (((x) & AVR_MEM_MASK) == AVR_SMEM_START);
-}
-
static CORE_ADDR
avr_convert_saddr_to_raw (CORE_ADDR x)
{
@@ -1319,11 +1307,8 @@ avr_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_skip_prologue (gdbarch, avr_skip_prologue);
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_frame_args_skip (gdbarch, 0);
set_gdbarch_frameless_function_invocation (gdbarch,
frameless_look_for_prologue);
diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c
index 5692c35..dadad8e 100644
--- a/gdb/ax-gdb.c
+++ b/gdb/ax-gdb.c
@@ -134,7 +134,6 @@ static void gen_sizeof (union exp_element **pc,
static void gen_expr (union exp_element **pc,
struct agent_expr *ax, struct axs_value *value);
-static void print_axs_value (struct ui_file *f, struct axs_value * value);
static void agent_command (char *exp, int from_tty);
@@ -621,7 +620,12 @@ gen_var_ref (struct agent_expr *ax, struct axs_value *value, struct symbol *var)
case LOC_COMPUTED:
case LOC_COMPUTED_ARG:
- (*SYMBOL_LOCATION_FUNCS (var)->tracepoint_var_ref) (var, ax, value);
+ /* FIXME: cagney/2004-01-26: It should be possible to
+ unconditionally call the SYMBOL_OPS method when available.
+ Unfortunately DWARF 2 stores the frame-base (instead of the
+ function) location in a function's symbol. Oops! For the
+ moment enable this when/where applicable. */
+ SYMBOL_OPS (var)->tracepoint_var_ref (var, ax, value);
break;
case LOC_OPTIMIZED_OUT:
@@ -1797,33 +1801,6 @@ gen_trace_for_expr (CORE_ADDR scope, struct expression *expr)
discard_cleanups (old_chain);
return ax;
}
-
-
-
-/* The "agent" command, for testing: compile and disassemble an expression. */
-
-static void
-print_axs_value (struct ui_file *f, struct axs_value *value)
-{
- switch (value->kind)
- {
- case axs_rvalue:
- fputs_filtered ("rvalue", f);
- break;
-
- case axs_lvalue_memory:
- fputs_filtered ("memory lvalue", f);
- break;
-
- case axs_lvalue_register:
- fprintf_filtered (f, "register %d lvalue", value->u.reg);
- break;
- }
-
- fputs_filtered (" : ", f);
- type_print (value->type, "", f, -1);
-}
-
static void
agent_command (char *exp, int from_tty)
diff --git a/gdb/block.h b/gdb/block.h
index 38d037e..a368213 100644
--- a/gdb/block.h
+++ b/gdb/block.h
@@ -139,9 +139,7 @@ struct blockvector
/* Special block numbers */
-#define GLOBAL_BLOCK 0
-#define STATIC_BLOCK 1
-#define FIRST_LOCAL_BLOCK 2
+enum { GLOBAL_BLOCK = 0, STATIC_BLOCK = 1, FIRST_LOCAL_BLOCK = 2 };
extern struct symbol *block_function (const struct block *);
diff --git a/gdb/blockframe.c b/gdb/blockframe.c
index 83bc691..00d7d8f 100644
--- a/gdb/blockframe.c
+++ b/gdb/blockframe.c
@@ -2,8 +2,8 @@
functions and pc values.
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
- 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software
- Foundation, Inc.
+ 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+ Free Software Foundation, Inc.
This file is part of GDB.
@@ -156,16 +156,19 @@ inside_main_func (CORE_ADDR pc)
&& symfile_objfile->ei.main_func_highpc > pc);
}
-/* Test whether PC is inside the range of addresses that corresponds
- to the process entry point function.
-
- A PC of zero is always considered to be the bottom of the stack. */
+/* Test whether THIS_FRAME is inside the process entry point function. */
int
-inside_entry_func (CORE_ADDR pc)
+inside_entry_func (struct frame_info *this_frame)
+{
+ return (get_frame_func (this_frame) == entry_point_address ());
+}
+
+/* Similar to inside_entry_func, but accomodating legacy frame code. */
+
+static int
+legacy_inside_entry_func (CORE_ADDR pc)
{
- if (pc == 0)
- return 1;
if (symfile_objfile == 0)
return 0;
@@ -608,7 +611,7 @@ legacy_frame_chain_valid (CORE_ADDR fp, struct frame_info *fi)
/* If we're already inside the entry function for the main objfile, then it
isn't valid. */
- if (inside_entry_func (get_frame_pc (fi)))
+ if (legacy_inside_entry_func (get_frame_pc (fi)))
return 0;
/* If we're inside the entry file, it isn't valid. */
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 6a17368..a4cfa46 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -1,8 +1,8 @@
/* Everything about breakpoints, 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.
+ 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+ Free Software Foundation, Inc.
This file is part of GDB.
@@ -89,7 +89,7 @@ extern void break_at_finish_at_depth_command (char *, int);
extern void tbreak_at_finish_command (char *, int);
-static void break_command_1 (char *, int, int);
+static int break_command_1 (char *, int, int, struct breakpoint *);
static void mention (struct breakpoint *);
@@ -119,6 +119,8 @@ static void condition_command (char *, int);
static int get_number_trailer (char **, int);
+static int do_captured_parse_breakpoint (struct ui_out *, void *);
+
void set_breakpoint_count (int);
typedef enum
@@ -193,10 +195,6 @@ static char *ep_parse_optional_if_clause (char **arg);
static char *ep_parse_optional_filename (char **arg);
-#if defined(CHILD_INSERT_EXEC_CATCHPOINT)
-static void catch_exec_command_1 (char *arg, int tempflag, int from_tty);
-#endif
-
static void create_exception_catchpoint (int tempflag, char *cond_string,
enum exception_event_kind ex_event,
struct symtab_and_line *sal);
@@ -244,16 +242,6 @@ static int overlay_events_enabled;
B ? (TMP=B->next, 1): 0; \
B = TMP)
-/* True if SHIFT_INST_REGS defined, false otherwise. */
-
-int must_shift_inst_regs =
-#if defined(SHIFT_INST_REGS)
-1
-#else
-0
-#endif
- ;
-
/* True if breakpoint hit counts should be displayed in breakpoint info. */
int show_breakpoint_hit_counts = 1;
@@ -336,7 +324,7 @@ int exception_support_initialized = 0;
static int
breakpoint_enabled (struct breakpoint *b)
{
- return b->enable_state == bp_enabled;
+ return (b->enable_state == bp_enabled && !b->pending);
}
/* Set breakpoint count to NUM. */
@@ -570,9 +558,12 @@ condition_command (char *arg, int from_tty)
/* I don't know if it matters whether this is the string the user
typed in or the decompiled expression. */
b->cond_string = savestring (arg, strlen (arg));
- b->cond = parse_exp_1 (&arg, block_for_pc (b->loc->address), 0);
- if (*arg)
- error ("Junk at end of expression");
+ if (!b->pending)
+ {
+ b->cond = parse_exp_1 (&arg, block_for_pc (b->loc->address), 0);
+ if (*arg)
+ error ("Junk at end of expression");
+ }
}
breakpoints_changed ();
breakpoint_modify_event (b->number);
@@ -1731,6 +1722,37 @@ breakpoint_inserted_here_p (CORE_ADDR pc)
return 0;
}
+/* This function returns non-zero iff there is a software breakpoint
+ inserted at PC. */
+
+int
+software_breakpoint_inserted_here_p (CORE_ADDR pc)
+{
+ struct bp_location *bpt;
+ int any_breakpoint_here = 0;
+
+ ALL_BP_LOCATIONS (bpt)
+ {
+ if (bpt->loc_type != bp_loc_software_breakpoint)
+ continue;
+
+ if ((breakpoint_enabled (bpt->owner)
+ || bpt->owner->enable_state == bp_permanent)
+ && bpt->inserted
+ && bpt->address == pc) /* bp is enabled and matches pc */
+ {
+ if (overlay_debugging
+ && section_is_overlay (bpt->section)
+ && !section_is_mapped (bpt->section))
+ continue; /* unmapped overlay -- can't be a match */
+ else
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
/* Return nonzero if FRAME is a dummy frame. We can't use
DEPRECATED_PC_IN_CALL_DUMMY because figuring out the saved SP would
take too much time, at least using frame_register() on the 68k.
@@ -2465,9 +2487,6 @@ watchpoint_check (void *p)
struct breakpoint *b;
struct frame_info *fr;
int within_current_scope;
-#if 0
- struct frame_id current_frame_id;
-#endif
b = bs->breakpoint_at;
@@ -2556,11 +2575,8 @@ which its expression is valid.\n");
}
}
-/* Get a bpstat associated with having just stopped at address *PC
- and frame address CORE_ADDRESS. Update *PC to point at the
- breakpoint (if we hit a breakpoint). NOT_A_SW_BREAKPOINT is nonzero
- if this is known to not be a real breakpoint (it could still be a
- watchpoint, though). */
+/* Get a bpstat associated with having just stopped at address
+ BP_ADDR. */
/* Determine whether we stopped at a breakpoint, etc, or whether we
don't understand this stop. Result is a chain of bpstat's such that:
@@ -2577,24 +2593,16 @@ which its expression is valid.\n");
commands, FIXME??? fields. */
bpstat
-bpstat_stop_status (CORE_ADDR *pc, int not_a_sw_breakpoint)
+bpstat_stop_status (CORE_ADDR bp_addr, ptid_t ptid)
{
struct breakpoint *b, *temp;
- CORE_ADDR bp_addr;
/* True if we've hit a breakpoint (as opposed to a watchpoint). */
int real_breakpoint = 0;
/* Root of the chain of bpstat's */
struct bpstats root_bs[1];
/* Pointer to the last thing in the chain currently. */
bpstat bs = root_bs;
-
- /* Get the address where the breakpoint would have been. The
- "not_a_sw_breakpoint" argument is meant to distinguish between a
- breakpoint trap event and a trace/singlestep trap event. For a
- trace/singlestep trap event, we would not want to subtract
- DECR_PC_AFTER_BREAK from the PC. */
-
- bp_addr = *pc - (not_a_sw_breakpoint ? 0 : DECR_PC_AFTER_BREAK);
+ int thread_id = pid_to_thread_id (ptid);
ALL_BREAKPOINTS_SAFE (b, temp)
{
@@ -2622,7 +2630,7 @@ bpstat_stop_status (CORE_ADDR *pc, int not_a_sw_breakpoint)
if (b->type == bp_hardware_breakpoint)
{
- if (b->loc->address != (*pc - DECR_PC_AFTER_HW_BREAK))
+ if (b->loc->address != bp_addr)
continue;
if (overlay_debugging /* unmapped overlay section */
&& section_is_overlay (b->loc->section)
@@ -2848,6 +2856,12 @@ bpstat_stop_status (CORE_ADDR *pc, int not_a_sw_breakpoint)
/* Don't consider this a hit. */
--(b->hit_count);
}
+ else if (b->thread != -1 && b->thread != thread_id)
+ {
+ bs->stop = 0;
+ /* Don't consider this a hit. */
+ --(b->hit_count);
+ }
else if (b->ignore_count > 0)
{
b->ignore_count--;
@@ -2880,30 +2894,6 @@ bpstat_stop_status (CORE_ADDR *pc, int not_a_sw_breakpoint)
bs->next = NULL; /* Terminate the chain */
bs = root_bs->next; /* Re-grab the head of the chain */
- if (real_breakpoint && bs)
- {
- if (bs->breakpoint_at->type == bp_hardware_breakpoint)
- {
- if (DECR_PC_AFTER_HW_BREAK != 0)
- {
- *pc = *pc - DECR_PC_AFTER_HW_BREAK;
- write_pc (*pc);
- }
- }
- else
- {
- if (DECR_PC_AFTER_BREAK != 0 || must_shift_inst_regs)
- {
- *pc = bp_addr;
-#if defined (SHIFT_INST_REGS)
- SHIFT_INST_REGS ();
-#else /* No SHIFT_INST_REGS. */
- write_pc (bp_addr);
-#endif /* No SHIFT_INST_REGS. */
- }
- }
- }
-
/* The value of a hardware watchpoint hasn't changed, but the
intermediate memory locations we are watching may have. */
if (bs && !bs->stop &&
@@ -3480,7 +3470,16 @@ print_one_breakpoint (struct breakpoint *b,
if (addressprint)
{
annotate_field (4);
- ui_out_field_core_addr (uiout, "addr", b->loc->address);
+ if (b->pending)
+ {
+ ui_out_field_string (uiout, "addr", "<PENDING>");
+ if (TARGET_ADDR_BIT <= 32)
+ ui_out_spaces (uiout, 2);
+ else
+ ui_out_spaces (uiout, 8);
+ }
+ else
+ ui_out_field_core_addr (uiout, "addr", b->loc->address);
}
annotate_field (5);
*last_addr = b->loc->address;
@@ -3499,6 +3498,10 @@ print_one_breakpoint (struct breakpoint *b,
ui_out_text (uiout, ":");
ui_out_field_int (uiout, "line", b->line_number);
}
+ else if (b->pending)
+ {
+ ui_out_field_string (uiout, "pending", b->addr_string);
+ }
else
{
print_address_symbolic (b->loc->address, stb->stream, demangle, "");
@@ -3535,7 +3538,15 @@ print_one_breakpoint (struct breakpoint *b,
ui_out_field_stream (uiout, "cond", stb);
ui_out_text (uiout, "\n");
}
-
+
+ if (b->pending && b->cond_string)
+ {
+ annotate_field (7);
+ ui_out_text (uiout, "\tstop only if ");
+ ui_out_field_string (uiout, "cond", b->cond_string);
+ ui_out_text (uiout, "\n");
+ }
+
if (b->thread != -1)
{
/* FIXME should make an annotation for this */
@@ -3766,14 +3777,14 @@ describe_other_breakpoints (CORE_ADDR pc, asection *section)
ALL_BREAKPOINTS (b)
if (b->loc->address == pc) /* address match / overlay match */
- if (!overlay_debugging || b->loc->section == section)
+ if (!b->pending && (!overlay_debugging || b->loc->section == section))
others++;
if (others > 0)
{
printf_filtered ("Note: breakpoint%s ", (others > 1) ? "s" : "");
ALL_BREAKPOINTS (b)
if (b->loc->address == pc) /* address match / overlay match */
- if (!overlay_debugging || b->loc->section == section)
+ if (!b->pending && (!overlay_debugging || b->loc->section == section))
{
others--;
printf_filtered ("%d%s%s ",
@@ -3862,6 +3873,7 @@ check_duplicates (struct breakpoint *bpt)
ALL_BP_LOCATIONS (b)
if (b->owner->enable_state != bp_disabled
&& b->owner->enable_state != bp_shlib_disabled
+ && !b->owner->pending
&& b->owner->enable_state != bp_call_disabled
&& b->address == address /* address / overlay match */
&& (!overlay_debugging || b->section == section)
@@ -3896,6 +3908,7 @@ check_duplicates (struct breakpoint *bpt)
{
if (b->owner->enable_state != bp_disabled
&& b->owner->enable_state != bp_shlib_disabled
+ && !b->owner->pending
&& b->owner->enable_state != bp_call_disabled
&& b->address == address /* address / overlay match */
&& (!overlay_debugging || b->section == section)
@@ -4072,6 +4085,7 @@ set_raw_breakpoint (struct symtab_and_line sal, enum bptype bptype)
b->forked_inferior_pid = 0;
b->exec_pathname = NULL;
b->ops = NULL;
+ b->pending = 0;
/* Add this breakpoint to the end of the chain
so that a list of breakpoints will come out in order
@@ -4255,6 +4269,66 @@ remove_thread_event_breakpoints (void)
delete_breakpoint (b);
}
+struct captured_parse_breakpoint_args
+ {
+ char **arg_p;
+ struct symtabs_and_lines *sals_p;
+ char ***addr_string_p;
+ int *not_found_ptr;
+ };
+
+struct lang_and_radix
+ {
+ enum language lang;
+ int radix;
+ };
+
+/* Cleanup helper routine to restore the current language and
+ input radix. */
+static void
+do_restore_lang_radix_cleanup (void *old)
+{
+ struct lang_and_radix *p = old;
+ set_language (p->lang);
+ input_radix = p->radix;
+}
+
+/* Try and resolve a pending breakpoint. */
+static int
+resolve_pending_breakpoint (struct breakpoint *b)
+{
+ /* Try and reparse the breakpoint in case the shared library
+ is now loaded. */
+ struct symtabs_and_lines sals;
+ struct symtab_and_line pending_sal;
+ char **cond_string = (char **) NULL;
+ char *copy_arg = b->addr_string;
+ char **addr_string;
+ char *errmsg;
+ int rc;
+ int not_found = 0;
+ struct ui_file *old_gdb_stderr;
+ struct lang_and_radix old_lr;
+ struct cleanup *old_chain;
+
+ /* Set language, input-radix, then reissue breakpoint command.
+ Ensure the language and input-radix are restored afterwards. */
+ old_lr.lang = current_language->la_language;
+ old_lr.radix = input_radix;
+ old_chain = make_cleanup (do_restore_lang_radix_cleanup, &old_lr);
+
+ set_language (b->language);
+ input_radix = b->input_radix;
+ rc = break_command_1 (b->addr_string, b->flag, b->from_tty, b);
+
+ if (rc == GDB_RC_OK)
+ /* Pending breakpoint has been resolved. */
+ printf_filtered ("Pending breakpoint \"%s\" resolved\n", b->addr_string);
+
+ do_cleanups (old_chain);
+ return rc;
+}
+
#ifdef SOLIB_ADD
void
remove_solib_event_breakpoints (void)
@@ -4314,19 +4388,26 @@ disable_breakpoints_in_shlibs (int silent)
void
re_enable_breakpoints_in_shlibs (void)
{
- struct breakpoint *b;
+ struct breakpoint *b, *tmp;
- ALL_BREAKPOINTS (b)
+ ALL_BREAKPOINTS_SAFE (b, tmp)
+ {
if (b->enable_state == bp_shlib_disabled)
- {
- char buf[1], *lib;
-
- /* Do not reenable the breakpoint if the shared library
- is still not mapped in. */
- lib = PC_SOLIB (b->loc->address);
- if (lib != NULL && target_read_memory (b->loc->address, buf, 1) == 0)
- b->enable_state = bp_enabled;
- }
+ {
+ char buf[1], *lib;
+
+ /* Do not reenable the breakpoint if the shared library
+ is still not mapped in. */
+ lib = PC_SOLIB (b->loc->address);
+ if (lib != NULL && target_read_memory (b->loc->address, buf, 1) == 0)
+ b->enable_state = bp_enabled;
+ }
+ else if (b->pending && (b->enable_state == bp_enabled))
+ {
+ if (resolve_pending_breakpoint (b) == GDB_RC_OK)
+ delete_breakpoint (b);
+ }
+ }
}
#endif
@@ -4738,14 +4819,21 @@ mention (struct breakpoint *b)
if (say_where)
{
- if (addressprint || b->source_file == NULL)
+ if (b->pending)
+ {
+ printf_filtered (" (%s) pending.", b->addr_string);
+ }
+ else
{
- printf_filtered (" at ");
- print_address_numeric (b->loc->address, 1, gdb_stdout);
+ if (addressprint || b->source_file == NULL)
+ {
+ printf_filtered (" at ");
+ print_address_numeric (b->loc->address, 1, gdb_stdout);
+ }
+ if (b->source_file)
+ printf_filtered (": file %s, line %d.",
+ b->source_file, b->line_number);
}
- if (b->source_file)
- printf_filtered (": file %s, line %d.",
- b->source_file, b->line_number);
}
do_cleanups (old_chain);
if (ui_out_is_mi_like_p (uiout))
@@ -4758,6 +4846,11 @@ mention (struct breakpoint *b)
SALS.sal[i] breakpoint, include the corresponding ADDR_STRING[i],
COND[i] and COND_STRING[i] values.
+ The parameter PENDING_BP points to a pending breakpoint that is
+ the basis of the breakpoints currently being created. The pending
+ breakpoint may contain a separate condition string or commands
+ that were added after the initial pending breakpoint was created.
+
NOTE: If the function succeeds, the caller is expected to cleanup
the arrays ADDR_STRING, COND_STRING, COND and SALS (but not the
array contents). If the function fails (error() is called), the
@@ -4768,7 +4861,8 @@ static void
create_breakpoints (struct symtabs_and_lines sals, char **addr_string,
struct expression **cond, char **cond_string,
enum bptype type, enum bpdisp disposition,
- int thread, int ignore_count, int from_tty)
+ int thread, int ignore_count, int from_tty,
+ struct breakpoint *pending_bp)
{
if (type == bp_hardware_breakpoint)
{
@@ -4808,6 +4902,26 @@ create_breakpoints (struct symtabs_and_lines sals, char **addr_string,
b->ignore_count = ignore_count;
b->enable_state = bp_enabled;
b->disposition = disposition;
+ /* If resolving a pending breakpoint, a check must be made to see if
+ the user has specified a new condition or commands for the
+ breakpoint. A new condition will override any condition that was
+ initially specified with the initial breakpoint command. */
+ if (pending_bp)
+ {
+ char *arg;
+ if (pending_bp->cond_string)
+ {
+ arg = pending_bp->cond_string;
+ b->cond_string = savestring (arg, strlen (arg));
+ b->cond = parse_exp_1 (&arg, block_for_pc (b->loc->address), 0);
+ if (*arg)
+ error ("Junk at end of pending breakpoint condition expression");
+ }
+ /* If there are commands associated with the breakpoint, they should
+ be copied too. */
+ if (pending_bp->commands)
+ b->commands = copy_command_lines (pending_bp->commands);
+ }
mention (b);
}
}
@@ -4821,7 +4935,8 @@ create_breakpoints (struct symtabs_and_lines sals, char **addr_string,
static void
parse_breakpoint_sals (char **address,
struct symtabs_and_lines *sals,
- char ***addr_string)
+ char ***addr_string,
+ int *not_found_ptr)
{
char *addr_start = *address;
*addr_string = NULL;
@@ -4862,9 +4977,11 @@ parse_breakpoint_sals (char **address,
|| ((strchr ("+-", (*address)[0]) != NULL)
&& ((*address)[1] != '['))))
*sals = decode_line_1 (address, 1, default_breakpoint_symtab,
- default_breakpoint_line, addr_string, NULL);
+ default_breakpoint_line, addr_string,
+ not_found_ptr);
else
- *sals = decode_line_1 (address, 1, (struct symtab *) NULL, 0, addr_string, NULL);
+ *sals = decode_line_1 (address, 1, (struct symtab *) NULL, 0,
+ addr_string, not_found_ptr);
}
/* For any SAL that didn't have a canonical string, fill one in. */
if (sals->nelts > 0 && *addr_string == NULL)
@@ -4918,26 +5035,44 @@ breakpoint_sals_to_pc (struct symtabs_and_lines *sals,
}
}
+static int
+do_captured_parse_breakpoint (struct ui_out *ui, void *data)
+{
+ struct captured_parse_breakpoint_args *args = data;
+
+ parse_breakpoint_sals (args->arg_p, args->sals_p, args->addr_string_p,
+ args->not_found_ptr);
+
+ return GDB_RC_OK;
+}
+
/* Set a breakpoint according to ARG (function, linenum or *address)
flag: first bit : 0 non-temporary, 1 temporary.
- second bit : 0 normal breakpoint, 1 hardware breakpoint. */
+ second bit : 0 normal breakpoint, 1 hardware breakpoint.
-static void
-break_command_1 (char *arg, int flag, int from_tty)
+ PENDING_BP is non-NULL when this function is being called to resolve
+ a pending breakpoint. */
+
+static int
+break_command_1 (char *arg, int flag, int from_tty, struct breakpoint *pending_bp)
{
int tempflag, hardwareflag;
struct symtabs_and_lines sals;
struct expression **cond = 0;
- /* Pointers in arg to the start, and one past the end, of the
- condition. */
+ struct symtab_and_line pending_sal;
char **cond_string = (char **) NULL;
+ char *copy_arg;
+ char *err_msg;
char *addr_start = arg;
char **addr_string;
struct cleanup *old_chain;
struct cleanup *breakpoint_chain = NULL;
- int i;
+ struct captured_parse_breakpoint_args parse_args;
+ int i, rc;
+ int pending = 0;
int thread = -1;
int ignore_count = 0;
+ int not_found = 0;
hardwareflag = flag & BP_HARDWAREFLAG;
tempflag = flag & BP_TEMPFLAG;
@@ -4945,19 +5080,55 @@ break_command_1 (char *arg, int flag, int from_tty)
sals.sals = NULL;
sals.nelts = 0;
addr_string = NULL;
- parse_breakpoint_sals (&arg, &sals, &addr_string);
- if (!sals.nelts)
- return;
+ parse_args.arg_p = &arg;
+ parse_args.sals_p = &sals;
+ parse_args.addr_string_p = &addr_string;
+ parse_args.not_found_ptr = &not_found;
+
+ rc = catch_exceptions_with_msg (uiout, do_captured_parse_breakpoint,
+ &parse_args, NULL, &err_msg,
+ RETURN_MASK_ALL);
+
+ /* If caller is interested in rc value from parse, set value. */
+
+ if (rc != GDB_RC_OK)
+ {
+ /* Check for file or function not found. */
+ if (not_found)
+ {
+ /* If called to resolve pending breakpoint, just return error code. */
+ if (pending_bp)
+ return rc;
+
+ error_output_message (NULL, err_msg);
+ xfree (err_msg);
+ if (!query ("Make breakpoint pending on future shared library load? "))
+ return rc;
+ copy_arg = xstrdup (addr_start);
+ addr_string = &copy_arg;
+ sals.nelts = 1;
+ sals.sals = &pending_sal;
+ pending_sal.pc = 0;
+ pending = 1;
+ }
+ else
+ return rc;
+ }
+ else if (!sals.nelts)
+ return GDB_RC_FAIL;
/* Create a chain of things that always need to be cleaned up. */
old_chain = make_cleanup (null_cleanup, 0);
- /* Make sure that all storage allocated to SALS gets freed. */
- make_cleanup (xfree, sals.sals);
-
- /* Cleanup the addr_string array but not its contents. */
- make_cleanup (xfree, addr_string);
+ if (!pending)
+ {
+ /* Make sure that all storage allocated to SALS gets freed. */
+ make_cleanup (xfree, sals.sals);
+
+ /* Cleanup the addr_string array but not its contents. */
+ make_cleanup (xfree, addr_string);
+ }
/* Allocate space for all the cond expressions. */
cond = xcalloc (sals.nelts, sizeof (struct expression *));
@@ -4984,62 +5155,94 @@ break_command_1 (char *arg, int flag, int from_tty)
/* Resolve all line numbers to PC's and verify that the addresses
are ok for the target. */
- breakpoint_sals_to_pc (&sals, addr_start);
+ if (!pending)
+ breakpoint_sals_to_pc (&sals, addr_start);
/* Verify that condition can be parsed, before setting any
breakpoints. Allocate a separate condition expression for each
breakpoint. */
thread = -1; /* No specific thread yet */
- for (i = 0; i < sals.nelts; i++)
+ if (!pending)
{
- char *tok = arg;
- while (tok && *tok)
+ for (i = 0; i < sals.nelts; i++)
{
- char *end_tok;
- int toklen;
- char *cond_start = NULL;
- char *cond_end = NULL;
- while (*tok == ' ' || *tok == '\t')
- tok++;
-
- end_tok = tok;
-
- while (*end_tok != ' ' && *end_tok != '\t' && *end_tok != '\000')
- end_tok++;
-
- toklen = end_tok - tok;
-
- if (toklen >= 1 && strncmp (tok, "if", toklen) == 0)
+ char *tok = arg;
+ while (tok && *tok)
{
- tok = cond_start = end_tok + 1;
- cond[i] = parse_exp_1 (&tok, block_for_pc (sals.sals[i].pc), 0);
- make_cleanup (xfree, cond[i]);
- cond_end = tok;
- cond_string[i] = savestring (cond_start, cond_end - cond_start);
- make_cleanup (xfree, cond_string[i]);
- }
- else if (toklen >= 1 && strncmp (tok, "thread", toklen) == 0)
- {
- char *tmptok;
-
- tok = end_tok + 1;
- tmptok = tok;
- thread = strtol (tok, &tok, 0);
- if (tok == tmptok)
- error ("Junk after thread keyword.");
- if (!valid_thread_id (thread))
- error ("Unknown thread %d\n", thread);
+ char *end_tok;
+ int toklen;
+ char *cond_start = NULL;
+ char *cond_end = NULL;
+ while (*tok == ' ' || *tok == '\t')
+ tok++;
+
+ end_tok = tok;
+
+ while (*end_tok != ' ' && *end_tok != '\t' && *end_tok != '\000')
+ end_tok++;
+
+ toklen = end_tok - tok;
+
+ if (toklen >= 1 && strncmp (tok, "if", toklen) == 0)
+ {
+ tok = cond_start = end_tok + 1;
+ cond[i] = parse_exp_1 (&tok, block_for_pc (sals.sals[i].pc),
+ 0);
+ make_cleanup (xfree, cond[i]);
+ cond_end = tok;
+ cond_string[i] = savestring (cond_start,
+ cond_end - cond_start);
+ make_cleanup (xfree, cond_string[i]);
+ }
+ else if (toklen >= 1 && strncmp (tok, "thread", toklen) == 0)
+ {
+ char *tmptok;
+
+ tok = end_tok + 1;
+ tmptok = tok;
+ thread = strtol (tok, &tok, 0);
+ if (tok == tmptok)
+ error ("Junk after thread keyword.");
+ if (!valid_thread_id (thread))
+ error ("Unknown thread %d\n", thread);
+ }
+ else
+ error ("Junk at end of arguments.");
}
- else
- error ("Junk at end of arguments.");
}
+ create_breakpoints (sals, addr_string, cond, cond_string,
+ hardwareflag ? bp_hardware_breakpoint
+ : bp_breakpoint,
+ tempflag ? disp_del : disp_donttouch,
+ thread, ignore_count, from_tty,
+ pending_bp);
}
-
- create_breakpoints (sals, addr_string, cond, cond_string,
- hardwareflag ? bp_hardware_breakpoint : bp_breakpoint,
- tempflag ? disp_del : disp_donttouch,
- thread, ignore_count, from_tty);
-
+ else
+ {
+ struct symtab_and_line sal;
+ struct breakpoint *b;
+
+ sal.symtab = NULL;
+ sal.pc = 0;
+
+ make_cleanup (xfree, copy_arg);
+
+ b = set_raw_breakpoint (sal, hardwareflag ? bp_hardware_breakpoint
+ : bp_breakpoint);
+ set_breakpoint_count (breakpoint_count + 1);
+ b->number = breakpoint_count;
+ b->cond = *cond;
+ b->thread = thread;
+ b->addr_string = *addr_string;
+ b->cond_string = *cond_string;
+ b->ignore_count = ignore_count;
+ b->pending = 1;
+ b->disposition = tempflag ? disp_del : disp_donttouch;
+ b->from_tty = from_tty;
+ b->flag = flag;
+ mention (b);
+ }
+
if (sals.nelts > 1)
{
warning ("Multiple breakpoints were set.");
@@ -5050,6 +5253,8 @@ break_command_1 (char *arg, int flag, int from_tty)
discard_cleanups (breakpoint_chain);
/* But cleanup everything else. */
do_cleanups (old_chain);
+
+ return GDB_RC_OK;
}
/* Set a breakpoint of TYPE/DISPOSITION according to ARG (function,
@@ -5086,7 +5291,7 @@ do_captured_breakpoint (void *data)
sals.nelts = 0;
address_end = args->address;
addr_string = NULL;
- parse_breakpoint_sals (&address_end, &sals, &addr_string);
+ parse_breakpoint_sals (&address_end, &sals, &addr_string, 0);
if (!sals.nelts)
return GDB_RC_NONE;
@@ -5150,7 +5355,8 @@ do_captured_breakpoint (void *data)
create_breakpoints (sals, addr_string, cond, cond_string,
args->hardwareflag ? bp_hardware_breakpoint : bp_breakpoint,
args->tempflag ? disp_del : disp_donttouch,
- args->thread, args->ignore_count, 0/*from-tty*/);
+ args->thread, args->ignore_count, 0/*from-tty*/,
+ NULL/*pending_bp*/);
/* That's it. Discard the cleanups for data inserted into the
breakpoint. */
@@ -5242,7 +5448,7 @@ break_at_finish_at_depth_command_1 (char *arg, int flag, int from_tty)
addr_string = xstrprintf ("*0x%s %s", paddr_nz (high), extra_args);
else
addr_string = xstrprintf ("*0x%s", paddr_nz (high));
- break_command_1 (addr_string, flag, from_tty);
+ break_command_1 (addr_string, flag, from_tty, NULL);
xfree (addr_string);
}
else
@@ -5325,7 +5531,7 @@ break_at_finish_command_1 (char *arg, int flag, int from_tty)
extra_args);
else
break_string = xstrprintf ("*0x%s", paddr_nz (high));
- break_command_1 (break_string, flag, from_tty);
+ break_command_1 (break_string, flag, from_tty, NULL);
xfree (break_string);
}
else
@@ -5392,7 +5598,7 @@ resolve_sal_pc (struct symtab_and_line *sal)
void
break_command (char *arg, int from_tty)
{
- break_command_1 (arg, 0, from_tty);
+ break_command_1 (arg, 0, from_tty, NULL);
}
void
@@ -5410,7 +5616,7 @@ break_at_finish_at_depth_command (char *arg, int from_tty)
void
tbreak_command (char *arg, int from_tty)
{
- break_command_1 (arg, BP_TEMPFLAG, from_tty);
+ break_command_1 (arg, BP_TEMPFLAG, from_tty, NULL);
}
void
@@ -5422,13 +5628,13 @@ tbreak_at_finish_command (char *arg, int from_tty)
static void
hbreak_command (char *arg, int from_tty)
{
- break_command_1 (arg, BP_HARDWAREFLAG, from_tty);
+ break_command_1 (arg, BP_HARDWAREFLAG, from_tty, NULL);
}
static void
thbreak_command (char *arg, int from_tty)
{
- break_command_1 (arg, (BP_TEMPFLAG | BP_HARDWAREFLAG), from_tty);
+ break_command_1 (arg, (BP_TEMPFLAG | BP_HARDWAREFLAG), from_tty, NULL);
}
static void
@@ -5469,7 +5675,7 @@ stopin_command (char *arg, int from_tty)
if (badInput)
printf_filtered ("Usage: stop in <function | address>\n");
else
- break_command_1 (arg, 0, from_tty);
+ break_command_1 (arg, 0, from_tty, NULL);
}
static void
@@ -5501,7 +5707,7 @@ stopat_command (char *arg, int from_tty)
if (badInput)
printf_filtered ("Usage: stop at <line>\n");
else
- break_command_1 (arg, 0, from_tty);
+ break_command_1 (arg, 0, from_tty, NULL);
}
/* accessflag: hw_write: watch write,
@@ -5901,30 +6107,6 @@ until_break_command (char *arg, int from_tty, int anywhere)
do_cleanups (old_chain);
}
-#if 0
-/* These aren't used; I don't konw what they were for. */
-/* Set a breakpoint at the catch clause for NAME. */
-static int
-catch_breakpoint (char *name)
-{
-}
-
-static int
-disable_catch_breakpoint (void)
-{
-}
-
-static int
-delete_catch_breakpoint (void)
-{
-}
-
-static int
-enable_catch_breakpoint (void)
-{
-}
-#endif /* 0 */
-
static void
ep_skip_leading_whitespace (char **s)
{
@@ -6039,10 +6221,6 @@ typedef enum
}
catch_fork_kind;
-#if defined(CHILD_INSERT_FORK_CATCHPOINT) || defined(CHILD_INSERT_VFORK_CATCHPOINT)
-static void catch_fork_command_1 (catch_fork_kind fork_kind,
- char *arg, int tempflag, int from_tty);
-
static void
catch_fork_command_1 (catch_fork_kind fork_kind, char *arg, int tempflag,
int from_tty)
@@ -6076,9 +6254,7 @@ catch_fork_command_1 (catch_fork_kind fork_kind, char *arg, int tempflag,
break;
}
}
-#endif
-#if defined(CHILD_INSERT_EXEC_CATCHPOINT)
static void
catch_exec_command_1 (char *arg, int tempflag, int from_tty)
{
@@ -6100,9 +6276,7 @@ catch_exec_command_1 (char *arg, int tempflag, int from_tty)
and enable reporting of such events. */
create_exec_event_catchpoint (tempflag, cond_string);
}
-#endif
-#if defined(SOLIB_ADD)
static void
catch_load_command_1 (char *arg, int tempflag, int from_tty)
{
@@ -6186,7 +6360,6 @@ catch_unload_command_1 (char *arg, int tempflag, int from_tty)
SOLIB_CREATE_CATCH_UNLOAD_HOOK (PIDGET (inferior_ptid), tempflag,
dll_pathname, cond_string);
}
-#endif /* SOLIB_ADD */
/* Commands to deal with catching exceptions. */
@@ -6435,43 +6608,23 @@ catch_command_1 (char *arg, int tempflag, int from_tty)
}
else if (strncmp (arg1_start, "fork", arg1_length) == 0)
{
-#if defined(CHILD_INSERT_FORK_CATCHPOINT)
catch_fork_command_1 (catch_fork, arg1_end + 1, tempflag, from_tty);
-#else
- error ("Catch of fork not yet implemented");
-#endif
}
else if (strncmp (arg1_start, "vfork", arg1_length) == 0)
{
-#if defined(CHILD_INSERT_VFORK_CATCHPOINT)
catch_fork_command_1 (catch_vfork, arg1_end + 1, tempflag, from_tty);
-#else
- error ("Catch of vfork not yet implemented");
-#endif
}
else if (strncmp (arg1_start, "exec", arg1_length) == 0)
{
-#if defined(CHILD_INSERT_EXEC_CATCHPOINT)
catch_exec_command_1 (arg1_end + 1, tempflag, from_tty);
-#else
- error ("Catch of exec not yet implemented");
-#endif
}
else if (strncmp (arg1_start, "load", arg1_length) == 0)
{
-#if defined(SOLIB_ADD)
catch_load_command_1 (arg1_end + 1, tempflag, from_tty);
-#else
- error ("Catch of load not implemented");
-#endif
}
else if (strncmp (arg1_start, "unload", arg1_length) == 0)
{
-#if defined(SOLIB_ADD)
catch_unload_command_1 (arg1_end + 1, tempflag, from_tty);
-#else
- error ("Catch of load not implemented");
-#endif
}
else if (strncmp (arg1_start, "stop", arg1_length) == 0)
{
@@ -6505,30 +6658,6 @@ set_breakpoint_sal (struct symtab_and_line sal)
return b;
}
-#if 0
-/* These aren't used; I don't know what they were for. */
-/* Disable breakpoints on all catch clauses described in ARGS. */
-static void
-disable_catch (char *args)
-{
- /* Map the disable command to catch clauses described in ARGS. */
-}
-
-/* Enable breakpoints on all catch clauses described in ARGS. */
-static void
-enable_catch (char *args)
-{
- /* Map the disable command to catch clauses described in ARGS. */
-}
-
-/* Delete breakpoints on all catch clauses in the active scope. */
-static void
-delete_catch (char *args)
-{
- /* Map the delete command to catch clauses described in ARGS. */
-}
-#endif /* 0 */
-
static void
catch_command (char *arg, int from_tty)
{
@@ -6785,6 +6914,7 @@ delete_breakpoint (struct breakpoint *bpt)
&& !b->loc->duplicate
&& b->enable_state != bp_disabled
&& b->enable_state != bp_shlib_disabled
+ && !b->pending
&& b->enable_state != bp_call_disabled)
{
int val;
@@ -6990,6 +7120,10 @@ breakpoint_re_set_one (void *bint)
shlib_disabled breakpoint though. There's a fair chance we
can't re-set it if the shared library it's in hasn't been
loaded yet. */
+
+ if (b->pending)
+ break;
+
save_enable = b->enable_state;
if (b->enable_state != bp_shlib_disabled)
b->enable_state = bp_disabled;
@@ -7008,7 +7142,12 @@ breakpoint_re_set_one (void *bint)
{
s = b->cond_string;
if (b->cond)
- xfree (b->cond);
+ {
+ xfree (b->cond);
+ /* Avoid re-freeing b->exp if an error during the call
+ to parse_exp_1. */
+ b->cond = NULL;
+ }
b->cond = parse_exp_1 (&s, block_for_pc (sals.sals[i].pc), 0);
}
@@ -7076,12 +7215,22 @@ breakpoint_re_set_one (void *bint)
/* So for now, just use a global context. */
if (b->exp)
- xfree (b->exp);
+ {
+ xfree (b->exp);
+ /* Avoid re-freeing b->exp if an error during the call to
+ parse_expression. */
+ b->exp = NULL;
+ }
b->exp = parse_expression (b->exp_string);
b->exp_valid_block = innermost_block;
mark = value_mark ();
if (b->val)
- value_free (b->val);
+ {
+ value_free (b->val);
+ /* Avoid re-freeing b->val if an error during the call to
+ evaluate_expression. */
+ b->val = NULL;
+ }
b->val = evaluate_expression (b->exp);
release_value (b->val);
if (VALUE_LAZY (b->val) && breakpoint_enabled (b))
@@ -7091,7 +7240,12 @@ breakpoint_re_set_one (void *bint)
{
s = b->cond_string;
if (b->cond)
- xfree (b->cond);
+ {
+ xfree (b->cond);
+ /* Avoid re-freeing b->exp if an error during the call
+ to parse_exp_1. */
+ b->cond = NULL;
+ }
b->cond = parse_exp_1 (&s, (struct block *) 0, 0);
}
if (breakpoint_enabled (b))
@@ -7385,70 +7539,91 @@ do_enable_breakpoint (struct breakpoint *bpt, enum bpdisp disposition)
error ("Hardware breakpoints used exceeds limit.");
}
- if (bpt->enable_state != bp_permanent)
- bpt->enable_state = bp_enabled;
- bpt->disposition = disposition;
- check_duplicates (bpt);
- breakpoints_changed ();
-
- if (bpt->type == bp_watchpoint ||
- bpt->type == bp_hardware_watchpoint ||
- bpt->type == bp_read_watchpoint ||
- bpt->type == bp_access_watchpoint)
+ if (bpt->pending)
{
- if (bpt->exp_valid_block != NULL)
+ if (bpt->enable_state != bp_enabled)
{
- struct frame_info *fr =
- fr = frame_find_by_id (bpt->watchpoint_frame);
- if (fr == NULL)
+ /* When enabling a pending breakpoint, we need to check if the breakpoint
+ is resolvable since shared libraries could have been loaded
+ after the breakpoint was disabled. */
+ breakpoints_changed ();
+ if (resolve_pending_breakpoint (bpt) == GDB_RC_OK)
{
- printf_filtered ("\
-Cannot enable watchpoint %d because the block in which its expression\n\
-is valid is not currently in scope.\n", bpt->number);
- bpt->enable_state = bp_disabled;
+ delete_breakpoint (bpt);
return;
}
-
- save_selected_frame = deprecated_selected_frame;
- save_selected_frame_level = frame_relative_level (deprecated_selected_frame);
- select_frame (fr);
+ bpt->enable_state = bp_enabled;
+ bpt->disposition = disposition;
}
-
- value_free (bpt->val);
- mark = value_mark ();
- bpt->val = evaluate_expression (bpt->exp);
- release_value (bpt->val);
- if (VALUE_LAZY (bpt->val))
- value_fetch_lazy (bpt->val);
-
- if (bpt->type == bp_hardware_watchpoint ||
- bpt->type == bp_read_watchpoint ||
+ }
+ else /* Not a pending breakpoint. */
+ {
+ if (bpt->enable_state != bp_permanent)
+ bpt->enable_state = bp_enabled;
+ bpt->disposition = disposition;
+ check_duplicates (bpt);
+ breakpoints_changed ();
+
+ if (bpt->type == bp_watchpoint ||
+ bpt->type == bp_hardware_watchpoint ||
+ bpt->type == bp_read_watchpoint ||
bpt->type == bp_access_watchpoint)
{
- int i = hw_watchpoint_used_count (bpt->type, &other_type_used);
- int mem_cnt = can_use_hardware_watchpoint (bpt->val);
-
- /* Hack around 'unused var' error for some targets here */
- (void) mem_cnt, i;
- target_resources_ok = TARGET_CAN_USE_HARDWARE_WATCHPOINT (
- bpt->type, i + mem_cnt, other_type_used);
- /* we can consider of type is bp_hardware_watchpoint, convert to
- bp_watchpoint in the following condition */
- if (target_resources_ok < 0)
+ if (bpt->exp_valid_block != NULL)
{
- printf_filtered ("\
+ struct frame_info *fr =
+ fr = frame_find_by_id (bpt->watchpoint_frame);
+ if (fr == NULL)
+ {
+ printf_filtered ("\
+Cannot enable watchpoint %d because the block in which its expression\n\
+is valid is not currently in scope.\n", bpt->number);
+ bpt->enable_state = bp_disabled;
+ return;
+ }
+
+ save_selected_frame = deprecated_selected_frame;
+ save_selected_frame_level = frame_relative_level (deprecated_selected_frame);
+ select_frame (fr);
+ }
+
+ value_free (bpt->val);
+ mark = value_mark ();
+ bpt->val = evaluate_expression (bpt->exp);
+ release_value (bpt->val);
+ if (VALUE_LAZY (bpt->val))
+ value_fetch_lazy (bpt->val);
+
+ if (bpt->type == bp_hardware_watchpoint ||
+ bpt->type == bp_read_watchpoint ||
+ bpt->type == bp_access_watchpoint)
+ {
+ int i = hw_watchpoint_used_count (bpt->type, &other_type_used);
+ int mem_cnt = can_use_hardware_watchpoint (bpt->val);
+
+ /* Hack around 'unused var' error for some targets here */
+ (void) mem_cnt, i;
+ target_resources_ok = TARGET_CAN_USE_HARDWARE_WATCHPOINT (
+ bpt->type, i + mem_cnt, other_type_used);
+ /* we can consider of type is bp_hardware_watchpoint, convert to
+ bp_watchpoint in the following condition */
+ if (target_resources_ok < 0)
+ {
+ printf_filtered ("\
Cannot enable watchpoint %d because target watch resources\n\
have been allocated for other watchpoints.\n", bpt->number);
- bpt->enable_state = bp_disabled;
- value_free_to_mark (mark);
- return;
+ bpt->enable_state = bp_disabled;
+ value_free_to_mark (mark);
+ return;
+ }
}
+
+ if (save_selected_frame_level >= 0)
+ select_frame (save_selected_frame);
+ value_free_to_mark (mark);
}
-
- if (save_selected_frame_level >= 0)
- select_frame (save_selected_frame);
- value_free_to_mark (mark);
}
+
if (modify_breakpoint_hook)
modify_breakpoint_hook (bpt);
breakpoint_modify_event (bpt->number);
diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h
index 85cc8b9..41bcb0c 100644
--- a/gdb/breakpoint.h
+++ b/gdb/breakpoint.h
@@ -1,5 +1,6 @@
/* Data structures associated with breakpoints in GDB.
- Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
+ Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+ 2002, 2003, 2004
Free Software Foundation, Inc.
This file is part of GDB.
@@ -385,6 +386,17 @@ struct breakpoint
/* Methods associated with this breakpoint. */
struct breakpoint_ops *ops;
+
+ /* Was breakpoint issued from a tty? Saved for the use of pending breakpoints. */
+ int from_tty;
+
+ /* Flag value for pending breakpoint.
+ first bit : 0 non-temporary, 1 temporary.
+ second bit : 0 normal breakpoint, 1 hardware breakpoint. */
+ int flag;
+
+ /* Is breakpoint pending on shlib loads? */
+ int pending;
};
/* The following stuff is an abstract data type "bpstat" ("breakpoint
@@ -402,7 +414,7 @@ extern void bpstat_clear (bpstat *);
is part of the bpstat is copied as well. */
extern bpstat bpstat_copy (bpstat);
-extern bpstat bpstat_stop_status (CORE_ADDR *pc, int not_a_sw_breakpoint);
+extern bpstat bpstat_stop_status (CORE_ADDR pc, ptid_t ptid);
/* This bpstat_what stuff tells wait_for_inferior what to do with a
breakpoint (a challenging task). */
@@ -605,6 +617,8 @@ extern enum breakpoint_here breakpoint_here_p (CORE_ADDR);
extern int breakpoint_inserted_here_p (CORE_ADDR);
+extern int software_breakpoint_inserted_here_p (CORE_ADDR);
+
/* FIXME: cagney/2002-11-10: The current [generic] dummy-frame code
implements a functional superset of this function. The only reason
it hasn't been removed is because some architectures still don't
diff --git a/gdb/buildsym.c b/gdb/buildsym.c
index 93090ed..4b362e0 100644
--- a/gdb/buildsym.c
+++ b/gdb/buildsym.c
@@ -1,6 +1,6 @@
/* Support routines for building symbol tables in GDB's internal format.
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
- 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+ 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
This file is part of GDB.
@@ -202,7 +202,7 @@ void
free_pending_blocks (void)
{
#if 0 /* Now we make the links in the
- symbol_obstack, so don't free
+ objfile_obstack, so don't free
them. */
struct pending_block *bnext, *bnext1;
@@ -230,16 +230,16 @@ finish_block (struct symbol *symbol, struct pending **listhead,
struct pending_block *pblock;
struct pending_block *opblock;
- block = allocate_block (&objfile->symbol_obstack);
+ block = allocate_block (&objfile->objfile_obstack);
if (symbol)
{
- BLOCK_DICT (block) = dict_create_linear (&objfile->symbol_obstack,
+ BLOCK_DICT (block) = dict_create_linear (&objfile->objfile_obstack,
*listhead);
}
else
{
- BLOCK_DICT (block) = dict_create_hashed (&objfile->symbol_obstack,
+ BLOCK_DICT (block) = dict_create_hashed (&objfile->objfile_obstack,
*listhead);
}
@@ -347,7 +347,7 @@ finish_block (struct symbol *symbol, struct pending **listhead,
/* If we're in the C++ case, set the block's scope. */
if (SYMBOL_LANGUAGE (symbol) == language_cplus)
{
- cp_set_block_scope (symbol, block, &objfile->symbol_obstack);
+ cp_set_block_scope (symbol, block, &objfile->objfile_obstack);
}
}
else
@@ -439,7 +439,7 @@ finish_block (struct symbol *symbol, struct pending **listhead,
OPBLOCK, or at the beginning if opblock is NULL. This puts the
block in the list after all its subblocks.
- Allocate the pending block struct in the symbol_obstack to save
+ Allocate the pending block struct in the objfile_obstack to save
time. This wastes a little space. FIXME: Is it worth it? */
void
@@ -449,7 +449,7 @@ record_pending_block (struct objfile *objfile, struct block *block,
struct pending_block *pblock;
pblock = (struct pending_block *)
- obstack_alloc (&objfile->symbol_obstack, sizeof (struct pending_block));
+ obstack_alloc (&objfile->objfile_obstack, sizeof (struct pending_block));
pblock->block = block;
if (opblock)
{
@@ -477,7 +477,7 @@ make_blockvector (struct objfile *objfile)
}
blockvector = (struct blockvector *)
- obstack_alloc (&objfile->symbol_obstack,
+ obstack_alloc (&objfile->objfile_obstack,
(sizeof (struct blockvector)
+ (i - 1) * sizeof (struct block *)));
@@ -909,7 +909,7 @@ end_symtab (CORE_ADDR end_addr, struct objfile *objfile, int section)
objfile);
blockvector = make_blockvector (objfile);
cp_finalize_namespace (BLOCKVECTOR_BLOCK (blockvector, STATIC_BLOCK),
- &objfile->symbol_obstack);
+ &objfile->objfile_obstack);
}
#ifndef PROCESS_LINENUMBER_HOOK
@@ -961,7 +961,7 @@ end_symtab (CORE_ADDR end_addr, struct objfile *objfile, int section)
{
/* Reallocate the line table on the symbol obstack */
symtab->linetable = (struct linetable *)
- obstack_alloc (&objfile->symbol_obstack, linetablesize);
+ obstack_alloc (&objfile->objfile_obstack, linetablesize);
memcpy (symtab->linetable, subfile->line_vector, linetablesize);
}
else
@@ -973,7 +973,7 @@ end_symtab (CORE_ADDR end_addr, struct objfile *objfile, int section)
{
/* Reallocate the dirname on the symbol obstack */
symtab->dirname = (char *)
- obstack_alloc (&objfile->symbol_obstack,
+ obstack_alloc (&objfile->objfile_obstack,
strlen (subfile->dirname) + 1);
strcpy (symtab->dirname, subfile->dirname);
}
@@ -997,7 +997,7 @@ end_symtab (CORE_ADDR end_addr, struct objfile *objfile, int section)
{
symtab->debugformat = obsavestring (subfile->debugformat,
strlen (subfile->debugformat),
- &objfile->symbol_obstack);
+ &objfile->objfile_obstack);
}
/* All symtabs for the main file and the subfiles share a
diff --git a/gdb/c-exp.y b/gdb/c-exp.y
index 1f3e683..f11b93e 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, 2003
+ 1998, 1999, 2000, 2003, 2004
Free Software Foundation, Inc.
This file is part of GDB.
@@ -939,11 +939,6 @@ typebase /* Implements (approximately): (type-qualifier)* type-specifier */
decode_line_1), but I'm not holding my breath waiting for somebody
to get around to cleaning this up... */
-/* FIXME: carlton/2003-09-25: Currently, the only qualified type
- symbols that we generate are nested namespaces. Next on my TODO
- list is to generate all nested type names properly (or at least as
- well as possible, assuming that we're using DWARF-2). */
-
qualified_type: typebase COLONCOLON name
{
struct type *type = $1;
@@ -953,14 +948,16 @@ qualified_type: typebase COLONCOLON name
memcpy (ncopy, $3.ptr, $3.length);
ncopy[$3.length] = '\0';
- if (TYPE_CODE (type) != TYPE_CODE_NAMESPACE)
- error ("`%s' is not defined as a namespace.",
+ if (TYPE_CODE (type) != TYPE_CODE_STRUCT
+ && TYPE_CODE (type) != TYPE_CODE_UNION
+ && TYPE_CODE (type) != TYPE_CODE_NAMESPACE)
+ error ("`%s' is not defined as an aggregate type.",
TYPE_NAME (type));
new_type = cp_lookup_nested_type (type, ncopy,
expression_context_block);
if (new_type == NULL)
- error ("No type \"%s\" in namespace \"%s\".",
+ error ("No type \"%s\" within class or namespace \"%s\".",
ncopy, TYPE_NAME (type));
$$ = new_type;
diff --git a/gdb/c-lang.c b/gdb/c-lang.c
index a296d81..ba34540 100644
--- a/gdb/c-lang.c
+++ b/gdb/c-lang.c
@@ -1,5 +1,5 @@
/* C language support routines for GDB, the GNU debugger.
- Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2002
+ Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2002, 2003, 2004
Free Software Foundation, Inc.
This file is part of GDB.
@@ -556,6 +556,7 @@ const struct language_defn c_language_defn =
NULL, /* Language specific skip_trampoline */
NULL, /* value_of_this */
basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
+ basic_lookup_transparent_type,/* lookup_transparent_type */
NULL, /* Language specific symbol demangler */
{"", "", "", ""}, /* Binary format info */
{"0%lo", "0", "o", ""}, /* Octal format info */
@@ -613,6 +614,7 @@ const struct language_defn cplus_language_defn =
NULL, /* Language specific skip_trampoline */
value_of_this, /* value_of_this */
cp_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
+ cp_lookup_transparent_type, /* lookup_transparent_type */
cplus_demangle, /* Language specific symbol demangler */
{"", "", "", ""}, /* Binary format info */
{"0%lo", "0", "o", ""}, /* Octal format info */
@@ -647,6 +649,7 @@ const struct language_defn asm_language_defn =
NULL, /* Language specific skip_trampoline */
NULL, /* value_of_this */
basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
+ basic_lookup_transparent_type,/* lookup_transparent_type */
NULL, /* Language specific symbol demangler */
{"", "", "", ""}, /* Binary format info */
{"0%lo", "0", "o", ""}, /* Octal format info */
@@ -686,6 +689,7 @@ const struct language_defn minimal_language_defn =
NULL, /* Language specific skip_trampoline */
NULL, /* value_of_this */
basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
+ basic_lookup_transparent_type,/* lookup_transparent_type */
NULL, /* Language specific symbol demangler */
{"", "", "", ""}, /* Binary format info */
{"0%lo", "0", "o", ""}, /* Octal format info */
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
index dcfd74f..70cec17 100644
--- a/gdb/cli/cli-cmds.c
+++ b/gdb/cli/cli-cmds.c
@@ -1,6 +1,6 @@
/* GDB CLI commands.
- Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+ Copyright 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of GDB.
@@ -20,6 +20,7 @@
Boston, MA 02111-1307, USA. */
#include "defs.h"
+#include <readline/readline.h>
#include <readline/tilde.h>
#include "completer.h"
#include "target.h" /* For baud_rate, remote_debug and remote_timeout */
@@ -59,8 +60,6 @@ static void pwd_command (char *, int);
static void show_version (char *, int);
-static void validate_comname (char *);
-
static void help_command (char *, int);
static void show_command (char *, int);
@@ -224,7 +223,7 @@ complete_command (char *arg, int from_tty)
{
int i;
int argpoint;
- char **completions;
+ char **completions, *point, *arg_prefix;
dont_repeat ();
@@ -232,7 +231,23 @@ complete_command (char *arg, int from_tty)
arg = "";
argpoint = strlen (arg);
- completions = complete_line (arg, arg, argpoint);
+ /* complete_line assumes that its first argument is somewhere within,
+ and except for filenames at the beginning of, the word to be completed.
+ The following crude imitation of readline's word-breaking tries to
+ accomodate this. */
+ point = arg + argpoint;
+ while (point > arg)
+ {
+ if (strchr (rl_completer_word_break_characters, point[-1]) != 0)
+ break;
+ point--;
+ }
+
+ arg_prefix = alloca (point - arg + 1);
+ memcpy (arg_prefix, arg, point - arg);
+ arg_prefix[point - arg] = 0;
+
+ completions = complete_line (point, arg, argpoint);
if (completions)
{
@@ -248,7 +263,7 @@ complete_command (char *arg, int from_tty)
while (item < size)
{
int next_item;
- printf_unfiltered ("%s\n", completions[item]);
+ printf_unfiltered ("%s%s\n", arg_prefix, completions[item]);
next_item = item + 1;
while (next_item < size
&& ! strcmp (completions[item], completions[next_item]))
@@ -506,9 +521,9 @@ shell_escape (char *arg, int from_tty)
p++; /* Get past '/' */
if (!arg)
- execl (user_shell, p, 0);
+ execl (user_shell, p, (char *) 0);
else
- execl (user_shell, p, "-c", arg, 0);
+ execl (user_shell, p, "-c", arg, (char *) 0);
fprintf_unfiltered (gdb_stderr, "Cannot execute %s: %s\n", user_shell,
safe_strerror (errno));
@@ -835,8 +850,9 @@ disassemble_command (char *arg, int from_tty)
#if defined(TUI)
/* NOTE: cagney/2003-02-13 The `tui_active' was previously
`tui_version'. */
- else if (tui_active)
- low = tuiGetLowDisassemblyAddress (low, pc);
+ if (tui_active)
+ /* FIXME: cagney/2004-02-07: This should be an observer. */
+ low = tui_get_low_disassembly_address (low, pc);
#endif
low += FUNCTION_START_OFFSET;
}
@@ -849,8 +865,9 @@ disassemble_command (char *arg, int from_tty)
#if defined(TUI)
/* NOTE: cagney/2003-02-13 The `tui_active' was previously
`tui_version'. */
- else if (tui_active)
- low = tuiGetLowDisassemblyAddress (low, pc);
+ if (tui_active)
+ /* FIXME: cagney/2004-02-07: This should be an observer. */
+ low = tui_get_low_disassembly_address (low, pc);
#endif
low += FUNCTION_START_OFFSET;
}
diff --git a/gdb/cli/cli-dump.c b/gdb/cli/cli-dump.c
index 7b88975..9e9c3de 100644
--- a/gdb/cli/cli-dump.c
+++ b/gdb/cli/cli-dump.c
@@ -331,36 +331,6 @@ dump_value_command (char *cmd, char *mode)
}
static void
-dump_filetype (char *cmd, char *mode, char *filetype)
-{
- char *suffix = cmd;
-
- if (cmd == NULL || *cmd == '\0')
- error ("Missing subcommand: try 'help %s %s'.",
- mode[0] == 'a' ? "append" : "dump",
- filetype);
-
- suffix += strcspn (cmd, " \t");
-
- if (suffix != cmd)
- {
- if (strncmp ("memory", cmd, suffix - cmd) == 0)
- {
- dump_memory_to_file (suffix, mode, filetype);
- return;
- }
- else if (strncmp ("value", cmd, suffix - cmd) == 0)
- {
- dump_value_to_file (suffix, mode, filetype);
- return;
- }
- }
-
- error ("dump %s: unknown subcommand '%s' -- try 'value' or 'memory'.",
- filetype, cmd);
-}
-
-static void
dump_srec_memory (char *args, int from_tty)
{
dump_memory_to_file (args, FOPEN_WB, "srec");
diff --git a/gdb/coffread.c b/gdb/coffread.c
index 215be80..c2a931c 100644
--- a/gdb/coffread.c
+++ b/gdb/coffread.c
@@ -1,6 +1,6 @@
/* Read coff symbol tables and convert to internal format, for GDB.
Copyright 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
- 1997, 1998, 1999, 2000, 2001, 2002, 2003
+ 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
Contributed by David D. Johnson, Brown University (ddj@cs.brown.edu).
@@ -1468,7 +1468,7 @@ process_coff_symbol (struct coff_symbol *cs,
struct objfile *objfile)
{
struct symbol *sym
- = (struct symbol *) obstack_alloc (&objfile->symbol_obstack,
+ = (struct symbol *) obstack_alloc (&objfile->objfile_obstack,
sizeof (struct symbol));
char *name;
@@ -1963,7 +1963,7 @@ coff_read_struct_type (int index, int length, int lastsym)
list->field.name =
obsavestring (name,
strlen (name),
- &current_objfile->symbol_obstack);
+ &current_objfile->objfile_obstack);
FIELD_TYPE (list->field) = decode_type (ms, ms->c_type, &sub_aux);
FIELD_BITPOS (list->field) = 8 * ms->c_value;
FIELD_BITSIZE (list->field) = 0;
@@ -1982,7 +1982,7 @@ coff_read_struct_type (int index, int length, int lastsym)
list->field.name =
obsavestring (name,
strlen (name),
- &current_objfile->symbol_obstack);
+ &current_objfile->objfile_obstack);
FIELD_TYPE (list->field) = decode_type (ms, ms->c_type, &sub_aux);
FIELD_BITPOS (list->field) = ms->c_value;
FIELD_BITSIZE (list->field) = sub_aux.x_sym.x_misc.x_lnsz.x_size;
@@ -2049,13 +2049,13 @@ coff_read_enum_type (int index, int length, int lastsym)
{
case C_MOE:
sym = (struct symbol *) obstack_alloc
- (&current_objfile->symbol_obstack,
+ (&current_objfile->objfile_obstack,
sizeof (struct symbol));
memset (sym, 0, sizeof (struct symbol));
DEPRECATED_SYMBOL_NAME (sym) =
obsavestring (name, strlen (name),
- &current_objfile->symbol_obstack);
+ &current_objfile->objfile_obstack);
SYMBOL_CLASS (sym) = LOC_CONST;
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
SYMBOL_VALUE (sym) = ms->c_value;
diff --git a/gdb/config.in b/gdb/config.in
index 1a11c7d..69982fd 100644
--- a/gdb/config.in
+++ b/gdb/config.in
@@ -136,15 +136,6 @@
/* Define if you have HPUX threads */
#undef HAVE_HPUX_THREAD_SUPPORT
-/* Define if you want to use the memory mapped malloc package (mmalloc). */
-#undef USE_MMALLOC
-
-/* Define if the runtime uses a routine from mmalloc before gdb has a chance
- to initialize mmalloc, and we want to force checking to be used anyway.
- This may cause spurious memory corruption messages if the runtime tries
- to explicitly deallocate that memory when gdb calls exit. */
-#undef MMCHECK_FORCE
-
/* Define if <proc_service.h> on solaris uses int instead of
size_t, and assorted other type changes. */
#undef PROC_SERVICE_IS_OLD
diff --git a/gdb/config/alpha/alpha-linux.mh b/gdb/config/alpha/alpha-linux.mh
index d373179..418bc41 100644
--- a/gdb/config/alpha/alpha-linux.mh
+++ b/gdb/config/alpha/alpha-linux.mh
@@ -7,9 +7,6 @@ NATDEPFILES= infptrace.o inftarg.o corelow.o alpha-nat.o linux-proc.o \
LOADLIBES = -ldl -rdynamic
-MMALLOC =
-MMALLOC_CFLAGS = -DNO_MMALLOC
-
# doublest.c currently assumes some properties of FP arithmetic
# on the host which require this.
MH_CFLAGS = -mieee
diff --git a/gdb/config/djgpp/fnchange.lst b/gdb/config/djgpp/fnchange.lst
index b1d9b3e..88569db 100644
--- a/gdb/config/djgpp/fnchange.lst
+++ b/gdb/config/djgpp/fnchange.lst
@@ -226,8 +226,6 @@
@V@/gdb/testsuite/gdb.mi/mi2-var-child.exp @V@/gdb/testsuite/gdb.mi/mi2varchild.exp
@V@/gdb/testsuite/gdb.mi/mi2-var-cmd.exp @V@/gdb/testsuite/gdb.mi/mi2varcmd.exp
@V@/gdb/testsuite/gdb.mi/mi2-var-display.exp @V@/gdb/testsuite/gdb.mi/mi2vardisplay.exp
-@V@/gdb/tui/tuiSourceWin.c @V@/gdb/tui/tuiWinSource.c
-@V@/gdb/tui/tuiSourceWin.h @V@/gdb/tui/tuiWinSource.h
@V@/gdb/x86-64-linux-tdep.c @V@/gdb/x8664-ltdep.c
@V@/gdb/x86-64-linux-nat.c @V@/gdb/x8664-lnat.c
@V@/include/ChangeLog-9103 @V@/include/ChangeLog.9103
diff --git a/gdb/config/i386/go32.mh b/gdb/config/i386/go32.mh
index 846896b..0de5a9f 100644
--- a/gdb/config/i386/go32.mh
+++ b/gdb/config/i386/go32.mh
@@ -1,8 +1,5 @@
# Host: Intel x86 running DJGPP
-# we don't need mmalloc on DJGPP
-MH_CFLAGS= -DNO_MMALLOC
-MMALLOC=
-MMALLOC_CFLAGS=
+MH_CFLAGS=
XM_FILE= xm-go32.h
diff --git a/gdb/config/i386/interix.mh b/gdb/config/i386/interix.mh
index 23311d6..c294dd5 100644
--- a/gdb/config/i386/interix.mh
+++ b/gdb/config/i386/interix.mh
@@ -4,6 +4,3 @@ NATDEPFILES= corelow.o core-regset.o fork-child.o i386-interix-nat.o \
procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o
NAT_FILE= nm-interix.h
XM_FILE= xm-interix.h
-# The below may be temporary; mmalloc relies on sbrk() at the moment
-MMALLOC=
-MMALLOC_CFLAGS=-DNO_MMALLOC
diff --git a/gdb/config/i386/nm-i386.h b/gdb/config/i386/nm-i386.h
index 97a7053..88eacc8 100644
--- a/gdb/config/i386/nm-i386.h
+++ b/gdb/config/i386/nm-i386.h
@@ -1,5 +1,5 @@
/* Native macro definitions for GDB on an Intel i[3456]86.
- Copyright 2001 Free Software Foundation, Inc.
+ Copyright 2001, 2004 Free Software Foundation, Inc.
This file is part of GDB.
@@ -113,8 +113,6 @@ extern int i386_remove_hw_breakpoint (CORE_ADDR addr, void *shadow);
#define target_remove_hw_breakpoint(addr, shadow) \
i386_remove_hw_breakpoint (addr, shadow)
-#define DECR_PC_AFTER_HW_BREAK 0
-
/* child_post_startup_inferior used to
reset all debug registers by calling i386_cleanup_dregs (). */
#define CHILD_POST_STARTUP_INFERIOR
diff --git a/gdb/config/nm-linux.h b/gdb/config/nm-linux.h
index 5d4175c..950e5af 100644
--- a/gdb/config/nm-linux.h
+++ b/gdb/config/nm-linux.h
@@ -77,3 +77,6 @@ extern void lin_thread_get_thread_signals (sigset_t *mask);
#define CHILD_POST_ATTACH
#define CHILD_FOLLOW_FORK
#define KILL_INFERIOR
+
+#define NATIVE_XFER_AUXV procfs_xfer_auxv
+#include "auxv.h" /* Declares it. */
diff --git a/gdb/config/powerpc/xm-linux.h b/gdb/config/powerpc/xm-linux.h
index c8a029d..73e7c40 100644
--- a/gdb/config/powerpc/xm-linux.h
+++ b/gdb/config/powerpc/xm-linux.h
@@ -25,14 +25,4 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
to get the offset in the core file of the register values. */
#define KERNEL_U_ADDR 0x0
-/* If you expect to use the mmalloc package to obtain mapped symbol files,
- for now you have to specify some parameters that determine how gdb places
- the mappings in it's address space. See the comments in map_to_address()
- for details. This is expected to only be a short term solution. Yes it
- is a kludge.
- FIXME: Make this more automatic. */
-
-#define MMAP_BASE_ADDRESS 0x20000000 /* First mapping here */
-#define MMAP_INCREMENT 0x01000000 /* Increment to next mapping */
-
#endif /* #ifndef XM_LINUX_H */
diff --git a/gdb/config/sparc/nm-nbsd.h b/gdb/config/sparc/nm-nbsd.h
index 089a5ac..5e05234 100644
--- a/gdb/config/sparc/nm-nbsd.h
+++ b/gdb/config/sparc/nm-nbsd.h
@@ -25,5 +25,17 @@
/* Get generic NetBSD native definitions. */
#include "config/nm-nbsd.h"
+
+
+/* Support for StackGhost cookies. */
+
+#include "target.h"
+
+#define NATIVE_XFER_WCOOKIE sparc_xfer_wcookie
+extern LONGEST sparc_xfer_wcookie (struct target_ops *ops,
+ enum target_object object,
+ const char *annex,
+ void *readbuf, const void *writebuf,
+ ULONGEST offset, LONGEST len);
#endif /* nm-nbsd.h */
diff --git a/gdb/configure b/gdb/configure
index da58de1..be9dae0 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -43,8 +43,6 @@ ac_help="$ac_help
ac_help="$ac_help
--enable-gdb-build-warnings Enable GDB specific build-time compiler warnings if gcc is used"
ac_help="$ac_help
- --with-mmalloc Use memory mapped malloc package"
-ac_help="$ac_help
--with-tclconfig=DIR Directory containing tcl configuration (tclConfig.sh)"
ac_help="$ac_help
--with-tkconfig=DIR Directory containing tk configuration (tkConfig.sh)"
@@ -81,7 +79,6 @@ program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
-sitefile=
srcdir=
target=NONE
verbose=
@@ -196,7 +193,6 @@ Configuration:
--help print this message
--no-create do not create output files
--quiet, --silent do not print \`checking...' messages
- --site-file=FILE use FILE as the site file
--version print the version of autoconf that created configure
Directory and file names:
--prefix=PREFIX install architecture-independent files in PREFIX
@@ -367,11 +363,6 @@ EOF
-site=* | --site=* | --sit=*)
site="$ac_optarg" ;;
- -site-file | --site-file | --site-fil | --site-fi | --site-f)
- ac_prev=sitefile ;;
- -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*)
- sitefile="$ac_optarg" ;;
-
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
@@ -537,16 +528,12 @@ fi
srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
# Prefer explicitly selected file to automatically selected ones.
-if test -z "$sitefile"; then
- if test -z "$CONFIG_SITE"; then
- if test "x$prefix" != xNONE; then
- CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
- else
- CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
- fi
+if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
fi
-else
- CONFIG_SITE="$sitefile"
fi
for ac_site_file in $CONFIG_SITE; do
if test -r "$ac_site_file"; then
@@ -587,7 +574,7 @@ fi
echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:591: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:578: checking whether to enable maintainer-specific portions of Makefiles" >&5
# Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
if test "${enable_maintainer_mode+set}" = set; then
enableval="$enable_maintainer_mode"
@@ -613,7 +600,7 @@ fi
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:617: checking for $ac_word" >&5
+echo "configure:604: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -643,7 +630,7 @@ if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:647: checking for $ac_word" >&5
+echo "configure:634: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -694,7 +681,7 @@ fi
# Extract the first word of "cl", so it can be a program name with args.
set dummy cl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:698: checking for $ac_word" >&5
+echo "configure:685: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -726,7 +713,7 @@ fi
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:730: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:717: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -737,12 +724,12 @@ cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext << EOF
-#line 741 "configure"
+#line 728 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:746: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:733: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
@@ -768,12 +755,12 @@ if test $ac_cv_prog_cc_works = no; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:772: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:759: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:777: checking whether we are using GNU C" >&5
+echo "configure:764: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -782,7 +769,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:786: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:773: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
@@ -801,7 +788,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:805: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:792: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -838,7 +825,7 @@ EOF
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:842: checking how to run the C preprocessor" >&5
+echo "configure:829: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -853,13 +840,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 857 "configure"
+#line 844 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:863: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:850: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -870,13 +857,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 874 "configure"
+#line 861 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:880: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:867: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -887,13 +874,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 891 "configure"
+#line 878 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:897: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:884: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -918,9 +905,9 @@ fi
echo "$ac_t""$CPP" 1>&6
echo $ac_n "checking for AIX""... $ac_c" 1>&6
-echo "configure:922: checking for AIX" >&5
+echo "configure:909: checking for AIX" >&5
cat > conftest.$ac_ext <<EOF
-#line 924 "configure"
+#line 911 "configure"
#include "confdefs.h"
#ifdef _AIX
yes
@@ -942,7 +929,7 @@ rm -f conftest*
echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
-echo "configure:946: checking for POSIXized ISC" >&5
+echo "configure:933: checking for POSIXized ISC" >&5
if test -d /etc/conf/kconfig.d &&
grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
then
@@ -966,7 +953,7 @@ fi
echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
-echo "configure:970: checking for ${CC-cc} option to accept ANSI C" >&5
+echo "configure:957: checking for ${CC-cc} option to accept ANSI C" >&5
if eval "test \"`echo '$''{'am_cv_prog_cc_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -983,7 +970,7 @@ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIO
do
CC="$ac_save_CC $ac_arg"
cat > conftest.$ac_ext <<EOF
-#line 987 "configure"
+#line 974 "configure"
#include "confdefs.h"
#include <stdarg.h>
#include <stdio.h>
@@ -1020,7 +1007,7 @@ return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
; return 0; }
EOF
-if { (eval echo configure:1024: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1011: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
am_cv_prog_cc_stdc="$ac_arg"; break
else
@@ -1091,7 +1078,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi
echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:1095: checking host system type" >&5
+echo "configure:1082: checking host system type" >&5
host_alias=$host
case "$host_alias" in
@@ -1112,7 +1099,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$host" 1>&6
echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:1116: checking target system type" >&5
+echo "configure:1103: checking target system type" >&5
target_alias=$target
case "$target_alias" in
@@ -1130,7 +1117,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$target" 1>&6
echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:1134: checking build system type" >&5
+echo "configure:1121: checking build system type" >&5
build_alias=$build
case "$build_alias" in
@@ -1168,7 +1155,7 @@ fi
# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1172: checking for $ac_word" >&5
+echo "configure:1159: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1200,7 +1187,7 @@ if test -n "$ac_tool_prefix"; then
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1204: checking for $ac_word" >&5
+echo "configure:1191: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1235,7 +1222,7 @@ fi
ALL_LINGUAS=
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:1239: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:1226: checking whether ${MAKE-make} sets \${MAKE}" >&5
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1264,7 +1251,7 @@ fi
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1268: checking for $ac_word" >&5
+echo "configure:1255: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1292,12 +1279,12 @@ else
fi
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1296: checking for ANSI C header files" >&5
+echo "configure:1283: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1301 "configure"
+#line 1288 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -1305,7 +1292,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1309: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1296: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1322,7 +1309,7 @@ rm -f conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 1326 "configure"
+#line 1313 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -1340,7 +1327,7 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 1344 "configure"
+#line 1331 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -1361,7 +1348,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 1365 "configure"
+#line 1352 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -1372,7 +1359,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:1376: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1363: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -1396,12 +1383,12 @@ EOF
fi
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:1400: checking for working const" >&5
+echo "configure:1387: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1405 "configure"
+#line 1392 "configure"
#include "confdefs.h"
int main() {
@@ -1450,7 +1437,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
-if { (eval echo configure:1454: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1441: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
@@ -1471,21 +1458,21 @@ EOF
fi
echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:1475: checking for inline" >&5
+echo "configure:1462: checking for inline" >&5
if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_c_inline=no
for ac_kw in inline __inline__ __inline; do
cat > conftest.$ac_ext <<EOF
-#line 1482 "configure"
+#line 1469 "configure"
#include "confdefs.h"
int main() {
} $ac_kw foo() {
; return 0; }
EOF
-if { (eval echo configure:1489: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1476: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_inline=$ac_kw; break
else
@@ -1511,12 +1498,12 @@ EOF
esac
echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:1515: checking for off_t" >&5
+echo "configure:1502: checking for off_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1520 "configure"
+#line 1507 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -1544,12 +1531,12 @@ EOF
fi
echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:1548: checking for size_t" >&5
+echo "configure:1535: checking for size_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1553 "configure"
+#line 1540 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -1579,19 +1566,19 @@ fi
# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments. Useless!
echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:1583: checking for working alloca.h" >&5
+echo "configure:1570: checking for working alloca.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1588 "configure"
+#line 1575 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
-if { (eval echo configure:1595: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1582: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_header_alloca_h=yes
else
@@ -1612,12 +1599,12 @@ EOF
fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:1616: checking for alloca" >&5
+echo "configure:1603: checking for alloca" >&5
if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1621 "configure"
+#line 1608 "configure"
#include "confdefs.h"
#ifdef __GNUC__
@@ -1645,7 +1632,7 @@ int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
-if { (eval echo configure:1649: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1636: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_func_alloca_works=yes
else
@@ -1677,12 +1664,12 @@ EOF
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:1681: checking whether alloca needs Cray hooks" >&5
+echo "configure:1668: checking whether alloca needs Cray hooks" >&5
if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1686 "configure"
+#line 1673 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@@ -1707,12 +1694,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6
if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1711: checking for $ac_func" >&5
+echo "configure:1698: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1716 "configure"
+#line 1703 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -1735,7 +1722,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:1739: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1726: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -1762,7 +1749,7 @@ done
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:1766: checking stack direction for C alloca" >&5
+echo "configure:1753: checking stack direction for C alloca" >&5
if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1770,7 +1757,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 1774 "configure"
+#line 1761 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@@ -1789,7 +1776,7 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:1793: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1780: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_c_stack_direction=1
else
@@ -1810,21 +1797,21 @@ EOF
fi
-for ac_hdr in unistd.h
+for ac_hdr in stdlib.h unistd.h sys/stat.h sys/types.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1818: checking for $ac_hdr" >&5
+echo "configure:1805: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1823 "configure"
+#line 1810 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1828: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1815: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1853,12 +1840,12 @@ done
for ac_func in getpagesize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1857: checking for $ac_func" >&5
+echo "configure:1844: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1862 "configure"
+#line 1849 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -1881,7 +1868,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:1885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1872: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -1906,7 +1893,7 @@ fi
done
echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:1910: checking for working mmap" >&5
+echo "configure:1897: checking for working mmap" >&5
if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1914,7 +1901,7 @@ else
ac_cv_func_mmap_fixed_mapped=no
else
cat > conftest.$ac_ext <<EOF
-#line 1918 "configure"
+#line 1905 "configure"
#include "confdefs.h"
/* Thanks to Mike Haertel and Jim Avera for this test.
@@ -1942,11 +1929,24 @@ else
#include <fcntl.h>
#include <sys/mman.h>
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+
+#if HAVE_STDLIB_H
+# include <stdlib.h>
+#endif
+
+#if HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
/* This mess was copied from the GNU getpagesize.h. */
#ifndef HAVE_GETPAGESIZE
-# ifdef HAVE_UNISTD_H
-# include <unistd.h>
-# endif
/* Assume that all systems that can run configure have sys/param.h. */
# ifndef HAVE_SYS_PARAM_H
@@ -3435,7 +3435,7 @@ fi
# Checks for programs. #
# --------------------- #
-for ac_prog in mawk gawk nawk awk
+for ac_prog in gawk mawk nawk awk
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
@@ -6091,7 +6091,7 @@ EOF
fi
-for ac_hdr in unistd.h
+for ac_hdr in stdlib.h unistd.h sys/stat.h sys/types.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
@@ -6223,11 +6223,24 @@ else
#include <fcntl.h>
#include <sys/mman.h>
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+
+#if HAVE_STDLIB_H
+# include <stdlib.h>
+#endif
+
+#if HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
/* This mess was copied from the GNU getpagesize.h. */
#ifndef HAVE_GETPAGESIZE
-# ifdef HAVE_UNISTD_H
-# include <unistd.h>
-# endif
/* Assume that all systems that can run configure have sys/param.h. */
# ifndef HAVE_SYS_PARAM_H
@@ -6335,7 +6348,7 @@ main()
}
EOF
-if { (eval echo configure:6339: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6352: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_mmap_fixed_mapped=yes
else
@@ -6358,12 +6371,12 @@ EOF
fi
echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:6362: checking for pid_t" >&5
+echo "configure:6375: checking for pid_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6367 "configure"
+#line 6380 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -6392,17 +6405,17 @@ fi
ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
-echo "configure:6396: checking for vfork.h" >&5
+echo "configure:6409: checking for vfork.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6401 "configure"
+#line 6414 "configure"
#include "confdefs.h"
#include <vfork.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6406: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6419: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -6427,18 +6440,18 @@ else
fi
echo $ac_n "checking for working vfork""... $ac_c" 1>&6
-echo "configure:6431: checking for working vfork" >&5
+echo "configure:6444: checking for working vfork" >&5
if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test "$cross_compiling" = yes; then
echo $ac_n "checking for vfork""... $ac_c" 1>&6
-echo "configure:6437: checking for vfork" >&5
+echo "configure:6450: checking for vfork" >&5
if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6442 "configure"
+#line 6455 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char vfork(); below. */
@@ -6461,7 +6474,7 @@ vfork();
; return 0; }
EOF
-if { (eval echo configure:6465: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6478: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_vfork=yes"
else
@@ -6483,7 +6496,7 @@ fi
ac_cv_func_vfork_works=$ac_cv_func_vfork
else
cat > conftest.$ac_ext <<EOF
-#line 6487 "configure"
+#line 6500 "configure"
#include "confdefs.h"
/* Thanks to Paul Eggert for this test. */
#include <stdio.h>
@@ -6578,7 +6591,7 @@ main() {
}
}
EOF
-if { (eval echo configure:6582: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6595: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_vfork_works=yes
else
@@ -6603,12 +6616,12 @@ fi
for ac_func in canonicalize_file_name realpath
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6607: checking for $ac_func" >&5
+echo "configure:6620: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6612 "configure"
+#line 6625 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6631,7 +6644,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6635: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6648: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -6658,12 +6671,12 @@ done
for ac_func in poll
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6662: checking for $ac_func" >&5
+echo "configure:6675: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6667 "configure"
+#line 6680 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6686,7 +6699,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6690: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6703: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -6713,12 +6726,12 @@ done
for ac_func in pread64
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6717: checking for $ac_func" >&5
+echo "configure:6730: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6722 "configure"
+#line 6735 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6741,7 +6754,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6745: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6758: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -6768,12 +6781,12 @@ done
for ac_func in sbrk
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6772: checking for $ac_func" >&5
+echo "configure:6785: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6777 "configure"
+#line 6790 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6796,7 +6809,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6800: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6813: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -6823,12 +6836,12 @@ done
for ac_func in setpgid setpgrp
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6827: checking for $ac_func" >&5
+echo "configure:6840: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6832 "configure"
+#line 6845 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6851,7 +6864,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6855: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6868: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -6878,12 +6891,12 @@ done
for ac_func in sigaction sigprocmask sigsetmask
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6882: checking for $ac_func" >&5
+echo "configure:6895: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6887 "configure"
+#line 6900 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6906,7 +6919,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6910: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6923: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -6933,12 +6946,12 @@ done
for ac_func in socketpair
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6937: checking for $ac_func" >&5
+echo "configure:6950: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6942 "configure"
+#line 6955 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6961,7 +6974,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6965: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6978: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -6988,12 +7001,12 @@ done
for ac_func in syscall
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6992: checking for $ac_func" >&5
+echo "configure:7005: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6997 "configure"
+#line 7010 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -7016,7 +7029,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:7020: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7033: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -7043,7 +7056,7 @@ done
if test "$cross_compiling" = no; then
echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6
-echo "configure:7047: checking whether setpgrp takes no argument" >&5
+echo "configure:7060: checking whether setpgrp takes no argument" >&5
if eval "test \"`echo '$''{'ac_cv_func_setpgrp_void'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -7051,7 +7064,7 @@ else
{ echo "configure: error: cannot check setpgrp if cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 7055 "configure"
+#line 7068 "configure"
#include "confdefs.h"
#ifdef HAVE_UNISTD_H
@@ -7071,7 +7084,7 @@ main()
}
EOF
-if { (eval echo configure:7075: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7088: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_setpgrp_void=no
else
@@ -7096,12 +7109,12 @@ fi
else
echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6
-echo "configure:7100: checking whether setpgrp takes no argument" >&5
+echo "configure:7113: checking whether setpgrp takes no argument" >&5
if eval "test \"`echo '$''{'ac_cv_func_setpgrp_void'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7105 "configure"
+#line 7118 "configure"
#include "confdefs.h"
#include <unistd.h>
@@ -7115,7 +7128,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:7119: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7132: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_func_setpgrp_void=no
else
@@ -7139,12 +7152,12 @@ fi
# Check if sigsetjmp is available. Using AC_CHECK_FUNCS won't do
# since sigsetjmp might only be defined as a macro.
echo $ac_n "checking for sigsetjmp""... $ac_c" 1>&6
-echo "configure:7143: checking for sigsetjmp" >&5
+echo "configure:7156: checking for sigsetjmp" >&5
if eval "test \"`echo '$''{'gdb_cv_func_sigsetjmp'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7148 "configure"
+#line 7161 "configure"
#include "confdefs.h"
#include <setjmp.h>
@@ -7153,7 +7166,7 @@ int main() {
sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1);
; return 0; }
EOF
-if { (eval echo configure:7157: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7170: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_func_sigsetjmp=yes
else
@@ -7179,12 +7192,12 @@ gdb_use_included_regex=yes
# However, if the system regex is GNU regex, then default to *not*
# using the included regex.
echo $ac_n "checking for GNU regex""... $ac_c" 1>&6
-echo "configure:7183: checking for GNU regex" >&5
+echo "configure:7196: checking for GNU regex" >&5
if eval "test \"`echo '$''{'gdb_cv_have_gnu_regex'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7188 "configure"
+#line 7201 "configure"
#include "confdefs.h"
#include <gnu-versions.h>
int main() {
@@ -7194,7 +7207,7 @@ int main() {
#endif
; return 0; }
EOF
-if { (eval echo configure:7198: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7211: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_gnu_regex=yes
else
@@ -7228,12 +7241,12 @@ fi
# See if <machine/reg.h> degines `struct reg'.
echo $ac_n "checking for struct reg in machine/reg.h""... $ac_c" 1>&6
-echo "configure:7232: checking for struct reg in machine/reg.h" >&5
+echo "configure:7245: checking for struct reg in machine/reg.h" >&5
if eval "test \"`echo '$''{'gdb_cv_struct_reg'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7237 "configure"
+#line 7250 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <machine/reg.h>
@@ -7241,7 +7254,7 @@ int main() {
struct reg r;
; return 0; }
EOF
-if { (eval echo configure:7245: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7258: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_struct_reg=yes
else
@@ -7264,19 +7277,19 @@ fi
# See if <machine/reg.h> supports the %fs and %gs i386 segment registers.
# Older i386 BSD's don't have the r_fs and r_gs members of `struct reg'.
echo $ac_n "checking for r_fs in struct reg""... $ac_c" 1>&6
-echo "configure:7268: checking for r_fs in struct reg" >&5
+echo "configure:7281: checking for r_fs in struct reg" >&5
if eval "test \"`echo '$''{'gdb_cv_struct_reg_r_fs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7273 "configure"
+#line 7286 "configure"
#include "confdefs.h"
#include <machine/reg.h>
int main() {
struct reg r; r.r_fs;
; return 0; }
EOF
-if { (eval echo configure:7280: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7293: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_struct_reg_r_fs=yes
else
@@ -7296,19 +7309,19 @@ EOF
fi
echo $ac_n "checking for r_gs in struct reg""... $ac_c" 1>&6
-echo "configure:7300: checking for r_gs in struct reg" >&5
+echo "configure:7313: checking for r_gs in struct reg" >&5
if eval "test \"`echo '$''{'gdb_cv_struct_reg_r_gs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7305 "configure"
+#line 7318 "configure"
#include "confdefs.h"
#include <machine/reg.h>
int main() {
struct reg r; r.r_gs;
; return 0; }
EOF
-if { (eval echo configure:7312: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7325: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_struct_reg_r_gs=yes
else
@@ -7330,19 +7343,19 @@ fi
# See if <sys/ptrace.h> provides the PTRACE_GETREGS request.
echo $ac_n "checking for PTRACE_GETREGS""... $ac_c" 1>&6
-echo "configure:7334: checking for PTRACE_GETREGS" >&5
+echo "configure:7347: checking for PTRACE_GETREGS" >&5
if eval "test \"`echo '$''{'gdb_cv_have_ptrace_getregs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7339 "configure"
+#line 7352 "configure"
#include "confdefs.h"
#include <sys/ptrace.h>
int main() {
PTRACE_GETREGS;
; return 0; }
EOF
-if { (eval echo configure:7346: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7359: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_ptrace_getregs=yes
else
@@ -7364,19 +7377,19 @@ fi
# See if <sys/ptrace.h> provides the PTRACE_GETFPXREGS request.
echo $ac_n "checking for PTRACE_GETFPXREGS""... $ac_c" 1>&6
-echo "configure:7368: checking for PTRACE_GETFPXREGS" >&5
+echo "configure:7381: checking for PTRACE_GETFPXREGS" >&5
if eval "test \"`echo '$''{'gdb_cv_have_ptrace_getfpxregs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7373 "configure"
+#line 7386 "configure"
#include "confdefs.h"
#include <sys/ptrace.h>
int main() {
PTRACE_GETFPXREGS;
; return 0; }
EOF
-if { (eval echo configure:7380: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7393: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_ptrace_getfpxregs=yes
else
@@ -7398,12 +7411,12 @@ fi
# See if <sys/ptrace.h> provides the PT_GETDBREGS request.
echo $ac_n "checking for PT_GETDBREGS""... $ac_c" 1>&6
-echo "configure:7402: checking for PT_GETDBREGS" >&5
+echo "configure:7415: checking for PT_GETDBREGS" >&5
if eval "test \"`echo '$''{'gdb_cv_have_pt_getdbregs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7407 "configure"
+#line 7420 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/ptrace.h>
@@ -7411,7 +7424,7 @@ int main() {
PT_GETDBREGS;
; return 0; }
EOF
-if { (eval echo configure:7415: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7428: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_pt_getdbregs=yes
else
@@ -7433,12 +7446,12 @@ fi
# See if <sys/ptrace.h> provides the PT_GETXMMREGS request.
echo $ac_n "checking for PT_GETXMMREGS""... $ac_c" 1>&6
-echo "configure:7437: checking for PT_GETXMMREGS" >&5
+echo "configure:7450: checking for PT_GETXMMREGS" >&5
if eval "test \"`echo '$''{'gdb_cv_have_pt_getxmmregs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7442 "configure"
+#line 7455 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/ptrace.h>
@@ -7446,7 +7459,7 @@ int main() {
PT_GETXMMREGS;
; return 0; }
EOF
-if { (eval echo configure:7450: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7463: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_pt_getxmmregs=yes
else
@@ -7469,19 +7482,19 @@ fi
# See if stdint.h provides the uintptr_t type.
# Autoconf 2.5X has an improved AC_CHECK_TYPE which will simplify this.
echo $ac_n "checking for uintptr_t in stdint.h""... $ac_c" 1>&6
-echo "configure:7473: checking for uintptr_t in stdint.h" >&5
+echo "configure:7486: checking for uintptr_t in stdint.h" >&5
if eval "test \"`echo '$''{'gdb_cv_have_uintptr_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7478 "configure"
+#line 7491 "configure"
#include "confdefs.h"
#include <stdint.h>
int main() {
uintptr_t foo = 0;
; return 0; }
EOF
-if { (eval echo configure:7485: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7498: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_uintptr_t=yes
else
@@ -7502,12 +7515,12 @@ EOF
fi
echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6
-echo "configure:7506: checking whether malloc must be declared" >&5
+echo "configure:7519: checking whether malloc must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_malloc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7511 "configure"
+#line 7524 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -7528,7 +7541,7 @@ int main() {
char *(*pfn) = (char *(*)) malloc
; return 0; }
EOF
-if { (eval echo configure:7532: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7545: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_malloc=no
else
@@ -7549,12 +7562,12 @@ EOF
fi
echo $ac_n "checking whether realloc must be declared""... $ac_c" 1>&6
-echo "configure:7553: checking whether realloc must be declared" >&5
+echo "configure:7566: checking whether realloc must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_realloc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7558 "configure"
+#line 7571 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -7575,7 +7588,7 @@ int main() {
char *(*pfn) = (char *(*)) realloc
; return 0; }
EOF
-if { (eval echo configure:7579: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7592: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_realloc=no
else
@@ -7596,12 +7609,12 @@ EOF
fi
echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6
-echo "configure:7600: checking whether free must be declared" >&5
+echo "configure:7613: checking whether free must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_free'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7605 "configure"
+#line 7618 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -7622,7 +7635,7 @@ int main() {
char *(*pfn) = (char *(*)) free
; return 0; }
EOF
-if { (eval echo configure:7626: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7639: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_free=no
else
@@ -7643,12 +7656,12 @@ EOF
fi
echo $ac_n "checking whether strerror must be declared""... $ac_c" 1>&6
-echo "configure:7647: checking whether strerror must be declared" >&5
+echo "configure:7660: checking whether strerror must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_strerror'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7652 "configure"
+#line 7665 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -7669,7 +7682,7 @@ int main() {
char *(*pfn) = (char *(*)) strerror
; return 0; }
EOF
-if { (eval echo configure:7673: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7686: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_strerror=no
else
@@ -7690,12 +7703,12 @@ EOF
fi
echo $ac_n "checking whether strdup must be declared""... $ac_c" 1>&6
-echo "configure:7694: checking whether strdup must be declared" >&5
+echo "configure:7707: checking whether strdup must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_strdup'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7699 "configure"
+#line 7712 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -7716,7 +7729,7 @@ int main() {
char *(*pfn) = (char *(*)) strdup
; return 0; }
EOF
-if { (eval echo configure:7720: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7733: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_strdup=no
else
@@ -7737,12 +7750,12 @@ EOF
fi
echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6
-echo "configure:7741: checking whether strstr must be declared" >&5
+echo "configure:7754: checking whether strstr must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_strstr'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7746 "configure"
+#line 7759 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -7763,7 +7776,7 @@ int main() {
char *(*pfn) = (char *(*)) strstr
; return 0; }
EOF
-if { (eval echo configure:7767: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7780: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_strstr=no
else
@@ -7784,12 +7797,12 @@ EOF
fi
echo $ac_n "checking whether canonicalize_file_name must be declared""... $ac_c" 1>&6
-echo "configure:7788: checking whether canonicalize_file_name must be declared" >&5
+echo "configure:7801: checking whether canonicalize_file_name must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_canonicalize_file_name'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7793 "configure"
+#line 7806 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -7810,7 +7823,7 @@ int main() {
char *(*pfn) = (char *(*)) canonicalize_file_name
; return 0; }
EOF
-if { (eval echo configure:7814: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7827: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_canonicalize_file_name=no
else
@@ -7836,9 +7849,9 @@ fi
# could be expunged. --jsm 1999-03-22
echo $ac_n "checking for HPUX save_state structure""... $ac_c" 1>&6
-echo "configure:7840: checking for HPUX save_state structure" >&5
+echo "configure:7853: checking for HPUX save_state structure" >&5
cat > conftest.$ac_ext <<EOF
-#line 7842 "configure"
+#line 7855 "configure"
#include "confdefs.h"
#include <machine/save_state.h>
EOF
@@ -7853,7 +7866,7 @@ fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 7857 "configure"
+#line 7870 "configure"
#include "confdefs.h"
#include <machine/save_state.h>
EOF
@@ -7912,7 +7925,7 @@ EOF
EOF
;;
- *-*-solaris2.[678])
+ *-*-solaris2.[6789])
cat >> confdefs.h <<\EOF
#define NEW_PROC_API 1
EOF
@@ -7923,12 +7936,12 @@ fi
if test "$ac_cv_header_sys_procfs_h" = yes; then
echo $ac_n "checking for pstatus_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:7927: checking for pstatus_t in sys/procfs.h" >&5
+echo "configure:7940: checking for pstatus_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pstatus_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7932 "configure"
+#line 7945 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -7937,7 +7950,7 @@ int main() {
pstatus_t avar
; return 0; }
EOF
-if { (eval echo configure:7941: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7954: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_pstatus_t=yes
else
@@ -7959,12 +7972,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_pstatus_t" 1>&6
echo $ac_n "checking for prrun_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:7963: checking for prrun_t in sys/procfs.h" >&5
+echo "configure:7976: checking for prrun_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prrun_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7968 "configure"
+#line 7981 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -7973,7 +7986,7 @@ int main() {
prrun_t avar
; return 0; }
EOF
-if { (eval echo configure:7977: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7990: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_prrun_t=yes
else
@@ -7995,12 +8008,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_prrun_t" 1>&6
echo $ac_n "checking for gregset_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:7999: checking for gregset_t in sys/procfs.h" >&5
+echo "configure:8012: checking for gregset_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_gregset_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8004 "configure"
+#line 8017 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -8009,7 +8022,7 @@ int main() {
gregset_t avar
; return 0; }
EOF
-if { (eval echo configure:8013: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8026: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_gregset_t=yes
else
@@ -8031,12 +8044,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_gregset_t" 1>&6
echo $ac_n "checking for fpregset_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:8035: checking for fpregset_t in sys/procfs.h" >&5
+echo "configure:8048: checking for fpregset_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_fpregset_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8040 "configure"
+#line 8053 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -8045,7 +8058,7 @@ int main() {
fpregset_t avar
; return 0; }
EOF
-if { (eval echo configure:8049: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8062: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_fpregset_t=yes
else
@@ -8067,12 +8080,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_fpregset_t" 1>&6
echo $ac_n "checking for prgregset_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:8071: checking for prgregset_t in sys/procfs.h" >&5
+echo "configure:8084: checking for prgregset_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prgregset_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8076 "configure"
+#line 8089 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -8081,7 +8094,7 @@ int main() {
prgregset_t avar
; return 0; }
EOF
-if { (eval echo configure:8085: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8098: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_prgregset_t=yes
else
@@ -8103,12 +8116,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_prgregset_t" 1>&6
echo $ac_n "checking for prfpregset_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:8107: checking for prfpregset_t in sys/procfs.h" >&5
+echo "configure:8120: checking for prfpregset_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prfpregset_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8112 "configure"
+#line 8125 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -8117,7 +8130,7 @@ int main() {
prfpregset_t avar
; return 0; }
EOF
-if { (eval echo configure:8121: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8134: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_prfpregset_t=yes
else
@@ -8139,12 +8152,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_prfpregset_t" 1>&6
echo $ac_n "checking for prgregset32_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:8143: checking for prgregset32_t in sys/procfs.h" >&5
+echo "configure:8156: checking for prgregset32_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prgregset32_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8148 "configure"
+#line 8161 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -8153,7 +8166,7 @@ int main() {
prgregset32_t avar
; return 0; }
EOF
-if { (eval echo configure:8157: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8170: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_prgregset32_t=yes
else
@@ -8175,12 +8188,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_prgregset32_t" 1>&6
echo $ac_n "checking for prfpregset32_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:8179: checking for prfpregset32_t in sys/procfs.h" >&5
+echo "configure:8192: checking for prfpregset32_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prfpregset32_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8184 "configure"
+#line 8197 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -8189,7 +8202,7 @@ int main() {
prfpregset32_t avar
; return 0; }
EOF
-if { (eval echo configure:8193: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8206: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_prfpregset32_t=yes
else
@@ -8211,12 +8224,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_prfpregset32_t" 1>&6
echo $ac_n "checking for lwpid_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:8215: checking for lwpid_t in sys/procfs.h" >&5
+echo "configure:8228: checking for lwpid_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_lwpid_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8220 "configure"
+#line 8233 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -8225,7 +8238,7 @@ int main() {
lwpid_t avar
; return 0; }
EOF
-if { (eval echo configure:8229: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8242: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_lwpid_t=yes
else
@@ -8247,12 +8260,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_lwpid_t" 1>&6
echo $ac_n "checking for psaddr_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:8251: checking for psaddr_t in sys/procfs.h" >&5
+echo "configure:8264: checking for psaddr_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_psaddr_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8256 "configure"
+#line 8269 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -8261,7 +8274,7 @@ int main() {
psaddr_t avar
; return 0; }
EOF
-if { (eval echo configure:8265: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8278: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_psaddr_t=yes
else
@@ -8283,12 +8296,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_psaddr_t" 1>&6
echo $ac_n "checking for prsysent_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:8287: checking for prsysent_t in sys/procfs.h" >&5
+echo "configure:8300: checking for prsysent_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prsysent_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8292 "configure"
+#line 8305 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -8297,7 +8310,7 @@ int main() {
prsysent_t avar
; return 0; }
EOF
-if { (eval echo configure:8301: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8314: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_prsysent_t=yes
else
@@ -8319,12 +8332,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_prsysent_t" 1>&6
echo $ac_n "checking for pr_sigset_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:8323: checking for pr_sigset_t in sys/procfs.h" >&5
+echo "configure:8336: checking for pr_sigset_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pr_sigset_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8328 "configure"
+#line 8341 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -8333,7 +8346,7 @@ int main() {
pr_sigset_t avar
; return 0; }
EOF
-if { (eval echo configure:8337: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8350: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_pr_sigset_t=yes
else
@@ -8355,12 +8368,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_pr_sigset_t" 1>&6
echo $ac_n "checking for pr_sigaction64_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:8359: checking for pr_sigaction64_t in sys/procfs.h" >&5
+echo "configure:8372: checking for pr_sigaction64_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pr_sigaction64_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8364 "configure"
+#line 8377 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -8369,7 +8382,7 @@ int main() {
pr_sigaction64_t avar
; return 0; }
EOF
-if { (eval echo configure:8373: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8386: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_pr_sigaction64_t=yes
else
@@ -8391,12 +8404,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_pr_sigaction64_t" 1>&6
echo $ac_n "checking for pr_siginfo64_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:8395: checking for pr_siginfo64_t in sys/procfs.h" >&5
+echo "configure:8408: checking for pr_siginfo64_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pr_siginfo64_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8400 "configure"
+#line 8413 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -8405,7 +8418,7 @@ int main() {
pr_siginfo64_t avar
; return 0; }
EOF
-if { (eval echo configure:8409: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8422: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_pr_siginfo64_t=yes
else
@@ -8432,7 +8445,7 @@ EOF
if test $bfd_cv_have_sys_procfs_type_prfpregset_t = yes; then
echo $ac_n "checking whether prfpregset_t type is broken""... $ac_c" 1>&6
-echo "configure:8436: checking whether prfpregset_t type is broken" >&5
+echo "configure:8449: checking whether prfpregset_t type is broken" >&5
if eval "test \"`echo '$''{'gdb_cv_prfpregset_t_broken'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -8440,7 +8453,7 @@ else
gdb_cv_prfpregset_t_broken=yes
else
cat > conftest.$ac_ext <<EOF
-#line 8444 "configure"
+#line 8457 "configure"
#include "confdefs.h"
#include <sys/procfs.h>
int main ()
@@ -8450,7 +8463,7 @@ else
return 0;
}
EOF
-if { (eval echo configure:8454: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8467: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
gdb_cv_prfpregset_t_broken=no
else
@@ -8475,12 +8488,12 @@ EOF
echo $ac_n "checking for PIOCSET ioctl entry in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:8479: checking for PIOCSET ioctl entry in sys/procfs.h" >&5
+echo "configure:8492: checking for PIOCSET ioctl entry in sys/procfs.h" >&5
if eval "test \"`echo '$''{'gdb_cv_have_procfs_piocset'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8484 "configure"
+#line 8497 "configure"
#include "confdefs.h"
#include <unistd.h>
#include <sys/types.h>
@@ -8493,7 +8506,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:8497: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8510: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_procfs_piocset=yes
else
@@ -8517,19 +8530,19 @@ fi
if test ${host} = ${target} ; then
echo $ac_n "checking for member l_addr in struct link_map""... $ac_c" 1>&6
-echo "configure:8521: checking for member l_addr in struct link_map" >&5
+echo "configure:8534: checking for member l_addr in struct link_map" >&5
if eval "test \"`echo '$''{'gdb_cv_have_struct_link_map_with_l_members'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8526 "configure"
+#line 8539 "configure"
#include "confdefs.h"
#include <link.h>
int main() {
struct link_map lm; (void) lm.l_addr;
; return 0; }
EOF
-if { (eval echo configure:8533: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8546: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_struct_link_map_with_l_members=yes
else
@@ -8551,12 +8564,12 @@ EOF
echo $ac_n "checking for member lm_addr in struct link_map""... $ac_c" 1>&6
-echo "configure:8555: checking for member lm_addr in struct link_map" >&5
+echo "configure:8568: checking for member lm_addr in struct link_map" >&5
if eval "test \"`echo '$''{'gdb_cv_have_struct_link_map_with_lm_members'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8560 "configure"
+#line 8573 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <link.h>
@@ -8564,7 +8577,7 @@ int main() {
struct link_map lm; (void) lm.lm_addr;
; return 0; }
EOF
-if { (eval echo configure:8568: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8581: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_struct_link_map_with_lm_members=yes
else
@@ -8586,12 +8599,12 @@ EOF
echo $ac_n "checking for member som_addr in struct so_map""... $ac_c" 1>&6
-echo "configure:8590: checking for member som_addr in struct so_map" >&5
+echo "configure:8603: checking for member som_addr in struct so_map" >&5
if eval "test \"`echo '$''{'gdb_cv_have_struct_so_map_with_som_members'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8595 "configure"
+#line 8608 "configure"
#include "confdefs.h"
#include <sys/types.h>
#ifdef HAVE_NLIST_H
@@ -8602,7 +8615,7 @@ int main() {
struct so_map lm; (void) lm.som_addr;
; return 0; }
EOF
-if { (eval echo configure:8606: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8619: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_struct_so_map_with_som_members=yes
else
@@ -8624,12 +8637,12 @@ EOF
echo $ac_n "checking for struct link_map32 in sys/link.h""... $ac_c" 1>&6
-echo "configure:8628: checking for struct link_map32 in sys/link.h" >&5
+echo "configure:8641: checking for struct link_map32 in sys/link.h" >&5
if eval "test \"`echo '$''{'gdb_cv_have_struct_link_map32'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8633 "configure"
+#line 8646 "configure"
#include "confdefs.h"
#define _SYSCALL32
#include <sys/link.h>
@@ -8637,7 +8650,7 @@ int main() {
struct link_map32 l;
; return 0; }
EOF
-if { (eval echo configure:8641: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8654: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_struct_link_map32=yes
else
@@ -8664,12 +8677,12 @@ fi
echo $ac_n "checking for long long support in compiler""... $ac_c" 1>&6
-echo "configure:8668: checking for long long support in compiler" >&5
+echo "configure:8681: checking for long long support in compiler" >&5
if eval "test \"`echo '$''{'gdb_cv_c_long_long'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8673 "configure"
+#line 8686 "configure"
#include "confdefs.h"
int main() {
@@ -8679,7 +8692,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:8683: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8696: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_c_long_long=yes
else
@@ -8701,7 +8714,7 @@ fi
echo $ac_n "checking for long long support in printf""... $ac_c" 1>&6
-echo "configure:8705: checking for long long support in printf" >&5
+echo "configure:8718: checking for long long support in printf" >&5
if eval "test \"`echo '$''{'gdb_cv_printf_has_long_long'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -8709,7 +8722,7 @@ else
gdb_cv_printf_has_long_long=no
else
cat > conftest.$ac_ext <<EOF
-#line 8713 "configure"
+#line 8726 "configure"
#include "confdefs.h"
int main () {
@@ -8723,7 +8736,7 @@ int main () {
return (strcmp ("0x0123456789abcdef", buf));
}
EOF
-if { (eval echo configure:8727: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8740: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
gdb_cv_printf_has_long_long=yes
else
@@ -8747,19 +8760,19 @@ echo "$ac_t""$gdb_cv_printf_has_long_long" 1>&6
echo $ac_n "checking for long double support in compiler""... $ac_c" 1>&6
-echo "configure:8751: checking for long double support in compiler" >&5
+echo "configure:8764: checking for long double support in compiler" >&5
if eval "test \"`echo '$''{'ac_cv_c_long_double'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8756 "configure"
+#line 8769 "configure"
#include "confdefs.h"
int main() {
long double foo;
; return 0; }
EOF
-if { (eval echo configure:8763: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8776: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_long_double=yes
else
@@ -8781,7 +8794,7 @@ fi
echo $ac_n "checking for long double support in printf""... $ac_c" 1>&6
-echo "configure:8785: checking for long double support in printf" >&5
+echo "configure:8798: checking for long double support in printf" >&5
if eval "test \"`echo '$''{'gdb_cv_printf_has_long_double'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -8789,7 +8802,7 @@ else
gdb_cv_printf_has_long_double=no
else
cat > conftest.$ac_ext <<EOF
-#line 8793 "configure"
+#line 8806 "configure"
#include "confdefs.h"
int main () {
@@ -8799,7 +8812,7 @@ int main () {
return (strncmp ("3.14159", buf, 7));
}
EOF
-if { (eval echo configure:8803: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8816: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
gdb_cv_printf_has_long_double=yes
else
@@ -8823,7 +8836,7 @@ echo "$ac_t""$gdb_cv_printf_has_long_double" 1>&6
echo $ac_n "checking for long double support in scanf""... $ac_c" 1>&6
-echo "configure:8827: checking for long double support in scanf" >&5
+echo "configure:8840: checking for long double support in scanf" >&5
if eval "test \"`echo '$''{'gdb_cv_scanf_has_long_double'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -8831,7 +8844,7 @@ else
gdb_cv_scanf_has_long_double=no
else
cat > conftest.$ac_ext <<EOF
-#line 8835 "configure"
+#line 8848 "configure"
#include "confdefs.h"
int main () {
@@ -8841,7 +8854,7 @@ int main () {
return !(f > 3.14159 && f < 3.14160);
}
EOF
-if { (eval echo configure:8845: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8858: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
gdb_cv_scanf_has_long_double=yes
else
@@ -8866,7 +8879,7 @@ echo "$ac_t""$gdb_cv_scanf_has_long_double" 1>&6
case ${host_os} in
aix*)
echo $ac_n "checking for -bbigtoc option""... $ac_c" 1>&6
-echo "configure:8870: checking for -bbigtoc option" >&5
+echo "configure:8883: checking for -bbigtoc option" >&5
if eval "test \"`echo '$''{'gdb_cv_bigtoc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -8880,14 +8893,14 @@ else
LDFLAGS=$LDFLAGS\ $gdb_cv_bigtoc
cat > conftest.$ac_ext <<EOF
-#line 8884 "configure"
+#line 8897 "configure"
#include "confdefs.h"
int main() {
int i;
; return 0; }
EOF
-if { (eval echo configure:8891: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8904: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
:
else
echo "configure: failed program was:" >&5
@@ -8910,7 +8923,7 @@ if test ${build} = ${host} -a ${host} = ${target} ; then
case ${host_os} in
hpux*)
echo $ac_n "checking for HPUX/OSF thread support""... $ac_c" 1>&6
-echo "configure:8914: checking for HPUX/OSF thread support" >&5
+echo "configure:8927: checking for HPUX/OSF thread support" >&5
if test -f /usr/include/dce/cma_config.h ; then
if test "$GCC" = "yes" ; then
echo "$ac_t""yes" 1>&6
@@ -8933,7 +8946,7 @@ EOF
# because version 0 (present on Solaris 2.4 or earlier) doesn't have
# the same API.
echo $ac_n "checking for Solaris thread debugging library""... $ac_c" 1>&6
-echo "configure:8937: checking for Solaris thread debugging library" >&5
+echo "configure:8950: checking for Solaris thread debugging library" >&5
if test -f /usr/lib/libthread_db.so.1 ; then
echo "$ac_t""yes" 1>&6
cat >> confdefs.h <<\EOF
@@ -8943,7 +8956,7 @@ EOF
CONFIG_LIB_OBS="${CONFIG_LIB_OBS} sol-thread.o"
CONFIG_SRCS="${CONFIG_SRCS} sol-thread.c"
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:8947: checking for dlopen in -ldl" >&5
+echo "configure:8960: checking for dlopen in -ldl" >&5
ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -8951,7 +8964,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 8955 "configure"
+#line 8968 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -8962,7 +8975,7 @@ int main() {
dlopen()
; return 0; }
EOF
-if { (eval echo configure:8966: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8979: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -8994,17 +9007,17 @@ fi
# all symbols visible in the dynamic symbol table.
hold_ldflags=$LDFLAGS
echo $ac_n "checking for the ld -export-dynamic flag""... $ac_c" 1>&6
-echo "configure:8998: checking for the ld -export-dynamic flag" >&5
+echo "configure:9011: checking for the ld -export-dynamic flag" >&5
LDFLAGS="${LDFLAGS} -Wl,-export-dynamic"
cat > conftest.$ac_ext <<EOF
-#line 9001 "configure"
+#line 9014 "configure"
#include "confdefs.h"
int main() {
int i;
; return 0; }
EOF
-if { (eval echo configure:9008: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9021: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
found=yes
else
@@ -9023,13 +9036,13 @@ rm -f conftest*
# Sun randomly tweaked the prototypes in <proc_service.h>
# at one point.
echo $ac_n "checking if <proc_service.h> is old""... $ac_c" 1>&6
-echo "configure:9027: checking if <proc_service.h> is old" >&5
+echo "configure:9040: checking if <proc_service.h> is old" >&5
if eval "test \"`echo '$''{'gdb_cv_proc_service_is_old'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 9033 "configure"
+#line 9046 "configure"
#include "confdefs.h"
#include <proc_service.h>
@@ -9040,7 +9053,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:9044: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9057: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_proc_service_is_old=no
else
@@ -9066,12 +9079,12 @@ EOF
;;
aix*)
echo $ac_n "checking for AiX thread debugging library""... $ac_c" 1>&6
-echo "configure:9070: checking for AiX thread debugging library" >&5
+echo "configure:9083: checking for AiX thread debugging library" >&5
if eval "test \"`echo '$''{'gdb_cv_have_aix_thread_debug'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 9075 "configure"
+#line 9088 "configure"
#include "confdefs.h"
#include <sys/pthdebug.h>
int main() {
@@ -9080,7 +9093,7 @@ int main() {
#endif
; return 0; }
EOF
-if { (eval echo configure:9084: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9097: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_aix_thread_debug=yes
else
@@ -9105,19 +9118,19 @@ fi
if test "x$ac_cv_header_thread_db_h" = "xyes"; then
echo $ac_n "checking whether <thread_db.h> has TD_NOTALLOC""... $ac_c" 1>&6
-echo "configure:9109: checking whether <thread_db.h> has TD_NOTALLOC" >&5
+echo "configure:9122: checking whether <thread_db.h> has TD_NOTALLOC" >&5
if eval "test \"`echo '$''{'gdb_cv_thread_db_h_has_td_notalloc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 9114 "configure"
+#line 9127 "configure"
#include "confdefs.h"
#include <thread_db.h>
int main() {
int i = TD_NOTALLOC;
; return 0; }
EOF
-if { (eval echo configure:9121: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9134: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_thread_db_h_has_td_notalloc=yes
else
@@ -9142,19 +9155,19 @@ fi
if test "x$ac_cv_header_sys_syscall_h" = "xyes"; then
echo $ac_n "checking whether <sys/syscall.h> has __NR_tkill""... $ac_c" 1>&6
-echo "configure:9146: checking whether <sys/syscall.h> has __NR_tkill" >&5
+echo "configure:9159: checking whether <sys/syscall.h> has __NR_tkill" >&5
if eval "test \"`echo '$''{'gdb_cv_sys_syscall_h_has_tkill'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 9151 "configure"
+#line 9164 "configure"
#include "confdefs.h"
#include <sys/syscall.h>
int main() {
int i = __NR_tkill;
; return 0; }
EOF
-if { (eval echo configure:9158: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9171: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_sys_syscall_h_has_tkill=yes
else
@@ -9221,9 +9234,10 @@ fi
# NOTE: If you add to this list, remember to update
# gdb/doc/gdbint.texinfo.
build_warnings="-Wimplicit -Wreturn-type -Wcomment -Wtrigraphs \
--Wformat -Wparentheses -Wpointer-arith -Wuninitialized -Wformat-nonliteral"
+-Wformat -Wparentheses -Wpointer-arith -Wuninitialized -Wformat-nonliteral \
+-Wunused-label"
# Up for debate: -Wswitch -Wcomment -trigraphs -Wtrigraphs
-# -Wunused-function -Wunused-label -Wunused-variable -Wunused-value
+# -Wunused-function -Wunused-variable -Wunused-value
# -Wchar-subscripts -Wtraditional -Wshadow -Wcast-qual
# -Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes
# -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls
@@ -9265,7 +9279,7 @@ WERROR_CFLAGS=""
if test "x${build_warnings}" != x -a "x$GCC" = xyes
then
echo $ac_n "checking compiler warning flags""... $ac_c" 1>&6
-echo "configure:9269: checking compiler warning flags" >&5
+echo "configure:9283: checking compiler warning flags" >&5
# Separate out the -Werror flag as some files just cannot be
# compiled with it enabled.
for w in ${build_warnings}; do
@@ -9275,14 +9289,14 @@ echo "configure:9269: checking compiler warning flags" >&5
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $w"
cat > conftest.$ac_ext <<EOF
-#line 9279 "configure"
+#line 9293 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:9286: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9300: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
WARN_CFLAGS="${WARN_CFLAGS} $w"
else
@@ -9298,44 +9312,14 @@ fi
-MMALLOC_CFLAGS=
-MMALLOC=
-
-
-
-# Check whether --with-mmalloc or --without-mmalloc was given.
-if test "${with_mmalloc+set}" = set; then
- withval="$with_mmalloc"
- case "${withval}" in
- yes) want_mmalloc=true ;;
- no) want_mmalloc=false;;
- *) { echo "configure: error: bad value ${withval} for GDB with-mmalloc option" 1>&2; exit 1; } ;;
-esac
-else
- want_mmalloc=false
-fi
-
-if test x$want_mmalloc = xtrue; then
- cat >> confdefs.h <<\EOF
-#define USE_MMALLOC 1
-EOF
-
- cat >> confdefs.h <<\EOF
-#define MMCHECK_FORCE 1
-EOF
-
- MMALLOC_CFLAGS="-I$srcdir/../mmalloc"
- MMALLOC='../mmalloc/libmmalloc.a'
-fi
-
# In the Cygwin environment, we need some additional flags.
echo $ac_n "checking for cygwin""... $ac_c" 1>&6
-echo "configure:9334: checking for cygwin" >&5
+echo "configure:9318: checking for cygwin" >&5
if eval "test \"`echo '$''{'gdb_cv_os_cygwin'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 9339 "configure"
+#line 9323 "configure"
#include "confdefs.h"
#if defined (__CYGWIN__) || defined (__CYGWIN32__)
@@ -9413,7 +9397,7 @@ if test "${with_tclconfig+set}" = set; then
fi
echo $ac_n "checking for Tcl configuration""... $ac_c" 1>&6
-echo "configure:9417: checking for Tcl configuration" >&5
+echo "configure:9401: checking for Tcl configuration" >&5
if eval "test \"`echo '$''{'ac_cv_c_tclconfig'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -9522,7 +9506,7 @@ if test "${with_tkconfig+set}" = set; then
fi
echo $ac_n "checking for Tk configuration""... $ac_c" 1>&6
-echo "configure:9526: checking for Tk configuration" >&5
+echo "configure:9510: checking for Tk configuration" >&5
if eval "test \"`echo '$''{'ac_cv_c_tkconfig'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -9631,7 +9615,7 @@ fi
no_tcl=true
echo $ac_n "checking for Tcl private headers. dir=${configdir}""... $ac_c" 1>&6
-echo "configure:9635: checking for Tcl private headers. dir=${configdir}" >&5
+echo "configure:9619: checking for Tcl private headers. dir=${configdir}" >&5
# Check whether --with-tclinclude or --without-tclinclude was given.
if test "${with_tclinclude+set}" = set; then
withval="$with_tclinclude"
@@ -9697,17 +9681,17 @@ fi
if test x"${ac_cv_c_tclh}" = x ; then
ac_safe=`echo "tclInt.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for tclInt.h""... $ac_c" 1>&6
-echo "configure:9701: checking for tclInt.h" >&5
+echo "configure:9685: checking for tclInt.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 9706 "configure"
+#line 9690 "configure"
#include "confdefs.h"
#include <tclInt.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9711: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9695: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -9767,7 +9751,7 @@ fi
#
no_tk=true
echo $ac_n "checking for Tk private headers""... $ac_c" 1>&6
-echo "configure:9771: checking for Tk private headers" >&5
+echo "configure:9755: checking for Tk private headers" >&5
# Check whether --with-tkinclude or --without-tkinclude was given.
if test "${with_tkinclude+set}" = set; then
withval="$with_tkinclude"
@@ -9833,17 +9817,17 @@ fi
if test x"${ac_cv_c_tkh}" = x ; then
ac_safe=`echo "tk.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for tk.h""... $ac_c" 1>&6
-echo "configure:9837: checking for tk.h" >&5
+echo "configure:9821: checking for tk.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 9842 "configure"
+#line 9826 "configure"
#include "confdefs.h"
#include <tk.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9847: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9831: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -9889,7 +9873,7 @@ fi
echo $ac_n "checking for Itcl private headers. srcdir=${srcdir}""... $ac_c" 1>&6
-echo "configure:9893: checking for Itcl private headers. srcdir=${srcdir}" >&5
+echo "configure:9877: checking for Itcl private headers. srcdir=${srcdir}" >&5
if test x"${ac_cv_c_itclh}" = x ; then
for i in ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ${srcdir}/../itcl/itcl; do
if test -f $i/generic/itcl.h ; then
@@ -9912,7 +9896,7 @@ fi
echo $ac_n "checking for Itk private headers. srcdir=${srcdir}""... $ac_c" 1>&6
-echo "configure:9916: checking for Itk private headers. srcdir=${srcdir}" >&5
+echo "configure:9900: checking for Itk private headers. srcdir=${srcdir}" >&5
if test x"${ac_cv_c_itkh}" = x ; then
for i in ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ${srcdir}/../itcl/itk; do
if test -f $i/generic/itk.h ; then
@@ -9967,7 +9951,7 @@ if test "${with_itclconfig+set}" = set; then
fi
echo $ac_n "checking for Itcl configuration""... $ac_c" 1>&6
-echo "configure:9971: checking for Itcl configuration" >&5
+echo "configure:9955: checking for Itcl configuration" >&5
if eval "test \"`echo '$''{'ac_cv_c_itclconfig'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -10070,7 +10054,7 @@ if test "${with_itkconfig+set}" = set; then
fi
echo $ac_n "checking for Itk configuration""... $ac_c" 1>&6
-echo "configure:10074: checking for Itk configuration" >&5
+echo "configure:10058: checking for Itk configuration" >&5
if eval "test \"`echo '$''{'ac_cv_c_itkconfig'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -10213,7 +10197,7 @@ fi
# Uses ac_ vars as temps to allow command line to override cache and checks.
# --without-x overrides everything else, but does not touch the cache.
echo $ac_n "checking for X""... $ac_c" 1>&6
-echo "configure:10217: checking for X" >&5
+echo "configure:10201: checking for X" >&5
# Check whether --with-x or --without-x was given.
if test "${with_x+set}" = set; then
@@ -10275,12 +10259,12 @@ if test "$ac_x_includes" = NO; then
# First, try using that file with no special directory specified.
cat > conftest.$ac_ext <<EOF
-#line 10279 "configure"
+#line 10263 "configure"
#include "confdefs.h"
#include <$x_direct_test_include>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10284: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10268: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -10349,14 +10333,14 @@ if test "$ac_x_libraries" = NO; then
ac_save_LIBS="$LIBS"
LIBS="-l$x_direct_test_library $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 10353 "configure"
+#line 10337 "configure"
#include "confdefs.h"
int main() {
${x_direct_test_function}()
; return 0; }
EOF
-if { (eval echo configure:10360: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10344: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
LIBS="$ac_save_LIBS"
# We can link X programs with no special library path.
@@ -10570,7 +10554,7 @@ fi
# We only build gdbserver automatically if host and target are the same.
if test "x$target" = "x$host"; then
echo $ac_n "checking whether gdbserver is supported on this host""... $ac_c" 1>&6
-echo "configure:10574: checking whether gdbserver is supported on this host" >&5
+echo "configure:10558: checking whether gdbserver is supported on this host" >&5
if test "x$build_gdbserver" = xyes; then
configdirs="$configdirs gdbserver"
echo "$ac_t""yes" 1>&6
@@ -10634,12 +10618,12 @@ fi
echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:10638: checking for Cygwin environment" >&5
+echo "configure:10622: checking for Cygwin environment" >&5
if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 10643 "configure"
+#line 10627 "configure"
#include "confdefs.h"
int main() {
@@ -10650,7 +10634,7 @@ int main() {
return __CYGWIN__;
; return 0; }
EOF
-if { (eval echo configure:10654: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10638: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_cygwin=yes
else
@@ -10667,19 +10651,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6
CYGWIN=
test "$ac_cv_cygwin" = yes && CYGWIN=yes
echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
-echo "configure:10671: checking for mingw32 environment" >&5
+echo "configure:10655: checking for mingw32 environment" >&5
if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 10676 "configure"
+#line 10660 "configure"
#include "confdefs.h"
int main() {
return __MINGW32__;
; return 0; }
EOF
-if { (eval echo configure:10683: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10667: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_mingw32=yes
else
@@ -10698,7 +10682,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes
echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:10702: checking for executable suffix" >&5
+echo "configure:10686: checking for executable suffix" >&5
if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -10708,10 +10692,10 @@ else
rm -f conftest*
echo 'int main () { return 0; }' > conftest.$ac_ext
ac_cv_exeext=
- if { (eval echo configure:10712: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ if { (eval echo configure:10696: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
for file in conftest.*; do
case $file in
- *.c | *.C | *.o | *.obj | *.ilk | *.pdb) ;;
+ *.c | *.o | *.obj) ;;
*) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
esac
done
@@ -10750,7 +10734,7 @@ fi
echo $ac_n "checking for iconv""... $ac_c" 1>&6
-echo "configure:10754: checking for iconv" >&5
+echo "configure:10738: checking for iconv" >&5
if eval "test \"`echo '$''{'am_cv_func_iconv'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -10758,7 +10742,7 @@ else
am_cv_func_iconv="no, consider installing GNU libiconv"
am_cv_lib_iconv=no
cat > conftest.$ac_ext <<EOF
-#line 10762 "configure"
+#line 10746 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <iconv.h>
@@ -10768,7 +10752,7 @@ iconv_t cd = iconv_open("","");
iconv_close(cd);
; return 0; }
EOF
-if { (eval echo configure:10772: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10756: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
am_cv_func_iconv=yes
else
@@ -10780,7 +10764,7 @@ rm -f conftest*
am_save_LIBS="$LIBS"
LIBS="$LIBS -liconv"
cat > conftest.$ac_ext <<EOF
-#line 10784 "configure"
+#line 10768 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <iconv.h>
@@ -10790,7 +10774,7 @@ iconv_t cd = iconv_open("","");
iconv_close(cd);
; return 0; }
EOF
-if { (eval echo configure:10794: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10778: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
am_cv_lib_iconv=yes
am_cv_func_iconv=yes
@@ -10811,13 +10795,13 @@ echo "$ac_t""$am_cv_func_iconv" 1>&6
EOF
echo $ac_n "checking for iconv declaration""... $ac_c" 1>&6
-echo "configure:10815: checking for iconv declaration" >&5
+echo "configure:10799: checking for iconv declaration" >&5
if eval "test \"`echo '$''{'am_cv_proto_iconv'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 10821 "configure"
+#line 10805 "configure"
#include "confdefs.h"
#include <stdlib.h>
@@ -10836,7 +10820,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:10840: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10824: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
am_cv_proto_iconv_arg1=""
else
@@ -11056,8 +11040,6 @@ s%@TARGET_SYSTEM_ROOT@%$TARGET_SYSTEM_ROOT%g
s%@TARGET_SYSTEM_ROOT_DEFINE@%$TARGET_SYSTEM_ROOT_DEFINE%g
s%@WARN_CFLAGS@%$WARN_CFLAGS%g
s%@WERROR_CFLAGS@%$WERROR_CFLAGS%g
-s%@MMALLOC_CFLAGS@%$MMALLOC_CFLAGS%g
-s%@MMALLOC@%$MMALLOC%g
s%@SER_HARDWIRE@%$SER_HARDWIRE%g
s%@WIN32LIBS@%$WIN32LIBS%g
s%@LIBGUI@%$LIBGUI%g
diff --git a/gdb/configure.host b/gdb/configure.host
index 6f28482..668008b 100644
--- a/gdb/configure.host
+++ b/gdb/configure.host
@@ -51,9 +51,11 @@ hppa*-*-hpux*) gdb_host=hppahpux ;;
i[34567]86-ncr-*) gdb_host=ncr3000 ;;
i[34567]86-*-bsd*) gdb_host=i386bsd ;;
i[34567]86-*-dgux*) gdb_host=i386v4 ;;
+i[34567]86-*-freebsd* | i[34567]86-*-kfreebsd*-gnu)
+ gdb_host=fbsd ;;
+i[34567]86-*-netbsdelf* | i[34567]86-*-knetbsd*-gnu)
+ gdb_host=nbsdelf ;;
i[34567]86-*-freebsd*) gdb_host=fbsd ;;
-i[34567]86-*-netbsdelf*) gdb_host=nbsdelf ;;
-i[34567]86-*-netbsdaout*) gdb_host=nbsdaout ;;
i[34567]86-*-netbsd*) gdb_host=nbsdaout ;;
i[34567]86-*-go32*) gdb_host=go32 ;;
i[34567]86-*-msdosdjgpp*) gdb_host=go32 ;;
@@ -132,6 +134,8 @@ sparc-*-netbsdelf*) gdb_host=nbsdelf ;;
sparc-*-netbsdaout*) gdb_host=nbsdaout ;;
sparc-*-netbsd*) gdb_host=nbsdaout ;;
sparc64-*-netbsd*) gdb_host=nbsd64 ;;
+sparc-*-openbsd*) gdb_host=nbsdelf ;;
+sparc64-*-openbsd*) gdb_host=nbsd64 ;;
sparc-*-solaris2* | sparcv9-*-solaris2* | sparc64-*-solaris2*)
gdb_host=sol2
;;
diff --git a/gdb/configure.in b/gdb/configure.in
index 2ab32fe..46df629 100644
--- a/gdb/configure.in
+++ b/gdb/configure.in
@@ -1,5 +1,5 @@
dnl Autoconf configure script for GDB, the GNU debugger.
-dnl Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+dnl Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
dnl Free Software Foundation, Inc.
dnl
dnl This file is part of GDB.
@@ -623,7 +623,7 @@ if test "${target}" = "${host}"; then
*-*-unixware* | *-*-sysv4.2* | *-*-sysv5* | *-*-interix* )
AC_DEFINE(NEW_PROC_API)
;;
- *-*-solaris2.[[678]])
+ *-*-solaris2.[[6789]])
AC_DEFINE(NEW_PROC_API)
;;
esac
@@ -1024,9 +1024,10 @@ AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE)
# NOTE: If you add to this list, remember to update
# gdb/doc/gdbint.texinfo.
build_warnings="-Wimplicit -Wreturn-type -Wcomment -Wtrigraphs \
--Wformat -Wparentheses -Wpointer-arith -Wuninitialized -Wformat-nonliteral"
+-Wformat -Wparentheses -Wpointer-arith -Wuninitialized -Wformat-nonliteral \
+-Wunused-label"
# Up for debate: -Wswitch -Wcomment -trigraphs -Wtrigraphs
-# -Wunused-function -Wunused-label -Wunused-variable -Wunused-value
+# -Wunused-function -Wunused-variable -Wunused-value
# -Wchar-subscripts -Wtraditional -Wshadow -Wcast-qual
# -Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes
# -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls
@@ -1081,26 +1082,6 @@ fi
AC_SUBST(WARN_CFLAGS)
AC_SUBST(WERROR_CFLAGS)
-MMALLOC_CFLAGS=
-MMALLOC=
-AC_SUBST(MMALLOC_CFLAGS)
-AC_SUBST(MMALLOC)
-
-AC_ARG_WITH(mmalloc,
-[ --with-mmalloc Use memory mapped malloc package],
-[case "${withval}" in
- yes) want_mmalloc=true ;;
- no) want_mmalloc=false;;
- *) AC_MSG_ERROR(bad value ${withval} for GDB with-mmalloc option) ;;
-esac],[want_mmalloc=false])dnl
-
-if test x$want_mmalloc = xtrue; then
- AC_DEFINE(USE_MMALLOC)
- AC_DEFINE(MMCHECK_FORCE)
- MMALLOC_CFLAGS="-I$srcdir/../mmalloc"
- MMALLOC='../mmalloc/libmmalloc.a'
-fi
-
# In the Cygwin environment, we need some additional flags.
AC_CACHE_CHECK([for cygwin], gdb_cv_os_cygwin,
[AC_EGREP_CPP(lose, [
diff --git a/gdb/configure.tgt b/gdb/configure.tgt
index f974631..0d159d4 100644
--- a/gdb/configure.tgt
+++ b/gdb/configure.tgt
@@ -38,8 +38,7 @@ esac
case "${target}" in
x86_64-*-freebsd*) gdb_target=fbsd64 ;;
-*-*-freebsd*) gdb_target=fbsd
- ;;
+*-*-freebsd*) gdb_target=fbsd ;;
alpha*-*-osf*) gdb_target=alpha-osf1 ;;
alpha*-*-linux*) gdb_target=alpha-linux ;;
@@ -78,7 +77,8 @@ hppa*-*-*) gdb_target=hppa ;;
i[34567]86-ncr-*) gdb_target=ncr3000 ;;
i[34567]86-*-bsd*) gdb_target=i386bsd ;;
-i[34567]86-*-netbsd*) gdb_target=nbsd ;;
+i[34567]86-*-netbsd* | i[34567]86-*-knetbsd*-gnu)
+ gdb_target=nbsd ;;
i[34567]86-*-openbsd*) gdb_target=obsd ;;
i[34567]86-*-go32*) gdb_target=i386aout ;;
i[34567]86-*-msdosdjgpp*) gdb_target=go32 ;;
@@ -190,6 +190,10 @@ sparc-*-linux*) gdb_target=linux ;;
sparc64-*-linux*) gdb_target=linux64 ;;
sparc-*-netbsd*) gdb_target=nbsd ;;
sparc64-*-netbsd*) gdb_target=nbsd64 ;;
+sparc-*-openbsd*) gdb_target=obsd ;;
+sparc64-*-openbsd*) gdb_target=obsd64
+ gdb_osabi=GDB_OSABI_OPENBSD_ELF
+ ;;
sparc-*-solaris2.[0-6] | sparc-*-solaris2.[0-6].*)
gdb_target=sol2
;;
diff --git a/gdb/core-sol2.c b/gdb/core-sol2.c
deleted file mode 100644
index 456eebc..0000000
--- a/gdb/core-sol2.c
+++ /dev/null
@@ -1,198 +0,0 @@
-/* Machine independent support for Solaris 2 core files for GDB.
- Copyright 1994, 1995, 1996, 1998, 1999, 2000, 2001
- Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-
-/* Solaris comes with two flavours of core files, cores generated by
- an ELF executable and cores generated by programs that were
- run under BCP (the part of Solaris which allows it to run SunOS4
- a.out files).
- This file combines the core register fetching from core-regset.c
- and sparc-nat.c to be able to read both flavours. */
-
-#include "defs.h"
-
-#if defined (__sparcv9)
-/* Fails to get included by the Solaris system header files. */
-# include <v9/sys/privregs.h>
-#endif
-
-#include <time.h>
-#include <sys/types.h>
-#include <sys/regset.h>
-#include <sys/procfs.h>
-#include <fcntl.h>
-#include <errno.h>
-#include "gdb_string.h"
-#include "regcache.h"
-
-#include "inferior.h"
-#include "target.h"
-#include "command.h"
-#include "gdbcore.h"
-
-/* Prototypes for supply_gregset etc. */
-#include "gregset.h"
-
-static void fetch_core_registers (char *, unsigned, int, CORE_ADDR);
-
-/* Fetch registers from core file data pointed to by CORE_REG_SECT. When
- WHICH is 0, the the general register set is fetched; when WHICH is
- 2, the floating point registers are fetched. CORE_REG_SIZE is used
- to validate the size of the data pointed to by CORE_REG_SECT. REG_ADDR
- is unused. */
-
-static void
-fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which,
- CORE_ADDR reg_addr)
-{
- int i;
-
- if (which == 0)
- {
- prgregset_t prgregset;
-
- if (core_reg_size == sizeof (prgregset_t))
- {
- memcpy ((char *) &prgregset, core_reg_sect, sizeof (prgregset));
- supply_gregset (&prgregset);
- }
-#if defined (HAVE_PRGREGSET32_T)
- /* 32-bit corefile, 64-bit debugger. */
- else if (core_reg_size == sizeof (prgregset32_t))
- {
- prgreg32_t *core_gregs;
-
- /* Can't use memcpy here, because the core file contains
- 32-bit regs; supply_register expects 64-bit regs. */
- core_gregs = (prgreg32_t *) core_reg_sect;
- for (i = 0; i < NPRGREG; i++)
- prgregset[i] = core_gregs[i];
-
- supply_gregset (&prgregset);
- }
-#endif /* HAVE_PRGREGSET32_T */
- else if (core_reg_size == sizeof (struct regs))
- {
- struct regs *gregs = (struct regs *) core_reg_sect;
-
- /* G0 *always* holds 0. */
- *(int *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (0)] = 0;
-
- /* The globals and output registers. */
- memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (G1_REGNUM)],
- &gregs->r_g1, 15 * DEPRECATED_REGISTER_RAW_SIZE (G1_REGNUM));
- *(int *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (PS_REGNUM)]
- = gregs->r_ps;
- *(int *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (PC_REGNUM)]
- = gregs->r_pc;
- *(int *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (DEPRECATED_NPC_REGNUM)]
- = gregs->r_npc;
- *(int *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (Y_REGNUM)]
- = gregs->r_y;
-
- /* My best guess at where to get the locals and input
- registers is exactly where they usually are, right above
- the stack pointer. If the core dump was caused by a bus error
- from blowing away the stack pointer (as is possible) then this
- won't work, but it's worth the try. */
- {
- int sp;
-
- sp = *(int *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (SP_REGNUM)];
- if (0 != target_read_memory (sp,
- &deprecated_registers[DEPRECATED_REGISTER_BYTE (L0_REGNUM)],
- 16 * DEPRECATED_REGISTER_RAW_SIZE (L0_REGNUM)))
- {
- warning ("couldn't read input and local registers from core file\n");
- }
- }
- }
- else
- {
- warning ("wrong size gregset struct in core file");
- }
- }
- else if (which == 2)
- {
- prfpregset_t prfpregset;
-
- if (core_reg_size == sizeof (prfpregset_t))
- {
- memcpy ((char *) &prfpregset, core_reg_sect, sizeof (prfpregset));
- supply_fpregset (&prfpregset);
- }
-#if defined (HAVE_PRFPREGSET32_T)
- /* 32-bit corefile, 64-bit debugger. */
- else if (core_reg_size == sizeof (prfpregset32_t))
- {
- prfpregset32_t *core_fpregset;
-
- /* Can't use memcpy here, because the core file contains
- 32-bit regs; supply_fpregset expects 64-bit regs. */
-
- core_fpregset = (prfpregset32_t *) core_reg_sect;
- for (i = 0; i < 16; i++)
- prfpregset.pr_fr.pr_dregs[i] = core_fpregset->pr_fr.pr_dregs[i];
- while (i < 32)
- prfpregset.pr_fr.pr_dregs[i++] = 0;
-
- prfpregset.pr_fsr = core_fpregset->pr_fsr;
- prfpregset.pr_qcnt = core_fpregset->pr_qcnt;
- prfpregset.pr_q_entrysize = core_fpregset->pr_q_entrysize;
- prfpregset.pr_en = core_fpregset->pr_en;
- /* We will not use the pr_q array. */
-
- supply_fpregset (&prfpregset);
- }
-#endif /* HAVE_PRFPREGSET32_T */
- else if (core_reg_size >= sizeof (struct fpu))
- {
- struct fpu *fpuregs = (struct fpu *) core_reg_sect;
-
- memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)],
- &fpuregs->fpu_fr, sizeof (fpuregs->fpu_fr));
- memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FPS_REGNUM)],
- &fpuregs->fpu_fsr, sizeof (FPU_FSR_TYPE));
- }
- else
- {
- warning ("wrong size fpregset struct in core file");
- }
- }
-}
-
-
-/* Register that we are able to handle solaris core file formats. */
-
-static struct core_fns solaris_core_fns =
-{
- bfd_target_elf_flavour, /* core_flavour */
- default_check_format, /* check_format */
- default_core_sniffer, /* core_sniffer */
- fetch_core_registers, /* core_read_registers */
- NULL /* next */
-};
-
-void
-_initialize_core_solaris (void)
-{
- add_core_fns (&solaris_core_fns);
-}
diff --git a/gdb/corelow.c b/gdb/corelow.c
index 8fc3e66..d14b3a3 100644
--- a/gdb/corelow.c
+++ b/gdb/corelow.c
@@ -477,7 +477,7 @@ get_core_register_section (char *name,
}
gdb_assert (core_vec);
- core_vec->core_read_registers (contents, size, which,
+ core_vec->core_read_registers (contents, size, which,
((CORE_ADDR)
bfd_section_vma (core_bfd, section)));
}
@@ -515,6 +515,63 @@ core_files_info (struct target_ops *t)
print_section_info (t, core_bfd);
}
+static LONGEST
+core_xfer_partial (struct target_ops *ops, enum target_object object,
+ const char *annex, void *readbuf,
+ const void *writebuf, ULONGEST offset, LONGEST len)
+{
+ switch (object)
+ {
+ case TARGET_OBJECT_MEMORY:
+ if (readbuf)
+ return (*ops->to_xfer_memory) (offset, readbuf, len, 0/*write*/,
+ NULL, ops);
+ if (writebuf)
+ return (*ops->to_xfer_memory) (offset, readbuf, len, 1/*write*/,
+ NULL, ops);
+ return -1;
+
+ case TARGET_OBJECT_AUXV:
+ if (readbuf)
+ {
+ /* When the aux vector is stored in core file, BFD
+ represents this with a fake section called ".auxv". */
+
+ sec_ptr section;
+ bfd_size_type size;
+ char *contents;
+
+ section = bfd_get_section_by_name (core_bfd, ".auxv");
+ if (section == NULL)
+ return -1;
+
+ size = bfd_section_size (core_bfd, section);
+ if (offset >= size)
+ return 0;
+ size -= offset;
+ if (size > len)
+ size = len;
+ if (size > 0 &&
+ ! bfd_get_section_contents (core_bfd, section, readbuf,
+ (file_ptr) offset, size))
+ {
+ warning ("Couldn't read NT_AUXV note in core file.");
+ return -1;
+ }
+
+ return size;
+ }
+ return -1;
+
+ default:
+ if (ops->beneath != NULL)
+ return ops->beneath->to_xfer_partial (ops->beneath, object, annex,
+ readbuf, writebuf, offset, len);
+ return -1;
+ }
+}
+
+
/* If mourn is being called in all the right places, this could be say
`gdb internal error' (since generic_mourn calls breakpoint_init_inferior). */
@@ -551,6 +608,7 @@ init_core_ops (void)
core_ops.to_attach = find_default_attach;
core_ops.to_detach = core_detach;
core_ops.to_fetch_registers = get_core_registers;
+ core_ops.to_xfer_partial = core_xfer_partial;
core_ops.to_xfer_memory = xfer_memory;
core_ops.to_files_info = core_files_info;
core_ops.to_insert_breakpoint = ignore;
diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c
index a766acb..65d3ecc 100644
--- a/gdb/cp-namespace.c
+++ b/gdb/cp-namespace.c
@@ -31,10 +31,14 @@
#include "gdbtypes.h"
#include "dictionary.h"
#include "command.h"
+#include "frame.h"
-/* When set, the file that we're processing seems to have debugging
- info for C++ namespaces, so cp-namespace.c shouldn't try to guess
- namespace info itself. */
+/* When set, the file that we're processing is known to have debugging
+ info for C++ namespaces. */
+
+/* NOTE: carlton/2004-01-13: No currently released version of GCC (the
+ latest of which is 3.3.x at the time of this writing) produces this
+ debug info. GCC 3.4 should, however. */
unsigned char processing_has_namespace_info;
@@ -82,6 +86,10 @@ static struct symbol *lookup_symbol_file (const char *name,
struct symtab **symtab,
int anonymous_namespace);
+static struct type *cp_lookup_transparent_type_loop (const char *name,
+ const char *scope,
+ int scope_len);
+
static void initialize_namespace_symtab (struct objfile *objfile);
static struct block *get_possible_namespace_block (struct objfile *objfile);
@@ -222,12 +230,6 @@ cp_set_block_scope (const struct symbol *symbol,
if (SYMBOL_CPLUS_DEMANGLED_NAME (symbol) != NULL)
{
-#if 0
- /* FIXME: carlton/2003-06-12: As mentioned above,
- 'processing_has_namespace_info' currently isn't entirely
- reliable, so let's always use demangled names to get this
- information for now. */
-
if (processing_has_namespace_info)
{
block_set_scope
@@ -237,7 +239,6 @@ cp_set_block_scope (const struct symbol *symbol,
obstack);
}
else
-#endif
{
/* Try to figure out the appropriate namespace from the
demangled name. */
@@ -520,10 +521,6 @@ lookup_symbol_file (const char *name,
class or namespace given by PARENT_TYPE, from within the context
given by BLOCK. Return NULL if there is no such nested type. */
-/* FIXME: carlton/2003-09-24: For now, this only works for nested
- namespaces; the patch to make this work on other sorts of nested
- types is next on my TODO list. */
-
struct type *
cp_lookup_nested_type (struct type *parent_type,
const char *nested_name,
@@ -531,8 +528,16 @@ cp_lookup_nested_type (struct type *parent_type,
{
switch (TYPE_CODE (parent_type))
{
+ case TYPE_CODE_STRUCT:
case TYPE_CODE_NAMESPACE:
{
+ /* NOTE: carlton/2003-11-10: We don't treat C++ class members
+ of classes like, say, data or function members. Instead,
+ they're just represented by symbols whose names are
+ qualified by the name of the surrounding class. This is
+ just like members of namespaces; in particular,
+ lookup_symbol_namespace works when looking them up. */
+
const char *parent_name = TYPE_TAG_NAME (parent_type);
struct symbol *sym = cp_lookup_symbol_namespace (parent_name,
nested_name,
@@ -547,10 +552,78 @@ cp_lookup_nested_type (struct type *parent_type,
}
default:
internal_error (__FILE__, __LINE__,
- "cp_lookup_nested_type called on a non-namespace.");
+ "cp_lookup_nested_type called on a non-aggregate type.");
}
}
+/* The C++-version of lookup_transparent_type. */
+
+/* FIXME: carlton/2004-01-16: The problem that this is trying to
+ address is that, unfortunately, sometimes NAME is wrong: it may not
+ include the name of namespaces enclosing the type in question.
+ lookup_transparent_type gets called when the the type in question
+ is a declaration, and we're trying to find its definition; but, for
+ declarations, our type name deduction mechanism doesn't work.
+ There's nothing we can do to fix this in general, I think, in the
+ absence of debug information about namespaces (I've filed PR
+ gdb/1511 about this); until such debug information becomes more
+ prevalent, one heuristic which sometimes looks is to search for the
+ definition in namespaces containing the current namespace.
+
+ We should delete this functions once the appropriate debug
+ information becomes more widespread. (GCC 3.4 will be the first
+ released version of GCC with such information.) */
+
+struct type *
+cp_lookup_transparent_type (const char *name)
+{
+ /* First, try the honest way of looking up the definition. */
+ struct type *t = basic_lookup_transparent_type (name);
+ const char *scope;
+
+ if (t != NULL)
+ return t;
+
+ /* If that doesn't work and we're within a namespace, look there
+ instead. */
+ scope = block_scope (get_selected_block (0));
+
+ if (scope[0] == '\0')
+ return NULL;
+
+ return cp_lookup_transparent_type_loop (name, scope, 0);
+}
+
+/* Lookup the the type definition associated to NAME in
+ namespaces/classes containing SCOPE whose name is strictly longer
+ than LENGTH. LENGTH must be the index of the start of a
+ component of SCOPE. */
+
+static struct type *
+cp_lookup_transparent_type_loop (const char *name, const char *scope,
+ int length)
+{
+ int scope_length = cp_find_first_component (scope + length);
+ char *full_name;
+
+ /* If the current scope is followed by "::", look in the next
+ component. */
+ if (scope[scope_length] == ':')
+ {
+ struct type *retval
+ = cp_lookup_transparent_type_loop (name, scope, scope_length + 2);
+ if (retval != NULL)
+ return retval;
+ }
+
+ full_name = alloca (scope_length + 2 + strlen (name) + 1);
+ strncpy (full_name, scope, scope_length);
+ strncpy (full_name + scope_length, "::", 2);
+ strcpy (full_name + scope_length + 2, name);
+
+ return basic_lookup_transparent_type (full_name);
+}
+
/* Now come functions for dealing with symbols associated to
namespaces. (They're used to store the namespaces themselves, not
objects that live in the namespaces.) These symbols come in two
@@ -582,7 +655,7 @@ initialize_namespace_symtab (struct objfile *objfile)
namespace_symtab->free_code = free_nothing;
namespace_symtab->dirname = NULL;
- bv = obstack_alloc (&objfile->symbol_obstack,
+ bv = obstack_alloc (&objfile->objfile_obstack,
sizeof (struct blockvector)
+ FIRST_LOCAL_BLOCK * sizeof (struct block *));
BLOCKVECTOR_NBLOCKS (bv) = FIRST_LOCAL_BLOCK + 1;
@@ -590,12 +663,12 @@ initialize_namespace_symtab (struct objfile *objfile)
/* Allocate empty GLOBAL_BLOCK and STATIC_BLOCK. */
- bl = allocate_block (&objfile->symbol_obstack);
- BLOCK_DICT (bl) = dict_create_linear (&objfile->symbol_obstack,
+ bl = allocate_block (&objfile->objfile_obstack);
+ BLOCK_DICT (bl) = dict_create_linear (&objfile->objfile_obstack,
NULL);
BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK) = bl;
- bl = allocate_block (&objfile->symbol_obstack);
- BLOCK_DICT (bl) = dict_create_linear (&objfile->symbol_obstack,
+ bl = allocate_block (&objfile->objfile_obstack);
+ BLOCK_DICT (bl) = dict_create_linear (&objfile->objfile_obstack,
NULL);
BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK) = bl;
@@ -613,7 +686,7 @@ initialize_namespace_symtab (struct objfile *objfile)
having a symtab/block for this purpose seems like the best
solution for now. */
- bl = allocate_block (&objfile->symbol_obstack);
+ bl = allocate_block (&objfile->objfile_obstack);
BLOCK_DICT (bl) = dict_create_hashed_expandable ();
BLOCKVECTOR_BLOCK (bv, FIRST_LOCAL_BLOCK) = bl;
@@ -710,7 +783,7 @@ check_one_possible_namespace_symbol (const char *name, int len,
struct objfile *objfile)
{
struct block *block = get_possible_namespace_block (objfile);
- char *name_copy = obsavestring (name, len, &objfile->symbol_obstack);
+ char *name_copy = obsavestring (name, len, &objfile->objfile_obstack);
struct symbol *sym = lookup_block_symbol (block, name_copy, NULL,
VAR_DOMAIN);
@@ -720,7 +793,7 @@ check_one_possible_namespace_symbol (const char *name, int len,
name_copy, objfile);
TYPE_TAG_NAME (type) = TYPE_NAME (type);
- sym = obstack_alloc (&objfile->symbol_obstack, sizeof (struct symbol));
+ sym = obstack_alloc (&objfile->objfile_obstack, sizeof (struct symbol));
memset (sym, 0, sizeof (struct symbol));
SYMBOL_LANGUAGE (sym) = language_cplus;
SYMBOL_SET_NAMES (sym, name_copy, len, objfile);
@@ -734,7 +807,7 @@ check_one_possible_namespace_symbol (const char *name, int len,
}
else
{
- obstack_free (&objfile->symbol_obstack, name_copy);
+ obstack_free (&objfile->objfile_obstack, name_copy);
return 1;
}
diff --git a/gdb/cp-support.c b/gdb/cp-support.c
index 102e51b..1a21e1e 100644
--- a/gdb/cp-support.c
+++ b/gdb/cp-support.c
@@ -55,7 +55,15 @@ static struct symbol **sym_return_val;
static char *remove_params (const char *demangled_name);
-static void overload_list_add_symbol (struct symbol *sym, char *oload_name);
+static void overload_list_add_symbol (struct symbol *sym,
+ const char *oload_name);
+
+static void make_symbol_overload_list_using (const char *func_name,
+ const char *namespace);
+
+static void make_symbol_overload_list_qualified (const char *func_name);
+
+static void read_in_psymtabs (const char *oload_name);
/* The list of "maint cplus" commands. */
@@ -428,6 +436,34 @@ cp_entire_prefix_len (const char *name)
return previous_len;
}
+/* If FULL_NAME is the demangled name of a C++ function (including an
+ arg list, possibly including namespace/class qualifications),
+ return a new string containing only the function name (without the
+ arg list/class qualifications). Otherwise, return NULL. The
+ caller is responsible for freeing the memory in question. */
+
+char *
+cp_func_name (const char *full_name)
+{
+ const char *previous_component = full_name;
+ const char *next_component;
+
+ if (!full_name)
+ return NULL;
+
+ for (next_component = (previous_component
+ + cp_find_first_component (previous_component));
+ *next_component == ':';
+ next_component = (previous_component
+ + cp_find_first_component (previous_component)))
+ {
+ /* Skip '::'. */
+ previous_component = next_component + 2;
+ }
+
+ return remove_params (previous_component);
+}
+
/* Overload resolution functions. */
static char *
@@ -472,12 +508,12 @@ remove_params (const char *demangled_name)
return new_name;
}
-/* Test to see if the symbol specified by SYMNAME (which is already
- demangled for C++ symbols) matches SYM_TEXT in the first SYM_TEXT_LEN
- characters. If so, add it to the current completion list. */
+/* Test to see if SYM is a symbol that we haven't seen corresponding
+ to a function named OLOAD_NAME. If so, add it to the current
+ completion list. */
static void
-overload_list_add_symbol (struct symbol *sym, char *oload_name)
+overload_list_add_symbol (struct symbol *sym, const char *oload_name)
{
int newsize;
int i;
@@ -489,11 +525,12 @@ overload_list_add_symbol (struct symbol *sym, char *oload_name)
/* skip any symbols that we've already considered. */
for (i = 0; i < sym_return_val_index; ++i)
- if (!strcmp (DEPRECATED_SYMBOL_NAME (sym), DEPRECATED_SYMBOL_NAME (sym_return_val[i])))
+ if (strcmp (SYMBOL_LINKAGE_NAME (sym),
+ SYMBOL_LINKAGE_NAME (sym_return_val[i])) == 0)
return;
/* Get the demangled name without parameters */
- sym_name = remove_params (SYMBOL_DEMANGLED_NAME (sym));
+ sym_name = remove_params (SYMBOL_NATURAL_NAME (sym));
if (!sym_name)
return;
@@ -518,82 +555,108 @@ overload_list_add_symbol (struct symbol *sym, char *oload_name)
}
/* Return a null-terminated list of pointers to function symbols that
- * match name of the supplied symbol FSYM.
- * This is used in finding all overloaded instances of a function name.
- * This has been modified from make_symbol_completion_list. */
-
+ are named FUNC_NAME and are visible within NAMESPACE. */
struct symbol **
-make_symbol_overload_list (struct symbol *fsym)
+make_symbol_overload_list (const char *func_name,
+ const char *namespace)
{
- struct symbol *sym;
- struct symtab *s;
- struct partial_symtab *ps;
- struct objfile *objfile;
- struct block *b, *surrounding_static_block = 0;
- struct dict_iterator iter;
- /* The name we are completing on. */
- char *oload_name = NULL;
- /* Length of name. */
- int oload_name_len = 0;
+ struct cleanup *old_cleanups;
- /* Look for the symbol we are supposed to complete on. */
+ sym_return_val_size = 100;
+ sym_return_val_index = 0;
+ sym_return_val = xmalloc ((sym_return_val_size + 1) *
+ sizeof (struct symbol *));
+ sym_return_val[0] = NULL;
- oload_name = remove_params (SYMBOL_DEMANGLED_NAME (fsym));
- if (!oload_name)
- {
- sym_return_val_size = 1;
- sym_return_val = (struct symbol **) xmalloc (2 * sizeof (struct symbol *));
- sym_return_val[0] = fsym;
- sym_return_val[1] = NULL;
+ old_cleanups = make_cleanup (xfree, sym_return_val);
+
+ make_symbol_overload_list_using (func_name, namespace);
+
+ discard_cleanups (old_cleanups);
+
+ return sym_return_val;
+}
+
+/* This applies the using directives to add namespaces to search in,
+ and then searches for overloads in all of those namespaces. It
+ adds the symbols found to sym_return_val. Arguments are as in
+ make_symbol_overload_list. */
+
+static void
+make_symbol_overload_list_using (const char *func_name,
+ const char *namespace)
+{
+ const struct using_direct *current;
+
+ /* First, go through the using directives. If any of them apply,
+ look in the appropriate namespaces for new functions to match
+ on. */
- return sym_return_val;
+ for (current = block_using (get_selected_block (0));
+ current != NULL;
+ current = current->next)
+ {
+ if (strcmp (namespace, current->outer) == 0)
+ {
+ make_symbol_overload_list_using (func_name,
+ current->inner);
+ }
}
- oload_name_len = strlen (oload_name);
- sym_return_val_size = 100;
- sym_return_val_index = 0;
- sym_return_val = (struct symbol **) xmalloc ((sym_return_val_size + 1) * sizeof (struct symbol *));
- sym_return_val[0] = NULL;
+ /* Now, add names for this namespace. */
+
+ if (namespace[0] == '\0')
+ {
+ make_symbol_overload_list_qualified (func_name);
+ }
+ else
+ {
+ char *concatenated_name
+ = alloca (strlen (namespace) + 2 + strlen (func_name) + 1);
+ strcpy (concatenated_name, namespace);
+ strcat (concatenated_name, "::");
+ strcat (concatenated_name, func_name);
+ make_symbol_overload_list_qualified (concatenated_name);
+ }
+}
- /* Read in all partial symtabs containing a partial symbol named
- OLOAD_NAME. */
+/* This does the bulk of the work of finding overloaded symbols.
+ FUNC_NAME is the name of the overloaded function we're looking for
+ (possibly including namespace info). */
- ALL_PSYMTABS (objfile, ps)
- {
- struct partial_symbol **psym;
+static void
+make_symbol_overload_list_qualified (const char *func_name)
+{
+ struct symbol *sym;
+ struct symtab *s;
+ struct objfile *objfile;
+ const struct block *b, *surrounding_static_block = 0;
+ struct dict_iterator iter;
+ const struct dictionary *dict;
- /* If the psymtab's been read in we'll get it when we search
- through the blockvector. */
- if (ps->readin)
- continue;
+ /* Look through the partial symtabs for all symbols which begin
+ by matching FUNC_NAME. Make sure we read that symbol table in. */
- if ((lookup_partial_symbol (ps, oload_name, NULL, 1, VAR_DOMAIN)
- != NULL)
- || (lookup_partial_symbol (ps, oload_name, NULL, 0, VAR_DOMAIN)
- != NULL))
- PSYMTAB_TO_SYMTAB (ps);
- }
+ read_in_psymtabs (func_name);
/* Search upwards from currently selected frame (so that we can
complete on local vars. */
for (b = get_selected_block (0); b != NULL; b = BLOCK_SUPERBLOCK (b))
{
- if (!BLOCK_SUPERBLOCK (b))
- {
- surrounding_static_block = b; /* For elimination of dups */
- }
+ dict = BLOCK_DICT (b);
- /* Also catch fields of types defined in this places which match our
- text string. Only complete on types visible from current context. */
-
- ALL_BLOCK_SYMBOLS (b, iter, sym)
+ for (sym = dict_iter_name_first (dict, func_name, &iter);
+ sym;
+ sym = dict_iter_name_next (func_name, &iter))
{
- overload_list_add_symbol (sym, oload_name);
+ overload_list_add_symbol (sym, func_name);
}
}
+ surrounding_static_block = block_static_block (get_selected_block (0));
+
/* Go through the symtabs and check the externs and statics for
symbols which match. */
@@ -601,10 +664,14 @@ make_symbol_overload_list (struct symbol *fsym)
{
QUIT;
b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), GLOBAL_BLOCK);
- ALL_BLOCK_SYMBOLS (b, iter, sym)
- {
- overload_list_add_symbol (sym, oload_name);
- }
+ dict = BLOCK_DICT (b);
+
+ for (sym = dict_iter_name_first (dict, func_name, &iter);
+ sym;
+ sym = dict_iter_name_next (func_name, &iter))
+ {
+ overload_list_add_symbol (sym, func_name);
+ }
}
ALL_SYMTABS (objfile, s)
@@ -614,15 +681,37 @@ make_symbol_overload_list (struct symbol *fsym)
/* Don't do this block twice. */
if (b == surrounding_static_block)
continue;
- ALL_BLOCK_SYMBOLS (b, iter, sym)
- {
- overload_list_add_symbol (sym, oload_name);
- }
+ dict = BLOCK_DICT (b);
+
+ for (sym = dict_iter_name_first (dict, func_name, &iter);
+ sym;
+ sym = dict_iter_name_next (func_name, &iter))
+ {
+ overload_list_add_symbol (sym, func_name);
+ }
}
+}
- xfree (oload_name);
+/* Look through the partial symtabs for all symbols which begin
+ by matching FUNC_NAME. Make sure we read that symbol table in. */
- return (sym_return_val);
+static void
+read_in_psymtabs (const char *func_name)
+{
+ struct partial_symtab *ps;
+ struct objfile *objfile;
+
+ ALL_PSYMTABS (objfile, ps)
+ {
+ if (ps->readin)
+ continue;
+
+ if ((lookup_partial_symbol (ps, func_name, NULL, 1, VAR_DOMAIN)
+ != NULL)
+ || (lookup_partial_symbol (ps, func_name, NULL, 0, VAR_DOMAIN)
+ != NULL))
+ psymtab_to_symtab (ps);
+ }
}
/* Lookup the rtti type for a class name. */
diff --git a/gdb/cp-support.h b/gdb/cp-support.h
index 956dac8..f0172ca 100644
--- a/gdb/cp-support.h
+++ b/gdb/cp-support.h
@@ -64,7 +64,10 @@ extern unsigned int cp_find_first_component (const char *name);
extern unsigned int cp_entire_prefix_len (const char *name);
-extern struct symbol **make_symbol_overload_list (struct symbol *);
+extern char *cp_func_name (const char *full_name);
+
+extern struct symbol **make_symbol_overload_list (const char *,
+ const char *);
extern struct type *cp_lookup_rtti_type (const char *name,
struct block *block);
@@ -112,6 +115,8 @@ extern struct type *cp_lookup_nested_type (struct type *parent_type,
extern void cp_check_possible_namespace_symbols (const char *name,
struct objfile *objfile);
+struct type *cp_lookup_transparent_type (const char *name);
+
/* Functions from cp-names.y. */
extern struct demangle_component *demangled_name_to_comp
diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c
index 6c5483b..6ef3b05 100644
--- a/gdb/cris-tdep.c
+++ b/gdb/cris-tdep.c
@@ -1,5 +1,7 @@
/* Target dependent code for CRIS, for GDB, the GNU debugger.
- Copyright 2001, 2002, 2003 Free Software Foundation, Inc.
+
+ Copyright 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+
Contributed by Axis Communications AB.
Written by Hendrik Ruijter, Stefan Andersson, and Orjan Friberg.
@@ -176,9 +178,6 @@ cris_abi (void)
return (gdbarch_tdep (current_gdbarch)->cris_abi);
}
-/* For saving call-clobbered contents in R9 when returning structs. */
-static CORE_ADDR struct_return_address;
-
struct frame_extra_info
{
CORE_ADDR return_pc;
@@ -1078,26 +1077,14 @@ cris_abi_v2_extract_return_value (struct type *type, char *regbuf,
}
/* Store the address of the place in which to copy the structure the
- subroutine will return. In the CRIS ABI, R9 is used in order to pass
- the address of the allocated area where a structure return value must
- be stored. R9 is call-clobbered, which means we must save it here for
- later use. */
+ subroutine will return. In the CRIS ABI, R9 is used in order to
+ pass the address of the allocated area where a structure return
+ value must be stored. */
static void
cris_store_struct_return (CORE_ADDR addr, CORE_ADDR sp)
{
write_register (STR_REGNUM, addr);
- struct_return_address = addr;
-}
-
-/* Extract from regbuf the address where a function should return a
- structure value. It's not there in the CRIS ABI, so we must do it another
- way. */
-
-static CORE_ADDR
-cris_extract_struct_value_address (char *regbuf)
-{
- return struct_return_address;
}
/* Returns 1 if the given type will be passed by pointer rather than
@@ -4267,8 +4254,6 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_deprecated_pop_frame (gdbarch, cris_pop_frame);
set_gdbarch_deprecated_store_struct_return (gdbarch, cris_store_struct_return);
- set_gdbarch_deprecated_extract_struct_value_address
- (gdbarch, cris_extract_struct_value_address);
set_gdbarch_use_struct_convention (gdbarch, always_use_struct_convention);
set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, cris_frame_init_saved_regs);
@@ -4281,13 +4266,6 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_breakpoint_from_pc (gdbarch, cris_breakpoint_from_pc);
- /* The PC must not be decremented after a breakpoint. (The breakpoint
- handler takes care of that.) */
- set_gdbarch_decr_pc_after_break (gdbarch, 0);
-
- /* Offset from address of function to start of its code. */
- set_gdbarch_function_start_offset (gdbarch, 0);
-
/* The number of bytes at the start of arglist that are not really args,
0 in the CRIS ABI. */
set_gdbarch_frame_args_skip (gdbarch, 0);
diff --git a/gdb/d10v-tdep.c b/gdb/d10v-tdep.c
index 6ad5ed5..b4eb2bb 100644
--- a/gdb/d10v-tdep.c
+++ b/gdb/d10v-tdep.c
@@ -293,12 +293,6 @@ d10v_register_type (struct gdbarch *gdbarch, int reg_nr)
}
static int
-d10v_daddr_p (CORE_ADDR x)
-{
- return (((x) & 0x3000000) == DMEM_START);
-}
-
-static int
d10v_iaddr_p (CORE_ADDR x)
{
return (((x) & 0x3000000) == IMEM_START);
@@ -1516,7 +1510,6 @@ d10v_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_skip_prologue (gdbarch, d10v_skip_prologue);
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
set_gdbarch_decr_pc_after_break (gdbarch, 4);
- set_gdbarch_function_start_offset (gdbarch, 0);
set_gdbarch_breakpoint_from_pc (gdbarch, d10v_breakpoint_from_pc);
set_gdbarch_remote_translate_xfer_address (gdbarch,
diff --git a/gdb/dbxread.c b/gdb/dbxread.c
index 62a583f..c1f7f8c 100644
--- a/gdb/dbxread.c
+++ b/gdb/dbxread.c
@@ -651,14 +651,13 @@ dbx_symfile_init (struct objfile *objfile)
DBX_SYMCOUNT (objfile) = bfd_get_symcount (sym_bfd);
DBX_SYMTAB_OFFSET (objfile) = SYMBOL_TABLE_OFFSET;
- /* Read the string table and stash it away in the psymbol_obstack. It is
- only needed as long as we need to expand psymbols into full symbols,
- so when we blow away the psymbol the string table goes away as well.
+ /* Read the string table and stash it away in the objfile_obstack.
+ When we blow away the objfile the string table goes away as well.
Note that gdb used to use the results of attempting to malloc the
string table, based on the size it read, as a form of sanity check
for botched byte swapping, on the theory that a byte swapped string
table size would be so totally bogus that the malloc would fail. Now
- that we put in on the psymbol_obstack, we can't do this since gdb gets
+ that we put in on the objfile_obstack, we can't do this since gdb gets
a fatal error (out of virtual memory) if the size is bogus. We can
however at least check to see if the size is less than the size of
the size field itself, or larger than the size of the entire file.
@@ -710,7 +709,7 @@ dbx_symfile_init (struct objfile *objfile)
DBX_STRINGTAB_SIZE (objfile));
DBX_STRINGTAB (objfile) =
- (char *) obstack_alloc (&objfile->psymbol_obstack,
+ (char *) obstack_alloc (&objfile->objfile_obstack,
DBX_STRINGTAB_SIZE (objfile));
OBJSTAT (objfile, sz_strtab += DBX_STRINGTAB_SIZE (objfile));
@@ -2147,7 +2146,7 @@ start_psymtab (struct objfile *objfile, char *filename, CORE_ADDR textlow,
filename, textlow, global_syms, static_syms);
result->read_symtab_private = (char *)
- obstack_alloc (&objfile->psymbol_obstack, sizeof (struct symloc));
+ obstack_alloc (&objfile->objfile_obstack, sizeof (struct symloc));
LDSYMOFF (result) = ldsymoff;
result->read_symtab = dbx_psymtab_to_symtab;
SYMBOL_SIZE (result) = symbol_size;
@@ -2269,7 +2268,7 @@ end_psymtab (struct partial_symtab *pst, char **include_list, int num_includes,
if (number_dependencies)
{
pst->dependencies = (struct partial_symtab **)
- obstack_alloc (&objfile->psymbol_obstack,
+ obstack_alloc (&objfile->objfile_obstack,
number_dependencies * sizeof (struct partial_symtab *));
memcpy (pst->dependencies, dependency_list,
number_dependencies * sizeof (struct partial_symtab *));
@@ -2285,7 +2284,7 @@ end_psymtab (struct partial_symtab *pst, char **include_list, int num_includes,
/* Copy the sesction_offsets array from the main psymtab. */
subpst->section_offsets = pst->section_offsets;
subpst->read_symtab_private =
- (char *) obstack_alloc (&objfile->psymbol_obstack,
+ (char *) obstack_alloc (&objfile->objfile_obstack,
sizeof (struct symloc));
LDSYMOFF (subpst) =
LDSYMLEN (subpst) =
@@ -2295,7 +2294,7 @@ end_psymtab (struct partial_symtab *pst, char **include_list, int num_includes,
/* We could save slight bits of space by only making one of these,
shared by the entire set of include files. FIXME-someday. */
subpst->dependencies = (struct partial_symtab **)
- obstack_alloc (&objfile->psymbol_obstack,
+ obstack_alloc (&objfile->objfile_obstack,
sizeof (struct partial_symtab *));
subpst->dependencies[0] = pst;
subpst->number_of_dependencies = 1;
@@ -3344,7 +3343,7 @@ coffstab_build_psymtabs (struct objfile *objfile, int mainline,
if (stabstrsize > bfd_get_size (sym_bfd))
error ("ridiculous string table size: %d bytes", stabstrsize);
DBX_STRINGTAB (objfile) = (char *)
- obstack_alloc (&objfile->psymbol_obstack, stabstrsize + 1);
+ obstack_alloc (&objfile->objfile_obstack, stabstrsize + 1);
OBJSTAT (objfile, sz_strtab += stabstrsize + 1);
/* Now read in the string table in one big gulp. */
@@ -3442,7 +3441,7 @@ elfstab_build_psymtabs (struct objfile *objfile, int mainline,
if (stabstrsize > bfd_get_size (sym_bfd))
error ("ridiculous string table size: %d bytes", stabstrsize);
DBX_STRINGTAB (objfile) = (char *)
- obstack_alloc (&objfile->psymbol_obstack, stabstrsize + 1);
+ obstack_alloc (&objfile->objfile_obstack, stabstrsize + 1);
OBJSTAT (objfile, sz_strtab += stabstrsize + 1);
/* Now read in the string table in one big gulp. */
@@ -3536,7 +3535,7 @@ stabsect_build_psymtabs (struct objfile *objfile, int mainline, char *stab_name,
if (DBX_STRINGTAB_SIZE (objfile) > bfd_get_size (sym_bfd))
error ("ridiculous string table size: %d bytes", DBX_STRINGTAB_SIZE (objfile));
DBX_STRINGTAB (objfile) = (char *)
- obstack_alloc (&objfile->psymbol_obstack, DBX_STRINGTAB_SIZE (objfile) + 1);
+ obstack_alloc (&objfile->objfile_obstack, DBX_STRINGTAB_SIZE (objfile) + 1);
OBJSTAT (objfile, sz_strtab += DBX_STRINGTAB_SIZE (objfile) + 1);
/* Now read in the string table in one big gulp. */
diff --git a/gdb/defs.h b/gdb/defs.h
index 443ad6b..0702bba 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -1,7 +1,7 @@
/* *INDENT-OFF* */ /* ATTR_FORMAT confuses indent, avoid running it for now */
/* Basic, host-specific, and target-specific definitions for GDB.
Copyright 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
- 1997, 1998, 1999, 2000, 2001, 2002, 2003
+ 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
This file is part of GDB.
@@ -324,10 +324,11 @@ struct cleanup
struct symtab;
struct breakpoint;
+struct frame_info;
/* From blockframe.c */
-extern int inside_entry_func (CORE_ADDR);
+extern int inside_entry_func (struct frame_info *this_frame);
extern int deprecated_inside_entry_file (CORE_ADDR addr);
@@ -444,12 +445,12 @@ extern struct ui_file *gdb_stdin;
/* Serious error notifications */
extern struct ui_file *gdb_stderr;
/* Log/debug/trace messages that should bypass normal stdout/stderr
- filtering. For momement, always call this stream using
+ filtering. For moment, always call this stream using
*_unfiltered. In the very near future that restriction shall be
removed - either call shall be unfiltered. (cagney 1999-06-13). */
extern struct ui_file *gdb_stdlog;
/* Target output that should bypass normal stdout/stderr filtering.
- For momement, always call this stream using *_unfiltered. In the
+ For moment, always call this stream using *_unfiltered. In the
very near future that restriction shall be removed - either call
shall be unfiltered. (cagney 1999-07-02). */
extern struct ui_file *gdb_stdtarg;
@@ -656,8 +657,6 @@ enum lval_type
lval_reg_frame_relative
};
-struct frame_info;
-
/* Control types for commands */
enum misc_command_type
@@ -911,6 +910,8 @@ extern NORETURN void verror (const char *fmt, va_list ap) ATTR_NORETURN;
extern NORETURN void error (const char *fmt, ...) ATTR_NORETURN ATTR_FORMAT (printf, 1, 2);
+extern NORETURN void error_silent (const char *fmt, ...) ATTR_NORETURN ATTR_FORMAT (printf, 1, 2);
+
extern NORETURN void error_stream (struct ui_file *) ATTR_NORETURN;
/* Initialize the error buffer. */
@@ -920,6 +921,9 @@ extern void error_init (void);
message. */
extern char *error_last_message (void);
+/* Output arbitrary error message. */
+extern void error_output_message (char *pre_print, char *msg);
+
extern NORETURN void internal_verror (const char *file, int line,
const char *, va_list ap) ATTR_NORETURN;
@@ -982,6 +986,11 @@ extern NORETURN void throw_exception (enum return_reason) ATTR_NORETURN;
new cleanup_chain is established. The old values are restored
before catch_exceptions() returns.
+ The variant catch_exceptions_with_msg() is the same as
+ catch_exceptions() but adds the ability to return an allocated
+ copy of the gdb error message. This is used when a silent error is
+ issued and the caller wants to manually issue the error message.
+
FIXME; cagney/2001-08-13: The need to override the global UIOUT
builder variable should just go away.
@@ -994,6 +1003,11 @@ typedef int (catch_exceptions_ftype) (struct ui_out *ui_out, void *args);
extern int catch_exceptions (struct ui_out *uiout,
catch_exceptions_ftype *func, void *func_args,
char *errstring, return_mask mask);
+extern int catch_exceptions_with_msg (struct ui_out *uiout,
+ catch_exceptions_ftype *func,
+ void *func_args,
+ char *errstring, char **gdberrmsg,
+ return_mask mask);
/* If CATCH_ERRORS_FTYPE throws an error, catch_errors() returns zero
otherwize the result from CATCH_ERRORS_FTYPE is returned. It is
@@ -1034,6 +1048,7 @@ enum gdb_osabi
GDB_OSABI_FREEBSD_ELF,
GDB_OSABI_NETBSD_AOUT,
GDB_OSABI_NETBSD_ELF,
+ GDB_OSABI_OPENBSD_ELF,
GDB_OSABI_WINCE,
GDB_OSABI_GO32,
GDB_OSABI_NETWARE,
diff --git a/gdb/dink32-rom.c b/gdb/dink32-rom.c
index 3b10c7c..4a68140 100644
--- a/gdb/dink32-rom.c
+++ b/gdb/dink32-rom.c
@@ -96,19 +96,6 @@ dink32_supply_register (char *regname, int regnamelen, char *val, int vallen)
monitor_supply_register (regno, val);
}
-static void
-dink32_load (struct monitor_ops *monops, char *filename, int from_tty)
-{
- generic_load (filename, from_tty);
-
- /* Finally, make the PC point at the start address */
- if (exec_bfd)
- write_pc (bfd_get_start_address (exec_bfd));
-
- inferior_ptid = null_ptid; /* No process now */
-}
-
-
/* This array of registers needs to match the indexes used by GDB. The
whole reason this exists is because the various ROM monitors use
different names than GDB does, and don't support all the registers
@@ -172,9 +159,6 @@ _initialize_dink32_rom (void)
/* S-record download, via "keyboard port". */
dink32_cmds.load = "dl -k\r";
dink32_cmds.loadresp = "Set Input Port : set to Keyboard Port\r";
-#if 0 /* slow load routine not needed if S-records work... */
- dink32_cmds.load_routine = dink32_load;
-#endif
dink32_cmds.prompt = "DINK32_603 >>";
dink32_cmds.line_term = "\r";
dink32_cmds.target = &dink32_ops;
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index 6d8feda..6516237 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,3 +1,69 @@
+2004-02-06 Michael Chastain <mec.gnu@mindspring.com>
+
+ * gdb.texinfo (Auxiliary Vector): Fix thinko with @value{GDBN}.
+
+2004-02-04 Roland McGrath <roland@redhat.com>
+
+ * gdb.texinfo (Auxiliary Vector): New node (section).
+ (Data): Add it to the menu.
+
+2004-02-02 Jeff Johnston <jjohnstn@redhat.com>
+
+ * gdb.texinfo (Breakpoints): Add information about pending
+ breakpoint support.
+
+2004-01-26 Andrew Cagney <cagney@redhat.com>
+
+ * gdb.texinfo (Overview): Delete references to the cisco protocol
+ including the "N" response.
+
+2004-01-26 Andrew Cagney <cagney@redhat.com>
+
+ * gdbint.texinfo (Target Architecture Definition): Rename
+ EXTRACT_STRUCT_VALUE_ADDRESS to
+ DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS.
+
+2004-01-24 Eli Zaretskii <eliz@gnu.org>
+
+ * gdb.texinfo (KOD): Document "show os". Add index entries for
+ "set/show os" and "info cisco" commands.
+
+2004-01-21 Eli Zaretskii <eliz@gnu.org>
+
+ * Makefile.in (install-info): Prepend $(DESTDIR) to $(infodir).
+
+2004-01-19 Michael Chastain <mec.gnu@mindspring.com>
+
+ * gdbint.texinfo: Delete USE_MMALLOC, NO_MMCHECK, MMCHECK_FORCE,
+ MMAP_BASE_ADDRESS, MMAP_INCREMENT.
+
+2004-01-19 Nick Roberts <nick@nick.uklinux.net>
+
+ * gdb.texinfo (GDB/MI Stack Manipulation): Describe extension to
+ -stack-list-locals.
+ (GDB/MI Variable Objects): Describe extension to
+ -var-list-children.
+
+2004-01-17 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdbint.texinfo (DECR_PC_AFTER_HW_BREAK): Don't document.
+
+2004-01-17 Andrew Cagney <cagney@redhat.com>
+
+ * gdbint.texinfo (Target Architecture Definition): Delete
+ documentation on DEPRECATED_NPC_REGNUM.
+
+2004-01-13 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdb.texinfo: Update copyright year. Mention that set
+ follow-fork-mode is supported on GNU/Linux. Remove documentation of
+ "set follow-fork-mode ask".
+
+2004-01-13 Andrew Cagney <cagney@redhat.com>
+
+ * gdbint.texinfo: Update copyright year.
+ (Coding): Add -Wunused-label to list of -Werror warnings.
+
2004-01-08 Jason Molenda <jmolenda@apple.com>
Eli Zaretskii <eliz@is.elta.co.il>
@@ -56,7 +122,7 @@
* gdb.texinfo (M32R/D): Mention m32rsdi target.
-2003-10-15 Kevin Buettner <kevinb@redhat.com>
+2003-10-15 Kevin Buettner <kevinb@redhat.com>
From Anthony Green <green@redhat.com>:
* gdb.texinfo (Breakpoints related warnings): Insert into menu.
@@ -65,7 +131,7 @@
* gdb.texinfo (Breakpoint related warnings): New node.
* gdbint.texinfo (ADJUST_BREAKPOINT_ADDRESS): Document.
-
+
2003-10-13 Daniel Jacobowitz <drow@mvista.com>
* gdb.texinfo (Remote Protocol): Document v and vCont.
@@ -97,7 +163,7 @@
2003-09-30 Andrew Cagney <cagney@redhat.com>
REGISTER_VIRTUAL_SIZE to DEPRECATED_REGISTER_VIRTUAL_SIZE.
- (Target Architecture Definition):
+ (Target Architecture Definition):
* gdbint.texinfo (Target Architecture Definition): Rename
REGISTER_VIRTUAL_TYPE to DEPRECATED_REGISTER_VIRTUAL_TYPE.
@@ -110,7 +176,7 @@
* gdbint.texinfo (Target Architecture Definition): Rename
NPC_REGNUM to DEPRECATED_NPC_REGNUM. Add cross reference to
TARGET_WRITE_PC.
-
+
2003-09-22 Michael Chastain <mec@shout.net>
* gdbint.texinfo (Testsuite Organization): Change gdb.c++ to gdb.cp.
@@ -384,7 +450,7 @@
2003-04-02 Bob Rossi <bob_rossi@cox.net>
- * gdb.texinfo (GDB/MI Program Control): Add
+ * gdb.texinfo (GDB/MI Program Control): Add
'-file-list-exec-source-file'
2003-03-31 Andrew Cagney <cagney@redhat.com>
@@ -396,7 +462,7 @@
* gdbint.texinfo (Target Architecture Definition): Remove
reference to TARGET_WRITE_SP.
-
+
2003-03-27 Andrew Cagney <cagney@redhat.com>
* gdbint.texinfo (Target Architecture Definition): Remove
@@ -457,7 +523,7 @@
* gdbint.texinfo (Target Architecture Definition): Rename
FRAME_SAVED_PC to DEPRECATED_FRAME_SAVED_PC.
-
+
2003-03-10 Corinna Vinschen <vinschen@redhat.com>
* gdb.texinfo: Add File-I/O documentation.
@@ -879,7 +945,7 @@
2002-08-08 Grace Sainsbury <graces@redhat.com>
- From Mark Salter:
+ From Mark Salter:
* gdb.texinfo (Protocol): Document T packet extension to
allow watchpoint address reporting.
@@ -1037,7 +1103,7 @@
From Eli Zaretskii <eliz@is.elta.co.il>
* gdb.texinfo (show max-user-call-depth): Correct formatting.
- Provide a better explaination of this feature.
+ Provide a better explaination of this feature.
2002-04-14 Andrew Cagney <ac131313@redhat.com>
@@ -1078,7 +1144,7 @@
* gdb.texinfo: Change all examples to @smallexample.
* gdbint.texinfo: Ditto.
-
+
2002-03-18 Andrew Cagney <ac131313@redhat.com>
* gdbint.texinfo (Releasing GDB): Add section ``Versions and
@@ -1320,7 +1386,7 @@ Tue Jan 22 11:57:38 2002 Andrew Cagney <cagney@redhat.com>
* gdb.texinfo (maint info sections): Document.
- * gdb.texinfo (info proc): Comment out documentation for
+ * gdb.texinfo (info proc): Comment out documentation for
'info proc' sub-options that are currently not implemented.
2001-12-20 Jim Blandy <jimb@redhat.com>
@@ -1382,7 +1448,7 @@ Tue Jan 22 11:57:38 2002 Andrew Cagney <cagney@redhat.com>
2001-11-05 Michael Snyder <msnyder@redhat.com>
- * gdb.texinfo (info functions): Document use of backslash to
+ * gdb.texinfo (info functions): Document use of backslash to
quote regexp chars in function names such as "operator*()".
2001-11-01 Fred Fish <fnf@redhat.com>
@@ -1448,7 +1514,7 @@ Wed Aug 15 10:47:28 2001 Christopher Faylor <cgf@cygnus.com>
* gdbint.texinfo: Add a cautionary note about macro use.
2001-08-02 Corinna Vinschen <vinschen@redhat.com>
-
+
* gdb.texinfo: Explain omitting the hostname in the
`target remote' command.
@@ -1837,10 +1903,10 @@ Tue Mar 28 18:28:45 2000 Andrew Cagney <cagney@b1.cygnus.com>
* gdb.texinfo (Protocol): Replace ``qfThreadExtraInfo'' with
qThreadExtraInfo.
-2000-03-28 J.T. Conklin <jtc@redback.com>
+2000-03-28 J.T. Conklin <jtc@redback.com>
- * gdb.texinfo: Clarify which remote debug protocol commands are
- required and which are optional.
+ * gdb.texinfo: Clarify which remote debug protocol commands are
+ required and which are optional.
Tue Mar 28 16:06:22 2000 Andrew Cagney <cagney@b1.cygnus.com>
@@ -1874,9 +1940,9 @@ Fri Mar 24 18:06:34 2000 Andrew Cagney <cagney@b1.cygnus.com>
* gdb.texinfo: Check for @ifinfo instead of @ifnottex.
(rluser.texinfo, inc-hist.texinfo, annotate.texi): Add local
@chapter and @node entries.
-
+
* gdb.texinfo: Link all top-level nodes.
-
+
Fri Mar 24 17:56:48 2000 Andrew Cagney <cagney@b1.cygnus.com>
* Makefile.in (install-info): Create $(infodir) before installing
@@ -1897,7 +1963,7 @@ Fri Mar 24 17:56:48 2000 Andrew Cagney <cagney@b1.cygnus.com>
2000-03-20 Michael Snyder <msnyder@cleaver.cygnus.com>
- * gdb.texinfo: Add white space to prevent overprinting in
+ * gdb.texinfo: Add white space to prevent overprinting in
two places.
2000-03-17 Stan Shebs <shebs@apple.com>
@@ -2067,8 +2133,8 @@ Wed Aug 11 13:18:14 1999 Andrew Cagney <cagney@amy.cygnus.com>
1999-08-10 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
- * Makefile.in: Rename inc-hist.texi to inc-hist.texinfo.
- * gdb.texinfo: Ditto.
+ * Makefile.in: Rename inc-hist.texi to inc-hist.texinfo.
+ * gdb.texinfo: Ditto.
1999-08-06 Tom Tromey <tromey@cygnus.com>
@@ -2173,7 +2239,7 @@ Tue Apr 20 11:59:38 1999 Andrew Cagney <cagney@b1.cygnus.com>
LITTLE_BREAKPOINT, LITTLE_REMOTE_BREAKPOINT,
BIG_REMOTE_BREAKPOINT): Deprecate in favor of REGISTER_NAME and
BREAKPOINT_FROM_PC.
-
+
Mon Apr 12 16:00:44 1999 Andrew Cagney <cagney@b1.cygnus.com>
* gdbint.texinfo (CALL_DUMMY_STACK_ADJUST_P,
@@ -2229,14 +2295,14 @@ Thu Jan 14 17:10:12 1999 Stan Shebs <shebs@andros.cygnus.com>
Wed Jan 13 10:38:40 1999 Edith Epstein <eepstein@sophia.cygnus.com>
- * gdb.texinfo: Changes made as part of a project to merge in
- changes made by HP. Documentation makes extensive use of
+ * gdb.texinfo: Changes made as part of a project to merge in
+ changes made by HP. Documentation makes extensive use of
@ifclear HPPA and @ifset HPPA. The HP manual omits doumentation
on remote debugging. There are differences in documentation
(HP vs. non-HP) on C++ support (aCC vs. gnu gcc++). Also,
the HP manual discusses catchpoints, hardware watchpoints, and
some HPUX specific limitations for shared library support.
-
+
There are also a number of @node changes.
1999-01-12 Jason Molenda (jsm@bugshack.cygnus.com)
@@ -2249,7 +2315,7 @@ Wed Jan 6 11:55:34 1999 David Taylor <taylor@texas.cygnus.com>
The following changes were made by Edith Epstein
<eepstein@cygnus.com> as part of a project to merge in changes
made by HP.
-
+
* HPPA-cfg.texi: new file.
* all-cfg.texi: set HPPA for HP PA-RISC targets.
@@ -2298,7 +2364,7 @@ Tue Dec 1 17:45:43 1998 Stan Shebs <shebs@andros.cygnus.com>
Mon Nov 30 11:32:21 1998 Andrew Cagney <cagney@chook>
- * gdbint.texinfo (FRAME_CHAIN_VALID_ALTERNATE):
+ * gdbint.texinfo (FRAME_CHAIN_VALID_ALTERNATE):
Sat Nov 28 13:45:53 1998 Andrew Cagney <cagney@b1.cygnus.com>
@@ -2345,7 +2411,7 @@ Thu Apr 2 16:10:36 1998 Stan Shebs <shebs@andros.cygnus.com>
* gdb.texinfo: Add some credits, mention bug monitor.
* remote.texi: Mention mips monitor targets.
* gdbint.texinfo: Describe SP_REGNUM, STEP_SKIPS_DELAY.
-
+
Mon Feb 2 17:13:03 1998 Stan Shebs <shebs@andros.cygnus.com>
* gdbint.texinfo: Remove obsolete mentions of pinsn.c and opcode.h
@@ -2421,14 +2487,14 @@ Fri Jul 5 15:38:54 1996 Fred Fish <fnf@cygnus.com>
Also document that some systems can use mmalloc but must define
this if their C runtime allocates memory that is later freed.
(MMCHECK_FORCE): Document new macro.
-
+
Fri Jun 28 22:17:10 1996 Dawn Perchik <dawn@cygnus.com>
* remote.texi: Add documentation for target Sparclet.
Mon Jun 24 18:12:22 1996 Jason Molenda (crash@godzilla.cygnus.co.jp)
- * Makefile.in (srcdir, VPATH, prefix, infodir, INSTALL,
+ * Makefile.in (srcdir, VPATH, prefix, infodir, INSTALL,
INSTALL_PROGRAM, INSTALL_DATA): Use autoconf set values.
* configure.in: Rewritten for autoconf.
* configure: New.
@@ -2446,7 +2512,7 @@ Mon Jun 17 10:43:41 1996 Fred Fish <fnf@cygnus.com>
(maintainer-clean): Remove clean-info and clean-dvi
dependencies and put their actions in the rules.
(gdb.ps): New target
- (gdb.dvi, gdbgui.dvi, gdbint.dvi, stabs.dvi): Remove
+ (gdb.dvi, gdbgui.dvi, gdbint.dvi, stabs.dvi): Remove
intermediate TeX files, whether they have 2 or 3 character
extensions.
(gdbint.ps): Add target and rules.
@@ -2817,7 +2883,7 @@ Sun Nov 28 18:06:25 1993 Roland H. Pesch (pesch@fowanton.cygnus.com)
entries; (Server): explain use of gdbserver w/real-time systems,
add example of conflicting TCP port; (MIPS Remote) break up
running text into table, highlighting commands, and add example.
-
+
Wed Nov 24 14:15:56 1993 Roland H. Pesch (pesch@fowanton.cygnus.com)
* refcard.tex: avoid bad linebreaks even when REFEDITS=psrc.sed
@@ -3133,7 +3199,7 @@ Fri Jul 9 09:47:02 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
Tue Jul 6 12:41:28 1993 John Gilmore (gnu@cygnus.com)
* gdbint.texinfo (Target Conditionals): Remove NO_TYPEDEFS,
- removed from the code by Kingdon.
+ removed from the code by Kingdon.
Tue Jul 6 12:24:34 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
@@ -3562,7 +3628,7 @@ Mon Aug 24 01:17:55 1992 John Gilmore (gnu@cygnus.com)
Tue Aug 18 15:59:13 1992 Roland H. Pesch (pesch@fowanton.cygnus.com)
* gdbinv-s.m4.in: refrain from using @cartouche for just a few
- examples (not consistent w others).
+ examples (not consistent w others).
gdb.texinfo: issue disclaimer paragraph on cmdline options only
for generic vn of doc
@@ -3629,7 +3695,7 @@ Fri Apr 10 17:50:43 1992 John Gilmore (gnu at rtl.cygnus.com)
* gdb.texinfo: Update for GDB-4.5. Move `Formatting
Documentation' ahead of `Installing GDB' to match README.
Update shared library doc, -readnow and -mapped, and directory
- structure (add glob and mmalloc). Update configure doc.
+ structure (add glob and mmalloc). Update configure doc.
Tue Mar 24 23:28:38 1992 K. Richard Pixley (rich@cygnus.com)
@@ -3658,7 +3724,7 @@ Fri Dec 6 23:57:34 1991 K. Richard Pixley (rich at rtl.cygnus.com)
* Makefile.in: remove spaces following hyphens, bsd make can't
cope. install using INSTALL_DATA. added clean-info. added
- standards.text support.
+ standards.text support.
Thu Dec 5 22:46:12 1991 K. Richard Pixley (rich at rtl.cygnus.com)
diff --git a/gdb/doc/Makefile.in b/gdb/doc/Makefile.in
index a06cc4a..90043b7 100644
--- a/gdb/doc/Makefile.in
+++ b/gdb/doc/Makefile.in
@@ -171,8 +171,8 @@ install-info: $(INFO_DEPS)
@if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
list='$(INFO_DEPS)'; \
for file in $$list; do \
- echo " install-info --info-dir=$(infodir) $(DESTDIR)$(infodir)/$$file";\
- install-info --info-dir=$(infodir) $(DESTDIR)$(infodir)/$$file || :;\
+ echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\
+ install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;\
done; \
else : ; fi
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index bc231b4..369e10c 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -84,7 +84,7 @@ development.''
@vskip 0pt plus 1filll
Copyright @copyright{} 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
-1996, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
@sp 2
Published by the Free Software Foundation @*
59 Temple Place - Suite 330, @*
@@ -861,7 +861,7 @@ equivalent to the @samp{-c}/@samp{-p} option followed by that argument.)
If the second argument begins with a decimal digit, @value{GDBN} will
first attempt to attach to it as a process, and if that fails, attempt
to open it as a corefile. If you have a corefile whose name begins with
-a digit, you can prevent @value{GDBN} from treating it as a pid by
+a digit, you can prevent @value{GDBN} from treating it as a pid by
prefixing it with @file{./}, eg. @file{./12345}.
If @value{GDBN} has not been configured to included core file support,
@@ -901,7 +901,7 @@ file.
@itemx -c @var{file}
@cindex @code{--core}
@cindex @code{-c}
-Use file @var{file} as a core dump to examine.
+Use file @var{file} as a core dump to examine.
@item -c @var{number}
@item -pid @var{number}
@@ -1112,7 +1112,7 @@ Run using @var{device} for your program's standard input and output.
@c resolve the situation of these eventually
@item -tui
@cindex @code{--tui}
-Activate the Terminal User Interface when starting.
+Activate the Terminal User Interface when starting.
The Terminal User Interface manages several text windows on the terminal,
showing source, assembly, registers and @value{GDBN} command outputs
(@pxref{TUI, ,@value{GDBN} Text User Interface}).
@@ -2289,9 +2289,10 @@ get its process ID. Then tell @value{GDBN} (a new invocation of
the child process (@pxref{Attach}). From that point on you can debug
the child process just like any other process which you attached to.
-On HP-UX (11.x and later only?), @value{GDBN} provides support for
-debugging programs that create additional processes using the
-@code{fork} or @code{vfork} function.
+On some systems, @value{GDBN} provides support for debugging programs that
+create additional processes using the @code{fork} or @code{vfork} functions.
+Currently, the only platforms with this feature are HP-UX (11.x and later
+only?) and GNU/Linux (kernel version 2.5.60 and later).
By default, when a program forks, @value{GDBN} will continue to debug
the parent process and the child process will run unimpeded.
@@ -2315,8 +2316,6 @@ unimpeded. This is the default.
The new process is debugged after a fork. The parent process runs
unimpeded.
-@item ask
-The debugger will ask for one of the above choices.
@end table
@item show follow-fork-mode
@@ -2600,16 +2599,23 @@ Whether the breakpoint is marked to be disabled or deleted when hit.
Enabled breakpoints are marked with @samp{y}. @samp{n} marks breakpoints
that are not enabled.
@item Address
-Where the breakpoint is in your program, as a memory address.
+Where the breakpoint is in your program, as a memory address. If the
+breakpoint is pending (see below for details) on a future load of a shared library, the address
+will be listed as @samp{<PENDING>}.
@item What
Where the breakpoint is in the source for your program, as a file and
-line number.
+line number. For a pending breakpoint, the original string passed to
+the breakpoint command will be listed as it cannot be resolved until
+the appropriate shared library is loaded in the future.
@end table
@noindent
If a breakpoint is conditional, @code{info break} shows the condition on
the line following the affected breakpoint; breakpoint commands, if any,
-are listed after that.
+are listed after that. A pending breakpoint is allowed to have a condition
+specified for it. The condition is not parsed for validity until a shared
+library is loaded that allows the pending breakpoint to resolve to a
+valid location.
@noindent
@code{info break} with a breakpoint
@@ -2632,6 +2638,31 @@ your program. There is nothing silly or meaningless about this. When
the breakpoints are conditional, this is even useful
(@pxref{Conditions, ,Break conditions}).
+@cindex pending breakpoints
+If a specified breakpoint location cannot be found, @value{GDBN} will
+prompt you
+as to whether to make the breakpoint pending on a future shared
+library load. This is useful for setting breakpoints at the start of your
+@value{GDBN} session for locations that you know will be dynamically loaded
+later by the program being debugged. When shared libraries are loaded,
+a check is made to see if the load resoloves any pending breakpoint locations.
+If a pending breakpoint location has been resolved,
+a real breakpoint is created and the original pending breakpoint is removed.
+
+@cindex operations allowed on pending breakpoints
+Normal breakpoint operations apply to pending breakpoints as well. You may
+specify a condition for a pending breakpoint and/or commands to run when the
+breakpoint is reached. You can also enable or disable
+the pending breakpoint. When you specify a condition for a pending breakpoint,
+the parsing of the condition will be deferred until the point where the
+pending breakpoint location is resolved. Disabling a pending breakpoint
+tells @value{GDBN} to not attempt to resolve the breakpoint on any subsequent
+shared library load. When a pending breakpoint is re-enabled,
+@value{GDBN} checks to see if the location is already resolved.
+This is done because any number of shared library loads could have
+occurred since the time the breakpoint was disabled and one or more
+of these loads could resolve the location.
+
@cindex negative breakpoint numbers
@cindex internal @value{GDBN} breakpoints
@value{GDBN} itself sometimes sets breakpoints in your program for
@@ -3216,7 +3247,7 @@ end
@cindex overloading
@cindex symbol overloading
-Some programming languages (notably C@t{++} and Objective-C) permit a
+Some programming languages (notably C@t{++} and Objective-C) permit a
single function name
to be defined several times, for application in different contexts.
This is called @dfn{overloading}. When a function name is overloaded,
@@ -3347,7 +3378,7 @@ Such warnings are printed both for user settable and @value{GDBN}'s
internal breakpoints. If you see one of these warnings, you should
verify that a breakpoint set at the adjusted address will have the
desired affect. If not, the breakpoint in question may be removed and
-other breakpoints may be set which will have the desired behavior.
+other breakpoints may be set which will have the desired behavior.
E.g., it may be sufficient to place the breakpoint at a later
instruction. A conditional breakpoint may also be useful in some
cases to prevent the breakpoint from triggering too often.
@@ -4685,6 +4716,7 @@ Table}.
* Registers:: Registers
* Floating Point Hardware:: Floating point hardware
* Vector Unit:: Vector Unit
+* Auxiliary Vector:: Auxiliary data provided by operating system
* Memory Region Attributes:: Memory region attributes
* Dump/Restore Files:: Copy between memory and a file
* Character Sets:: Debugging programs that use a different
@@ -5865,12 +5897,38 @@ Display information about the vector unit. The exact contents and
layout vary depending on the hardware.
@end table
+@node Auxiliary Vector
+@section Operating system auxiliary vector
+@cindex auxiliary vector
+@cindex vector, auxiliary
+
+Some operating systems supply an @dfn{auxiliary vector} to programs at
+startup. This is akin to the arguments and environment that you
+specify for a program, but contains a system-dependent variety of
+binary values that tell system libraries important details about the
+hardware, operating system, and process. Each value's purpose is
+identified by an integer tag; the meanings are well-known but system-specific.
+Depending on the configuration and operating system facilities,
+@value{GDBN} may be able to show you this information.
+
+@table @code
+@kindex info auxv
+@item info auxv
+Display the auxiliary vector of the inferior, which can be either a
+live process or a core dump file. @value{GDBN} prints each tag value
+numerically, and also shows names and text descriptions for recognized
+tags. Some values in the vector are numbers, some bit masks, and some
+pointers to strings or other data. @value{GDBN} displays each value in the
+most appropriate form for a recognized tag, and in hexadecimal for
+an unrecognized tag.
+@end table
+
@node Memory Region Attributes
-@section Memory region attributes
+@section Memory region attributes
@cindex memory region attributes
-@dfn{Memory region attributes} allow you to describe special handling
-required by regions of your target's memory. @value{GDBN} uses attributes
+@dfn{Memory region attributes} allow you to describe special handling
+required by regions of your target's memory. @value{GDBN} uses attributes
to determine whether to allow certain types of memory accesses; whether to
use specific width accesses; and whether to cache target memory.
@@ -5880,7 +5938,7 @@ accessing memory in that region. Similarly, if no memory regions have
been defined, @value{GDBN} uses the default attributes when accessing
all memory.
-When a memory region is defined, it is given a number to identify it;
+When a memory region is defined, it is given a number to identify it;
to enable, disable, or remove a memory region, you specify that number.
@table @code
@@ -5898,7 +5956,7 @@ Remove memory regions @var{nums}@dots{}.
@kindex disable mem
@item disable mem @var{nums}@dots{}
Disable memory regions @var{nums}@dots{}.
-A disabled memory region is not forgotten.
+A disabled memory region is not forgotten.
It may be enabled again later.
@kindex enable mem
@@ -5913,7 +5971,7 @@ for each region.
@table @emph
@item Memory Region Number
@item Enabled or Disabled.
-Enabled memory regions are marked with @samp{y}.
+Enabled memory regions are marked with @samp{y}.
Disabled memory regions are marked with @samp{n}.
@item Lo Address
@@ -5930,7 +5988,7 @@ The list of attributes set for this memory region.
@subsection Attributes
-@subsubsection Memory Access Mode
+@subsubsection Memory Access Mode
The access mode attributes set whether @value{GDBN} may make read or
write accesses to a memory region.
@@ -5971,7 +6029,7 @@ Use 64 bit memory accesses.
@c
@c @table @code
@c @item hwbreak
-@c Always use hardware breakpoints
+@c Always use hardware breakpoints
@c @item swbreak (default)
@c @end table
@@ -5984,13 +6042,13 @@ registers.
@table @code
@item cache
-Enable @value{GDBN} to cache target memory.
+Enable @value{GDBN} to cache target memory.
@item nocache
Disable @value{GDBN} from caching target memory. This is the default.
@end table
@c @subsubsection Memory Write Verification
-@c The memory write verification attributes set whether @value{GDBN}
+@c The memory write verification attributes set whether @value{GDBN}
@c will re-reads data after each write to verify the write was successful.
@c
@c @table @code
@@ -6052,7 +6110,7 @@ Restore the contents of file @var{filename} into memory. The
file format, except for raw binary. To restore a raw binary file you
must specify the optional keyword @code{binary} after the filename.
-If @var{bias} is non-zero, its value will be added to the addresses
+If @var{bias} is non-zero, its value will be added to the addresses
contained in the file. Binary files always start at address zero, so
they will be restored at address @var{bias}. Other bfd files have
a built-in location; they will be restored at offset @var{bias}
@@ -6060,7 +6118,7 @@ from that location.
If @var{start} and/or @var{end} are non-zero, then only data between
file offset @var{start} and file offset @var{end} will be restored.
-These offsets are relative to the addresses in the file, before
+These offsets are relative to the addresses in the file, before
the @var{bias} argument is applied.
@end table
@@ -6131,15 +6189,15 @@ for both host and target.
@item show charset
@kindex show charset
-Show the names of the current host and target charsets.
+Show the names of the current host and target charsets.
@itemx show host-charset
@kindex show host-charset
-Show the name of the current host charset.
+Show the name of the current host charset.
@itemx show target-charset
@kindex show target-charset
-Show the name of the current target charset.
+Show the name of the current target charset.
@end table
@@ -6206,7 +6264,7 @@ $ gdb -nw charset-test
GNU gdb 2001-12-19-cvs
Copyright 2001 Free Software Foundation, Inc.
@dots{}
-(gdb)
+(gdb)
@end smallexample
We can use the @code{show charset} command to see what character sets
@@ -6216,7 +6274,7 @@ strings:
@smallexample
(gdb) show charset
The current host and target character set is `ISO-8859-1'.
-(gdb)
+(gdb)
@end smallexample
For the sake of printing this manual, let's use @sc{ascii} as our
@@ -6225,7 +6283,7 @@ initial character set:
(gdb) set charset ASCII
(gdb) show charset
The current host and target character set is `ASCII'.
-(gdb)
+(gdb)
@end smallexample
Let's assume that @sc{ascii} is indeed the correct character set for our
@@ -6239,7 +6297,7 @@ them properly. Since our current target character set is also
$1 = 0x401698 "Hello, world!\n"
(gdb) print ascii_hello[0]
$2 = 72 'H'
-(gdb)
+(gdb)
@end smallexample
@value{GDBN} uses the target character set for character and string
@@ -6248,7 +6306,7 @@ literals you use in expressions:
@smallexample
(gdb) print '+'
$3 = 43 '+'
-(gdb)
+(gdb)
@end smallexample
The @sc{ascii} character set uses the number 43 to encode the @samp{+}
@@ -6263,7 +6321,7 @@ character set is still @sc{ascii}, we get jibberish:
$4 = 0x4016a8 "\310\205\223\223\226k@@\246\226\231\223\204Z%"
(gdb) print ibm1047_hello[0]
$5 = 200 '\310'
-(gdb)
+(gdb)
@end smallexample
If we invoke the @code{set target-charset} followed by @key{TAB}@key{TAB},
@@ -6271,8 +6329,8 @@ If we invoke the @code{set target-charset} followed by @key{TAB}@key{TAB},
@smallexample
(gdb) set target-charset
-ASCII EBCDIC-US IBM1047 ISO-8859-1
-(gdb) set target-charset
+ASCII EBCDIC-US IBM1047 ISO-8859-1
+(gdb) set target-charset
@end smallexample
We can select @sc{ibm1047} as our target character set, and examine the
@@ -6303,7 +6361,7 @@ string literals you use in expressions:
@smallexample
(gdb) print '+'
$10 = 78 '+'
-(gdb)
+(gdb)
@end smallexample
The @sc{ibm1047} character set uses the number 78 to encode the @samp{+}
@@ -6474,7 +6532,7 @@ Defined at /home/jimb/gdb/macros/play/sample.h:1
expands to: (42 + 1)
(gdb) macro expand-once ADD(1)
expands to: once (M + 1)
-(gdb)
+(gdb)
@end smallexample
In the example above, note that @command{macro expand-once} expands only
@@ -6489,11 +6547,11 @@ the source line of the current stack frame:
(gdb) break main
Breakpoint 1 at 0x8048370: file sample.c, line 10.
(gdb) run
-Starting program: /home/jimb/gdb/macros/play/sample
+Starting program: /home/jimb/gdb/macros/play/sample
Breakpoint 1, main () at sample.c:10
10 printf ("Hello, world!\n");
-(gdb)
+(gdb)
@end smallexample
At line 10, the definition of the macro @code{N} at line 9 is in force:
@@ -6506,7 +6564,7 @@ Defined at /home/jimb/gdb/macros/play/sample.c:9
expands to: 28 < 42
(gdb) print N Q M
$1 = 1
-(gdb)
+(gdb)
@end smallexample
As we step over directives that remove @code{N}'s definition, and then
@@ -6530,7 +6588,7 @@ Defined at /home/jimb/gdb/macros/play/sample.c:13
expands to: 1729 < 42
(gdb) print N Q M
$2 = 0
-(gdb)
+(gdb)
@end smallexample
@@ -6569,9 +6627,9 @@ tracepoints as of this writing.
This chapter describes the tracepoint commands and features.
@menu
-* Set Tracepoints::
-* Analyze Collected Data::
-* Tracepoint Variables::
+* Set Tracepoints::
+* Analyze Collected Data::
+* Tracepoint Variables::
@end menu
@node Set Tracepoints
@@ -6596,12 +6654,12 @@ This section describes commands to set tracepoints and associated
conditions and actions.
@menu
-* Create and Delete Tracepoints::
-* Enable and Disable Tracepoints::
-* Tracepoint Passcounts::
-* Tracepoint Actions::
-* Listing Tracepoints::
-* Starting and Stopping Trace Experiment::
+* Create and Delete Tracepoints::
+* Enable and Disable Tracepoints::
+* Tracepoint Passcounts::
+* Tracepoint Actions::
+* Listing Tracepoints::
+* Starting and Stopping Trace Experiment::
@end menu
@node Create and Delete Tracepoints
@@ -6700,7 +6758,7 @@ user.
Examples:
@smallexample
-(@value{GDBP}) @b{passcount 5 2} // Stop on the 5th execution of
+(@value{GDBP}) @b{passcount 5 2} // Stop on the 5th execution of
@exdent @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @code{// tracepoint 2}
(@value{GDBP}) @b{passcount 12} // Stop on the 12th execution of the
@@ -7412,7 +7470,7 @@ name normally:
@smallexample
(gdb) overlay list
-Section .ov.foo.text, loaded at 0x100000 - 0x100034,
+Section .ov.foo.text, loaded at 0x100000 - 0x100034,
mapped at 0x1016 - 0x104a
(gdb) print foo
$6 = @{int (int)@} 0x1016 <foo>
@@ -7495,7 +7553,7 @@ will silently set a breakpoint there. If the overlay manager then
calls this function whenever it has changed the overlay table, this
will enable @value{GDBN} to accurately keep track of which overlays
are in program memory, and update any breakpoints that may be set
-in overlays. This will allow breakpoints to work even if the
+in overlays. This will allow breakpoints to work even if the
overlays are kept in ROM or other non-writable memory while they
are not being executed.
@@ -7927,7 +7985,7 @@ language reference or tutorial.
@menu
* C:: C and C@t{++}
-* Objective-C:: Objective-C
+* Objective-C:: Objective-C
* Modula-2:: Modula-2
@end menu
@@ -8453,8 +8511,8 @@ This section provides information about some commands and command
options that are useful for debugging Objective-C code.
@menu
-* Method Names in Commands::
-* The Print Command with Objective-C::
+* Method Names in Commands::
+* The Print Command with Objective-C::
@end menu
@node Method Names in Commands, The Print Command with Objective-C, Objective-C, Objective-C
@@ -9186,8 +9244,8 @@ Print the names and data types of all defined functions
whose names contain a match for regular expression @var{regexp}.
Thus, @samp{info fun step} finds all functions whose names
include @code{step}; @samp{info fun ^step} finds those whose names
-start with @code{step}. If a function name contains characters
-that conflict with the regular expression language (eg.
+start with @code{step}. If a function name contains characters
+that conflict with the regular expression language (eg.
@samp{operator*()}), they may be quoted with a backslash.
@kindex info variables
@@ -9318,7 +9376,7 @@ structure in more detail. For example:
(@value{GDBP}) maint info psymtabs dwarf2read
@{ objfile /home/gnu/build/gdb/gdb
((struct objfile *) 0x82e69d0)
- @{ psymtab /home/gnu/src/gdb/dwarf2read.c
+ @{ psymtab /home/gnu/src/gdb/dwarf2read.c
((struct partial_symtab *) 0x8474b10)
readin no
fullname (null)
@@ -9343,9 +9401,9 @@ read the symtab for the compilation unit containing that function:
Breakpoint 1 at 0x814e5da: file /home/gnu/src/gdb/dwarf2read.c,
line 1574.
(@value{GDBP}) maint info symtabs
-@{ objfile /home/gnu/build/gdb/gdb
+@{ objfile /home/gnu/build/gdb/gdb
((struct objfile *) 0x82e69d0)
- @{ symtab /home/gnu/src/gdb/dwarf2read.c
+ @{ symtab /home/gnu/src/gdb/dwarf2read.c
((struct symtab *) 0x86c1f38)
dirname (null)
fullname (null)
@@ -9353,7 +9411,7 @@ line 1574.
debugformat DWARF 2
@}
@}
-(@value{GDBP})
+(@value{GDBP})
@end smallexample
@end table
@@ -10633,9 +10691,7 @@ configuration of @value{GDBN}; use @code{help target} to list them.
@node KOD
@section Kernel Object Display
-
@cindex kernel object display
-@cindex kernel object
@cindex KOD
Some targets support kernel object display. Using this facility,
@@ -10644,6 +10700,7 @@ and can display information about operating system-level objects such as
mutexes and other synchronization objects. Exactly which objects can be
displayed is determined on a per-OS basis.
+@kindex set os
Use the @code{set os} command to set the operating system. This tells
@value{GDBN} which kernel object display module to initialize:
@@ -10651,11 +10708,17 @@ Use the @code{set os} command to set the operating system. This tells
(@value{GDBP}) set os cisco
@end smallexample
+@kindex show os
+The associated command @code{show os} displays the operating system
+set with the @code{set os} command; if no operating system has been
+set, @code{show os} will display an empty string @samp{""}.
+
If @code{set os} succeeds, @value{GDBN} will display some information
about the operating system, and will create a new @code{info} command
which can be used to query the target. The @code{info} command is named
after the operating system:
+@kindex info cisco
@smallexample
(@value{GDBP}) info cisco
List of Cisco Kernel Objects
@@ -10666,8 +10729,10 @@ any Any and all objects
Further subcommands can be used to query about particular objects known
by the kernel.
-There is currently no way to determine whether a given operating system
-is supported other than to try it.
+There is currently no way to determine whether a given operating
+system is supported other than to try setting it with @kbd{set os
+@var{name}}, where @var{name} is the name of the operating system you
+want to try.
@node Remote Debugging
@@ -11448,10 +11513,10 @@ accepts addresses which may belong to @emph{any} segment. For
example, here's how to display the Page Table entry for the page where
the variable @code{i} is stored:
-@smallexample
+@smallexample
@exdent @code{(@value{GDBP}) info dos address-pte __djgpp_base_address + (char *)&i}
@exdent @code{Page Table entry for address 0x11a00d30:}
-@exdent @code{Base=0x02698000 Dirty Acc. Not-Cached Write-Back Usr Read-Write +0xd30}
+@exdent @code{Base=0x02698000 Dirty Acc. Not-Cached Write-Back Usr Read-Write +0xd30}
@end smallexample
@noindent
@@ -11520,9 +11585,9 @@ This is a Cygwin specific alias of info shared.
This command loads symbols from a dll similarly to
add-sym command but without the need to specify a base address.
-@kindex set new-console
+@kindex set new-console
@item set new-console @var{mode}
-If @var{mode} is @code{on} the debuggee will
+If @var{mode} is @code{on} the debuggee will
be started in a new console on next start.
If @var{mode} is @code{off}i, the debuggee will
be started in the same console as the debugger.
@@ -11549,17 +11614,17 @@ This boolean value adds debug output concerning events seen by the debugger.
@kindex set debugexec
@item set debugexec
-This boolean value adds debug output concerning execute events
+This boolean value adds debug output concerning execute events
seen by the debugger.
@kindex set debugexceptions
@item set debugexceptions
-This boolean value adds debug ouptut concerning exception events
+This boolean value adds debug ouptut concerning exception events
seen by the debugger.
@kindex set debugmemory
@item set debugmemory
-This boolean value adds debug ouptut concerning memory events
+This boolean value adds debug ouptut concerning memory events
seen by the debugger.
@kindex set shell
@@ -13132,7 +13197,7 @@ current ABI.
@kindex show osabi
One @value{GDBN} configuration can debug binaries for multiple operating
-system targets, either via remote debugging or native emulation.
+system targets, either via remote debugging or native emulation.
@value{GDBN} will autodetect the @dfn{OS ABI} (Operating System ABI) in use,
but you can override its conclusion using the @code{set osabi} command.
One example where this is useful is in debugging of binaries which use
@@ -13526,7 +13591,7 @@ end
@end smallexample
As a further example, to hook at the begining and end of the @code{echo}
-command, and to add extra text to the beginning and end of the message,
+command, and to add extra text to the beginning and end of the message,
you could define:
@smallexample
@@ -14037,7 +14102,7 @@ key bindings such as @key{C-p}, @key{C-n}, @key{C-b} and @key{C-f}.
The TUI provides a @emph{SingleKey} mode in which it installs a particular
key binding in the readline keymaps to connect single keys to
-some gdb commands.
+some gdb commands.
@table @kbd
@kindex c @r{(SingleKey TUI key)}
@@ -14343,7 +14408,7 @@ the files with these buffers if you wish; but keep in mind that @value{GDBN}
communicates with Emacs in terms of line numbers. If you add or
delete lines from the text, the line numbers that @value{GDBN} knows cease
to correspond properly with the code.
-
+
The description given here is for GNU Emacs version 21.3 and a more
detailed description of its interaction with @value{GDBN} is given in
the Emacs manual (@pxref{Debuggers,,, Emacs, The @sc{gnu} Emacs Manual}).
@@ -15983,17 +16048,17 @@ The corresponding @value{GDBN} command is @samp{cd}.
Add directories @var{pathdir} to beginning of search path for source files.
If the @samp{-r} option is used, the search path is reset to the default
-search path. If directories @var{pathdir} are supplied in addition to the
+search path. If directories @var{pathdir} are supplied in addition to the
@samp{-r} option, the search path is first reset and then addition
occurs as normal.
-Multiple directories may be specified, separated by blanks. Specifying
+Multiple directories may be specified, separated by blanks. Specifying
multiple directories in a single command
results in the directories added to the beginning of the
search path in the same order they were presented in the command.
If blanks are needed as
part of a directory name, double-quotes should be used around
the name. In the command output, the path will show up separated
-by the system directory-separator character. The directory-seperator
+by the system directory-separator character. The directory-seperator
character must not be used
in any directory name.
If no directories are specified, the current search path is displayed.
@@ -16032,18 +16097,18 @@ The corresponding @value{GDBN} command is @samp{dir}.
Add directories @var{pathdir} to beginning of search path for object files.
If the @samp{-r} option is used, the search path is reset to the original
-search path that existed at gdb start-up. If directories @var{pathdir} are
-supplied in addition to the
+search path that existed at gdb start-up. If directories @var{pathdir} are
+supplied in addition to the
@samp{-r} option, the search path is first reset and then addition
occurs as normal.
-Multiple directories may be specified, separated by blanks. Specifying
+Multiple directories may be specified, separated by blanks. Specifying
multiple directories in a single command
results in the directories added to the beginning of the
search path in the same order they were presented in the command.
If blanks are needed as
part of a directory name, double-quotes should be used around
the name. In the command output, the path will show up separated
-by the system directory-separator character. The directory-seperator
+by the system directory-separator character. The directory-seperator
character must not be used
in any directory name.
If no directories are specified, the current path is displayed.
@@ -16057,7 +16122,7 @@ The corresponding @value{GDBN} command is @samp{path}.
@smallexample
(@value{GDBP})
--environment-path
+-environment-path
^done,path="/usr/bin"
(@value{GDBP})
-environment-path /kwikemart/marge/ezannoni/flathead-dev/ppc-eabi/gdb /bin
@@ -16663,7 +16728,7 @@ N.A.
-file-list-exec-source-file
@end smallexample
-List the line number, the current source file, and the absolute path
+List the line number, the current source file, and the absolute path
to the current source file for the current executable.
@subsubheading @value{GDBN} Command
@@ -16876,7 +16941,7 @@ information when you start an interactive session.
~Type "show copying" to see the conditions.
~There is absolutely no warranty for GDB. Type "show warranty" for
~ details.
-~This GDB was configured as
+~This GDB was configured as
"--host=sparc-sun-solaris2.5.1 --target=ppc-eabi".
^done
(@value{GDBP})
@@ -17207,8 +17272,14 @@ Show a single frame:
@end smallexample
Display the local variable names for the current frame. With an
-argument of 0 prints only the names of the variables, with argument of 1
-prints also their values.
+argument of 0 or @code{--no-values}, prints only the names of the variables.
+With argument of 1 or @code{--all-values}, prints also their values. With
+argument of 2 or @code{--simple-values}, prints the name, type and value for
+simple data types and the name and type for arrays, structures and
+unions. In this last case, the idea is that the user can see the
+value of simple data types immediately and he can create variable
+objects for other data types if he wishes to explore their values in
+more detail.
@subsubheading @value{GDBN} Command
@@ -17221,9 +17292,12 @@ prints also their values.
-stack-list-locals 0
^done,locals=[name="A",name="B",name="C"]
(@value{GDBP})
--stack-list-locals 1
+-stack-list-locals --all-values
^done,locals=[@{name="A",value="1"@},@{name="B",value="2"@},
- @{name="C",value="3"@}]
+ @{name="C",value="@{1, 2, 3@}"@}]
+-stack-list-locals --simple-values
+^done,locals=[@{name="A",type="int",value="1"@},
+ @{name="B",type="int",value="2"@},@{name="C",type="int [3]"@}]
(@value{GDBP})
@end smallexample
@@ -18167,14 +18241,26 @@ Returns the number of children of a variable object @var{name}:
@subsubheading Synopsis
@smallexample
- -var-list-children @var{name}
+ -var-list-children [@var{print-values}] @var{name}
@end smallexample
-Returns a list of the children of the specified variable object:
+Returns a list of the children of the specified variable object. With
+just the variable object name as an argument or with an optional
+preceding argument of 0 or @code{--no-values}, prints only the names of the
+variables. With an optional preceding argument of 1 or @code{--all-values},
+also prints their values.
+
+@subsubheading Example
@smallexample
+(@value{GDBP})
+ -var-list-children n
numchild=@var{n},children=[@{name=@var{name},
numchild=@var{n},type=@var{type}@},@r{(repeats N times)}]
+(@value{GDBP})
+ -var-list-children --all-values n
+ numchild=@var{n},children=[@{name=@var{name},
+ numchild=@var{n},value=@var{value},type=@var{type}@},@r{(repeats N times)}]
@end smallexample
@@ -18263,7 +18349,7 @@ before the value of a child variable can be evaluated.
Assigns the value of @var{expression} to the variable object specified
by @var{name}. The object must be @samp{editable}. If the variable's
-value is altered by the assign, the variable will show up in any
+value is altered by the assign, the variable will show up in any
subsequent @code{-var-update} list.
@subsubheading Example
@@ -18363,12 +18449,12 @@ for details.
This GDB was configured as "i386-pc-linux-gnu"
^Z^Zpre-prompt
-(gdb)
+(gdb)
^Z^Zprompt
@kbd{quit}
^Z^Zpost-prompt
-$
+$
@end smallexample
Here @samp{quit} is input to @value{GDBN}; the rest is output from
@@ -18518,13 +18604,13 @@ deleted a breakpoint.
@findex starting
@findex stopping
When the program starts executing due to a @value{GDBN} command such as
-@code{step} or @code{continue},
+@code{step} or @code{continue},
@smallexample
^Z^Zstarting
@end smallexample
-is output. When the program stops,
+is output. When the program stops,
@smallexample
^Z^Zstopped
@@ -19281,7 +19367,7 @@ A problem internal to GDB has been detected. Further
debugging may prove unreliable.
Quit this debugging session? (y or n) @kbd{n}
Create a core file? (y or n) @kbd{n}
-(gdb)
+(gdb)
@end smallexample
Takes an optional parameter that is used as the text of the error or
@@ -19304,7 +19390,7 @@ The program being debugged stopped while in a function called from GDB.
0x1a57c80: pc=0x01014068 fp=0x0200bddc sp=0x0200bdd6
top=0x0200bdd4 id=@{stack=0x200bddc,code=0x101405c@}
call_lo=0x01014000 call_hi=0x01014001
-(gdb)
+(gdb)
@end smallexample
Takes an optional file parameter.
@@ -19336,14 +19422,14 @@ Takes an optional file parameter.
@smallexample
(gdb) @kbd{maint print reggroups}
- Group Type
- general user
- float user
- all user
- vector user
- system user
- save internal
- restore internal
+ Group Type
+ general user
+ float user
+ all user
+ vector user
+ system user
+ save internal
+ restore internal
@end smallexample
@kindex maint set profile
@@ -19362,7 +19448,7 @@ if you use profiling, @value{GDBN} will overwrite the profiling log file
data in a @file{gmon.out} file, be sure to move it to a safe location.
Configuring with @samp{--enable-profiling} arranges for @value{GDBN} to be
-compiled with the @samp{-pg} compiler option.
+compiled with the @samp{-pg} compiler option.
@end table
@@ -19461,10 +19547,6 @@ where @code{n >=3} (which is where rle starts to win). The printable
characters @samp{$}, @samp{#}, @samp{+} and @samp{-} or with a numeric
value greater than 126 should not be used.
-Some remote systems have used a different run-length encoding mechanism
-loosely refered to as the cisco encoding. Following the @samp{*}
-character are two hex digits that indicate the size of the packet.
-
So:
@smallexample
"@code{0* }"
@@ -19480,8 +19562,8 @@ For any @var{command} not supported by the stub, an empty response
protocol. A newer @value{GDBN} can tell if a packet is supported based
on that response.
-A stub is required to support the @samp{g}, @samp{G}, @samp{m}, @samp{M},
-@samp{c}, and @samp{s} @var{command}s. All other @var{command}s are
+A stub is required to support the @samp{g}, @samp{G}, @samp{m}, @samp{M},
+@samp{c}, and @samp{s} @var{command}s. All other @var{command}s are
optional.
@node Packets
@@ -19646,7 +19728,7 @@ for an error
Reserved for future use.
-@item @code{H}@var{c}@var{t@dots{}} --- set thread
+@item @code{H}@var{c}@var{t@dots{}} --- set thread
@cindex @code{H} packet
Set thread for subsequent operations (@samp{m}, @samp{M}, @samp{g},
@@ -19857,7 +19939,7 @@ Like @samp{C} but step not continue.
Reply:
@xref{Stop Reply Packets}, for the reply specifications.
-@item @code{t}@var{addr}@code{:}@var{PP}@code{,}@var{MM} --- search
+@item @code{t}@var{addr}@code{:}@var{PP}@code{,}@var{MM} --- search
@cindex @code{t} packet
Search backwards starting at address @var{addr} for a match with pattern
@@ -20134,15 +20216,6 @@ applicable to certain targets.
The process terminated with signal @var{AA}.
-@item N@var{AA};@var{t@dots{}};@var{d@dots{}};@var{b@dots{}} @strong{(obsolete)}
-
-@var{AA} = signal number; @var{t@dots{}} = address of symbol
-@code{_start}; @var{d@dots{}} = base of data section; @var{b@dots{}} =
-base of bss section. @emph{Note: only used by Cisco Systems targets.
-The difference between this reply and the @samp{qOffsets} query is that
-the @samp{N} packet may arrive spontaneously whereas the @samp{qOffsets}
-is a query initiated by the host debugger.}
-
@item O@var{XX@dots{}}
@var{XX@dots{}} is hex encoding of @sc{ascii} data. This can happen at
@@ -20479,20 +20552,20 @@ system are not supported by this protocol.
The File-I/O protocol uses the @code{F} packet, as request as well
as as reply packet. Since a File-I/O system call can only occur when
-@value{GDBN} is waiting for the continuing or stepping target, the
+@value{GDBN} is waiting for the continuing or stepping target, the
File-I/O request is a reply that @value{GDBN} has to expect as a result
of a former @samp{C}, @samp{c}, @samp{S} or @samp{s} packet.
This @code{F} packet contains all information needed to allow @value{GDBN}
to call the appropriate host system call:
@itemize @bullet
-@item
+@item
A unique identifier for the requested system call.
@item
All parameters to the system call. Pointers are given as addresses
in the target memory address space. Pointers to strings are given as
-pointer/length pair. Numerical values are given as they are.
+pointer/length pair. Numerical values are given as they are.
Numerical control values are given in a protocol specific representation.
@end itemize
@@ -20500,7 +20573,7 @@ Numerical control values are given in a protocol specific representation.
At that point @value{GDBN} has to perform the following actions.
@itemize @bullet
-@item
+@item
If parameter pointer values are given, which point to data needed as input
to a system call, @value{GDBN} requests this data from the target with a
standard @code{m} packet request. This additional communication has to be
@@ -20562,7 +20635,7 @@ This is just the name of the function.
@var{parameter@dots{}} are the parameters to the system call.
-@end table
+@end table
Parameters are hexadecimal integer values, either the real values in case
of scalar datatypes, as pointers to target buffer space in case of compound
@@ -20629,7 +20702,7 @@ reply packet. In this case the target should behave, as if it had
gotten a break message. The meaning for the target is ``system call
interupted by @code{SIGINT}''. Consequentially, the target should actually stop
(as with a break message) and return to @value{GDBN} with a @code{T02}
-packet. In this case, it's important for the target to know, in which
+packet. In this case, it's important for the target to know, in which
state the system call was interrupted. Since this action is by design
not an atomic operation, we have to differ between two cases:
@@ -20714,7 +20787,7 @@ in case the user pressed @kbd{Ctrl-C}. Otherwise the return value consists
entirely of the exit status of the called command.
Due to security concerns, the @code{system} call is refused to be called
-by @value{GDBN} by default. The user has to allow this call explicitly by
+by @value{GDBN} by default. The user has to allow this call explicitly by
entering
@table @samp
@@ -20763,7 +20836,7 @@ The current setting is shown by typing
int open(const char *pathname, int flags);
int open(const char *pathname, int flags, mode_t mode);
-@exdent Request:
+@exdent Request:
Fopen,pathptr/len,flags,mode
@end smallexample
@@ -20771,30 +20844,30 @@ Fopen,pathptr/len,flags,mode
@code{flags} is the bitwise or of the following values:
@table @code
-@item O_CREAT
+@item O_CREAT
If the file does not exist it will be created. The host
rules apply as far as file ownership and time stamps
are concerned.
-@item O_EXCL
+@item O_EXCL
When used with O_CREAT, if the file already exists it is
an error and open() fails.
-@item O_TRUNC
+@item O_TRUNC
If the file already exists and the open mode allows
writing (O_RDWR or O_WRONLY is given) it will be
truncated to length 0.
-@item O_APPEND
+@item O_APPEND
The file is opened in append mode.
-@item O_RDONLY
+@item O_RDONLY
The file is opened for reading only.
-@item O_WRONLY
+@item O_WRONLY
The file is opened for writing only.
-@item O_RDWR
+@item O_RDWR
The file is opened for reading and writing.
@noindent
@@ -20806,22 +20879,22 @@ Each other bit is silently ignored.
@code{mode} is the bitwise or of the following values:
@table @code
-@item S_IRUSR
+@item S_IRUSR
User has read permission.
-@item S_IWUSR
+@item S_IWUSR
User has write permission.
-@item S_IRGRP
+@item S_IRGRP
Group has read permission.
-@item S_IWGRP
+@item S_IWGRP
Group has write permission.
-@item S_IROTH
+@item S_IROTH
Others have read permission.
-@item S_IWOTH
+@item S_IWOTH
Others have write permission.
@noindent
@@ -20838,42 +20911,42 @@ occured.
@end smallexample
@table @code
-@item EEXIST
+@item EEXIST
pathname already exists and O_CREAT and O_EXCL were used.
-@item EISDIR
+@item EISDIR
pathname refers to a directory.
-@item EACCES
+@item EACCES
The requested access is not allowed.
@item ENAMETOOLONG
pathname was too long.
-@item ENOENT
+@item ENOENT
A directory component in pathname does not exist.
-@item ENODEV
+@item ENODEV
pathname refers to a device, pipe, named pipe or socket.
-@item EROFS
+@item EROFS
pathname refers to a file on a read-only filesystem and
write access was requested.
-@item EFAULT
+@item EFAULT
pathname is an invalid pointer value.
-@item ENOSPC
+@item ENOSPC
No space on device to create the file.
-@item EMFILE
+@item EMFILE
The process already has the maximum number of files open.
-@item ENFILE
+@item ENFILE
The limit on the total number of files open on the system
has been reached.
-@item EINTR
+@item EINTR
The call was interrupted by the user.
@end table
@@ -20882,10 +20955,10 @@ The call was interrupted by the user.
@cindex close, file-i/o system call
@smallexample
-@exdent Synopsis:
+@exdent Synopsis:
int close(int fd);
-@exdent Request:
+@exdent Request:
Fclose,fd
@exdent Return value:
@@ -20895,10 +20968,10 @@ close returns zero on success, or -1 if an error occurred.
@end smallexample
@table @code
-@item EBADF
+@item EBADF
fd isn't a valid open file descriptor.
-@item EINTR
+@item EINTR
The call was interrupted by the user.
@end table
@@ -20907,29 +20980,29 @@ The call was interrupted by the user.
@cindex read, file-i/o system call
@smallexample
-@exdent Synopsis:
+@exdent Synopsis:
int read(int fd, void *buf, unsigned int count);
-@exdent Request:
+@exdent Request:
Fread,fd,bufptr,count
@exdent Return value:
On success, the number of bytes read is returned.
Zero indicates end of file. If count is zero, read
-returns zero as well. On error, -1 is returned.
+returns zero as well. On error, -1 is returned.
@exdent Errors:
@end smallexample
@table @code
-@item EBADF
+@item EBADF
fd is not a valid file descriptor or is not open for
reading.
-@item EFAULT
+@item EFAULT
buf is an invalid pointer value.
-@item EINTR
+@item EINTR
The call was interrupted by the user.
@end table
@@ -20938,10 +21011,10 @@ The call was interrupted by the user.
@cindex write, file-i/o system call
@smallexample
-@exdent Synopsis:
+@exdent Synopsis:
int write(int fd, const void *buf, unsigned int count);
-@exdent Request:
+@exdent Request:
Fwrite,fd,bufptr,count
@exdent Return value:
@@ -20953,21 +21026,21 @@ is returned.
@end smallexample
@table @code
-@item EBADF
+@item EBADF
fd is not a valid file descriptor or is not open for
writing.
-@item EFAULT
+@item EFAULT
buf is an invalid pointer value.
-@item EFBIG
+@item EFBIG
An attempt was made to write a file that exceeds the
host specific maximum file size allowed.
-@item ENOSPC
+@item ENOSPC
No space on device to write the data.
-@item EINTR
+@item EINTR
The call was interrupted by the user.
@end table
@@ -20976,24 +21049,24 @@ The call was interrupted by the user.
@cindex lseek, file-i/o system call
@smallexample
-@exdent Synopsis:
+@exdent Synopsis:
long lseek (int fd, long offset, int flag);
-@exdent Request:
+@exdent Request:
Flseek,fd,offset,flag
@end smallexample
@code{flag} is one of:
@table @code
-@item SEEK_SET
+@item SEEK_SET
The offset is set to offset bytes.
-@item SEEK_CUR
+@item SEEK_CUR
The offset is set to its current location plus offset
bytes.
-@item SEEK_END
+@item SEEK_END
The offset is set to the size of the file plus offset
bytes.
@end table
@@ -21008,16 +21081,16 @@ value of -1 is returned.
@end smallexample
@table @code
-@item EBADF
+@item EBADF
fd is not a valid open file descriptor.
-@item ESPIPE
+@item ESPIPE
fd is associated with the @value{GDBN} console.
-@item EINVAL
+@item EINVAL
flag is not a proper value.
-@item EINTR
+@item EINTR
The call was interrupted by the user.
@end table
@@ -21026,10 +21099,10 @@ The call was interrupted by the user.
@cindex rename, file-i/o system call
@smallexample
-@exdent Synopsis:
+@exdent Synopsis:
int rename(const char *oldpath, const char *newpath);
-@exdent Request:
+@exdent Request:
Frename,oldpathptr/len,newpathptr/len
@exdent Return value:
@@ -21039,47 +21112,47 @@ On success, zero is returned. On error, -1 is returned.
@end smallexample
@table @code
-@item EISDIR
+@item EISDIR
newpath is an existing directory, but oldpath is not a
directory.
-@item EEXIST
+@item EEXIST
newpath is a non-empty directory.
-@item EBUSY
+@item EBUSY
oldpath or newpath is a directory that is in use by some
process.
-@item EINVAL
+@item EINVAL
An attempt was made to make a directory a subdirectory
of itself.
-@item ENOTDIR
+@item ENOTDIR
A component used as a directory in oldpath or new
path is not a directory. Or oldpath is a directory
and newpath exists but is not a directory.
-@item EFAULT
+@item EFAULT
oldpathptr or newpathptr are invalid pointer values.
-@item EACCES
+@item EACCES
No access to the file or the path of the file.
@item ENAMETOOLONG
-
+
oldpath or newpath was too long.
-@item ENOENT
+@item ENOENT
A directory component in oldpath or newpath does not exist.
-@item EROFS
+@item EROFS
The file is on a read-only filesystem.
-@item ENOSPC
+@item ENOSPC
The device containing the file has no room for the new
directory entry.
-@item EINTR
+@item EINTR
The call was interrupted by the user.
@end table
@@ -21088,10 +21161,10 @@ The call was interrupted by the user.
@cindex unlink, file-i/o system call
@smallexample
-@exdent Synopsis:
+@exdent Synopsis:
int unlink(const char *pathname);
-@exdent Request:
+@exdent Request:
Funlink,pathnameptr/len
@exdent Return value:
@@ -21101,32 +21174,32 @@ On success, zero is returned. On error, -1 is returned.
@end smallexample
@table @code
-@item EACCES
+@item EACCES
No access to the file or the path of the file.
-@item EPERM
+@item EPERM
The system does not allow unlinking of directories.
-@item EBUSY
+@item EBUSY
The file pathname cannot be unlinked because it's
being used by another process.
-@item EFAULT
+@item EFAULT
pathnameptr is an invalid pointer value.
@item ENAMETOOLONG
pathname was too long.
-@item ENOENT
+@item ENOENT
A directory component in pathname does not exist.
-@item ENOTDIR
+@item ENOTDIR
A component of the path is not a directory.
-@item EROFS
+@item EROFS
The file is on a read-only filesystem.
-@item EINTR
+@item EINTR
The call was interrupted by the user.
@end table
@@ -21136,11 +21209,11 @@ The call was interrupted by the user.
@cindex stat, file-i/o system call
@smallexample
-@exdent Synopsis:
+@exdent Synopsis:
int stat(const char *pathname, struct stat *buf);
int fstat(int fd, struct stat *buf);
-@exdent Request:
+@exdent Request:
Fstat,pathnameptr/len,bufptr
Ffstat,fd,bufptr
@@ -21151,26 +21224,26 @@ On success, zero is returned. On error, -1 is returned.
@end smallexample
@table @code
-@item EBADF
+@item EBADF
fd is not a valid open file.
-@item ENOENT
+@item ENOENT
A directory component in pathname does not exist or the
path is an empty string.
-@item ENOTDIR
+@item ENOTDIR
A component of the path is not a directory.
-@item EFAULT
+@item EFAULT
pathnameptr is an invalid pointer value.
-@item EACCES
+@item EACCES
No access to the file or the path of the file.
@item ENAMETOOLONG
pathname was too long.
-@item EINTR
+@item EINTR
The call was interrupted by the user.
@end table
@@ -21179,10 +21252,10 @@ The call was interrupted by the user.
@cindex gettimeofday, file-i/o system call
@smallexample
-@exdent Synopsis:
+@exdent Synopsis:
int gettimeofday(struct timeval *tv, void *tz);
-@exdent Request:
+@exdent Request:
Fgettimeofday,tvptr,tzptr
@exdent Return value:
@@ -21192,10 +21265,10 @@ On success, 0 is returned, -1 otherwise.
@end smallexample
@table @code
-@item EINVAL
+@item EINVAL
tz is a non-NULL pointer.
-@item EFAULT
+@item EFAULT
tvptr and/or tzptr is an invalid pointer value.
@end table
@@ -21204,10 +21277,10 @@ tvptr and/or tzptr is an invalid pointer value.
@cindex isatty, file-i/o system call
@smallexample
-@exdent Synopsis:
+@exdent Synopsis:
int isatty(int fd);
-@exdent Request:
+@exdent Request:
Fisatty,fd
@exdent Return value:
@@ -21217,7 +21290,7 @@ Returns 1 if fd refers to the @value{GDBN} console, 0 otherwise.
@end smallexample
@table @code
-@item EINTR
+@item EINTR
The call was interrupted by the user.
@end table
@@ -21226,10 +21299,10 @@ The call was interrupted by the user.
@cindex system, file-i/o system call
@smallexample
-@exdent Synopsis:
+@exdent Synopsis:
int system(const char *command);
-@exdent Request:
+@exdent Request:
Fsystem,commandptr/len
@exdent Return value:
@@ -21243,7 +21316,7 @@ In case /bin/sh could not be executed, 127 is returned.
@end smallexample
@table @code
-@item EINTR
+@item EINTR
The call was interrupted by the user.
@end table
@@ -21271,8 +21344,8 @@ int@r{,} unsigned int@r{,} long@r{,} unsigned long@r{,} mode_t @r{and} time_t
@code{Int}, @code{unsigned int}, @code{mode_t} and @code{time_t} are
implemented as 32 bit values in this protocol.
-@code{Long} and @code{unsigned long} are implemented as 64 bit types.
-
+@code{Long} and @code{unsigned long} are implemented as 64 bit types.
+
@xref{Limits}, for corresponding MIN and MAX values (similar to those
in @file{limits.h}) to allow range checking on host and target.
@@ -21380,7 +21453,7 @@ The buffer of type struct timeval used by the target and @value{GDBN}
is defined as follows:
@smallexample
-struct timeval @{
+struct timeval @{
time_t tv_sec; /* second */
long tv_usec; /* microsecond */
@};
diff --git a/gdb/doc/gdbint.texinfo b/gdb/doc/gdbint.texinfo
index 3170ce2..081f999 100644
--- a/gdb/doc/gdbint.texinfo
+++ b/gdb/doc/gdbint.texinfo
@@ -8,7 +8,7 @@
@ifinfo
This file documents the internals of the GNU debugger @value{GDBN}.
-Copyright 1990,1991,1992,1993,1994,1996,1998,1999,2000,2001,2002,2003
+Copyright 1990,1991,1992,1993,1994,1996,1998,1999,2000,2001,2002,2003,2004
Free Software Foundation, Inc.
Contributed by Cygnus Solutions. Written by John Gilmore.
Second Edition by Stan Shebs.
@@ -48,7 +48,7 @@ Free Documentation License''.
@vskip 0pt plus 1filll
Copyright @copyright{} 1990,1991,1992,1993,1994,1996,1998,1999,2000,2001,
- 2002, 2003 Free Software Foundation, Inc.
+ 2002, 2003, 2004 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1 or
@@ -480,13 +480,6 @@ two macros can use them for their internal purposes.
If the inferior has some watchpoint that triggered, return the address
associated with that watchpoint. Otherwise, return zero.
-@findex DECR_PC_AFTER_HW_BREAK
-@item DECR_PC_AFTER_HW_BREAK
-If defined, @value{GDBN} decrements the program counter by the value
-of @code{DECR_PC_AFTER_HW_BREAK} after a hardware break-point. This
-overrides the value of @code{DECR_PC_AFTER_BREAK} when a breakpoint
-that breaks is a hardware-assisted breakpoint.
-
@findex HAVE_STEPPABLE_WATCHPOINT
@item HAVE_STEPPABLE_WATCHPOINT
If defined to a non-zero value, it is not necessary to disable a
@@ -2245,12 +2238,6 @@ This macro is used as the argument to @code{lseek} (or, most commonly,
@code{bfd_seek}). FIXME, should be replaced by SEEK_SET instead,
which is the POSIX equivalent.
-@item MMAP_BASE_ADDRESS
-When using HAVE_MMAP, the first mapping should go at this address.
-
-@item MMAP_INCREMENT
-when using HAVE_MMAP, this is the increment between mappings.
-
@item NORETURN
If defined, this should be one or more tokens, such as @code{volatile},
that can be used in both the declaration and definition of functions to
@@ -2264,37 +2251,6 @@ of functions to indicate that they never return. The default is already
set correctly if compiling with GCC. This will almost never need to be
defined.
-@item USE_MMALLOC
-@findex mmalloc
-@value{GDBN} will use the @code{mmalloc} library for memory allocation
-for symbol reading if this symbol is defined. Be careful defining it
-since there are systems on which @code{mmalloc} does not work for some
-reason. One example is the DECstation, where its RPC library can't
-cope with our redefinition of @code{malloc} to call @code{mmalloc}.
-When defining @code{USE_MMALLOC}, you will also have to set
-@code{MMALLOC} in the Makefile, to point to the @code{mmalloc} library. This
-define is set when you configure with @samp{--with-mmalloc}.
-
-@item NO_MMCHECK
-@findex mmcheck
-Define this if you are using @code{mmalloc}, but don't want the overhead
-of checking the heap with @code{mmcheck}. Note that on some systems,
-the C runtime makes calls to @code{malloc} prior to calling @code{main}, and if
-@code{free} is ever called with these pointers after calling
-@code{mmcheck} to enable checking, a memory corruption abort is certain
-to occur. These systems can still use @code{mmalloc}, but must define
-@code{NO_MMCHECK}.
-
-@item MMCHECK_FORCE
-Define this to 1 if the C runtime allocates memory prior to
-@code{mmcheck} being called, but that memory is never freed so we don't
-have to worry about it triggering a memory corruption abort. The
-default is 0, which means that @code{mmcheck} will only install the heap
-checking functions if there has not yet been any memory allocation
-calls, and if it fails to install the functions, @value{GDBN} will issue a
-warning. This is currently defined if you configure using
-@samp{--with-mmalloc}.
-
@item NO_SIGINTERRUPT
@findex siginterrupt
Define this to indicate that @code{siginterrupt} is not available.
@@ -3161,10 +3117,6 @@ Define this to be the amount by which to decrement the PC after the
program encounters a breakpoint. This is often the number of bytes in
@code{BREAKPOINT}, though not always. For most targets this value will be 0.
-@item DECR_PC_AFTER_HW_BREAK
-@findex DECR_PC_AFTER_HW_BREAK
-Similarly, for hardware breakpoints.
-
@item DISABLE_UNSETTABLE_BREAK (@var{addr})
@findex DISABLE_UNSETTABLE_BREAK
If defined, this should evaluate to 1 if @var{addr} is in a shared
@@ -3222,18 +3174,18 @@ into @var{valbuf}.
This method has been deprecated in favour of @code{gdbarch_return_value}
(@pxref{gdbarch_return_value}).
-@item EXTRACT_STRUCT_VALUE_ADDRESS(@var{regbuf})
-@findex EXTRACT_STRUCT_VALUE_ADDRESS
-@anchor{EXTRACT_STRUCT_VALUE_ADDRESS}
+@item DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(@var{regbuf})
+@findex DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS
+@anchor{DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS}
When defined, extract from the array @var{regbuf} (containing the raw
register state) the @code{CORE_ADDR} at which a function should return
its structure value.
@xref{gdbarch_return_value}.
-@item EXTRACT_STRUCT_VALUE_ADDRESS_P()
-@findex EXTRACT_STRUCT_VALUE_ADDRESS_P
-Predicate for @code{EXTRACT_STRUCT_VALUE_ADDRESS}.
+@item DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P()
+@findex DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P
+Predicate for @code{DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS}.
@item DEPRECATED_FP_REGNUM
@findex DEPRECATED_FP_REGNUM
@@ -3715,13 +3667,6 @@ be the number (greater than or equal to zero) of that register.
This should only need to be defined if @code{TARGET_READ_PC} and
@code{TARGET_WRITE_PC} are not defined.
-@item DEPRECATED_NPC_REGNUM
-@findex DEPRECATED_NPC_REGNUM
-The number of the ``next program counter'' register, if defined.
-
-@code{DEPRECATED_NPC_REGNUM} has been replaced by @code{TARGET_WRITE_PC}
-(@pxref{TARGET_WRITE_PC}).
-
@item PARM_BOUNDARY
@findex PARM_BOUNDARY
If non-zero, round arguments to a boundary of this many bits before
@@ -3849,7 +3794,7 @@ non-@code{NULL}, also copy the return value from @var{regcache} into
@var{readbuf} (@var{regcache} contains a copy of the registers from the
just returned function).
-@xref{EXTRACT_STRUCT_VALUE_ADDRESS}, for a description of how
+@xref{DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS}, for a description of how
return-values that use the struct convention are handled.
@emph{Maintainer note: This method replaces separate predicate, extract,
@@ -5132,6 +5077,23 @@ This warning includes uses of the assignment operator within an
@item -Wpointer-arith
@item -Wuninitialized
+
+@item -Wunused-label
+This warning has the additional benefit of detecting the absence of the
+@code{case} reserved word in a switch statement:
+@smallexample
+enum @{ FD_SCHEDULED, NOTHING_SCHEDULED @} sched;
+@dots{}
+switch (sched)
+ @{
+ case FD_SCHEDULED:
+ @dots{};
+ break;
+ NOTHING_SCHEDULED:
+ @dots{};
+ break;
+ @}
+@end smallexample
@end table
@emph{Pragmatics: Due to the way that @value{GDBN} is implemented most
diff --git a/gdb/dwarf2-frame.c b/gdb/dwarf2-frame.c
index 84bc1c2..5a55976 100644
--- a/gdb/dwarf2-frame.c
+++ b/gdb/dwarf2-frame.c
@@ -1,6 +1,6 @@
/* Frame unwinder for frames with DWARF Call Frame Information.
- Copyright 2003 Free Software Foundation, Inc.
+ Copyright 2003, 2004 Free Software Foundation, Inc.
Contributed by Mark Kettenis.
@@ -97,49 +97,13 @@ static struct dwarf2_fde *dwarf2_frame_find_fde (CORE_ADDR *pc);
/* Structure describing a frame state. */
-enum dwarf2_reg_rule
-{
- /* Make certain that 0 maps onto the correct enum value; the
- corresponding structure is being initialized using memset zero.
- This indicates that CFI didn't provide any information at all
- about a register, leaving how to obtain its value totally
- unspecified. */
- REG_UNSPECIFIED = 0,
-
- /* The term "undefined" comes from the DWARF2 CFI spec which this
- code is moddeling; it indicates that the register's value is
- "undefined". GCC uses the less formal term "unsaved". Its
- definition is a combination of REG_UNDEFINED and REG_UNSPECIFIED.
- The failure to differentiate the two helps explain a few problems
- with the CFI generated by GCC. */
- REG_UNDEFINED,
- REG_SAVED_OFFSET,
- REG_SAVED_REG,
- REG_SAVED_EXP,
- REG_SAME_VALUE,
-
- /* These aren't defined by the DWARF2 CFI specification, but are
- used internally by GDB. */
- REG_RA, /* Return Address. */
- REG_CFA /* Call Frame Address. */
-};
-
struct dwarf2_frame_state
{
/* Each register save state can be described in terms of a CFA slot,
another register, or a location expression. */
struct dwarf2_frame_state_reg_info
{
- struct dwarf2_frame_state_reg
- {
- union {
- LONGEST offset;
- ULONGEST reg;
- unsigned char *exp;
- } loc;
- ULONGEST exp_len;
- enum dwarf2_reg_rule how;
- } *reg;
+ struct dwarf2_frame_state_reg *reg;
int num_regs;
/* Used to implement DW_CFA_remember_state. */
@@ -242,12 +206,13 @@ static CORE_ADDR
read_reg (void *baton, int reg)
{
struct frame_info *next_frame = (struct frame_info *) baton;
+ struct gdbarch *gdbarch = get_frame_arch (next_frame);
int regnum;
char *buf;
regnum = DWARF2_REG_TO_REGNUM (reg);
- buf = (char *) alloca (register_size (current_gdbarch, regnum));
+ buf = (char *) alloca (register_size (gdbarch, regnum));
frame_unwind_register (next_frame, regnum, buf);
return extract_typed_address (buf, builtin_type_void_data_ptr);
}
@@ -321,7 +286,7 @@ execute_cfa_program (unsigned char *insn_ptr, unsigned char *insn_end,
insn_ptr = read_uleb128 (insn_ptr, insn_end, &utmp);
offset = utmp * fs->data_align;
dwarf2_frame_state_alloc_regs (&fs->regs, reg + 1);
- fs->regs.reg[reg].how = REG_SAVED_OFFSET;
+ fs->regs.reg[reg].how = DWARF2_FRAME_REG_SAVED_OFFSET;
fs->regs.reg[reg].loc.offset = offset;
}
else if ((insn & 0xc0) == DW_CFA_restore)
@@ -361,7 +326,7 @@ execute_cfa_program (unsigned char *insn_ptr, unsigned char *insn_end,
insn_ptr = read_uleb128 (insn_ptr, insn_end, &utmp);
offset = utmp * fs->data_align;
dwarf2_frame_state_alloc_regs (&fs->regs, reg + 1);
- fs->regs.reg[reg].how = REG_SAVED_OFFSET;
+ fs->regs.reg[reg].how = DWARF2_FRAME_REG_SAVED_OFFSET;
fs->regs.reg[reg].loc.offset = offset;
break;
@@ -375,20 +340,20 @@ execute_cfa_program (unsigned char *insn_ptr, unsigned char *insn_end,
case DW_CFA_undefined:
insn_ptr = read_uleb128 (insn_ptr, insn_end, &reg);
dwarf2_frame_state_alloc_regs (&fs->regs, reg + 1);
- fs->regs.reg[reg].how = REG_UNDEFINED;
+ fs->regs.reg[reg].how = DWARF2_FRAME_REG_UNDEFINED;
break;
case DW_CFA_same_value:
insn_ptr = read_uleb128 (insn_ptr, insn_end, &reg);
dwarf2_frame_state_alloc_regs (&fs->regs, reg + 1);
- fs->regs.reg[reg].how = REG_SAME_VALUE;
+ fs->regs.reg[reg].how = DWARF2_FRAME_REG_SAME_VALUE;
break;
case DW_CFA_register:
insn_ptr = read_uleb128 (insn_ptr, insn_end, &reg);
insn_ptr = read_uleb128 (insn_ptr, insn_end, &utmp);
dwarf2_frame_state_alloc_regs (&fs->regs, reg + 1);
- fs->regs.reg[reg].how = REG_SAVED_REG;
+ fs->regs.reg[reg].how = DWARF2_FRAME_REG_SAVED_REG;
fs->regs.reg[reg].loc.reg = utmp;
break;
@@ -432,6 +397,9 @@ execute_cfa_program (unsigned char *insn_ptr, unsigned char *insn_end,
/* cfa_how deliberately not set. */
break;
+ case DW_CFA_nop:
+ break;
+
case DW_CFA_def_cfa_expression:
insn_ptr = read_uleb128 (insn_ptr, insn_end, &fs->cfa_exp_len);
fs->cfa_exp = insn_ptr;
@@ -445,11 +413,30 @@ execute_cfa_program (unsigned char *insn_ptr, unsigned char *insn_end,
insn_ptr = read_uleb128 (insn_ptr, insn_end, &utmp);
fs->regs.reg[reg].loc.exp = insn_ptr;
fs->regs.reg[reg].exp_len = utmp;
- fs->regs.reg[reg].how = REG_SAVED_EXP;
+ fs->regs.reg[reg].how = DWARF2_FRAME_REG_SAVED_EXP;
insn_ptr += utmp;
break;
- case DW_CFA_nop:
+ case DW_CFA_offset_extended_sf:
+ insn_ptr = read_uleb128 (insn_ptr, insn_end, &reg);
+ insn_ptr = read_sleb128 (insn_ptr, insn_end, &offset);
+ offset += fs->data_align;
+ dwarf2_frame_state_alloc_regs (&fs->regs, reg + 1);
+ fs->regs.reg[reg].how = DWARF2_FRAME_REG_SAVED_OFFSET;
+ fs->regs.reg[reg].loc.offset = offset;
+ break;
+
+ case DW_CFA_def_cfa_sf:
+ insn_ptr = read_uleb128 (insn_ptr, insn_end, &fs->cfa_reg);
+ insn_ptr = read_sleb128 (insn_ptr, insn_end, &offset);
+ fs->cfa_offset = offset * fs->data_align;
+ fs->cfa_how = CFA_REG_OFFSET;
+ break;
+
+ case DW_CFA_def_cfa_offset_sf:
+ insn_ptr = read_sleb128 (insn_ptr, insn_end, &offset);
+ fs->cfa_offset = offset * fs->data_align;
+ /* cfa_how deliberately not set. */
break;
case DW_CFA_GNU_args_size:
@@ -478,10 +465,47 @@ struct dwarf2_frame_cache
struct dwarf2_frame_state_reg *reg;
};
+/* Initialize the register state REG. If we have a register that acts
+ as a program counter, mark it as a destination for the return
+ address. If we have a register that serves as the stack pointer,
+ arrange for it to be filled with the call frame address (CFA). The
+ other registers are marked as unspecified.
+
+ We copy the return address to the program counter, since many parts
+ in GDB assume that it is possible to get the return address by
+ unwind the program counter register. However, on ISA's with a
+ dedicated return address register, the CFI usually only contains
+ information to unwind that return address register.
+
+ The reason we're treating the stack pointer special here is because
+ in many cases GCC doesn't emit CFI for the stack pointer and
+ implicitly assumes that it is equal to the CFA. This makes some
+ sense since the DWARF specification (version 3, draft 8, p. 102)
+ says that:
+
+ "Typically, the CFA is defined to be the value of the stack pointer
+ at the call site in the previous frame (which may be different from
+ its value on entry to the current frame)."
+
+ However, this isn't true for all platforms supported by GCC
+ (e.g. IBM S/390 and zSeries). For those targets we should override
+ the defaults given here. */
+
+static void
+dwarf2_frame_init_reg (struct gdbarch *gdbarch, int regnum,
+ struct dwarf2_frame_state_reg *reg)
+{
+ if (regnum == PC_REGNUM)
+ reg->how = DWARF2_FRAME_REG_RA;
+ else if (regnum == SP_REGNUM)
+ reg->how = DWARF2_FRAME_REG_CFA;
+}
+
static struct dwarf2_frame_cache *
dwarf2_frame_cache (struct frame_info *next_frame, void **this_cache)
{
struct cleanup *old_chain;
+ struct gdbarch *gdbarch = get_frame_arch (next_frame);
const int num_regs = NUM_REGS + NUM_PSEUDO_REGS;
struct dwarf2_frame_cache *cache;
struct dwarf2_frame_state *fs;
@@ -553,43 +577,12 @@ dwarf2_frame_cache (struct frame_info *next_frame, void **this_cache)
internal_error (__FILE__, __LINE__, "Unknown CFA rule.");
}
- /* Initialize the register rules. If we have a register that acts
- as a program counter, mark it as a destination for the return
- address. If we have a register that serves as the stack pointer,
- arrange for it to be filled with the call frame address (CFA).
- The other registers are marked as unspecified.
-
- We copy the return address to the program counter, since many
- parts in GDB assume that it is possible to get the return address
- by unwind the program counter register. However, on ISA's with a
- dedicated return address register, the CFI usually only contains
- information to unwind that return address register.
-
- The reason we're treating the stack pointer special here is
- because in many cases GCC doesn't emit CFI for the stack pointer
- and implicitly assumes that it is equal to the CFA. This makes
- some sense since the DWARF specification (version 3, draft 8,
- p. 102) says that:
-
- "Typically, the CFA is defined to be the value of the stack
- pointer at the call site in the previous frame (which may be
- different from its value on entry to the current frame)."
-
- However, this isn't true for all platforms supported by GCC
- (e.g. IBM S/390 and zSeries). For those targets we should
- override the defaults given here. */
+ /* Initialize the register state. */
{
int regnum;
for (regnum = 0; regnum < num_regs; regnum++)
- {
- if (regnum == PC_REGNUM)
- cache->reg[regnum].how = REG_RA;
- else if (regnum == SP_REGNUM)
- cache->reg[regnum].how = REG_CFA;
- else
- cache->reg[regnum].how = REG_UNSPECIFIED;
- }
+ dwarf2_frame_init_reg (gdbarch, regnum, &cache->reg[regnum]);
}
/* Go through the DWARF2 CFI generated table and save its register
@@ -622,7 +615,7 @@ dwarf2_frame_cache (struct frame_info *next_frame, void **this_cache)
problems when a debug info register falls outside of the
table. We need a way of iterating through all the valid
DWARF2 register numbers. */
- if (fs->regs.reg[column].how == REG_UNSPECIFIED)
+ if (fs->regs.reg[column].how == DWARF2_FRAME_REG_UNSPECIFIED)
complaint (&symfile_complaints,
"Incomplete CFI data; unspecified registers at 0x%s",
paddr (fs->pc));
@@ -631,24 +624,32 @@ dwarf2_frame_cache (struct frame_info *next_frame, void **this_cache)
}
}
- /* Eliminate any REG_RA rules. */
+ /* Eliminate any DWARF2_FRAME_REG_RA rules. */
{
int regnum;
for (regnum = 0; regnum < num_regs; regnum++)
{
- if (cache->reg[regnum].how == REG_RA)
+ if (cache->reg[regnum].how == DWARF2_FRAME_REG_RA)
{
- if (fs->retaddr_column < fs->regs.num_regs)
- cache->reg[regnum] = fs->regs.reg[fs->retaddr_column];
+ struct dwarf2_frame_state_reg *retaddr_reg =
+ &fs->regs.reg[fs->retaddr_column];
+
+ /* It seems rather bizarre to specify an "empty" column as
+ the return adress column. However, this is exactly
+ what GCC does on some targets. It turns out that GCC
+ assumes that the return address can be found in the
+ register corresponding to the return address column.
+ Incidentally, that's how should treat a return address
+ column specifying "same value" too. */
+ if (fs->retaddr_column < fs->regs.num_regs
+ && retaddr_reg->how != DWARF2_FRAME_REG_UNSPECIFIED
+ && retaddr_reg->how != DWARF2_FRAME_REG_SAME_VALUE)
+ cache->reg[regnum] = *retaddr_reg;
else
{
- /* It turns out that GCC assumes that if the return
- address column is "empty" the return address can be
- found in the register corresponding to the return
- address column. */
cache->reg[regnum].loc.reg = fs->retaddr_column;
- cache->reg[regnum].how = REG_SAVED_REG;
+ cache->reg[regnum].how = DWARF2_FRAME_REG_SAVED_REG;
}
}
}
@@ -676,12 +677,13 @@ dwarf2_frame_prev_register (struct frame_info *next_frame, void **this_cache,
enum lval_type *lvalp, CORE_ADDR *addrp,
int *realnump, void *valuep)
{
+ struct gdbarch *gdbarch = get_frame_arch (next_frame);
struct dwarf2_frame_cache *cache =
dwarf2_frame_cache (next_frame, this_cache);
switch (cache->reg[regnum].how)
{
- case REG_UNDEFINED:
+ case DWARF2_FRAME_REG_UNDEFINED:
/* If CFI explicitly specified that the value isn't defined,
mark it as optimized away; the value isn't available. */
*optimizedp = 1;
@@ -697,7 +699,7 @@ dwarf2_frame_prev_register (struct frame_info *next_frame, void **this_cache,
}
break;
- case REG_SAVED_OFFSET:
+ case DWARF2_FRAME_REG_SAVED_OFFSET:
*optimizedp = 0;
*lvalp = lval_memory;
*addrp = cache->cfa + cache->reg[regnum].loc.offset;
@@ -705,18 +707,17 @@ dwarf2_frame_prev_register (struct frame_info *next_frame, void **this_cache,
if (valuep)
{
/* Read the value in from memory. */
- read_memory (*addrp, valuep,
- register_size (current_gdbarch, regnum));
+ read_memory (*addrp, valuep, register_size (gdbarch, regnum));
}
break;
- case REG_SAVED_REG:
+ case DWARF2_FRAME_REG_SAVED_REG:
regnum = DWARF2_REG_TO_REGNUM (cache->reg[regnum].loc.reg);
frame_register_unwind (next_frame, regnum,
optimizedp, lvalp, addrp, realnump, valuep);
break;
- case REG_SAVED_EXP:
+ case DWARF2_FRAME_REG_SAVED_EXP:
*optimizedp = 0;
*lvalp = lval_memory;
*addrp = execute_stack_op (cache->reg[regnum].loc.exp,
@@ -726,12 +727,11 @@ dwarf2_frame_prev_register (struct frame_info *next_frame, void **this_cache,
if (valuep)
{
/* Read the value in from memory. */
- read_memory (*addrp, valuep,
- register_size (current_gdbarch, regnum));
+ read_memory (*addrp, valuep, register_size (gdbarch, regnum));
}
break;
- case REG_UNSPECIFIED:
+ case DWARF2_FRAME_REG_UNSPECIFIED:
/* GCC, in its infinite wisdom decided to not provide unwind
information for registers that are "same value". Since
DWARF2 (3 draft 7) doesn't define such behavior, said
@@ -743,12 +743,12 @@ dwarf2_frame_prev_register (struct frame_info *next_frame, void **this_cache,
optimizedp, lvalp, addrp, realnump, valuep);
break;
- case REG_SAME_VALUE:
+ case DWARF2_FRAME_REG_SAME_VALUE:
frame_register_unwind (next_frame, regnum,
optimizedp, lvalp, addrp, realnump, valuep);
break;
- case REG_CFA:
+ case DWARF2_FRAME_REG_CFA:
*optimizedp = 0;
*lvalp = not_lval;
*addrp = 0;
@@ -1211,7 +1211,7 @@ decode_frame_entry_1 (struct comp_unit *unit, char *start, int eh_frame_p)
return end;
cie = (struct dwarf2_cie *)
- obstack_alloc (&unit->objfile->psymbol_obstack,
+ obstack_alloc (&unit->objfile->objfile_obstack,
sizeof (struct dwarf2_cie));
cie->initial_instructions = NULL;
cie->cie_pointer = cie_pointer;
@@ -1327,7 +1327,7 @@ decode_frame_entry_1 (struct comp_unit *unit, char *start, int eh_frame_p)
return NULL;
fde = (struct dwarf2_fde *)
- obstack_alloc (&unit->objfile->psymbol_obstack,
+ obstack_alloc (&unit->objfile->objfile_obstack,
sizeof (struct dwarf2_fde));
fde->cie = find_cie (unit, cie_pointer);
if (fde->cie == NULL)
diff --git a/gdb/dwarf2-frame.h b/gdb/dwarf2-frame.h
index c9c106f..b650a84 100644
--- a/gdb/dwarf2-frame.h
+++ b/gdb/dwarf2-frame.h
@@ -1,6 +1,6 @@
/* Frame unwinder for frames with DWARF Call Frame Information.
- Copyright 2003 Free Software Foundation, Inc.
+ Copyright 2003, 2004 Free Software Foundation, Inc.
Contributed by Mark Kettenis.
@@ -27,15 +27,61 @@
struct objfile;
struct frame_info;
+/* Register rule. */
+
+enum dwarf2_frame_reg_rule
+{
+ /* Make certain that 0 maps onto the correct enum value; the
+ corresponding structure is being initialized using memset zero.
+ This indicates that CFI didn't provide any information at all
+ about a register, leaving how to obtain its value totally
+ unspecified. */
+ DWARF2_FRAME_REG_UNSPECIFIED = 0,
+
+ /* The term "undefined" comes from the DWARF2 CFI spec which this
+ code is moddeling; it indicates that the register's value is
+ "undefined". GCC uses the less formal term "unsaved". Its
+ definition is a combination of REG_UNDEFINED and REG_UNSPECIFIED.
+ The failure to differentiate the two helps explain a few problems
+ with the CFI generated by GCC. */
+ DWARF2_FRAME_REG_UNDEFINED,
+ DWARF2_FRAME_REG_SAVED_OFFSET,
+ DWARF2_FRAME_REG_SAVED_REG,
+ DWARF2_FRAME_REG_SAVED_EXP,
+ DWARF2_FRAME_REG_SAME_VALUE,
+
+ /* These aren't defined by the DWARF2 CFI specification, but are
+ used internally by GDB. */
+ DWARF2_FRAME_REG_RA, /* Return Address. */
+ DWARF2_FRAME_REG_CFA /* Call Frame Address. */
+};
+
+/* Register state. */
+
+struct dwarf2_frame_state_reg
+{
+ /* Each register save state can be described in terms of a CFA slot,
+ another register, or a location expression. */
+ union {
+ LONGEST offset;
+ ULONGEST reg;
+ unsigned char *exp;
+ } loc;
+ ULONGEST exp_len;
+ enum dwarf2_frame_reg_rule how;
+};
+
/* Return the frame unwind methods for the function that contains PC,
or NULL if it can't be handled by DWARF CFI frame unwinder. */
-const struct frame_unwind *dwarf2_frame_sniffer (struct frame_info *next_frame);
+extern const struct frame_unwind *
+ dwarf2_frame_sniffer (struct frame_info *next_frame);
/* Return the frame base methods for the function that contains PC, or
NULL if it can't be handled by the DWARF CFI frame unwinder. */
-const struct frame_base *dwarf2_frame_base_sniffer (struct frame_info *next_frame);
+extern const struct frame_base *
+ dwarf2_frame_base_sniffer (struct frame_info *next_frame);
/* Register the DWARF CFI for OBJFILE. */
diff --git a/gdb/dwarf2expr.c b/gdb/dwarf2expr.c
index cf00929..50baced 100644
--- a/gdb/dwarf2expr.c
+++ b/gdb/dwarf2expr.c
@@ -562,7 +562,7 @@ execute_stack_op (struct dwarf_expr_context *ctx, unsigned char *op_ptr,
second = dwarf_expr_fetch (ctx, 0);
dwarf_expr_pop (ctx);
- first = dwarf_expr_fetch (ctx, 1);
+ first = dwarf_expr_fetch (ctx, 0);
dwarf_expr_pop (ctx);
val1 = value_from_longest (unsigned_address_type (), first);
@@ -660,7 +660,7 @@ execute_stack_op (struct dwarf_expr_context *ctx, unsigned char *op_ptr,
goto no_push;
default:
- error ("Unhandled dwarf expression opcode");
+ error ("Unhandled dwarf expression opcode 0x%x", op);
}
/* Most things push a result value. */
diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
index fac5c4a..ef333f7 100644
--- a/gdb/dwarf2loc.c
+++ b/gdb/dwarf2loc.c
@@ -154,7 +154,7 @@ dwarf_expr_frame_base (void *baton, unsigned char **start, size_t * length)
framefunc = get_frame_function (debaton->frame);
- if (SYMBOL_LOCATION_FUNCS (framefunc) == &dwarf2_loclist_funcs)
+ if (SYMBOL_OPS (framefunc) == &dwarf2_loclist_funcs)
{
struct dwarf2_loclist_baton *symbaton;
symbaton = SYMBOL_LOCATION_BATON (framefunc);
@@ -465,7 +465,7 @@ locexpr_tracepoint_var_ref (struct symbol * symbol, struct agent_expr * ax,
/* The set of location functions used with the DWARF-2 expression
evaluator. */
-struct location_funcs dwarf2_locexpr_funcs = {
+const struct symbol_ops dwarf2_locexpr_funcs = {
locexpr_read_variable,
locexpr_read_needs_frame,
locexpr_describe_location,
@@ -537,7 +537,7 @@ loclist_tracepoint_var_ref (struct symbol * symbol, struct agent_expr * ax,
/* The set of location functions used with the DWARF-2 expression
evaluator and location lists. */
-struct location_funcs dwarf2_loclist_funcs = {
+const struct symbol_ops dwarf2_loclist_funcs = {
loclist_read_variable,
loclist_read_needs_frame,
loclist_describe_location,
diff --git a/gdb/dwarf2loc.h b/gdb/dwarf2loc.h
index 321cb03..ce0a8ef 100644
--- a/gdb/dwarf2loc.h
+++ b/gdb/dwarf2loc.h
@@ -21,6 +21,8 @@
#if !defined (DWARF2LOC_H)
#define DWARF2LOC_H
+struct symbol_ops;
+
/* This header is private to the DWARF-2 reader. It is shared between
dwarf2read.c and dwarf2loc.c. */
@@ -62,7 +64,7 @@ struct dwarf2_loclist_baton
struct objfile *objfile;
};
-extern struct location_funcs dwarf2_locexpr_funcs;
-extern struct location_funcs dwarf2_loclist_funcs;
+extern const struct symbol_ops dwarf2_locexpr_funcs;
+extern const struct symbol_ops dwarf2_loclist_funcs;
#endif
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index b3c2be9..c77dc9c 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -231,6 +231,34 @@ struct dwarf2_cu
should be moved to the dwarf2_cu structure; for instance the abbrevs
hash table. */
struct comp_unit_head header;
+
+ struct function_range *first_fn, *last_fn, *cached_fn;
+
+ /* The language we are debugging. */
+ enum language language;
+ const struct language_defn *language_defn;
+
+ /* The generic symbol table building routines have separate lists for
+ file scope symbols and all all other scopes (local scopes). So
+ we need to select the right one to pass to add_symbol_to_list().
+ We do it by keeping a pointer to the correct list in list_in_scope.
+
+ FIXME: The original dwarf code just treated the file scope as the
+ first local scope, and all other local scopes as nested local
+ scopes, and worked fine. Check to see if we really need to
+ distinguish these in buildsym.c. */
+ struct pending **list_in_scope;
+
+ /* Maintain an array of referenced fundamental types for the current
+ compilation unit being read. For DWARF version 1, we have to construct
+ the fundamental types on the fly, since no information about the
+ fundamental types is supplied. Each such fundamental type is created by
+ calling a language dependent routine to create the type, and then a
+ pointer to that type is then placed in the array at the index specified
+ by it's FT_<TYPENAME> value. The array has a fixed size set by the
+ FT_NUM_MEMBERS compile time constant, which is the number of predefined
+ fundamental types gdb knows how to construct. */
+ struct type *ftypes[FT_NUM_MEMBERS]; /* Fundamental types */
};
/* The line number information for a compilation unit (found in the
@@ -360,8 +388,6 @@ struct function_range
struct function_range *next;
};
-static struct function_range *cu_first_fn, *cu_last_fn, *cu_cached_fn;
-
/* Get at parts of an attribute structure */
#define DW_STRING(attr) ((attr)->u.str)
@@ -391,19 +417,11 @@ static struct die_info *die_ref_table[REF_HASH_SIZE];
/* Obstack for allocating temporary storage used during symbol reading. */
static struct obstack dwarf2_tmp_obstack;
-/* Offset to the first byte of the current compilation unit header,
- for resolving relative reference dies. */
-static unsigned int cu_header_offset;
-
/* Allocate fields for structs, unions and enums in this size. */
#ifndef DW_FIELD_ALLOC_CHUNK
#define DW_FIELD_ALLOC_CHUNK 4
#endif
-/* The language we are debugging. */
-static enum language cu_language;
-static const struct language_defn *cu_language_defn;
-
/* Actually data from the sections. */
static char *dwarf_info_buffer;
static char *dwarf_abbrev_buffer;
@@ -416,17 +434,6 @@ static char *dwarf_loc_buffer;
/* A zeroed version of a partial die for initialization purposes. */
static struct partial_die_info zeroed_partial_die;
-/* The generic symbol table building routines have separate lists for
- file scope symbols and all all other scopes (local scopes). So
- we need to select the right one to pass to add_symbol_to_list().
- We do it by keeping a pointer to the correct list in list_in_scope.
-
- FIXME: The original dwarf code just treated the file scope as the first
- local scope, and all other local scopes as nested local scopes, and worked
- fine. Check to see if we really need to distinguish these
- in buildsym.c. */
-static struct pending **list_in_scope = &file_symbols;
-
/* FIXME: decode_locdesc sets these variables to describe the location
to the caller. These ought to be a structure or something. If
none of the flags are set, the object lives at the address returned
@@ -436,15 +443,10 @@ static int isreg; /* Object lives in register.
decode_locdesc's return value is
the register number. */
-/* This value is added to each symbol value. FIXME: Generalize to
- the section_offsets structure used by dbxread (once this is done,
- pass the appropriate section number to end_symtab). */
-static CORE_ADDR baseaddr; /* Add to each symbol value */
-
/* We put a pointer to this structure in the read_symtab_private field
of the psymtab.
The complete dwarf information for an objfile is kept in the
- psymbol_obstack, so that absolute die references can be handled.
+ objfile_obstack, so that absolute die references can be handled.
Most of the information in this structure is related to an entire
object file and could be passed via the sym_private field of the objfile.
It is however conceivable that dwarf2 might not be the only type
@@ -525,17 +527,6 @@ struct dwarf2_pinfo
#define DWARF_LOC_BUFFER(p) (PST_PRIVATE(p)->dwarf_loc_buffer)
#define DWARF_LOC_SIZE(p) (PST_PRIVATE(p)->dwarf_loc_size)
-/* Maintain an array of referenced fundamental types for the current
- compilation unit being read. For DWARF version 1, we have to construct
- the fundamental types on the fly, since no information about the
- fundamental types is supplied. Each such fundamental type is created by
- calling a language dependent routine to create the type, and then a
- pointer to that type is then placed in the array at the index specified
- by it's FT_<TYPENAME> value. The array has a fixed size set by the
- FT_NUM_MEMBERS compile time constant, which is the number of predefined
- fundamental types gdb knows how to construct. */
-static struct type *ftypes[FT_NUM_MEMBERS]; /* Fundamental types */
-
/* FIXME: We might want to set this from BFD via bfd_arch_bits_per_byte,
but this would require a corresponding change in unpack_field_as_long
and friends. */
@@ -592,13 +583,6 @@ struct field_info
/* Various complaints about symbol reading that don't abort the process */
static void
-dwarf2_non_const_array_bound_ignored_complaint (const char *arg1)
-{
- complaint (&symfile_complaints, "non-constant array bounds form '%s' ignored",
- arg1);
-}
-
-static void
dwarf2_statement_list_fits_in_line_number_section_complaint (void)
{
complaint (&symfile_complaints,
@@ -612,13 +596,6 @@ dwarf2_complex_location_expr_complaint (void)
}
static void
-dwarf2_unsupported_at_frame_base_complaint (const char *arg1)
-{
- complaint (&symfile_complaints,
- "unsupported DW_AT_frame_base for function '%s'", arg1);
-}
-
-static void
dwarf2_const_value_length_mismatch_complaint (const char *arg1, int arg2,
int arg3)
{
@@ -666,12 +643,19 @@ static char *scan_partial_symbols (char *, CORE_ADDR *, CORE_ADDR *,
static void add_partial_symbol (struct partial_die_info *, struct dwarf2_cu *,
const char *namespace);
+static int pdi_needs_namespace (enum dwarf_tag tag, const char *namespace);
+
static char *add_partial_namespace (struct partial_die_info *pdi,
char *info_ptr,
CORE_ADDR *lowpc, CORE_ADDR *highpc,
struct dwarf2_cu *cu,
const char *namespace);
+static char *add_partial_structure (struct partial_die_info *struct_pdi,
+ char *info_ptr,
+ struct dwarf2_cu *cu,
+ const char *namespace);
+
static char *add_partial_enumeration (struct partial_die_info *enum_pdi,
char *info_ptr,
struct dwarf2_cu *cu,
@@ -737,11 +721,15 @@ static unsigned long read_unsigned_leb128 (bfd *, char *, unsigned int *);
static long read_signed_leb128 (bfd *, char *, unsigned int *);
-static void set_cu_language (unsigned int);
+static void set_cu_language (unsigned int, struct dwarf2_cu *);
+
+static struct attribute *dwarf2_attr (struct die_info *, unsigned int,
+ struct dwarf2_cu *);
-static struct attribute *dwarf_attr (struct die_info *, unsigned int);
+static int die_is_declaration (struct die_info *, struct dwarf2_cu *cu);
-static int die_is_declaration (struct die_info *);
+static struct die_info *die_specification (struct die_info *die,
+ struct dwarf2_cu *);
static void free_line_header (struct line_header *lh);
@@ -777,10 +765,20 @@ static struct type *tag_type_to_type (struct die_info *, struct dwarf2_cu *);
static void read_type_die (struct die_info *, struct dwarf2_cu *);
+static char *determine_prefix (struct die_info *die, struct dwarf2_cu *);
+
+static char *determine_prefix_aux (struct die_info *die, struct dwarf2_cu *);
+
+static char *typename_concat (const char *prefix, const char *suffix);
+
+static char *class_name (struct die_info *die, struct dwarf2_cu *);
+
static void read_typedef (struct die_info *, struct dwarf2_cu *);
static void read_base_type (struct die_info *, struct dwarf2_cu *);
+static void read_subrange_type (struct die_info *die, struct dwarf2_cu *cu);
+
static void read_file_scope (struct die_info *, struct dwarf2_cu *);
static void read_func_scope (struct die_info *, struct dwarf2_cu *);
@@ -790,6 +788,10 @@ static void read_lexical_block_scope (struct die_info *, struct dwarf2_cu *);
static int dwarf2_get_pc_bounds (struct die_info *,
CORE_ADDR *, CORE_ADDR *, struct dwarf2_cu *);
+static void get_scope_pc_bounds (struct die_info *,
+ CORE_ADDR *, CORE_ADDR *,
+ struct dwarf2_cu *);
+
static void dwarf2_add_field (struct field_info *, struct die_info *,
struct dwarf2_cu *);
@@ -810,7 +812,7 @@ static void read_common_block (struct die_info *, struct dwarf2_cu *);
static void read_namespace (struct die_info *die, struct dwarf2_cu *);
static const char *namespace_name (struct die_info *die,
- int *is_anonymous);
+ int *is_anonymous, struct dwarf2_cu *);
static void read_enumeration (struct die_info *, struct dwarf2_cu *);
@@ -853,11 +855,12 @@ static struct cleanup *make_cleanup_free_die_list (struct die_info *);
static void process_die (struct die_info *, struct dwarf2_cu *);
-static char *dwarf2_linkage_name (struct die_info *);
+static char *dwarf2_linkage_name (struct die_info *, struct dwarf2_cu *);
-static char *dwarf2_name (struct die_info *die);
+static char *dwarf2_name (struct die_info *die, struct dwarf2_cu *);
-static struct die_info *dwarf2_extension (struct die_info *die);
+static struct die_info *dwarf2_extension (struct die_info *die,
+ struct dwarf2_cu *);
static char *dwarf_tag_name (unsigned int);
@@ -887,11 +890,15 @@ static void store_in_ref_table (unsigned int, struct die_info *);
static void dwarf2_empty_hash_tables (void);
-static unsigned int dwarf2_get_ref_die_offset (struct attribute *);
+static unsigned int dwarf2_get_ref_die_offset (struct attribute *,
+ struct dwarf2_cu *);
+
+static int dwarf2_get_attr_constant_value (struct attribute *, int);
static struct die_info *follow_die_ref (unsigned int);
-static struct type *dwarf2_fundamental_type (struct objfile *, int);
+static struct type *dwarf2_fundamental_type (struct objfile *, int,
+ struct dwarf2_cu *);
/* memory allocation interface */
@@ -903,9 +910,10 @@ static struct abbrev_info *dwarf_alloc_abbrev (void);
static struct die_info *dwarf_alloc_die (void);
-static void initialize_cu_func_list (void);
+static void initialize_cu_func_list (struct dwarf2_cu *);
-static void add_to_cu_func_list (const char *, CORE_ADDR, CORE_ADDR);
+static void add_to_cu_func_list (const char *, CORE_ADDR, CORE_ADDR,
+ struct dwarf2_cu *);
static void dwarf_decode_macros (struct line_header *, unsigned int,
char *, bfd *, struct dwarf2_cu *);
@@ -1143,7 +1151,7 @@ dwarf2_build_psymtabs_hard (struct objfile *objfile, int mainline)
struct partial_die_info comp_unit_die;
struct partial_symtab *pst;
struct cleanup *back_to;
- CORE_ADDR lowpc, highpc;
+ CORE_ADDR lowpc, highpc, baseaddr;
info_ptr = dwarf_info_buffer;
abbrev_ptr = dwarf_abbrev_buffer;
@@ -1227,6 +1235,8 @@ dwarf2_build_psymtabs_hard (struct objfile *objfile, int mainline)
cu.header.first_die_ptr = info_ptr;
cu.header.cu_head_ptr = beg_of_comp_unit;
+ cu.list_in_scope = &file_symbols;
+
/* Read the abbrevs for this compilation unit into a table */
dwarf2_read_abbrevs (abfd, &cu);
make_cleanup (dwarf2_empty_abbrev_table, cu.header.dwarf2_abbrevs);
@@ -1236,7 +1246,7 @@ dwarf2_build_psymtabs_hard (struct objfile *objfile, int mainline)
&cu);
/* Set the language we're debugging */
- set_cu_language (comp_unit_die.language);
+ set_cu_language (comp_unit_die.language, &cu);
/* Allocate a new partial symbol table structure */
pst = start_psymtab_common (objfile, objfile->section_offsets,
@@ -1246,8 +1256,7 @@ dwarf2_build_psymtabs_hard (struct objfile *objfile, int mainline)
objfile->static_psymbols.next);
pst->read_symtab_private = (char *)
- obstack_alloc (&objfile->psymbol_obstack, sizeof (struct dwarf2_pinfo));
- cu_header_offset = beg_of_comp_unit - dwarf_info_buffer;
+ obstack_alloc (&objfile->objfile_obstack, sizeof (struct dwarf2_pinfo));
DWARF_INFO_BUFFER (pst) = dwarf_info_buffer;
DWARF_INFO_OFFSET (pst) = beg_of_comp_unit - dwarf_info_buffer;
DWARF_ABBREV_BUFFER (pst) = dwarf_abbrev_buffer;
@@ -1368,11 +1377,18 @@ scan_partial_symbols (char *info_ptr, CORE_ADDR *lowpc,
case DW_TAG_variable:
case DW_TAG_typedef:
case DW_TAG_union_type:
+ if (!pdi.is_declaration)
+ {
+ add_partial_symbol (&pdi, cu, namespace);
+ }
+ break;
case DW_TAG_class_type:
case DW_TAG_structure_type:
if (!pdi.is_declaration)
{
- add_partial_symbol (&pdi, cu, namespace);
+ info_ptr = add_partial_structure (&pdi, info_ptr, cu,
+ namespace);
+ info_ptr_updated = 1;
}
break;
case DW_TAG_enumeration_type:
@@ -1384,6 +1400,7 @@ scan_partial_symbols (char *info_ptr, CORE_ADDR *lowpc,
}
break;
case DW_TAG_base_type:
+ case DW_TAG_subrange_type:
/* File scope base type definitions are added to the partial
symbol table. */
add_partial_symbol (&pdi, cu, namespace);
@@ -1429,6 +1446,20 @@ add_partial_symbol (struct partial_die_info *pdi,
CORE_ADDR addr = 0;
char *actual_name = pdi->name;
const struct partial_symbol *psym = NULL;
+ CORE_ADDR baseaddr;
+
+ baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
+
+ /* If we're not in the global namespace and if the namespace name
+ isn't encoded in a mangled actual_name, add it. */
+
+ if (pdi_needs_namespace (pdi->tag, namespace))
+ {
+ actual_name = alloca (strlen (pdi->name) + 2 + strlen (namespace) + 1);
+ strcpy (actual_name, namespace);
+ strcat (actual_name, "::");
+ strcat (actual_name, pdi->name);
+ }
switch (pdi->tag)
{
@@ -1441,7 +1472,7 @@ add_partial_symbol (struct partial_die_info *pdi,
VAR_DOMAIN, LOC_BLOCK,
&objfile->global_psymbols,
0, pdi->lowpc + baseaddr,
- cu_language, objfile);
+ cu->language, objfile);
}
else
{
@@ -1451,7 +1482,7 @@ add_partial_symbol (struct partial_die_info *pdi,
VAR_DOMAIN, LOC_BLOCK,
&objfile->static_psymbols,
0, pdi->lowpc + baseaddr,
- cu_language, objfile);
+ cu->language, objfile);
}
break;
case DW_TAG_variable:
@@ -1477,7 +1508,7 @@ add_partial_symbol (struct partial_die_info *pdi,
VAR_DOMAIN, LOC_STATIC,
&objfile->global_psymbols,
0, addr + baseaddr,
- cu_language, objfile);
+ cu->language, objfile);
}
else
{
@@ -1491,15 +1522,16 @@ add_partial_symbol (struct partial_die_info *pdi,
VAR_DOMAIN, LOC_STATIC,
&objfile->static_psymbols,
0, addr + baseaddr,
- cu_language, objfile);
+ cu->language, objfile);
}
break;
case DW_TAG_typedef:
case DW_TAG_base_type:
+ case DW_TAG_subrange_type:
add_psymbol_to_list (actual_name, strlen (actual_name),
VAR_DOMAIN, LOC_TYPEDEF,
&objfile->static_psymbols,
- 0, (CORE_ADDR) 0, cu_language, objfile);
+ 0, (CORE_ADDR) 0, cu->language, objfile);
break;
case DW_TAG_class_type:
case DW_TAG_structure_type:
@@ -1507,27 +1539,33 @@ add_partial_symbol (struct partial_die_info *pdi,
case DW_TAG_enumeration_type:
/* Skip aggregate types without children, these are external
references. */
+ /* NOTE: carlton/2003-10-07: See comment in new_symbol about
+ static vs. global. */
if (pdi->has_children == 0)
return;
add_psymbol_to_list (actual_name, strlen (actual_name),
STRUCT_DOMAIN, LOC_TYPEDEF,
- &objfile->static_psymbols,
- 0, (CORE_ADDR) 0, cu_language, objfile);
+ cu->language == language_cplus
+ ? &objfile->global_psymbols
+ : &objfile->static_psymbols,
+ 0, (CORE_ADDR) 0, cu->language, objfile);
- if (cu_language == language_cplus)
+ if (cu->language == language_cplus)
{
/* For C++, these implicitly act as typedefs as well. */
add_psymbol_to_list (actual_name, strlen (actual_name),
VAR_DOMAIN, LOC_TYPEDEF,
- &objfile->static_psymbols,
- 0, (CORE_ADDR) 0, cu_language, objfile);
+ &objfile->global_psymbols,
+ 0, (CORE_ADDR) 0, cu->language, objfile);
}
break;
case DW_TAG_enumerator:
add_psymbol_to_list (actual_name, strlen (actual_name),
VAR_DOMAIN, LOC_CONST,
- &objfile->static_psymbols,
- 0, (CORE_ADDR) 0, cu_language, objfile);
+ cu->language == language_cplus
+ ? &objfile->static_psymbols
+ : &objfile->global_psymbols,
+ 0, (CORE_ADDR) 0, cu->language, objfile);
break;
default:
break;
@@ -1539,7 +1577,7 @@ add_partial_symbol (struct partial_die_info *pdi,
(otherwise we'll have psym == NULL), and if we actually had a
mangled name to begin with. */
- if (cu_language == language_cplus
+ if (cu->language == language_cplus
&& namespace == NULL
&& psym != NULL
&& SYMBOL_CPLUS_DEMANGLED_NAME (psym) != NULL)
@@ -1547,6 +1585,30 @@ add_partial_symbol (struct partial_die_info *pdi,
objfile);
}
+/* Determine whether a die of type TAG living in the C++ namespace
+ NAMESPACE needs to have the name of the namespace prepended to the
+ name listed in the die. */
+
+static int
+pdi_needs_namespace (enum dwarf_tag tag, const char *namespace)
+{
+ if (namespace == NULL || namespace[0] == '\0')
+ return 0;
+
+ switch (tag)
+ {
+ case DW_TAG_typedef:
+ case DW_TAG_class_type:
+ case DW_TAG_structure_type:
+ case DW_TAG_union_type:
+ case DW_TAG_enumeration_type:
+ case DW_TAG_enumerator:
+ return 1;
+ default:
+ return 0;
+ }
+}
+
/* Read a partial die corresponding to a namespace; also, add a symbol
corresponding to that namespace to the symbol table. NAMESPACE is
the name of the enclosing namespace. */
@@ -1570,14 +1632,15 @@ add_partial_namespace (struct partial_die_info *pdi, char *info_ptr,
strcat (full_name, "::");
strcat (full_name, new_name);
- /* FIXME: carlton/2003-06-27: Once we build qualified names for more
- symbols than just namespaces, we should replace this by a call to
- add_partial_symbol. */
+ /* FIXME: carlton/2003-10-07: We can't just replace this by a call
+ to add_partial_symbol, because we don't have a way to pass in the
+ full name to that function; that might be a flaw in
+ add_partial_symbol's interface. */
add_psymbol_to_list (full_name, strlen (full_name),
VAR_DOMAIN, LOC_TYPEDEF,
&objfile->global_psymbols,
- 0, 0, cu_language, objfile);
+ 0, 0, cu->language, objfile);
/* Now scan partial symbols in that namespace. */
@@ -1587,6 +1650,78 @@ add_partial_namespace (struct partial_die_info *pdi, char *info_ptr,
return info_ptr;
}
+/* Read a partial die corresponding to a class or structure. */
+
+static char *
+add_partial_structure (struct partial_die_info *struct_pdi, char *info_ptr,
+ struct dwarf2_cu *cu,
+ const char *namespace)
+{
+ bfd *abfd = cu->objfile->obfd;
+ char *actual_class_name = NULL;
+
+ if (cu->language == language_cplus
+ && (namespace == NULL || namespace[0] == '\0')
+ && struct_pdi->name != NULL
+ && struct_pdi->has_children)
+ {
+ /* See if we can figure out if the class lives in a namespace
+ (or is nested within another class.) We do this by looking
+ for a member function; its demangled name will contain
+ namespace info, if there is any. */
+
+ /* NOTE: carlton/2003-10-07: Getting the info this way changes
+ what template types look like, because the demangler
+ frequently doesn't give the same name as the debug info. We
+ could fix this by only using the demangled name to get the
+ prefix (but see comment in read_structure_scope). */
+
+ /* FIXME: carlton/2004-01-23: If NAMESPACE equals "", we have
+ the appropriate debug information, so it would be nice to be
+ able to avoid this hack. But NAMESPACE may not be the
+ namespace where this class was defined: NAMESPACE reflects
+ where STRUCT_PDI occurs in the tree of dies, but because of
+ DW_AT_specification, that may not actually tell us where the
+ class is defined. (See the comment in read_func_scope for an
+ example of how this could occur.)
+
+ Unfortunately, our current partial symtab data structures are
+ completely unable to deal with DW_AT_specification. So, for
+ now, the best thing to do is to get nesting information from
+ places other than the tree structure of dies if there's any
+ chance that a DW_AT_specification is involved. :-( */
+
+ char *next_child = info_ptr;
+
+ while (1)
+ {
+ struct partial_die_info child_pdi;
+
+ next_child = read_partial_die (&child_pdi, abfd, next_child,
+ cu);
+ if (!child_pdi.tag)
+ break;
+ if (child_pdi.tag == DW_TAG_subprogram)
+ {
+ actual_class_name = class_name_from_physname (child_pdi.name);
+ if (actual_class_name != NULL)
+ struct_pdi->name = actual_class_name;
+ break;
+ }
+ else
+ {
+ next_child = locate_pdi_sibling (&child_pdi, next_child,
+ abfd, cu);
+ }
+ }
+ }
+
+ add_partial_symbol (struct_pdi, cu, namespace);
+ xfree (actual_class_name);
+
+ return locate_pdi_sibling (struct_pdi, info_ptr, abfd, cu);
+}
+
/* Read a partial die corresponding to an enumeration type. */
static char *
@@ -1691,6 +1826,7 @@ psymtab_to_symtab_1 (struct partial_symtab *pst)
struct symtab *symtab;
struct cleanup *back_to;
struct attribute *attr;
+ CORE_ADDR baseaddr;
/* Set local variables from the partial symbol table info. */
offset = DWARF_INFO_OFFSET (pst);
@@ -1707,9 +1843,11 @@ psymtab_to_symtab_1 (struct partial_symtab *pst)
dwarf_ranges_size = DWARF_RANGES_SIZE (pst);
dwarf_loc_buffer = DWARF_LOC_BUFFER (pst);
dwarf_loc_size = DWARF_LOC_SIZE (pst);
- baseaddr = ANOFFSET (pst->section_offsets, SECT_OFF_TEXT (objfile));
- cu_header_offset = offset;
info_ptr = dwarf_info_buffer + offset;
+ baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
+
+ /* We're in the global namespace. */
+ processing_current_prefix = "";
obstack_init (&dwarf2_tmp_obstack);
back_to = make_cleanup (dwarf2_free_tmp_obstack, NULL);
@@ -1726,6 +1864,10 @@ psymtab_to_symtab_1 (struct partial_symtab *pst)
dwarf2_read_abbrevs (abfd, &cu);
make_cleanup (dwarf2_empty_abbrev_table, cu.header.dwarf2_abbrevs);
+ cu.header.offset = offset;
+
+ cu.list_in_scope = &file_symbols;
+
dies = read_comp_unit (info_ptr, abfd, &cu);
make_cleanup_free_die_list (dies);
@@ -1739,7 +1881,7 @@ psymtab_to_symtab_1 (struct partial_symtab *pst)
cu.header.base_known = 0;
cu.header.base_address = 0;
- attr = dwarf_attr (dies, DW_AT_entry_pc);
+ attr = dwarf2_attr (dies, DW_AT_entry_pc, &cu);
if (attr)
{
cu.header.base_address = DW_ADDR (attr);
@@ -1747,7 +1889,7 @@ psymtab_to_symtab_1 (struct partial_symtab *pst)
}
else
{
- attr = dwarf_attr (dies, DW_AT_low_pc);
+ attr = dwarf2_attr (dies, DW_AT_low_pc, &cu);
if (attr)
{
cu.header.base_address = DW_ADDR (attr);
@@ -1758,39 +1900,20 @@ psymtab_to_symtab_1 (struct partial_symtab *pst)
/* Do line number decoding in read_file_scope () */
process_die (dies, &cu);
- if (!dwarf2_get_pc_bounds (dies, &lowpc, &highpc, &cu))
- {
- /* Some compilers don't define a DW_AT_high_pc attribute for
- the compilation unit. If the DW_AT_high_pc is missing,
- synthesize it, by scanning the DIE's below the compilation unit. */
- highpc = 0;
- if (dies->child != NULL)
- {
- child_die = dies->child;
- while (child_die && child_die->tag)
- {
- if (child_die->tag == DW_TAG_subprogram)
- {
- CORE_ADDR low, high;
+ /* Some compilers don't define a DW_AT_high_pc attribute for the
+ compilation unit. If the DW_AT_high_pc is missing, synthesize
+ it, by scanning the DIE's below the compilation unit. */
+ get_scope_pc_bounds (dies, &lowpc, &highpc, &cu);
- if (dwarf2_get_pc_bounds (child_die, &low, &high, &cu))
- {
- highpc = max (highpc, high);
- }
- }
- child_die = sibling_die (child_die);
- }
- }
- }
symtab = end_symtab (highpc + baseaddr, objfile, SECT_OFF_TEXT (objfile));
/* Set symtab language to language from DW_AT_language.
If the compilation is from a C file generated by language preprocessors,
do not set the language if it was already deduced by start_subfile. */
if (symtab != NULL
- && !(cu_language == language_c && symtab->language != language_c))
+ && !(cu.language == language_c && symtab->language != language_c))
{
- symtab->language = cu_language;
+ symtab->language = cu.language;
}
pst->symtab = symtab;
pst->readin = 1;
@@ -1852,23 +1975,27 @@ process_die (struct die_info *die, struct dwarf2_cu *cu)
break;
case DW_TAG_base_type:
read_base_type (die, cu);
- if (dwarf_attr (die, DW_AT_name))
+ if (dwarf2_attr (die, DW_AT_name, cu))
{
/* Add a typedef symbol for the base type definition. */
new_symbol (die, die->type, cu);
}
break;
+ case DW_TAG_subrange_type:
+ read_subrange_type (die, cu);
+ if (dwarf2_attr (die, DW_AT_name, cu))
+ {
+ /* Add a typedef symbol for the base type definition. */
+ new_symbol (die, die->type, cu);
+ }
+ break;
case DW_TAG_common_block:
read_common_block (die, cu);
break;
case DW_TAG_common_inclusion:
break;
case DW_TAG_namespace:
- if (!processing_has_namespace_info)
- {
- processing_has_namespace_info = 1;
- processing_current_prefix = "";
- }
+ processing_has_namespace_info = 1;
read_namespace (die, cu);
break;
case DW_TAG_imported_declaration:
@@ -1879,11 +2006,7 @@ process_die (struct die_info *die, struct dwarf2_cu *cu)
shouldn't in the C++ case, but conceivably could in the
Fortran case, so we'll have to replace this gdb_assert if
Fortran compilers start generating that info. */
- if (!processing_has_namespace_info)
- {
- processing_has_namespace_info = 1;
- processing_current_prefix = "";
- }
+ processing_has_namespace_info = 1;
gdb_assert (die->child == NULL);
break;
default:
@@ -1893,9 +2016,9 @@ process_die (struct die_info *die, struct dwarf2_cu *cu)
}
static void
-initialize_cu_func_list (void)
+initialize_cu_func_list (struct dwarf2_cu *cu)
{
- cu_first_fn = cu_last_fn = cu_cached_fn = NULL;
+ cu->first_fn = cu->last_fn = cu->cached_fn = NULL;
}
static void
@@ -1912,28 +2035,11 @@ read_file_scope (struct die_info *die, struct dwarf2_cu *cu)
struct die_info *child_die;
bfd *abfd = objfile->obfd;
struct line_header *line_header = 0;
+ CORE_ADDR baseaddr;
+
+ baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
- if (!dwarf2_get_pc_bounds (die, &lowpc, &highpc, cu))
- {
- if (die->child != NULL)
- {
- child_die = die->child;
- while (child_die && child_die->tag)
- {
- if (child_die->tag == DW_TAG_subprogram)
- {
- CORE_ADDR low, high;
-
- if (dwarf2_get_pc_bounds (child_die, &low, &high, cu))
- {
- lowpc = min (lowpc, low);
- highpc = max (highpc, high);
- }
- }
- child_die = sibling_die (child_die);
- }
- }
- }
+ get_scope_pc_bounds (die, &lowpc, &highpc, cu);
/* If we didn't find a lowpc, set it to highpc to avoid complaints
from finish_block. */
@@ -1942,12 +2048,12 @@ read_file_scope (struct die_info *die, struct dwarf2_cu *cu)
lowpc += baseaddr;
highpc += baseaddr;
- attr = dwarf_attr (die, DW_AT_name);
+ attr = dwarf2_attr (die, DW_AT_name, cu);
if (attr)
{
name = DW_STRING (attr);
}
- attr = dwarf_attr (die, DW_AT_comp_dir);
+ attr = dwarf2_attr (die, DW_AT_comp_dir, cu);
if (attr)
{
comp_dir = DW_STRING (attr);
@@ -1969,10 +2075,10 @@ read_file_scope (struct die_info *die, struct dwarf2_cu *cu)
objfile->ei.deprecated_entry_file_highpc = highpc;
}
- attr = dwarf_attr (die, DW_AT_language);
+ attr = dwarf2_attr (die, DW_AT_language, cu);
if (attr)
{
- set_cu_language (DW_UNSND (attr));
+ set_cu_language (DW_UNSND (attr), cu);
}
/* We assume that we're processing GCC output. */
@@ -1987,12 +2093,12 @@ read_file_scope (struct die_info *die, struct dwarf2_cu *cu)
/* The compilation unit may be in a different language or objfile,
zero out all remembered fundamental types. */
- memset (ftypes, 0, FT_NUM_MEMBERS * sizeof (struct type *));
+ memset (cu->ftypes, 0, FT_NUM_MEMBERS * sizeof (struct type *));
start_symtab (name, comp_dir, lowpc);
record_debugformat ("DWARF 2");
- initialize_cu_func_list ();
+ initialize_cu_func_list (cu);
/* Process all dies in compilation unit. */
if (die->child != NULL)
@@ -2006,7 +2112,7 @@ read_file_scope (struct die_info *die, struct dwarf2_cu *cu)
}
/* Decode line number information if present. */
- attr = dwarf_attr (die, DW_AT_stmt_list);
+ attr = dwarf2_attr (die, DW_AT_stmt_list, cu);
if (attr)
{
unsigned int line_offset = DW_UNSND (attr);
@@ -2023,7 +2129,7 @@ read_file_scope (struct die_info *die, struct dwarf2_cu *cu)
refers to information in the line number info statement program
header, so we can only read it if we've read the header
successfully. */
- attr = dwarf_attr (die, DW_AT_macro_info);
+ attr = dwarf2_attr (die, DW_AT_macro_info, cu);
if (attr && line_header)
{
unsigned int macro_offset = DW_UNSND (attr);
@@ -2034,7 +2140,8 @@ read_file_scope (struct die_info *die, struct dwarf2_cu *cu)
}
static void
-add_to_cu_func_list (const char *name, CORE_ADDR lowpc, CORE_ADDR highpc)
+add_to_cu_func_list (const char *name, CORE_ADDR lowpc, CORE_ADDR highpc,
+ struct dwarf2_cu *cu)
{
struct function_range *thisfn;
@@ -2046,12 +2153,12 @@ add_to_cu_func_list (const char *name, CORE_ADDR lowpc, CORE_ADDR highpc)
thisfn->seen_line = 0;
thisfn->next = NULL;
- if (cu_last_fn == NULL)
- cu_first_fn = thisfn;
+ if (cu->last_fn == NULL)
+ cu->first_fn = thisfn;
else
- cu_last_fn->next = thisfn;
+ cu->last_fn->next = thisfn;
- cu_last_fn = thisfn;
+ cu->last_fn = thisfn;
}
static void
@@ -2064,19 +2171,58 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu)
struct die_info *child_die;
struct attribute *attr;
char *name;
+ const char *previous_prefix = processing_current_prefix;
+ struct cleanup *back_to = NULL;
+ CORE_ADDR baseaddr;
- name = dwarf2_linkage_name (die);
+ baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
+
+ name = dwarf2_linkage_name (die, cu);
/* Ignore functions with missing or empty names and functions with
missing or invalid low and high pc attributes. */
if (name == NULL || !dwarf2_get_pc_bounds (die, &lowpc, &highpc, cu))
return;
+ if (cu->language == language_cplus)
+ {
+ struct die_info *spec_die = die_specification (die, cu);
+
+ /* NOTE: carlton/2004-01-23: We have to be careful in the
+ presence of DW_AT_specification. For example, with GCC 3.4,
+ given the code
+
+ namespace N {
+ void foo() {
+ // Definition of N::foo.
+ }
+ }
+
+ then we'll have a tree of DIEs like this:
+
+ 1: DW_TAG_compile_unit
+ 2: DW_TAG_namespace // N
+ 3: DW_TAG_subprogram // declaration of N::foo
+ 4: DW_TAG_subprogram // definition of N::foo
+ DW_AT_specification // refers to die #3
+
+ Thus, when processing die #4, we have to pretend that we're
+ in the context of its DW_AT_specification, namely the contex
+ of die #3. */
+
+ if (spec_die != NULL)
+ {
+ char *specification_prefix = determine_prefix (spec_die, cu);
+ processing_current_prefix = specification_prefix;
+ back_to = make_cleanup (xfree, specification_prefix);
+ }
+ }
+
lowpc += baseaddr;
highpc += baseaddr;
/* Record the function range for dwarf_decode_lines. */
- add_to_cu_func_list (name, lowpc, highpc);
+ add_to_cu_func_list (name, lowpc, highpc, cu);
if (objfile->ei.entry_point >= lowpc &&
objfile->ei.entry_point < highpc)
@@ -2090,11 +2236,20 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu)
/* If there is a location expression for DW_AT_frame_base, record
it. */
- attr = dwarf_attr (die, DW_AT_frame_base);
+ attr = dwarf2_attr (die, DW_AT_frame_base, cu);
if (attr)
+ /* FIXME: cagney/2004-01-26: The DW_AT_frame_base's location
+ expression is being recorded directly in the function's symbol
+ and not in a separate frame-base object. I guess this hack is
+ to avoid adding some sort of frame-base adjunct/annex to the
+ function's symbol :-(. The problem with doing this is that it
+ results in a function symbol with a location expression that
+ has nothing to do with the location of the function, ouch! The
+ relationship should be: a function's symbol has-a frame base; a
+ frame-base has-a location expression. */
dwarf2_symbol_mark_computed (attr, new->name, cu);
- list_in_scope = &local_symbols;
+ cu->list_in_scope = &local_symbols;
if (die->child != NULL)
{
@@ -2121,7 +2276,11 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu)
/* If we've finished processing a top-level function, subsequent
symbols go in the file symbol list. */
if (outermost_context_p ())
- list_in_scope = &file_symbols;
+ cu->list_in_scope = &file_symbols;
+
+ processing_current_prefix = previous_prefix;
+ if (back_to != NULL)
+ do_cleanups (back_to);
}
/* Process all the DIES contained within a lexical block scope. Start
@@ -2134,6 +2293,9 @@ read_lexical_block_scope (struct die_info *die, struct dwarf2_cu *cu)
struct context_stack *new;
CORE_ADDR lowpc, highpc;
struct die_info *child_die;
+ CORE_ADDR baseaddr;
+
+ baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
/* Ignore blocks with missing or invalid low and high pc attributes. */
/* ??? Perhaps consider discontiguous blocks defined by DW_AT_ranges
@@ -2180,11 +2342,11 @@ dwarf2_get_pc_bounds (struct die_info *die, CORE_ADDR *lowpc,
CORE_ADDR high = 0;
int ret = 0;
- attr = dwarf_attr (die, DW_AT_high_pc);
+ attr = dwarf2_attr (die, DW_AT_high_pc, cu);
if (attr)
{
high = DW_ADDR (attr);
- attr = dwarf_attr (die, DW_AT_low_pc);
+ attr = dwarf2_attr (die, DW_AT_low_pc, cu);
if (attr)
low = DW_ADDR (attr);
else
@@ -2196,7 +2358,7 @@ dwarf2_get_pc_bounds (struct die_info *die, CORE_ADDR *lowpc,
}
else
{
- attr = dwarf_attr (die, DW_AT_ranges);
+ attr = dwarf2_attr (die, DW_AT_ranges, cu);
if (attr != NULL)
{
unsigned int addr_size = cu_header->addr_size;
@@ -2324,6 +2486,68 @@ dwarf2_get_pc_bounds (struct die_info *die, CORE_ADDR *lowpc,
return ret;
}
+/* Get the low and high pc's represented by the scope DIE, and store
+ them in *LOWPC and *HIGHPC. If the correct values can't be
+ determined, set *LOWPC to -1 and *HIGHPC to 0. */
+
+static void
+get_scope_pc_bounds (struct die_info *die,
+ CORE_ADDR *lowpc, CORE_ADDR *highpc,
+ struct dwarf2_cu *cu)
+{
+ CORE_ADDR best_low = (CORE_ADDR) -1;
+ CORE_ADDR best_high = (CORE_ADDR) 0;
+ CORE_ADDR current_low, current_high;
+
+ if (dwarf2_get_pc_bounds (die, &current_low, &current_high, cu))
+ {
+ best_low = current_low;
+ best_high = current_high;
+ }
+ else
+ {
+ struct die_info *child = die->child;
+
+ while (child && child->tag)
+ {
+ switch (child->tag) {
+ case DW_TAG_subprogram:
+ if (dwarf2_get_pc_bounds (child, &current_low, &current_high, cu))
+ {
+ best_low = min (best_low, current_low);
+ best_high = max (best_high, current_high);
+ }
+ break;
+ case DW_TAG_namespace:
+ /* FIXME: carlton/2004-01-16: Should we do this for
+ DW_TAG_class_type/DW_TAG_structure_type, too? I think
+ that current GCC's always emit the DIEs corresponding
+ to definitions of methods of classes as children of a
+ DW_TAG_compile_unit or DW_TAG_namespace (as opposed to
+ the DIEs giving the declarations, which could be
+ anywhere). But I don't see any reason why the
+ standards says that they have to be there. */
+ get_scope_pc_bounds (child, &current_low, &current_high, cu);
+
+ if (current_low != ((CORE_ADDR) -1))
+ {
+ best_low = min (best_low, current_low);
+ best_high = max (best_high, current_high);
+ }
+ break;
+ default:
+ /* Ignore. */
+ break;
+ }
+
+ child = sibling_die (child);
+ }
+ }
+
+ *lowpc = best_low;
+ *highpc = best_high;
+}
+
/* Add an aggregate field to the field list. */
static void
@@ -2353,18 +2577,18 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die,
new_field->accessibility = DW_ACCESS_private;
new_field->virtuality = DW_VIRTUALITY_none;
- attr = dwarf_attr (die, DW_AT_accessibility);
+ attr = dwarf2_attr (die, DW_AT_accessibility, cu);
if (attr)
new_field->accessibility = DW_UNSND (attr);
if (new_field->accessibility != DW_ACCESS_public)
fip->non_public_fields = 1;
- attr = dwarf_attr (die, DW_AT_virtuality);
+ attr = dwarf2_attr (die, DW_AT_virtuality, cu);
if (attr)
new_field->virtuality = DW_UNSND (attr);
fp = &new_field->field;
- if (die->tag == DW_TAG_member && ! die_is_declaration (die))
+ if (die->tag == DW_TAG_member && ! die_is_declaration (die, cu))
{
/* Data member other than a C++ static data member. */
@@ -2374,7 +2598,7 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die,
FIELD_STATIC_KIND (*fp) = 0;
/* Get bit size of field (zero if none). */
- attr = dwarf_attr (die, DW_AT_bit_size);
+ attr = dwarf2_attr (die, DW_AT_bit_size, cu);
if (attr)
{
FIELD_BITSIZE (*fp) = DW_UNSND (attr);
@@ -2385,7 +2609,7 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die,
}
/* Get bit offset of field. */
- attr = dwarf_attr (die, DW_AT_data_member_location);
+ attr = dwarf2_attr (die, DW_AT_data_member_location, cu);
if (attr)
{
FIELD_BITPOS (*fp) =
@@ -2393,7 +2617,7 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die,
}
else
FIELD_BITPOS (*fp) = 0;
- attr = dwarf_attr (die, DW_AT_bit_offset);
+ attr = dwarf2_attr (die, DW_AT_bit_offset, cu);
if (attr)
{
if (BITS_BIG_ENDIAN)
@@ -2416,7 +2640,7 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die,
int anonymous_size;
int bit_offset = DW_UNSND (attr);
- attr = dwarf_attr (die, DW_AT_byte_size);
+ attr = dwarf2_attr (die, DW_AT_byte_size, cu);
if (attr)
{
/* The size of the anonymous object containing
@@ -2438,15 +2662,15 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die,
}
/* Get name of field. */
- attr = dwarf_attr (die, DW_AT_name);
+ attr = dwarf2_attr (die, DW_AT_name, cu);
if (attr && DW_STRING (attr))
fieldname = DW_STRING (attr);
fp->name = obsavestring (fieldname, strlen (fieldname),
- &objfile->type_obstack);
+ &objfile->objfile_obstack);
/* Change accessibility for artificial fields (e.g. virtual table
pointer or virtual base class pointer) to private. */
- if (dwarf_attr (die, DW_AT_artificial))
+ if (dwarf2_attr (die, DW_AT_artificial, cu))
{
new_field->accessibility = DW_ACCESS_private;
fip->non_public_fields = 1;
@@ -2464,25 +2688,25 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die,
char *physname;
/* Get name of field. */
- attr = dwarf_attr (die, DW_AT_name);
+ attr = dwarf2_attr (die, DW_AT_name, cu);
if (attr && DW_STRING (attr))
fieldname = DW_STRING (attr);
else
return;
/* Get physical name. */
- physname = dwarf2_linkage_name (die);
+ physname = dwarf2_linkage_name (die, cu);
SET_FIELD_PHYSNAME (*fp, obsavestring (physname, strlen (physname),
- &objfile->type_obstack));
+ &objfile->objfile_obstack));
FIELD_TYPE (*fp) = die_type (die, cu);
FIELD_NAME (*fp) = obsavestring (fieldname, strlen (fieldname),
- &objfile->type_obstack);
+ &objfile->objfile_obstack);
}
else if (die->tag == DW_TAG_inheritance)
{
/* C++ base class field. */
- attr = dwarf_attr (die, DW_AT_data_member_location);
+ attr = dwarf2_attr (die, DW_AT_data_member_location, cu);
if (attr)
FIELD_BITPOS (*fp) = (decode_locdesc (DW_BLOCK (attr), cu)
* bits_per_byte);
@@ -2597,14 +2821,14 @@ dwarf2_add_member_fn (struct field_info *fip, struct die_info *die,
struct nextfnfield *new_fnfield;
/* Get name of member function. */
- attr = dwarf_attr (die, DW_AT_name);
+ attr = dwarf2_attr (die, DW_AT_name, cu);
if (attr && DW_STRING (attr))
fieldname = DW_STRING (attr);
else
return;
/* Get the mangled name. */
- physname = dwarf2_linkage_name (die);
+ physname = dwarf2_linkage_name (die, cu);
/* Look up member function name in fieldlist. */
for (i = 0; i < fip->nfnfields; i++)
@@ -2646,7 +2870,7 @@ dwarf2_add_member_fn (struct field_info *fip, struct die_info *die,
/* Fill in the member function field info. */
fnp = &new_fnfield->fnfield;
fnp->physname = obsavestring (physname, strlen (physname),
- &objfile->type_obstack);
+ &objfile->objfile_obstack);
fnp->type = alloc_type (objfile);
if (die->type && TYPE_CODE (die->type) == TYPE_CODE_FUNC)
{
@@ -2674,14 +2898,14 @@ dwarf2_add_member_fn (struct field_info *fip, struct die_info *die,
physname);
/* Get fcontext from DW_AT_containing_type if present. */
- if (dwarf_attr (die, DW_AT_containing_type) != NULL)
+ if (dwarf2_attr (die, DW_AT_containing_type, cu) != NULL)
fnp->fcontext = die_containing_type (die, cu);
/* dwarf2 doesn't have stubbed physical names, so the setting of is_const
and is_volatile is irrelevant, as it is needed by gdb_mangle_name only. */
/* Get accessibility. */
- attr = dwarf_attr (die, DW_AT_accessibility);
+ attr = dwarf2_attr (die, DW_AT_accessibility, cu);
if (attr)
{
switch (DW_UNSND (attr))
@@ -2696,12 +2920,12 @@ dwarf2_add_member_fn (struct field_info *fip, struct die_info *die,
}
/* Check for artificial methods. */
- attr = dwarf_attr (die, DW_AT_artificial);
+ attr = dwarf2_attr (die, DW_AT_artificial, cu);
if (attr && DW_UNSND (attr) != 0)
fnp->is_artificial = 1;
/* Get index in virtual function table if it is a virtual member function. */
- attr = dwarf_attr (die, DW_AT_vtable_elem_location);
+ attr = dwarf2_attr (die, DW_AT_vtable_elem_location, cu);
if (attr)
{
/* Support the .debug_loc offsets */
@@ -2777,22 +3001,63 @@ read_structure_scope (struct die_info *die, struct dwarf2_cu *cu)
struct objfile *objfile = cu->objfile;
struct type *type;
struct attribute *attr;
+ const char *name = NULL;
+ const char *previous_prefix = processing_current_prefix;
+ struct cleanup *back_to = NULL;
+ /* This says whether or not we want to try to update the structure's
+ name to include enclosing namespace/class information, if
+ any. */
+ int need_to_update_name = 0;
type = alloc_type (objfile);
INIT_CPLUS_SPECIFIC (type);
- attr = dwarf_attr (die, DW_AT_name);
+ attr = dwarf2_attr (die, DW_AT_name, cu);
if (attr && DW_STRING (attr))
{
/* FIXME: This should be in a more general location. */
- char *name;
name = cp_canonicalize_string (DW_STRING (attr));
if (name == NULL)
name = DW_STRING (attr);
- TYPE_TAG_NAME (type) = obsavestring (name, strlen (name),
- &objfile->type_obstack);
- if (name != DW_STRING (attr))
- free (name);
+ else
+ back_to = make_cleanup (xfree, name);
+
+ if (cu->language == language_cplus)
+ {
+ struct die_info *spec_die = die_specification (die, cu);
+
+ if (spec_die != NULL)
+ {
+ char *specification_prefix = determine_prefix (spec_die, cu);
+ processing_current_prefix = specification_prefix;
+ if (back_to == NULL)
+ back_to = make_cleanup (xfree, specification_prefix);
+ else
+ make_cleanup (xfree, specification_prefix);
+ }
+ }
+
+ if (processing_has_namespace_info)
+ {
+ /* FIXME: carlton/2003-11-10: This variable exists only for
+ const-correctness reasons. When I tried to change
+ TYPE_TAG_NAME to be a const char *, I ran into a cascade
+ of changes which would have forced decode_line_1 to take
+ a const char **. */
+ char *new_prefix = obconcat (&objfile->objfile_obstack,
+ processing_current_prefix,
+ processing_current_prefix[0] == '\0'
+ ? "" : "::",
+ name);
+ TYPE_TAG_NAME (type) = new_prefix;
+ processing_current_prefix = new_prefix;
+ }
+ else
+ {
+ TYPE_TAG_NAME (type) = obsavestring (name, strlen (name),
+ &objfile->objfile_obstack);
+ need_to_update_name = (cu->language == language_cplus);
+ }
}
if (die->tag == DW_TAG_structure_type)
@@ -2810,7 +3075,7 @@ read_structure_scope (struct die_info *die, struct dwarf2_cu *cu)
TYPE_CODE (type) = TYPE_CODE_CLASS;
}
- attr = dwarf_attr (die, DW_AT_byte_size);
+ attr = dwarf2_attr (die, DW_AT_byte_size, cu);
if (attr)
{
TYPE_LENGTH (type) = DW_UNSND (attr);
@@ -2825,7 +3090,7 @@ read_structure_scope (struct die_info *die, struct dwarf2_cu *cu)
type within the structure itself. */
die->type = type;
- if (die->child != NULL && ! die_is_declaration (die))
+ if (die->child != NULL && ! die_is_declaration (die, cu))
{
struct field_info fi;
struct die_info *child_die;
@@ -2852,6 +3117,41 @@ read_structure_scope (struct die_info *die, struct dwarf2_cu *cu)
/* C++ member function. */
process_die (child_die, cu);
dwarf2_add_member_fn (&fi, child_die, type, cu);
+ if (need_to_update_name)
+ {
+ /* The demangled names of member functions contain
+ information about enclosing namespaces/classes,
+ if any. */
+
+ /* FIXME: carlton/2003-11-10: The excessive
+ demangling here is a bit wasteful, as is the
+ memory usage for names. */
+
+ /* NOTE: carlton/2003-11-10: As commented in
+ add_partial_structure, the demangler sometimes
+ prints the type info in a different form from the
+ debug info. We could solve this by using the
+ demangled name to get the prefix; if doing so,
+ however, we'd need to be careful when reading a
+ class that's nested inside a template class.
+ That would also cause problems when trying to
+ determine RTTI information, since we use the
+ demangler to determine the appropriate class
+ name. */
+ char *actual_class_name
+ = class_name_from_physname (dwarf2_linkage_name
+ (child_die, cu));
+ if (actual_class_name != NULL
+ && strcmp (actual_class_name, name) != 0)
+ {
+ TYPE_TAG_NAME (type)
+ = obsavestring (actual_class_name,
+ strlen (actual_class_name),
+ &objfile->objfile_obstack);
+ }
+ xfree (actual_class_name);
+ need_to_update_name = 0;
+ }
}
else if (child_die->tag == DW_TAG_inheritance)
{
@@ -2876,7 +3176,7 @@ read_structure_scope (struct die_info *die, struct dwarf2_cu *cu)
class itself) which contains the vtable pointer for the current
class from the DW_AT_containing_type attribute. */
- if (dwarf_attr (die, DW_AT_containing_type) != NULL)
+ if (dwarf2_attr (die, DW_AT_containing_type, cu) != NULL)
{
struct type *t = die_containing_type (die, cu);
@@ -2927,6 +3227,10 @@ read_structure_scope (struct die_info *die, struct dwarf2_cu *cu)
/* No children, must be stub. */
TYPE_FLAGS (type) |= TYPE_FLAG_STUB;
}
+
+ processing_current_prefix = previous_prefix;
+ if (back_to != NULL)
+ do_cleanups (back_to);
}
/* Given a pointer to a die which begins an enumeration, process all
@@ -2953,15 +3257,27 @@ read_enumeration (struct die_info *die, struct dwarf2_cu *cu)
type = alloc_type (objfile);
TYPE_CODE (type) = TYPE_CODE_ENUM;
- attr = dwarf_attr (die, DW_AT_name);
+ attr = dwarf2_attr (die, DW_AT_name, cu);
if (attr && DW_STRING (attr))
{
- TYPE_TAG_NAME (type) = obsavestring (DW_STRING (attr),
- strlen (DW_STRING (attr)),
- &objfile->type_obstack);
+ const char *name = DW_STRING (attr);
+
+ if (processing_has_namespace_info)
+ {
+ TYPE_TAG_NAME (type) = obconcat (&objfile->objfile_obstack,
+ processing_current_prefix,
+ processing_current_prefix[0] == '\0'
+ ? "" : "::",
+ name);
+ }
+ else
+ {
+ TYPE_TAG_NAME (type) = obsavestring (name, strlen (name),
+ &objfile->objfile_obstack);
+ }
}
- attr = dwarf_attr (die, DW_AT_byte_size);
+ attr = dwarf2_attr (die, DW_AT_byte_size, cu);
if (attr)
{
TYPE_LENGTH (type) = DW_UNSND (attr);
@@ -2984,7 +3300,7 @@ read_enumeration (struct die_info *die, struct dwarf2_cu *cu)
}
else
{
- attr = dwarf_attr (child_die, DW_AT_name);
+ attr = dwarf2_attr (child_die, DW_AT_name, cu);
if (attr)
{
sym = new_symbol (child_die, type, cu);
@@ -3056,7 +3372,7 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu)
arrays with unspecified length. */
if (die->child == NULL)
{
- index_type = dwarf2_fundamental_type (objfile, FT_INTEGER);
+ index_type = dwarf2_fundamental_type (objfile, FT_INTEGER, cu);
range_type = create_range_type (NULL, index_type, 0, -1);
die->type = create_array_type (NULL, element_type, range_type);
return;
@@ -3068,88 +3384,22 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu)
{
if (child_die->tag == DW_TAG_subrange_type)
{
- unsigned int low, high;
-
- /* Default bounds to an array with unspecified length. */
- low = 0;
- high = -1;
- if (cu_language == language_fortran)
- {
- /* FORTRAN implies a lower bound of 1, if not given. */
- low = 1;
- }
-
- index_type = die_type (child_die, cu);
- attr = dwarf_attr (child_die, DW_AT_lower_bound);
- if (attr)
- {
- if (attr->form == DW_FORM_sdata)
- {
- low = DW_SND (attr);
- }
- else if (attr->form == DW_FORM_udata
- || attr->form == DW_FORM_data1
- || attr->form == DW_FORM_data2
- || attr->form == DW_FORM_data4
- || attr->form == DW_FORM_data8)
- {
- low = DW_UNSND (attr);
- }
- else
- {
- dwarf2_non_const_array_bound_ignored_complaint
- (dwarf_form_name (attr->form));
- low = 0;
- }
- }
- attr = dwarf_attr (child_die, DW_AT_upper_bound);
- if (attr)
- {
- if (attr->form == DW_FORM_sdata)
- {
- high = DW_SND (attr);
- }
- else if (attr->form == DW_FORM_udata
- || attr->form == DW_FORM_data1
- || attr->form == DW_FORM_data2
- || attr->form == DW_FORM_data4
- || attr->form == DW_FORM_data8)
- {
- high = DW_UNSND (attr);
- }
- else if (attr->form == DW_FORM_block1)
- {
- /* GCC encodes arrays with unspecified or dynamic length
- with a DW_FORM_block1 attribute.
- FIXME: GDB does not yet know how to handle dynamic
- arrays properly, treat them as arrays with unspecified
- length for now.
-
- FIXME: jimb/2003-09-22: GDB does not really know
- how to handle arrays of unspecified length
- either; we just represent them as zero-length
- arrays. Choose an appropriate upper bound given
- the lower bound we've computed above. */
- high = low - 1;
- }
- else
- {
- dwarf2_non_const_array_bound_ignored_complaint
- (dwarf_form_name (attr->form));
- high = 1;
- }
- }
+ read_subrange_type (child_die, cu);
- /* Create a range type and save it for array type creation. */
- if ((ndim % DW_FIELD_ALLOC_CHUNK) == 0)
- {
- range_types = (struct type **)
- xrealloc (range_types, (ndim + DW_FIELD_ALLOC_CHUNK)
- * sizeof (struct type *));
- if (ndim == 0)
- make_cleanup (free_current_contents, &range_types);
- }
- range_types[ndim++] = create_range_type (NULL, index_type, low, high);
+ if (child_die->type != NULL)
+ {
+ /* The range type was succesfully read. Save it for
+ the array type creation. */
+ if ((ndim % DW_FIELD_ALLOC_CHUNK) == 0)
+ {
+ range_types = (struct type **)
+ xrealloc (range_types, (ndim + DW_FIELD_ALLOC_CHUNK)
+ * sizeof (struct type *));
+ if (ndim == 0)
+ make_cleanup (free_current_contents, &range_types);
+ }
+ range_types[ndim++] = child_die->type;
+ }
}
child_die = sibling_die (child_die);
}
@@ -3166,7 +3416,7 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu)
custom vendor extension. The main difference between a regular
array and the vector variant is that vectors are passed by value
to functions. */
- attr = dwarf_attr (die, DW_AT_GNU_vector);
+ attr = dwarf2_attr (die, DW_AT_GNU_vector, cu);
if (attr)
TYPE_FLAGS (type) |= TYPE_FLAG_VECTOR;
@@ -3186,7 +3436,7 @@ read_common_block (struct die_info *die, struct dwarf2_cu *cu)
struct symbol *sym;
CORE_ADDR base = (CORE_ADDR) 0;
- attr = dwarf_attr (die, DW_AT_location);
+ attr = dwarf2_attr (die, DW_AT_location, cu);
if (attr)
{
/* Support the .debug_loc offsets */
@@ -3210,7 +3460,7 @@ read_common_block (struct die_info *die, struct dwarf2_cu *cu)
while (child_die && child_die->tag)
{
sym = new_symbol (child_die, NULL, cu);
- attr = dwarf_attr (child_die, DW_AT_data_member_location);
+ attr = dwarf2_attr (child_die, DW_AT_data_member_location, cu);
if (attr)
{
SYMBOL_VALUE_ADDRESS (sym) =
@@ -3229,11 +3479,11 @@ read_namespace (struct die_info *die, struct dwarf2_cu *cu)
{
struct objfile *objfile = cu->objfile;
const char *previous_prefix = processing_current_prefix;
- const char *name = NULL;
+ const char *name;
int is_anonymous;
struct die_info *current_die;
- name = namespace_name (die, &is_anonymous);
+ name = namespace_name (die, &is_anonymous, cu);
/* Now build the name of the current namespace. */
@@ -3258,7 +3508,7 @@ read_namespace (struct die_info *die, struct dwarf2_cu *cu)
before. Also, add a using directive if it's an anonymous
namespace. */
- if (dwarf2_extension (die) == NULL)
+ if (dwarf2_extension (die, cu) == NULL)
{
struct type *type;
@@ -3296,7 +3546,7 @@ read_namespace (struct die_info *die, struct dwarf2_cu *cu)
namespace. */
static const char *
-namespace_name (struct die_info *die, int *is_anonymous)
+namespace_name (struct die_info *die, int *is_anonymous, struct dwarf2_cu *cu)
{
struct die_info *current_die;
const char *name = NULL;
@@ -3305,9 +3555,9 @@ namespace_name (struct die_info *die, int *is_anonymous)
for (current_die = die;
current_die != NULL;
- current_die = dwarf2_extension (die))
+ current_die = dwarf2_extension (die, cu))
{
- name = dwarf2_name (current_die);
+ name = dwarf2_name (current_die, cu);
if (name != NULL)
break;
}
@@ -3340,13 +3590,13 @@ read_tag_pointer_type (struct die_info *die, struct dwarf2_cu *cu)
type = lookup_pointer_type (die_type (die, cu));
- attr_byte_size = dwarf_attr (die, DW_AT_byte_size);
+ attr_byte_size = dwarf2_attr (die, DW_AT_byte_size, cu);
if (attr_byte_size)
byte_size = DW_UNSND (attr_byte_size);
else
byte_size = cu_header->addr_size;
- attr_address_class = dwarf_attr (die, DW_AT_address_class);
+ attr_address_class = dwarf2_attr (die, DW_AT_address_class, cu);
if (attr_address_class)
addr_class = DW_UNSND (attr_address_class);
else
@@ -3418,7 +3668,7 @@ read_tag_reference_type (struct die_info *die, struct dwarf2_cu *cu)
}
type = lookup_reference_type (die_type (die, cu));
- attr = dwarf_attr (die, DW_AT_byte_size);
+ attr = dwarf2_attr (die, DW_AT_byte_size, cu);
if (attr)
{
TYPE_LENGTH (type) = DW_UNSND (attr);
@@ -3476,7 +3726,7 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu)
return;
}
- attr = dwarf_attr (die, DW_AT_string_length);
+ attr = dwarf2_attr (die, DW_AT_string_length, cu);
if (attr)
{
length = DW_UNSND (attr);
@@ -3484,7 +3734,7 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu)
else
{
/* check for the DW_AT_byte_size attribute */
- attr = dwarf_attr (die, DW_AT_byte_size);
+ attr = dwarf2_attr (die, DW_AT_byte_size, cu);
if (attr)
{
length = DW_UNSND (attr);
@@ -3494,9 +3744,9 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu)
length = 1;
}
}
- index_type = dwarf2_fundamental_type (objfile, FT_INTEGER);
+ index_type = dwarf2_fundamental_type (objfile, FT_INTEGER, cu);
range_type = create_range_type (NULL, index_type, 1, length);
- if (cu_language == language_fortran)
+ if (cu->language == language_fortran)
{
/* Need to create a unique string type for bounds
information */
@@ -3504,7 +3754,7 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu)
}
else
{
- char_type = dwarf2_fundamental_type (objfile, FT_CHAR);
+ char_type = dwarf2_fundamental_type (objfile, FT_CHAR, cu);
type = create_string_type (char_type, range_type);
}
die->type = type;
@@ -3537,9 +3787,9 @@ read_subroutine_type (struct die_info *die, struct dwarf2_cu *cu)
ftype = lookup_function_type (type);
/* All functions in C++ have prototypes. */
- attr = dwarf_attr (die, DW_AT_prototyped);
+ attr = dwarf2_attr (die, DW_AT_prototyped, cu);
if ((attr && (DW_UNSND (attr) != 0))
- || cu_language == language_cplus)
+ || cu->language == language_cplus)
TYPE_FLAGS (ftype) |= TYPE_FLAG_PROTOTYPED;
if (die->child != NULL)
@@ -3576,7 +3826,7 @@ read_subroutine_type (struct die_info *die, struct dwarf2_cu *cu)
parameter for non-static member functions (which is the
this pointer) as artificial. We pass this information
to dwarf2_add_member_fn via TYPE_FIELD_ARTIFICIAL. */
- attr = dwarf_attr (child_die, DW_AT_artificial);
+ attr = dwarf2_attr (child_die, DW_AT_artificial, cu);
if (attr)
TYPE_FIELD_ARTIFICIAL (ftype, iparams) = DW_UNSND (attr);
else
@@ -3600,7 +3850,7 @@ read_typedef (struct die_info *die, struct dwarf2_cu *cu)
if (!die->type)
{
- attr = dwarf_attr (die, DW_AT_name);
+ attr = dwarf2_attr (die, DW_AT_name, cu);
if (attr && DW_STRING (attr))
{
name = DW_STRING (attr);
@@ -3627,17 +3877,17 @@ read_base_type (struct die_info *die, struct dwarf2_cu *cu)
return;
}
- attr = dwarf_attr (die, DW_AT_encoding);
+ attr = dwarf2_attr (die, DW_AT_encoding, cu);
if (attr)
{
encoding = DW_UNSND (attr);
}
- attr = dwarf_attr (die, DW_AT_byte_size);
+ attr = dwarf2_attr (die, DW_AT_byte_size, cu);
if (attr)
{
size = DW_UNSND (attr);
}
- attr = dwarf_attr (die, DW_AT_name);
+ attr = dwarf2_attr (die, DW_AT_name, cu);
if (attr && DW_STRING (attr))
{
enum type_code code = TYPE_CODE_INT;
@@ -3674,18 +3924,19 @@ read_base_type (struct die_info *die, struct dwarf2_cu *cu)
}
type = init_type (code, size, type_flags, DW_STRING (attr), objfile);
if (encoding == DW_ATE_address)
- TYPE_TARGET_TYPE (type) = dwarf2_fundamental_type (objfile, FT_VOID);
+ TYPE_TARGET_TYPE (type) = dwarf2_fundamental_type (objfile, FT_VOID,
+ cu);
else if (encoding == DW_ATE_complex_float)
{
if (size == 32)
TYPE_TARGET_TYPE (type)
- = dwarf2_fundamental_type (objfile, FT_EXT_PREC_FLOAT);
+ = dwarf2_fundamental_type (objfile, FT_EXT_PREC_FLOAT, cu);
else if (size == 16)
TYPE_TARGET_TYPE (type)
- = dwarf2_fundamental_type (objfile, FT_DBL_PREC_FLOAT);
+ = dwarf2_fundamental_type (objfile, FT_DBL_PREC_FLOAT, cu);
else if (size == 8)
TYPE_TARGET_TYPE (type)
- = dwarf2_fundamental_type (objfile, FT_FLOAT);
+ = dwarf2_fundamental_type (objfile, FT_FLOAT, cu);
}
}
else
@@ -3695,6 +3946,78 @@ read_base_type (struct die_info *die, struct dwarf2_cu *cu)
die->type = type;
}
+/* Read the given DW_AT_subrange DIE. */
+
+static void
+read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
+{
+ struct type *base_type;
+ struct type *range_type;
+ struct attribute *attr;
+ int low = 0;
+ int high = -1;
+
+ /* If we have already decoded this die, then nothing more to do. */
+ if (die->type)
+ return;
+
+ base_type = die_type (die, cu);
+ if (base_type == NULL)
+ {
+ complaint (&symfile_complaints,
+ "DW_AT_type missing from DW_TAG_subrange_type");
+ return;
+ }
+
+ if (TYPE_CODE (base_type) == TYPE_CODE_VOID)
+ base_type = alloc_type (NULL);
+
+ if (cu->language == language_fortran)
+ {
+ /* FORTRAN implies a lower bound of 1, if not given. */
+ low = 1;
+ }
+
+ attr = dwarf2_attr (die, DW_AT_lower_bound, cu);
+ if (attr)
+ low = dwarf2_get_attr_constant_value (attr, 0);
+
+ attr = dwarf2_attr (die, DW_AT_upper_bound, cu);
+ if (attr)
+ {
+ if (attr->form == DW_FORM_block1)
+ {
+ /* GCC encodes arrays with unspecified or dynamic length
+ with a DW_FORM_block1 attribute.
+ FIXME: GDB does not yet know how to handle dynamic
+ arrays properly, treat them as arrays with unspecified
+ length for now.
+
+ FIXME: jimb/2003-09-22: GDB does not really know
+ how to handle arrays of unspecified length
+ either; we just represent them as zero-length
+ arrays. Choose an appropriate upper bound given
+ the lower bound we've computed above. */
+ high = low - 1;
+ }
+ else
+ high = dwarf2_get_attr_constant_value (attr, 1);
+ }
+
+ range_type = create_range_type (NULL, base_type, low, high);
+
+ attr = dwarf2_attr (die, DW_AT_name, cu);
+ if (attr && DW_STRING (attr))
+ TYPE_NAME (range_type) = DW_STRING (attr);
+
+ attr = dwarf2_attr (die, DW_AT_byte_size, cu);
+ if (attr)
+ TYPE_LENGTH (range_type) = DW_UNSND (attr);
+
+ die->type = range_type;
+}
+
+
/* Read a whole compilation unit into a linked list of dies. */
static struct die_info *
@@ -3817,7 +4140,7 @@ make_cleanup_free_die_list (struct die_info *dies)
/* Read the contents of the section at OFFSET and of size SIZE from the
- object file specified by OBJFILE into the psymbol_obstack and return it. */
+ object file specified by OBJFILE into the objfile_obstack and return it. */
char *
dwarf2_read_section (struct objfile *objfile, asection *sectp)
@@ -3829,7 +4152,7 @@ dwarf2_read_section (struct objfile *objfile, asection *sectp)
if (size == 0)
return NULL;
- buf = (char *) obstack_alloc (&objfile->psymbol_obstack, size);
+ buf = (char *) obstack_alloc (&objfile->objfile_obstack, size);
retbuf
= (char *) symfile_relocate_debug_section (abfd, sectp, (bfd_byte *) buf);
if (retbuf != NULL)
@@ -4064,7 +4387,7 @@ read_partial_die (struct partial_die_info *part_die, bfd *abfd,
complaint (&symfile_complaints, "ignoring absolute DW_AT_sibling");
else
part_die->sibling =
- dwarf_info_buffer + dwarf2_get_ref_die_offset (&attr);
+ dwarf_info_buffer + dwarf2_get_ref_die_offset (&attr, cu);
break;
default:
break;
@@ -4079,7 +4402,8 @@ read_partial_die (struct partial_die_info *part_die, bfd *abfd,
struct partial_die_info spec_die;
char *spec_ptr;
- spec_ptr = dwarf_info_buffer + dwarf2_get_ref_die_offset (&spec_attr);
+ spec_ptr = dwarf_info_buffer
+ + dwarf2_get_ref_die_offset (&spec_attr, cu);
read_partial_die (&spec_die, abfd, spec_ptr, cu);
if (spec_die.name)
{
@@ -4613,27 +4937,27 @@ read_signed_leb128 (bfd *abfd, char *buf, unsigned int *bytes_read_ptr)
}
static void
-set_cu_language (unsigned int lang)
+set_cu_language (unsigned int lang, struct dwarf2_cu *cu)
{
switch (lang)
{
case DW_LANG_C89:
case DW_LANG_C:
- cu_language = language_c;
+ cu->language = language_c;
break;
case DW_LANG_C_plus_plus:
- cu_language = language_cplus;
+ cu->language = language_cplus;
break;
case DW_LANG_Fortran77:
case DW_LANG_Fortran90:
case DW_LANG_Fortran95:
- cu_language = language_fortran;
+ cu->language = language_fortran;
break;
case DW_LANG_Mips_Assembler:
- cu_language = language_asm;
+ cu->language = language_asm;
break;
case DW_LANG_Java:
- cu_language = language_java;
+ cu->language = language_java;
break;
case DW_LANG_Ada83:
case DW_LANG_Ada95:
@@ -4642,16 +4966,16 @@ set_cu_language (unsigned int lang)
case DW_LANG_Pascal83:
case DW_LANG_Modula2:
default:
- cu_language = language_minimal;
+ cu->language = language_minimal;
break;
}
- cu_language_defn = language_def (cu_language);
+ cu->language_defn = language_def (cu->language);
}
/* Return the named attribute or NULL if not there. */
static struct attribute *
-dwarf_attr (struct die_info *die, unsigned int name)
+dwarf2_attr (struct die_info *die, unsigned int name, struct dwarf2_cu *cu)
{
unsigned int i;
struct attribute *spec = NULL;
@@ -4669,22 +4993,35 @@ dwarf_attr (struct die_info *die, unsigned int name)
if (spec)
{
struct die_info *ref_die =
- follow_die_ref (dwarf2_get_ref_die_offset (spec));
+ follow_die_ref (dwarf2_get_ref_die_offset (spec, cu));
if (ref_die)
- return dwarf_attr (ref_die, name);
+ return dwarf2_attr (ref_die, name, cu);
}
return NULL;
}
static int
-die_is_declaration (struct die_info *die)
+die_is_declaration (struct die_info *die, struct dwarf2_cu *cu)
{
- return (dwarf_attr (die, DW_AT_declaration)
- && ! dwarf_attr (die, DW_AT_specification));
+ return (dwarf2_attr (die, DW_AT_declaration, cu)
+ && ! dwarf2_attr (die, DW_AT_specification, cu));
}
+/* Return the die giving the specification for DIE, if there is
+ one. */
+
+static struct die_info *
+die_specification (struct die_info *die, struct dwarf2_cu *cu)
+{
+ struct attribute *spec_attr = dwarf2_attr (die, DW_AT_specification, cu);
+
+ if (spec_attr == NULL)
+ return NULL;
+ else
+ return follow_die_ref (dwarf2_get_ref_die_offset (spec_attr, cu));
+}
/* Free the line_header structure *LH, and any arrays and strings it
refers to. */
@@ -4877,26 +5214,26 @@ dwarf_decode_line_header (unsigned int offset, bfd *abfd,
addresses passed to record_line. */
static CORE_ADDR
-check_cu_functions (CORE_ADDR address)
+check_cu_functions (CORE_ADDR address, struct dwarf2_cu *cu)
{
struct function_range *fn;
/* Find the function_range containing address. */
- if (!cu_first_fn)
+ if (!cu->first_fn)
return address;
- if (!cu_cached_fn)
- cu_cached_fn = cu_first_fn;
+ if (!cu->cached_fn)
+ cu->cached_fn = cu->first_fn;
- fn = cu_cached_fn;
+ fn = cu->cached_fn;
while (fn)
if (fn->lowpc <= address && fn->highpc > address)
goto found;
else
fn = fn->next;
- fn = cu_first_fn;
- while (fn && fn != cu_cached_fn)
+ fn = cu->first_fn;
+ while (fn && fn != cu->cached_fn)
if (fn->lowpc <= address && fn->highpc > address)
goto found;
else
@@ -4927,6 +5264,10 @@ dwarf_decode_lines (struct line_header *lh, char *comp_dir, bfd *abfd,
char *line_end;
unsigned int bytes_read;
unsigned char op_code, extended_op, adj_opcode;
+ CORE_ADDR baseaddr;
+ struct objfile *objfile = cu->objfile;
+
+ baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
line_ptr = lh->statement_program_start;
line_end = lh->statement_program_end;
@@ -4972,7 +5313,7 @@ dwarf_decode_lines (struct line_header *lh, char *comp_dir, bfd *abfd,
line += lh->line_base + (adj_opcode % lh->line_range);
/* append row to matrix using current values */
record_line (current_subfile, line,
- check_cu_functions (address));
+ check_cu_functions (address, cu));
basic_block = 1;
}
else switch (op_code)
@@ -5019,7 +5360,7 @@ dwarf_decode_lines (struct line_header *lh, char *comp_dir, bfd *abfd,
break;
case DW_LNS_copy:
record_line (current_subfile, line,
- check_cu_functions (address));
+ check_cu_functions (address, cu));
basic_block = 0;
break;
case DW_LNS_advance_pc:
@@ -5200,21 +5541,24 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
char *name;
struct attribute *attr = NULL;
struct attribute *attr2 = NULL;
+ CORE_ADDR baseaddr;
+
+ baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
if (die->tag != DW_TAG_namespace)
- name = dwarf2_linkage_name (die);
+ name = dwarf2_linkage_name (die, cu);
else
name = TYPE_NAME (type);
if (name)
{
- sym = (struct symbol *) obstack_alloc (&objfile->symbol_obstack,
+ sym = (struct symbol *) obstack_alloc (&objfile->objfile_obstack,
sizeof (struct symbol));
OBJSTAT (objfile, n_syms++);
memset (sym, 0, sizeof (struct symbol));
/* Cache this symbol's name and the name's demangled form (if any). */
- SYMBOL_LANGUAGE (sym) = cu_language;
+ SYMBOL_LANGUAGE (sym) = cu->language;
SYMBOL_SET_NAMES (sym, name, strlen (name), objfile);
/* Default assumptions.
@@ -5225,7 +5569,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
SYMBOL_TYPE (sym) = type;
else
SYMBOL_TYPE (sym) = die_type (die, cu);
- attr = dwarf_attr (die, DW_AT_decl_line);
+ attr = dwarf2_attr (die, DW_AT_decl_line, cu);
if (attr)
{
SYMBOL_LINE (sym) = DW_UNSND (attr);
@@ -5233,7 +5577,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
switch (die->tag)
{
case DW_TAG_label:
- attr = dwarf_attr (die, DW_AT_low_pc);
+ attr = dwarf2_attr (die, DW_AT_low_pc, cu);
if (attr)
{
SYMBOL_VALUE_ADDRESS (sym) = DW_ADDR (attr) + baseaddr;
@@ -5244,14 +5588,14 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
/* SYMBOL_BLOCK_VALUE (sym) will be filled in later by
finish_block. */
SYMBOL_CLASS (sym) = LOC_BLOCK;
- attr2 = dwarf_attr (die, DW_AT_external);
+ attr2 = dwarf2_attr (die, DW_AT_external, cu);
if (attr2 && (DW_UNSND (attr2) != 0))
{
add_symbol_to_list (sym, &global_symbols);
}
else
{
- add_symbol_to_list (sym, list_in_scope);
+ add_symbol_to_list (sym, cu->list_in_scope);
}
break;
case DW_TAG_variable:
@@ -5263,26 +5607,26 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
TARGET_INT_BIT / HOST_CHAR_BIT, 0,
"<variable, no debug info>",
objfile);
- attr = dwarf_attr (die, DW_AT_const_value);
+ attr = dwarf2_attr (die, DW_AT_const_value, cu);
if (attr)
{
dwarf2_const_value (attr, sym, cu);
- attr2 = dwarf_attr (die, DW_AT_external);
+ attr2 = dwarf2_attr (die, DW_AT_external, cu);
if (attr2 && (DW_UNSND (attr2) != 0))
add_symbol_to_list (sym, &global_symbols);
else
- add_symbol_to_list (sym, list_in_scope);
+ add_symbol_to_list (sym, cu->list_in_scope);
break;
}
- attr = dwarf_attr (die, DW_AT_location);
+ attr = dwarf2_attr (die, DW_AT_location, cu);
if (attr)
{
var_decode_location (attr, sym, cu);
- attr2 = dwarf_attr (die, DW_AT_external);
+ attr2 = dwarf2_attr (die, DW_AT_external, cu);
if (attr2 && (DW_UNSND (attr2) != 0))
add_symbol_to_list (sym, &global_symbols);
else
- add_symbol_to_list (sym, list_in_scope);
+ add_symbol_to_list (sym, cu->list_in_scope);
}
else
{
@@ -5292,9 +5636,9 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
The address of the variable will then be determined from
the minimal symbol table whenever the variable is
referenced. */
- attr2 = dwarf_attr (die, DW_AT_external);
+ attr2 = dwarf2_attr (die, DW_AT_external, cu);
if (attr2 && (DW_UNSND (attr2) != 0)
- && dwarf_attr (die, DW_AT_type) != NULL)
+ && dwarf2_attr (die, DW_AT_type, cu) != NULL)
{
SYMBOL_CLASS (sym) = LOC_UNRESOLVED;
add_symbol_to_list (sym, &global_symbols);
@@ -5302,7 +5646,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
}
break;
case DW_TAG_formal_parameter:
- attr = dwarf_attr (die, DW_AT_location);
+ attr = dwarf2_attr (die, DW_AT_location, cu);
if (attr)
{
var_decode_location (attr, sym, cu);
@@ -5310,12 +5654,12 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
if (SYMBOL_CLASS (sym) == LOC_COMPUTED)
SYMBOL_CLASS (sym) = LOC_COMPUTED_ARG;
}
- attr = dwarf_attr (die, DW_AT_const_value);
+ attr = dwarf2_attr (die, DW_AT_const_value, cu);
if (attr)
{
dwarf2_const_value (attr, sym, cu);
}
- add_symbol_to_list (sym, list_in_scope);
+ add_symbol_to_list (sym, cu->list_in_scope);
break;
case DW_TAG_unspecified_parameters:
/* From varargs functions; gdb doesn't seem to have any
@@ -5328,39 +5672,109 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
case DW_TAG_enumeration_type:
SYMBOL_CLASS (sym) = LOC_TYPEDEF;
SYMBOL_DOMAIN (sym) = STRUCT_DOMAIN;
- add_symbol_to_list (sym, list_in_scope);
- /* The semantics of C++ state that "struct foo { ... }" also
- defines a typedef for "foo". Synthesize a typedef symbol so
- that "ptype foo" works as expected. */
- if (cu_language == language_cplus)
+ /* Make sure that the symbol includes appropriate enclosing
+ classes/namespaces in its name. These are calculated in
+ read_structure_scope, and the correct name is saved in
+ the type. */
+
+ if (cu->language == language_cplus)
{
- struct symbol *typedef_sym = (struct symbol *)
- obstack_alloc (&objfile->symbol_obstack,
- sizeof (struct symbol));
- *typedef_sym = *sym;
- SYMBOL_DOMAIN (typedef_sym) = VAR_DOMAIN;
- if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0)
- TYPE_NAME (SYMBOL_TYPE (sym)) =
- obsavestring (DEPRECATED_SYMBOL_NAME (sym),
- strlen (DEPRECATED_SYMBOL_NAME (sym)),
- &objfile->type_obstack);
- add_symbol_to_list (typedef_sym, list_in_scope);
+ struct type *type = SYMBOL_TYPE (sym);
+
+ if (TYPE_TAG_NAME (type) != NULL)
+ {
+ /* FIXME: carlton/2003-11-10: Should this use
+ SYMBOL_SET_NAMES instead? (The same problem also
+ arises a further down in the function.) */
+ SYMBOL_LINKAGE_NAME (sym)
+ = obsavestring (TYPE_TAG_NAME (type),
+ strlen (TYPE_TAG_NAME (type)),
+ &objfile->objfile_obstack);
+ }
}
+
+ {
+ /* NOTE: carlton/2003-11-10: C++ class symbols shouldn't
+ really ever be static objects: otherwise, if you try
+ to, say, break of a class's method and you're in a file
+ which doesn't mention that class, it won't work unless
+ the check for all static symbols in lookup_symbol_aux
+ saves you. See the OtherFileClass tests in
+ gdb.c++/namespace.exp. */
+
+ struct pending **list_to_add;
+
+ list_to_add = (cu->list_in_scope == &file_symbols
+ && cu->language == language_cplus
+ ? &global_symbols : cu->list_in_scope);
+
+ add_symbol_to_list (sym, list_to_add);
+
+ /* The semantics of C++ state that "struct foo { ... }" also
+ defines a typedef for "foo". Synthesize a typedef symbol so
+ that "ptype foo" works as expected. */
+ if (cu->language == language_cplus)
+ {
+ struct symbol *typedef_sym = (struct symbol *)
+ obstack_alloc (&objfile->objfile_obstack,
+ sizeof (struct symbol));
+ *typedef_sym = *sym;
+ SYMBOL_DOMAIN (typedef_sym) = VAR_DOMAIN;
+ if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0)
+ TYPE_NAME (SYMBOL_TYPE (sym)) =
+ obsavestring (SYMBOL_NATURAL_NAME (sym),
+ strlen (SYMBOL_NATURAL_NAME (sym)),
+ &objfile->objfile_obstack);
+ add_symbol_to_list (typedef_sym, list_to_add);
+ }
+ }
break;
case DW_TAG_typedef:
+ if (processing_has_namespace_info
+ && processing_current_prefix[0] != '\0')
+ {
+ SYMBOL_LINKAGE_NAME (sym) = obconcat (&objfile->objfile_obstack,
+ processing_current_prefix,
+ "::",
+ name);
+ }
+ SYMBOL_CLASS (sym) = LOC_TYPEDEF;
+ SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
+ add_symbol_to_list (sym, cu->list_in_scope);
+ break;
case DW_TAG_base_type:
+ case DW_TAG_subrange_type:
SYMBOL_CLASS (sym) = LOC_TYPEDEF;
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
- add_symbol_to_list (sym, list_in_scope);
+ add_symbol_to_list (sym, cu->list_in_scope);
break;
case DW_TAG_enumerator:
- attr = dwarf_attr (die, DW_AT_const_value);
+ if (processing_has_namespace_info
+ && processing_current_prefix[0] != '\0')
+ {
+ SYMBOL_LINKAGE_NAME (sym) = obconcat (&objfile->objfile_obstack,
+ processing_current_prefix,
+ "::",
+ name);
+ }
+ attr = dwarf2_attr (die, DW_AT_const_value, cu);
if (attr)
{
dwarf2_const_value (attr, sym, cu);
}
- add_symbol_to_list (sym, list_in_scope);
+ {
+ /* NOTE: carlton/2003-11-10: See comment above in the
+ DW_TAG_class_type, etc. block. */
+
+ struct pending **list_to_add;
+
+ list_to_add = (cu->list_in_scope == &file_symbols
+ && cu->language == language_cplus
+ ? &global_symbols : cu->list_in_scope);
+
+ add_symbol_to_list (sym, list_to_add);
+ }
break;
case DW_TAG_namespace:
SYMBOL_CLASS (sym) = LOC_TYPEDEF;
@@ -5398,7 +5812,7 @@ dwarf2_const_value (struct attribute *attr, struct symbol *sym,
TYPE_LENGTH (SYMBOL_TYPE
(sym)));
SYMBOL_VALUE_BYTES (sym) = (char *)
- obstack_alloc (&objfile->symbol_obstack, cu_header->addr_size);
+ obstack_alloc (&objfile->objfile_obstack, cu_header->addr_size);
/* 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,
@@ -5416,7 +5830,7 @@ dwarf2_const_value (struct attribute *attr, struct symbol *sym,
TYPE_LENGTH (SYMBOL_TYPE
(sym)));
SYMBOL_VALUE_BYTES (sym) = (char *)
- obstack_alloc (&objfile->symbol_obstack, blk->size);
+ obstack_alloc (&objfile->objfile_obstack, blk->size);
memcpy (SYMBOL_VALUE_BYTES (sym), blk->data, blk->size);
SYMBOL_CLASS (sym) = LOC_CONST_BYTES;
break;
@@ -5492,15 +5906,15 @@ die_type (struct die_info *die, struct dwarf2_cu *cu)
struct die_info *type_die;
unsigned int ref;
- type_attr = dwarf_attr (die, DW_AT_type);
+ type_attr = dwarf2_attr (die, DW_AT_type, cu);
if (!type_attr)
{
/* A missing DW_AT_type represents a void type. */
- return dwarf2_fundamental_type (cu->objfile, FT_VOID);
+ return dwarf2_fundamental_type (cu->objfile, FT_VOID, cu);
}
else
{
- ref = dwarf2_get_ref_die_offset (type_attr);
+ ref = dwarf2_get_ref_die_offset (type_attr, cu);
type_die = follow_die_ref (ref);
if (!type_die)
{
@@ -5530,10 +5944,10 @@ die_containing_type (struct die_info *die, struct dwarf2_cu *cu)
struct die_info *type_die = NULL;
unsigned int ref;
- type_attr = dwarf_attr (die, DW_AT_containing_type);
+ type_attr = dwarf2_attr (die, DW_AT_containing_type, cu);
if (type_attr)
{
- ref = dwarf2_get_ref_die_offset (type_attr);
+ ref = dwarf2_get_ref_die_offset (type_attr, cu);
type_die = follow_die_ref (ref);
if (!type_die)
{
@@ -5594,6 +6008,11 @@ tag_type_to_type (struct die_info *die, struct dwarf2_cu *cu)
static void
read_type_die (struct die_info *die, struct dwarf2_cu *cu)
{
+ char *prefix = determine_prefix (die, cu);
+ const char *old_prefix = processing_current_prefix;
+ struct cleanup *back_to = make_cleanup (xfree, prefix);
+ processing_current_prefix = prefix;
+
switch (die->tag)
{
case DW_TAG_class_type:
@@ -5632,6 +6051,9 @@ read_type_die (struct die_info *die, struct dwarf2_cu *cu)
case DW_TAG_typedef:
read_typedef (die, cu);
break;
+ case DW_TAG_subrange_type:
+ read_subrange_type (die, cu);
+ break;
case DW_TAG_base_type:
read_base_type (die, cu);
break;
@@ -5640,6 +6062,129 @@ read_type_die (struct die_info *die, struct dwarf2_cu *cu)
dwarf_tag_name (die->tag));
break;
}
+
+ processing_current_prefix = old_prefix;
+ do_cleanups (back_to);
+}
+
+/* Return the name of the namespace/class that DIE is defined within,
+ or "" if we can't tell. The caller should xfree the result. */
+
+/* NOTE: carlton/2004-01-23: See read_func_scope (and the comment
+ therein) for an example of how to use this function to deal with
+ DW_AT_specification. */
+
+static char *
+determine_prefix (struct die_info *die, struct dwarf2_cu *cu)
+{
+ char *prefix = determine_prefix_aux (die, cu);
+
+ return prefix ? prefix : xstrdup ("");
+}
+
+/* Return the name of the namespace/class that DIE is defined
+ within, or NULL if we can't tell. The caller should xfree the
+ result. */
+
+static char *
+determine_prefix_aux (struct die_info *die, struct dwarf2_cu *cu)
+{
+ struct die_info *parent;
+
+ if (cu->language != language_cplus)
+ return NULL;
+
+ parent = die->parent;
+
+ if (parent == NULL)
+ {
+ return (processing_has_namespace_info ? xstrdup ("") : NULL);
+ }
+ else
+ {
+ char *parent_prefix = determine_prefix_aux (parent, cu);
+ char *retval;
+
+ switch (parent->tag) {
+ case DW_TAG_namespace:
+ {
+ int dummy;
+
+ retval = typename_concat (parent_prefix,
+ namespace_name (parent, &dummy, cu));
+ }
+ break;
+ case DW_TAG_class_type:
+ case DW_TAG_structure_type:
+ {
+ if (parent_prefix != NULL)
+ {
+ const char *parent_name = dwarf2_name (parent, cu);
+
+ if (parent_name != NULL)
+ retval = typename_concat (parent_prefix, dwarf2_name (parent, cu));
+ else
+ /* FIXME: carlton/2003-11-10: I'm not sure what the
+ best thing to do here is. */
+ retval = typename_concat (parent_prefix,
+ "<<anonymous class>>");
+ }
+ else
+ retval = class_name (parent, cu);
+ }
+ break;
+ default:
+ retval = parent_prefix;
+ break;
+ }
+
+ if (retval != parent_prefix)
+ xfree (parent_prefix);
+ return retval;
+ }
+}
+
+/* Return a newly-allocated string formed by concatenating PREFIX,
+ "::", and SUFFIX, except that if PREFIX is NULL or the empty
+ string, just return a copy of SUFFIX. */
+
+static char *
+typename_concat (const char *prefix, const char *suffix)
+{
+ if (prefix == NULL || prefix[0] == '\0')
+ return xstrdup (suffix);
+ else
+ {
+ char *retval = xmalloc (strlen (prefix) + 2 + strlen (suffix) + 1);
+
+ strcpy (retval, prefix);
+ strcat (retval, "::");
+ strcat (retval, suffix);
+
+ return retval;
+ }
+}
+
+/* Return a newly-allocated string giving the name of the class given
+ by DIE. */
+
+static char *
+class_name (struct die_info *die, struct dwarf2_cu *cu)
+{
+ struct die_info *child;
+ const char *name;
+
+ for (child = die->child; child != NULL; child = sibling_die (child))
+ {
+ if (child->tag == DW_TAG_subprogram)
+ return class_name_from_physname (dwarf2_linkage_name (child, cu));
+ }
+
+ name = dwarf2_name (die, cu);
+ if (name != NULL)
+ return xstrdup (name);
+ else
+ return xstrdup ("");
}
static struct type *
@@ -5653,69 +6198,69 @@ dwarf_base_type (int encoding, int size, struct dwarf2_cu *cu)
switch (encoding)
{
case DW_ATE_address:
- type = dwarf2_fundamental_type (objfile, FT_VOID);
+ type = dwarf2_fundamental_type (objfile, FT_VOID, cu);
return type;
case DW_ATE_boolean:
- type = dwarf2_fundamental_type (objfile, FT_BOOLEAN);
+ type = dwarf2_fundamental_type (objfile, FT_BOOLEAN, cu);
return type;
case DW_ATE_complex_float:
if (size == 16)
{
- type = dwarf2_fundamental_type (objfile, FT_DBL_PREC_COMPLEX);
+ type = dwarf2_fundamental_type (objfile, FT_DBL_PREC_COMPLEX, cu);
}
else
{
- type = dwarf2_fundamental_type (objfile, FT_COMPLEX);
+ type = dwarf2_fundamental_type (objfile, FT_COMPLEX, cu);
}
return type;
case DW_ATE_float:
if (size == 8)
{
- type = dwarf2_fundamental_type (objfile, FT_DBL_PREC_FLOAT);
+ type = dwarf2_fundamental_type (objfile, FT_DBL_PREC_FLOAT, cu);
}
else
{
- type = dwarf2_fundamental_type (objfile, FT_FLOAT);
+ type = dwarf2_fundamental_type (objfile, FT_FLOAT, cu);
}
return type;
case DW_ATE_signed:
switch (size)
{
case 1:
- type = dwarf2_fundamental_type (objfile, FT_SIGNED_CHAR);
+ type = dwarf2_fundamental_type (objfile, FT_SIGNED_CHAR, cu);
break;
case 2:
- type = dwarf2_fundamental_type (objfile, FT_SIGNED_SHORT);
+ type = dwarf2_fundamental_type (objfile, FT_SIGNED_SHORT, cu);
break;
default:
case 4:
- type = dwarf2_fundamental_type (objfile, FT_SIGNED_INTEGER);
+ type = dwarf2_fundamental_type (objfile, FT_SIGNED_INTEGER, cu);
break;
}
return type;
case DW_ATE_signed_char:
- type = dwarf2_fundamental_type (objfile, FT_SIGNED_CHAR);
+ type = dwarf2_fundamental_type (objfile, FT_SIGNED_CHAR, cu);
return type;
case DW_ATE_unsigned:
switch (size)
{
case 1:
- type = dwarf2_fundamental_type (objfile, FT_UNSIGNED_CHAR);
+ type = dwarf2_fundamental_type (objfile, FT_UNSIGNED_CHAR, cu);
break;
case 2:
- type = dwarf2_fundamental_type (objfile, FT_UNSIGNED_SHORT);
+ type = dwarf2_fundamental_type (objfile, FT_UNSIGNED_SHORT, cu);
break;
default:
case 4:
- type = dwarf2_fundamental_type (objfile, FT_UNSIGNED_INTEGER);
+ type = dwarf2_fundamental_type (objfile, FT_UNSIGNED_INTEGER, cu);
break;
}
return type;
case DW_ATE_unsigned_char:
- type = dwarf2_fundamental_type (objfile, FT_UNSIGNED_CHAR);
+ type = dwarf2_fundamental_type (objfile, FT_UNSIGNED_CHAR, cu);
return type;
default:
- type = dwarf2_fundamental_type (objfile, FT_SIGNED_INTEGER);
+ type = dwarf2_fundamental_type (objfile, FT_SIGNED_INTEGER, cu);
return type;
}
}
@@ -5764,14 +6309,14 @@ sibling_die (struct die_info *die)
/* Get linkage name of a die, return NULL if not found. */
static char *
-dwarf2_linkage_name (struct die_info *die)
+dwarf2_linkage_name (struct die_info *die, struct dwarf2_cu *cu)
{
struct attribute *attr;
- attr = dwarf_attr (die, DW_AT_MIPS_linkage_name);
+ attr = dwarf2_attr (die, DW_AT_MIPS_linkage_name, cu);
if (attr && DW_STRING (attr))
return DW_STRING (attr);
- attr = dwarf_attr (die, DW_AT_name);
+ attr = dwarf2_attr (die, DW_AT_name, cu);
if (attr && DW_STRING (attr))
return DW_STRING (attr);
return NULL;
@@ -5780,11 +6325,11 @@ dwarf2_linkage_name (struct die_info *die)
/* Get name of a die, return NULL if not found. */
static char *
-dwarf2_name (struct die_info *die)
+dwarf2_name (struct die_info *die, struct dwarf2_cu *cu)
{
struct attribute *attr;
- attr = dwarf_attr (die, DW_AT_name);
+ attr = dwarf2_attr (die, DW_AT_name, cu);
if (attr && DW_STRING (attr))
return DW_STRING (attr);
return NULL;
@@ -5794,17 +6339,17 @@ dwarf2_name (struct die_info *die)
is none. */
static struct die_info *
-dwarf2_extension (struct die_info *die)
+dwarf2_extension (struct die_info *die, struct dwarf2_cu *cu)
{
struct attribute *attr;
struct die_info *extension_die;
unsigned int ref;
- attr = dwarf_attr (die, DW_AT_extension);
+ attr = dwarf2_attr (die, DW_AT_extension, cu);
if (attr == NULL)
return NULL;
- ref = dwarf2_get_ref_die_offset (attr);
+ ref = dwarf2_get_ref_die_offset (attr, cu);
extension_die = follow_die_ref (ref);
if (!extension_die)
{
@@ -6717,7 +7262,7 @@ dwarf2_empty_hash_tables (void)
}
static unsigned int
-dwarf2_get_ref_die_offset (struct attribute *attr)
+dwarf2_get_ref_die_offset (struct attribute *attr, struct dwarf2_cu *cu)
{
unsigned int result = 0;
@@ -6731,7 +7276,7 @@ dwarf2_get_ref_die_offset (struct attribute *attr)
case DW_FORM_ref4:
case DW_FORM_ref8:
case DW_FORM_ref_udata:
- result = cu_header_offset + DW_UNSND (attr);
+ result = cu->header.offset + DW_UNSND (attr);
break;
default:
complaint (&symfile_complaints,
@@ -6741,6 +7286,28 @@ dwarf2_get_ref_die_offset (struct attribute *attr)
return result;
}
+/* Return the constant value held by the given attribute. Return -1
+ if the value held by the attribute is not constant. */
+
+static int
+dwarf2_get_attr_constant_value (struct attribute *attr, int default_value)
+{
+ if (attr->form == DW_FORM_sdata)
+ return DW_SND (attr);
+ else if (attr->form == DW_FORM_udata
+ || attr->form == DW_FORM_data1
+ || attr->form == DW_FORM_data2
+ || attr->form == DW_FORM_data4
+ || attr->form == DW_FORM_data8)
+ return DW_UNSND (attr);
+ else
+ {
+ complaint (&symfile_complaints, "Attribute value is not a constant (%s)",
+ dwarf_form_name (attr->form));
+ return default_value;
+ }
+}
+
static struct die_info *
follow_die_ref (unsigned int offset)
{
@@ -6761,7 +7328,8 @@ follow_die_ref (unsigned int offset)
}
static struct type *
-dwarf2_fundamental_type (struct objfile *objfile, int typeid)
+dwarf2_fundamental_type (struct objfile *objfile, int typeid,
+ struct dwarf2_cu *cu)
{
if (typeid < 0 || typeid >= FT_NUM_MEMBERS)
{
@@ -6773,12 +7341,12 @@ dwarf2_fundamental_type (struct objfile *objfile, int typeid)
one is not found, create and install one appropriate for the
current language and the current target machine. */
- if (ftypes[typeid] == NULL)
+ if (cu->ftypes[typeid] == NULL)
{
- ftypes[typeid] = cu_language_defn->la_fund_type (objfile, typeid);
+ cu->ftypes[typeid] = cu->language_defn->la_fund_type (objfile, typeid);
}
- return (ftypes[typeid]);
+ return (cu->ftypes[typeid]);
}
/* Decode simple location descriptions.
@@ -7098,7 +7666,7 @@ macro_start_file (int file, int line,
/* We don't create a macro table for this compilation unit
at all until we actually get a filename. */
if (! pending_macros)
- pending_macros = new_macro_table (&objfile->symbol_obstack,
+ pending_macros = new_macro_table (&objfile->objfile_obstack,
objfile->macro_cache);
if (! current_file)
@@ -7441,7 +8009,7 @@ dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym,
{
struct dwarf2_loclist_baton *baton;
- baton = obstack_alloc (&cu->objfile->symbol_obstack,
+ baton = obstack_alloc (&cu->objfile->objfile_obstack,
sizeof (struct dwarf2_loclist_baton));
baton->objfile = cu->objfile;
@@ -7454,14 +8022,14 @@ dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym,
complaint (&symfile_complaints,
"Location list used without specifying the CU base address.");
- SYMBOL_LOCATION_FUNCS (sym) = &dwarf2_loclist_funcs;
+ SYMBOL_OPS (sym) = &dwarf2_loclist_funcs;
SYMBOL_LOCATION_BATON (sym) = baton;
}
else
{
struct dwarf2_locexpr_baton *baton;
- baton = obstack_alloc (&cu->objfile->symbol_obstack,
+ baton = obstack_alloc (&cu->objfile->objfile_obstack,
sizeof (struct dwarf2_locexpr_baton));
baton->objfile = cu->objfile;
@@ -7483,7 +8051,7 @@ dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym,
baton->data = NULL;
}
- SYMBOL_LOCATION_FUNCS (sym) = &dwarf2_locexpr_funcs;
+ SYMBOL_OPS (sym) = &dwarf2_locexpr_funcs;
SYMBOL_LOCATION_BATON (sym) = baton;
}
}
diff --git a/gdb/dwarfread.c b/gdb/dwarfread.c
index 5d1518d..8048466 100644
--- a/gdb/dwarfread.c
+++ b/gdb/dwarfread.c
@@ -1,7 +1,7 @@
/* DWARF debugging format support for GDB.
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+ 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
Written by Fred Fish at Cygnus Support. Portions based on dbxread.c,
mipsread.c, coffread.c, and dwarfread.c from a Data General SVR4 gdb port.
@@ -968,7 +968,7 @@ struct_type (struct dieinfo *dip, char *thisdie, char *enddie,
&& *dip->at_name != '~'
&& *dip->at_name != '.')
{
- TYPE_TAG_NAME (type) = obconcat (&objfile->type_obstack,
+ TYPE_TAG_NAME (type) = obconcat (&objfile->objfile_obstack,
"", "", dip->at_name);
}
/* Use whatever size is known. Zero is a valid size. We might however
@@ -1011,7 +1011,7 @@ struct_type (struct dieinfo *dip, char *thisdie, char *enddie,
/* Save the data. */
list->field.name =
obsavestring (mbr.at_name, strlen (mbr.at_name),
- &objfile->type_obstack);
+ &objfile->objfile_obstack);
FIELD_TYPE (list->field) = decode_die_type (&mbr);
FIELD_BITPOS (list->field) = 8 * locval (&mbr);
FIELD_STATIC_KIND (list->field) = 0;
@@ -1670,7 +1670,7 @@ enum_type (struct dieinfo *dip, struct objfile *objfile)
&& *dip->at_name != '~'
&& *dip->at_name != '.')
{
- TYPE_TAG_NAME (type) = obconcat (&objfile->type_obstack,
+ TYPE_TAG_NAME (type) = obconcat (&objfile->objfile_obstack,
"", "", dip->at_name);
}
if (dip->at_byte_size != 0)
@@ -1704,15 +1704,15 @@ enum_type (struct dieinfo *dip, struct objfile *objfile)
objfile);
scan += TARGET_FT_LONG_SIZE (objfile);
list->field.name = obsavestring (scan, strlen (scan),
- &objfile->type_obstack);
+ &objfile->objfile_obstack);
scan += strlen (scan) + 1;
nfields++;
/* Handcraft a new symbol for this enum member. */
- sym = (struct symbol *) obstack_alloc (&objfile->symbol_obstack,
+ sym = (struct symbol *) obstack_alloc (&objfile->objfile_obstack,
sizeof (struct symbol));
memset (sym, 0, sizeof (struct symbol));
DEPRECATED_SYMBOL_NAME (sym) = create_name (list->field.name,
- &objfile->symbol_obstack);
+ &objfile->objfile_obstack);
SYMBOL_INIT_LANGUAGE_SPECIFIC (sym, cu_language);
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
SYMBOL_CLASS (sym) = LOC_CONST;
@@ -1733,7 +1733,7 @@ enum_type (struct dieinfo *dip, struct objfile *objfile)
TYPE_FLAGS (type) |= TYPE_FLAG_UNSIGNED;
TYPE_NFIELDS (type) = nfields;
TYPE_FIELDS (type) = (struct field *)
- obstack_alloc (&objfile->symbol_obstack, sizeof (struct field) * nfields);
+ obstack_alloc (&objfile->objfile_obstack, sizeof (struct field) * nfields);
/* Copy the saved-up fields into the field vector. */
for (n = 0; (n < nfields) && (list != NULL); list = list->next)
{
@@ -2800,7 +2800,7 @@ scan_compilation_units (char *thisdie, char *enddie, file_ptr dbfoff,
pst->texthigh = di.at_high_pc;
pst->read_symtab_private = (char *)
- obstack_alloc (&objfile->psymbol_obstack,
+ obstack_alloc (&objfile->objfile_obstack,
sizeof (struct dwfinfo));
DBFOFF (pst) = dbfoff;
DBROFF (pst) = curoff;
@@ -2851,7 +2851,7 @@ new_symbol (struct dieinfo *dip, struct objfile *objfile)
if (dip->at_name != NULL)
{
- sym = (struct symbol *) obstack_alloc (&objfile->symbol_obstack,
+ sym = (struct symbol *) obstack_alloc (&objfile->objfile_obstack,
sizeof (struct symbol));
OBJSTAT (objfile, n_syms++);
memset (sym, 0, sizeof (struct symbol));
@@ -3011,11 +3011,11 @@ synthesize_typedef (struct dieinfo *dip, struct objfile *objfile,
if (dip->at_name != NULL)
{
sym = (struct symbol *)
- obstack_alloc (&objfile->symbol_obstack, sizeof (struct symbol));
+ obstack_alloc (&objfile->objfile_obstack, sizeof (struct symbol));
OBJSTAT (objfile, n_syms++);
memset (sym, 0, sizeof (struct symbol));
DEPRECATED_SYMBOL_NAME (sym) = create_name (dip->at_name,
- &objfile->symbol_obstack);
+ &objfile->objfile_obstack);
SYMBOL_INIT_LANGUAGE_SPECIFIC (sym, cu_language);
SYMBOL_TYPE (sym) = type;
SYMBOL_CLASS (sym) = LOC_TYPEDEF;
diff --git a/gdb/elfread.c b/gdb/elfread.c
index d3779c0..83a1862 100644
--- a/gdb/elfread.c
+++ b/gdb/elfread.c
@@ -1,7 +1,7 @@
/* Read ELF (Executable and Linking Format) object files for GDB.
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+ 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
Written by Fred Fish at Cygnus Support.
@@ -159,8 +159,8 @@ elf_symtab_read (struct objfile *objfile, int dynamic)
seen any section info for it yet. */
asymbol *filesym = 0;
#ifdef SOFUN_ADDRESS_MAYBE_MISSING
- /* Name of filesym, as saved on the symbol_obstack. */
- char *filesymname = obsavestring ("", 0, &objfile->symbol_obstack);
+ /* Name of filesym, as saved on the objfile_obstack. */
+ char *filesymname = obsavestring ("", 0, &objfile->objfile_obstack);
#endif
struct dbx_symfile_info *dbx = objfile->sym_stab_info;
int stripped = (bfd_get_symcount (objfile->obfd) == 0);
@@ -251,7 +251,7 @@ elf_symtab_read (struct objfile *objfile, int dynamic)
#ifdef SOFUN_ADDRESS_MAYBE_MISSING
filesymname =
obsavestring ((char *) filesym->name, strlen (filesym->name),
- &objfile->symbol_obstack);
+ &objfile->objfile_obstack);
#endif
}
else if (sym->flags & (BSF_GLOBAL | BSF_LOCAL | BSF_WEAK))
@@ -712,7 +712,7 @@ elfstab_offset_sections (struct objfile *objfile, struct partial_symtab *pst)
/* Found it! Allocate a new psymtab struct, and fill it in. */
maybe->found++;
pst->section_offsets = (struct section_offsets *)
- obstack_alloc (&objfile->psymbol_obstack,
+ obstack_alloc (&objfile->objfile_obstack,
SIZEOF_N_SECTION_OFFSETS (objfile->num_sections));
for (i = 0; i < maybe->num_sections; i++)
(pst->section_offsets)->offsets[i] = maybe->sections[i];
diff --git a/gdb/f-lang.c b/gdb/f-lang.c
index 37ca92c..c34b4a7 100644
--- a/gdb/f-lang.c
+++ b/gdb/f-lang.c
@@ -1,5 +1,5 @@
/* Fortran language support routines for GDB, the GNU debugger.
- Copyright 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
+ Copyright 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
Contributed by Motorola. Adapted from the C parser by Farooq Butt
(fmbutt@engage.sps.mot.com).
@@ -475,6 +475,7 @@ const struct language_defn f_language_defn =
NULL, /* Language specific skip_trampoline */
value_of_this, /* value_of_this */
basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
+ basic_lookup_transparent_type,/* lookup_transparent_type */
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 34b4a5b..5be4abf 100644
--- a/gdb/findvar.c
+++ b/gdb/findvar.c
@@ -346,11 +346,12 @@ symbol_read_needs_frame (struct symbol *sym)
we failed to consider one. */
case LOC_COMPUTED:
case LOC_COMPUTED_ARG:
- {
- struct location_funcs *symfuncs = SYMBOL_LOCATION_FUNCS (sym);
- return (symfuncs->read_needs_frame) (sym);
- }
- break;
+ /* FIXME: cagney/2004-01-26: It should be possible to
+ unconditionally call the SYMBOL_OPS method when available.
+ Unfortunately DWARF 2 stores the frame-base (instead of the
+ function) location in a function's symbol. Oops! For the
+ moment enable this when/where applicable. */
+ return SYMBOL_OPS (sym)->read_needs_frame (sym);
case LOC_REGISTER:
case LOC_ARG:
@@ -564,15 +565,14 @@ addresses have not been bound by the dynamic loader. Try again when executable i
case LOC_COMPUTED:
case LOC_COMPUTED_ARG:
- {
- struct location_funcs *funcs = SYMBOL_LOCATION_FUNCS (var);
-
- if (frame == 0 && (funcs->read_needs_frame) (var))
- return 0;
- return (funcs->read_variable) (var, frame);
-
- }
- break;
+ /* FIXME: cagney/2004-01-26: It should be possible to
+ unconditionally call the SYMBOL_OPS method when available.
+ Unfortunately DWARF 2 stores the frame-base (instead of the
+ function) location in a function's symbol. Oops! For the
+ moment enable this when/where applicable. */
+ if (frame == 0 && SYMBOL_OPS (var)->read_needs_frame (var))
+ return 0;
+ return SYMBOL_OPS (var)->read_variable (var, frame);
case LOC_UNRESOLVED:
{
diff --git a/gdb/frame.c b/gdb/frame.c
index a7da919..6c2a29f 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -1838,7 +1838,7 @@ get_prev_frame (struct frame_info *this_frame)
&& backtrace_beyond_entry_func
#endif
&& this_frame->type != DUMMY_FRAME && this_frame->level >= 0
- && inside_entry_func (get_frame_pc (this_frame)))
+ && inside_entry_func (this_frame))
{
if (frame_debug)
{
diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c
index 28fbc35..bc680c5 100644
--- a/gdb/frv-tdep.c
+++ b/gdb/frv-tdep.c
@@ -44,8 +44,6 @@ static gdbarch_breakpoint_from_pc_ftype frv_breakpoint_from_pc;
static gdbarch_adjust_breakpoint_address_ftype frv_gdbarch_adjust_breakpoint_address;
static gdbarch_skip_prologue_ftype frv_skip_prologue;
static gdbarch_frameless_function_invocation_ftype frv_frameless_function_invocation;
-static gdbarch_deprecated_push_arguments_ftype frv_push_arguments;
-static gdbarch_deprecated_saved_pc_after_call_ftype frv_saved_pc_after_call;
/* Register numbers. The order in which these appear define the
remote protocol, so take care in changing them. */
@@ -1402,7 +1400,7 @@ frv_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_deprecated_store_struct_return (gdbarch, frv_store_struct_return);
set_gdbarch_store_return_value (gdbarch, frv_store_return_value);
- set_gdbarch_extract_struct_value_address (gdbarch, frv_extract_struct_value_address);
+ set_gdbarch_deprecated_extract_struct_value_address (gdbarch, frv_extract_struct_value_address);
/* Frame stuff. */
set_gdbarch_unwind_pc (gdbarch, frv_unwind_pc);
@@ -1420,9 +1418,6 @@ frv_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_write_pc (gdbarch, generic_target_write_pc);
- set_gdbarch_decr_pc_after_break (gdbarch, 0);
- set_gdbarch_function_start_offset (gdbarch, 0);
-
set_gdbarch_remote_translate_xfer_address
(gdbarch, generic_remote_translate_xfer_address);
diff --git a/gdb/gcore.c b/gdb/gcore.c
index d1525dd..b551372 100644
--- a/gdb/gcore.c
+++ b/gdb/gcore.c
@@ -1,6 +1,6 @@
/* Generate a core file for the inferior process.
- Copyright 2001, 2002, 2003 Free Software Foundation, Inc.
+ Copyright 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of GDB.
@@ -314,6 +314,20 @@ gcore_create_callback (CORE_ADDR vaddr, unsigned long size,
asection *osec;
flagword flags = SEC_ALLOC | SEC_HAS_CONTENTS | SEC_LOAD;
+ /* If the memory segment has no permissions set, ignore it, otherwise
+ when we later try to access it for read/write, we'll get an error
+ or jam the kernel. */
+ if (read == 0 && write == 0 && exec == 0)
+ {
+ if (info_verbose)
+ {
+ fprintf_filtered (gdb_stdout, "Ignore segment, %s bytes at 0x%s\n",
+ paddr_d (size), paddr_nz (vaddr));
+ }
+
+ return 0;
+ }
+
if (write == 0)
{
/* See if this region of memory lies inside a known file on disk.
@@ -364,8 +378,8 @@ gcore_create_callback (CORE_ADDR vaddr, unsigned long size,
if (info_verbose)
{
- fprintf_filtered (gdb_stdout, "Save segment, %lld bytes at 0x%s\n",
- (long long) size, paddr_nz (vaddr));
+ fprintf_filtered (gdb_stdout, "Save segment, %s bytes at 0x%s\n",
+ paddr_d (size), paddr_nz (vaddr));
}
bfd_set_section_size (obfd, osec, size);
@@ -450,8 +464,8 @@ gcore_copy_callback (bfd *obfd, asection *osec, void *ignored)
if (target_read_memory (bfd_section_vma (obfd, osec),
memhunk, size) != 0)
- warning ("Memory read failed for corefile section, %ld bytes at 0x%s\n",
- (long) size, paddr (bfd_section_vma (obfd, osec)));
+ warning ("Memory read failed for corefile section, %s bytes at 0x%s\n",
+ paddr_d (size), paddr (bfd_section_vma (obfd, osec)));
if (!bfd_set_section_contents (obfd, osec, memhunk, 0, size))
warning ("Failed to write corefile contents (%s).",
bfd_errmsg (bfd_get_error ()));
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index bac577b..a3d4ee5 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -1,7 +1,9 @@
/* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
/* Dynamic architecture support for GDB, the GNU debugger.
- Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+
+ Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free
+ Software Foundation, Inc.
This file is part of GDB.
@@ -137,7 +139,6 @@ struct gdbarch
int pc_regnum;
int ps_regnum;
int fp0_regnum;
- int deprecated_npc_regnum;
gdbarch_stab_reg_to_regnum_ftype *stab_reg_to_regnum;
gdbarch_ecoff_reg_to_regnum_ftype *ecoff_reg_to_regnum;
gdbarch_dwarf_reg_to_regnum_ftype *dwarf_reg_to_regnum;
@@ -207,7 +208,6 @@ struct gdbarch
gdbarch_deprecated_extract_return_value_ftype *deprecated_extract_return_value;
gdbarch_deprecated_store_return_value_ftype *deprecated_store_return_value;
gdbarch_use_struct_convention_ftype *use_struct_convention;
- gdbarch_extract_struct_value_address_ftype *extract_struct_value_address;
gdbarch_deprecated_extract_struct_value_address_ftype *deprecated_extract_struct_value_address;
gdbarch_deprecated_frame_init_saved_regs_ftype *deprecated_frame_init_saved_regs;
gdbarch_deprecated_init_extra_frame_info_ftype *deprecated_init_extra_frame_info;
@@ -310,7 +310,6 @@ struct gdbarch startup_gdbarch =
-1, /* pc_regnum */
-1, /* ps_regnum */
0, /* fp0_regnum */
- 0, /* deprecated_npc_regnum */
0, /* stab_reg_to_regnum */
0, /* ecoff_reg_to_regnum */
0, /* dwarf_reg_to_regnum */
@@ -380,7 +379,6 @@ struct gdbarch startup_gdbarch =
0, /* deprecated_extract_return_value */
0, /* deprecated_store_return_value */
0, /* use_struct_convention */
- 0, /* extract_struct_value_address */
0, /* deprecated_extract_struct_value_address */
0, /* deprecated_frame_init_saved_regs */
0, /* deprecated_init_extra_frame_info */
@@ -493,7 +491,6 @@ gdbarch_alloc (const struct gdbarch_info *info,
current_gdbarch->pc_regnum = -1;
current_gdbarch->ps_regnum = -1;
current_gdbarch->fp0_regnum = -1;
- current_gdbarch->deprecated_npc_regnum = -1;
current_gdbarch->stab_reg_to_regnum = no_op_reg_to_regnum;
current_gdbarch->ecoff_reg_to_regnum = no_op_reg_to_regnum;
current_gdbarch->dwarf_reg_to_regnum = no_op_reg_to_regnum;
@@ -525,8 +522,6 @@ gdbarch_alloc (const struct gdbarch_info *info,
current_gdbarch->prologue_frameless_p = generic_prologue_frameless_p;
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;
- current_gdbarch->function_start_offset = -1;
current_gdbarch->remote_translate_xfer_address = generic_remote_translate_xfer_address;
current_gdbarch->frame_args_skip = -1;
current_gdbarch->frameless_function_invocation = generic_frameless_function_invocation_not;
@@ -632,7 +627,6 @@ verify_gdbarch (struct gdbarch *current_gdbarch)
/* Skip verify of pc_regnum, invalid_p == 0 */
/* Skip verify of ps_regnum, invalid_p == 0 */
/* Skip verify of fp0_regnum, invalid_p == 0 */
- /* Skip verify of deprecated_npc_regnum, invalid_p == 0 */
/* Skip verify of stab_reg_to_regnum, invalid_p == 0 */
/* Skip verify of ecoff_reg_to_regnum, invalid_p == 0 */
/* Skip verify of dwarf_reg_to_regnum, invalid_p == 0 */
@@ -692,7 +686,6 @@ verify_gdbarch (struct gdbarch *current_gdbarch)
/* Skip verify of extract_return_value, invalid_p == 0 */
/* Skip verify of store_return_value, invalid_p == 0 */
/* Skip verify of use_struct_convention, invalid_p == 0 */
- /* Skip verify of extract_struct_value_address, has predicate */
/* Skip verify of deprecated_extract_struct_value_address, has predicate */
/* Skip verify of deprecated_frame_init_saved_regs, has predicate */
/* Skip verify of deprecated_init_extra_frame_info, has predicate */
@@ -709,12 +702,8 @@ verify_gdbarch (struct gdbarch *current_gdbarch)
/* Skip verify of adjust_breakpoint_address, has predicate */
/* 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)
- && (current_gdbarch->decr_pc_after_break == -1))
- fprintf_unfiltered (log, "\n\tdecr_pc_after_break");
- if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
- && (current_gdbarch->function_start_offset == -1))
- fprintf_unfiltered (log, "\n\tfunction_start_offset");
+ /* Skip verify of decr_pc_after_break, invalid_p == 0 */
+ /* Skip verify of function_start_offset, invalid_p == 0 */
/* Skip verify of remote_translate_xfer_address, invalid_p == 0 */
if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
&& (current_gdbarch->frame_args_skip == -1))
@@ -1110,8 +1099,8 @@ gdbarch_dump (struct gdbarch *current_gdbarch, struct ui_file *file)
#ifdef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
- "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(regbuf)",
- XSTRING (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS (regbuf)));
+ "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(regcache)",
+ XSTRING (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS (regcache)));
fprintf_unfiltered (file,
"gdbarch_dump: DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS = <0x%08lx>\n",
(long) current_gdbarch->deprecated_extract_struct_value_address
@@ -1376,14 +1365,6 @@ gdbarch_dump (struct gdbarch *current_gdbarch, struct ui_file *file)
"gdbarch_dump: DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE = %d\n",
DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE);
#endif
-#ifdef DEPRECATED_NPC_REGNUM
- fprintf_unfiltered (file,
- "gdbarch_dump: DEPRECATED_NPC_REGNUM # %s\n",
- XSTRING (DEPRECATED_NPC_REGNUM));
- fprintf_unfiltered (file,
- "gdbarch_dump: DEPRECATED_NPC_REGNUM = %d\n",
- DEPRECATED_NPC_REGNUM);
-#endif
#ifdef DEPRECATED_PC_IN_CALL_DUMMY_P
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
@@ -1791,25 +1772,6 @@ gdbarch_dump (struct gdbarch *current_gdbarch, struct ui_file *file)
(long) current_gdbarch->extract_return_value
/*EXTRACT_RETURN_VALUE ()*/);
#endif
-#ifdef EXTRACT_STRUCT_VALUE_ADDRESS_P
- fprintf_unfiltered (file,
- "gdbarch_dump: %s # %s\n",
- "EXTRACT_STRUCT_VALUE_ADDRESS_P()",
- XSTRING (EXTRACT_STRUCT_VALUE_ADDRESS_P ()));
- fprintf_unfiltered (file,
- "gdbarch_dump: EXTRACT_STRUCT_VALUE_ADDRESS_P() = %d\n",
- EXTRACT_STRUCT_VALUE_ADDRESS_P ());
-#endif
-#ifdef EXTRACT_STRUCT_VALUE_ADDRESS
- fprintf_unfiltered (file,
- "gdbarch_dump: %s # %s\n",
- "EXTRACT_STRUCT_VALUE_ADDRESS(regcache)",
- XSTRING (EXTRACT_STRUCT_VALUE_ADDRESS (regcache)));
- fprintf_unfiltered (file,
- "gdbarch_dump: EXTRACT_STRUCT_VALUE_ADDRESS = <0x%08lx>\n",
- (long) current_gdbarch->extract_struct_value_address
- /*EXTRACT_STRUCT_VALUE_ADDRESS ()*/);
-#endif
#ifdef FETCH_POINTER_ARGUMENT_P
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
@@ -2993,23 +2955,6 @@ set_gdbarch_fp0_regnum (struct gdbarch *gdbarch,
}
int
-gdbarch_deprecated_npc_regnum (struct gdbarch *gdbarch)
-{
- gdb_assert (gdbarch != NULL);
- /* Skip verify of deprecated_npc_regnum, invalid_p == 0 */
- if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_npc_regnum called\n");
- return gdbarch->deprecated_npc_regnum;
-}
-
-void
-set_gdbarch_deprecated_npc_regnum (struct gdbarch *gdbarch,
- int deprecated_npc_regnum)
-{
- gdbarch->deprecated_npc_regnum = deprecated_npc_regnum;
-}
-
-int
gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr)
{
gdb_assert (gdbarch != NULL);
@@ -4401,30 +4346,6 @@ set_gdbarch_use_struct_convention (struct gdbarch *gdbarch,
}
int
-gdbarch_extract_struct_value_address_p (struct gdbarch *gdbarch)
-{
- gdb_assert (gdbarch != NULL);
- return gdbarch->extract_struct_value_address != NULL;
-}
-
-CORE_ADDR
-gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, struct regcache *regcache)
-{
- gdb_assert (gdbarch != NULL);
- gdb_assert (gdbarch->extract_struct_value_address != NULL);
- if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_struct_value_address called\n");
- return gdbarch->extract_struct_value_address (regcache);
-}
-
-void
-set_gdbarch_extract_struct_value_address (struct gdbarch *gdbarch,
- gdbarch_extract_struct_value_address_ftype extract_struct_value_address)
-{
- gdbarch->extract_struct_value_address = extract_struct_value_address;
-}
-
-int
gdbarch_deprecated_extract_struct_value_address_p (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);
@@ -4432,13 +4353,13 @@ gdbarch_deprecated_extract_struct_value_address_p (struct gdbarch *gdbarch)
}
CORE_ADDR
-gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch, char *regbuf)
+gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch, struct regcache *regcache)
{
gdb_assert (gdbarch != NULL);
gdb_assert (gdbarch->deprecated_extract_struct_value_address != NULL);
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_extract_struct_value_address called\n");
- return gdbarch->deprecated_extract_struct_value_address (regbuf);
+ return gdbarch->deprecated_extract_struct_value_address (regcache);
}
void
@@ -4626,8 +4547,7 @@ CORE_ADDR
gdbarch_decr_pc_after_break (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);
- /* Check variable changed from pre-default. */
- gdb_assert (gdbarch->decr_pc_after_break != -1);
+ /* Skip verify of decr_pc_after_break, invalid_p == 0 */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_decr_pc_after_break called\n");
return gdbarch->decr_pc_after_break;
@@ -4644,8 +4564,7 @@ CORE_ADDR
gdbarch_function_start_offset (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);
- /* Check variable changed from pre-default. */
- gdb_assert (gdbarch->function_start_offset != -1);
+ /* Skip verify of function_start_offset, invalid_p == 0 */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_function_start_offset called\n");
return gdbarch->function_start_offset;
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index a9df675..e6651c7 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -1,7 +1,9 @@
/* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
/* Dynamic architecture support for GDB, the GNU debugger.
- Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+
+ Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free
+ Software Foundation, Inc.
This file is part of GDB.
@@ -376,18 +378,6 @@ extern void set_gdbarch_fp0_regnum (struct gdbarch *gdbarch, int fp0_regnum);
#define FP0_REGNUM (gdbarch_fp0_regnum (current_gdbarch))
#endif
-/* Replace DEPRECATED_NPC_REGNUM with an implementation of WRITE_PC
- that updates PC, NPC and even NNPC. */
-
-extern int gdbarch_deprecated_npc_regnum (struct gdbarch *gdbarch);
-extern void set_gdbarch_deprecated_npc_regnum (struct gdbarch *gdbarch, int deprecated_npc_regnum);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_NPC_REGNUM)
-#error "Non multi-arch definition of DEPRECATED_NPC_REGNUM"
-#endif
-#if !defined (DEPRECATED_NPC_REGNUM)
-#define DEPRECATED_NPC_REGNUM (gdbarch_deprecated_npc_regnum (current_gdbarch))
-#endif
-
/* Convert stab register number (from `r' declaration) to a gdb REGNUM. */
typedef int (gdbarch_stab_reg_to_regnum_ftype) (int stab_regnr);
@@ -1457,11 +1447,7 @@ extern void set_gdbarch_return_value (struct gdbarch *gdbarch, gdbarch_return_va
/* The deprecated methods RETURN_VALUE_ON_STACK, EXTRACT_RETURN_VALUE,
STORE_RETURN_VALUE and USE_STRUCT_CONVENTION have all been folded
- into RETURN_VALUE. For the moment do not try to fold in
- EXTRACT_STRUCT_VALUE_ADDRESS as, dependant on the ABI, the debug
- info, and the level of effort, it may well be possible to find the
- address of a structure being return on the stack. Someone else can
- make that change. */
+ into RETURN_VALUE. */
typedef int (gdbarch_return_value_on_stack_ftype) (struct type *type);
extern int gdbarch_return_value_on_stack (struct gdbarch *gdbarch, struct type *type);
@@ -1523,30 +1509,23 @@ extern void set_gdbarch_use_struct_convention (struct gdbarch *gdbarch, gdbarch_
#define USE_STRUCT_CONVENTION(gcc_p, value_type) (gdbarch_use_struct_convention (current_gdbarch, gcc_p, value_type))
#endif
-#if defined (EXTRACT_STRUCT_VALUE_ADDRESS)
-/* Legacy for systems yet to multi-arch EXTRACT_STRUCT_VALUE_ADDRESS */
-#if !defined (EXTRACT_STRUCT_VALUE_ADDRESS_P)
-#define EXTRACT_STRUCT_VALUE_ADDRESS_P() (1)
-#endif
-#endif
-
-extern int gdbarch_extract_struct_value_address_p (struct gdbarch *gdbarch);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (EXTRACT_STRUCT_VALUE_ADDRESS_P)
-#error "Non multi-arch definition of EXTRACT_STRUCT_VALUE_ADDRESS"
-#endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (EXTRACT_STRUCT_VALUE_ADDRESS_P)
-#define EXTRACT_STRUCT_VALUE_ADDRESS_P() (gdbarch_extract_struct_value_address_p (current_gdbarch))
-#endif
-
-typedef CORE_ADDR (gdbarch_extract_struct_value_address_ftype) (struct regcache *regcache);
-extern CORE_ADDR gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, struct regcache *regcache);
-extern void set_gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, gdbarch_extract_struct_value_address_ftype *extract_struct_value_address);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (EXTRACT_STRUCT_VALUE_ADDRESS)
-#error "Non multi-arch definition of EXTRACT_STRUCT_VALUE_ADDRESS"
-#endif
-#if !defined (EXTRACT_STRUCT_VALUE_ADDRESS)
-#define EXTRACT_STRUCT_VALUE_ADDRESS(regcache) (gdbarch_extract_struct_value_address (current_gdbarch, regcache))
-#endif
+/* As of 2004-01-17 only the 32-bit SPARC ABI has been identified as an
+ ABI suitable for the implementation of a robust extract
+ struct-convention return-value address method (the sparc saves the
+ address in the callers frame). All the other cases so far examined,
+ the DEPRECATED_EXTRACT_STRUCT_VALUE implementation has been
+ erreneous - the code was incorrectly assuming that the return-value
+ address, stored in a register, was preserved across the entire
+ function call.
+ For the moment retain DEPRECATED_EXTRACT_STRUCT_VALUE as a marker of
+ the ABIs that are still to be analyzed - perhaps this should simply
+ be deleted. The commented out extract_returned_value_address method
+ is provided as a starting point for the 32-bit SPARC. It, or
+ something like it, along with changes to both infcmd.c and stack.c
+ will be needed for that case to work. NB: It is passed the callers
+ frame since it is only after the callee has returned that this
+ function is used.
+ M:::CORE_ADDR:extract_returned_value_address:struct frame_info *caller_frame:caller_frame */
#if defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS)
/* Legacy for systems yet to multi-arch DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS */
@@ -1563,14 +1542,14 @@ extern int gdbarch_deprecated_extract_struct_value_address_p (struct gdbarch *gd
#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P() (gdbarch_deprecated_extract_struct_value_address_p (current_gdbarch))
#endif
-typedef CORE_ADDR (gdbarch_deprecated_extract_struct_value_address_ftype) (char *regbuf);
-extern CORE_ADDR gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch, char *regbuf);
+typedef CORE_ADDR (gdbarch_deprecated_extract_struct_value_address_ftype) (struct regcache *regcache);
+extern CORE_ADDR gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch, struct regcache *regcache);
extern void set_gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch, gdbarch_deprecated_extract_struct_value_address_ftype *deprecated_extract_struct_value_address);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS)
#error "Non multi-arch definition of DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS"
#endif
#if !defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS)
-#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(regbuf) (gdbarch_deprecated_extract_struct_value_address (current_gdbarch, regbuf))
+#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(regcache) (gdbarch_deprecated_extract_struct_value_address (current_gdbarch, regcache))
#endif
#if defined (DEPRECATED_FRAME_INIT_SAVED_REGS)
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index eb015b3..db7588b 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -1,7 +1,10 @@
#!/bin/sh -u
# Architecture commands for GDB, the GNU debugger.
-# Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+#
+# Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software
+# Foundation, Inc.
+#
#
# This file is part of GDB.
#
@@ -454,9 +457,6 @@ v:2:SP_REGNUM:int:sp_regnum::::-1:-1::0
v:2:PC_REGNUM:int:pc_regnum::::-1:-1::0
v:2:PS_REGNUM:int:ps_regnum::::-1:-1::0
v:2:FP0_REGNUM:int:fp0_regnum::::0:-1::0
-# Replace DEPRECATED_NPC_REGNUM with an implementation of WRITE_PC
-# that updates PC, NPC and even NNPC.
-v:2:DEPRECATED_NPC_REGNUM:int:deprecated_npc_regnum::::0:-1::0
# Convert stab register number (from \`r\' declaration) to a gdb REGNUM.
f:2:STAB_REG_TO_REGNUM:int:stab_reg_to_regnum:int stab_regnr:stab_regnr:::no_op_reg_to_regnum::0
# Provide a default mapping from a ecoff register number to a gdb REGNUM.
@@ -606,11 +606,7 @@ M:::enum return_value_convention:return_value:struct type *valtype, struct regca
# The deprecated methods RETURN_VALUE_ON_STACK, EXTRACT_RETURN_VALUE,
# STORE_RETURN_VALUE and USE_STRUCT_CONVENTION have all been folded
-# into RETURN_VALUE. For the moment do not try to fold in
-# EXTRACT_STRUCT_VALUE_ADDRESS as, dependant on the ABI, the debug
-# info, and the level of effort, it may well be possible to find the
-# address of a structure being return on the stack. Someone else can
-# make that change.
+# into RETURN_VALUE.
f:2:RETURN_VALUE_ON_STACK:int:return_value_on_stack:struct type *type:type:::generic_return_value_on_stack_not::0
f:2:EXTRACT_RETURN_VALUE:void:extract_return_value:struct type *type, struct regcache *regcache, void *valbuf:type, regcache, valbuf:::legacy_extract_return_value::0
@@ -619,9 +615,27 @@ f:2:DEPRECATED_EXTRACT_RETURN_VALUE:void:deprecated_extract_return_value:struct
f:2:DEPRECATED_STORE_RETURN_VALUE:void:deprecated_store_return_value:struct type *type, char *valbuf:type, valbuf
f:2:USE_STRUCT_CONVENTION:int:use_struct_convention:int gcc_p, struct type *value_type:gcc_p, value_type:::generic_use_struct_convention::0
-F:2:EXTRACT_STRUCT_VALUE_ADDRESS:CORE_ADDR:extract_struct_value_address:struct regcache *regcache:regcache
-F:2:DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS:CORE_ADDR:deprecated_extract_struct_value_address:char *regbuf:regbuf
-#
+# As of 2004-01-17 only the 32-bit SPARC ABI has been identified as an
+# ABI suitable for the implementation of a robust extract
+# struct-convention return-value address method (the sparc saves the
+# address in the callers frame). All the other cases so far examined,
+# the DEPRECATED_EXTRACT_STRUCT_VALUE implementation has been
+# erreneous - the code was incorrectly assuming that the return-value
+# address, stored in a register, was preserved across the entire
+# function call.
+
+# For the moment retain DEPRECATED_EXTRACT_STRUCT_VALUE as a marker of
+# the ABIs that are still to be analyzed - perhaps this should simply
+# be deleted. The commented out extract_returned_value_address method
+# is provided as a starting point for the 32-bit SPARC. It, or
+# something like it, along with changes to both infcmd.c and stack.c
+# will be needed for that case to work. NB: It is passed the callers
+# frame since it is only after the callee has returned that this
+# function is used.
+
+#M:::CORE_ADDR:extract_returned_value_address:struct frame_info *caller_frame:caller_frame
+F:2:DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS:CORE_ADDR:deprecated_extract_struct_value_address:struct regcache *regcache:regcache
+
F:2:DEPRECATED_FRAME_INIT_SAVED_REGS:void:deprecated_frame_init_saved_regs:struct frame_info *frame:frame
F:2:DEPRECATED_INIT_EXTRA_FRAME_INFO:void:deprecated_init_extra_frame_info:int fromleaf, struct frame_info *frame:fromleaf, frame
#
@@ -632,8 +646,8 @@ f::BREAKPOINT_FROM_PC:const unsigned char *:breakpoint_from_pc:CORE_ADDR *pcptr,
M:2:ADJUST_BREAKPOINT_ADDRESS:CORE_ADDR:adjust_breakpoint_address:CORE_ADDR bpaddr:bpaddr
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
-v:2:FUNCTION_START_OFFSET:CORE_ADDR:function_start_offset::::0:-1
+v:2:DECR_PC_AFTER_BREAK:CORE_ADDR:decr_pc_after_break::::0:::0
+v:2:FUNCTION_START_OFFSET:CORE_ADDR:function_start_offset::::0:::0
#
m::REMOTE_TRANSLATE_XFER_ADDRESS:void:remote_translate_xfer_address:struct regcache *regcache, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len:regcache, gdb_addr, gdb_len, rem_addr, rem_len:::generic_remote_translate_xfer_address::0
#
@@ -823,7 +837,9 @@ cat <<EOF
/* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
/* Dynamic architecture support for GDB, the GNU debugger.
- Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+
+ Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free
+ Software Foundation, Inc.
This file is part of GDB.
diff --git a/gdb/gdbinit.in b/gdb/gdbinit.in
index 56881c9..1a080dc 100644
--- a/gdb/gdbinit.in
+++ b/gdb/gdbinit.in
@@ -10,7 +10,6 @@ commands
return
end
-dir @srcdir@/../mmalloc
dir @srcdir@/../libiberty
dir @srcdir@/../bfd
dir @srcdir@
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 603c33f..0d908ea 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,19 @@
+2004-01-31 Daniel Jacobowitz <drow@mvista.com>
+
+ * linux-low.c: Update copyright year.
+ (check_removed_breakpoint): Clear pending_is_breakpoint.
+ (linux_set_resume_request, linux_queue_one_thread)
+ (resume_status_pending_p): New functions.
+ (linux_continue_one_thread): Use process->resume.
+ (linux_resume): Only resume threads if there are no pending events.
+ * linux-low.h (struct process_info): Add resume request
+ pointer.
+
+2004-01-30 Daniel Jacobowitz <drow@mvista.com>
+
+ * regcache.c (new_register_cache): Clear the allocated register
+ buffer. Suggested by Atsushi Nemoto <anemo@mba.ocn.ne.jp>.
+
2003-10-13 Daniel Jacobowitz <drow@mvista.com>
* linux-low.c (linux_resume): Take a struct thread_resume *
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index 68b3f65..501bb58 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -1,5 +1,5 @@
/* Low level interface to ptrace, for the remote server for GDB.
- Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002
+ Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
This file is part of GDB.
@@ -316,6 +316,7 @@ check_removed_breakpoint (struct process_info *event_child)
(*the_low_target.set_pc) (stop_pc);
/* We consumed the pending SIGTRAP. */
+ event_child->pending_is_breakpoint = 0;
event_child->status_pending_p = 0;
event_child->status_pending = 0;
@@ -876,18 +877,18 @@ linux_resume_one_process (struct inferior_list_entry *entry,
static struct thread_resume *resume_ptr;
/* This function is called once per thread. We look up the thread
- in RESUME_PTR, which will tell us whether to resume, step, or leave
- the thread stopped; and what signal, if any, it should be sent.
- For threads which we aren't explicitly told otherwise, we preserve
- the stepping flag; this is used for stepping over gdbserver-placed
- breakpoints. If the thread has a status pending, it may not actually
- be resumed. */
+ in RESUME_PTR, and mark the thread with a pointer to the appropriate
+ resume request.
+
+ This algorithm is O(threads * resume elements), but resume elements
+ is small (and will remain small at least until GDB supports thread
+ suspension). */
static void
-linux_continue_one_thread (struct inferior_list_entry *entry)
+linux_set_resume_request (struct inferior_list_entry *entry)
{
struct process_info *process;
struct thread_info *thread;
- int ndx, step;
+ int ndx;
thread = (struct thread_info *) entry;
process = get_thread_process (thread);
@@ -896,25 +897,127 @@ linux_continue_one_thread (struct inferior_list_entry *entry)
while (resume_ptr[ndx].thread != -1 && resume_ptr[ndx].thread != entry->id)
ndx++;
- if (resume_ptr[ndx].leave_stopped)
+ process->resume = &resume_ptr[ndx];
+}
+
+/* This function is called once per thread. We check the thread's resume
+ request, which will tell us whether to resume, step, or leave the thread
+ stopped; and what signal, if any, it should be sent. For threads which
+ we aren't explicitly told otherwise, we preserve the stepping flag; this
+ is used for stepping over gdbserver-placed breakpoints. */
+
+static void
+linux_continue_one_thread (struct inferior_list_entry *entry)
+{
+ struct process_info *process;
+ struct thread_info *thread;
+ int step;
+
+ thread = (struct thread_info *) entry;
+ process = get_thread_process (thread);
+
+ if (process->resume->leave_stopped)
return;
- if (resume_ptr[ndx].thread == -1)
- step = process->stepping || resume_ptr[ndx].step;
+ if (process->resume->thread == -1)
+ step = process->stepping || process->resume->step;
else
- step = resume_ptr[ndx].step;
+ step = process->resume->step;
+
+ linux_resume_one_process (&process->head, step, process->resume->sig);
- linux_resume_one_process (&process->head, step, resume_ptr[ndx].sig);
+ process->resume = NULL;
+}
+
+/* This function is called once per thread. We check the thread's resume
+ request, which will tell us whether to resume, step, or leave the thread
+ stopped; and what signal, if any, it should be sent. We queue any needed
+ signals, since we won't actually resume. We already have a pending event
+ to report, so we don't need to preserve any step requests; they should
+ be re-issued if necessary. */
+
+static void
+linux_queue_one_thread (struct inferior_list_entry *entry)
+{
+ struct process_info *process;
+ struct thread_info *thread;
+
+ thread = (struct thread_info *) entry;
+ process = get_thread_process (thread);
+
+ if (process->resume->leave_stopped)
+ return;
+
+ /* If we have a new signal, enqueue the signal. */
+ if (process->resume->sig != 0)
+ {
+ struct pending_signals *p_sig;
+ p_sig = malloc (sizeof (*p_sig));
+ p_sig->prev = process->pending_signals;
+ p_sig->signal = process->resume->sig;
+ process->pending_signals = p_sig;
+ }
+
+ process->resume = NULL;
+}
+
+/* Set DUMMY if this process has an interesting status pending. */
+static int
+resume_status_pending_p (struct inferior_list_entry *entry, void *flag_p)
+{
+ struct process_info *process = (struct process_info *) entry;
+
+ /* Processes which will not be resumed are not interesting, because
+ we might not wait for them next time through linux_wait. */
+ if (process->resume->leave_stopped)
+ return 0;
+
+ /* If this thread has a removed breakpoint, we won't have any
+ events to report later, so check now. check_removed_breakpoint
+ may clear status_pending_p. We avoid calling check_removed_breakpoint
+ for any thread that we are not otherwise going to resume - this
+ lets us preserve stopped status when two threads hit a breakpoint.
+ GDB removes the breakpoint to single-step a particular thread
+ past it, then re-inserts it and resumes all threads. We want
+ to report the second thread without resuming it in the interim. */
+ if (process->status_pending_p)
+ check_removed_breakpoint (process);
+
+ if (process->status_pending_p)
+ * (int *) flag_p = 1;
+
+ return 0;
}
static void
linux_resume (struct thread_resume *resume_info)
{
- /* Yes, this is quadratic. If it ever becomes a problem then it's
- fairly easy to fix. Yes, the use of a global here is rather ugly. */
+ int pending_flag;
+ /* Yes, the use of a global here is rather ugly. */
resume_ptr = resume_info;
- for_each_inferior (&all_threads, linux_continue_one_thread);
+
+ for_each_inferior (&all_threads, linux_set_resume_request);
+
+ /* If there is a thread which would otherwise be resumed, which
+ has a pending status, then don't resume any threads - we can just
+ report the pending status. Make sure to queue any signals
+ that would otherwise be sent. */
+ pending_flag = 0;
+ find_inferior (&all_processes, resume_status_pending_p, &pending_flag);
+
+ if (debug_threads)
+ {
+ if (pending_flag)
+ fprintf (stderr, "Not resuming, pending status\n");
+ else
+ fprintf (stderr, "Resuming, no pending status\n");
+ }
+
+ if (pending_flag)
+ for_each_inferior (&all_threads, linux_queue_one_thread);
+ else
+ for_each_inferior (&all_threads, linux_continue_one_thread);
}
#ifdef HAVE_LINUX_USRREGS
diff --git a/gdb/gdbserver/linux-low.h b/gdb/gdbserver/linux-low.h
index bae76b7..d42c9b5 100644
--- a/gdb/gdbserver/linux-low.h
+++ b/gdb/gdbserver/linux-low.h
@@ -1,5 +1,5 @@
/* Internal interfaces for the GNU/Linux specific target code for gdbserver.
- Copyright 2002, Free Software Foundation, Inc.
+ Copyright 2002, 2004 Free Software Foundation, Inc.
This file is part of GDB.
@@ -106,7 +106,13 @@ struct process_info
/* If this is non-zero, it points to a chain of signals which need to
be delivered to this process. */
struct pending_signals *pending_signals;
+
+ /* A link used when resuming. It is initialized from the resume request,
+ and then processed and cleared in linux_resume_one_process. */
+
+ struct thread_resume *resume;
};
+
extern struct inferior_list all_processes;
void linux_attach_lwp (int pid, int tid);
diff --git a/gdb/gdbserver/regcache.c b/gdb/gdbserver/regcache.c
index be3b3a7..bc64ebc 100644
--- a/gdb/gdbserver/regcache.c
+++ b/gdb/gdbserver/regcache.c
@@ -1,5 +1,5 @@
/* Register support routines for the remote server for GDB.
- Copyright 2001, 2002
+ Copyright 2001, 2002, 2004
Free Software Foundation, Inc.
This file is part of GDB.
@@ -101,7 +101,10 @@ new_register_cache (void)
regcache = malloc (sizeof (*regcache));
- regcache->registers = malloc (register_bytes);
+ /* Make sure to zero-initialize the register cache when it is created,
+ in case there are registers the target never fetches. This way they'll
+ read as zero instead of garbage. */
+ regcache->registers = calloc (1, register_bytes);
if (regcache->registers == NULL)
fatal ("Could not allocate register cache.");
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index f6137ae..d170862 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -1,6 +1,6 @@
/* Support routines for manipulating internal types for GDB.
- Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003
- Free Software Foundation, Inc.
+ Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003,
+ 2004 Free Software Foundation, Inc.
Contributed by Cygnus Support, using pieces from other GDB modules.
This file is part of GDB.
@@ -127,8 +127,6 @@ struct extra
int len;
}; /* maximum extension is 128! FIXME */
-static void add_name (struct extra *, char *);
-static void add_mangled_type (struct extra *, struct type *);
static void print_bit_vector (B_TYPE *, int);
static void print_arg_types (struct field *, int, int);
static void dump_fn_fieldlists (struct type *, int);
@@ -138,7 +136,7 @@ static void virtual_base_list_aux (struct type *dclass);
/* Alloc a new type structure and fill it with some defaults. If
OBJFILE is non-NULL, then allocate the space for the type structure
- in that objfile's type_obstack. Otherwise allocate the new type structure
+ in that objfile's objfile_obstack. Otherwise allocate the new type structure
by xmalloc () (for permanent types). */
struct type *
@@ -156,10 +154,10 @@ alloc_type (struct objfile *objfile)
}
else
{
- type = obstack_alloc (&objfile->type_obstack,
+ type = obstack_alloc (&objfile->objfile_obstack,
sizeof (struct type));
memset (type, 0, sizeof (struct type));
- TYPE_MAIN_TYPE (type) = obstack_alloc (&objfile->type_obstack,
+ TYPE_MAIN_TYPE (type) = obstack_alloc (&objfile->objfile_obstack,
sizeof (struct main_type));
OBJSTAT (objfile, n_types++);
}
@@ -193,7 +191,7 @@ alloc_type_instance (struct type *oldtype)
}
else
{
- type = obstack_alloc (&TYPE_OBJFILE (oldtype)->type_obstack,
+ type = obstack_alloc (&TYPE_OBJFILE (oldtype)->objfile_obstack,
sizeof (struct type));
memset (type, 0, sizeof (struct type));
}
@@ -1684,7 +1682,7 @@ allocate_cplus_struct_type (struct type *type)
/* Helper function to initialize the standard scalar types.
If NAME is non-NULL and OBJFILE is non-NULL, then we make a copy
- of the string pointed to by name in the type_obstack for that objfile,
+ of the string pointed to by name in the objfile_obstack for that objfile,
and initialize the type name to that copy. There are places (mipsread.c
in particular, where init_type is called with a NULL value for NAME). */
@@ -1701,7 +1699,7 @@ init_type (enum type_code code, int length, int flags, char *name,
if ((name != NULL) && (objfile != NULL))
{
TYPE_NAME (type) =
- obsavestring (name, strlen (name), &objfile->type_obstack);
+ obsavestring (name, strlen (name), &objfile->objfile_obstack);
}
else
{
@@ -1802,7 +1800,7 @@ lookup_fundamental_type (struct objfile *objfile, int typeid)
{
nbytes = FT_NUM_MEMBERS * sizeof (struct type *);
objfile->fundamental_types = (struct type **)
- obstack_alloc (&objfile->type_obstack, nbytes);
+ obstack_alloc (&objfile->objfile_obstack, nbytes);
memset ((char *) objfile->fundamental_types, 0, nbytes);
OBJSTAT (objfile, n_types += FT_NUM_MEMBERS);
}
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
index acd0ffd..a1141d7 100644
--- a/gdb/gdbtypes.h
+++ b/gdb/gdbtypes.h
@@ -1,7 +1,7 @@
/* Internal type definitions for GDB.
Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003 Free Software Foundation, Inc.
+ 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
Contributed by Cygnus Support, using pieces from other GDB modules.
@@ -320,7 +320,7 @@ struct main_type
char *tag_name;
/* Every type is now associated with a particular objfile, and the
- type is allocated on the type_obstack for that objfile. One problem
+ type is allocated on the objfile_obstack for that objfile. One problem
however, is that there are times when gdb allocates new types while
it is not in the process of reading symbols from a particular objfile.
Fortunately, these happen when the type being created is a derived
@@ -1069,15 +1069,15 @@ extern struct type *builtin_type_f_void;
/* Allocate space for storing data associated with a particular type.
We ensure that the space is allocated using the same mechanism that
was used to allocate the space for the type structure itself. I.E.
- if the type is on an objfile's type_obstack, then the space for data
- associated with that type will also be allocated on the type_obstack.
+ if the type is on an objfile's objfile_obstack, then the space for data
+ associated with that type will also be allocated on the objfile_obstack.
If the type is not associated with any particular objfile (such as
builtin types), then the data space will be allocated with xmalloc,
the same as for the type structure. */
#define TYPE_ALLOC(t,size) \
(TYPE_OBJFILE (t) != NULL \
- ? obstack_alloc (&TYPE_OBJFILE (t) -> type_obstack, size) \
+ ? obstack_alloc (&TYPE_OBJFILE (t) -> objfile_obstack, size) \
: xmalloc (size))
extern struct type *alloc_type (struct objfile *);
diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c
index 4a66d80..f6bdb15 100644
--- a/gdb/h8300-tdep.c
+++ b/gdb/h8300-tdep.c
@@ -1323,18 +1323,12 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
*/
/* Stack grows up. */
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
- /* PC stops zero byte after a trap instruction
- (which means: exactly on trap instruction). */
- set_gdbarch_decr_pc_after_break (gdbarch, 0);
- /* This value is almost never non-zero... */
- set_gdbarch_function_start_offset (gdbarch, 0);
/* This value is almost never non-zero... */
set_gdbarch_frame_args_skip (gdbarch, 0);
set_gdbarch_frameless_function_invocation (gdbarch,
frameless_look_for_prologue);
- set_gdbarch_extract_struct_value_address (gdbarch,
- h8300_extract_struct_value_address);
+ set_gdbarch_deprecated_extract_struct_value_address (gdbarch, h8300_extract_struct_value_address);
set_gdbarch_use_struct_convention (gdbarch, always_use_struct_convention);
set_gdbarch_breakpoint_from_pc (gdbarch, h8300_breakpoint_from_pc);
set_gdbarch_push_dummy_code (gdbarch, h8300_push_dummy_code);
diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c
index 1e51103..e11d871 100644
--- a/gdb/hppa-tdep.c
+++ b/gdb/hppa-tdep.c
@@ -1,7 +1,8 @@
/* Target-dependent code for the HP PA architecture, for GDB.
Copyright 1986, 1987, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
- 1996, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+ 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software
+ Foundation, Inc.
Contributed by the Center for Software Science at the
University of Utah (pa-gdb-bugs@cs.utah.edu).
@@ -193,7 +194,6 @@ int hppa32_use_struct_convention (int gcc_p, struct type *type);
int hppa64_use_struct_convention (int gcc_p, struct type *type);
void hppa32_store_return_value (struct type *type, char *valbuf);
void hppa64_store_return_value (struct type *type, char *valbuf);
-CORE_ADDR hppa_extract_struct_value_address (char *regbuf);
int hppa_cannot_store_register (int regnum);
void hppa_init_extra_frame_info (int fromleaf, struct frame_info *frame);
CORE_ADDR hppa_frame_chain (struct frame_info *frame);
@@ -510,7 +510,7 @@ read_unwind_info (struct objfile *objfile)
obj_private_data_t *obj_private;
text_offset = ANOFFSET (objfile->section_offsets, 0);
- ui = (struct obj_unwind_info *) obstack_alloc (&objfile->psymbol_obstack,
+ ui = (struct obj_unwind_info *) obstack_alloc (&objfile->objfile_obstack,
sizeof (struct obj_unwind_info));
ui->table = NULL;
@@ -560,7 +560,7 @@ read_unwind_info (struct objfile *objfile)
/* Allocate memory for the unwind table. */
ui->table = (struct unwind_table_entry *)
- obstack_alloc (&objfile->psymbol_obstack, total_size);
+ obstack_alloc (&objfile->objfile_obstack, total_size);
ui->last = total_entries - 1;
/* Now read in each unwind section and internalize the standard unwind
@@ -623,7 +623,7 @@ read_unwind_info (struct objfile *objfile)
if (objfile->obj_private == NULL)
{
obj_private = (obj_private_data_t *)
- obstack_alloc (&objfile->psymbol_obstack,
+ obstack_alloc (&objfile->objfile_obstack,
sizeof (obj_private_data_t));
obj_private->unwind_info = NULL;
obj_private->so_info = NULL;
@@ -2609,7 +2609,7 @@ hppa_target_write_pc (CORE_ADDR v, ptid_t ptid)
write_register_pid (31, v | 0x3, ptid);
write_register_pid (PC_REGNUM, v, ptid);
- write_register_pid (DEPRECATED_NPC_REGNUM, v + 4, ptid);
+ write_register_pid (PCOQ_TAIL_REGNUM, v + 4, ptid);
}
/* return the alignment of a type in bytes. Structures have the maximum
@@ -5008,26 +5008,6 @@ hppa_store_struct_return (CORE_ADDR addr, CORE_ADDR sp)
{
write_register (28, addr);
}
-
-CORE_ADDR
-hppa_extract_struct_value_address (char *regbuf)
-{
- /* 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). */
- /* FIXME: brobecker 2002-12-26.
- The current implementation is historical, but we should eventually
- implement it in a more robust manner as it relies on the fact that
- the address size is equal to the size of an int* _on the host_...
- One possible implementation that crossed my mind is to use
- extract_address. */
- /* FIXME: cagney/2003-09-27: This function can probably go. ELZ
- writes: We cannot assume on the pa that r28 still contains the
- address of the returned structure. Usually this will be
- overwritten by the callee. */
- return (*(int *)(regbuf + DEPRECATED_REGISTER_BYTE (28)));
-}
-
/* Return True if REGNUM is not a register available to the user
through ptrace(). */
@@ -5189,7 +5169,6 @@ hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
/* The following gdbarch vector elements do not depend on the address
size, or in any other gdbarch element previously set. */
- set_gdbarch_function_start_offset (gdbarch, 0);
set_gdbarch_skip_prologue (gdbarch, hppa_skip_prologue);
set_gdbarch_skip_trampoline_code (gdbarch, hppa_skip_trampoline_code);
set_gdbarch_in_solib_call_trampoline (gdbarch, hppa_in_solib_call_trampoline);
@@ -5197,21 +5176,17 @@ hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
hppa_in_solib_return_trampoline);
set_gdbarch_deprecated_saved_pc_after_call (gdbarch, hppa_saved_pc_after_call);
set_gdbarch_inner_than (gdbarch, hppa_inner_than);
- set_gdbarch_decr_pc_after_break (gdbarch, 0);
set_gdbarch_deprecated_register_size (gdbarch, tdep->bytes_per_address);
set_gdbarch_deprecated_fp_regnum (gdbarch, 3);
set_gdbarch_sp_regnum (gdbarch, 30);
set_gdbarch_fp0_regnum (gdbarch, 64);
set_gdbarch_pc_regnum (gdbarch, PCOQ_HEAD_REGNUM);
- set_gdbarch_deprecated_npc_regnum (gdbarch, PCOQ_TAIL_REGNUM);
set_gdbarch_deprecated_register_raw_size (gdbarch, hppa_register_raw_size);
set_gdbarch_deprecated_register_byte (gdbarch, hppa_register_byte);
set_gdbarch_deprecated_register_virtual_size (gdbarch, hppa_register_raw_size);
set_gdbarch_deprecated_max_register_raw_size (gdbarch, tdep->bytes_per_address);
set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 8);
set_gdbarch_deprecated_store_struct_return (gdbarch, hppa_store_struct_return);
- set_gdbarch_deprecated_extract_struct_value_address
- (gdbarch, hppa_extract_struct_value_address);
set_gdbarch_cannot_store_register (gdbarch, hppa_cannot_store_register);
set_gdbarch_deprecated_init_extra_frame_info (gdbarch, hppa_init_extra_frame_info);
set_gdbarch_deprecated_frame_chain (gdbarch, hppa_frame_chain);
diff --git a/gdb/hpread.c b/gdb/hpread.c
index 246f77e..76e9696 100644
--- a/gdb/hpread.c
+++ b/gdb/hpread.c
@@ -1680,7 +1680,7 @@ hpread_symfile_init (struct objfile *objfile)
return;
GNTT (objfile)
- = obstack_alloc (&objfile->symbol_obstack,
+ = obstack_alloc (&objfile->objfile_obstack,
bfd_section_size (objfile->obfd, gntt_section));
bfd_get_section_contents (objfile->obfd, gntt_section, GNTT (objfile),
@@ -1702,7 +1702,7 @@ hpread_symfile_init (struct objfile *objfile)
return;
LNTT (objfile)
- = obstack_alloc (&objfile->symbol_obstack,
+ = obstack_alloc (&objfile->objfile_obstack,
bfd_section_size (objfile->obfd, lntt_section));
bfd_get_section_contents (objfile->obfd, lntt_section, LNTT (objfile),
@@ -1719,7 +1719,7 @@ hpread_symfile_init (struct objfile *objfile)
return;
SLT (objfile) =
- obstack_alloc (&objfile->symbol_obstack,
+ obstack_alloc (&objfile->objfile_obstack,
bfd_section_size (objfile->obfd, slt_section));
bfd_get_section_contents (objfile->obfd, slt_section, SLT (objfile),
@@ -1734,7 +1734,7 @@ hpread_symfile_init (struct objfile *objfile)
VT_SIZE (objfile) = bfd_section_size (objfile->obfd, vt_section);
VT (objfile) =
- (char *) obstack_alloc (&objfile->symbol_obstack,
+ (char *) obstack_alloc (&objfile->objfile_obstack,
VT_SIZE (objfile));
bfd_get_section_contents (objfile->obfd, vt_section, VT (objfile),
@@ -1973,7 +1973,7 @@ hpread_build_psymtabs (struct objfile *objfile, int mainline)
if (!have_name)
{
pst->filename = (char *)
- obstack_alloc (&pst->objfile->psymbol_obstack,
+ obstack_alloc (&pst->objfile->objfile_obstack,
strlen (namestring) + 1);
strcpy (pst->filename, namestring);
have_name = 1;
@@ -2392,7 +2392,7 @@ hpread_start_psymtab (struct objfile *objfile, char *filename,
result->textlow += offset;
result->read_symtab_private = (char *)
- obstack_alloc (&objfile->psymbol_obstack, sizeof (struct symloc));
+ obstack_alloc (&objfile->objfile_obstack, sizeof (struct symloc));
LDSYMOFF (result) = ldsymoff;
result->read_symtab = hpread_psymtab_to_symtab;
@@ -2453,7 +2453,7 @@ hpread_end_psymtab (struct partial_symtab *pst, char **include_list,
if (number_dependencies)
{
pst->dependencies = (struct partial_symtab **)
- obstack_alloc (&objfile->psymbol_obstack,
+ obstack_alloc (&objfile->objfile_obstack,
number_dependencies * sizeof (struct partial_symtab *));
memcpy (pst->dependencies, dependency_list,
number_dependencies * sizeof (struct partial_symtab *));
@@ -2468,7 +2468,7 @@ hpread_end_psymtab (struct partial_symtab *pst, char **include_list,
subpst->section_offsets = pst->section_offsets;
subpst->read_symtab_private =
- (char *) obstack_alloc (&objfile->psymbol_obstack,
+ (char *) obstack_alloc (&objfile->objfile_obstack,
sizeof (struct symloc));
LDSYMOFF (subpst) =
LDSYMLEN (subpst) =
@@ -2478,7 +2478,7 @@ hpread_end_psymtab (struct partial_symtab *pst, char **include_list,
/* We could save slight bits of space by only making one of these,
shared by the entire set of include files. FIXME-someday. */
subpst->dependencies = (struct partial_symtab **)
- obstack_alloc (&objfile->psymbol_obstack,
+ obstack_alloc (&objfile->objfile_obstack,
sizeof (struct partial_symtab *));
subpst->dependencies[0] = pst;
subpst->number_of_dependencies = 1;
@@ -3127,11 +3127,11 @@ hpread_read_enum_type (dnttpointer hp_type, union dnttentry *dn_bufp,
memp = hpread_get_lntt (mem.dnttp.index, objfile);
name = VT (objfile) + memp->dmember.name;
- sym = (struct symbol *) obstack_alloc (&objfile->symbol_obstack,
+ sym = (struct symbol *) obstack_alloc (&objfile->objfile_obstack,
sizeof (struct symbol));
memset (sym, 0, sizeof (struct symbol));
DEPRECATED_SYMBOL_NAME (sym) = obsavestring (name, strlen (name),
- &objfile->symbol_obstack);
+ &objfile->objfile_obstack);
SYMBOL_CLASS (sym) = LOC_CONST;
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
SYMBOL_VALUE (sym) = memp->dmember.value;
@@ -3145,7 +3145,7 @@ hpread_read_enum_type (dnttpointer hp_type, union dnttentry *dn_bufp,
TYPE_FLAGS (type) &= ~TYPE_FLAG_STUB;
TYPE_NFIELDS (type) = nsyms;
TYPE_FIELDS (type) = (struct field *)
- obstack_alloc (&objfile->type_obstack, sizeof (struct field) * nsyms);
+ obstack_alloc (&objfile->objfile_obstack, sizeof (struct field) * nsyms);
/* Find the symbols for the members and put them into the type.
The symbols can be found in the symlist that we put them on
@@ -3235,11 +3235,11 @@ hpread_read_function_type (dnttpointer hp_type, union dnttentry *dn_bufp,
/* Get the name. */
name = VT (objfile) + paramp->dfparam.name;
- sym = (struct symbol *) obstack_alloc (&objfile->symbol_obstack,
+ sym = (struct symbol *) obstack_alloc (&objfile->objfile_obstack,
sizeof (struct symbol));
(void) memset (sym, 0, sizeof (struct symbol));
DEPRECATED_SYMBOL_NAME (sym) = obsavestring (name, strlen (name),
- &objfile->symbol_obstack);
+ &objfile->objfile_obstack);
/* Figure out where it lives. */
if (paramp->dfparam.regparam)
@@ -3306,7 +3306,7 @@ hpread_read_function_type (dnttpointer hp_type, union dnttentry *dn_bufp,
/* Note how many parameters we found. */
TYPE_NFIELDS (type) = nsyms;
TYPE_FIELDS (type) = (struct field *)
- obstack_alloc (&objfile->type_obstack,
+ obstack_alloc (&objfile->objfile_obstack,
sizeof (struct field) * nsyms);
/* Find the symbols for the parameters and
@@ -3415,7 +3415,7 @@ hpread_read_doc_function_type (dnttpointer hp_type, union dnttentry *dn_bufp,
/* Get the name. */
name = VT (objfile) + paramp->dfparam.name;
- sym = (struct symbol *) obstack_alloc (&objfile->symbol_obstack,
+ sym = (struct symbol *) obstack_alloc (&objfile->objfile_obstack,
sizeof (struct symbol));
(void) memset (sym, 0, sizeof (struct symbol));
DEPRECATED_SYMBOL_NAME (sym) = name;
@@ -3485,7 +3485,7 @@ hpread_read_doc_function_type (dnttpointer hp_type, union dnttentry *dn_bufp,
/* Note how many parameters we found. */
TYPE_NFIELDS (type) = nsyms;
TYPE_FIELDS (type) = (struct field *)
- obstack_alloc (&objfile->type_obstack,
+ obstack_alloc (&objfile->objfile_obstack,
sizeof (struct field) * nsyms);
/* Find the symbols for the parameters and
@@ -3782,7 +3782,7 @@ hpread_read_struct_type (dnttpointer hp_type, union dnttentry *dn_bufp,
if (n_templ_args > 0)
TYPE_TEMPLATE_ARGS (type) = (struct template_arg *)
- obstack_alloc (&objfile->type_obstack, sizeof (struct template_arg) * n_templ_args);
+ obstack_alloc (&objfile->objfile_obstack, sizeof (struct template_arg) * n_templ_args);
for (n = n_templ_args; t_list; t_list = t_list->next)
{
n -= 1;
@@ -4255,7 +4255,7 @@ hpread_read_struct_type (dnttpointer hp_type, union dnttentry *dn_bufp,
TYPE_NINSTANTIATIONS (type) = ninstantiations;
if (ninstantiations > 0)
TYPE_INSTANTIATIONS (type) = (struct type **)
- obstack_alloc (&objfile->type_obstack, sizeof (struct type *) * ninstantiations);
+ obstack_alloc (&objfile->objfile_obstack, sizeof (struct type *) * ninstantiations);
for (n = ninstantiations; i_list; i_list = i_list->next)
{
n -= 1;
@@ -4267,7 +4267,7 @@ hpread_read_struct_type (dnttpointer hp_type, union dnttentry *dn_bufp,
TYPE_NFIELDS (type) = nfields;
TYPE_N_BASECLASSES (type) = n_base_classes;
TYPE_FIELDS (type) = (struct field *)
- obstack_alloc (&objfile->type_obstack, sizeof (struct field) * nfields);
+ obstack_alloc (&objfile->objfile_obstack, sizeof (struct field) * nfields);
/* Copy the saved-up fields into the field vector. */
for (n = nfields, tmp_list = list; tmp_list; tmp_list = tmp_list->next)
{
@@ -4281,7 +4281,7 @@ hpread_read_struct_type (dnttpointer hp_type, union dnttentry *dn_bufp,
TYPE_NFN_FIELDS (type) = n_fn_fields;
TYPE_NFN_FIELDS_TOTAL (type) = n_fn_fields_total;
TYPE_FN_FIELDLISTS (type) = (struct fn_fieldlist *)
- obstack_alloc (&objfile->type_obstack, sizeof (struct fn_fieldlist) * n_fn_fields);
+ obstack_alloc (&objfile->objfile_obstack, sizeof (struct fn_fieldlist) * n_fn_fields);
for (n = n_fn_fields; fn_list; fn_list = fn_list->next)
{
n -= 1;
@@ -4399,7 +4399,7 @@ fix_static_member_physnames (struct type *type, char *class_name,
return; /* physnames are already set */
SET_FIELD_PHYSNAME (TYPE_FIELDS (type)[i],
- obstack_alloc (&objfile->type_obstack,
+ obstack_alloc (&objfile->objfile_obstack,
strlen (class_name) + strlen (TYPE_FIELD_NAME (type, i)) + 3));
strcpy (TYPE_FIELD_STATIC_PHYSNAME (type, i), class_name);
strcat (TYPE_FIELD_STATIC_PHYSNAME (type, i), "::");
@@ -4562,7 +4562,7 @@ hpread_read_array_type (dnttpointer hp_type, union dnttentry *dn_bufp,
*/
TYPE_NFIELDS (type) = 1;
TYPE_FIELDS (type) = (struct field *)
- obstack_alloc (&objfile->type_obstack, sizeof (struct field));
+ obstack_alloc (&objfile->objfile_obstack, sizeof (struct field));
TYPE_FIELD_TYPE (type, 0) = hpread_type_lookup (dn_bufp->darray.indextype,
objfile);
return type;
@@ -4585,7 +4585,7 @@ hpread_read_subrange_type (dnttpointer hp_type, union dnttentry *dn_bufp,
TYPE_LENGTH (type) = dn_bufp->dsubr.bitlength / 8;
TYPE_NFIELDS (type) = 2;
TYPE_FIELDS (type)
- = (struct field *) obstack_alloc (&objfile->type_obstack,
+ = (struct field *) obstack_alloc (&objfile->objfile_obstack,
2 * sizeof (struct field));
if (dn_bufp->dsubr.dyn_low)
@@ -4803,7 +4803,7 @@ hpread_type_lookup (dnttpointer hp_type, struct objfile *objfile)
/* Build the correct name. */
TYPE_NAME (structtype)
- = (char *) obstack_alloc (&objfile->type_obstack,
+ = (char *) obstack_alloc (&objfile->objfile_obstack,
strlen (prefix) + strlen (suffix) + 1);
TYPE_NAME (structtype) = strcpy (TYPE_NAME (structtype), prefix);
TYPE_NAME (structtype) = strcat (TYPE_NAME (structtype), suffix);
@@ -5098,10 +5098,10 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name,
char *class_scope_name;
/* Allocate one GDB debug symbol and fill in some default values. */
- sym = (struct symbol *) obstack_alloc (&objfile->symbol_obstack,
+ sym = (struct symbol *) obstack_alloc (&objfile->objfile_obstack,
sizeof (struct symbol));
memset (sym, 0, sizeof (struct symbol));
- DEPRECATED_SYMBOL_NAME (sym) = obsavestring (name, strlen (name), &objfile->symbol_obstack);
+ DEPRECATED_SYMBOL_NAME (sym) = obsavestring (name, strlen (name), &objfile->objfile_obstack);
SYMBOL_LANGUAGE (sym) = language_auto;
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
SYMBOL_LINE (sym) = 0;
@@ -5304,7 +5304,7 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name,
* some things broke, so I'm leaving it in here, and
* working around the issue in stack.c. - RT
*/
- SYMBOL_INIT_DEMANGLED_NAME (sym, &objfile->symbol_obstack);
+ SYMBOL_INIT_DEMANGLED_NAME (sym, &objfile->objfile_obstack);
if ((DEPRECATED_SYMBOL_NAME (sym) == VT (objfile) + dn_bufp->dfunc.alias) &&
(!SYMBOL_CPLUS_DEMANGLED_NAME (sym)))
{
@@ -5420,7 +5420,7 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name,
* some things broke, so I'm leaving it in here, and
* working around the issue in stack.c. - RT
*/
- SYMBOL_INIT_DEMANGLED_NAME (sym, &objfile->symbol_obstack);
+ SYMBOL_INIT_DEMANGLED_NAME (sym, &objfile->objfile_obstack);
if ((DEPRECATED_SYMBOL_NAME (sym) == VT (objfile) + dn_bufp->ddocfunc.alias) &&
(!SYMBOL_CPLUS_DEMANGLED_NAME (sym)))
@@ -5886,7 +5886,7 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name,
{
struct symbol *newsym;
- newsym = (struct symbol *) obstack_alloc (&objfile->symbol_obstack,
+ newsym = (struct symbol *) obstack_alloc (&objfile->objfile_obstack,
sizeof (struct symbol));
memset (newsym, 0, sizeof (struct symbol));
DEPRECATED_SYMBOL_NAME (newsym) = name;
diff --git a/gdb/i386-interix-tdep.c b/gdb/i386-interix-tdep.c
index ea9f8c4..0d2af2f 100644
--- a/gdb/i386-interix-tdep.c
+++ b/gdb/i386-interix-tdep.c
@@ -325,7 +325,6 @@ i386_interix_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
tdep->struct_return = reg_struct_return;
tdep->jb_pc_offset = jump_buffer_Eip_offset;
- set_gdbarch_decr_pc_after_break (gdbarch, 0);
set_gdbarch_pc_in_sigtramp (gdbarch, i386_interix_pc_in_sigtramp);
set_gdbarch_in_solib_call_trampoline (gdbarch,
i386_interix_in_solib_call_trampoline);
diff --git a/gdb/i386-linux-tdep.c b/gdb/i386-linux-tdep.c
index 50073b1..768a5b6 100644
--- a/gdb/i386-linux-tdep.c
+++ b/gdb/i386-linux-tdep.c
@@ -274,7 +274,7 @@ i386_linux_sigcontext_addr (struct frame_info *next_frame)
pointer to the user context is passed as the third argument
to the signal handler. */
read_memory (sp + 8, buf, 4);
- ucontext_addr = extract_unsigned_integer (buf, 4) + 20;
+ ucontext_addr = extract_unsigned_integer (buf, 4);
return ucontext_addr + I386_LINUX_UCONTEXT_SIGCONTEXT_OFFSET;
}
diff --git a/gdb/i386-nto-tdep.c b/gdb/i386-nto-tdep.c
index a80c7a4..6d2f492 100644
--- a/gdb/i386-nto-tdep.c
+++ b/gdb/i386-nto-tdep.c
@@ -270,7 +270,8 @@ i386nto_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
/* NTO uses ELF. */
i386_elf_init_abi (info, gdbarch);
- /* Neutrino rewinds to look more normal. */
+ /* Neutrino rewinds to look more normal. Need to override the i386
+ default which is [unfortunately] to decrement the PC. */
set_gdbarch_decr_pc_after_break (gdbarch, 0);
/* NTO has shared libraries. */
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index 4ee9fa4..e1ce81f 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -1,7 +1,8 @@
/* Intel 386 target-dependent stuff.
Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
- 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+ 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software
+ Foundation, Inc.
This file is part of GDB.
@@ -1274,19 +1275,6 @@ i386_store_return_value (struct gdbarch *gdbarch, struct type *type,
#undef I387_ST0_REGNUM
}
-
-/* Extract from REGCACHE, which contains the (raw) register state, the
- address in which a function should return its structure value, as a
- CORE_ADDR. */
-
-static CORE_ADDR
-i386_extract_struct_value_address (struct regcache *regcache)
-{
- char buf[4];
-
- regcache_cooked_read (regcache, I386_EAX_REGNUM, buf);
- return extract_unsigned_integer (buf, 4);
-}
/* This is the variable that is set with "set struct-convention", and
@@ -1995,8 +1983,6 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_value_to_register (gdbarch, i386_value_to_register);
set_gdbarch_return_value (gdbarch, i386_return_value);
- set_gdbarch_extract_struct_value_address (gdbarch,
- i386_extract_struct_value_address);
set_gdbarch_skip_prologue (gdbarch, i386_skip_prologue);
@@ -2005,7 +1991,6 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_breakpoint_from_pc (gdbarch, i386_breakpoint_from_pc);
set_gdbarch_decr_pc_after_break (gdbarch, 1);
- set_gdbarch_function_start_offset (gdbarch, 0);
set_gdbarch_frame_args_skip (gdbarch, 8);
set_gdbarch_pc_in_sigtramp (gdbarch, i386_pc_in_sigtramp);
diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c
index 760a17d..01b0920 100644
--- a/gdb/ia64-tdep.c
+++ b/gdb/ia64-tdep.c
@@ -102,7 +102,6 @@ static gdbarch_register_type_ftype ia64_register_type;
static gdbarch_breakpoint_from_pc_ftype ia64_breakpoint_from_pc;
static gdbarch_skip_prologue_ftype ia64_skip_prologue;
static gdbarch_extract_return_value_ftype ia64_extract_return_value;
-static gdbarch_extract_struct_value_address_ftype ia64_extract_struct_value_address;
static gdbarch_use_struct_convention_ftype ia64_use_struct_convention;
static struct type *is_float_or_hfa_type (struct type *t);
@@ -334,32 +333,6 @@ const struct floatformat floatformat_ia64_ext =
};
-/* Read the given register from a sigcontext structure in the
- specified frame. */
-
-static CORE_ADDR
-read_sigcontext_register (struct frame_info *frame, int regnum)
-{
- CORE_ADDR regaddr;
-
- if (frame == NULL)
- internal_error (__FILE__, __LINE__,
- "read_sigcontext_register: NULL frame");
- if (!(get_frame_type (frame) == SIGTRAMP_FRAME))
- internal_error (__FILE__, __LINE__,
- "read_sigcontext_register: frame not a signal trampoline");
- if (SIGCONTEXT_REGISTER_ADDRESS == 0)
- internal_error (__FILE__, __LINE__,
- "read_sigcontext_register: SIGCONTEXT_REGISTER_ADDRESS is 0");
-
- regaddr = SIGCONTEXT_REGISTER_ADDRESS (get_frame_base (frame), regnum);
- if (regaddr)
- return read_memory_integer (regaddr, register_size (current_gdbarch, regnum));
- else
- internal_error (__FILE__, __LINE__,
- "read_sigcontext_register: Register %d not in struct sigcontext", regnum);
-}
-
/* Extract ``len'' bits from an instruction bundle starting at
bit ``from''. */
@@ -650,18 +623,6 @@ ia64_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
}
static CORE_ADDR
-ia64_read_fp (void)
-{
- /* We won't necessarily have a frame pointer and even if we do, it
- winds up being extraordinarly messy when attempting to find the
- frame chain. So for the purposes of creating frames (which is
- all deprecated_read_fp() is used for), simply use the stack
- pointer value instead. */
- gdb_assert (SP_REGNUM >= 0);
- return read_register (SP_REGNUM);
-}
-
-static CORE_ADDR
ia64_read_pc (ptid_t ptid)
{
CORE_ADDR psr_value = read_register_pid (IA64_PSR_REGNUM, ptid);
@@ -2709,9 +2670,9 @@ static struct libunwind_descr ia64_libunwind_descr =
#endif /* HAVE_LIBUNWIND_IA64_H */
-/* Should we use EXTRACT_STRUCT_VALUE_ADDRESS instead of
- EXTRACT_RETURN_VALUE? GCC_P is true if compiled with gcc
- and TYPE is the type (which is known to be struct, union or array). */
+/* Should we use DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS instead of
+ EXTRACT_RETURN_VALUE? GCC_P is true if compiled with gcc and TYPE
+ is the type (which is known to be struct, union or array). */
int
ia64_use_struct_convention (int gcc_p, struct type *type)
{
@@ -3256,53 +3217,6 @@ ia64_remote_translate_xfer_address (struct gdbarch *gdbarch,
*targ_len = nr_bytes;
}
-static void
-process_note_abi_tag_sections (bfd *abfd, asection *sect, void *obj)
-{
- int *os_ident_ptr = obj;
- const char *name;
- unsigned int sectsize;
-
- name = bfd_get_section_name (abfd, sect);
- sectsize = bfd_section_size (abfd, sect);
- if (strcmp (name, ".note.ABI-tag") == 0 && sectsize > 0)
- {
- unsigned int name_length, data_length, note_type;
- char *note = alloca (sectsize);
-
- bfd_get_section_contents (abfd, sect, note,
- (file_ptr) 0, (bfd_size_type) sectsize);
-
- name_length = bfd_h_get_32 (abfd, note);
- data_length = bfd_h_get_32 (abfd, note + 4);
- note_type = bfd_h_get_32 (abfd, note + 8);
-
- if (name_length == 4 && data_length == 16 && note_type == 1
- && strcmp (note + 12, "GNU") == 0)
- {
- int os_number = bfd_h_get_32 (abfd, note + 16);
-
- /* The case numbers are from abi-tags in glibc. */
- switch (os_number)
- {
- case 0 :
- *os_ident_ptr = ELFOSABI_LINUX;
- break;
- case 1 :
- *os_ident_ptr = ELFOSABI_HURD;
- break;
- case 2 :
- *os_ident_ptr = ELFOSABI_SOLARIS;
- break;
- default :
- internal_error (__FILE__, __LINE__,
- "process_note_abi_sections: unknown OS number %d", os_number);
- break;
- }
- }
- }
-}
-
static int
ia64_print_insn (bfd_vma memaddr, struct disassemble_info *info)
{
@@ -3400,7 +3314,7 @@ ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_extract_return_value (gdbarch, ia64_extract_return_value);
set_gdbarch_store_return_value (gdbarch, ia64_store_return_value);
- set_gdbarch_extract_struct_value_address (gdbarch, ia64_extract_struct_value_address);
+ set_gdbarch_deprecated_extract_struct_value_address (gdbarch, ia64_extract_struct_value_address);
set_gdbarch_memory_insert_breakpoint (gdbarch, ia64_memory_insert_breakpoint);
set_gdbarch_memory_remove_breakpoint (gdbarch, ia64_memory_remove_breakpoint);
@@ -3425,8 +3339,6 @@ ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
/* Settings that should be unnecessary. */
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
- set_gdbarch_decr_pc_after_break (gdbarch, 0);
- set_gdbarch_function_start_offset (gdbarch, 0);
set_gdbarch_frame_args_skip (gdbarch, 0);
set_gdbarch_remote_translate_xfer_address (
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index 2c8631e..2de769e 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -1,6 +1,6 @@
/* Memory-access and commands for "inferior" process, for GDB.
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
- 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+ 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
This file is part of GDB.
@@ -661,13 +661,6 @@ which has no line number information.\n", name);
if (!stop_step)
break;
-
- /* FIXME: On nexti, this may have already been done (when we hit the
- step resume break, I think). Probably this should be moved to
- wait_for_inferior (near the top). */
-#if defined (SHIFT_INST_REGS)
- SHIFT_INST_REGS ();
-#endif
}
if (!single_inst || skip_subroutines)
@@ -702,15 +695,7 @@ step_1_continuation (struct continuation_arg *arg)
count = arg->next->next->data.integer;
if (stop_step)
- {
- /* FIXME: On nexti, this may have already been done (when we hit the
- step resume break, I think). Probably this should be moved to
- wait_for_inferior (near the top). */
-#if defined (SHIFT_INST_REGS)
- SHIFT_INST_REGS ();
-#endif
- step_once (skip_subroutines, single_inst, count - 1);
- }
+ step_once (skip_subroutines, single_inst, count - 1);
else
if (!single_inst || skip_subroutines)
do_exec_cleanups (ALL_CLEANUPS);
@@ -1062,24 +1047,23 @@ advance_command (char *arg, int from_tty)
}
-/* Print the result of a function at the end of a 'finish' command. */
+/* Print the result of a function at the end of a 'finish' command. */
+
static void
-print_return_value (int structure_return, struct type *value_type)
+print_return_value (int struct_return, struct type *value_type)
{
+ struct cleanup *old_chain;
+ struct ui_stream *stb;
struct value *value;
- static struct ui_stream *stb = NULL;
- if (!structure_return)
+ if (!struct_return)
{
+ /* The return value can be found in the inferior's registers. */
value = register_value_being_returned (value_type, stop_registers);
- stb = ui_out_stream_new (uiout);
- ui_out_text (uiout, "Value returned is ");
- ui_out_field_fmt (uiout, "gdb-result-var", "$%d", record_latest_value (value));
- ui_out_text (uiout, " = ");
- value_print (value, stb->stream, 0, Val_no_prettyprint);
- ui_out_field_stream (uiout, "return-value", stb);
- ui_out_text (uiout, "\n");
}
+ /* FIXME: cagney/2004-01-17: When both return_value and
+ extract_returned_value_address are available, should use that to
+ find the address of and then extract the returned value. */
/* FIXME: 2003-09-27: When returning from a nested inferior function
call, it's possible (with no help from the architecture vector)
to locate and return/print a "struct return" value. This is just
@@ -1092,7 +1076,8 @@ print_return_value (int structure_return, struct type *value_type)
initiate the call, as opposed to the call_function_by_hand
case. */
{
- gdb_assert (gdbarch_return_value (current_gdbarch, value_type, NULL, NULL, NULL)
+ gdb_assert (gdbarch_return_value (current_gdbarch, value_type,
+ NULL, NULL, NULL)
== RETURN_VALUE_STRUCT_CONVENTION);
ui_out_text (uiout, "Value returned has type: ");
ui_out_field_string (uiout, "return-type", TYPE_NAME (value_type));
@@ -1102,17 +1087,9 @@ print_return_value (int structure_return, struct type *value_type)
}
else
{
- if (EXTRACT_STRUCT_VALUE_ADDRESS_P ())
+ if (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P ())
{
- CORE_ADDR addr = EXTRACT_STRUCT_VALUE_ADDRESS (stop_registers);
- if (!addr)
- error ("Function return value unknown.");
- value = value_at (value_type, addr, NULL);
- }
- else if (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P ())
- {
- char *buf = deprecated_grub_regcache_for_registers (stop_registers);
- CORE_ADDR addr = DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS (buf);
+ CORE_ADDR addr = DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS (stop_registers);
if (!addr)
error ("Function return value unknown.");
value = value_at (value_type, addr, NULL);
@@ -1130,25 +1107,31 @@ print_return_value (int structure_return, struct type *value_type)
EXTRACT_RETURN_VALUE (value_type, stop_registers,
VALUE_CONTENTS_RAW (value));
}
- stb = ui_out_stream_new (uiout);
- ui_out_text (uiout, "Value returned is ");
- ui_out_field_fmt (uiout, "gdb-result-var", "$%d", record_latest_value (value));
- ui_out_text (uiout, " = ");
- value_print (value, stb->stream, 0, Val_no_prettyprint);
- ui_out_field_stream (uiout, "return-value", stb);
- ui_out_text (uiout, "\n");
}
+
+ /* Print it. */
+ stb = ui_out_stream_new (uiout);
+ old_chain = make_cleanup_ui_out_stream_delete (stb);
+ ui_out_text (uiout, "Value returned is ");
+ ui_out_field_fmt (uiout, "gdb-result-var", "$%d",
+ record_latest_value (value));
+ ui_out_text (uiout, " = ");
+ value_print (value, stb->stream, 0, Val_no_prettyprint);
+ ui_out_field_stream (uiout, "return-value", stb);
+ ui_out_text (uiout, "\n");
+ do_cleanups (old_chain);
}
/* Stuff that needs to be done by the finish command after the target
- has stopped. In asynchronous mode, we wait for the target to stop in
- the call to poll or select in the event loop, so it is impossible to
- do all the stuff as part of the finish_command function itself. The
- only chance we have to complete this command is in
- fetch_inferior_event, which is called by the event loop as soon as it
- detects that the target has stopped. This function is called via the
- cmd_continuation pointer. */
-void
+ has stopped. In asynchronous mode, we wait for the target to stop
+ in the call to poll or select in the event loop, so it is
+ impossible to do all the stuff as part of the finish_command
+ function itself. The only chance we have to complete this command
+ is in fetch_inferior_event, which is called by the event loop as
+ soon as it detects that the target has stopped. This function is
+ called via the cmd_continuation pointer. */
+
+static void
finish_command_continuation (struct continuation_arg *arg)
{
struct symbol *function;
@@ -1156,15 +1139,15 @@ finish_command_continuation (struct continuation_arg *arg)
struct cleanup *cleanups;
breakpoint = (struct breakpoint *) arg->data.pointer;
- function = (struct symbol *) arg->next->data.pointer;
- cleanups = (struct cleanup *) arg->next->next->data.pointer;
+ function = (struct symbol *) arg->next->data.pointer;
+ cleanups = (struct cleanup *) arg->next->next->data.pointer;
if (bpstat_find_breakpoint (stop_bpstat, breakpoint) != NULL
- && function != 0)
+ && function != NULL)
{
struct type *value_type;
- CORE_ADDR funcaddr;
int struct_return;
+ int gcc_compiled;
value_type = TYPE_TARGET_TYPE (SYMBOL_TYPE (function));
if (!value_type)
@@ -1177,18 +1160,18 @@ finish_command_continuation (struct continuation_arg *arg)
return;
}
- funcaddr = BLOCK_START (SYMBOL_BLOCK_VALUE (function));
-
- struct_return = using_struct_return (check_typedef (value_type),
- BLOCK_GCC_COMPILED (SYMBOL_BLOCK_VALUE (function)));
+ CHECK_TYPEDEF (value_type);
+ gcc_compiled = BLOCK_GCC_COMPILED (SYMBOL_BLOCK_VALUE (function));
+ struct_return = using_struct_return (value_type, gcc_compiled);
print_return_value (struct_return, value_type);
}
+
do_exec_cleanups (cleanups);
}
-/* "finish": Set a temporary breakpoint at the place
- the selected frame will return to, then continue. */
+/* "finish": Set a temporary breakpoint at the place the selected
+ frame will return to, then continue. */
static void
finish_command (char *arg, int from_tty)
@@ -1202,20 +1185,20 @@ finish_command (char *arg, int from_tty)
int async_exec = 0;
- /* Find out whether we must run in the background. */
+ /* Find out whether we must run in the background. */
if (arg != NULL)
async_exec = strip_bg_char (&arg);
/* If we must run in the background, but the target can't do it,
- error out. */
+ error out. */
if (event_loop_p && async_exec && !target_can_async_p ())
error ("Asynchronous execution not supported on this target.");
/* If we are not asked to run in the bg, then prepare to run in the
- foreground, synchronously. */
+ foreground, synchronously. */
if (event_loop_p && !async_exec && target_can_async_p ())
{
- /* Simulate synchronous execution */
+ /* Simulate synchronous execution. */
async_disable_stdin ();
}
@@ -1246,8 +1229,8 @@ finish_command (char *arg, int from_tty)
function = find_pc_function (get_frame_pc (deprecated_selected_frame));
- /* Print info on the selected frame, including level number
- but not source. */
+ /* Print info on the selected frame, including level number but not
+ source. */
if (from_tty)
{
printf_filtered ("Run till exit from ");
@@ -1258,7 +1241,7 @@ finish_command (char *arg, int from_tty)
/* If running asynchronously and the target support asynchronous
execution, set things up for the rest of the finish command to be
completed later on, when gdb has detected that the target has
- stopped, in fetch_inferior_event. */
+ stopped, in fetch_inferior_event. */
if (event_loop_p && target_can_async_p ())
{
arg1 =
@@ -1276,44 +1259,43 @@ finish_command (char *arg, int from_tty)
add_continuation (finish_command_continuation, arg1);
}
- proceed_to_finish = 1; /* We want stop_registers, please... */
+ proceed_to_finish = 1; /* We want stop_registers, please... */
proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 0);
/* Do this only if not running asynchronously or if the target
- cannot do async execution. Otherwise, complete this command when
- the target actually stops, in fetch_inferior_event. */
+ cannot do async execution. Otherwise, complete this command when
+ the target actually stops, in fetch_inferior_event. */
if (!event_loop_p || !target_can_async_p ())
{
-
- /* Did we stop at our breakpoint? */
+ /* Did we stop at our breakpoint? */
if (bpstat_find_breakpoint (stop_bpstat, breakpoint) != NULL
- && function != 0)
+ && function != NULL)
{
struct type *value_type;
- CORE_ADDR funcaddr;
int struct_return;
+ int gcc_compiled;
value_type = TYPE_TARGET_TYPE (SYMBOL_TYPE (function));
if (!value_type)
internal_error (__FILE__, __LINE__,
"finish_command: function has no target type");
- /* FIXME: Shouldn't we do the cleanups before returning? */
+ /* FIXME: Shouldn't we do the cleanups before returning? */
if (TYPE_CODE (value_type) == TYPE_CODE_VOID)
return;
- funcaddr = BLOCK_START (SYMBOL_BLOCK_VALUE (function));
-
- struct_return =
- using_struct_return (check_typedef (value_type),
- BLOCK_GCC_COMPILED (SYMBOL_BLOCK_VALUE (function)));
+ CHECK_TYPEDEF (value_type);
+ gcc_compiled = BLOCK_GCC_COMPILED (SYMBOL_BLOCK_VALUE (function));
+ struct_return = using_struct_return (value_type, gcc_compiled);
print_return_value (struct_return, value_type);
}
+
do_cleanups (old_chain);
}
}
+
static void
program_info (char *args, int from_tty)
{
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 4e615d5..ea83f13 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -2,8 +2,8 @@
process.
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
- 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software
- Foundation, Inc.
+ 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free
+ Software Foundation, Inc.
This file is part of GDB.
@@ -61,9 +61,6 @@ static int hook_stop_stub (void *);
static void delete_breakpoint_current_contents (void *);
-static void set_follow_fork_mode_command (char *arg, int from_tty,
- struct cmd_list_element *c);
-
static int restore_selected_frame (void *);
static void build_infrun (void);
@@ -340,12 +337,10 @@ static struct
}
pending_follow;
-static const char follow_fork_mode_ask[] = "ask";
static const char follow_fork_mode_child[] = "child";
static const char follow_fork_mode_parent[] = "parent";
static const char *follow_fork_mode_kind_names[] = {
- follow_fork_mode_ask,
follow_fork_mode_child,
follow_fork_mode_parent,
NULL
@@ -357,16 +352,7 @@ static const char *follow_fork_mode_string = follow_fork_mode_parent;
static int
follow_fork (void)
{
- const char *follow_mode = follow_fork_mode_string;
- int follow_child = (follow_mode == follow_fork_mode_child);
-
- /* Or, did the user not know, and want us to ask? */
- if (follow_fork_mode_string == follow_fork_mode_ask)
- {
- internal_error (__FILE__, __LINE__,
- "follow_inferior_fork: \"ask\" mode not implemented");
- /* follow_mode = follow_fork_mode_...; */
- }
+ int follow_child = (follow_fork_mode_string == follow_fork_mode_child);
return target_follow_fork (follow_child);
}
@@ -1327,6 +1313,79 @@ handle_step_into_function (struct execution_control_state *ecs)
return;
}
+static void
+adjust_pc_after_break (struct execution_control_state *ecs)
+{
+ CORE_ADDR stop_pc;
+
+ /* If this target does not decrement the PC after breakpoints, then
+ we have nothing to do. */
+ if (DECR_PC_AFTER_BREAK == 0)
+ return;
+
+ /* If we've hit a breakpoint, we'll normally be stopped with SIGTRAP. If
+ we aren't, just return.
+
+ We assume that waitkinds other than TARGET_WAITKIND_STOPPED are not
+ affected by DECR_PC_AFTER_BREAK. Other waitkinds which are implemented
+ by software breakpoints should be handled through the normal breakpoint
+ layer.
+
+ NOTE drow/2004-01-31: On some targets, breakpoints may generate
+ different signals (SIGILL or SIGEMT for instance), but it is less
+ clear where the PC is pointing afterwards. It may not match
+ DECR_PC_AFTER_BREAK. I don't know any specific target that generates
+ these signals at breakpoints (the code has been in GDB since at least
+ 1992) so I can not guess how to handle them here.
+
+ In earlier versions of GDB, a target with HAVE_NONSTEPPABLE_WATCHPOINTS
+ would have the PC after hitting a watchpoint affected by
+ DECR_PC_AFTER_BREAK. I haven't found any target with both of these set
+ in GDB history, and it seems unlikely to be correct, so
+ HAVE_NONSTEPPABLE_WATCHPOINTS is not checked here. */
+
+ if (ecs->ws.kind != TARGET_WAITKIND_STOPPED)
+ return;
+
+ if (ecs->ws.value.sig != TARGET_SIGNAL_TRAP)
+ return;
+
+ /* Find the location where (if we've hit a breakpoint) the breakpoint would
+ be. */
+ stop_pc = read_pc_pid (ecs->ptid) - DECR_PC_AFTER_BREAK;
+
+ /* If we're software-single-stepping, then assume this is a breakpoint.
+ NOTE drow/2004-01-17: This doesn't check that the PC matches, or that
+ we're even in the right thread. The software-single-step code needs
+ some modernization.
+
+ If we're not software-single-stepping, then we first check that there
+ is an enabled software breakpoint at this address. If there is, and
+ we weren't using hardware-single-step, then we've hit the breakpoint.
+
+ If we were using hardware-single-step, we check prev_pc; if we just
+ stepped over an inserted software breakpoint, then we should decrement
+ the PC and eventually report hitting the breakpoint. The prev_pc check
+ prevents us from decrementing the PC if we just stepped over a jump
+ instruction and landed on the instruction after a breakpoint.
+
+ The last bit checks that we didn't hit a breakpoint in a signal handler
+ without an intervening stop in sigtramp, which is detected by a new
+ stack pointer value below any usual function calling stack adjustments.
+
+ NOTE drow/2004-01-17: I'm not sure that this is necessary. The check
+ predates checking for software single step at the same time. Also,
+ if we've moved into a signal handler we should have seen the
+ signal. */
+
+ if ((SOFTWARE_SINGLE_STEP_P () && singlestep_breakpoints_inserted_p)
+ || (software_breakpoint_inserted_here_p (stop_pc)
+ && !(currently_stepping (ecs)
+ && prev_pc != stop_pc
+ && !(step_range_end && INNER_THAN (read_sp (), (step_sp - 16))))))
+ write_pc_pid (stop_pc, ecs->ptid);
+}
+
/* Given an execution control state that has been freshly filled in
by an event from the inferior, figure out what it means and take
appropriate action. */
@@ -1346,6 +1405,8 @@ handle_inferior_event (struct execution_control_state *ecs)
target_last_wait_ptid = ecs->ptid;
target_last_waitstatus = *ecs->wp;
+ adjust_pc_after_break (ecs);
+
switch (ecs->infwait_state)
{
case infwait_thread_hop_state:
@@ -1528,13 +1589,7 @@ handle_inferior_event (struct execution_control_state *ecs)
stop_pc = read_pc ();
- /* Assume that catchpoints are not really software breakpoints. If
- some future target implements them using software breakpoints then
- that target is responsible for fudging DECR_PC_AFTER_BREAK. Thus
- we pass 1 for the NOT_A_SW_BREAKPOINT argument, so that
- bpstat_stop_status will not decrement the PC. */
-
- stop_bpstat = bpstat_stop_status (&stop_pc, 1);
+ stop_bpstat = bpstat_stop_status (stop_pc, ecs->ptid);
ecs->random_signal = !bpstat_explains_signal (stop_bpstat);
@@ -1583,13 +1638,7 @@ handle_inferior_event (struct execution_control_state *ecs)
ecs->saved_inferior_ptid = inferior_ptid;
inferior_ptid = ecs->ptid;
- /* Assume that catchpoints are not really software breakpoints. If
- some future target implements them using software breakpoints then
- that target is responsible for fudging DECR_PC_AFTER_BREAK. Thus
- we pass 1 for the NOT_A_SW_BREAKPOINT argument, so that
- bpstat_stop_status will not decrement the PC. */
-
- stop_bpstat = bpstat_stop_status (&stop_pc, 1);
+ stop_bpstat = bpstat_stop_status (stop_pc, ecs->ptid);
ecs->random_signal = !bpstat_explains_signal (stop_bpstat);
inferior_ptid = ecs->saved_inferior_ptid;
@@ -1699,19 +1748,15 @@ handle_inferior_event (struct execution_control_state *ecs)
/* Check if a regular breakpoint has been hit before checking
for a potential single step breakpoint. Otherwise, GDB will
not see this breakpoint hit when stepping onto breakpoints. */
- if (breakpoints_inserted
- && breakpoint_here_p (stop_pc - DECR_PC_AFTER_BREAK))
+ if (breakpoints_inserted && breakpoint_here_p (stop_pc))
{
ecs->random_signal = 0;
- if (!breakpoint_thread_match (stop_pc - DECR_PC_AFTER_BREAK,
- ecs->ptid))
+ if (!breakpoint_thread_match (stop_pc, ecs->ptid))
{
int remove_status;
/* Saw a breakpoint, but it was hit by the wrong thread.
Just continue. */
- if (DECR_PC_AFTER_BREAK)
- write_pc_pid (stop_pc - DECR_PC_AFTER_BREAK, ecs->ptid);
remove_status = remove_breakpoints ();
/* Did we fail to remove breakpoints? If so, try
@@ -1724,7 +1769,7 @@ handle_inferior_event (struct execution_control_state *ecs)
if (remove_status != 0)
{
/* FIXME! This is obviously non-portable! */
- write_pc_pid (stop_pc - DECR_PC_AFTER_BREAK + 4, ecs->ptid);
+ write_pc_pid (stop_pc + 4, ecs->ptid);
/* We need to restart all the threads now,
* unles we're running in scheduler-locked mode.
* Use currently_stepping to determine whether to
@@ -1758,17 +1803,6 @@ handle_inferior_event (struct execution_control_state *ecs)
}
else if (SOFTWARE_SINGLE_STEP_P () && singlestep_breakpoints_inserted_p)
{
- /* Readjust the stop_pc as it is off by DECR_PC_AFTER_BREAK
- compared to the value it would have if the system stepping
- capability was used. This allows the rest of the code in
- this function to use this address without having to worry
- whether software single step is in use or not. */
- if (DECR_PC_AFTER_BREAK)
- {
- stop_pc -= DECR_PC_AFTER_BREAK;
- write_pc_pid (stop_pc, ecs->ptid);
- }
-
sw_single_step_trap_p = 1;
ecs->random_signal = 0;
}
@@ -1900,9 +1934,6 @@ handle_inferior_event (struct execution_control_state *ecs)
includes evaluating watchpoints, things will come to a
stop in the correct manner. */
- if (DECR_PC_AFTER_BREAK)
- write_pc (stop_pc - DECR_PC_AFTER_BREAK);
-
remove_breakpoints ();
registers_changed ();
target_resume (ecs->ptid, 1, TARGET_SIGNAL_0); /* Single step */
@@ -1944,15 +1975,20 @@ handle_inferior_event (struct execution_control_state *ecs)
will be made according to the signal handling tables. */
/* First, distinguish signals caused by the debugger from signals
- that have to do with the program's own actions.
- Note that breakpoint insns may cause SIGTRAP or SIGILL
- or SIGEMT, depending on the operating system version.
- Here we detect when a SIGILL or SIGEMT is really a breakpoint
- and change it to SIGTRAP. */
+ that have to do with the program's own actions. Note that
+ breakpoint insns may cause SIGTRAP or SIGILL or SIGEMT, depending
+ on the operating system version. Here we detect when a SIGILL or
+ SIGEMT is really a breakpoint and change it to SIGTRAP. We do
+ something similar for SIGSEGV, since a SIGSEGV will be generated
+ when we're trying to execute a breakpoint instruction on a
+ non-executable stack. This happens for call dummy breakpoints
+ for architectures like SPARC that place call dummies on the
+ stack. */
if (stop_signal == TARGET_SIGNAL_TRAP
|| (breakpoints_inserted &&
(stop_signal == TARGET_SIGNAL_ILL
+ || stop_signal == TARGET_SIGNAL_SEGV
|| stop_signal == TARGET_SIGNAL_EMT))
|| stop_soon == STOP_QUIETLY
|| stop_soon == STOP_QUIETLY_NO_SIGSTOP)
@@ -1997,29 +2033,8 @@ handle_inferior_event (struct execution_control_state *ecs)
else
{
/* See if there is a breakpoint at the current PC. */
+ stop_bpstat = bpstat_stop_status (stop_pc, ecs->ptid);
- /* The second argument of bpstat_stop_status is meant to help
- distinguish between a breakpoint trap and a singlestep trap.
- This is only important on targets where DECR_PC_AFTER_BREAK
- is non-zero. The prev_pc test is meant to distinguish between
- singlestepping a trap instruction, and singlestepping thru a
- jump to the instruction following a trap instruction.
-
- Therefore, pass TRUE if our reason for stopping is
- something other than hitting a breakpoint. We do this by
- checking that either: we detected earlier a software single
- step trap or, 1) stepping is going on and 2) we didn't hit
- a breakpoint in a signal handler without an intervening stop
- in sigtramp, which is detected by a new stack pointer value
- below any usual function calling stack adjustments. */
- stop_bpstat =
- bpstat_stop_status
- (&stop_pc,
- sw_single_step_trap_p
- || (currently_stepping (ecs)
- && prev_pc != stop_pc - DECR_PC_AFTER_BREAK
- && !(step_range_end
- && INNER_THAN (read_sp (), (step_sp - 16)))));
/* Following in case break condition called a
function. */
stop_print_frame = 1;
@@ -2036,10 +2051,14 @@ handle_inferior_event (struct execution_control_state *ecs)
If someone ever tries to get get call dummys on a
non-executable stack to work (where the target would stop
- with something like a SIGSEG), then those tests might need to
- be re-instated. Given, however, that the tests were only
+ with something like a SIGSEGV), then those tests might need
+ to be re-instated. Given, however, that the tests were only
enabled when momentary breakpoints were not being used, I
- suspect that it won't be the case. */
+ suspect that it won't be the case.
+
+ NOTE: kettenis/2004-02-05: Indeed such checks don't seem to
+ be necessary for call dummies on a non-executable stack on
+ SPARC. */
if (stop_signal == TARGET_SIGNAL_TRAP)
ecs->random_signal
@@ -2315,7 +2334,7 @@ process_event_stop_test:
gdb of events. This allows the user to get control
and place breakpoints in initializer routines for
dynamically loaded objects (among other things). */
- if (stop_on_solib_events)
+ if (stop_on_solib_events || stop_stack_dummy)
{
stop_stepping (ecs);
return;
@@ -2771,6 +2790,29 @@ step_into_function (struct execution_control_state *ecs)
&& ecs->sal.end < ecs->stop_func_end)
ecs->stop_func_start = ecs->sal.end;
+ /* Architectures which require breakpoint adjustment might not be able
+ to place a breakpoint at the computed address. If so, the test
+ ``ecs->stop_func_start == stop_pc'' will never succeed. Adjust
+ ecs->stop_func_start to an address at which a breakpoint may be
+ legitimately placed.
+
+ Note: kevinb/2004-01-19: On FR-V, if this adjustment is not
+ made, GDB will enter an infinite loop when stepping through
+ optimized code consisting of VLIW instructions which contain
+ subinstructions corresponding to different source lines. On
+ FR-V, it's not permitted to place a breakpoint on any but the
+ first subinstruction of a VLIW instruction. When a breakpoint is
+ set, GDB will adjust the breakpoint address to the beginning of
+ the VLIW instruction. Thus, we need to make the corresponding
+ adjustment here when computing the stop address. */
+
+ if (gdbarch_adjust_breakpoint_address_p (current_gdbarch))
+ {
+ ecs->stop_func_start
+ = gdbarch_adjust_breakpoint_address (current_gdbarch,
+ ecs->stop_func_start);
+ }
+
if (ecs->stop_func_start == stop_pc)
{
/* We are already there: stop now. */
@@ -2954,17 +2996,6 @@ keep_going (struct execution_control_state *ecs)
if (stop_signal == TARGET_SIGNAL_TRAP && !signal_program[stop_signal])
stop_signal = TARGET_SIGNAL_0;
-#ifdef SHIFT_INST_REGS
- /* I'm not sure when this following segment applies. I do know,
- now, that we shouldn't rewrite the regs when we were stopped
- by a random signal from the inferior process. */
- /* FIXME: Shouldn't this be based on the valid bit of the SXIP?
- (this is only used on the 88k). */
-
- if (!bpstat_explains_signal (stop_bpstat)
- && (stop_signal != TARGET_SIGNAL_CHLD) && !stopped_by_random_signal)
- SHIFT_INST_REGS ();
-#endif /* SHIFT_INST_REGS */
resume (currently_stepping (ecs), stop_signal);
}
@@ -3123,6 +3154,7 @@ normal_stop (void)
previous_inferior_ptid = inferior_ptid;
}
+ /* NOTE drow/2004-01-17: Is this still necessary? */
/* Make sure that the current_frame's pc is correct. This
is a correction for setting up the frame info before doing
DECR_PC_AFTER_BREAK */
@@ -4075,31 +4107,12 @@ to the user would be loading/unloading of a new library.\n", &setlist), &showlis
c = add_set_enum_cmd ("follow-fork-mode",
class_run,
follow_fork_mode_kind_names, &follow_fork_mode_string,
-/* ??rehrauer: The "both" option is broken, by what may be a 10.20
- kernel problem. It's also not terribly useful without a GUI to
- help the user drive two debuggers. So for now, I'm disabling
- the "both" option. */
-/* "Set debugger response to a program call of fork \
- or vfork.\n\
- A fork or vfork creates a new process. follow-fork-mode can be:\n\
- parent - the original process is debugged after a fork\n\
- child - the new process is debugged after a fork\n\
- both - both the parent and child are debugged after a fork\n\
- ask - the debugger will ask for one of the above choices\n\
- For \"both\", another copy of the debugger will be started to follow\n\
- the new child process. The original debugger will continue to follow\n\
- the original parent process. To distinguish their prompts, the\n\
- debugger copy's prompt will be changed.\n\
- For \"parent\" or \"child\", the unfollowed process will run free.\n\
- By default, the debugger will follow the parent process.",
- */
"Set debugger response to a program call of fork \
or vfork.\n\
A fork or vfork creates a new process. follow-fork-mode can be:\n\
parent - the original process is debugged after a fork\n\
child - the new process is debugged after a fork\n\
- ask - the debugger will ask for one of the above choices\n\
-For \"parent\" or \"child\", the unfollowed process will run free.\n\
+The unfollowed process will continue to run.\n\
By default, the debugger will follow the parent process.", &setlist);
add_show_from_set (c, &showlist);
diff --git a/gdb/inftarg.c b/gdb/inftarg.c
index a20c39f..a6f40ec 100644
--- a/gdb/inftarg.c
+++ b/gdb/inftarg.c
@@ -1,7 +1,7 @@
/* Target-vector operations for controlling Unix child processes, for GDB.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999,
- 2000, 2002, 2003 Free Software Foundation, Inc.
+ 2000, 2002, 2003, 2004 Free Software Foundation, Inc.
Contributed by Cygnus Support.
@@ -222,7 +222,7 @@ child_attach (char *args, int from_tty)
printf_unfiltered ("Attaching to program: %s, %s\n", exec_file,
target_pid_to_str (pid_to_ptid (pid)));
else
- printf_unfiltered ("Attaching to %s\n",
+ printf_unfiltered ("Attaching to %s\n",
target_pid_to_str (pid_to_ptid (pid)));
gdb_flush (gdb_stdout);
@@ -578,11 +578,19 @@ child_xfer_partial (struct target_ops *ops, enum target_object object,
return NATIVE_XFER_UNWIND_TABLE (ops, object, annex, readbuf, writebuf,
offset, len);
-#if 0
case TARGET_OBJECT_AUXV:
- return native_xfer_auxv (PIDGET (inferior_ptid), readbuf, writebuf,
+#ifndef NATIVE_XFER_AUXV
+#define NATIVE_XFER_AUXV(OPS,OBJECT,ANNEX,WRITEBUF,READBUF,OFFSET,LEN) (-1)
+#endif
+ return NATIVE_XFER_AUXV (ops, object, annex, readbuf, writebuf,
offset, len);
+
+ case TARGET_OBJECT_WCOOKIE:
+#ifndef NATIVE_XFER_WCOOKIE
+#define NATIVE_XFER_WCOOKIE(OPS,OBJECT,ANNEX,WRITEBUF,READBUF,OFFSET,LEN) (-1)
#endif
+ return NATIVE_XFER_WCOOKIE (ops, object, annex, readbuf, writebuf,
+ offset, len);
default:
return -1;
@@ -655,10 +663,10 @@ init_child_ops (void)
}
/* Take over the 'find_mapped_memory' vector from inftarg.c. */
-extern void
-inftarg_set_find_memory_regions (int (*func) (int (*) (CORE_ADDR,
- unsigned long,
- int, int, int,
+extern void
+inftarg_set_find_memory_regions (int (*func) (int (*) (CORE_ADDR,
+ unsigned long,
+ int, int, int,
void *),
void *))
{
@@ -666,7 +674,7 @@ inftarg_set_find_memory_regions (int (*func) (int (*) (CORE_ADDR,
}
/* Take over the 'make_corefile_notes' vector from inftarg.c. */
-extern void
+extern void
inftarg_set_make_corefile_notes (char * (*func) (bfd *, int *))
{
child_ops.to_make_corefile_notes = func;
diff --git a/gdb/jv-lang.c b/gdb/jv-lang.c
index 0d4d6bb..6db6e88 100644
--- a/gdb/jv-lang.c
+++ b/gdb/jv-lang.c
@@ -1,5 +1,5 @@
/* Java language support routines for GDB, the GNU debugger.
- Copyright 1997, 1998, 1999, 2000, 2003 Free Software Foundation, Inc.
+ Copyright 1997, 1998, 1999, 2000, 2003, 2004 Free Software Foundation, Inc.
This file is part of GDB.
@@ -58,7 +58,6 @@ static void java_demangled_signature_copy (char *, char *);
static struct symtab *get_java_class_symtab (void);
static char *get_java_utf8_name (struct obstack *obstack, struct value *name);
static int java_class_is_primitive (struct value *clas);
-static struct type *java_lookup_type (char *signature);
static struct value *java_value_string (char *ptr, int len);
static void java_emit_char (int c, struct ui_file * stream, int quoter);
@@ -105,19 +104,19 @@ get_java_class_symtab (void)
class_symtab = allocate_symtab ("<java-classes>", objfile);
class_symtab->language = language_java;
bv = (struct blockvector *)
- obstack_alloc (&objfile->symbol_obstack,
+ obstack_alloc (&objfile->objfile_obstack,
sizeof (struct blockvector) + sizeof (struct block *));
BLOCKVECTOR_NBLOCKS (bv) = 1;
BLOCKVECTOR (class_symtab) = bv;
/* Allocate dummy STATIC_BLOCK. */
- bl = allocate_block (&objfile->symbol_obstack);
- BLOCK_DICT (bl) = dict_create_linear (&objfile->symbol_obstack,
+ bl = allocate_block (&objfile->objfile_obstack);
+ BLOCK_DICT (bl) = dict_create_linear (&objfile->objfile_obstack,
NULL);
BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK) = bl;
/* Allocate GLOBAL_BLOCK. */
- bl = allocate_block (&objfile->symbol_obstack);
+ bl = allocate_block (&objfile->objfile_obstack);
BLOCK_DICT (bl) = dict_create_hashed_expandable ();
BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK) = bl;
class_symtab->free_func = free_class_block;
@@ -140,7 +139,7 @@ add_class_symbol (struct type *type, CORE_ADDR addr)
{
struct symbol *sym;
sym = (struct symbol *)
- obstack_alloc (&dynamics_objfile->symbol_obstack, sizeof (struct symbol));
+ obstack_alloc (&dynamics_objfile->objfile_obstack, sizeof (struct symbol));
memset (sym, 0, sizeof (struct symbol));
SYMBOL_LANGUAGE (sym) = language_java;
DEPRECATED_SYMBOL_NAME (sym) = TYPE_TAG_NAME (type);
@@ -187,7 +186,7 @@ java_lookup_class (char *name)
type = alloc_type (objfile);
TYPE_CODE (type) = TYPE_CODE_STRUCT;
INIT_CPLUS_SPECIFIC (type);
- TYPE_TAG_NAME (type) = obsavestring (name, strlen (name), &objfile->type_obstack);
+ TYPE_TAG_NAME (type) = obsavestring (name, strlen (name), &objfile->objfile_obstack);
TYPE_FLAGS (type) |= TYPE_FLAG_STUB;
TYPE ? = addr;
return type;
@@ -290,7 +289,7 @@ type_from_class (struct value *clas)
/* if clasloader non-null, prepend loader address. FIXME */
temp = clas;
utf8_name = value_struct_elt (&temp, NULL, "name", NULL, "structure");
- name = get_java_utf8_name (&objfile->type_obstack, utf8_name);
+ name = get_java_utf8_name (&objfile->objfile_obstack, utf8_name);
for (nptr = name; *nptr != 0; nptr++)
{
if (*nptr == '/')
@@ -310,7 +309,7 @@ type_from_class (struct value *clas)
char *signature = name;
int namelen = java_demangled_signature_length (signature);
if (namelen > strlen (name))
- name = obstack_alloc (&objfile->type_obstack, namelen + 1);
+ name = obstack_alloc (&objfile->objfile_obstack, namelen + 1);
java_demangled_signature_copy (name, signature);
name[namelen] = '\0';
is_array = 1;
@@ -443,7 +442,7 @@ java_link_class_type (struct type *type, struct value *clas)
temp = field;
temp = value_struct_elt (&temp, NULL, "name", NULL, "structure");
TYPE_FIELD_NAME (type, i) =
- get_java_utf8_name (&objfile->type_obstack, temp);
+ get_java_utf8_name (&objfile->objfile_obstack, temp);
temp = field;
accflags = value_as_long (value_struct_elt (&temp, NULL, "accflags",
NULL, "structure"));
@@ -489,7 +488,7 @@ java_link_class_type (struct type *type, struct value *clas)
TYPE_NFN_FIELDS_TOTAL (type) = nmethods;
j = nmethods * sizeof (struct fn_field);
fn_fields = (struct fn_field *)
- obstack_alloc (&dynamics_objfile->symbol_obstack, j);
+ obstack_alloc (&dynamics_objfile->objfile_obstack, j);
memset (fn_fields, 0, j);
fn_fieldlists = (struct fn_fieldlist *)
alloca (nmethods * sizeof (struct fn_fieldlist));
@@ -514,7 +513,7 @@ java_link_class_type (struct type *type, struct value *clas)
/* Get method name. */
temp = method;
temp = value_struct_elt (&temp, NULL, "name", NULL, "structure");
- mname = get_java_utf8_name (&objfile->type_obstack, temp);
+ mname = get_java_utf8_name (&objfile->objfile_obstack, temp);
if (strcmp (mname, "<init>") == 0)
mname = unqualified_name;
@@ -539,7 +538,7 @@ java_link_class_type (struct type *type, struct value *clas)
{ /* Found an existing method with the same name. */
int l;
if (mname != unqualified_name)
- obstack_free (&objfile->type_obstack, mname);
+ obstack_free (&objfile->objfile_obstack, mname);
mname = fn_fieldlists[j].name;
fn_fieldlists[j].length++;
k = i - k; /* Index of new slot. */
@@ -560,7 +559,7 @@ java_link_class_type (struct type *type, struct value *clas)
j = TYPE_NFN_FIELDS (type) * sizeof (struct fn_fieldlist);
TYPE_FN_FIELDLISTS (type) = (struct fn_fieldlist *)
- obstack_alloc (&dynamics_objfile->symbol_obstack, j);
+ obstack_alloc (&dynamics_objfile->objfile_obstack, j);
memcpy (TYPE_FN_FIELDLISTS (type), fn_fieldlists, j);
return type;
@@ -764,19 +763,6 @@ java_demangle_type_signature (char *signature)
return result;
}
-struct type *
-java_lookup_type (char *signature)
-{
- switch (signature[0])
- {
- case 'L':
- case '[':
- error ("java_lookup_type not fully implemented");
- default:
- return java_primitive_type (signature[0]);
- }
-}
-
/* Return the type of TYPE followed by DIMS pairs of [ ].
If DIMS == 0, TYPE is returned. */
@@ -1060,6 +1046,7 @@ const struct language_defn java_language_defn =
NULL, /* Language specific skip_trampoline */
value_of_this, /* value_of_this */
basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
+ basic_lookup_transparent_type,/* lookup_transparent_type */
java_demangle, /* Language specific symbol demangler */
{"", "", "", ""}, /* Binary format info */
{"0%lo", "0", "o", ""}, /* Octal format info */
diff --git a/gdb/language.c b/gdb/language.c
index 3be9f9e..bc00b47 100644
--- a/gdb/language.c
+++ b/gdb/language.c
@@ -1,7 +1,7 @@
/* Multiple source language support for GDB.
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000,
- 2001, 2002, 2003 Free Software Foundation, Inc.
+ 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
Contributed by the Department of Computer Science at the State University
of New York at Buffalo.
@@ -1289,6 +1289,7 @@ const struct language_defn unknown_language_defn =
unk_lang_trampoline, /* Language specific skip_trampoline */
value_of_this, /* value_of_this */
basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
+ basic_lookup_transparent_type,/* lookup_transparent_type */
unk_lang_demangle, /* Language specific symbol demangler */
{"", "", "", ""}, /* Binary format info */
{"0%lo", "0", "o", ""}, /* Octal format info */
@@ -1324,6 +1325,7 @@ const struct language_defn auto_language_defn =
unk_lang_trampoline, /* Language specific skip_trampoline */
value_of_this, /* value_of_this */
basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
+ basic_lookup_transparent_type,/* lookup_transparent_type */
unk_lang_demangle, /* Language specific symbol demangler */
{"", "", "", ""}, /* Binary format info */
{"0%lo", "0", "o", ""}, /* Octal format info */
@@ -1358,6 +1360,7 @@ const struct language_defn local_language_defn =
unk_lang_trampoline, /* Language specific skip_trampoline */
value_of_this, /* value_of_this */
basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
+ basic_lookup_transparent_type,/* lookup_transparent_type */
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 7470167..8ed9fb0 100644
--- a/gdb/language.h
+++ b/gdb/language.h
@@ -1,7 +1,7 @@
/* Source-language-related definitions for GDB.
- Copyright 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2003 Free
- Software Foundation, Inc.
+ Copyright 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2003,
+ 2004 Free Software Foundation, Inc.
Contributed by the Department of Computer Science at the State University
of New York at Buffalo.
@@ -233,6 +233,9 @@ struct language_defn
const domain_enum,
struct symtab **);
+ /* Find the definition of the type with the given name. */
+ struct type *(*la_lookup_transparent_type) (const char *);
+
/* 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 741ac88..e16e96e 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -1,6 +1,6 @@
/* Parser for linespec for the GNU debugger, GDB.
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
- 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+ 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
This file is part of GDB.
@@ -1469,7 +1469,14 @@ symtab_from_filename (char **argptr, char *p, int is_quote_enclosed,
if (not_found_ptr)
{
*not_found_ptr = 1;
- throw_exception (RETURN_ERROR);
+ /* The caller has indicated that it wishes quiet notification of any
+ error where the function or file is not found. A call to
+ error_silent causes an error to occur, but it does not issue
+ the supplied message. The message can be manually output by
+ the caller, if desired. This is used, for example, when
+ attempting to set breakpoints for functions in shared libraries
+ that have not yet been loaded. */
+ error_silent ("No source file named %s.", copy);
}
error ("No source file named %s.", copy);
}
@@ -1684,7 +1691,14 @@ decode_variable (char *copy, int funfirstline, char ***canonical,
if (not_found_ptr)
{
*not_found_ptr = 1;
- throw_exception (RETURN_ERROR);
+ /* The caller has indicated that it wishes quiet notification of any
+ error where the function or file is not found. A call to
+ error_silent causes an error to occur, but it does not issue
+ the supplied message. The message can be manually output by
+ the caller, if desired. This is used, for example, when
+ attempting to set breakpoints for functions in shared libraries
+ that have not yet been loaded. */
+ error_silent ("Function \"%s\" not defined.", copy);
}
error ("Function \"%s\" not defined.", copy);
diff --git a/gdb/linux-proc.c b/gdb/linux-proc.c
index 22dc93d..0a77459 100644
--- a/gdb/linux-proc.c
+++ b/gdb/linux-proc.c
@@ -208,7 +208,7 @@ struct linux_corefile_thread_data
};
/* Function: linux_corefile_thread_callback
- *
+ *
* Called by gdbthread.c once per thread.
* Records the thread's register state for the corefile note section.
*/
@@ -221,7 +221,7 @@ linux_corefile_thread_callback (struct lwp_info *ti, void *data)
inferior_ptid = ti->ptid;
registers_changed ();
- target_fetch_registers (-1); /* FIXME should not be necessary;
+ target_fetch_registers (-1); /* FIXME should not be necessary;
fill_gregset should do it automatically. */
args->note_data = linux_do_thread_registers (args->obfd,
ti->ptid,
@@ -230,13 +230,13 @@ linux_corefile_thread_callback (struct lwp_info *ti, void *data)
args->num_notes++;
inferior_ptid = saved_ptid;
registers_changed ();
- target_fetch_registers (-1); /* FIXME should not be necessary;
+ target_fetch_registers (-1); /* FIXME should not be necessary;
fill_gregset should do it automatically. */
return 0;
}
/* Function: linux_do_registers
- *
+ *
* Records the register state for the corefile note section.
*/
@@ -245,7 +245,7 @@ linux_do_registers (bfd *obfd, ptid_t ptid,
char *note_data, int *note_size)
{
registers_changed ();
- target_fetch_registers (-1); /* FIXME should not be necessary;
+ target_fetch_registers (-1); /* FIXME should not be necessary;
fill_gregset should do it automatically. */
return linux_do_thread_registers (obfd,
ptid_build (ptid_get_pid (inferior_ptid),
@@ -258,8 +258,8 @@ linux_do_registers (bfd *obfd, ptid_t ptid,
/* Function: linux_make_note_section
*
* Fills the "to_make_corefile_note" target vector.
- * Builds the note section for a corefile, and returns it
- * in a malloc buffer.
+ * Builds the note section for a corefile, and returns it
+ * in a malloc buffer.
*/
static char *
@@ -271,6 +271,8 @@ linux_make_note_section (bfd *obfd, int *note_size)
char psargs[80] = { '\0' };
char *note_data = NULL;
ptid_t current_ptid = inferior_ptid;
+ char *auxv;
+ int auxv_len;
if (get_exec_file (0))
{
@@ -305,6 +307,14 @@ linux_make_note_section (bfd *obfd, int *note_size)
note_data = thread_args.note_data;
}
+ auxv_len = target_auxv_read (&current_target, &auxv);
+ if (auxv_len > 0)
+ {
+ note_data = elfcore_write_note (obfd, note_data, note_size,
+ "CORE", NT_AUXV, auxv, auxv_len);
+ xfree (auxv);
+ }
+
make_cleanup (xfree, note_data);
return note_data;
}
@@ -564,7 +574,7 @@ linux_info_proc_cmd (char *args, int from_tty)
printf_filtered ("End of text: 0x%x\n", itmp);
if (fscanf (procfile, "%u ", &itmp) > 0)
printf_filtered ("Start of stack: 0x%x\n", itmp);
-#if 0 /* Don't know how architecture-dependent the rest is...
+#if 0 /* Don't know how architecture-dependent the rest is...
Anyway the signal bitmap info is available from "status". */
if (fscanf (procfile, "%u ", &itmp) > 0) /* FIXME arch? */
printf_filtered ("Kernel stack pointer: 0x%x\n", itmp);
diff --git a/gdb/lynx-nat.c b/gdb/lynx-nat.c
index b0e2402..7bfd40e 100644
--- a/gdb/lynx-nat.c
+++ b/gdb/lynx-nat.c
@@ -256,214 +256,6 @@ static int regmap[] =
#endif /* rs6000 */
-#ifdef SPARC
-
-/* This routine handles some oddball cases for Sparc registers and LynxOS.
- In partucular, it causes refs to G0, g5->7, and all fp regs to return zero.
- It also handles knows where to find the I & L regs on the stack. */
-
-void
-fetch_inferior_registers (int regno)
-{
- int whatregs = 0;
-
-#define WHATREGS_FLOAT 1
-#define WHATREGS_GEN 2
-#define WHATREGS_STACK 4
-
- if (regno == -1)
- whatregs = WHATREGS_FLOAT | WHATREGS_GEN | WHATREGS_STACK;
- else if (regno >= L0_REGNUM && regno <= I7_REGNUM)
- whatregs = WHATREGS_STACK;
- else if (regno >= FP0_REGNUM && regno < FP0_REGNUM + 32)
- whatregs = WHATREGS_FLOAT;
- else
- whatregs = WHATREGS_GEN;
-
- if (whatregs & WHATREGS_GEN)
- {
- struct econtext ec; /* general regs */
- char buf[MAX_REGISTER_SIZE];
- int retval;
- int i;
-
- errno = 0;
- retval = ptrace (PTRACE_GETREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) & ec, 0);
- if (errno)
- perror_with_name ("ptrace(PTRACE_GETREGS)");
-
- memset (buf, 0, DEPRECATED_REGISTER_RAW_SIZE (G0_REGNUM));
- supply_register (G0_REGNUM, buf);
- supply_register (TBR_REGNUM, (char *) &ec.tbr);
-
- memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (G1_REGNUM)], &ec.g1,
- 4 * DEPRECATED_REGISTER_RAW_SIZE (G1_REGNUM));
- for (i = G1_REGNUM; i <= G1_REGNUM + 3; i++)
- deprecated_register_valid[i] = 1;
-
- supply_register (PS_REGNUM, (char *) &ec.psr);
- supply_register (Y_REGNUM, (char *) &ec.y);
- supply_register (PC_REGNUM, (char *) &ec.pc);
- supply_register (DEPRECATED_NPC_REGNUM, (char *) &ec.npc);
- supply_register (WIM_REGNUM, (char *) &ec.wim);
-
- memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (O0_REGNUM)], ec.o,
- 8 * DEPRECATED_REGISTER_RAW_SIZE (O0_REGNUM));
- for (i = O0_REGNUM; i <= O0_REGNUM + 7; i++)
- deprecated_register_valid[i] = 1;
- }
-
- if (whatregs & WHATREGS_STACK)
- {
- CORE_ADDR sp;
- int i;
-
- sp = read_register (SP_REGNUM);
-
- target_read_memory (sp + FRAME_SAVED_I0,
- &deprecated_registers[DEPRECATED_REGISTER_BYTE (I0_REGNUM)],
- 8 * DEPRECATED_REGISTER_RAW_SIZE (I0_REGNUM));
- for (i = I0_REGNUM; i <= I7_REGNUM; i++)
- deprecated_register_valid[i] = 1;
-
- target_read_memory (sp + FRAME_SAVED_L0,
- &deprecated_registers[DEPRECATED_REGISTER_BYTE (L0_REGNUM)],
- 8 * DEPRECATED_REGISTER_RAW_SIZE (L0_REGNUM));
- for (i = L0_REGNUM; i <= L0_REGNUM + 7; i++)
- deprecated_register_valid[i] = 1;
- }
-
- if (whatregs & WHATREGS_FLOAT)
- {
- struct fcontext fc; /* fp regs */
- int retval;
- int i;
-
- errno = 0;
- retval = ptrace (PTRACE_GETFPREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) & fc, 0);
- if (errno)
- perror_with_name ("ptrace(PTRACE_GETFPREGS)");
-
- memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)], fc.f.fregs,
- 32 * DEPRECATED_REGISTER_RAW_SIZE (FP0_REGNUM));
- for (i = FP0_REGNUM; i <= FP0_REGNUM + 31; i++)
- deprecated_register_valid[i] = 1;
-
- supply_register (FPS_REGNUM, (char *) &fc.fsr);
- }
-}
-
-/* This routine handles storing of the I & L regs for the Sparc. The trick
- here is that they actually live on the stack. The really tricky part is
- that when changing the stack pointer, the I & L regs must be written to
- where the new SP points, otherwise the regs will be incorrect when the
- process is started up again. We assume that the I & L regs are valid at
- this point. */
-
-void
-store_inferior_registers (int regno)
-{
- int whatregs = 0;
-
- if (regno == -1)
- whatregs = WHATREGS_FLOAT | WHATREGS_GEN | WHATREGS_STACK;
- else if (regno >= L0_REGNUM && regno <= I7_REGNUM)
- whatregs = WHATREGS_STACK;
- else if (regno >= FP0_REGNUM && regno < FP0_REGNUM + 32)
- whatregs = WHATREGS_FLOAT;
- else if (regno == SP_REGNUM)
- whatregs = WHATREGS_STACK | WHATREGS_GEN;
- else
- whatregs = WHATREGS_GEN;
-
- if (whatregs & WHATREGS_GEN)
- {
- struct econtext ec; /* general regs */
- int retval;
-
- ec.tbr = read_register (TBR_REGNUM);
- memcpy (&ec.g1, &deprecated_registers[DEPRECATED_REGISTER_BYTE (G1_REGNUM)],
- 4 * DEPRECATED_REGISTER_RAW_SIZE (G1_REGNUM));
-
- ec.psr = read_register (PS_REGNUM);
- ec.y = read_register (Y_REGNUM);
- ec.pc = read_register (PC_REGNUM);
- ec.npc = read_register (DEPRECATED_NPC_REGNUM);
- ec.wim = read_register (WIM_REGNUM);
-
- memcpy (ec.o, &deprecated_registers[DEPRECATED_REGISTER_BYTE (O0_REGNUM)],
- 8 * DEPRECATED_REGISTER_RAW_SIZE (O0_REGNUM));
-
- errno = 0;
- retval = ptrace (PTRACE_SETREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) & ec, 0);
- if (errno)
- perror_with_name ("ptrace(PTRACE_SETREGS)");
- }
-
- if (whatregs & WHATREGS_STACK)
- {
- int regoffset;
- CORE_ADDR sp;
-
- sp = read_register (SP_REGNUM);
-
- if (regno == -1 || regno == SP_REGNUM)
- {
- if (!deprecated_register_valid[L0_REGNUM + 5])
- internal_error (__FILE__, __LINE__, "failed internal consistency check");
- target_write_memory (sp + FRAME_SAVED_I0,
- &deprecated_registers[DEPRECATED_REGISTER_BYTE (I0_REGNUM)],
- 8 * DEPRECATED_REGISTER_RAW_SIZE (I0_REGNUM));
-
- target_write_memory (sp + FRAME_SAVED_L0,
- &deprecated_registers[DEPRECATED_REGISTER_BYTE (L0_REGNUM)],
- 8 * DEPRECATED_REGISTER_RAW_SIZE (L0_REGNUM));
- }
- else if (regno >= L0_REGNUM && regno <= I7_REGNUM)
- {
- if (!deprecated_register_valid[regno])
- internal_error (__FILE__, __LINE__, "failed internal consistency check");
- if (regno >= L0_REGNUM && regno <= L0_REGNUM + 7)
- regoffset = DEPRECATED_REGISTER_BYTE (regno) - DEPRECATED_REGISTER_BYTE (L0_REGNUM)
- + FRAME_SAVED_L0;
- else
- regoffset = DEPRECATED_REGISTER_BYTE (regno) - DEPRECATED_REGISTER_BYTE (I0_REGNUM)
- + FRAME_SAVED_I0;
- target_write_memory (sp + regoffset,
- &deprecated_registers[DEPRECATED_REGISTER_BYTE (regno)],
- DEPRECATED_REGISTER_RAW_SIZE (regno));
- }
- }
-
- if (whatregs & WHATREGS_FLOAT)
- {
- struct fcontext fc; /* fp regs */
- int retval;
-
-/* We read fcontext first so that we can get good values for fq_t... */
- errno = 0;
- retval = ptrace (PTRACE_GETFPREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) & fc, 0);
- if (errno)
- perror_with_name ("ptrace(PTRACE_GETFPREGS)");
-
- memcpy (fc.f.fregs, &deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)],
- 32 * DEPRECATED_REGISTER_RAW_SIZE (FP0_REGNUM));
-
- fc.fsr = read_register (FPS_REGNUM);
-
- errno = 0;
- retval = ptrace (PTRACE_SETFPREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) & fc, 0);
- if (errno)
- perror_with_name ("ptrace(PTRACE_SETFPREGS)");
- }
-}
-#endif /* SPARC */
-
#if defined (I386) || defined (M68K) || defined (rs6000)
/* Return the offset relative to the start of the per-thread data to the
diff --git a/gdb/m2-lang.c b/gdb/m2-lang.c
index 7fe2e34e..e5b6b50 100644
--- a/gdb/m2-lang.c
+++ b/gdb/m2-lang.c
@@ -1,5 +1,5 @@
/* Modula 2 language support routines for GDB, the GNU debugger.
- Copyright 1992, 1993, 1994, 1995, 1996, 1998, 2000, 2002
+ Copyright 1992, 1993, 1994, 1995, 1996, 1998, 2000, 2002, 2003, 2004
Free Software Foundation, Inc.
This file is part of GDB.
@@ -428,6 +428,7 @@ const struct language_defn m2_language_defn =
NULL, /* Language specific skip_trampoline */
value_of_this, /* value_of_this */
basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
+ basic_lookup_transparent_type,/* lookup_transparent_type */
NULL, /* Language specific symbol demangler */
{"", "", "", ""}, /* Binary format info */
{"%loB", "", "o", "B"}, /* Octal format info */
diff --git a/gdb/m32r-rom.c b/gdb/m32r-rom.c
index 970a8e6..ef8c271 100644
--- a/gdb/m32r-rom.c
+++ b/gdb/m32r-rom.c
@@ -398,63 +398,6 @@ mon2000_open (char *args, int from_tty)
monitor_open (args, &mon2000_cmds, from_tty);
}
-/* Function: set_board_address
- Tell the BootOne monitor what it's ethernet IP address is. */
-
-static void
-m32r_set_board_address (char *args, int from_tty)
-{
- int resp_len;
- char buf[1024];
-
- if (args && *args)
- {
- monitor_printf ("ulip %s\n", args);
- resp_len = monitor_expect_prompt (buf, sizeof (buf));
- /* now parse the result for success */
- }
- else
- error ("Requires argument (IP address for M32R-EVA board)");
-}
-
-/* Function: set_server_address
- Tell the BootOne monitor what gdb's ethernet IP address is. */
-
-static void
-m32r_set_server_address (char *args, int from_tty)
-{
- int resp_len;
- char buf[1024];
-
- if (args && *args)
- {
- monitor_printf ("uhip %s\n", args);
- resp_len = monitor_expect_prompt (buf, sizeof (buf));
- /* now parse the result for success */
- }
- else
- error ("Requires argument (IP address of GDB's host computer)");
-}
-
-/* Function: set_download_path
- Tell the BootOne monitor the default path for downloadable SREC files. */
-
-static void
-m32r_set_download_path (char *args, int from_tty)
-{
- int resp_len;
- char buf[1024];
-
- if (args && *args)
- {
- monitor_printf ("up %s\n", args);
- resp_len = monitor_expect_prompt (buf, sizeof (buf));
- /* now parse the result for success */
- }
- else
- error ("Requires argument (default path for downloadable SREC files)");
-}
-
static void
m32r_upload_command (char *args, int from_tty)
{
diff --git a/gdb/m32r-tdep.c b/gdb/m32r-tdep.c
index b2bc71f..3eff522 100644
--- a/gdb/m32r-tdep.c
+++ b/gdb/m32r-tdep.c
@@ -75,9 +75,9 @@ m32r_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp)
return sp & ~3;
}
-/* Should we use EXTRACT_STRUCT_VALUE_ADDRESS instead of
- EXTRACT_RETURN_VALUE? GCC_P is true if compiled with gcc
- and TYPE is the type (which is known to be struct, union or array).
+/* Should we use DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS instead of
+ EXTRACT_RETURN_VALUE? GCC_P is true if compiled with gcc and TYPE
+ is the type (which is known to be struct, union or array).
The m32r returns anything less than 8 bytes in size in
registers. */
@@ -939,14 +939,11 @@ m32r_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_extract_return_value (gdbarch, m32r_extract_return_value);
set_gdbarch_push_dummy_call (gdbarch, m32r_push_dummy_call);
set_gdbarch_store_return_value (gdbarch, m32r_store_return_value);
- set_gdbarch_extract_struct_value_address (gdbarch,
- m32r_extract_struct_value_address);
+ set_gdbarch_deprecated_extract_struct_value_address (gdbarch, m32r_extract_struct_value_address);
set_gdbarch_use_struct_convention (gdbarch, m32r_use_struct_convention);
set_gdbarch_skip_prologue (gdbarch, m32r_skip_prologue);
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
- set_gdbarch_decr_pc_after_break (gdbarch, 0);
- set_gdbarch_function_start_offset (gdbarch, 0);
set_gdbarch_breakpoint_from_pc (gdbarch, m32r_breakpoint_from_pc);
set_gdbarch_memory_insert_breakpoint (gdbarch,
m32r_memory_insert_breakpoint);
diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c
index cc0ad71..b84fdd3 100644
--- a/gdb/m68hc11-tdep.c
+++ b/gdb/m68hc11-tdep.c
@@ -1,5 +1,8 @@
/* Target-dependent code for Motorola 68HC11 & 68HC12
- Copyright 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+
+ Copyright 1999, 2000, 2001, 2002, 2003, 2004 Free Software
+ Foundation, Inc.
+
Contributed by Stephane Carrez, stcarrez@nerim.fr
This file is part of GDB.
@@ -1549,15 +1552,11 @@ m68hc11_gdbarch_init (struct gdbarch_info info,
set_gdbarch_return_value_on_stack (gdbarch, m68hc11_return_value_on_stack);
set_gdbarch_store_return_value (gdbarch, m68hc11_store_return_value);
- set_gdbarch_extract_struct_value_address (gdbarch, m68hc11_extract_struct_value_address);
-
set_gdbarch_store_return_value (gdbarch, m68hc11_store_return_value);
- set_gdbarch_extract_struct_value_address (gdbarch, m68hc11_extract_struct_value_address);
+ set_gdbarch_deprecated_extract_struct_value_address (gdbarch, m68hc11_extract_struct_value_address);
set_gdbarch_use_struct_convention (gdbarch, m68hc11_use_struct_convention);
set_gdbarch_skip_prologue (gdbarch, m68hc11_skip_prologue);
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
- set_gdbarch_decr_pc_after_break (gdbarch, 0);
- set_gdbarch_function_start_offset (gdbarch, 0);
set_gdbarch_breakpoint_from_pc (gdbarch, m68hc11_breakpoint_from_pc);
set_gdbarch_deprecated_stack_align (gdbarch, m68hc11_stack_align);
set_gdbarch_print_insn (gdbarch, gdb_print_insn_m68hc11);
diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c
index e5b41a9..f6284ee 100644
--- a/gdb/m68k-tdep.c
+++ b/gdb/m68k-tdep.c
@@ -1,7 +1,7 @@
/* Target dependent code for the Motorola 68000 series.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000, 2001,
- 2002, 2003
- Free Software Foundation, Inc.
+
+ Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000,
+ 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of GDB.
@@ -69,17 +69,6 @@
#endif
-/* gdbarch_breakpoint_from_pc is set to m68k_local_breakpoint_from_pc
- so m68k_remote_breakpoint_from_pc is currently not used. */
-
-static const unsigned char *
-m68k_remote_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
-{
- static unsigned char break_insn[] = {0x4e, (0x40 | REMOTE_BPT_VECTOR)};
- *lenptr = sizeof (break_insn);
- return break_insn;
-}
-
static const unsigned char *
m68k_local_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
{
@@ -144,20 +133,6 @@ m68k_register_name (int regnum)
else
return register_names[regnum];
}
-
-/* Index within `registers' of the first byte of the space for
- register regnum. */
-
-static int
-m68k_register_byte (int regnum)
-{
- if (regnum >= M68K_FPC_REGNUM)
- return (((regnum - M68K_FPC_REGNUM) * 4) + 168);
- else if (regnum >= FP0_REGNUM)
- return (((regnum - FP0_REGNUM) * 12) + 72);
- else
- return (regnum * 4);
-}
/* Extract from an array REGBUF containing the (raw) register state, a
function return value of TYPE, and copy that, in virtual format,
@@ -1062,26 +1037,6 @@ m68k_get_longjmp_target (CORE_ADDR *pc)
return 1;
}
-#ifdef SYSCALL_TRAP
-/* Immediately after a function call, return the saved pc before the frame
- is setup. For sun3's, we check for the common case of being inside of a
- system call, and if so, we know that Sun pushes the call # on the stack
- prior to doing the trap. */
-
-static CORE_ADDR
-m68k_saved_pc_after_call (struct frame_info *frame)
-{
- int op;
-
- op = read_memory_unsigned_integer (frame->pc - SYSCALL_TRAP_OFFSET, 2);
-
- if (op == SYSCALL_TRAP)
- return read_memory_unsigned_integer (read_register (SP_REGNUM) + 4, 4);
- else
- return read_memory_unsigned_integer (read_register (SP_REGNUM), 4);
-}
-#endif /* SYSCALL_TRAP */
-
/* Function: m68k_gdbarch_init
Initializer function for the m68k gdbarch vector.
Called by gdbarch. Sets up the gdbarch vector(s) for this target. */
@@ -1103,12 +1058,7 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_long_double_format (gdbarch, &floatformat_m68881_ext);
set_gdbarch_long_double_bit (gdbarch, 96);
- set_gdbarch_function_start_offset (gdbarch, 0);
-
set_gdbarch_skip_prologue (gdbarch, m68k_skip_prologue);
-#ifdef SYSCALL_TRAP
- set_gdbarch_deprecated_saved_pc_after_call (gdbarch, m68k_saved_pc_after_call);
-#endif
set_gdbarch_breakpoint_from_pc (gdbarch, m68k_local_breakpoint_from_pc);
/* Stack grows down. */
@@ -1120,8 +1070,7 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_extract_return_value (gdbarch, m68k_extract_return_value);
set_gdbarch_store_return_value (gdbarch, m68k_store_return_value);
- set_gdbarch_extract_struct_value_address (gdbarch,
- m68k_extract_struct_value_address);
+ set_gdbarch_deprecated_extract_struct_value_address (gdbarch, m68k_extract_struct_value_address);
set_gdbarch_use_struct_convention (gdbarch, m68k_use_struct_convention);
set_gdbarch_frameless_function_invocation (gdbarch,
diff --git a/gdb/m68klinux-tdep.c b/gdb/m68klinux-tdep.c
index b39eebe..ed7e3ec 100644
--- a/gdb/m68klinux-tdep.c
+++ b/gdb/m68klinux-tdep.c
@@ -294,8 +294,7 @@ m68k_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
set_gdbarch_extract_return_value (gdbarch, m68k_linux_extract_return_value);
set_gdbarch_store_return_value (gdbarch, m68k_linux_store_return_value);
- set_gdbarch_extract_struct_value_address (gdbarch,
- m68k_linux_extract_struct_value_address);
+ set_gdbarch_deprecated_extract_struct_value_address (gdbarch, m68k_linux_extract_struct_value_address);
set_gdbarch_pc_in_sigtramp (gdbarch, m68k_linux_pc_in_sigtramp);
diff --git a/gdb/main.c b/gdb/main.c
index 2d552c0..9017a8a 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -1,7 +1,7 @@
/* Top level stuff for GDB, the GNU debugger.
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
- 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software
+ 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software
Foundation, Inc.
This file is part of GDB.
@@ -72,10 +72,10 @@ char *gdb_sysroot = 0;
struct ui_file *gdb_stdout;
struct ui_file *gdb_stderr;
struct ui_file *gdb_stdlog;
-struct ui_file *gdb_stdtarg;
struct ui_file *gdb_stdin;
/* target IO streams */
struct ui_file *gdb_stdtargin;
+struct ui_file *gdb_stdtarg;
struct ui_file *gdb_stdtargerr;
/* Whether to enable writing into executable and core files */
@@ -264,8 +264,6 @@ captured_main (void *data)
{"dbx", no_argument, &dbx_commands, 1},
{"readnow", no_argument, &readnow_symbol_files, 1},
{"r", no_argument, &readnow_symbol_files, 1},
- {"mapped", no_argument, &mapped_symbol_files, 1},
- {"m", no_argument, &mapped_symbol_files, 1},
{"quiet", no_argument, &quiet, 1},
{"q", no_argument, &quiet, 1},
{"silent", no_argument, &quiet, 1},
diff --git a/gdb/maint.c b/gdb/maint.c
index f7bb194..f105afa 100644
--- a/gdb/maint.c
+++ b/gdb/maint.c
@@ -1,6 +1,8 @@
/* Support for GDB maintenance commands.
- Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2003
- Free Software Foundation, Inc.
+
+ Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2001,
+ 2002, 2003, 2004 Free Software Foundation, Inc.
+
Written by Fred Fish at Cygnus Support.
This file is part of GDB.
@@ -54,8 +56,6 @@ static void maintenance_space_display (char *, int);
static void maintenance_info_command (char *, int);
-static void print_section_table (bfd *, asection *, void *);
-
static void maintenance_info_sections (char *, int);
static void maintenance_print_command (char *, int);
diff --git a/gdb/mcore-tdep.c b/gdb/mcore-tdep.c
index 598a0ac..5e08e25 100644
--- a/gdb/mcore-tdep.c
+++ b/gdb/mcore-tdep.c
@@ -1,5 +1,7 @@
/* Target-machine dependent code for Motorola MCore for GDB, the GNU debugger
- Copyright 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+
+ Copyright 1999, 2000, 2001, 2002, 2003, 2004 Free Software
+ Foundation, Inc.
This file is part of GDB.
@@ -917,16 +919,13 @@ mcore_push_return_address (CORE_ADDR pc, CORE_ADDR sp)
argument.
For gdb, this leaves us two routes, based on what
- USE_STRUCT_CONVENTION (mcore_use_struct_convention) returns.
- If this macro returns 1, gdb will call STORE_STRUCT_RETURN and
- EXTRACT_STRUCT_VALUE_ADDRESS.
-
- If USE_STRUCT_CONVENTION retruns 0, then gdb uses STORE_RETURN_VALUE
- and EXTRACT_RETURN_VALUE to store/fetch the functions return value. */
+ USE_STRUCT_CONVENTION (mcore_use_struct_convention) returns. If
+ this macro returns 1, gdb will call STORE_STRUCT_RETURN to store
+ the return value.
-/* Should we use EXTRACT_STRUCT_VALUE_ADDRESS instead of
- EXTRACT_RETURN_VALUE? GCC_P is true if compiled with gcc
- and TYPE is the type (which is known to be struct, union or array). */
+ If USE_STRUCT_CONVENTION returns 0, then gdb uses
+ STORE_RETURN_VALUE and EXTRACT_RETURN_VALUE to store/fetch the
+ functions return value. */
static int
mcore_use_struct_convention (int gcc_p, struct type *type)
@@ -934,16 +933,6 @@ mcore_use_struct_convention (int gcc_p, struct type *type)
return (TYPE_LENGTH (type) > 8);
}
-/* Where is the return value saved? For MCore, a pointer to
- this buffer was passed as a hidden first argument, so
- just return that address. */
-
-static CORE_ADDR
-mcore_extract_struct_value_address (char *regbuf)
-{
- return extract_unsigned_integer (regbuf + DEPRECATED_REGISTER_BYTE (FIRST_ARGREG), DEPRECATED_REGISTER_SIZE);
-}
-
/* Given a function which returns a value of type TYPE, extract the
the function's return value and place the result into VALBUF.
REGBUF is the register contents of the target. */
@@ -1071,8 +1060,6 @@ mcore_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, 0);
set_gdbarch_deprecated_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos);
set_gdbarch_deprecated_saved_pc_after_call (gdbarch, mcore_saved_pc_after_call);
- set_gdbarch_function_start_offset (gdbarch, 0);
- set_gdbarch_decr_pc_after_break (gdbarch, 0);
set_gdbarch_breakpoint_from_pc (gdbarch, mcore_breakpoint_from_pc);
set_gdbarch_deprecated_push_return_address (gdbarch, mcore_push_return_address);
set_gdbarch_deprecated_push_arguments (gdbarch, mcore_push_arguments);
@@ -1087,8 +1074,6 @@ mcore_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_deprecated_extract_return_value (gdbarch,
mcore_extract_return_value);
set_gdbarch_deprecated_store_struct_return (gdbarch, mcore_store_struct_return);
- set_gdbarch_deprecated_extract_struct_value_address (gdbarch,
- mcore_extract_struct_value_address);
set_gdbarch_skip_prologue (gdbarch, mcore_skip_prologue);
set_gdbarch_frame_args_skip (gdbarch, 0);
set_gdbarch_deprecated_frame_args_address (gdbarch, mcore_frame_args_address);
diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c
index 97794dc..a30959f 100644
--- a/gdb/mdebugread.c
+++ b/gdb/mdebugread.c
@@ -1,7 +1,9 @@
/* Read a symbol table in ECOFF format (Third-Eye).
- Copyright 1986, 1987, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
- 1997, 1998, 1999, 2000, 2001, 2002, 2003
- Free Software Foundation, Inc.
+
+ Copyright 1986, 1987, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
+ 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software
+ Foundation, Inc.
+
Original version contributed by Alessandro Forin (af@cs.cmu.edu) at
CMU. Major work by Per Bothner, John Gilmore and Ian Lance Taylor
at Cygnus Support.
@@ -426,7 +428,7 @@ mdebug_build_psymtabs (struct objfile *objfile,
char *fdr_end;
FDR *fdr_ptr;
- info->fdr = (FDR *) obstack_alloc (&objfile->psymbol_obstack,
+ info->fdr = (FDR *) obstack_alloc (&objfile->objfile_obstack,
(info->symbolic_header.ifdMax
* sizeof (FDR)));
fdr_src = info->external_fdr;
@@ -579,7 +581,7 @@ add_pending (FDR *fh, char *sh, struct type *t)
if (!p)
{
p = ((struct mdebug_pending *)
- obstack_alloc (&current_objfile->psymbol_obstack,
+ obstack_alloc (&current_objfile->objfile_obstack,
sizeof (struct mdebug_pending)));
p->s = sh;
p->t = t;
@@ -793,7 +795,8 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
else
{
t = parse_type (cur_fd, ax, sh->index + 1, 0, bigend, name);
- if (DEPRECATED_STREQ (name, "malloc") && TYPE_CODE (t) == TYPE_CODE_VOID)
+ if (strcmp (name, "malloc") == 0
+ && TYPE_CODE (t) == TYPE_CODE_VOID)
{
/* I don't know why, but, at least under Alpha GNU/Linux,
when linking against a malloc without debugging
@@ -1057,7 +1060,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
if (sh->iss == 0 || name[0] == '.' || name[0] == '\0')
TYPE_TAG_NAME (t) = NULL;
else
- TYPE_TAG_NAME (t) = obconcat (&current_objfile->symbol_obstack,
+ TYPE_TAG_NAME (t) = obconcat (&current_objfile->objfile_obstack,
"", "", name);
TYPE_CODE (t) = type_code;
@@ -1103,12 +1106,12 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
FIELD_STATIC_KIND (*f) = 0;
enum_sym = ((struct symbol *)
- obstack_alloc (&current_objfile->symbol_obstack,
+ obstack_alloc (&current_objfile->objfile_obstack,
sizeof (struct symbol)));
memset (enum_sym, 0, sizeof (struct symbol));
DEPRECATED_SYMBOL_NAME (enum_sym) =
obsavestring (f->name, strlen (f->name),
- &current_objfile->symbol_obstack);
+ &current_objfile->objfile_obstack);
SYMBOL_CLASS (enum_sym) = LOC_CONST;
SYMBOL_TYPE (enum_sym) = t;
SYMBOL_DOMAIN (enum_sym) = VAR_DOMAIN;
@@ -1201,7 +1204,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
SYMBOL_CLASS (s) = LOC_CONST;
SYMBOL_TYPE (s) = mdebug_type_void;
e = ((struct mips_extra_func_info *)
- obstack_alloc (&current_objfile->symbol_obstack,
+ obstack_alloc (&current_objfile->objfile_obstack,
sizeof (struct mips_extra_func_info)));
memset (e, 0, sizeof (struct mips_extra_func_info));
SYMBOL_VALUE (s) = (long) e;
@@ -1634,7 +1637,7 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs,
else if (TYPE_TAG_NAME (tp) == NULL
|| strcmp (TYPE_TAG_NAME (tp), name) != 0)
TYPE_TAG_NAME (tp) = obsavestring (name, strlen (name),
- &current_objfile->type_obstack);
+ &current_objfile->objfile_obstack);
}
}
@@ -1667,9 +1670,10 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs,
bad_tag_guess_complaint (sym_name);
TYPE_CODE (tp) = type_code;
}
- if (TYPE_NAME (tp) == NULL || !DEPRECATED_STREQ (TYPE_NAME (tp), name))
+ if (TYPE_NAME (tp) == NULL
+ || strcmp (TYPE_NAME (tp), name) != 0)
TYPE_NAME (tp) = obsavestring (name, strlen (name),
- &current_objfile->type_obstack);
+ &current_objfile->objfile_obstack);
}
}
if (t->bt == btTypedef)
@@ -1693,11 +1697,11 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs,
TYPE_FIELDS (tp) = ((struct field *)
TYPE_ALLOC (tp, 2 * sizeof (struct field)));
TYPE_FIELD_NAME (tp, 0) = obsavestring ("Low", strlen ("Low"),
- &current_objfile->type_obstack);
+ &current_objfile->objfile_obstack);
TYPE_FIELD_BITPOS (tp, 0) = AUX_GET_DNLOW (bigend, ax);
ax++;
TYPE_FIELD_NAME (tp, 1) = obsavestring ("High", strlen ("High"),
- &current_objfile->type_obstack);
+ &current_objfile->objfile_obstack);
TYPE_FIELD_BITPOS (tp, 1) = AUX_GET_DNHIGH (bigend, ax);
ax++;
}
@@ -1987,7 +1991,8 @@ parse_procedure (PDR *pr, struct symtab *search_symtab,
/* Correct incorrect setjmp procedure descriptor from the library
to make backtrace through setjmp work. */
- if (e->pdr.pcreg == 0 && DEPRECATED_STREQ (sh_name, "setjmp"))
+ if (e->pdr.pcreg == 0
+ && strcmp (sh_name, "setjmp") == 0)
{
complaint (&symfile_complaints, "fixing bad setjmp PDR from libc");
e->pdr.pcreg = RA_REGNUM;
@@ -2257,7 +2262,7 @@ parse_partial_symbols (struct objfile *objfile)
&& (bfd_get_section_flags (cur_bfd, text_sect) & SEC_RELOC))
relocatable = 1;
- extern_tab = (EXTR *) obstack_alloc (&objfile->psymbol_obstack,
+ extern_tab = (EXTR *) obstack_alloc (&objfile->objfile_obstack,
sizeof (EXTR) * hdr->iextMax);
includes_allocated = 30;
@@ -2301,7 +2306,7 @@ parse_partial_symbols (struct objfile *objfile)
/* Allocate the global pending list. */
pending_list =
((struct mdebug_pending **)
- obstack_alloc (&objfile->psymbol_obstack,
+ obstack_alloc (&objfile->objfile_obstack,
hdr->ifdMax * sizeof (struct mdebug_pending *)));
memset (pending_list, 0,
hdr->ifdMax * sizeof (struct mdebug_pending *));
@@ -2553,7 +2558,7 @@ parse_partial_symbols (struct objfile *objfile)
objfile->global_psymbols.next,
objfile->static_psymbols.next);
pst->read_symtab_private = ((char *)
- obstack_alloc (&objfile->psymbol_obstack,
+ obstack_alloc (&objfile->objfile_obstack,
sizeof (struct symloc)));
memset (pst->read_symtab_private, 0, sizeof (struct symloc));
@@ -2608,7 +2613,8 @@ parse_partial_symbols (struct objfile *objfile)
((char *) debug_info->external_sym
+ (fh->isymBase + 1) * external_sym_size),
&sh);
- if (DEPRECATED_STREQ (debug_info->ss + fh->issBase + sh.iss, stabs_symbol))
+ if (strcmp (debug_info->ss + fh->issBase + sh.iss,
+ stabs_symbol) == 0)
processing_gcc_compilation = 2;
}
@@ -2929,12 +2935,13 @@ parse_partial_symbols (struct objfile *objfile)
things like "break c-exp.y:435" need to work (I
suppose the psymtab_include_list could be hashed or put
in a binary tree, if profiling shows this is a major hog). */
- if (pst && DEPRECATED_STREQ (namestring, pst->filename))
+ if (pst && strcmp (namestring, pst->filename) == 0)
continue;
{
int i;
for (i = 0; i < includes_used; i++)
- if (DEPRECATED_STREQ (namestring, psymtab_include_list[i]))
+ if (strcmp (namestring,
+ psymtab_include_list[i]) == 0)
{
i = -1;
break;
@@ -3654,7 +3661,7 @@ parse_partial_symbols (struct objfile *objfile)
pst->number_of_dependencies = 0;
pst->dependencies =
((struct partial_symtab **)
- obstack_alloc (&objfile->psymbol_obstack,
+ obstack_alloc (&objfile->objfile_obstack,
((fh->crfd - 1)
* sizeof (struct partial_symtab *))));
for (s_idx = 1; s_idx < fh->crfd; s_idx++)
@@ -3861,8 +3868,8 @@ psymtab_to_symtab_1 (struct partial_symtab *pst, char *filename)
((char *) debug_info->external_sym
+ (fh->isymBase + 1) * external_sym_size),
&sh);
- if (DEPRECATED_STREQ (debug_info->ss + fh->issBase + sh.iss,
- stabs_symbol))
+ if (strcmp (debug_info->ss + fh->issBase + sh.iss,
+ stabs_symbol) == 0)
{
/* We indicate that this is a GCC compilation so that certain
features will be enabled in stabsread/dbxread. */
@@ -3941,7 +3948,7 @@ psymtab_to_symtab_1 (struct partial_symtab *pst, char *filename)
procedure specific info */
struct mips_extra_func_info *e =
((struct mips_extra_func_info *)
- obstack_alloc (&current_objfile->symbol_obstack,
+ obstack_alloc (&current_objfile->objfile_obstack,
sizeof (struct mips_extra_func_info)));
struct symbol *s = new_symbol (MIPS_EFI_SYMBOL_NAME);
@@ -4502,7 +4509,7 @@ add_line (struct linetable *lt, int lineno, CORE_ADDR adr, int last)
static int
compare_blocks (const void *arg1, const void *arg2)
{
- int addr_diff;
+ LONGEST addr_diff;
struct block **b1 = (struct block **) arg1;
struct block **b2 = (struct block **) arg2;
@@ -4585,7 +4592,7 @@ new_symtab (char *name, int maxlines, struct objfile *objfile)
s->free_code = free_linetable;
s->debugformat = obsavestring ("ECOFF", 5,
- &objfile->symbol_obstack);
+ &objfile->objfile_obstack);
return (s);
}
@@ -4602,7 +4609,7 @@ new_psymtab (char *name, struct objfile *objfile)
/* Keep a backpointer to the file's symbols */
psymtab->read_symtab_private = ((char *)
- obstack_alloc (&objfile->psymbol_obstack,
+ obstack_alloc (&objfile->objfile_obstack,
sizeof (struct symloc)));
memset (psymtab->read_symtab_private, 0, sizeof (struct symloc));
CUR_BFD (psymtab) = cur_bfd;
@@ -4690,7 +4697,7 @@ static struct symbol *
new_symbol (char *name)
{
struct symbol *s = ((struct symbol *)
- obstack_alloc (&current_objfile->symbol_obstack,
+ obstack_alloc (&current_objfile->objfile_obstack,
sizeof (struct symbol)));
memset (s, 0, sizeof (*s));
@@ -4733,7 +4740,7 @@ elfmdebug_build_psymtabs (struct objfile *objfile,
back_to = make_cleanup_discard_minimal_symbols ();
info = ((struct ecoff_debug_info *)
- obstack_alloc (&objfile->psymbol_obstack,
+ obstack_alloc (&objfile->objfile_obstack,
sizeof (struct ecoff_debug_info)));
if (!(*swap->read_debug_info) (abfd, sec, info))
diff --git a/gdb/mi/mi-cmd-env.c b/gdb/mi/mi-cmd-env.c
index ec0fa35..439c719 100644
--- a/gdb/mi/mi-cmd-env.c
+++ b/gdb/mi/mi-cmd-env.c
@@ -1,6 +1,6 @@
/* MI Command Set - environment commands.
- Copyright 2002, 2003 Free Software Foundation, Inc.
+ Copyright 2002, 2003, 2004 Free Software Foundation, Inc.
Contributed by Red Hat Inc.
@@ -37,7 +37,6 @@
#include "gdb_string.h"
#include "gdb_stat.h"
-static void env_cli_command (const char *cli, const char *args);
static void env_mod_path (char *dirname, char **which_path);
extern void _initialize_mi_cmd_env (void);
diff --git a/gdb/mi/mi-cmd-stack.c b/gdb/mi/mi-cmd-stack.c
index 6330cda..7db9ffb 100644
--- a/gdb/mi/mi-cmd-stack.c
+++ b/gdb/mi/mi-cmd-stack.c
@@ -1,5 +1,5 @@
/* MI Command Set - stack commands.
- Copyright 2000, 2002, 2003 Free Software Foundation, Inc.
+ Copyright 2000, 2002, 2003, 2004 Free Software Foundation, Inc.
Contributed by Cygnus Solutions (a Red Hat company).
This file is part of GDB.
@@ -29,6 +29,7 @@
#include "block.h"
#include "stack.h"
#include "dictionary.h"
+#include "gdb_string.h"
static void list_args_or_locals (int locals, int values, struct frame_info *fi);
@@ -137,10 +138,26 @@ mi_cmd_stack_info_depth (char *command, char **argv, int argc)
enum mi_cmd_result
mi_cmd_stack_list_locals (char *command, char **argv, int argc)
{
+ struct frame_info *frame;
+ enum print_values print_values;
+
if (argc != 1)
error ("mi_cmd_stack_list_locals: Usage: PRINT_VALUES");
- list_args_or_locals (1, atoi (argv[0]), deprecated_selected_frame);
+ frame = get_selected_frame ();
+
+ if (strcmp (argv[0], "0") == 0
+ || strcmp (argv[0], "--no-values") == 0)
+ print_values = PRINT_NO_VALUES;
+ else if (strcmp (argv[0], "1") == 0
+ || strcmp (argv[0], "--all-values") == 0)
+ print_values = PRINT_ALL_VALUES;
+ else if (strcmp (argv[0], "2") == 0
+ || strcmp (argv[0], "--simple-values") == 0)
+ print_values = PRINT_SIMPLE_VALUES;
+ else
+ error ("Unknown value for PRINT_VALUES: must be: 0 or \"--no-values\", 1 or \"--all-values\", 2 or \"--simple-values\"");
+ list_args_or_locals (1, print_values, frame);
return MI_CMD_DONE;
}
@@ -218,6 +235,7 @@ list_args_or_locals (int locals, int values, struct frame_info *fi)
int nsyms;
struct cleanup *cleanup_list;
static struct ui_stream *stb = NULL;
+ struct type *type;
stb = ui_out_stream_new (uiout);
@@ -268,24 +286,39 @@ list_args_or_locals (int locals, int values, struct frame_info *fi)
if (print_me)
{
struct cleanup *cleanup_tuple = NULL;
- if (values)
- cleanup_tuple =
+ struct symbol *sym2;
+ if (values != PRINT_NO_VALUES)
+ cleanup_tuple =
make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
- ui_out_field_string (uiout, "name", DEPRECATED_SYMBOL_NAME (sym));
+ ui_out_field_string (uiout, "name", SYMBOL_PRINT_NAME (sym));
- if (values)
- {
- struct symbol *sym2;
- if (!locals)
- sym2 = lookup_symbol (DEPRECATED_SYMBOL_NAME (sym),
- block, VAR_DOMAIN,
- (int *) NULL,
- (struct symtab **) NULL);
- else
+ if (!locals)
+ sym2 = lookup_symbol (SYMBOL_NATURAL_NAME (sym),
+ block, VAR_DOMAIN,
+ (int *) NULL,
+ (struct symtab **) NULL);
+ else
sym2 = sym;
+ switch (values)
+ {
+ case PRINT_SIMPLE_VALUES:
+ type = check_typedef (sym2->type);
+ type_print (sym2->type, "", stb->stream, -1);
+ ui_out_field_stream (uiout, "type", stb);
+ if (TYPE_CODE (type) != TYPE_CODE_ARRAY
+ && TYPE_CODE (type) != TYPE_CODE_STRUCT
+ && TYPE_CODE (type) != TYPE_CODE_UNION)
+ {
+ print_variable_value (sym2, fi, stb->stream);
+ ui_out_field_stream (uiout, "value", stb);
+ }
+ do_cleanups (cleanup_tuple);
+ break;
+ case PRINT_ALL_VALUES:
print_variable_value (sym2, fi, stb->stream);
ui_out_field_stream (uiout, "value", stb);
do_cleanups (cleanup_tuple);
+ break;
}
}
}
diff --git a/gdb/mi/mi-cmd-var.c b/gdb/mi/mi-cmd-var.c
index 114531c..709ed301 100644
--- a/gdb/mi/mi-cmd-var.c
+++ b/gdb/mi/mi-cmd-var.c
@@ -1,6 +1,6 @@
/* MI Command Set - varobj commands.
- Copyright 2000, 2002 Free Software Foundation, Inc.
+ Copyright 2000, 2002, 2004 Free Software Foundation, Inc.
Contributed by Cygnus Solutions (a Red Hat company).
@@ -257,17 +257,29 @@ mi_cmd_var_list_children (char *command, char **argv, int argc)
struct cleanup *cleanup_children;
int numchild;
char *type;
+ enum print_values print_values;
- if (argc != 1)
- error ("mi_cmd_var_list_children: Usage: NAME.");
+ if (argc != 1 && argc != 2)
+ error ("mi_cmd_var_list_children: Usage: [PRINT_VALUES] NAME");
/* Get varobj handle, if a valid var obj name was specified */
- var = varobj_get_handle (argv[0]);
+ if (argc == 1) var = varobj_get_handle (argv[0]);
+ else var = varobj_get_handle (argv[1]);
if (var == NULL)
- error ("mi_cmd_var_list_children: Variable object not found");
+ error ("Variable object not found");
numchild = varobj_list_children (var, &childlist);
ui_out_field_int (uiout, "numchild", numchild);
+ if (argc == 2)
+ if (strcmp (argv[0], "0") == 0
+ || strcmp (argv[0], "--no-values") == 0)
+ print_values = PRINT_NO_VALUES;
+ else if (strcmp (argv[0], "1") == 0
+ || strcmp (argv[0], "--all-values") == 0)
+ print_values = PRINT_ALL_VALUES;
+ else
+ error ("Unknown value for PRINT_VALUES: must be: 0 or \"--no-values\", 1 or \"--all-values\"");
+ else print_values = PRINT_NO_VALUES;
if (numchild <= 0)
return MI_CMD_DONE;
@@ -284,6 +296,8 @@ mi_cmd_var_list_children (char *command, char **argv, int argc)
ui_out_field_string (uiout, "name", varobj_get_objname (*cc));
ui_out_field_string (uiout, "exp", varobj_get_expression (*cc));
ui_out_field_int (uiout, "numchild", varobj_get_num_children (*cc));
+ if (print_values)
+ ui_out_field_string (uiout, "value", varobj_get_value (*cc));
type = varobj_get_type (*cc);
/* C++ pseudo-variables (public, private, protected) do not have a type */
if (type)
diff --git a/gdb/mi/mi-cmds.h b/gdb/mi/mi-cmds.h
index efcf0b5..5453059 100644
--- a/gdb/mi/mi-cmds.h
+++ b/gdb/mi/mi-cmds.h
@@ -1,6 +1,6 @@
/* MI Command Set for GDB, the GNU debugger.
- Copyright 2000, 2003 Free Software Foundation, Inc.
+ Copyright 2000, 2003, 2004 Free Software Foundation, Inc.
Contributed by Cygnus Solutions (a Red Hat company).
@@ -48,6 +48,12 @@ enum mi_cmd_result
MI_CMD_QUIET
};
+enum print_values {
+ PRINT_NO_VALUES,
+ PRINT_ALL_VALUES,
+ PRINT_SIMPLE_VALUES
+};
+
typedef enum mi_cmd_result (mi_cmd_argv_ftype) (char *command, char **argv, int argc);
/* Older MI commands have this interface. Retained until all old
diff --git a/gdb/mi/mi-interp.c b/gdb/mi/mi-interp.c
index b72d7ef..08201ca 100644
--- a/gdb/mi/mi-interp.c
+++ b/gdb/mi/mi-interp.c
@@ -1,6 +1,6 @@
/* MI Interpreter Definitions and Commands for GDB, the GNU debugger.
- Copyright 2002, 2003 Free Software Foundation, Inc.
+ Copyright 2002, 2003, 2003 Free Software Foundation, Inc.
This file is part of GDB.
@@ -57,8 +57,6 @@ static char *mi_input (char *);
so we can report interesting things that happened "behind the mi's
back" in this command */
static int mi_interp_query_hook (const char *ctlstr, va_list ap);
-static char *mi_interp_read_one_line_hook (char *prompt, int repeat,
- char *anno);
static void mi3_command_loop (void);
static void mi2_command_loop (void);
@@ -299,25 +297,6 @@ mi_interp_query_hook (const char *ctlstr, va_list ap)
return 1;
}
-static char *
-mi_interp_read_one_line_hook (char *prompt, int repeat, char *anno)
-{
- static char buff[256];
- printf_unfiltered ("=read-one-line,prompt=\"%s\"\n", prompt);
- gdb_flush (gdb_stdout);
- (void) fgets (buff, sizeof (buff), stdin);
- buff[(strlen (buff) - 1)] = 0;
- return buff;
-}
-
-static void
-output_control_change_notification (char *notification)
-{
- printf_unfiltered ("^");
- printf_unfiltered ("%s\n", notification);
- gdb_flush (gdb_stdout);
-}
-
static void
mi_execute_command_wrapper (char *cmd)
{
diff --git a/gdb/mi/mi-out.c b/gdb/mi/mi-out.c
index 637ceb4..2be9d17 100644
--- a/gdb/mi/mi-out.c
+++ b/gdb/mi/mi-out.c
@@ -1,6 +1,6 @@
/* MI Command Set - output generating routines.
- Copyright 2000, 2002, 2003 Free Software Foundation, Inc.
+ Copyright 2000, 2002, 2003, 2004 Free Software Foundation, Inc.
Contributed by Cygnus Solutions (a Red Hat company).
@@ -98,9 +98,6 @@ static void mi_open (struct ui_out *uiout, const char *name,
enum ui_out_type type);
static void mi_close (struct ui_out *uiout, enum ui_out_type type);
-static void out_field_fmt (struct ui_out *uiout, int fldno, char *fldname,
- char *format,...);
-
/* Mark beginning of a table */
void
@@ -290,31 +287,6 @@ mi_flush (struct ui_out *uiout)
/* local functions */
-/* Like mi_field_fmt, but takes a variable number of args
- and makes a va_list and does not insert a separator */
-
-/* VARARGS */
-static void
-out_field_fmt (struct ui_out *uiout, int fldno, char *fldname,
- char *format,...)
-{
- mi_out_data *data = ui_out_data (uiout);
- va_list args;
-
- field_separator (uiout);
- if (fldname)
- fprintf_unfiltered (data->buffer, "%s=\"", fldname);
- else
- fputs_unfiltered ("\"", data->buffer);
-
- va_start (args, format);
- vfprintf_unfiltered (data->buffer, format, args);
-
- fputs_unfiltered ("\"", data->buffer);
-
- va_end (args);
-}
-
/* access to ui_out format private members */
static void
diff --git a/gdb/minsyms.c b/gdb/minsyms.c
index df35956..74b867d 100644
--- a/gdb/minsyms.c
+++ b/gdb/minsyms.c
@@ -1,6 +1,6 @@
/* GDB routines for manipulating the minimal symbol tables.
Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
- 2002, 2003
+ 2002, 2003, 2004
Free Software Foundation, Inc.
Contributed by Cygnus Support, using pieces from other GDB modules.
@@ -714,7 +714,7 @@ make_cleanup_discard_minimal_symbols (void)
Note that we are not concerned here about recovering the space that
is potentially freed up, because the strings themselves are allocated
- on the symbol_obstack, and will get automatically freed when the symbol
+ on the objfile_obstack, and will get automatically freed when the symbol
table is freed. The caller can free up the unused minimal symbols at
the end of the compacted region if their allocation strategy allows it.
@@ -832,10 +832,10 @@ install_minimal_symbols (struct objfile *objfile)
we will give back the excess space. */
alloc_count = msym_count + objfile->minimal_symbol_count + 1;
- obstack_blank (&objfile->symbol_obstack,
+ obstack_blank (&objfile->objfile_obstack,
alloc_count * sizeof (struct minimal_symbol));
msymbols = (struct minimal_symbol *)
- obstack_base (&objfile->symbol_obstack);
+ obstack_base (&objfile->objfile_obstack);
/* Copy in the existing minimal symbols, if there are any. */
@@ -875,10 +875,10 @@ install_minimal_symbols (struct objfile *objfile)
mcount = compact_minimal_symbols (msymbols, mcount, objfile);
- obstack_blank (&objfile->symbol_obstack,
+ obstack_blank (&objfile->objfile_obstack,
(mcount + 1 - alloc_count) * sizeof (struct minimal_symbol));
msymbols = (struct minimal_symbol *)
- obstack_finish (&objfile->symbol_obstack);
+ obstack_finish (&objfile->objfile_obstack);
/* We also terminate the minimal symbol table with a "null symbol",
which is *not* included in the size of the table. This makes it
@@ -896,7 +896,7 @@ install_minimal_symbols (struct objfile *objfile)
SYMBOL_INIT_LANGUAGE_SPECIFIC (&msymbols[mcount], language_unknown);
/* Attach the minimal symbol table to the specified objfile.
- The strings themselves are also located in the symbol_obstack
+ The strings themselves are also located in the objfile_obstack
of this objfile. */
objfile->minimal_symbol_count = mcount;
diff --git a/gdb/mips-linux-nat.c b/gdb/mips-linux-nat.c
index 197f7e9..f5071ad 100644
--- a/gdb/mips-linux-nat.c
+++ b/gdb/mips-linux-nat.c
@@ -20,6 +20,7 @@
Boston, MA 02111-1307, USA. */
#include "defs.h"
+#include "mips-tdep.h"
/* Pseudo registers can not be read. ptrace does not provide a way to
read (or set) PS_REGNUM, and there's no point in reading or setting
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index fafac66..ee23f4a 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -81,10 +81,10 @@ static const char *mips_abi_strings[] = {
};
struct frame_extra_info
- {
- mips_extra_func_info_t proc_desc;
- int num_args;
- };
+{
+ mips_extra_func_info_t proc_desc;
+ int num_args;
+};
/* Various MIPS ISA options (related to stack analysis) can be
overridden dynamically. Establish an enum/array for managing
@@ -106,11 +106,11 @@ static const char *size_enums[] = {
FP_REGISTER_DOUBLE. */
enum mips_fpu_type
- {
- MIPS_FPU_DOUBLE, /* Full double precision floating point. */
- MIPS_FPU_SINGLE, /* Single precision floating point (R4650). */
- MIPS_FPU_NONE /* No floating point. */
- };
+{
+ MIPS_FPU_DOUBLE, /* Full double precision floating point. */
+ MIPS_FPU_SINGLE, /* Single precision floating point (R4650). */
+ MIPS_FPU_NONE /* No floating point. */
+};
#ifndef MIPS_DEFAULT_FPU_TYPE
#define MIPS_DEFAULT_FPU_TYPE MIPS_FPU_DOUBLE
@@ -122,30 +122,30 @@ static int mips_debug = 0;
/* MIPS specific per-architecture information */
struct gdbarch_tdep
- {
- /* from the elf header */
- int elf_flags;
-
- /* mips options */
- enum mips_abi mips_abi;
- enum mips_abi found_abi;
- enum mips_fpu_type mips_fpu_type;
- int mips_last_arg_regnum;
- int mips_last_fp_arg_regnum;
- int mips_default_saved_regsize;
- int mips_fp_register_double;
- int mips_default_stack_argsize;
- int default_mask_address_p;
- /* Is the target using 64-bit raw integer registers but only
- storing a left-aligned 32-bit value in each? */
- int mips64_transfers_32bit_regs_p;
- /* Indexes for various registers. IRIX and embedded have
- different values. This contains the "public" fields. Don't
- add any that do not need to be public. */
- const struct mips_regnum *regnum;
- /* Register names table for the current register set. */
- const char **mips_processor_reg_names;
- };
+{
+ /* from the elf header */
+ int elf_flags;
+
+ /* mips options */
+ enum mips_abi mips_abi;
+ enum mips_abi found_abi;
+ enum mips_fpu_type mips_fpu_type;
+ int mips_last_arg_regnum;
+ int mips_last_fp_arg_regnum;
+ int mips_default_saved_regsize;
+ int mips_fp_register_double;
+ int mips_default_stack_argsize;
+ int default_mask_address_p;
+ /* Is the target using 64-bit raw integer registers but only
+ storing a left-aligned 32-bit value in each? */
+ int mips64_transfers_32bit_regs_p;
+ /* Indexes for various registers. IRIX and embedded have
+ different values. This contains the "public" fields. Don't
+ add any that do not need to be public. */
+ const struct mips_regnum *regnum;
+ /* Register names table for the current register set. */
+ const char **mips_processor_reg_names;
+};
const struct mips_regnum *
mips_regnum (struct gdbarch *gdbarch)
@@ -196,7 +196,8 @@ read_signed_register (int regnum)
{
void *buf = alloca (register_size (current_gdbarch, regnum));
deprecated_read_register_gen (regnum, buf);
- return (extract_signed_integer (buf, register_size (current_gdbarch, regnum)));
+ return (extract_signed_integer
+ (buf, register_size (current_gdbarch, regnum)));
}
static LONGEST
@@ -244,7 +245,7 @@ mips_saved_regsize (struct gdbarch_tdep *tdep)
return tdep->mips_default_saved_regsize;
else if (mips_saved_regsize_string == size_64)
return 8;
- else /* if (mips_saved_regsize_string == size_32) */
+ else /* if (mips_saved_regsize_string == size_32) */
return 4;
}
@@ -259,14 +260,14 @@ mips_saved_regsize (struct gdbarch_tdep *tdep)
MSYMBOL_IS_SPECIAL tests the "special" bit in a minimal symbol */
static void
-mips_elf_make_msymbol_special (asymbol *sym, struct minimal_symbol *msym)
-{
- if (((elf_symbol_type *)(sym))->internal_elf_sym.st_other == STO_MIPS16)
- {
- MSYMBOL_INFO (msym) = (char *)
- (((long) MSYMBOL_INFO (msym)) | 0x80000000);
- SYMBOL_VALUE_ADDRESS (msym) |= 1;
- }
+mips_elf_make_msymbol_special (asymbol * sym, struct minimal_symbol *msym)
+{
+ if (((elf_symbol_type *) (sym))->internal_elf_sym.st_other == STO_MIPS16)
+ {
+ MSYMBOL_INFO (msym) = (char *)
+ (((long) MSYMBOL_INFO (msym)) | 0x80000000);
+ SYMBOL_VALUE_ADDRESS (msym) |= 1;
+ }
}
static int
@@ -282,8 +283,8 @@ msymbol_is_special (struct minimal_symbol *msym)
static void
mips_xfer_register (struct regcache *regcache, int reg_num, int length,
- enum bfd_endian endian, bfd_byte *in, const bfd_byte *out,
- int buf_offset)
+ enum bfd_endian endian, bfd_byte * in,
+ const bfd_byte * out, int buf_offset)
{
bfd_byte reg[MAX_REGISTER_SIZE];
int reg_offset = 0;
@@ -298,7 +299,7 @@ mips_xfer_register (struct regcache *regcache, int reg_num, int length,
case BFD_ENDIAN_LITTLE:
reg_offset = 0;
break;
- case BFD_ENDIAN_UNKNOWN: /* Indicates no alignment. */
+ case BFD_ENDIAN_UNKNOWN: /* Indicates no alignment. */
reg_offset = 0;
break;
default:
@@ -316,9 +317,11 @@ mips_xfer_register (struct regcache *regcache, int reg_num, int length,
fprintf_unfiltered (gdb_stdlog, "%02x", out[buf_offset + i]);
}
if (in != NULL)
- regcache_cooked_read_part (regcache, reg_num, reg_offset, length, in + buf_offset);
+ regcache_cooked_read_part (regcache, reg_num, reg_offset, length,
+ in + buf_offset);
if (out != NULL)
- regcache_cooked_write_part (regcache, reg_num, reg_offset, length, out + buf_offset);
+ regcache_cooked_write_part (regcache, reg_num, reg_offset, length,
+ out + buf_offset);
if (mips_debug && in != NULL)
{
int i;
@@ -339,7 +342,8 @@ mips2_fp_compat (void)
{
/* MIPS1 and MIPS2 have only 32 bit FPRs, and the FR bit is not
meaningful. */
- if (register_size (current_gdbarch, mips_regnum (current_gdbarch)->fp0) == 4)
+ if (register_size (current_gdbarch, mips_regnum (current_gdbarch)->fp0) ==
+ 4)
return 0;
#if 0
@@ -373,7 +377,7 @@ mips_stack_argsize (struct gdbarch_tdep *tdep)
return tdep->mips_default_stack_argsize;
else if (mips_stack_argsize_string == size_64)
return 8;
- else /* if (mips_stack_argsize_string == size_32) */
+ else /* if (mips_stack_argsize_string == size_32) */
return 4;
}
@@ -407,54 +411,55 @@ static struct cmd_list_element *showmipscmdlist = NULL;
mips_register_name(). Processor specific registers 32 and above
are listed in the followign tables. */
-enum { NUM_MIPS_PROCESSOR_REGS = (90 - 32) };
+enum
+{ NUM_MIPS_PROCESSOR_REGS = (90 - 32) };
/* Generic MIPS. */
static const char *mips_generic_reg_names[NUM_MIPS_PROCESSOR_REGS] = {
- "sr", "lo", "hi", "bad", "cause","pc",
- "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7",
- "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15",
- "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23",
- "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31",
- "fsr", "fir", ""/*"fp"*/, "",
- "", "", "", "", "", "", "", "",
- "", "", "", "", "", "", "", "",
+ "sr", "lo", "hi", "bad", "cause", "pc",
+ "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7",
+ "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15",
+ "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23",
+ "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31",
+ "fsr", "fir", "" /*"fp" */ , "",
+ "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "",
};
/* Names of IDT R3041 registers. */
static const char *mips_r3041_reg_names[] = {
- "sr", "lo", "hi", "bad", "cause","pc",
- "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7",
- "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15",
- "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23",
- "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31",
- "fsr", "fir", "",/*"fp"*/ "",
- "", "", "bus", "ccfg", "", "", "", "",
- "", "", "port", "cmp", "", "", "epc", "prid",
+ "sr", "lo", "hi", "bad", "cause", "pc",
+ "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7",
+ "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15",
+ "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23",
+ "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31",
+ "fsr", "fir", "", /*"fp" */ "",
+ "", "", "bus", "ccfg", "", "", "", "",
+ "", "", "port", "cmp", "", "", "epc", "prid",
};
/* Names of tx39 registers. */
static const char *mips_tx39_reg_names[NUM_MIPS_PROCESSOR_REGS] = {
- "sr", "lo", "hi", "bad", "cause","pc",
- "", "", "", "", "", "", "", "",
- "", "", "", "", "", "", "", "",
- "", "", "", "", "", "", "", "",
- "", "", "", "", "", "", "", "",
- "", "", "", "",
- "", "", "", "", "", "", "", "",
- "", "", "config", "cache", "debug", "depc", "epc", ""
+ "sr", "lo", "hi", "bad", "cause", "pc",
+ "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "",
+ "", "", "", "",
+ "", "", "", "", "", "", "", "",
+ "", "", "config", "cache", "debug", "depc", "epc", ""
};
/* Names of IRIX registers. */
static const char *mips_irix_reg_names[NUM_MIPS_PROCESSOR_REGS] = {
- "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7",
- "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15",
- "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23",
- "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31",
- "pc", "cause", "bad", "hi", "lo", "fsr", "fir"
+ "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7",
+ "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15",
+ "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23",
+ "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31",
+ "pc", "cause", "bad", "hi", "lo", "fsr", "fir"
};
@@ -465,18 +470,18 @@ mips_register_name (int regno)
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
/* GPR names for all ABIs other than n32/n64. */
static char *mips_gpr_names[] = {
- "zero", "at", "v0", "v1", "a0", "a1", "a2", "a3",
- "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7",
- "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7",
- "t8", "t9", "k0", "k1", "gp", "sp", "s8", "ra",
+ "zero", "at", "v0", "v1", "a0", "a1", "a2", "a3",
+ "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7",
+ "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7",
+ "t8", "t9", "k0", "k1", "gp", "sp", "s8", "ra",
};
/* GPR names for n32 and n64 ABIs. */
static char *mips_n32_n64_gpr_names[] = {
- "zero", "at", "v0", "v1", "a0", "a1", "a2", "a3",
- "a4", "a5", "a6", "a7", "t0", "t1", "t2", "t3",
- "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7",
- "t8", "t9", "k0", "k1", "gp", "sp", "s8", "ra"
+ "zero", "at", "v0", "v1", "a0", "a1", "a2", "a3",
+ "a4", "a5", "a6", "a7", "t0", "t1", "t2", "t3",
+ "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7",
+ "t8", "t9", "k0", "k1", "gp", "sp", "s8", "ra"
};
enum mips_abi abi = mips_abi (current_gdbarch);
@@ -525,8 +530,7 @@ mips_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
/* FIXME: cagney/2003-04-13: Can't yet use gdbarch_num_regs
(gdbarch), as not all architectures are multi-arch. */
raw_p = rawnum < NUM_REGS;
- if (REGISTER_NAME (regnum) == NULL
- || REGISTER_NAME (regnum)[0] == '\0')
+ if (REGISTER_NAME (regnum) == NULL || REGISTER_NAME (regnum)[0] == '\0')
return 0;
if (reggroup == float_reggroup)
return float_p && pseudo;
@@ -542,7 +546,7 @@ mips_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
/* Restore the same pseudo register. */
if (reggroup == restore_reggroup)
return raw_p && pseudo;
- return 0;
+ return 0;
}
/* Map the symbol table registers which live in the range [1 *
@@ -557,7 +561,8 @@ mips_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
gdb_assert (cookednum >= NUM_REGS && cookednum < 2 * NUM_REGS);
if (register_size (gdbarch, rawnum) == register_size (gdbarch, cookednum))
regcache_raw_read (regcache, rawnum, buf);
- else if (register_size (gdbarch, rawnum) > register_size (gdbarch, cookednum))
+ else if (register_size (gdbarch, rawnum) >
+ register_size (gdbarch, cookednum))
{
if (gdbarch_tdep (gdbarch)->mips64_transfers_32bit_regs_p
|| TARGET_BYTE_ORDER == BFD_ENDIAN_LITTLE)
@@ -570,14 +575,16 @@ mips_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
}
static void
-mips_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
- int cookednum, const void *buf)
+mips_pseudo_register_write (struct gdbarch *gdbarch,
+ struct regcache *regcache, int cookednum,
+ const void *buf)
{
int rawnum = cookednum % NUM_REGS;
gdb_assert (cookednum >= NUM_REGS && cookednum < 2 * NUM_REGS);
if (register_size (gdbarch, rawnum) == register_size (gdbarch, cookednum))
regcache_raw_write (regcache, rawnum, buf);
- else if (register_size (gdbarch, rawnum) > register_size (gdbarch, cookednum))
+ else if (register_size (gdbarch, rawnum) >
+ register_size (gdbarch, cookednum))
{
if (gdbarch_tdep (gdbarch)->mips64_transfers_32bit_regs_p
|| TARGET_BYTE_ORDER == BFD_ENDIAN_LITTLE)
@@ -590,8 +597,7 @@ mips_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
}
/* Table to translate MIPS16 register field to actual register number. */
-static int mips16_to_32_reg[8] =
-{16, 17, 2, 3, 4, 5, 6, 7};
+static int mips16_to_32_reg[8] = { 16, 17, 2, 3, 4, 5, 6, 7 };
/* Heuristic_proc_start may hunt through the text section for a long
time across a 2400 baud serial line. Allows the user to limit this
@@ -617,10 +623,10 @@ static unsigned int heuristic_fence_post = 0;
#define SET_PROC_DESC_IS_DUMMY(proc) ((proc)->pdr.isym = _PROC_MAGIC_)
struct linked_proc_info
- {
- struct mips_extra_func_info info;
- struct linked_proc_info *next;
- }
+{
+ struct mips_extra_func_info info;
+ struct linked_proc_info *next;
+}
*linked_proc_desc_table = NULL;
/* Number of bytes of storage in the actual machine representation for
@@ -652,9 +658,9 @@ mips_convert_register_p (int regnum, struct type *type)
{
return (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG
&& register_size (current_gdbarch, regnum) == 4
- && (regnum) >= mips_regnum (current_gdbarch)->fp0 && (regnum) < mips_regnum (current_gdbarch)->fp0 + 32
- && TYPE_CODE(type) == TYPE_CODE_FLT
- && TYPE_LENGTH(type) == 8);
+ && (regnum % NUM_REGS) >= mips_regnum (current_gdbarch)->fp0
+ && (regnum % NUM_REGS) < mips_regnum (current_gdbarch)->fp0 + 32
+ && TYPE_CODE (type) == TYPE_CODE_FLT && TYPE_LENGTH (type) == 8);
}
static void
@@ -702,7 +708,8 @@ mips_register_type (struct gdbarch *gdbarch, int regnum)
internal_error (__FILE__, __LINE__, "bad switch");
}
}
- else if (regnum >= (NUM_REGS + mips_regnum (current_gdbarch)->fp_control_status)
+ else if (regnum >=
+ (NUM_REGS + mips_regnum (current_gdbarch)->fp_control_status)
&& regnum <= NUM_REGS + LAST_EMBED_REGNUM)
/* The pseudo/cooked view of the embedded registers is always
32-bit. The raw view is handled below. */
@@ -745,8 +752,7 @@ mips_mask_address_p (struct gdbarch_tdep *tdep)
case AUTO_BOOLEAN_AUTO:
return tdep->default_mask_address_p;
default:
- internal_error (__FILE__, __LINE__,
- "mips_mask_address_p: bad switch");
+ internal_error (__FILE__, __LINE__, "mips_mask_address_p: bad switch");
return -1;
}
}
@@ -764,42 +770,16 @@ show_mask_address (char *cmd, int from_tty, struct cmd_list_element *c)
printf_filtered ("The 32 bit mips address mask is disabled\n");
break;
case AUTO_BOOLEAN_AUTO:
- printf_filtered ("The 32 bit address mask is set automatically. Currently %s\n",
- mips_mask_address_p (tdep) ? "enabled" : "disabled");
+ printf_filtered
+ ("The 32 bit address mask is set automatically. Currently %s\n",
+ mips_mask_address_p (tdep) ? "enabled" : "disabled");
break;
default:
- internal_error (__FILE__, __LINE__,
- "show_mask_address: bad switch");
+ internal_error (__FILE__, __LINE__, "show_mask_address: bad switch");
break;
}
}
-/* Should call_function allocate stack space for a struct return? */
-
-static int
-mips_eabi_use_struct_convention (int gcc_p, struct type *type)
-{
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
- return (TYPE_LENGTH (type) > 2 * mips_saved_regsize (tdep));
-}
-
-/* Should call_function pass struct by reference?
- For each architecture, structs are passed either by
- value or by reference, depending on their size. */
-
-static int
-mips_eabi_reg_struct_has_addr (int gcc_p, struct type *type)
-{
- enum type_code typecode = TYPE_CODE (check_typedef (type));
- int len = TYPE_LENGTH (check_typedef (type));
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
-
- if (typecode == TYPE_CODE_STRUCT || typecode == TYPE_CODE_UNION)
- return (len > mips_saved_regsize (tdep));
-
- return 0;
-}
-
/* Tell if the program counter value in MEMADDR is in a MIPS16 function. */
static int
@@ -827,15 +807,20 @@ pc_is_mips16 (bfd_vma memaddr)
static CORE_ADDR
mips_read_pc (ptid_t ptid)
{
- return read_signed_register_pid (PC_REGNUM, ptid);
+ return read_signed_register_pid (mips_regnum (current_gdbarch)->pc, ptid);
+}
+
+static void
+mips_write_pc (CORE_ADDR pc, ptid_t ptid)
+{
+ write_register_pid (mips_regnum (current_gdbarch)->pc, pc, ptid);
}
/* This returns the PC of the first inst after the prologue. If we can't
find the prologue, then return 0. */
static CORE_ADDR
-after_prologue (CORE_ADDR pc,
- mips_extra_func_info_t proc_desc)
+after_prologue (CORE_ADDR pc, mips_extra_func_info_t proc_desc)
{
struct symtab_and_line sal;
CORE_ADDR func_addr, func_end;
@@ -882,7 +867,7 @@ mips32_decode_reg_save (t_inst inst, unsigned long *gen_mask,
{
int reg;
- if ((inst & 0xffe00000) == 0xafa00000 /* sw reg,n($sp) */
+ if ((inst & 0xffe00000) == 0xafa00000 /* sw reg,n($sp) */
|| (inst & 0xffe00000) == 0xafc00000 /* sw reg,n($r30) */
|| (inst & 0xffe00000) == 0xffa00000) /* sd reg,n($sp) */
{
@@ -895,7 +880,7 @@ mips32_decode_reg_save (t_inst inst, unsigned long *gen_mask,
*gen_mask |= (1 << reg);
}
else if ((inst & 0xffe00000) == 0xe7a00000 /* swc1 freg,n($sp) */
- || (inst & 0xffe00000) == 0xe7c00000 /* swc1 freg,n($r30) */
+ || (inst & 0xffe00000) == 0xe7c00000 /* swc1 freg,n($r30) */
|| (inst & 0xffe00000) == 0xf7a00000) /* sdc1 freg,n($sp) */
{
@@ -993,7 +978,7 @@ mips32_next_pc (CORE_ADDR pc)
if ((inst & 0xe0000000) != 0) /* Not a special, jump or branch instruction */
{
if (itype_op (inst) >> 2 == 5)
- /* BEQL, BNEL, BLEZL, BGTZL: bits 0101xx */
+ /* BEQL, BNEL, BLEZL, BGTZL: bits 0101xx */
{
op = (itype_op (inst) & 0x03);
switch (op)
@@ -1011,11 +996,13 @@ mips32_next_pc (CORE_ADDR pc)
}
}
else if (itype_op (inst) == 17 && itype_rs (inst) == 8)
- /* BC1F, BC1FL, BC1T, BC1TL: 010001 01000 */
+ /* BC1F, BC1FL, BC1T, BC1TL: 010001 01000 */
{
int tf = itype_rt (inst) & 0x01;
int cnum = itype_rt (inst) >> 2;
- int fcrcs = read_signed_register (mips_regnum (current_gdbarch)->fp_control_status);
+ int fcrcs =
+ read_signed_register (mips_regnum (current_gdbarch)->
+ fp_control_status);
int cond = ((fcrcs >> 24) & 0x0e) | ((fcrcs >> 23) & 0x01);
if (((cond >> cnum) & 0x01) == tf)
@@ -1045,7 +1032,7 @@ mips32_next_pc (CORE_ADDR pc)
pc += 4;
}
- break; /* end SPECIAL */
+ break; /* end SPECIAL */
case 1: /* REGIMM */
{
op = itype_rt (inst); /* branch condition */
@@ -1075,7 +1062,7 @@ mips32_next_pc (CORE_ADDR pc)
pc += 4;
}
}
- break; /* end REGIMM */
+ break; /* end REGIMM */
case 2: /* J */
case 3: /* JAL */
{
@@ -1167,11 +1154,11 @@ enum mips16_inst_fmts
/* I am heaping all the fields of the formats into one structure and
then, only the fields which are involved in instruction extension */
struct upk_mips16
- {
- CORE_ADDR offset;
- unsigned int regx; /* Function in i8 type */
- unsigned int regy;
- };
+{
+ CORE_ADDR offset;
+ unsigned int regx; /* Function in i8 type */
+ unsigned int regy;
+};
/* The EXT-I, EXT-ri nad EXT-I8 instructions all have the same format
@@ -1211,8 +1198,7 @@ static void
unpack_mips16 (CORE_ADDR pc,
unsigned int extension,
unsigned int inst,
- enum mips16_inst_fmts insn_format,
- struct upk_mips16 *upk)
+ enum mips16_inst_fmts insn_format, struct upk_mips16 *upk)
{
CORE_ADDR offset;
int regx;
@@ -1226,7 +1212,7 @@ unpack_mips16 (CORE_ADDR pc,
{
value = extended_offset (extension);
value = value << 11; /* rom for the original value */
- value |= inst & 0x7ff; /* eleven bits from instruction */
+ value |= inst & 0x7ff; /* eleven bits from instruction */
}
else
{
@@ -1285,8 +1271,7 @@ unpack_mips16 (CORE_ADDR pc,
break;
}
default:
- internal_error (__FILE__, __LINE__,
- "bad switch");
+ internal_error (__FILE__, __LINE__, "bad switch");
}
upk->offset = offset;
upk->regx = regx;
@@ -1302,13 +1287,12 @@ add_offset_16 (CORE_ADDR pc, int offset)
static CORE_ADDR
extended_mips16_next_pc (CORE_ADDR pc,
- unsigned int extension,
- unsigned int insn)
+ unsigned int extension, unsigned int insn)
{
int op = (insn >> 11);
switch (op)
{
- case 2: /* Branch */
+ case 2: /* Branch */
{
CORE_ADDR offset;
struct upk_mips16 upk;
@@ -1322,7 +1306,7 @@ extended_mips16_next_pc (CORE_ADDR pc,
pc += (offset << 1) + 2;
break;
}
- case 3: /* JAL , JALX - Watch out, these are 32 bit instruction */
+ case 3: /* JAL , JALX - Watch out, these are 32 bit instruction */
{
struct upk_mips16 upk;
unpack_mips16 (pc, extension, insn, jalxtype, &upk);
@@ -1333,7 +1317,7 @@ extended_mips16_next_pc (CORE_ADDR pc,
pc |= 0x01;
break;
}
- case 4: /* beqz */
+ case 4: /* beqz */
{
struct upk_mips16 upk;
int reg;
@@ -1345,7 +1329,7 @@ extended_mips16_next_pc (CORE_ADDR pc,
pc += 2;
break;
}
- case 5: /* bnez */
+ case 5: /* bnez */
{
struct upk_mips16 upk;
int reg;
@@ -1357,7 +1341,7 @@ extended_mips16_next_pc (CORE_ADDR pc,
pc += 2;
break;
}
- case 12: /* I8 Formats btez btnez */
+ case 12: /* I8 Formats btez btnez */
{
struct upk_mips16 upk;
int reg;
@@ -1372,7 +1356,7 @@ extended_mips16_next_pc (CORE_ADDR pc,
pc += 2;
break;
}
- case 29: /* RR Formats JR, JALR, JALR-RA */
+ case 29: /* RR Formats JR, JALR, JALR-RA */
{
struct upk_mips16 upk;
/* upk.fmt = rrtype; */
@@ -1389,13 +1373,13 @@ extended_mips16_next_pc (CORE_ADDR pc,
break;
case 1:
reg = 31;
- break; /* Function return instruction */
+ break; /* Function return instruction */
case 2:
reg = upk.regx;
break;
default:
reg = 31;
- break; /* BOGUS Guess */
+ break; /* BOGUS Guess */
}
pc = read_signed_register (reg);
}
@@ -1485,8 +1469,9 @@ mips_find_saved_regs (struct frame_info *fci)
{
for (ireg = 0; ireg < MIPS_NUMREGS; ireg++)
{
- CORE_ADDR reg_position = (get_frame_base (fci) + SIGFRAME_REGSAVE_OFF
- + ireg * mips_regsize (current_gdbarch));
+ CORE_ADDR reg_position =
+ (get_frame_base (fci) + SIGFRAME_REGSAVE_OFF +
+ ireg * mips_regsize (current_gdbarch));
set_reg_offset (saved_regs, ireg, reg_position);
}
for (ireg = 0; ireg < MIPS_NUMREGS; ireg++)
@@ -1494,10 +1479,13 @@ mips_find_saved_regs (struct frame_info *fci)
CORE_ADDR reg_position = (get_frame_base (fci)
+ SIGFRAME_FPREGSAVE_OFF
+ ireg * mips_regsize (current_gdbarch));
- set_reg_offset (saved_regs, mips_regnum (current_gdbarch)->fp0 + ireg, reg_position);
+ set_reg_offset (saved_regs,
+ mips_regnum (current_gdbarch)->fp0 + ireg,
+ reg_position);
}
- set_reg_offset (saved_regs, PC_REGNUM, get_frame_base (fci) + SIGFRAME_PC_OFF);
+ set_reg_offset (saved_regs, mips_regnum (current_gdbarch)->pc,
+ get_frame_base (fci) + SIGFRAME_PC_OFF);
/* SP_REGNUM, contains the value and not the address. */
set_reg_offset (saved_regs, SP_REGNUM, get_frame_base (fci));
return;
@@ -1514,25 +1502,21 @@ mips_find_saved_regs (struct frame_info *fci)
gen_mask = kernel_trap ? 0xFFFFFFFF : PROC_REG_MASK (proc_desc);
float_mask = kernel_trap ? 0xFFFFFFFF : PROC_FREG_MASK (proc_desc);
- if (/* In any frame other than the innermost or a frame interrupted
- by a signal, we assume that all registers have been saved.
- This assumes that all register saves in a function happen
- before the first function call. */
+ if ( /* In any frame other than the innermost or a frame interrupted
+ by a signal, we assume that all registers have been saved.
+ This assumes that all register saves in a function happen
+ before the first function call. */
(get_next_frame (fci) == NULL
|| (get_frame_type (get_next_frame (fci)) == SIGTRAMP_FRAME))
-
/* In a dummy frame we know exactly where things are saved. */
&& !PROC_DESC_IS_DUMMY (proc_desc)
-
/* Don't bother unless we are inside a function prologue.
- Outside the prologue, we know where everything is. */
-
+ Outside the prologue, we know where everything is. */
&& in_prologue (get_frame_pc (fci), PROC_LOW_ADDR (proc_desc))
-
/* Not sure exactly what kernel_trap means, but if it means the
- kernel saves the registers without a prologue doing it, we
- better not examine the prologue to see whether registers
- have been saved yet. */
+ kernel saves the registers without a prologue doing it, we
+ better not examine the prologue to see whether registers
+ have been saved yet. */
&& !kernel_trap)
{
/* We need to figure out whether the registers that the
@@ -1597,7 +1581,7 @@ mips_find_saved_regs (struct frame_info *fci)
reg_position -= mips_saved_regsize (tdep);
/* Check if the s0 and s1 registers were pushed on the
- stack. */
+ stack. */
for (reg = 16; reg < sreg_count + 16; reg++)
{
set_reg_offset (saved_regs, reg, reg_position);
@@ -1621,40 +1605,45 @@ mips_find_saved_regs (struct frame_info *fci)
&& TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
{
/* On a big endian 32 bit ABI, floating point registers
- are paired to form doubles such that the most
- significant part is in $f[N+1] and the least
- significant in $f[N] vis: $f[N+1] ||| $f[N]. The
- registers are also spilled as a pair and stored as a
- double.
+ are paired to form doubles such that the most
+ significant part is in $f[N+1] and the least
+ significant in $f[N] vis: $f[N+1] ||| $f[N]. The
+ registers are also spilled as a pair and stored as a
+ double.
When little-endian the least significant part is
stored first leading to the memory order $f[N] and
then $f[N+1].
- Unfortunately, when big-endian the most significant
- part of the double is stored first, and the least
- significant is stored second. This leads to the
- registers being ordered in memory as firt $f[N+1] and
- then $f[N].
-
- For the big-endian case make certain that the
- addresses point at the correct (swapped) locations
- $f[N] and $f[N+1] pair (keep in mind that
- reg_position is decremented each time through the
- loop). */
+ Unfortunately, when big-endian the most significant
+ part of the double is stored first, and the least
+ significant is stored second. This leads to the
+ registers being ordered in memory as firt $f[N+1] and
+ then $f[N].
+
+ For the big-endian case make certain that the
+ addresses point at the correct (swapped) locations
+ $f[N] and $f[N+1] pair (keep in mind that
+ reg_position is decremented each time through the
+ loop). */
if ((ireg & 1))
- set_reg_offset (saved_regs, mips_regnum (current_gdbarch)->fp0 + ireg,
+ set_reg_offset (saved_regs,
+ mips_regnum (current_gdbarch)->fp0 + ireg,
reg_position - mips_saved_regsize (tdep));
else
- set_reg_offset (saved_regs, mips_regnum (current_gdbarch)->fp0 + ireg,
+ set_reg_offset (saved_regs,
+ mips_regnum (current_gdbarch)->fp0 + ireg,
reg_position + mips_saved_regsize (tdep));
}
else
- set_reg_offset (saved_regs, mips_regnum (current_gdbarch)->fp0 + ireg, reg_position);
+ set_reg_offset (saved_regs,
+ mips_regnum (current_gdbarch)->fp0 + ireg,
+ reg_position);
reg_position -= mips_saved_regsize (tdep);
}
- set_reg_offset (saved_regs, PC_REGNUM, saved_regs[RA_REGNUM]);
+ set_reg_offset (saved_regs, mips_regnum (current_gdbarch)->pc,
+ saved_regs[RA_REGNUM]);
}
/* SP_REGNUM, contains the value and not the address. */
@@ -1689,8 +1678,7 @@ static CORE_ADDR
mips_addr_bits_remove (CORE_ADDR addr)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
- if (mips_mask_address_p (tdep)
- && (((ULONGEST) addr) >> 32 == 0xffffffffUL))
+ if (mips_mask_address_p (tdep) && (((ULONGEST) addr) >> 32 == 0xffffffffUL))
/* This hack is a work-around for existing boards using PMON, the
simulator, and any other 64-bit targets that doesn't have true
64-bit addressing. On these targets, the upper 32 bits of
@@ -1729,7 +1717,7 @@ mips_software_single_step (enum target_signal sig, int insert_breakpoints_p)
if (insert_breakpoints_p)
{
- pc = read_register (PC_REGNUM);
+ pc = read_register (mips_regnum (current_gdbarch)->pc);
next_pc = mips_next_pc (pc);
target_insert_breakpoint (next_pc, break_mem);
@@ -1746,8 +1734,7 @@ mips_init_frame_pc_first (int fromleaf, struct frame_info *prev)
pc = ((fromleaf)
? DEPRECATED_SAVED_PC_AFTER_CALL (get_next_frame (prev))
: get_next_frame (prev)
- ? DEPRECATED_FRAME_SAVED_PC (get_next_frame (prev))
- : read_pc ());
+ ? DEPRECATED_FRAME_SAVED_PC (get_next_frame (prev)) : read_pc ());
tmp = SKIP_TRAMPOLINE_CODE (pc);
return tmp ? tmp : pc;
}
@@ -1762,7 +1749,7 @@ mips_frame_saved_pc (struct frame_info *frame)
if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), 0, 0))
{
/* Always unwind the cooked PC register value. */
- saved_pc = frame_unwind_register_signed (frame, NUM_REGS + PC_REGNUM);
+ saved_pc = frame_unwind_register_signed (frame, NUM_REGS + mips_regnum (current_gdbarch)->pc);
}
else
{
@@ -1770,13 +1757,14 @@ mips_frame_saved_pc (struct frame_info *frame)
= get_frame_extra_info (frame)->proc_desc;
if (proc_desc && PROC_DESC_IS_DUMMY (proc_desc))
saved_pc = read_memory_integer ((get_frame_base (frame)
- - mips_saved_regsize (tdep))
- , mips_saved_regsize (tdep));
+ - mips_saved_regsize (tdep)),
+ mips_saved_regsize (tdep));
else
{
/* We have to get the saved pc from the sigcontext if it is
a signal handler frame. */
- int pcreg = (get_frame_type (frame) == SIGTRAMP_FRAME ? PC_REGNUM
+ int pcreg = (get_frame_type (frame) == SIGTRAMP_FRAME
+ ? mips_regnum (current_gdbarch)->pc
: proc_desc ? PROC_PC_REG (proc_desc) : RA_REGNUM);
saved_pc = read_next_frame_reg (frame, NUM_REGS + pcreg);
}
@@ -1852,8 +1840,7 @@ heuristic_proc_start (CORE_ADDR pc)
if (start_pc == 0)
return 0;
- if (heuristic_fence_post == UINT_MAX
- || fence < VM_MIN_ADDRESS)
+ if (heuristic_fence_post == UINT_MAX || fence < VM_MIN_ADDRESS)
fence = VM_MIN_ADDRESS;
instlen = pc_is_mips16 (pc) ? MIPS16_INSTLEN : MIPS_INSTLEN;
@@ -1870,8 +1857,9 @@ heuristic_proc_start (CORE_ADDR pc)
{
static int blurb_printed = 0;
- warning ("Warning: GDB can't find the start of the function at 0x%s.",
- paddr_nz (pc));
+ warning
+ ("Warning: GDB can't find the start of the function at 0x%s.",
+ paddr_nz (pc));
if (!blurb_printed)
{
@@ -1891,8 +1879,7 @@ stack pointer.\n\
However, if you think GDB should simply search farther back\n\
from 0x%s for code which looks like the beginning of a\n\
function, you can increase the range of the search using the `set\n\
-heuristic-fence-post' command.\n",
- paddr_nz (pc), paddr_nz (pc));
+heuristic-fence-post' command.\n", paddr_nz (pc), paddr_nz (pc));
blurb_printed = 1;
}
}
@@ -1938,9 +1925,9 @@ heuristic-fence-post' command.\n",
static int
mips16_get_imm (unsigned short prev_inst, /* previous instruction */
unsigned short inst, /* current instruction */
- int nbits, /* number of bits in imm field */
- int scale, /* scale factor to be applied to imm */
- int is_signed) /* is the imm field signed? */
+ int nbits, /* number of bits in imm field */
+ int scale, /* scale factor to be applied to imm */
+ int is_signed) /* is the imm field signed? */
{
int offset;
@@ -1992,7 +1979,7 @@ mips16_heuristic_proc_desc (CORE_ADDR start_pc, CORE_ADDR limit_pc,
/* Fetch and decode the instruction. */
inst = (unsigned short) mips_fetch_instruction (cur_pc);
if ((inst & 0xff00) == 0x6300 /* addiu sp */
- || (inst & 0xff00) == 0xfb00) /* daddiu sp */
+ || (inst & 0xff00) == 0xfb00) /* daddiu sp */
{
offset = mips16_get_imm (prev_inst, inst, 8, 8, 1);
if (offset < 0) /* negative stack adjustment? */
@@ -2153,7 +2140,8 @@ restart:
but the register size used is only 32 bits. Make the address
for the saved register point to the lower 32 bits. */
PROC_REG_MASK (&temp_proc_desc) |= 1 << reg;
- set_reg_offset (temp_saved_regs, reg, sp + low_word + 8 - mips_regsize (current_gdbarch));
+ set_reg_offset (temp_saved_regs, reg,
+ sp + low_word + 8 - mips_regsize (current_gdbarch));
}
else if (high_word == 0x27be) /* addiu $30,$sp,size */
{
@@ -2286,7 +2274,7 @@ non_heuristic_proc_desc (CORE_ADDR pc, CORE_ADDR *addrptr)
priv = (struct mips_objfile_private *) sec->objfile->obj_private;
/* Search the ".pdr" section generated by GAS. This includes most of
- the information normally found in ECOFF PDRs. */
+ the information normally found in ECOFF PDRs. */
the_bfd = sec->objfile->obfd;
if (priv == NULL
@@ -2298,7 +2286,7 @@ non_heuristic_proc_desc (CORE_ADDR pc, CORE_ADDR *addrptr)
This means that we should not bother with this method on 64-bit
targets (until that is fixed). */
- priv = obstack_alloc (& sec->objfile->psymbol_obstack,
+ priv = obstack_alloc (&sec->objfile->objfile_obstack,
sizeof (struct mips_objfile_private));
priv->size = 0;
sec->objfile->obj_private = priv;
@@ -2307,23 +2295,24 @@ non_heuristic_proc_desc (CORE_ADDR pc, CORE_ADDR *addrptr)
{
asection *bfdsec;
- priv = obstack_alloc (& sec->objfile->psymbol_obstack,
+ priv = obstack_alloc (&sec->objfile->objfile_obstack,
sizeof (struct mips_objfile_private));
bfdsec = bfd_get_section_by_name (sec->objfile->obfd, ".pdr");
if (bfdsec != NULL)
{
priv->size = bfd_section_size (sec->objfile->obfd, bfdsec);
- priv->contents = obstack_alloc (& sec->objfile->psymbol_obstack,
+ priv->contents = obstack_alloc (&sec->objfile->objfile_obstack,
priv->size);
bfd_get_section_contents (sec->objfile->obfd, bfdsec,
priv->contents, 0, priv->size);
/* In general, the .pdr section is sorted. However, in the
- presence of multiple code sections (and other corner cases)
- it can become unsorted. Sort it so that we can use a faster
- binary search. */
- qsort (priv->contents, priv->size / 32, 32, compare_pdr_entries);
+ presence of multiple code sections (and other corner cases)
+ it can become unsorted. Sort it so that we can use a faster
+ binary search. */
+ qsort (priv->contents, priv->size / 32, 32,
+ compare_pdr_entries);
}
else
priv->size = 0;
@@ -2365,7 +2354,7 @@ non_heuristic_proc_desc (CORE_ADDR pc, CORE_ADDR *addrptr)
/* Fill in what we need of the proc_desc. */
proc_desc = (mips_extra_func_info_t)
- obstack_alloc (&sec->objfile->psymbol_obstack,
+ obstack_alloc (&sec->objfile->objfile_obstack,
sizeof (struct mips_extra_func_info));
PROC_LOW_ADDR (proc_desc) = startaddr;
@@ -2400,8 +2389,8 @@ non_heuristic_proc_desc (CORE_ADDR pc, CORE_ADDR *addrptr)
if (startaddr > BLOCK_START (b))
{
/* This is the "pathological" case referred to in a comment in
- print_frame_info. It might be better to move this check into
- symbol reading. */
+ print_frame_info. It might be better to move this check into
+ symbol reading. */
return NULL;
}
@@ -2447,8 +2436,7 @@ find_proc_desc (CORE_ADDR pc, struct frame_info *next_frame, int cur_frame)
if (proc_symbol)
{
val = find_pc_line (BLOCK_START
- (SYMBOL_BLOCK_VALUE (proc_symbol)),
- 0);
+ (SYMBOL_BLOCK_VALUE (proc_symbol)), 0);
val.pc = val.end ? val.end : pc;
}
if (!proc_symbol || pc < val.pc)
@@ -2478,19 +2466,16 @@ find_proc_desc (CORE_ADDR pc, struct frame_info *next_frame, int cur_frame)
if (startaddr == 0)
startaddr = heuristic_proc_start (pc);
- proc_desc =
- heuristic_proc_desc (startaddr, pc, next_frame, cur_frame);
+ proc_desc = heuristic_proc_desc (startaddr, pc, next_frame, cur_frame);
}
return proc_desc;
}
static CORE_ADDR
-get_frame_pointer (struct frame_info *frame,
- mips_extra_func_info_t proc_desc)
+get_frame_pointer (struct frame_info *frame, mips_extra_func_info_t proc_desc)
{
return (read_next_frame_reg (frame, NUM_REGS + PROC_FRAME_REG (proc_desc))
- + PROC_FRAME_OFFSET (proc_desc)
- - PROC_FRAME_ADJUST (proc_desc));
+ + PROC_FRAME_OFFSET (proc_desc) - PROC_FRAME_ADJUST (proc_desc));
}
static mips_extra_func_info_t cached_proc_desc;
@@ -2528,7 +2513,7 @@ mips_frame_chain (struct frame_info *frame)
if (PROC_FRAME_REG (proc_desc) == SP_REGNUM
&& PROC_FRAME_OFFSET (proc_desc) == 0
/* The previous frame from a sigtramp frame might be frameless
- and have frame size zero. */
+ and have frame size zero. */
&& !(get_frame_type (frame) == SIGTRAMP_FRAME)
/* For a generic dummy frame, let get_frame_pointer() unwind a
register value saved as part of the dummy frame call. */
@@ -2555,7 +2540,7 @@ mips_init_extra_frame_info (int fromleaf, struct frame_info *fci)
get_next_frame (fci)
? cached_proc_desc
: find_proc_desc (get_frame_pc (fci),
- NULL /* i.e, get_next_frame (fci) */,
+ NULL /* i.e, get_next_frame (fci) */ ,
1);
frame_extra_info_zalloc (fci, sizeof (struct frame_extra_info));
@@ -2570,17 +2555,24 @@ mips_init_extra_frame_info (int fromleaf, struct frame_info *fci)
interrupted by a signal at it's very start. */
if (get_frame_pc (fci) == PROC_LOW_ADDR (proc_desc)
&& !PROC_DESC_IS_DUMMY (proc_desc))
- deprecated_update_frame_base_hack (fci, read_next_frame_reg (get_next_frame (fci), NUM_REGS + SP_REGNUM));
+ deprecated_update_frame_base_hack (fci,
+ read_next_frame_reg (get_next_frame
+ (fci),
+ NUM_REGS +
+ SP_REGNUM));
else if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fci), 0, 0))
/* Do not ``fix'' fci->frame. It will have the value of the
- generic dummy frame's top-of-stack (since the draft
- fci->frame is obtained by returning the unwound stack
- pointer) and that is what we want. That way the fci->frame
- value will match the top-of-stack value that was saved as
- part of the dummy frames data. */
- /* Do nothing. */;
+ generic dummy frame's top-of-stack (since the draft
+ fci->frame is obtained by returning the unwound stack
+ pointer) and that is what we want. That way the fci->frame
+ value will match the top-of-stack value that was saved as
+ part of the dummy frames data. */
+ /* Do nothing. */ ;
else
- deprecated_update_frame_base_hack (fci, get_frame_pointer (get_next_frame (fci), proc_desc));
+ deprecated_update_frame_base_hack (fci,
+ get_frame_pointer (get_next_frame
+ (fci),
+ proc_desc));
if (proc_desc == &temp_proc_desc)
{
@@ -2591,8 +2583,8 @@ mips_init_extra_frame_info (int fromleaf, struct frame_info *fci)
use (get_frame_type (fci) == SIGTRAMP_FRAME), it is not
yet set. */
/* FIXME: cagney/2002-11-18: This problem will go away once
- frame.c:get_prev_frame() is modified to set the frame's
- type before calling functions like this. */
+ frame.c:get_prev_frame() is modified to set the frame's
+ type before calling functions like this. */
find_pc_partial_function (get_frame_pc (fci), &name,
(CORE_ADDR *) NULL, (CORE_ADDR *) NULL);
if (!PC_IN_SIGTRAMP (get_frame_pc (fci), name))
@@ -2606,7 +2598,7 @@ mips_init_extra_frame_info (int fromleaf, struct frame_info *fci)
may be found. */
set_reg_offset (temp_saved_regs, SP_REGNUM,
get_frame_base (fci));
- set_reg_offset (temp_saved_regs, PC_REGNUM,
+ set_reg_offset (temp_saved_regs, mips_regnum (current_gdbarch)->pc,
temp_saved_regs[RA_REGNUM]);
memcpy (deprecated_get_frame_saved_regs (fci), temp_saved_regs,
SIZEOF_FRAME_SAVED_REGS);
@@ -2662,7 +2654,8 @@ fp_register_arg_p (enum type_code typecode, struct type *arg_type)
{
return ((typecode == TYPE_CODE_FLT
|| (MIPS_EABI
- && (typecode == TYPE_CODE_STRUCT || typecode == TYPE_CODE_UNION)
+ && (typecode == TYPE_CODE_STRUCT
+ || typecode == TYPE_CODE_UNION)
&& TYPE_NFIELDS (arg_type) == 1
&& TYPE_CODE (TYPE_FIELD_TYPE (arg_type, 0)) == TYPE_CODE_FLT))
&& MIPS_FPU_TYPE != MIPS_FPU_NONE);
@@ -2705,11 +2698,150 @@ mips_frame_align (struct gdbarch *gdbarch, CORE_ADDR addr)
return align_down (addr, 16);
}
+/* Determine how a return value is stored within the MIPS register
+ file, given the return type `valtype'. */
+
+struct return_value_word
+{
+ int len;
+ int reg;
+ int reg_offset;
+ int buf_offset;
+};
+
+static void
+return_value_location (struct type *valtype,
+ struct return_value_word *hi,
+ struct return_value_word *lo)
+{
+ int len = TYPE_LENGTH (valtype);
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+ if (TYPE_CODE (valtype) == TYPE_CODE_FLT
+ && ((MIPS_FPU_TYPE == MIPS_FPU_DOUBLE && (len == 4 || len == 8))
+ || (MIPS_FPU_TYPE == MIPS_FPU_SINGLE && len == 4)))
+ {
+ if (!FP_REGISTER_DOUBLE && len == 8)
+ {
+ /* We need to break a 64bit float in two 32 bit halves and
+ spread them across a floating-point register pair. */
+ lo->buf_offset = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? 4 : 0;
+ hi->buf_offset = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? 0 : 4;
+ lo->reg_offset = ((TARGET_BYTE_ORDER == BFD_ENDIAN_BIG
+ && register_size (current_gdbarch,
+ mips_regnum (current_gdbarch)->
+ fp0) == 8) ? 4 : 0);
+ hi->reg_offset = lo->reg_offset;
+ lo->reg = mips_regnum (current_gdbarch)->fp0 + 0;
+ hi->reg = mips_regnum (current_gdbarch)->fp0 + 1;
+ lo->len = 4;
+ hi->len = 4;
+ }
+ else
+ {
+ /* The floating point value fits in a single floating-point
+ register. */
+ lo->reg_offset = ((TARGET_BYTE_ORDER == BFD_ENDIAN_BIG
+ && register_size (current_gdbarch,
+ mips_regnum (current_gdbarch)->
+ fp0) == 8
+ && len == 4) ? 4 : 0);
+ lo->reg = mips_regnum (current_gdbarch)->fp0;
+ lo->len = len;
+ lo->buf_offset = 0;
+ hi->len = 0;
+ hi->reg_offset = 0;
+ hi->buf_offset = 0;
+ hi->reg = 0;
+ }
+ }
+ else
+ {
+ /* Locate a result possibly spread across two registers. */
+ int regnum = 2;
+ lo->reg = regnum + 0;
+ hi->reg = regnum + 1;
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG
+ && len < mips_saved_regsize (tdep))
+ {
+ /* "un-left-justify" the value in the low register */
+ lo->reg_offset = mips_saved_regsize (tdep) - len;
+ lo->len = len;
+ hi->reg_offset = 0;
+ hi->len = 0;
+ }
+ else if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG && len > mips_saved_regsize (tdep) /* odd-size structs */
+ && len < mips_saved_regsize (tdep) * 2
+ && (TYPE_CODE (valtype) == TYPE_CODE_STRUCT ||
+ TYPE_CODE (valtype) == TYPE_CODE_UNION))
+ {
+ /* "un-left-justify" the value spread across two registers. */
+ lo->reg_offset = 2 * mips_saved_regsize (tdep) - len;
+ lo->len = mips_saved_regsize (tdep) - lo->reg_offset;
+ hi->reg_offset = 0;
+ hi->len = len - lo->len;
+ }
+ else
+ {
+ /* Only perform a partial copy of the second register. */
+ lo->reg_offset = 0;
+ hi->reg_offset = 0;
+ if (len > mips_saved_regsize (tdep))
+ {
+ lo->len = mips_saved_regsize (tdep);
+ hi->len = len - mips_saved_regsize (tdep);
+ }
+ else
+ {
+ lo->len = len;
+ hi->len = 0;
+ }
+ }
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG
+ && register_size (current_gdbarch, regnum) == 8
+ && mips_saved_regsize (tdep) == 4)
+ {
+ /* Account for the fact that only the least-signficant part
+ of the register is being used */
+ lo->reg_offset += 4;
+ hi->reg_offset += 4;
+ }
+ lo->buf_offset = 0;
+ hi->buf_offset = lo->len;
+ }
+}
+
+/* Should call_function allocate stack space for a struct return? */
+
+static int
+mips_eabi_use_struct_convention (int gcc_p, struct type *type)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+ return (TYPE_LENGTH (type) > 2 * mips_saved_regsize (tdep));
+}
+
+/* Should call_function pass struct by reference?
+ For each architecture, structs are passed either by
+ value or by reference, depending on their size. */
+
+static int
+mips_eabi_reg_struct_has_addr (int gcc_p, struct type *type)
+{
+ enum type_code typecode = TYPE_CODE (check_typedef (type));
+ int len = TYPE_LENGTH (check_typedef (type));
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+ if (typecode == TYPE_CODE_STRUCT || typecode == TYPE_CODE_UNION)
+ return (len > mips_saved_regsize (tdep));
+
+ return 0;
+}
+
static CORE_ADDR
mips_eabi_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
- struct regcache *regcache, CORE_ADDR bp_addr, int nargs,
- struct value **args, CORE_ADDR sp, int struct_return,
- CORE_ADDR struct_addr)
+ struct regcache *regcache, CORE_ADDR bp_addr,
+ int nargs, struct value **args, CORE_ADDR sp,
+ int struct_return, CORE_ADDR struct_addr)
{
int argreg;
int float_argreg;
@@ -2739,12 +2871,12 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
than necessary for EABI, because the first few arguments are
passed in registers, but that's OK. */
for (argnum = 0; argnum < nargs; argnum++)
- len += align_up (TYPE_LENGTH (VALUE_TYPE (args[argnum])),
+ len += align_up (TYPE_LENGTH (VALUE_TYPE (args[argnum])),
mips_stack_argsize (tdep));
sp -= align_up (len, 16);
if (mips_debug)
- fprintf_unfiltered (gdb_stdlog,
+ fprintf_unfiltered (gdb_stdlog,
"mips_eabi_push_dummy_call: sp=0x%s allocated %ld\n",
paddr_nz (sp), (long) align_up (len, 16));
@@ -2800,8 +2932,7 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
up before the check to see if there are any FP registers
left. Non MIPS_EABI targets also pass the FP in the integer
registers so also round up normal registers. */
- if (!FP_REGISTER_DOUBLE
- && fp_register_arg_p (typecode, arg_type))
+ if (!FP_REGISTER_DOUBLE && fp_register_arg_p (typecode, arg_type))
{
if ((float_argreg & 1))
float_argreg++;
@@ -2846,7 +2977,7 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
/* This is a floating point value that fits entirely
in a single register. */
/* On 32 bit ABI's the float_argreg is further adjusted
- above to ensure that it is even register aligned. */
+ above to ensure that it is even register aligned. */
LONGEST regval = extract_unsigned_integer (val, len);
if (mips_debug)
fprintf_unfiltered (gdb_stdlog, " - fpreg=%d val=%s",
@@ -2868,7 +2999,7 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
&& (len % mips_saved_regsize (tdep) != 0));
/* Note: Floating-point values that didn't fit into an FP
- register are only written to memory. */
+ register are only written to memory. */
while (len > 0)
{
/* Remember if the argument was written to the stack. */
@@ -2895,8 +3026,7 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
if (mips_stack_argsize (tdep) == 8
&& (typecode == TYPE_CODE_INT
|| typecode == TYPE_CODE_PTR
- || typecode == TYPE_CODE_FLT)
- && len <= 4)
+ || typecode == TYPE_CODE_FLT) && len <= 4)
longword_offset = mips_stack_argsize (tdep) - len;
else if ((typecode == TYPE_CODE_STRUCT
|| typecode == TYPE_CODE_UNION)
@@ -2918,11 +3048,11 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
if (mips_debug)
{
int i;
- fprintf_unfiltered (gdb_stdlog, " @0x%s ",
+ fprintf_unfiltered (gdb_stdlog, " @0x%s ",
paddr_nz (addr));
for (i = 0; i < partial_len; i++)
{
- fprintf_unfiltered (gdb_stdlog, "%02x",
+ fprintf_unfiltered (gdb_stdlog, "%02x",
val[i] & 0xff);
}
}
@@ -2933,16 +3063,18 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
structs may go thru BOTH paths. Floating point
arguments will not. */
/* Write this portion of the argument to a general
- purpose register. */
+ purpose register. */
if (argreg <= MIPS_LAST_ARG_REGNUM
&& !fp_register_arg_p (typecode, arg_type))
{
- LONGEST regval = extract_unsigned_integer (val, partial_len);
+ LONGEST regval =
+ extract_unsigned_integer (val, partial_len);
if (mips_debug)
fprintf_filtered (gdb_stdlog, " - reg=%d val=%s",
argreg,
- phex (regval, mips_saved_regsize (tdep)));
+ phex (regval,
+ mips_saved_regsize (tdep)));
write_register (argreg, regval);
argreg++;
}
@@ -2951,7 +3083,7 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
val += partial_len;
/* Compute the the offset into the stack at which we
- will copy the next parameter.
+ will copy the next parameter.
In the new EABI (and the NABI32), the stack_offset
only needs to be adjusted when it has been used. */
@@ -2971,13 +3103,62 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
return sp;
}
-/* N32/N64 version of push_dummy_call. */
+/* Given a return value in `regbuf' with a type `valtype', extract and
+ copy its value into `valbuf'. */
+
+static void
+mips_eabi_extract_return_value (struct type *valtype,
+ char regbuf[], char *valbuf)
+{
+ struct return_value_word lo;
+ struct return_value_word hi;
+ return_value_location (valtype, &hi, &lo);
+
+ memcpy (valbuf + lo.buf_offset,
+ regbuf + DEPRECATED_REGISTER_BYTE (NUM_REGS + lo.reg) +
+ lo.reg_offset, lo.len);
+
+ if (hi.len > 0)
+ memcpy (valbuf + hi.buf_offset,
+ regbuf + DEPRECATED_REGISTER_BYTE (NUM_REGS + hi.reg) +
+ hi.reg_offset, hi.len);
+}
+
+/* Given a return value in `valbuf' with a type `valtype', write it's
+ value into the appropriate register. */
+
+static void
+mips_eabi_store_return_value (struct type *valtype, char *valbuf)
+{
+ char raw_buffer[MAX_REGISTER_SIZE];
+ struct return_value_word lo;
+ struct return_value_word hi;
+ return_value_location (valtype, &hi, &lo);
+
+ memset (raw_buffer, 0, sizeof (raw_buffer));
+ memcpy (raw_buffer + lo.reg_offset, valbuf + lo.buf_offset, lo.len);
+ deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (lo.reg),
+ raw_buffer, register_size (current_gdbarch,
+ lo.reg));
+
+ if (hi.len > 0)
+ {
+ memset (raw_buffer, 0, sizeof (raw_buffer));
+ memcpy (raw_buffer + hi.reg_offset, valbuf + hi.buf_offset, hi.len);
+ deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (hi.reg),
+ raw_buffer,
+ register_size (current_gdbarch,
+ hi.reg));
+ }
+}
+
+/* N32/N64 ABI stuff. */
static CORE_ADDR
mips_n32n64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
- struct regcache *regcache, CORE_ADDR bp_addr, int nargs,
- struct value **args, CORE_ADDR sp, int struct_return,
- CORE_ADDR struct_addr)
+ struct regcache *regcache, CORE_ADDR bp_addr,
+ int nargs, struct value **args, CORE_ADDR sp,
+ int struct_return, CORE_ADDR struct_addr)
{
int argreg;
int float_argreg;
@@ -3005,12 +3186,12 @@ mips_n32n64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
/* Now make space on the stack for the args. */
for (argnum = 0; argnum < nargs; argnum++)
- len += align_up (TYPE_LENGTH (VALUE_TYPE (args[argnum])),
+ len += align_up (TYPE_LENGTH (VALUE_TYPE (args[argnum])),
mips_stack_argsize (tdep));
sp -= align_up (len, 16);
if (mips_debug)
- fprintf_unfiltered (gdb_stdlog,
+ fprintf_unfiltered (gdb_stdlog,
"mips_n32n64_push_dummy_call: sp=0x%s allocated %ld\n",
paddr_nz (sp), (long) align_up (len, 16));
@@ -3079,7 +3260,7 @@ mips_n32n64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
int odd_sized_struct = ((len > mips_saved_regsize (tdep))
&& (len % mips_saved_regsize (tdep) != 0));
/* Note: Floating-point values that didn't fit into an FP
- register are only written to memory. */
+ register are only written to memory. */
while (len > 0)
{
/* Rememer if the argument was written to the stack. */
@@ -3106,8 +3287,7 @@ mips_n32n64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
if (mips_stack_argsize (tdep) == 8
&& (typecode == TYPE_CODE_INT
|| typecode == TYPE_CODE_PTR
- || typecode == TYPE_CODE_FLT)
- && len <= 4)
+ || typecode == TYPE_CODE_FLT) && len <= 4)
longword_offset = mips_stack_argsize (tdep) - len;
}
@@ -3124,11 +3304,11 @@ mips_n32n64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
if (mips_debug)
{
int i;
- fprintf_unfiltered (gdb_stdlog, " @0x%s ",
+ fprintf_unfiltered (gdb_stdlog, " @0x%s ",
paddr_nz (addr));
for (i = 0; i < partial_len; i++)
{
- fprintf_unfiltered (gdb_stdlog, "%02x",
+ fprintf_unfiltered (gdb_stdlog, "%02x",
val[i] & 0xff);
}
}
@@ -3139,11 +3319,12 @@ mips_n32n64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
structs may go thru BOTH paths. Floating point
arguments will not. */
/* Write this portion of the argument to a general
- purpose register. */
+ purpose register. */
if (argreg <= MIPS_LAST_ARG_REGNUM
&& !fp_register_arg_p (typecode, arg_type))
{
- LONGEST regval = extract_unsigned_integer (val, partial_len);
+ LONGEST regval =
+ extract_unsigned_integer (val, partial_len);
/* A non-floating-point argument being passed in a
general register. If a struct or union, and if
@@ -3178,7 +3359,8 @@ mips_n32n64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
if (mips_debug)
fprintf_filtered (gdb_stdlog, " - reg=%d val=%s",
argreg,
- phex (regval, mips_saved_regsize (tdep)));
+ phex (regval,
+ mips_saved_regsize (tdep)));
write_register (argreg, regval);
argreg++;
}
@@ -3187,7 +3369,7 @@ mips_n32n64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
val += partial_len;
/* Compute the the offset into the stack at which we
- will copy the next parameter.
+ will copy the next parameter.
In N32 (N64?), the stack_offset only needs to be
adjusted when it has been used. */
@@ -3207,13 +3389,117 @@ mips_n32n64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
return sp;
}
-/* O32 version of push_dummy_call. */
+static enum return_value_convention
+mips_n32n64_return_value (struct gdbarch *gdbarch,
+ struct type *type, struct regcache *regcache,
+ void *readbuf, const void *writebuf)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+ if (TYPE_CODE (type) == TYPE_CODE_STRUCT
+ || TYPE_CODE (type) == TYPE_CODE_UNION
+ || TYPE_CODE (type) == TYPE_CODE_ARRAY
+ || TYPE_LENGTH (type) > 2 * mips_saved_regsize (tdep))
+ return RETURN_VALUE_STRUCT_CONVENTION;
+ else if (TYPE_CODE (type) == TYPE_CODE_FLT
+ && tdep->mips_fpu_type != MIPS_FPU_NONE)
+ {
+ /* A floating-point value belongs in the least significant part
+ of FP0. */
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stderr, "Return float in $fp0\n");
+ mips_xfer_register (regcache,
+ NUM_REGS + mips_regnum (current_gdbarch)->fp0,
+ TYPE_LENGTH (type),
+ TARGET_BYTE_ORDER, readbuf, writebuf, 0);
+ return RETURN_VALUE_REGISTER_CONVENTION;
+ }
+ else if (TYPE_CODE (type) == TYPE_CODE_STRUCT
+ && TYPE_NFIELDS (type) <= 2
+ && TYPE_NFIELDS (type) >= 1
+ && ((TYPE_NFIELDS (type) == 1
+ && (TYPE_CODE (TYPE_FIELD_TYPE (type, 0))
+ == TYPE_CODE_FLT))
+ || (TYPE_NFIELDS (type) == 2
+ && (TYPE_CODE (TYPE_FIELD_TYPE (type, 0))
+ == TYPE_CODE_FLT)
+ && (TYPE_CODE (TYPE_FIELD_TYPE (type, 1))
+ == TYPE_CODE_FLT)))
+ && tdep->mips_fpu_type != MIPS_FPU_NONE)
+ {
+ /* A struct that contains one or two floats. Each value is part
+ in the least significant part of their floating point
+ register.. */
+ bfd_byte reg[MAX_REGISTER_SIZE];
+ int regnum;
+ int field;
+ for (field = 0, regnum = mips_regnum (current_gdbarch)->fp0;
+ field < TYPE_NFIELDS (type); field++, regnum += 2)
+ {
+ int offset = (FIELD_BITPOS (TYPE_FIELDS (type)[field])
+ / TARGET_CHAR_BIT);
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stderr, "Return float struct+%d\n",
+ offset);
+ mips_xfer_register (regcache, NUM_REGS + regnum,
+ TYPE_LENGTH (TYPE_FIELD_TYPE (type, field)),
+ TARGET_BYTE_ORDER, readbuf, writebuf, offset);
+ }
+ return RETURN_VALUE_REGISTER_CONVENTION;
+ }
+ else if (TYPE_CODE (type) == TYPE_CODE_STRUCT
+ || TYPE_CODE (type) == TYPE_CODE_UNION)
+ {
+ /* A structure or union. Extract the left justified value,
+ regardless of the byte order. I.e. DO NOT USE
+ mips_xfer_lower. */
+ int offset;
+ int regnum;
+ for (offset = 0, regnum = V0_REGNUM;
+ offset < TYPE_LENGTH (type);
+ offset += register_size (current_gdbarch, regnum), regnum++)
+ {
+ int xfer = register_size (current_gdbarch, regnum);
+ if (offset + xfer > TYPE_LENGTH (type))
+ xfer = TYPE_LENGTH (type) - offset;
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stderr, "Return struct+%d:%d in $%d\n",
+ offset, xfer, regnum);
+ mips_xfer_register (regcache, NUM_REGS + regnum, xfer,
+ BFD_ENDIAN_UNKNOWN, readbuf, writebuf, offset);
+ }
+ return RETURN_VALUE_REGISTER_CONVENTION;
+ }
+ else
+ {
+ /* A scalar extract each part but least-significant-byte
+ justified. */
+ int offset;
+ int regnum;
+ for (offset = 0, regnum = V0_REGNUM;
+ offset < TYPE_LENGTH (type);
+ offset += register_size (current_gdbarch, regnum), regnum++)
+ {
+ int xfer = register_size (current_gdbarch, regnum);
+ int pos = 0;
+ if (offset + xfer > TYPE_LENGTH (type))
+ xfer = TYPE_LENGTH (type) - offset;
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stderr, "Return scalar+%d:%d in $%d\n",
+ offset, xfer, regnum);
+ mips_xfer_register (regcache, NUM_REGS + regnum, xfer,
+ TARGET_BYTE_ORDER, readbuf, writebuf, offset);
+ }
+ return RETURN_VALUE_REGISTER_CONVENTION;
+ }
+}
+
+/* O32 ABI stuff. */
static CORE_ADDR
mips_o32_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
- struct regcache *regcache, CORE_ADDR bp_addr, int nargs,
- struct value **args, CORE_ADDR sp, int struct_return,
- CORE_ADDR struct_addr)
+ struct regcache *regcache, CORE_ADDR bp_addr,
+ int nargs, struct value **args, CORE_ADDR sp,
+ int struct_return, CORE_ADDR struct_addr)
{
int argreg;
int float_argreg;
@@ -3241,12 +3527,12 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
/* Now make space on the stack for the args. */
for (argnum = 0; argnum < nargs; argnum++)
- len += align_up (TYPE_LENGTH (VALUE_TYPE (args[argnum])),
+ len += align_up (TYPE_LENGTH (VALUE_TYPE (args[argnum])),
mips_stack_argsize (tdep));
sp -= align_up (len, 16);
if (mips_debug)
- fprintf_unfiltered (gdb_stdlog,
+ fprintf_unfiltered (gdb_stdlog,
"mips_o32_push_dummy_call: sp=0x%s allocated %ld\n",
paddr_nz (sp), (long) align_up (len, 16));
@@ -3289,8 +3575,7 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
up before the check to see if there are any FP registers
left. O32/O64 targets also pass the FP in the integer
registers so also round up normal registers. */
- if (!FP_REGISTER_DOUBLE
- && fp_register_arg_p (typecode, arg_type))
+ if (!FP_REGISTER_DOUBLE && fp_register_arg_p (typecode, arg_type))
{
if ((float_argreg & 1))
float_argreg++;
@@ -3342,16 +3627,16 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
/* This is a floating point value that fits entirely
in a single register. */
/* On 32 bit ABI's the float_argreg is further adjusted
- above to ensure that it is even register aligned. */
+ above to ensure that it is even register aligned. */
LONGEST regval = extract_unsigned_integer (val, len);
if (mips_debug)
fprintf_unfiltered (gdb_stdlog, " - fpreg=%d val=%s",
float_argreg, phex (regval, len));
write_register (float_argreg++, regval);
/* CAGNEY: 32 bit MIPS ABI's always reserve two FP
- registers for each argument. The below is (my
- guess) to ensure that the corresponding integer
- register has reserved the same space. */
+ registers for each argument. The below is (my
+ guess) to ensure that the corresponding integer
+ register has reserved the same space. */
if (mips_debug)
fprintf_unfiltered (gdb_stdlog, " - reg=%d val=%s",
argreg, phex (regval, len));
@@ -3379,10 +3664,10 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
&& mips_type_needs_double_align (arg_type))
{
if ((argreg & 1))
- argreg++;
+ argreg++;
}
/* Note: Floating-point values that didn't fit into an FP
- register are only written to memory. */
+ register are only written to memory. */
while (len > 0)
{
/* Remember if the argument was written to the stack. */
@@ -3409,8 +3694,7 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
if (mips_stack_argsize (tdep) == 8
&& (typecode == TYPE_CODE_INT
|| typecode == TYPE_CODE_PTR
- || typecode == TYPE_CODE_FLT)
- && len <= 4)
+ || typecode == TYPE_CODE_FLT) && len <= 4)
longword_offset = mips_stack_argsize (tdep) - len;
}
@@ -3427,11 +3711,11 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
if (mips_debug)
{
int i;
- fprintf_unfiltered (gdb_stdlog, " @0x%s ",
+ fprintf_unfiltered (gdb_stdlog, " @0x%s ",
paddr_nz (addr));
for (i = 0; i < partial_len; i++)
{
- fprintf_unfiltered (gdb_stdlog, "%02x",
+ fprintf_unfiltered (gdb_stdlog, "%02x",
val[i] & 0xff);
}
}
@@ -3442,7 +3726,7 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
structs may go thru BOTH paths. Floating point
arguments will not. */
/* Write this portion of the argument to a general
- purpose register. */
+ purpose register. */
if (argreg <= MIPS_LAST_ARG_REGNUM
&& !fp_register_arg_p (typecode, arg_type))
{
@@ -3486,7 +3770,8 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
if (mips_debug)
fprintf_filtered (gdb_stdlog, " - reg=%d val=%s",
argreg,
- phex (regval, mips_saved_regsize (tdep)));
+ phex (regval,
+ mips_saved_regsize (tdep)));
write_register (argreg, regval);
argreg++;
@@ -3499,12 +3784,12 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
val += partial_len;
/* Compute the the offset into the stack at which we
- will copy the next parameter.
+ will copy the next parameter.
- In older ABIs, the caller reserved space for
- registers that contained arguments. This was loosely
- refered to as their "home". Consequently, space is
- always allocated. */
+ In older ABIs, the caller reserved space for
+ registers that contained arguments. This was loosely
+ refered to as their "home". Consequently, space is
+ always allocated. */
stack_offset += align_up (partial_len,
mips_stack_argsize (tdep));
@@ -3520,13 +3805,155 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
return sp;
}
-/* O64 version of push_dummy_call. */
+static enum return_value_convention
+mips_o32_return_value (struct gdbarch *gdbarch, struct type *type,
+ struct regcache *regcache,
+ void *readbuf, const void *writebuf)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+ if (TYPE_CODE (type) == TYPE_CODE_STRUCT
+ || TYPE_CODE (type) == TYPE_CODE_UNION
+ || TYPE_CODE (type) == TYPE_CODE_ARRAY)
+ return RETURN_VALUE_STRUCT_CONVENTION;
+ else if (TYPE_CODE (type) == TYPE_CODE_FLT
+ && TYPE_LENGTH (type) == 4 && tdep->mips_fpu_type != MIPS_FPU_NONE)
+ {
+ /* A single-precision floating-point value. It fits in the
+ least significant part of FP0. */
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stderr, "Return float in $fp0\n");
+ mips_xfer_register (regcache,
+ NUM_REGS + mips_regnum (current_gdbarch)->fp0,
+ TYPE_LENGTH (type),
+ TARGET_BYTE_ORDER, readbuf, writebuf, 0);
+ return RETURN_VALUE_REGISTER_CONVENTION;
+ }
+ else if (TYPE_CODE (type) == TYPE_CODE_FLT
+ && TYPE_LENGTH (type) == 8 && tdep->mips_fpu_type != MIPS_FPU_NONE)
+ {
+ /* A double-precision floating-point value. The most
+ significant part goes in FP1, and the least significant in
+ FP0. */
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stderr, "Return float in $fp1/$fp0\n");
+ switch (TARGET_BYTE_ORDER)
+ {
+ case BFD_ENDIAN_LITTLE:
+ mips_xfer_register (regcache,
+ NUM_REGS + mips_regnum (current_gdbarch)->fp0 +
+ 0, 4, TARGET_BYTE_ORDER, readbuf, writebuf, 0);
+ mips_xfer_register (regcache,
+ NUM_REGS + mips_regnum (current_gdbarch)->fp0 +
+ 1, 4, TARGET_BYTE_ORDER, readbuf, writebuf, 4);
+ break;
+ case BFD_ENDIAN_BIG:
+ mips_xfer_register (regcache,
+ NUM_REGS + mips_regnum (current_gdbarch)->fp0 +
+ 1, 4, TARGET_BYTE_ORDER, readbuf, writebuf, 0);
+ mips_xfer_register (regcache,
+ NUM_REGS + mips_regnum (current_gdbarch)->fp0 +
+ 0, 4, TARGET_BYTE_ORDER, readbuf, writebuf, 4);
+ break;
+ default:
+ internal_error (__FILE__, __LINE__, "bad switch");
+ }
+ return RETURN_VALUE_REGISTER_CONVENTION;
+ }
+#if 0
+ else if (TYPE_CODE (type) == TYPE_CODE_STRUCT
+ && TYPE_NFIELDS (type) <= 2
+ && TYPE_NFIELDS (type) >= 1
+ && ((TYPE_NFIELDS (type) == 1
+ && (TYPE_CODE (TYPE_FIELD_TYPE (type, 0))
+ == TYPE_CODE_FLT))
+ || (TYPE_NFIELDS (type) == 2
+ && (TYPE_CODE (TYPE_FIELD_TYPE (type, 0))
+ == TYPE_CODE_FLT)
+ && (TYPE_CODE (TYPE_FIELD_TYPE (type, 1))
+ == TYPE_CODE_FLT)))
+ && tdep->mips_fpu_type != MIPS_FPU_NONE)
+ {
+ /* A struct that contains one or two floats. Each value is part
+ in the least significant part of their floating point
+ register.. */
+ bfd_byte reg[MAX_REGISTER_SIZE];
+ int regnum;
+ int field;
+ for (field = 0, regnum = mips_regnum (current_gdbarch)->fp0;
+ field < TYPE_NFIELDS (type); field++, regnum += 2)
+ {
+ int offset = (FIELD_BITPOS (TYPE_FIELDS (type)[field])
+ / TARGET_CHAR_BIT);
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stderr, "Return float struct+%d\n",
+ offset);
+ mips_xfer_register (regcache, NUM_REGS + regnum,
+ TYPE_LENGTH (TYPE_FIELD_TYPE (type, field)),
+ TARGET_BYTE_ORDER, readbuf, writebuf, offset);
+ }
+ return RETURN_VALUE_REGISTER_CONVENTION;
+ }
+#endif
+#if 0
+ else if (TYPE_CODE (type) == TYPE_CODE_STRUCT
+ || TYPE_CODE (type) == TYPE_CODE_UNION)
+ {
+ /* A structure or union. Extract the left justified value,
+ regardless of the byte order. I.e. DO NOT USE
+ mips_xfer_lower. */
+ int offset;
+ int regnum;
+ for (offset = 0, regnum = V0_REGNUM;
+ offset < TYPE_LENGTH (type);
+ offset += register_size (current_gdbarch, regnum), regnum++)
+ {
+ int xfer = register_size (current_gdbarch, regnum);
+ if (offset + xfer > TYPE_LENGTH (type))
+ xfer = TYPE_LENGTH (type) - offset;
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stderr, "Return struct+%d:%d in $%d\n",
+ offset, xfer, regnum);
+ mips_xfer_register (regcache, NUM_REGS + regnum, xfer,
+ BFD_ENDIAN_UNKNOWN, readbuf, writebuf, offset);
+ }
+ return RETURN_VALUE_REGISTER_CONVENTION;
+ }
+#endif
+ else
+ {
+ /* A scalar extract each part but least-significant-byte
+ justified. o32 thinks registers are 4 byte, regardless of
+ the ISA. mips_stack_argsize controls this. */
+ int offset;
+ int regnum;
+ for (offset = 0, regnum = V0_REGNUM;
+ offset < TYPE_LENGTH (type);
+ offset += mips_stack_argsize (tdep), regnum++)
+ {
+ int xfer = mips_stack_argsize (tdep);
+ int pos = 0;
+ if (offset + xfer > TYPE_LENGTH (type))
+ xfer = TYPE_LENGTH (type) - offset;
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stderr, "Return scalar+%d:%d in $%d\n",
+ offset, xfer, regnum);
+ mips_xfer_register (regcache, NUM_REGS + regnum, xfer,
+ TARGET_BYTE_ORDER, readbuf, writebuf, offset);
+ }
+ return RETURN_VALUE_REGISTER_CONVENTION;
+ }
+}
+
+/* O64 ABI. This is a hacked up kind of 64-bit version of the o32
+ ABI. */
static CORE_ADDR
mips_o64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
- struct regcache *regcache, CORE_ADDR bp_addr, int nargs,
- struct value **args, CORE_ADDR sp, int struct_return,
- CORE_ADDR struct_addr)
+ struct regcache *regcache, CORE_ADDR bp_addr,
+ int nargs,
+ struct value **args, CORE_ADDR sp,
+ int struct_return, CORE_ADDR struct_addr)
{
int argreg;
int float_argreg;
@@ -3554,12 +3981,12 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
/* Now make space on the stack for the args. */
for (argnum = 0; argnum < nargs; argnum++)
- len += align_up (TYPE_LENGTH (VALUE_TYPE (args[argnum])),
+ len += align_up (TYPE_LENGTH (VALUE_TYPE (args[argnum])),
mips_stack_argsize (tdep));
sp -= align_up (len, 16);
if (mips_debug)
- fprintf_unfiltered (gdb_stdlog,
+ fprintf_unfiltered (gdb_stdlog,
"mips_o64_push_dummy_call: sp=0x%s allocated %ld\n",
paddr_nz (sp), (long) align_up (len, 16));
@@ -3602,8 +4029,7 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
up before the check to see if there are any FP registers
left. O32/O64 targets also pass the FP in the integer
registers so also round up normal registers. */
- if (!FP_REGISTER_DOUBLE
- && fp_register_arg_p (typecode, arg_type))
+ if (!FP_REGISTER_DOUBLE && fp_register_arg_p (typecode, arg_type))
{
if ((float_argreg & 1))
float_argreg++;
@@ -3655,16 +4081,16 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
/* This is a floating point value that fits entirely
in a single register. */
/* On 32 bit ABI's the float_argreg is further adjusted
- above to ensure that it is even register aligned. */
+ above to ensure that it is even register aligned. */
LONGEST regval = extract_unsigned_integer (val, len);
if (mips_debug)
fprintf_unfiltered (gdb_stdlog, " - fpreg=%d val=%s",
float_argreg, phex (regval, len));
write_register (float_argreg++, regval);
/* CAGNEY: 32 bit MIPS ABI's always reserve two FP
- registers for each argument. The below is (my
- guess) to ensure that the corresponding integer
- register has reserved the same space. */
+ registers for each argument. The below is (my
+ guess) to ensure that the corresponding integer
+ register has reserved the same space. */
if (mips_debug)
fprintf_unfiltered (gdb_stdlog, " - reg=%d val=%s",
argreg, phex (regval, len));
@@ -3692,10 +4118,10 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
&& mips_type_needs_double_align (arg_type))
{
if ((argreg & 1))
- argreg++;
+ argreg++;
}
/* Note: Floating-point values that didn't fit into an FP
- register are only written to memory. */
+ register are only written to memory. */
while (len > 0)
{
/* Remember if the argument was written to the stack. */
@@ -3722,8 +4148,7 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
if (mips_stack_argsize (tdep) == 8
&& (typecode == TYPE_CODE_INT
|| typecode == TYPE_CODE_PTR
- || typecode == TYPE_CODE_FLT)
- && len <= 4)
+ || typecode == TYPE_CODE_FLT) && len <= 4)
longword_offset = mips_stack_argsize (tdep) - len;
}
@@ -3740,11 +4165,11 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
if (mips_debug)
{
int i;
- fprintf_unfiltered (gdb_stdlog, " @0x%s ",
+ fprintf_unfiltered (gdb_stdlog, " @0x%s ",
paddr_nz (addr));
for (i = 0; i < partial_len; i++)
{
- fprintf_unfiltered (gdb_stdlog, "%02x",
+ fprintf_unfiltered (gdb_stdlog, "%02x",
val[i] & 0xff);
}
}
@@ -3755,7 +4180,7 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
structs may go thru BOTH paths. Floating point
arguments will not. */
/* Write this portion of the argument to a general
- purpose register. */
+ purpose register. */
if (argreg <= MIPS_LAST_ARG_REGNUM
&& !fp_register_arg_p (typecode, arg_type))
{
@@ -3799,7 +4224,8 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
if (mips_debug)
fprintf_filtered (gdb_stdlog, " - reg=%d val=%s",
argreg,
- phex (regval, mips_saved_regsize (tdep)));
+ phex (regval,
+ mips_saved_regsize (tdep)));
write_register (argreg, regval);
argreg++;
@@ -3812,12 +4238,12 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
val += partial_len;
/* Compute the the offset into the stack at which we
- will copy the next parameter.
+ will copy the next parameter.
- In older ABIs, the caller reserved space for
- registers that contained arguments. This was loosely
- refered to as their "home". Consequently, space is
- always allocated. */
+ In older ABIs, the caller reserved space for
+ registers that contained arguments. This was loosely
+ refered to as their "home". Consequently, space is
+ always allocated. */
stack_offset += align_up (partial_len,
mips_stack_argsize (tdep));
@@ -3834,6 +4260,49 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
}
static void
+mips_o64_extract_return_value (struct type *valtype,
+ char regbuf[], char *valbuf)
+{
+ struct return_value_word lo;
+ struct return_value_word hi;
+ return_value_location (valtype, &hi, &lo);
+
+ memcpy (valbuf + lo.buf_offset,
+ regbuf + DEPRECATED_REGISTER_BYTE (NUM_REGS + lo.reg) +
+ lo.reg_offset, lo.len);
+
+ if (hi.len > 0)
+ memcpy (valbuf + hi.buf_offset,
+ regbuf + DEPRECATED_REGISTER_BYTE (NUM_REGS + hi.reg) +
+ hi.reg_offset, hi.len);
+}
+
+static void
+mips_o64_store_return_value (struct type *valtype, char *valbuf)
+{
+ char raw_buffer[MAX_REGISTER_SIZE];
+ struct return_value_word lo;
+ struct return_value_word hi;
+ return_value_location (valtype, &hi, &lo);
+
+ memset (raw_buffer, 0, sizeof (raw_buffer));
+ memcpy (raw_buffer + lo.reg_offset, valbuf + lo.buf_offset, lo.len);
+ deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (lo.reg),
+ raw_buffer, register_size (current_gdbarch,
+ lo.reg));
+
+ if (hi.len > 0)
+ {
+ memset (raw_buffer, 0, sizeof (raw_buffer));
+ memcpy (raw_buffer + hi.reg_offset, valbuf + hi.buf_offset, hi.len);
+ deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (hi.reg),
+ raw_buffer,
+ register_size (current_gdbarch,
+ hi.reg));
+ }
+}
+
+static void
mips_pop_frame (void)
{
int regnum;
@@ -3850,22 +4319,26 @@ mips_pop_frame (void)
}
proc_desc = get_frame_extra_info (frame)->proc_desc;
- write_register (PC_REGNUM, DEPRECATED_FRAME_SAVED_PC (frame));
+ write_register (mips_regnum (current_gdbarch)->pc,
+ DEPRECATED_FRAME_SAVED_PC (frame));
mips_find_saved_regs (frame);
for (regnum = 0; regnum < NUM_REGS; regnum++)
- if (regnum != SP_REGNUM && regnum != PC_REGNUM
+ if (regnum != SP_REGNUM && regnum != mips_regnum (current_gdbarch)->pc
&& deprecated_get_frame_saved_regs (frame)[regnum])
{
/* Floating point registers must not be sign extended, in case
mips_saved_regsize() = 4 but sizeof (FP0_REGNUM) == 8. */
- if (mips_regnum (current_gdbarch)->fp0 <= regnum && regnum < mips_regnum (current_gdbarch)->fp0 + 32)
+ if (mips_regnum (current_gdbarch)->fp0 <= regnum
+ && regnum < mips_regnum (current_gdbarch)->fp0 + 32)
write_register (regnum,
- read_memory_unsigned_integer (deprecated_get_frame_saved_regs (frame)[regnum],
- mips_saved_regsize (tdep)));
+ read_memory_unsigned_integer
+ (deprecated_get_frame_saved_regs (frame)[regnum],
+ mips_saved_regsize (tdep)));
else
write_register (regnum,
- read_memory_integer (deprecated_get_frame_saved_regs (frame)[regnum],
+ read_memory_integer (deprecated_get_frame_saved_regs
+ (frame)[regnum],
mips_saved_regsize (tdep)));
}
@@ -3877,8 +4350,7 @@ mips_pop_frame (void)
struct linked_proc_info *pi_ptr, *prev_ptr;
for (pi_ptr = linked_proc_desc_table, prev_ptr = NULL;
- pi_ptr != NULL;
- prev_ptr = pi_ptr, pi_ptr = pi_ptr->next)
+ pi_ptr != NULL; prev_ptr = pi_ptr, pi_ptr = pi_ptr->next)
{
if (&pi_ptr->info == proc_desc)
break;
@@ -3905,7 +4377,8 @@ mips_pop_frame (void)
if (MIPS_FPU_TYPE != MIPS_FPU_NONE)
write_register (mips_regnum (current_gdbarch)->fp_control_status,
read_memory_integer ((new_sp
- - 4 * mips_saved_regsize (tdep)),
+ -
+ 4 * mips_saved_regsize (tdep)),
mips_saved_regsize (tdep)));
}
}
@@ -3973,7 +4446,7 @@ mips_read_fp_register_single (struct frame_info *frame, int regno,
if (raw_size == 8)
{
/* We have a 64-bit value for this register. Find the low-order
- 32 bits. */
+ 32 bits. */
int offset;
if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
@@ -4002,7 +4475,7 @@ mips_read_fp_register_double (struct frame_info *frame, int regno,
if (raw_size == 8 && !mips2_fp_compat ())
{
/* We have a 64-bit value for this register, and we should use
- all 64 bits. */
+ all 64 bits. */
if (!frame_register_read (frame, regno, rare_buffer))
error ("can't read register %d (%s)", regno, REGISTER_NAME (regno));
}
@@ -4014,7 +4487,7 @@ mips_read_fp_register_double (struct frame_info *frame, int regno,
"odd-numbered FP register");
/* mips_read_fp_register_single will find the correct 32 bits from
- each register. */
+ each register. */
if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
{
mips_read_fp_register_single (frame, regno, rare_buffer + 4);
@@ -4036,7 +4509,10 @@ mips_print_fp_register (struct ui_file *file, struct frame_info *frame,
double doub, flt1, flt2; /* doubles extracted from raw hex data */
int inv1, inv2, namelen;
- raw_buffer = (char *) alloca (2 * register_size (current_gdbarch, mips_regnum (current_gdbarch)->fp0));
+ raw_buffer =
+ (char *) alloca (2 *
+ register_size (current_gdbarch,
+ mips_regnum (current_gdbarch)->fp0));
fprintf_filtered (file, "%s:", REGISTER_NAME (regnum));
fprintf_filtered (file, "%*s", 4 - (int) strlen (REGISTER_NAME (regnum)),
@@ -4049,7 +4525,8 @@ mips_print_fp_register (struct ui_file *file, struct frame_info *frame,
mips_read_fp_register_single (frame, regnum, raw_buffer);
flt1 = unpack_double (mips_float_register_type (), raw_buffer, &inv1);
- print_scalar_formatted (raw_buffer, builtin_type_uint32, 'x', 'w', file);
+ print_scalar_formatted (raw_buffer, builtin_type_uint32, 'x', 'w',
+ file);
fprintf_filtered (file, " flt: ");
if (inv1)
@@ -4061,7 +4538,7 @@ mips_print_fp_register (struct ui_file *file, struct frame_info *frame,
{
mips_read_fp_register_double (frame, regnum, raw_buffer);
doub = unpack_double (mips_double_register_type (), raw_buffer,
- &inv2);
+ &inv2);
fprintf_filtered (file, " dbl: ");
if (inv2)
@@ -4080,7 +4557,8 @@ mips_print_fp_register (struct ui_file *file, struct frame_info *frame,
doub = unpack_double (mips_double_register_type (), raw_buffer, &inv2);
- print_scalar_formatted (raw_buffer, builtin_type_uint64, 'x', 'g', file);
+ print_scalar_formatted (raw_buffer, builtin_type_uint64, 'x', 'g',
+ file);
fprintf_filtered (file, " flt: ");
if (inv1)
@@ -4129,12 +4607,15 @@ mips_print_register (struct ui_file *file, struct frame_info *frame,
fprintf_filtered (file, ": ");
if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
- offset = register_size (current_gdbarch, regnum) - register_size (current_gdbarch, regnum);
+ offset =
+ register_size (current_gdbarch,
+ regnum) - register_size (current_gdbarch, regnum);
else
offset = 0;
- print_scalar_formatted (raw_buffer + offset, gdbarch_register_type (gdbarch, regnum),
- 'x', 0, file);
+ print_scalar_formatted (raw_buffer + offset,
+ gdbarch_register_type (gdbarch, regnum), 'x', 0,
+ file);
}
/* Replacement for generic do_registers_info.
@@ -4167,14 +4648,15 @@ print_gp_register_row (struct ui_file *file, struct frame_info *frame,
/* For GP registers, we print a separate row of names above the vals */
fprintf_filtered (file, " ");
for (col = 0, regnum = start_regnum;
- col < ncols && regnum < NUM_REGS + NUM_PSEUDO_REGS;
- regnum++)
+ col < ncols && regnum < NUM_REGS + NUM_PSEUDO_REGS; regnum++)
{
if (*REGISTER_NAME (regnum) == '\0')
continue; /* unused register */
- if (TYPE_CODE (gdbarch_register_type (gdbarch, regnum)) == TYPE_CODE_FLT)
+ if (TYPE_CODE (gdbarch_register_type (gdbarch, regnum)) ==
+ TYPE_CODE_FLT)
break; /* end the row: reached FP register */
- fprintf_filtered (file, mips_regsize (current_gdbarch) == 8 ? "%17s" : "%9s",
+ fprintf_filtered (file,
+ mips_regsize (current_gdbarch) == 8 ? "%17s" : "%9s",
REGISTER_NAME (regnum));
col++;
}
@@ -4186,12 +4668,12 @@ print_gp_register_row (struct ui_file *file, struct frame_info *frame,
/* now print the values in hex, 4 or 8 to the row */
for (col = 0, regnum = start_regnum;
- col < ncols && regnum < NUM_REGS + NUM_PSEUDO_REGS;
- regnum++)
+ col < ncols && regnum < NUM_REGS + NUM_PSEUDO_REGS; regnum++)
{
if (*REGISTER_NAME (regnum) == '\0')
continue; /* unused register */
- if (TYPE_CODE (gdbarch_register_type (gdbarch, regnum)) == TYPE_CODE_FLT)
+ if (TYPE_CODE (gdbarch_register_type (gdbarch, regnum)) ==
+ TYPE_CODE_FLT)
break; /* end row: reached FP register */
/* OK: get the data in raw format. */
if (!frame_register_read (frame, regnum, raw_buffer))
@@ -4199,19 +4681,18 @@ print_gp_register_row (struct ui_file *file, struct frame_info *frame,
/* pad small registers */
for (byte = 0;
byte < (mips_regsize (current_gdbarch)
- - register_size (current_gdbarch, regnum));
- byte++)
+ - register_size (current_gdbarch, regnum)); byte++)
printf_filtered (" ");
/* Now print the register value in hex, endian order. */
if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
- for (byte = register_size (current_gdbarch, regnum) - register_size (current_gdbarch, regnum);
- byte < register_size (current_gdbarch, regnum);
- byte++)
+ for (byte =
+ register_size (current_gdbarch,
+ regnum) - register_size (current_gdbarch, regnum);
+ byte < register_size (current_gdbarch, regnum); byte++)
fprintf_filtered (file, "%02x", (unsigned char) raw_buffer[byte]);
else
for (byte = register_size (current_gdbarch, regnum) - 1;
- byte >= 0;
- byte--)
+ byte >= 0; byte--)
fprintf_filtered (file, "%02x", (unsigned char) raw_buffer[byte]);
fprintf_filtered (file, " ");
col++;
@@ -4243,7 +4724,8 @@ mips_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file,
regnum = NUM_REGS;
while (regnum < NUM_REGS + NUM_PSEUDO_REGS)
{
- if (TYPE_CODE (gdbarch_register_type (gdbarch, regnum)) == TYPE_CODE_FLT)
+ if (TYPE_CODE (gdbarch_register_type (gdbarch, regnum)) ==
+ TYPE_CODE_FLT)
{
if (all) /* true for "INFO ALL-REGISTERS" command */
regnum = print_fp_register_row (file, frame, regnum);
@@ -4286,7 +4768,8 @@ mips_step_skips_delay (CORE_ADDR pc)
if (target_read_memory (pc, buf, MIPS_INSTLEN) != 0)
/* If error reading memory, guess that it is not a delayed branch. */
return 0;
- return is_delayed ((unsigned long) extract_unsigned_integer (buf, MIPS_INSTLEN));
+ return is_delayed ((unsigned long)
+ extract_unsigned_integer (buf, MIPS_INSTLEN));
}
@@ -4329,7 +4812,7 @@ skip_prologue_using_sal (CORE_ADDR func_addr)
if (sal.line == 0)
break;
/* Assume that a consecutive SAL for the same (or larger)
- line mark the prologue -> body transition. */
+ line mark the prologue -> body transition. */
if (sal.line >= prologue_sal.line)
break;
/* The case in which compiler's optimizer/scheduler has
@@ -4359,7 +4842,7 @@ mips32_skip_prologue (CORE_ADDR pc)
/* Find an upper bound on the prologue. */
end_pc = skip_prologue_using_sal (pc);
if (end_pc == 0)
- end_pc = pc + 100; /* Magic. */
+ end_pc = pc + 100; /* Magic. */
/* Skip the typical prologue instructions. These are the stack adjustment
instruction and the instructions that save registers on the stack
@@ -4419,7 +4902,7 @@ mips32_skip_prologue (CORE_ADDR pc)
else if (high_word == 0x3421 || /* ori $at,$at,n */
high_word == 0x3508 || /* ori $t0,$t0,n */
high_word == 0x3401 || /* ori $at,$zero,n */
- high_word == 0x3408) /* ori $t0,$zero,n */
+ high_word == 0x3408) /* ori $t0,$zero,n */
{
load_immediate_bytes += MIPS_INSTLEN; /* FIXME!! */
continue;
@@ -4451,65 +4934,53 @@ mips16_skip_prologue (CORE_ADDR pc)
/* Table of instructions likely to be found in a function prologue. */
static struct
- {
- unsigned short inst;
- unsigned short mask;
- }
+ {
+ unsigned short inst;
+ unsigned short mask;
+ }
table[] =
{
{
- 0x6300, 0xff00
- }
+ 0x6300, 0xff00}
, /* addiu $sp,offset */
{
- 0xfb00, 0xff00
- }
+ 0xfb00, 0xff00}
, /* daddiu $sp,offset */
{
- 0xd000, 0xf800
- }
+ 0xd000, 0xf800}
, /* sw reg,n($sp) */
{
- 0xf900, 0xff00
- }
+ 0xf900, 0xff00}
, /* sd reg,n($sp) */
{
- 0x6200, 0xff00
- }
+ 0x6200, 0xff00}
, /* sw $ra,n($sp) */
{
- 0xfa00, 0xff00
- }
+ 0xfa00, 0xff00}
, /* sd $ra,n($sp) */
{
- 0x673d, 0xffff
- }
+ 0x673d, 0xffff}
, /* move $s1,sp */
{
- 0xd980, 0xff80
- }
+ 0xd980, 0xff80}
, /* sw $a0-$a3,n($s1) */
{
- 0x6704, 0xff1c
- }
+ 0x6704, 0xff1c}
, /* move reg,$a0-$a3 */
{
- 0xe809, 0xf81f
- }
+ 0xe809, 0xf81f}
, /* entry pseudo-op */
{
- 0x0100, 0xff00
- }
+ 0x0100, 0xff00}
, /* addiu $s1,$sp,n */
{
- 0, 0
- } /* end of table marker */
+ 0, 0} /* end of table marker */
};
/* Find an upper bound on the prologue. */
end_pc = skip_prologue_using_sal (pc);
if (end_pc == 0)
- end_pc = pc + 100; /* Magic. */
+ end_pc = pc + 100; /* Magic. */
/* Skip the typical prologue instructions. These are the stack adjustment
instruction and the instructions that save registers on the stack
@@ -4580,456 +5051,6 @@ mips_skip_prologue (CORE_ADDR pc)
return mips32_skip_prologue (pc);
}
-/* Determine how a return value is stored within the MIPS register
- file, given the return type `valtype'. */
-
-struct return_value_word
-{
- int len;
- int reg;
- int reg_offset;
- int buf_offset;
-};
-
-static void
-return_value_location (struct type *valtype,
- struct return_value_word *hi,
- struct return_value_word *lo)
-{
- int len = TYPE_LENGTH (valtype);
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
-
- if (TYPE_CODE (valtype) == TYPE_CODE_FLT
- && ((MIPS_FPU_TYPE == MIPS_FPU_DOUBLE && (len == 4 || len == 8))
- || (MIPS_FPU_TYPE == MIPS_FPU_SINGLE && len == 4)))
- {
- if (!FP_REGISTER_DOUBLE && len == 8)
- {
- /* We need to break a 64bit float in two 32 bit halves and
- spread them across a floating-point register pair. */
- lo->buf_offset = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? 4 : 0;
- hi->buf_offset = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? 0 : 4;
- lo->reg_offset = ((TARGET_BYTE_ORDER == BFD_ENDIAN_BIG
- && register_size (current_gdbarch, mips_regnum (current_gdbarch)->fp0) == 8)
- ? 4 : 0);
- hi->reg_offset = lo->reg_offset;
- lo->reg = mips_regnum (current_gdbarch)->fp0 + 0;
- hi->reg = mips_regnum (current_gdbarch)->fp0 + 1;
- lo->len = 4;
- hi->len = 4;
- }
- else
- {
- /* The floating point value fits in a single floating-point
- register. */
- lo->reg_offset = ((TARGET_BYTE_ORDER == BFD_ENDIAN_BIG
- && register_size (current_gdbarch, mips_regnum (current_gdbarch)->fp0) == 8
- && len == 4)
- ? 4 : 0);
- lo->reg = mips_regnum (current_gdbarch)->fp0;
- lo->len = len;
- lo->buf_offset = 0;
- hi->len = 0;
- hi->reg_offset = 0;
- hi->buf_offset = 0;
- hi->reg = 0;
- }
- }
- else
- {
- /* Locate a result possibly spread across two registers. */
- int regnum = 2;
- lo->reg = regnum + 0;
- hi->reg = regnum + 1;
- if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG
- && len < mips_saved_regsize (tdep))
- {
- /* "un-left-justify" the value in the low register */
- lo->reg_offset = mips_saved_regsize (tdep) - len;
- lo->len = len;
- hi->reg_offset = 0;
- hi->len = 0;
- }
- else if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG
- && len > mips_saved_regsize (tdep) /* odd-size structs */
- && len < mips_saved_regsize (tdep) * 2
- && (TYPE_CODE (valtype) == TYPE_CODE_STRUCT ||
- TYPE_CODE (valtype) == TYPE_CODE_UNION))
- {
- /* "un-left-justify" the value spread across two registers. */
- lo->reg_offset = 2 * mips_saved_regsize (tdep) - len;
- lo->len = mips_saved_regsize (tdep) - lo->reg_offset;
- hi->reg_offset = 0;
- hi->len = len - lo->len;
- }
- else
- {
- /* Only perform a partial copy of the second register. */
- lo->reg_offset = 0;
- hi->reg_offset = 0;
- if (len > mips_saved_regsize (tdep))
- {
- lo->len = mips_saved_regsize (tdep);
- hi->len = len - mips_saved_regsize (tdep);
- }
- else
- {
- lo->len = len;
- hi->len = 0;
- }
- }
- if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG
- && register_size (current_gdbarch, regnum) == 8
- && mips_saved_regsize (tdep) == 4)
- {
- /* Account for the fact that only the least-signficant part
- of the register is being used */
- lo->reg_offset += 4;
- hi->reg_offset += 4;
- }
- lo->buf_offset = 0;
- hi->buf_offset = lo->len;
- }
-}
-
-/* Given a return value in `regbuf' with a type `valtype', extract and
- copy its value into `valbuf'. */
-
-static void
-mips_eabi_extract_return_value (struct type *valtype,
- char regbuf[],
- char *valbuf)
-{
- struct return_value_word lo;
- struct return_value_word hi;
- return_value_location (valtype, &hi, &lo);
-
- memcpy (valbuf + lo.buf_offset,
- regbuf + DEPRECATED_REGISTER_BYTE (NUM_REGS + lo.reg) + lo.reg_offset,
- lo.len);
-
- if (hi.len > 0)
- memcpy (valbuf + hi.buf_offset,
- regbuf + DEPRECATED_REGISTER_BYTE (NUM_REGS + hi.reg) + hi.reg_offset,
- hi.len);
-}
-
-static void
-mips_o64_extract_return_value (struct type *valtype,
- char regbuf[],
- char *valbuf)
-{
- struct return_value_word lo;
- struct return_value_word hi;
- return_value_location (valtype, &hi, &lo);
-
- memcpy (valbuf + lo.buf_offset,
- regbuf + DEPRECATED_REGISTER_BYTE (NUM_REGS + lo.reg) + lo.reg_offset,
- lo.len);
-
- if (hi.len > 0)
- memcpy (valbuf + hi.buf_offset,
- regbuf + DEPRECATED_REGISTER_BYTE (NUM_REGS + hi.reg) + hi.reg_offset,
- hi.len);
-}
-
-/* Given a return value in `valbuf' with a type `valtype', write it's
- value into the appropriate register. */
-
-static void
-mips_eabi_store_return_value (struct type *valtype, char *valbuf)
-{
- char raw_buffer[MAX_REGISTER_SIZE];
- struct return_value_word lo;
- struct return_value_word hi;
- return_value_location (valtype, &hi, &lo);
-
- memset (raw_buffer, 0, sizeof (raw_buffer));
- memcpy (raw_buffer + lo.reg_offset, valbuf + lo.buf_offset, lo.len);
- deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (lo.reg), raw_buffer,
- register_size (current_gdbarch, lo.reg));
-
- if (hi.len > 0)
- {
- memset (raw_buffer, 0, sizeof (raw_buffer));
- memcpy (raw_buffer + hi.reg_offset, valbuf + hi.buf_offset, hi.len);
- deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (hi.reg), raw_buffer,
- register_size (current_gdbarch, hi.reg));
- }
-}
-
-static void
-mips_o64_store_return_value (struct type *valtype, char *valbuf)
-{
- char raw_buffer[MAX_REGISTER_SIZE];
- struct return_value_word lo;
- struct return_value_word hi;
- return_value_location (valtype, &hi, &lo);
-
- memset (raw_buffer, 0, sizeof (raw_buffer));
- memcpy (raw_buffer + lo.reg_offset, valbuf + lo.buf_offset, lo.len);
- deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (lo.reg), raw_buffer,
- register_size (current_gdbarch, lo.reg));
-
- if (hi.len > 0)
- {
- memset (raw_buffer, 0, sizeof (raw_buffer));
- memcpy (raw_buffer + hi.reg_offset, valbuf + hi.buf_offset, hi.len);
- deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (hi.reg), raw_buffer,
- register_size (current_gdbarch, hi.reg));
- }
-}
-
-/* O32 ABI stuff. */
-
-static enum return_value_convention
-mips_o32_return_value (struct gdbarch *gdbarch, struct type *type,
- struct regcache *regcache,
- void *readbuf, const void *writebuf)
-{
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
-
- if (TYPE_CODE (type)== TYPE_CODE_STRUCT
- || TYPE_CODE (type)== TYPE_CODE_UNION
- || TYPE_CODE (type)== TYPE_CODE_ARRAY)
- return RETURN_VALUE_STRUCT_CONVENTION;
- else if (TYPE_CODE (type) == TYPE_CODE_FLT
- && TYPE_LENGTH (type) == 4
- && tdep->mips_fpu_type != MIPS_FPU_NONE)
- {
- /* A single-precision floating-point value. It fits in the
- least significant part of FP0. */
- if (mips_debug)
- fprintf_unfiltered (gdb_stderr, "Return float in $fp0\n");
- mips_xfer_register (regcache,
- NUM_REGS + mips_regnum (current_gdbarch)->fp0,
- TYPE_LENGTH (type),
- TARGET_BYTE_ORDER, readbuf, writebuf, 0);
- return RETURN_VALUE_REGISTER_CONVENTION;
- }
- else if (TYPE_CODE (type) == TYPE_CODE_FLT
- && TYPE_LENGTH (type) == 8
- && tdep->mips_fpu_type != MIPS_FPU_NONE)
- {
- /* A double-precision floating-point value. The most
- significant part goes in FP1, and the least significant in
- FP0. */
- if (mips_debug)
- fprintf_unfiltered (gdb_stderr, "Return float in $fp1/$fp0\n");
- switch (TARGET_BYTE_ORDER)
- {
- case BFD_ENDIAN_LITTLE:
- mips_xfer_register (regcache,
- NUM_REGS + mips_regnum (current_gdbarch)->fp0 + 0,
- 4, TARGET_BYTE_ORDER, readbuf, writebuf, 0);
- mips_xfer_register (regcache,
- NUM_REGS + mips_regnum (current_gdbarch)->fp0 + 1,
- 4, TARGET_BYTE_ORDER, readbuf, writebuf, 4);
- break;
- case BFD_ENDIAN_BIG:
- mips_xfer_register (regcache,
- NUM_REGS + mips_regnum (current_gdbarch)->fp0 + 1,
- 4, TARGET_BYTE_ORDER, readbuf, writebuf, 0);
- mips_xfer_register (regcache,
- NUM_REGS + mips_regnum (current_gdbarch)->fp0 + 0,
- 4, TARGET_BYTE_ORDER, readbuf, writebuf, 4);
- break;
- default:
- internal_error (__FILE__, __LINE__, "bad switch");
- }
- return RETURN_VALUE_REGISTER_CONVENTION;
- }
-#if 0
- else if (TYPE_CODE (type) == TYPE_CODE_STRUCT
- && TYPE_NFIELDS (type) <= 2
- && TYPE_NFIELDS (type) >= 1
- && ((TYPE_NFIELDS (type) == 1
- && (TYPE_CODE (TYPE_FIELD_TYPE (type, 0))
- == TYPE_CODE_FLT))
- || (TYPE_NFIELDS (type) == 2
- && (TYPE_CODE (TYPE_FIELD_TYPE (type, 0))
- == TYPE_CODE_FLT)
- && (TYPE_CODE (TYPE_FIELD_TYPE (type, 1))
- == TYPE_CODE_FLT)))
- && tdep->mips_fpu_type != MIPS_FPU_NONE)
- {
- /* A struct that contains one or two floats. Each value is part
- in the least significant part of their floating point
- register.. */
- bfd_byte reg[MAX_REGISTER_SIZE];
- int regnum;
- int field;
- for (field = 0, regnum = mips_regnum (current_gdbarch)->fp0;
- field < TYPE_NFIELDS (type);
- field++, regnum += 2)
- {
- int offset = (FIELD_BITPOS (TYPE_FIELDS (type)[field])
- / TARGET_CHAR_BIT);
- if (mips_debug)
- fprintf_unfiltered (gdb_stderr, "Return float struct+%d\n", offset);
- mips_xfer_register (regcache, NUM_REGS + regnum,
- TYPE_LENGTH (TYPE_FIELD_TYPE (type, field)),
- TARGET_BYTE_ORDER, readbuf, writebuf, offset);
- }
- return RETURN_VALUE_REGISTER_CONVENTION;
- }
-#endif
-#if 0
- else if (TYPE_CODE (type) == TYPE_CODE_STRUCT
- || TYPE_CODE (type) == TYPE_CODE_UNION)
- {
- /* A structure or union. Extract the left justified value,
- regardless of the byte order. I.e. DO NOT USE
- mips_xfer_lower. */
- int offset;
- int regnum;
- for (offset = 0, regnum = V0_REGNUM;
- offset < TYPE_LENGTH (type);
- offset += register_size (current_gdbarch, regnum), regnum++)
- {
- int xfer = register_size (current_gdbarch, regnum);
- if (offset + xfer > TYPE_LENGTH (type))
- xfer = TYPE_LENGTH (type) - offset;
- if (mips_debug)
- fprintf_unfiltered (gdb_stderr, "Return struct+%d:%d in $%d\n",
- offset, xfer, regnum);
- mips_xfer_register (regcache, NUM_REGS + regnum, xfer,
- BFD_ENDIAN_UNKNOWN, readbuf, writebuf, offset);
- }
- return RETURN_VALUE_REGISTER_CONVENTION;
- }
-#endif
- else
- {
- /* A scalar extract each part but least-significant-byte
- justified. o32 thinks registers are 4 byte, regardless of
- the ISA. mips_stack_argsize controls this. */
- int offset;
- int regnum;
- for (offset = 0, regnum = V0_REGNUM;
- offset < TYPE_LENGTH (type);
- offset += mips_stack_argsize (tdep), regnum++)
- {
- int xfer = mips_stack_argsize (tdep);
- int pos = 0;
- if (offset + xfer > TYPE_LENGTH (type))
- xfer = TYPE_LENGTH (type) - offset;
- if (mips_debug)
- fprintf_unfiltered (gdb_stderr, "Return scalar+%d:%d in $%d\n",
- offset, xfer, regnum);
- mips_xfer_register (regcache, NUM_REGS + regnum, xfer,
- TARGET_BYTE_ORDER, readbuf, writebuf, offset);
- }
- return RETURN_VALUE_REGISTER_CONVENTION;
- }
-}
-
-/* N32/N44 ABI stuff. */
-
-static enum return_value_convention
-mips_n32n64_return_value (struct gdbarch *gdbarch,
- struct type *type, struct regcache *regcache,
- void *readbuf, const void *writebuf)
-{
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
- if (TYPE_CODE (type)== TYPE_CODE_STRUCT
- || TYPE_CODE (type)== TYPE_CODE_UNION
- || TYPE_CODE (type)== TYPE_CODE_ARRAY
- || TYPE_LENGTH (type) > 2 * mips_saved_regsize (tdep))
- return RETURN_VALUE_STRUCT_CONVENTION;
- else if (TYPE_CODE (type) == TYPE_CODE_FLT
- && tdep->mips_fpu_type != MIPS_FPU_NONE)
- {
- /* A floating-point value belongs in the least significant part
- of FP0. */
- if (mips_debug)
- fprintf_unfiltered (gdb_stderr, "Return float in $fp0\n");
- mips_xfer_register (regcache,
- NUM_REGS + mips_regnum (current_gdbarch)->fp0,
- TYPE_LENGTH (type),
- TARGET_BYTE_ORDER, readbuf, writebuf, 0);
- return RETURN_VALUE_REGISTER_CONVENTION;
- }
- else if (TYPE_CODE (type) == TYPE_CODE_STRUCT
- && TYPE_NFIELDS (type) <= 2
- && TYPE_NFIELDS (type) >= 1
- && ((TYPE_NFIELDS (type) == 1
- && (TYPE_CODE (TYPE_FIELD_TYPE (type, 0))
- == TYPE_CODE_FLT))
- || (TYPE_NFIELDS (type) == 2
- && (TYPE_CODE (TYPE_FIELD_TYPE (type, 0))
- == TYPE_CODE_FLT)
- && (TYPE_CODE (TYPE_FIELD_TYPE (type, 1))
- == TYPE_CODE_FLT)))
- && tdep->mips_fpu_type != MIPS_FPU_NONE)
- {
- /* A struct that contains one or two floats. Each value is part
- in the least significant part of their floating point
- register.. */
- bfd_byte reg[MAX_REGISTER_SIZE];
- int regnum;
- int field;
- for (field = 0, regnum = mips_regnum (current_gdbarch)->fp0;
- field < TYPE_NFIELDS (type);
- field++, regnum += 2)
- {
- int offset = (FIELD_BITPOS (TYPE_FIELDS (type)[field])
- / TARGET_CHAR_BIT);
- if (mips_debug)
- fprintf_unfiltered (gdb_stderr, "Return float struct+%d\n", offset);
- mips_xfer_register (regcache, NUM_REGS + regnum,
- TYPE_LENGTH (TYPE_FIELD_TYPE (type, field)),
- TARGET_BYTE_ORDER, readbuf, writebuf, offset);
- }
- return RETURN_VALUE_REGISTER_CONVENTION;
- }
- else if (TYPE_CODE (type) == TYPE_CODE_STRUCT
- || TYPE_CODE (type) == TYPE_CODE_UNION)
- {
- /* A structure or union. Extract the left justified value,
- regardless of the byte order. I.e. DO NOT USE
- mips_xfer_lower. */
- int offset;
- int regnum;
- for (offset = 0, regnum = V0_REGNUM;
- offset < TYPE_LENGTH (type);
- offset += register_size (current_gdbarch, regnum), regnum++)
- {
- int xfer = register_size (current_gdbarch, regnum);
- if (offset + xfer > TYPE_LENGTH (type))
- xfer = TYPE_LENGTH (type) - offset;
- if (mips_debug)
- fprintf_unfiltered (gdb_stderr, "Return struct+%d:%d in $%d\n",
- offset, xfer, regnum);
- mips_xfer_register (regcache, NUM_REGS + regnum, xfer,
- BFD_ENDIAN_UNKNOWN, readbuf, writebuf, offset);
- }
- return RETURN_VALUE_REGISTER_CONVENTION;
- }
- else
- {
- /* A scalar extract each part but least-significant-byte
- justified. */
- int offset;
- int regnum;
- for (offset = 0, regnum = V0_REGNUM;
- offset < TYPE_LENGTH (type);
- offset += register_size (current_gdbarch, regnum), regnum++)
- {
- int xfer = register_size (current_gdbarch, regnum);
- int pos = 0;
- if (offset + xfer > TYPE_LENGTH (type))
- xfer = TYPE_LENGTH (type) - offset;
- if (mips_debug)
- fprintf_unfiltered (gdb_stderr, "Return scalar+%d:%d in $%d\n",
- offset, xfer, regnum);
- mips_xfer_register (regcache, NUM_REGS + regnum, xfer,
- TARGET_BYTE_ORDER, readbuf, writebuf, offset);
- }
- return RETURN_VALUE_REGISTER_CONVENTION;
- }
-}
-
/* Exported procedure: Is PC in the signal trampoline code */
static int
@@ -5052,7 +5073,8 @@ show_mips_command (char *args, int from_tty)
static void
set_mips_command (char *args, int from_tty)
{
- printf_unfiltered ("\"set mips\" must be followed by an appropriate subcommand.\n");
+ printf_unfiltered
+ ("\"set mips\" must be followed by an appropriate subcommand.\n");
help_list (setmipscmdlist, "set mips ", all_commands, gdb_stdout);
}
@@ -5077,18 +5099,20 @@ show_mipsfpu_command (char *args, int from_tty)
internal_error (__FILE__, __LINE__, "bad switch");
}
if (mips_fpu_type_auto)
- printf_unfiltered ("The MIPS floating-point coprocessor is set automatically (currently %s)\n",
- fpu);
+ printf_unfiltered
+ ("The MIPS floating-point coprocessor is set automatically (currently %s)\n",
+ fpu);
else
- printf_unfiltered ("The MIPS floating-point coprocessor is assumed to be %s\n",
- fpu);
+ printf_unfiltered
+ ("The MIPS floating-point coprocessor is assumed to be %s\n", fpu);
}
static void
set_mipsfpu_command (char *args, int from_tty)
{
- printf_unfiltered ("\"set mipsfpu\" must be followed by \"double\", \"single\",\"none\" or \"auto\".\n");
+ printf_unfiltered
+ ("\"set mipsfpu\" must be followed by \"double\", \"single\",\"none\" or \"auto\".\n");
show_mipsfpu_command (args, from_tty);
}
@@ -5193,23 +5217,22 @@ gdb_print_insn_mips (bfd_vma memaddr, struct disassemble_info *info)
if (proc_desc)
{
if (pc_is_mips16 (PROC_LOW_ADDR (proc_desc)))
- info->mach = bfd_mach_mips16;
+ info->mach = bfd_mach_mips16;
}
else
{
if (pc_is_mips16 (memaddr))
- info->mach = bfd_mach_mips16;
- }
+ info->mach = bfd_mach_mips16;
+ }
/* Round down the instruction address to the appropriate boundary. */
memaddr &= (info->mach == bfd_mach_mips16 ? ~1 : ~3);
/* Set the disassembler options. */
- if (tdep->mips_abi == MIPS_ABI_N32
- || tdep->mips_abi == MIPS_ABI_N64)
+ if (tdep->mips_abi == MIPS_ABI_N32 || tdep->mips_abi == MIPS_ABI_N64)
{
/* Set up the disassembler info, so that we get the right
- register names from libopcodes. */
+ register names from libopcodes. */
if (tdep->mips_abi == MIPS_ABI_N32)
info->disassembler_options = "gpr-names=n32";
else
@@ -5239,13 +5262,13 @@ gdb_print_insn_mips (bfd_vma memaddr, struct disassemble_info *info)
breakpoint should be inserted. */
static const unsigned char *
-mips_breakpoint_from_pc (CORE_ADDR * pcptr, int *lenptr)
+mips_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
{
if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
{
if (pc_is_mips16 (*pcptr))
{
- static unsigned char mips16_big_breakpoint[] = {0xe8, 0xa5};
+ static unsigned char mips16_big_breakpoint[] = { 0xe8, 0xa5 };
*pcptr = unmake_mips16_addr (*pcptr);
*lenptr = sizeof (mips16_big_breakpoint);
return mips16_big_breakpoint;
@@ -5255,9 +5278,9 @@ mips_breakpoint_from_pc (CORE_ADDR * pcptr, int *lenptr)
/* 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};
+ 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);
@@ -5275,16 +5298,16 @@ mips_breakpoint_from_pc (CORE_ADDR * pcptr, int *lenptr)
{
if (pc_is_mips16 (*pcptr))
{
- static unsigned char mips16_little_breakpoint[] = {0xa5, 0xe8};
+ 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[] = {0xd, 0, 0x5, 0};
- static unsigned char pmon_little_breakpoint[] = {0xd, 0, 0, 0};
- static unsigned char idt_little_breakpoint[] = {0xd, 0x0a, 0, 0};
+ 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);
@@ -5367,7 +5390,8 @@ mips_skip_stub (CORE_ADDR pc)
int i;
/* See if the name of the target function is __fn_stub_*. */
- if (find_pc_partial_function (target_pc, &name, NULL, NULL) == 0)
+ if (find_pc_partial_function (target_pc, &name, NULL, NULL) ==
+ 0)
return target_pc;
if (strncmp (name, "__fn_stub_", 10) != 0
&& strcmp (name, "etext") != 0
@@ -5409,7 +5433,8 @@ mips_in_call_stub (CORE_ADDR pc, char *name)
/* Find the starting address of the function containing the PC. If the
caller didn't give us a name, look it up at the same time. */
- if (find_pc_partial_function (pc, name ? NULL : &name, &start_addr, NULL) == 0)
+ if (find_pc_partial_function (pc, name ? NULL : &name, &start_addr, NULL) ==
+ 0)
return 0;
if (strncmp (name, "__mips16_call_stub_", 19) == 0)
@@ -5447,8 +5472,7 @@ mips_in_return_stub (CORE_ADDR pc, char *name)
/* If the PC is in __mips16_call_stub_{s,d}f_{0..10} but not at the start,
i.e. after the jal instruction, this is effectively a return stub. */
if (strncmp (name, "__mips16_call_stub_", 19) == 0
- && (name[19] == 's' || name[19] == 'd')
- && pc != start_addr)
+ && (name[19] == 's' || name[19] == 'd') && pc != start_addr)
return 1;
return 0; /* not a stub */
@@ -5488,8 +5512,7 @@ mips_get_saved_register (char *raw_buffer,
int *optimizedp,
CORE_ADDR *addrp,
struct frame_info *frame,
- int regnum,
- enum lval_type *lvalp)
+ int regnum, enum lval_type *lvalp)
{
CORE_ADDR addrx;
enum lval_type lvalx;
@@ -5591,7 +5614,7 @@ mips_register_sim_regno (int regnum)
&& REGISTER_NAME (NUM_REGS + regnum)[0] != '\0')
return regnum;
else
- return LEGACY_SIM_REGNO_IGNORE;
+ return LEGACY_SIM_REGNO_IGNORE;
}
@@ -5646,13 +5669,11 @@ global_mips_abi (void)
if (mips_abi_strings[i] == mips_abi_string)
return (enum mips_abi) i;
- internal_error (__FILE__, __LINE__,
- "unknown ABI string");
+ internal_error (__FILE__, __LINE__, "unknown ABI string");
}
static struct gdbarch *
-mips_gdbarch_init (struct gdbarch_info info,
- struct gdbarch_list *arches)
+mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
{
struct gdbarch *gdbarch;
struct gdbarch_tdep *tdep;
@@ -5670,8 +5691,7 @@ mips_gdbarch_init (struct gdbarch_info info,
elf_flags = 0;
if (gdbarch_debug)
fprintf_unfiltered (gdb_stdlog,
- "mips_gdbarch_init: elf_flags = 0x%08x\n",
- elf_flags);
+ "mips_gdbarch_init: elf_flags = 0x%08x\n", elf_flags);
/* Check ELF_FLAGS to see if it specifies the ABI being used. */
switch ((elf_flags & EF_MIPS_ABI))
@@ -5786,8 +5806,7 @@ mips_gdbarch_init (struct gdbarch_info info,
fpu_type = MIPS_FPU_DOUBLE;
if (gdbarch_debug)
fprintf_unfiltered (gdb_stdlog,
- "mips_gdbarch_init: fpu_type = %d\n",
- fpu_type);
+ "mips_gdbarch_init: fpu_type = %d\n", fpu_type);
/* try to find a pre-existing architecture */
for (arches = gdbarch_list_lookup_by_info (arches, &info);
@@ -5830,7 +5849,7 @@ mips_gdbarch_init (struct gdbarch_info info,
set_gdbarch_pseudo_register_read (gdbarch, mips_pseudo_register_read);
set_gdbarch_pseudo_register_write (gdbarch, mips_pseudo_register_write);
- set_gdbarch_elf_make_msymbol_special (gdbarch,
+ set_gdbarch_elf_make_msymbol_special (gdbarch,
mips_elf_make_msymbol_special);
/* Fill in the OS dependant register numbers and names. */
@@ -5896,8 +5915,10 @@ mips_gdbarch_init (struct gdbarch_info info,
break;
case MIPS_ABI_O64:
set_gdbarch_push_dummy_call (gdbarch, mips_o64_push_dummy_call);
- set_gdbarch_deprecated_store_return_value (gdbarch, mips_o64_store_return_value);
- set_gdbarch_deprecated_extract_return_value (gdbarch, mips_o64_extract_return_value);
+ set_gdbarch_deprecated_store_return_value (gdbarch,
+ mips_o64_store_return_value);
+ set_gdbarch_deprecated_extract_return_value (gdbarch,
+ mips_o64_extract_return_value);
tdep->mips_default_saved_regsize = 8;
tdep->mips_default_stack_argsize = 8;
tdep->mips_fp_register_double = 1;
@@ -5907,12 +5928,15 @@ mips_gdbarch_init (struct gdbarch_info info,
set_gdbarch_long_bit (gdbarch, 32);
set_gdbarch_ptr_bit (gdbarch, 32);
set_gdbarch_long_long_bit (gdbarch, 64);
- set_gdbarch_use_struct_convention (gdbarch, always_use_struct_convention);
+ set_gdbarch_use_struct_convention (gdbarch,
+ always_use_struct_convention);
break;
case MIPS_ABI_EABI32:
set_gdbarch_push_dummy_call (gdbarch, mips_eabi_push_dummy_call);
- set_gdbarch_deprecated_store_return_value (gdbarch, mips_eabi_store_return_value);
- set_gdbarch_deprecated_extract_return_value (gdbarch, mips_eabi_extract_return_value);
+ set_gdbarch_deprecated_store_return_value (gdbarch,
+ mips_eabi_store_return_value);
+ set_gdbarch_deprecated_extract_return_value (gdbarch,
+ mips_eabi_extract_return_value);
tdep->mips_default_saved_regsize = 4;
tdep->mips_default_stack_argsize = 4;
tdep->mips_fp_register_double = 0;
@@ -5924,13 +5948,15 @@ mips_gdbarch_init (struct gdbarch_info info,
set_gdbarch_long_long_bit (gdbarch, 64);
set_gdbarch_deprecated_reg_struct_has_addr
(gdbarch, mips_eabi_reg_struct_has_addr);
- set_gdbarch_use_struct_convention (gdbarch,
+ set_gdbarch_use_struct_convention (gdbarch,
mips_eabi_use_struct_convention);
break;
case MIPS_ABI_EABI64:
set_gdbarch_push_dummy_call (gdbarch, mips_eabi_push_dummy_call);
- set_gdbarch_deprecated_store_return_value (gdbarch, mips_eabi_store_return_value);
- set_gdbarch_deprecated_extract_return_value (gdbarch, mips_eabi_extract_return_value);
+ set_gdbarch_deprecated_store_return_value (gdbarch,
+ mips_eabi_store_return_value);
+ set_gdbarch_deprecated_extract_return_value (gdbarch,
+ mips_eabi_extract_return_value);
tdep->mips_default_saved_regsize = 8;
tdep->mips_default_stack_argsize = 8;
tdep->mips_fp_register_double = 1;
@@ -5942,7 +5968,7 @@ mips_gdbarch_init (struct gdbarch_info info,
set_gdbarch_long_long_bit (gdbarch, 64);
set_gdbarch_deprecated_reg_struct_has_addr
(gdbarch, mips_eabi_reg_struct_has_addr);
- set_gdbarch_use_struct_convention (gdbarch,
+ set_gdbarch_use_struct_convention (gdbarch,
mips_eabi_use_struct_convention);
break;
case MIPS_ABI_N32:
@@ -5972,8 +5998,7 @@ mips_gdbarch_init (struct gdbarch_info info,
set_gdbarch_long_long_bit (gdbarch, 64);
break;
default:
- internal_error (__FILE__, __LINE__,
- "unknown ABI in switch");
+ internal_error (__FILE__, __LINE__, "unknown ABI in switch");
}
/* FIXME: jlarmour/2000-04-07: There *is* a flag EF_MIPS_32BIT_MODE
@@ -5998,8 +6023,8 @@ mips_gdbarch_init (struct gdbarch_info info,
as 32-bit programs by default. */
set_gdbarch_read_pc (gdbarch, mips_read_pc);
- set_gdbarch_write_pc (gdbarch, generic_target_write_pc);
- set_gdbarch_deprecated_target_read_fp (gdbarch, mips_read_sp); /* Draft FRAME base. */
+ set_gdbarch_write_pc (gdbarch, mips_write_pc);
+ set_gdbarch_deprecated_target_read_fp (gdbarch, mips_read_sp); /* Draft FRAME base. */
set_gdbarch_read_sp (gdbarch, mips_read_sp);
/* Add/remove bits from an address. The MIPS needs be careful to
@@ -6008,18 +6033,24 @@ mips_gdbarch_init (struct gdbarch_info info,
/* There's a mess in stack frame creation. See comments in
blockframe.c near reference to DEPRECATED_INIT_FRAME_PC_FIRST. */
- set_gdbarch_deprecated_init_frame_pc_first (gdbarch, mips_init_frame_pc_first);
+ set_gdbarch_deprecated_init_frame_pc_first (gdbarch,
+ mips_init_frame_pc_first);
/* Map debug register numbers onto internal register numbers. */
set_gdbarch_stab_reg_to_regnum (gdbarch, mips_stab_reg_to_regnum);
- set_gdbarch_ecoff_reg_to_regnum (gdbarch, mips_dwarf_dwarf2_ecoff_reg_to_regnum);
- set_gdbarch_dwarf_reg_to_regnum (gdbarch, mips_dwarf_dwarf2_ecoff_reg_to_regnum);
- set_gdbarch_dwarf2_reg_to_regnum (gdbarch, mips_dwarf_dwarf2_ecoff_reg_to_regnum);
+ set_gdbarch_ecoff_reg_to_regnum (gdbarch,
+ mips_dwarf_dwarf2_ecoff_reg_to_regnum);
+ set_gdbarch_dwarf_reg_to_regnum (gdbarch,
+ mips_dwarf_dwarf2_ecoff_reg_to_regnum);
+ set_gdbarch_dwarf2_reg_to_regnum (gdbarch,
+ mips_dwarf_dwarf2_ecoff_reg_to_regnum);
set_gdbarch_register_sim_regno (gdbarch, mips_register_sim_regno);
/* Initialize a frame */
- set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, mips_find_saved_regs);
- set_gdbarch_deprecated_init_extra_frame_info (gdbarch, mips_init_extra_frame_info);
+ set_gdbarch_deprecated_frame_init_saved_regs (gdbarch,
+ mips_find_saved_regs);
+ set_gdbarch_deprecated_init_extra_frame_info (gdbarch,
+ mips_init_extra_frame_info);
/* MIPS version of CALL_DUMMY */
@@ -6029,29 +6060,33 @@ mips_gdbarch_init (struct gdbarch_info info,
set_gdbarch_call_dummy_location (gdbarch, AT_SYMBOL);
set_gdbarch_deprecated_pop_frame (gdbarch, mips_pop_frame);
set_gdbarch_frame_align (gdbarch, mips_frame_align);
- set_gdbarch_deprecated_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos);
+ set_gdbarch_deprecated_save_dummy_frame_tos (gdbarch,
+ generic_save_dummy_frame_tos);
+
+ set_gdbarch_convert_register_p (gdbarch, mips_convert_register_p);
+ set_gdbarch_register_to_value (gdbarch, mips_register_to_value);
+ set_gdbarch_value_to_register (gdbarch, mips_value_to_register);
set_gdbarch_deprecated_frame_chain (gdbarch, mips_frame_chain);
- set_gdbarch_frameless_function_invocation (gdbarch,
+ set_gdbarch_frameless_function_invocation (gdbarch,
generic_frameless_function_invocation_not);
set_gdbarch_deprecated_frame_saved_pc (gdbarch, mips_frame_saved_pc);
set_gdbarch_frame_args_skip (gdbarch, 0);
- set_gdbarch_deprecated_get_saved_register (gdbarch, mips_get_saved_register);
+ set_gdbarch_deprecated_get_saved_register (gdbarch,
+ mips_get_saved_register);
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
set_gdbarch_breakpoint_from_pc (gdbarch, mips_breakpoint_from_pc);
- set_gdbarch_decr_pc_after_break (gdbarch, 0);
set_gdbarch_skip_prologue (gdbarch, mips_skip_prologue);
- set_gdbarch_deprecated_saved_pc_after_call (gdbarch, mips_saved_pc_after_call);
+ set_gdbarch_deprecated_saved_pc_after_call (gdbarch,
+ mips_saved_pc_after_call);
set_gdbarch_pointer_to_address (gdbarch, signed_pointer_to_address);
set_gdbarch_address_to_pointer (gdbarch, address_to_signed_pointer);
set_gdbarch_integer_to_address (gdbarch, mips_integer_to_address);
- set_gdbarch_function_start_offset (gdbarch, 0);
-
set_gdbarch_register_type (gdbarch, mips_register_type);
set_gdbarch_print_registers_info (gdbarch, mips_print_registers_info);
@@ -6079,8 +6114,7 @@ mips_gdbarch_init (struct gdbarch_info info,
}
static void
-mips_abi_update (char *ignore_args, int from_tty,
- struct cmd_list_element *c)
+mips_abi_update (char *ignore_args, int from_tty, struct cmd_list_element *c)
{
struct gdbarch_info info;
@@ -6096,8 +6130,8 @@ static void
show_mips_abi (char *ignore_args, int from_tty)
{
if (gdbarch_bfd_arch_info (current_gdbarch)->arch != bfd_arch_mips)
- printf_filtered (
- "The MIPS ABI is unknown because the current architecture is not MIPS.\n");
+ printf_filtered
+ ("The MIPS ABI is unknown because the current architecture is not MIPS.\n");
else
{
enum mips_abi global_abi = global_mips_abi ();
@@ -6105,19 +6139,19 @@ show_mips_abi (char *ignore_args, int from_tty)
const char *actual_abi_str = mips_abi_strings[actual_abi];
if (global_abi == MIPS_ABI_UNKNOWN)
- printf_filtered ("The MIPS ABI is set automatically (currently \"%s\").\n",
- actual_abi_str);
+ printf_filtered
+ ("The MIPS ABI is set automatically (currently \"%s\").\n",
+ actual_abi_str);
else if (global_abi == actual_abi)
- printf_filtered (
- "The MIPS ABI is assumed to be \"%s\" (due to user setting).\n",
- actual_abi_str);
+ printf_filtered
+ ("The MIPS ABI is assumed to be \"%s\" (due to user setting).\n",
+ actual_abi_str);
else
{
/* Probably shouldn't happen... */
- printf_filtered (
- "The (auto detected) MIPS ABI \"%s\" is in use even though the user setting was \"%s\".\n",
- actual_abi_str,
- mips_abi_strings[global_abi]);
+ printf_filtered
+ ("The (auto detected) MIPS ABI \"%s\" is in use even though the user setting was \"%s\".\n",
+ actual_abi_str, mips_abi_strings[global_abi]);
}
}
}
@@ -6162,8 +6196,7 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file)
ef_mips_arch);
fprintf_unfiltered (file,
"mips_dump_tdep: tdep->mips_abi = %d (%s)\n",
- tdep->mips_abi,
- mips_abi_strings[tdep->mips_abi]);
+ tdep->mips_abi, mips_abi_strings[tdep->mips_abi]);
fprintf_unfiltered (file,
"mips_dump_tdep: mips_mask_address_p() %d (default %d)\n",
mips_mask_address_p (tdep),
@@ -6179,9 +6212,7 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file)
: MIPS_DEFAULT_FPU_TYPE == MIPS_FPU_SINGLE ? "single"
: MIPS_DEFAULT_FPU_TYPE == MIPS_FPU_DOUBLE ? "double"
: "???"));
- fprintf_unfiltered (file,
- "mips_dump_tdep: MIPS_EABI = %d\n",
- MIPS_EABI);
+ fprintf_unfiltered (file, "mips_dump_tdep: MIPS_EABI = %d\n", MIPS_EABI);
fprintf_unfiltered (file,
"mips_dump_tdep: MIPS_FPU_TYPE = %d (%s)\n",
MIPS_FPU_TYPE,
@@ -6195,12 +6226,10 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file)
fprintf_unfiltered (file,
"mips_dump_tdep: mips_stack_argsize() = %d\n",
mips_stack_argsize (tdep));
- fprintf_unfiltered (file,
- "mips_dump_tdep: A0_REGNUM = %d\n",
- A0_REGNUM);
+ fprintf_unfiltered (file, "mips_dump_tdep: A0_REGNUM = %d\n", A0_REGNUM);
fprintf_unfiltered (file,
"mips_dump_tdep: ADDR_BITS_REMOVE # %s\n",
- XSTRING (ADDR_BITS_REMOVE(ADDR)));
+ XSTRING (ADDR_BITS_REMOVE (ADDR)));
fprintf_unfiltered (file,
"mips_dump_tdep: ATTACH_DETACH # %s\n",
XSTRING (ATTACH_DETACH));
@@ -6243,70 +6272,48 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file)
fprintf_unfiltered (file,
"mips_dump_tdep: MIPS16_INSTLEN = %d\n",
MIPS16_INSTLEN);
- fprintf_unfiltered (file,
- "mips_dump_tdep: MIPS_DEFAULT_ABI = FIXME!\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");
fprintf_unfiltered (file,
- "mips_dump_tdep: MIPS_INSTLEN = %d\n",
- MIPS_INSTLEN);
+ "mips_dump_tdep: MIPS_INSTLEN = %d\n", MIPS_INSTLEN);
fprintf_unfiltered (file,
"mips_dump_tdep: MIPS_LAST_ARG_REGNUM = %d (%d regs)\n",
MIPS_LAST_ARG_REGNUM,
MIPS_LAST_ARG_REGNUM - A0_REGNUM + 1);
fprintf_unfiltered (file,
- "mips_dump_tdep: MIPS_NUMREGS = %d\n",
- MIPS_NUMREGS);
+ "mips_dump_tdep: MIPS_NUMREGS = %d\n", MIPS_NUMREGS);
fprintf_unfiltered (file,
"mips_dump_tdep: mips_saved_regsize() = %d\n",
mips_saved_regsize (tdep));
fprintf_unfiltered (file,
- "mips_dump_tdep: PRID_REGNUM = %d\n",
- PRID_REGNUM);
+ "mips_dump_tdep: PRID_REGNUM = %d\n", PRID_REGNUM);
fprintf_unfiltered (file,
"mips_dump_tdep: PROC_DESC_IS_DUMMY = function?\n");
fprintf_unfiltered (file,
"mips_dump_tdep: PROC_FRAME_ADJUST = function?\n");
fprintf_unfiltered (file,
"mips_dump_tdep: PROC_FRAME_OFFSET = function?\n");
- fprintf_unfiltered (file,
- "mips_dump_tdep: PROC_FRAME_REG = function?\n");
- fprintf_unfiltered (file,
- "mips_dump_tdep: PROC_FREG_MASK = function?\n");
- fprintf_unfiltered (file,
- "mips_dump_tdep: PROC_FREG_OFFSET = function?\n");
- fprintf_unfiltered (file,
- "mips_dump_tdep: PROC_HIGH_ADDR = function?\n");
- fprintf_unfiltered (file,
- "mips_dump_tdep: PROC_LOW_ADDR = function?\n");
- fprintf_unfiltered (file,
- "mips_dump_tdep: PROC_PC_REG = function?\n");
- fprintf_unfiltered (file,
- "mips_dump_tdep: PROC_REG_MASK = function?\n");
- fprintf_unfiltered (file,
- "mips_dump_tdep: PROC_REG_OFFSET = function?\n");
- fprintf_unfiltered (file,
- "mips_dump_tdep: PROC_SYMBOL = function?\n");
- fprintf_unfiltered (file,
- "mips_dump_tdep: PS_REGNUM = %d\n",
- PS_REGNUM);
- fprintf_unfiltered (file,
- "mips_dump_tdep: RA_REGNUM = %d\n",
- RA_REGNUM);
+ fprintf_unfiltered (file, "mips_dump_tdep: PROC_FRAME_REG = function?\n");
+ fprintf_unfiltered (file, "mips_dump_tdep: PROC_FREG_MASK = function?\n");
+ fprintf_unfiltered (file, "mips_dump_tdep: PROC_FREG_OFFSET = function?\n");
+ fprintf_unfiltered (file, "mips_dump_tdep: PROC_HIGH_ADDR = function?\n");
+ fprintf_unfiltered (file, "mips_dump_tdep: PROC_LOW_ADDR = function?\n");
+ fprintf_unfiltered (file, "mips_dump_tdep: PROC_PC_REG = function?\n");
+ fprintf_unfiltered (file, "mips_dump_tdep: PROC_REG_MASK = function?\n");
+ fprintf_unfiltered (file, "mips_dump_tdep: PROC_REG_OFFSET = function?\n");
+ fprintf_unfiltered (file, "mips_dump_tdep: PROC_SYMBOL = function?\n");
+ fprintf_unfiltered (file, "mips_dump_tdep: PS_REGNUM = %d\n", PS_REGNUM);
+ fprintf_unfiltered (file, "mips_dump_tdep: RA_REGNUM = %d\n", RA_REGNUM);
#ifdef SAVED_BYTES
fprintf_unfiltered (file,
- "mips_dump_tdep: SAVED_BYTES = %d\n",
- SAVED_BYTES);
+ "mips_dump_tdep: SAVED_BYTES = %d\n", SAVED_BYTES);
#endif
#ifdef SAVED_FP
- fprintf_unfiltered (file,
- "mips_dump_tdep: SAVED_FP = %d\n",
- SAVED_FP);
+ fprintf_unfiltered (file, "mips_dump_tdep: SAVED_FP = %d\n", SAVED_FP);
#endif
#ifdef SAVED_PC
- fprintf_unfiltered (file,
- "mips_dump_tdep: SAVED_PC = %d\n",
- SAVED_PC);
+ fprintf_unfiltered (file, "mips_dump_tdep: SAVED_PC = %d\n", SAVED_PC);
#endif
fprintf_unfiltered (file,
"mips_dump_tdep: SETUP_ARBITRARY_FRAME # %s\n",
@@ -6314,8 +6321,7 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file)
fprintf_unfiltered (file,
"mips_dump_tdep: SET_PROC_DESC_IS_DUMMY = function?\n");
fprintf_unfiltered (file,
- "mips_dump_tdep: SIGFRAME_BASE = %d\n",
- SIGFRAME_BASE);
+ "mips_dump_tdep: SIGFRAME_BASE = %d\n", SIGFRAME_BASE);
fprintf_unfiltered (file,
"mips_dump_tdep: SIGFRAME_FPREGSAVE_OFF = %d\n",
SIGFRAME_FPREGSAVE_OFF);
@@ -6351,14 +6357,13 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file)
fprintf_unfiltered (file,
"mips_dump_tdep: STOPPED_BY_WATCHPOINT # %s\n",
XSTRING (STOPPED_BY_WATCHPOINT (WS)));
- fprintf_unfiltered (file,
- "mips_dump_tdep: T9_REGNUM = %d\n",
- T9_REGNUM);
+ fprintf_unfiltered (file, "mips_dump_tdep: T9_REGNUM = %d\n", T9_REGNUM);
fprintf_unfiltered (file,
"mips_dump_tdep: TABULAR_REGISTER_OUTPUT = used?\n");
fprintf_unfiltered (file,
"mips_dump_tdep: TARGET_CAN_USE_HARDWARE_WATCHPOINT # %s\n",
- XSTRING (TARGET_CAN_USE_HARDWARE_WATCHPOINT (TYPE,CNT,OTHERTYPE)));
+ XSTRING (TARGET_CAN_USE_HARDWARE_WATCHPOINT
+ (TYPE, CNT, OTHERTYPE)));
fprintf_unfiltered (file,
"mips_dump_tdep: TARGET_HAS_HARDWARE_WATCHPOINTS # %s\n",
XSTRING (TARGET_HAS_HARDWARE_WATCHPOINTS));
@@ -6369,8 +6374,7 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file)
#endif
#ifdef TRACE_FLAVOR
fprintf_unfiltered (file,
- "mips_dump_tdep: TRACE_FLAVOR = %d\n",
- TRACE_FLAVOR);
+ "mips_dump_tdep: TRACE_FLAVOR = %d\n", TRACE_FLAVOR);
#endif
#ifdef TRACE_FLAVOR_SIZE
fprintf_unfiltered (file,
@@ -6380,28 +6384,23 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file)
#ifdef TRACE_SET
fprintf_unfiltered (file,
"mips_dump_tdep: TRACE_SET # %s\n",
- XSTRING (TRACE_SET (X,STATE)));
+ XSTRING (TRACE_SET (X, STATE)));
#endif
#ifdef UNUSED_REGNUM
fprintf_unfiltered (file,
- "mips_dump_tdep: UNUSED_REGNUM = %d\n",
- UNUSED_REGNUM);
+ "mips_dump_tdep: UNUSED_REGNUM = %d\n", UNUSED_REGNUM);
#endif
- fprintf_unfiltered (file,
- "mips_dump_tdep: V0_REGNUM = %d\n",
- V0_REGNUM);
+ fprintf_unfiltered (file, "mips_dump_tdep: V0_REGNUM = %d\n", V0_REGNUM);
fprintf_unfiltered (file,
"mips_dump_tdep: VM_MIN_ADDRESS = %ld\n",
(long) VM_MIN_ADDRESS);
fprintf_unfiltered (file,
- "mips_dump_tdep: ZERO_REGNUM = %d\n",
- ZERO_REGNUM);
+ "mips_dump_tdep: ZERO_REGNUM = %d\n", ZERO_REGNUM);
fprintf_unfiltered (file,
- "mips_dump_tdep: _PROC_MAGIC_ = %d\n",
- _PROC_MAGIC_);
+ "mips_dump_tdep: _PROC_MAGIC_ = %d\n", _PROC_MAGIC_);
}
-extern initialize_file_ftype _initialize_mips_tdep; /* -Wmissing-prototypes */
+extern initialize_file_ftype _initialize_mips_tdep; /* -Wmissing-prototypes */
void
_initialize_mips_tdep (void)
@@ -6409,7 +6408,7 @@ _initialize_mips_tdep (void)
static struct cmd_list_element *mipsfpulist = NULL;
struct cmd_list_element *c;
- mips_abi_string = mips_abi_strings [MIPS_ABI_UNKNOWN];
+ mips_abi_string = mips_abi_strings[MIPS_ABI_UNKNOWN];
if (MIPS_ABI_LAST + 1
!= sizeof (mips_abi_strings) / sizeof (mips_abi_strings[0]))
internal_error (__FILE__, __LINE__, "mips_abi_strings out of sync");
@@ -6436,9 +6435,7 @@ This option can be set to one of:\n\
64 - Force GDB to treat saved GP registers as 64-bit\n\
auto - Allow GDB to use the target's default setting or autodetect the\n\
saved GP register size from information contained in the executable.\n\
- (default: auto)",
- &setmipscmdlist),
- &showmipscmdlist);
+ (default: auto)", &setmipscmdlist), &showmipscmdlist);
/* Allow the user to override the argument stack size. */
add_show_from_set (add_set_enum_cmd ("stack-arg-size",
@@ -6450,9 +6447,7 @@ This option can be set to one of:\n\
32 - Force GDB to allocate 32-bit chunks per argument\n\
64 - Force GDB to allocate 64-bit chunks per argument\n\
auto - Allow GDB to determine the correct setting from the current\n\
- target and executable (default)",
- &setmipscmdlist),
- &showmipscmdlist);
+ target and executable (default)", &setmipscmdlist), &showmipscmdlist);
/* Allow the user to override the ABI. */
c = add_set_enum_cmd
@@ -6461,15 +6456,10 @@ This option can be set to one of:\n\
"This option can be set to one of:\n"
" auto - the default ABI associated with the current binary\n"
" o32\n"
- " o64\n"
- " n32\n"
- " n64\n"
- " eabi32\n"
- " eabi64",
- &setmipscmdlist);
+ " o64\n" " n32\n" " n64\n" " eabi32\n" " eabi64", &setmipscmdlist);
set_cmd_sfunc (c, mips_abi_update);
add_cmd ("abi", class_obscure, show_mips_abi,
- "Show ABI in use by MIPS target", &showmipscmdlist);
+ "Show ABI in use by MIPS target", &showmipscmdlist);
/* Let the user turn off floating point and set the fence post for
heuristic_proc_start. */
@@ -6487,8 +6477,7 @@ This option can be set to one of:\n\
add_alias_cmd ("yes", "double", class_support, 1, &mipsfpulist);
add_alias_cmd ("1", "double", class_support, 1, &mipsfpulist);
add_cmd ("none", class_support, set_mipsfpu_none_command,
- "Select no MIPS floating-point coprocessor.",
- &mipsfpulist);
+ "Select no MIPS floating-point coprocessor.", &mipsfpulist);
add_alias_cmd ("off", "none", class_support, 1, &mipsfpulist);
add_alias_cmd ("no", "none", class_support, 1, &mipsfpulist);
add_alias_cmd ("0", "none", class_support, 1, &mipsfpulist);
@@ -6503,13 +6492,11 @@ This option can be set to one of:\n\
command.c doesn't deal with that. So make it a var_zinteger
because the user can always use "999999" or some such for unlimited. */
c = add_set_cmd ("heuristic-fence-post", class_support, var_zinteger,
- (char *) &heuristic_fence_post,
- "\
+ (char *) &heuristic_fence_post, "\
Set the distance searched for the start of a function.\n\
If you are debugging a stripped executable, GDB needs to search through the\n\
program for the start of a function. This command sets the distance of the\n\
-search. The only need to set it is when debugging a stripped executable.",
- &setlist);
+search. The only need to set it is when debugging a stripped executable.", &setlist);
/* We need to throw away the frame cache when we set this, since it
might change our ability to get backtraces. */
set_cmd_sfunc (c, reinit_frame_cache_sfunc);
@@ -6522,8 +6509,7 @@ Set zeroing of upper 32 bits of 64-bit addresses.\n\
Use \"on\" to enable the masking, \"off\" to disable it and \"auto\" to \n\
allow GDB to determine the correct value.\n", "\
Show zeroing of upper 32 bits of 64-bit addresses.",
- NULL, show_mask_address,
- &setmipscmdlist, &showmipscmdlist);
+ NULL, show_mask_address, &setmipscmdlist, &showmipscmdlist);
/* Allow the user to control the size of 32 bit registers within the
raw remote packet. */
@@ -6532,17 +6518,14 @@ Show zeroing of upper 32 bits of 64-bit addresses.",
Set compatibility with 64-bit MIPS targets that transfer 32-bit quantities.\n\
Use \"on\" to enable backward compatibility with older MIPS 64 GDB+target\n\
that would transfer 32 bits for some registers (e.g. SR, FSR) and\n\
-64 bits for others. Use \"off\" to disable compatibility mode", "\
+64 bits for others. Use \"off\" to disable compatibility mode", "\
Show compatibility with 64-bit MIPS targets that transfer 32-bit quantities.\n\
Use \"on\" to enable backward compatibility with older MIPS 64 GDB+target\n\
that would transfer 32 bits for some registers (e.g. SR, FSR) and\n\
-64 bits for others. Use \"off\" to disable compatibility mode",
- set_mips64_transfers_32bit_regs, NULL,
- &setlist, &showlist);
+64 bits for others. Use \"off\" to disable compatibility mode", set_mips64_transfers_32bit_regs, NULL, &setlist, &showlist);
/* Debug this files internals. */
add_show_from_set (add_set_cmd ("mips", class_maintenance, var_zinteger,
&mips_debug, "Set mips debugging.\n\
-When non-zero, mips specific debugging is enabled.", &setdebuglist),
- &showdebuglist);
+When non-zero, mips specific debugging is enabled.", &setdebuglist), &showdebuglist);
}
diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c
index fdc3530..a6ef1ca 100644
--- a/gdb/mn10300-tdep.c
+++ b/gdb/mn10300-tdep.c
@@ -1,7 +1,7 @@
/* Target-dependent code for the Matsushita MN10300 for GDB, the GNU debugger.
- Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software
- Foundation, Inc.
+ Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free
+ Software Foundation, Inc.
This file is part of GDB.
@@ -130,13 +130,6 @@ mn10300_extract_return_value (struct type *type, char *regbuf, char *valbuf)
memcpy (valbuf, regbuf + DEPRECATED_REGISTER_BYTE (0), TYPE_LENGTH (type));
}
-static CORE_ADDR
-mn10300_extract_struct_value_address (char *regbuf)
-{
- return extract_unsigned_integer (regbuf + DEPRECATED_REGISTER_BYTE (4),
- DEPRECATED_REGISTER_RAW_SIZE (4));
-}
-
static void
mn10300_store_return_value (struct type *type, char *valbuf)
{
@@ -1173,8 +1166,6 @@ mn10300_gdbarch_init (struct gdbarch_info info,
/* Breakpoints. */
set_gdbarch_breakpoint_from_pc (gdbarch, mn10300_breakpoint_from_pc);
- set_gdbarch_function_start_offset (gdbarch, 0);
- set_gdbarch_decr_pc_after_break (gdbarch, 0);
/* Stack unwinding. */
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
@@ -1184,8 +1175,6 @@ mn10300_gdbarch_init (struct gdbarch_info info,
set_gdbarch_deprecated_frame_chain (gdbarch, mn10300_frame_chain);
set_gdbarch_deprecated_frame_saved_pc (gdbarch, mn10300_frame_saved_pc);
set_gdbarch_deprecated_extract_return_value (gdbarch, mn10300_extract_return_value);
- set_gdbarch_deprecated_extract_struct_value_address
- (gdbarch, mn10300_extract_struct_value_address);
set_gdbarch_deprecated_store_return_value (gdbarch, mn10300_store_return_value);
set_gdbarch_deprecated_store_struct_return (gdbarch, mn10300_store_struct_return);
set_gdbarch_deprecated_pop_frame (gdbarch, mn10300_pop_frame);
@@ -1219,6 +1208,5 @@ void
_initialize_mn10300_tdep (void)
{
/* printf("_initialize_mn10300_tdep\n"); */
-
- register_gdbarch_init (bfd_arch_mn10300, mn10300_gdbarch_init);
+ gdbarch_register (bfd_arch_mn10300, mn10300_gdbarch_init, mn10300_dump_tdep);
}
diff --git a/gdb/monitor.c b/gdb/monitor.c
index 198155f..cd4f045 100644
--- a/gdb/monitor.c
+++ b/gdb/monitor.c
@@ -1516,33 +1516,6 @@ monitor_write_memory (CORE_ADDR memaddr, char *myaddr, int len)
static int
-monitor_write_even_block (CORE_ADDR memaddr, char *myaddr, int len)
-{
- unsigned int val;
- int written = 0;;
- /* Enter the sub mode */
- monitor_printf (current_monitor->setmem.cmdl, memaddr);
- monitor_expect_prompt (NULL, 0);
-
- while (len)
- {
- val = extract_unsigned_integer (myaddr, 4); /* REALLY */
- monitor_printf ("%x\r", val);
- myaddr += 4;
- memaddr += 4;
- written += 4;
- monitor_debug (" @ %s\n", paddr (memaddr));
- /* If we wanted to, here we could validate the address */
- monitor_expect_prompt (NULL, 0);
- }
- /* Now exit the sub mode */
- monitor_printf (current_monitor->getreg.term_cmd);
- monitor_expect_prompt (NULL, 0);
- return written;
-}
-
-
-static int
monitor_write_memory_bytes (CORE_ADDR memaddr, char *myaddr, int len)
{
unsigned char val;
@@ -1694,17 +1667,6 @@ monitor_write_memory_block (CORE_ADDR memaddr, char *myaddr, int len)
return monitor_write_memory_longlongs (memaddr, myaddr, len);
}
#endif
-#if 0
- if (len > 4)
- {
- int sublen;
- written = monitor_write_even_block (memaddr, myaddr, len);
- /* Adjust calling parameters by written amount */
- memaddr += written;
- myaddr += written;
- len -= written;
- }
-#endif
written = monitor_write_memory_bytes (memaddr, myaddr, len);
return written;
}
diff --git a/gdb/ns32k-tdep.c b/gdb/ns32k-tdep.c
index d426113..dc143bb 100644
--- a/gdb/ns32k-tdep.c
+++ b/gdb/ns32k-tdep.c
@@ -1,6 +1,7 @@
/* Target dependent code for the NS32000, for GDB.
- Copyright 1986, 1988, 1991, 1992, 1994, 1995, 1998, 1999, 2000, 2001,
- 2002, 2003 Free Software Foundation, Inc.
+
+ Copyright 1986, 1988, 1991, 1992, 1994, 1995, 1998, 1999, 2000,
+ 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of GDB.
@@ -308,10 +309,6 @@ ns32k_frame_chain (struct frame_info *frame)
/* In the case of the NS32000 series, the frame's nominal address is the
FP value, and that address is saved at the previous FP value as a
4-byte word. */
-
- if (deprecated_inside_entry_file (get_frame_pc (frame)))
- return 0;
-
return (read_memory_integer (get_frame_base (frame), 4));
}
@@ -495,12 +492,6 @@ ns32k_store_return_value (struct type *valtype, char *valbuf)
TYPE_LENGTH (valtype));
}
-static CORE_ADDR
-ns32k_extract_struct_value_address (char *regbuf)
-{
- return (extract_unsigned_integer (regbuf + DEPRECATED_REGISTER_BYTE (0), DEPRECATED_REGISTER_RAW_SIZE (0)));
-}
-
void
ns32k_gdbarch_init_32082 (struct gdbarch *gdbarch)
{
@@ -582,8 +573,6 @@ ns32k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_deprecated_store_struct_return (gdbarch, ns32k_store_struct_return);
set_gdbarch_deprecated_extract_return_value (gdbarch, ns32k_extract_return_value);
set_gdbarch_deprecated_store_return_value (gdbarch, ns32k_store_return_value);
- set_gdbarch_deprecated_extract_struct_value_address (gdbarch,
- ns32k_extract_struct_value_address);
/* Call dummy info */
set_gdbarch_deprecated_push_dummy_frame (gdbarch, ns32k_push_dummy_frame);
@@ -598,12 +587,8 @@ ns32k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_on_stack);
/* Breakpoint info */
- set_gdbarch_decr_pc_after_break (gdbarch, 0);
set_gdbarch_breakpoint_from_pc (gdbarch, ns32k_breakpoint_from_pc);
- /* Misc info */
- set_gdbarch_function_start_offset (gdbarch, 0);
-
/* Should be using push_dummy_call. */
set_gdbarch_deprecated_dummy_write_sp (gdbarch, deprecated_write_sp);
diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c
index c655616..cc933db 100644
--- a/gdb/objc-lang.c
+++ b/gdb/objc-lang.c
@@ -1,6 +1,6 @@
/* Objective-C language support routines for GDB, the GNU debugger.
- Copyright 2002, 2003 Free Software Foundation, Inc.
+ Copyright 2002, 2003, 2004 Free Software Foundation, Inc.
Contributed by Apple Computer, Inc.
Written by Michael Snyder.
@@ -672,6 +672,7 @@ const struct language_defn objc_language_defn = {
objc_skip_trampoline, /* Language specific skip_trampoline */
value_of_this, /* value_of_this */
basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
+ basic_lookup_transparent_type,/* lookup_transparent_type */
objc_demangle, /* Language specific symbol demangler */
{"", "", "", ""}, /* Binary format info */
{"0%lo", "0", "o", ""}, /* Octal format info */
diff --git a/gdb/objfiles.c b/gdb/objfiles.c
index 923d59b..1500c19 100644
--- a/gdb/objfiles.c
+++ b/gdb/objfiles.c
@@ -1,7 +1,7 @@
/* GDB routines for manipulating objfiles.
Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003 Free Software Foundation, Inc.
+ 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
Contributed by Cygnus Support, using pieces from other GDB modules.
@@ -48,18 +48,6 @@
/* Prototypes for local functions */
-#if defined(USE_MMALLOC) && defined(HAVE_MMAP)
-
-#include "mmalloc.h"
-
-static int open_existing_mapped_file (char *, long, int);
-
-static int open_mapped_file (char *filename, long mtime, int flags);
-
-static void *map_to_file (int);
-
-#endif /* defined(USE_MMALLOC) && defined(HAVE_MMAP) */
-
static void objfile_alloc_data (struct objfile *objfile);
static void objfile_free_data (struct objfile *objfile);
@@ -71,8 +59,6 @@ struct objfile *current_objfile; /* For symbol file being read in */
struct objfile *symfile_objfile; /* Main symbol table loaded from */
struct objfile *rt_common_objfile; /* For runtime common symbols */
-int mapped_symbol_files; /* Try to use mapped symbol files */
-
/* Locate all mappable sections of a BFD file.
objfile_p_char is a char * to get it through
bfd_map_over_sections; we cast it back to its proper type. */
@@ -107,7 +93,7 @@ add_to_objfile_sections (struct bfd *abfd, struct bfd_section *asect,
section.ovly_mapped = 0;
section.addr = bfd_section_vma (abfd, asect);
section.endaddr = section.addr + bfd_section_size (abfd, asect);
- obstack_grow (&objfile->psymbol_obstack, (char *) &section, sizeof (section));
+ obstack_grow (&objfile->objfile_obstack, (char *) &section, sizeof (section));
objfile->sections_end = (struct obj_section *) (((unsigned long) objfile->sections_end) + 1);
}
@@ -133,13 +119,13 @@ build_objfile_section_table (struct objfile *objfile)
/* objfile->sections can be already set when reading a mapped symbol
file. I believe that we do need to rebuild the section table in
this case (we rebuild other things derived from the bfd), but we
- can't free the old one (it's in the psymbol_obstack). So we just
+ can't free the old one (it's in the objfile_obstack). So we just
waste some memory. */
objfile->sections_end = 0;
bfd_map_over_sections (objfile->obfd, add_to_objfile_sections, (char *) objfile);
objfile->sections = (struct obj_section *)
- obstack_finish (&objfile->psymbol_obstack);
+ obstack_finish (&objfile->objfile_obstack);
objfile->sections_end = objfile->sections + (unsigned long) objfile->sections_end;
return (0);
}
@@ -150,10 +136,8 @@ build_objfile_section_table (struct objfile *objfile)
new objfile struct.
The FLAGS word contains various bits (OBJF_*) that can be taken as
- requests for specific operations, like trying to open a mapped
- version of the objfile (OBJF_MAPPED). Other bits like
- OBJF_SHARED are simply copied through to the new objfile flags
- member. */
+ requests for specific operations. Other bits like OBJF_SHARED are
+ simply copied through to the new objfile flags member. */
/* NOTE: carlton/2003-02-04: This function is called with args NULL, 0
by jv-lang.c, to create an artificial objfile used to hold
@@ -170,119 +154,6 @@ allocate_objfile (bfd *abfd, int flags)
struct objfile *objfile = NULL;
struct objfile *last_one = NULL;
- if (mapped_symbol_files)
- flags |= OBJF_MAPPED;
-
-#if defined(USE_MMALLOC) && defined(HAVE_MMAP)
- if (abfd != NULL)
- {
-
- /* If we can support mapped symbol files, try to open/reopen the
- mapped file that corresponds to the file from which we wish to
- read symbols. If the objfile is to be mapped, we must malloc
- the structure itself using the mmap version, and arrange that
- all memory allocation for the objfile uses the mmap routines.
- If we are reusing an existing mapped file, from which we get
- our objfile pointer, we have to make sure that we update the
- pointers to the alloc/free functions in the obstack, in case
- these functions have moved within the current gdb. */
-
- int fd;
-
- fd = open_mapped_file (bfd_get_filename (abfd), bfd_get_mtime (abfd),
- flags);
- if (fd >= 0)
- {
- void *md;
-
- if ((md = map_to_file (fd)) == NULL)
- {
- close (fd);
- }
- else if ((objfile = (struct objfile *) mmalloc_getkey (md, 0)) != NULL)
- {
- /* Update memory corruption handler function addresses. */
- init_malloc (md);
- objfile->md = md;
- objfile->mmfd = fd;
- /* Update pointers to functions to *our* copies */
- if (objfile->demangled_names_hash)
- htab_set_functions_ex
- (objfile->demangled_names_hash, htab_hash_string,
- (int (*) (const void *, const void *)) streq, NULL,
- objfile->md, xmcalloc, xmfree);
- obstack_chunkfun (&objfile->psymbol_cache.cache, xmmalloc);
- obstack_freefun (&objfile->psymbol_cache.cache, xmfree);
- obstack_chunkfun (&objfile->macro_cache.cache, xmmalloc);
- obstack_freefun (&objfile->macro_cache.cache, xmfree);
- obstack_chunkfun (&objfile->psymbol_obstack, xmmalloc);
- obstack_freefun (&objfile->psymbol_obstack, xmfree);
- obstack_chunkfun (&objfile->symbol_obstack, xmmalloc);
- obstack_freefun (&objfile->symbol_obstack, xmfree);
- obstack_chunkfun (&objfile->type_obstack, xmmalloc);
- obstack_freefun (&objfile->type_obstack, xmfree);
- /* If already in objfile list, unlink it. */
- unlink_objfile (objfile);
- /* Forget things specific to a particular gdb, may have changed. */
- objfile->sf = NULL;
- }
- else
- {
-
- /* Set up to detect internal memory corruption. MUST be
- done before the first malloc. See comments in
- init_malloc() and mmcheck(). */
-
- init_malloc (md);
-
- objfile = (struct objfile *)
- xmmalloc (md, sizeof (struct objfile));
- memset (objfile, 0, sizeof (struct objfile));
- objfile->md = md;
- objfile->mmfd = fd;
- objfile->flags |= OBJF_MAPPED;
- mmalloc_setkey (objfile->md, 0, objfile);
- obstack_specify_allocation_with_arg (&objfile->psymbol_cache.cache,
- 0, 0, xmmalloc, xmfree,
- objfile->md);
- obstack_specify_allocation_with_arg (&objfile->macro_cache.cache,
- 0, 0, xmmalloc, xmfree,
- objfile->md);
- obstack_specify_allocation_with_arg (&objfile->psymbol_obstack,
- 0, 0, xmmalloc, xmfree,
- objfile->md);
- obstack_specify_allocation_with_arg (&objfile->symbol_obstack,
- 0, 0, xmmalloc, xmfree,
- objfile->md);
- obstack_specify_allocation_with_arg (&objfile->type_obstack,
- 0, 0, xmmalloc, xmfree,
- objfile->md);
- }
- }
-
- if ((flags & OBJF_MAPPED) && (objfile == NULL))
- {
- warning ("symbol table for '%s' will not be mapped",
- bfd_get_filename (abfd));
- flags &= ~OBJF_MAPPED;
- }
- }
-#else /* !defined(USE_MMALLOC) || !defined(HAVE_MMAP) */
-
- if (flags & OBJF_MAPPED)
- {
- warning ("mapped symbol tables are not supported on this machine; missing or broken mmap().");
-
- /* Turn off the global flag so we don't try to do mapped symbol tables
- any more, which shuts up gdb unless the user specifically gives the
- "mapped" keyword again. */
-
- mapped_symbol_files = 0;
- flags &= ~OBJF_MAPPED;
- }
-
-#endif /* defined(USE_MMALLOC) && defined(HAVE_MMAP) */
-
/* If we don't support mapped symbol files, didn't ask for the file to be
mapped, or failed to open the mapped file for some reason, then revert
back to an unmapped objfile. */
@@ -294,14 +165,8 @@ allocate_objfile (bfd *abfd, int flags)
objfile->md = NULL;
objfile->psymbol_cache = bcache_xmalloc ();
objfile->macro_cache = bcache_xmalloc ();
- obstack_specify_allocation (&objfile->psymbol_obstack, 0, 0, xmalloc,
+ obstack_specify_allocation (&objfile->objfile_obstack, 0, 0, xmalloc,
xfree);
- obstack_specify_allocation (&objfile->symbol_obstack, 0, 0, xmalloc,
- xfree);
- obstack_specify_allocation (&objfile->type_obstack, 0, 0, xmalloc,
- xfree);
- flags &= ~OBJF_MAPPED;
-
terminate_minimal_symbol_table (objfile);
}
@@ -368,14 +233,14 @@ allocate_objfile (bfd *abfd, int flags)
/* Create the terminating entry of OBJFILE's minimal symbol table.
If OBJFILE->msymbols is zero, allocate a single entry from
- OBJFILE->symbol_obstack; otherwise, just initialize
+ OBJFILE->objfile_obstack; otherwise, just initialize
OBJFILE->msymbols[OBJFILE->minimal_symbol_count]. */
void
terminate_minimal_symbol_table (struct objfile *objfile)
{
if (! objfile->msymbols)
objfile->msymbols = ((struct minimal_symbol *)
- obstack_alloc (&objfile->symbol_obstack,
+ obstack_alloc (&objfile->objfile_obstack,
sizeof (objfile->msymbols[0])));
{
@@ -471,8 +336,8 @@ unlink_objfile (struct objfile *objfile)
/* Destroy an objfile and all the symtabs and psymtabs under it. Note
- that as much as possible is allocated on the symbol_obstack and
- psymbol_obstack, so that the memory can be efficiently freed.
+ that as much as possible is allocated on the objfile_obstack
+ so that the memory can be efficiently freed.
Things which we do NOT free because they are not in malloc'd memory
or not in memory specific to the objfile include:
@@ -545,52 +410,25 @@ free_objfile (struct objfile *objfile)
to call this here. */
clear_pc_function_cache ();
- /* The last thing we do is free the objfile struct itself for the
- non-reusable case, or detach from the mapped file for the
- reusable case. Note that the mmalloc_detach or the xmfree() is
- the last thing we can do with this objfile. */
+ /* The last thing we do is free the objfile struct itself. */
-#if defined(USE_MMALLOC) && defined(HAVE_MMAP)
-
- if (objfile->flags & OBJF_MAPPED)
- {
- /* Remember the fd so we can close it. We can't close it before
- doing the detach, and after the detach the objfile is gone. */
- int mmfd;
-
- mmfd = objfile->mmfd;
- mmalloc_detach (objfile->md);
- objfile = NULL;
- close (mmfd);
- }
-
-#endif /* defined(USE_MMALLOC) && defined(HAVE_MMAP) */
-
- /* If we still have an objfile, then either we don't support reusable
- objfiles or this one was not reusable. So free it normally. */
-
- if (objfile != NULL)
+ objfile_free_data (objfile);
+ if (objfile->name != NULL)
{
- objfile_free_data (objfile);
- if (objfile->name != NULL)
- {
- xmfree (objfile->md, objfile->name);
- }
- if (objfile->global_psymbols.list)
- xmfree (objfile->md, objfile->global_psymbols.list);
- if (objfile->static_psymbols.list)
- xmfree (objfile->md, objfile->static_psymbols.list);
- /* Free the obstacks for non-reusable objfiles */
- bcache_xfree (objfile->psymbol_cache);
- bcache_xfree (objfile->macro_cache);
- if (objfile->demangled_names_hash)
- htab_delete (objfile->demangled_names_hash);
- obstack_free (&objfile->psymbol_obstack, 0);
- obstack_free (&objfile->symbol_obstack, 0);
- obstack_free (&objfile->type_obstack, 0);
- xmfree (objfile->md, objfile);
- objfile = NULL;
+ xmfree (objfile->md, objfile->name);
}
+ if (objfile->global_psymbols.list)
+ xmfree (objfile->md, objfile->global_psymbols.list);
+ if (objfile->static_psymbols.list)
+ xmfree (objfile->md, objfile->static_psymbols.list);
+ /* Free the obstacks for non-reusable objfiles */
+ bcache_xfree (objfile->psymbol_cache);
+ bcache_xfree (objfile->macro_cache);
+ if (objfile->demangled_names_hash)
+ htab_delete (objfile->demangled_names_hash);
+ obstack_free (&objfile->objfile_obstack, 0);
+ xmfree (objfile->md, objfile);
+ objfile = NULL;
}
static void
@@ -882,168 +720,6 @@ have_minimal_symbols (void)
return 0;
}
-#if defined(USE_MMALLOC) && defined(HAVE_MMAP)
-
-/* Given the name of a mapped symbol file in SYMSFILENAME, and the timestamp
- of the corresponding symbol file in MTIME, try to open an existing file
- with the name SYMSFILENAME and verify it is more recent than the base
- file by checking it's timestamp against MTIME.
-
- If SYMSFILENAME does not exist (or can't be stat'd), simply returns -1.
-
- If SYMSFILENAME does exist, but is out of date, we check to see if the
- user has specified creation of a mapped file. If so, we don't issue
- any warning message because we will be creating a new mapped file anyway,
- overwriting the old one. If not, then we issue a warning message so that
- the user will know why we aren't using this existing mapped symbol file.
- In either case, we return -1.
-
- If SYMSFILENAME does exist and is not out of date, but can't be opened for
- some reason, then prints an appropriate system error message and returns -1.
-
- Otherwise, returns the open file descriptor. */
-
-static int
-open_existing_mapped_file (char *symsfilename, long mtime, int flags)
-{
- int fd = -1;
- struct stat sbuf;
-
- if (stat (symsfilename, &sbuf) == 0)
- {
- if (sbuf.st_mtime < mtime)
- {
- if (!(flags & OBJF_MAPPED))
- {
- warning ("mapped symbol file `%s' is out of date, ignored it",
- symsfilename);
- }
- }
- else if ((fd = open (symsfilename, O_RDWR)) < 0)
- {
- if (error_pre_print)
- {
- printf_unfiltered (error_pre_print);
- }
- print_sys_errmsg (symsfilename, errno);
- }
- }
- return (fd);
-}
-
-/* Look for a mapped symbol file that corresponds to FILENAME and is more
- recent than MTIME. If MAPPED is nonzero, the user has asked that gdb
- use a mapped symbol file for this file, so create a new one if one does
- not currently exist.
-
- If found, then return an open file descriptor for the file, otherwise
- return -1.
-
- This routine is responsible for implementing the policy that generates
- the name of the mapped symbol file from the name of a file containing
- symbols that gdb would like to read. Currently this policy is to append
- ".syms" to the name of the file.
-
- This routine is also responsible for implementing the policy that
- determines where the mapped symbol file is found (the search path).
- This policy is that when reading an existing mapped file, a file of
- the correct name in the current directory takes precedence over a
- file of the correct name in the same directory as the symbol file.
- When creating a new mapped file, it is always created in the current
- directory. This helps to minimize the chances of a user unknowingly
- creating big mapped files in places like /bin and /usr/local/bin, and
- allows a local copy to override a manually installed global copy (in
- /bin for example). */
-
-static int
-open_mapped_file (char *filename, long mtime, int flags)
-{
- int fd;
- char *symsfilename;
-
- /* First try to open an existing file in the current directory, and
- then try the directory where the symbol file is located. */
-
- symsfilename = concat ("./", lbasename (filename), ".syms", (char *) NULL);
- if ((fd = open_existing_mapped_file (symsfilename, mtime, flags)) < 0)
- {
- xfree (symsfilename);
- symsfilename = concat (filename, ".syms", (char *) NULL);
- fd = open_existing_mapped_file (symsfilename, mtime, flags);
- }
-
- /* If we don't have an open file by now, then either the file does not
- already exist, or the base file has changed since it was created. In
- either case, if the user has specified use of a mapped file, then
- create a new mapped file, truncating any existing one. If we can't
- create one, print a system error message saying why we can't.
-
- By default the file is rw for everyone, with the user's umask taking
- care of turning off the permissions the user wants off. */
-
- if ((fd < 0) && (flags & OBJF_MAPPED))
- {
- xfree (symsfilename);
- symsfilename = concat ("./", lbasename (filename), ".syms",
- (char *) NULL);
- if ((fd = open (symsfilename, O_RDWR | O_CREAT | O_TRUNC, 0666)) < 0)
- {
- if (error_pre_print)
- {
- printf_unfiltered (error_pre_print);
- }
- print_sys_errmsg (symsfilename, errno);
- }
- }
-
- xfree (symsfilename);
- return (fd);
-}
-
-static void *
-map_to_file (int fd)
-{
- void *md;
- CORE_ADDR mapto;
-
- md = mmalloc_attach (fd, 0);
- if (md != NULL)
- {
- mapto = (CORE_ADDR) mmalloc_getkey (md, 1);
- md = mmalloc_detach (md);
- if (md != NULL)
- {
- /* FIXME: should figure out why detach failed */
- md = NULL;
- }
- else if (mapto != (CORE_ADDR) NULL)
- {
- /* This mapping file needs to be remapped at "mapto" */
- md = mmalloc_attach (fd, mapto);
- }
- else
- {
- /* This is a freshly created mapping file. */
- mapto = (CORE_ADDR) mmalloc_findbase (20 * 1024 * 1024);
- if (mapto != 0)
- {
- /* To avoid reusing the freshly created mapping file, at the
- address selected by mmap, we must truncate it before trying
- to do an attach at the address we want. */
- ftruncate (fd, 0);
- md = mmalloc_attach (fd, mapto);
- if (md != NULL)
- {
- mmalloc_setkey (md, 1, mapto);
- }
- }
- }
- }
- return (md);
-}
-
-#endif /* defined(USE_MMALLOC) && defined(HAVE_MMAP) */
-
/* Returns a section whose range includes PC and SECTION, or NULL if
none found. Note the distinction between the return type, struct
obj_section (which is defined in gdb), and the input type "struct
diff --git a/gdb/objfiles.h b/gdb/objfiles.h
index ebc10b3..1454fbd 100644
--- a/gdb/objfiles.h
+++ b/gdb/objfiles.h
@@ -1,7 +1,7 @@
/* Definitions for symbol file management in GDB.
Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003 Free Software Foundation, Inc.
+ 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of GDB.
@@ -98,18 +98,7 @@ struct objfile_data;
use the block at main, or can't find it for some reason, everything
still works as before. And if we have no startup code debugging
information but we do have usable information for main(), backtraces
- from user code don't go wandering off into the startup code.
-
- To use this method, define your DEPRECATED_FRAME_CHAIN_VALID macro
- like:
-
- #define DEPRECATED_FRAME_CHAIN_VALID(chain, thisframe) \
- (chain != 0 \
- && !(inside_main_func ((thisframe)->pc)) \
- && !(inside_entry_func ((thisframe)->pc)))
-
- and add initializations of the four scope controlling variables inside
- the object file / debugging information processing modules. */
+ from user code don't go wandering off into the startup code. */
struct entry_info
{
@@ -292,12 +281,10 @@ struct objfile
long mtime;
- /* Obstacks to hold objects that should be freed when we load a new symbol
+ /* Obstack to hold objects that should be freed when we load a new symbol
table from this object file. */
- struct obstack psymbol_obstack; /* Partial symbols */
- struct obstack symbol_obstack; /* Full symbols */
- struct obstack type_obstack; /* Types */
+ struct obstack objfile_obstack;
/* A byte cache where we can stash arbitrary "chunks" of bytes that
will not change. */
@@ -313,7 +300,7 @@ struct objfile
struct htab *demangled_names_hash;
/* Vectors of all partial symbols read in from file. The actual data
- is stored in the psymbol_obstack. */
+ is stored in the objfile_obstack. */
struct psymbol_allocation_list global_psymbols;
struct psymbol_allocation_list static_psymbols;
@@ -325,7 +312,7 @@ struct objfile
when passed a pointer to somewhere in the middle of it. There is also
a count of the number of symbols, which does not include the terminating
null symbol. The array itself, as well as all the data that it points
- to, should be allocated on the symbol_obstack for this file. */
+ to, should be allocated on the objfile_obstack for this file. */
struct minimal_symbol *msymbols;
int minimal_symbol_count;
@@ -403,7 +390,7 @@ struct objfile
unsigned num_data;
/* Set of relocation offsets to apply to each section.
- Currently on the psymbol_obstack (which makes no sense, but I'm
+ Currently on the objfile_obstack (which makes no sense, but I'm
not sure it's harming anything).
These offsets indicate that all symbols (including partial and
@@ -431,7 +418,7 @@ struct objfile
SECTIONS points to the first entry in the table, and
SECTIONS_END points to the first location past the last entry
in the table. Currently the table is stored on the
- psymbol_obstack (which makes no sense, but I'm not sure it's
+ objfile_obstack (which makes no sense, but I'm not sure it's
harming anything). */
struct obj_section
@@ -470,15 +457,6 @@ struct objfile
/* Defines for the objfile flag word. */
-/* Gdb can arrange to allocate storage for all objects related to a
- particular objfile in a designated section of its address space,
- managed at a low level by mmap() and using a special version of
- malloc that handles malloc/free/realloc on top of the mmap() interface.
- This allows the "internal gdb state" for a particular objfile to be
- dumped to a gdb state file and subsequently reloaded at a later time. */
-
-#define OBJF_MAPPED (1 << 0) /* Objfile data is mmap'd */
-
/* When using mapped/remapped predigested gdb symbol information, we need
a flag that indicates that we have previously done an initial symbol
table read from this particular objfile. We can't just look for the
@@ -529,7 +507,7 @@ extern struct objfile *symfile_objfile;
extern struct objfile *rt_common_objfile;
-/* When we need to allocate a new type, we need to know which type_obstack
+/* When we need to allocate a new type, we need to know which objfile_obstack
to allocate the type on, since there is one for each objfile. The places
where types are allocated are deeply buried in function call hierarchies
which know nothing about objfiles, so rather than trying to pass a
diff --git a/gdb/ocd.c b/gdb/ocd.c
index 4155d73..c53db89 100644
--- a/gdb/ocd.c
+++ b/gdb/ocd.c
@@ -1,7 +1,7 @@
/* Target communications support for Macraigor Systems' On-Chip Debugging
- Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software
- Foundation, Inc.
+ Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2004 Free
+ Software Foundation, Inc.
This file is part of GDB.
@@ -46,14 +46,6 @@ static int ocd_start_remote (void *dummy);
static int readchar (int timeout);
-static void reset_packet (void);
-
-static void output_packet (void);
-
-static int get_quoted_char (int timeout);
-
-static void put_quoted_char (int c);
-
static void ocd_interrupt (int signo);
static void ocd_interrupt_twice (int signo);
@@ -70,17 +62,6 @@ static struct target_ops *current_ops = NULL;
static int last_run_status;
-/* This was 5 seconds, which is a long time to sit and wait.
- Unless this is going though some terminal server or multiplexer or
- other form of hairy serial connection, I would think 2 seconds would
- be plenty. */
-
-#if 0
-/* FIXME: Change to allow option to set timeout value on a per target
- basis. */
-static int remote_timeout = 2;
-#endif
-
/* Descriptor for I/O to remote machine. Initialize it to NULL so that
ocd_open knows that we don't have a file open when the program
starts. */
@@ -210,19 +191,11 @@ ocd_start_remote (void *dummy)
printf_unfiltered ("[Wiggler version %x.%x, capability 0x%x]\n",
p[0], p[1], (p[2] << 16) | p[3]);
-#if 0
- /* Reset the target */
-
- ocd_do_command (OCD_RESET_RUN, &status, &pktlen);
-/* ocd_do_command (OCD_RESET, &status, &pktlen); */
-#endif
-
/* If processor is still running, stop it. */
if (!(status & OCD_FLAG_BDM))
ocd_stop ();
-#if 1
/* When using a target box, we want to asynchronously return status when
target stops. The OCD_SET_CTL_FLAGS command is ignored by Wigglers.dll
when using a parallel Wiggler */
@@ -241,7 +214,6 @@ ocd_start_remote (void *dummy)
if (error_code != 0)
ocd_error ("OCD_SET_CTL_FLAGS:", error_code);
-#endif
immediate_quit--;
@@ -780,112 +752,6 @@ readchar (int timeout)
}
}
-#if 0
-/* Read a character from the data stream, dequoting as necessary. SYN is
- treated special. Any SYNs appearing in the data stream are returned as the
- distinct value RAW_SYN (which has a value > 8 bits and therefore cannot be
- mistaken for real data). */
-
-static int
-get_quoted_char (int timeout)
-{
- int ch;
-
- ch = readchar (timeout);
-
- switch (ch)
- {
- case SERIAL_TIMEOUT:
- error ("Timeout in mid-packet, aborting");
- case SYN:
- return RAW_SYN;
- case DLE:
- ch = readchar (timeout);
- if (ch == SYN)
- return RAW_SYN;
- return ch & ~0100;
- default:
- return ch;
- }
-}
-
-static unsigned char pkt[256 * 2 + 10], *pktp; /* Worst case */
-
-static void
-reset_packet (void)
-{
- pktp = pkt;
-}
-
-static void
-output_packet (void)
-{
- if (serial_write (ocd_desc, pkt, pktp - pkt))
- perror_with_name ("output_packet: write failed");
-
- reset_packet ();
-}
-
-/* Output a quoted character. SYNs and DLEs are quoted. Everything else goes
- through untouched. */
-
-static void
-put_quoted_char (int c)
-{
- switch (c)
- {
- case SYN:
- case DLE:
- *pktp++ = DLE;
- c |= 0100;
- }
-
- *pktp++ = c;
-}
-
-/* Send a packet to the OCD device. The packet framed by a SYN character,
- a byte count and a checksum. The byte count only counts the number of
- bytes between the count and the checksum. A count of zero actually
- means 256. Any SYNs within the packet (including the checksum and
- count) must be quoted. The quote character must be quoted as well.
- Quoting is done by replacing the character with the two-character sequence
- DLE, {char} | 0100. Note that the quoting mechanism has no effect on the
- byte count. */
-
-static void
-stu_put_packet (unsigned char *buf, int len)
-{
- unsigned char checksum;
- unsigned char c;
-
- if (len == 0 || len > 256)
- internal_error (__FILE__, __LINE__, "failed internal consistency check"); /* Can't represent 0 length packet */
-
- reset_packet ();
-
- checksum = 0;
-
- put_quoted_char (RAW_SYN);
-
- c = len;
-
- do
- {
- checksum += c;
-
- put_quoted_char (c);
-
- c = *buf++;
- }
- while (len-- > 0);
-
- put_quoted_char (-checksum & 0xff);
-
- output_packet ();
-}
-
-#else
-
/* Send a packet to the OCD device. The packet framed by a SYN character,
a byte count and a checksum. The byte count only counts the number of
bytes between the count and the checksum. A count of zero actually
@@ -921,71 +787,6 @@ ocd_put_packet (unsigned char *buf, int len)
if (serial_write (ocd_desc, packet, packet_ptr - packet))
perror_with_name ("output_packet: write failed");
}
-#endif
-
-#if 0
-/* Get a packet from the OCD device. Timeout is only enforced for the
- first byte of the packet. Subsequent bytes are expected to arrive in
- time <= remote_timeout. Returns a pointer to a static buffer containing
- the payload of the packet. *LENP contains the length of the packet.
- */
-
-static unsigned char *
-stu_get_packet (unsigned char cmd, int *lenp, int timeout)
-{
- int ch;
- int len;
- static unsigned char buf[256 + 10], *p;
- unsigned char checksum;
-
-find_packet:
-
- ch = get_quoted_char (timeout);
-
- if (ch < 0)
- error ("get_packet (readchar): %d", ch);
-
- if (ch != RAW_SYN)
- goto find_packet;
-
-found_syn: /* Found the start of a packet */
-
- p = buf;
- checksum = 0;
-
- len = get_quoted_char (remote_timeout);
-
- if (len == RAW_SYN)
- goto found_syn;
-
- checksum += len;
-
- if (len == 0)
- len = 256;
-
- len++; /* Include checksum */
-
- while (len-- > 0)
- {
- ch = get_quoted_char (remote_timeout);
- if (ch == RAW_SYN)
- goto found_syn;
-
- *p++ = ch;
- checksum += ch;
- }
-
- if (checksum != 0)
- goto find_packet;
-
- if (cmd != buf[0])
- error ("Response phase error. Got 0x%x, expected 0x%x", buf[0], cmd);
-
- *lenp = p - buf - 1;
- return buf;
-}
-
-#else
/* Get a packet from the OCD device. Timeout is only enforced for the
first byte of the packet. Subsequent bytes are expected to arrive in
@@ -1135,7 +936,6 @@ ocd_get_packet (int cmd, int *lenp, int timeout)
*lenp = packet_ptr - packet - 1; /* Subtract checksum byte */
return packet;
}
-#endif
/* Execute a simple (one-byte) command. Returns a pointer to the data
following the error code. */
@@ -1244,9 +1044,6 @@ ocd_load (char *args, int from_tty)
not yet supported fully */
#define BDM_BREAKPOINT {0x0,0x0,0x0,0x0} /* For ppc 8xx */
-#if 0
-#define BDM_BREAKPOINT {0x4a,0xfa} /* BGND insn used for CPU32 */
-#endif
/* BDM (at least on CPU32) uses a different breakpoint */
@@ -1349,19 +1146,6 @@ bdm_update_flash_command (char *args, int from_tty)
/* discard_cleanups (old_chain); */
}
-
-static void
-bdm_read_register_command (char *args, int from_tty)
-{
- /* XXX repeat should go on to the next register */
-
- if (!ocd_desc)
- error ("Not connected to OCD device.");
-
- if (!args)
- error ("Must specify BDM register number.");
-
-}
extern initialize_file_ftype _initialize_remote_ocd; /* -Wmissing-prototypes */
@@ -1382,5 +1166,4 @@ _initialize_remote_ocd (void)
add_cmd ("reset", class_obscure, bdm_reset_command, "", &ocd_cmd_list);
add_cmd ("restart", class_obscure, bdm_restart_command, "", &ocd_cmd_list);
add_cmd ("update-flash", class_obscure, bdm_update_flash_command, "", &ocd_cmd_list);
- /* add_cmd ("read-register", class_obscure, bdm_read_register_command, "", &ocd_cmd_list); */
}
diff --git a/gdb/osabi.c b/gdb/osabi.c
index 4c94c5e..3acfc70 100644
--- a/gdb/osabi.c
+++ b/gdb/osabi.c
@@ -60,6 +60,7 @@ static const char * const gdb_osabi_names[] =
"FreeBSD ELF",
"NetBSD a.out",
"NetBSD ELF",
+ "OpenBSD ELF",
"Windows CE",
"DJGPP",
"NetWare",
@@ -354,119 +355,137 @@ gdbarch_init_osabi (struct gdbarch_info info, struct gdbarch *gdbarch)
info.bfd_arch_info->printable_name);
}
+/* Limit on the amount of data to be read. */
+#define MAX_NOTESZ 128
+
+/* Return non-zero if NOTE matches NAME, DESCSZ and TYPE. */
+
+static int
+check_note (bfd *abfd, asection *sect, const char *note,
+ const char *name, unsigned long descsz, unsigned long type)
+{
+ unsigned long notesz;
+
+ /* Calculate the size of this note. */
+ notesz = strlen (name) + 1;
+ notesz = ((notesz + 3) & ~3);
+ notesz += descsz;
+ notesz = ((notesz + 3) & ~3);
+
+ /* If this assertion triggers, increase MAX_NOTESZ. */
+ gdb_assert (notesz <= MAX_NOTESZ);
+
+ /* Check whether SECT is big enough to comtain the complete note. */
+ if (notesz > bfd_section_size (abfd, sect))
+ return 0;
+
+ /* Check the note name. */
+ if (bfd_h_get_32 (abfd, note) != (strlen (name) + 1)
+ || strcmp (note + 12, name) != 0)
+ return 0;
+
+ /* Check the descriptor size. */
+ if (bfd_h_get_32 (abfd, note + 4) != descsz)
+ return 0;
+
+ /* Check the note type. */
+ if (bfd_h_get_32 (abfd, note + 8) != type)
+ return 0;
+
+ return 1;
+}
/* Generic sniffer for ELF flavoured files. */
void
generic_elf_osabi_sniff_abi_tag_sections (bfd *abfd, asection *sect, void *obj)
{
- enum gdb_osabi *os_ident_ptr = obj;
+ enum gdb_osabi *osabi = obj;
const char *name;
unsigned int sectsize;
+ char *note;
name = bfd_get_section_name (abfd, sect);
sectsize = bfd_section_size (abfd, sect);
- /* .note.ABI-tag notes, used by GNU/Linux and FreeBSD. */
- if (strcmp (name, ".note.ABI-tag") == 0 && sectsize > 0)
- {
- unsigned int name_length, data_length, note_type;
- char *note;
-
- /* If the section is larger than this, it's probably not what we are
- looking for. */
- if (sectsize > 128)
- sectsize = 128;
+ /* Limit the amount of data to read. */
+ if (sectsize > MAX_NOTESZ)
+ sectsize = MAX_NOTESZ;
- note = alloca (sectsize);
+ note = alloca (sectsize);
+ bfd_get_section_contents (abfd, sect, note, 0, sectsize);
- bfd_get_section_contents (abfd, sect, note,
- (file_ptr) 0, (bfd_size_type) sectsize);
-
- name_length = bfd_h_get_32 (abfd, note);
- data_length = bfd_h_get_32 (abfd, note + 4);
- note_type = bfd_h_get_32 (abfd, note + 8);
-
- if (name_length == 4 && data_length == 16 && note_type == NT_GNU_ABI_TAG
- && strcmp (note + 12, "GNU") == 0)
+ /* .note.ABI-tag notes, used by GNU/Linux and FreeBSD. */
+ if (strcmp (name, ".note.ABI-tag") == 0)
+ {
+ /* GNU. */
+ if (check_note (abfd, sect, note, "GNU", 16, NT_GNU_ABI_TAG))
{
- int os_number = bfd_h_get_32 (abfd, note + 16);
+ unsigned int abi_tag = bfd_h_get_32 (abfd, note + 16);
- switch (os_number)
+ switch (abi_tag)
{
case GNU_ABI_TAG_LINUX:
- *os_ident_ptr = GDB_OSABI_LINUX;
+ *osabi = GDB_OSABI_LINUX;
break;
case GNU_ABI_TAG_HURD:
- *os_ident_ptr = GDB_OSABI_HURD;
+ *osabi = GDB_OSABI_HURD;
break;
case GNU_ABI_TAG_SOLARIS:
- *os_ident_ptr = GDB_OSABI_SOLARIS;
+ *osabi = GDB_OSABI_SOLARIS;
break;
case GNU_ABI_TAG_FREEBSD:
- *os_ident_ptr = GDB_OSABI_FREEBSD_ELF;
+ *osabi = GDB_OSABI_FREEBSD_ELF;
break;
-
+
case GNU_ABI_TAG_NETBSD:
- *os_ident_ptr = GDB_OSABI_NETBSD_ELF;
+ *osabi = GDB_OSABI_NETBSD_ELF;
break;
-
+
default:
- internal_error
- (__FILE__, __LINE__,
- "generic_elf_osabi_sniff_abi_tag_sections: unknown OS number %d",
- os_number);
+ internal_error (__FILE__, __LINE__, "\
+generic_elf_osabi_sniff_abi_tag_sections: unknown OS number %d",
+ abi_tag);
}
return;
}
- else if (name_length == 8 && data_length == 4
- && note_type == NT_FREEBSD_ABI_TAG
- && strcmp (note + 12, "FreeBSD") == 0)
+
+ /* FreeBSD. */
+ if (check_note (abfd, sect, note, "FreeBSD", 4, NT_FREEBSD_ABI_TAG))
{
- /* XXX Should we check the version here? Probably not
- necessary yet. */
- *os_ident_ptr = GDB_OSABI_FREEBSD_ELF;
+ /* There is no need to check the version yet. */
+ *osabi = GDB_OSABI_FREEBSD_ELF;
+ return;
}
+
return;
}
-
+
/* .note.netbsd.ident notes, used by NetBSD. */
- if (strcmp (name, ".note.netbsd.ident") == 0 && sectsize > 0)
+ if (strcmp (name, ".note.netbsd.ident") == 0
+ && check_note (abfd, sect, note, "NetBSD", 4, NT_NETBSD_IDENT))
{
- unsigned int name_length, data_length, note_type;
- char *note;
-
- /* If the section is larger than this, it's probably not what we are
- looking for. */
- if (sectsize > 128)
- sectsize = 128;
-
- note = alloca (sectsize);
-
- bfd_get_section_contents (abfd, sect, note,
- (file_ptr) 0, (bfd_size_type) sectsize);
-
- name_length = bfd_h_get_32 (abfd, note);
- data_length = bfd_h_get_32 (abfd, note + 4);
- note_type = bfd_h_get_32 (abfd, note + 8);
+ /* There is no need to check the version yet. */
+ *osabi = GDB_OSABI_NETBSD_ELF;
+ return;
+ }
- if (name_length == 7 && data_length == 4 && note_type == NT_NETBSD_IDENT
- && strcmp (note + 12, "NetBSD") == 0)
- {
- /* XXX Should we check the version here? Probably not
- necessary yet. */
- *os_ident_ptr = GDB_OSABI_NETBSD_ELF;
- }
+ /* .note.openbsd.ident notes, used by OpenBSD. */
+ if (strcmp (name, ".note.openbsd.ident") == 0
+ && check_note (abfd, sect, note, "OpenBSD", 4, NT_OPENBSD_IDENT))
+ {
+ /* There is no need to check the version yet. */
+ *osabi = GDB_OSABI_OPENBSD_ELF;
return;
}
/* .note.netbsdcore.procinfo notes, used by NetBSD. */
- if (strcmp (name, ".note.netbsdcore.procinfo") == 0 && sectsize > 0)
+ if (strcmp (name, ".note.netbsdcore.procinfo") == 0)
{
- *os_ident_ptr = GDB_OSABI_NETBSD_ELF;
+ *osabi = GDB_OSABI_NETBSD_ELF;
return;
}
}
diff --git a/gdb/p-lang.c b/gdb/p-lang.c
index 3ebb433..a402532 100644
--- a/gdb/p-lang.c
+++ b/gdb/p-lang.c
@@ -1,5 +1,5 @@
/* Pascal language support routines for GDB, the GNU debugger.
- Copyright 2000, 2002 Free Software Foundation, Inc.
+ Copyright 2000, 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of GDB.
@@ -464,6 +464,7 @@ const struct language_defn pascal_language_defn =
NULL, /* Language specific skip_trampoline */
value_of_this, /* value_of_this */
basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
+ basic_lookup_transparent_type,/* lookup_transparent_type */
NULL, /* Language specific symbol demangler */
{"", "%", "b", ""}, /* Binary format info */
{"0%lo", "0", "o", ""}, /* Octal format info */
diff --git a/gdb/pa64solib.c b/gdb/pa64solib.c
index 8a5cae1..4e29455 100644
--- a/gdb/pa64solib.c
+++ b/gdb/pa64solib.c
@@ -1,6 +1,6 @@
/* Handle HP ELF shared libraries for GDB, the GNU Debugger.
- Copyright 1999, 2000, 2001, 2002, 2003 Free Software Foundation,
+ Copyright 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation,
Inc.
This file is part of GDB.
@@ -281,7 +281,7 @@ pa64_solib_add_solib_objfile (struct so_list *so, char *name, int from_tty,
if (so->objfile->obj_private == NULL)
{
obj_private = (obj_private_data_t *)
- obstack_alloc (&so->objfile->psymbol_obstack,
+ obstack_alloc (&so->objfile->objfile_obstack,
sizeof (obj_private_data_t));
obj_private->unwind_info = NULL;
obj_private->so_info = NULL;
@@ -1161,7 +1161,7 @@ add_to_solist (int from_tty, char *dll_path, int readsyms,
new_so->pa64_solib_desc_addr = load_module_desc_addr;
new_so->loaded = 1;
new_so->name = obsavestring (dll_path, strlen(dll_path),
- &symfile_objfile->symbol_obstack);
+ &symfile_objfile->objfile_obstack);
/* If we are not going to load the library, tell the user if we
haven't already and return. */
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
index 3c7ad41..2767ec7 100644
--- a/gdb/printcmd.c
+++ b/gdb/printcmd.c
@@ -1141,7 +1141,12 @@ address_info (char *exp, int from_tty)
case LOC_COMPUTED:
case LOC_COMPUTED_ARG:
- (SYMBOL_LOCATION_FUNCS (sym)->describe_location) (sym, gdb_stdout);
+ /* FIXME: cagney/2004-01-26: It should be possible to
+ unconditionally call the SYMBOL_OPS method when available.
+ Unfortunately DWARF 2 stores the frame-base (instead of the
+ function) location in a function's symbol. Oops! For the
+ moment enable this when/where applicable. */
+ SYMBOL_OPS (sym)->describe_location (sym, gdb_stdout);
break;
case LOC_REGISTER:
@@ -1356,7 +1361,7 @@ display_command (char *exp, int from_tty)
/* NOTE: cagney/2003-02-13 The `tui_active' was previously
`tui_version'. */
if (tui_active && *exp == '$')
- display_it = (tui_set_layout (exp) == TUI_FAILURE);
+ display_it = (tui_set_layout_for_display_command (exp) == TUI_FAILURE);
#endif
if (display_it)
diff --git a/gdb/proc-api.c b/gdb/proc-api.c
index 1e4a2dc..e6d30ea 100644
--- a/gdb/proc-api.c
+++ b/gdb/proc-api.c
@@ -459,7 +459,7 @@ static off_t lseek_offset;
int
write_with_trace (int fd, void *varg, size_t len, char *file, int line)
{
- int i;
+ int i = ARRAY_SIZE (rw_table) - 1;
int ret;
procfs_ctl_t *arg = (procfs_ctl_t *) varg;
diff --git a/gdb/procfs.c b/gdb/procfs.c
index 72ad202..f73f729 100644
--- a/gdb/procfs.c
+++ b/gdb/procfs.c
@@ -19,7 +19,7 @@ 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,
+along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "defs.h"
@@ -45,10 +45,12 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "gdb_wait.h"
#include <signal.h>
#include <ctype.h>
+#include "gdb_string.h"
#include "gdb_assert.h"
#include "inflow.h"
+#include "auxv.h"
-/*
+/*
* PROCFS.C
*
* This module provides the interface between GDB and the
@@ -73,7 +75,7 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
* This module has to support both /proc interfaces. This means
* that there are two different ways of doing every basic operation.
*
- * In order to keep most of the code simple and clean, I have
+ * In order to keep most of the code simple and clean, I have
* defined an interface "layer" which hides all these system calls.
* An ifdef (NEW_PROC_API) determines which interface we are using,
* and most or all occurrances of this ifdef should be confined to
@@ -82,7 +84,7 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Determine which /proc API we are using:
- The ioctl API defines PIOCSTATUS, while
+ The ioctl API defines PIOCSTATUS, while
the read/write (multiple fd) API never does. */
#ifdef NEW_PROC_API
@@ -127,16 +129,21 @@ static ptid_t procfs_wait (ptid_t, struct target_waitstatus *);
static int procfs_xfer_memory (CORE_ADDR, char *, int, int,
struct mem_attrib *attrib,
struct target_ops *);
+static LONGEST procfs_xfer_partial (struct target_ops *ops,
+ enum target_object object,
+ const char *annex,
+ void *readbuf, const void *writebuf,
+ ULONGEST offset, LONGEST len);
static int procfs_thread_alive (ptid_t);
void procfs_find_new_threads (void);
char *procfs_pid_to_str (ptid_t);
-static int proc_find_memory_regions (int (*) (CORE_ADDR,
- unsigned long,
- int, int, int,
- void *),
+static int proc_find_memory_regions (int (*) (CORE_ADDR,
+ unsigned long,
+ int, int, int,
+ void *),
void *);
static char * procfs_make_note_section (bfd *, int *);
@@ -150,7 +157,7 @@ init_procfs_ops (void)
{
procfs_ops.to_shortname = "procfs";
procfs_ops.to_longname = "Unix /proc child process";
- procfs_ops.to_doc =
+ procfs_ops.to_doc =
"Unix /proc child process (started by the \"run\" command).";
procfs_ops.to_open = procfs_open;
procfs_ops.to_can_run = procfs_can_run;
@@ -164,6 +171,7 @@ init_procfs_ops (void)
procfs_ops.to_prepare_to_store = procfs_prepare_to_store;
procfs_ops.to_fetch_registers = procfs_fetch_registers;
procfs_ops.to_store_registers = procfs_store_registers;
+ procfs_ops.to_xfer_partial = procfs_xfer_partial;
procfs_ops.to_xfer_memory = procfs_xfer_memory;
procfs_ops.to_insert_breakpoint = memory_insert_breakpoint;
procfs_ops.to_remove_breakpoint = memory_remove_breakpoint;
@@ -206,14 +214,14 @@ init_procfs_ops (void)
#ifdef NEW_PROC_API /* Solaris 7 && 8 method for watchpoints */
#ifdef WA_READ
- enum { READ_WATCHFLAG = WA_READ,
+ enum { READ_WATCHFLAG = WA_READ,
WRITE_WATCHFLAG = WA_WRITE,
EXEC_WATCHFLAG = WA_EXEC,
AFTER_WATCHFLAG = WA_TRAPAFTER
};
#endif
#else /* Irix method for watchpoints */
- enum { READ_WATCHFLAG = MA_READ,
+ enum { READ_WATCHFLAG = MA_READ,
WRITE_WATCHFLAG = MA_WRITE,
EXEC_WATCHFLAG = MA_EXEC,
AFTER_WATCHFLAG = 0 /* trapafter not implemented */
@@ -344,7 +352,7 @@ typedef struct procinfo {
int was_stopped;
int ignore_next_sigstop;
- /* The following four fd fields may be identical, or may contain
+ /* The following four fd fields may be identical, or may contain
several different fd's, depending on the version of /proc
(old ioctl or new read/write). */
@@ -352,7 +360,7 @@ typedef struct procinfo {
/*
* The next three file descriptors are actually only needed in the
* read/write, multiple-file-descriptor implemenation (NEW_PROC_API).
- * However, to avoid a bunch of #ifdefs in the code, we will use
+ * However, to avoid a bunch of #ifdefs in the code, we will use
* them uniformly by (in the case of the ioctl single-file-descriptor
* implementation) filling them with copies of the control fd.
*/
@@ -377,7 +385,7 @@ typedef struct procinfo {
int num_syscalls; /* Total number of syscalls */
char **syscall_names; /* Syscall number to name map */
#endif
-
+
struct procinfo *thread_list;
int status_valid : 1;
@@ -417,7 +425,7 @@ static procinfo * procinfo_list;
* Returns: pointer to procinfo, or NULL if not found.
*/
-static procinfo *
+static procinfo *
find_procinfo (int pid, int tid)
{
procinfo *pi;
@@ -458,7 +466,7 @@ find_procinfo_or_die (int pid, int tid)
if (pi == NULL)
{
if (tid)
- error ("procfs: couldn't find pid %d (kernel thread %d) in procinfo list.",
+ error ("procfs: couldn't find pid %d (kernel thread %d) in procinfo list.",
pid, tid);
else
error ("procfs: couldn't find pid %d in procinfo list.", pid);
@@ -469,14 +477,14 @@ find_procinfo_or_die (int pid, int tid)
/* open_with_retry() is a wrapper for open(). The appropriate
open() call is attempted; if unsuccessful, it will be retried as
many times as needed for the EAGAIN and EINTR conditions.
-
+
For other conditions, open_with_retry() will retry the open() a
limited number of times. In addition, a short sleep is imposed
prior to retrying the open(). The reason for this sleep is to give
the kernel a chance to catch up and create the file in question in
the event that GDB "wins" the race to open a file before the kernel
has created it. */
-
+
static int
open_with_retry (const char *pathname, int flags)
{
@@ -523,19 +531,19 @@ open_procinfo_files (procinfo *pi, int which)
#endif
int fd;
- /*
+ /*
* This function is getting ALMOST long enough to break up into several.
* Here is some rationale:
*
* NEW_PROC_API (Solaris 2.6, Solaris 2.7, Unixware):
- * There are several file descriptors that may need to be open
+ * There are several file descriptors that may need to be open
* for any given process or LWP. The ones we're intereted in are:
* - control (ctl) write-only change the state
* - status (status) read-only query the state
* - address space (as) read/write access memory
* - map (map) read-only virtual addr map
* Most of these are opened lazily as they are needed.
- * The pathnames for the 'files' for an LWP look slightly
+ * The pathnames for the 'files' for an LWP look slightly
* different from those of a first-class process:
* Pathnames for a process (<proc-id>):
* /proc/<proc-id>/ctl
@@ -553,12 +561,12 @@ open_procinfo_files (procinfo *pi, int which)
* For convenience, we copy the same file descriptor into all
* three fields of the procinfo struct (ctl_fd, status_fd, and
* as_fd, see NEW_PROC_API above) so that code that uses them
- * doesn't need any #ifdef's.
+ * doesn't need any #ifdef's.
* Pathname for all:
* /proc/<proc-id>
*
* Solaris 2.5 LWP's:
- * Each LWP has an independent file descriptor, but these
+ * Each LWP has an independent file descriptor, but these
* are not obtained via the 'open' system call like the rest:
* instead, they're obtained thru an ioctl call (PIOCOPENLWP)
* to the file descriptor of the parent process.
@@ -617,11 +625,11 @@ open_procinfo_files (procinfo *pi, int which)
* In this case, there is only one file descriptor for each procinfo
* (ie. each process or LWP). In fact, only the file descriptor for
* the process can actually be opened by an 'open' system call.
- * The ones for the LWPs have to be obtained thru an IOCTL call
- * on the process's file descriptor.
+ * The ones for the LWPs have to be obtained thru an IOCTL call
+ * on the process's file descriptor.
*
* For convenience, we copy each procinfo's single file descriptor
- * into all of the fields occupied by the several file descriptors
+ * into all of the fields occupied by the several file descriptors
* of the NEW_PROC_API implementation. That way, the code that uses
* them can be written without ifdefs.
*/
@@ -751,7 +759,7 @@ destroy_one_procinfo (procinfo **list, procinfo *pi)
/* Step one: unlink the procinfo from its list */
if (pi == *list)
*list = pi->next;
- else
+ else
for (ptr = *list; ptr; ptr = ptr->next)
if (ptr->next == pi)
{
@@ -849,7 +857,7 @@ sysset_t_size (procinfo * pi)
}
/* Function: sysset_t_alloc
-
+
Allocate and (partially) initialize a sysset_t struct. */
static sysset_t *
@@ -868,7 +876,7 @@ sysset_t_alloc (procinfo * pi)
#ifdef DYNAMIC_SYSCALLS
/* Function: load_syscalls
-
+
Extract syscall numbers and names from /proc/<pid>/sysent. Initialize
pi->num_syscalls with the number of syscalls and pi->syscall_names
with the names. (Certain numbers may be skipped in which case the
@@ -968,13 +976,13 @@ load_syscalls (procinfo *pi)
strncpy (pi->syscall_names[callnum], namebuf, size-1);
pi->syscall_names[callnum][size-1] = '\0';
}
-
+
close (sysent_fd);
xfree (syscalls);
}
/* Function: free_syscalls
-
+
Free the space allocated for the syscall names from the procinfo
structure. */
@@ -998,7 +1006,7 @@ free_syscalls (procinfo *pi)
Given a name, look up (and return) the corresponding syscall number.
If no match is found, return -1. */
-
+
static int
find_syscall (procinfo *pi, char *name)
{
@@ -1018,7 +1026,7 @@ find_syscall (procinfo *pi, char *name)
/*
* This "module" is the interface layer between the /proc system API
- * and the gdb target vector functions. This layer consists of
+ * and the gdb target vector functions. This layer consists of
* access functions that encapsulate each of the basic operations
* that we need to use from the /proc API.
*
@@ -1118,16 +1126,16 @@ proc_get_status (procinfo *pi)
pi->status_valid = 0; /* fail */
else
{
- /* Sigh... I have to read a different data structure,
+ /* Sigh... I have to read a different data structure,
depending on whether this is a main process or an LWP. */
if (pi->tid)
- pi->status_valid = (read (pi->status_fd,
- (char *) &pi->prstatus.pr_lwp,
+ pi->status_valid = (read (pi->status_fd,
+ (char *) &pi->prstatus.pr_lwp,
sizeof (lwpstatus_t))
== sizeof (lwpstatus_t));
else
{
- pi->status_valid = (read (pi->status_fd,
+ pi->status_valid = (read (pi->status_fd,
(char *) &pi->prstatus,
sizeof (gdb_prstatus_t))
== sizeof (gdb_prstatus_t));
@@ -1136,7 +1144,7 @@ proc_get_status (procinfo *pi)
(pi->prstatus.pr_lwp.pr_flags & PR_ISTOP) &&
pi->prstatus.pr_lwp.pr_why == PR_REQUESTED)
/* Unixware peculiarity -- read the damn thing again! */
- pi->status_valid = (read (pi->status_fd,
+ pi->status_valid = (read (pi->status_fd,
(char *) &pi->prstatus,
sizeof (gdb_prstatus_t))
== sizeof (gdb_prstatus_t));
@@ -1148,7 +1156,7 @@ proc_get_status (procinfo *pi)
if (pi->tid == 0) /* main process */
{
/* Just read the danged status. Now isn't that simple? */
- pi->status_valid =
+ pi->status_valid =
(ioctl (pi->status_fd, PIOCSTATUS, &pi->prstatus) >= 0);
}
else
@@ -1165,7 +1173,7 @@ proc_get_status (procinfo *pi)
win = (ioctl (pi->status_fd, PIOCTSTATUS, &thread_status) >= 0);
if (win)
{
- memcpy (&pi->prstatus, &thread_status.status,
+ memcpy (&pi->prstatus, &thread_status.status,
sizeof (pi->prstatus));
pi->status_valid = 1;
}
@@ -1178,16 +1186,16 @@ proc_get_status (procinfo *pi)
if (pi->status_valid)
{
- PROC_PRETTYFPRINT_STATUS (proc_flags (pi),
+ PROC_PRETTYFPRINT_STATUS (proc_flags (pi),
proc_why (pi),
- proc_what (pi),
+ proc_what (pi),
proc_get_current_thread (pi));
}
/* The status struct includes general regs, so mark them valid too */
pi->gregs_valid = pi->status_valid;
#ifdef NEW_PROC_API
- /* In the read/write multiple-fd model,
+ /* In the read/write multiple-fd model,
the status struct includes the fp regs too, so mark them valid too */
pi->fpregs_valid = pi->status_valid;
#endif
@@ -1198,7 +1206,7 @@ proc_get_status (procinfo *pi)
* Function: proc_flags
*
* returns the process flags (pr_flags field).
- */
+ */
long
proc_flags (procinfo *pi)
@@ -1274,7 +1282,7 @@ proc_nsysarg (procinfo *pi)
if (!pi->status_valid)
if (!proc_get_status (pi))
return 0;
-
+
#ifdef NEW_PROC_API
return pi->prstatus.pr_lwp.pr_nsysarg;
#else
@@ -1294,7 +1302,7 @@ proc_sysargs (procinfo *pi)
if (!pi->status_valid)
if (!proc_get_status (pi))
return NULL;
-
+
#ifdef NEW_PROC_API
return (long *) &pi->prstatus.pr_lwp.pr_sysarg;
#else
@@ -1314,7 +1322,7 @@ proc_syscall (procinfo *pi)
if (!pi->status_valid)
if (!proc_get_status (pi))
return 0;
-
+
#ifdef NEW_PROC_API
return pi->prstatus.pr_lwp.pr_syscall;
#else
@@ -1344,9 +1352,9 @@ proc_cursig (struct procinfo *pi)
}
/*
- * Function: proc_modify_flag
+ * Function: proc_modify_flag
*
- * === I appologize for the messiness of this function.
+ * === I appologize for the messiness of this function.
* === This is an area where the different versions of
* === /proc are more inconsistent than usual. MVS
*
@@ -1368,7 +1376,7 @@ proc_cursig (struct procinfo *pi)
* Note: OSF does not define PR_KLC.
* Note: OSF is the only one that can ONLY use the oldest method.
*
- * Arguments:
+ * Arguments:
* pi -- the procinfo
* flag -- one of PR_FORK, PR_RLC, or PR_ASYNC
* mode -- 1 for set, 0 for reset.
@@ -1383,20 +1391,20 @@ proc_modify_flag (procinfo *pi, long flag, long mode)
{
long win = 0; /* default to fail */
- /*
- * These operations affect the process as a whole, and applying
- * them to an individual LWP has the same meaning as applying them
- * to the main process. Therefore, if we're ever called with a
- * pointer to an LWP's procinfo, let's substitute the process's
- * procinfo and avoid opening the LWP's file descriptor
- * unnecessarily.
+ /*
+ * These operations affect the process as a whole, and applying
+ * them to an individual LWP has the same meaning as applying them
+ * to the main process. Therefore, if we're ever called with a
+ * pointer to an LWP's procinfo, let's substitute the process's
+ * procinfo and avoid opening the LWP's file descriptor
+ * unnecessarily.
*/
if (pi->pid != 0)
pi = find_procinfo_or_die (pi->pid, 0);
#ifdef NEW_PROC_API /* Newest method: UnixWare and newer Solarii */
- /* First normalize the PCUNSET/PCRESET command opcode
+ /* First normalize the PCUNSET/PCRESET command opcode
(which for no obvious reason has a different definition
from one operating system to the next...) */
#ifdef PCUNSET
@@ -1463,7 +1471,7 @@ proc_modify_flag (procinfo *pi, long flag, long mode)
pi->status_valid = 0;
if (!win)
- warning ("procfs: modify_flag failed to turn %s %s",
+ warning ("procfs: modify_flag failed to turn %s %s",
flag == PR_FORK ? "PR_FORK" :
flag == PR_RLC ? "PR_RLC" :
#ifdef PR_ASYNC
@@ -1531,7 +1539,7 @@ proc_set_kill_on_last_close (procinfo *pi)
* Function: proc_unset_kill_on_last_close
*
* Reset the kill_on_last_close flag.
- * Process will NOT be killed when debugger
+ * Process will NOT be killed when debugger
* closes its file handles (or exits or dies).
*
* Returns non-zero for success, zero for failure.
@@ -1581,7 +1589,7 @@ proc_unset_inherit_on_fork (procinfo *pi)
* Function: proc_set_async
*
* Set PR_ASYNC flag.
- * If one LWP stops because of a debug event (signal etc.),
+ * If one LWP stops because of a debug event (signal etc.),
* the remaining LWPs will continue to run.
*
* Returns non-zero for success, zero for failure.
@@ -1614,7 +1622,7 @@ proc_unset_async (procinfo *pi)
* Function: proc_stop_process
*
* Request the process/LWP to stop. Does not wait.
- * Returns non-zero for success, zero for failure.
+ * Returns non-zero for success, zero for failure.
*/
int
@@ -1641,9 +1649,9 @@ proc_stop_process (procinfo *pi)
if (win)
{
pi->status_valid = 1;
- PROC_PRETTYFPRINT_STATUS (proc_flags (pi),
+ PROC_PRETTYFPRINT_STATUS (proc_flags (pi),
proc_why (pi),
- proc_what (pi),
+ proc_what (pi),
proc_get_current_thread (pi));
}
#endif
@@ -1656,7 +1664,7 @@ proc_stop_process (procinfo *pi)
* Function: proc_wait_for_stop
*
* Wait for the process or LWP to stop (block until it does).
- * Returns non-zero for success, zero for failure.
+ * Returns non-zero for success, zero for failure.
*/
int
@@ -1667,10 +1675,10 @@ proc_wait_for_stop (procinfo *pi)
/*
* We should never have to apply this operation to any procinfo
* except the one for the main process. If that ever changes
- * for any reason, then take out the following clause and
+ * for any reason, then take out the following clause and
* replace it with one that makes sure the ctl_fd is open.
*/
-
+
if (pi->tid != 0)
pi = find_procinfo_or_die (pi->pid, 0);
@@ -1687,9 +1695,9 @@ proc_wait_for_stop (procinfo *pi)
if (win)
{
pi->status_valid = 1;
- PROC_PRETTYFPRINT_STATUS (proc_flags (pi),
+ PROC_PRETTYFPRINT_STATUS (proc_flags (pi),
proc_why (pi),
- proc_what (pi),
+ proc_what (pi),
proc_get_current_thread (pi));
}
#endif
@@ -1720,7 +1728,7 @@ proc_wait_for_stop (procinfo *pi)
* signo if zero, clear the current signal if any.
* if non-zero, set the current signal to this one.
*
- * Returns non-zero for success, zero for failure.
+ * Returns non-zero for success, zero for failure.
*/
int
@@ -1733,7 +1741,7 @@ proc_run_process (procinfo *pi, int step, int signo)
* We will probably have to apply this operation to individual threads,
* so make sure the control file descriptor is open.
*/
-
+
if (pi->ctl_fd == 0 &&
open_procinfo_files (pi, FD_CTL) == 0)
{
@@ -1773,7 +1781,7 @@ proc_run_process (procinfo *pi, int step, int signo)
* Function: proc_set_traced_signals
*
* Register to trace signals in the process or LWP.
- * Returns non-zero for success, zero for failure.
+ * Returns non-zero for success, zero for failure.
*/
int
@@ -1784,10 +1792,10 @@ proc_set_traced_signals (procinfo *pi, gdb_sigset_t *sigset)
/*
* We should never have to apply this operation to any procinfo
* except the one for the main process. If that ever changes
- * for any reason, then take out the following clause and
+ * for any reason, then take out the following clause and
* replace it with one that makes sure the ctl_fd is open.
*/
-
+
if (pi->tid != 0)
pi = find_procinfo_or_die (pi->pid, 0);
@@ -1819,7 +1827,7 @@ proc_set_traced_signals (procinfo *pi, gdb_sigset_t *sigset)
* Function: proc_set_traced_faults
*
* Register to trace hardware faults in the process or LWP.
- * Returns non-zero for success, zero for failure.
+ * Returns non-zero for success, zero for failure.
*/
int
@@ -1830,10 +1838,10 @@ proc_set_traced_faults (procinfo *pi, fltset_t *fltset)
/*
* We should never have to apply this operation to any procinfo
* except the one for the main process. If that ever changes
- * for any reason, then take out the following clause and
+ * for any reason, then take out the following clause and
* replace it with one that makes sure the ctl_fd is open.
*/
-
+
if (pi->tid != 0)
pi = find_procinfo_or_die (pi->pid, 0);
@@ -1863,7 +1871,7 @@ proc_set_traced_faults (procinfo *pi, fltset_t *fltset)
* Function: proc_set_traced_sysentry
*
* Register to trace entry to system calls in the process or LWP.
- * Returns non-zero for success, zero for failure.
+ * Returns non-zero for success, zero for failure.
*/
int
@@ -1874,10 +1882,10 @@ proc_set_traced_sysentry (procinfo *pi, sysset_t *sysset)
/*
* We should never have to apply this operation to any procinfo
* except the one for the main process. If that ever changes
- * for any reason, then take out the following clause and
+ * for any reason, then take out the following clause and
* replace it with one that makes sure the ctl_fd is open.
*/
-
+
if (pi->tid != 0)
pi = find_procinfo_or_die (pi->pid, 0);
@@ -1905,7 +1913,7 @@ proc_set_traced_sysentry (procinfo *pi, sysset_t *sysset)
#endif
/* The above operation renders the procinfo's cached pstatus obsolete. */
pi->status_valid = 0;
-
+
return win;
}
@@ -1913,7 +1921,7 @@ proc_set_traced_sysentry (procinfo *pi, sysset_t *sysset)
* Function: proc_set_traced_sysexit
*
* Register to trace exit from system calls in the process or LWP.
- * Returns non-zero for success, zero for failure.
+ * Returns non-zero for success, zero for failure.
*/
int
@@ -1924,10 +1932,10 @@ proc_set_traced_sysexit (procinfo *pi, sysset_t *sysset)
/*
* We should never have to apply this operation to any procinfo
* except the one for the main process. If that ever changes
- * for any reason, then take out the following clause and
+ * for any reason, then take out the following clause and
* replace it with one that makes sure the ctl_fd is open.
*/
-
+
if (pi->tid != 0)
pi = find_procinfo_or_die (pi->pid, 0);
@@ -1963,7 +1971,7 @@ proc_set_traced_sysexit (procinfo *pi, sysset_t *sysset)
* Function: proc_set_held_signals
*
* Specify the set of blocked / held signals in the process or LWP.
- * Returns non-zero for success, zero for failure.
+ * Returns non-zero for success, zero for failure.
*/
int
@@ -1974,10 +1982,10 @@ proc_set_held_signals (procinfo *pi, gdb_sigset_t *sighold)
/*
* We should never have to apply this operation to any procinfo
* except the one for the main process. If that ever changes
- * for any reason, then take out the following clause and
+ * for any reason, then take out the following clause and
* replace it with one that makes sure the ctl_fd is open.
*/
-
+
if (pi->tid != 0)
pi = find_procinfo_or_die (pi->pid, 0);
@@ -2017,10 +2025,10 @@ proc_get_pending_signals (procinfo *pi, gdb_sigset_t *save)
/*
* We should never have to apply this operation to any procinfo
* except the one for the main process. If that ever changes
- * for any reason, then take out the following clause and
+ * for any reason, then take out the following clause and
* replace it with one that makes sure the ctl_fd is open.
*/
-
+
if (pi->tid != 0)
pi = find_procinfo_or_die (pi->pid, 0);
@@ -2054,10 +2062,10 @@ proc_get_signal_actions (procinfo *pi, gdb_sigaction_t *save)
/*
* We should never have to apply this operation to any procinfo
* except the one for the main process. If that ever changes
- * for any reason, then take out the following clause and
+ * for any reason, then take out the following clause and
* replace it with one that makes sure the ctl_fd is open.
*/
-
+
if (pi->tid != 0)
pi = find_procinfo_or_die (pi->pid, 0);
@@ -2091,10 +2099,10 @@ proc_get_held_signals (procinfo *pi, gdb_sigset_t *save)
/*
* We should never have to apply this operation to any procinfo
* except the one for the main process. If that ever changes
- * for any reason, then take out the following clause and
+ * for any reason, then take out the following clause and
* replace it with one that makes sure the ctl_fd is open.
*/
-
+
if (pi->tid != 0)
pi = find_procinfo_or_die (pi->pid, 0);
@@ -2137,10 +2145,10 @@ proc_get_traced_signals (procinfo *pi, gdb_sigset_t *save)
/*
* We should never have to apply this operation to any procinfo
* except the one for the main process. If that ever changes
- * for any reason, then take out the following clause and
+ * for any reason, then take out the following clause and
* replace it with one that makes sure the ctl_fd is open.
*/
-
+
if (pi->tid != 0)
pi = find_procinfo_or_die (pi->pid, 0);
@@ -2179,10 +2187,10 @@ proc_trace_signal (procinfo *pi, int signo)
/*
* We should never have to apply this operation to any procinfo
* except the one for the main process. If that ever changes
- * for any reason, then take out the following clause and
+ * for any reason, then take out the following clause and
* replace it with one that makes sure the ctl_fd is open.
*/
-
+
if (pi->tid != 0)
pi = find_procinfo_or_die (pi->pid, 0);
@@ -2213,10 +2221,10 @@ proc_ignore_signal (procinfo *pi, int signo)
/*
* We should never have to apply this operation to any procinfo
* except the one for the main process. If that ever changes
- * for any reason, then take out the following clause and
+ * for any reason, then take out the following clause and
* replace it with one that makes sure the ctl_fd is open.
*/
-
+
if (pi->tid != 0)
pi = find_procinfo_or_die (pi->pid, 0);
@@ -2247,10 +2255,10 @@ proc_get_traced_faults (procinfo *pi, fltset_t *save)
/*
* We should never have to apply this operation to any procinfo
* except the one for the main process. If that ever changes
- * for any reason, then take out the following clause and
+ * for any reason, then take out the following clause and
* replace it with one that makes sure the ctl_fd is open.
*/
-
+
if (pi->tid != 0)
pi = find_procinfo_or_die (pi->pid, 0);
@@ -2289,10 +2297,10 @@ proc_get_traced_sysentry (procinfo *pi, sysset_t *save)
/*
* We should never have to apply this operation to any procinfo
* except the one for the main process. If that ever changes
- * for any reason, then take out the following clause and
+ * for any reason, then take out the following clause and
* replace it with one that makes sure the ctl_fd is open.
*/
-
+
if (pi->tid != 0)
pi = find_procinfo_or_die (pi->pid, 0);
@@ -2362,10 +2370,10 @@ proc_get_traced_sysexit (procinfo *pi, sysset_t *save)
/*
* We should never have to apply this operation to any procinfo
* except the one for the main process. If that ever changes
- * for any reason, then take out the following clause and
+ * for any reason, then take out the following clause and
* replace it with one that makes sure the ctl_fd is open.
*/
-
+
if (pi->tid != 0)
pi = find_procinfo_or_die (pi->pid, 0);
@@ -2435,10 +2443,10 @@ proc_clear_current_fault (procinfo *pi)
/*
* We should never have to apply this operation to any procinfo
* except the one for the main process. If that ever changes
- * for any reason, then take out the following clause and
+ * for any reason, then take out the following clause and
* replace it with one that makes sure the ctl_fd is open.
*/
-
+
if (pi->tid != 0)
pi = find_procinfo_or_die (pi->pid, 0);
@@ -2481,17 +2489,17 @@ proc_set_current_signal (procinfo *pi, int signo)
/*
* We should never have to apply this operation to any procinfo
* except the one for the main process. If that ever changes
- * for any reason, then take out the following clause and
+ * for any reason, then take out the following clause and
* replace it with one that makes sure the ctl_fd is open.
*/
-
+
if (pi->tid != 0)
pi = find_procinfo_or_die (pi->pid, 0);
#ifdef PROCFS_DONT_PIOCSSIG_CURSIG
/* With Alpha OSF/1 procfs, the kernel gets really confused if it
* receives a PIOCSSIG with a signal identical to the current signal,
- * it messes up the current signal. Work around the kernel bug.
+ * it messes up the current signal. Work around the kernel bug.
*/
if (signo > 0 &&
signo == proc_cursig (pi))
@@ -2531,10 +2539,10 @@ proc_clear_current_signal (procinfo *pi)
/*
* We should never have to apply this operation to any procinfo
* except the one for the main process. If that ever changes
- * for any reason, then take out the following clause and
+ * for any reason, then take out the following clause and
* replace it with one that makes sure the ctl_fd is open.
*/
-
+
if (pi->tid != 0)
pi = find_procinfo_or_die (pi->pid, 0);
@@ -2581,7 +2589,7 @@ proc_get_gregs (procinfo *pi)
/*
* OK, sorry about the ifdef's.
- * There's three cases instead of two, because
+ * There's three cases instead of two, because
* in this instance Unixware and Solaris/RW differ.
*/
@@ -2831,10 +2839,10 @@ proc_parent_pid (procinfo *pi)
/*
* We should never have to apply this operation to any procinfo
* except the one for the main process. If that ever changes
- * for any reason, then take out the following clause and
+ * for any reason, then take out the following clause and
* replace it with one that makes sure the ctl_fd is open.
*/
-
+
if (pi->tid != 0)
pi = find_procinfo_or_die (pi->pid, 0);
@@ -2867,7 +2875,7 @@ procfs_address_to_host_pointer (CORE_ADDR addr)
int
proc_set_watchpoint (procinfo *pi, CORE_ADDR addr, int len, int wflags)
{
-#if !defined (TARGET_HAS_HARDWARE_WATCHPOINTS)
+#if !defined (TARGET_HAS_HARDWARE_WATCHPOINTS)
return 0;
#else
/* Horrible hack! Detect Solaris 2.5, because this doesn't work on 2.5 */
@@ -2975,11 +2983,11 @@ proc_get_LDT_entry (procinfo *pi, int key)
/* This alloc has to persist, 'cause we return a pointer to it. */
if (nldt > nalloc)
{
- ldt_entry = (struct ssd *)
+ ldt_entry = (struct ssd *)
xrealloc (ldt_entry, (nldt + 1) * sizeof (struct ssd));
nalloc = nldt;
}
-
+
/* Read the whole table in one gulp. */
if (ioctl (pi->ctl_fd, PIOCLDT, ldt_entry) < 0)
{
@@ -3007,16 +3015,16 @@ proc_get_LDT_entry (procinfo *pi, int key)
since there is a different way to do threads on every OS. */
/*
- * Function: proc_get_nthreads
+ * Function: proc_get_nthreads
*
- * Return the number of threads for the process
+ * Return the number of threads for the process
*/
#if defined (PIOCNTHR) && defined (PIOCTLIST)
/*
* OSF version
*/
-int
+int
proc_get_nthreads (procinfo *pi)
{
int nthreads = 0;
@@ -3040,10 +3048,10 @@ proc_get_nthreads (procinfo *pi)
return 0;
/*
- * NEW_PROC_API: only works for the process procinfo,
+ * NEW_PROC_API: only works for the process procinfo,
* because the LWP procinfos do not get prstatus filled in.
*/
-#ifdef NEW_PROC_API
+#ifdef NEW_PROC_API
if (pi->tid != 0) /* find the parent process procinfo */
pi = find_procinfo_or_die (pi->pid, 0);
#endif
@@ -3081,10 +3089,10 @@ proc_get_current_thread (procinfo *pi)
/*
* Note: this should be applied to the root procinfo for the process,
* not to the procinfo for an LWP. If applied to the procinfo for
- * an LWP, it will simply return that LWP's ID. In that case,
+ * an LWP, it will simply return that LWP's ID. In that case,
* find the parent process procinfo.
*/
-
+
if (pi->tid != 0)
pi = find_procinfo_or_die (pi->pid, 0);
@@ -3104,7 +3112,7 @@ proc_get_current_thread (procinfo *pi)
/*
* OSF version
*/
-int
+int
proc_get_current_thread (procinfo *pi)
{
#if 0 /* FIXME: not ready for prime time? */
@@ -3118,7 +3126,7 @@ proc_get_current_thread (procinfo *pi)
/*
* Default version
*/
-int
+int
proc_get_current_thread (procinfo *pi)
{
return 0;
@@ -3128,7 +3136,7 @@ proc_get_current_thread (procinfo *pi)
#endif
/*
- * Function: proc_update_threads
+ * Function: proc_update_threads
*
* Discover the IDs of all the threads within the process, and
* create a procinfo for each of them (chained to the parent).
@@ -3165,10 +3173,10 @@ proc_update_threads (procinfo *pi)
/*
* We should never have to apply this operation to any procinfo
* except the one for the main process. If that ever changes
- * for any reason, then take out the following clause and
+ * for any reason, then take out the following clause and
* replace it with one that makes sure the ctl_fd is open.
*/
-
+
if (pi->tid != 0)
pi = find_procinfo_or_die (pi->pid, 0);
@@ -3220,10 +3228,10 @@ proc_update_threads (procinfo *pi)
/*
* We should never have to apply this operation to any procinfo
* except the one for the main process. If that ever changes
- * for any reason, then take out the following clause and
+ * for any reason, then take out the following clause and
* replace it with one that makes sure the ctl_fd is open.
*/
-
+
if (pi->tid != 0)
pi = find_procinfo_or_die (pi->pid, 0);
@@ -3232,8 +3240,8 @@ proc_update_threads (procinfo *pi)
/*
* Unixware
*
- * Note: this brute-force method is the only way I know of
- * to accomplish this task on Unixware. This method will
+ * Note: this brute-force method is the only way I know of
+ * to accomplish this task on Unixware. This method will
* also work on Solaris 2.6 and 2.7. There is a much simpler
* and more elegant way to do this on Solaris, but the margins
* of this manuscript are too small to write it here... ;-)
@@ -3261,7 +3269,7 @@ proc_update_threads (procinfo *pi)
/*
* OSF version
*/
-int
+int
proc_update_threads (procinfo *pi)
{
int nthreads, i;
@@ -3270,10 +3278,10 @@ proc_update_threads (procinfo *pi)
/*
* We should never have to apply this operation to any procinfo
* except the one for the main process. If that ever changes
- * for any reason, then take out the following clause and
+ * for any reason, then take out the following clause and
* replace it with one that makes sure the ctl_fd is open.
*/
-
+
if (pi->tid != 0)
pi = find_procinfo_or_die (pi->pid, 0);
@@ -3284,7 +3292,7 @@ proc_update_threads (procinfo *pi)
return 0; /* nothing to do for 1 or fewer threads */
threads = xmalloc (nthreads * sizeof (tid_t));
-
+
if (ioctl (pi->ctl_fd, PIOCTLIST, threads) < 0)
proc_error (pi, "procfs: update_threads (PIOCTLIST)", __LINE__);
@@ -3322,8 +3330,8 @@ proc_update_threads (procinfo *pi)
* Note: this function does NOT call update_threads.
* If you want to discover new threads first, you must
* call that function explicitly. This function just makes
- * a quick pass over the currently-known procinfos.
- *
+ * a quick pass over the currently-known procinfos.
+ *
* Arguments:
* pi - parent process procinfo
* func - per-thread function
@@ -3344,10 +3352,10 @@ proc_iterate_over_threads (procinfo *pi,
/*
* We should never have to apply this operation to any procinfo
* except the one for the main process. If that ever changes
- * for any reason, then take out the following clause and
+ * for any reason, then take out the following clause and
* replace it with one that makes sure the ctl_fd is open.
*/
-
+
if (pi->tid != 0)
pi = find_procinfo_or_die (pi->pid, 0);
@@ -3504,7 +3512,7 @@ procfs_debug_inferior (procinfo *pi)
return 0;
}
-static void
+static void
procfs_attach (char *args, int from_tty)
{
char *exec_file;
@@ -3522,7 +3530,7 @@ procfs_attach (char *args, int from_tty)
exec_file = get_exec_file (0);
if (exec_file)
- printf_filtered ("Attaching to program `%s', %s\n",
+ printf_filtered ("Attaching to program `%s', %s\n",
exec_file, target_pid_to_str (pid_to_ptid (pid)));
else
printf_filtered ("Attaching to %s\n",
@@ -3534,7 +3542,7 @@ procfs_attach (char *args, int from_tty)
push_target (&procfs_ops);
}
-static void
+static void
procfs_detach (char *args, int from_tty)
{
char *exec_file;
@@ -3551,7 +3559,7 @@ procfs_detach (char *args, int from_tty)
}
if (args)
signo = atoi (args);
-
+
do_detach (signo);
inferior_ptid = null_ptid;
unpush_target (&procfs_ops); /* Pop out of handling an inferior */
@@ -3569,7 +3577,7 @@ do_attach (ptid_t ptid)
if (!open_procinfo_files (pi, FD_CTL))
{
fprintf_filtered (gdb_stderr, "procfs:%d -- ", __LINE__);
- sprintf (errmsg, "do_attach: couldn't open /proc file for process %d",
+ sprintf (errmsg, "do_attach: couldn't open /proc file for process %d",
PIDGET (ptid));
dead_procinfo (pi, errmsg, NOKILL);
}
@@ -3601,7 +3609,7 @@ do_attach (ptid_t ptid)
dead_procinfo (pi, "do_attach: couldn't save traced syscall entries.",
NOKILL);
if (!proc_get_traced_sysexit (pi, pi->saved_exitset))
- dead_procinfo (pi, "do_attach: couldn't save traced syscall exits.",
+ dead_procinfo (pi, "do_attach: couldn't save traced syscall exits.",
NOKILL);
if (!proc_get_held_signals (pi, &pi->saved_sighold))
dead_procinfo (pi, "do_attach: couldn't save held signals.", NOKILL);
@@ -3685,15 +3693,15 @@ procfs_fetch_registers (int regno)
/* First look up procinfo for the main process. */
pi = find_procinfo_or_die (pid, 0);
- /* If the event thread is not the same as GDB's requested thread
- (ie. inferior_ptid), then look up procinfo for the requested
+ /* If the event thread is not the same as GDB's requested thread
+ (ie. inferior_ptid), then look up procinfo for the requested
thread. */
- if ((tid != 0) &&
+ if ((tid != 0) &&
(tid != proc_get_current_thread (pi)))
pi = find_procinfo_or_die (pid, tid);
if (pi == NULL)
- error ("procfs: fetch_registers failed to find procinfo for %s",
+ error ("procfs: fetch_registers failed to find procinfo for %s",
target_pid_to_str (inferior_ptid));
if ((gregs = proc_get_gregs (pi)) == NULL)
@@ -3703,11 +3711,10 @@ procfs_fetch_registers (int regno)
if (FP0_REGNUM >= 0) /* need floating point? */
{
- if ((regno >= 0 && regno < FP0_REGNUM) ||
- regno == PC_REGNUM ||
- (DEPRECATED_NPC_REGNUM >= 0 && regno == DEPRECATED_NPC_REGNUM) ||
- regno == DEPRECATED_FP_REGNUM ||
- regno == SP_REGNUM)
+ if ((regno >= 0 && regno < FP0_REGNUM)
+ || regno == PC_REGNUM
+ || regno == DEPRECATED_FP_REGNUM
+ || regno == SP_REGNUM)
return; /* not a floating point register */
if ((fpregs = proc_get_fpregs (pi)) == NULL)
@@ -3734,7 +3741,7 @@ procfs_prepare_to_store (void)
/*
* store_registers
*
- * Since the /proc interface will not read individual registers,
+ * Since the /proc interface will not read individual registers,
* we will cache these requests until the process is resumed, and
* only then write them back to the inferior process.
*
@@ -3760,7 +3767,7 @@ procfs_store_registers (int regno)
/* If current lwp for process is not the same as requested thread
(ie. inferior_ptid), then find procinfo for the requested thread. */
- if ((tid != 0) &&
+ if ((tid != 0) &&
(tid != proc_get_current_thread (pi)))
pi = find_procinfo_or_die (pid, tid);
@@ -3777,11 +3784,10 @@ procfs_store_registers (int regno)
if (FP0_REGNUM >= 0) /* need floating point? */
{
- if ((regno >= 0 && regno < FP0_REGNUM) ||
- regno == PC_REGNUM ||
- (DEPRECATED_NPC_REGNUM >= 0 && regno == DEPRECATED_NPC_REGNUM) ||
- regno == DEPRECATED_FP_REGNUM ||
- regno == SP_REGNUM)
+ if ((regno >= 0 && regno < FP0_REGNUM)
+ || regno == PC_REGNUM
+ || regno == DEPRECATED_FP_REGNUM
+ || regno == SP_REGNUM)
return; /* not a floating point register */
if ((fpregs = proc_get_fpregs (pi)) == NULL)
@@ -3940,7 +3946,7 @@ wait_again:
into a waitstatus for GDB.
If we actually had to call wait because the /proc file
- is gone (child terminated), then we skip this block,
+ is gone (child terminated), then we skip this block,
because we already have a waitstatus. */
flags = proc_flags (pi);
@@ -3981,20 +3987,20 @@ wait_again:
{
/* Handle SYS_exit call only */
/* Stopped at entry to SYS_exit.
- Make it runnable, resume it, then use
+ Make it runnable, resume it, then use
the wait system call to get its exit code.
- Proc_run_process always clears the current
+ Proc_run_process always clears the current
fault and signal.
Then return its exit status. */
pi->status_valid = 0;
wstat = 0;
- /* FIXME: what we should do is return
+ /* FIXME: what we should do is return
TARGET_WAITKIND_SPURIOUS. */
if (!proc_run_process (pi, 0, 0))
proc_error (pi, "target_wait, run_process", __LINE__);
if (attach_flag)
{
- /* Don't call wait: simulate waiting for exit,
+ /* Don't call wait: simulate waiting for exit,
return a "success" exit code. Bogus: what if
it returns something else? */
wstat = 0;
@@ -4030,7 +4036,7 @@ wait_again:
{
printf_filtered ("%ld syscall arguments:\n", nsysargs);
for (i = 0; i < nsysargs; i++)
- printf_filtered ("#%ld: 0x%08lx\n",
+ printf_filtered ("#%ld: 0x%08lx\n",
i, sysargs[i]);
}
@@ -4101,7 +4107,7 @@ wait_again:
SYS_fork, or SYS_vfork here? The old procfs
seemed to use this event to handle threads on
older (non-LWP) systems, where I'm assuming
- that threads were actually separate processes.
+ that threads were actually separate processes.
Irix, maybe? Anyway, low priority for now. */
}
else
@@ -4118,7 +4124,7 @@ wait_again:
{
printf_filtered ("%ld syscall arguments:\n", nsysargs);
for (i = 0; i < nsysargs; i++)
- printf_filtered ("#%ld: 0x%08lx\n",
+ printf_filtered ("#%ld: 0x%08lx\n",
i, sysargs[i]);
}
}
@@ -4149,7 +4155,7 @@ wait_again:
temp_ptid = MERGEPID (pi->pid, temp_tid);
if (!in_thread_list (temp_ptid))
{
- printf_filtered ("[New %s]\n",
+ printf_filtered ("[New %s]\n",
target_pid_to_str (temp_ptid));
add_thread (temp_ptid);
}
@@ -4227,9 +4233,9 @@ wait_again:
!in_thread_list (retval))
{
/*
- * We have a new thread.
+ * We have a new thread.
* We need to add it both to GDB's list and to our own.
- * If we don't create a procinfo, resume may be unhappy
+ * If we don't create a procinfo, resume may be unhappy
* later.
*/
printf_filtered ("[New %s]\n", target_pid_to_str (retval));
@@ -4238,16 +4244,16 @@ wait_again:
create_procinfo (PIDGET (retval), TIDGET (retval));
/* In addition, it's possible that this is the first
- * new thread we've seen, in which case we may not
+ * new thread we've seen, in which case we may not
* have created entries for inferior_ptid yet.
*/
if (TIDGET (inferior_ptid) != 0)
{
if (!in_thread_list (inferior_ptid))
add_thread (inferior_ptid);
- if (find_procinfo (PIDGET (inferior_ptid),
+ if (find_procinfo (PIDGET (inferior_ptid),
TIDGET (inferior_ptid)) == NULL)
- create_procinfo (PIDGET (inferior_ptid),
+ create_procinfo (PIDGET (inferior_ptid),
TIDGET (inferior_ptid));
}
}
@@ -4269,6 +4275,40 @@ wait_again:
return retval;
}
+/* Perform a partial transfer to/from the specified object. For
+ memory transfers, fall back to the old memory xfer functions. */
+
+static LONGEST
+procfs_xfer_partial (struct target_ops *ops, enum target_object object,
+ const char *annex, void *readbuf,
+ const void *writebuf, ULONGEST offset, LONGEST len)
+{
+ switch (object)
+ {
+ case TARGET_OBJECT_MEMORY:
+ if (readbuf)
+ return (*ops->to_xfer_memory) (offset, readbuf, len, 0/*write*/,
+ NULL, ops);
+ if (writebuf)
+ return (*ops->to_xfer_memory) (offset, readbuf, len, 1/*write*/,
+ NULL, ops);
+ return -1;
+
+#ifdef NEW_PROC_API
+ case TARGET_OBJECT_AUXV:
+ return procfs_xfer_auxv (ops, object, annex, readbuf, writebuf,
+ offset, len);
+#endif
+
+ default:
+ if (ops->beneath != NULL)
+ return ops->beneath->to_xfer_partial (ops->beneath, object, annex,
+ readbuf, writebuf, offset, len);
+ return -1;
+ }
+}
+
+
/* Transfer LEN bytes between GDB address MYADDR and target address
MEMADDR. If DOWRITE is non-zero, transfer them to the target,
otherwise transfer them from the target. TARGET is unused.
@@ -4327,7 +4367,7 @@ procfs_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int dowrite,
* If there are "dirty" caches that need to be written back
* to the child process, do that.
*
- * File descriptors are also cached.
+ * File descriptors are also cached.
* As they are a limited resource, we cannot hold onto them indefinitely.
* However, as they are expensive to open, we don't want to throw them
* away indescriminately either. As a compromise, we will keep the
@@ -4335,7 +4375,7 @@ procfs_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int dowrite,
* descriptors we may have accumulated for the threads.
*
* Return value:
- * As this function is called by iterate_over_threads, it always
+ * As this function is called by iterate_over_threads, it always
* returns zero (so that iterate_over_threads will keep iterating).
*/
@@ -4359,14 +4399,14 @@ invalidate_cache (procinfo *parent, procinfo *pi, void *ptr)
if (parent == NULL ||
proc_get_current_thread (parent) != pi->tid)
if (!proc_set_fpregs (pi)) /* flush fpregs cache */
- proc_warn (pi, "target_resume, set_fpregs",
+ proc_warn (pi, "target_resume, set_fpregs",
__LINE__);
#endif
if (parent != NULL)
{
/* The presence of a parent indicates that this is an LWP.
- Close any file descriptors that it might have open.
+ Close any file descriptors that it might have open.
We don't do this to the master (parent) procinfo. */
close_procinfo_files (pi);
@@ -4414,10 +4454,10 @@ make_signal_thread_runnable (procinfo *process, procinfo *pi, void *ptr)
* procfs_wait and wait for it to stop again (unles gdb is async).
*
* Arguments:
- * step: if true, then arrange for the child to stop again
+ * step: if true, then arrange for the child to stop again
* after executing a single instruction.
* signo: if zero, then cancel any pending signal.
- * If non-zero, then arrange for the indicated signal
+ * If non-zero, then arrange for the indicated signal
* to be delivered to the child when it runs.
* pid: if -1, then allow any child thread to run.
* if non-zero, then allow only the indicated thread to run.
@@ -4430,11 +4470,11 @@ procfs_resume (ptid_t ptid, int step, enum target_signal signo)
procinfo *pi, *thread;
int native_signo;
- /* 2.1:
+ /* 2.1:
prrun.prflags |= PRSVADDR;
- prrun.pr_vaddr = $PC; set resume address
+ prrun.pr_vaddr = $PC; set resume address
prrun.prflags |= PRSTRACE; trace signals in pr_trace (all)
- prrun.prflags |= PRSFAULT; trace faults in pr_fault (all but PAGE)
+ prrun.prflags |= PRSFAULT; trace faults in pr_fault (all but PAGE)
prrun.prflags |= PRCFAULT; clear current fault.
PRSTRACE and PRSFAULT can be done by other means
@@ -4463,7 +4503,7 @@ procfs_resume (ptid_t ptid, int step, enum target_signal signo)
/* Running the process voids all cached registers and status. */
/* Void the threads' caches first */
- proc_iterate_over_threads (pi, invalidate_cache, NULL);
+ proc_iterate_over_threads (pi, invalidate_cache, NULL);
/* Void the process procinfo's caches. */
invalidate_cache (NULL, pi, NULL);
@@ -4483,7 +4523,7 @@ procfs_resume (ptid_t ptid, int step, enum target_signal signo)
proc_error (pi, "target_resume, set_async", __LINE__);
#endif
#if 0
- proc_iterate_over_threads (pi,
+ proc_iterate_over_threads (pi,
make_signal_thread_runnable,
NULL);
#endif
@@ -4504,7 +4544,7 @@ procfs_resume (ptid_t ptid, int step, enum target_signal signo)
/*
* Function: register_gdb_signals
*
- * Traverse the list of signals that GDB knows about
+ * Traverse the list of signals that GDB knows about
* (see "handle" command), and arrange for the target
* to be stopped or not, according to these settings.
*
@@ -4556,7 +4596,7 @@ static void
procfs_files_info (struct target_ops *ignore)
{
printf_filtered ("\tUsing the running image of %s %s via /proc.\n",
- attach_flag? "attached": "child",
+ attach_flag? "attached": "child",
target_pid_to_str (inferior_ptid));
}
@@ -4575,7 +4615,7 @@ procfs_open (char *args, int from_tty)
/*
* Function: target_can_run
*
- * This tells GDB that this target vector can be invoked
+ * This tells GDB that this target vector can be invoked
* for "run" or "attach".
*/
@@ -4592,7 +4632,7 @@ procfs_can_run (void)
may layer their own process structure atop that provided here.
sol-thread.c does this because of the Solaris two-level thread
model. */
-
+
/* NOTE: possibly obsolete -- use the thread_stratum approach instead. */
return !procfs_suppress_run;
@@ -4617,7 +4657,7 @@ procfs_stop (void)
* Function: unconditionally_kill_inferior
*
* Make it die. Wait for it to die. Clean up after it.
- * Note: this should only be applied to the real process,
+ * Note: this should only be applied to the real process,
* not to an LWP, because of the check for parent-process.
* If we need this to work for an LWP, it needs some more logic.
*/
@@ -4664,7 +4704,7 @@ unconditionally_kill_inferior (procinfo *pi)
/* If pi is GDB's child, wait for it to die. */
if (parent_pid == getpid ())
- /* FIXME: should we use waitpid to make sure we get the right event?
+ /* FIXME: should we use waitpid to make sure we get the right event?
Should we check the returned event? */
{
#if 0
@@ -4684,7 +4724,7 @@ unconditionally_kill_inferior (procinfo *pi)
* Then we want GDB to forget all about it.
*/
-static void
+static void
procfs_kill_inferior (void)
{
if (!ptid_equal (inferior_ptid, null_ptid)) /* ? */
@@ -4704,7 +4744,7 @@ procfs_kill_inferior (void)
* Forget we ever debugged this thing!
*/
-static void
+static void
procfs_mourn_inferior (void)
{
procinfo *pi;
@@ -4723,13 +4763,13 @@ procfs_mourn_inferior (void)
/*
* Function: init_inferior
*
- * When GDB forks to create a runnable inferior process,
+ * When GDB forks to create a runnable inferior process,
* this function is called on the parent side of the fork.
* It's job is to do whatever is necessary to make the child
* ready to be debugged, and then wait for the child to synchronize.
*/
-static void
+static void
procfs_init_inferior (int pid)
{
procinfo *pi;
@@ -4914,7 +4954,7 @@ procfs_set_exec_trap (void)
if (!proc_unset_run_on_last_close (pi))
proc_warn (pi, "set_exec_trap, unset_RLC", __LINE__);
- /* FIXME: No need to destroy the procinfo --
+ /* FIXME: No need to destroy the procinfo --
we have our own address space, and we're about to do an exec! */
/*destroy_procinfo (pi);*/
}
@@ -4923,10 +4963,10 @@ procfs_set_exec_trap (void)
* Function: create_inferior
*
* This function is called BEFORE gdb forks the inferior process.
- * Its only real responsibility is to set things up for the fork,
+ * Its only real responsibility is to set things up for the fork,
* and tell GDB which two functions to call after the fork (one
* for the parent, and one for the child).
- *
+ *
* This function does a complicated search for a unix shell program,
* which it then uses to parse arguments and environment variables
* to be sent to the child. I wonder whether this code could not
@@ -5007,7 +5047,7 @@ procfs_create_inferior (char *exec_file, char *allargs, char **env)
shell_file = tryname;
}
- fork_inferior (exec_file, allargs, env, procfs_set_exec_trap,
+ fork_inferior (exec_file, allargs, env, procfs_set_exec_trap,
procfs_init_inferior, NULL, shell_file);
/* We are at the first instruction we care about. */
@@ -5037,7 +5077,7 @@ procfs_notice_thread (procinfo *pi, procinfo *thread, void *ptr)
/*
* Function: target_find_new_threads
*
- * Query all the threads that the target knows about,
+ * Query all the threads that the target knows about,
* and give them back to GDB to add to its list.
*/
@@ -5052,7 +5092,7 @@ procfs_find_new_threads (void)
proc_iterate_over_threads (pi, procfs_notice_thread, NULL);
}
-/*
+/*
* Function: target_thread_alive
*
* Return true if the thread is still 'alive'.
@@ -5087,7 +5127,7 @@ procfs_thread_alive (ptid_t ptid)
/*
* Function: target_pid_to_str
*
- * Return a string to be used to identify the thread in
+ * Return a string to be used to identify the thread in
* the "info threads" display.
*/
@@ -5114,16 +5154,16 @@ procfs_pid_to_str (ptid_t ptid)
* Insert a watchpoint
*/
-int
+int
procfs_set_watchpoint (ptid_t ptid, CORE_ADDR addr, int len, int rwflag,
int after)
{
#ifndef UNIXWARE
#ifndef AIX5
int pflags = 0;
- procinfo *pi;
+ procinfo *pi;
- pi = find_procinfo_or_die (PIDGET (ptid) == -1 ?
+ pi = find_procinfo_or_die (PIDGET (ptid) == -1 ?
PIDGET (inferior_ptid) : PIDGET (ptid), 0);
/* Translate from GDB's flags to /proc's */
@@ -5168,7 +5208,7 @@ procfs_set_watchpoint (ptid_t ptid, CORE_ADDR addr, int len, int rwflag,
is one of bp_hardware_watchpoint, bp_read_watchpoint, bp_write_watchpoint,
or bp_hardware_watchpoint. CNT is the number of watchpoints used so
far.
-
+
Note: procfs_can_use_hw_breakpoint() is not yet used by all
procfs.c targets due to the fact that some of them still define
TARGET_CAN_USE_HARDWARE_WATCHPOINT. */
@@ -5208,7 +5248,7 @@ procfs_stopped_by_watchpoint (ptid_t ptid)
{
procinfo *pi;
- pi = find_procinfo_or_die (PIDGET (ptid) == -1 ?
+ pi = find_procinfo_or_die (PIDGET (ptid) == -1 ?
PIDGET (inferior_ptid) : PIDGET (ptid), 0);
if (!pi) /* If no process, then not stopped by watchpoint! */
@@ -5217,7 +5257,7 @@ procfs_stopped_by_watchpoint (ptid_t ptid)
if (proc_flags (pi) & (PR_STOPPED | PR_ISTOP))
{
if (proc_why (pi) == PR_FAULTED)
- {
+ {
#ifdef FLTWATCH
if (proc_what (pi) == FLTWATCH)
return 1;
@@ -5233,7 +5273,7 @@ procfs_stopped_by_watchpoint (ptid_t ptid)
#ifdef TM_I386SOL2_H
/*
- * Function: procfs_find_LDT_entry
+ * Function: procfs_find_LDT_entry
*
* Input:
* ptid_t ptid; // The GDB-style pid-plus-LWP.
@@ -5275,7 +5315,7 @@ procfs_find_LDT_entry (ptid_t ptid)
* Memory Mappings Functions:
*/
-/*
+/*
* Function: iterate_over_mappings
*
* Call a callback function once for each mapping, passing it the mapping,
@@ -5289,14 +5329,14 @@ procfs_find_LDT_entry (ptid_t ptid)
* child_func -- optional secondary function pointer to be passed
* to the child function.
*
- * Return: First non-zero return value from the callback function,
+ * Return: First non-zero return value from the callback function,
* or zero.
*/
static int
-iterate_over_mappings (procinfo *pi, int (*child_func) (), void *data,
- int (*func) (struct prmap *map,
- int (*child_func) (),
+iterate_over_mappings (procinfo *pi, int (*child_func) (), void *data,
+ int (*func) (struct prmap *map,
+ int (*child_func) (),
void *data))
{
char pathname[MAX_PROC_NAME_SIZE];
@@ -5309,7 +5349,7 @@ iterate_over_mappings (procinfo *pi, int (*child_func) (), void *data,
struct stat sbuf;
#endif
- /* Get the number of mappings, allocate space,
+ /* Get the number of mappings, allocate space,
and read the mappings into prmaps. */
#ifdef NEW_PROC_API
/* Open map fd. */
@@ -5320,7 +5360,7 @@ iterate_over_mappings (procinfo *pi, int (*child_func) (), void *data,
/* Make sure it gets closed again. */
make_cleanup_close (map_fd);
- /* Use stat to determine the file size, and compute
+ /* Use stat to determine the file size, and compute
the number of prmap_t objects it contains. */
if (fstat (map_fd, &sbuf) != 0)
proc_error (pi, "iterate_over_mappings (fstat)", __LINE__);
@@ -5350,10 +5390,10 @@ iterate_over_mappings (procinfo *pi, int (*child_func) (), void *data,
/*
* Function: solib_mappings_callback
*
- * Calls the supplied callback function once for each mapped address
- * space in the process. The callback function receives an open
- * file descriptor for the file corresponding to that mapped
- * address space (if there is one), and the base address of the
+ * Calls the supplied callback function once for each mapped address
+ * space in the process. The callback function receives an open
+ * file descriptor for the file corresponding to that mapped
+ * address space (if there is one), and the base address of the
* mapped space. Quit when the callback function returns a
* nonzero value, or at teh end of the mappings.
*
@@ -5361,7 +5401,7 @@ iterate_over_mappings (procinfo *pi, int (*child_func) (), void *data,
* or zero.
*/
-int solib_mappings_callback (struct prmap *map,
+int solib_mappings_callback (struct prmap *map,
int (*func) (int, CORE_ADDR),
void *data)
{
@@ -5384,14 +5424,14 @@ int solib_mappings_callback (struct prmap *map,
/* Note: caller's responsibility to close this fd! */
fd = open_with_retry (name, O_RDONLY);
/* Note: we don't test the above call for failure;
- we just pass the FD on as given. Sometimes there is
+ we just pass the FD on as given. Sometimes there is
no file, so the open may return failure, but that's
not a problem. */
}
#else
fd = ioctl (pi->ctl_fd, PIOCOPENM, &map->pr_vaddr);
/* Note: we don't test the above call for failure;
- we just pass the FD on as given. Sometimes there is
+ we just pass the FD on as given. Sometimes there is
no file, so the ioctl may return failure, but that's
not a problem. */
#endif
@@ -5405,7 +5445,7 @@ int solib_mappings_callback (struct prmap *map,
* to implement the exported interface to solib-svr4.c.
*
* Given a pointer to a function, call that function once for every
- * mapped address space in the process. The callback function
+ * mapped address space in the process. The callback function
* receives an open file descriptor for the file corresponding to
* that mapped address space (if there is one), and the base address
* of the mapped space. Quit when the callback function returns a
@@ -5430,27 +5470,27 @@ proc_iterate_over_mappings (int (*func) (int, CORE_ADDR))
* Calls an external function for each memory region.
* External function will have the signiture:
*
- * int callback (CORE_ADDR vaddr,
- * unsigned long size,
- * int read, int write, int execute,
+ * int callback (CORE_ADDR vaddr,
+ * unsigned long size,
+ * int read, int write, int execute,
* void *data);
*
* Returns the integer value returned by the callback.
*/
static int
-find_memory_regions_callback (struct prmap *map,
- int (*func) (CORE_ADDR,
- unsigned long,
- int, int, int,
+find_memory_regions_callback (struct prmap *map,
+ int (*func) (CORE_ADDR,
+ unsigned long,
+ int, int, int,
void *),
void *data)
{
return (*func) ((CORE_ADDR) map->pr_vaddr,
- map->pr_size,
+ map->pr_size,
(map->pr_mflags & MA_READ) != 0,
(map->pr_mflags & MA_WRITE) != 0,
- (map->pr_mflags & MA_EXEC) != 0,
+ (map->pr_mflags & MA_EXEC) != 0,
data);
}
@@ -5460,25 +5500,25 @@ find_memory_regions_callback (struct prmap *map,
* External interface. Calls a callback function once for each
* mapped memory region in the child process, passing as arguments
* CORE_ADDR virtual_address,
- * unsigned long size,
+ * unsigned long size,
* int read, TRUE if region is readable by the child
* int write, TRUE if region is writable by the child
* int execute TRUE if region is executable by the child.
- *
+ *
* Stops iterating and returns the first non-zero value
* returned by the callback.
*/
static int
-proc_find_memory_regions (int (*func) (CORE_ADDR,
- unsigned long,
- int, int, int,
- void *),
+proc_find_memory_regions (int (*func) (CORE_ADDR,
+ unsigned long,
+ int, int, int,
+ void *),
void *data)
{
procinfo *pi = find_procinfo_or_die (PIDGET (inferior_ptid), 0);
- return iterate_over_mappings (pi, func, data,
+ return iterate_over_mappings (pi, func, data,
find_memory_regions_callback);
}
@@ -5529,12 +5569,12 @@ info_mappings_callback (struct prmap *map, int (*ignore) (), void *unused)
else
data_fmt_string = " %#18lx %#18lx %#10x %#10x %7s\n";
- printf_filtered (data_fmt_string,
+ printf_filtered (data_fmt_string,
(unsigned long) map->pr_vaddr,
(unsigned long) map->pr_vaddr + map->pr_size - 1,
map->pr_size,
#ifdef PCAGENT /* Horrible hack: only defined on Solaris 2.6+ */
- (unsigned int) map->pr_offset,
+ (unsigned int) map->pr_offset,
#else
map->pr_off,
#endif
@@ -5563,7 +5603,7 @@ info_proc_mappings (procinfo *pi, int summary)
return; /* No output for summary mode. */
printf_filtered ("Mapped address spaces:\n\n");
- printf_filtered (header_fmt_string,
+ printf_filtered (header_fmt_string,
"Start Addr",
" End Addr",
" Size",
@@ -5633,7 +5673,7 @@ info_proc_cmd (char *args, int from_tty)
process = find_procinfo (pid, 0);
if (process == NULL)
{
- /* No. So open a procinfo for it, but
+ /* No. So open a procinfo for it, but
remember to close it again when finished. */
process = create_procinfo (pid, 0);
make_cleanup (do_destroy_procinfo_cleanup, process);
@@ -5651,7 +5691,7 @@ info_proc_cmd (char *args, int from_tty)
if (proc_flags (process) & (PR_STOPPED | PR_ISTOP))
proc_prettyprint_why (proc_why (process), proc_what (process), 1);
if (proc_get_nthreads (process) > 1)
- printf_filtered ("Process has %d threads.\n",
+ printf_filtered ("Process has %d threads.\n",
proc_get_nthreads (process));
}
if (thread)
@@ -5713,25 +5753,25 @@ proc_trace_syscalls (char *args, int from_tty, int entry_or_exit, int mode)
}
}
-static void
+static void
proc_trace_sysentry_cmd (char *args, int from_tty)
{
proc_trace_syscalls (args, from_tty, PR_SYSENTRY, FLAG_SET);
}
-static void
+static void
proc_trace_sysexit_cmd (char *args, int from_tty)
{
proc_trace_syscalls (args, from_tty, PR_SYSEXIT, FLAG_SET);
}
-static void
+static void
proc_untrace_sysentry_cmd (char *args, int from_tty)
{
proc_trace_syscalls (args, from_tty, PR_SYSENTRY, FLAG_RESET);
}
-static void
+static void
proc_untrace_sysexit_cmd (char *args, int from_tty)
{
proc_trace_syscalls (args, from_tty, PR_SYSEXIT, FLAG_RESET);
@@ -5743,17 +5783,17 @@ _initialize_procfs (void)
{
init_procfs_ops ();
add_target (&procfs_ops);
- add_info ("proc", info_proc_cmd,
+ add_info ("proc", info_proc_cmd,
"Show /proc process information about any running process.\n\
Specify process id, or use the program being debugged by default.\n\
Specify keyword 'mappings' for detailed info on memory mappings.");
- add_com ("proc-trace-entry", no_class, proc_trace_sysentry_cmd,
+ add_com ("proc-trace-entry", no_class, proc_trace_sysentry_cmd,
"Give a trace of entries into the syscall.");
- add_com ("proc-trace-exit", no_class, proc_trace_sysexit_cmd,
+ add_com ("proc-trace-exit", no_class, proc_trace_sysexit_cmd,
"Give a trace of exits from the syscall.");
- add_com ("proc-untrace-entry", no_class, proc_untrace_sysentry_cmd,
+ add_com ("proc-untrace-entry", no_class, proc_untrace_sysentry_cmd,
"Cancel a trace of entries into the syscall.");
- add_com ("proc-untrace-exit", no_class, proc_untrace_sysexit_cmd,
+ add_com ("proc-untrace-exit", no_class, proc_untrace_sysexit_cmd,
"Cancel a trace of exits from the syscall.");
}
@@ -5782,7 +5822,7 @@ procfs_first_available (void)
/* gcore only implemented on solaris and unixware (so far) */
static char *
-procfs_do_thread_registers (bfd *obfd, ptid_t ptid,
+procfs_do_thread_registers (bfd *obfd, ptid_t ptid,
char *note_data, int *note_size)
{
gdb_gregset_t gregs;
@@ -5796,14 +5836,14 @@ procfs_do_thread_registers (bfd *obfd, ptid_t ptid,
note_data = (char *) elfcore_write_lwpstatus (obfd,
note_data,
note_size,
- merged_pid,
+ merged_pid,
stop_signal,
&gregs);
#else
note_data = (char *) elfcore_write_prstatus (obfd,
note_data,
note_size,
- merged_pid,
+ merged_pid,
stop_signal,
&gregs);
#endif
@@ -5831,8 +5871,8 @@ procfs_corefile_thread_callback (procinfo *pi, procinfo *thread, void *data)
{
ptid_t saved_ptid = inferior_ptid;
inferior_ptid = MERGEPID (pi->pid, thread->tid);
- args->note_data = procfs_do_thread_registers (args->obfd, inferior_ptid,
- args->note_data,
+ args->note_data = procfs_do_thread_registers (args->obfd, inferior_ptid,
+ args->note_data,
args->note_size);
inferior_ptid = saved_ptid;
}
@@ -5851,34 +5891,36 @@ procfs_make_note_section (bfd *obfd, int *note_size)
char *note_data = NULL;
char *inf_args;
struct procfs_corefile_thread_data thread_args;
+ char *auxv;
+ int auxv_len;
if (get_exec_file (0))
{
strncpy (fname, strrchr (get_exec_file (0), '/') + 1, sizeof (fname));
- strncpy (psargs, get_exec_file (0),
+ strncpy (psargs, get_exec_file (0),
sizeof (psargs));
inf_args = get_inferior_args ();
if (inf_args && *inf_args &&
strlen (inf_args) < ((int) sizeof (psargs) - (int) strlen (psargs)))
{
- strncat (psargs, " ",
+ strncat (psargs, " ",
sizeof (psargs) - strlen (psargs));
- strncat (psargs, inf_args,
+ strncat (psargs, inf_args,
sizeof (psargs) - strlen (psargs));
}
}
- note_data = (char *) elfcore_write_prpsinfo (obfd,
- note_data,
- note_size,
- fname,
+ note_data = (char *) elfcore_write_prpsinfo (obfd,
+ note_data,
+ note_size,
+ fname,
psargs);
#ifdef UNIXWARE
fill_gregset (&gregs, -1);
- note_data = elfcore_write_pstatus (obfd, note_data, note_size,
- PIDGET (inferior_ptid),
+ note_data = elfcore_write_pstatus (obfd, note_data, note_size,
+ PIDGET (inferior_ptid),
stop_signal, &gregs);
#endif
@@ -5891,7 +5933,7 @@ procfs_make_note_section (bfd *obfd, int *note_size)
{
/* iterate_over_threads didn't come up with any threads;
just use inferior_ptid. */
- note_data = procfs_do_thread_registers (obfd, inferior_ptid,
+ note_data = procfs_do_thread_registers (obfd, inferior_ptid,
note_data, note_size);
}
else
@@ -5899,6 +5941,14 @@ procfs_make_note_section (bfd *obfd, int *note_size)
note_data = thread_args.note_data;
}
+ auxv_len = target_auxv_read (&current_target, &auxv);
+ if (auxv_len > 0)
+ {
+ note_data = elfcore_write_note (obfd, note_data, note_size,
+ "CORE", NT_AUXV, auxv, auxv_len);
+ xfree (auxv);
+ }
+
make_cleanup (xfree, note_data);
return note_data;
}
diff --git a/gdb/regcache.c b/gdb/regcache.c
index 62c0de5..504196d 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -1351,15 +1351,11 @@ read_pc (void)
void
generic_target_write_pc (CORE_ADDR pc, ptid_t ptid)
{
-#ifdef PC_REGNUM
if (PC_REGNUM >= 0)
write_register_pid (PC_REGNUM, pc, ptid);
- if (DEPRECATED_NPC_REGNUM >= 0)
- write_register_pid (DEPRECATED_NPC_REGNUM, pc + 4, ptid);
-#else
- internal_error (__FILE__, __LINE__,
- "generic_target_write_pc");
-#endif
+ else
+ internal_error (__FILE__, __LINE__,
+ "generic_target_write_pc");
}
void
diff --git a/gdb/remote-fileio.c b/gdb/remote-fileio.c
index ead40f0..281872e 100644
--- a/gdb/remote-fileio.c
+++ b/gdb/remote-fileio.c
@@ -364,12 +364,6 @@ remote_fileio_to_be (LONGEST num, char *buf, int bytes)
}
static void
-remote_fileio_to_fio_int (long num, fio_int_t fnum)
-{
- remote_fileio_to_be ((LONGEST) num, (char *) fnum, 4);
-}
-
-static void
remote_fileio_to_fio_uint (long num, fio_uint_t fnum)
{
remote_fileio_to_be ((LONGEST) num, (char *) fnum, 4);
diff --git a/gdb/remote-mips.c b/gdb/remote-mips.c
index 71e2bef..c757684 100644
--- a/gdb/remote-mips.c
+++ b/gdb/remote-mips.c
@@ -599,35 +599,6 @@ mips_expect (const char *string)
return mips_expect_timeout (string, remote_timeout);
}
-/* Read the required number of characters into the given buffer (which
- is assumed to be large enough). The only failure is a timeout. */
-static int
-mips_getstring (char *string, int n)
-{
- char *p = string;
- int c;
-
- immediate_quit++;
- while (n > 0)
- {
- c = serial_readchar (mips_desc, remote_timeout);
-
- if (c == SERIAL_TIMEOUT)
- {
- fprintf_unfiltered (gdb_stderr,
- "Failed to read %d characters from target (TIMEOUT)\n", n);
- immediate_quit--;
- return 0;
- }
-
- *p++ = c;
- n--;
- }
-
- immediate_quit--;
- return 1;
-}
-
/* Read a character from the remote, aborting on error. Returns
SERIAL_TIMEOUT on timeout (since that's what serial_readchar()
returns). FIXME: If we see the string mips_monitor_prompt from the
@@ -2270,129 +2241,6 @@ mips_remove_breakpoint (CORE_ADDR addr, char *contents_cache)
return memory_remove_breakpoint (addr, contents_cache);
}
-#if 0 /* currently not used */
-/* PMON does not currently provide support for the debug mode 'b'
- commands to manipulate breakpoints. However, if we wanted to use
- the monitor breakpoints (rather than the GDB BREAK_INSN version)
- then this code performs the work needed to leave debug mode,
- set/clear the breakpoint, and then return to debug mode. */
-
-#define PMON_MAX_BP (33) /* 32 SW, 1 HW */
-static CORE_ADDR mips_pmon_bp_info[PMON_MAX_BP];
-/* NOTE: The code relies on this vector being zero-initialised by the system */
-
-static int
-pmon_insert_breakpoint (CORE_ADDR addr, char *contents_cache)
-{
- int status;
-
- if (monitor_supports_breakpoints)
- {
- char tbuff[12]; /* space for breakpoint command */
- int bpnum;
- CORE_ADDR bpaddr;
-
- /* PMON does not support debug level breakpoint set/remove: */
- if (mips_exit_debug ())
- mips_error ("Failed to exit debug mode");
-
- sprintf (tbuff, "b %08x\r", addr);
- mips_send_command (tbuff, 0);
-
- mips_expect ("Bpt ");
-
- if (!mips_getstring (tbuff, remote_timeout))
- return 1;
- tbuff[2] = '\0'; /* terminate the string */
- if (sscanf (tbuff, "%d", &bpnum) != 1)
- {
- fprintf_unfiltered (gdb_stderr,
- "Invalid decimal breakpoint number from target: %s\n", tbuff);
- return 1;
- }
-
- mips_expect (" = ");
-
- /* Lead in the hex number we are expecting: */
- tbuff[0] = '0';
- tbuff[1] = 'x';
-
- /* FIXME!! only 8 bytes! need to expand for Bfd64;
- which targets return 64-bit addresses? PMON returns only 32! */
- if (!mips_getstring (&tbuff[2], 8))
- return 1;
- tbuff[10] = '\0'; /* terminate the string */
-
- if (sscanf (tbuff, "0x%08x", &bpaddr) != 1)
- {
- fprintf_unfiltered (gdb_stderr,
- "Invalid hex address from target: %s\n", tbuff);
- return 1;
- }
-
- if (bpnum >= PMON_MAX_BP)
- {
- fprintf_unfiltered (gdb_stderr,
- "Error: Returned breakpoint number %d outside acceptable range (0..%d)\n",
- bpnum, PMON_MAX_BP - 1);
- return 1;
- }
-
- if (bpaddr != addr)
- fprintf_unfiltered (gdb_stderr, "Warning: Breakpoint addresses do not match: 0x%x != 0x%x\n", addr, bpaddr);
-
- mips_pmon_bp_info[bpnum] = bpaddr;
-
- mips_expect ("\r\n");
- mips_expect (mips_monitor_prompt);
-
- mips_enter_debug ();
-
- return 0;
- }
-
- return mips_store_word (addr, BREAK_INSN, contents_cache);
-}
-
-static int
-pmon_remove_breakpoint (CORE_ADDR addr, char *contents_cache)
-{
- if (monitor_supports_breakpoints)
- {
- int bpnum;
- char tbuff[7]; /* enough for delete breakpoint command */
-
- for (bpnum = 0; bpnum < PMON_MAX_BP; bpnum++)
- if (mips_pmon_bp_info[bpnum] == addr)
- break;
-
- if (bpnum >= PMON_MAX_BP)
- {
- fprintf_unfiltered (gdb_stderr,
- "pmon_remove_breakpoint: Failed to find breakpoint at address 0x%s\n",
- paddr_nz (addr));
- return 1;
- }
-
- if (mips_exit_debug ())
- mips_error ("Failed to exit debug mode");
-
- sprintf (tbuff, "db %02d\r", bpnum);
-
- mips_send_command (tbuff, -1);
- /* NOTE: If the breakpoint does not exist then a "Bpt <dd> not
- set" message will be returned. */
-
- mips_enter_debug ();
-
- return 0;
- }
-
- return target_write_memory (addr, contents_cache, BREAK_INSN_SIZE);
-}
-#endif
-
-
/* Tell whether this target can support a hardware breakpoint. CNT
is the number of hardware breakpoints already installed. This
implements the TARGET_CAN_USE_HARDWARE_WATCHPOINT macro. */
@@ -2427,31 +2275,6 @@ calculate_mask (CORE_ADDR addr, int len)
}
-/* Insert a hardware breakpoint. This works only on LSI targets, which
- implement ordinary breakpoints using hardware facilities. */
-
-static int
-remote_mips_insert_hw_breakpoint (CORE_ADDR addr, char *contents_cache)
-{
- if (strcmp (target_shortname, "lsi") == 0)
- return mips_insert_breakpoint (addr, contents_cache);
- else
- return -1;
-}
-
-
-/* Remove a hardware breakpoint. This works only on LSI targets, which
- implement ordinary breakpoints using hardware facilities. */
-
-static int
-remote_mips_remove_hw_breakpoint (CORE_ADDR addr, char *contents_cache)
-{
- if (strcmp (target_shortname, "lsi") == 0)
- return mips_remove_breakpoint (addr, contents_cache);
- else
- return -1;
-}
-
/* Set a data watchpoint. ADDR and LEN should be obvious. TYPE is 0
for a write watchpoint, 1 for a read watchpoint, or 2 for a read/write
watchpoint. */
diff --git a/gdb/remote-rdi.c b/gdb/remote-rdi.c
index bd208c1..aa005a7 100644
--- a/gdb/remote-rdi.c
+++ b/gdb/remote-rdi.c
@@ -76,10 +76,6 @@ static void arm_rdi_close (int quitting);
static void arm_rdi_store_registers (int regno);
-static void arm_rdi_mourn (void);
-
-static void arm_rdi_send (char *buf);
-
static ptid_t arm_rdi_wait (ptid_t ptid, struct target_waitstatus *status);
static void arm_rdi_kill (void);
diff --git a/gdb/remote-sds.c b/gdb/remote-sds.c
index c920997..d74fd7d 100644
--- a/gdb/remote-sds.c
+++ b/gdb/remote-sds.c
@@ -1,6 +1,6 @@
/* Remote target communications for serial-line targets using SDS' protocol.
- Copyright 1997, 1998, 1999, 2000, 2001, 2002 Free Software
+ Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2004 Free Software
Foundation, Inc.
This file is part of GDB.
@@ -92,8 +92,6 @@ static ptid_t sds_wait (ptid_t, struct target_waitstatus *);
static void sds_kill (void);
-static int tohex (int);
-
static int fromhex (int);
static void sds_detach (char *, int);
@@ -278,17 +276,6 @@ fromhex (int a)
error ("Reply contains invalid hex digit %d", a);
}
-/* Convert number NIB to a hex digit. */
-
-static int
-tohex (int nib)
-{
- if (nib < 10)
- return '0' + nib;
- else
- return 'a' + nib - 10;
-}
-
static int
tob64 (unsigned char *inbuf, char *outbuf, int len)
{
diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c
index b1dc94e..9b0b3fd 100644
--- a/gdb/remote-sim.c
+++ b/gdb/remote-sim.c
@@ -1,7 +1,7 @@
/* Generic remote debugging interface for simulators.
Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
- 2002 Free Software Foundation, Inc.
+ 2002, 2004 Free Software Foundation, Inc.
Contributed by Cygnus Support.
Steve Chamberlain (sac@cygnus.com).
@@ -221,7 +221,7 @@ gdb_os_write_stderr (host_callback *p, const char *buf, int len)
{
b[0] = buf[i];
b[1] = 0;
- fputs_unfiltered (b, gdb_stdtarg);
+ fputs_unfiltered (b, gdb_stdtargerr);
}
return len;
}
@@ -231,7 +231,7 @@ gdb_os_write_stderr (host_callback *p, const char *buf, int len)
static void
gdb_os_flush_stderr (host_callback *p)
{
- gdb_flush (gdb_stderr);
+ gdb_flush (gdb_stdtargerr);
}
/* GDB version of printf_filtered callback. */
diff --git a/gdb/remote.c b/gdb/remote.c
index 1ed3680..99f51a3 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -1,7 +1,8 @@
/* Remote target communications for serial-line targets in custom GDB protocol
Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
- 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+ Free Software Foundation, Inc.
This file is part of GDB.
@@ -151,10 +152,6 @@ static void init_remote_ops (void);
static void init_extended_remote_ops (void);
-static void init_remote_cisco_ops (void);
-
-static struct target_ops remote_cisco_ops;
-
static void remote_stop (void);
static int ishex (int ch, int *val);
@@ -372,10 +369,6 @@ static int remote_break;
starts. */
static struct serial *remote_desc = NULL;
-/* This is set by the target (thru the 'S' message)
- to denote that the target is in kernel mode. */
-static int cisco_kernel_mode = 0;
-
/* This variable sets the number of bits in an address that are to be
sent in a memory ("M" or "m") packet. Normally, after stripping
leading zeros, the entire address would be sent. This variable
@@ -1161,10 +1154,6 @@ static int remote_unpack_thread_info_response (char *pkt,
static int remote_get_threadinfo (threadref * threadid, int fieldset, /*TAG mask */
struct gdb_ext_thread_info *info);
-static int adapt_remote_get_threadinfo (gdb_threadref * ref,
- int selection,
- struct gdb_ext_thread_info *info);
-
static char *pack_threadlist_request (char *pkt, int startflag,
int threadcount,
threadref * nextthread);
@@ -1576,19 +1565,6 @@ remote_get_threadinfo (threadref *threadid, int fieldset, /* TAG mask */
return result;
}
-/* Unfortunately, 61 bit thread-ids are bigger than the internal
- representation of a threadid. */
-
-static int
-adapt_remote_get_threadinfo (gdb_threadref *ref, int selection,
- struct gdb_ext_thread_info *info)
-{
- threadref lclref;
-
- int_to_threadref (&lclref, *ref);
- return remote_get_threadinfo (&lclref, selection, info);
-}
-
/* Format: i'Q':8,i"L":8,initflag:8,batchsize:16,lastthreadid:32 */
static char *
@@ -2010,123 +1986,6 @@ get_offsets (void)
objfile_relocate (symfile_objfile, offs);
}
-/*
- * Cisco version of section offsets:
- *
- * Instead of having GDB query the target for the section offsets,
- * Cisco lets the target volunteer the information! It's also in
- * a different format, so here are the functions that will decode
- * a section offset packet from a Cisco target.
- */
-
-/*
- * Function: remote_cisco_section_offsets
- *
- * Returns: zero for success, non-zero for failure
- */
-
-static int
-remote_cisco_section_offsets (bfd_vma text_addr,
- bfd_vma data_addr,
- bfd_vma bss_addr,
- bfd_signed_vma *text_offs,
- bfd_signed_vma *data_offs,
- bfd_signed_vma *bss_offs)
-{
- bfd_vma text_base, data_base, bss_base;
- struct minimal_symbol *start;
- asection *sect;
- bfd *abfd;
- int len;
-
- if (symfile_objfile == NULL)
- return -1; /* no can do nothin' */
-
- start = lookup_minimal_symbol ("_start", NULL, NULL);
- if (start == NULL)
- return -1; /* Can't find "_start" symbol */
-
- data_base = bss_base = 0;
- text_base = SYMBOL_VALUE_ADDRESS (start);
-
- abfd = symfile_objfile->obfd;
- for (sect = abfd->sections;
- sect != 0;
- sect = sect->next)
- {
- const char *p = bfd_get_section_name (abfd, sect);
- len = strlen (p);
- if (strcmp (p + len - 4, "data") == 0) /* ends in "data" */
- if (data_base == 0 ||
- data_base > bfd_get_section_vma (abfd, sect))
- data_base = bfd_get_section_vma (abfd, sect);
- if (strcmp (p + len - 3, "bss") == 0) /* ends in "bss" */
- if (bss_base == 0 ||
- bss_base > bfd_get_section_vma (abfd, sect))
- bss_base = bfd_get_section_vma (abfd, sect);
- }
- *text_offs = text_addr - text_base;
- *data_offs = data_addr - data_base;
- *bss_offs = bss_addr - bss_base;
- if (remote_debug)
- {
- char tmp[128];
-
- sprintf (tmp, "VMA: text = 0x");
- sprintf_vma (tmp + strlen (tmp), text_addr);
- sprintf (tmp + strlen (tmp), " data = 0x");
- sprintf_vma (tmp + strlen (tmp), data_addr);
- sprintf (tmp + strlen (tmp), " bss = 0x");
- sprintf_vma (tmp + strlen (tmp), bss_addr);
- fputs_filtered (tmp, gdb_stdlog);
- fprintf_filtered (gdb_stdlog,
- "Reloc offset: text = 0x%s data = 0x%s bss = 0x%s\n",
- paddr_nz (*text_offs),
- paddr_nz (*data_offs),
- paddr_nz (*bss_offs));
- }
-
- return 0;
-}
-
-/*
- * Function: remote_cisco_objfile_relocate
- *
- * Relocate the symbol file for a remote target.
- */
-
-void
-remote_cisco_objfile_relocate (bfd_signed_vma text_off, bfd_signed_vma data_off,
- bfd_signed_vma bss_off)
-{
- struct section_offsets *offs;
-
- if (text_off != 0 || data_off != 0 || bss_off != 0)
- {
- /* FIXME: This code assumes gdb-stabs.h is being used; it's
- broken for xcoff, dwarf, sdb-coff, etc. But there is no
- simple canonical representation for this stuff. */
-
- offs = (struct section_offsets *)
- alloca (SIZEOF_N_SECTION_OFFSETS (symfile_objfile->num_sections));
- memcpy (offs, symfile_objfile->section_offsets,
- SIZEOF_N_SECTION_OFFSETS (symfile_objfile->num_sections));
-
- offs->offsets[SECT_OFF_TEXT (symfile_objfile)] = text_off;
- offs->offsets[SECT_OFF_DATA (symfile_objfile)] = data_off;
- offs->offsets[SECT_OFF_BSS (symfile_objfile)] = bss_off;
-
- /* First call the standard objfile_relocate. */
- objfile_relocate (symfile_objfile, offs);
-
- /* Now we need to fix up the section entries already attached to
- the exec target. These entries will control memory transfers
- from the exec file. */
-
- exec_set_section_offsets (text_off, data_off, bss_off);
- }
-}
-
/* Stub for catch_errors. */
static int
@@ -2583,7 +2442,7 @@ remote_vcont_resume (ptid_t ptid, int step, enum target_signal siggnal)
{
struct remote_state *rs = get_remote_state ();
int pid = PIDGET (ptid);
- char *buf = NULL;
+ char *buf = NULL, *outbuf;
struct cleanup *old_cleanup;
buf = xmalloc (rs->remote_packet_size);
@@ -2608,40 +2467,45 @@ remote_vcont_resume (ptid_t ptid, int step, enum target_signal siggnal)
don't have any PID numbers the inferior will understand. Make sure
to only send forms that do not specify a PID. */
if (step && siggnal != TARGET_SIGNAL_0)
- sprintf (buf, "vCont;S%02x", siggnal);
+ outbuf = xstrprintf ("vCont;S%02x", siggnal);
else if (step)
- sprintf (buf, "vCont;s");
+ outbuf = xstrprintf ("vCont;s");
else if (siggnal != TARGET_SIGNAL_0)
- sprintf (buf, "vCont;C%02x", siggnal);
+ outbuf = xstrprintf ("vCont;C%02x", siggnal);
else
- sprintf (buf, "vCont;c");
+ outbuf = xstrprintf ("vCont;c");
}
else if (pid == -1)
{
/* Resume all threads, with preference for INFERIOR_PTID. */
if (step && siggnal != TARGET_SIGNAL_0)
- sprintf (buf, "vCont;S%02x:%x;c", siggnal, PIDGET (inferior_ptid));
+ outbuf = xstrprintf ("vCont;S%02x:%x;c", siggnal,
+ PIDGET (inferior_ptid));
else if (step)
- sprintf (buf, "vCont;s:%x;c", PIDGET (inferior_ptid));
+ outbuf = xstrprintf ("vCont;s:%x;c", PIDGET (inferior_ptid));
else if (siggnal != TARGET_SIGNAL_0)
- sprintf (buf, "vCont;C%02x:%x;c", siggnal, PIDGET (inferior_ptid));
+ outbuf = xstrprintf ("vCont;C%02x:%x;c", siggnal,
+ PIDGET (inferior_ptid));
else
- sprintf (buf, "vCont;c");
+ outbuf = xstrprintf ("vCont;c");
}
else
{
/* Scheduler locking; resume only PTID. */
if (step && siggnal != TARGET_SIGNAL_0)
- sprintf (buf, "vCont;S%02x:%x", siggnal, pid);
+ outbuf = xstrprintf ("vCont;S%02x:%x", siggnal, pid);
else if (step)
- sprintf (buf, "vCont;s:%x", pid);
+ outbuf = xstrprintf ("vCont;s:%x", pid);
else if (siggnal != TARGET_SIGNAL_0)
- sprintf (buf, "vCont;C%02x:%x", siggnal, pid);
+ outbuf = xstrprintf ("vCont;C%02x:%x", siggnal, pid);
else
- sprintf (buf, "vCont;c:%x", pid);
+ outbuf = xstrprintf ("vCont;c:%x", pid);
}
- putpkt (buf);
+ gdb_assert (outbuf && strlen (outbuf) < rs->remote_packet_size);
+ make_cleanup (xfree, outbuf);
+
+ putpkt (outbuf);
do_cleanups (old_cleanup);
@@ -3108,70 +2972,10 @@ Packet: '%s'\n",
if (buf[3] == 'p')
{
- /* Export Cisco kernel mode as a convenience variable
- (so that it can be used in the GDB prompt if desired). */
-
- if (cisco_kernel_mode == 1)
- set_internalvar (lookup_internalvar ("cisco_kernel_mode"),
- value_from_string ("PDEBUG-"));
- cisco_kernel_mode = 0;
thread_num = strtol ((const char *) &buf[4], NULL, 16);
record_currthread (thread_num);
}
- else if (buf[3] == 'k')
- {
- /* Export Cisco kernel mode as a convenience variable
- (so that it can be used in the GDB prompt if desired). */
-
- if (cisco_kernel_mode == 1)
- set_internalvar (lookup_internalvar ("cisco_kernel_mode"),
- value_from_string ("KDEBUG-"));
- cisco_kernel_mode = 1;
- }
goto got_status;
- case 'N': /* Cisco special: status and offsets */
- {
- bfd_vma text_addr, data_addr, bss_addr;
- bfd_signed_vma text_off, data_off, bss_off;
- unsigned char *p1;
-
- status->kind = TARGET_WAITKIND_STOPPED;
- status->value.sig = (enum target_signal)
- (((fromhex (buf[1])) << 4) + (fromhex (buf[2])));
-
- if (symfile_objfile == NULL)
- {
- warning ("Relocation packet received with no symbol file. \
-Packet Dropped");
- goto got_status;
- }
-
- /* Relocate object file. Buffer format is NAATT;DD;BB
- * where AA is the signal number, TT is the new text
- * address, DD * is the new data address, and BB is the
- * new bss address. */
-
- p = &buf[3];
- text_addr = strtoul (p, (char **) &p1, 16);
- if (p1 == p || *p1 != ';')
- warning ("Malformed relocation packet: Packet '%s'", buf);
- p = p1 + 1;
- data_addr = strtoul (p, (char **) &p1, 16);
- if (p1 == p || *p1 != ';')
- warning ("Malformed relocation packet: Packet '%s'", buf);
- p = p1 + 1;
- bss_addr = strtoul (p, (char **) &p1, 16);
- if (p1 == p)
- warning ("Malformed relocation packet: Packet '%s'", buf);
-
- if (remote_cisco_section_offsets (text_addr, data_addr, bss_addr,
- &text_off, &data_off, &bss_off)
- == 0)
- if (text_off != 0 || data_off != 0 || bss_off != 0)
- remote_cisco_objfile_relocate (text_off, data_off, bss_off);
-
- goto got_status;
- }
case 'W': /* Target exited */
{
/* The remote process exited. */
@@ -3357,70 +3161,10 @@ remote_async_wait (ptid_t ptid, struct target_waitstatus *status)
if (buf[3] == 'p')
{
- /* Export Cisco kernel mode as a convenience variable
- (so that it can be used in the GDB prompt if desired). */
-
- if (cisco_kernel_mode == 1)
- set_internalvar (lookup_internalvar ("cisco_kernel_mode"),
- value_from_string ("PDEBUG-"));
- cisco_kernel_mode = 0;
thread_num = strtol ((const char *) &buf[4], NULL, 16);
record_currthread (thread_num);
}
- else if (buf[3] == 'k')
- {
- /* Export Cisco kernel mode as a convenience variable
- (so that it can be used in the GDB prompt if desired). */
-
- if (cisco_kernel_mode == 1)
- set_internalvar (lookup_internalvar ("cisco_kernel_mode"),
- value_from_string ("KDEBUG-"));
- cisco_kernel_mode = 1;
- }
goto got_status;
- case 'N': /* Cisco special: status and offsets */
- {
- bfd_vma text_addr, data_addr, bss_addr;
- bfd_signed_vma text_off, data_off, bss_off;
- unsigned char *p1;
-
- status->kind = TARGET_WAITKIND_STOPPED;
- status->value.sig = (enum target_signal)
- (((fromhex (buf[1])) << 4) + (fromhex (buf[2])));
-
- if (symfile_objfile == NULL)
- {
- warning ("Relocation packet recieved with no symbol file. \
-Packet Dropped");
- goto got_status;
- }
-
- /* Relocate object file. Buffer format is NAATT;DD;BB
- * where AA is the signal number, TT is the new text
- * address, DD * is the new data address, and BB is the
- * new bss address. */
-
- p = &buf[3];
- text_addr = strtoul (p, (char **) &p1, 16);
- if (p1 == p || *p1 != ';')
- warning ("Malformed relocation packet: Packet '%s'", buf);
- p = p1 + 1;
- data_addr = strtoul (p, (char **) &p1, 16);
- if (p1 == p || *p1 != ';')
- warning ("Malformed relocation packet: Packet '%s'", buf);
- p = p1 + 1;
- bss_addr = strtoul (p, (char **) &p1, 16);
- if (p1 == p)
- warning ("Malformed relocation packet: Packet '%s'", buf);
-
- if (remote_cisco_section_offsets (text_addr, data_addr, bss_addr,
- &text_off, &data_off, &bss_off)
- == 0)
- if (text_off != 0 || data_off != 0 || bss_off != 0)
- remote_cisco_objfile_relocate (text_off, data_off, bss_off);
-
- goto got_status;
- }
case 'W': /* Target exited */
{
/* The remote process exited. */
@@ -4261,8 +4005,6 @@ putpkt_binary (char *buf, int cnt)
}
}
-static int remote_cisco_mode;
-
/* Come here after finding the start of the frame. Collect the rest
into BUF, verifying the checksum, length, and handling run-length
compression. No more than sizeof_buf-1 characters are read so that
@@ -4344,24 +4086,9 @@ read_frame (char *buf,
int repeat;
csum += c;
- if (remote_cisco_mode == 0)
- {
- c = readchar (remote_timeout);
- csum += c;
- repeat = c - ' ' + 3; /* Compute repeat count */
- }
- else
- {
- /* Cisco's run-length encoding variant uses two
- hex chars to represent the repeat count. */
-
- c = readchar (remote_timeout);
- csum += c;
- repeat = fromhex (c) << 4;
- c = readchar (remote_timeout);
- csum += c;
- repeat += fromhex (c);
- }
+ c = readchar (remote_timeout);
+ csum += c;
+ repeat = c - ' ' + 3; /* Compute repeat count */
/* The character before ``*'' is repeated. */
@@ -5499,409 +5226,6 @@ Specify the serial device it is connected to (e.g. /dev/ttya).",
extended_remote_ops.to_mourn_inferior = extended_remote_mourn;
}
-/*
- * Command: info remote-process
- *
- * This implements Cisco's version of the "info proc" command.
- *
- * This query allows the target stub to return an arbitrary string
- * (or strings) giving arbitrary information about the target process.
- * This is optional; the target stub isn't required to implement it.
- *
- * Syntax: qfProcessInfo request first string
- * qsProcessInfo request subsequent string
- * reply: 'O'<hex-encoded-string>
- * 'l' last reply (empty)
- */
-
-static void
-remote_info_process (char *args, int from_tty)
-{
- struct remote_state *rs = get_remote_state ();
- char *buf = alloca (rs->remote_packet_size);
-
- if (remote_desc == 0)
- error ("Command can only be used when connected to the remote target.");
-
- putpkt ("qfProcessInfo");
- getpkt (buf, (rs->remote_packet_size), 0);
- if (buf[0] == 0)
- return; /* Silently: target does not support this feature. */
-
- if (buf[0] == 'E')
- error ("info proc: target error.");
-
- while (buf[0] == 'O') /* Capitol-O packet */
- {
- remote_console_output (&buf[1]);
- putpkt ("qsProcessInfo");
- getpkt (buf, (rs->remote_packet_size), 0);
- }
-}
-
-/*
- * Target Cisco
- */
-
-static void
-remote_cisco_open (char *name, int from_tty)
-{
- int ex;
- if (name == 0)
- error ("To open a remote debug connection, you need to specify what \n"
- "device is attached to the remote system (e.g. host:port).");
-
- /* See FIXME above */
- wait_forever_enabled_p = 1;
-
- target_preopen (from_tty);
-
- unpush_target (&remote_cisco_ops);
-
- remote_desc = remote_serial_open (name);
- if (!remote_desc)
- perror_with_name (name);
-
- /*
- * If a baud rate was specified on the gdb command line it will
- * be greater than the initial value of -1. If it is, use it otherwise
- * default to 9600
- */
-
- baud_rate = (baud_rate > 0) ? baud_rate : 9600;
- if (serial_setbaudrate (remote_desc, baud_rate))
- {
- /* The requested speed could not be set. Error out to
- top level after closing remote_desc. Take care to
- set remote_desc to NULL to avoid closing remote_desc
- more than once. */
- serial_close (remote_desc);
- remote_desc = NULL;
- perror_with_name (name);
- }
-
- serial_raw (remote_desc);
-
- /* If there is something sitting in the buffer we might take it as a
- response to a command, which would be bad. */
- serial_flush_input (remote_desc);
-
- if (from_tty)
- {
- puts_filtered ("Remote debugging using ");
- puts_filtered (name);
- puts_filtered ("\n");
- }
-
- remote_cisco_mode = 1;
-
- push_target (&remote_cisco_ops); /* Switch to using cisco target now */
-
- init_all_packet_configs ();
-
- general_thread = -2;
- continue_thread = -2;
-
- /* Probe for ability to use "ThreadInfo" query, as required. */
- use_threadinfo_query = 1;
- use_threadextra_query = 1;
-
- /* Without this, some commands which require an active target (such
- as kill) won't work. This variable serves (at least) double duty
- as both the pid of the target process (if it has such), and as a
- flag indicating that a target is active. These functions should
- be split out into seperate variables, especially since GDB will
- someday have a notion of debugging several processes. */
- inferior_ptid = pid_to_ptid (MAGIC_NULL_PID);
-
- /* Start the remote connection; if error, discard this target. See
- the comments in remote_open_1() for further details such as the
- need to re-throw the exception. */
- ex = catch_exceptions (uiout,
- remote_start_remote_dummy, NULL,
- "Couldn't establish connection to remote"
- " target\n",
- RETURN_MASK_ALL);
- if (ex < 0)
- {
- pop_target ();
- throw_exception (ex);
- }
-}
-
-static void
-remote_cisco_close (int quitting)
-{
- remote_cisco_mode = 0;
- remote_close (quitting);
-}
-
-static void
-remote_cisco_mourn (void)
-{
- remote_mourn_1 (&remote_cisco_ops);
-}
-
-enum
-{
- READ_MORE,
- FATAL_ERROR,
- ENTER_DEBUG,
- DISCONNECT_TELNET
-}
-minitelnet_return;
-
-/* Shared between readsocket() and readtty(). The size is arbitrary,
- however all targets are known to support a 400 character packet. */
-static char tty_input[400];
-
-static int escape_count;
-static int echo_check;
-extern int quit_flag;
-
-static int
-readsocket (void)
-{
- int data;
-
- /* Loop until the socket doesn't have any more data */
-
- while ((data = readchar (0)) >= 0)
- {
- /* Check for the escape sequence */
- if (data == '|')
- {
- /* If this is the fourth escape, get out */
- if (++escape_count == 4)
- {
- return ENTER_DEBUG;
- }
- else
- { /* This is a '|', but not the fourth in a row.
- Continue without echoing it. If it isn't actually
- one of four in a row, it'll be echoed later. */
- continue;
- }
- }
- else
- /* Not a '|' */
- {
- /* Ensure any pending '|'s are flushed. */
-
- for (; escape_count > 0; escape_count--)
- putchar ('|');
- }
-
- if (data == '\r') /* If this is a return character, */
- continue; /* - just supress it. */
-
- if (echo_check != -1) /* Check for echo of user input. */
- {
- if (tty_input[echo_check] == data)
- {
- gdb_assert (echo_check <= sizeof (tty_input));
- echo_check++; /* Character matched user input: */
- continue; /* Continue without echoing it. */
- }
- else if ((data == '\n') && (tty_input[echo_check] == '\r'))
- { /* End of the line (and of echo checking). */
- echo_check = -1; /* No more echo supression */
- continue; /* Continue without echoing. */
- }
- else
- { /* Failed check for echo of user input.
- We now have some suppressed output to flush! */
- int j;
-
- for (j = 0; j < echo_check; j++)
- putchar (tty_input[j]);
- echo_check = -1;
- }
- }
- putchar (data); /* Default case: output the char. */
- }
-
- if (data == SERIAL_TIMEOUT) /* Timeout returned from readchar. */
- return READ_MORE; /* Try to read some more */
- else
- return FATAL_ERROR; /* Trouble, bail out */
-}
-
-static int
-readtty (void)
-{
- int tty_bytecount;
-
- /* First, read a buffer full from the terminal */
- tty_bytecount = read (fileno (stdin), tty_input, sizeof (tty_input) - 1);
- if (tty_bytecount == -1)
- {
- perror ("readtty: read failed");
- return FATAL_ERROR;
- }
-
- /* Remove a quoted newline. */
- if (tty_input[tty_bytecount - 1] == '\n' &&
- tty_input[tty_bytecount - 2] == '\\') /* line ending in backslash */
- {
- tty_input[--tty_bytecount] = 0; /* remove newline */
- tty_input[--tty_bytecount] = 0; /* remove backslash */
- }
-
- /* Turn trailing newlines into returns */
- if (tty_input[tty_bytecount - 1] == '\n')
- tty_input[tty_bytecount - 1] = '\r';
-
- /* If the line consists of a ~, enter debugging mode. */
- if ((tty_input[0] == '~') && (tty_bytecount == 2))
- return ENTER_DEBUG;
-
- /* Make this a zero terminated string and write it out */
- tty_input[tty_bytecount] = 0;
- if (serial_write (remote_desc, tty_input, tty_bytecount))
- {
- perror_with_name ("readtty: write failed");
- return FATAL_ERROR;
- }
-
- return READ_MORE;
-}
-
-static int
-minitelnet (void)
-{
- fd_set input; /* file descriptors for select */
- int tablesize; /* max number of FDs for select */
- int status;
- int quit_count = 0;
-
- escape_count = 0;
- echo_check = -1;
-
- tablesize = 8 * sizeof (input);
-
- for (;;)
- {
- /* Check for anything from our socket - doesn't block. Note that
- this must be done *before* the select as there may be
- buffered I/O waiting to be processed. */
-
- if ((status = readsocket ()) == FATAL_ERROR)
- {
- error ("Debugging terminated by communications error");
- }
- else if (status != READ_MORE)
- {
- return (status);
- }
-
- fflush (stdout); /* Flush output before blocking */
-
- /* Now block on more socket input or TTY input */
-
- FD_ZERO (&input);
- FD_SET (fileno (stdin), &input);
- FD_SET (deprecated_serial_fd (remote_desc), &input);
-
- status = select (tablesize, &input, 0, 0, 0);
- if ((status == -1) && (errno != EINTR))
- {
- error ("Communications error on select %d", errno);
- }
-
- /* Handle Control-C typed */
-
- if (quit_flag)
- {
- if ((++quit_count) == 2)
- {
- if (query ("Interrupt GDB? "))
- {
- printf_filtered ("Interrupted by user.\n");
- throw_exception (RETURN_QUIT);
- }
- quit_count = 0;
- }
- quit_flag = 0;
-
- if (remote_break)
- serial_send_break (remote_desc);
- else
- serial_write (remote_desc, "\003", 1);
-
- continue;
- }
-
- /* Handle console input */
-
- if (FD_ISSET (fileno (stdin), &input))
- {
- quit_count = 0;
- echo_check = 0;
- status = readtty ();
- if (status == READ_MORE)
- continue;
-
- return status; /* telnet session ended */
- }
- }
-}
-
-static ptid_t
-remote_cisco_wait (ptid_t ptid, struct target_waitstatus *status)
-{
- if (minitelnet () != ENTER_DEBUG)
- {
- error ("Debugging session terminated by protocol error");
- }
- putpkt ("?");
- return remote_wait (ptid, status);
-}
-
-static void
-init_remote_cisco_ops (void)
-{
- remote_cisco_ops.to_shortname = "cisco";
- remote_cisco_ops.to_longname = "Remote serial target in cisco-specific protocol";
- remote_cisco_ops.to_doc =
- "Use a remote machine via TCP, using a cisco-specific protocol.\n\
-Specify the serial device it is connected to (e.g. host:2020).";
- remote_cisco_ops.to_open = remote_cisco_open;
- remote_cisco_ops.to_close = remote_cisco_close;
- remote_cisco_ops.to_detach = remote_detach;
- remote_cisco_ops.to_disconnect = remote_disconnect;
- remote_cisco_ops.to_resume = remote_resume;
- remote_cisco_ops.to_wait = remote_cisco_wait;
- remote_cisco_ops.to_fetch_registers = remote_fetch_registers;
- remote_cisco_ops.to_store_registers = remote_store_registers;
- remote_cisco_ops.to_prepare_to_store = remote_prepare_to_store;
- remote_cisco_ops.to_xfer_memory = remote_xfer_memory;
- remote_cisco_ops.to_files_info = remote_files_info;
- remote_cisco_ops.to_insert_breakpoint = remote_insert_breakpoint;
- remote_cisco_ops.to_remove_breakpoint = remote_remove_breakpoint;
- remote_cisco_ops.to_remove_hw_breakpoint = remote_remove_hw_breakpoint;
- remote_cisco_ops.to_insert_hw_breakpoint = remote_insert_hw_breakpoint;
- remote_cisco_ops.to_insert_watchpoint = remote_insert_watchpoint;
- remote_cisco_ops.to_remove_watchpoint = remote_remove_watchpoint;
- remote_cisco_ops.to_stopped_by_watchpoint = remote_stopped_by_watchpoint;
- remote_cisco_ops.to_stopped_data_address = remote_stopped_data_address;
- remote_cisco_ops.to_can_use_hw_breakpoint = remote_check_watch_resources;
- remote_cisco_ops.to_kill = remote_kill;
- remote_cisco_ops.to_load = generic_load;
- remote_cisco_ops.to_mourn_inferior = remote_cisco_mourn;
- remote_cisco_ops.to_thread_alive = remote_thread_alive;
- remote_cisco_ops.to_find_new_threads = remote_threads_info;
- remote_cisco_ops.to_pid_to_str = remote_pid_to_str;
- remote_cisco_ops.to_extra_thread_info = remote_threads_extra_info;
- remote_cisco_ops.to_stratum = process_stratum;
- remote_cisco_ops.to_has_all_memory = 1;
- remote_cisco_ops.to_has_memory = 1;
- remote_cisco_ops.to_has_stack = 1;
- remote_cisco_ops.to_has_registers = 1;
- remote_cisco_ops.to_has_execution = 1;
- remote_cisco_ops.to_magic = OPS_MAGIC;
-}
-
static int
remote_can_async_p (void)
{
@@ -6098,9 +5422,6 @@ _initialize_remote (void)
init_extended_async_remote_ops ();
add_target (&extended_async_remote_ops);
- init_remote_cisco_ops ();
- add_target (&remote_cisco_ops);
-
/* Hook into new objfile notification. */
remote_new_objfile_chain = target_new_objfile_hook;
target_new_objfile_hook = remote_new_objfile;
@@ -6214,9 +5535,6 @@ in a memory packet.\n",
&showlist);
#endif
- add_info ("remote-process", remote_info_process,
- "Query the remote system for process info.");
-
add_packet_config_cmd (&remote_protocol_vcont,
"vCont", "verbose-resume",
set_remote_protocol_vcont_packet_cmd,
diff --git a/gdb/rs6000-nat.c b/gdb/rs6000-nat.c
index 7878984..3d6c07c 100644
--- a/gdb/rs6000-nat.c
+++ b/gdb/rs6000-nat.c
@@ -1,8 +1,8 @@
/* IBM RS/6000 native-dependent code for GDB, the GNU debugger.
Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996,
- 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation,
- Inc.
+ 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software
+ Foundation, Inc.
This file is part of GDB.
@@ -1002,6 +1002,7 @@ set_host_arch (int pid)
gdbarch_info_init (&info);
info.bfd_arch_info = bfd_get_arch_info (&abfd);
+ info.abfd = exec_bfd;
if (!gdbarch_update_p (info))
{
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index b3a322d..1743643 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -1,7 +1,8 @@
/* Target-dependent code for GDB, the GNU debugger.
- Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
- 1998, 1999, 2000, 2001, 2002, 2003
- Free Software Foundation, Inc.
+
+ Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996,
+ 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software
+ Foundation, Inc.
This file is part of GDB.
@@ -1247,6 +1248,14 @@ ran_out_of_registers_for_arguments:
space = (space + 15) & -16;
sp -= space;
+ /* This is another instance we need to be concerned about
+ securing our stack space. If we write anything underneath %sp
+ (r1), we might conflict with the kernel who thinks he is free
+ to use this area. So, update %sp first before doing anything
+ else. */
+
+ regcache_raw_write_signed (regcache, SP_REGNUM, sp);
+
/* If the last argument copied into the registers didn't fit there
completely, push the rest of it into stack. */
@@ -1288,16 +1297,18 @@ ran_out_of_registers_for_arguments:
}
}
- /* set back chain properly */
- store_unsigned_integer (tmp_buffer, 4, saved_sp);
- write_memory (sp, tmp_buffer, 4);
-
/* Set the stack pointer. According to the ABI, the SP is meant to
- be set _before_ the corresponding stack space is used. No need
- for that here though - the target has been completely stopped -
- it isn't possible for an exception handler to stomp on the stack. */
+ be set _before_ the corresponding stack space is used. On AIX,
+ this even applies when the target has been completely stopped!
+ Not doing this can lead to conflicts with the kernel which thinks
+ that it still has control over this not-yet-allocated stack
+ region. */
regcache_raw_write_signed (regcache, SP_REGNUM, sp);
+ /* Set back chain properly. */
+ store_unsigned_integer (tmp_buffer, 4, saved_sp);
+ write_memory (sp, tmp_buffer, 4);
+
/* Point the inferior function call's return address at the dummy's
breakpoint. */
regcache_raw_write_signed (regcache, tdep->ppc_lr_regnum, bp_addr);
@@ -2881,13 +2892,11 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
else
set_gdbarch_push_dummy_call (gdbarch, rs6000_push_dummy_call);
- set_gdbarch_extract_struct_value_address (gdbarch, rs6000_extract_struct_value_address);
+ set_gdbarch_deprecated_extract_struct_value_address (gdbarch, rs6000_extract_struct_value_address);
set_gdbarch_deprecated_pop_frame (gdbarch, rs6000_pop_frame);
set_gdbarch_skip_prologue (gdbarch, rs6000_skip_prologue);
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
- set_gdbarch_decr_pc_after_break (gdbarch, 0);
- set_gdbarch_function_start_offset (gdbarch, 0);
set_gdbarch_breakpoint_from_pc (gdbarch, rs6000_breakpoint_from_pc);
/* Handle the 64-bit SVR4 minimal-symbol convention of using "FN"
diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c
index eb4a62e..2126759 100644
--- a/gdb/s390-tdep.c
+++ b/gdb/s390-tdep.c
@@ -2597,9 +2597,6 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_deprecated_pop_frame (gdbarch, s390_pop_frame);
/* Stack grows downward. */
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
- /* Offset from address of function to start of its code.
- Zero on most machines. */
- set_gdbarch_function_start_offset (gdbarch, 0);
set_gdbarch_deprecated_max_register_raw_size (gdbarch, 8);
set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 8);
set_gdbarch_breakpoint_from_pc (gdbarch, s390_breakpoint_from_pc);
@@ -2631,7 +2628,7 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_stab_reg_to_regnum (gdbarch, s390_stab_reg_to_regnum);
set_gdbarch_dwarf_reg_to_regnum (gdbarch, s390_stab_reg_to_regnum);
set_gdbarch_dwarf2_reg_to_regnum (gdbarch, s390_stab_reg_to_regnum);
- set_gdbarch_extract_struct_value_address (gdbarch, s390_cannot_extract_struct_value_address);
+ set_gdbarch_deprecated_extract_struct_value_address (gdbarch, s390_cannot_extract_struct_value_address);
/* Parameters for inferior function calls. */
set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point);
diff --git a/gdb/scm-lang.c b/gdb/scm-lang.c
index 7e2ad8f..872dcaf 100644
--- a/gdb/scm-lang.c
+++ b/gdb/scm-lang.c
@@ -1,6 +1,6 @@
/* Scheme/Guile language support routines for GDB, the GNU debugger.
- Copyright 1995, 1996, 1998, 2000, 2001, 2002, 2003 Free Software
+ Copyright 1995, 1996, 1998, 2000, 2001, 2002, 2003, 2004 Free Software
Foundation, Inc.
This file is part of GDB.
@@ -263,6 +263,7 @@ const struct language_defn scm_language_defn =
NULL, /* Language specific skip_trampoline */
value_of_this, /* value_of_this */
basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
+ basic_lookup_transparent_type,/* lookup_transparent_type */
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 38f8e78..3e04973 100644
--- a/gdb/ser-pipe.c
+++ b/gdb/ser-pipe.c
@@ -98,7 +98,7 @@ pipe_open (struct serial *scb, const char *name)
for (old = pidlist; old; old = old->next)
close (fileno (old->fp)); /* don't allow a flush */
#endif
- execl ("/bin/sh", "sh", "-c", name, NULL);
+ execl ("/bin/sh", "sh", "-c", name, (char *) 0);
_exit (127);
}
diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c
index a14c0d9..1cf0c0f 100644
--- a/gdb/sh-tdep.c
+++ b/gdb/sh-tdep.c
@@ -2239,13 +2239,10 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_store_return_value (gdbarch, sh_default_store_return_value);
set_gdbarch_extract_return_value (gdbarch, sh_default_extract_return_value);
- set_gdbarch_extract_struct_value_address (gdbarch,
- sh_extract_struct_value_address);
+ set_gdbarch_deprecated_extract_struct_value_address (gdbarch, sh_extract_struct_value_address);
set_gdbarch_skip_prologue (gdbarch, sh_skip_prologue);
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
- set_gdbarch_decr_pc_after_break (gdbarch, 0);
- set_gdbarch_function_start_offset (gdbarch, 0);
set_gdbarch_push_dummy_call (gdbarch, sh_push_dummy_call_nofpu);
diff --git a/gdb/sh64-tdep.c b/gdb/sh64-tdep.c
index ac080ac..5457254 100644
--- a/gdb/sh64-tdep.c
+++ b/gdb/sh64-tdep.c
@@ -1,6 +1,7 @@
/* Target-dependent code for Renesas Super-H, for GDB.
- Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
- Free Software Foundation, Inc.
+
+ Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+ 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of GDB.
@@ -831,12 +832,6 @@ is_media_pseudo (int rn)
}
static int
-sh64_get_gdb_regnum (int gcc_regnum, CORE_ADDR pc)
-{
- return translate_insn_rn (gcc_regnum, pc_is_isa32 (pc));
-}
-
-static int
sh64_media_reg_base_num (int reg_nr)
{
int base_regnum = -1;
@@ -1347,11 +1342,14 @@ sh64_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp,
}
static CORE_ADDR
-sh64_extract_struct_value_address (char *regbuf)
+sh64_extract_struct_value_address (struct regcache *regcache)
{
- return (extract_unsigned_integer ((regbuf + DEPRECATED_REGISTER_BYTE (STRUCT_RETURN_REGNUM)),
- register_size (current_gdbarch,
- STRUCT_RETURN_REGNUM)));
+ /* FIXME: cagney/2004-01-17: Does the ABI guarantee that the return
+ address regster is preserved across function calls? Probably
+ not, making this function wrong. */
+ ULONGEST val;
+ regcache_raw_read_unsigned (regcache, STRUCT_RETURN_REGNUM, &val);
+ return val;
}
static CORE_ADDR
@@ -2848,8 +2846,6 @@ sh64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_skip_prologue (gdbarch, sh_skip_prologue);
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
- set_gdbarch_decr_pc_after_break (gdbarch, 0);
- set_gdbarch_function_start_offset (gdbarch, 0);
set_gdbarch_frame_args_skip (gdbarch, 0);
set_gdbarch_frameless_function_invocation (gdbarch, frameless_look_for_prologue);
diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c
index 72313dc..3ac2a34 100644
--- a/gdb/sol-thread.c
+++ b/gdb/sol-thread.c
@@ -111,7 +111,7 @@ static void sol_core_close (int quitting);
static void init_sol_thread_ops (void);
static void init_sol_core_ops (void);
-/* Default definitions: These must be defined in tm.h
+/* Default definitions: These must be defined in tm.h
if they are to be shared with a process module such as procfs. */
#define GET_PID(ptid) ptid_get_pid (ptid)
@@ -127,56 +127,56 @@ static void init_sol_core_ops (void);
/* Pointers to routines from lithread_db resolved by dlopen() */
static void (*p_td_log) (const int on_off);
-static td_err_e (*p_td_ta_new) (const struct ps_prochandle * ph_p,
+static td_err_e (*p_td_ta_new) (const struct ps_prochandle * ph_p,
td_thragent_t ** ta_pp);
static td_err_e (*p_td_ta_delete) (td_thragent_t * ta_p);
static td_err_e (*p_td_init) (void);
-static td_err_e (*p_td_ta_get_ph) (const td_thragent_t * ta_p,
+static td_err_e (*p_td_ta_get_ph) (const td_thragent_t * ta_p,
struct ps_prochandle ** ph_pp);
-static td_err_e (*p_td_ta_get_nthreads) (const td_thragent_t * ta_p,
+static td_err_e (*p_td_ta_get_nthreads) (const td_thragent_t * ta_p,
int *nthread_p);
-static td_err_e (*p_td_ta_tsd_iter) (const td_thragent_t * ta_p,
- td_key_iter_f * cb,
+static td_err_e (*p_td_ta_tsd_iter) (const td_thragent_t * ta_p,
+ td_key_iter_f * cb,
void *cbdata_p);
-static td_err_e (*p_td_ta_thr_iter) (const td_thragent_t * ta_p,
- td_thr_iter_f * cb,
- void *cbdata_p,
+static td_err_e (*p_td_ta_thr_iter) (const td_thragent_t * ta_p,
+ td_thr_iter_f * cb,
+ void *cbdata_p,
td_thr_state_e state,
- int ti_pri,
- sigset_t * ti_sigmask_p,
+ int ti_pri,
+ sigset_t * ti_sigmask_p,
unsigned ti_user_flags);
static td_err_e (*p_td_thr_validate) (const td_thrhandle_t * th_p);
-static td_err_e (*p_td_thr_tsd) (const td_thrhandle_t * th_p,
- const thread_key_t key,
+static td_err_e (*p_td_thr_tsd) (const td_thrhandle_t * th_p,
+ const thread_key_t key,
void **data_pp);
-static td_err_e (*p_td_thr_get_info) (const td_thrhandle_t * th_p,
+static td_err_e (*p_td_thr_get_info) (const td_thrhandle_t * th_p,
td_thrinfo_t * ti_p);
-static td_err_e (*p_td_thr_getfpregs) (const td_thrhandle_t * th_p,
+static td_err_e (*p_td_thr_getfpregs) (const td_thrhandle_t * th_p,
prfpregset_t * fpregset);
-static td_err_e (*p_td_thr_getxregsize) (const td_thrhandle_t * th_p,
+static td_err_e (*p_td_thr_getxregsize) (const td_thrhandle_t * th_p,
int *xregsize);
-static td_err_e (*p_td_thr_getxregs) (const td_thrhandle_t * th_p,
+static td_err_e (*p_td_thr_getxregs) (const td_thrhandle_t * th_p,
const caddr_t xregset);
-static td_err_e (*p_td_thr_sigsetmask) (const td_thrhandle_t * th_p,
+static td_err_e (*p_td_thr_sigsetmask) (const td_thrhandle_t * th_p,
const sigset_t ti_sigmask);
-static td_err_e (*p_td_thr_setprio) (const td_thrhandle_t * th_p,
+static td_err_e (*p_td_thr_setprio) (const td_thrhandle_t * th_p,
const int ti_pri);
-static td_err_e (*p_td_thr_setsigpending) (const td_thrhandle_t * th_p,
- const uchar_t ti_pending_flag,
+static td_err_e (*p_td_thr_setsigpending) (const td_thrhandle_t * th_p,
+ const uchar_t ti_pending_flag,
const sigset_t ti_pending);
-static td_err_e (*p_td_thr_setfpregs) (const td_thrhandle_t * th_p,
+static td_err_e (*p_td_thr_setfpregs) (const td_thrhandle_t * th_p,
const prfpregset_t * fpregset);
-static td_err_e (*p_td_thr_setxregs) (const td_thrhandle_t * th_p,
+static td_err_e (*p_td_thr_setxregs) (const td_thrhandle_t * th_p,
const caddr_t xregset);
-static td_err_e (*p_td_ta_map_id2thr) (const td_thragent_t * ta_p,
- thread_t tid,
+static td_err_e (*p_td_ta_map_id2thr) (const td_thragent_t * ta_p,
+ thread_t tid,
td_thrhandle_t * th_p);
-static td_err_e (*p_td_ta_map_lwp2thr) (const td_thragent_t * ta_p,
- lwpid_t lwpid,
+static td_err_e (*p_td_ta_map_lwp2thr) (const td_thragent_t * ta_p,
+ lwpid_t lwpid,
td_thrhandle_t * th_p);
-static td_err_e (*p_td_thr_getgregs) (const td_thrhandle_t * th_p,
+static td_err_e (*p_td_thr_getgregs) (const td_thrhandle_t * th_p,
prgregset_t regset);
-static td_err_e (*p_td_thr_setgregs) (const td_thrhandle_t * th_p,
+static td_err_e (*p_td_thr_setgregs) (const td_thrhandle_t * th_p,
const prgregset_t regset);
/*
@@ -647,7 +647,7 @@ sol_thread_store_registers (int regno)
if (regno != -1)
{ /* Not writing all the regs */
char old_value[MAX_REGISTER_SIZE];
-
+
/* Save new register value. */
regcache_collect (regno, old_value);
@@ -739,7 +739,7 @@ sol_thread_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int dowrite,
/* Note: don't need to call switch_to_thread; we're just reading memory. */
if (target_has_execution)
- retval = procfs_ops.to_xfer_memory (memaddr, myaddr, len,
+ retval = procfs_ops.to_xfer_memory (memaddr, myaddr, len,
dowrite, attrib, target);
else
retval = orig_core_ops.to_xfer_memory (memaddr, myaddr, len,
@@ -750,6 +750,37 @@ sol_thread_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int dowrite,
return retval;
}
+/* Perform partial transfers on OBJECT. See target_read_partial
+ and target_write_partial for details of each variant. One, and
+ only one, of readbuf or writebuf must be non-NULL. */
+
+static LONGEST
+sol_thread_xfer_partial (struct target_ops *ops, enum target_object object,
+ const char *annex, void *readbuf,
+ const void *writebuf, ULONGEST offset, LONGEST len)
+{
+ int retval;
+ struct cleanup *old_chain;
+
+ old_chain = save_inferior_ptid ();
+
+ if (is_thread (inferior_ptid) || /* A thread */
+ !target_thread_alive (inferior_ptid)) /* An lwp, but not alive */
+ inferior_ptid = procfs_first_available (); /* Find any live lwp. */
+ /* Note: don't need to call switch_to_thread; we're just reading memory. */
+
+ if (target_has_execution)
+ retval = procfs_ops.to_xfer_partial (ops, object, annex,
+ readbuf, writebuf, offset, len);
+ else
+ retval = orig_core_ops.to_xfer_partial (ops, object, annex,
+ readbuf, writebuf, offset, len);
+
+ do_cleanups (old_chain);
+
+ return retval;
+}
+
/* Print status information about what we're accessing. */
static void
@@ -798,7 +829,7 @@ sol_thread_create_inferior (char *exec_file, char *allargs, char **env)
those variables don't show up until the library gets mapped and the symbol
table is read in. */
-/* This new_objfile event is now managed by a chained function pointer.
+/* This new_objfile event is now managed by a chained function pointer.
* It is the callee's responsability to call the next client on the chain.
*/
@@ -864,7 +895,7 @@ sol_thread_can_run (void)
return procfs_suppress_run;
}
-/*
+/*
LOCAL FUNCTION
@@ -1028,10 +1059,10 @@ rw_common (int dowrite, const struct ps_prochandle *ph, gdb_ps_addr_t addr,
/* FIXME: passing 0 as attrib argument. */
if (target_has_execution)
- cc = procfs_ops.to_xfer_memory (addr, buf, size,
+ cc = procfs_ops.to_xfer_memory (addr, buf, size,
dowrite, 0, &procfs_ops);
else
- cc = orig_core_ops.to_xfer_memory (addr, buf, size,
+ cc = orig_core_ops.to_xfer_memory (addr, buf, size,
dowrite, 0, &core_ops);
if (cc < 0)
@@ -1048,10 +1079,10 @@ rw_common (int dowrite, const struct ps_prochandle *ph, gdb_ps_addr_t addr,
else if (cc == 0)
{
if (dowrite == 0)
- warning ("rw_common (): unable to read at addr 0x%lx",
+ warning ("rw_common (): unable to read at addr 0x%lx",
(long) addr);
else
- warning ("rw_common (): unable to write at addr 0x%lx",
+ warning ("rw_common (): unable to write at addr 0x%lx",
(long) addr);
do_cleanups (old_chain);
@@ -1430,7 +1461,7 @@ sol_core_files_info (struct target_ops *t)
}
/* Worker bee for info sol-thread command. This is a callback function that
- gets called once for each Solaris thread (ie. not kernel thread) in the
+ gets called once for each Solaris thread (ie. not kernel thread) in the
inferior. Print anything interesting that we can think of. */
static int
@@ -1512,10 +1543,10 @@ info_solthreads (char *args, int from_tty)
}
static int
-sol_find_memory_regions (int (*func) (CORE_ADDR,
- unsigned long,
- int, int, int,
- void *),
+sol_find_memory_regions (int (*func) (CORE_ADDR,
+ unsigned long,
+ int, int, int,
+ void *),
void *data)
{
return procfs_ops.to_find_memory_regions (func, data);
@@ -1549,6 +1580,7 @@ init_sol_thread_ops (void)
sol_thread_ops.to_store_registers = sol_thread_store_registers;
sol_thread_ops.to_prepare_to_store = sol_thread_prepare_to_store;
sol_thread_ops.to_xfer_memory = sol_thread_xfer_memory;
+ sol_thread_ops.to_xfer_partial = sol_thread_xfer_partial;
sol_thread_ops.to_files_info = sol_thread_files_info;
sol_thread_ops.to_insert_breakpoint = memory_insert_breakpoint;
sol_thread_ops.to_remove_breakpoint = memory_remove_breakpoint;
@@ -1592,6 +1624,7 @@ init_sol_core_ops (void)
sol_core_ops.to_detach = sol_core_detach;
sol_core_ops.to_fetch_registers = sol_thread_fetch_registers;
sol_core_ops.to_xfer_memory = sol_thread_xfer_memory;
+ sol_core_ops.to_xfer_partial = sol_thread_xfer_partial;
sol_core_ops.to_files_info = sol_core_files_info;
sol_core_ops.to_insert_breakpoint = ignore;
sol_core_ops.to_remove_breakpoint = ignore;
diff --git a/gdb/solib-sunos.c b/gdb/solib-sunos.c
index b7444c6..ef6069e 100644
--- a/gdb/solib-sunos.c
+++ b/gdb/solib-sunos.c
@@ -1,6 +1,6 @@
/* Handle SunOS shared libraries for GDB, the GNU Debugger.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000,
- 2001
+ 2001, 2004
Free Software Foundation, Inc.
This file is part of GDB.
@@ -145,11 +145,7 @@ allocate_rt_common_objfile (void)
objfile->md = NULL;
objfile->psymbol_cache = bcache_xmalloc ();
objfile->macro_cache = bcache_xmalloc ();
- obstack_specify_allocation (&objfile->psymbol_obstack, 0, 0, xmalloc,
- xfree);
- obstack_specify_allocation (&objfile->symbol_obstack, 0, 0, xmalloc,
- xfree);
- obstack_specify_allocation (&objfile->type_obstack, 0, 0, xmalloc,
+ obstack_specify_allocation (&objfile->objfile_obstack, 0, 0, xmalloc,
xfree);
objfile->name = mstrsave (objfile->md, "rt_common");
@@ -185,8 +181,8 @@ solib_add_common_symbols (CORE_ADDR rtc_symp)
if (rt_common_objfile != NULL && rt_common_objfile->minimal_symbol_count)
{
- obstack_free (&rt_common_objfile->symbol_obstack, 0);
- obstack_specify_allocation (&rt_common_objfile->symbol_obstack, 0, 0,
+ obstack_free (&rt_common_objfile->objfile_obstack, 0);
+ obstack_specify_allocation (&rt_common_objfile->objfile_obstack, 0, 0,
xmalloc, xfree);
rt_common_objfile->minimal_symbol_count = 0;
rt_common_objfile->msymbols = NULL;
diff --git a/gdb/somread.c b/gdb/somread.c
index 971fea2..4ffa4c1 100644
--- a/gdb/somread.c
+++ b/gdb/somread.c
@@ -1,6 +1,6 @@
/* Read HP PA/Risc object files for GDB.
- Copyright 1991, 1992, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
- Free Software Foundation, Inc.
+ Copyright 1991, 1992, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002,
+ 2004 Free Software Foundation, Inc.
Written by Fred Fish at Cygnus Support.
This file is part of GDB.
@@ -432,7 +432,7 @@ som_symfile_offsets (struct objfile *objfile, struct section_addr_info *addrs)
objfile->num_sections = bfd_count_sections (objfile->obfd);
objfile->section_offsets = (struct section_offsets *)
- obstack_alloc (&objfile->psymbol_obstack,
+ obstack_alloc (&objfile->objfile_obstack,
SIZEOF_N_SECTION_OFFSETS (objfile->num_sections));
/* FIXME: ezannoni 2000-04-20 The section names in SOM are not
@@ -534,7 +534,7 @@ init_import_symbols (struct objfile *objfile)
to do with psymbols, just a matter of convenience. We want the
import list to be freed when the objfile is deallocated */
objfile->import_list
- = (ImportEntry *) obstack_alloc (&objfile->psymbol_obstack,
+ = (ImportEntry *) obstack_alloc (&objfile->objfile_obstack,
import_list_size * sizeof (ImportEntry));
/* Read in the import entries, a bunch at a time */
@@ -550,7 +550,7 @@ init_import_symbols (struct objfile *objfile)
if (buffer[i].type != (unsigned char) 0)
{
objfile->import_list[k]
- = (char *) obstack_alloc (&objfile->psymbol_obstack, strlen (string_buffer + buffer[i].name) + 1);
+ = (char *) obstack_alloc (&objfile->objfile_obstack, strlen (string_buffer + buffer[i].name) + 1);
strcpy (objfile->import_list[k], string_buffer + buffer[i].name);
/* Some day we might want to record the type and other information too */
}
@@ -570,7 +570,7 @@ init_import_symbols (struct objfile *objfile)
if (buffer[i].type != (unsigned char) 0)
{
objfile->import_list[k]
- = (char *) obstack_alloc (&objfile->psymbol_obstack, strlen (string_buffer + buffer[i].name) + 1);
+ = (char *) obstack_alloc (&objfile->objfile_obstack, strlen (string_buffer + buffer[i].name) + 1);
strcpy (objfile->import_list[k], string_buffer + buffer[i].name);
/* Some day we might want to record the type and other information too */
}
@@ -657,7 +657,7 @@ init_export_symbols (struct objfile *objfile)
to do with psymbols, just a matter of convenience. We want the
export list to be freed when the objfile is deallocated */
objfile->export_list
- = (ExportEntry *) obstack_alloc (&objfile->psymbol_obstack,
+ = (ExportEntry *) obstack_alloc (&objfile->objfile_obstack,
export_list_size * sizeof (ExportEntry));
/* Read in the export entries, a bunch at a time */
@@ -673,7 +673,7 @@ init_export_symbols (struct objfile *objfile)
if (buffer[i].type != (unsigned char) 0)
{
objfile->export_list[k].name
- = (char *) obstack_alloc (&objfile->psymbol_obstack, strlen (string_buffer + buffer[i].name) + 1);
+ = (char *) obstack_alloc (&objfile->objfile_obstack, strlen (string_buffer + buffer[i].name) + 1);
strcpy (objfile->export_list[k].name, string_buffer + buffer[i].name);
objfile->export_list[k].address = buffer[i].value;
/* Some day we might want to record the type and other information too */
@@ -697,7 +697,7 @@ init_export_symbols (struct objfile *objfile)
if (buffer[i].type != (unsigned char) 0)
{
objfile->export_list[k].name
- = (char *) obstack_alloc (&objfile->psymbol_obstack, strlen (string_buffer + buffer[i].name) + 1);
+ = (char *) obstack_alloc (&objfile->objfile_obstack, strlen (string_buffer + buffer[i].name) + 1);
strcpy (objfile->export_list[k].name, string_buffer + buffer[i].name);
/* Some day we might want to record the type and other information too */
objfile->export_list[k].address = buffer[i].value;
diff --git a/gdb/somsolib.c b/gdb/somsolib.c
index b2a833c..7ecc97e 100644
--- a/gdb/somsolib.c
+++ b/gdb/somsolib.c
@@ -1,7 +1,7 @@
/* Handle HP SOM shared libraries for GDB, the GNU Debugger.
Copyright 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002,
- 2003 Free Software Foundation, Inc.
+ 2003, 2004 Free Software Foundation, Inc.
This file is part of GDB.
@@ -310,7 +310,7 @@ som_solib_add_solib_objfile (struct so_list *so, char *name, int from_tty,
if (so->objfile->obj_private == NULL)
{
obj_private = (obj_private_data_t *)
- obstack_alloc (&so->objfile->psymbol_obstack,
+ obstack_alloc (&so->objfile->objfile_obstack,
sizeof (obj_private_data_t));
obj_private->unwind_info = NULL;
obj_private->so_info = NULL;
@@ -643,7 +643,7 @@ som_solib_add (char *arg_string, int from_tty, struct target_ops *target, int re
}
name = obsavestring (name, name_len - 1,
- &symfile_objfile->symbol_obstack);
+ &symfile_objfile->objfile_obstack);
status = target_read_memory (addr + 8, buf, 4);
if (status != 0)
diff --git a/gdb/source.c b/gdb/source.c
index c5f588a..ba2dc06 100644
--- a/gdb/source.c
+++ b/gdb/source.c
@@ -80,8 +80,6 @@ static void forward_search_command (char *, int);
static void line_info (char *, int);
-static void ambiguous_line_spec (struct symtabs_and_lines *);
-
static void source_info (char *, int);
static void show_directories (char *, int);
@@ -1232,22 +1230,6 @@ print_source_lines (struct symtab *s, int line, int stopline, int noerror)
print_source_lines_base (s, line, stopline, noerror);
}
-/* Print a list of files and line numbers which a user may choose from
- in order to list a function which was specified ambiguously (as with
- `list classname::overloadedfuncname', or 'list objectiveCSelector:).
- The vector in SALS provides the filenames and line numbers.
- NOTE: some of the SALS may have no filename or line information! */
-
-static void
-ambiguous_line_spec (struct symtabs_and_lines *sals)
-{
- int i;
-
- for (i = 0; i < sals->nelts; ++i)
- printf_filtered ("file: \"%s\", line number: %d\n",
- sals->sals[i].symtab->filename, sals->sals[i].line);
-}
-
/* Print info on range of pc's in a specified line. */
static void
diff --git a/gdb/sparc-nat.c b/gdb/sparc-nat.c
index 3ab21f0..477fc97 100644
--- a/gdb/sparc-nat.c
+++ b/gdb/sparc-nat.c
@@ -22,7 +22,9 @@
#include "defs.h"
#include "inferior.h"
#include "regcache.h"
+#include "target.h"
+#include "gdb_assert.h"
#include <signal.h>
#include "gdb_string.h"
#include <sys/ptrace.h>
@@ -246,8 +248,40 @@ store_inferior_registers (int regnum)
return;
}
}
+
+/* Fetch StackGhost Per-Process XOR cookie. */
+
+LONGEST
+sparc_xfer_wcookie (struct target_ops *ops, enum target_object object,
+ const char *annex, void *readbuf, const void *writebuf,
+ ULONGEST offset, LONGEST len)
+{
+ unsigned long wcookie = 0;
+ char *buf = (char *)&wcookie;
+
+ gdb_assert (object == TARGET_OBJECT_WCOOKIE);
+ gdb_assert (readbuf && writebuf == NULL);
+
+ if (offset >= sizeof (unsigned long))
+ return -1;
+#ifdef PT_WCOOKIE
+ /* If PT_WCOOKIE is defined (by <sys/ptrace.h>), assume we're
+ running on an OpenBSD release that uses StackGhost (3.1 or
+ later). As of release 3.4, OpenBSD doesn't use a randomized
+ cookie yet. */
+ wcookie = 0x3;
+#endif /* PT_WCOOKIE */
+
+ if (len > sizeof (unsigned long) - offset)
+ len = sizeof (unsigned long) - offset;
+
+ memcpy (readbuf, buf + offset, len);
+ return len;
+}
+
+
/* Provide a prototype to silence -Wmissing-prototypes. */
void _initialize_sparc_nat (void);
diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c
index e79f038..66dbac7 100644
--- a/gdb/sparc-tdep.c
+++ b/gdb/sparc-tdep.c
@@ -96,7 +96,9 @@ sparc_fetch_instruction (CORE_ADDR pc)
unsigned long insn;
int i;
- read_memory (pc, buf, sizeof (buf));
+ /* If we can't read the instruction at PC, return zero. */
+ if (target_read_memory (pc, buf, sizeof (buf)))
+ return 0;
insn = 0;
for (i = 0; i < sizeof (buf); i++)
@@ -104,6 +106,56 @@ sparc_fetch_instruction (CORE_ADDR pc)
return insn;
}
+
+/* OpenBSD/sparc includes StackGhost, which according to the author's
+ website http://stackghost.cerias.purdue.edu "... transparently and
+ automatically protects applications' stack frames; more
+ specifically, it guards the return pointers. The protection
+ mechanisms require no application source or binary modification and
+ imposes only a negligible performance penalty."
+
+ The same website provides the following description of how
+ StackGhost works:
+
+ "StackGhost interfaces with the kernel trap handler that would
+ normally write out registers to the stack and the handler that
+ would read them back in. By XORing a cookie into the
+ return-address saved in the user stack when it is actually written
+ to the stack, and then XOR it out when the return-address is pulled
+ from the stack, StackGhost can cause attacker corrupted return
+ pointers to behave in a manner the attacker cannot predict.
+ StackGhost can also use several unused bits in the return pointer
+ to detect a smashed return pointer and abort the process."
+
+ For GDB this means that whenever we're reading %i7 from a stack
+ frame's window save area, we'll have to XOR the cookie.
+
+ More information on StackGuard can be found on in:
+
+ Mike Frantzen and Mike Shuey. "StackGhost: Hardware Facilitated
+ Stack Protection." 2001. Published in USENIX Security Symposium
+ '01. */
+
+/* Fetch StackGhost Per-Process XOR cookie. */
+
+ULONGEST
+sparc_fetch_wcookie (void)
+{
+ struct target_ops *ops = &current_target;
+ char buf[8];
+ int len;
+
+ len = target_read_partial (ops, TARGET_OBJECT_WCOOKIE, NULL, buf, 0, 8);
+ if (len == -1)
+ return 0;
+
+ /* We should have either an 32-bit or an 64-bit cookie. */
+ gdb_assert (len == 4 || len == 8);
+
+ return extract_unsigned_integer (buf, len);
+}
+
+
/* Return the contents if register REGNUM as an address. */
static CORE_ADDR
@@ -664,6 +716,29 @@ sparc32_frame_prev_register (struct frame_info *next_frame, void **this_cache,
return;
}
+ /* Handle StackGhost. */
+ {
+ ULONGEST wcookie = sparc_fetch_wcookie ();
+
+ if (wcookie != 0 && !cache->frameless_p && regnum == SPARC_I7_REGNUM)
+ {
+ *optimizedp = 0;
+ *lvalp = not_lval;
+ *addrp = 0;
+ *realnump = -1;
+ if (valuep)
+ {
+ CORE_ADDR addr = cache->base + (regnum - SPARC_L0_REGNUM) * 4;
+ ULONGEST i7;
+
+ /* Read the value in from memory. */
+ i7 = get_frame_memory_unsigned (next_frame, addr, 4);
+ store_unsigned_integer (valuep, 4, i7 ^ wcookie);
+ }
+ return;
+ }
+ }
+
/* The previous frame's `local' and `in' registers have been saved
in the register save area. */
if (!cache->frameless_p
@@ -834,6 +909,18 @@ sparc32_return_value (struct gdbarch *gdbarch, struct type *type,
return RETURN_VALUE_REGISTER_CONVENTION;
}
+#if 0
+/* NOTE: cagney/2004-01-17: For the moment disable this method. The
+ architecture and CORE-gdb will need new code (and a replacement for
+ DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS) before this can be made to
+ work robustly. Here is a possible function signature: */
+/* NOTE: cagney/2004-01-17: So far only the 32-bit SPARC ABI has been
+ identifed as having a way to robustly recover the address of a
+ struct-convention return-value (after the function has returned).
+ For all other ABIs so far examined, the calling convention makes no
+ guarenteed that the register containing the return-value will be
+ preserved and hence that the return-value's address can be
+ recovered. */
/* Extract from REGCACHE, which contains the (raw) register state, the
address in which a function should return its structure value, as a
CORE_ADDR. */
@@ -846,6 +933,7 @@ sparc32_extract_struct_value_address (struct regcache *regcache)
regcache_cooked_read_unsigned (regcache, SPARC_SP_REGNUM, &sp);
return read_memory_unsigned_integer (sp + 64, 4);
}
+#endif
static int
sparc32_stabs_argument_has_addr (struct gdbarch *gdbarch, struct type *type)
@@ -1015,10 +1103,10 @@ sparc_regset_from_core_section (struct gdbarch *gdbarch,
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
- if (strcmp (sect_name, ".reg") == 0 && sect_size == tdep->sizeof_gregset)
+ if (strcmp (sect_name, ".reg") == 0 && sect_size >= tdep->sizeof_gregset)
return tdep->gregset;
- if (strcmp (sect_name, ".reg2") == 0 && sect_size == tdep->sizeof_fpregset)
+ if (strcmp (sect_name, ".reg2") == 0 && sect_size >= tdep->sizeof_fpregset)
return tdep->fpregset;
return NULL;
@@ -1043,9 +1131,9 @@ sparc32_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
tdep->pc_regnum = SPARC32_PC_REGNUM;
tdep->npc_regnum = SPARC32_NPC_REGNUM;
tdep->gregset = NULL;
- tdep->sizeof_gregset = 20 * 4;
+ tdep->sizeof_gregset = 0;
tdep->fpregset = NULL;
- tdep->sizeof_fpregset = 33 * 4;
+ tdep->sizeof_fpregset = 0;
tdep->plt_entry_size = 0;
set_gdbarch_long_double_bit (gdbarch, 128);
@@ -1069,8 +1157,6 @@ sparc32_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_push_dummy_call (gdbarch, sparc32_push_dummy_call);
set_gdbarch_return_value (gdbarch, sparc32_return_value);
- set_gdbarch_extract_struct_value_address
- (gdbarch, sparc32_extract_struct_value_address);
set_gdbarch_stabs_argument_has_addr
(gdbarch, sparc32_stabs_argument_has_addr);
@@ -1080,8 +1166,6 @@ sparc32_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
set_gdbarch_breakpoint_from_pc (gdbarch, sparc_breakpoint_from_pc);
- set_gdbarch_decr_pc_after_break (gdbarch, 0);
- set_gdbarch_function_start_offset (gdbarch, 0);
set_gdbarch_frame_args_skip (gdbarch, 8);
@@ -1102,7 +1186,7 @@ sparc32_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
frame_unwind_append_sniffer (gdbarch, sparc32_frame_sniffer);
/* If we have register sets, enable the generic core file support. */
- if (tdep->gregset && tdep->fpregset)
+ if (tdep->gregset)
set_gdbarch_regset_from_core_section (gdbarch,
sparc_regset_from_core_section);
@@ -1152,6 +1236,16 @@ sparc_supply_rwindow (struct regcache *regcache, CORE_ADDR sp, int regnum)
{
target_read_memory (sp + ((i - SPARC_L0_REGNUM) * 4),
buf + offset, 4);
+
+ /* Handle StackGhost. */
+ if (i == SPARC_I7_REGNUM)
+ {
+ ULONGEST wcookie = sparc_fetch_wcookie ();
+ ULONGEST i7 = extract_unsigned_integer (buf + offset, 4);
+
+ store_unsigned_integer (buf + offset, 4, i7 ^ wcookie);
+ }
+
regcache_raw_supply (regcache, i, buf);
}
}
@@ -1195,6 +1289,16 @@ sparc_collect_rwindow (const struct regcache *regcache,
if (regnum == -1 || regnum == SPARC_SP_REGNUM || regnum == i)
{
regcache_raw_collect (regcache, i, buf);
+
+ /* Handle StackGhost. */
+ if (i == SPARC_I7_REGNUM)
+ {
+ ULONGEST wcookie = sparc_fetch_wcookie ();
+ ULONGEST i7 = extract_unsigned_integer (buf + offset, 4);
+
+ store_unsigned_integer (buf + offset, 4, i7 ^ wcookie);
+ }
+
target_write_memory (sp + ((i - SPARC_L0_REGNUM) * 4),
buf + offset, 4);
}
diff --git a/gdb/sparc-tdep.h b/gdb/sparc-tdep.h
index d8d0582..bbfbb42 100644
--- a/gdb/sparc-tdep.h
+++ b/gdb/sparc-tdep.h
@@ -22,11 +22,11 @@
#ifndef SPARC_TDEP_H
#define SPARC_TDEP_H 1
+struct frame_info;
struct gdbarch;
struct regcache;
struct regset;
struct trad_frame_saved_reg;
-struct frame_info;
/* Register offsets for the general-purpose register set. */
@@ -147,6 +147,9 @@ struct sparc_frame_cache
/* Fetch the instruction at PC. */
extern unsigned long sparc_fetch_instruction (CORE_ADDR pc);
+/* Fetch StackGhost Per-Process XOR cookie. */
+extern ULONGEST sparc_fetch_wcookie (void);
+
extern CORE_ADDR sparc_analyze_prologue (CORE_ADDR pc, CORE_ADDR current_pc,
struct sparc_frame_cache *cache);
@@ -195,4 +198,7 @@ extern void sparc32_sol2_init_abi (struct gdbarch_info info,
/* Register offsets for NetBSD. */
extern const struct sparc_gregset sparc32nbsd_gregset;
+extern struct trad_frame_saved_reg *
+ sparc32nbsd_sigcontext_saved_regs (struct frame_info *next_frame);
+
#endif /* sparc-tdep.h */
diff --git a/gdb/sparc64-tdep.c b/gdb/sparc64-tdep.c
index b32a24c..8aad619 100644
--- a/gdb/sparc64-tdep.c
+++ b/gdb/sparc64-tdep.c
@@ -1086,19 +1086,6 @@ sparc64_return_value (struct gdbarch *gdbarch, struct type *type,
return RETURN_VALUE_REGISTER_CONVENTION;
}
-
-/* Extract from REGCACHE, which contains the (raw) register state, the
- address in which a function should return its structure value, as a
- CORE_ADDR. */
-
-static CORE_ADDR
-sparc64_extract_struct_value_address (struct regcache *regcache)
-{
- ULONGEST addr;
-
- regcache_cooked_read_unsigned (regcache, SPARC_O0_REGNUM, &addr);
- return addr;
-}
void
@@ -1130,8 +1117,6 @@ sparc64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
set_gdbarch_push_dummy_call (gdbarch, sparc64_push_dummy_call);
set_gdbarch_return_value (gdbarch, sparc64_return_value);
- set_gdbarch_extract_struct_value_address
- (gdbarch, sparc64_extract_struct_value_address);
set_gdbarch_stabs_argument_has_addr
(gdbarch, default_stabs_argument_has_addr);
diff --git a/gdb/sparc64-tdep.h b/gdb/sparc64-tdep.h
index f5ab60d..c3073b9 100644
--- a/gdb/sparc64-tdep.h
+++ b/gdb/sparc64-tdep.h
@@ -22,9 +22,11 @@
#ifndef SPARC64_TDEP_H
#define SPARC64_TDEP_H 1
+struct frame_info;
struct gdbarch;
-struct sparc_gregset;
struct regcache;
+struct sparc_gregset;
+struct trad_frame_saved_reg;
#include "sparc-tdep.h"
@@ -109,9 +111,13 @@ extern void sparc64_sol2_init_abi (struct gdbarch_info info,
/* Register offsets for FreeBSD/sparc64. */
extern const struct sparc_gregset sparc64fbsd_gregset;
-/* Variables exported from sparc64nbsd-tdep.c. */
+/* Functions and variables exported from sparc64nbsd-tdep.c. */
/* Register offsets for NetBSD/sparc64. */
extern const struct sparc_gregset sparc64nbsd_gregset;
+extern struct trad_frame_saved_reg *
+ sparc64nbsd_sigcontext_saved_regs (CORE_ADDR sigcontext_addr,
+ struct frame_info *next_frame);
+
#endif /* sparc64-tdep.h */
diff --git a/gdb/sparc64nbsd-tdep.c b/gdb/sparc64nbsd-tdep.c
index 58b87b3..8e79870 100644
--- a/gdb/sparc64nbsd-tdep.c
+++ b/gdb/sparc64nbsd-tdep.c
@@ -88,76 +88,86 @@ sparc64nbsd_pc_in_sigtramp (CORE_ADDR pc, char *name)
return nbsd_pc_in_sigtramp (pc, name);
}
-static struct sparc_frame_cache *
-sparc64nbsd_sigcontext_frame_cache (struct frame_info *next_frame,
- void **this_cache)
+struct trad_frame_saved_reg *
+sparc64nbsd_sigcontext_saved_regs (CORE_ADDR sigcontext_addr,
+ struct frame_info *next_frame)
{
- struct sparc_frame_cache *cache;
- CORE_ADDR addr, sigcontext_addr, sp;
- LONGEST fprs;
+ struct trad_frame_saved_reg *saved_regs;
+ CORE_ADDR addr, sp;
int regnum, delta;
- if (*this_cache)
- return *this_cache;
-
- cache = sparc_frame_cache (next_frame, this_cache);
- gdb_assert (cache == *this_cache);
+ saved_regs = trad_frame_alloc_saved_regs (next_frame);
/* The registers are saved in bits and pieces scattered all over the
place. The code below records their location on the assumption
that the part of the signal trampoline that saves the state has
been executed. */
- /* If we couldn't find the frame's function, we're probably dealing
- with an on-stack signal trampoline. */
- if (cache->pc == 0)
- {
- cache->pc = sparc64nbsd_sigtramp_start;
-
- /* Since we couldn't find the frame's function, the cache was
- initialized under the assumption that we're frameless. */
- cache->frameless_p = 0;
- addr = frame_unwind_register_unsigned (next_frame, SPARC_FP_REGNUM);
- cache->base = addr;
- }
-
- cache->saved_regs = trad_frame_alloc_saved_regs (next_frame);
-
- /* We find the appropriate instance of `struct sigcontext' at a
- fixed offset in the signal frame. */
- sigcontext_addr = cache->base + BIAS + 128 + 8;
-
- cache->saved_regs[SPARC_SP_REGNUM].addr = sigcontext_addr + 8;
- cache->saved_regs[SPARC64_PC_REGNUM].addr = sigcontext_addr + 16;
- cache->saved_regs[SPARC64_NPC_REGNUM].addr = sigcontext_addr + 24;
- cache->saved_regs[SPARC64_STATE_REGNUM].addr = sigcontext_addr + 32;
- cache->saved_regs[SPARC_G1_REGNUM].addr = sigcontext_addr + 40;
- cache->saved_regs[SPARC_O0_REGNUM].addr = sigcontext_addr + 48;
+ saved_regs[SPARC_SP_REGNUM].addr = sigcontext_addr + 8;
+ saved_regs[SPARC64_PC_REGNUM].addr = sigcontext_addr + 16;
+ saved_regs[SPARC64_NPC_REGNUM].addr = sigcontext_addr + 24;
+ saved_regs[SPARC64_STATE_REGNUM].addr = sigcontext_addr + 32;
+ saved_regs[SPARC_G1_REGNUM].addr = sigcontext_addr + 40;
+ saved_regs[SPARC_O0_REGNUM].addr = sigcontext_addr + 48;
/* The remaining `global' registers and %y are saved in the `local'
registers. */
delta = SPARC_L0_REGNUM - SPARC_G0_REGNUM;
for (regnum = SPARC_G2_REGNUM; regnum <= SPARC_G7_REGNUM; regnum++)
- cache->saved_regs[regnum].realreg = regnum + delta;
- cache->saved_regs[SPARC64_Y_REGNUM].realreg = SPARC_L1_REGNUM;
+ saved_regs[regnum].realreg = regnum + delta;
+ saved_regs[SPARC64_Y_REGNUM].realreg = SPARC_L1_REGNUM;
/* The remaining `out' registers can be found in the current frame's
`in' registers. */
delta = SPARC_I0_REGNUM - SPARC_O0_REGNUM;
for (regnum = SPARC_O1_REGNUM; regnum <= SPARC_O5_REGNUM; regnum++)
- cache->saved_regs[regnum].realreg = regnum + delta;
- cache->saved_regs[SPARC_O7_REGNUM].realreg = SPARC_I7_REGNUM;
+ saved_regs[regnum].realreg = regnum + delta;
+ saved_regs[SPARC_O7_REGNUM].realreg = SPARC_I7_REGNUM;
/* The `local' and `in' registers have been saved in the register
save area. */
- addr = cache->saved_regs[SPARC_SP_REGNUM].addr;
+ addr = saved_regs[SPARC_SP_REGNUM].addr;
sp = get_frame_memory_unsigned (next_frame, addr, 8);
for (regnum = SPARC_L0_REGNUM, addr = sp + BIAS;
regnum <= SPARC_I7_REGNUM; regnum++, addr += 8)
- cache->saved_regs[regnum].addr = addr;
+ saved_regs[regnum].addr = addr;
/* TODO: Handle the floating-point registers. */
+ return saved_regs;
+}
+
+static struct sparc_frame_cache *
+sparc64nbsd_sigcontext_frame_cache (struct frame_info *next_frame,
+ void **this_cache)
+{
+ struct sparc_frame_cache *cache;
+ CORE_ADDR addr;
+
+ if (*this_cache)
+ return *this_cache;
+
+ cache = sparc_frame_cache (next_frame, this_cache);
+ gdb_assert (cache == *this_cache);
+
+ /* If we couldn't find the frame's function, we're probably dealing
+ with an on-stack signal trampoline. */
+ if (cache->pc == 0)
+ {
+ cache->pc = sparc64nbsd_sigtramp_start;
+
+ /* Since we couldn't find the frame's function, the cache was
+ initialized under the assumption that we're frameless. */
+ cache->frameless_p = 0;
+ addr = frame_unwind_register_unsigned (next_frame, SPARC_FP_REGNUM);
+ cache->base = addr;
+ }
+
+ /* We find the appropriate instance of `struct sigcontext' at a
+ fixed offset in the signal frame. */
+ addr = cache->base + BIAS + 128 + 8;
+ cache->saved_regs = sparc64nbsd_sigcontext_saved_regs (addr, next_frame);
+
return cache;
}
diff --git a/gdb/sparcnbsd-tdep.c b/gdb/sparcnbsd-tdep.c
index 4ea3901..b1be7eb 100644
--- a/gdb/sparcnbsd-tdep.c
+++ b/gdb/sparcnbsd-tdep.c
@@ -50,16 +50,18 @@ const struct sparc_gregset sparc32nbsd_gregset =
-1 /* %l0 */
};
-/* Unlike other NetBSD implementations, the SPARC port historically
- used .reg and .reg2 (see bfd/netbsd-core.c), and as such, we can
- share one routine for a.out and ELF core files. */
-
static void
sparc32nbsd_supply_gregset (const struct regset *regset,
struct regcache *regcache,
int regnum, const void *gregs, size_t len)
{
sparc32_supply_gregset (regset->descr, regcache, regnum, gregs);
+
+ /* Traditional NetBSD core files don't use multiple register sets.
+ Instead, the general-purpose and floating-point registers are
+ lumped together in a single section. */
+ if (len >= 212)
+ sparc32_supply_fpregset (regcache, regnum, (const char *) gregs + 80);
}
static void
@@ -90,92 +92,118 @@ sparc32nbsd_pc_in_sigtramp (CORE_ADDR pc, char *name)
return nbsd_pc_in_sigtramp (pc, name);
}
-static struct sparc_frame_cache *
-sparc32nbsd_sigcontext_frame_cache (struct frame_info *next_frame,
- void **this_cache)
+struct trad_frame_saved_reg *
+sparc32nbsd_sigcontext_saved_regs (struct frame_info *next_frame)
{
- struct sparc_frame_cache *cache;
+ struct trad_frame_saved_reg *saved_regs;
CORE_ADDR addr, sigcontext_addr;
- LONGEST psr;
int regnum, delta;
+ ULONGEST psr;
- if (*this_cache)
- return *this_cache;
+ saved_regs = trad_frame_alloc_saved_regs (next_frame);
- cache = sparc_frame_cache (next_frame, this_cache);
- gdb_assert (cache == *this_cache);
+ /* We find the appropriate instance of `struct sigcontext' at a
+ fixed offset in the signal frame. */
+ addr = frame_unwind_register_unsigned (next_frame, SPARC_FP_REGNUM);
+ sigcontext_addr = addr + 64 + 16;
/* The registers are saved in bits and pieces scattered all over the
place. The code below records their location on the assumption
that the part of the signal trampoline that saves the state has
been executed. */
- /* If we couldn't find the frame's function, we're probably dealing
- with an on-stack signal trampoline. */
- if (cache->pc == 0)
- {
- cache->pc = sparc32nbsd_sigtramp_start;
-
- /* Since we couldn't find the frame's function, the cache was
- initialized under the assumption that we're frameless. */
- cache->frameless_p = 0;
- addr = frame_unwind_register_unsigned (next_frame, SPARC_FP_REGNUM);
- cache->base = addr;
- }
-
- cache->saved_regs = trad_frame_alloc_saved_regs (next_frame);
-
- /* We find the appropriate instance of `struct sigcontext' at a
- fixed offset in the signal frame. */
- sigcontext_addr = cache->base + 64 + 16;
-
- cache->saved_regs[SPARC_SP_REGNUM].addr = sigcontext_addr + 8;
- cache->saved_regs[SPARC32_PC_REGNUM].addr = sigcontext_addr + 12;
- cache->saved_regs[SPARC32_NPC_REGNUM].addr = sigcontext_addr + 16;
- cache->saved_regs[SPARC32_PSR_REGNUM].addr = sigcontext_addr + 20;
- cache->saved_regs[SPARC_G1_REGNUM].addr = sigcontext_addr + 24;
- cache->saved_regs[SPARC_O0_REGNUM].addr = sigcontext_addr + 28;
+ saved_regs[SPARC_SP_REGNUM].addr = sigcontext_addr + 8;
+ saved_regs[SPARC32_PC_REGNUM].addr = sigcontext_addr + 12;
+ saved_regs[SPARC32_NPC_REGNUM].addr = sigcontext_addr + 16;
+ saved_regs[SPARC32_PSR_REGNUM].addr = sigcontext_addr + 20;
+ saved_regs[SPARC_G1_REGNUM].addr = sigcontext_addr + 24;
+ saved_regs[SPARC_O0_REGNUM].addr = sigcontext_addr + 28;
/* The remaining `global' registers and %y are saved in the `local'
registers. */
delta = SPARC_L0_REGNUM - SPARC_G0_REGNUM;
for (regnum = SPARC_G2_REGNUM; regnum <= SPARC_G7_REGNUM; regnum++)
- cache->saved_regs[regnum].realreg = regnum + delta;
- cache->saved_regs[SPARC32_Y_REGNUM].realreg = SPARC_L1_REGNUM;
+ saved_regs[regnum].realreg = regnum + delta;
+ saved_regs[SPARC32_Y_REGNUM].realreg = SPARC_L1_REGNUM;
/* The remaining `out' registers can be found in the current frame's
`in' registers. */
delta = SPARC_I0_REGNUM - SPARC_O0_REGNUM;
for (regnum = SPARC_O1_REGNUM; regnum <= SPARC_O5_REGNUM; regnum++)
- cache->saved_regs[regnum].realreg = regnum + delta;
- cache->saved_regs[SPARC_O7_REGNUM].realreg = SPARC_I7_REGNUM;
+ saved_regs[regnum].realreg = regnum + delta;
+ saved_regs[SPARC_O7_REGNUM].realreg = SPARC_I7_REGNUM;
/* The `local' and `in' registers have been saved in the register
save area. */
- addr = cache->saved_regs[SPARC_SP_REGNUM].addr;
+ addr = saved_regs[SPARC_SP_REGNUM].addr;
addr = get_frame_memory_unsigned (next_frame, addr, 4);
for (regnum = SPARC_L0_REGNUM;
regnum <= SPARC_I7_REGNUM; regnum++, addr += 4)
- cache->saved_regs[regnum].addr = addr;
+ saved_regs[regnum].addr = addr;
+
+ /* Handle StackGhost. */
+ {
+ ULONGEST wcookie = sparc_fetch_wcookie ();
+
+ if (wcookie != 0)
+ {
+ ULONGEST i7;
+
+ addr = saved_regs[SPARC_I7_REGNUM].addr;
+ i7 = get_frame_memory_unsigned (next_frame, addr, 4);
+ trad_frame_set_value (saved_regs, SPARC_I7_REGNUM, i7 ^ wcookie);
+ }
+ }
/* The floating-point registers are only saved if the EF bit in %prs
has been set. */
#define PSR_EF 0x00001000
- addr = cache->saved_regs[SPARC32_PSR_REGNUM].addr;
+ addr = saved_regs[SPARC32_PSR_REGNUM].addr;
psr = get_frame_memory_unsigned (next_frame, addr, 4);
if (psr & PSR_EF)
{
CORE_ADDR sp;
sp = frame_unwind_register_unsigned (next_frame, SPARC_SP_REGNUM);
- cache->saved_regs[SPARC32_FSR_REGNUM].addr = sp + 96;
+ saved_regs[SPARC32_FSR_REGNUM].addr = sp + 96;
for (regnum = SPARC_F0_REGNUM, addr = sp + 96 + 8;
regnum <= SPARC_F31_REGNUM; regnum++, addr += 4)
- cache->saved_regs[regnum].addr = addr;
+ saved_regs[regnum].addr = addr;
+ }
+
+ return saved_regs;
+}
+
+static struct sparc_frame_cache *
+sparc32nbsd_sigcontext_frame_cache (struct frame_info *next_frame,
+ void **this_cache)
+{
+ struct sparc_frame_cache *cache;
+ CORE_ADDR addr;
+
+ if (*this_cache)
+ return *this_cache;
+
+ cache = sparc_frame_cache (next_frame, this_cache);
+ gdb_assert (cache == *this_cache);
+
+ /* If we couldn't find the frame's function, we're probably dealing
+ with an on-stack signal trampoline. */
+ if (cache->pc == 0)
+ {
+ cache->pc = sparc32nbsd_sigtramp_start;
+
+ /* Since we couldn't find the frame's function, the cache was
+ initialized under the assumption that we're frameless. */
+ cache->frameless_p = 0;
+ addr = frame_unwind_register_unsigned (next_frame, SPARC_FP_REGNUM);
+ cache->base = addr;
}
+ cache->saved_regs = sparc32nbsd_sigcontext_saved_regs (next_frame);
+
return cache;
}
@@ -249,9 +277,11 @@ sparc32nbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
tdep->gregset = XMALLOC (struct regset);
tdep->gregset->descr = &sparc32nbsd_gregset;
tdep->gregset->supply_regset = sparc32nbsd_supply_gregset;
+ tdep->sizeof_gregset = 20 * 4;
tdep->fpregset = XMALLOC (struct regset);
tdep->fpregset->supply_regset = sparc32nbsd_supply_fpregset;
+ tdep->sizeof_fpregset = 33 * 4;
set_gdbarch_pc_in_sigtramp (gdbarch, sparc32nbsd_pc_in_sigtramp);
frame_unwind_append_sniffer (gdbarch, sparc32nbsd_sigtramp_frame_sniffer);
@@ -284,6 +314,28 @@ sparcnbsd_aout_osabi_sniffer (bfd *abfd)
return GDB_OSABI_UNKNOWN;
}
+/* OpenBSD uses the traditional NetBSD core file format, even for
+ ports that use ELF. Therefore, if the default OS ABI is OpenBSD
+ ELF, we return that instead of NetBSD a.out. This is mainly for
+ the benfit of OpenBSD/sparc64, which inherits the sniffer below
+ since we include this file for an OpenBSD/sparc64 target. For
+ OpenBSD/sparc, the NetBSD a.out OS ABI is probably similar enough
+ to both the OpenBSD a.out and the OpenBSD ELF OS ABI. */
+#if defined (GDB_OSABI_DEFAULT) && (GDB_OSABI_DEFAULT == GDB_OSABI_OPENBSD_ELF)
+#define GDB_OSABI_NETBSD_CORE GDB_OSABI_OPENBSD_ELF
+#else
+#define GDB_OSABI_NETBSD_CORE GDB_OSABI_NETBSD_AOUT
+#endif
+
+static enum gdb_osabi
+sparcnbsd_core_osabi_sniffer (bfd *abfd)
+{
+ if (strcmp (bfd_get_target (abfd), "netbsd-core") == 0)
+ return GDB_OSABI_NETBSD_CORE;
+
+ return GDB_OSABI_UNKNOWN;
+}
+
/* Provide a prototype to silence -Wmissing-prototypes. */
void _initialize_sparcnbsd_tdep (void);
@@ -294,6 +346,11 @@ _initialize_sparnbsd_tdep (void)
gdbarch_register_osabi_sniffer (bfd_arch_sparc, bfd_target_aout_flavour,
sparcnbsd_aout_osabi_sniffer);
+ /* BFD doesn't set the architecture for NetBSD style a.out core
+ files. */
+ gdbarch_register_osabi_sniffer (bfd_arch_unknown, bfd_target_unknown_flavour,
+ sparcnbsd_core_osabi_sniffer);
+
gdbarch_register_osabi (bfd_arch_sparc, 0, GDB_OSABI_NETBSD_AOUT,
sparc32nbsd_aout_init_abi);
gdbarch_register_osabi (bfd_arch_sparc, 0, GDB_OSABI_NETBSD_ELF,
diff --git a/gdb/stabsread.c b/gdb/stabsread.c
index 948cf0e..5dd8f58 100644
--- a/gdb/stabsread.c
+++ b/gdb/stabsread.c
@@ -1,7 +1,8 @@
/* Support routines for decoding "stabs" debugging information format.
- Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
- 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
- Free Software Foundation, Inc.
+
+ Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
+ 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free
+ Software Foundation, Inc.
This file is part of GDB.
@@ -89,8 +90,6 @@ static void
read_one_struct_field (struct field_info *, char **, char *,
struct type *, struct objfile *);
-static char *get_substring (char **, int);
-
static struct type *dbx_alloc_type (int[2], struct objfile *);
static long read_huge_number (char **, int, int *);
@@ -158,8 +157,6 @@ static char *find_name_end (char *name);
static int process_reference (char **string);
-static CORE_ADDR ref_search_value (int refnum);
-
void stabsread_clear_cache (void);
static const char vptr_name[] = "_vptr$";
@@ -194,12 +191,6 @@ stabs_general_complaint (const char *arg1)
complaint (&symfile_complaints, "%s", arg1);
}
-static void
-lrs_general_complaint (const char *arg1)
-{
- complaint (&symfile_complaints, "%s", arg1);
-}
-
/* Make a list of forward references which haven't been defined. */
static struct type **undef_types;
@@ -388,14 +379,14 @@ patch_block_stabs (struct pending *symbols, struct pending_stabs *stabs,
ld will remove it from the executable. There is then
a N_GSYM stab for it, but no regular (C_EXT) symbol. */
sym = (struct symbol *)
- obstack_alloc (&objfile->symbol_obstack,
+ obstack_alloc (&objfile->objfile_obstack,
sizeof (struct symbol));
memset (sym, 0, sizeof (struct symbol));
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
SYMBOL_CLASS (sym) = LOC_OPTIMIZED_OUT;
DEPRECATED_SYMBOL_NAME (sym) =
- obsavestring (name, pp - name, &objfile->symbol_obstack);
+ obsavestring (name, pp - name, &objfile->objfile_obstack);
pp += 2;
if (*(pp - 1) == 'F' || *(pp - 1) == 'f')
{
@@ -533,16 +524,6 @@ ref_search (int refnum)
return ref_map[refnum].sym;
}
-/* Return value for the reference REFNUM. */
-
-static CORE_ADDR
-ref_search_value (int refnum)
-{
- if (refnum < 0 || refnum > ref_count)
- return 0;
- return ref_map[refnum].value;
-}
-
/* Parse a reference id in STRING and return the resulting
reference number. Move STRING beyond the reference id. */
@@ -631,7 +612,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
nameless = (p == string || ((string[0] == ' ') && (string[1] == ':')));
current_symbol = sym = (struct symbol *)
- obstack_alloc (&objfile->symbol_obstack, sizeof (struct symbol));
+ obstack_alloc (&objfile->objfile_obstack, sizeof (struct symbol));
memset (sym, 0, sizeof (struct symbol));
switch (type & N_TYPE)
@@ -665,7 +646,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
{
case 't':
DEPRECATED_SYMBOL_NAME (sym) = obsavestring ("this", strlen ("this"),
- &objfile->symbol_obstack);
+ &objfile->objfile_obstack);
break;
case 'v': /* $vtbl_ptr_type */
@@ -674,7 +655,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
case 'e':
DEPRECATED_SYMBOL_NAME (sym) = obsavestring ("eh_throw", strlen ("eh_throw"),
- &objfile->symbol_obstack);
+ &objfile->objfile_obstack);
break;
case '_':
@@ -757,7 +738,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
SYMBOL_TYPE (sym) = lookup_fundamental_type (objfile,
FT_DBL_PREC_FLOAT);
dbl_valu = (char *)
- obstack_alloc (&objfile->symbol_obstack,
+ obstack_alloc (&objfile->objfile_obstack,
TYPE_LENGTH (SYMBOL_TYPE (sym)));
store_typed_floating (dbl_valu, SYMBOL_TYPE (sym), d);
SYMBOL_VALUE_BYTES (sym) = dbl_valu;
@@ -1270,21 +1251,21 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
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));
+ = obconcat (&objfile->objfile_obstack, "", "", DEPRECATED_SYMBOL_NAME (sym));
add_symbol_to_list (sym, &file_symbols);
if (synonym)
{
/* Clone the sym and then modify it. */
struct symbol *typedef_sym = (struct symbol *)
- obstack_alloc (&objfile->symbol_obstack, sizeof (struct symbol));
+ obstack_alloc (&objfile->objfile_obstack, sizeof (struct symbol));
*typedef_sym = *sym;
SYMBOL_CLASS (typedef_sym) = LOC_TYPEDEF;
SYMBOL_VALUE (typedef_sym) = valu;
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));
+ = obconcat (&objfile->objfile_obstack, "", "", DEPRECATED_SYMBOL_NAME (sym));
add_symbol_to_list (typedef_sym, &file_symbols);
}
break;
@@ -1546,7 +1527,7 @@ again:
return error_type (pp, objfile);
}
to = type_name =
- (char *) obstack_alloc (&objfile->type_obstack, p - *pp + 1);
+ (char *) obstack_alloc (&objfile->objfile_obstack, p - *pp + 1);
/* Copy the name. */
from = *pp + 1;
@@ -1573,7 +1554,7 @@ again:
&& (TYPE_CODE (SYMBOL_TYPE (sym)) == code)
&& strcmp (DEPRECATED_SYMBOL_NAME (sym), type_name) == 0)
{
- obstack_free (&objfile->type_obstack, type_name);
+ obstack_free (&objfile->objfile_obstack, type_name);
type = SYMBOL_TYPE (sym);
if (typenums[0] != -1)
*dbx_lookup_type (typenums) = type;
@@ -2314,8 +2295,9 @@ read_member_functions (struct field_info *fip, char **pp, struct type *type,
/* G++ anonymous structures have names starting with '.' or
'$'. */
if (is_cplus_marker (class_name[0]))
- TYPE_NAME (type) = obconcat (&objfile->type_obstack, "",
- "", class_name);
+ TYPE_NAME (type) = obsavestring (&objfile->objfile_obstack,
+ class_name,
+ strlen (class_name));
}
/* Set this member function's visibility fields. */
@@ -2561,11 +2543,11 @@ read_member_functions (struct field_info *fip, char **pp, struct type *type,
make_cleanup (xfree, destr_fnlist);
memset (destr_fnlist, 0, sizeof (struct next_fnfieldlist));
destr_fnlist->fn_fieldlist.name
- = obconcat (&objfile->type_obstack, "", "~",
+ = obconcat (&objfile->objfile_obstack, "", "~",
new_fnlist->fn_fieldlist.name);
destr_fnlist->fn_fieldlist.fn_fields = (struct fn_field *)
- obstack_alloc (&objfile->type_obstack,
+ obstack_alloc (&objfile->objfile_obstack,
sizeof (struct fn_field) * has_destructor);
memset (destr_fnlist->fn_fieldlist.fn_fields, 0,
sizeof (struct fn_field) * has_destructor);
@@ -2626,11 +2608,11 @@ read_member_functions (struct field_info *fip, char **pp, struct type *type,
if (ret)
new_fnlist->fn_fieldlist.name
= obsavestring (dem_opname, strlen (dem_opname),
- &objfile->type_obstack);
+ &objfile->objfile_obstack);
}
new_fnlist->fn_fieldlist.fn_fields = (struct fn_field *)
- obstack_alloc (&objfile->type_obstack,
+ obstack_alloc (&objfile->objfile_obstack,
sizeof (struct fn_field) * length);
memset (new_fnlist->fn_fieldlist.fn_fields, 0,
sizeof (struct fn_field) * length);
@@ -2699,7 +2681,7 @@ read_cpp_abbrev (struct field_info *fip, char **pp, struct type *type,
name = "";
}
fip->list->field.name =
- obconcat (&objfile->type_obstack, vptr_name, name, "");
+ obconcat (&objfile->objfile_obstack, vptr_name, name, "");
break;
case 'b': /* $vb -- a virtual bsomethingorother */
@@ -2712,13 +2694,13 @@ read_cpp_abbrev (struct field_info *fip, char **pp, struct type *type,
name = "FOO";
}
fip->list->field.name =
- obconcat (&objfile->type_obstack, vb_name, name, "");
+ obconcat (&objfile->objfile_obstack, vb_name, name, "");
break;
default:
invalid_cpp_abbrev_complaint (*pp);
fip->list->field.name =
- obconcat (&objfile->type_obstack,
+ obconcat (&objfile->objfile_obstack,
"INVALID_CPLUSPLUS_ABBREV", "", "");
break;
}
@@ -2764,7 +2746,7 @@ read_one_struct_field (struct field_info *fip, char **pp, char *p,
struct type *type, struct objfile *objfile)
{
fip->list->field.name =
- obsavestring (*pp, p - *pp, &objfile->type_obstack);
+ obsavestring (*pp, p - *pp, &objfile->objfile_obstack);
*pp = p + 1;
/* This means we have a visibility for a field coming. */
@@ -3534,14 +3516,14 @@ read_enum_type (char **pp, struct type *type,
p = *pp;
while (*p != ':')
p++;
- name = obsavestring (*pp, p - *pp, &objfile->symbol_obstack);
+ name = obsavestring (*pp, p - *pp, &objfile->objfile_obstack);
*pp = p + 1;
n = read_huge_number (pp, ',', &nbits);
if (nbits != 0)
return error_type (pp, objfile);
sym = (struct symbol *)
- obstack_alloc (&objfile->symbol_obstack, sizeof (struct symbol));
+ obstack_alloc (&objfile->objfile_obstack, sizeof (struct symbol));
memset (sym, 0, sizeof (struct symbol));
DEPRECATED_SYMBOL_NAME (sym) = name;
SYMBOL_LANGUAGE (sym) = current_subfile->language;
@@ -4089,7 +4071,7 @@ common_block_start (char *name, struct objfile *objfile)
common_block = local_symbols;
common_block_i = local_symbols ? local_symbols->nsyms : 0;
common_block_name = obsavestring (name, strlen (name),
- &objfile->symbol_obstack);
+ &objfile->objfile_obstack);
}
/* Process a N_ECOMM symbol. */
@@ -4115,9 +4097,9 @@ common_block_end (struct objfile *objfile)
}
sym = (struct symbol *)
- obstack_alloc (&objfile->symbol_obstack, sizeof (struct symbol));
+ obstack_alloc (&objfile->objfile_obstack, sizeof (struct symbol));
memset (sym, 0, sizeof (struct symbol));
- /* Note: common_block_name already saved on symbol_obstack */
+ /* Note: common_block_name already saved on objfile_obstack */
DEPRECATED_SYMBOL_NAME (sym) = common_block_name;
SYMBOL_CLASS (sym) = LOC_BLOCK;
diff --git a/gdb/stack.c b/gdb/stack.c
index 73a6ec5..0a9052f 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -1857,6 +1857,9 @@ return_command (char *retval_exp, int from_tty)
is discarded, side effects such as "return i++" still
occure. */
return_value = NULL;
+ /* FIXME: cagney/2004-01-17: If the architecture implements both
+ return_value and extract_returned_value_address, should allow
+ "return" to work - don't set return_value to NULL. */
else if (!gdbarch_return_value_p (current_gdbarch)
&& (TYPE_CODE (return_type) == TYPE_CODE_STRUCT
|| TYPE_CODE (return_type) == TYPE_CODE_UNION))
@@ -1926,6 +1929,10 @@ If you continue, the return value that you specified will be ignored.\n";
STORE_RETURN_VALUE (return_type, current_regcache,
VALUE_CONTENTS (return_value));
}
+ /* FIXME: cagney/2004-01-17: If extract_returned_value_address
+ is available and the function is using
+ RETURN_VALUE_STRUCT_CONVENTION, should use it to find the
+ address of the returned value so that it can be assigned. */
else
{
gdb_assert (gdbarch_return_value (current_gdbarch, return_type,
diff --git a/gdb/symfile.c b/gdb/symfile.c
index e940003..13bfec3 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -1,7 +1,7 @@
/* Generic symbol file reading for the GNU debugger, GDB.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
Contributed by Cygnus Support, using pieces from other GDB modules.
@@ -199,20 +199,6 @@ int auto_solib_add = 1;
int auto_solib_limit;
-/* Since this function is called from within qsort, in an ANSI environment
- it must conform to the prototype for qsort, which specifies that the
- comparison function takes two "void *" pointers. */
-
-static int
-compare_symbols (const void *s1p, const void *s2p)
-{
- struct symbol **s1, **s2;
-
- s1 = (struct symbol **) s1p;
- s2 = (struct symbol **) s2p;
- return (strcmp (SYMBOL_NATURAL_NAME (*s1), SYMBOL_NATURAL_NAME (*s2)));
-}
-
/* This compares two partial symbols by names, using strcmp_iw_ordered
for the comparison. */
@@ -499,7 +485,7 @@ default_symfile_offsets (struct objfile *objfile,
objfile->num_sections = bfd_count_sections (objfile->obfd);
objfile->section_offsets = (struct section_offsets *)
- obstack_alloc (&objfile->psymbol_obstack,
+ obstack_alloc (&objfile->objfile_obstack,
SIZEOF_N_SECTION_OFFSETS (objfile->num_sections));
memset (objfile->section_offsets, 0,
SIZEOF_N_SECTION_OFFSETS (objfile->num_sections));
@@ -704,7 +690,7 @@ syms_from_objfile (struct objfile *objfile,
objfile->num_sections = num_offsets;
objfile->section_offsets
= ((struct section_offsets *)
- obstack_alloc (&objfile->psymbol_obstack, size));
+ obstack_alloc (&objfile->objfile_obstack, size));
memcpy (objfile->section_offsets, offsets, size);
init_objfile_sect_indices (objfile);
@@ -861,43 +847,22 @@ symbol_file_add_with_addrs_or_offsets (char *name, int from_tty,
orig_addrs->other[i] = addrs->other[i];
}
- /* If the objfile uses a mapped symbol file, and we have a psymtab for
- it, then skip reading any symbols at this time. */
-
- if ((objfile->flags & OBJF_MAPPED) && (objfile->flags & OBJF_SYMS))
+ /* We either created a new mapped symbol table, mapped an existing
+ symbol table file which has not had initial symbol reading
+ performed, or need to read an unmapped symbol table. */
+ if (from_tty || info_verbose)
{
- /* We mapped in an existing symbol table file that already has had
- initial symbol reading performed, so we can skip that part. Notify
- the user that instead of reading the symbols, they have been mapped.
- */
- if (from_tty || info_verbose)
+ if (pre_add_symbol_hook)
+ pre_add_symbol_hook (name);
+ else
{
- printf_unfiltered ("Mapped symbols for %s...", name);
+ printf_unfiltered ("Reading symbols from %s...", name);
wrap_here ("");
gdb_flush (gdb_stdout);
}
- init_entry_point_info (objfile);
- find_sym_fns (objfile);
- }
- else
- {
- /* We either created a new mapped symbol table, mapped an existing
- symbol table file which has not had initial symbol reading
- performed, or need to read an unmapped symbol table. */
- if (from_tty || info_verbose)
- {
- if (pre_add_symbol_hook)
- pre_add_symbol_hook (name);
- else
- {
- printf_unfiltered ("Reading symbols from %s...", name);
- wrap_here ("");
- gdb_flush (gdb_stdout);
- }
- }
- syms_from_objfile (objfile, addrs, offsets, num_offsets,
- mainline, from_tty);
}
+ syms_from_objfile (objfile, addrs, offsets, num_offsets,
+ mainline, from_tty);
/* We now have at least a partial symbol table. Check to see if the
user requested that all symbols be read on initial access via either
@@ -1223,20 +1188,16 @@ symbol_file_command (char *args, int from_tty)
cleanups = make_cleanup_freeargv (argv);
while (*argv != NULL)
{
- if (strcmp (*argv, "-mapped") == 0)
- flags |= OBJF_MAPPED;
- else
- if (strcmp (*argv, "-readnow") == 0)
- flags |= OBJF_READNOW;
- else
- if (**argv == '-')
- error ("unknown option `%s'", *argv);
- else
- {
- name = *argv;
-
- symbol_file_add_main_1 (name, from_tty, flags);
- }
+ if (strcmp (*argv, "-readnow") == 0)
+ flags |= OBJF_READNOW;
+ else if (**argv == '-')
+ error ("unknown option `%s'", *argv);
+ else
+ {
+ name = *argv;
+
+ symbol_file_add_main_1 (name, from_tty, flags);
+ }
argv++;
}
@@ -1751,17 +1712,13 @@ add_symbol_file_command (char *args, int from_tty)
if (*arg == '-')
{
- if (strcmp (arg, "-mapped") == 0)
- flags |= OBJF_MAPPED;
- else
- if (strcmp (arg, "-readnow") == 0)
- flags |= OBJF_READNOW;
- else
- if (strcmp (arg, "-s") == 0)
- {
- expecting_sec_name = 1;
- expecting_sec_addr = 1;
- }
+ if (strcmp (arg, "-readnow") == 0)
+ flags |= OBJF_READNOW;
+ else if (strcmp (arg, "-s") == 0)
+ {
+ expecting_sec_name = 1;
+ expecting_sec_addr = 1;
+ }
}
else
{
@@ -1922,7 +1879,7 @@ reread_symbols (void)
bfd_errmsg (bfd_get_error ()));
/* Save the offsets, we will nuke them with the rest of the
- psymbol_obstack. */
+ objfile_obstack. */
num_offsets = objfile->num_sections;
offsets = ((struct section_offsets *)
alloca (SIZEOF_N_SECTION_OFFSETS (num_offsets)));
@@ -1954,13 +1911,12 @@ reread_symbols (void)
htab_delete (objfile->demangled_names_hash);
objfile->demangled_names_hash = NULL;
}
- obstack_free (&objfile->psymbol_obstack, 0);
- obstack_free (&objfile->symbol_obstack, 0);
- obstack_free (&objfile->type_obstack, 0);
+ obstack_free (&objfile->objfile_obstack, 0);
objfile->sections = NULL;
objfile->symtabs = NULL;
objfile->psymtabs = NULL;
objfile->free_psymtabs = NULL;
+ objfile->cp_namespace_symtab = NULL;
objfile->msymbols = NULL;
objfile->sym_private = NULL;
objfile->minimal_symbol_count = 0;
@@ -1981,11 +1937,7 @@ reread_symbols (void)
it is empty. */
objfile->psymbol_cache = bcache_xmalloc ();
objfile->macro_cache = bcache_xmalloc ();
- obstack_specify_allocation (&objfile->psymbol_obstack, 0, 0,
- xmalloc, xfree);
- obstack_specify_allocation (&objfile->symbol_obstack, 0, 0,
- xmalloc, xfree);
- obstack_specify_allocation (&objfile->type_obstack, 0, 0,
+ obstack_specify_allocation (&objfile->objfile_obstack, 0, 0,
xmalloc, xfree);
if (build_objfile_section_table (objfile))
{
@@ -1997,7 +1949,7 @@ reread_symbols (void)
/* We use the same section offsets as from last time. I'm not
sure whether that is always correct for shared libraries. */
objfile->section_offsets = (struct section_offsets *)
- obstack_alloc (&objfile->psymbol_obstack,
+ obstack_alloc (&objfile->objfile_obstack,
SIZEOF_N_SECTION_OFFSETS (num_offsets));
memcpy (objfile->section_offsets, offsets,
SIZEOF_N_SECTION_OFFSETS (num_offsets));
@@ -2110,8 +2062,7 @@ reread_separate_symbols (struct objfile *objfile)
0, /* No addr table. */
objfile->section_offsets, objfile->num_sections,
0, /* Not mainline. See comments about this above. */
- objfile->flags & (OBJF_MAPPED | OBJF_REORDERED
- | OBJF_SHARED | OBJF_READNOW
+ objfile->flags & (OBJF_REORDERED | OBJF_SHARED | OBJF_READNOW
| OBJF_USERLOADED)));
objfile->separate_debug_objfile->separate_debug_objfile_backlink
= objfile;
@@ -2284,14 +2235,14 @@ allocate_symtab (char *filename, struct objfile *objfile)
struct symtab *symtab;
symtab = (struct symtab *)
- obstack_alloc (&objfile->symbol_obstack, sizeof (struct symtab));
+ obstack_alloc (&objfile->objfile_obstack, sizeof (struct symtab));
memset (symtab, 0, sizeof (*symtab));
symtab->filename = obsavestring (filename, strlen (filename),
- &objfile->symbol_obstack);
+ &objfile->objfile_obstack);
symtab->fullname = NULL;
symtab->language = deduce_language_from_filename (filename);
symtab->debugformat = obsavestring ("unknown", 7,
- &objfile->symbol_obstack);
+ &objfile->objfile_obstack);
/* Hook it to the objfile it comes from */
@@ -2322,12 +2273,12 @@ allocate_psymtab (char *filename, struct objfile *objfile)
}
else
psymtab = (struct partial_symtab *)
- obstack_alloc (&objfile->psymbol_obstack,
+ obstack_alloc (&objfile->objfile_obstack,
sizeof (struct partial_symtab));
memset (psymtab, 0, sizeof (struct partial_symtab));
psymtab->filename = obsavestring (filename, strlen (filename),
- &objfile->psymbol_obstack);
+ &objfile->objfile_obstack);
psymtab->symtab = NULL;
/* Prepend it to the psymtab list for the objfile it belongs to.
@@ -2476,7 +2427,7 @@ cashier_psymtab (struct partial_symtab *pst)
partial_symbol lists (global_psymbols/static_psymbols) that
this psymtab points to. These just take up space until all
the psymtabs are reclaimed. Ditto the dependencies list and
- filename, which are all in the psymbol_obstack. */
+ filename, which are all in the objfile_obstack. */
/* We need to cashier any psymtab that has this one as a dependency... */
again:
diff --git a/gdb/symfile.h b/gdb/symfile.h
index 40aa8dd..13f6555 100644
--- a/gdb/symfile.h
+++ b/gdb/symfile.h
@@ -1,7 +1,7 @@
/* Definitions for reading symbol files into GDB.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of GDB.
@@ -224,7 +224,7 @@ extern struct partial_symtab *start_psymtab_common (struct objfile *,
extern char *obsavestring (const char *, int, struct obstack *);
/* Concatenate strings S1, S2 and S3; return the new string. Space is
- found in the symbol_obstack. */
+ found in the OBSTACKP */
extern char *obconcat (struct obstack *obstackp, const char *, const char *,
const char *);
diff --git a/gdb/symmisc.c b/gdb/symmisc.c
index 76b3507..f6d31f9 100644
--- a/gdb/symmisc.c
+++ b/gdb/symmisc.c
@@ -1,7 +1,7 @@
/* Do various things to symbol tables (other than lookup), for GDB.
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
- 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003 Free Software
+ 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004 Free Software
Foundation, Inc.
This file is part of GDB.
@@ -230,16 +230,12 @@ print_objfile_statistics (void)
if (OBJSTAT (objfile, sz_strtab) > 0)
printf_filtered (" Space used by a.out string tables: %d\n",
OBJSTAT (objfile, sz_strtab));
- printf_filtered (" Total memory used for psymbol obstack: %d\n",
- obstack_memory_used (&objfile->psymbol_obstack));
+ printf_filtered (" Total memory used for objfile obstack: %d\n",
+ obstack_memory_used (&objfile->objfile_obstack));
printf_filtered (" Total memory used for psymbol cache: %d\n",
bcache_memory_used (objfile->psymbol_cache));
printf_filtered (" Total memory used for macro cache: %d\n",
bcache_memory_used (objfile->macro_cache));
- printf_filtered (" Total memory used for symbol obstack: %d\n",
- obstack_memory_used (&objfile->symbol_obstack));
- printf_filtered (" Total memory used for type obstack: %d\n",
- obstack_memory_used (&objfile->type_obstack));
}
immediate_quit--;
}
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 1d7b396..622e277 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -1,7 +1,7 @@
/* Symbol table lookup for the GNU debugger, GDB.
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
- 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+ 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
This file is part of GDB.
@@ -485,7 +485,7 @@ symbol_find_demangled_name (struct general_symbol_info *gsymbol,
/* Set both the mangled and demangled (if any) names for GSYMBOL based
on LINKAGE_NAME and LEN. The hash table corresponding to OBJFILE
- is used, and the memory comes from that objfile's symbol_obstack.
+ is used, and the memory comes from that objfile's objfile_obstack.
LINKAGE_NAME is copied, so the pointer can be discarded after
calling this function. */
@@ -572,7 +572,7 @@ symbol_set_names (struct general_symbol_info *gsymbol,
/* If there is a demangled name, place it right after the mangled name.
Otherwise, just place a second zero byte after the end of the mangled
name. */
- *slot = obstack_alloc (&objfile->symbol_obstack,
+ *slot = obstack_alloc (&objfile->objfile_obstack,
lookup_len + demangled_len + 2);
memcpy (*slot, lookup_name, lookup_len + 1);
if (demangled_name != NULL)
@@ -1480,15 +1480,23 @@ lookup_partial_symbol (struct partial_symtab *pst, const char *name,
}
/* 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
+ 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_domain and only at file-static or global blocks. */
+struct type *
+lookup_transparent_type (const char *name)
+{
+ return current_language->la_lookup_transparent_type (name);
+}
+/* The standard implementation of lookup_transparent_type. This code
+ was modeled 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_domain and only at file-static or
+ global blocks. */
struct type *
-lookup_transparent_type (const char *name)
+basic_lookup_transparent_type (const char *name)
{
struct symbol *sym;
struct symtab *s = NULL;
diff --git a/gdb/symtab.h b/gdb/symtab.h
index ce1c9fa..b5d9ffd 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -1,7 +1,7 @@
/* Symbol table definitions for GDB.
Copyright 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
- 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software
+ 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software
Foundation, Inc.
This file is part of GDB.
@@ -88,10 +88,10 @@ struct agent_expr;
struct general_symbol_info
{
/* Name of the symbol. This is a required field. Storage for the
- name is allocated on the psymbol_obstack or symbol_obstack for
- the associated objfile. For languages like C++ that make a
- distinction between the mangled name and demangled name, this is
- the mangled name. */
+ name is allocated on the objfile_obstack for the associated
+ objfile. For languages like C++ that make a distinction between
+ the mangled name and demangled name, this is the mangled
+ name. */
char *name;
@@ -311,12 +311,13 @@ struct minimal_symbol
struct general_symbol_info ginfo;
- /* The info field is available for caching machine-specific information
- so it doesn't have to rederive the info constantly (over a serial line).
- It is initialized to zero and stays that way until target-dependent code
- sets it. Storage for any data pointed to by this field should be allo-
- cated on the symbol_obstack for the associated objfile.
- The type would be "void *" except for reasons of compatibility with older
+ /* The info field is available for caching machine-specific
+ information so it doesn't have to rederive the info constantly
+ (over a serial line). It is initialized to zero and stays that
+ way until target-dependent code sets it. Storage for any data
+ pointed to by this field should be allocated on the
+ objfile_obstack for the associated objfile. The type would be
+ "void *" except for reasons of compatibility with older
compilers. This field is optional.
Currently, the AMD 29000 tdep.c uses it to remember things it has decoded
@@ -546,21 +547,12 @@ enum address_class
LOC_COMPUTED_ARG
};
-/* A structure of function pointers describing the location of a
- variable, structure member, or structure base class.
-
- These functions' BATON arguments are generic data pointers, holding
- whatever data the functions need --- the code which provides this
- structure also provides the actual contents of the baton, and
- decides its form. However, there may be other rules about where
- the baton data must be allocated; whoever is pointing to this
- `struct location_funcs' object will know the rules. For example,
- when a symbol S's location is LOC_COMPUTED, then
- SYMBOL_LOCATION_FUNCS(S) is pointing to a location_funcs structure,
- and SYMBOL_LOCATION_BATON(S) is the baton, which must be allocated
- on the same obstack as the symbol itself. */
-
-struct location_funcs
+/* The methods needed to implement a symbol class. These methods can
+ use the symbol's .aux_value for additional per-symbol information.
+
+ At present this is only used to implement location expressions. */
+
+struct symbol_ops
{
/* Return the value of the variable SYMBOL, relative to the stack
@@ -608,6 +600,12 @@ struct symbol
ENUM_BITFIELD(domain_enum_tag) domain : 6;
/* Address class */
+ /* NOTE: cagney/2003-11-02: The fields "aclass" and "ops" contain
+ overlapping information. By creating a per-aclass ops vector, or
+ using the aclass as an index into an ops table, the aclass and
+ ops fields can be merged. The latter, for instance, would shave
+ 32-bits from each symbol (relative to a symbol lookup, any table
+ index overhead would be in the noise). */
ENUM_BITFIELD(address_class) aclass : 6;
@@ -617,28 +615,30 @@ struct symbol
unsigned short line;
- /* Some symbols require an additional value to be recorded on a per-
- symbol basis. Stash those values here. */
+ /* Method's for symbol's of this class. */
+ /* NOTE: cagney/2003-11-02: See comment above attached to "aclass". */
+
+ const struct symbol_ops *ops;
+
+ /* Some symbols require additional information to be recorded on a
+ per- symbol basis. Stash those values here. */
union
{
/* Used by LOC_BASEREG and LOC_BASEREG_ARG. */
short basereg;
-
- /* For a LOC_COMPUTED or LOC_COMPUTED_ARG symbol, this is the
- baton and location_funcs structure to find its location. For a
- LOC_BLOCK symbol for a function in a compilation unit compiled
- with DWARF 2 information, this is information used internally
- by the DWARF 2 code --- specifically, the location expression
- for the frame base for this function. */
+ /* An arbitrary data pointer. Note that this data must be
+ allocated using the same obstack as the symbol itself. */
+ /* So far it is only used by LOC_COMPUTED and LOC_COMPUTED_ARG to
+ find the location location information. For a LOC_BLOCK symbol
+ for a function in a compilation unit compiled with DWARF 2
+ information, this is information used internally by the DWARF 2
+ code --- specifically, the location expression for the frame
+ base for this function. */
/* FIXME drow/2003-02-21: For the LOC_BLOCK case, it might be better
to add a magic symbol to the block containing this information,
or to have a generic debug info annotation slot for symbols. */
- struct
- {
- void *baton;
- struct location_funcs *funcs;
- } loc;
+ void *ptr;
}
aux_value;
@@ -652,8 +652,8 @@ struct symbol
#define SYMBOL_LINE(symbol) (symbol)->line
#define SYMBOL_BASEREG(symbol) (symbol)->aux_value.basereg
#define SYMBOL_OBJFILE(symbol) (symbol)->aux_value.objfile
-#define SYMBOL_LOCATION_BATON(symbol) (symbol)->aux_value.loc.baton
-#define SYMBOL_LOCATION_FUNCS(symbol) (symbol)->aux_value.loc.funcs
+#define SYMBOL_OPS(symbol) (symbol)->ops
+#define SYMBOL_LOCATION_BATON(symbol) (symbol)->aux_value.ptr
/* A partial_symbol records the name, domain, and address class of
symbols whose types we have not parsed yet. For functions, it also
@@ -859,7 +859,7 @@ struct symtab
Even after the source file has been read into a symtab, the
partial_symtab remains around. They are allocated on an obstack,
- psymbol_obstack. FIXME, this is bad for dynamic linking or VxWorks-
+ objfile_obstack. FIXME, this is bad for dynamic linking or VxWorks-
style execution of a bunch of .o's. */
struct partial_symtab
@@ -1107,6 +1107,7 @@ extern int find_pc_line_pc_range (CORE_ADDR, CORE_ADDR *, CORE_ADDR *);
extern void reread_symbols (void);
extern struct type *lookup_transparent_type (const char *);
+extern struct type *basic_lookup_transparent_type (const char *);
/* Macro for name of symbol to indicate a file compiled with gcc. */
diff --git a/gdb/target.c b/gdb/target.c
index cc3b747..ff47ac1 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -1,7 +1,7 @@
/* Select target systems and architectures at runtime for GDB.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
Contributed by Cygnus Support.
@@ -71,8 +71,6 @@ static struct target_ops *find_default_run_target (char *);
static void nosupport_runtime (void);
-static void normal_target_post_startup_inferior (ptid_t ptid);
-
static LONGEST default_xfer_partial (struct target_ops *ops,
enum target_object object,
const char *annex, void *readbuf,
@@ -1362,7 +1360,7 @@ find_default_create_inferior (char *exec_file, char *allargs, char **env)
static int
default_region_size_ok_for_hw_watchpoint (int byte_count)
{
- return (byte_count <= DEPRECATED_REGISTER_SIZE);
+ return (byte_count <= TYPE_LENGTH (builtin_type_void_data_ptr));
}
static int
@@ -1603,24 +1601,6 @@ normal_pid_to_str (ptid_t ptid)
return buf;
}
-/* Some targets (such as ttrace-based HPUX) don't allow us to request
- notification of inferior events such as fork and vork immediately
- after the inferior is created. (This because of how gdb gets an
- inferior created via invoking a shell to do it. In such a scenario,
- if the shell init file has commands in it, the shell will fork and
- exec for each of those commands, and we will see each such fork
- event. Very bad.)
-
- This function is used by all targets that allow us to request
- notification of forks, etc at inferior creation time; e.g., in
- target_acknowledge_forked_child.
- */
-static void
-normal_target_post_startup_inferior (ptid_t ptid)
-{
- /* This space intentionally left blank. */
-}
-
/* Error-catcher for target_find_memory_regions */
static int dummy_find_memory_regions (int (*ignore1) (), void *ignore2)
{
diff --git a/gdb/target.h b/gdb/target.h
index 21956df..2d8ce37 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -1,7 +1,7 @@
/* Interface between GDB and target environments, including files and processes
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
Contributed by Cygnus Support. Written by John Gilmore.
@@ -35,8 +35,8 @@ struct target_ops;
specific to the communications interface between us and the
target.
- A TARGET is an interface between the debugger and a particular
- kind of file or process. Targets can be STACKED in STRATA,
+ A TARGET is an interface between the debugger and a particular
+ kind of file or process. Targets can be STACKED in STRATA,
so that more than one target can potentially respond to a request.
In particular, memory accesses will walk down the stack of targets
until they find a target that is interested in handling that particular
@@ -155,7 +155,7 @@ enum inferior_event_type
INF_QUIT_REQ,
/* Process a normal inferior event which will result in target_wait
being called. */
- INF_REG_EVENT,
+ INF_REG_EVENT,
/* Deal with an error on the inferior. */
INF_ERROR,
/* We are called because a timer went off. */
@@ -186,7 +186,7 @@ enum target_signal target_signal_from_name (char *);
Return the number of bytes actually transfered, zero when no
further transfer is possible, and -1 when the transfer is not
supported.
-
+
NOTE: cagney/2003-10-17: The current interface does not support a
"retry" mechanism. Instead it assumes that at least one byte will
be transfered on each call.
@@ -226,8 +226,12 @@ enum target_object
TARGET_OBJECT_MEMORY,
/* Kernel Unwind Table. See "ia64-tdep.c". */
TARGET_OBJECT_UNWIND_TABLE,
- /* Possible future objects: TARGET_OBJECT_FILE, TARGET_OBJECT_PROC,
- TARGET_OBJECT_AUXV, ... */
+ /* Transfer auxilliary vector. */
+ TARGET_OBJECT_AUXV,
+ /* StackGhost cookie. See "sparc-tdep.c". */
+ TARGET_OBJECT_WCOOKIE
+
+ /* Possible future objects: TARGET_OBJECT_FILE, TARGET_OBJECT_PROC, ... */
};
extern LONGEST target_read_partial (struct target_ops *ops,
@@ -324,7 +328,7 @@ struct target_ops
something at MEMADDR + N. */
int (*to_xfer_memory) (CORE_ADDR memaddr, char *myaddr,
- int len, int write,
+ int len, int write,
struct mem_attrib *attrib,
struct target_ops *target);
@@ -392,10 +396,10 @@ struct target_ops
void (*to_async) (void (*cb) (enum inferior_event_type, void *context),
void *context);
int to_async_mask_value;
- int (*to_find_memory_regions) (int (*) (CORE_ADDR,
- unsigned long,
- int, int, int,
- void *),
+ int (*to_find_memory_regions) (int (*) (CORE_ADDR,
+ unsigned long,
+ int, int, int,
+ void *),
void *);
char * (*to_make_corefile_notes) (bfd *, int *);
@@ -413,7 +417,7 @@ struct target_ops
only one, of readbuf or writebuf must be non-NULL. */
LONGEST (*to_xfer_partial) (struct target_ops *ops,
enum target_object object, const char *annex,
- void *readbuf, const void *writebuf,
+ void *readbuf, const void *writebuf,
ULONGEST offset, LONGEST len);
int to_magic;
@@ -451,9 +455,9 @@ void target_close (struct target_ops *targ, int quitting);
/* Attaches to a process on the target side. Arguments are as passed
to the `attach' command by the user. This routine can be called
when the target is not on the target-stack, if the target_can_run
- routine returns 1; in that case, it must push itself onto the stack.
+ routine returns 1; in that case, it must push itself onto the stack.
Upon exit, the target should be ready for normal operations, and
- should be ready to deliver the status of the process immediately
+ should be ready to deliver the status of the process immediately
(without waiting) to an upcoming target_wait call. */
#define target_attach(args, from_tty) \
@@ -548,10 +552,10 @@ extern int target_read_memory (CORE_ADDR memaddr, char *myaddr, int len);
extern int target_write_memory (CORE_ADDR memaddr, char *myaddr, int len);
-extern int xfer_memory (CORE_ADDR, char *, int, int,
+extern int xfer_memory (CORE_ADDR, char *, int, int,
struct mem_attrib *, struct target_ops *);
-extern int child_xfer_memory (CORE_ADDR, char *, int, int,
+extern int child_xfer_memory (CORE_ADDR, char *, int, int,
struct mem_attrib *, struct target_ops *);
/* Make a single attempt at transfering LEN bytes. On a successful
@@ -629,8 +633,8 @@ extern void print_section_info (struct target_ops *, bfd *);
(*current_target.to_insert_breakpoint) (addr, save)
/* Remove a breakpoint at address ADDR in the target machine.
- SAVE is a pointer to the same save area
- that was previously passed to target_insert_breakpoint.
+ SAVE is a pointer to the same save area
+ that was previously passed to target_insert_breakpoint.
Result is 0 for success, or an errno value. */
#define target_remove_breakpoint(addr, save) \
@@ -782,7 +786,7 @@ extern void target_load (char *arg, int from_tty);
(*current_target.to_has_exited) (pid,wait_status,exit_status)
/* The debugger has completed a blocking wait() call. There is now
- some process event that must be processed. This function should
+ some process event that must be processed. This function should
be defined by those targets that require the debugger to perform
cleanup or internal state changes in response to the process event. */
@@ -826,7 +830,7 @@ extern void target_load (char *arg, int from_tty);
/* Get the symbol information for a breakpointable routine called when
- an exception event occurs.
+ an exception event occurs.
Intended mainly for C++, and for those
platforms/implementations where such a callback mechanism is available,
e.g. HP-UX with ANSI C++ (aCC). Some compilers (e.g. g++) support
@@ -910,7 +914,7 @@ extern void target_load (char *arg, int from_tty);
#define target_async_mask_value \
(current_target.to_async_mask_value)
-extern int target_async_mask (int mask);
+extern int target_async_mask (int mask);
extern void target_link (char *, CORE_ADDR *);
@@ -938,7 +942,7 @@ extern char *normal_pid_to_str (ptid_t ptid);
* New Objfile Event Hook:
*
* Sometimes a GDB component wants to get notified whenever a new
- * objfile is loaded. Mainly this is used by thread-debugging
+ * objfile is loaded. Mainly this is used by thread-debugging
* implementations that need to know when symbols for the target
* thread implemenation are available.
*
@@ -983,7 +987,7 @@ extern void (*target_new_objfile_hook) (struct objfile *);
* Iterator function for target memory regions.
* Calls a callback function once for each memory region 'mapped'
* in the child process. Defined as a simple macro rather than
- * as a function macro so that it can be tested for nullity.
+ * as a function macro so that it can be tested for nullity.
*/
#define target_find_memory_regions(FUNC, DATA) \
@@ -1040,7 +1044,7 @@ extern void (*target_new_objfile_hook) (struct objfile *);
/* Provide defaults for hardware watchpoint functions. */
-/* If the *_hw_beakpoint functions have not been defined
+/* If the *_hw_beakpoint functions have not been defined
elsewhere use the definitions in the target vector. */
/* Returns non-zero if we can set a hardware watchpoint of type TYPE. TYPE is
@@ -1084,13 +1088,6 @@ extern void (*target_new_objfile_hook) (struct objfile *);
(*current_target.to_stopped_data_address) ()
#endif
-/* If defined, then we need to decr pc by this much after a hardware break-
- point. Presumably this overrides DECR_PC_AFTER_BREAK... */
-
-#ifndef DECR_PC_AFTER_HW_BREAK
-#define DECR_PC_AFTER_HW_BREAK 0
-#endif
-
/* Sometimes gdb may pick up what appears to be a valid target address
from a minimal symbol, but the value really means, essentially,
"This is an index into a table which is populated when the inferior
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index fec3158..ca904f7 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,283 @@
+2004-02-07 Elena Zannoni <ezannoni@redhat.com>
+
+ * gdb.base/maint.exp: Update test to reflect
+ obstack changes.
+
+2004-02-04 Jeff Johnston <jjohnstn@redhat.com>
+
+ * gdb.base/pendshr.c (pendfunc): New function that calls
+ pendfunc1.
+ * gdb.base/pending.c: Call pendfunc instead of pendfunc1.
+
+2004-02-04 Fred Fish <fnf@redhat.com>
+
+ * gdb.arch/gdb1431.c: Add underbar prefixed version of global
+ function symbols and update copyright years.
+ * gdb.arch/gdb1291.c: Ditto.
+
+2004-02-03 Michael Chastain <mec.gnu@mindspring.com>
+
+ * gdb.cp/virtfunc.exp: Accept both "ctor()" and "ctor(void)".
+
+2004-02-03 Michael Chastain <mec.gnu@mindspring.com>
+
+ * gdb.cp/inherit.exp: Accept both "ctor()" and "ctor(void)".
+
+2004-02-03 Michael Chastain <mec.gnu@mindspring.com>
+
+ * gdb.cp/inherit.exp: Accept output with gcc 3.2-7-rh.
+
+2004-02-02 Fred Fish <fnf@redhat.com>
+
+ * gdb.base/bang.exp: Use gdb_run_cmd so this tests works with
+ remote targets. Update copyright years.
+
+2004-02-02 Jeff Johnston <jjohnstn@redhat.com>
+
+ * lib/gdb.exp (gdb_breakpoint): Add pending breakpoint
+ support.
+ * gdb.base/langs.exp: Fix test which attempts to create
+ breakpoint on non-existent function to handle new pending
+ support.
+ * gdb.base/shlib-call.exp: Use gdb_breakpoint to set
+ a breakpoint.
+ * gdb.base/pending.exp: New test.
+ * gdb.base/pending.c: New file.
+ * gdb.base/pendshr.c: Ditto.
+
+2004-02-02 David Carlton <carlton@kealia.com>
+
+ * gdb.cp/overload.exp: Add overloadNamespace tests.
+ * gdb.cp/overload.cc (dummyClass, dummyInstance): New.
+ (overloadNamespace, XXX): New.
+ (main): Call XXX::marker2.
+
+2004-02-01 Fred Fish <fnf@redhat.com>
+
+ * gdb.base/dump.exp: Use runto_main instead of "runto main".
+ * gdb.base/finish.exp: Ditto.
+ * gdb.base/gcore.exp: Ditto.
+ * gdb.base/huge.exp: Ditto.
+ * gdb.base/info-proc.exp: Ditto.
+ * gdb.base/return2.exp: Ditto.
+ * gdb.threads/gcore-thread.exp: Ditto.
+
+2004-02-01 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdb.threads/thread-specific.exp: Add missing anchor to regexp.
+
+2004-02-01 Mark Kettenis <kettenis@gnu.org>
+
+ * gdb.base/fileio.c (test_open): Replace O_RDONLY with O_RDWR such
+ that opening the file succeeds on OpenBSD.
+
+2004-02-01 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdb.threads/thread-specific.c: New file.
+ * gdb.threads/threads-specific.exp: New test script.
+ * lib/gdb.exp (gdb_test_multiple): Allow user patterns access
+ to expect_out.
+
+2004-02-01 Mark Kettenis <kettenis@gnu.org>
+
+ * gdb.base/call-ar-st.exp: Call get_debug_format. Remove xfail on
+ sparc*-*-solaris* into a kfail PR gdb/1539 on sparc-*-* for stabs
+ only on the "print_small_structs from print_long_arg_list" test.
+
+2004-02-01 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdb.base/completion.exp: Kill a stray backslash.
+
+ From Jim Ingham <jingham@apple.com>:
+ * gdb.base/completion.exp: Test that "complete file ./gdb.base/compl"
+ agrees with the result from sending a tab.
+
+2004-01-31 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdb.base/chng-syms.exp: Remove stray newline.
+
+2004-01-31 Mark Kettenis <kettenis@gnu.org>
+
+ * gdb.asm/asm-source.exp: Set asm-note to "openbsd" for
+ *-*-openbsd*.
+ * gdb.asm/openbsd.inc: New file.
+
+2004-01-30 Mark Kettenis <kettenis@gnu.org>
+
+ * gdb.asm/asm-source.exp: Strip -Wl, from link-flags. Don't
+ append -static to link-flags for *-*-freebsd*, *-*netbsd* and
+ *-*solaris2*. Remove commented out default settings for
+ asm-flags. Replace gdb_compile with target_link.
+
+2004-01-29 Michael Chastain <mec.gnu@mindspring.com>
+
+ * gdb.cp/inherit.exp: Rewrite. Use gdb_test_multiple and gdb
+ for all tests. Remove old hp-ux and cygnus xfail cases.
+
+2004-01-29 Paul N. Hilfinger <Hilfinger@gnat.com>
+
+ * gdb.base/chng-syms.exp: New file.
+ * gdb.base/chng-syms.c: New file.
+
+2004-01-24 Michael Chastain <mec.gnu@mindspring.com>
+
+ * gdb.cp/local.exp: Rewrite "ptype Local". Add "ptype l".
+ Provide arms for current output in all my configurations.
+
+2004-01-24 Michael Chastain <mec.gnu@mindspring.com>
+
+ * lib/compiler.c: Add hp_cc_compiler and hp_aCC_compiler.
+ * lib/compiler.cc: Likewise.
+ * lib/gdb.exp (get_compiler_info): Always call gdb_compile to
+ get the right preprocessor. Eval the output directly. Remove
+ special tests for hp_cc_compiler and hp_aCC_compiler. Remove
+ hp_f77_compiler and hp_f90_compiler completely.
+ (gdb_preprocess): Delete.
+ (get_compiler): Delete.
+
+2004-01-24 Mark Kettenis <kettenis@gnu.org>
+
+ * gdb.base/charset.c, gdb.base/dump.c, gdb.base/huge.c: Include
+ <string.h>.
+
+2004-01-24 Nick Roberts <nick@nick.uklinux.net>
+
+ * gdb.mi/mi-stack.exp: Update copyright.
+
+2004-01-23 David Carlton <carlton@kealia.com>
+
+ * gdb.cp/rtti.exp: Don't include full path in ${srcfile}. Add
+ test for cp_lookup_transparent_type.
+ * gdb.cp/rtti1.cc: Update copyright. Add n2::func and refer_to;
+ call them.
+
+2004-01-23 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdb.mi/mi-var-child.exp: Update copyright year. Move new test
+ after -var-update.
+
+2004-01-23 David Carlton <carlton@kealia.com>
+
+ * gdb.cp/namespace.cc (C::ensureRefs): New.
+ * gdb.cp/namespace1.cc (C::ensureOtherRefs): New.
+
+2004-01-20 Nick Roberts <nick@nick.uklinux.net>
+
+ * gdb.mi/mi-stack.exp (test_stack_locals_listing): Test for
+ case "-stack-list-locals 2".
+ * gdb.mi/mi-var-child.exp: Test for case
+ "-var-list-children --all-values NAME".
+
+2004-01-18 Michael Chastain <mec.gnu@mindspring.com>
+
+ * gdb.cp/local.exp: Accept correct output for gcc v3 -gstabs+.
+
+2004-01-18 Mark Kettenis <kettenis@gnu.org>
+
+ * gdb.base/fileio.exp: Add "$gdb_prompt $" anchors to patterns
+ used with gdb_test_multiple.
+
+ * gdb.base/gdb1476.exp: Accept alternat pattern for failed memory
+ read at address 0. This fixes PR testsuite/1504.
+
+2004-01-18 Daniel Jacobowitz <drow@mvista.com>
+
+ * config/gdbserver.exp (gdbserver_gdb_load): Rename from gdb_load.
+ Remove downloading, guessing the host executable, the calls to
+ gdb_file_cmd and gdb_target_cmd, and "load" support.
+ (infer_host_exec): New function broken out from gdb_load.
+ (gdb_load): New wrapper for gdbserver_gdb_load.
+ * lib/mi-support.exp (mi_gdb_target_cmd): New function, based on
+ gdb_target_cmd. Use -target-select.
+ (mi_gdb_file_cmd): New function, broken out from mi_gdb_load.
+ Download binaries to the host. Clear last_mi_remote_file when
+ we load a new binary.
+ (mi_gdb_load): Call mi_gdb_file_cmd. If gdbserver.exp is loaded,
+ call gdbserver_gdb_load and mi_gdb_target_cmd.
+
+2004-01-17 Michael Chastain <mec.gnu@mindspring.com>
+
+ * gdb.cp/templates.exp: Accept more spaces with "<foo, ?bar>"
+ type patterns.
+
+2004-01-17 Michael Chastain <mec.gnu@mindspring.com>
+
+ * gdb.cp/templates.exp: Fix typo in test name of
+ "print Foo<volatile char*>::foo".
+
+2004-01-15 Michael Chastain <mec.gnu@mindspring.com>
+
+ * gdb.base/setvar.exp: Remove setup_xfail for hppa*-*-*11*.
+
+2004-01-16 Ben Elliston <bje@wasabisystems.com>
+
+ * gdb.arch/Makefile.in (MISCELLANEOUS): Remove.
+ (clean mostlyclean): Remove empty rm.
+
+2004-01-15 Michael Chastain <mec.gnu@mindspring.com>
+
+ * gdb.base/setvar.exp: Add copyright years.
+
+2004-01-14 David Carlton <carlton@bactrian.org>
+
+ * gdb.cp/rtti.exp: Update copyright. KFAIL test with repect to
+ PR c++/1511 and update coment.
+ * gdb.cp/templates.exp: Update patterns to match current output.
+ If changes involve something other than whitespace, KFAIL
+ w.r.t. PR c++/1512 or PR c++/931 as appropriate.
+
+2004-01-14 David Carlton <carlton@kealia.com>
+
+ * gdb.cp/namespace.exp: Add tests involving classes defined within
+ namespaces.
+ * gdb.cp/namespace.cc (C::CClass): New.
+ * gdb.cp/namespace1.cc (C::OtherFileClass): New.
+
+2004-01-14 Elena Zannoni <ezannoni@redhat.com>
+
+ * gdb.base/sepdebug.exp: Bail out of the test if we don't know
+ what debug info we have. Print a better message if something goes
+ wrong while producing the separate debug info file.
+
+2004-01-14 Michael Chastain <mec.gnu@mindspring.com>
+
+ * gdb.base/callfuncs.c: Remove explicit declaration of malloc.
+
+2004-01-14 Michael Chastain <mec.gnu@mindspring.com>
+
+ * gdb.base/callfuncs.c: Add copyright notice.
+
+2004-01-13 Michael Chastain <mec.gnu@mindspring.com>
+
+ * gdb.cp/derivation.exp: Add XFAIL for bug with protected
+ inheritance. PR gdb/1498, PR gcc/13539.
+
+2004-01-13 Elena Zannoni <ezannoni@redhat.com>
+
+ * gdb.threads/gcore-thread.exp: Prefix name of binary with
+ test specific name.
+ * gdb.mi/gdb669.exp: Ditto.
+ * gdb.mi/mi-pthreads.exp: Ditto.
+ * gdb.mi/mi1-pthreads.exp: Ditto.
+ * gdb.mi/mi2-pthreads.exp: Ditto.
+
+2004-01-12 Michael Chastain <mec.gnu@mindspring.com>
+
+ * gdb.cp/member-ptr.cc: Add copyright notice.
+
+2004-01-12 Michael Chastain <mec.gnu@mindspring.com>
+
+ * gdb.cp/member-ptr.exp: Use gdb_test, gdb_test_multiple. Add
+ some patterns for recent versions of gcc and hpacc. Delete
+ calls to setup_xfail for hppa*-*-*. Delete redundant tests.
+ Delete tests that access a NULL pointer-to-member-data. This
+ script is still disabled for gcc.
+
+2004-01-12 Elena Zannoni <ezannoni@redhat.com>
+
+ * gdb.mi/mi2-basics.exp: Make sure that full pathnames are
+ escaped correctly.
+
2004-01-12 Elena Zannoni <ezannoni@redhat.com>
* gdb.base/sepdebug.exp: New file.
diff --git a/gdb/testsuite/config/gdbserver.exp b/gdb/testsuite/config/gdbserver.exp
index 475acd4..bb5b246 100644
--- a/gdb/testsuite/config/gdbserver.exp
+++ b/gdb/testsuite/config/gdbserver.exp
@@ -2,7 +2,7 @@
# ie. a debug agent running as a native process on the same or
# a different host.
-# Copyright 2000, 2002 Free Software Foundation, Inc.
+# Copyright 2000, 2002, 2003, 2004 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
@@ -89,12 +89,8 @@ global server_exec;
global portnum;
set portnum "2345";
-proc gdb_load { arg } {
- global host_exec;
- global server_exec;
- global portnum;
- global verbose;
- global gdb_prompt;
+proc gdbserver_gdb_load { server_exec } {
+ global portnum
# Port id -- either specified in baseboard file, or managed here.
if [target_info exists gdb,socketport] {
@@ -134,35 +130,6 @@ proc gdb_load { arg } {
# Export the host:port pair.
set gdbport $debughost$portnum;
- # Remember new exec file.
- if { $arg == "" } {
- if { ! [info exists host_exec] } {
- send_gdb "info files\n";
- gdb_expect 30 {
- -re "Symbols from \"(\[^\"\]+)\"" {
- set host_exec $expect_out(1,string);
- exp_continue;
- }
- -re "Local exec file:\[\r\n\]+\[ \t\]*`(\[^'\]+)'," {
- set host_exec $expect_out(1,string);
- exp_continue;
- }
- -re "$gdb_prompt $" { }
- }
- }
- } else {
- set host_exec $arg
- if [info exists server_exec] { unset server_exec }
- }
-
- if { ! [info exists server_exec] } {
- if [is_remote target] {
- set server_exec [remote_download target $host_exec]
- } else {
- set server_exec $host_exec
- }
- }
-
# Fire off the debug agent
if [target_info exists gdb_server_args] {
# This flavour of gdbserver takes as arguments those specified
@@ -175,52 +142,77 @@ proc gdb_load { arg } {
# and the name of the executable file to be debugged.
set server_spawn_id [remote_spawn target \
"$gdbserver $sockethost$portnum $server_exec"]
- }
+ }
- # We can't call close, because if gdbserver is local then that means
- # that it will get a SIGHUP.
- ## close -i $server_spawn_id
- wait -nowait -i $server_spawn_id
+ # Wait for the server to produce at least one character of output.
+ expect {
+ -i $server_spawn_id
+ -notransfer
+ -re . { }
+ }
- # Give it a little time to establish
- sleep 1
+ # We can't just call close, because if gdbserver is local then that means
+ # that it will get a SIGHUP. Doing it this way could also allow us to
+ # get at the inferior's input or output if necessary, and means that we
+ # don't need to redirect output.
+ expect_background {
+ -i $server_spawn_id
+ -re "." { }
+ eof {
+ # The spawn ID is already closed now (but not yet waited for).
+ wait -i $expect_out(spawn_id)
+ }
+ }
- # tell gdb what file we are debugging
- if { $arg != "" } {
- if [gdb_file_cmd $arg] {
- return -1;
+ return [list $protocol $gdbport];
+}
+
+proc infer_host_exec { } {
+ set host_exec ""
+
+ send_gdb "info files\n";
+ gdb_expect 30 {
+ -re "Symbols from \"(\[^\"\]+)\"" {
+ set host_exec $expect_out(1,string);
+ exp_continue;
+ }
+ -re "Local exec file:\[\r\n\]+\[ \t\]*`(\[^'\]+)'," {
+ set host_exec $expect_out(1,string);
+ exp_continue;
}
+ -re "$gdb_prompt $" { }
+ }
+
+ return $host_exec
+}
+
+proc gdb_load { arg } {
+ global host_exec
+ global server_exec
+
+ if { $arg == "" && $host_exec == "" } {
+ set host_exec [infer_host_exec]
+ } elseif { $arg != "" } {
+ set host_exec $arg
+ if [info exists server_exec] { unset server_exec }
}
- # attach to the "serial port"
- gdb_target_cmd $protocol $gdbport;
-
- # do the real load if needed
- if [target_info exists gdb_server_do_load] {
- send_gdb "load\n"
- set timeout 2400
- verbose "Timeout is now $timeout seconds" 2
- gdb_expect {
- -re ".*$gdb_prompt $" {
- if $verbose>1 then {
- send_user "Loaded $arg into $GDB\n"
- }
- set timeout 30
- verbose "Timeout is now $timeout seconds" 2
- return 1
- }
- -re "$gdb_prompt $" {
- if $verbose>1 then {
- perror "GDB couldn't load."
- }
- }
- timeout {
- if $verbose>1 then {
- perror "Timed out trying to load $arg."
- }
- }
- }
+ if { ! [info exists server_exec] } {
+ if [is_remote target] {
+ set server_exec [remote_download target $host_exec]
+ } else {
+ set server_exec $host_exec
+ }
}
- return 0;
+ set res [gdbserver_gdb_load $host_exec]
+ set protocol [lindex $res 0]
+ set gdbport [lindex $res 1]
+
+ if { $arg != "" } {
+ if [gdb_file_cmd $arg] {
+ return -1
+ }
+ }
+ gdb_target_cmd $protocol $gdbport
}
diff --git a/gdb/testsuite/gdb.arch/Makefile.in b/gdb/testsuite/gdb.arch/Makefile.in
index 2b6f494..4c47272 100644
--- a/gdb/testsuite/gdb.arch/Makefile.in
+++ b/gdb/testsuite/gdb.arch/Makefile.in
@@ -3,15 +3,12 @@ srcdir = @srcdir@
EXECUTABLES = altivec-abi altivec-regs
-MISCELLANEOUS =
-
all info install-info dvi install uninstall installcheck check:
@echo "Nothing to be done for $@..."
clean mostlyclean:
-rm -f *~ *.o a.out *.x *.ci *.tmp
-rm -f core core.coremaker coremaker.core corefile $(EXECUTABLES)
- -rm -f $(MISCELLANEOUS)
distclean maintainer-clean realclean: clean
-rm -f *~ core
diff --git a/gdb/testsuite/gdb.arch/gdb1291.c b/gdb/testsuite/gdb.arch/gdb1291.c
index 2178f70..7e70e6e 100755
--- a/gdb/testsuite/gdb.arch/gdb1291.c
+++ b/gdb/testsuite/gdb.arch/gdb1291.c
@@ -1,4 +1,4 @@
-/* Copyright 2003 Free Software Foundation, Inc.
+/* Copyright 2003, 2004 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
@@ -29,6 +29,7 @@ main()
asm(".text\n"
" .align 5\n"
"sub:\n"
+ "_sub:\n"
" mov.l r14,@-r15\n"
" mov.w .STACK2,r3\n"
" sub r3,r15\n"
diff --git a/gdb/testsuite/gdb.arch/gdb1431.c b/gdb/testsuite/gdb.arch/gdb1431.c
index 0041042..64f5c60 100755
--- a/gdb/testsuite/gdb.arch/gdb1431.c
+++ b/gdb/testsuite/gdb.arch/gdb1431.c
@@ -1,4 +1,4 @@
-/* Copyright 2003 Free Software Foundation, Inc.
+/* Copyright 2003, 2004 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
@@ -31,6 +31,7 @@ main()
asm(".text\n"
" .align 5\n"
"sub1:\n"
+ "_sub1:\n"
" mov.l r14,@-r15\n"
" add #-128,r15\n"
" add #-128,r15\n"
@@ -48,6 +49,7 @@ asm(".text\n"
asm(".text\n"
" .align 5\n"
"sub2:\n"
+ "_sub2:\n"
" mov.l r14,@-r15\n"
" mov.w .STACK2,r3\n"
" sub r3,r15\n"
diff --git a/gdb/testsuite/gdb.asm/asm-source.exp b/gdb/testsuite/gdb.asm/asm-source.exp
index 301b778..75e64b4 100644
--- a/gdb/testsuite/gdb.asm/asm-source.exp
+++ b/gdb/testsuite/gdb.asm/asm-source.exp
@@ -70,7 +70,7 @@ switch -glob -- [istarget] {
}
"m32r*-*" {
set asm-arch m32r
- append link-flags " -Wl,--whole-archive -lgloss -Wl,--no-whole-archive"
+ append link-flags "--whole-archive -lgloss --no-whole-archive"
}
"m6811-*-*" {
set asm-arch m68hc11
@@ -118,26 +118,19 @@ if { "${asm-arch}" == "" } {
gdb_suppress_entire_file "Assembly source test -- not implemented for this target."
}
-# On FreeBSD and NetBSD, the final link will fail because of
-# unresolved symbols. It turns out that libc.so references symbols
-# that are normally provided by crt1.o, which isn't linked in since we
-# specify -nostartfiles. Using -nostdlib doesn't help since
-# target_compile automatically adds -lm. Linking statically avoids
-# this mess.
-#
-# On Solaris, linking dynamically results in a binary that dumps core.
-#
-if {[istarget "*-*-freebsd*"] || [istarget "*-*-netbsd*"]
- || [istarget "*-*-solaris2*"]} then {
- append link-flags " -static"
-}
-
# On NetBSD/ELF we need a special NetBSD-identifying note section.
if { [istarget "*-*-netbsdelf*"]
|| [istarget "x86_64-*-netbsd*"] } then {
set asm-note "netbsd"
}
+# On OpenBSD/ELF we need a similar note section. We make no attempt
+# of handing a.out here since most OpenBSD/a.out systems use a rather
+# outdated assembler that doesn't assemble this test's code anyway.
+if { [istarget "*-*-openbsd*"] } then {
+ set asm-note "openbsd"
+}
+
# Watch out, we are invoking the assembler, but the testsuite sets multilib
# switches according to compiler syntax. If we pass these options straight
# to the assembler, they won't always make sense. If we don't pass them to
@@ -164,7 +157,6 @@ remote_exec build "rm -f ${subdir}/note.inc"
remote_download host ${srcdir}/${subdir}/${asm-note}.inc ${subdir}/note.inc
if { "${asm-flags}" == "" } {
- #set asm-flags "-Wa,-gstabs,-I${srcdir}/${subdir},-I${objdir}/${subdir}"
set asm-flags "-gstabs -I${srcdir}/${subdir} -I${objdir}/${subdir}"
}
@@ -175,11 +167,13 @@ if {[target_assemble ${srcdir}/${subdir}/${srcfile2} asmsrc2.o "${asm-flags}"] !
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
-set opts "debug ldflags=-nostartfiles"
-foreach i ${link-flags} {
- append opts " ldflags=$i"
-}
-if { [gdb_compile "asmsrc1.o asmsrc2.o" "${binfile}" executable $opts] != "" } {
+# We deliberately don't use gdb_compile here to link together the
+# assembled object files. Using gdb_compile, and therefore the C
+# compiler, is conceptually wrong, since we're testing raw assembler
+# code here that provides its own startup code. Using target_link
+# also avoids a lot of problems on many systems, most notably on
+# *-*-*bsd* and *-*-solaris2*.
+if {[target_link "asmsrc1.o asmsrc2.o" "${binfile}" ${link-flags}] != "" } then {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
diff --git a/gdb/testsuite/gdb.base/Makefile.in b/gdb/testsuite/gdb.base/Makefile.in
index e59f57b..9f382db 100644
--- a/gdb/testsuite/gdb.base/Makefile.in
+++ b/gdb/testsuite/gdb.base/Makefile.in
@@ -3,7 +3,7 @@ srcdir = @srcdir@
EXECUTABLES = all-types annota1 bitfields break \
call-ar-st call-rt-st call-strs callfuncs callfwmall \
- commands compiler condbreak constvars coremaker \
+ chng-syms commands compiler condbreak constvars coremaker \
dbx-test display ending-run execd-prog exprs \
foll-exec foll-fork foll-vfork funcargs int-type interrupt jump \
langs list long_long mips_pro miscexprs nodebug opaque overlays \
diff --git a/gdb/testsuite/gdb.base/bang.exp b/gdb/testsuite/gdb.base/bang.exp
index f584074..1e18328 100644
--- a/gdb/testsuite/gdb.base/bang.exp
+++ b/gdb/testsuite/gdb.base/bang.exp
@@ -1,4 +1,4 @@
-# Copyright 2003 Free Software Foundation, Inc.
+# Copyright 2003, 2004 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
@@ -35,7 +35,13 @@ gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
# Verify that we can run the program and that it terminates normally.
-gdb_test "run" \
- ".*Program exited normally\." \
- "run program"
+gdb_run_cmd
+gdb_expect {
+ -re ".*Program exited normally\.\r\n$gdb_prompt $" {
+ pass "run program"
+ }
+ timeout {
+ fail "run program (timeout)"
+ }
+}
diff --git a/gdb/testsuite/gdb.base/call-ar-st.exp b/gdb/testsuite/gdb.base/call-ar-st.exp
index 1431bc5..9b0e539 100644
--- a/gdb/testsuite/gdb.base/call-ar-st.exp
+++ b/gdb/testsuite/gdb.base/call-ar-st.exp
@@ -105,6 +105,8 @@ if ![runto_main] then {
continue
}
+get_debug_format
+
#go -until 1209
gdb_test "tbreak 1209" \
"Breakpoint \[0-9\]+.*file.*$srcfile, line 1209.*" \
@@ -500,11 +502,14 @@ set ws "\[\n\r\t \]+"
if {![gdb_skip_float_test "print_small_structs from print_long_arg_list"] && \
![gdb_skip_stdio_test "print_small_structs from print_long_arg_list"] } {
- # On Solaris, some of the args are passed by ref, others by value,
- # and GDB gets confused and says "Invalid cast" because it thinks
- # it has to cast the structure into a pointer to structure. A real
- # GDB bug, probably for all Sparc configs, but obscure. -sts 1999-08-17.
- setup_xfail "sparc*-*-solaris*"
+
+ # On 32-bit SPARC, some of the args are passed by ref, others by
+ # value, and GDB gets confused and says "Invalid cast" because it
+ # thinks it has to cast the structure into a pointer to structure.
+ if { [test_debug_format "stabs"] } then {
+ setup_kfail "gdb/1539" "sparc-*-*"
+ }
+
send_gdb "print print_small_structs(struct1, struct2, struct3, struct4, flags, flags_combo, three_char, five_char, int_char_combo, d1, d2, d3, f1, f2, f3)\n"
gdb_expect_list "print print_small_structs from print_long_arg_list" ".*$gdb_prompt $" {
"\[\t\r\n \]+alpha"
diff --git a/gdb/testsuite/gdb.base/callfuncs.c b/gdb/testsuite/gdb.base/callfuncs.c
index 9917e78..a52b2b1 100644
--- a/gdb/testsuite/gdb.base/callfuncs.c
+++ b/gdb/testsuite/gdb.base/callfuncs.c
@@ -1,3 +1,25 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 1993, 1994, 1995, 1998, 1999, 2000, 2001, 2004
+ 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 */
+
/* Support program for testing gdb's ability to call functions
in the inferior, pass appropriate arguments to those functions,
and get the returned result. */
@@ -357,7 +379,7 @@ int a, b;
/* Gotta have a main to be able to generate a linked, runnable
executable, and also provide a useful place to set a breakpoint. */
-extern void * malloc() ;
+
int main ()
{
#ifdef usestubs
diff --git a/gdb/testsuite/gdb.base/charset.c b/gdb/testsuite/gdb.base/charset.c
index ece684a..a7b7123 100644
--- a/gdb/testsuite/gdb.base/charset.c
+++ b/gdb/testsuite/gdb.base/charset.c
@@ -2,6 +2,7 @@
Jim Blandy <jimb@cygnus.com> --- December 2001 */
#include <stdio.h>
+#include <string.h>
/* X_string is a null-terminated string in the X charset whose
diff --git a/gdb/testsuite/gdb.base/completion.exp b/gdb/testsuite/gdb.base/completion.exp
index 9f5435d..1698a30 100644
--- a/gdb/testsuite/gdb.base/completion.exp
+++ b/gdb/testsuite/gdb.base/completion.exp
@@ -1,4 +1,4 @@
-# Copyright 1998, 1999, 2002, 2003 Free Software Foundation, Inc.
+# Copyright 1998, 1999, 2002, 2003, 2004 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
@@ -657,6 +657,15 @@ gdb_test "cd ${fullsrcdir}" \
"Working directory [string_to_regexp ${fullsrcdir}].*" \
"cd to \${srcdir}"
+send_gdb "complete file ./gdb.base/compl\n"
+sleep 1
+gdb_expect {
+ -re "file ./gdb.base/completion\\.exp.*$gdb_prompt $"
+ { pass "complete-command 'file ./gdb.base/compl'"}
+ -re ".*$gdb_prompt $" { fail "complete-command 'file ./gdb.base/compl'" }
+ timeout { fail "(timeout) complete-command 'file ./gdb.base/compl'" }
+}
+
send_gdb "file ./gdb.base/complet\t"
sleep 1
gdb_expect {
@@ -664,7 +673,6 @@ gdb_expect {
{ send_gdb "\n"
gdb_expect {
-re "\r\nA program is being debugged already\\. Kill it\\? \\(y or n\\) $"
-\
{ send_gdb "n\n"
gdb_expect {
-re "\r\nProgram not killed\\.\r\n$gdb_prompt $"\
@@ -710,10 +718,10 @@ gdb_expect {
send_gdb "set follow-fork-mode \t\t"
sleep 1
gdb_expect {
- -re "ask.*child.*parent.*$gdb_prompt set follow-fork-mode $"\
+ -re "child.*parent.*$gdb_prompt set follow-fork-mode $"\
{ send_gdb "\n"
gdb_expect {
- -re "Requires an argument.*ask.*child.*parent.*$gdb_prompt $"\
+ -re "Requires an argument.*child.*parent.*$gdb_prompt $"\
{ pass "complete 'set follow-fork-mode'"}
-re "Ambiguous item \"\"\\..*$gdb_prompt $"\
{ pass "complete 'set follow-fork-mode'"}
diff --git a/gdb/testsuite/gdb.base/dump.c b/gdb/testsuite/gdb.base/dump.c
index 784edf6..bc68778 100644
--- a/gdb/testsuite/gdb.base/dump.c
+++ b/gdb/testsuite/gdb.base/dump.c
@@ -1,3 +1,5 @@
+#include <string.h>
+
#define ARRSIZE 32
int intarray[ARRSIZE], intarray2[ARRSIZE];
diff --git a/gdb/testsuite/gdb.base/dump.exp b/gdb/testsuite/gdb.base/dump.exp
index 0bc4472..e09a60c 100644
--- a/gdb/testsuite/gdb.base/dump.exp
+++ b/gdb/testsuite/gdb.base/dump.exp
@@ -1,4 +1,4 @@
-# Copyright 2002 Free Software Foundation, Inc.
+# Copyright 2002, 2004 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
@@ -264,7 +264,7 @@ gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
# Run to main.
-if { ! [ runto main ] } then {
+if { ! [ runto_main ] } then {
gdb_suppress_entire_file "Program failed to run, so remaining tests in this file will automatically fail."
}
diff --git a/gdb/testsuite/gdb.base/fileio.c b/gdb/testsuite/gdb.base/fileio.c
index 4fda0fd..c9ef715 100644
--- a/gdb/testsuite/gdb.base/fileio.c
+++ b/gdb/testsuite/gdb.base/fileio.c
@@ -75,7 +75,7 @@ test_open ()
/* Test opening */
errno = 0;
- ret = open (FILENAME, O_CREAT | O_TRUNC | O_RDONLY, S_IWUSR | S_IRUSR);
+ ret = open (FILENAME, O_CREAT | O_TRUNC | O_RDWR, S_IWUSR | S_IRUSR);
printf ("open 1: ret = %d, errno = %d %s\n", ret, errno,
ret >= 0 ? "OK" : "");
if (ret >= 0)
diff --git a/gdb/testsuite/gdb.base/fileio.exp b/gdb/testsuite/gdb.base/fileio.exp
index 80dc618..2a717bf 100644
--- a/gdb/testsuite/gdb.base/fileio.exp
+++ b/gdb/testsuite/gdb.base/fileio.exp
@@ -218,10 +218,10 @@ gdb_test continue \
send_gdb "tbreak 388\n" ; gdb_expect -re "$gdb_prompt $"
set test "Renaming a directory to a non-empty directory returns ENOTEMPTY or EEXIST"
gdb_test_multiple continue "${test}" {
- -re "Continuing\\..*rename 3:.*(ENOTEMPTY|EEXIST).*test_rename \\(\\) at.*$srcfile:388.*" {
+ -re "Continuing\\..*rename 3:.*(ENOTEMPTY|EEXIST).*test_rename \\(\\) at.*$srcfile:388.*$gdb_prompt $" {
pass "${test}"
}
- -re "Continuing\\..*rename 3:.*EBUSY.*test_rename \\(\\) at.*$srcfile:388.*" {
+ -re "Continuing\\..*rename 3:.*EBUSY.*test_rename \\(\\) at.*$srcfile:388.*$gdb_prompt $" {
# At least version <= 2.6/2004-01-08 of the Linux Kernel gets
# this wrong (reporting EBUSY) when the file system is NFS
# mounted.
diff --git a/gdb/testsuite/gdb.base/finish.exp b/gdb/testsuite/gdb.base/finish.exp
index 064f26e..8818233 100644
--- a/gdb/testsuite/gdb.base/finish.exp
+++ b/gdb/testsuite/gdb.base/finish.exp
@@ -1,4 +1,4 @@
-# Copyright 2000 Free Software Foundation, Inc.
+# Copyright 2000, 2004 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
@@ -100,7 +100,7 @@ proc finish_void { } {
proc finish_tests { } {
global gdb_prompt
- if { ! [ runto main ] } then {
+ if { ! [ runto_main ] } then {
gdb_suppress_entire_file "Run to main failed, so all tests in this file will automatically fail."
}
diff --git a/gdb/testsuite/gdb.base/gcore.exp b/gdb/testsuite/gdb.base/gcore.exp
index 0576638..33fcba4 100644
--- a/gdb/testsuite/gdb.base/gcore.exp
+++ b/gdb/testsuite/gdb.base/gcore.exp
@@ -1,4 +1,4 @@
-# Copyright 2002, 2003 Free Software Foundation, Inc.
+# Copyright 2002, 2003, 2004 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
@@ -61,7 +61,7 @@ gdb_expect {
}
}
-if { ! [ runto main ] } then {
+if { ! [ runto_main ] } then {
gdb_suppress_entire_file "Run to main failed, so all tests in this file will automatically fail."
}
diff --git a/gdb/testsuite/gdb.base/gdb1476.exp b/gdb/testsuite/gdb.base/gdb1476.exp
index 2ac8074..b88b2de 100644
--- a/gdb/testsuite/gdb.base/gdb1476.exp
+++ b/gdb/testsuite/gdb.base/gdb1476.exp
@@ -56,6 +56,7 @@ if ![runto_main] then {
send_gdb "x 0\n"
gdb_expect {
+ -re "0x0:.*Cannot access memory at address 0x0.*$gdb_prompt $" { }
-re "0x0:.*Error accessing memory address 0x0.*$gdb_prompt $" { }
-re ".*$gdb_prompt $" {
untested "Memory at address 0 is possibly executable"
@@ -68,4 +69,4 @@ gdb_test "continue" "Program received signal SIGSEGV.*" \
gdb_test "backtrace 10" \
"#0\[ \t\]*0x0* in .*\r\n#1\[ \t\]*$hex in x.*\r\n#2\[ \t\]*$hex in main.*" \
- "backtrace from null pointer call" \ No newline at end of file
+ "backtrace from null pointer call"
diff --git a/gdb/testsuite/gdb.base/huge.c b/gdb/testsuite/gdb.base/huge.c
index 419b92c..446bb18 100644
--- a/gdb/testsuite/gdb.base/huge.c
+++ b/gdb/testsuite/gdb.base/huge.c
@@ -2,6 +2,8 @@
* Test GDB's ability to read a very large data object from target memory.
*/
+#include <string.h>
+
/* A value that will produce a target data object large enough to
crash GDB. 0x200000 is big enough on GNU/Linux, other systems may
need a larger number. */
diff --git a/gdb/testsuite/gdb.base/huge.exp b/gdb/testsuite/gdb.base/huge.exp
index fa50d01..733ddee 100644
--- a/gdb/testsuite/gdb.base/huge.exp
+++ b/gdb/testsuite/gdb.base/huge.exp
@@ -1,4 +1,4 @@
-# Copyright 2001 Free Software Foundation, Inc.
+# Copyright 2001, 2004 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
@@ -49,7 +49,7 @@ gdb_load ${binfile}
set timeout 30
-if { ! [ runto main ] } then {
+if { ! [ runto_main ] } then {
gdb_suppress_entire_file "Run to main failed, so all tests in this file will automatically fail."
}
diff --git a/gdb/testsuite/gdb.base/info-proc.exp b/gdb/testsuite/gdb.base/info-proc.exp
index d0da68f..fc68601 100644
--- a/gdb/testsuite/gdb.base/info-proc.exp
+++ b/gdb/testsuite/gdb.base/info-proc.exp
@@ -1,4 +1,4 @@
-# Copyright 2002, 2003 Free Software Foundation, Inc.
+# Copyright 2002, 2003, 2004 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
@@ -74,7 +74,7 @@ gdb_expect {
gdb_test "info proc" "No current process.*" "info proc without a process"
-if { ! [ runto main ] } then {
+if { ! [ runto_main ] } then {
gdb_suppress_entire_file "Run to main failed, so all tests in this file will automatically fail."
}
diff --git a/gdb/testsuite/gdb.base/langs.exp b/gdb/testsuite/gdb.base/langs.exp
index 8006bbf..a81df66 100644
--- a/gdb/testsuite/gdb.base/langs.exp
+++ b/gdb/testsuite/gdb.base/langs.exp
@@ -65,8 +65,15 @@ gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load $binfile
-gdb_test "b langs0" "Function \"langs0\" not defined\.|Breakpoint .* (deferred).*" \
- "break on nonexistent function in langs.exp"
+gdb_test_multiple "b langs0" "break on nonexistent function in langs.exp" {
+ -re "Function \"langs0\" not defined\..*Make breakpoint pending on future shared library load.*y or n. $" {
+
+ gdb_test "n" "" "break on nonexistent function in langs.exp"
+ }
+ -re "Breakpoint .* (deferred).*$gdb_prompt $" {
+ pass "break on nonexistent function in langs.exp"
+ }
+}
if {$hp_aCC_compiler} {
set isfixed 1
diff --git a/gdb/testsuite/gdb.base/maint.exp b/gdb/testsuite/gdb.base/maint.exp
index 3e98c00..53d5825 100644
--- a/gdb/testsuite/gdb.base/maint.exp
+++ b/gdb/testsuite/gdb.base/maint.exp
@@ -191,6 +191,11 @@ gdb_expect {
send_gdb "maint print statistics\n"
gdb_expect {
-re "Statistics for.*break.*Number of \"minimal\" symbols read.*Number of \"partial\" symbols read.*Number of \"types\" defined.*Number of psym tables \\(not yet expanded\\).*Number of symbol tables.*Number of symbol tables with line tables.*Number of symbol tables with blockvectors.*Total memory used for psymbol obstack.*Total memory used for psymbol cache.*Total memory used for symbol obstack.*Total memory used for type obstack.*$gdb_prompt $"\
+ {
+ # Old output for gdb 6.0 and earlier
+ pass "maint print statistics"
+ }
+ -re "Statistics for.*break.*Number of \"minimal\" symbols read.*Number of \"partial\" symbols read.*Number of \"types\" defined.*Number of psym tables \\(not yet expanded\\).*Number of symbol tables.*Number of symbol tables with line tables.*Number of symbol tables with blockvectors.*Total memory used for objfile obstack.*Total memory used for psymbol cache.*Total memory used for macro cache.*$gdb_prompt $"\
{ pass "maint print statistics" }
-re ".*$gdb_prompt $" { fail "maint print statistics" }
timeout { fail "(timeout) maint print statistics" }
diff --git a/gdb/testsuite/gdb.base/pending.exp b/gdb/testsuite/gdb.base/pending.exp
index 2cef30a..0ecdf67 100644
--- a/gdb/testsuite/gdb.base/pending.exp
+++ b/gdb/testsuite/gdb.base/pending.exp
@@ -151,7 +151,7 @@ gdb_test_multiple "break pendfunc2" "Don't set pending breakpoint" {
# Add condition to pending breakpoint
#
-gdb_test "condition 1 k == 1" ""
+gdb_test "condition 1 k == 1\n" ""
gdb_test "info break" \
"Num Type\[ \]+Disp Enb Address\[ \]+What.*
@@ -164,7 +164,7 @@ gdb_test "info break" \
# Disable pending breakpoint
#
-gdb_test "disable 1" ""
+gdb_test "disable 1\n" ""
gdb_test "info break" \
"Num Type\[ \]+Disp Enb Address\[ \]+What.*
diff --git a/gdb/testsuite/gdb.base/return2.exp b/gdb/testsuite/gdb.base/return2.exp
index c87d9e4..050ccf9 100644
--- a/gdb/testsuite/gdb.base/return2.exp
+++ b/gdb/testsuite/gdb.base/return2.exp
@@ -1,4 +1,4 @@
-# Copyright 2000, 2001 Free Software Foundation, Inc.
+# Copyright 2000, 2001, 2004 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
@@ -100,7 +100,7 @@ proc return_void { } {
proc return2_tests { } {
global gdb_prompt
- if { ! [ runto main ] } then {
+ if { ! [ runto_main ] } then {
gdb_suppress_entire_file "Run to main failed, so all tests in this file will automatically fail."
}
diff --git a/gdb/testsuite/gdb.base/sepdebug.exp b/gdb/testsuite/gdb.base/sepdebug.exp
index 7a2a551..1028dab 100644
--- a/gdb/testsuite/gdb.base/sepdebug.exp
+++ b/gdb/testsuite/gdb.base/sepdebug.exp
@@ -72,17 +72,22 @@ if { [test_debug_format "stabs"] } then {
# (see dejagnu/lib/framework.exp)
unsupported "no separate debug info handling with stabs"
return -1
+} elseif { [test_debug_format "unknown"] } then {
+ # gdb doesn't know what the debug format is. We are out of luck here.
+ unsupported "unknown debugging format"
+ return -1
}
gdb_exit
# Note: the procedure gdb_gnu_strip_debug will produce an executable called
# ${binfile}, which is just like the executable ($binfile) but without
# the debuginfo. Instead $binfile has a .gnudebuglink section which contains
-# the name of a idebuginfo only file. This file will be stored in the
+# the name of a debuginfo only file. This file will be stored in the
# gdb.base/.debug subdirectory.
if [gdb_gnu_strip_debug $binfile] {
- unsupported "no separate debug info handling"
+ # check that you have a recent version of strip and objcopy installed
+ unsupported "cannot produce separate debug info files"
return -1
}
diff --git a/gdb/testsuite/gdb.base/setvar.exp b/gdb/testsuite/gdb.base/setvar.exp
index e14ed5d..5f3b02c 100644
--- a/gdb/testsuite/gdb.base/setvar.exp
+++ b/gdb/testsuite/gdb.base/setvar.exp
@@ -1,4 +1,5 @@
-# Copyright 1997, 1999, 2000 Free Software Foundation, Inc.
+# Copyright 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2004
+# 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
@@ -329,12 +330,8 @@ gdb_test "print *(v_signed_short_pointer+1)" ".\[0-9\]*.*=.*-456"
gdb_test "set v_unsigned_short_pointer=v_unsigned_short_array" ""
gdb_test "set variable *(v_unsigned_short_pointer)=123" ""
gdb_test "set variable *(v_unsigned_short_pointer+1)=-456" ""
-# DTS 10060CLLbs - bad type info from cc
-if {$hp_cc_compiler} {setup_xfail hppa*-*-*11* 10060CLLbs}
gdb_test "print v_unsigned_short_array" ".\[0-9\]* =.*\\{123,.*65080\\}" \
"set variable unsigned short pointer"
-# DTS 10060CLLbs - bad type info from cc
-if {$hp_cc_compiler} {setup_xfail hppa*-*-*11* 10060CLLbs}
gdb_test "print *(v_unsigned_short_pointer+1)" ".\[0-9\]* = 65080"
#
# test "set variable" for type "int *"
diff --git a/gdb/testsuite/gdb.base/shlib-call.exp b/gdb/testsuite/gdb.base/shlib-call.exp
index 8fe8b22..4205253 100644
--- a/gdb/testsuite/gdb.base/shlib-call.exp
+++ b/gdb/testsuite/gdb.base/shlib-call.exp
@@ -1,4 +1,4 @@
-# Copyright 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+# Copyright 1997, 1998, 1999, 2000, 2004 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
@@ -291,7 +291,7 @@ send_gdb "set width 0\n" ; gdb_expect -re "$gdb_prompt $"
# PR's 16495, 18213
# test that we can re-set breakpoints in shared libraries
-gdb_test "break shr1" "Breakpoint 1.*" "set bp in shared library"
+gdb_breakpoint "shr1"
# FIXME: should not send "run" explicitly. Non-portable.
diff --git a/gdb/testsuite/gdb.cp/derivation.exp b/gdb/testsuite/gdb.cp/derivation.exp
index 5f75899..6ef6dbe 100644
--- a/gdb/testsuite/gdb.cp/derivation.exp
+++ b/gdb/testsuite/gdb.cp/derivation.exp
@@ -111,14 +111,16 @@ gdb_test_multiple "ptype d_instance" "ptype d_instance" {
pass "ptype d_instance"
}
-re "type = $XX_class${ws}$re_fields${ws}$re_methods${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
- # TODO: this is a gcc bug
- # kfail "gdb/1498" "ptype d_instance"
- pass "ptype d_instance"
+ # This is a gcc bug, gcc/13539, gdb/1498.
+ # Fixed in gcc HEAD 2004-01-13
+ setup_xfail "*-*-*" "gcc/13539"
+ fail "ptype d_instance"
}
-re "type = $XX_class${ws}$re_fields${ws}$re_all_methods$nl\}$nl$gdb_prompt $" {
- # TODO: this is a gcc bug.
- # kfail "gdb/1498" "ptype d_instance"
- pass "ptype d_instance"
+ # This is a gcc bug, gcc/13539, gdb/1498.
+ # Fixed in gcc HEAD 2004-01-13
+ setup_xfail "*-*-*" "gcc/13539"
+ fail "ptype d_instance"
}
}
@@ -145,14 +147,16 @@ gdb_test_multiple "ptype e_instance" "ptype e_instance" {
pass "ptype e_instance"
}
-re "type = $XX_class${ws}$re_fields${ws}$re_methods${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
- # TODO: this is a gcc bug.
- # kfail "gdb/1498" "ptype e_instance"
- pass "ptype e_instance"
+ # This is a gcc bug, gcc/13539, gdb/1498.
+ # Fixed in gcc HEAD 2004-01-13
+ setup_xfail "*-*-*" "gcc/13539"
+ fail "ptype e_instance"
}
-re "type = $XX_class${ws}$re_fields${ws}$re_all_methods$nl\}$nl$gdb_prompt $" {
- # TODO: this is a gcc bug.
- # kfail "gdb/1498" "ptype e_instance"
- pass "ptype e_instance"
+ # This is a gcc bug, gcc/13539, gdb/1498.
+ # Fixed in gcc HEAD 2004-01-13
+ setup_xfail "*-*-*" "gcc/13539"
+ fail "ptype e_instance"
}
}
diff --git a/gdb/testsuite/gdb.cp/inherit.exp b/gdb/testsuite/gdb.cp/inherit.exp
index 993bfb1..7374c2d 100644
--- a/gdb/testsuite/gdb.cp/inherit.exp
+++ b/gdb/testsuite/gdb.cp/inherit.exp
@@ -1,5 +1,5 @@
-# Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003
-# Free Software Foundation, Inc.
+# Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003,
+# 2004 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
@@ -19,947 +19,1007 @@
# bug-gdb@prep.ai.mit.edu
# This file was written by Fred Fish. (fnf@cygnus.com)
+# And rewritten by Michael Chastain. (mec.gnu@mindspring.com)
-set ws "\[\r\n\t \]+"
-set nl "\[\r\n\]+"
-
-# The format of a g++ virtual base pointer.
-set vbptr "(_vb\[$.\]|__vb_)\[0-9\]?"
+set ws "\[\r\n\t \]+"
+set nl "\[\r\n\]+"
+set vhn "\\$\[0-9\]+"
if $tracelevel then {
- strace $tracelevel
+ strace $tracelevel
}
if { [skip_cplus_tests] } { continue }
-# Note - create separate "inherit" executable from misc.cc
-
set testfile "inherit"
set srcfile misc.cc
set binfile ${objdir}/${subdir}/${testfile}
-
-# Create and source the file that provides information about the compiler
-# used to compile the test case.
-
-if [get_compiler_info ${binfile} "c++"] {
- 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 automatically fail."
}
-#
-# Single inheritance, print individual members.
-#
-
-proc test_print_si_members {} {
- # Print all members of g_A using fully qualified form.
-
- gdb_test "print g_A.A::a" ".* = 1" "print g_A.A::a"
-
- gdb_test "print g_A.A::x" ".* = 2" "print g_A.A::x"
-
- # Print members of g_A using nonambiguous compact form.
-
- gdb_test "print g_A.a" ".* = 1" "print g_A.a"
-
- gdb_test "print g_A.x" ".* = 2" "print g_A.x"
-
- # Print all members of g_B using fully qualified form.
-
- gdb_test "print g_B.A::a" ".* = 3" "print g_B.A::a"
-
- gdb_test "print g_B.A::x" ".* = 4" "print g_B.A::x"
-
- gdb_test "print g_B.B::b" ".* = 5" "print g_B.B::b"
-
- gdb_test "print g_B.B::x" ".* = 6" "print g_B.B::x"
-
- # Print members of g_B using nonambiguous compact form.
-
- gdb_test "print g_B.a" ".* = 3" "print g_B.a"
-
- gdb_test "print g_B.b" ".* = 5" "print g_B.b"
-
- gdb_test "print g_B.x" ".* = 6" "print g_B.x"
-
- # Print all members of g_C using fully qualified form.
-
- gdb_test "print g_C.A::a" ".* = 7" "print g_C.A::a"
-
- gdb_test "print g_C.A::x" ".* = 8" "print g_C.A::x"
-
- gdb_test "print g_C.C::c" ".* = 9" "print g_C.C::c"
-
- gdb_test "print g_C.C::x" ".* = 10" "print g_C.C::x"
-
- # Print members of g_C using nonambiguous compact form.
-
- gdb_test "print g_C.a" ".* = 7" "print g_C.a"
-
- gdb_test "print g_C.c" ".* = 9" "print g_C.c"
-
- gdb_test "print g_C.x" ".* = 10" "print g_C.x"
-}
-
-#
# Single inheritance, print type definitions.
-#
-proc test_ptype_si {} {
+proc test_ptype_si { } {
global gdb_prompt
global ws
global nl
- global hp_aCC_compiler
# Print class A as a type.
- send_gdb "ptype A\n"
- gdb_expect {
- -re "type = class A \{$nl.*\[ \]*int a;$nl\[ \]*int x;$nl.*\[ \]*\}$nl$gdb_prompt $" {
- pass "ptype A (FIXME)"
+ set re_class "class A \{${ws}public:"
+ set re_fields "int a;${ws}int x;"
+ set re_synth_gcc_23 "A & operator=\\(A const ?&\\);${ws}A\\(A const ?&\\);${ws}A\\((void|)\\);"
+
+ set name "ptype A (FIXME)"
+ gdb_test_multiple "ptype A" $name {
+ -re "type = $re_class${ws}$re_fields$nl\}$nl$gdb_prompt $" {
+ pass $name
}
- -re "type = struct A \{$nl\[ \]*int a;$nl\[ \]*int x;$nl\[ \]*\}$nl$gdb_prompt $" {
- setup_xfail "*-*-*"
- fail "ptype A (FIXME)"
+ -re "type = $re_class${ws}$re_fields${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
+ pass $name
}
- -re ".*$gdb_prompt $" { fail "ptype A" }
- timeout { fail "ptype A (timeout)" ; return }
}
# Print class A as an explicit class.
- send_gdb "ptype class A\n"
- gdb_expect {
- -re "type = class A \{$nl.*\[ \]*int a;$nl\[ \]*int x;$nl.*\[ \]*\}$nl$gdb_prompt $" {
- pass "ptype class A (FIXME)"
+ set name "ptype class A (FIXME)"
+ gdb_test_multiple "ptype class A" $name {
+ -re "type = $re_class${ws}$re_fields$nl\}$nl$gdb_prompt $" {
+ pass $name
}
- -re "type = struct A \{$nl\[ \]*int a;$nl\[ \]*int x;$nl\[ \]*\}$nl$gdb_prompt $" {
- if {!$hp_aCC_compiler} {setup_xfail "*-*-*"}
- fail "ptype class A (FIXME)"
+ -re "type = $re_class${ws}$re_fields${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
+ pass $name
}
- -re ".*$gdb_prompt $" { fail "ptype class A" }
- timeout { fail "ptype class A (timeout)" ; return }
}
# Print type of an object of type A.
- send_gdb "ptype g_A\n"
- gdb_expect {
- -re "type = class A \{$nl.*\[ \]*int a;$nl\[ \]*int x;$nl.*\[ \]*\}$nl$gdb_prompt $" {
- pass "ptype g_A (FIXME)"
+ set name "ptype g_A (FIXME)"
+ gdb_test_multiple "ptype g_A" $name {
+ -re "type = $re_class${ws}$re_fields$nl\}$nl$gdb_prompt $" {
+ pass $name
}
- -re "type = struct A \{$nl\[ \]*int a;$nl\[ \]*int x;$nl\[ \]*\}$nl$gdb_prompt $" {
- if {!$hp_aCC_compiler} {setup_xfail "*-*-*"}
- fail "ptype g_A (FIXME)"
+ -re "type = $re_class${ws}$re_fields${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
+ pass $name
}
- -re ".*$gdb_prompt $" { fail "ptype g_A" }
- timeout { fail "ptype g_A (timeout)" ; return }
}
# Print class B as a type.
- gdb_test "ptype B" "type = class B : public A \{$nl\[ \]*public:$nl\[ \]*int b;$nl\[ \]*int x;$nl.*\}" "ptype B"
+ set re_class "class B : public A \{${ws}public:"
+ set re_fields "int b;${ws}int x;"
+ set re_synth_gcc_23 "B & operator=\\(B const ?&\\);${ws}B\\(B const ?&\\);${ws}B\\((void|)\\);"
+
+ set name "ptype B"
+ gdb_test_multiple "ptype B" $name {
+ -re "type = $re_class${ws}$re_fields$nl\}$nl$gdb_prompt $" {
+ pass $name
+ }
+ -re "type = $re_class${ws}$re_fields${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
+ pass $name
+ }
+ }
# Print class B as an explicit class.
- gdb_test "ptype class B" "type = class B : public A \{$nl\[ \]*public:$nl\[ \]*int b;$nl\[ \]*int x;$nl.*\}" "ptype class B"
+ set name "ptype class B"
+ gdb_test_multiple "ptype class B" $name {
+ -re "type = $re_class${ws}$re_fields$nl\}$nl$gdb_prompt $" {
+ pass $name
+ }
+ -re "type = $re_class${ws}$re_fields${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
+ pass $name
+ }
+ }
# Print type of an object of type B.
- gdb_test "ptype g_B" "type = class B : public A \{$nl\[ \]*public:$nl\[ \]*int b;$nl\[ \]*int x;$nl.*\}" "ptype g_B"
+ set name "ptype g_B"
+ gdb_test_multiple "ptype g_B" $name {
+ -re "type = $re_class${ws}$re_fields$nl\}$nl$gdb_prompt $" {
+ pass $name
+ }
+ -re "type = $re_class${ws}$re_fields${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
+ pass $name
+ }
+ }
# Print class C as a type.
- gdb_test "ptype C" "type = class C : public A \{$nl\[ \]*public:$nl\[ \]*int c;$nl\[ \]*int x;$nl.*\}" "ptype C"
+ set re_class "class C : public A \{${ws}public:"
+ set re_fields "int c;${ws}int x;"
+ set re_synth_gcc_23 "C & operator=\\(C const ?&\\);${ws}C\\(C const ?&\\);${ws}C\\((void|)\\);"
+
+ set name "ptype C"
+ gdb_test_multiple "ptype C" $name {
+ -re "type = $re_class${ws}$re_fields$nl\}$nl$gdb_prompt $" {
+ pass $name
+ }
+ -re "type = $re_class${ws}$re_fields${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
+ pass $name
+ }
+ }
# Print class C as an explicit class.
- gdb_test "ptype class C" "type = class C : public A \{$nl\[ \]*public:$nl\[ \]*int c;$nl\[ \]*int x;$nl.*\}" "ptype class C"
+ set name "ptype class C"
+ gdb_test_multiple "ptype class C" $name {
+ -re "type = $re_class${ws}$re_fields$nl\}$nl$gdb_prompt $" {
+ pass $name
+ }
+ -re "type = $re_class${ws}$re_fields${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
+ pass $name
+ }
+ }
# Print type of an object of type g_C.
- gdb_test "ptype g_C" "type = class C : public A \{$nl\[ \]*public:$nl\[ \]*int c;$nl\[ \]*int x;$nl.*\}" "ptype g_C"
-
- # gcc cygnus-2.3.3 (Q1) has this bug, but it was fixed as of
- # cygnus-2.3.3-930417. PR 2819.
- send_gdb "ptype tagless_struct\n"
- gdb_expect {
- -re "type = class \{${ws}public:${ws}int one;${ws}int two;${ws}tagless_struct & operator=\\(tagless_struct (const ?)?&\\);${ws}tagless_struct\\(tagless_struct (const ?)?&\\);${ws}tagless_struct\\(\\);${ws}\}$nl$gdb_prompt $" {
- pass "ptype tagless struct"
+ set name "ptype g_C"
+ gdb_test_multiple "ptype g_C" $name {
+ -re "type = $re_class${ws}$re_fields$nl\}$nl$gdb_prompt $" {
+ pass $name
}
- -re "type = class \{${ws}public:${ws}int one;${ws}int two;;${ws}\}$nl$gdb_prompt $" {
- pass "ptype tagless struct"
+ -re "type = $re_class${ws}$re_fields${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
+ pass $name
+ }
+ }
+
+ # Print a structure with no tag.
+
+ set re_tag "tagless_struct"
+ set XX_tag "\\._1"
+ set re_class "(class $re_tag \{${ws}public:|class \{${ws}public:|struct $re_tag \{|struct \{)"
+ set XX_class "(class $XX_tag \{${ws}public:|struct $XX_tag \{)"
+ set re_fields "int one;${ws}int two;"
+ set re_synth_gcc_23 "$re_tag & operator=\\($re_tag const ?&\\);${ws}$re_tag\\($re_tag const ?&\\);${ws}$re_tag\\((void|)\\);"
+ set XX_synth_gcc_23 "($re_tag|$XX_tag) & operator=\\($XX_tag const ?&\\);${ws}$XX_tag\\($XX_tag const ?&\\);${ws}$XX_tag\\((void|)\\);"
+
+ set name "ptype tagless struct"
+ gdb_test_multiple "ptype tagless_struct" $name {
+ -re "type = $XX_class${ws}$re_fields$nl\}$nl$gdb_prompt $" {
+ # gcc 2.95.3 -gdwarf-2
+ pass "$name (obsolete gcc or gdb)"
}
- -re "type = (struct|class).*\{.*int one;.*int two;.*\}$nl$gdb_prompt $" {
- pass "ptype tagless struct (obsolete gcc or gdb)"
+ -re "type = $re_class${ws}$re_fields${ws}$XX_synth_gcc_23$nl\}$nl$gdb_prompt $" {
+ # gcc 2.95.3 -gstabs+
+ pass "$name (obsolete gcc or gdb)"
}
- -re ".*$gdb_prompt $" {
- fail "ptype tagless struct"
+ -re "type = $re_class${ws}$re_fields$nl\}$nl$gdb_prompt $" {
+ # gcc 3.3.2 -gdwarf-2
+ # gcc HEAD 2004-01-21 -gdwarf-2
+ pass "$name (obsolete gcc or gdb)"
}
- timeout {
- fail "ptype tagless struct (timeout)"
+ -re "type = $re_class${ws}$re_fields${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
+ # gcc 3.3.2 -gstabs+
+ # gcc HEAD 2004-01-21 -gstabs+
+ pass "$name"
}
}
- send_gdb "ptype v_tagless\n"
- gdb_expect {
- -re "type = class \{${ws}public:${ws}int one;${ws}int two;${ws}tagless_struct & operator=\\(tagless_struct (const ?)?&\\);${ws}tagless_struct\\(tagless_struct (const ?)?&\\);${ws}tagless_struct\\(\\);${ws}\}$nl$gdb_prompt $" {
- pass "ptype variable of type tagless struct"
- }
- -re "type = class \{${ws}public:${ws}int one;${ws}int two;;${ws}\}$nl$gdb_prompt $" {
- pass "ptype tagless struct"
+ set name "ptype variable of type tagless struct"
+ gdb_test_multiple "ptype v_tagless" $name {
+ -re "type = $XX_class${ws}$re_fields$nl\}$nl$gdb_prompt $" {
+ # gcc 2.95.3 -gdwarf-2
+ pass "$name (obsolete gcc or gdb)"
}
- -re "type = (struct|class).*\{.*int one;.*int two;.*\}$nl$gdb_prompt $" {
- pass "ptype variable of type tagless struct (obsolete gcc or gdb)"
+ -re "type = $re_class${ws}$re_fields${ws}$XX_synth_gcc_23$nl\}$nl$gdb_prompt $" {
+ # gcc 2.95.3 -gstabs+
+ pass "$name (obsolete gcc or gdb)"
}
- -re ".*$gdb_prompt $" {
- fail "ptype variable of type tagless struct"
+ -re "type = $re_class${ws}$re_fields$nl\}$nl$gdb_prompt $" {
+ # gcc 3.3.2 -gdwarf-2
+ # gcc HEAD 2004-01-21 -gdwarf-2
+ pass "$name (obsolete gcc or gdb)"
}
- timeout {
- fail "ptype variable of type tagless struct (timeout)"
+ -re "type = $re_class${ws}$re_fields${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
+ # gcc 3.3.2 -gstabs+
+ # gcc HEAD 2004-01-21 -gstabs+
+ pass "$name"
}
}
}
-#
-# Single inheritance, print complete classes.
-#
-
-proc test_print_si_classes {} {
- # Print all members of g_A.
-
- gdb_test "print g_A" ".* = \{a = 1, x = 2\}" "print g_A"
-
- # Print all members of g_B.
-
- gdb_test "print g_B" ".* = \{\<(class |)A\> = \{a = 3, x = 4\}, b = 5, x = 6\}" "print g_B"
-
- # Print all members of g_C.
-
- gdb_test "print g_C" ".* = \{\<(class |)A\> = \{a = 7, x = 8\}, c = 9, x = 10\}" "print g_C"
-}
-
-#
-# Single inheritance, print anonymous unions.
-# GDB versions prior to 4.14 entered an infinite loop when printing
-# the type of a class containing an anonymous union, and they were also
-# incapable of printing the member of an anonymous union.
-# We test the printing of the member first, and perform the other tests
-# only if the test succeeds, to avoid the infinite loop.
-#
+# Multiple inheritance, print type definitions.
-proc test_print_anon_union {} {
+proc test_ptype_mi { } {
global gdb_prompt
global ws
global nl
- gdb_test "print g_anon_union.a" ".* = 2" "print anonymous union member"
- send_gdb "print g_anon_union\n"
- gdb_expect {
- -re ".* = \{one = 1, ( = |)\{a = 2, b = 2\}\}$nl$gdb_prompt $" {
- pass "print variable of type anonymous union"
+ set re_class "class D : public B, public C \{${ws}public:"
+ set re_fields "int d;${ws}int x;"
+ set re_synth_gcc_23 "D & operator=\\(D const ?&\\);${ws}D\\(D const ?&\\);${ws}D\\((void|)\\);"
+
+ # ptype D: type, class, object.
+
+ set name "ptype D"
+ gdb_test_multiple "ptype D" $name {
+ -re "type = $re_class${ws}$re_fields$nl\}$nl$gdb_prompt $" {
+ pass $name
}
- -re ".* = .*\{one = 1, ( = |)\{a = 2, b = .*\}\}$nl$gdb_prompt $" {
- pass "print variable of type anonymous union (obsolete gcc or gdb)"
+ -re "type = $re_class${ws}$re_fields${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
+ pass $name
}
- -re ".*$nl$gdb_prompt $" {
- fail "print variable of type anonymous union"
+ }
+
+ set name "ptype class D"
+ gdb_test_multiple "ptype class D" $name {
+ -re "type = $re_class${ws}$re_fields$nl\}$nl$gdb_prompt $" {
+ pass $name
+ }
+ -re "type = $re_class${ws}$re_fields${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
+ pass $name
+ }
+ }
+
+ set name "ptype g_D"
+ gdb_test_multiple "ptype g_D" $name {
+ -re "type = $re_class${ws}$re_fields$nl\}$nl$gdb_prompt $" {
+ pass $name
}
- timeout {
- fail "print variableof type anonymous union (timeout)"
+ -re "type = $re_class${ws}$re_fields${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
+ pass $name
}
}
- send_gdb "ptype g_anon_union\n"
- gdb_expect {
- -re "type = class class_with_anon_union \{${ws}public:${ws}int one;${ws}union \{${ws}public:${ws}int a;${ws}long int b;${ws}union \{\.\.\.\} & operator=\\(union \{\.\.\.\} &\\);${ws}\\\$_0 \\(union \{\.\.\.\} &\\);${ws}\\\$_0 \\(\\);${ws}\};${ws}class_with_anon_union & operator=\\(class_with_anon_union const &\\);${ws}class_with_anon_union\\(class_with_anon_union const &\\);${ws}class_with_anon_union\\(void\\);${ws}\}$nl$gdb_prompt $" {
- pass "print type of anonymous union"
+
+ set re_class "class E : public D \{${ws}public:"
+ set re_fields "int e;${ws}int x;"
+ set re_synth_gcc_23 "E & operator=\\(E const ?&\\);${ws}E\\(E const ?&\\);${ws}E\\((void|)\\);"
+
+ # ptype E: type, class, object.
+
+ set name "ptype E"
+ gdb_test_multiple "ptype E" $name {
+ -re "type = $re_class${ws}$re_fields$nl\}$nl$gdb_prompt $" {
+ pass $name
}
- -re "type = class class_with_anon_union \{${ws}public:${ws}int one;${ws}union \{${ws}int a;${ws}long int b;${ws}\};${ws}class_with_anon_union & operator=\\(class_with_anon_union const ?&\\);${ws}class_with_anon_union\\(class_with_anon_union const ?&\\);${ws}class_with_anon_union\\((void|)\\);${ws}\}$nl$gdb_prompt $" {
- pass "print type of anonymous union"
+ -re "type = $re_class${ws}$re_fields${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
+ pass $name
}
- -re "type = class class_with_anon_union \{${ws}public:${ws}int one;${ws}union \{${ws}int a;${ws}long int b;${ws}\};${ws}\}$nl$gdb_prompt $" {
- pass "print type of anonymous union"
+ }
+
+ set name "ptype class E"
+ gdb_test_multiple "ptype class E" $name {
+ -re "type = $re_class${ws}$re_fields$nl\}$nl$gdb_prompt $" {
+ pass $name
}
- -re "type = (struct|class).*\{.*int one;.*union \{.*int a;.*(long|long int|int) b;.*\};.*\}$nl$gdb_prompt $" {
- pass "print type of anonymous union (obsolete gcc or gdb)"
+ -re "type = $re_class${ws}$re_fields${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
+ pass $name
}
- -re ".*$nl$gdb_prompt $" {
- fail "print type of anonymous union"
+ }
+
+ set name "ptype g_E"
+ gdb_test_multiple "ptype g_E" $name {
+ -re "type = $re_class${ws}$re_fields$nl\}$nl$gdb_prompt $" {
+ pass $name
}
- timeout {
- fail "print type of anonymous union (timeout)"
+ -re "type = $re_class${ws}$re_fields${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
+ pass $name
}
}
}
-#
-# Multiple inheritance, print individual members.
-#
+# Single virtual inheritance, print type definitions.
-proc test_print_mi_members {} {
+proc test_ptype_vi { } {
global gdb_prompt
+ global ws
global nl
- global hp_aCC_compiler
-
- # Print all members of g_A.
- gdb_test "print g_A.A::a" ".* = 1" "print g_A.A::a"
-
- gdb_test "print g_A.A::x" ".* = 2" "print g_A.A::x"
+ # ptype vA: type, class, object.
- # Print all members of g_B.
-
- gdb_test "print g_B.A::a" ".* = 3" "print g_B.A::a"
+ set re_class "class vA \{${ws}public:"
+ set re_fields "int va;${ws}int vx;"
+ set re_synth_gcc_23 "vA & operator=\\(vA const ?&\\);${ws}vA\\(vA const ?&\\);${ws}vA\\((void|)\\);"
- gdb_test "print g_B.A::x" ".* = 4" "print g_B.A::x"
+ set name "ptype vA"
+ gdb_test_multiple "ptype vA" $name {
+ -re "type = $re_class${ws}$re_fields$nl\}$nl$gdb_prompt $" {
+ pass $name
+ }
+ -re "type = $re_class${ws}$re_fields${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
+ pass $name
+ }
+ }
- gdb_test "print g_B.B::b" ".* = 5" "print g_B.B::b"
+ set name "ptype class vA"
+ gdb_test_multiple "ptype class vA" $name {
+ -re "type = $re_class${ws}$re_fields$nl\}$nl$gdb_prompt $" {
+ pass $name
+ }
+ -re "type = $re_class${ws}$re_fields${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
+ pass $name
+ }
+ }
- gdb_test "print g_B.B::x" ".* = 6" "print g_B.B::x"
+ set name "ptype g_vA"
+ gdb_test_multiple "ptype g_vA" $name {
+ -re "type = $re_class${ws}$re_fields$nl\}$nl$gdb_prompt $" {
+ pass $name
+ }
+ -re "type = $re_class${ws}$re_fields${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
+ pass $name
+ }
+ }
- # Print all members of g_C.
+ # ptype vB: type, class, object.
- gdb_test "print g_C.A::a" ".* = 7" "print g_C.A::a"
+ set re_class "class vB : public virtual vA \{(${ws}private:|)"
+ set re_vbptr "vA \\*(_vb.2vA|_vb.vA);${ws}"
+ set re_access "public:"
+ set re_fields "int vb;${ws}int vx;"
+ set re_synth_gcc_2 "vB & operator=\\(vB const ?&\\);${ws}vB\\(int, vB const ?&\\);${ws}vB\\(int\\);"
+ set re_synth_gcc_3 "vB & operator=\\(vB const ?&\\);${ws}vB\\(vB const ?&\\);${ws}vB\\((void|)\\);"
- gdb_test "print g_C.A::x" ".* = 8" "print g_C.A::x"
+ set name "ptype vB"
+ gdb_test_multiple "ptype vB" $name {
+ -re "type = $re_class${ws}$re_vbptr${ws}$re_access${ws}$re_fields$nl\}$nl$gdb_prompt $" {
+ # gcc 2.95.3 -gdwarf-2
+ pass $name
+ }
+ -re "type = $re_class${ws}$re_vbptr${ws}$re_access${ws}$re_fields${ws}$re_synth_gcc_2$nl\}$nl$gdb_prompt $" {
+ # gcc 2.95.3 -gstabs+
+ pass $name
+ }
+ -re "type = $re_class${ws}$re_access${ws}$re_fields$nl\}$nl$gdb_prompt $" {
+ # gcc 3.3.2 -gdwarf-2
+ # gcc HEAD 2004-01-21 -gdwarf-2
+ pass "$name (aCC)"
+ }
+ -re "type = $re_class${ws}$re_access${ws}$re_fields${ws}$re_synth_gcc_3$nl\}$nl$gdb_prompt $" {
+ # gcc 3.3.2 -gstabs+
+ # gcc HEAD 2004-01-21 -gstabs+
+ pass "$name (aCC)"
+ }
+ }
- gdb_test "print g_C.C::c" ".* = 9" "print g_C.C::c"
+ set name "ptype class vB"
+ gdb_test_multiple "ptype class vB" $name {
+ -re "type = $re_class${ws}$re_vbptr${ws}$re_access${ws}$re_fields$nl\}$nl$gdb_prompt $" {
+ # gcc 2.95.3 -gdwarf-2
+ pass $name
+ }
+ -re "type = $re_class${ws}$re_vbptr${ws}$re_access${ws}$re_fields${ws}$re_synth_gcc_2$nl\}$nl$gdb_prompt $" {
+ # gcc 2.95.3 -gstabs+
+ pass $name
+ }
+ -re "type = $re_class${ws}$re_access${ws}$re_fields$nl\}$nl$gdb_prompt $" {
+ # gcc 3.3.2 -gdwarf-2
+ # gcc HEAD 2004-01-21 -gdwarf-2
+ pass "$name (aCC)"
+ }
+ -re "type = $re_class${ws}$re_access${ws}$re_fields${ws}$re_synth_gcc_3$nl\}$nl$gdb_prompt $" {
+ # gcc 3.3.2 -gstabs+
+ # gcc HEAD 2004-01-21 -gstabs+
+ pass "$name (aCC)"
+ }
+ }
- gdb_test "print g_C.C::x" ".* = 10" "print g_C.C::x"
+ set name "ptype g_vB"
+ gdb_test_multiple "ptype g_vB" $name {
+ -re "type = $re_class${ws}$re_vbptr${ws}$re_access${ws}$re_fields$nl\}$nl$gdb_prompt $" {
+ # gcc 2.95.3 -gdwarf-2
+ pass $name
+ }
+ -re "type = $re_class${ws}$re_vbptr${ws}$re_access${ws}$re_fields${ws}$re_synth_gcc_2$nl\}$nl$gdb_prompt $" {
+ # gcc 2.95.3 -gstabs+
+ pass $name
+ }
+ -re "type = $re_class${ws}$re_access${ws}$re_fields$nl\}$nl$gdb_prompt $" {
+ # gcc 3.3.2 -gdwarf-2
+ # gcc HEAD 2004-01-21 -gdwarf-2
+ pass "$name (aCC)"
+ }
+ -re "type = $re_class${ws}$re_access${ws}$re_fields${ws}$re_synth_gcc_3$nl\}$nl$gdb_prompt $" {
+ # gcc 3.3.2 -gstabs+
+ # gcc HEAD 2004-01-21 -gstabs+
+ pass "$name (aCC)"
+ }
+ }
- # Print all members of g_D.
+ # ptype vC: type, class, object.
- # The following is ambiguous, and gdb should detect this.
- # For now, accept gdb's behavior as an expected failure if it
- # simply prints either member correctly.
+ set re_class "class vC : public virtual vA \{(${ws}private:|)"
+ set re_vbptr "vA \\*(_vb.2vA|_vb.vA);${ws}"
+ set re_access "public:"
+ set re_fields "int vc;${ws}int vx;"
+ set re_synth_gcc_2 "vC & operator=\\(vC const ?&\\);${ws}vC\\(int, vC const ?&\\);${ws}vC\\(int\\);"
+ set re_synth_gcc_3 "vC & operator=\\(vC const ?&\\);${ws}vC\\(vC const ?&\\);${ws}vC\\((void|)\\);"
- send_gdb "print g_D.A::a\n"
- gdb_expect {
- -re "warning: A ambiguous; using D::C::A. Use a cast to disambiguate.$nl\\$\[0-9\]* = 15$nl$gdb_prompt $" {
- pass "print g_D.A::a"
+ set name "ptype vC"
+ gdb_test_multiple "ptype vC" $name {
+ -re "type = $re_class${ws}$re_vbptr${ws}$re_access${ws}$re_fields$nl\}$nl$gdb_prompt $" {
+ # gcc 2.95.3 -gdwarf-2
+ pass $name
}
- -re "warning: A ambiguous; using D::B::A. Use a cast to disambiguate.$nl\\$\[0-9\]* = 11$nl$gdb_prompt $" {
- pass "print g_D.A::a (using B)"
+ -re "type = $re_class${ws}$re_vbptr${ws}$re_access${ws}$re_fields${ws}$re_synth_gcc_2$nl\}$nl$gdb_prompt $" {
+ # gcc 2.95.3 -gstabs+
+ pass $name
}
- -re ".* = 15$nl$gdb_prompt $" {
- kfail "gdb/68" "print g_D.A::a"
+ -re "type = $re_class${ws}$re_access${ws}$re_fields$nl\}$nl$gdb_prompt $" {
+ # gcc 3.3.2 -gdwarf-2
+ # gcc HEAD 2004-01-21 -gdwarf-2
+ pass "$name (aCC)"
}
- -re ".* = 11$nl$gdb_prompt $" {
- kfail "gdb/68" "print g_D.A::a"
+ -re "type = $re_class${ws}$re_access${ws}$re_fields${ws}$re_synth_gcc_3$nl\}$nl$gdb_prompt $" {
+ # gcc 3.3.2 -gstabs+
+ # gcc HEAD 2004-01-21 -gstabs+
+ pass "$name (aCC)"
}
- -re ".*$gdb_prompt $" { fail "print g_D.A::a" }
- timeout { fail "print g_D.A::a (timeout)" ; return }
}
- # The following is ambiguous, and gdb should detect this.
- # For now, accept gdb's behavior as an expected failure if it
- # simply prints either member correctly.
-
- send_gdb "print g_D.A::x\n"
- gdb_expect {
- -re "warning: A ambiguous; using D::C::A. Use a cast to disambiguate.$nl\\$\[0-9\]* = 16$nl$gdb_prompt $" {
- pass "print g_D.A::x"
+ set name "ptype class vC"
+ gdb_test_multiple "ptype class vC" $name {
+ -re "type = $re_class${ws}$re_vbptr${ws}$re_access${ws}$re_fields$nl\}$nl$gdb_prompt $" {
+ # gcc 2.95.3 -gdwarf-2
+ pass $name
}
- -re "warning: A ambiguous; using D::B::A. Use a cast to disambiguate.$nl\\$\[0-9\]* = 12$nl$gdb_prompt $" {
- pass "print g_D.A::x (using B)"
+ -re "type = $re_class${ws}$re_vbptr${ws}$re_access${ws}$re_fields${ws}$re_synth_gcc_2$nl\}$nl$gdb_prompt $" {
+ # gcc 2.95.3 -gstabs+
+ pass $name
}
- -re ".* = 16$nl$gdb_prompt $" {
- kfail "gdb/68" "print g_D.A::x"
+ -re "type = $re_class${ws}$re_access${ws}$re_fields$nl\}$nl$gdb_prompt $" {
+ # gcc 3.3.2 -gdwarf-2
+ # gcc HEAD 2004-01-21 -gdwarf-2
+ pass "$name (aCC)"
}
- -re ".* = 12$nl$gdb_prompt $" {
- kfail "gdb/68" "print g_D.A::x"
+ -re "type = $re_class${ws}$re_access${ws}$re_fields${ws}$re_synth_gcc_3$nl\}$nl$gdb_prompt $" {
+ # gcc 3.3.2 -gstabs+
+ # gcc HEAD 2004-01-21 -gstabs+
+ pass "$name (aCC)"
}
- -re ".*$gdb_prompt $" { fail "print g_D.A::x" }
- timeout { fail "print g_D.A::x (timeout)" ; return }
}
- gdb_test "print g_D.B::b" ".* = 13" "print g_D.B::b"
-
- gdb_test "print g_D.B::x" ".* = 14" "print g_D.B::x"
-
- gdb_test "print g_D.C::c" ".* = 17" "print g_D.C::c"
-
- gdb_test "print g_D.C::x" ".* = 18" "print g_D.C::x"
+ set name "ptype g_vC"
+ gdb_test_multiple "ptype g_vC" $name {
+ -re "type = $re_class${ws}$re_vbptr${ws}$re_access${ws}$re_fields$nl\}$nl$gdb_prompt $" {
+ # gcc 2.95.3 -gdwarf-2
+ pass $name
+ }
+ -re "type = $re_class${ws}$re_vbptr${ws}$re_access${ws}$re_fields${ws}$re_synth_gcc_2$nl\}$nl$gdb_prompt $" {
+ # gcc 2.95.3 -gstabs+
+ pass $name
+ }
+ -re "type = $re_class${ws}$re_access${ws}$re_fields$nl\}$nl$gdb_prompt $" {
+ # gcc 3.3.2 -gdwarf-2
+ # gcc HEAD 2004-01-21 -gdwarf-2
+ pass "$name (aCC)"
+ }
+ -re "type = $re_class${ws}$re_access${ws}$re_fields${ws}$re_synth_gcc_3$nl\}$nl$gdb_prompt $" {
+ # gcc 3.3.2 -gstabs+
+ # gcc HEAD 2004-01-21 -gstabs+
+ pass "$name (aCC)"
+ }
+ }
+}
- gdb_test "print g_D.D::d" ".* = 19" "print g_D.D::d"
+# Multiple virtual inheritance, print type definitions.
- gdb_test "print g_D.D::x" ".* = 20" "print g_D.D::x"
+proc test_ptype_mvi { } {
+ global gdb_prompt
+ global ws
+ global nl
- # Print all members of g_E.
+ # ptype vD: type, class, object.
- # The following is ambiguous, and gdb should detect this.
- # For now, accept gdb's behavior as an expected failure if it
- # simply prints either member correctly.
+ set re_class "class vD : public virtual vB, public virtual vC \{(${ws}private:|)"
+ set re_vbptr "vC \\*(_vb.2vC|_vb.vC);${ws}vB \\*(_vb.2vB|_vb.vB);"
+ set re_access "public:"
+ set re_fields "int vd;${ws}int vx;"
+ set re_synth_gcc_2 "vD & operator=\\(vD const ?&\\);${ws}vD\\(int, vD const ?&\\);${ws}vD\\(int\\);"
+ set re_synth_gcc_3 "vD & operator=\\(vD const ?&\\);${ws}vD\\(vD const ?&\\);${ws}vD\\((void|)\\);"
- send_gdb "print g_E.A::a\n"
- gdb_expect {
- -re ".* = 21$nl$gdb_prompt $" {
- kfail "gdb/68" "print g_E.A::a"
+ set name "ptype vD"
+ gdb_test_multiple "ptype vD" $name {
+ -re "type = $re_class${ws}$re_vbptr${ws}$re_access${ws}$re_fields$nl\}$nl$gdb_prompt $" {
+ # gcc 2.95.3 -gdwarf-2
+ pass $name
}
- -re ".* = 25$nl$gdb_prompt $" {
- kfail "gdb/68" "print g_E.A::a"
+ -re "type = $re_class${ws}$re_vbptr${ws}$re_access${ws}$re_fields${ws}$re_synth_gcc_2$nl\}$nl$gdb_prompt $" {
+ # gcc 2.95.3 -gstabs+
+ pass $name
+ }
+ -re "type = $re_class${ws}$re_access${ws}$re_fields$nl\}$nl$gdb_prompt $" {
+ # gcc 3.3.2 -gdwarf-2
+ # gcc HEAD 2004-01-21 -gdwarf-2
+ pass "$name"
+ }
+ -re "type = $re_class${ws}$re_access${ws}$re_fields${ws}$re_synth_gcc_3$nl\}$nl$gdb_prompt $" {
+ # gcc 3.3.2 -gstabs+
+ # gcc HEAD 2004-01-21 -gstabs+
+ pass "$name"
}
- -re ".*$gdb_prompt $" { fail "print g_E.A::a" }
- timeout { fail "print g_E.A::a (timeout)" ; return }
}
- # The following is ambiguous, and gdb should detect this.
- # For now, accept gdb's behavior as an expected failure if it
- # simply prints either member correctly.
-
- send_gdb "print g_E.A::x\n"
- gdb_expect {
- -re "warning: A ambiguous; using E::D::C::A. Use a cast to disambiguate.$nl\\$\[0-9\]* = 26$nl$gdb_prompt $" {
- pass "print g_E.A::x"
+ set name "ptype class vD"
+ gdb_test_multiple "ptype class vD" $name {
+ -re "type = $re_class${ws}$re_vbptr${ws}$re_access${ws}$re_fields$nl\}$nl$gdb_prompt $" {
+ # gcc 2.95.3 -gdwarf-2
+ pass $name
}
- -re "warning: A ambiguous; using E::D::B::A. Use a cast to disambiguate.$nl\\$\[0-9\]* = 22$nl$gdb_prompt $" {
- pass "print g_E.A::x (using B)"
+ -re "type = $re_class${ws}$re_vbptr${ws}$re_access${ws}$re_fields${ws}$re_synth_gcc_2$nl\}$nl$gdb_prompt $" {
+ # gcc 2.95.3 -gstabs+
+ pass $name
}
- -re ".* = 26$nl$gdb_prompt $" {
- kfail "gdb/68" "print g_E.A::x"
+ -re "type = $re_class${ws}$re_access${ws}$re_fields$nl\}$nl$gdb_prompt $" {
+ # gcc 3.3.2 -gdwarf-2
+ # gcc HEAD 2004-01-21 -gdwarf-2
+ pass "$name"
}
- -re ".* = 22$nl$gdb_prompt $" {
- kfail "gdb/68" "print g_E.A::x"
+ -re "type = $re_class${ws}$re_access${ws}$re_fields${ws}$re_synth_gcc_3$nl\}$nl$gdb_prompt $" {
+ # gcc 3.3.2 -gstabs+
+ # gcc HEAD 2004-01-21 -gstabs+
+ pass "$name"
}
- -re ".*$gdb_prompt $" { fail "print g_E.A::x" }
- timeout { fail "print g_E.A::x (timeout)" ; return }
}
- gdb_test "print g_E.B::b" ".* = 23" "print g_E.B::b"
-
- gdb_test "print g_E.B::x" ".* = 24" "print g_E.B::x"
-
- gdb_test "print g_E.C::c" ".* = 27" "print g_E.C::c"
+ set name "ptype g_vD"
+ gdb_test_multiple "ptype g_vD" $name {
+ -re "type = $re_class${ws}$re_vbptr${ws}$re_access${ws}$re_fields$nl\}$nl$gdb_prompt $" {
+ # gcc 2.95.3 -gdwarf-2
+ pass $name
+ }
+ -re "type = $re_class${ws}$re_vbptr${ws}$re_access${ws}$re_fields${ws}$re_synth_gcc_2$nl\}$nl$gdb_prompt $" {
+ # gcc 2.95.3 -gstabs+
+ pass $name
+ }
+ -re "type = $re_class${ws}$re_access${ws}$re_fields$nl\}$nl$gdb_prompt $" {
+ # gcc 3.3.2 -gdwarf-2
+ # gcc HEAD 2004-01-21 -gdwarf-2
+ pass "$name"
+ }
+ -re "type = $re_class${ws}$re_access${ws}$re_fields${ws}$re_synth_gcc_3$nl\}$nl$gdb_prompt $" {
+ # gcc 3.3.2 -gstabs+
+ # gcc HEAD 2004-01-21 -gstabs+
+ pass "$name"
+ }
+ }
- gdb_test "print g_E.C::x" ".* = 28" "print g_E.C::x"
+ # ptype vE: type, class, object.
- gdb_test "print g_E.D::d" ".* = 29" "print g_E.D::d"
+ set re_class "class vE : public virtual vD \{(${ws}private:|)"
+ set re_vbptr "vD \\*(_vb.2vD|_vb.vD);"
+ set re_access "public:"
+ set re_fields "int ve;${ws}int vx;"
+ set re_synth_gcc_2 "vE & operator=\\(vE const ?&\\);${ws}vE\\(int, vE const ?&\\);${ws}vE\\(int\\);"
+ set re_synth_gcc_3 "vE & operator=\\(vE const ?&\\);${ws}vE\\(vE const ?&\\);${ws}vE\\((void|)\\);"
- gdb_test "print g_E.D::x" ".* = 30" "print g_E.D::x"
+ set name "ptype vE"
+ gdb_test_multiple "ptype vE" $name {
+ -re "type = $re_class${ws}$re_vbptr${ws}$re_access${ws}$re_fields$nl\}$nl$gdb_prompt $" {
+ # gcc 2.95.3 -gdwarf-2
+ pass $name
+ }
+ -re "type = $re_class${ws}$re_vbptr${ws}$re_access${ws}$re_fields${ws}$re_synth_gcc_2$nl\}$nl$gdb_prompt $" {
+ # gcc 2.95.3 -gstabs+
+ pass $name
+ }
+ -re "type = $re_class${ws}$re_access${ws}$re_fields$nl\}$nl$gdb_prompt $" {
+ # gcc 3.3.2 -gdwarf-2
+ # gcc HEAD 2004-01-21 -gdwarf-2
+ pass "$name"
+ }
+ -re "type = $re_class${ws}$re_access${ws}$re_fields${ws}$re_synth_gcc_3$nl\}$nl$gdb_prompt $" {
+ # gcc 3.3.2 -gstabs+
+ # gcc HEAD 2004-01-21 -gstabs+
+ pass "$name"
+ }
+ }
- gdb_test "print g_E.E::e" ".* = 31" "print g_E.E::e"
+ set name "ptype class vE"
+ gdb_test_multiple "ptype class vE" $name {
+ -re "type = $re_class${ws}$re_vbptr${ws}$re_access${ws}$re_fields$nl\}$nl$gdb_prompt $" {
+ # gcc 2.95.3 -gdwarf-2
+ pass $name
+ }
+ -re "type = $re_class${ws}$re_vbptr${ws}$re_access${ws}$re_fields${ws}$re_synth_gcc_2$nl\}$nl$gdb_prompt $" {
+ # gcc 2.95.3 -gstabs+
+ pass $name
+ }
+ -re "type = $re_class${ws}$re_access${ws}$re_fields$nl\}$nl$gdb_prompt $" {
+ # gcc 3.3.2 -gdwarf-2
+ # gcc HEAD 2004-01-21 -gdwarf-2
+ pass "$name"
+ }
+ -re "type = $re_class${ws}$re_access${ws}$re_fields${ws}$re_synth_gcc_3$nl\}$nl$gdb_prompt $" {
+ # gcc 3.3.2 -gstabs+
+ # gcc HEAD 2004-01-21 -gstabs+
+ pass "$name"
+ }
+ }
- gdb_test "print g_E.E::x" ".* = 32" "print g_E.E::x"
+ set name "ptype g_vE"
+ gdb_test_multiple "ptype g_vE" $name {
+ -re "type = $re_class${ws}$re_vbptr${ws}$re_access${ws}$re_fields$nl\}$nl$gdb_prompt $" {
+ # gcc 2.95.3 -gdwarf-2
+ pass $name
+ }
+ -re "type = $re_class${ws}$re_vbptr${ws}$re_access${ws}$re_fields${ws}$re_synth_gcc_2$nl\}$nl$gdb_prompt $" {
+ # gcc 2.95.3 -gstabs+
+ pass $name
+ }
+ -re "type = $re_class${ws}$re_access${ws}$re_fields$nl\}$nl$gdb_prompt $" {
+ # gcc 3.3.2 -gdwarf-2
+ # gcc HEAD 2004-01-21 -gdwarf-2
+ pass "$name"
+ }
+ -re "type = $re_class${ws}$re_access${ws}$re_fields${ws}$re_synth_gcc_3$nl\}$nl$gdb_prompt $" {
+ # gcc 3.3.2 -gstabs+
+ # gcc HEAD 2004-01-21 -gstabs+
+ pass "$name"
+ }
+ }
}
-#
-# Multiple inheritance, print type definitions.
-#
+# Single inheritance, print individual members.
-proc test_ptype_mi {} {
- global nl
+proc test_print_si_members { } {
+ global vhn
- gdb_test "ptype D" "type = class D : public B, public C \{$nl\[ \]*public:$nl\[ \]*int d;$nl\[ \]*int x;$nl.*\}" "ptype D"
+ # Print all members of g_A using fully qualified form.
+ gdb_test "print g_A.A::a" "$vhn = 1"
+ gdb_test "print g_A.A::x" "$vhn = 2"
- gdb_test "ptype class D" "type = class D : public B, public C \{$nl\[ \]*public:$nl\[ \]*int d;$nl\[ \]*int x;$nl.*\}" "ptype class D"
+ # Print members of g_A using nonambiguous compact form.
+ gdb_test "print g_A.a" "$vhn = 1"
+ gdb_test "print g_A.x" "$vhn = 2"
- gdb_test "ptype g_D" "type = class D : public B, public C \{$nl\[ \]*public:$nl\[ \]*int d;$nl\[ \]*int x;$nl.*\}" "ptype g_D"
+ # Print all members of g_B using fully qualified form.
+ gdb_test "print g_B.A::a" "$vhn = 3"
+ gdb_test "print g_B.A::x" "$vhn = 4"
+ gdb_test "print g_B.B::b" "$vhn = 5"
+ gdb_test "print g_B.B::x" "$vhn = 6"
- gdb_test "ptype E" "type = class E : public D \{$nl\[ \]*public:$nl\[ \]*int e;$nl\[ \]*int x;$nl.*\}" "ptype E"
+ # Print members of g_B using nonambiguous compact form.
+ gdb_test "print g_B.a" "$vhn = 3"
+ gdb_test "print g_B.b" "$vhn = 5"
+ gdb_test "print g_B.x" "$vhn = 6"
- gdb_test "ptype class E" "type = class E : public D \{$nl\[ \]*public:$nl\[ \]*int e;$nl\[ \]*int x;$nl.*\}" "ptype class E"
+ # Print all members of g_C using fully qualified form.
+ gdb_test "print g_C.A::a" "$vhn = 7"
+ gdb_test "print g_C.A::x" "$vhn = 8"
+ gdb_test "print g_C.C::c" "$vhn = 9"
+ gdb_test "print g_C.C::x" "$vhn = 10"
- gdb_test "ptype g_E" "type = class E : public D \{$nl\[ \]*public:$nl\[ \]*int e;$nl\[ \]*int x;$nl.*\}" "ptype g_E"
+ # Print members of g_C using nonambiguous compact form.
+ gdb_test "print g_C.a" "$vhn = 7"
+ gdb_test "print g_C.c" "$vhn = 9"
+ gdb_test "print g_C.x" "$vhn = 10"
}
-#
-# Multiple inheritance, print complete classes.
-#
-
-proc test_print_mi_classes {} {
- # Print all members of g_D.
-
- gdb_test "print g_D" ".* = \{\<(class |)B\> = \{\<(class |)A\> = \{a = 11, x = 12\}, b = 13, x = 14\}, \<(class |)C\> = \{\<(class |)A\> = \{a = 15, x = 16\}, c = 17, x = 18\}, d = 19, x = 20\}" "print g_D"
+# Single inheritance, print complete classes.
- # Print all members of g_E.
+proc test_print_si_classes { } {
+ global vhn
- gdb_test "print g_E" ".* = \{\<(class |)D\> = \{\<(class |)B\> = \{\<(class |)A\> = \{a = 21, x = 22\}, b = 23, x = 24\}, \<(class |)C\> = \{\<(class |)A\> = \{a = 25, x = 26\}, c = 27, x = 28\}, d = 29, x = 30\}, e = 31, x = 32\}" "print g_E"
+ # Print all members of g_A, g_B, g_C.
+ gdb_test "print g_A" "$vhn = \{a = 1, x = 2\}"
+ gdb_test "print g_B" "$vhn = \{<(class A|A)> = \{a = 3, x = 4\}, b = 5, x = 6\}"
+ gdb_test "print g_C" "$vhn = \{<(class A|A)> = \{a = 7, x = 8\}, c = 9, x = 10\}"
}
-#
-# Single virtual inheritance, print individual members.
-#
+# Multiple inheritance, print individual members.
-proc test_print_svi_members {} {
+proc test_print_mi_members {} {
global gdb_prompt
- global decimal
global nl
+ global vhn
- # Print all members of g_vA.
-
- gdb_test "print g_vA.vA::va" ".* = 1" "print g_vA.vA::va"
-
- gdb_test "print g_vA.vA::vx" ".* = 2" "print g_vA.vA::vx"
-
- # Print members of g_vA using compact form.
-
- gdb_test "print g_vA.va" ".* = 1" "print g_vA.va"
+ # Print all members of g_A.
+ gdb_test "print g_A.A::a" "$vhn = 1"
+ gdb_test "print g_A.A::x" "$vhn = 2"
- gdb_test "print g_vA.vx" ".* = 2" "print g_vA.vx"
+ # Print all members of g_B.
+ gdb_test "print g_B.A::a" "$vhn = 3"
+ gdb_test "print g_B.A::x" "$vhn = 4"
+ gdb_test "print g_B.B::b" "$vhn = 5"
+ gdb_test "print g_B.B::x" "$vhn = 6"
- # Print all members of g_vB.
+ # Print all members of g_C.
+ gdb_test "print g_C.A::a" "$vhn = 7"
+ gdb_test "print g_C.A::x" "$vhn = 8"
+ gdb_test "print g_C.C::c" "$vhn = 9"
+ gdb_test "print g_C.C::x" "$vhn = 10"
- send_gdb "print g_vB.vA::va\n"
- gdb_expect {
- -re ".* = 3$nl$gdb_prompt $" { pass "print g_vB.vA::va" }
- -re ".*virtual baseclass botch.*$gdb_prompt $" {
- # Does not happen with gcc cygnus-2.4.5-930828
- fail "print g_vB.vA::va (known bug with gcc cygnus-2.4.5-930417)"
- # Many of the rest of these tests have the same problem.
- return 0
+ # Print all members of g_D.
+ #
+ # g_D.A::a and g_D.A::x are ambiguous member accesses, and gdb
+ # should detect these. There are no ways to PASS these tests
+ # because I don't know what the gdb message will be. -- chastain
+ # 2004-01-27.
+
+ set name "print g_D.A::a"
+ gdb_test_multiple "print g_D.A::a" $name {
+ -re "$vhn = (15|11)$nl$gdb_prompt $" {
+ kfail "gdb/68" "print g_D.A::a"
}
- -re ".*$gdb_prompt $" { fail "print g_vB.vA::va" }
- timeout { fail "print g_vB.vA::va (timeout)" ; return }
}
- gdb_test "print g_vB.vA::vx" ".* = 4" "print g_vB.vA::vx"
-
- gdb_test "print g_vB.vB::vb" ".* = 5" "print g_vB.vB::vb"
-
- gdb_test "print g_vB.vB::vx" ".* = 6" "print g_vB.vB::vx"
-
- # Print members of g_vB using compact form.
-
- gdb_test "print g_vB.va" ".* = 3" "print g_vB.va"
-
- gdb_test "print g_vB.vb" ".* = 5" "print g_vB.vb"
-
- gdb_test "print g_vB.vx" ".* = 6" "print g_vB.vx"
+ set name "print g_D.A::x"
+ gdb_test_multiple "print g_D.A::x" $name {
+ -re "$vhn = (16|12)$nl$gdb_prompt $" {
+ kfail "gdb/68" "print g_D.A::x"
+ }
+ }
- # Print all members of g_vC.
+ gdb_test "print g_D.B::b" "$vhn = 13"
+ gdb_test "print g_D.B::x" "$vhn = 14"
+ gdb_test "print g_D.C::c" "$vhn = 17"
+ gdb_test "print g_D.C::x" "$vhn = 18"
+ gdb_test "print g_D.D::d" "$vhn = 19"
+ gdb_test "print g_D.D::x" "$vhn = 20"
- gdb_test "print g_vC.vA::va" ".* = 7" "print g_vC.vA::va"
+ # Print all members of g_E.
+ # g_E.A::a and g_E.A::x are ambiguous.
- gdb_test "print g_vC.vA::vx" ".* = 8" "print g_vC.vA::vx"
+ set name "print g_E.A::a"
+ gdb_test_multiple "print g_E.A::a" $name {
+ -re "$vhn = (21|25)$nl$gdb_prompt $" {
+ kfail "gdb/68" "print g_E.A::a"
+ }
+ }
- gdb_test "print g_vC.vC::vc" ".* = 9" "print g_vC.vC::vc"
+ set name "print g_E.A::x"
+ gdb_test_multiple "print g_E.A::x" $name {
+ -re "$vhn = (26|22)$nl$gdb_prompt $" {
+ kfail "gdb/68" "print g_E.A::x"
+ }
+ }
- gdb_test "print g_vC.vC::vx" ".* = 10" "print g_vC.vC::vx"
+ gdb_test "print g_E.B::b" "$vhn = 23"
+ gdb_test "print g_E.B::x" "$vhn = 24"
+ gdb_test "print g_E.C::c" "$vhn = 27"
+ gdb_test "print g_E.C::x" "$vhn = 28"
+ gdb_test "print g_E.D::d" "$vhn = 29"
+ gdb_test "print g_E.D::x" "$vhn = 30"
+ gdb_test "print g_E.E::e" "$vhn = 31"
+ gdb_test "print g_E.E::x" "$vhn = 32"
+}
- # Print members of g_vC using compact form.
+# Multiple inheritance, print complete classes.
- gdb_test "print g_vC.va" ".* = 7" "print g_vC.va"
+proc test_print_mi_classes { } {
+ global vhn
- gdb_test "print g_vC.vc" ".* = 9" "print g_vC.vc"
+ # Print all members of g_D.
+ gdb_test "print g_D" "$vhn = \{\<(class |)B\> = \{\<(class |)A\> = \{a = 11, x = 12\}, b = 13, x = 14\}, \<(class |)C\> = \{\<(class |)A\> = \{a = 15, x = 16\}, c = 17, x = 18\}, d = 19, x = 20\}"
- gdb_test "print g_vC.vx" ".* = 10" "print g_vC.vx"
+ # Print all members of g_E.
+ gdb_test "print g_E" "$vhn = \{\<(class |)D\> = \{\<(class |)B\> = \{\<(class |)A\> = \{a = 21, x = 22\}, b = 23, x = 24\}, \<(class |)C\> = \{\<(class |)A\> = \{a = 25, x = 26\}, c = 27, x = 28\}, d = 29, x = 30\}, e = 31, x = 32\}"
}
+# Single inheritance, print anonymous unions.
+# GDB versions prior to 4.14 entered an infinite loop when printing
+# the type of a class containing an anonymous union, and they were also
+# incapable of printing the member of an anonymous union.
+# We test the printing of the member first, and perform the other tests
+# only if the test succeeds, to avoid the infinite loop.
#
-# Single virtual inheritance, print type definitions.
-#
+# GDB HEAD 2004-01-27 with hp aCC A.03.45 crashes on the first test.
+# -- chastain 2004-01-27
-proc test_ptype_vi {} {
+proc test_print_anon_union {} {
global gdb_prompt
global ws
global nl
- global vbptr
+ global vhn
- # This class does not use any C++-specific features, so it's fine for
- # it to print as "struct".
- send_gdb "ptype vA\n"
- gdb_expect {
- -re "type = class vA \{$nl\[ \]*public:$nl\[ \]*int va;$nl\[ \]*int vx;$nl.*\}$nl$gdb_prompt $" {
- pass "ptype vA"
- }
- -re "type = struct vA \{$nl\[ \]*int va;$nl\[ \]*int vx;$nl\}$nl$gdb_prompt $" {
- pass "ptype vA"
- }
- -re ".*$gdb_prompt $" { fail "ptype vA" }
- timeout { fail "ptype vA (timeout)" ; return }
- }
+ gdb_test "print g_anon_union.a" "$vhn = 2" "print anonymous union member"
- # This class does not use any C++-specific features, so it's fine for
- # it to print as "struct".
- send_gdb "ptype class vA\n"
- gdb_expect {
- -re "type = class vA \{$nl\[ \]*public:$nl\[ \]*int va;$nl\[ \]*int vx;$nl.*\}$nl$gdb_prompt $" {
- pass "ptype class vA"
- }
- -re "type = struct vA \{$nl\[ \]*int va;$nl\[ \]*int vx;$nl\}$nl$gdb_prompt $" {
- pass "ptype class vA"
+ set name "print variable of type anonymous union"
+ gdb_test_multiple "print g_anon_union" $name {
+ -re "$vhn = \{one = 1, \{a = 2, b = 2\}\}$nl$gdb_prompt $" {
+ pass $name
}
- -re ".*$gdb_prompt $" { fail "ptype class vA" }
- timeout { fail "ptype class vA (timeout)" ; return }
}
- # This class does not use any C++-specific features, so it's fine for
- # it to print as "struct".
- send_gdb "ptype g_vA\n"
- gdb_expect {
- -re "type = class vA \{$nl\[ \]*public:$nl\[ \]*int va;$nl\[ \]*int vx;$nl.*\}$nl$gdb_prompt $" {
- pass "ptype g_vA"
- }
- -re "type = struct vA \{$nl\[ \]*int va;$nl\[ \]*int vx;$nl\}$nl$gdb_prompt $" {
- pass "ptype g_vA"
- }
- -re ".*$gdb_prompt $" { fail "ptype g_vA" }
- timeout { fail "ptype g_vA (timeout)" ; return }
- }
+ set re_class "class class_with_anon_union \{${ws}public:"
+ set re_fields "int one;${ws}"
+ set re_anon_union "union \{${ws}int a;${ws}long int b;${ws}\};"
+ set re_synth_gcc_23 "class_with_anon_union & operator=\\(class_with_anon_union const ?&\\);${ws}class_with_anon_union\\(class_with_anon_union const ?&\\);${ws}class_with_anon_union\\((void|)\\);"
- send_gdb "ptype vB\n"
- gdb_expect {
- -re "ptype vB${nl}type = class vB : public virtual vA \{$nl private:${ws}vA \\*${vbptr}vA;$nl public:${ws}int vb;${ws}int vx;$nl.*\}$nl$gdb_prompt $" {
- pass "ptype vB"
+ set name "print type of anonymous union"
+ gdb_test_multiple "ptype g_anon_union" $name {
+ -re "type = $re_class${ws}$re_fields${ws}$re_anon_union$nl\}$nl$gdb_prompt $" {
+ pass $name
}
- -re "ptype vB${nl}type = class vB : public virtual vA \{$nl public:${ws}int vb;${ws}int vx;$nl.*\}$nl$gdb_prompt $" {
- pass "ptype vB (aCC)"
+ -re "type = $re_class${ws}$re_fields${ws}$re_anon_union${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
+ pass $name
}
- -re ".*$gdb_prompt $" { fail "ptype vB" }
- timeout { fail "ptype vB (timeout)" }
}
+}
- send_gdb "ptype class vB\n"
- gdb_expect {
- -re "type = class vB : public virtual vA \{$nl\[ \]*private:$nl\[ \]*vA \\*${vbptr}vA;$nl\[ \]*public:$nl\[ \]*int vb;$nl\[ \]*int vx;$nl.*\}$nl$gdb_prompt $" {
- pass "ptype class vB"
- }
- -re "type = class vB : public virtual vA \{$nl\[ \]*public:$nl\[ \]*int vb;$nl\[ \]*int vx;$nl.*\}$nl$gdb_prompt $" {
- pass "ptype class vB (aCC)"
- }
- -re ".*$gdb_prompt $" { fail "ptype class vB" }
- timeout { fail "ptype class vB (timeout)" }
- }
- send_gdb "ptype g_vB\n"
- gdb_expect {
- -re "type = class vB : public virtual vA \{$nl\[ \]*private:$nl\[ \]*vA \\*${vbptr}vA;$nl\[ \]*public:$nl\[ \]*int vb;$nl\[ \]*int vx;$nl.*\}$nl$gdb_prompt $" {
- pass "ptype g_vB"
- }
- -re "type = class vB : public virtual vA \{$nl\[ \]*public:$nl\[ \]*int vb;$nl\[ \]*int vx;$nl.*\}$nl$gdb_prompt $" {
- pass "ptype g_vB (aCC)"
- }
- -re ".*$gdb_prompt $" { fail "ptype g_vB" }
- timeout { fail "ptype g_vB (timeout)" }
- }
+# Single virtual inheritance, print individual members.
- send_gdb "ptype vC\n"
- gdb_expect {
- -re "type = class vC : public virtual vA \{$nl\[ \]*private:$nl\[ \]*vA \\*${vbptr}vA;$nl\[ \]*public:$nl\[ \]*int vc;$nl\[ \]*int vx;$nl.*\}$nl$gdb_prompt $" {
- pass "ptype vC"
- }
- -re "type = class vC : public virtual vA \{$nl\[ \]*public:$nl\[ \]*int vc;$nl\[ \]*int vx;$nl.*\}$nl$gdb_prompt $" {
- pass "ptype vC (aCC)"
- }
- -re ".*$gdb_prompt $" { fail "ptype vC" }
- timeout { fail "ptype vC (timeout)" }
- }
+proc test_print_svi_members { } {
+ global vhn
- send_gdb "ptype class vC\n"
- gdb_expect {
- -re "type = class vC : public virtual vA \{$nl\[ \]*private:$nl\[ \]*vA \\*${vbptr}vA;$nl\[ \]*public:$nl\[ \]*int vc;$nl\[ \]*int vx;$nl.*\}$nl$gdb_prompt $" {
- pass "ptype class vC"
- }
- -re "type = class vC : public virtual vA \{$nl\[ \]*public:$nl\[ \]*int vc;$nl\[ \]*int vx;$nl.*\}$nl$gdb_prompt $" {
- pass "ptype class vC (aCC)"
- }
- -re ".*$gdb_prompt $" { fail "ptype class vC" }
- timeout { fail "ptype class vC (timeout)" }
- }
+ # Print all members of g_vA.
+ gdb_test "print g_vA.vA::va" "$vhn = 1"
+ gdb_test "print g_vA.vA::vx" "$vhn = 2"
- send_gdb "ptype g_vC\n"
- gdb_expect {
- -re "type = class vC : public virtual vA \{$nl\[ \]*private:$nl\[ \]*vA \\*${vbptr}vA;$nl\[ \]*public:$nl\[ \]*int vc;$nl\[ \]*int vx;$nl.*\}$nl$gdb_prompt $" {
- pass "ptype g_vC"
- }
- -re "type = class vC : public virtual vA \{$nl\[ \]*public:$nl\[ \]*int vc;$nl\[ \]*int vx;$nl.*\}$nl$gdb_prompt $" {
- pass "ptype g_vC (aCC)"
- }
- -re ".*$gdb_prompt $" { fail "ptype g_vC" }
- timeout { fail "ptype g_vC (timeout)" }
- }
+ # Print members of g_vA using compact form.
+ gdb_test "print g_vA.va" "$vhn = 1"
+ gdb_test "print g_vA.vx" "$vhn = 2"
+
+ # Print all members of g_vB.
+ gdb_test "print g_vB.vA::va" "$vhn = 3"
+ gdb_test "print g_vB.vA::vx" "$vhn = 4"
+ gdb_test "print g_vB.vB::vb" "$vhn = 5"
+ gdb_test "print g_vB.vB::vx" "$vhn = 6"
+
+ # Print members of g_vB using compact form.
+ gdb_test "print g_vB.va" "$vhn = 3"
+ gdb_test "print g_vB.vb" "$vhn = 5"
+ gdb_test "print g_vB.vx" "$vhn = 6"
+
+ # Print all members of g_vC.
+ gdb_test "print g_vC.vA::va" "$vhn = 7"
+ gdb_test "print g_vC.vA::vx" "$vhn = 8"
+ gdb_test "print g_vC.vC::vc" "$vhn = 9"
+ gdb_test "print g_vC.vC::vx" "$vhn = 10"
+
+ # Print members of g_vC using compact form.
+ gdb_test "print g_vC.va" "$vhn = 7" "print g_vC.va"
+ gdb_test "print g_vC.vc" "$vhn = 9" "print g_vC.vc"
+ gdb_test "print g_vC.vx" "$vhn = 10" "print g_vC.vx"
}
-#
# Single virtual inheritance, print complete classes.
-#
-proc test_print_svi_classes {} {
+proc test_print_svi_classes { } {
global gdb_prompt
global hex
- global decimal
global nl
- global vbptr
+ global vhn
# Print all members of g_vA.
-
- gdb_test "print g_vA" ".* = \{va = 1, vx = 2\}" "print g_vA"
+ gdb_test "print g_vA" "$vhn = \{va = 1, vx = 2\}"
# Print all members of g_vB.
-
- send_gdb "print g_vB\n"
- gdb_expect {
- -re ".* = \{\<class vA\> = \{va = 3, vx = 4\}, vb = 5, vx = 6, Virtual table at $hex\}$nl$gdb_prompt $" {
- pass "print g_vB (aCC)"
- }
- -re ".* = \{\<class vA\> = \{va = 3, vx = 4\}, vb = 5, vx = 6, __vfp = $hex\}$nl$gdb_prompt $" {
- pass "print g_vB (aCC)"
- }
- -re ".* = \{\<vA\> = \{va = 3, vx = 4\}, ${vbptr}vA = $hex, vb = 5, vx = 6\}$nl$gdb_prompt $" {
- pass "print g_vB"
+ set re_vbptr_2 "(_vb.2vA|_vb.vA)"
+ set re_vbptr_3 "_vptr.vB"
+
+ set name "print g_vB"
+ gdb_test_multiple "print g_vB" $name {
+ -re "$vhn = \{<vA> = \{va = 3, vx = 4\}, $re_vbptr_2 = $hex, vb = 5, vx = 6\}$nl$gdb_prompt $" {
+ # gcc 2.95.3 -gdwarf-2
+ # gcc 2.95.3 -gstabs+
+ pass $name
+ }
+ -re "$vhn = \{<vA> = \{va = 3, vx = 4\}, $re_vbptr_3 = $hex, vb = 5, vx = 6\}$nl$gdb_prompt $" {
+ # gcc 3.3.2 -gdwarf-2
+ # gcc HEAD 2004-01-21 -gdwarf-2
+ # gcc HEAD 2004-01-21 -gstabs+
+ pass "$name (FIXME v3 vtbl ptr)"
+ }
+ -re "$vhn = \{<vA> = \{va = 3, vx = 4\}, $re_vbptr_3 = $hex <VTT for vB>, vb = 5, vx = 6\}$nl$gdb_prompt $" {
+ # gcc 3.3.2 -gstabs+
+ pass $name
}
- -re ".* = \{\<vA\> = \{va = 3, vx = 4\}, _vptr.vB = $hex, vb = 5, vx = 6\}$nl$gdb_prompt $" {
- pass "print g_vB (FIXME v3 vtbl ptr)"
- }
- -re ".* = \{\<vA\> = \{va = 3, vx = 4\}, _vptr.vB = $hex <VTT for vB>, vb = 5, vx = 6\}$nl$gdb_prompt $" {
- # Happens with gcc 3.3 -gstabs+
- # Does not happen with gcc 3.2.3 -gstabs+.
- # Does not happen gcc HEAD%20030624 (pre-3.4) -gstabs+.
- # -- chastain 2003-06-29
- pass "print g_vB"
- }
-
- -re ".*invalid address 0x0.*$gdb_prompt $" {
- # Does not happen with gcc cygnus-2.4.5-930828
- fail "print g_vB (known bug with gcc cygnus-2.4.5-930417)"
- # Many of the rest of these tests have the same problem.
- return 0
- }
- -re ".*$gdb_prompt $" { fail "print g_vB" }
- timeout { fail "print g_vB (timeout)" ; return }
}
# Print all members of g_vC.
-
- send_gdb "print g_vC\n"
- gdb_expect {
- -re ".* = \{\<class vA\> = \{va = 7, vx = 8\}, vc = 9, vx = 10, Virtual table at $hex\}$nl$gdb_prompt $" {
- pass "print g_vC (aCC)"
- }
- -re ".* = \{\<class vA\> = \{va = 7, vx = 8\}, vc = 9, vx = 10, __vfp = $hex\}$nl$gdb_prompt $" {
- pass "print g_vC (aCC)"
+ set re_vbptr_2 "(_vb.2vA|_vb.vA)"
+ set re_vbptr_3 "_vptr.vC"
+
+ set name "print g_vC"
+ gdb_test_multiple "print g_vC" $name {
+ -re "$vhn = \{<vA> = \{va = 7, vx = 8\}, $re_vbptr_2 = $hex, vc = 9, vx = 10\}$nl$gdb_prompt $" {
+ # gcc 2.95.3 -gdwarf-2
+ # gcc 2.95.3 -gstabs+
+ pass $name
+ }
+ -re "$vhn = \{<vA> = \{va = 7, vx = 8\}, $re_vbptr_3 = $hex, vc = 9, vx = 10\}$nl$gdb_prompt $" {
+ # gcc 3.3.2 -gdwarf-2
+ # gcc HEAD 2004-01-21 -gdwarf-2
+ # gcc HEAD 2004-01-21 -gstabs+
+ pass "$name (FIXME v3 vtbl ptr)"
+ }
+ -re "$vhn = \{<vA> = \{va = 7, vx = 8\}, $re_vbptr_3 = $hex <VTT for vC>, vc = 9, vx = 10\}$nl$gdb_prompt $" {
+ # gcc 3.3.2 -gstabs+
+ pass $name
}
- -re ".* = \{\<vA\> = \{va = 7, vx = 8\}, ${vbptr}vA = $hex, vc = 9, vx = 10\}$nl$gdb_prompt $" {
- pass "print g_vC"
- }
- -re ".* = \{\<vA\> = \{va = 7, vx = 8\}, _vptr.vC = $hex, vc = 9, vx = 10\}$nl$gdb_prompt $" {
- pass "print g_vC (FIXME v3 vtbl ptr)"
- }
- -re ".* = \{\<vA\> = \{va = 7, vx = 8\}, _vptr.vC = $hex <VTT for vC>, vc = 9, vx = 10\}$nl$gdb_prompt $" {
- # Happens with gcc 3.3 -gstabs+
- # Does not happen with gcc 3.2.3 -gstabs+.
- # Does not happen gcc HEAD%20030624 (pre-3.4) -gstabs+.
- # -- chastain 2003-06-29
- pass "print g_vC"
- }
- -re ".*$gdb_prompt $" { fail "print g_vC" }
- timeout { fail "print g_vC (timeout)" }
}
}
-#
# Multiple virtual inheritance, print individual members.
-#
-proc test_print_mvi_members {} {
- global gdb_prompt
- global decimal
- global nl
+proc test_print_mvi_members { } {
+ global vhn
# Print all members of g_vD.
-
- send_gdb "print g_vD.vA::va\n"
- gdb_expect {
- -re ".* = 19$nl$gdb_prompt $" { pass "print g_vD.vA::va" }
- -re ".*virtual baseclass botch.*$gdb_prompt $" {
- # Does not happen with gcc cygnus-2.4.5-930828
- fail "print g_vD.vA::va (known bug with gcc cygnus-2.4.5-930417)"
- # Many of the rest of these tests have the same problem.
- return 0
- }
- -re ".*$gdb_prompt $" { fail "print g_vD.vA::va" }
- timeout { fail "print g_vD.vA::va (timeout)" ; return }
- }
-
- gdb_test "print g_vD.vA::vx" ".* = 20" "print g_vD.vA::vx"
-
- gdb_test "print g_vD.vB::vb" ".* = 21" "print g_vD.vB::vb"
-
- gdb_test "print g_vD.vB::vx" ".* = 22" "print g_vD.vB::vx"
-
- gdb_test "print g_vD.vC::vc" ".* = 23" "print g_vD.vC::vc"
-
- gdb_test "print g_vD.vC::vx" ".* = 24" "print g_vD.vC::vx"
-
- gdb_test "print g_vD.vD::vd" ".* = 25" "print g_vD.vD::vd"
-
- gdb_test "print g_vD.vD::vx" ".* = 26" "print g_vD.vD::vx"
+ gdb_test "print g_vD.vA::va" "$vhn = 19"
+ gdb_test "print g_vD.vA::vx" "$vhn = 20"
+ gdb_test "print g_vD.vB::vb" "$vhn = 21"
+ gdb_test "print g_vD.vB::vx" "$vhn = 22"
+ gdb_test "print g_vD.vC::vc" "$vhn = 23"
+ gdb_test "print g_vD.vC::vx" "$vhn = 24"
+ gdb_test "print g_vD.vD::vd" "$vhn = 25"
+ gdb_test "print g_vD.vD::vx" "$vhn = 26"
# Print all members of g_vE.
-
- gdb_test "print g_vE.vA::va" ".* = 0" "print g_vE.vA::va"
-
- gdb_test "print g_vE.vA::vx" ".* = 0" "print g_vE.vA::vx"
-
- gdb_test "print g_vE.vB::vb" ".* = 0" "print g_vE.vB::vb"
-
- gdb_test "print g_vE.vB::vx" ".* = 0" "print g_vE.vB::vx"
-
- gdb_test "print g_vE.vC::vc" ".* = 0" "print g_vE.vC::vc"
-
- gdb_test "print g_vE.vC::vx" ".* = 0" "print g_vE.vC::vx"
-
- gdb_test "print g_vE.vD::vd" ".* = 0" "print g_vE.vD::vd"
-
- gdb_test "print g_vE.vD::vx" ".* = 0" "print g_vE.vD::vx"
-
- gdb_test "print g_vE.vE::ve" ".* = 27" "print g_vE.vE::ve"
-
- gdb_test "print g_vE.vE::vx" ".* = 28" "print g_vE.vE::vx"
+ gdb_test "print g_vE.vA::va" "$vhn = 0"
+ gdb_test "print g_vE.vA::vx" "$vhn = 0"
+ gdb_test "print g_vE.vB::vb" "$vhn = 0"
+ gdb_test "print g_vE.vB::vx" "$vhn = 0"
+ gdb_test "print g_vE.vC::vc" "$vhn = 0"
+ gdb_test "print g_vE.vC::vx" "$vhn = 0"
+ gdb_test "print g_vE.vD::vd" "$vhn = 0"
+ gdb_test "print g_vE.vD::vx" "$vhn = 0"
+ gdb_test "print g_vE.vE::ve" "$vhn = 27"
+ gdb_test "print g_vE.vE::vx" "$vhn = 28"
}
-#
-# Multiple virtual inheritance, print type definitions.
-#
+# Multiple virtual inheritance, print complete classes.
-proc test_ptype_mvi {} {
+proc test_print_mvi_classes { } {
global gdb_prompt
+ global hex
global ws
global nl
- global vbptr
-
- send_gdb "ptype vD\n"
- gdb_expect {
- -re "type = class vD : public virtual vB, public virtual vC \{${ws}private:${ws}vC \\*${vbptr}vC;${ws}vB \\*${vbptr}vB;${ws}public:${ws}int vd;${ws}int vx;$nl.*\}.*$gdb_prompt $" {
- pass "ptype vD"
- }
- -re ".*class vD : public virtual vB, public virtual vC \{${ws}public:${ws}int vd;${ws}int vx;.*\}.*$gdb_prompt $" {
- pass "ptype vD"
- }
- -re ".*$gdb_prompt $" { fail "ptype vD" }
- timeout { fail "(timeout) ptype vD" }
- }
-
- send_gdb "ptype class vD\n"
- gdb_expect {
- -re "type = class vD : public virtual vB, public virtual vC \{${ws}private:${ws}vC \\*${vbptr}vC;${ws}vB \\*${vbptr}vB;${ws}public:${ws}int vd;${ws}int vx;$nl.*\}.*$gdb_prompt $" {
- pass "ptype class vD"
- }
- -re ".*class vD : public virtual vB, public virtual vC \{${ws}public:${ws}int vd;${ws}int vx;.*\}.*$gdb_prompt $" {
- pass "ptype class vD"
- }
- -re ".*$gdb_prompt $" { fail "ptype class vD" }
- timeout { fail "(timeout) ptype class vD" }
- }
-
- send_gdb "ptype g_vD\n"
- gdb_expect {
- -re "type = class vD : public virtual vB, public virtual vC \{${ws}private:${ws}vC \\*${vbptr}vC;${ws}vB \\*${vbptr}vB;${ws}public:${ws}int vd;${ws}int vx;$nl.*\}.*$gdb_prompt $" {
- pass "ptype g_vD"
- }
- -re ".*class vD : public virtual vB, public virtual vC \{${ws}public:${ws}int vd;${ws}int vx;\r\n.*\}.*$gdb_prompt $" {
- pass "ptype g_vD"
- }
- -re ".*$gdb_prompt $" { fail "ptype g_vD" }
- timeout { fail "(timeout) ptype g_vD" }
- }
-
- send_gdb "ptype vE\n"
- gdb_expect {
- -re "type = class vE : public virtual vD \{${ws}private:${ws}vD \\*${vbptr}vD;${ws}public:${ws}int ve;${ws}int vx;$nl.*\}.*$gdb_prompt $" {
- pass "ptype vE"
- }
- -re ".*class vE : public virtual vD \{${ws}public:${ws}int ve;${ws}int vx;\r\n.*\}.*$gdb_prompt $" {
- pass "ptype vE"
- }
- -re ".*$gdb_prompt $" { fail "ptype vE" }
- timeout { fail "(timeout) ptype vE" }
- }
+ global vhn
- send_gdb "ptype class vE\n"
- gdb_expect {
- -re "type = class vE : public virtual vD \{${ws}private:${ws}vD \\*${vbptr}vD;${ws}public:${ws}int ve;${ws}int vx;$nl.*\}.*$gdb_prompt $" {
- pass "ptype class vE"
- }
- -re "type = class vE : public virtual vD \{${ws}public:${ws}int ve;${ws}int vx;\r\n.*\}.*$gdb_prompt $" {
- pass "ptype class vE"
- }
- -re ".*$gdb_prompt $" { fail "ptype class vE" }
- timeout { fail "(timeout) ptype class vE" }
- }
+ # Virtual base pointers for everybody.
- send_gdb "ptype g_vE\n"
- gdb_expect {
- -re "type = class vE : public virtual vD \{${ws}private:${ws}vD \\*${vbptr}vD;${ws}public:${ws}int ve;${ws}int vx;$nl.*\}.*$gdb_prompt $" {
- pass "ptype g_vE"
- }
- -re "type = class vE : public virtual vD \{${ws}public:${ws}int ve;${ws}int vx;\r\n.*\}.*$gdb_prompt $" {
- pass "ptype g_vE"
- }
- -re ".*$gdb_prompt $" { fail "ptype g_vE" }
- timeout { fail "(timeout) ptype g_vE" }
- }
-}
-
-#
-# Multiple virtual inheritance, print complete classes.
-#
-
-proc test_print_mvi_classes {} {
- global gdb_prompt
- global hex
- global decimal
- global nl
- global vbptr
+ set re_vbptr_2_vA "(_vb.2vA|_vb.vA)"
+ set re_vbptr_2_vB "(_vb.2vB|_vb.vB)"
+ set re_vbptr_2_vC "(_vb.2vC|_vb.vC)"
+ set re_vbptr_2_vD "(_vb.2vD|_vb.vD)"
+ set re_vbptr_3_vA "_vptr.vA"
+ set re_vbptr_3_vB "_vptr.vB"
+ set re_vbptr_3_vC "_vptr.vC"
+ set re_vbptr_3_vD "_vptr.vD"
+ set re_vbptr_3_vE "_vptr.vE"
# Print all members of g_vD.
- send_gdb "print g_vD\n"
- gdb_expect {
- -re ".* = \{\<class vB\> = \{\<class vA\> = \{va = 19, vx = 20\}, vb = 21, vx = 22, Virtual table at $hex\}, \<class vC\> = \{vc = 23, vx = 24, Virtual table at $hex\}, vd = 25, vx = 26, Virtual table at $hex\}$nl$gdb_prompt $" {
- pass "print g_vD (aCC)"
- }
- -re ".* = \{\<class vB\> = \{\<class vA\> = \{va = 19, vx = 20\}, vb = 21, vx = 22, __vfp = $hex\}, \<class vC\> = \{vc = 23, vx = 24, __vfp = $hex\}, vd = 25, vx = 26, __vfp = $hex\}$nl$gdb_prompt $" {
- pass "print g_vD (aCC)"
+ set name "print g_vD"
+ gdb_test_multiple "print g_vD" $name {
+ -re "$vhn = \{<vB> = \{<vA> = \{va = 19, vx = 20\}, $re_vbptr_2_vA = $hex, vb = 21, vx = 22\}, <vC> = \{$re_vbptr_2_vA = $hex, vc = 23, vx = 24\}, $re_vbptr_2_vC = $hex, $re_vbptr_2_vB = $hex, vd = 25, vx = 26\}$nl$gdb_prompt $" {
+ # gcc 2.95.3 -gdwarf-2
+ # gcc 2.95.3 -gstabs+
+ pass $name
}
- -re ".* = \{\<vB\> = \{\<vA\> = \{va = 19, vx = 20\}, ${vbptr}vA = $hex, vb = 21, vx = 22\}, \<vC\> = \{${vbptr}vA = $hex, vc = 23, vx = 24\}, ${vbptr}vC = $hex, ${vbptr}vB = $hex, vd = 25, vx = 26\}$nl$gdb_prompt $" {
- pass "print g_vD"
+ -re "$vhn = \{<vB> = \{<vA> = \{va = 19, vx = 20\}, $re_vbptr_3_vB = $hex, vb = 21, vx = 22\}, <vC> = \{$re_vbptr_3_vC = $hex, vc = 23, vx = 24\}, $re_vbptr_3_vD = $hex, vd = 25, vx = 26\}$nl$gdb_prompt $" {
+ # gcc 3.3.2 -gdwarf-2
+ # gcc HEAD 2004-01-21 -gdwarf-2
+ # gcc HEAD 2004-01-21 -gstabs+
+ pass "$name (FIXME v3 vtbl ptr)"
}
- -re ".* = \{\<vB\> = \{\<vA\> = \{va = 19, vx = 20\}, _vptr.vB = $hex, vb = 21, vx = 22\}, \<vC\> = \{_vptr.vC = $hex, vc = 23, vx = 24\}, _vptr.vD = $hex, vd = 25, vx = 26\}$nl$gdb_prompt $" {
- pass "print g_vD (FIXME v3 vtbl ptr)"
+ -re "$vhn = \{<vB> = \{<vA> = \{va = 19, vx = 20\}, $re_vbptr_3_vB = $hex, vb = 21, vx = 22\}, <vC> = \{$re_vbptr_3_vC = $hex <VTT for vD>, vc = 23, vx = 24\}, $re_vbptr_3_vD = $hex, vd = 25, vx = 26\}$nl$gdb_prompt $" {
+ # gcc 3.3.2 -gstabs+
+ pass "$name"
}
- -re ".* = \{\<vB\> = \{\<vA\> = \{va = 19, vx = 20\}, _vptr.vB = $hex, vb = 21, vx = 22\}, \<vC\> = \{_vptr.vC = $hex <VTT for vD>, vc = 23, vx = 24\}, _vptr.vD = $hex, vd = 25, vx = 26\}$nl$gdb_prompt $" {
- # Happens with gcc 3.3 -gstabs+
- # Does not happen with gcc 3.2.3 -gstabs+.
- # Does not happen gcc HEAD%20030624 (pre-3.4) -gstabs+.
- # -- chastain 2003-06-29
- pass "print g_vD"
- }
- -re ".*invalid address 0x0.*$gdb_prompt $" {
- # Does not happen with gcc cygnus-2.4.5-930828
- fail "print g_vD (known bug with gcc cygnus-2.4.5-930417)"
- # Many of the rest of these tests have the same problem.
- return 0
- }
- -re ".*$gdb_prompt $" { fail "print g_vD" }
- timeout { fail "print g_vD (timeout)" ; return }
}
# Print all members of g_vE.
- send_gdb "print g_vE\n"
- gdb_expect {
- -re ".* = \{\<class vD\> = \{\<class vB\> = \{\<class vA\> = \{va = 0, vx = 0\}, vb = 0, vx = 0, Virtual table at $hex\}, \<class vC\> = \{vc = 0, vx = 0, Virtual table at $hex\}, vd = 0, vx = 0, Virtual table at $hex\}, ve = 27, vx = 28, Virtual table at $hex\}$nl$gdb_prompt $" {
- pass "print g_vE (aCC)"
- }
- -re ".* = \{\<class vD\> = \{\<class vB\> = \{\<class vA\> = \{va = 0, vx = 0\}, vb = 0, vx = 0, __vfp = $hex\}, \<class vC\> = \{vc = 0, vx = 0, __vfp = $hex\}, vd = 0, vx = 0, __vfp = $hex\}, ve = 27, vx = 28, __vfp = $hex\}$nl$gdb_prompt $" {
- pass "print g_vE (aCC)"
+ set name "print g_vE"
+ gdb_test_multiple "print g_vE" $name {
+ -re "$vhn = \{<vD> = \{<vB> = \{<vA> = \{va = 0, vx = 0\}, $re_vbptr_2_vA = $hex, vb = 0, vx = 0\}, <vC> = \{$re_vbptr_2_vA = $hex, vc = 0, vx = 0\}, $re_vbptr_2_vC = $hex, $re_vbptr_2_vB = $hex, vd = 0, vx = 0\}, $re_vbptr_2_vD = $hex, ve = 27, vx = 28\}$nl$gdb_prompt $" {
+ # gcc 2.95.3 -gdwarf-2
+ # gcc 2.95.3 -gstabs+
+ pass $name
}
- -re ".* = \{\<vD\> = \{\<vB\> = \{\<vA\> = \{va = 0, vx = 0\}, ${vbptr}vA = $hex, vb = 0, vx = 0\}, \<vC\> = \{${vbptr}vA = $hex, vc = 0, vx = 0\}, ${vbptr}vC = $hex, ${vbptr}vB = $hex, vd = 0, vx = 0\}, ${vbptr}vD = $hex, ve = 27, vx = 28\}$nl$gdb_prompt $" {
- pass "print g_vE"
+ -re "$vhn = \{<vD> = \{<vB> = \{<vA> = \{va = 0, vx = 0\}, $re_vbptr_3_vB = $hex, vb = 0, vx = 0\}, <vC> = \{$re_vbptr_3_vC = $hex, vc = 0, vx = 0\}, $re_vbptr_3_vD = $hex, vd = 0, vx = 0\}, $re_vbptr_3_vE = $hex, ve = 27, vx = 28\}$nl$gdb_prompt $" {
+ # gcc 3.3.2 -gdwarf-2
+ # gcc 3.3.2 -gstabs+
+ # gcc HEAD 2004-01-21 -gdwarf-2
+ # gcc HEAD 2004-01-21 -gstabs+
+ pass "$name (FIXME v3 vtbl ptr)"
}
- -re ".* = \{\<vD\> = \{\<vB\> = \{\<vA\> = \{va = 0, vx = 0\}, _vptr.vB = $hex *(\<VTT for vD\>)?, vb = 0, vx = 0\}, \<vC\> = \{_vptr.vC = $hex *(\<VTT for vD\>)?, vc = 0, vx = 0\}, _vptr.vD = $hex, vd = 0, vx = 0\}, _vptr.vE = $hex, ve = 27, vx = 28\}$nl$gdb_prompt $" {
- pass "print g_vE (FIXME v3 vtbl ptr)"
+ -re "$vhn = \{<vD> = \{<vB> = \{<vA> = \{va = 0, vx = 0\}, $re_vbptr_3_vB = $hex, vb = 0, vx = 0\}, <vC> = \{$re_vbptr_3_vC = $hex <VTT for vD>, vc = 0, vx = 0\}, $re_vbptr_3_vD = $hex, vd = 0, vx = 0\}, $re_vbptr_3_vE = $hex, ve = 27, vx = 28\}$nl$gdb_prompt $" {
+ # gcc 3.2.7-rh -gstabs+
+ pass "$name (FIXME v3 vtbl ptr)"
}
- -re ".*$gdb_prompt $" { fail "print g_vE" }
- timeout { fail "print g_vE (timeout)" }
}
}
-proc do_tests {} {
+proc do_tests { } {
global prms_id
global bug_id
global subdir
@@ -980,10 +1040,9 @@ proc do_tests {} {
gdb_test "set language c++" ""
gdb_test "set width 0" ""
- # Get the debug format for the compiled test case.
-
- if { ![ runto_main] } {
- gdb_suppress_tests;
+ if { ![runto_main] } then {
+ perror "couldn't run to main"
+ return
}
test_ptype_si
@@ -991,10 +1050,9 @@ proc do_tests {} {
test_ptype_vi
test_ptype_mvi
- gdb_stop_suppressing_tests;
-
- if { ![ runto 'inheritance2' ] } {
- gdb_suppress_tests;
+ if { ![runto 'inheritance2'] } then {
+ perror "couldn't run to inheritance2"
+ return
}
test_print_si_members
@@ -1003,10 +1061,9 @@ proc do_tests {} {
test_print_mi_classes
test_print_anon_union
- gdb_stop_suppressing_tests;
-
- if { ![ runto 'inheritance4' ] } {
- gdb_suppress_tests;
+ if { ![runto 'inheritance4'] } {
+ perror "couldn't run to inheritance4"
+ return
}
test_print_svi_members
diff --git a/gdb/testsuite/gdb.cp/local.exp b/gdb/testsuite/gdb.cp/local.exp
index 8888055..8654674 100644
--- a/gdb/testsuite/gdb.cp/local.exp
+++ b/gdb/testsuite/gdb.cp/local.exp
@@ -25,6 +25,9 @@
# This file is part of the gdb testsuite
+set ws "\[\r\n\t \]+"
+set nl "\[\r\n\]+"
+
if $tracelevel then {
strace $tracelevel
}
@@ -70,53 +73,104 @@ if ![runto 'marker1'] then {
gdb_test "up" ".*foobar.*" "up from marker1"
-# Local classes in g++ get names like "main.1::InnerLocal", just like local
-# static variables. Some targets use "___" instead of ".".
+set sep "(\[.\]|___)\[0-9\]"
-# ---
-# Pattern 1:
-# PASS
-# dwarf-2
-# gcc 2.95.3
+# ptype on a local variable.
#
-# Pattern 2:
-# FAIL
-# This has a duplicate "char loc_foo" line. This is a bug.
-# Historically this has been an XFAIL.
-# dwarf-2
-# gcc 2.96-rh, 3.0.4, gcc-3_1-branch, HEAD
+# This test has six arms. The first three arms accept normal output:
+# no synthetic methods; synthetic methods before user methods;
+# synthetic methods after user methods.
#
-# Pattern 3:
-# PASS
-# stabs+
-# gcc 2.95.3, 2.96-rh, 3.0.4, gcc-3_1-branch, HEAD
+# The next two arms accept "foobar__Fi.0::Local" instead of "Local".
+# This is a bug. It happens in various places with various versions of
+# gcc and gdb and various debugging types.
#
-# Pattern 4:
-# This an old pattern from the hppa aCC version of this file.
-# I left it alone.
+# The last arm accepts the user methods in duplicate. This bug happens
+# with gcc 3.3.2 -gdwarf-2, and has been fixed in gcc HEAD 2004-01-22.
#
-# chastain 2002-04-08
-
-# pattern #5
-# PASS
-# stabs+
-# gcc HEAD abi-2
-#
-# chastain 2004-01-02
+# -- chastain 2004-01-24
+
+set re_class "((struct|class) Local \{${ws}public:|struct Local \{)"
+set re_fields "int loc1;"
+set re_methods "char loc_foo\\(char\\);"
+set re_synth_gcc_23 "Local & operator=\\(Local const ?&\\);${ws}Local\\(Local const ?&\\);${ws}Local\\((void|)\\);"
+
+set XX_class "((struct|class) foobar__Fi.0::Local \{${ws}public:|struct foobar__Fi.0:Local \{)"
+set XX_synth_gcc_2 "Local & operator=\\(foobar__Fi.0::Local const ?&\\);${ws}Local\\(foobar__Fi.0::Local const ?&\\);${ws}Local\\((void|)\\);"
+set YY_methods "$re_methods${ws}$re_methods"
+
+set name "ptype l"
+gdb_test_multiple "ptype l" $name {
+ -re "type = $re_class${ws}$re_fields${ws}$re_methods$nl\}$nl$gdb_prompt $" {
+ # gdb 6.0, gcc 2.95.3, dwarf-2
+ # gdb 6.0, gcc HEAD 2004-01-22, dwarf-2
+ # gdb HEAD 2004-01-23, gcc HEAD 2004-01,22, dwarf-2
+ pass "$name"
+ }
+ -re "type = $re_class${ws}$re_fields${ws}$re_synth_gcc_23${ws}$re_methods$nl\}$nl$gdb_prompt $" {
+ # gdb 6.0, gcc 3.3.2, stabs+
+ # gdb HEAD 2004-01-23, gcc 3.3.2, stabs+
+ pass "$name"
+ }
+ -re "type = $re_class${ws}$re_fields${ws}$re_methods${ws}$re_synth_gcc_23${ws}$nl\}$nl$gdb_prompt $" {
+ # gdb 6.0, gcc HEAD 2004-01-22, stabs+
+ # gdb HEAD 2004-01-23, gcc HEAD 2004-01-22, stabs+
+ pass "$name"
+ }
+ -re "type = $XX_class${ws}$re_fields${ws}$re_methods$nl\}$nl$gdb_prompt $" {
+ # gdb HEAD 2004-01-23, gcc 2.95.3, dwarf-2
+ kfail "gdb/1516" "$name"
+ }
+ -re "type = ($re_class|$XX_class)${ws}$re_fields${ws}($re_synth_gcc_23|$XX_synth_gcc_2)${ws}$re_methods$nl\}$nl$gdb_prompt $" {
+ # gdb 6.0, gcc 2.95.3, stabs+
+ # gdb HEAD 2004-01-23, gcc 2.95.3, stabs+
+ kfail "gdb/1516" "$name"
+ }
+ -re "type = ($re_class|$XX_class)${ws}$re_fields${ws}$YY_methods$nl\}$nl$gdb_prompt $" {
+ # gdb 6.0, gcc 3.3.2, dwarf-2
+ # gdb HEAD 2004-01-23, gcc 3.2.2, dwarf-2
+ kfail "gdb/483" "$name"
+ }
+}
-set sep "(\[.\]|___)\[0-9\]"
+# This is the same test with "ptype Local" (the type name)
+# instead of "ptype l" (the variable name).
-send_gdb "ptype Local\n"
-gdb_expect {
- -re "type = class Local \{\[\r\n\t \]*public:\[\r\n\t \]*int loc1;\[\r\n\t \]*char loc_foo\\((const *|)char\\);\[\r\n\t \]*\}.*$gdb_prompt $" { pass "ptype Local" }
- -re "type = class Local \{\[\r\n\t \]*public:\[\r\n\t \]*int loc1;\[\r\n\t \]*char loc_foo\\((const *|)char\\);\[\r\n\t \]*char loc_foo\\((const *|)char\\);\[\r\n\t \]*\}.*$gdb_prompt $" {
- kfail "gdb/483" "ptype Local"
- }
- -re "type = class Local \{\[\r\n\t \]*public:\[\r\n\t \]*int loc1;\[\r\n\t \]*Local & operator *=\\((foobar__Fi${sep}::|)Local const *&\\);\[\r\n\t \]*Local\\((foobar__Fi${sep}::|)Local const *&\\);\[\r\n\t \]*Local\\((void|)\\);\[\r\n\t \]*char loc_foo\\(char\\);\[\r\n\t \]*\}.*$gdb_prompt $" { pass "ptype Local" }
- -re "type = class Local \{\r\n\[\t \]*public:\r\n\[\t \]*int loc1;\r\n\r\n\[\t \]*char loc_foo\\(char\\);\r\n\[\t \]*\\(Local at.*local\\.cc:\[0-9\]*\\)\r\n\}.*$gdb_prompt $" { xpass "ptype Local (old aCC)" }
- -re "type = class Local \{\[\r\n\t \]*public:\[\r\n\t \]*int loc1;\[\r\n\t \]*char loc_foo\\(char\\);\[\r\n\t \]*Local & operator *=\\((foobar__Fi${sep}::|)Local const *&\\);\[\r\n\t \]*Local\\((foobar__Fi${sep}::|)Local const *&\\);\[\r\n\t \]*Local\\((void|)\\);\[\r\n\t \]*\}.*$gdb_prompt $" { pass "ptype Local" }
- -re ".*$gdb_prompt $" { fail "ptype Local" }
- timeout { fail "(timeout) ptype Local" }
+set name "ptype Local"
+gdb_test_multiple "ptype Local" $name {
+ -re "type = $re_class${ws}$re_fields${ws}$re_methods$nl\}$nl$gdb_prompt $" {
+ # gdb 6.0, gcc 2.95.3, dwarf-2
+ # gdb 6.0, gcc HEAD 2004-01-22, dwarf-2
+ # gdb HEAD 2004-01-23, gcc HEAD 2004-01-22, dwarf-2
+ pass "$name"
+ }
+ -re "type = $re_class${ws}$re_fields${ws}$re_synth_gcc_23${ws}$re_methods$nl\}$nl$gdb_prompt $" {
+ # gdb 6.0, gcc 3.3.2, stabs+
+ # gdb HEAD 2004-01-23, gcc 3.3.2, stabs+
+ pass "$name"
+ }
+ -re "type = $re_class${ws}$re_fields${ws}$re_methods${ws}$re_synth_gcc_23${ws}$nl\}$nl$gdb_prompt $" {
+ # gdb 6.0, gcc HEAD 2004-01-22, stabs+
+ # gdb HEAD 2004-01-23, gcc HEAD 2004-01-22, stabs+
+ pass "$name"
+ }
+ -re "type = $XX_class${ws}$re_fields${ws}$re_methods$nl\}$nl$gdb_prompt $" {
+ kfail "gdb/1516" "$name"
+ }
+ -re "type = ($re_class|$XX_class)${ws}$re_fields${ws}($re_synth_gcc_23|$XX_synth_gcc_2)${ws}$re_methods$nl\}$nl$gdb_prompt $" {
+ # gdb 6.0, gcc 2.95.3, stabs+
+ # gdb HEAD 2004-01-23, gcc 2.95.3, stabs+
+ kfail "gdb/1516" "$name"
+ }
+ -re "type = ($re_class|$XX_class)${ws}$re_fields${ws}$YY_methods$nl\}$nl$gdb_prompt $" {
+ # gdb 6.0, gcc 3.3.2, dwarf-2
+ # gdb HEAD 2004-01-23, gcc 3.2.2, dwarf-2
+ kfail "gdb/483" "$name"
+ }
+ -re "No symbol \"Local\" in current context.$nl$gdb_prompt $" {
+ # gdb HEAD 2004-01-23, gcc 2.95.3, dwarf-2
+ fail "$name"
+ }
}
gdb_test "break marker2"
@@ -220,30 +274,28 @@ gdb_expect {
timeout { fail "(timeout) ptype NestedInnerLocal" }
}
-# gdb incorrectly interprets the NestedInnerLocal in
-# InnerLocal::NestedInnerLocal as field name instead of a type name;
-# See CLLbs14784.
+set re_class "((struct|class) InnerLocal::NestedInnerLocal \{${ws}public:|struct InnerLocal::NestedInnerLocal \{)"
+set re_fields "int nil;"
+set re_methods "int nil_foo\\(int\\);"
+set re_synth_gcc_23 "InnerLocal::NestedInnerLocal & operator=\\(InnerLocal::NestedInnerLocal const ?&\\);${ws}NestedInnerLocal\\(InnerLocal::NestedInnerLocal const ?&\\);${ws}NestedInnerLocal\\(\\);"
-#---
-# Pattern 3:
-# FAIL
-# The comment above, about CLLbs14784, is still correct.
-# dwarf-2
-# gcc 2.95.3, 2.96-rh, 3.0.4, gcc-3_1-branch, HEAD
-# stabs+
-# gcc 2.95.3, 2.96-rh, 3.0.4, gcc-3_1-branch, HEAD
-#
-# chastain 2002-04-08
-
-send_gdb "ptype InnerLocal::NestedInnerLocal\n"
-gdb_expect {
- -re "type = class InnerLocal::NestedInnerLocal \{\[\r\n\t \]*public:\[\r\n\t \]*int nil;\[\r\n\t \]*int nil_foo\\(int\\);\[\r\n\t \]*\}.*$gdb_prompt $" { pass "ptype InnerLocal::NestedInnerLocal" }
- -re "type = class InnerLocal::NestedInnerLocal \{\[\r\n\t \]*public:\[\r\n\t \]*int nil;\[\r\n\t \]*NestedInnerLocal *& *operator *= *\\((main${sep}::|)InnerLocal::NestedInnerLocal const *&\\);\[\r\n\t \]*NestedInnerLocal\\((main${sep}::|)InnerLocal::NestedInnerLocal const *&\\);\[\r\n\t \]*NestedInnerLocal\\((void|)\\);\[\r\n\t \]*int nil_foo\\(int\\);\[\r\n\t \]*\}.*$gdb_prompt $" { pass "ptype InnerLocal::NestedInnerLocal" }
- -re "There is no field named NestedInnerLocal.*$gdb_prompt $" {
- setup_kfail "gdb/482" *-*-*
- fail "ptype InnerLocal::NestedInnerLocal"
- }
- -re "No symbol .*NestedInnerLocal.* in current context.*$gdb_prompt $" { fail "ptype InnerLocal::NestedInnerLocal (bogus symbol lookup)" }
- -re ".*$gdb_prompt $" { fail "ptype InnerLocal::NestedInnerLocal" }
- timeout { fail "(timeout) ptype InnerLocal::NestedInnerLocal" }
+set name "ptype InnerLocal::NestedInnerLocal"
+gdb_test_multiple "ptype InnerLocal::NestedInnerLocal" $name {
+ -re "type = $re_class${ws}$re_fields${ws}$re_methods$nl\}$nl$gdb_prompt $" {
+ # gcc -gdwarf-2 should produce this but does not yet
+ pass $name
+ }
+ -re "type = $re_class${ws}$re_fields${ws}$re_synth_gcc_23${ws}$re_methods${ws}$nl\}$nl$gdb_prompt $" {
+ # gcc 2.95.3 -gstabs+
+ # gcc v3 -gstabs+, abi 1
+ pass $name
+ }
+ -re "type = $re_class${ws}$re_fields${ws}$re_methods${ws}$re_synth_gcc_23${ws}$nl\}$nl$gdb_prompt $" {
+ # gcc v3 -gstabs+, abi 2
+ pass $name
+ }
+ -re "There is no field named NestedInnerLocal.*$gdb_prompt $" {
+ # gcc v3 -gdwarf-2
+ kfail "gdb/482" $name
+ }
}
diff --git a/gdb/testsuite/gdb.cp/member-ptr.cc b/gdb/testsuite/gdb.cp/member-ptr.cc
index 4beb926..8851a85 100644
--- a/gdb/testsuite/gdb.cp/member-ptr.cc
+++ b/gdb/testsuite/gdb.cp/member-ptr.cc
@@ -1,3 +1,24 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 1998, 1999 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 */
+
extern "C" {
#include <stdio.h>
}
diff --git a/gdb/testsuite/gdb.cp/member-ptr.exp b/gdb/testsuite/gdb.cp/member-ptr.exp
index 8243785..83a70a0 100644
--- a/gdb/testsuite/gdb.cp/member-ptr.exp
+++ b/gdb/testsuite/gdb.cp/member-ptr.exp
@@ -1,4 +1,6 @@
-# Copyright 1998, 1999, 2003 Free Software Foundation, Inc.
+# Copyright 1998, 1999, 2003, 2004 Free Software Foundation, Inc.
+
+# This file is part of the gdb testsuite
# 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
@@ -16,27 +18,21 @@
# Please email any bugs, comments, and/or additions to this file to:
# bug-gdb@prep.ai.mit.edu
+
# Tests for pointer-to-member support
# Written by Satish Pai <pai@apollo.hp.com> 1997-08-19
+# Rewritten by Michael Chastain <mec.gnu@mindspring.com> 2004-01-11
-# This file is part of the gdb testsuite
+# TODO: copyright notice for member-ptr.cc
+set vhn "\\$\[0-9\]+"
if $tracelevel then {
- strace $tracelevel
- }
+ strace $tracelevel
+}
if { [skip_cplus_tests] } { continue }
-#
-# test running programs
-#
-
-# Start with a fresh gdb
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-
set prms_id 0
set bug_id 0
@@ -44,506 +40,586 @@ set testfile "member-ptr"
set srcfile ${testfile}.cc
set binfile ${objdir}/${subdir}/${testfile}
-# Create and source the file that provides information about the compiler
-# used to compile the test case.
-
if [get_compiler_info ${binfile} "c++"] {
return -1
}
-# Nearly all of these tests fail when compiled with G++, so just give up
-# until GDB gets enhanced. -sts 1999-06-22
-
-if { [test_compiler_info gcc-*] } then {
- continue
-}
-
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
-
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
-
if ![runto_main] then {
perror "couldn't run to breakpoint"
continue
}
-send_gdb "break 83\n"
-gdb_expect {
- -re "Breakpoint \[0-9\]*.*line 83\\.\r\n$gdb_prompt $" {
- pass "set break at 83"
- }
- -re ".*$gdb_prompt $" { fail "set break at 83" }
- timeout { fail "(timeout) set break at 83" }
-}
+gdb_breakpoint [gdb_get_line_number "pmi = NULL"]
+gdb_continue_to_breakpoint "continue to pmi = NULL"
-send_gdb "continue\n"
-gdb_expect {
- -re "Continuing\\.\r\n\r\nBreakpoint.*at.*member-ptr\\.cc:83\r\n83\[ \t]*pmi = NULL;\r\n$gdb_prompt $" {
- pass "continue to 83"
- }
- -re ".*$gdb_prompt $" { fail "continue to 83" }
- timeout { fail "(timeout) continue to 83" }
+# gcc is not ready for production
+# -- chastain 2004-01-12
+
+if { [test_compiler_info "gcc-*"] } {
+ continue
}
+# ======================
+# pointer to member data
+# ======================
+
# ptype on pointer to data member
-send_gdb "ptype pmi\n"
-gdb_expect {
- -re "type = int \\( A::\\*\\)\r\n$gdb_prompt $" {
- pass "ptype pmi"
+set name "ptype pmi (A::j)"
+gdb_test_multiple "ptype pmi" $name {
+ -re "type = int *\\( ?A::\\*\\)\r\n$gdb_prompt $" {
+ pass $name
+ }
+ -re "type = int *A::\r\n$gdb_prompt $" {
+ # gcc HEAD 2004-01-10 -gdwarf-2
+ # gcc HEAD 2004-01-10 -gstabs+
+ kfail "gdb/NNNN" $name
}
- -re ".*$gdb_prompt $" { fail "ptype pmi" }
- timeout { fail "(timeout) ptype pmi" }
}
# print pointer to data member
-setup_xfail "hppa*-*-*" CLLbs16901
-send_gdb "print pmi\n"
-gdb_expect {
- -re "\\$\[0-9\]* = \\(int \\( A::\\*\\)\\) &A::j\r\n$gdb_prompt $" {
- pass "print pmi"
+set name "print pmi (A::j) "
+gdb_test_multiple "print pmi" $name {
+ -re "$vhn = &A::j\r\n$gdb_prompt $" {
+ pass $name
+ }
+ -re "$vhn = \\(int ?\\( ?A::\\*\\)\\) &A::j\r\n$gdb_prompt $" {
+ pass $name
+ }
+ -re "$vhn = \\(int ?\\( ?A::\\*\\)\\) ?&A::j ?\\+ ?1 bytes\r\n$gdb_prompt $" {
+ # gcc 2.95.3 -gdwarf-2
+ kfail "gdb/NNNN" $name
+ }
+ -re "$vhn = &A::j ?\\+ ?1 bytes\r\n$gdb_prompt $" {
+ # gcc 2.95.3 -gstabs+
+ kfail "gdb/NNNN" $name
+ }
+ -re "$vhn = not implemented: member type in c_val_print\r\n$gdb_prompt $" {
+ # gcc HEAD 2004-01-11 05:33:21 -gdwarf-2
+ # gcc HEAD 2004-01-11 05:33:21 -gstabs+
+ kfail "gdb/NNNN" $name
+ }
+ -re "$vhn = \\(int ?\\( A::\\*\\)\\) 536870920\r\n$gdb_prompt $" {
+ # the value is 0x20000008 hex. 0x20000000 is an internal flag.
+ # Use '|' to add in more values as needed.
+ # hpacc A.03.45
+ kfail "gdb/NNNN" $name
}
- -re ".*$gdb_prompt $" { fail "print pmi" }
- timeout { fail "(timeout) print pmi" }
}
-
# print dereferenced pointer to data member
-setup_xfail "hppa*-*-*" CLLbs16901
-send_gdb "print a.*pmi\n"
-gdb_expect {
- -re "\\$\[0-9\]* = 121\r\n$gdb_prompt $" {
- pass "print a.*pmi"
+set name "print a.*pmi (A::j)"
+gdb_test_multiple "print a.*pmi" $name {
+ -re "$vhn = 121\r\n$gdb_prompt $" {
+ pass $name
+ }
+ -re "$vhn = 855638016\r\n$gdb_prompt $" {
+ # gcc 2.95.3 -gdwarf-2
+ # gcc 2.95.3 -gstabs+
+ kfail "gdb/NNNN" $name
+ }
+ -re "not implemented: member types in unpack_long\r\n$gdb_prompt $" {
+ # gcc HEAD 2004-01-10 -gdwarf-2
+ # gcc HEAD 2004-01-10 -gstabs+
+ kfail "gdb/NNNN" $name
}
- -re ".*$gdb_prompt $" { fail "print a.*pmi" }
- timeout { fail "(timeout) print a.*pmi" }
}
# print dereferenced pointer to data member
# this time, dereferenced through a pointer
-setup_xfail "hppa*-*-*" CLLbs16901
-send_gdb "print a_p->*pmi\n"
-gdb_expect {
- -re "\\$\[0-9\]* = 121\r\n$gdb_prompt $" {
- pass "print a->*pmi"
+set name "print a_p->*pmi (A::j)"
+gdb_test_multiple "print a_p->*pmi" $name {
+ -re "$vhn = 121\r\n$gdb_prompt $" {
+ pass $name
+ }
+ -re "$vhn = 855638016\r\n$gdb_prompt $" {
+ # gcc 2.95.3 -gdwarf-2
+ # gcc 2.95.3 -gstabs+
+ kfail "gdb/NNNN" $name
+ }
+ -re "not implemented: member types in unpack_long\r\n$gdb_prompt $" {
+ # gcc HEAD 2004-01-10 -gdwarf-2
+ # gcc HEAD 2004-01-10 -gstabs+
+ kfail "gdb/NNNN" $name
}
- -re ".*$gdb_prompt $" { fail "print a->*pmi" }
- timeout { fail "(timeout) print a->*pmi" }
}
+# set the pointer to a different data member
-# set the pointer to data member
-
-send_gdb "set var pmi = &A::jj\n"
-gdb_expect {
- -re "$gdb_prompt $" {
- pass "set var (not really a pass)"
+set name "set var pmi = &A::jj"
+gdb_test_multiple "set var pmi = &A::jj" $name {
+ -re "Invalid cast.\r\n$gdb_prompt $" {
+ # gcc HEAD 2004-01-10 -gdwarf-2
+ # gcc HEAD 2004-01-10 -gstabs+
+ kfail "gdb/NNNN" $name
+ }
+ -re "set var pmi = &A::jj\r\n$gdb_prompt $" {
+ # I have to match the echo'ed input explicitly here.
+ # If I leave it out, the pattern becomes too general
+ # and matches anything that ends in "$gdb_prompt $".
+ pass $name
}
- timeout { fail "(timeout) " }
}
-# Now print the pointer again
+# print the pointer again
-send_gdb "print pmi\n"
-gdb_expect {
- -re "\\$\[0-9\]* = \\(int \\( A::\\*\\)\\) &A::jj\r\n$gdb_prompt $" {
- pass "print pmi after setting"
+set name "print pmi (A::jj)"
+gdb_test_multiple "print pmi" $name {
+ -re "$vhn = &A::jj\r\n$gdb_prompt $" {
+ pass $name
+ }
+ -re "$vhn = \\(int ?\\( ?A::\\*\\)\\) &A::jj\r\n$gdb_prompt $" {
+ pass $name
+ }
+ -re "$vhn = not implemented: member type in c_val_print\r\n$gdb_prompt $" {
+ # gcc HEAD 2004-01-11 05:33:21 -gdwarf-2
+ # gcc HEAD 2004-01-11 05:33:21 -gstabs+
+ kfail "gdb/NNNN" $name
+ }
+ -re "$vhn = \\(int ?\\( A::\\*\\)\\) 536870924\r\n$gdb_prompt $" {
+ # the value is 0x20000008 hex. 0x20000000 is an internal flag.
+ # Use '|' to add in more values as needed.
+ # hpacc A.03.45
+ kfail "gdb/NNNN" $name
}
- -re ".*$gdb_prompt $" { fail "print pmi after setting" }
- timeout { fail "(timeout) print pmi after setting" }
}
# print dereferenced pointer to data member again
-send_gdb "print a.*pmi\n"
-gdb_expect {
- -re "\\$\[0-9\]* = 1331\r\n$gdb_prompt $" {
- pass "print a.*pmi after setting"
+set name "print a.*pmi (A::jj)"
+gdb_test_multiple "print a.*pmi" $name {
+ -re "$vhn = 1331\r\n$gdb_prompt $" {
+ pass $name
+ }
+ -re "not implemented: member types in unpack_long\r\n$gdb_prompt $" {
+ # gcc HEAD 2004-01-10 -gdwarf-2
+ # gcc HEAD 2004-01-10 -gstabs+
+ kfail "gdb/NNNN" $name
}
- -re ".*$gdb_prompt $" { fail "print a.*pmi after setting" }
- timeout { fail "(timeout) print a.*pmi after setting" }
}
# set the pointer to data member back to A::j
-send_gdb "set var pmi = &A::j\n"
-gdb_expect {
- -re "$gdb_prompt $" {
- pass "set var back to A::j (not really a pass)"
+set name "set var pmi = &A::j"
+gdb_test_multiple "set var pmi = &A::j" $name {
+ -re "Invalid cast.\r\n$gdb_prompt $" {
+ # gcc HEAD 2004-01-10 -gdwarf-2
+ # gcc HEAD 2004-01-10 -gstabs+
+ kfail "gdb/NNNN" $name
+ }
+ -re "set var pmi = &A::j\r\n$gdb_prompt $" {
+ # I have to match the echo'ed input explicitly here.
+ # If I leave it out, the pattern becomes too general
+ # and matches anything that ends in "$gdb_prompt $".
+ pass $name
}
- timeout { fail "(timeout) set var pmi" }
}
# print dereferenced pointer to data member yet again (extra check, why not)
-send_gdb "print a.*pmi\n"
-gdb_expect {
- -re "\\$\[0-9\]* = 121\r\n$gdb_prompt $" {
- pass "print a.*pmi after resetting"
+set name "print a.*pmi (A::j) (again)"
+gdb_test_multiple "print a.*pmi" $name {
+ -re "$vhn = 121\r\n$gdb_prompt $" {
+ pass $name
+ }
+ -re "not implemented: member types in unpack_long\r\n$gdb_prompt $" {
+ # gcc HEAD 2004-01-10 -gdwarf-2
+ # gcc HEAD 2004-01-10 -gstabs+
+ kfail "gdb/NNNN" $name
}
- -re ".*$gdb_prompt $" { fail "print a.*pmi after resetting" }
- timeout { fail "(timeout) print a.*pmi after resetting" }
}
# Set the data member pointed to.
-send_gdb "print a.*pmi = 33\n"
-gdb_expect {
- -re "\\$\[0-9\]* = 33\r\n$gdb_prompt $" {
- pass "print command to set"
+set name "print a.*pmi = 33"
+gdb_test_multiple "print a.*pmi = 33" $name {
+ -re "$vhn = 33\r\n$gdb_prompt $" {
+ pass $name
+ }
+ -re "not implemented: member types in unpack_long\r\n$gdb_prompt $" {
+ # gcc HEAD 2004-01-10 -gdwarf-2
+ # gcc HEAD 2004-01-10 -gstabs+
+ kfail "gdb/NNNN" $name
}
- -re ".*$gdb_prompt $" { fail "print command to set" }
- timeout { fail "(timeout) print command to set" }
}
# Now check that the data really was changed
-send_gdb "print a.*pmi\n"
-gdb_expect {
- -re "\\$\[0-9\]* = 33\r\n$gdb_prompt $" {
- pass "print a.*pmi after setting member pointed to"
- }
- -re ".*$gdb_prompt $" { fail "print a.*pmi after setting member pointed to" }
- timeout { fail "(timeout) print a.*pmi after setting member pointed to" }
-}
-# Double-check by printing a.
-setup_xfail "hppa*-*-*" CLLbs16901
-send_gdb "print a\n"
-gdb_expect {
- -re "\\$\[0-9\]* = \{c = 120 'x', j = 33, jj = 1331, static s = 10, Virtual table at $hex\}\r\n$gdb_prompt $" {
- pass "print a after setting member pointed to by pmi"
+set name "print a.*pmi (A::j) (33)"
+gdb_test_multiple "print a.*pmi" $name {
+ -re "$vhn = 33\r\n$gdb_prompt $" {
+ pass $name
+ }
+ -re "not implemented: member types in unpack_long\r\n$gdb_prompt $" {
+ # gcc HEAD 2004-01-10 -gdwarf-2
+ # gcc HEAD 2004-01-10 -gstabs+
+ kfail "gdb/NNNN" $name
}
- -re ".*$gdb_prompt $" { fail "print a after setting member pointed to by pmi" }
- timeout { fail "(timeout) print a after setting member pointed to by pmi" }
}
+# Double-check by printing a.
-# Set the data member pointed to, using ->*
-
-send_gdb "print a_p->*pmi = 44\n"
-gdb_expect {
- -re "\\$\[0-9\]* = 44\r\n$gdb_prompt $" {
- pass "print command to set (->)"
+set name "print a (j = 33)"
+gdb_test_multiple "print a" $name {
+ -re "$vhn = \{c = 120 'x', j = 33, jj = 1331, (static|static int) s = 10, (_vptr.A|_vptr\\$) = ($hex|$hex <A virtual table>)\}\r\n$gdb_prompt $" {
+ pass $name
}
- -re ".*$gdb_prompt $" { fail "print command to set (->)" }
- timeout { fail "(timeout) print command to set (->)" }
-}
-
-# Now check that the data really was changed
-send_gdb "print a_p->*pmi\n"
-gdb_expect {
- -re "\\$\[0-9\]* = 44\r\n$gdb_prompt $" {
- pass "print a_p->*pmi after setting member pointed to"
+ -re "$vhn = \{c = 120 'x', j = 33, jj = 1331, (static|static int) s = 10, Virtual table at $hex\}\r\n$gdb_prompt $" {
+ pass $name
}
- -re ".*$gdb_prompt $" { fail "print a_p->*pmi after setting member pointed to" }
- timeout { fail "(timeout) print a_p->*pmi after setting member pointed to" }
-}
-
-# Double-check by printing a.
-setup_xfail "hppa*-*-*" CLLbs16901
-send_gdb "print a\n"
-gdb_expect {
- -re "\\$\[0-9\]* = \{c = 120 'x', j = 44, jj = 1331, static s = 10, Virtual table at $hex\}\r\n$gdb_prompt $" {
- pass "print a after setting member pointed to by pmi (->) "
+ -re "$vhn = \{(_vptr.A|_vptr\\$) = $hex, c = 120 'x', j = 33, jj = 1331, (static|static int) s = 10\}\r\n$gdb_prompt $" {
+ pass $name
+ }
+ -re "$vhn = \{(_vptr.A|_vptr\\$) = $hex, c = 120 'x', j = 121, jj = 1331, (static|static int) s = 10\}\r\n$gdb_prompt $" {
+ # gcc HEAD 2004-01-10 -gdwarf-2
+ # gcc HEAD 2004-01-10 -gstabs+
+ kfail "gdb/NNNN" $name
}
- -re ".*$gdb_prompt $" { fail "print a after setting member pointed to by pmi (->) " }
- timeout { fail "(timeout) print a after setting member pointed to by pmi (->) " }
}
+# Set the data member pointed to, using ->*
-# Do a ptype on the dereferenced pointer to member
-# pai/1997-08-20 Doesn't work
-
-# send_gdb "ptype a.*pmi\n"
-# gdb_expect {
-# -re "type = int\r\n$gdb_prompt $" {
-# pass "ptype a.*pmi"
-# }
-# -re ".*$gdb_prompt $" { fail "ptype a.*pmi" }
-# timeout { fail "(timeout) ptype a.*pmi" }
-#}
-
-# Try to dereference the pointer to data member without any object
-
-send_gdb "print *pmi\n"
-gdb_expect {
- -re "Attempt to dereference pointer to member without an object\r\n$gdb_prompt $" {
- pass "attempt to print ptr to member without object"
+set name "print a_p->*pmi = 44"
+gdb_test_multiple "print a_p->*pmi = 44" $name {
+ -re "$vhn = 44\r\n$gdb_prompt $" {
+ pass $name
+ }
+ -re "not implemented: member types in unpack_long\r\n$gdb_prompt $" {
+ # gcc HEAD 2004-01-10 -gdwarf-2
+ # gcc HEAD 2004-01-10 -gstabs+
+ kfail "gdb/NNNN" $name
}
- -re ".*$gdb_prompt $" { fail "attempt to print ptr to member without object" }
- timeout { fail "(timeout) attempt to print ptr to member without object" }
}
-# Try to ptype a dereference of the pointer to data member without any object
+# Check that the data really was changed
-send_gdb "ptype *pmi\n"
-gdb_expect {
- -re "Attempt to dereference pointer to member without an object\r\n$gdb_prompt $" {
- pass "attempt to ptype ptr to member without object"
+set name "print a_p->*pmi (44)"
+gdb_test_multiple "print a_p->*pmi" $name {
+ -re "$vhn = 44\r\n$gdb_prompt $" {
+ pass $name
+ }
+ -re "not implemented: member types in unpack_long\r\n$gdb_prompt $" {
+ # gcc HEAD 2004-01-10 -gdwarf-2
+ # gcc HEAD 2004-01-10 -gstabs+
+ kfail "gdb/NNNN" $name
}
- -re ".*$gdb_prompt $" { fail "attempt to ptype ptr to member without object" }
- timeout { fail "(timeout) attempt to ptype ptr to member without object" }
}
-# Ptype a pointer to a method.
+# Double-check by printing a.
-setup_xfail "hppa*-*-*" CLLbs16901
-send_gdb "ptype pmf\n"
-gdb_expect {
- -re "type = int \\( A::\\*\\)\\(\\.\\.\\.\\)\r\n$gdb_prompt $" {
- pass "ptype pmf"
+set name "print a (j = 44)"
+gdb_test_multiple "print a" $name {
+ -re "$vhn = \{c = 120 'x', j = 44, jj = 1331, (static|static int) s = 10, (_vptr.A|_vptr\\$) = ($hex|$hex <A virtual table>)\}\r\n$gdb_prompt $" {
+ pass $name
+ }
+ -re "$vhn = \{c = 120 'x', j = 44, jj = 1331, (static|static int) s = 10, Virtual table at $hex\}\r\n$gdb_prompt $" {
+ pass $name
+ }
+ -re "$vhn = \{(_vptr.A|_vptr\\$) = $hex, c = 120 'x', j = 44, jj = 1331, (static|static int) s = 10\}\r\n$gdb_prompt $" {
+ pass $name
+ }
+ -re "$vhn = \{(_vptr.A|_vptr\\$) = $hex, c = 120 'x', j = 121, jj = 1331, (static|static int) s = 10\}\r\n$gdb_prompt $" {
+ # gcc HEAD 2004-01-10 -gdwarf-2
+ # gcc HEAD 2004-01-10 -gstabs+
+ kfail "gdb/NNNN" $name
}
- -re ".*$gdb_prompt $" { fail "ptype pmf" }
- timeout { fail "(timeout) ptype pmf" }
}
-# print a pointer to a method
+# ptype the dereferenced pointer to member.
-setup_xfail "hppa*-*-*" CLLbs16901
-send_gdb "print pmf\n"
-gdb_expect {
- -re "\\$\[0-9\]* = \\(int \\( A::\\*\\)\\(\\.\\.\\.\\)\\) \\?\\? <not supported with HP aCC>\r\n$gdb_prompt $" {
- pass "print pmf"
+set name "ptype a.*pmi"
+gdb_test_multiple "ptype a.*pmi" $name {
+ -re "type = int\r\n$gdb_prompt" {
+ pass $name
+ }
+ -re "not implemented: member types in unpack_long\r\n$gdb_prompt $" {
+ # gcc HEAD 2004-01-10 -gdwarf-2
+ # gcc HEAD 2004-01-10 -gstabs+
+ kfail "gdb/NNNN" $name
}
- -re ".*$gdb_prompt $" { fail "print pmf" }
- timeout { fail "(timeout) print pmf" }
}
+# dereference the pointer to data member without any object
+# this is not allowed: a pmi must be bound to an object to dereference
-# Ptype a pointer to a pointer to a method
-
-setup_xfail "hppa*-*-*" CLLbs16901
-send_gdb "ptype pmf_p\n"
-gdb_expect {
- -re "type = int \\( A::\\*\\*\\)\\(\\.\\.\\.\\)\r\n$gdb_prompt $" {
- pass "ptype pmf_p"
+set name "print *pmi"
+gdb_test_multiple "print *pmi" $name {
+ -re "Attempt to dereference pointer to member without an object\r\n$gdb_prompt $" {
+ pass $name
+ }
+ -re "Cannot access memory at address 0x4\r\n$gdb_prompt $" {
+ # gcc 2.95.3 -gstabs+
+ kfail "gdb/NNNN" $name
+ }
+ -re "Cannot access memory at address 0x8\r\n$gdb_prompt $" {
+ # gcc 3.3.2 -gdwarf-2
+ # gcc 3.3.2 -gstabs+
+ kfail "gdb/NNNN" $name
}
- -re ".*$gdb_prompt $" { fail "ptype pmf_p" }
- timeout { fail "(timeout) ptype pmf_p" }
}
-# print a pointer to a pointer to a method
+# dereference the pointer to data member without any object
+# this is not allowed: a pmi must be bound to an object to dereference
-setup_xfail "hppa*-*-*" CLLbs16901
-send_gdb "print pmf_p\n"
-gdb_expect {
- -re "\\$\[0-9\]* = \\(int \\( A::\\*\\*\\)\\(\\.\\.\\.\\)\\) $hex\r\n$gdb_prompt $" {
- pass "print pmf_p"
+set name "ptype *pmi"
+gdb_test_multiple "ptype *pmi" $name {
+ -re "Attempt to dereference pointer to member without an object\r\n$gdb_prompt $" {
+ pass $name
+ }
+ -re "type = int A::\r\n$gdb_prompt $" {
+ # gcc 2.95.3 -gstabs+
+ # gcc HEAD 2004-01-10 -gdwarf-2
+ # gcc HEAD 2004-01-10 -gstabs+
+ kfail "gdb/NNNN" $name
}
- -re ".*$gdb_prompt $" { fail "print pmf_p" }
- timeout { fail "(timeout) print pmf_p" }
}
-# print dereferenced pointer to method
+# Check cast of pointer to member to integer.
+# This is similar to "offset-of".
+# such as "A a; print (size_t) &A.j - (size_t) &A".
-setup_xfail "hppa*-*-*" CLLbs16901
-send_gdb "print a.*pmf\n"
-gdb_expect {
- -re "Pointers to methods not supported with HP aCC\r\n$gdb_prompt $" {
- pass "print a.*pmf (known aCC limitation)"
+set name "print (int) pmi"
+gdb_test_multiple "print (int) pmi" $name {
+ -re "$vhn = (4|8)\r\n$gdb_prompt" {
+ pass $name
}
- -re ".*$gdb_prompt $" { fail "print a.*pmf" }
- timeout { fail "(timeout) print a.*pmf" }
}
-# print dereferenced pointer to method, using ->*
+# Check "(int) pmi" explicitly for equality.
-setup_xfail "hppa*-*-*" CLLbs16901
-send_gdb "print a_p->*pmf\n"
-gdb_expect {
- -re "Pointers to methods not supported with HP aCC\r\n$gdb_prompt $" {
- pass "print a_p->*pmf (known aCC limitation)"
+set name "print ((int) pmi) == ((char *) &a.j - (char *) &a)"
+gdb_test_multiple "print ((int) pmi) == ((char *) &a.j - (char *) & a)" $name {
+ -re "$vhn = true\r\n$gdb_prompt" {
+ pass $name
}
- -re ".*$gdb_prompt $" { fail "print a_p->*pmf" }
- timeout { fail "(timeout) print a_p->*pmf" }
}
-# set the pointer to data member
+# ==========================
+# pointer to member function
+# ==========================
+
+# ptype a pointer to a method
-setup_xfail "hppa*-*-*"
-send_gdb "set var pmf = &A::foo\n"
-gdb_expect {
- -re "Assignment to pointers to methods not implemented with HP aCC\r\n$gdb_prompt $" {
- pass "set var pmf (known aCC limitation)"
+set name "ptype pmf"
+gdb_test_multiple "ptype pmf" $name {
+ -re "type = int \\( ?A::\\*\\)\\(int\\)\r\n$gdb_prompt $" {
+ pass $name
+ }
+ -re "type = int \\( ?A::\\*\\)\\(void\\)\r\n$gdb_prompt $" {
+ # hpacc A.03.45
+ kfail "gdb/NNNN" $name
+ }
+ -re "type = struct \{.*\}\r\n$gdb_prompt $" {
+ # gcc 2.95.3 -gdwarf-2
+ # gcc 2.95.3 -gstabs+
+ # gcc 3.2.2 -gdwarf-2
+ # gcc 3.2.2 -gstabs+
+ # gcc HEAD 2004-01-10 -gdwarf-2
+ # gcc HEAD 2004-01-10 -gstabs+
+ kfail "gdb/NNNN" $name
}
- -re ".*$gdb_prompt $" { fail "set var pmf" }
- timeout { fail "(timeout) set var pmf" }
}
-# Try to dereference the pointer to method without any object
+# print a pointer to a method
-setup_xfail "hppa*-*-*" CLLbs16901
-send_gdb "print *pmf\n"
-gdb_expect {
- -re "Attempt to dereference pointer to member without an object\r\n$gdb_prompt $" {
- pass "attempt to print ptr to method without object"
+set name "print pmf"
+gdb_test_multiple "print pmf" $name {
+ -re "$vhn = &A::bar\r\n$gdb_prompt $" {
+ pass $name
+ }
+ -re "$vhn = .*not supported with HP aCC.*\r\n$gdb_prompt $" {
+ # hpacc A.03.45
+ kfail "gdb/NNNN" $name
+ }
+ -re "$vhn = \{.*\}\r\n$gdb_prompt $" {
+ # gcc 2.95.3 -gdwarf-2
+ # gcc 2.95.3 -gstabs+
+ # gcc 3.2.2 -gdwarf-2
+ # gcc 3.2.2 -gstabs+
+ # gcc HEAD 2004-01-10 -gdwarf-2
+ # gcc HEAD 2004-01-10 -gstabs+
+ kfail "gdb/NNNN" $name
}
- -re ".*$gdb_prompt $" { fail "attempt to print ptr to method without object" }
- timeout { fail "(timeout) attempt to print ptr to method without object" }
}
-# Try to ptype a dereference of the pointer to method without any object
+# ptype a pointer to a pointer to a method
-send_gdb "ptype *pmi\n"
-gdb_expect {
- -re "Attempt to dereference pointer to member without an object\r\n$gdb_prompt $" {
- pass "attempt to ptype ptr to member without object"
+set name "ptype pmf_p"
+gdb_test_multiple "ptype pmf_p" $name {
+ -re "type = int \\( ?A::\\*\\*\\)\\(int\\)\r\n$gdb_prompt $" {
+ pass $name
}
- -re ".*$gdb_prompt $" { fail "attempt to ptype ptr to member without object" }
- timeout { fail "(timeout) attempt to ptype ptr to member without object" }
-}
-
-# Check cast of pointer to member to integer
-setup_xfail "hppa*-*-*" CLLbs16901
-send_gdb "print (int) pmi\n"
-gdb_expect {
- -re "\\$\[0-9\]* = 8\r\n$gdb_prompt $" {
- pass "casting pmi to int"
+ -re "type = int \\( ?A::\\*\\*\\)\\(void\\)\r\n$gdb_prompt $" {
+ # hpacc A.03.45
+ kfail "gdb/NNNN" $name
}
- -re ".*$gdb_prompt $" { fail "casting pmi to int" }
- timeout { fail "(timeout) casting pmi to int" }
-}
-
-# Check cast of pointer to method to integer
-setup_xfail "hppa*-*-*" CLLbs16901
-send_gdb "print (int) pmf\n"
-gdb_expect {
- -re "Pointers to methods not supported with HP aCC\r\n$gdb_prompt $" {
- pass "casting pmf to int (known aCC limitation)"
+ -re "type = struct \{.*\} \\*\r\n$gdb_prompt $" {
+ # gcc 2.95.3 -gdwarf-2
+ # gcc 2.95.3 -gstabs+
+ # gcc 3.2.2 -gdwarf-2
+ # gcc 3.2.2 -gstabs+
+ # gcc HEAD 2004-01-10 -gdwarf-2
+ # gcc HEAD 2004-01-10 -gstabs+
+ kfail "gdb/NNNN" $name
}
- -re ".*$gdb_prompt $" { fail "casting pmf to int" }
- timeout { fail "(timeout) casting pmf to int" }
}
-# Try to invoke a function through a pointer to data member
-setup_xfail "hppa*-*-*" CLLbs16901
-send_gdb "print (a.*pmi)(3)\n"
-gdb_expect {
- -re "Not implemented: function invocation through pointer to method with HP aCC\r\n$gdb_prompt $" {
- pass "print (a.*pmi)(3) -- error message should be different"
- }
- -re ".*$gdb_prompt $" { fail "print (a.*pmi)(3)" }
- timeout { fail "(timeout) print (a.*pmi)(3)" }
-}
+# print a pointer to a pointer to a method
-# Try to invoke a function through a pointer to a method
-setup_xfail "hppa*-*-*" CLLbs16901
-send_gdb "print (a.*pmf)(3)\n"
-gdb_expect {
- -re "Not implemented: function invocation through pointer to method with HP aCC\r\n$gdb_prompt $" {
- pass "print (a.*pmi)(3) -- known aCC limitation"
+set name "print pmf_p"
+gdb_test_multiple "print pmf_p" $name {
+ -re "$vhn = \\(int \\( ?A::\\*\\*\\)\\)\\(int\\)\\) $hex\r\n$gdb_prompt $" {
+ pass $name
+ }
+ -re "$vhn = \\(PMF \\*\\) $hex\r\n$gdb_prompt $" {
+ pass "gdb/NNNN"
+ }
+ -re "$vhn = \\(int \\( ?A::\\*\\*\\)\\(void\\)\\) $hex\r\n$gdb_prompt $" {
+ # hpacc A.03.45
+ kfail "gdb/NNNN" $name
+ }
+ -re "$vhn = \\(struct \{.*\} \\*\\) $hex\r\n$gdb_prompt $" {
+ # gcc 2.95.3 -gdwarf-2
+ kfail "gdb/NNNN" $name
}
- -re ".*$gdb_prompt $" { fail "print (a.*pmf)(3)" }
- timeout { fail "(timeout) print (a.*pmf)(3)" }
}
+# print dereferenced pointer to method
-# Go past assignment of NULL to pmi
-setup_xfail "hppa*-*-*" CLLbs16901
-send_gdb "next\n"
-gdb_expect {
- -re "\r\n85\[ \t\]*k = \\(a.\\*pmf\\)\\(3\\);\r\n$gdb_prompt $" {
- pass "next past 83"
+set name "print a.*pmf"
+gdb_test_multiple "print a.*pmf" $name {
+ -re "$vhn = \\(int \\(\\*\\)\\(int\\)\\) $hex <A::bar\\(int\\)>\r\n$gdb_prompt$ " {
+ pass $name
+ }
+ -re "Pointers to methods not supported with HP aCC\r\n$gdb_prompt $" {
+ # hpacc A.03.45
+ kfail "gdb/NNNN" $name
+ }
+ -re "Value can't be converted to integer.\r\n$gdb_prompt $" {
+ # gcc 2.95.3 -gdwarf-2
+ # gcc 2.95.3 -gstabs+
+ # gcc 3.2.2 -gdwarf-2
+ # gcc 3.2.2 -gstabs+
+ # gcc HEAD 2004-01-10 -gdwarf-2
+ # gcc HEAD 2004-01-10 -gstabs+
+ kfail "gdb/NNNN" $name
}
- -re ".*$gdb_prompt $" { fail "next past 83" }
- timeout { fail "(timeout) next past 83" }
}
-#send_gdb "print pmi\n"
-#gdb_expect {
-# -re "Attempted dereference of null pointer-to-member\r\n$gdb_prompt $" {
-# pass ""
-# }
-# -re ".*$gdb_prompt $" { fail "" }
-# timeout { fail "(timeout) " }
-#}
+# print dereferenced pointer to method, using ->*
-# Dereference the null pointer to member
-setup_xfail "hppa*-*-*" CLLbs16901
-send_gdb "print a.*pmi\n"
-gdb_expect {
- -re "Attempted dereference of null pointer-to-member\r\n$gdb_prompt $" {
- pass "print a.*NULL"
+set name "print a_p->*pmf"
+gdb_test_multiple "print a_p->*pmf" $name {
+ -re "$vhn = \\(int \\(\\*\\)\\(int\\)\\) $hex <A::bar\\(int\\)>\r\n$gdb_prompt$ " {
+ pass $name
+ }
+ -re "Pointers to methods not supported with HP aCC\r\n$gdb_prompt $" {
+ # hpacc A.03.45
+ kfail "gdb/NNNN" $name
+ }
+ -re "Value can't be converted to integer.\r\n$gdb_prompt $" {
+ # gcc 2.95.3 -gdwarf-2
+ # gcc 2.95.3 -gstabs+
+ # gcc 3.2.2 -gdwarf-2
+ # gcc 3.2.2 -gstabs+
+ # gcc HEAD 2004-01-10 -gdwarf-2
+ # gcc HEAD 2004-01-10 -gstabs+
+ kfail "gdb/NNNN" $name
}
- -re ".*$gdb_prompt $" { fail "print a.*NULL" }
- timeout { fail "(timeout) print a.*NULL" }
}
+# set the pointer to data member
-# Go to another part of the program
-send_gdb "break 91\n"
-gdb_expect {
- -re "Breakpoint \[0-9\]*.*line 91\\.\r\n$gdb_prompt $" {
- pass "set break at 91"
+set name "set var pmf = &A::foo"
+gdb_test_multiple "set var pmf = &A::foo" $name {
+ -re "set var pmf = &A::foo\r\n$gdb_prompt $" {
+ # I have to match the echo'ed input explicitly here.
+ # If I leave it out, the pattern becomes too general
+ # and matches anything that ends in "$gdb_prompt $".
+ pass $name
}
- -re ".*$gdb_prompt $" { fail "set break at 91" }
- timeout { fail "(timeout) set break at 91" }
-}
-
-setup_xfail "hppa*-*-*" CLLbs16901
-send_gdb "continue\n"
-gdb_expect {
- -re "Continuing\\.\r\n\r\nBreakpoint.*at.*member-ptr\\.cc:91\r\n91\[ \t]*k = \\(a.\\*pmf\\)\\(4\\);\r\n$gdb_prompt $" {
- pass "continue to 91"
+ -re "Invalid cast.\r\n$gdb_prompt $" {
+ # gcc 2.95.3 -gdwarf-2
+ # gcc 2.95.3 -gstabs+
+ # gcc 3.2.2 -gdwarf-2
+ # gcc 3.2.2 -gstabs+
+ # gcc HEAD 2004-01-10 -gdwarf-2
+ # gcc HEAD 2004-01-10 -gstabs+
+ kfail "gdb/NNNN" $name
+ }
+ -re "Assignment to pointers to methods not implemented with HP aCC\r\n$gdb_prompt $" {
+ kfail "gdb/NNNN" $name
}
- -re ".*$gdb_prompt $" { fail "continue to 91" }
- timeout { fail "(timeout) continue to 91" }
}
+# dereference the pointer to data member without any object
+# this is not allowed: a pmf must be bound to an object to dereference
-# Now check again that pmi works even when not set to
-# something that's at the beginning of the object
-
-setup_xfail "hppa*-*-*" CLLbs16901
-send_gdb "print pmi\n"
-gdb_expect {
- -re "\\$\[0-9\]* = \\(int \\( A::\\*\\)\\) &A::jj\r\n$gdb_prompt $" {
- pass "print pmi (2)"
+set name "print *pmf"
+gdb_test_multiple "print *pmf" $name {
+ -re "Attempt to dereference pointer to member without an object\r\n$gdb_prompt $" {
+ pass $name
+ }
+ -re "Structure has no component named operator\\*.\r\n$gdb_prompt $" {
+ # gcc 2.95.3 -gdwarf-2
+ # gcc 2.95.3 -gstabs+
+ # gcc 3.3.2 -gdwarf-2
+ # gcc 3.3.2 -gstabs+
+ # gcc HEAD 2004-01-10 -gdwarf-2
+ # gcc HEAD 2004-01-10 -gstabs+
+ kfail "gdb/NNNN" $name
}
- -re ".*$gdb_prompt $" { fail "print pmi (2)" }
- timeout { fail "(timeout) print pmi (2)" }
}
+# dereference the pointer to data member without any object
+# this is not allowed: a pmf must be bound to an object to dereference
-# print dereferenced pointer to data member
-
-setup_xfail "hppa*-*-*" CLLbs16901
-send_gdb "print a.*pmi\n"
-gdb_expect {
- -re "\\$\[0-9\]* = 1331\r\n$gdb_prompt $" {
- pass "print a.*pmi (2)"
+set name "ptype *pmf"
+gdb_test_multiple "ptype *pmf" $name {
+ -re "Attempt to dereference pointer to member without an object\r\n$gdb_prompt $" {
+ pass $name
+ }
+ -re "Structure has no component named operator\\*.\r\n$gdb_prompt $" {
+ # gcc 2.95.3 -gdwarf-2
+ # gcc 2.95.3 -gstabs+
+ # gcc 3.3.2 -gdwarf-2
+ # gcc 3.3.2 -gstabs+
+ # gcc HEAD 2004-01-10 -gdwarf-2
+ # gcc HEAD 2004-01-10 -gstabs+
+ kfail "gdb/NNNN" $name
}
- -re ".*$gdb_prompt $" { fail "print a.*pmi (2)" }
- timeout { fail "(timeout) print a.*pmi (2)" }
}
-# print dereferenced pointer to data member
-# this time, dereferenced through a pointer
+# Call a function through a pmf.
-setup_xfail "hppa*-*-*" CLLbs16901
-send_gdb "print a_p->*pmi\n"
-gdb_expect {
- -re "\\$\[0-9\]* = 1331\r\n$gdb_prompt $" {
- pass "print a->*pmi"
+set name "print (a.*pmf)(3)"
+gdb_test_multiple "print (a.*pmf)(3)" $name {
+ -re "$vhn = 50\r\n$gdb_prompt $" {
+ pass $name
+ }
+ -re "Not implemented: function invocation through pointer to method with HP aCC\r\n$gdb_prompt $" {
+ # hpacc A.03.45
+ kfail "gdb/NNNN" $name
+ }
+ -re "Value can't be converted to integer.\r\n$gdb_prompt $" {
+ # gcc 2.95.3 -gdwarf-2
+ # gcc 2.95.3 -gstabs+
+ # gcc 3.3.2 -gdwarf-2
+ # gcc 3.3.2 -gstabs+
+ # gcc HEAD 2004-01-10 -gdwarf-2
+ # gcc HEAD 2004-01-10 -gstabs+
+ kfail "gdb/NNNN" $name
}
- -re ".*$gdb_prompt $" { fail "print a->*pmi (2)" }
- timeout { fail "(timeout) print a->*pmi (2)" }
}
-
-
-# p a.*pmf - fail
-
-# p pmi
-
-# p a.*pmi
-
diff --git a/gdb/testsuite/gdb.cp/namespace.cc b/gdb/testsuite/gdb.cp/namespace.cc
index a0814ee..ee55168 100644
--- a/gdb/testsuite/gdb.cp/namespace.cc
+++ b/gdb/testsuite/gdb.cp/namespace.cc
@@ -88,6 +88,22 @@ namespace C
int c = 1;
int shadow = 12;
+ class CClass {
+ public:
+ int x;
+ class NestedClass {
+ public:
+ int y;
+ };
+ };
+
+ void ensureRefs () {
+ // NOTE (2004-04-23, carlton): This function is here only to make
+ // sure that GCC 3.4 outputs debug info for these classes.
+ static CClass *c = new CClass();
+ static CClass::NestedClass *n = new CClass::NestedClass();
+ }
+
namespace
{
int cX = 6;
diff --git a/gdb/testsuite/gdb.cp/namespace.exp b/gdb/testsuite/gdb.cp/namespace.exp
index fda393e..eb03a3e 100644
--- a/gdb/testsuite/gdb.cp/namespace.exp
+++ b/gdb/testsuite/gdb.cp/namespace.exp
@@ -26,7 +26,7 @@
# Note: The original tests were geared to the HP aCC compiler,
# which has an idiosyncratic way of emitting debug info
# for namespaces.
-# Note: As of 2000-06-03, these pass under g++ - djb
+# Note: As of 2000-06-03, they passed under g++ - djb
if $tracelevel then {
@@ -83,7 +83,7 @@ if ![runto 'marker1'] then {
gdb_test "up" ".*main.*" "up from marker1"
# Access a data item inside a namespace using colons and
-# single quotes :-(
+# single quotes. :-(
# NOTE: carlton/2003-09-24: the quotes are becoming less necessary (or
# even desirable.) For tests where it should still work with quotes,
@@ -215,6 +215,15 @@ gdb_expect {
timeout { fail "(timeout) print 'BBB::Class::xyzq'" }
}
+send_gdb "print BBB::Class::xyzq\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = \{char \\((BBB::|)Class \\*( const|), (char|int)\\)\} $hex <BBB::Class::xyzq\\(char\\)>\r\n$gdb_prompt $" {
+ pass "print BBB::Class::xyzq"
+ }
+ -re ".*$gdb_prompt $" { fail "print BBB::Class::xyzq" }
+ timeout { fail "(timeout) print BBB::Class::xyzq" }
+}
+
# Break on a function in a class in a namespace
send_gdb "break BBB::Class::xyzq\n"
@@ -240,15 +249,35 @@ gdb_test "print cc" "No symbol \"cc\" in current context."
gdb_test "print 'C::cc'" "\\$\[0-9\].* = 2"
gdb_test "print C::cc" "\\$\[0-9\].* = 2"
gdb_test "print cd" "\\$\[0-9\].* = 3"
-gdb_test "print C::D::cd" "No type \"D\" in namespace \"C::C\"."
+gdb_test "print C::D::cd" "No type \"D\" within class or namespace \"C::C\"."
gdb_test "print 'E::cde'" "\\$\[0-9\].* = 5"
gdb_test "print E::cde" "\\$\[0-9\].* = 5"
gdb_test "print shadow" "\\$\[0-9\].* = 13"
gdb_test "print E::ce" "No symbol \"ce\" in namespace \"C::D::E\"."
-gdb_test "print cOtherFile" "\\$\[0-9\].* = 316"
gdb_test "ptype C" "type = namespace C::C"
gdb_test "ptype E" "type = namespace C::D::E"
+gdb_test "ptype CClass" "type = class C::CClass \{\r\n public:\r\n int x;\r\n\}"
+gdb_test "ptype CClass::NestedClass" "type = class C::CClass::NestedClass \{\r\n public:\r\n int y;\r\n\}"
+gdb_test "ptype NestedClass" "No symbol \"NestedClass\" in current context."
+setup_kfail "gdb/1448" "*-*-*"
+gdb_test "ptype ::C::CClass" "type = class C::CClass \{\r\n public:\r\n int x;\r\n\}"
+setup_kfail "gdb/1448" "*-*-*"
+gdb_test "ptype ::C::CClass::NestedClass" "type = class C::CClass::NestedClass \{\r\n public:\r\n int y;\r\n\}"
+setup_kfail "gdb/1448" "*-*-*"
+gdb_test "ptype ::C::NestedClass" "No symbol \"NestedClass\" in namespace \"C\"."
+gdb_test "ptype C::CClass" "No symbol \"CClass\" in namespace \"C::C\"."
+gdb_test "ptype C::CClass::NestedClass" "No type \"CClass\" within class or namespace \"C::C\"."
+gdb_test "ptype C::NestedClass" "No symbol \"NestedClass\" in namespace \"C::C\"."
+
+# Tests involving multiple files
+
+gdb_test "print cOtherFile" "\\$\[0-9\].* = 316"
+gdb_test "ptype OtherFileClass" "type = class C::OtherFileClass \{\r\n public:\r\n int z;\r\n\}"
+setup_kfail "gdb/1448" "*-*-*"
+gdb_test "ptype ::C::OtherFileClass" "type = class C::OtherFileClass \{\r\n public:\r\n int z;\r\n\}"
+gdb_test "ptype C::OtherFileClass" "No symbol \"OtherFileClass\" in namespace \"C::C\"."
+
# Some anonymous namespace tests.
gdb_test "print cX" "\\$\[0-9\].* = 6"
diff --git a/gdb/testsuite/gdb.cp/namespace1.cc b/gdb/testsuite/gdb.cp/namespace1.cc
index 4a5900a..53b3e57 100644
--- a/gdb/testsuite/gdb.cp/namespace1.cc
+++ b/gdb/testsuite/gdb.cp/namespace1.cc
@@ -1,4 +1,4 @@
-/* Copyright 2003 Free Software Foundation, Inc.
+/* Copyright 2003, 2004 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
@@ -19,6 +19,17 @@
namespace C
{
+ class OtherFileClass {
+ public:
+ int z;
+ };
+
+ void ensureOtherRefs () {
+ // NOTE (2004-04-23, carlton): This function is here only to make
+ // sure that GCC 3.4 outputs debug info for this class.
+ static OtherFileClass *c = new OtherFileClass();
+ }
+
namespace {
int cXOtherFile = 29;
};
diff --git a/gdb/testsuite/gdb.cp/overload.cc b/gdb/testsuite/gdb.cp/overload.cc
index 56afc96..a41e14d 100644
--- a/gdb/testsuite/gdb.cp/overload.cc
+++ b/gdb/testsuite/gdb.cp/overload.cc
@@ -53,6 +53,31 @@ int intToChar (char c)
void marker1()
{}
+// Now test how overloading and namespaces interact.
+
+class dummyClass {};
+
+dummyClass dummyInstance;
+
+int overloadNamespace(int i)
+{
+ return 1;
+}
+
+int overloadNamespace(dummyClass d)
+{
+ return 2;
+}
+
+namespace XXX {
+ int overloadNamespace (char c)
+ {
+ return 3;
+ }
+
+ void marker2() {}
+}
+
int main ()
{
char arg2 = 2;
@@ -81,7 +106,8 @@ int main ()
intToChar(1);
marker1(); // marker1-returns-here
- return 0; // marker1-returns-here
+ XXX::marker2(); // marker1-returns-here
+ return 0;
}
foo::foo (int i) { ifoo = i; ccpfoo = NULL; }
diff --git a/gdb/testsuite/gdb.cp/overload.exp b/gdb/testsuite/gdb.cp/overload.exp
index 2925b50..5ce9f81 100644
--- a/gdb/testsuite/gdb.cp/overload.exp
+++ b/gdb/testsuite/gdb.cp/overload.exp
@@ -296,6 +296,21 @@ gdb_test "list \"foo::overloadfnarg(int, int (*)(int))\"" \
"int foo::overloadfnarg.*\\(int arg, int \\(\\*foo\\) \\(int\\)\\).*" \
"list overloaded function with function ptr args - quotes around argument"
+# Now some tests to see how overloading and namespaces interact.
+
+gdb_test "print overloadNamespace(1)" ".\[0-9\]* = 1"
+gdb_test "print overloadNamespace('a')" ".\[0-9\]* = 1"
+gdb_test "print overloadNamespace(dummyInstance)" ".\[0-9\]* = 2"
+
+if ![runto 'XXX::marker2'] then {
+ perror "couldn't run to XXX::marker2"
+ continue
+}
+
+gdb_test "print overloadNamespace(1)" ".\[0-9\]* = 3" "print overloadNamespace(1) in XXX"
+gdb_test "print overloadNamespace('a')" ".\[0-9\]* = 3" "print overloadNamespace('a') in XXX"
+gdb_test "print overloadNamespace(dummyInstance)" ".\[0-9\]* = 2" "print overloadNamespace(dummyInstance) in XXX"
+
# One last mysterious test.
# I wonder what this is for?
diff --git a/gdb/testsuite/gdb.cp/rtti.exp b/gdb/testsuite/gdb.cp/rtti.exp
index 6177f80..0a8a2d7 100644
--- a/gdb/testsuite/gdb.cp/rtti.exp
+++ b/gdb/testsuite/gdb.cp/rtti.exp
@@ -1,4 +1,4 @@
-# Copyright 2003 Free Software Foundation, Inc.
+# Copyright 2003, 2004 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
@@ -46,8 +46,9 @@ 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}"
+# gdb_get_line_number needs this to be called srcfile. Except that it
+# gets confused if the directories are included. :-(
+set srcfile "${testfile}1.cc"
if { [gdb_compile "${srcfile1}" "${objfile1}" object {debug c++}] != "" } {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
@@ -78,8 +79,8 @@ if ![runto_main] then {
# 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_breakpoint [gdb_get_line_number "main-constructs-done"]
+gdb_continue_to_breakpoint "end of constructors in main"
gdb_test_multiple "print *e1" "print *e1" {
-re "warning: RTTI symbol not found for class 'n1::D1'.*$gdb_prompt $" {
@@ -102,15 +103,14 @@ gdb_test_multiple "print *e1" "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.
+# NOTE: carlton/2004-01-14: This test 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; this should arrive with GCC
+# 3.4.
gdb_test_multiple "print *e2" "print *e2" {
-re "warning: RTTI symbol not found for class 'n2::D2'.*$gdb_prompt $" {
@@ -122,8 +122,7 @@ gdb_test_multiple "print *e2" "print *e2" {
kfail "gdb/488" "print *e2"
}
-re "\\$\[0-9\]* = <incomplete type>\r\n$gdb_prompt $" {
- # See above NOTE.
- fail "print *e2"
+ kfail "gdb/1511" "print *e2"
}
-re "\\$\[0-9\]* = {<n2::Base2> = .*}\r\n$gdb_prompt $" {
pass "print *e2"
@@ -133,5 +132,13 @@ gdb_test_multiple "print *e2" "print *e2" {
}
}
+# Now we test the hack that's been implemented to get around some
+# instances of PR gdb/1511.
+
+gdb_breakpoint [gdb_get_line_number "func-constructs-done"]
+gdb_continue_to_breakpoint "end of constructors in func"
+
+gdb_test "print *obj" "\\$\[0-9\]* = {<n2::Base2> = .*}"
+
gdb_exit
return 0
diff --git a/gdb/testsuite/gdb.cp/rtti1.cc b/gdb/testsuite/gdb.cp/rtti1.cc
index 6e9d862..de8e12f 100644
--- a/gdb/testsuite/gdb.cp/rtti1.cc
+++ b/gdb/testsuite/gdb.cp/rtti1.cc
@@ -1,6 +1,6 @@
/* Code to go along with tests in rtti.exp.
- Copyright 2003 Free Software Foundation, Inc.
+ Copyright 2003, 2004 Free Software Foundation, Inc.
Contributed by David Carlton <carlton@bactrian.org> and by Kealia,
Inc.
@@ -55,6 +55,26 @@ namespace n1 {
} // n1
+// NOTE: carlton/2004-01-23: This call exists only to convince GCC to
+// keep around a reference to 'obj' in n2::func - GCC 3.4 had been
+// optimizing it away.
+void refer_to (n2::C2 *obj)
+{
+ // Do nothing.
+}
+
+namespace n2
+{
+ void func ()
+ {
+ C2 *obj = create2 ();
+
+ refer_to (obj); // func-constructs-done
+
+ return;
+ }
+}
+
int main()
{
using namespace n1;
@@ -63,5 +83,7 @@ int main()
C1 *e1 = create1();
C2 *e2 = create2();
- return 0; // constructs-done
+ n2::func(); // main-constructs-done
+
+ return 0;
}
diff --git a/gdb/testsuite/gdb.cp/templates.exp b/gdb/testsuite/gdb.cp/templates.exp
index 8f94790..0f7a573 100644
--- a/gdb/testsuite/gdb.cp/templates.exp
+++ b/gdb/testsuite/gdb.cp/templates.exp
@@ -52,7 +52,7 @@ proc test_ptype_of_templates {} {
send_gdb "ptype T5<int>\n"
gdb_expect {
- -re "type = class T5<int> \\{${ws}public:${ws}static int X;${ws}int x;${ws}int val;${ws}(T5<int> & operator=\\(T5<int> const ?&\\);${ws})?T5\\(int\\);${ws}T5\\((T5<int> const|const T5<int>) ?&\\);${ws}~T5\\((void|)\\);${ws}static void \\* operator new\\(unsigned( int| long)?\\);${ws}static void operator delete\\(void ?\\*\\);${ws}int value\\((void|)\\);${ws}\\}\r\n$gdb_prompt $" {
+ -re "type = class T5<int> \{${ws}public:${ws}static int X;${ws}int x;${ws}int val;${ws}T5<int> & operator=\\(T5<int> const ?&\\);${ws}T5\\(int\\);${ws}T5\\((T5<int> const|const T5<int>) ?&\\);${ws}~T5\\((void|)\\);${ws}static void \\* operator new\\(unsigned( int| long)?\\);${ws}static void operator delete\\(void ?\\*\\);${ws}int value\\((void|)\\);${ws}\}\r\n$gdb_prompt $" {
pass "ptype T5<int>"
}
-re "type = class T5<int> \{${ws}public:${ws}static int X;${ws}int x;${ws}int val;${ws}T5\\(int\\);${ws}T5\\((T5<int> const|const T5<int>) ?&\\);${ws}~T5\\((void|)\\);${ws}static void \\* operator new\\(unsigned( int| long)?\\);${ws}static void operator delete\\(void ?\\*\\);${ws}int value\\((void|)\\);${ws}T5<int> & operator=\\(T5<int> const ?&\\);${ws}\}\r\n$gdb_prompt $" {
@@ -60,10 +60,10 @@ proc test_ptype_of_templates {} {
}
-re "type = class T5<int> \\{${ws}public:${ws}static int X;${ws}int x;${ws}int val;${ws}${ws}T5 \\(int\\);${ws}T5 \\(const class T5<int> &\\);${ws}void ~T5 \\(int\\);${ws}static void \\* new \\(unsigned int\\);${ws}static void delete \\(void ?\\*\\);${ws}int value \\((void|)\\);${ws}\\}${ws}$gdb_prompt $" { pass "ptype T5<int> -- new with unsigned int" }
-re "type = class T5<int> \\{.*public:.*static int X;.*int x;.*int val;.*T5 \\(int\\);.*T5 \\(const class T5<int> &\\);.*void ~T5 \\(int\\);.*static void \\* new \\(unsigned long\\);.*static void delete \\(void ?\\*\\);.*int value \\((void|)\\);.*\\}\r\n$gdb_prompt $" { pass "ptype T5<int> -- new with unsigned long" }
- -re "type = class T5<int> \\{${ws}public:${ws}static int X;${ws}int x;${ws}int val;((${ws}T5<int> & operator=\\(T5<int> const ?&\\);)|(${ws}T5\\(int\\);)|(${ws}T5\\((T5<int> const|const T5<int>) ?&\\);)|(${ws}~T5\\((void|)\\);)|(${ws}static void \\* operator new\\(unsigned( int| long)?\\);)|(${ws}static void operator delete\\(void ?\\*\\);)|(${ws}int value\\((void|)\\);))*${ws}\\}\r\n$gdb_prompt $" {
+ -re "type = class T5<int> \{${ws}public:${ws}static int X;${ws}int x;${ws}int val;((${ws}T5<int> & operator=\\(T5<int> const ?&\\);)|(${ws}T5\\(int\\);)|(${ws}T5\\((T5<int> const|const T5<int>) ?&\\);)|(${ws}~T5\\((void|)\\);)|(${ws}static void \\* operator new\\(unsigned( int| long)?\\);)|(${ws}static void operator delete\\(void ?\\*\\);)|(${ws}int value\\((void|)\\);))*${ws}\}\r\n$gdb_prompt $" {
pass "ptype T5<int> (obsolescent gcc or gdb)"
}
- -re "type = class T5<int> \\{${ws}public:${ws}static int X;${ws}int x;${ws}int val;${ws}void T5\\(int\\);${ws}void T5\\((T5<int> const|const T5<int>) ?&\\);${ws}~T5\\(int\\);${ws}static void \\* operator new\\(unsigned( int| long|)\\);${ws}static void operator delete\\(void ?\\*\\);${ws}int value\\((void|)\\);${ws}\\}\r\n$gdb_prompt $" {
+ -re "type = class T5<int> \{${ws}public:${ws}static int X;${ws}int x;${ws}int val;${ws}void T5\\(int\\);${ws}void T5\\((T5<int> const|const T5<int>) ?&\\);${ws}~T5\\(int\\);${ws}static void \\* operator new\\(unsigned( int| long|)\\);${ws}static void operator delete\\(void ?\\*\\);${ws}int value\\((void|)\\);${ws}\}\r\n$gdb_prompt $" {
# This also triggers gdb/1113...
kfail "gdb/1111" "ptype T5<int>"
}
@@ -80,19 +80,19 @@ proc test_ptype_of_templates {} {
-re "type = class T5<int> \\{${ws}public:${ws}static int X;${ws}int x;${ws}int val;\r\n${ws}T5\\(int\\);${ws}T5\\(T5<int> const ?&\\);${ws}~T5\\((void|)\\);${ws}static void \\* operator new\\(unsigned( int| long)?\\);${ws}static void operator delete\\(void ?\\*\\);${ws}int value\\((void|)\\);${ws}\\}\r\n$gdb_prompt $" { pass "ptype T5<int> -- with several fixes from 4.17" }
-re "type = class T5<int> \\{${ws}public:${ws}static int X;${ws}int x;${ws}int val;\r\n${ws}T5 \\(int\\);${ws}T5 \\(const class T5<int> &\\);${ws}void ~T5 \\(int\\);${ws}static void \\* new \\(unsigned int\\);${ws}static void delete \\(void ?\\*\\);${ws}int value \\((void|)\\);${ws}\\}\r\n$gdb_prompt $" { pass "ptype t5i<int> -- new with unsigned int" }
-re "type = class T5<int> \\{${ws}public:${ws}static int X;${ws}int x;${ws}int val;\r\n${ws}T5 \\(int\\);${ws}T5 \\(const class T5<int> &\\);${ws}void ~T5 \\(int\\);${ws}static void \\* new \\(unsigned long\\);${ws}static void delete \\(void ?\\*\\);${ws}int value \\((void|)\\);${ws}\\}\r\n$gdb_prompt $" { pass "ptype t5i<int> -- new with unsigned long" }
- -re "type = class T5<int> \\{.*public:.*static int X;.*int x;.*int val;.*.*T5 \\(int\\);.*.*void ~T5 \\(int\\).*.*.*int value \\((void|)\\);.*\\}.*$gdb_prompt $" {
+ -re "type = class T5<int> \{.*public:.*static int X;.*int x;.*int val;.*.*T5 \\(int\\);.*.*void ~T5 \\(int\\).*.*.*int value \\((void|)\\);.*\}.*$gdb_prompt $" {
pass "ptype t5i"
}
- -re "type = class T5<int> \\{${ws}public:${ws}static int X;${ws}int x;${ws}int val;${ws}(T5<int> & operator=\\(T5<int> const ?&\\);${ws})?T5\\(int\\);${ws}T5\\((T5<int> const|const T5<int>) ?&\\);${ws}~T5\\((void|)\\);${ws}static void \\* operator new\\(unsigned( int| long)?\\);${ws}static void operator delete\\(void ?\\*\\);${ws}int value\\((void|)\\);${ws}\\}\r\n$gdb_prompt $" {
+ -re "type = class T5<int> \{${ws}public:${ws}static int X;${ws}int x;${ws}int val;${ws}T5<int> & operator=\\(T5<int> const ?&\\);${ws}T5\\(int\\);${ws}T5\\((T5<int> const|const T5<int>) ?&\\);${ws}~T5\\((void|)\\);${ws}static void \\* operator new\\(unsigned( int| long)?\\);${ws}static void operator delete\\(void ?\\*\\);${ws}int value\\((void|)\\);${ws}\}\r\n$gdb_prompt $" {
pass "ptype t5i"
}
- -re "type = class T5<int> \\{${ws}public:${ws}static int X;${ws}int x;${ws}int val;${ws}T5\\(int\\);${ws}T5\\((T5<int> const|const T5<int>) ?&\\);${ws}~T5\\((void|)\\);${ws}static void \\* operator new\\(unsigned( int| long)?\\);${ws}static void operator delete\\(void ?\\*\\);${ws}int value\\((void|)\\);${ws}T5<int> & operator=\\(T5<int> const ?&\\);${ws}\\}\r\n$gdb_prompt $" {
+ -re "type = class T5<int> \{${ws}public:${ws}static int X;${ws}int x;${ws}int val;${ws}T5\\(int\\);${ws}T5\\((T5<int> const|const T5<int>) ?&\\);${ws}~T5\\((void|)\\);${ws}static void \\* operator new\\(unsigned( int| long)?\\);${ws}static void operator delete\\(void ?\\*\\);${ws}int value\\((void|)\\);${ws}T5<int> & operator=\\(T5<int> const ?&\\);${ws}\}\r\n$gdb_prompt $" {
pass "ptype t5i"
}
- -re "type = class T5<int> \\{${ws}public:${ws}static int X;${ws}int x;${ws}int val;((${ws}T5<int> & operator=\\(T5<int> const ?&\\);)|(${ws}T5\\(int\\);)|(${ws}T5\\(T5<int> const ?&\\);)|(${ws}~T5\\((void|)\\);)|(${ws}static void \\* operator new\\(unsigned( int| long)?\\);)|(${ws}static void operator delete\\(void ?\\*\\);)|(${ws}int value\\((void|)\\);))*${ws}\\}\r\n$gdb_prompt $" {
+ -re "type = class T5<int> \{${ws}public:${ws}static int X;${ws}int x;${ws}int val;((${ws}T5<int> & operator=\\(T5<int> const ?&\\);)|(${ws}T5\\(int\\);)|(${ws}T5\\(T5<int> const ?&\\);)|(${ws}~T5\\((void|)\\);)|(${ws}static void \\* operator new\\(unsigned( int| long)?\\);)|(${ws}static void operator delete\\(void ?\\*\\);)|(${ws}int value\\((void|)\\);))*${ws}\}\r\n$gdb_prompt $" {
pass "ptype t5i (obsolescent gcc or gdb)"
}
- -re "type = class T5<int> \\{${ws}public:${ws}static int X;${ws}int x;${ws}int val;${ws}void T5\\(int\\);${ws}void T5\\((T5<int> const|const T5<int>) ?&\\);${ws}~T5\\(int\\);${ws}static void \\* operator new\\(unsigned( int| long|)\\);${ws}static void operator delete\\(void ?\\*\\);${ws}int value\\((void|)\\);${ws}\\}\r\n$gdb_prompt $" {
+ -re "type = class T5<int> \{${ws}public:${ws}static int X;${ws}int x;${ws}int val;${ws}void T5\\(int\\);${ws}void T5\\((T5<int> const|const T5<int>) ?&\\);${ws}~T5\\(int\\);${ws}static void \\* operator new\\(unsigned( int| long|)\\);${ws}static void operator delete\\(void ?\\*\\);${ws}int value\\((void|)\\);${ws}\}\r\n$gdb_prompt $" {
# This also triggers gdb/1113...
kfail "gdb/1111" "ptype T5<int>"
}
@@ -312,8 +312,11 @@ gdb_expect {
send_gdb "ptype fvpchar\n"
gdb_expect {
- -re "type = (class |)Foo<(volatile char|char volatile) ?\\*> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*.*char.*\\*t;\r\n\r\n\[ \t\]*.*char \\* foo\\(int,.*char.*\\*\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype fvpchar" }
- -re "type = (class |)Foo<(volatile char|char volatile) ?\\*> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*.*char.*\\*t;\r\n\r\n\[ \t\]*.*char \\* foo\\(int,.*char.*\\*\\);.*\r\n\\}\r\n$gdb_prompt $" { pass "ptype fvpchar" }
+ -re "type = (class |)Foo<volatile char ?\\*> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*.*char.*\\*t;\r\n\r\n\[ \t\]*.*char \\* foo\\(int,.*char.*\\*\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype fvpchar" }
+ -re "type = (class |)Foo<volatile char ?\\*> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*.*char.*\\*t;\r\n\r\n\[ \t\]*.*char \\* foo\\(int,.*char.*\\*\\);.*\r\n\\}\r\n$gdb_prompt $" { pass "ptype fvpchar" }
+ -re "type = (class |)Foo<char volatile ?\\*> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*.*char.*\\*t;\r\n\r\n\[ \t\]*.*char \\* foo\\(int,.*char.*\\*\\);\r\n\\}\r\n$gdb_prompt $" {
+ kfail "gdb/1512" "ptype fvpchar"
+ }
-re "$gdb_prompt $" { fail "ptype fvpchar" }
timeout { fail "(timeout) ptype fvpchar" }
}
@@ -325,11 +328,13 @@ gdb_expect {
send_gdb "print Foo<volatile char *>::foo\n"
gdb_expect {
- -re "\\$\[0-9\]* = \\{.*char.* \\*\\((class |)Foo<volatile char ?\\*> \\*(| const), int, .*char.* \\*\\)\\} $hex <Foo<.*char.*\\*>::foo\\(int, .*char.*\\*\\)>\r\n$gdb_prompt $" { pass "print Foo<volatile char *>::foo" }
+ -re "\\$\[0-9\]* = \\{.*char \\*\\((class |)Foo<volatile char ?\\*> \\*(| const), int, .*char \\*\\)\\} $hex <Foo<.*char.*\\*>::foo\\(int, .*char.*\\*\\)>\r\n$gdb_prompt $" { pass "print Foo<volatile char *>::foo" }
-re "No symbol \"Foo<volatile char \\*>\" in current context.\r\n$gdb_prompt $"
{
- # This used to be a kfail gdb/33, but it shouldn't occur any more now.
- fail "print Foo<volatile char *>::foo"
+ # This used to be a kfail gdb/33. That problem has been
+ # fixed, but now gdb/931 and gdb/1512 are rearing their ugly
+ # heads.
+ kfail "gdb/931" "print Foo<volatile char *>::foo"
}
-re "$gdb_prompt $" { fail "print Foo<volatile char *>::foo" }
timeout { fail "(timeout) print Foo<volatile char *>::foo" }
@@ -337,22 +342,18 @@ gdb_expect {
send_gdb "print Foo<volatile char*>::foo\n"
gdb_expect {
- -re "\\$\[0-9\]* = \\{.*char.* \\*\\((class |)Foo<volatile char ?\\*> \\*(| const), int, .*char.* \\*\\)\\} $hex <Foo<.*char.*\\*>::foo\\(int, .*char.*\\*\\)>\r\n$gdb_prompt $" { pass "print Foo<volatile char*>::foo" }
+ -re "\\$\[0-9\]* = \\{.*char \\*\\((class |)Foo<volatile char ?\\*> \\*(| const), int, .*char \\*\\)\\} $hex <Foo<.*char.*\\*>::foo\\(int, .*char.*\\*\\)>\r\n$gdb_prompt $" { pass "print Foo<volatile char*>::foo" }
-re "No symbol \"Foo<volatile char\\*>\" in current context.\r\n$gdb_prompt $"
{
- # This used to be a kfail gdb/33, but it shouldn't occur any more now.
- fail "print Foo<volatile char *>::foo"
+ # This used to be a kfail gdb/33. That problem has been
+ # fixed, but now gdb/931 and gdb/1512 are rearing their ugly
+ # heads.
+ kfail "gdb/931" "print Foo<volatile char*>::foo"
}
-re "$gdb_prompt $" { fail "print Foo<volatile char*>::foo" }
timeout { fail "(timeout) print Foo<volatile char*>::foo" }
}
-# Verify that we get the same results for Foo for some equivalent
-# template arguments.
-gdb_test "ptype Foo<volatile char*>::x" "type = int \\( Foo<.*char.*\\*>::&\\)"
-gdb_test "ptype Foo<volatile char *>::x" "type = int \\( Foo<.*char.*\\*>::&\\)"
-gdb_test "ptype Foo<char volatile *>::x" "type = int \\( Foo<.*char.*\\*>::&\\)"
-
# Template Bar<T, int>
# same as Foo for g++
@@ -360,7 +361,7 @@ send_gdb "ptype Bar\n"
gdb_expect {
-re "type = template <(class |)T, (class |)sz> (class |)Bar \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\ntemplate instantiations:\r\n\[ \t\]*(class |)Bar<int,(\\(int\\)|)1>\r\n\[ \t\]*(class |)Bar<int,(\\(int\\)|)33>\r\n$gdb_prompt $" { pass "ptype Bar" }
-re "type = <(class |)T, (class |)sz> (class |)Bar \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\n$gdb_prompt $" { xfail "ptype Bar" }
- -re "ptype Bar\r\ntype = class Bar<int, 33> {\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int bar\\(int, int\\);\r\n}\r\n$gdb_prompt $"
+ -re "ptype Bar\r\ntype = class Bar<int, ?33> {\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int bar\\(int, int\\);\r\n}\r\n$gdb_prompt $"
{ # GCC 3.1, DWARF-2 output.
kfail "gdb/57" "ptype Bar" }
-re "No symbol \"Bar\" in current context.\r\n$gdb_prompt $"
@@ -376,7 +377,7 @@ gdb_expect {
send_gdb "ptype bint\n"
gdb_expect {
-re "type = (class |)Bar<int, ?(\\(int\\)|)33> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*.*int bar\\(int, int\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype bint" }
- -re "type = (class |)Bar<int, ?(\\(int\\)|)33> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int bar\\(int, int\\);.*\r\n\\}\r\n$gdb_prompt $" { pass "ptype bint" }
+ -re "type = (class |)Bar<int,(\\(int\\)|)33> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int bar\\(int, int\\);.*\r\n\\}\r\n$gdb_prompt $" { pass "ptype bint" }
-re "$gdb_prompt $" { fail "ptype bint" }
timeout { fail "(timeout) ptype bint" }
}
@@ -386,7 +387,7 @@ gdb_expect {
send_gdb "ptype bint2\n"
gdb_expect {
-re "type = (class |)Bar<int, ?(\\(int\\)|)1> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*.*int bar\\(int, int\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype bint2" }
- -re "type = (class |)Bar<int, ?(\\(int\\)|)1> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int bar\\(int, int\\);.*\r\n\\}\r\n$gdb_prompt $" { pass "ptype bint2" }
+ -re "type = (class |)Bar<int,(\\(int\\)|)1> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int bar\\(int, int\\);.*\r\n\\}\r\n$gdb_prompt $" { pass "ptype bint2" }
-re "$gdb_prompt $" { fail "ptype bint2" }
timeout { fail "(timeout) ptype bint2" }
}
@@ -396,11 +397,14 @@ gdb_expect {
# Same as Foo, for g++
send_gdb "ptype Baz\n"
gdb_expect {
- -re "type = template <(class |)T, (class |)sz> (class |)Baz \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\ntemplate instantiations:\r\n\[ \t\]*(class |)Baz<char,(\\(char\\)|)97>\r\n\[ \t\]*(class |)Baz<int,(\\(char\\)|)115>\r\n$gdb_prompt $" { pass "ptype Baz" }
- -re "type = <(class |)T, (class |)sz> (class |)Baz \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\n$gdb_prompt $" { xfail "ptype Baz" }
- -re "type = class Baz<int, 's'> {\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int baz\\(int, int\\);\r\n}\r\n$gdb_prompt $"
+ -re "type = template <(class |)T, ?(class |)sz> (class |)Baz \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\ntemplate instantiations:\r\n\[ \t\]*(class |)Baz<char,(\\(char\\)|)97>\r\n\[ \t\]*(class |)Baz<int,(\\(char\\)|)115>\r\n$gdb_prompt $" { pass "ptype Baz" }
+ -re "type = <(class |)T, ?(class |)sz> (class |)Baz \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\n$gdb_prompt $" { xfail "ptype Baz" }
+ -re "type = class Baz<int, ?'s'> {\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int baz\\(int, int\\);\r\n}\r\n$gdb_prompt $"
{ # GCC 3.1, DWARF-2 output.
kfail "gdb/57" "ptype Baz" }
+ -re "type = class Baz<int, ?115> {\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int baz\\(int, int\\);\r\n}\r\n$gdb_prompt $"
+ { # GCC 3.x, DWARF-2 output, running into gdb/57 and gdb/1512.
+ kfail "gdb/57" "ptype Baz" }
-re "No symbol \"Baz\" in current context.\r\n$gdb_prompt $"
{ # GCC 2.95.3, stabs+ output.
pass "ptype Baz" }
@@ -414,7 +418,7 @@ gdb_expect {
send_gdb "ptype bazint\n"
gdb_expect {
-re "type = (class |)Baz<int, ?(\\(char\\)|)(115|\\'s\\')> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*.*int baz\\(int, int\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype bazint" }
- -re "type = (class |)Baz<int, ?(\\(char\\)|)(115|\\'s\\')> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int baz\\(int, int\\).*;\r\n\\}\r\n$gdb_prompt $" { pass "ptype bazint" }
+ -re "type = (class |)Baz<int,(\\(char\\)|)(115|\\'s\\')> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int baz\\(int, int\\).*;\r\n\\}\r\n$gdb_prompt $" { pass "ptype bazint" }
-re "$gdb_prompt $" { fail "ptype bazint" }
timeout { fail "(timeout) ptype bazint" }
}
@@ -424,7 +428,7 @@ gdb_expect {
send_gdb "ptype bazint2\n"
gdb_expect {
-re "type = (class |)Baz<char, ?(\\(char\\)|)(97|\\'a\\')> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*char t;\r\n\r\n\[ \t\]*.*char baz\\(int, char\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype bazint2" }
- -re "type = (class |)Baz<char, ?(\\(char\\)|)(97|\\'a\\')> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*char t;\r\n\r\n\[ \t\]*char baz\\(int, char\\);.*\r\n\\}\r\n$gdb_prompt $" { pass "ptype bazint2" }
+ -re "type = (class |)Baz<char,(\\(char\\)|)(97|\\'a\\')> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*char t;\r\n\r\n\[ \t\]*char baz\\(int, char\\);.*\r\n\\}\r\n$gdb_prompt $" { pass "ptype bazint2" }
-re "$gdb_prompt $" { fail "ptype bazint2" }
timeout { fail "(timeout) ptype bazint2" }
}
@@ -433,11 +437,14 @@ gdb_expect {
# Same as Foo for g++
send_gdb "ptype Qux\n"
gdb_expect {
- -re "type = template <(class |)T, (class |)sz> (class |)Qux \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\ntemplate instantiations:\r\n\[ \t\]*(class |)Qux<int,&string>\r\n\[ \t\]*(class |)Qux<char,&string>\r\n$gdb_prompt $" { pass "ptype Qux" }
- -re ".*type = template <(class |)T.*, (class |)sz> (class |)Qux \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}.*$gdb_prompt $" { pass "ptype Qux" }
- -re "type = class Qux<char, &\\(string\\)> {\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*char t;\r\n\r\n\[ \t\]*char qux\\(int, char\\);\r\n}\r\n$gdb_prompt $"
+ -re "type = template <(class |)T, ?(class |)sz> (class |)Qux \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\ntemplate instantiations:\r\n\[ \t\]*(class |)Qux<int,&string>\r\n\[ \t\]*(class |)Qux<char,&string>\r\n$gdb_prompt $" { pass "ptype Qux" }
+ -re ".*type = template <(class |)T.*, ?(class |)sz> (class |)Qux \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}.*$gdb_prompt $" { pass "ptype Qux" }
+ -re "type = class Qux<char, ?&string> {\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*char t;\r\n\r\n\[ \t\]*char qux\\(int, char\\);\r\n}\r\n$gdb_prompt $"
{ # GCC 3.1, DWARF-2 output.
kfail "gdb/57" "ptype Qux" }
+ -re "type = class Qux<char, ?&\\(string\\)> {\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*char t;\r\n\r\n\[ \t\]*char qux\\(int, char\\);\r\n}\r\n$gdb_prompt $"
+ { # GCC 3.x, DWARF-2 output; gdb/57 + gdb/1512.
+ kfail "gdb/57" "ptype Qux" }
-re "No symbol \"Qux\" in current context.\r\n$gdb_prompt $"
{ # GCC 2.95.3, stabs+ output.
pass "ptype Qux" }
@@ -449,8 +456,11 @@ gdb_expect {
send_gdb "ptype quxint\n"
gdb_expect {
- -re "type = class Qux<int, ?&\\(?string\\)?> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*.*int qux\\(int, int\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype quxint" }
- -re "type = class Qux<int, ?&\\(?string\\)?> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int qux\\(int, int\\);.*\r\n\\}\r\n$gdb_prompt $" { pass "ptype quxint" }
+ -re "type = class Qux<int, ?&string> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*.*int qux\\(int, int\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype quxint" }
+ -re "type = class Qux<int, ?&string> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int qux\\(int, int\\);.*\r\n\\}\r\n$gdb_prompt $" { pass "ptype quxint" }
+ -re "type = class Qux<int, ?&\\(string\\)> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int qux\\(int, int\\);.*\r\n\\}\r\n$gdb_prompt $" {
+ kfail "gdb/1512" "ptype quxint"
+ }
-re "$gdb_prompt $" { fail "ptype quxint" }
timeout { fail "(timeout) ptype quxint" }
}
@@ -461,7 +471,7 @@ gdb_expect {
# templates.exp -- ovidiu
# send_gdb "ptype quxint2\n"
# gdb_expect {
-# -re "type = class Qux<char, &string> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*char t;\r\n\r\n\[ \t\]*char qux\\(int, char\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype quxint2" }
+# -re "type = class Qux<char,&string> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*char t;\r\n\r\n\[ \t\]*char qux\\(int, char\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype quxint2" }
# -re "$gdb_prompt $" { fail "ptype quxint2" }
# timeout { fail "(timeout) ptype quxint2" }
# }
@@ -473,7 +483,7 @@ send_gdb "ptype Spec\n"
gdb_expect {
-re "type = template <(class |)T1, (class |)T2> (class |)Spec \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\\}\r\ntemplate instantiations:\r\n\[ \t\]*(class |)Spec<int,int \\*>\r\n\[ \t\]*(class |)Spec<int,char>\r\n$gdb_prompt $" { pass "ptype Spec" }
-re "type = <(class |)T1, (class |)T2> (class |)Spec \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\\}\r\n$gdb_prompt $" { xfail "ptype Spec" }
- -re "type = class Spec<int, char> {\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\r\n\[ \t\]*int spec\\(char\\);\r\n}\r\n$gdb_prompt $"
+ -re "type = class Spec<int, ?char> {\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\r\n\[ \t\]*int spec\\(char\\);\r\n}\r\n$gdb_prompt $"
{ # GCC 3.1, DWARF-2 output.
kfail "gdb/57" "ptype Spec" }
-re "No symbol \"Spec\" in current context.\r\n$gdb_prompt $"
@@ -488,7 +498,7 @@ gdb_expect {
send_gdb "ptype siip\n"
gdb_expect {
-re "type = class Spec<int, ?int ?\\*> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\r\n\[ \t\]*.*int spec\\(int ?\\*\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype siip" }
- -re "type = class Spec<int, ?int ?\\*> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\r\n\[ \t\]*int spec\\(int ?\\*\\);.*\r\n\\}\r\n$gdb_prompt $" { pass "ptype siip" }
+ -re "type = class Spec<int,int ?\\*> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\r\n\[ \t\]*int spec\\(int ?\\*\\);.*\r\n\\}\r\n$gdb_prompt $" { pass "ptype siip" }
-re "$gdb_prompt $" { fail "ptype siip" }
timeout { fail "(timeout) ptype siip" }
}
diff --git a/gdb/testsuite/gdb.cp/virtfunc.exp b/gdb/testsuite/gdb.cp/virtfunc.exp
index 958900a..9ec2b08 100644
--- a/gdb/testsuite/gdb.cp/virtfunc.exp
+++ b/gdb/testsuite/gdb.cp/virtfunc.exp
@@ -176,7 +176,7 @@ proc test_ptype_of_classes {} {
"" "int a;" \
"public:" "virtual int f\\((void|)\\);" \
"A & operator=\\(A const ?&\\);${ws}A\\(int, A const ?&\\);${ws}A\\(int\\);" \
- "A & operator=\\(A const ?&\\);${ws}A\\(A const ?&\\);${ws}A\\(\\);" \
+ "A & operator=\\(A const ?&\\);${ws}A\\(A const ?&\\);${ws}A\\((void|)\\);" \
""
# class B
@@ -187,7 +187,7 @@ proc test_ptype_of_classes {} {
"" "int b;" \
"public:" "virtual int f\\((void|)\\);" \
"B & operator=\\(B const ?&\\);${ws}B\\(int, B const ?&\\);${ws}B\\(int\\);" \
- "B & operator=\\(B const ?&\\);${ws}B\\(B const ?&\\);${ws}B\\(\\);" \
+ "B & operator=\\(B const ?&\\);${ws}B\\(B const ?&\\);${ws}B\\((void|)\\);" \
""
# class C
@@ -198,7 +198,7 @@ proc test_ptype_of_classes {} {
"public:" "int c;" \
"" "" \
"C & operator=\\(C const ?&\\);${ws}C\\(int, C const ?&\\);${ws}C\\(int\\);" \
- "C & operator=\\(C const ?&\\);${ws}C\\(C const ?&\\);${ws}C\\(\\);" \
+ "C & operator=\\(C const ?&\\);${ws}C\\(C const ?&\\);${ws}C\\((void|)\\);" \
""
# class AD
@@ -220,7 +220,7 @@ proc test_ptype_of_classes {} {
"public:" "int d;" \
"" "static void s\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vd\\((void|)\\);${ws}int fd\\((void|)\\);" \
"D & operator=\\(D const ?&\\);${ws}D\\(int, D const ?&\\);${ws}D\\(int\\);" \
- "D & operator=\\(D const ?&\\);${ws}D\\(D const ?&\\);${ws}D\\(\\);" \
+ "D & operator=\\(D const ?&\\);${ws}D\\(D const ?&\\);${ws}D\\((void|)\\);" \
""
# class E
@@ -232,7 +232,7 @@ proc test_ptype_of_classes {} {
"public:" "int e;" \
"" "virtual int f\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vv\\((void|)\\);" \
"E & operator=\\(E const ?&\\);${ws}E\\(int, E const ?&\\);${ws}E\\(int\\);" \
- "E & operator=\\(E const ?&\\);${ws}E\\(E const ?&\\);${ws}E\\(\\);" \
+ "E & operator=\\(E const ?&\\);${ws}E\\(E const ?&\\);${ws}E\\((void|)\\);" \
""
# An instance of D
@@ -243,7 +243,7 @@ proc test_ptype_of_classes {} {
"public:" "int d;" \
"" "static void s\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vd\\((void|)\\);${ws}int fd\\((void|)\\);" \
"D & operator=\\(D const ?&\\);${ws}D\\(int, D const ?&\\);${ws}D\\(int\\);" \
- "D & operator=\\(D const ?&\\);${ws}D\\(D const ?&\\);${ws}D\\(\\);" \
+ "D & operator=\\(D const ?&\\);${ws}D\\(D const ?&\\);${ws}D\\((void|)\\);" \
""
# An instance of D *
@@ -254,7 +254,7 @@ proc test_ptype_of_classes {} {
"public:" "int d;" \
"" "static void s\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vd\\((void|)\\);${ws}int fd\\((void|)\\);" \
"D & operator=\\(D const ?&\\);${ws}D\\(int, D const ?&\\);${ws}D\\(int\\);" \
- "D & operator=\\(D const ?&\\);${ws}D\\(D const ?&\\);${ws}D\\(\\);" \
+ "D & operator=\\(D const ?&\\);${ws}D\\(D const ?&\\);${ws}D\\((void|)\\);" \
" ?\\*"
# An instance of AD *
@@ -277,7 +277,7 @@ proc test_ptype_of_classes {} {
"" "int a;" \
"public:" "virtual int f\\((void|)\\);" \
"A & operator=\\(A const ?&\\);${ws}A\\(int, A const ?&\\);${ws}A\\(int\\);" \
- "A & operator=\\(A const ?&\\);${ws}A\\(A const ?&\\);${ws}A\\(\\);" \
+ "A & operator=\\(A const ?&\\);${ws}A\\(A const ?&\\);${ws}A\\((void|)\\);" \
""
# An instance of B
@@ -288,7 +288,7 @@ proc test_ptype_of_classes {} {
"" "int b;" \
"public:" "virtual int f\\((void|)\\);" \
"B & operator=\\(B const ?&\\);${ws}B\\(int, B const ?&\\);${ws}B\\(int\\);" \
- "B & operator=\\(B const ?&\\);${ws}B\\(B const ?&\\);${ws}B\\(\\);" \
+ "B & operator=\\(B const ?&\\);${ws}B\\(B const ?&\\);${ws}B\\((void|)\\);" \
""
# An instance of C
@@ -299,7 +299,7 @@ proc test_ptype_of_classes {} {
"public:" "int c;" \
"" "" \
"C & operator=\\(C const ?&\\);${ws}C\\(int, C const ?&\\);${ws}C\\(int\\);" \
- "C & operator=\\(C const ?&\\);${ws}C\\(C const ?&\\);${ws}C\\(\\);" \
+ "C & operator=\\(C const ?&\\);${ws}C\\(C const ?&\\);${ws}C\\((void|)\\);" \
""
# An instance of D
@@ -310,7 +310,7 @@ proc test_ptype_of_classes {} {
"public:" "int d;" \
"" "static void s\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vd\\((void|)\\);${ws}int fd\\((void|)\\);" \
"D & operator=\\(D const ?&\\);${ws}D\\(int, D const ?&\\);${ws}D\\(int\\);" \
- "D & operator=\\(D const ?&\\);${ws}D\\(D const ?&\\);${ws}D\\(\\);" \
+ "D & operator=\\(D const ?&\\);${ws}D\\(D const ?&\\);${ws}D\\((void|)\\);" \
""
# An instance of E
@@ -321,7 +321,7 @@ proc test_ptype_of_classes {} {
"public:" "int e;" \
"" "virtual int f\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vv\\((void|)\\);" \
"E & operator=\\(E const ?&\\);${ws}E\\(int, E const ?&\\);${ws}E\\(int\\);" \
- "E & operator=\\(E const ?&\\);${ws}E\\(E const ?&\\);${ws}E\\(\\);" \
+ "E & operator=\\(E const ?&\\);${ws}E\\(E const ?&\\);${ws}E\\((void|)\\);" \
""
# An instance of V
@@ -354,7 +354,7 @@ proc test_ptype_of_classes {} {
"" "int a;" \
"public:" "virtual int f\\((void|)\\);" \
"A & operator=\\(A const ?&\\);${ws}A\\(int, A const ?&\\);${ws}A\\(int\\);" \
- "A & operator=\\(A const ?&\\);${ws}A\\(A const ?&\\);${ws}A\\(\\);" \
+ "A & operator=\\(A const ?&\\);${ws}A\\(A const ?&\\);${ws}A\\((void|)\\);" \
" ?\\*"
# An instance of A *
@@ -365,7 +365,7 @@ proc test_ptype_of_classes {} {
"" "int a;" \
"public:" "virtual int f\\((void|)\\);" \
"A & operator=\\(A const ?&\\);${ws}A\\(int, A const ?&\\);${ws}A\\(int\\);" \
- "A & operator=\\(A const ?&\\);${ws}A\\(A const ?&\\);${ws}A\\(\\);" \
+ "A & operator=\\(A const ?&\\);${ws}A\\(A const ?&\\);${ws}A\\((void|)\\);" \
" ?\\*"
# An instance of B *
@@ -376,7 +376,7 @@ proc test_ptype_of_classes {} {
"" "int b;" \
"public:" "virtual int f\\((void|)\\);" \
"B & operator=\\(B const ?&\\);${ws}B\\(int, B const ?&\\);${ws}B\\(int\\);" \
- "B & operator=\\(B const ?&\\);${ws}B\\(B const ?&\\);${ws}B\\(\\);" \
+ "B & operator=\\(B const ?&\\);${ws}B\\(B const ?&\\);${ws}B\\((void|)\\);" \
" ?\\*"
# An instance of D *
@@ -387,7 +387,7 @@ proc test_ptype_of_classes {} {
"public:" "int d;" \
"" "static void s\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vd\\((void|)\\);${ws}int fd\\((void|)\\);" \
"D & operator=\\(D const ?&\\);${ws}D\\(int, D const ?&\\);${ws}D\\(int\\);" \
- "D & operator=\\(D const ?&\\);${ws}D\\(D const ?&\\);${ws}D\\(\\);" \
+ "D & operator=\\(D const ?&\\);${ws}D\\(D const ?&\\);${ws}D\\((void|)\\);" \
" ?\\*"
# An instance of D *
@@ -398,7 +398,7 @@ proc test_ptype_of_classes {} {
"public:" "int d;" \
"" "static void s\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vd\\((void|)\\);${ws}int fd\\((void|)\\);" \
"D & operator=\\(D const ?&\\);${ws}D\\(int, D const ?&\\);${ws}D\\(int\\);" \
- "D & operator=\\(D const ?&\\);${ws}D\\(D const ?&\\);${ws}D\\(\\);" \
+ "D & operator=\\(D const ?&\\);${ws}D\\(D const ?&\\);${ws}D\\((void|)\\);" \
" ?\\*"
# An instance of V *
@@ -464,7 +464,7 @@ proc test_ptype_of_classes {} {
"public:" "int e;" \
"" "virtual int f\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vv\\((void|)\\);" \
"E & operator=\\(E const ?&\\);${ws}E\\(int, E const ?&\\);${ws}E\\(int\\);" \
- "E & operator=\\(E const ?&\\);${ws}E\\(E const ?&\\);${ws}E\\(\\);" \
+ "E & operator=\\(E const ?&\\);${ws}E\\(E const ?&\\);${ws}E\\((void|)\\);" \
" ?\\*"
# An instance of VB *
diff --git a/gdb/testsuite/gdb.mi/gdb669.exp b/gdb/testsuite/gdb.mi/gdb669.exp
index d03ce35..4bdcdab 100644
--- a/gdb/testsuite/gdb.mi/gdb669.exp
+++ b/gdb/testsuite/gdb.mi/gdb669.exp
@@ -1,4 +1,4 @@
-# Copyright 2002, 2003 Free Software Foundation, Inc.
+# Copyright 2002, 2003, 2004 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
@@ -176,7 +176,7 @@ proc check_mi_and_console_threads {name} {
#
set testfile "pthreads"
set srcfile "$testfile.c"
-set binfile "$objdir/$subdir/$testfile"
+set binfile "$objdir/$subdir/gdb669-$testfile"
set options [list debug incdir=$objdir]
if {[gdb_compile_pthreads "$srcdir/$subdir/$srcfile" $binfile executable $options] != "" } {
diff --git a/gdb/testsuite/gdb.mi/mi-pthreads.exp b/gdb/testsuite/gdb.mi/mi-pthreads.exp
index 532134a..be18647 100644
--- a/gdb/testsuite/gdb.mi/mi-pthreads.exp
+++ b/gdb/testsuite/gdb.mi/mi-pthreads.exp
@@ -1,4 +1,4 @@
-# Copyright 2002, 2003 Free Software Foundation, Inc.
+# Copyright 2002, 2003, 2004 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
@@ -205,7 +205,7 @@ proc check_mi_thread_command_set {} {
#
set testfile "pthreads"
set srcfile "$testfile.c"
-set binfile "$objdir/$subdir/$testfile"
+set binfile "$objdir/$subdir/mi-$testfile"
set options [list debug incdir=$objdir]
if {[gdb_compile_pthreads "$srcdir/$subdir/$srcfile" $binfile executable $options] != "" } {
diff --git a/gdb/testsuite/gdb.mi/mi-stack.exp b/gdb/testsuite/gdb.mi/mi-stack.exp
index 92c651d..966a86d 100644
--- a/gdb/testsuite/gdb.mi/mi-stack.exp
+++ b/gdb/testsuite/gdb.mi/mi-stack.exp
@@ -1,4 +1,4 @@
-# Copyright 2000, 2002 Free Software Foundation, Inc.
+# Copyright 2000, 2002, 2004 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
@@ -149,6 +149,7 @@ proc test_stack_locals_listing {} {
# Tests:
# -stack-list-locals 0
# -stack-list-locals 1
+ # -stack-list-locals 2
# -stack-list-arguments
mi_gdb_test "232-stack-list-locals 0" \
@@ -168,6 +169,10 @@ gdb_expect {
"232\\^done,locals=\\\[\{name=\"A\",value=\"1\"\},\{name=\"B\",value=\"2\"\},\{name=\"C\",value=\"3\"\}\\\]" \
"stack locals listing 1"
+ mi_gdb_test "232-stack-list-locals 2" \
+ "232\\^done,locals=\\\[\{name=\"A\",type=\"int\",value=\"1\"\},\{name=\"B\",type=\"int\",value=\"2\"\},\{name=\"C\",type=\"int\",value=\"3\"\}\\\]" \
+ "stack locals listing 2"
+
mi_gdb_test "234-stack-list-locals" \
"234\\^error,msg=\"mi_cmd_stack_list_locals: Usage.*PRINT_VALUES.*\"" \
"stack locals listing wrong"
diff --git a/gdb/testsuite/gdb.mi/mi-var-child.exp b/gdb/testsuite/gdb.mi/mi-var-child.exp
index 15e3f79..74a5894 100644
--- a/gdb/testsuite/gdb.mi/mi-var-child.exp
+++ b/gdb/testsuite/gdb.mi/mi-var-child.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1999, 2000, 2002 Free Software Foundation
+# Copyright (C) 1999, 2000, 2002, 2004 Free Software Foundation
# 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
@@ -833,6 +833,9 @@ mi_gdb_test "-var-update *" \
"\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.3\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.long_array.4\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.long_array.5\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.long_array.6\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.long_array.7\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.long_array.8\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.long_array.9\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \
"update all vars struct_declarations.long_array.3-9 changed"
+mi_gdb_test "-var-list-children --all-values struct_declarations.long_array" \
+ "\\^done,numchild=\"10\",children=\\\[child=\{name=\"struct_declarations.long_array.0\",exp=\"0\",numchild=\"0\",value=\"1234\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.1\",exp=\"1\",numchild=\"0\",value=\"2345\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.2\",exp=\"2\",numchild=\"0\",value=\"3456\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.3\",exp=\"3\",numchild=\"0\",value=\"4567\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.4\",exp=\"4\",numchild=\"0\",value=\"5678\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.5\",exp=\"5\",numchild=\"0\",value=\"6789\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.6\",exp=\"6\",numchild=\"0\",value=\"7890\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.7\",exp=\"7\",numchild=\"0\",value=\"8901\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.8\",exp=\"8\",numchild=\"0\",value=\"9012\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.9\",exp=\"9\",numchild=\"0\",value=\"1234\",type=\"long int\"\}\\\]" \
+ "listing of names and values of children"
# Step over "weird->func_ptr = nothing;"
set line 211
diff --git a/gdb/testsuite/gdb.mi/mi1-pthreads.exp b/gdb/testsuite/gdb.mi/mi1-pthreads.exp
index f84f1fe..df841b2 100644
--- a/gdb/testsuite/gdb.mi/mi1-pthreads.exp
+++ b/gdb/testsuite/gdb.mi/mi1-pthreads.exp
@@ -1,4 +1,4 @@
-# Copyright 2002, 2003 Free Software Foundation, Inc.
+# Copyright 2002, 2003, 2004 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
@@ -205,7 +205,7 @@ proc check_mi_thread_command_set {} {
#
set testfile "pthreads"
set srcfile "$testfile.c"
-set binfile "$objdir/$subdir/$testfile"
+set binfile "$objdir/$subdir/mi1-$testfile"
set options [list debug incdir=$objdir]
if {[gdb_compile_pthreads "$srcdir/$subdir/$srcfile" $binfile executable $options] != "" } {
diff --git a/gdb/testsuite/gdb.mi/mi2-basics.exp b/gdb/testsuite/gdb.mi/mi2-basics.exp
index 44d2e4b..a86ba37 100644
--- a/gdb/testsuite/gdb.mi/mi2-basics.exp
+++ b/gdb/testsuite/gdb.mi/mi2-basics.exp
@@ -1,4 +1,4 @@
-# Copyright 1999, 2000 Free Software Foundation, Inc.
+# Copyright 1999, 2000, 2004 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
@@ -40,6 +40,9 @@ if [mi_gdb_start] {
set testfile "basics"
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
+set escapedobjdir [string_to_regexp ${objdir}]
+set escapedsrcdir [string_to_regexp ${srcdir}]
+
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
@@ -154,13 +157,14 @@ proc test_dir_specification {} {
# -environment-directory
# -environment-directory -r
-#exp_internal 1
+ set envirodir [string_to_regexp ${srcdir}/${subdir}]
+
mi_gdb_test "202-environment-directory ${srcdir}/${subdir}" \
- "\\\^done,source-path=\"${srcdir}/${subdir}.\\\$cdir.\\\$cwd\"" \
+ "\\\^done,source-path=\"${envirodir}.\\\$cdir.\\\$cwd\"" \
"environment-directory arg operation"
mi_gdb_test "203-environment-directory" \
- "\\\^done,source-path=\"${srcdir}/${subdir}.\\\$cdir.\\\$cwd\"" \
+ "\\\^done,source-path=\"${envirodir}.\\\$cdir.\\\$cwd\"" \
"environment-directory empty-string operation"
mi_gdb_test "204-environment-directory -r" \
@@ -174,6 +178,7 @@ proc test_cwd_specification {} {
global mi_gdb_prompt
global objdir
global subdir
+ global escapedobjdir
# Change the working directory, then print the current working directory
# Tests:
@@ -185,7 +190,7 @@ proc test_cwd_specification {} {
"environment-cd arg operation"
mi_gdb_test "206-environment-pwd" \
- "\\\^done,cwd=\"${objdir}\"" \
+ "\\\^done,cwd=\"${escapedobjdir}\"" \
"environment-pwd operation"
}
@@ -194,6 +199,8 @@ proc test_path_specification {} {
global orig_path
global objdir
global srcdir
+ global escapedobjdir
+ global escapedsrcdir
# Add to the path, display, then reset
# Tests:
@@ -202,8 +209,6 @@ proc test_path_specification {} {
# -environment-path -r dir
# -environment-path -r
-#exp_internal 1
-
send_gdb "-environment-path\n"
gdb_expect 20 {
-re "\\\^done,path=\"\(.*\)\"\r\n$mi_gdb_prompt" {
@@ -220,18 +225,17 @@ proc test_path_specification {} {
"environment-path no-args operation"
mi_gdb_test "208-environment-path $srcdir $objdir" \
- "\\\^done,path=\"$srcdir.$objdir.$orig_path\"" \
+ "\\\^done,path=\"$escapedsrcdir.$escapedobjdir.$orig_path\"" \
"environment-path dir1 dir2 operation"
mi_gdb_test "209-environment-path -r $objdir" \
- "\\\^done,path=\"$objdir.$orig_path\"" \
+ "\\\^done,path=\"$escapedobjdir.$orig_path\"" \
"environment-path -r dir operation"
mi_gdb_test "210-environment-path -r" \
"\\\^done,path=\"$orig_path\"" \
"environment-path -r operation"
-#exp_internal 0
}
if [test_mi_interpreter_selection] {
diff --git a/gdb/testsuite/gdb.mi/mi2-pthreads.exp b/gdb/testsuite/gdb.mi/mi2-pthreads.exp
index fe007e5..4067883 100644
--- a/gdb/testsuite/gdb.mi/mi2-pthreads.exp
+++ b/gdb/testsuite/gdb.mi/mi2-pthreads.exp
@@ -1,4 +1,4 @@
-# Copyright 2002, 2003 Free Software Foundation, Inc.
+# Copyright 2002, 2003, 2004 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
@@ -205,7 +205,7 @@ proc check_mi_thread_command_set {} {
#
set testfile "pthreads"
set srcfile "$testfile.c"
-set binfile "$objdir/$subdir/$testfile"
+set binfile "$objdir/$subdir/mi2-$testfile"
set options [list debug incdir=$objdir]
if {[gdb_compile_pthreads "$srcdir/$subdir/$srcfile" $binfile executable $options] != "" } {
diff --git a/gdb/testsuite/gdb.threads/gcore-thread.exp b/gdb/testsuite/gdb.threads/gcore-thread.exp
index 40c9ada..d7f8971 100644
--- a/gdb/testsuite/gdb.threads/gcore-thread.exp
+++ b/gdb/testsuite/gdb.threads/gcore-thread.exp
@@ -1,4 +1,4 @@
-# Copyright 2002, 2003 Free Software Foundation, Inc.
+# Copyright 2002, 2003, 2004 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -30,7 +30,7 @@ set bug_id 0
# Single-threaded test case
set testfile "pthreads"
set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+set binfile ${objdir}/${subdir}/gcore-${testfile}
if [istarget "*-*-linux"] then {
set target_cflags "-D_MIT_POSIX_THREADS"
@@ -78,7 +78,7 @@ gdb_expect {
}
}
-if { ! [ runto main ] } then {
+if { ! [ runto_main ] } then {
gdb_suppress_entire_file "Run to main failed, so all tests in this file will automatically fail."
}
diff --git a/gdb/testsuite/lib/compiler.c b/gdb/testsuite/lib/compiler.c
index b0f557c..b1f1f5d 100644
--- a/gdb/testsuite/lib/compiler.c
+++ b/gdb/testsuite/lib/compiler.c
@@ -1,6 +1,6 @@
/* This test file is part of GDB, the GNU debugger.
- Copyright 1995, 1997, 1999, 2003 Free Software Foundation, Inc.
+ Copyright 1995, 1997, 1999, 2003, 2004 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
@@ -19,36 +19,47 @@
Please email any bugs, comments, and/or additions to this file to:
bug-gdb@prep.ai.mit.edu */
-/* Often the behavior of any particular test depends upon what compiler was
- used to compile the test. As each test is compiled, this file is
- preprocessed by the same compiler used to compile that specific test
- (different tests might be compiled by different compilers, particularly
- if compiled at different times), and used to generate a *.ci (compiler
- info) file for that test.
+/* Sometimes the behavior of a test depends upon the compiler used to
+ compile the test program. A test script can call get_compiler_info
+ to figure out the compiler version and test_compiler_info to test it.
- I.E., when callfuncs is compiled, a callfuncs.ci file will be generated,
- which can then be sourced by callfuncs.exp to give callfuncs.exp access
- to information about the compilation environment.
+ get_compiler_info runs the preprocessor on this file and then eval's
+ the result. This sets various symbols for use by test_compiler_info.
- TODO: It might be a good idea to add expect code that tests each
- definition made with 'set" to see if one already exists, and if so
- warn about conflicts if it is being set to something else. */
+ TODO: make compiler_info a local variable for get_compiler_info and
+ test_compiler_info.
-/* This needs to be kept in sync with whatis.c and gdb.exp(get_compiler_info).
- If this ends up being hairy, we could use a common header file. */
+ TODO: all clients should use test_compiler_info and should not
+ use gcc_compiled, hp_cc_compiler, or hp_aCC_compiler.
-#if defined (__STDC__) || defined (_AIX)
-set signed_keyword_not_used 0
-#else
-set signed_keyword_not_used 1
-#endif
+ TODO: purge signed_keyword_not_used. */
+
+set compiler_info ""
#if defined (__GNUC__)
-set gcc_compiled __GNUC__
set compiler_info [join {gcc __GNUC__ __GNUC_MINOR__ } -]
+set gcc_compiled __GNUC__
#else
set gcc_compiled 0
-set compiler_info ""
#endif
-return 0
+#if defined (__HP_cc)
+set compiler_info [join {hpcc __HP_cc} -]
+set hp_cc_compiler __HP_cc
+#else
+set hp_cc_compiler 0
+#endif
+
+#if defined (__HP_aCC)
+set compiler_info [join {hpacc __HP_aCC} -]
+set hp_aCC_compiler __HP_aCC
+#else
+set hp_aCC_compiler 0
+#endif
+
+/* gdb.base/whatis.exp still uses this */
+#if defined (__STDC__) || defined (_AIX)
+set signed_keyword_not_used 0
+#else
+set signed_keyword_not_used 1
+#endif
diff --git a/gdb/testsuite/lib/compiler.cc b/gdb/testsuite/lib/compiler.cc
index bbefeaa..0c5eb66 100644
--- a/gdb/testsuite/lib/compiler.cc
+++ b/gdb/testsuite/lib/compiler.cc
@@ -19,27 +19,35 @@
Please email any bugs, comments, and/or additions to this file to:
bug-gdb@prep.ai.mit.edu */
-/* Often the behavior of any particular test depends upon what compiler was
- used to compile the test. As each test is compiled, this file is
- preprocessed by the same compiler used to compile that specific test
- (different tests might be compiled by different compilers, particularly
- if compiled at different times), and used to generate a *.ci (compiler
- info) file for that test.
+/* This file is exactly like compiler.c. I could just use compiler.c if
+ I could be sure that every C++ compiler accepted extensions of ".c". */
- I.E., when callfuncs is compiled, a callfuncs.ci file will be generated,
- which can then be sourced by callfuncs.exp to give callfuncs.exp access
- to information about the compilation environment.
-
- TODO: It might be a good idea to add expect code that tests each
- definition made with 'set" to see if one already exists, and if so
- warn about conflicts if it is being set to something else. */
+set compiler_info ""
#if defined (__GNUC__)
-set gcc_compiled __GNUC__
set compiler_info [join {gcc __GNUC__ __GNUC_MINOR__ } -]
+set gcc_compiled __GNUC__
#else
set gcc_compiled 0
-set compiler_info ""
#endif
-return 0
+#if defined (__HP_cc)
+set compiler_info [join {hpcc __HP_cc} -]
+set hp_cc_compiler __HP_cc
+#else
+set hp_cc_compiler 0
+#endif
+
+#if defined (__HP_aCC)
+set compiler_info [join {hpacc __HP_aCC} -]
+set hp_aCC_compiler __HP_aCC
+#else
+set hp_aCC_compiler 0
+#endif
+
+/* gdb.base/whatis.exp still uses this */
+#if defined (__STDC__) || defined (_AIX)
+set signed_keyword_not_used 0
+#else
+set signed_keyword_not_used 1
+#endif
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 3f2938e..52ec55f 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -1,5 +1,5 @@
# Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-# 2002, 2003
+# 2002, 2003, 2004
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
@@ -269,6 +269,10 @@ proc gdb_breakpoint { function } {
-re "Breakpoint \[0-9\]* at .*: file .*, line $decimal.\r\n$gdb_prompt $" {}
-re "Breakpoint \[0-9\]*: file .*, line $decimal.\r\n$gdb_prompt $" {}
-re "Breakpoint \[0-9\]* at .*$gdb_prompt $" {}
+ -re "Make breakpoint pending.*y or n. $" {
+ gdb_test "n" "" "setting breakpoint at $function" ;
+ return 1;
+ }
-re "$gdb_prompt $" { fail "setting breakpoint at $function" ; return 0 }
timeout { fail "setting breakpoint at $function (timeout)" ; return 0 }
}
@@ -449,6 +453,7 @@ proc gdb_test_multiple { command message user_code } {
global gdb_prompt
global GDB
upvar timeout timeout
+ upvar expect_out expect_out
if { $message == "" } {
set message $command
@@ -1094,86 +1099,114 @@ proc skip_hp_tests {} {
return $skip_hp
}
-global compiler_info
-set compiler_info unknown
+set compiler_info "unknown"
+set gcc_compiled 0
+set hp_cc_compiler 0
+set hp_aCC_compiler 0
+set signed_keyword_not_used 0
+
+# Figure out what compiler I am using.
+#
+# BINFILE is a "compiler information" output file. This implementation
+# does not use BINFILE.
+#
+# ARGS can be empty or "C++". If empty, "C" is assumed.
+#
+# There are several ways to do this, with various problems.
+#
+# [ gdb_compile -E $ifile -o $binfile.ci ]
+# source $binfile.ci
+#
+# Single Unix Spec v3 says that "-E -o ..." together are not
+# specified. And in fact, the native compiler on hp-ux 11 (among
+# others) does not work with "-E -o ...". Most targets used to do
+# this, and it mostly worked, because it works with gcc.
+#
+# [ catch "exec $compiler -E $ifile > $binfile.ci" exec_output ]
+# source $binfile.ci
+#
+# This avoids the problem with -E and -o together. This almost works
+# if the build machine is the same as the host machine, which is
+# usually true of the targets which are not gcc. But this code does
+# not figure which compiler to call, and it always ends up using the C
+# compiler. Not good for setting hp_aCC_compiler. Targets
+# hppa*-*-hpux* and mips*-*-irix* used to do this.
+#
+# [ gdb_compile -E $ifile > $binfile.ci ]
+# source $binfile.ci
+#
+# dejagnu target_compile says that it supports output redirection,
+# but the code is completely different from the normal path and I
+# don't want to sweep the mines from that path. So I didn't even try
+# this.
+#
+# set cppout [ gdb_compile $ifile "" preprocess $args quiet ]
+# eval $cppout
+#
+# I actually do this for all targets now. gdb_compile runs the right
+# compiler, and TCL captures the output, and I eval the output.
+#
+# Unfortunately, expect logs the output of the command as it goes by,
+# and dejagnu helpfully prints a second copy of it right afterwards.
+# So I turn off expect logging for a moment.
+#
+# [ gdb_compile $ifile $ciexe_file executable $args ]
+# [ remote_exec $ciexe_file ]
+# [ source $ci_file.out ]
+#
+# I could give up on -E and just do this.
+# I didn't get desperate enough to try this.
+#
+# -- chastain 2004-01-06
proc get_compiler_info {binfile args} {
- # Create and source the file that provides information about the compiler
- # used to compile the test case.
- # Compiler_type can be null or c++. If null we assume c.
+ # For compiler.c and compiler.cc
global srcdir
- global subdir
- # These two come from compiler.c.
- global signed_keyword_not_used
- global gcc_compiled
+
+ # I am going to play with the log to keep noise out.
+ global outdir
+ global tool
+
+ # These come from compiler.c or compiler.cc
global compiler_info
+ global gcc_compiled
+ global hp_cc_compiler
+ global hp_aCC_compiler
+ global signed_keyword_not_used
- if {![istarget "hppa*-*-hpux*"] && ![istarget "mips*-*-irix*"]} {
- if { [llength $args] > 0 } {
- if {$args == "c++"} {
- if { [gdb_compile "${srcdir}/lib/compiler.cc" "${binfile}.ci" preprocess {}] != "" } {
- perror "Couldn't make ${binfile}.ci file"
- return 1;
- }
- }
- } else {
- if { [gdb_compile "${srcdir}/lib/compiler.c" "${binfile}.ci" preprocess {}] != "" } {
- perror "Couldn't make ${binfile}.ci file"
- return 1;
- }
- }
- } else {
- if { [llength $args] > 0 } {
- if {$args == "c++"} {
- if { [eval gdb_preprocess \
- [list "${srcdir}/lib/compiler.cc" "${binfile}.ci"] \
- $args] != "" } {
- perror "Couldn't make ${binfile}.ci file"
- return 1;
- }
- }
- } elseif { $args != "f77" } {
- if { [eval gdb_preprocess \
- [list "${srcdir}/lib/compiler.c" "${binfile}.ci"] \
- $args] != "" } {
- perror "Couldn't make ${binfile}.ci file"
- return 1;
- }
- }
+ # Choose which file to preprocess.
+ set ifile "${srcdir}/lib/compiler.c"
+ if { [llength $args] > 0 && [lindex $args 0] == "c++" } {
+ set ifile "${srcdir}/lib/compiler.cc"
}
-
- uplevel \#0 { set gcc_compiled 0 }
- if { [llength $args] == 0 || $args != "f77" } {
- source ${binfile}.ci
+ # Run $ifile through the right preprocessor.
+ # Toggle gdb.log to keep the compiler output out of the log.
+ log_file
+ set cppout [ gdb_compile "${ifile}" "" preprocess [list "$args" quiet] ]
+ log_file -a "$outdir/$tool.log"
+
+ # Source the output.
+ foreach cppline [ split "$cppout" "\n" ] {
+ if { ! [ regexp "^#" "$cppline" ] } {
+ if { ! [ regexp "^\[\n\r\t \]*$" "$cppline" ] } {
+ verbose "get_compiler_info: $cppline" 2
+ eval "$cppline"
+ }
+ }
}
+ verbose -log "get_compiler_info: $compiler_info"
# Most compilers will evaluate comparisons and other boolean
# operations to 0 or 1.
uplevel \#0 { set true 1 }
uplevel \#0 { set false 0 }
- uplevel \#0 { set hp_cc_compiler 0 }
- uplevel \#0 { set hp_aCC_compiler 0 }
- uplevel \#0 { set hp_f77_compiler 0 }
- uplevel \#0 { set hp_f90_compiler 0 }
- if { !$gcc_compiled && [istarget "hppa*-*-hpux*"] } {
- # Check for the HP compilers
- set compiler [lindex [split [get_compiler $args] " "] 0]
- catch "exec what $compiler" output
- if [regexp ".*HP aC\\+\\+.*" $output] {
- uplevel \#0 { set hp_aCC_compiler 1 }
- # Use of aCC results in boolean results being displayed as
- # "true" or "false"
- uplevel \#0 { set true true }
- uplevel \#0 { set false false }
- } elseif [regexp ".*HP C Compiler.*" $output] {
- uplevel \#0 { set hp_cc_compiler 1 }
- } elseif [regexp ".*HP-UX f77.*" $output] {
- uplevel \#0 { set hp_f77_compiler 1 }
- } elseif [regexp ".*HP-UX f90.*" $output] {
- uplevel \#0 { set hp_f90_compiler 1 }
- }
+ # Use of aCC results in boolean results being displayed as
+ # "true" or "false"
+ if { $hp_aCC_compiler } {
+ uplevel \#0 { set true true }
+ uplevel \#0 { set false false }
}
return 0;
@@ -1184,85 +1217,6 @@ proc test_compiler_info { compiler } {
return [string match $compiler $compiler_info]
}
-proc get_compiler {args} {
- global CC CC_FOR_TARGET CXX CXX_FOR_TARGET F77_FOR_TARGET
-
- if { [llength $args] == 0
- || ([llength $args] == 1 && [lindex $args 0] == "") } {
- set which_compiler "c"
- } else {
- if { $args =="c++" } {
- set which_compiler "c++"
- } elseif { $args =="f77" } {
- set which_compiler "f77"
- } else {
- perror "Unknown compiler type supplied to gdb_preprocess"
- return ""
- }
- }
-
- if [info exists CC_FOR_TARGET] {
- if {$which_compiler == "c"} {
- set compiler $CC_FOR_TARGET
- }
- }
-
- if [info exists CXX_FOR_TARGET] {
- if {$which_compiler == "c++"} {
- set compiler $CXX_FOR_TARGET
- }
- }
-
- if [info exists F77_FOR_TARGET] {
- if {$which_compiler == "f77"} {
- set compiler $F77_FOR_TARGET
- }
- }
-
- if { ![info exists compiler] } {
- if { $which_compiler == "c" } {
- if {[info exists CC]} {
- set compiler $CC
- }
- }
- if { $which_compiler == "c++" } {
- if {[info exists CXX]} {
- set compiler $CXX
- }
- }
- if {![info exists compiler]} {
- set compiler [board_info [target_info name] compiler];
- if { $compiler == "" } {
- perror "get_compiler: No compiler found"
- return ""
- }
- }
- }
-
- return $compiler
-}
-
-proc gdb_preprocess {source dest args} {
- set compiler [get_compiler "$args"]
- if { $compiler == "" } {
- return 1
- }
-
- set cmdline "$compiler -E $source > $dest"
-
- verbose "Invoking $compiler -E $source > $dest"
- verbose -log "Executing on local host: $cmdline" 2
- set status [catch "exec ${cmdline}" exec_output]
-
- set result [prune_warnings $exec_output]
- regsub "\[\r\n\]*$" "$result" "" result;
- regsub "^\[\r\n\]*" "$result" "" result;
- if { $result != "" } {
- clone_output "gdb compile failed, $result"
- }
- return $result;
-}
-
set gdb_wrapper_initialized 0
proc gdb_wrapper_init { args } {
diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp
index 4239a37..29a4f76 100644
--- a/gdb/testsuite/lib/mi-support.exp
+++ b/gdb/testsuite/lib/mi-support.exp
@@ -1,4 +1,4 @@
-# Copyright 1999, 2000, 2002 Free Software Foundation, Inc.
+# Copyright 1999, 2000, 2002, 2003, 2004 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
@@ -281,35 +281,94 @@ proc mi_gdb_reinitialize_dir { subdir } {
}
}
+# Send GDB the "target" command.
+# FIXME: Some of these patterns are not appropriate for MI. Based on
+# config/monitor.exp:gdb_target_command.
+proc mi_gdb_target_cmd { targetname serialport } {
+ global mi_gdb_prompt
+
+ for {set i 1} {$i <= 3} {incr i} {
+ send_gdb "47-target-select $targetname $serialport\n"
+ gdb_expect 60 {
+ -re "47\\^connected.*$mi_gdb_prompt$" {
+ verbose "Set target to $targetname";
+ return 0;
+ }
+ -re "Couldn't establish connection to remote.*$mi_gdb_prompt$" {
+ verbose "Connection failed";
+ }
+ -re "Remote MIPS debugging.*$mi_gdb_prompt$" {
+ verbose "Set target to $targetname";
+ return 0;
+ }
+ -re "Remote debugging using .*$serialport.*$mi_gdb_prompt$" {
+ verbose "Set target to $targetname";
+ return 0;
+ }
+ -re "Remote target $targetname connected to.*$mi_gdb_prompt$" {
+ verbose "Set target to $targetname";
+ return 0;
+ }
+ -re "Connected to.*$mi_gdb_prompt$" {
+ verbose "Set target to $targetname";
+ return 0;
+ }
+ -re "Ending remote.*$mi_gdb_prompt$" { }
+ -re "Connection refused.*$mi_gdb_prompt$" {
+ verbose "Connection refused by remote target. Pausing, and trying again."
+ sleep 5
+ continue
+ }
+ -re "Timeout reading from remote system.*$mi_gdb_prompt$" {
+ verbose "Got timeout error from gdb.";
+ }
+ timeout {
+ send_gdb "";
+ break
+ }
+ }
+ }
+ return 1
+}
+
#
-# load a file into the debugger.
+# load a file into the debugger (file command only).
# return a -1 if anything goes wrong.
#
-proc mi_gdb_load { arg } {
+proc mi_gdb_file_cmd { arg } {
global verbose
global loadpath
global loadfile
global GDB
global mi_gdb_prompt
global last_mi_gdb_file
+ global last_mi_remote_file
upvar timeout timeout
if { $arg == "" } {
set arg $last_mi_gdb_file;
+ } else {
+ set last_mi_gdb_file $arg
+ if { [ info exists last_mi_remote_file ] } {
+ unset last_mi_remote_file
+ }
}
- set last_mi_gdb_file $arg;
-
- # ``gdb_unload''
+ if [is_remote host] {
+ set arg [remote_download host $arg];
+ if { $arg == "" } {
+ error "download failed"
+ return -1;
+ }
+ }
- # ``gdb_file_cmd''
# FIXME: Several of these patterns are only acceptable for console
# output. Queries are an error for mi.
send_gdb "105-file-exec-and-symbols $arg\n"
gdb_expect 120 {
-re "Reading symbols from.*done.*$mi_gdb_prompt$" {
verbose "\t\tLoaded $arg into the $GDB"
- # All OK
+ return 0
}
-re "has no symbol-table.*$mi_gdb_prompt$" {
perror "$arg wasn't compiled with \"-g\""
@@ -338,14 +397,15 @@ proc mi_gdb_load { arg } {
return -1
}
-re "105-file-exec-and-symbols .*\r\n105\\\^done\r\n$mi_gdb_prompt$" {
- # We are just giving the prompt back for now
- # All OK
- }
+ # We (MI) are just giving the prompt back for now, instead of giving
+ # some acknowledgement.
+ return 0
+ }
timeout {
perror "couldn't load $arg into $GDB (timed out)."
return -1
}
- eof {
+ eof {
# This is an attempt to detect a core dump, but seems not to
# work. Perhaps we need to match .* followed by eof, in which
# gdb_expect does not seem to have a way to do that.
@@ -353,9 +413,46 @@ proc mi_gdb_load { arg } {
return -1
}
}
-
+}
+
+#
+# load a file into the debugger.
+# return a -1 if anything goes wrong.
+#
+proc mi_gdb_load { arg } {
+ global verbose
+ global loadpath
+ global loadfile
+ global GDB
+ global mi_gdb_prompt
+ upvar timeout timeout
+
+ # ``gdb_unload''
+ if { $arg != "" } {
+ mi_gdb_file_cmd $arg
+ }
+
# ``load''
- if { [info procs send_target_sid] != "" } {
+ if { [info procs gdbserver_gdb_load] != "" } {
+ global last_mi_gdb_file
+ global last_mi_remote_file
+
+ if { ! [info exists last_mi_remote_file] } {
+ if [is_remote target] {
+ set last_mi_remote_file [remote_download target $arg]
+ } else {
+ set last_mi_remote_file $last_mi_gdb_file
+ }
+ }
+
+ set res [gdbserver_gdb_load $last_mi_remote_file]
+ set protocol [lindex $res 0]
+ set gdbport [lindex $res 1]
+
+ if { [mi_gdb_target_cmd $protocol $gdbport] != 0 } {
+ return -1
+ }
+ } elseif { [info procs send_target_sid] != "" } {
# For SID, things get complex
send_target_sid
gdb_expect 60 {
diff --git a/gdb/top.c b/gdb/top.c
index 8dcf73a..e11aad2 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -383,6 +383,7 @@ catcher (catch_exceptions_ftype *func,
int *func_val,
enum return_reason *func_caught,
char *errstring,
+ char **gdberrmsg,
return_mask mask)
{
SIGJMP_BUF *saved_catch;
@@ -428,7 +429,14 @@ catcher (catch_exceptions_ftype *func,
if (!caught)
val = (*func) (func_uiout, func_args);
else
- val = 0;
+ {
+ val = 0;
+ /* If caller wants a copy of the low-level error message, make one.
+ This is used in the case of a silent error whereby the caller
+ may optionally want to issue the message. */
+ if (gdberrmsg)
+ *gdberrmsg = error_last_message ();
+ }
catch_return = saved_catch;
/* FIXME: cagney/1999-11-05: A correct FUNC implementation will
@@ -476,7 +484,25 @@ catch_exceptions (struct ui_out *uiout,
{
int val;
enum return_reason caught;
- catcher (func, uiout, func_args, &val, &caught, errstring, mask);
+ catcher (func, uiout, func_args, &val, &caught, errstring, NULL, mask);
+ gdb_assert (val >= 0);
+ gdb_assert (caught <= 0);
+ if (caught < 0)
+ return caught;
+ return val;
+}
+
+int
+catch_exceptions_with_msg (struct ui_out *uiout,
+ catch_exceptions_ftype *func,
+ void *func_args,
+ char *errstring,
+ char **gdberrmsg,
+ return_mask mask)
+{
+ int val;
+ enum return_reason caught;
+ catcher (func, uiout, func_args, &val, &caught, errstring, gdberrmsg, mask);
gdb_assert (val >= 0);
gdb_assert (caught <= 0);
if (caught < 0)
@@ -506,7 +532,8 @@ catch_errors (catch_errors_ftype *func, void *func_args, char *errstring,
struct catch_errors_args args;
args.func = func;
args.func_args = func_args;
- catcher (do_catch_errors, uiout, &args, &val, &caught, errstring, mask);
+ catcher (do_catch_errors, uiout, &args, &val, &caught, errstring,
+ NULL, mask);
if (caught != 0)
return 0;
return val;
diff --git a/gdb/top.h b/gdb/top.h
index 50361dc..88b7e7a 100644
--- a/gdb/top.h
+++ b/gdb/top.h
@@ -56,7 +56,6 @@ extern char *get_prompt (void);
extern void set_prompt (char *);
/* From random places. */
-extern int mapped_symbol_files;
extern int readnow_symbol_files;
/* Perform _initialize initialization */
diff --git a/gdb/tui/tui-command.c b/gdb/tui/tui-command.c
index a182b4c..2a51fc8 100644
--- a/gdb/tui/tui-command.c
+++ b/gdb/tui/tui-command.c
@@ -64,8 +64,8 @@ tui_dispatch_ctrl_char (unsigned int ch)
return ch;
else
{
- unsigned int c = 0, ch_copy = ch;
- int i;
+ unsigned int c = 0, chCopy = ch;
+ register int i;
char *term;
/* If this is an xterm, page next/prev keys aren't returned
@@ -77,32 +77,31 @@ tui_dispatch_ctrl_char (unsigned int ch)
term[i] = toupper (term[i]);
if ((strcmp (term, "XTERM") == 0) && key_is_start_sequence (ch))
{
- unsigned int page_ch = 0;
- unsigned int tmp_char;
+ unsigned int pageCh = 0, tmpChar;
- tmp_char = 0;
- while (!key_is_end_sequence (tmp_char))
+ tmpChar = 0;
+ while (!key_is_end_sequence (tmpChar))
{
- tmp_char = (int) wgetch (w);
- if (tmp_char == ERR)
+ tmpChar = (int) wgetch (w);
+ if (tmpChar == ERR)
{
return ch;
}
- if (!tmp_char)
+ if (!tmpChar)
break;
- if (tmp_char == 53)
- page_ch = KEY_PPAGE;
- else if (tmp_char == 54)
- page_ch = KEY_NPAGE;
+ if (tmpChar == 53)
+ pageCh = KEY_PPAGE;
+ else if (tmpChar == 54)
+ pageCh = KEY_NPAGE;
else
{
return 0;
}
}
- ch_copy = page_ch;
+ chCopy = pageCh;
}
- switch (ch_copy)
+ switch (chCopy)
{
case KEY_NPAGE:
tui_scroll_forward (win_info, 0);
@@ -128,7 +127,7 @@ tui_dispatch_ctrl_char (unsigned int ch)
tui_refresh_all_win ();
break;
default:
- c = ch_copy;
+ c = chCopy;
break;
}
return c;
diff --git a/gdb/tui/tui-data.c b/gdb/tui/tui-data.c
index 1f41023..7b901d3 100644
--- a/gdb/tui/tui-data.c
+++ b/gdb/tui/tui-data.c
@@ -46,27 +46,27 @@ struct tui_win_info *(tui_win_list[MAX_MAJOR_WINDOWS]);
/***************************
** Private data
****************************/
-static enum tui_layout_type current_layout = UNDEFINED_LAYOUT;
-static int term_height, term_width;
+static enum tui_layout_type _currentLayout = UNDEFINED_LAYOUT;
+static int _termHeight, _termWidth;
static struct tui_gen_win_info _locator;
-static struct tui_gen_win_info exec_info[2];
-static struct tui_win_info * src_win_list[2];
-static struct tui_list source_windows = {(void **) src_win_list, 0};
-static int default_tab_len = DEFAULT_TAB_LEN;
-static struct tui_win_info * win_with_focus = (struct tui_win_info *) NULL;
-static struct tui_layout_def layout_def =
-{SRC_WIN, /* DISPLAY_MODE */
- FALSE, /* SPLIT */
- TUI_UNDEFINED_REGS, /* REGS_DISPLAY_TYPE */
- TUI_SFLOAT_REGS}; /* FLOAT_REGS_DISPLAY_TYPE */
-static int win_resized = FALSE;
+static struct tui_gen_win_info _execInfo[2];
+static struct tui_win_info * _srcWinList[2];
+static struct tui_list _sourceWindows = {(void **) _srcWinList, 0};
+static int _defaultTabLen = DEFAULT_TAB_LEN;
+static struct tui_win_info * _winWithFocus = (struct tui_win_info *) NULL;
+static struct tui_layout_def _layoutDef =
+{SRC_WIN, /* displayMode */
+ FALSE, /* split */
+ TUI_UNDEFINED_REGS, /* regsDisplayType */
+ TUI_SFLOAT_REGS}; /* floatRegsDisplayType */
+static int _winResized = FALSE;
/*********************************
** Static function forward decls
**********************************/
-static void free_content (tui_win_content, int, enum tui_win_type);
-static void free_content_elements (tui_win_content, int, enum tui_win_type);
+static void freeContent (tui_win_content, int, enum tui_win_type);
+static void freeContentElements (tui_win_content, int, enum tui_win_type);
@@ -108,7 +108,7 @@ tui_set_win_highlight (struct tui_win_info *win_info, int highlight)
int
tui_win_resized (void)
{
- return win_resized;
+ return _winResized;
}
@@ -116,7 +116,7 @@ tui_win_resized (void)
void
tui_set_win_resized_to (int resized)
{
- win_resized = resized;
+ _winResized = resized;
}
@@ -124,7 +124,7 @@ tui_set_win_resized_to (int resized)
struct tui_layout_def *
tui_layout_def (void)
{
- return &layout_def;
+ return &_layoutDef;
}
@@ -132,7 +132,7 @@ tui_layout_def (void)
struct tui_win_info *
tui_win_with_focus (void)
{
- return win_with_focus;
+ return _winWithFocus;
}
@@ -140,7 +140,7 @@ tui_win_with_focus (void)
void
tui_set_win_with_focus (struct tui_win_info * win_info)
{
- win_with_focus = win_info;
+ _winWithFocus = win_info;
}
@@ -148,7 +148,7 @@ tui_set_win_with_focus (struct tui_win_info * win_info)
int
tui_default_tab_len (void)
{
- return default_tab_len;
+ return _defaultTabLen;
}
@@ -156,17 +156,20 @@ tui_default_tab_len (void)
void
tui_set_default_tab_len (int len)
{
- default_tab_len = len;
+ _defaultTabLen = len;
}
-/* Accessor for the current source window. Usually there is only one
- source window (either source or disassembly), but both can be
- displayed at the same time. */
+/*
+ ** currentSourceWin()
+ ** Accessor for the current source window. Usually there is only
+ ** one source window (either source or disassembly), but both can
+ ** be displayed at the same time.
+ */
struct tui_list *
tui_source_windows (void)
{
- return &source_windows;
+ return &_sourceWindows;
}
@@ -176,9 +179,9 @@ tui_source_windows (void)
void
tui_clear_source_windows (void)
{
- source_windows.list[0] = NULL;
- source_windows.list[1] = NULL;
- source_windows.count = 0;
+ _sourceWindows.list[0] = NULL;
+ _sourceWindows.list[1] = NULL;
+ _sourceWindows.count = 0;
}
@@ -199,8 +202,8 @@ tui_clear_source_windows_detail (void)
void
tui_add_to_source_windows (struct tui_win_info * win_info)
{
- if (source_windows.count < 2)
- source_windows.list[source_windows.count++] = (void *) win_info;
+ if (_sourceWindows.count < 2)
+ _sourceWindows.list[_sourceWindows.count++] = (void *) win_info;
}
@@ -237,23 +240,31 @@ tui_clear_win_detail (struct tui_win_info * win_info)
break;
}
}
-}
+
+ return;
+} /* clearWinDetail */
-/* Accessor for the source execution info ptr. */
+/*
+ ** sourceExecInfoPtr().
+ ** Accessor for the source execution info ptr.
+ */
struct tui_gen_win_info *
tui_source_exec_info_win_ptr (void)
{
- return &exec_info[0];
-}
+ return &_execInfo[0];
+} /* sourceExecInfoWinPtr */
-/* Accessor for the disassem execution info ptr. */
+/*
+ ** disassemExecInfoPtr().
+ ** Accessor for the disassem execution info ptr.
+ */
struct tui_gen_win_info *
tui_disassem_exec_info_win_ptr (void)
{
- return &exec_info[1];
-}
+ return &_execInfo[1];
+} /* disassemExecInfoWinPtr */
/* Accessor for the locator win info. Answers a pointer to the static
@@ -265,11 +276,11 @@ tui_locator_win_info_ptr (void)
}
-/* Accessor for the term_height. */
+/* Accessor for the termHeight. */
int
tui_term_height (void)
{
- return term_height;
+ return _termHeight;
}
@@ -277,23 +288,23 @@ tui_term_height (void)
void
tui_set_term_height_to (int h)
{
- term_height = h;
+ _termHeight = h;
}
-/* Accessor for the term_width. */
+/* Accessor for the termWidth. */
int
tui_term_width (void)
{
- return term_width;
+ return _termWidth;
}
-/* Mutator for the term_width. */
+/* Mutator for the termWidth. */
void
tui_set_term_width_to (int w)
{
- term_width = w;
+ _termWidth = w;
}
@@ -301,25 +312,30 @@ tui_set_term_width_to (int w)
enum tui_layout_type
tui_current_layout (void)
{
- return current_layout;
+ return _currentLayout;
}
/* Mutator for the current layout. */
void
-tui_set_current_layout_to (enum tui_layout_type new_layout)
+tui_set_current_layout_to (enum tui_layout_type newLayout)
{
- current_layout = new_layout;
+ _currentLayout = newLayout;
}
-/* Set the origin of the window. */
+/*
+ ** setGenWinOrigin().
+ ** Set the origin of the window
+ */
void
-set_gen_win_origin (struct tui_gen_win_info * win_info, int x, int y)
+setGenWinOrigin (struct tui_gen_win_info * win_info, int x, int y)
{
win_info->origin.x = x;
win_info->origin.y = y;
-}
+
+ return;
+} /* setGenWinOrigin */
/*****************************
@@ -330,19 +346,19 @@ set_gen_win_origin (struct tui_gen_win_info * win_info, int x, int y)
/* Answer the next window in the list, cycling back to the top if
necessary. */
struct tui_win_info *
-tui_next_win (struct tui_win_info * cur_win)
+tui_next_win (struct tui_win_info * curWin)
{
- enum tui_win_type type = cur_win->generic.type;
- struct tui_win_info * next_win = (struct tui_win_info *) NULL;
+ enum tui_win_type type = curWin->generic.type;
+ struct tui_win_info * nextWin = (struct tui_win_info *) NULL;
- if (cur_win->generic.type == CMD_WIN)
+ if (curWin->generic.type == CMD_WIN)
type = SRC_WIN;
else
- type = cur_win->generic.type + 1;
- while (type != cur_win->generic.type && (next_win == NULL))
+ type = curWin->generic.type + 1;
+ while (type != curWin->generic.type && (nextWin == NULL))
{
if (tui_win_list[type] && tui_win_list[type]->generic.is_visible)
- next_win = tui_win_list[type];
+ nextWin = tui_win_list[type];
else
{
if (type == CMD_WIN)
@@ -352,23 +368,23 @@ tui_next_win (struct tui_win_info * cur_win)
}
}
- return next_win;
-}
+ return nextWin;
+} /* tuiNextWin */
/* Answer the prev window in the list, cycling back to the bottom if
necessary. */
struct tui_win_info *
-tui_prev_win (struct tui_win_info * cur_win)
+tui_prev_win (struct tui_win_info * curWin)
{
- enum tui_win_type type = cur_win->generic.type;
+ enum tui_win_type type = curWin->generic.type;
struct tui_win_info * prev = (struct tui_win_info *) NULL;
- if (cur_win->generic.type == SRC_WIN)
+ if (curWin->generic.type == SRC_WIN)
type = CMD_WIN;
else
- type = cur_win->generic.type - 1;
- while (type != cur_win->generic.type && (prev == NULL))
+ type = curWin->generic.type - 1;
+ while (type != curWin->generic.type && (prev == NULL))
{
if (tui_win_list[type]->generic.is_visible)
prev = tui_win_list[type];
@@ -399,9 +415,9 @@ tui_partial_win_by_name (char *name)
{
if (tui_win_list[i] != 0)
{
- char *cur_name = tui_win_name (&tui_win_list[i]->generic);
- if (strlen (name) <= strlen (cur_name) &&
- strncmp (name, cur_name, strlen (name)) == 0)
+ char *curName = tui_win_name (&tui_win_list[i]->generic);
+ if (strlen (name) <= strlen (curName) &&
+ strncmp (name, curName, strlen (name)) == 0)
win_info = tui_win_list[i];
}
i++;
@@ -409,10 +425,13 @@ tui_partial_win_by_name (char *name)
}
return win_info;
-}
+} /* partialWinByName */
-/* Answer the name of the window. */
+/*
+ ** winName().
+ ** Answer the name of the window
+ */
char *
tui_win_name (struct tui_gen_win_info * win_info)
{
@@ -438,7 +457,7 @@ tui_win_name (struct tui_gen_win_info * win_info)
}
return name;
-}
+} /* winName */
void
@@ -460,9 +479,12 @@ tui_alloc_generic_win_info (void)
tui_init_generic_part (win);
return win;
-}
+} /* allocGenericWinInfo */
+/*
+ ** initGenericPart().
+ */
void
tui_init_generic_part (struct tui_gen_win_info * win)
{
@@ -482,10 +504,10 @@ tui_init_generic_part (struct tui_gen_win_info * win)
/*
- ** init_content_element().
+ ** initContentElement().
*/
void
-init_content_element (struct tui_win_element * element, enum tui_win_type type)
+initContentElement (struct tui_win_element * element, enum tui_win_type type)
{
element->highlight = FALSE;
switch (type)
@@ -528,10 +550,14 @@ init_content_element (struct tui_win_element * element, enum tui_win_type type)
default:
break;
}
-}
+ return;
+} /* initContentElement */
+/*
+ ** initWinInfo().
+ */
void
-init_win_info (struct tui_win_info * win_info)
+initWinInfo (struct tui_win_info * win_info)
{
tui_init_generic_part (&win_info->generic);
win_info->can_highlight =
@@ -564,7 +590,9 @@ init_win_info (struct tui_win_info * win_info)
win_info->detail.opaque = NULL;
break;
}
-}
+
+ return;
+} /* initWinInfo */
struct tui_win_info *
@@ -576,23 +604,26 @@ tui_alloc_win_info (enum tui_win_type type)
if ((win_info != NULL))
{
win_info->generic.type = type;
- init_win_info (win_info);
+ initWinInfo (win_info);
}
return win_info;
-}
+} /* allocWinInfo */
-/* Allocates the content and elements in a block. */
+/*
+ ** allocContent().
+ ** Allocates the content and elements in a block.
+ */
tui_win_content
-tui_alloc_content (int num_elements, enum tui_win_type type)
+tui_alloc_content (int numElements, enum tui_win_type type)
{
tui_win_content content = (tui_win_content) NULL;
- char *element_block_ptr = (char *) NULL;
+ char *elementBlockPtr = (char *) NULL;
int i;
if ((content = (tui_win_content)
- xmalloc (sizeof (struct tui_win_element *) * num_elements)) != (tui_win_content) NULL)
+ xmalloc (sizeof (struct tui_win_element *) * numElements)) != (tui_win_content) NULL)
{ /*
** All windows, except the data window, can allocate the elements
** in a chunk. The data window cannot because items can be
@@ -600,14 +631,14 @@ tui_alloc_content (int num_elements, enum tui_win_type type)
*/
if (type != DATA_WIN)
{
- if ((element_block_ptr = (char *)
- xmalloc (sizeof (struct tui_win_element) * num_elements)) != (char *) NULL)
+ if ((elementBlockPtr = (char *)
+ xmalloc (sizeof (struct tui_win_element) * numElements)) != (char *) NULL)
{
- for (i = 0; i < num_elements; i++)
+ for (i = 0; i < numElements; i++)
{
- content[i] = (struct tui_win_element *) element_block_ptr;
- init_content_element (content[i], type);
- element_block_ptr += sizeof (struct tui_win_element);
+ content[i] = (struct tui_win_element *) elementBlockPtr;
+ initContentElement (content[i], type);
+ elementBlockPtr += sizeof (struct tui_win_element);
}
}
else
@@ -619,36 +650,36 @@ tui_alloc_content (int num_elements, enum tui_win_type type)
}
return content;
-}
+} /* allocContent */
/* Adds the input number of elements to the windows's content. If no
- content has been allocated yet, alloc_content() is called to do
+ content has been allocated yet, allocContent() is called to do
this. The index of the first element added is returned, unless
there is a memory allocation error, in which case, (-1) is
returned. */
int
-tui_add_content_elements (struct tui_gen_win_info * win_info, int num_elements)
+tui_add_content_elements (struct tui_gen_win_info * win_info, int numElements)
{
- struct tui_win_element * element_ptr;
- int i, index_start;
+ struct tui_win_element * elementPtr;
+ int i, indexStart;
if (win_info->content == NULL)
{
- win_info->content = (void **) tui_alloc_content (num_elements, win_info->type);
- index_start = 0;
+ win_info->content = (void **) tui_alloc_content (numElements, win_info->type);
+ indexStart = 0;
}
else
- index_start = win_info->content_size;
+ indexStart = win_info->content_size;
if (win_info->content != NULL)
{
- for (i = index_start; (i < num_elements + index_start); i++)
+ for (i = indexStart; (i < numElements + indexStart); i++)
{
- if ((element_ptr = (struct tui_win_element *)
+ if ((elementPtr = (struct tui_win_element *)
xmalloc (sizeof (struct tui_win_element))) != (struct tui_win_element *) NULL)
{
- win_info->content[i] = (void *) element_ptr;
- init_content_element (element_ptr, win_info->type);
+ win_info->content[i] = (void *) elementPtr;
+ initContentElement (elementPtr, win_info->type);
win_info->content_size++;
}
else /* things must be really hosed now! We ran out of memory!? */
@@ -656,39 +687,39 @@ tui_add_content_elements (struct tui_gen_win_info * win_info, int num_elements)
}
}
- return index_start;
-}
+ return indexStart;
+} /* addContentElements */
/* Delete all curses windows associated with win_info, leaving everything
else intact. */
void
-tui_del_window (struct tui_win_info * win_info)
+tuiDelWindow (struct tui_win_info * win_info)
{
- struct tui_gen_win_info * generic_win;
+ struct tui_gen_win_info * genericWin;
switch (win_info->generic.type)
{
case SRC_WIN:
case DISASSEM_WIN:
- generic_win = tui_locator_win_info_ptr ();
- if (generic_win != (struct tui_gen_win_info *) NULL)
+ genericWin = tui_locator_win_info_ptr ();
+ if (genericWin != (struct tui_gen_win_info *) NULL)
{
- tui_delete_win (generic_win->handle);
- generic_win->handle = (WINDOW *) NULL;
- generic_win->is_visible = FALSE;
+ tui_delete_win (genericWin->handle);
+ genericWin->handle = (WINDOW *) NULL;
+ genericWin->is_visible = FALSE;
}
if (win_info->detail.source_info.filename)
{
xfree (win_info->detail.source_info.filename);
win_info->detail.source_info.filename = 0;
}
- generic_win = win_info->detail.source_info.execution_info;
- if (generic_win != (struct tui_gen_win_info *) NULL)
+ genericWin = win_info->detail.source_info.execution_info;
+ if (genericWin != (struct tui_gen_win_info *) NULL)
{
- tui_delete_win (generic_win->handle);
- generic_win->handle = (WINDOW *) NULL;
- generic_win->is_visible = FALSE;
+ tui_delete_win (genericWin->handle);
+ genericWin->handle = (WINDOW *) NULL;
+ genericWin->is_visible = FALSE;
}
break;
case DATA_WIN:
@@ -715,30 +746,30 @@ tui_del_window (struct tui_win_info * win_info)
void
tui_free_window (struct tui_win_info * win_info)
{
- struct tui_gen_win_info * generic_win;
+ struct tui_gen_win_info * genericWin;
switch (win_info->generic.type)
{
case SRC_WIN:
case DISASSEM_WIN:
- generic_win = tui_locator_win_info_ptr ();
- if (generic_win != (struct tui_gen_win_info *) NULL)
+ genericWin = tui_locator_win_info_ptr ();
+ if (genericWin != (struct tui_gen_win_info *) NULL)
{
- tui_delete_win (generic_win->handle);
- generic_win->handle = (WINDOW *) NULL;
+ tui_delete_win (genericWin->handle);
+ genericWin->handle = (WINDOW *) NULL;
}
- tui_free_win_content (generic_win);
+ tui_free_win_content (genericWin);
if (win_info->detail.source_info.filename)
{
xfree (win_info->detail.source_info.filename);
win_info->detail.source_info.filename = 0;
}
- generic_win = win_info->detail.source_info.execution_info;
- if (generic_win != (struct tui_gen_win_info *) NULL)
+ genericWin = win_info->detail.source_info.execution_info;
+ if (genericWin != (struct tui_gen_win_info *) NULL)
{
- tui_delete_win (generic_win->handle);
- generic_win->handle = (WINDOW *) NULL;
- tui_free_win_content (generic_win);
+ tui_delete_win (genericWin->handle);
+ genericWin->handle = (WINDOW *) NULL;
+ tui_free_win_content (genericWin);
}
break;
case DATA_WIN:
@@ -800,17 +831,19 @@ tui_free_win_content (struct tui_gen_win_info * win_info)
{
if (win_info->content != NULL)
{
- free_content ((tui_win_content) win_info->content,
+ freeContent ((tui_win_content) win_info->content,
win_info->content_size,
win_info->type);
win_info->content = NULL;
}
win_info->content_size = 0;
-}
+
+ return;
+} /* freeWinContent */
void
-tui_del_data_windows (tui_win_content content, int content_size)
+tui_del_data_windows (tui_win_content content, int contentSize)
{
int i;
@@ -818,22 +851,22 @@ tui_del_data_windows (tui_win_content content, int content_size)
** Remember that data window content elements are of type struct tui_gen_win_info *,
** each of which whose single element is a data element.
*/
- for (i = 0; i < content_size; i++)
+ for (i = 0; i < contentSize; i++)
{
- struct tui_gen_win_info * generic_win = &content[i]->which_element.data_window;
+ struct tui_gen_win_info * genericWin = &content[i]->which_element.data_window;
- if (generic_win != (struct tui_gen_win_info *) NULL)
+ if (genericWin != (struct tui_gen_win_info *) NULL)
{
- tui_delete_win (generic_win->handle);
- generic_win->handle = (WINDOW *) NULL;
- generic_win->is_visible = FALSE;
+ tui_delete_win (genericWin->handle);
+ genericWin->handle = (WINDOW *) NULL;
+ genericWin->is_visible = FALSE;
}
}
}
void
-tui_free_data_content (tui_win_content content, int content_size)
+tui_free_data_content (tui_win_content content, int contentSize)
{
int i;
@@ -841,21 +874,23 @@ tui_free_data_content (tui_win_content content, int content_size)
** Remember that data window content elements are of type struct tui_gen_win_info *,
** each of which whose single element is a data element.
*/
- for (i = 0; i < content_size; i++)
+ for (i = 0; i < contentSize; i++)
{
- struct tui_gen_win_info * generic_win = &content[i]->which_element.data_window;
+ struct tui_gen_win_info * genericWin = &content[i]->which_element.data_window;
- if (generic_win != (struct tui_gen_win_info *) NULL)
+ if (genericWin != (struct tui_gen_win_info *) NULL)
{
- tui_delete_win (generic_win->handle);
- generic_win->handle = (WINDOW *) NULL;
- tui_free_win_content (generic_win);
+ tui_delete_win (genericWin->handle);
+ genericWin->handle = (WINDOW *) NULL;
+ tui_free_win_content (genericWin);
}
}
- free_content (content,
- content_size,
+ freeContent (content,
+ contentSize,
DATA_WIN);
-}
+
+ return;
+} /* freeDataContent */
/**********************************
@@ -863,22 +898,27 @@ tui_free_data_content (tui_win_content content, int content_size)
**********************************/
+/*
+ ** freeContent().
+ */
static void
-free_content (tui_win_content content, int content_size, enum tui_win_type win_type)
+freeContent (tui_win_content content, int contentSize, enum tui_win_type winType)
{
if (content != (tui_win_content) NULL)
{
- free_content_elements (content, content_size, win_type);
+ freeContentElements (content, contentSize, winType);
xfree (content);
}
-}
+
+ return;
+} /* freeContent */
/*
- ** free_content_elements().
+ ** freeContentElements().
*/
static void
-free_content_elements (tui_win_content content, int content_size, enum tui_win_type type)
+freeContentElements (tui_win_content content, int contentSize, enum tui_win_type type)
{
if (content != (tui_win_content) NULL)
{
@@ -891,7 +931,7 @@ free_content_elements (tui_win_content content, int content_size, enum tui_win_t
}
else
{
- for (i = 0; i < content_size; i++)
+ for (i = 0; i < contentSize; i++)
{
struct tui_win_element * element;
@@ -925,4 +965,6 @@ free_content_elements (tui_win_content content, int content_size, enum tui_win_t
if (type != DATA_WIN && type != DATA_ITEM_WIN)
xfree (content[0]); /* free the element block */
}
-}
+
+ return;
+} /* freeContentElements */
diff --git a/gdb/tui/tui-disasm.c b/gdb/tui/tui-disasm.c
index a431121..81c849a 100644
--- a/gdb/tui/tui-disasm.c
+++ b/gdb/tui/tui-disasm.c
@@ -95,24 +95,24 @@ tui_disassemble (struct tui_asm_line* lines, CORE_ADDR pc, int count)
static CORE_ADDR
tui_find_disassembly_address (CORE_ADDR pc, int from)
{
- CORE_ADDR new_low;
- int max_lines;
+ register CORE_ADDR newLow;
+ int maxLines;
int i;
struct tui_asm_line* lines;
- max_lines = (from > 0) ? from : - from;
- if (max_lines <= 1)
+ maxLines = (from > 0) ? from : - from;
+ if (maxLines <= 1)
return pc;
lines = (struct tui_asm_line*) alloca (sizeof (struct tui_asm_line)
- * max_lines);
- memset (lines, 0, sizeof (struct tui_asm_line) * max_lines);
+ * maxLines);
+ memset (lines, 0, sizeof (struct tui_asm_line) * maxLines);
- new_low = pc;
+ newLow = pc;
if (from > 0)
{
- tui_disassemble (lines, pc, max_lines);
- new_low = lines[max_lines - 1].addr;
+ tui_disassemble (lines, pc, maxLines);
+ newLow = lines[maxLines - 1].addr;
}
else
{
@@ -123,17 +123,17 @@ tui_find_disassembly_address (CORE_ADDR pc, int from)
/* Find backward an address which is a symbol
and for which disassembling from that address will fill
completely the window. */
- pos = max_lines - 1;
+ pos = maxLines - 1;
do {
- new_low -= 1 * max_lines;
- msymbol = lookup_minimal_symbol_by_pc_section (new_low, 0);
+ newLow -= 1 * maxLines;
+ msymbol = lookup_minimal_symbol_by_pc_section (newLow, 0);
if (msymbol)
- new_low = SYMBOL_VALUE_ADDRESS (msymbol);
+ newLow = SYMBOL_VALUE_ADDRESS (msymbol);
else
- new_low += 1 * max_lines;
+ newLow += 1 * maxLines;
- tui_disassemble (lines, new_low, max_lines);
+ tui_disassemble (lines, newLow, maxLines);
last_addr = lines[pos].addr;
} while (last_addr > pc && msymbol);
@@ -148,7 +148,7 @@ tui_find_disassembly_address (CORE_ADDR pc, int from)
CORE_ADDR next_addr;
pos++;
- if (pos >= max_lines)
+ if (pos >= maxLines)
pos = 0;
next_addr = tui_disassemble (&lines[pos], last_addr, 1);
@@ -159,16 +159,16 @@ tui_find_disassembly_address (CORE_ADDR pc, int from)
last_addr = next_addr;
} while (last_addr <= pc);
pos++;
- if (pos >= max_lines)
+ if (pos >= maxLines)
pos = 0;
- new_low = lines[pos].addr;
+ newLow = lines[pos].addr;
}
- for (i = 0; i < max_lines; i++)
+ for (i = 0; i < maxLines; i++)
{
xfree (lines[i].addr_string);
xfree (lines[i].insn);
}
- return new_low;
+ return newLow;
}
/* Function to set the disassembly window's content. */
@@ -176,9 +176,9 @@ enum tui_status
tui_set_disassem_content (CORE_ADDR pc)
{
enum tui_status ret = TUI_FAILURE;
- int i;
+ register int i;
int offset = TUI_DISASM_WIN->detail.source_info.horizontal_offset;
- int line_width, max_lines;
+ register int lineWidth, maxLines;
CORE_ADDR cur_pc;
struct tui_gen_win_info * locator = tui_locator_win_info_ptr ();
int tab_len = tui_default_tab_len ();
@@ -198,21 +198,21 @@ tui_set_disassem_content (CORE_ADDR pc)
cur_pc = (CORE_ADDR)
(((struct tui_win_element *) locator->content[0])->which_element.locator.addr);
- max_lines = TUI_DISASM_WIN->generic.height - 2; /* account for hilite */
+ maxLines = TUI_DISASM_WIN->generic.height - 2; /* account for hilite */
/* Get temporary table that will hold all strings (addr & insn). */
lines = (struct tui_asm_line*) alloca (sizeof (struct tui_asm_line)
- * max_lines);
- memset (lines, 0, sizeof (struct tui_asm_line) * max_lines);
+ * maxLines);
+ memset (lines, 0, sizeof (struct tui_asm_line) * maxLines);
- line_width = TUI_DISASM_WIN->generic.width - 1;
+ lineWidth = TUI_DISASM_WIN->generic.width - 1;
- tui_disassemble (lines, pc, max_lines);
+ tui_disassemble (lines, pc, maxLines);
/* See what is the maximum length of an address and of a line. */
addr_size = 0;
max_size = 0;
- for (i = 0; i < max_lines; i++)
+ for (i = 0; i < maxLines; i++)
{
size_t len = strlen (lines[i].addr_string);
if (len > addr_size)
@@ -229,22 +229,22 @@ tui_set_disassem_content (CORE_ADDR pc)
insn_pos = (1 + (addr_size / tab_len)) * tab_len;
/* Now construct each line */
- for (i = 0; i < max_lines; i++)
+ for (i = 0; i < maxLines; i++)
{
struct tui_win_element * element;
struct tui_source_element* src;
- int cur_len;
+ int curLen;
element = (struct tui_win_element *) TUI_DISASM_WIN->generic.content[i];
src = &element->which_element.source;
strcpy (line, lines[i].addr_string);
- cur_len = strlen (line);
+ curLen = strlen (line);
/* Add spaces to make the instructions start on the same column */
- while (cur_len < insn_pos)
+ while (curLen < insn_pos)
{
strcat (line, " ");
- cur_len++;
+ curLen++;
}
strcat (line, lines[i].insn);
@@ -272,20 +272,20 @@ tui_set_disassem_content (CORE_ADDR pc)
/* Function to display the disassembly window with disassembled code. */
void
-tui_show_disassem (CORE_ADDR start_addr)
+tui_show_disassem (CORE_ADDR startAddr)
{
- struct symtab *s = find_pc_symtab (start_addr);
- struct tui_win_info * win_with_focus = tui_win_with_focus ();
+ struct symtab *s = find_pc_symtab (startAddr);
+ struct tui_win_info * winWithFocus = tui_win_with_focus ();
union tui_line_or_address val;
- val.addr = start_addr;
+ val.addr = startAddr;
tui_add_win_to_layout (DISASSEM_WIN);
tui_update_source_window (TUI_DISASM_WIN, s, val, FALSE);
/*
** if the focus was in the src win, put it in the asm win, if the
** source view isn't split
*/
- if (tui_current_layout () != SRC_DISASSEM_COMMAND && win_with_focus == TUI_SRC_WIN)
+ if (tui_current_layout () != SRC_DISASSEM_COMMAND && winWithFocus == TUI_SRC_WIN)
tui_set_win_focus_to (TUI_DISASM_WIN);
return;
@@ -294,11 +294,11 @@ tui_show_disassem (CORE_ADDR start_addr)
/* Function to display the disassembly window. */
void
-tui_show_disassem_and_update_source (CORE_ADDR start_addr)
+tui_show_disassem_and_update_source (CORE_ADDR startAddr)
{
struct symtab_and_line sal;
- tui_show_disassem (start_addr);
+ tui_show_disassem (startAddr);
if (tui_current_layout () == SRC_DISASSEM_COMMAND)
{
union tui_line_or_address val;
@@ -307,7 +307,7 @@ tui_show_disassem_and_update_source (CORE_ADDR start_addr)
** Update what is in the source window if it is displayed too,
** note that it follows what is in the disassembly window and visa-versa
*/
- sal = find_pc_line (start_addr, 0);
+ sal = find_pc_line (startAddr, 0);
val.line_no = sal.line;
tui_update_source_window (TUI_SRC_WIN, sal.symtab, val, TRUE);
if (sal.symtab)
@@ -374,8 +374,8 @@ tui_get_low_disassembly_address (CORE_ADDR low, CORE_ADDR pc)
/* Scroll the disassembly forward or backward vertically. */
void
-tui_vertical_disassem_scroll (enum tui_scroll_direction scroll_direction,
- int num_to_scroll)
+tui_vertical_disassem_scroll (enum tui_scroll_direction scrollDirection,
+ int numToScroll)
{
if (TUI_DISASM_WIN->generic.content != NULL)
{
@@ -383,7 +383,7 @@ tui_vertical_disassem_scroll (enum tui_scroll_direction scroll_direction,
tui_win_content content;
struct symtab *s;
union tui_line_or_address val;
- int max_lines, dir;
+ int maxLines, dir;
struct symtab_and_line cursal = get_current_source_symtab_and_line ();
content = (tui_win_content) TUI_DISASM_WIN->generic.content;
@@ -393,9 +393,9 @@ tui_vertical_disassem_scroll (enum tui_scroll_direction scroll_direction,
s = cursal.symtab;
/* account for hilite */
- max_lines = TUI_DISASM_WIN->generic.height - 2;
+ maxLines = TUI_DISASM_WIN->generic.height - 2;
pc = content[0]->which_element.source.line_or_addr.addr;
- dir = (scroll_direction == FORWARD_SCROLL) ? max_lines : - max_lines;
+ dir = (scrollDirection == FORWARD_SCROLL) ? maxLines : - maxLines;
val.addr = tui_find_disassembly_address (pc, dir);
tui_update_source_window_as_is (TUI_DISASM_WIN, s, val, FALSE);
diff --git a/gdb/tui/tui-file.c b/gdb/tui/tui-file.c
index 1a72d01..36fc097 100644
--- a/gdb/tui/tui-file.c
+++ b/gdb/tui/tui-file.c
@@ -21,7 +21,7 @@
#include "defs.h"
#include "ui-file.h"
#include "tui/tui-file.h"
-#include "tui/tuiIO.h"
+#include "tui/tui-io.h"
#include "tui.h"
diff --git a/gdb/tui/tui-hooks.c b/gdb/tui/tui-hooks.c
index e00ba85..b982941 100644
--- a/gdb/tui/tui-hooks.c
+++ b/gdb/tui/tui-hooks.c
@@ -1,6 +1,6 @@
/* GDB hooks for TUI.
- Copyright 2001, 2002, 2003 Free Software Foundation, Inc.
+ Copyright 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of GDB.
@@ -39,15 +39,15 @@
#include <unistd.h>
#include <fcntl.h>
-#include "tui.h"
-#include "tuiData.h"
-#include "tuiLayout.h"
-#include "tuiIO.h"
-#include "tuiRegs.h"
-#include "tuiWin.h"
-#include "tuiStack.h"
-#include "tuiDataWin.h"
-#include "tuiSourceWin.h"
+#include "tui/tui.h"
+#include "tui/tui-data.h"
+#include "tui/tui-layout.h"
+#include "tui/tui-io.h"
+#include "tui/tui-regs.h"
+#include "tui/tui-win.h"
+#include "tui/tui-stack.h"
+#include "tui/tui-windata.h"
+#include "tui/tui-winsource.h"
#ifdef HAVE_NCURSES_H
#include <ncurses.h>
@@ -156,7 +156,7 @@ tui_register_changed_hook (int regno)
if (fi && tui_refreshing_registers == 0)
{
tui_refreshing_registers = 1;
- tuiCheckDataValues (fi);
+ tui_check_data_values (fi);
tui_refreshing_registers = 0;
}
}
@@ -250,13 +250,13 @@ tui_selected_frame_level_changed_hook (int level)
select_source_symtab (s);
/* Display the frame position (even if there is no symbols). */
- tuiShowFrameInfo (fi);
+ tui_show_frame_info (fi);
/* Refresh the register window if it's visible. */
if (tui_is_window_visible (DATA_WIN))
{
tui_refreshing_registers = 1;
- tuiCheckDataValues (fi);
+ tui_check_data_values (fi);
tui_refreshing_registers = 0;
}
}
@@ -268,7 +268,7 @@ tui_print_frame_info_listing_hook (struct symtab *s, int line,
int stopline, int noerror)
{
select_source_symtab (s);
- tuiShowFrameInfo (deprecated_selected_frame);
+ tui_show_frame_info (deprecated_selected_frame);
}
/* Called when the target process died or is detached.
@@ -276,7 +276,7 @@ tui_print_frame_info_listing_hook (struct symtab *s, int line,
static void
tui_detach_hook (void)
{
- tuiShowFrameInfo (0);
+ tui_show_frame_info (0);
tui_display_main ();
}
diff --git a/gdb/tui/tui-interp.c b/gdb/tui/tui-interp.c
index 986ebb3..1e1d643 100644
--- a/gdb/tui/tui-interp.c
+++ b/gdb/tui/tui-interp.c
@@ -26,11 +26,11 @@
#include "event-loop.h"
#include "ui-out.h"
#include "cli-out.h"
-#include "tui/tuiData.h"
+#include "tui/tui-data.h"
#include "readline/readline.h"
-#include "tui/tuiWin.h"
+#include "tui/tui-win.h"
#include "tui/tui.h"
-#include "tui/tuiIO.h"
+#include "tui/tui-io.h"
/* Set to 1 when the TUI mode must be activated when we first start gdb. */
static int tui_start_enabled = 0;
@@ -53,7 +53,7 @@ tui_init (void)
/* Install exit handler to leave the screen in a good shape. */
atexit (tui_exit);
- initializeStaticData ();
+ tui_initialize_static_data ();
tui_initialize_io ();
tui_initialize_readline ();
diff --git a/gdb/tui/tui-io.c b/gdb/tui/tui-io.c
index 6ca2bee..bc52ce7 100644
--- a/gdb/tui/tui-io.c
+++ b/gdb/tui/tui-io.c
@@ -147,7 +147,7 @@ static int tui_readline_pipe[2];
This may be the main gdb prompt or a secondary prompt. */
static char *tui_rl_saved_prompt;
-static unsigned int tui_handle_resize_during_io (unsigned int);
+static unsigned int _tuiHandleResizeDuringIO (unsigned int);
static void
tui_putc (char c)
@@ -322,7 +322,8 @@ tui_readline_output (int code, gdb_client_data data)
Comes from readline/complete.c */
static char *
-printable_part (char *pathname)
+printable_part (pathname)
+ char *pathname;
{
char *temp;
@@ -359,7 +360,8 @@ printable_part (char *pathname)
} while (0)
static int
-print_filename (char *to_print, char *full_pathname)
+print_filename (to_print, full_pathname)
+ char *to_print, *full_pathname;
{
int printed_len = 0;
char *s;
@@ -374,7 +376,7 @@ print_filename (char *to_print, char *full_pathname)
/* The user must press "y" or "n". Non-zero return means "y" pressed.
Comes from readline/complete.c */
static int
-get_y_or_n (void)
+get_y_or_n ()
{
extern int _rl_abort_internal ();
int c;
@@ -400,7 +402,9 @@ get_y_or_n (void)
Comes from readline/complete.c and modified to write in
the TUI command window using tui_putc/tui_puts. */
static void
-tui_rl_display_match_list (char **matches, int len, int max)
+tui_rl_display_match_list (matches, len, max)
+ char **matches;
+ int len, max;
{
typedef int QSFUNC (const void *, const void *);
extern int _rl_qsort_string_compare (const void*, const void*);
@@ -594,7 +598,7 @@ tui_cont_sig (int sig)
/* Initialize the IO for gdb in curses mode. */
void
-tui_initialize_io (void)
+tui_initialize_io ()
{
#ifdef SIGCONT
signal (SIGCONT, tui_cont_sig);
@@ -655,7 +659,7 @@ tui_getc (FILE *fp)
#endif
ch = wgetch (w);
- ch = tui_handle_resize_during_io (ch);
+ ch = _tuiHandleResizeDuringIO (ch);
/* The \n must be echoed because it will not be printed by readline. */
if (ch == '\n')
@@ -690,6 +694,10 @@ tui_getc (FILE *fp)
if (ch == '\n' || ch == '\r' || ch == '\f')
TUI_CMD_WIN->detail.command_info.curch = 0;
+#if 0
+ else
+ tuiIncrCommandCharCountBy (1);
+#endif
if (ch == KEY_BACKSPACE)
return '\b';
@@ -700,7 +708,7 @@ tui_getc (FILE *fp)
/* Cleanup when a resize has occured.
Returns the character that must be processed. */
static unsigned int
-tui_handle_resize_during_io (unsigned int original_ch)
+_tuiHandleResizeDuringIO (unsigned int originalCh)
{
if (tui_win_resized ())
{
@@ -710,5 +718,5 @@ tui_handle_resize_during_io (unsigned int original_ch)
return '\n';
}
else
- return original_ch;
+ return originalCh;
}
diff --git a/gdb/tui/tui-layout.c b/gdb/tui/tui-layout.c
index 341d3cd..3c1e230 100644
--- a/gdb/tui/tui-layout.c
+++ b/gdb/tui/tui-layout.c
@@ -50,26 +50,26 @@
/*******************************
** Static Local Decls
********************************/
-static void show_layout (enum tui_layout_type);
-static void init_gen_win_info (struct tui_gen_win_info *, enum tui_win_type, int, int, int, int);
-static void init_and_make_win (void **, enum tui_win_type, int, int, int, int, int);
-static void show_source_or_disasm_and_command (enum tui_layout_type);
-static void make_source_or_disasm_window (struct tui_win_info * *, enum tui_win_type, int, int);
-static void make_command_window (struct tui_win_info * *, int, int);
-static void make_source_window (struct tui_win_info * *, int, int);
-static void make_disasm_window (struct tui_win_info * *, int, int);
-static void make_data_window (struct tui_win_info * *, int, int);
-static void show_source_command (void);
-static void show_disasm_command (void);
-static void show_source_disasm_command (void);
-static void show_data (enum tui_layout_type);
-static enum tui_layout_type next_layout (void);
-static enum tui_layout_type prev_layout (void);
-static void tui_layout_command (char *, int);
-static void tui_toggle_layout_command (char *, int);
-static void tui_toggle_split_layout_command (char *, int);
-static CORE_ADDR extract_display_start_addr (void);
-static void tui_handle_xdb_layout (struct tui_layout_def *);
+static void showLayout (enum tui_layout_type);
+static void _initGenWinInfo (struct tui_gen_win_info *, enum tui_win_type, int, int, int, int);
+static void _initAndMakeWin (void **, enum tui_win_type, int, int, int, int, int);
+static void _showSourceOrDisassemAndCommand (enum tui_layout_type);
+static void _makeSourceOrDisassemWindow (struct tui_win_info * *, enum tui_win_type, int, int);
+static void _makeCommandWindow (struct tui_win_info * *, int, int);
+static void _makeSourceWindow (struct tui_win_info * *, int, int);
+static void _makeDisassemWindow (struct tui_win_info * *, int, int);
+static void _makeDataWindow (struct tui_win_info * *, int, int);
+static void _showSourceCommand (void);
+static void _showDisassemCommand (void);
+static void _showSourceDisassemCommand (void);
+static void _showData (enum tui_layout_type);
+static enum tui_layout_type _nextLayout (void);
+static enum tui_layout_type _prevLayout (void);
+static void _tuiLayout_command (char *, int);
+static void _tuiToggleLayout_command (char *, int);
+static void _tuiToggleSplitLayout_command (char *, int);
+static CORE_ADDR _extractDisplayStartAddr (void);
+static void _tuiHandleXDBLayout (struct tui_layout_def *);
/***************************************
@@ -80,11 +80,11 @@ static void tui_handle_xdb_layout (struct tui_layout_def *);
/* Show the screen layout defined. */
static void
-show_layout (enum tui_layout_type layout)
+showLayout (enum tui_layout_type layout)
{
- enum tui_layout_type cur_layout = tui_current_layout ();
+ enum tui_layout_type curLayout = tui_current_layout ();
- if (layout != cur_layout)
+ if (layout != curLayout)
{
/*
** Since the new layout may cause changes in window size, we
@@ -95,7 +95,7 @@ show_layout (enum tui_layout_type layout)
tui_clear_source_windows ();
if (layout == SRC_DATA_COMMAND || layout == DISASSEM_DATA_COMMAND)
{
- show_data (layout);
+ _showData (layout);
tui_refresh_all (tui_win_list);
}
else
@@ -108,15 +108,15 @@ show_layout (enum tui_layout_type layout)
{
/* Now show the new layout */
case SRC_COMMAND:
- show_source_command ();
+ _showSourceCommand ();
tui_add_to_source_windows (TUI_SRC_WIN);
break;
case DISASSEM_COMMAND:
- show_disasm_command ();
+ _showDisassemCommand ();
tui_add_to_source_windows (TUI_DISASM_WIN);
break;
case SRC_DISASSEM_COMMAND:
- show_source_disasm_command ();
+ _showSourceDisassemCommand ();
tui_add_to_source_windows (TUI_SRC_WIN);
tui_add_to_source_windows (TUI_DISASM_WIN);
break;
@@ -134,54 +134,54 @@ show_layout (enum tui_layout_type layout)
UNDEFINED_LAYOUT, then the data window is populated according to
regs_display_type. */
enum tui_status
-tui_set_layout (enum tui_layout_type layout_type,
+tui_set_layout (enum tui_layout_type layoutType,
enum tui_register_display_type regs_display_type)
{
enum tui_status status = TUI_SUCCESS;
- if (layout_type != UNDEFINED_LAYOUT || regs_display_type != TUI_UNDEFINED_REGS)
+ if (layoutType != UNDEFINED_LAYOUT || regs_display_type != TUI_UNDEFINED_REGS)
{
- enum tui_layout_type cur_layout = tui_current_layout (), new_layout = UNDEFINED_LAYOUT;
- int regs_populate = FALSE;
- CORE_ADDR addr = extract_display_start_addr ();
- struct tui_win_info * new_win_with_focus = (struct tui_win_info *) NULL;
- struct tui_win_info * win_with_focus = tui_win_with_focus ();
- struct tui_layout_def * layout_def = tui_layout_def ();
+ enum tui_layout_type curLayout = tui_current_layout (), newLayout = UNDEFINED_LAYOUT;
+ int regsPopulate = FALSE;
+ CORE_ADDR addr = _extractDisplayStartAddr ();
+ struct tui_win_info * newWinWithFocus = (struct tui_win_info *) NULL;
+ struct tui_win_info * winWithFocus = tui_win_with_focus ();
+ struct tui_layout_def * layoutDef = tui_layout_def ();
- if (layout_type == UNDEFINED_LAYOUT &&
+ if (layoutType == UNDEFINED_LAYOUT &&
regs_display_type != TUI_UNDEFINED_REGS)
{
- if (cur_layout == SRC_DISASSEM_COMMAND)
- new_layout = DISASSEM_DATA_COMMAND;
- else if (cur_layout == SRC_COMMAND || cur_layout == SRC_DATA_COMMAND)
- new_layout = SRC_DATA_COMMAND;
- else if (cur_layout == DISASSEM_COMMAND ||
- cur_layout == DISASSEM_DATA_COMMAND)
- new_layout = DISASSEM_DATA_COMMAND;
+ if (curLayout == SRC_DISASSEM_COMMAND)
+ newLayout = DISASSEM_DATA_COMMAND;
+ else if (curLayout == SRC_COMMAND || curLayout == SRC_DATA_COMMAND)
+ newLayout = SRC_DATA_COMMAND;
+ else if (curLayout == DISASSEM_COMMAND ||
+ curLayout == DISASSEM_DATA_COMMAND)
+ newLayout = DISASSEM_DATA_COMMAND;
}
else
- new_layout = layout_type;
+ newLayout = layoutType;
- regs_populate = (new_layout == SRC_DATA_COMMAND ||
- new_layout == DISASSEM_DATA_COMMAND ||
+ regsPopulate = (newLayout == SRC_DATA_COMMAND ||
+ newLayout == DISASSEM_DATA_COMMAND ||
regs_display_type != TUI_UNDEFINED_REGS);
- if (new_layout != cur_layout || regs_display_type != TUI_UNDEFINED_REGS)
+ if (newLayout != curLayout || regs_display_type != TUI_UNDEFINED_REGS)
{
- if (new_layout != cur_layout)
+ if (newLayout != curLayout)
{
- show_layout (new_layout);
+ showLayout (newLayout);
/*
** Now determine where focus should be
*/
- if (win_with_focus != TUI_CMD_WIN)
+ if (winWithFocus != TUI_CMD_WIN)
{
- switch (new_layout)
+ switch (newLayout)
{
case SRC_COMMAND:
tui_set_win_focus_to (TUI_SRC_WIN);
- layout_def->display_mode = SRC_WIN;
- layout_def->split = FALSE;
+ layoutDef->display_mode = SRC_WIN;
+ layoutDef->split = FALSE;
break;
case DISASSEM_COMMAND:
/* the previous layout was not showing
@@ -193,8 +193,8 @@ tui_set_layout (enum tui_layout_type layout_type,
*/
addr = tui_get_begin_asm_address ();
tui_set_win_focus_to (TUI_DISASM_WIN);
- layout_def->display_mode = DISASSEM_WIN;
- layout_def->split = FALSE;
+ layoutDef->display_mode = DISASSEM_WIN;
+ layoutDef->split = FALSE;
break;
case SRC_DISASSEM_COMMAND:
/* the previous layout was not showing
@@ -205,19 +205,19 @@ tui_set_layout (enum tui_layout_type layout_type,
** We still want to show the assembly though!
*/
addr = tui_get_begin_asm_address ();
- if (win_with_focus == TUI_SRC_WIN)
+ if (winWithFocus == TUI_SRC_WIN)
tui_set_win_focus_to (TUI_SRC_WIN);
else
tui_set_win_focus_to (TUI_DISASM_WIN);
- layout_def->split = TRUE;
+ layoutDef->split = TRUE;
break;
case SRC_DATA_COMMAND:
- if (win_with_focus != TUI_DATA_WIN)
+ if (winWithFocus != TUI_DATA_WIN)
tui_set_win_focus_to (TUI_SRC_WIN);
else
tui_set_win_focus_to (TUI_DATA_WIN);
- layout_def->display_mode = SRC_WIN;
- layout_def->split = FALSE;
+ layoutDef->display_mode = SRC_WIN;
+ layoutDef->split = FALSE;
break;
case DISASSEM_DATA_COMMAND:
/* the previous layout was not showing
@@ -228,35 +228,35 @@ tui_set_layout (enum tui_layout_type layout_type,
** We still want to show the assembly though!
*/
addr = tui_get_begin_asm_address ();
- if (win_with_focus != TUI_DATA_WIN)
+ if (winWithFocus != TUI_DATA_WIN)
tui_set_win_focus_to (TUI_DISASM_WIN);
else
tui_set_win_focus_to (TUI_DATA_WIN);
- layout_def->display_mode = DISASSEM_WIN;
- layout_def->split = FALSE;
+ layoutDef->display_mode = DISASSEM_WIN;
+ layoutDef->split = FALSE;
break;
default:
break;
}
}
- if (new_win_with_focus != (struct tui_win_info *) NULL)
- tui_set_win_focus_to (new_win_with_focus);
+ if (newWinWithFocus != (struct tui_win_info *) NULL)
+ tui_set_win_focus_to (newWinWithFocus);
/*
** Now update the window content
*/
- if (!regs_populate &&
- (new_layout == SRC_DATA_COMMAND ||
- new_layout == DISASSEM_DATA_COMMAND))
+ if (!regsPopulate &&
+ (newLayout == SRC_DATA_COMMAND ||
+ newLayout == DISASSEM_DATA_COMMAND))
tui_display_all_data ();
tui_update_source_windows_with_addr (addr);
}
- if (regs_populate)
+ if (regsPopulate)
{
- layout_def->regs_display_type =
+ layoutDef->regs_display_type =
(regs_display_type == TUI_UNDEFINED_REGS ?
TUI_GENERAL_REGS : regs_display_type);
- tui_show_registers (layout_def->regs_display_type);
+ tui_show_registers (layoutDef->regs_display_type);
}
}
}
@@ -272,55 +272,60 @@ tui_set_layout (enum tui_layout_type layout_type,
void
tui_add_win_to_layout (enum tui_win_type type)
{
- enum tui_layout_type cur_layout = tui_current_layout ();
+ enum tui_layout_type curLayout = tui_current_layout ();
switch (type)
{
case SRC_WIN:
- if (cur_layout != SRC_COMMAND &&
- cur_layout != SRC_DISASSEM_COMMAND &&
- cur_layout != SRC_DATA_COMMAND)
+ if (curLayout != SRC_COMMAND &&
+ curLayout != SRC_DISASSEM_COMMAND &&
+ curLayout != SRC_DATA_COMMAND)
{
tui_clear_source_windows_detail ();
- if (cur_layout == DISASSEM_DATA_COMMAND)
- show_layout (SRC_DATA_COMMAND);
+ if (curLayout == DISASSEM_DATA_COMMAND)
+ showLayout (SRC_DATA_COMMAND);
else
- show_layout (SRC_COMMAND);
+ showLayout (SRC_COMMAND);
}
break;
case DISASSEM_WIN:
- if (cur_layout != DISASSEM_COMMAND &&
- cur_layout != SRC_DISASSEM_COMMAND &&
- cur_layout != DISASSEM_DATA_COMMAND)
+ if (curLayout != DISASSEM_COMMAND &&
+ curLayout != SRC_DISASSEM_COMMAND &&
+ curLayout != DISASSEM_DATA_COMMAND)
{
tui_clear_source_windows_detail ();
- if (cur_layout == SRC_DATA_COMMAND)
- show_layout (DISASSEM_DATA_COMMAND);
+ if (curLayout == SRC_DATA_COMMAND)
+ showLayout (DISASSEM_DATA_COMMAND);
else
- show_layout (DISASSEM_COMMAND);
+ showLayout (DISASSEM_COMMAND);
}
break;
case DATA_WIN:
- if (cur_layout != SRC_DATA_COMMAND &&
- cur_layout != DISASSEM_DATA_COMMAND)
+ if (curLayout != SRC_DATA_COMMAND &&
+ curLayout != DISASSEM_DATA_COMMAND)
{
- if (cur_layout == DISASSEM_COMMAND)
- show_layout (DISASSEM_DATA_COMMAND);
+ if (curLayout == DISASSEM_COMMAND)
+ showLayout (DISASSEM_DATA_COMMAND);
else
- show_layout (SRC_DATA_COMMAND);
+ showLayout (SRC_DATA_COMMAND);
}
break;
default:
break;
}
-}
+ return;
+} /* tuiAddWinToLayout */
-/* Answer the height of a window. If it hasn't been created yet,
- answer what the height of a window would be based upon its type and
- the layout. */
+
+/*
+ ** tuiDefaultWinHeight().
+ ** Answer the height of a window. If it hasn't been created yet,
+ ** answer what the height of a window would be based upon its
+ ** type and the layout.
+ */
int
-tui_default_win_height (enum tui_win_type type, enum tui_layout_type layout)
+tuiDefaultWinHeight (enum tui_win_type type, enum tui_layout_type layout)
{
int h;
@@ -352,7 +357,7 @@ tui_default_win_height (enum tui_win_type type, enum tui_layout_type layout)
}
return h;
-}
+} /* tuiDefaultWinHeight */
/* Answer the height of a window. If it hasn't been created yet,
@@ -364,7 +369,7 @@ tui_default_win_viewport_height (enum tui_win_type type,
{
int h;
- h = tui_default_win_height (type, layout);
+ h = tuiDefaultWinHeight (type, layout);
if (tui_win_list[type] == TUI_CMD_WIN)
h -= 1;
@@ -372,15 +377,18 @@ tui_default_win_viewport_height (enum tui_win_type type,
h -= 2;
return h;
-}
+} /* tuiDefaultWinViewportHeight */
-/* Function to initialize gdb commands, for tui window layout
- manipulation. */
+/*
+ ** _initialize_tuiLayout().
+ ** Function to initialize gdb commands, for tui window layout
+ ** manipulation.
+ */
void
-_initialize_tui_layout (void)
+_initialize_tuiLayout (void)
{
- add_com ("layout", class_tui, tui_layout_command,
+ add_com ("layout", class_tui, _tuiLayout_command,
"Change the layout of windows.\n\
Usage: layout prev | next | <layout_name> \n\
Layout names are:\n\
@@ -395,9 +403,9 @@ Layout names are:\n\
the window that has current logical focus.\n");
if (xdb_commands)
{
- add_com ("td", class_tui, tui_toggle_layout_command,
+ add_com ("td", class_tui, _tuiToggleLayout_command,
"Toggle between Source/Command and Disassembly/Command layouts.\n");
- add_com ("ts", class_tui, tui_toggle_split_layout_command,
+ add_com ("ts", class_tui, _tuiToggleSplitLayout_command,
"Toggle between Source/Command or Disassembly/Command and \n\
Source/Disassembly/Command layouts.\n");
}
@@ -409,81 +417,84 @@ Source/Disassembly/Command layouts.\n");
**************************/
-/* Function to set the layout to SRC, ASM, SPLIT, NEXT, PREV, DATA,
- REGS, $REGS, $GREGS, $FREGS, $SREGS. */
+/*
+ ** _tuiSetLayoutTo()
+ ** Function to set the layout to SRC, ASM, SPLIT, NEXT, PREV, DATA, REGS,
+ ** $REGS, $GREGS, $FREGS, $SREGS.
+ */
enum tui_status
-tui_set_layout_for_display_command (const char *layout_name)
+tui_set_layout_for_display_command (const char *layoutName)
{
enum tui_status status = TUI_SUCCESS;
- if (layout_name != (char *) NULL)
+ if (layoutName != (char *) NULL)
{
- int i;
- char *buf_ptr;
- enum tui_layout_type new_layout = UNDEFINED_LAYOUT;
- enum tui_register_display_type dpy_type = TUI_UNDEFINED_REGS;
- enum tui_layout_type cur_layout = tui_current_layout ();
+ register int i;
+ register char *bufPtr;
+ enum tui_layout_type newLayout = UNDEFINED_LAYOUT;
+ enum tui_register_display_type dpyType = TUI_UNDEFINED_REGS;
+ enum tui_layout_type curLayout = tui_current_layout ();
- buf_ptr = (char *) xstrdup (layout_name);
- for (i = 0; (i < strlen (layout_name)); i++)
- buf_ptr[i] = toupper (buf_ptr[i]);
+ bufPtr = (char *) xstrdup (layoutName);
+ for (i = 0; (i < strlen (layoutName)); i++)
+ bufPtr[i] = toupper (bufPtr[i]);
/* First check for ambiguous input */
- if (strlen (buf_ptr) <= 1 && (*buf_ptr == 'S' || *buf_ptr == '$'))
+ if (strlen (bufPtr) <= 1 && (*bufPtr == 'S' || *bufPtr == '$'))
{
warning ("Ambiguous command input.\n");
status = TUI_FAILURE;
}
else
{
- if (subset_compare (buf_ptr, "SRC"))
- new_layout = SRC_COMMAND;
- else if (subset_compare (buf_ptr, "ASM"))
- new_layout = DISASSEM_COMMAND;
- else if (subset_compare (buf_ptr, "SPLIT"))
- new_layout = SRC_DISASSEM_COMMAND;
- else if (subset_compare (buf_ptr, "REGS") ||
- subset_compare (buf_ptr, TUI_GENERAL_SPECIAL_REGS_NAME) ||
- subset_compare (buf_ptr, TUI_GENERAL_REGS_NAME) ||
- subset_compare (buf_ptr, TUI_FLOAT_REGS_NAME) ||
- subset_compare (buf_ptr, TUI_SPECIAL_REGS_NAME))
+ if (subset_compare (bufPtr, "SRC"))
+ newLayout = SRC_COMMAND;
+ else if (subset_compare (bufPtr, "ASM"))
+ newLayout = DISASSEM_COMMAND;
+ else if (subset_compare (bufPtr, "SPLIT"))
+ newLayout = SRC_DISASSEM_COMMAND;
+ else if (subset_compare (bufPtr, "REGS") ||
+ subset_compare (bufPtr, TUI_GENERAL_SPECIAL_REGS_NAME) ||
+ subset_compare (bufPtr, TUI_GENERAL_REGS_NAME) ||
+ subset_compare (bufPtr, TUI_FLOAT_REGS_NAME) ||
+ subset_compare (bufPtr, TUI_SPECIAL_REGS_NAME))
{
- if (cur_layout == SRC_COMMAND || cur_layout == SRC_DATA_COMMAND)
- new_layout = SRC_DATA_COMMAND;
+ if (curLayout == SRC_COMMAND || curLayout == SRC_DATA_COMMAND)
+ newLayout = SRC_DATA_COMMAND;
else
- new_layout = DISASSEM_DATA_COMMAND;
+ newLayout = DISASSEM_DATA_COMMAND;
/* could ifdef out the following code. when compile with -z, there are null
pointer references that cause a core dump if 'layout regs' is the first
layout command issued by the user. HP has asked us to hook up this code
- edie epstein
*/
- if (subset_compare (buf_ptr, TUI_FLOAT_REGS_NAME))
+ if (subset_compare (bufPtr, TUI_FLOAT_REGS_NAME))
{
if (TUI_DATA_WIN->detail.data_display_info.regs_display_type !=
TUI_SFLOAT_REGS &&
TUI_DATA_WIN->detail.data_display_info.regs_display_type !=
TUI_DFLOAT_REGS)
- dpy_type = TUI_SFLOAT_REGS;
+ dpyType = TUI_SFLOAT_REGS;
else
- dpy_type =
+ dpyType =
TUI_DATA_WIN->detail.data_display_info.regs_display_type;
}
- else if (subset_compare (buf_ptr,
+ else if (subset_compare (bufPtr,
TUI_GENERAL_SPECIAL_REGS_NAME))
- dpy_type = TUI_GENERAL_AND_SPECIAL_REGS;
- else if (subset_compare (buf_ptr, TUI_GENERAL_REGS_NAME))
- dpy_type = TUI_GENERAL_REGS;
- else if (subset_compare (buf_ptr, TUI_SPECIAL_REGS_NAME))
- dpy_type = TUI_SPECIAL_REGS;
+ dpyType = TUI_GENERAL_AND_SPECIAL_REGS;
+ else if (subset_compare (bufPtr, TUI_GENERAL_REGS_NAME))
+ dpyType = TUI_GENERAL_REGS;
+ else if (subset_compare (bufPtr, TUI_SPECIAL_REGS_NAME))
+ dpyType = TUI_SPECIAL_REGS;
else if (TUI_DATA_WIN)
{
if (TUI_DATA_WIN->detail.data_display_info.regs_display_type !=
TUI_UNDEFINED_REGS)
- dpy_type =
+ dpyType =
TUI_DATA_WIN->detail.data_display_info.regs_display_type;
else
- dpy_type = TUI_GENERAL_REGS;
+ dpyType = TUI_GENERAL_REGS;
}
/* end of potential ifdef
@@ -493,18 +504,18 @@ tui_set_layout_for_display_command (const char *layout_name)
general purpose registers
*/
-/* dpy_type = TUI_GENERAL_REGS;
+/* dpyType = TUI_GENERAL_REGS;
*/
}
- else if (subset_compare (buf_ptr, "NEXT"))
- new_layout = next_layout ();
- else if (subset_compare (buf_ptr, "PREV"))
- new_layout = prev_layout ();
+ else if (subset_compare (bufPtr, "NEXT"))
+ newLayout = _nextLayout ();
+ else if (subset_compare (bufPtr, "PREV"))
+ newLayout = _prevLayout ();
else
status = TUI_FAILURE;
- xfree (buf_ptr);
+ xfree (bufPtr);
- tui_set_layout (new_layout, dpy_type);
+ tui_set_layout (newLayout, dpyType);
}
}
else
@@ -515,14 +526,14 @@ tui_set_layout_for_display_command (const char *layout_name)
static CORE_ADDR
-extract_display_start_addr (void)
+_extractDisplayStartAddr (void)
{
- enum tui_layout_type cur_layout = tui_current_layout ();
+ enum tui_layout_type curLayout = tui_current_layout ();
CORE_ADDR addr;
CORE_ADDR pc;
struct symtab_and_line cursal = get_current_source_symtab_and_line ();
- switch (cur_layout)
+ switch (curLayout)
{
case SRC_COMMAND:
case SRC_DATA_COMMAND:
@@ -542,58 +553,63 @@ extract_display_start_addr (void)
}
return addr;
-}
+} /* _extractDisplayStartAddr */
static void
-tui_handle_xdb_layout (struct tui_layout_def * layout_def)
+_tuiHandleXDBLayout (struct tui_layout_def * layoutDef)
{
- if (layout_def->split)
+ if (layoutDef->split)
{
tui_set_layout (SRC_DISASSEM_COMMAND, TUI_UNDEFINED_REGS);
- tui_set_win_focus_to (tui_win_list[layout_def->display_mode]);
+ tui_set_win_focus_to (tui_win_list[layoutDef->display_mode]);
}
else
{
- if (layout_def->display_mode == SRC_WIN)
+ if (layoutDef->display_mode == SRC_WIN)
tui_set_layout (SRC_COMMAND, TUI_UNDEFINED_REGS);
else
- tui_set_layout (DISASSEM_DATA_COMMAND, layout_def->regs_display_type);
+ tui_set_layout (DISASSEM_DATA_COMMAND, layoutDef->regs_display_type);
}
-}
+
+
+ return;
+} /* _tuiHandleXDBLayout */
static void
-tui_toggle_layout_command (char *arg, int from_tty)
+_tuiToggleLayout_command (char *arg, int fromTTY)
{
- struct tui_layout_def * layout_def = tui_layout_def ();
+ struct tui_layout_def * layoutDef = tui_layout_def ();
/* Make sure the curses mode is enabled. */
tui_enable ();
- if (layout_def->display_mode == SRC_WIN)
- layout_def->display_mode = DISASSEM_WIN;
+ if (layoutDef->display_mode == SRC_WIN)
+ layoutDef->display_mode = DISASSEM_WIN;
else
- layout_def->display_mode = SRC_WIN;
+ layoutDef->display_mode = SRC_WIN;
+
+ if (!layoutDef->split)
+ _tuiHandleXDBLayout (layoutDef);
- if (!layout_def->split)
- tui_handle_xdb_layout (layout_def);
}
static void
-tui_toggle_split_layout_command (char *arg, int from_tty)
+_tuiToggleSplitLayout_command (char *arg, int fromTTY)
{
- struct tui_layout_def * layout_def = tui_layout_def ();
+ struct tui_layout_def * layoutDef = tui_layout_def ();
/* Make sure the curses mode is enabled. */
tui_enable ();
- layout_def->split = (!layout_def->split);
- tui_handle_xdb_layout (layout_def);
+ layoutDef->split = (!layoutDef->split);
+ _tuiHandleXDBLayout (layoutDef);
+
}
static void
-tui_layout_command (char *arg, int from_tty)
+_tuiLayout_command (char *arg, int fromTTY)
{
/* Make sure the curses mode is enabled. */
tui_enable ();
@@ -604,146 +620,175 @@ tui_layout_command (char *arg, int from_tty)
}
-/* Answer the previous layout to cycle to. */
+/*
+ ** _nextLayout().
+ ** Answer the previous layout to cycle to.
+ */
static enum tui_layout_type
-next_layout (void)
+_nextLayout (void)
{
- enum tui_layout_type new_layout;
+ enum tui_layout_type newLayout;
- new_layout = tui_current_layout ();
- if (new_layout == UNDEFINED_LAYOUT)
- new_layout = SRC_COMMAND;
+ newLayout = tui_current_layout ();
+ if (newLayout == UNDEFINED_LAYOUT)
+ newLayout = SRC_COMMAND;
else
{
- new_layout++;
- if (new_layout == UNDEFINED_LAYOUT)
- new_layout = SRC_COMMAND;
+ newLayout++;
+ if (newLayout == UNDEFINED_LAYOUT)
+ newLayout = SRC_COMMAND;
}
- return new_layout;
-}
+ return newLayout;
+} /* _nextLayout */
-/* Answer the next layout to cycle to. */
+/*
+ ** _prevLayout().
+ ** Answer the next layout to cycle to.
+ */
static enum tui_layout_type
-prev_layout (void)
+_prevLayout (void)
{
- enum tui_layout_type new_layout;
+ enum tui_layout_type newLayout;
- new_layout = tui_current_layout ();
- if (new_layout == SRC_COMMAND)
- new_layout = DISASSEM_DATA_COMMAND;
+ newLayout = tui_current_layout ();
+ if (newLayout == SRC_COMMAND)
+ newLayout = DISASSEM_DATA_COMMAND;
else
{
- new_layout--;
- if (new_layout == UNDEFINED_LAYOUT)
- new_layout = DISASSEM_DATA_COMMAND;
+ newLayout--;
+ if (newLayout == UNDEFINED_LAYOUT)
+ newLayout = DISASSEM_DATA_COMMAND;
}
- return new_layout;
-}
+ return newLayout;
+} /* _prevLayout */
+/*
+ ** _makeCommandWindow().
+ */
static void
-make_command_window (struct tui_win_info * * win_info_ptr, int height, int origin_y)
+_makeCommandWindow (struct tui_win_info * * winInfoPtr, int height, int originY)
{
- init_and_make_win ((void **) win_info_ptr,
+ _initAndMakeWin ((void **) winInfoPtr,
CMD_WIN,
height,
tui_term_width (),
0,
- origin_y,
+ originY,
DONT_BOX_WINDOW);
- (*win_info_ptr)->can_highlight = FALSE;
-}
+ (*winInfoPtr)->can_highlight = FALSE;
+
+ return;
+} /* _makeCommandWindow */
/*
- ** make_source_window().
+ ** _makeSourceWindow().
*/
static void
-make_source_window (struct tui_win_info * * win_info_ptr, int height, int origin_y)
+_makeSourceWindow (struct tui_win_info * * winInfoPtr, int height, int originY)
{
- make_source_or_disasm_window (win_info_ptr, SRC_WIN, height, origin_y);
+ _makeSourceOrDisassemWindow (winInfoPtr, SRC_WIN, height, originY);
return;
-} /* make_source_window */
+} /* _makeSourceWindow */
/*
- ** make_disasm_window().
+ ** _makeDisassemWindow().
*/
static void
-make_disasm_window (struct tui_win_info * * win_info_ptr, int height, int origin_y)
+_makeDisassemWindow (struct tui_win_info * * winInfoPtr, int height, int originY)
{
- make_source_or_disasm_window (win_info_ptr, DISASSEM_WIN, height, origin_y);
+ _makeSourceOrDisassemWindow (winInfoPtr, DISASSEM_WIN, height, originY);
return;
-} /* make_disasm_window */
+} /* _makeDisassemWindow */
+/*
+ ** _makeDataWindow().
+ */
static void
-make_data_window (struct tui_win_info * * win_info_ptr, int height, int origin_y)
+_makeDataWindow (struct tui_win_info * * winInfoPtr, int height, int originY)
{
- init_and_make_win ((void **) win_info_ptr,
+ _initAndMakeWin ((void **) winInfoPtr,
DATA_WIN,
height,
tui_term_width (),
0,
- origin_y,
+ originY,
BOX_WINDOW);
-}
+
+ return;
+} /* _makeDataWindow */
-/* Show the Source/Command layout. */
+/*
+ ** _showSourceCommand().
+ ** Show the Source/Command layout
+ */
static void
-show_source_command (void)
+_showSourceCommand (void)
{
- show_source_or_disasm_and_command (SRC_COMMAND);
-}
+ _showSourceOrDisassemAndCommand (SRC_COMMAND);
+
+ return;
+} /* _showSourceCommand */
-/* Show the Dissassem/Command layout. */
+/*
+ ** _showDisassemCommand().
+ ** Show the Dissassem/Command layout
+ */
static void
-show_disasm_command (void)
+_showDisassemCommand (void)
{
- show_source_or_disasm_and_command (DISASSEM_COMMAND);
-}
+ _showSourceOrDisassemAndCommand (DISASSEM_COMMAND);
+
+ return;
+} /* _showDisassemCommand */
-/* Show the Source/Disassem/Command layout. */
+/*
+ ** _showSourceDisassemCommand().
+ ** Show the Source/Disassem/Command layout
+ */
static void
-show_source_disasm_command (void)
+_showSourceDisassemCommand (void)
{
if (tui_current_layout () != SRC_DISASSEM_COMMAND)
{
- int cmd_height, src_height, asm_height;
+ int cmdHeight, srcHeight, asmHeight;
if (TUI_CMD_WIN != NULL)
- cmd_height = TUI_CMD_WIN->generic.height;
+ cmdHeight = TUI_CMD_WIN->generic.height;
else
- cmd_height = tui_term_height () / 3;
+ cmdHeight = tui_term_height () / 3;
- src_height = (tui_term_height () - cmd_height) / 2;
- asm_height = tui_term_height () - (src_height + cmd_height);
+ srcHeight = (tui_term_height () - cmdHeight) / 2;
+ asmHeight = tui_term_height () - (srcHeight + cmdHeight);
if (TUI_SRC_WIN == NULL)
- make_source_window (&TUI_SRC_WIN, src_height, 0);
+ _makeSourceWindow (&TUI_SRC_WIN, srcHeight, 0);
else
{
- init_gen_win_info (&TUI_SRC_WIN->generic,
+ _initGenWinInfo (&TUI_SRC_WIN->generic,
TUI_SRC_WIN->generic.type,
- src_height,
+ srcHeight,
TUI_SRC_WIN->generic.width,
TUI_SRC_WIN->detail.source_info.execution_info->width,
0);
TUI_SRC_WIN->can_highlight = TRUE;
- init_gen_win_info (TUI_SRC_WIN->detail.source_info.execution_info,
+ _initGenWinInfo (TUI_SRC_WIN->detail.source_info.execution_info,
EXEC_INFO_WIN,
- src_height,
+ srcHeight,
3,
0,
0);
@@ -758,37 +803,37 @@ show_source_disasm_command (void)
tui_show_source_content (TUI_SRC_WIN);
if (TUI_DISASM_WIN == NULL)
{
- make_disasm_window (&TUI_DISASM_WIN, asm_height, src_height - 1);
- init_and_make_win ((void **) & locator,
+ _makeDisassemWindow (&TUI_DISASM_WIN, asmHeight, srcHeight - 1);
+ _initAndMakeWin ((void **) & locator,
LOCATOR_WIN,
2 /* 1 */ ,
tui_term_width (),
0,
- (src_height + asm_height) - 1,
+ (srcHeight + asmHeight) - 1,
DONT_BOX_WINDOW);
}
else
{
- init_gen_win_info (locator,
+ _initGenWinInfo (locator,
LOCATOR_WIN,
2 /* 1 */ ,
tui_term_width (),
0,
- (src_height + asm_height) - 1);
+ (srcHeight + asmHeight) - 1);
TUI_DISASM_WIN->detail.source_info.has_locator = TRUE;
- init_gen_win_info (
+ _initGenWinInfo (
&TUI_DISASM_WIN->generic,
TUI_DISASM_WIN->generic.type,
- asm_height,
+ asmHeight,
TUI_DISASM_WIN->generic.width,
TUI_DISASM_WIN->detail.source_info.execution_info->width,
- src_height - 1);
- init_gen_win_info (TUI_DISASM_WIN->detail.source_info.execution_info,
+ srcHeight - 1);
+ _initGenWinInfo (TUI_DISASM_WIN->detail.source_info.execution_info,
EXEC_INFO_WIN,
- asm_height,
+ asmHeight,
3,
0,
- src_height - 1);
+ srcHeight - 1);
TUI_DISASM_WIN->can_highlight = TRUE;
tui_make_visible (&TUI_DISASM_WIN->generic);
tui_make_visible (TUI_DISASM_WIN->detail.source_info.execution_info);
@@ -802,12 +847,12 @@ show_source_disasm_command (void)
tui_show_source_content (TUI_DISASM_WIN);
if (TUI_CMD_WIN == NULL)
- make_command_window (&TUI_CMD_WIN,
- cmd_height,
- tui_term_height () - cmd_height);
+ _makeCommandWindow (&TUI_CMD_WIN,
+ cmdHeight,
+ tui_term_height () - cmdHeight);
else
{
- init_gen_win_info (&TUI_CMD_WIN->generic,
+ _initGenWinInfo (&TUI_CMD_WIN->generic,
TUI_CMD_WIN->generic.type,
TUI_CMD_WIN->generic.height,
TUI_CMD_WIN->generic.width,
@@ -822,141 +867,150 @@ show_source_disasm_command (void)
}
tui_set_current_layout_to (SRC_DISASSEM_COMMAND);
}
-}
+ return;
+} /* _showSourceDisassemCommand */
-/* Show the Source/Data/Command or the Dissassembly/Data/Command
- layout. */
+
+/*
+ ** _showData().
+ ** Show the Source/Data/Command or the Dissassembly/Data/Command layout
+ */
static void
-show_data (enum tui_layout_type new_layout)
+_showData (enum tui_layout_type newLayout)
{
- int total_height = (tui_term_height () - TUI_CMD_WIN->generic.height);
- int src_height, data_height;
- enum tui_win_type win_type;
+ int totalHeight = (tui_term_height () - TUI_CMD_WIN->generic.height);
+ int srcHeight, dataHeight;
+ enum tui_win_type winType;
struct tui_gen_win_info * locator = tui_locator_win_info_ptr ();
- data_height = total_height / 2;
- src_height = total_height - data_height;
+ dataHeight = totalHeight / 2;
+ srcHeight = totalHeight - dataHeight;
tui_make_all_invisible ();
tui_make_invisible (locator);
- make_data_window (&TUI_DATA_WIN, data_height, 0);
+ _makeDataWindow (&TUI_DATA_WIN, dataHeight, 0);
TUI_DATA_WIN->can_highlight = TRUE;
- if (new_layout == SRC_DATA_COMMAND)
- win_type = SRC_WIN;
+ if (newLayout == SRC_DATA_COMMAND)
+ winType = SRC_WIN;
else
- win_type = DISASSEM_WIN;
- if (tui_win_list[win_type] == NULL)
+ winType = DISASSEM_WIN;
+ if (tui_win_list[winType] == NULL)
{
- if (win_type == SRC_WIN)
- make_source_window (&tui_win_list[win_type], src_height, data_height - 1);
+ if (winType == SRC_WIN)
+ _makeSourceWindow (&tui_win_list[winType], srcHeight, dataHeight - 1);
else
- make_disasm_window (&tui_win_list[win_type], src_height, data_height - 1);
- init_and_make_win ((void **) & locator,
+ _makeDisassemWindow (&tui_win_list[winType], srcHeight, dataHeight - 1);
+ _initAndMakeWin ((void **) & locator,
LOCATOR_WIN,
2 /* 1 */ ,
tui_term_width (),
0,
- total_height - 1,
+ totalHeight - 1,
DONT_BOX_WINDOW);
}
else
{
- init_gen_win_info (&tui_win_list[win_type]->generic,
- tui_win_list[win_type]->generic.type,
- src_height,
- tui_win_list[win_type]->generic.width,
- tui_win_list[win_type]->detail.source_info.execution_info->width,
- data_height - 1);
- init_gen_win_info (tui_win_list[win_type]->detail.source_info.execution_info,
+ _initGenWinInfo (&tui_win_list[winType]->generic,
+ tui_win_list[winType]->generic.type,
+ srcHeight,
+ tui_win_list[winType]->generic.width,
+ tui_win_list[winType]->detail.source_info.execution_info->width,
+ dataHeight - 1);
+ _initGenWinInfo (tui_win_list[winType]->detail.source_info.execution_info,
EXEC_INFO_WIN,
- src_height,
+ srcHeight,
3,
0,
- data_height - 1);
- tui_make_visible (&tui_win_list[win_type]->generic);
- tui_make_visible (tui_win_list[win_type]->detail.source_info.execution_info);
- init_gen_win_info (locator,
+ dataHeight - 1);
+ tui_make_visible (&tui_win_list[winType]->generic);
+ tui_make_visible (tui_win_list[winType]->detail.source_info.execution_info);
+ _initGenWinInfo (locator,
LOCATOR_WIN,
2 /* 1 */ ,
tui_term_width (),
0,
- total_height - 1);
+ totalHeight - 1);
}
- tui_win_list[win_type]->detail.source_info.has_locator = TRUE;
+ tui_win_list[winType]->detail.source_info.has_locator = TRUE;
tui_make_visible (locator);
tui_show_locator_content ();
- tui_add_to_source_windows (tui_win_list[win_type]);
- tui_set_current_layout_to (new_layout);
-}
+ tui_add_to_source_windows (tui_win_list[winType]);
+ tui_set_current_layout_to (newLayout);
+
+ return;
+} /* _showData */
/*
- ** init_gen_win_info().
+ ** _initGenWinInfo().
*/
static void
-init_gen_win_info (struct tui_gen_win_info * win_info, enum tui_win_type type,
- int height, int width, int origin_x, int origin_y)
+_initGenWinInfo (struct tui_gen_win_info * winInfo, enum tui_win_type type,
+ int height, int width, int originX, int originY)
{
int h = height;
- win_info->type = type;
- win_info->width = width;
- win_info->height = h;
+ winInfo->type = type;
+ winInfo->width = width;
+ winInfo->height = h;
if (h > 1)
{
- win_info->viewport_height = h - 1;
- if (win_info->type != CMD_WIN)
- win_info->viewport_height--;
+ winInfo->viewport_height = h - 1;
+ if (winInfo->type != CMD_WIN)
+ winInfo->viewport_height--;
}
else
- win_info->viewport_height = 1;
- win_info->origin.x = origin_x;
- win_info->origin.y = origin_y;
+ winInfo->viewport_height = 1;
+ winInfo->origin.x = originX;
+ winInfo->origin.y = originY;
return;
-} /* init_gen_win_info */
+} /* _initGenWinInfo */
/*
- ** init_and_make_win().
+ ** _initAndMakeWin().
*/
static void
-init_and_make_win (void ** win_info_ptr, enum tui_win_type win_type,
- int height, int width, int origin_x, int origin_y, int box_it)
+_initAndMakeWin (void ** winInfoPtr, enum tui_win_type winType,
+ int height, int width, int originX, int originY, int boxIt)
{
- void *opaque_win_info = *win_info_ptr;
+ void *opaqueWinInfo = *winInfoPtr;
struct tui_gen_win_info * generic;
- if (opaque_win_info == NULL)
+ if (opaqueWinInfo == NULL)
{
- if (tui_win_is_auxillary (win_type))
- opaque_win_info = (void *) tui_alloc_generic_win_info ();
+ if (tui_win_is_auxillary (winType))
+ opaqueWinInfo = (void *) tui_alloc_generic_win_info ();
else
- opaque_win_info = (void *) tui_alloc_win_info (win_type);
+ opaqueWinInfo = (void *) tui_alloc_win_info (winType);
}
- if (tui_win_is_auxillary (win_type))
- generic = (struct tui_gen_win_info *) opaque_win_info;
+ if (tui_win_is_auxillary (winType))
+ generic = (struct tui_gen_win_info *) opaqueWinInfo;
else
- generic = &((struct tui_win_info *) opaque_win_info)->generic;
+ generic = &((struct tui_win_info *) opaqueWinInfo)->generic;
- if (opaque_win_info != NULL)
+ if (opaqueWinInfo != NULL)
{
- init_gen_win_info (generic, win_type, height, width, origin_x, origin_y);
- if (!tui_win_is_auxillary (win_type))
+ _initGenWinInfo (generic, winType, height, width, originX, originY);
+ if (!tui_win_is_auxillary (winType))
{
if (generic->type == CMD_WIN)
- ((struct tui_win_info *) opaque_win_info)->can_highlight = FALSE;
+ ((struct tui_win_info *) opaqueWinInfo)->can_highlight = FALSE;
else
- ((struct tui_win_info *) opaque_win_info)->can_highlight = TRUE;
+ ((struct tui_win_info *) opaqueWinInfo)->can_highlight = TRUE;
}
- tui_make_window (generic, box_it);
+ tui_make_window (generic, boxIt);
}
- *win_info_ptr = opaque_win_info;
+ *winInfoPtr = opaqueWinInfo;
}
+/*
+ ** _makeSourceOrDisassemWindow().
+ */
static void
-make_source_or_disasm_window (struct tui_win_info * * win_info_ptr, enum tui_win_type type,
- int height, int origin_y)
+_makeSourceOrDisassemWindow (struct tui_win_info * * winInfoPtr, enum tui_win_type type,
+ int height, int originY)
{
struct tui_gen_win_info * execution_info = (struct tui_gen_win_info *) NULL;
@@ -967,105 +1021,110 @@ make_source_or_disasm_window (struct tui_win_info * * win_info_ptr, enum tui_win
execution_info = tui_source_exec_info_win_ptr ();
else
execution_info = tui_disassem_exec_info_win_ptr ();
- init_and_make_win ((void **) & execution_info,
+ _initAndMakeWin ((void **) & execution_info,
EXEC_INFO_WIN,
height,
3,
0,
- origin_y,
+ originY,
DONT_BOX_WINDOW);
/*
** Now create the source window.
*/
- init_and_make_win ((void **) win_info_ptr,
+ _initAndMakeWin ((void **) winInfoPtr,
type,
height,
tui_term_width () - execution_info->width,
execution_info->width,
- origin_y,
+ originY,
BOX_WINDOW);
- (*win_info_ptr)->detail.source_info.execution_info = execution_info;
-}
+ (*winInfoPtr)->detail.source_info.execution_info = execution_info;
+
+ return;
+} /* _makeSourceOrDisassemWindow */
-/* Show the Source/Command or the Disassem layout. */
+/*
+ ** _showSourceOrDisassemAndCommand().
+ ** Show the Source/Command or the Disassem layout
+ */
static void
-show_source_or_disasm_and_command (enum tui_layout_type layout_type)
+_showSourceOrDisassemAndCommand (enum tui_layout_type layoutType)
{
- if (tui_current_layout () != layout_type)
+ if (tui_current_layout () != layoutType)
{
- struct tui_win_info * *win_info_ptr;
- int src_height, cmd_height;
+ struct tui_win_info * *winInfoPtr;
+ int srcHeight, cmdHeight;
struct tui_gen_win_info * locator = tui_locator_win_info_ptr ();
if (TUI_CMD_WIN != NULL)
- cmd_height = TUI_CMD_WIN->generic.height;
+ cmdHeight = TUI_CMD_WIN->generic.height;
else
- cmd_height = tui_term_height () / 3;
- src_height = tui_term_height () - cmd_height;
+ cmdHeight = tui_term_height () / 3;
+ srcHeight = tui_term_height () - cmdHeight;
- if (layout_type == SRC_COMMAND)
- win_info_ptr = &TUI_SRC_WIN;
+ if (layoutType == SRC_COMMAND)
+ winInfoPtr = &TUI_SRC_WIN;
else
- win_info_ptr = &TUI_DISASM_WIN;
+ winInfoPtr = &TUI_DISASM_WIN;
- if ((*win_info_ptr) == NULL)
+ if ((*winInfoPtr) == NULL)
{
- if (layout_type == SRC_COMMAND)
- make_source_window (win_info_ptr, src_height - 1, 0);
+ if (layoutType == SRC_COMMAND)
+ _makeSourceWindow (winInfoPtr, srcHeight - 1, 0);
else
- make_disasm_window (win_info_ptr, src_height - 1, 0);
- init_and_make_win ((void **) & locator,
+ _makeDisassemWindow (winInfoPtr, srcHeight - 1, 0);
+ _initAndMakeWin ((void **) & locator,
LOCATOR_WIN,
2 /* 1 */ ,
tui_term_width (),
0,
- src_height - 1,
+ srcHeight - 1,
DONT_BOX_WINDOW);
}
else
{
- init_gen_win_info (locator,
+ _initGenWinInfo (locator,
LOCATOR_WIN,
2 /* 1 */ ,
tui_term_width (),
0,
- src_height - 1);
- (*win_info_ptr)->detail.source_info.has_locator = TRUE;
- init_gen_win_info (
- &(*win_info_ptr)->generic,
- (*win_info_ptr)->generic.type,
- src_height - 1,
- (*win_info_ptr)->generic.width,
- (*win_info_ptr)->detail.source_info.execution_info->width,
+ srcHeight - 1);
+ (*winInfoPtr)->detail.source_info.has_locator = TRUE;
+ _initGenWinInfo (
+ &(*winInfoPtr)->generic,
+ (*winInfoPtr)->generic.type,
+ srcHeight - 1,
+ (*winInfoPtr)->generic.width,
+ (*winInfoPtr)->detail.source_info.execution_info->width,
0);
- init_gen_win_info ((*win_info_ptr)->detail.source_info.execution_info,
+ _initGenWinInfo ((*winInfoPtr)->detail.source_info.execution_info,
EXEC_INFO_WIN,
- src_height - 1,
+ srcHeight - 1,
3,
0,
0);
- (*win_info_ptr)->can_highlight = TRUE;
- tui_make_visible (&(*win_info_ptr)->generic);
- tui_make_visible ((*win_info_ptr)->detail.source_info.execution_info);
+ (*winInfoPtr)->can_highlight = TRUE;
+ tui_make_visible (&(*winInfoPtr)->generic);
+ tui_make_visible ((*winInfoPtr)->detail.source_info.execution_info);
}
- if ((*win_info_ptr) != NULL)
+ if ((*winInfoPtr) != NULL)
{
- (*win_info_ptr)->detail.source_info.has_locator = TRUE;
+ (*winInfoPtr)->detail.source_info.has_locator = TRUE;
tui_make_visible (locator);
tui_show_locator_content ();
- tui_show_source_content (*win_info_ptr);
+ tui_show_source_content (*winInfoPtr);
if (TUI_CMD_WIN == NULL)
{
- make_command_window (&TUI_CMD_WIN, cmd_height, src_height);
+ _makeCommandWindow (&TUI_CMD_WIN, cmdHeight, srcHeight);
tui_refresh_win (&TUI_CMD_WIN->generic);
}
else
{
- init_gen_win_info (&TUI_CMD_WIN->generic,
+ _initGenWinInfo (&TUI_CMD_WIN->generic,
TUI_CMD_WIN->generic.type,
TUI_CMD_WIN->generic.height,
TUI_CMD_WIN->generic.width,
@@ -1075,6 +1134,8 @@ show_source_or_disasm_and_command (enum tui_layout_type layout_type)
tui_make_visible (&TUI_CMD_WIN->generic);
}
}
- tui_set_current_layout_to (layout_type);
+ tui_set_current_layout_to (layoutType);
}
-}
+
+ return;
+} /* _showSourceOrDisassemAndCommand */
diff --git a/gdb/tui/tui-regs.c b/gdb/tui/tui-regs.c
index d3ff1eb..ad70a88 100644
--- a/gdb/tui/tui-regs.c
+++ b/gdb/tui/tui-regs.c
@@ -77,28 +77,28 @@
/*****************************************
** STATIC LOCAL FUNCTIONS FORWARD DECLS **
******************************************/
-static enum tui_status tui_set_regs_content
+static enum tui_status _tuiSetRegsContent
(int, int, struct frame_info *, enum tui_register_display_type, int);
-static const char *tui_register_name (int);
-static enum tui_status tui_get_register_raw_value (int, char *, struct frame_info *);
-static void tui_set_register_element
+static const char *_tuiRegisterName (int);
+static enum tui_status _tuiGetRegisterRawValue (int, char *, struct frame_info *);
+static void _tuiSetRegisterElement
(int, struct frame_info *, struct tui_data_element *, int);
-static void tui_display_register (int, struct tui_gen_win_info *, enum precision_type);
-static void tui_register_format
+static void _tuiDisplayRegister (int, struct tui_gen_win_info *, enum precision_type);
+static void _tuiRegisterFormat
(char *, int, int, struct tui_data_element *, enum precision_type);
-static enum tui_status tui_set_general_regs_content (int);
-static enum tui_status tui_set_special_regs_content (int);
-static enum tui_status tui_set_general_and_special_regs_content (int);
-static enum tui_status tui_set_float_regs_content (enum tui_register_display_type, int);
-static int tui_reg_value_has_changed
+static enum tui_status _tuiSetGeneralRegsContent (int);
+static enum tui_status _tuiSetSpecialRegsContent (int);
+static enum tui_status _tuiSetGeneralAndSpecialRegsContent (int);
+static enum tui_status _tuiSetFloatRegsContent (enum tui_register_display_type, int);
+static int _tuiRegValueHasChanged
(struct tui_data_element *, struct frame_info *, char *);
-static void tui_show_float_command (char *, int);
-static void tui_show_general_command (char *, int);
-static void tui_show_special_command (char *, int);
-static void tui_v_show_registers_command_support (enum tui_register_display_type);
-static void _tui_toggle_float_regs_command (char *, int);
-static void tui_scroll_regs_forward_command (char *, int);
-static void tui_scroll_regs_backward_command (char *, int);
+static void _tuiShowFloat_command (char *, int);
+static void _tuiShowGeneral_command (char *, int);
+static void _tuiShowSpecial_command (char *, int);
+static void _tui_vShowRegisters_commandSupport (enum tui_register_display_type);
+static void _tuiToggleFloatRegs_command (char *, int);
+static void _tuiScrollRegsForward_command (char *, int);
+static void _tuiScrollRegsBackward_command (char *, int);
@@ -111,34 +111,34 @@ static void tui_scroll_regs_backward_command (char *, int);
int
tui_last_regs_line_no (void)
{
- int num_lines = (-1);
+ register int numLines = (-1);
if (TUI_DATA_WIN->detail.data_display_info.regs_content_count > 0)
{
- num_lines = (TUI_DATA_WIN->detail.data_display_info.regs_content_count /
+ numLines = (TUI_DATA_WIN->detail.data_display_info.regs_content_count /
TUI_DATA_WIN->detail.data_display_info.regs_column_count);
if (TUI_DATA_WIN->detail.data_display_info.regs_content_count %
TUI_DATA_WIN->detail.data_display_info.regs_column_count)
- num_lines++;
+ numLines++;
}
- return num_lines;
+ return numLines;
}
-/* Answer the line number that the register element at element_no is
- on. If element_no is greater than the number of register elements
+/* Answer the line number that the register element at elementNo is
+ on. If elementNo is greater than the number of register elements
there are, -1 is returned. */
int
-tui_line_from_reg_element_no (int element_no)
+tui_line_from_reg_element_no (int elementNo)
{
- if (element_no < TUI_DATA_WIN->detail.data_display_info.regs_content_count)
+ if (elementNo < TUI_DATA_WIN->detail.data_display_info.regs_content_count)
{
int i, line = (-1);
i = 1;
while (line == (-1))
{
- if (element_no <
+ if (elementNo <
(TUI_DATA_WIN->detail.data_display_info.regs_column_count * i))
line = i - 1;
else
@@ -152,14 +152,14 @@ tui_line_from_reg_element_no (int element_no)
}
-/* Answer the index of the first element in line_no. If line_no is past
+/* Answer the index of the first element in lineNo. If lineNo is past
the register area (-1) is returned. */
int
-tui_first_reg_element_no_inline (int line_no)
+tui_first_reg_element_no_inline (int lineNo)
{
- if ((line_no * TUI_DATA_WIN->detail.data_display_info.regs_column_count)
+ if ((lineNo * TUI_DATA_WIN->detail.data_display_info.regs_column_count)
<= TUI_DATA_WIN->detail.data_display_info.regs_content_count)
- return ((line_no + 1) *
+ return ((lineNo + 1) *
TUI_DATA_WIN->detail.data_display_info.regs_column_count) -
TUI_DATA_WIN->detail.data_display_info.regs_column_count;
else
@@ -167,75 +167,78 @@ tui_first_reg_element_no_inline (int line_no)
}
-/* Answer the index of the last element in line_no. If line_no is
- past the register area (-1) is returned. */
+/*
+ ** tuiLastRegElementNoInLine()
+ ** Answer the index of the last element in lineNo. If lineNo is past
+ ** the register area (-1) is returned.
+ */
int
-tui_last_reg_element_no_in_line (int line_no)
+tuiLastRegElementNoInLine (int lineNo)
{
- if ((line_no * TUI_DATA_WIN->detail.data_display_info.regs_column_count) <=
+ if ((lineNo * TUI_DATA_WIN->detail.data_display_info.regs_column_count) <=
TUI_DATA_WIN->detail.data_display_info.regs_content_count)
- return ((line_no + 1) *
+ return ((lineNo + 1) *
TUI_DATA_WIN->detail.data_display_info.regs_column_count) - 1;
else
return (-1);
-}
+} /* tuiLastRegElementNoInLine */
/* Calculate the number of columns that should be used to display the
registers. */
int
-tui_calculate_regs_column_count (enum tui_register_display_type dpy_type)
+tui_calculate_regs_column_count (enum tui_register_display_type dpyType)
{
- int col_count, col_width;
+ int colCount, colWidth;
- if (IS_64BIT || dpy_type == TUI_DFLOAT_REGS)
- col_width = DOUBLE_FLOAT_VALUE_WIDTH + DOUBLE_FLOAT_LABEL_WIDTH;
+ if (IS_64BIT || dpyType == TUI_DFLOAT_REGS)
+ colWidth = DOUBLE_FLOAT_VALUE_WIDTH + DOUBLE_FLOAT_LABEL_WIDTH;
else
{
- if (dpy_type == TUI_SFLOAT_REGS)
- col_width = SINGLE_FLOAT_VALUE_WIDTH + SINGLE_FLOAT_LABEL_WIDTH;
+ if (dpyType == TUI_SFLOAT_REGS)
+ colWidth = SINGLE_FLOAT_VALUE_WIDTH + SINGLE_FLOAT_LABEL_WIDTH;
else
- col_width = SINGLE_VALUE_WIDTH + SINGLE_LABEL_WIDTH;
+ colWidth = SINGLE_VALUE_WIDTH + SINGLE_LABEL_WIDTH;
}
- col_count = (TUI_DATA_WIN->generic.width - 2) / col_width;
+ colCount = (TUI_DATA_WIN->generic.width - 2) / colWidth;
- return col_count;
-}
+ return colCount;
+} /* tuiCalulateRegs_column_count */
-/* Show the registers int the data window as indicated by dpy_type. If
+/* Show the registers int the data window as indicated by dpyType. If
there is any other registers being displayed, then they are
- cleared. What registers are displayed is dependent upon dpy_type. */
+ cleared. What registers are displayed is dependent upon dpyType. */
void
-tui_show_registers (enum tui_register_display_type dpy_type)
+tui_show_registers (enum tui_register_display_type dpyType)
{
enum tui_status ret = TUI_FAILURE;
- int refresh_values_only = FALSE;
+ int refreshValuesOnly = FALSE;
/* Say that registers should be displayed, even if there is a problem */
TUI_DATA_WIN->detail.data_display_info.display_regs = TRUE;
if (target_has_registers)
{
- refresh_values_only =
- (dpy_type == TUI_DATA_WIN->detail.data_display_info.regs_display_type);
- switch (dpy_type)
+ refreshValuesOnly =
+ (dpyType == TUI_DATA_WIN->detail.data_display_info.regs_display_type);
+ switch (dpyType)
{
case TUI_GENERAL_REGS:
- ret = tui_set_general_regs_content (refresh_values_only);
+ ret = _tuiSetGeneralRegsContent (refreshValuesOnly);
break;
case TUI_SFLOAT_REGS:
case TUI_DFLOAT_REGS:
- ret = tui_set_float_regs_content (dpy_type, refresh_values_only);
+ ret = _tuiSetFloatRegsContent (dpyType, refreshValuesOnly);
break;
/* could ifdef out */
case TUI_SPECIAL_REGS:
- ret = tui_set_special_regs_content (refresh_values_only);
+ ret = _tuiSetSpecialRegsContent (refreshValuesOnly);
break;
case TUI_GENERAL_AND_SPECIAL_REGS:
- ret = tui_set_general_and_special_regs_content (refresh_values_only);
+ ret = _tuiSetGeneralAndSpecialRegsContent (refreshValuesOnly);
break;
/* end of potential if def */
@@ -256,34 +259,34 @@ tui_show_registers (enum tui_register_display_type dpy_type)
/* Clear all notation of changed values */
for (i = 0; (i < TUI_DATA_WIN->detail.data_display_info.regs_content_count); i++)
{
- struct tui_gen_win_info * data_item_win;
+ struct tui_gen_win_info * dataItemWin;
- data_item_win = &TUI_DATA_WIN->detail.data_display_info.
+ dataItemWin = &TUI_DATA_WIN->detail.data_display_info.
regs_content[i]->which_element.data_window;
(&((struct tui_win_element *)
- data_item_win->content[0])->which_element.data)->highlight = FALSE;
+ dataItemWin->content[0])->which_element.data)->highlight = FALSE;
}
- TUI_DATA_WIN->detail.data_display_info.regs_display_type = dpy_type;
+ TUI_DATA_WIN->detail.data_display_info.regs_display_type = dpyType;
tui_display_all_data ();
}
- (tui_layout_def ())->regs_display_type = dpy_type;
+ (tui_layout_def ())->regs_display_type = dpyType;
return;
}
/* Function to display the registers in the content from
- 'start_element_no' until the end of the register content or the end
+ 'startElementNo' until the end of the register content or the end
of the display height. No checking for displaying past the end of
the registers is done here. */
void
-tui_display_registers_from (int start_element_no)
+tui_display_registers_from (int startElementNo)
{
if (TUI_DATA_WIN->detail.data_display_info.regs_content != (tui_win_content) NULL &&
TUI_DATA_WIN->detail.data_display_info.regs_content_count > 0)
{
- int i = start_element_no;
- int j, value_chars_wide, item_win_width, cur_y, label_width;
+ register int i = startElementNo;
+ int j, valueCharsWide, itemWinWidth, curY, labelWidth;
enum precision_type precision;
precision = (TUI_DATA_WIN->detail.data_display_info.regs_display_type
@@ -292,64 +295,64 @@ tui_display_registers_from (int start_element_no)
if (IS_64BIT ||
TUI_DATA_WIN->detail.data_display_info.regs_display_type == TUI_DFLOAT_REGS)
{
- value_chars_wide = DOUBLE_FLOAT_VALUE_WIDTH;
- label_width = DOUBLE_FLOAT_LABEL_WIDTH;
+ valueCharsWide = DOUBLE_FLOAT_VALUE_WIDTH;
+ labelWidth = DOUBLE_FLOAT_LABEL_WIDTH;
}
else
{
if (TUI_DATA_WIN->detail.data_display_info.regs_display_type ==
TUI_SFLOAT_REGS)
{
- value_chars_wide = SINGLE_FLOAT_VALUE_WIDTH;
- label_width = SINGLE_FLOAT_LABEL_WIDTH;
+ valueCharsWide = SINGLE_FLOAT_VALUE_WIDTH;
+ labelWidth = SINGLE_FLOAT_LABEL_WIDTH;
}
else
{
- value_chars_wide = SINGLE_VALUE_WIDTH;
- label_width = SINGLE_LABEL_WIDTH;
+ valueCharsWide = SINGLE_VALUE_WIDTH;
+ labelWidth = SINGLE_LABEL_WIDTH;
}
}
- item_win_width = value_chars_wide + label_width;
+ itemWinWidth = valueCharsWide + labelWidth;
/*
** Now create each data "sub" window, and write the display into it.
*/
- cur_y = 1;
+ curY = 1;
while (i < TUI_DATA_WIN->detail.data_display_info.regs_content_count &&
- cur_y <= TUI_DATA_WIN->generic.viewport_height)
+ curY <= TUI_DATA_WIN->generic.viewport_height)
{
for (j = 0;
(j < TUI_DATA_WIN->detail.data_display_info.regs_column_count &&
i < TUI_DATA_WIN->detail.data_display_info.regs_content_count); j++)
{
- struct tui_gen_win_info * data_item_win;
- struct tui_data_element * data_element_ptr;
+ struct tui_gen_win_info * dataItemWin;
+ struct tui_data_element * dataElementPtr;
/* create the window if necessary */
- data_item_win = &TUI_DATA_WIN->detail.data_display_info.
+ dataItemWin = &TUI_DATA_WIN->detail.data_display_info.
regs_content[i]->which_element.data_window;
- data_element_ptr = &((struct tui_win_element *)
- data_item_win->content[0])->which_element.data;
- if (data_item_win->handle == (WINDOW *) NULL)
+ dataElementPtr = &((struct tui_win_element *)
+ dataItemWin->content[0])->which_element.data;
+ if (dataItemWin->handle == (WINDOW *) NULL)
{
- data_item_win->height = 1;
- data_item_win->width = (precision == double_precision) ?
- item_win_width + 2 : item_win_width + 1;
- data_item_win->origin.x = (item_win_width * j) + 1;
- data_item_win->origin.y = cur_y;
- tui_make_window (data_item_win, DONT_BOX_WINDOW);
- scrollok (data_item_win->handle, FALSE);
+ dataItemWin->height = 1;
+ dataItemWin->width = (precision == double_precision) ?
+ itemWinWidth + 2 : itemWinWidth + 1;
+ dataItemWin->origin.x = (itemWinWidth * j) + 1;
+ dataItemWin->origin.y = curY;
+ tui_make_window (dataItemWin, DONT_BOX_WINDOW);
+ scrollok (dataItemWin->handle, FALSE);
}
- touchwin (data_item_win->handle);
+ touchwin (dataItemWin->handle);
/*
** Get the printable representation of the register
** and display it
*/
- tui_display_register (
- data_element_ptr->item_no, data_item_win, precision);
+ _tuiDisplayRegister (
+ dataElementPtr->item_no, dataItemWin, precision);
i++; /* next register */
}
- cur_y++; /* next row; */
+ curY++; /* next row; */
}
}
@@ -357,73 +360,79 @@ tui_display_registers_from (int start_element_no)
}
-/* Function to display the registers in the content from
- 'start_element_no' on 'start_line_no' until the end of the register
- content or the end of the display height. This function checks
- that we won't display off the end of the register display. */
+/*
+ ** tuiDisplayRegElementAtLine().
+ ** Function to display the registers in the content from
+ ** 'startElementNo' on 'startLineNo' until the end of the
+ ** register content or the end of the display height.
+ ** This function checks that we won't display off the end
+ ** of the register display.
+ */
void
-tui_display_reg_element_at_line (int start_element_no, int start_line_no)
+tuiDisplayRegElementAtLine (int startElementNo, int startLineNo)
{
if (TUI_DATA_WIN->detail.data_display_info.regs_content != (tui_win_content) NULL &&
TUI_DATA_WIN->detail.data_display_info.regs_content_count > 0)
{
- int element_no = start_element_no;
+ register int elementNo = startElementNo;
- if (start_element_no != 0 && start_line_no != 0)
+ if (startElementNo != 0 && startLineNo != 0)
{
- int last_line_no, first_line_on_last_page;
+ register int lastLineNo, firstLineOnLastPage;
- last_line_no = tui_last_regs_line_no ();
- first_line_on_last_page = last_line_no - (TUI_DATA_WIN->generic.height - 2);
- if (first_line_on_last_page < 0)
- first_line_on_last_page = 0;
+ lastLineNo = tui_last_regs_line_no ();
+ firstLineOnLastPage = lastLineNo - (TUI_DATA_WIN->generic.height - 2);
+ if (firstLineOnLastPage < 0)
+ firstLineOnLastPage = 0;
/*
** If there is no other data displayed except registers,
- ** and the element_no causes us to scroll past the end of the
+ ** and the elementNo causes us to scroll past the end of the
** registers, adjust what element to really start the display at.
*/
if (TUI_DATA_WIN->detail.data_display_info.data_content_count <= 0 &&
- start_line_no > first_line_on_last_page)
- element_no = tui_first_reg_element_no_inline (first_line_on_last_page);
+ startLineNo > firstLineOnLastPage)
+ elementNo = tui_first_reg_element_no_inline (firstLineOnLastPage);
}
- tui_display_registers_from (element_no);
+ tui_display_registers_from (elementNo);
}
-}
+
+ return;
+} /* tuiDisplayRegElementAtLine */
-/* Function to display the registers starting at line line_no in the
+/* Function to display the registers starting at line lineNo in the
data window. Answers the line number that the display actually
started from. If nothing is displayed (-1) is returned. */
int
-tui_display_registers_from_line (int line_no, int force_display)
+tui_display_registers_from_line (int lineNo, int forceDisplay)
{
if (TUI_DATA_WIN->detail.data_display_info.regs_content_count > 0)
{
- int line, element_no;
+ int line, elementNo;
- if (line_no < 0)
+ if (lineNo < 0)
line = 0;
- else if (force_display)
+ else if (forceDisplay)
{ /*
- ** If we must display regs (force_display is true), then make
+ ** If we must display regs (forceDisplay is true), then make
** sure that we don't display off the end of the registers.
*/
- if (line_no >= tui_last_regs_line_no ())
+ if (lineNo >= tui_last_regs_line_no ())
{
if ((line = tui_line_from_reg_element_no (
TUI_DATA_WIN->detail.data_display_info.regs_content_count - 1)) < 0)
line = 0;
}
else
- line = line_no;
+ line = lineNo;
}
else
- line = line_no;
+ line = lineNo;
- element_no = tui_first_reg_element_no_inline (line);
- if (element_no < TUI_DATA_WIN->detail.data_display_info.regs_content_count)
- tui_display_reg_element_at_line (element_no, line);
+ elementNo = tui_first_reg_element_no_inline (line);
+ if (elementNo < TUI_DATA_WIN->detail.data_display_info.regs_content_count)
+ tuiDisplayRegElementAtLine (elementNo, line);
else
line = (-1);
@@ -448,42 +457,42 @@ tui_check_register_values (struct frame_info *frame)
else
{
int i, j;
- char raw_buf[MAX_REGISTER_SIZE];
+ char rawBuf[MAX_REGISTER_SIZE];
for (i = 0;
(i < TUI_DATA_WIN->detail.data_display_info.regs_content_count); i++)
{
- struct tui_data_element * data_element_ptr;
- struct tui_gen_win_info * data_item_win_ptr;
- int was_hilighted;
+ struct tui_data_element * dataElementPtr;
+ struct tui_gen_win_info * dataItemWinPtr;
+ int wasHilighted;
- data_item_win_ptr = &TUI_DATA_WIN->detail.data_display_info.
+ dataItemWinPtr = &TUI_DATA_WIN->detail.data_display_info.
regs_content[i]->which_element.data_window;
- data_element_ptr = &((struct tui_win_element *)
- data_item_win_ptr->content[0])->which_element.data;
- was_hilighted = data_element_ptr->highlight;
- data_element_ptr->highlight =
- tui_reg_value_has_changed (data_element_ptr, frame, &raw_buf[0]);
- if (data_element_ptr->highlight)
+ dataElementPtr = &((struct tui_win_element *)
+ dataItemWinPtr->content[0])->which_element.data;
+ wasHilighted = dataElementPtr->highlight;
+ dataElementPtr->highlight =
+ _tuiRegValueHasChanged (dataElementPtr, frame, &rawBuf[0]);
+ if (dataElementPtr->highlight)
{
int size;
- size = DEPRECATED_REGISTER_RAW_SIZE (data_element_ptr->item_no);
+ size = DEPRECATED_REGISTER_RAW_SIZE (dataElementPtr->item_no);
for (j = 0; j < size; j++)
- ((char *) data_element_ptr->value)[j] = raw_buf[j];
- tui_display_register (
- data_element_ptr->item_no,
- data_item_win_ptr,
+ ((char *) dataElementPtr->value)[j] = rawBuf[j];
+ _tuiDisplayRegister (
+ dataElementPtr->item_no,
+ dataItemWinPtr,
((TUI_DATA_WIN->detail.data_display_info.regs_display_type ==
TUI_DFLOAT_REGS) ?
double_precision : unspecified_precision));
}
- else if (was_hilighted)
+ else if (wasHilighted)
{
- data_element_ptr->highlight = FALSE;
- tui_display_register (
- data_element_ptr->item_no,
- data_item_win_ptr,
+ dataElementPtr->highlight = FALSE;
+ _tuiDisplayRegister (
+ dataElementPtr->item_no,
+ dataItemWinPtr,
((TUI_DATA_WIN->detail.data_display_info.regs_display_type ==
TUI_DFLOAT_REGS) ?
double_precision : unspecified_precision));
@@ -496,47 +505,47 @@ tui_check_register_values (struct frame_info *frame)
/*
- ** tui_toggle_float_regs().
+ ** tuiToggleFloatRegs().
*/
void
-tui_toggle_float_regs (void)
+tuiToggleFloatRegs (void)
{
- struct tui_layout_def * layout_def = tui_layout_def ();
+ struct tui_layout_def * layoutDef = tui_layout_def ();
- if (layout_def->float_regs_display_type == TUI_SFLOAT_REGS)
- layout_def->float_regs_display_type = TUI_DFLOAT_REGS;
+ if (layoutDef->float_regs_display_type == TUI_SFLOAT_REGS)
+ layoutDef->float_regs_display_type = TUI_DFLOAT_REGS;
else
- layout_def->float_regs_display_type = TUI_SFLOAT_REGS;
+ layoutDef->float_regs_display_type = TUI_SFLOAT_REGS;
if (TUI_DATA_WIN != NULL && TUI_DATA_WIN->generic.is_visible &&
(TUI_DATA_WIN->detail.data_display_info.regs_display_type == TUI_SFLOAT_REGS ||
TUI_DATA_WIN->detail.data_display_info.regs_display_type == TUI_DFLOAT_REGS))
- tui_show_registers (layout_def->float_regs_display_type);
+ tui_show_registers (layoutDef->float_regs_display_type);
return;
-} /* tui_toggle_float_regs */
+} /* tuiToggleFloatRegs */
void
-_initialize_tui_regs (void)
+_initialize_tuiRegs (void)
{
if (xdb_commands)
{
- add_com ("fr", class_tui, tui_show_float_command,
+ add_com ("fr", class_tui, _tuiShowFloat_command,
"Display only floating point registers\n");
- add_com ("gr", class_tui, tui_show_general_command,
+ add_com ("gr", class_tui, _tuiShowGeneral_command,
"Display only general registers\n");
- add_com ("sr", class_tui, tui_show_special_command,
+ add_com ("sr", class_tui, _tuiShowSpecial_command,
"Display only special registers\n");
- add_com ("+r", class_tui, tui_scroll_regs_forward_command,
+ add_com ("+r", class_tui, _tuiScrollRegsForward_command,
"Scroll the registers window forward\n");
- add_com ("-r", class_tui, tui_scroll_regs_backward_command,
+ add_com ("-r", class_tui, _tuiScrollRegsBackward_command,
"Scroll the register window backward\n");
- add_com ("tf", class_tui, _tui_toggle_float_regs_command,
+ add_com ("tf", class_tui, _tuiToggleFloatRegs_command,
"Toggle between single and double precision floating point registers.\n");
add_cmd (TUI_FLOAT_REGS_NAME_LOWER,
class_tui,
- _tui_toggle_float_regs_command,
+ _tuiToggleFloatRegs_command,
"Toggle between single and double precision floating point \
registers.\n",
&togglelist);
@@ -550,13 +559,13 @@ registers.\n",
/*
- ** tui_register_name().
+ ** _tuiRegisterName().
** Return the register name.
*/
static const char *
-tui_register_name (int reg_num)
+_tuiRegisterName (int regNum)
{
- return REGISTER_NAME (reg_num);
+ return REGISTER_NAME (regNum);
}
extern int pagination_enabled;
@@ -569,13 +578,13 @@ tui_restore_gdbout (void *ui)
}
/*
- ** tui_register_format
+ ** _tuiRegisterFormat
** Function to format the register name and value into a buffer,
** suitable for printing or display
*/
static void
-tui_register_format (char *buf, int buf_len, int reg_num,
- struct tui_data_element * data_element,
+_tuiRegisterFormat (char *buf, int bufLen, int regNum,
+ struct tui_data_element * dataElement,
enum precision_type precision)
{
struct ui_file *stream;
@@ -585,7 +594,7 @@ tui_register_format (char *buf, int buf_len, int reg_num,
char *p;
int pos;
- name = REGISTER_NAME (reg_num);
+ name = REGISTER_NAME (regNum);
if (name == 0)
{
strcpy (buf, "");
@@ -594,30 +603,30 @@ tui_register_format (char *buf, int buf_len, int reg_num,
pagination_enabled = 0;
old_stdout = gdb_stdout;
- stream = tui_sfileopen (buf_len);
+ stream = tui_sfileopen (bufLen);
gdb_stdout = stream;
cleanups = make_cleanup (tui_restore_gdbout, (void*) old_stdout);
gdbarch_print_registers_info (current_gdbarch, stream, deprecated_selected_frame,
- reg_num, 1);
+ regNum, 1);
/* Save formatted output in the buffer. */
p = tui_file_get_strbuf (stream);
pos = 0;
- while (*p && *p == *name++ && buf_len)
+ while (*p && *p == *name++ && bufLen)
{
*buf++ = *p++;
- buf_len--;
+ bufLen--;
pos++;
}
while (*p == ' ')
p++;
- while (pos < 8 && buf_len)
+ while (pos < 8 && bufLen)
{
*buf++ = ' ';
- buf_len--;
+ bufLen--;
pos++;
}
- strncpy (buf, p, buf_len);
+ strncpy (buf, p, bufLen);
/* Remove the possible \n. */
p = strchr (buf, '\n');
@@ -629,18 +638,20 @@ tui_register_format (char *buf, int buf_len, int reg_num,
#define NUM_GENERAL_REGS 32
-/* Set the content of the data window to consist of the general
- registers. */
+/*
+ ** _tuiSetGeneralRegsContent().
+ ** Set the content of the data window to consist of the general registers.
+ */
static enum tui_status
-tui_set_general_regs_content (int refresh_values_only)
+_tuiSetGeneralRegsContent (int refreshValuesOnly)
{
- return (tui_set_regs_content (0,
+ return (_tuiSetRegsContent (0,
NUM_GENERAL_REGS - 1,
deprecated_selected_frame,
TUI_GENERAL_REGS,
- refresh_values_only));
+ refreshValuesOnly));
-}
+} /* _tuiSetGeneralRegsContent */
#ifndef PCOQ_HEAD_REGNUM
@@ -649,151 +660,171 @@ tui_set_general_regs_content (int refresh_values_only)
#define START_SPECIAL_REGS PCOQ_HEAD_REGNUM
#endif
-/* Set the content of the data window to consist of the special
- registers. */
+/*
+ ** _tuiSetSpecialRegsContent().
+ ** Set the content of the data window to consist of the special registers.
+ */
static enum tui_status
-tui_set_special_regs_content (int refresh_values_only)
+_tuiSetSpecialRegsContent (int refreshValuesOnly)
{
enum tui_status ret = TUI_FAILURE;
- int end_reg_num;
+ int endRegNum;
- end_reg_num = FP0_REGNUM - 1;
- ret = tui_set_regs_content (START_SPECIAL_REGS,
- end_reg_num,
+ endRegNum = FP0_REGNUM - 1;
+ ret = _tuiSetRegsContent (START_SPECIAL_REGS,
+ endRegNum,
deprecated_selected_frame,
TUI_SPECIAL_REGS,
- refresh_values_only);
+ refreshValuesOnly);
return ret;
-}
+} /* _tuiSetSpecialRegsContent */
-/* Set the content of the data window to consist of the special
- registers. */
+/*
+ ** _tuiSetGeneralAndSpecialRegsContent().
+ ** Set the content of the data window to consist of the special registers.
+ */
static enum tui_status
-tui_set_general_and_special_regs_content (int refresh_values_only)
+_tuiSetGeneralAndSpecialRegsContent (int refreshValuesOnly)
{
enum tui_status ret = TUI_FAILURE;
- int end_reg_num = (-1);
+ int endRegNum = (-1);
- end_reg_num = FP0_REGNUM - 1;
- ret = tui_set_regs_content (
- 0, end_reg_num, deprecated_selected_frame, TUI_SPECIAL_REGS, refresh_values_only);
+ endRegNum = FP0_REGNUM - 1;
+ ret = _tuiSetRegsContent (
+ 0, endRegNum, deprecated_selected_frame, TUI_SPECIAL_REGS, refreshValuesOnly);
return ret;
-}
+} /* _tuiSetGeneralAndSpecialRegsContent */
-/* Set the content of the data window to consist of the float
- registers. */
+/*
+ ** _tuiSetFloatRegsContent().
+ ** Set the content of the data window to consist of the float registers.
+ */
static enum tui_status
-tui_set_float_regs_content (enum tui_register_display_type dpy_type,
- int refresh_values_only)
+_tuiSetFloatRegsContent (enum tui_register_display_type dpyType, int refreshValuesOnly)
{
enum tui_status ret = TUI_FAILURE;
- int start_reg_num;
+ int startRegNum;
- start_reg_num = FP0_REGNUM;
- ret = tui_set_regs_content (start_reg_num,
+ startRegNum = FP0_REGNUM;
+ ret = _tuiSetRegsContent (startRegNum,
NUM_REGS - 1,
deprecated_selected_frame,
- dpy_type,
- refresh_values_only);
+ dpyType,
+ refreshValuesOnly);
return ret;
-}
+} /* _tuiSetFloatRegsContent */
-/* Answer TRUE if the register's value has changed, FALSE otherwise.
- If TRUE, new_value is filled in with the new value. */
+/*
+ ** _tuiRegValueHasChanged().
+ ** Answer TRUE if the register's value has changed, FALSE otherwise.
+ ** If TRUE, newValue is filled in with the new value.
+ */
static int
-tui_reg_value_has_changed (struct tui_data_element * data_element,
- struct frame_info *frame, char *new_value)
+_tuiRegValueHasChanged (struct tui_data_element * dataElement,
+ struct frame_info *frame,
+ char *newValue)
{
- int has_changed = FALSE;
+ int hasChanged = FALSE;
- if (data_element->item_no != UNDEFINED_ITEM &&
- tui_register_name (data_element->item_no) != (char *) NULL)
+ if (dataElement->item_no != UNDEFINED_ITEM &&
+ _tuiRegisterName (dataElement->item_no) != (char *) NULL)
{
- char raw_buf[MAX_REGISTER_SIZE];
+ char rawBuf[MAX_REGISTER_SIZE];
int i;
- if (tui_get_register_raw_value (data_element->item_no, raw_buf, frame) == TUI_SUCCESS)
+ if (_tuiGetRegisterRawValue (
+ dataElement->item_no, rawBuf, frame) == TUI_SUCCESS)
{
- int size = DEPRECATED_REGISTER_RAW_SIZE (data_element->item_no);
+ int size = DEPRECATED_REGISTER_RAW_SIZE (dataElement->item_no);
- for (i = 0; (i < size && !has_changed); i++)
- has_changed = (((char *) data_element->value)[i] != raw_buf[i]);
- if (has_changed && new_value != (char *) NULL)
+ for (i = 0; (i < size && !hasChanged); i++)
+ hasChanged = (((char *) dataElement->value)[i] != rawBuf[i]);
+ if (hasChanged && newValue != (char *) NULL)
{
for (i = 0; i < size; i++)
- new_value[i] = raw_buf[i];
+ newValue[i] = rawBuf[i];
}
}
}
- return has_changed;
-}
+ return hasChanged;
+} /* _tuiRegValueHasChanged */
-/* Get the register raw value. The raw value is returned in reg_value. */
+/*
+ ** _tuiGetRegisterRawValue().
+ ** Get the register raw value. The raw value is returned in regValue.
+ */
static enum tui_status
-tui_get_register_raw_value (int reg_num, char *reg_value, struct frame_info *frame)
+_tuiGetRegisterRawValue (int regNum, char *regValue, struct frame_info *frame)
{
enum tui_status ret = TUI_FAILURE;
if (target_has_registers)
{
- get_frame_register (frame, reg_num, reg_value);
+ get_frame_register (frame, regNum, regValue);
/* NOTE: cagney/2003-03-13: This is bogus. It is refering to
the register cache and not the frame which could have pulled
the register value off the stack. */
- if (register_cached (reg_num) >= 0)
+ if (register_cached (regNum) >= 0)
ret = TUI_SUCCESS;
}
return ret;
-}
+} /* _tuiGetRegisterRawValue */
-/* Function to initialize a data element with the input and the
- register value. */
+/*
+ ** _tuiSetRegisterElement().
+ ** Function to initialize a data element with the input and
+ ** the register value.
+ */
static void
-tui_set_register_element (int reg_num, struct frame_info *frame,
- struct tui_data_element * data_element,
- int refresh_value_only)
+_tuiSetRegisterElement (int regNum, struct frame_info *frame,
+ struct tui_data_element * dataElement,
+ int refreshValueOnly)
{
- if (data_element != (struct tui_data_element *) NULL)
+ if (dataElement != (struct tui_data_element *) NULL)
{
- if (!refresh_value_only)
+ if (!refreshValueOnly)
{
- data_element->item_no = reg_num;
- data_element->name = tui_register_name (reg_num);
- data_element->highlight = FALSE;
+ dataElement->item_no = regNum;
+ dataElement->name = _tuiRegisterName (regNum);
+ dataElement->highlight = FALSE;
}
- if (data_element->value == NULL)
- data_element->value = xmalloc (MAX_REGISTER_SIZE);
- if (data_element->value != NULL)
- tui_get_register_raw_value (reg_num, data_element->value, frame);
+ if (dataElement->value == NULL)
+ dataElement->value = xmalloc (MAX_REGISTER_SIZE);
+ if (dataElement->value != NULL)
+ _tuiGetRegisterRawValue (regNum, dataElement->value, frame);
}
-}
+
+ return;
+} /* _tuiSetRegisterElement */
-/* Set the content of the data window to consist of the registers
- numbered from start_reg_num to end_reg_num. Note that if
- refresh_values_only is TRUE, start_reg_num and end_reg_num are
- ignored. */
+/*
+ ** _tuiSetRegsContent().
+ ** Set the content of the data window to consist of the registers
+ ** numbered from startRegNum to endRegNum. Note that if
+ ** refreshValuesOnly is TRUE, startRegNum and endRegNum are ignored.
+ */
static enum tui_status
-tui_set_regs_content (int start_reg_num, int end_reg_num,
+_tuiSetRegsContent (int startRegNum, int endRegNum,
struct frame_info *frame,
- enum tui_register_display_type dpy_type,
- int refresh_values_only)
+ enum tui_register_display_type dpyType,
+ int refreshValuesOnly)
{
enum tui_status ret = TUI_FAILURE;
- int num_regs = end_reg_num - start_reg_num + 1;
- int allocated_here = FALSE;
+ int numRegs = endRegNum - startRegNum + 1;
+ int allocatedHere = FALSE;
if (TUI_DATA_WIN->detail.data_display_info.regs_content_count > 0 &&
- !refresh_values_only)
+ !refreshValuesOnly)
{
tui_free_data_content (TUI_DATA_WIN->detail.data_display_info.regs_content,
TUI_DATA_WIN->detail.data_display_info.regs_content_count);
@@ -802,46 +833,46 @@ tui_set_regs_content (int start_reg_num, int end_reg_num,
if (TUI_DATA_WIN->detail.data_display_info.regs_content_count <= 0)
{
TUI_DATA_WIN->detail.data_display_info.regs_content =
- tui_alloc_content (num_regs, DATA_WIN);
- allocated_here = TRUE;
+ tui_alloc_content (numRegs, DATA_WIN);
+ allocatedHere = TRUE;
}
if (TUI_DATA_WIN->detail.data_display_info.regs_content != (tui_win_content) NULL)
{
int i;
- if (!refresh_values_only || allocated_here)
+ if (!refreshValuesOnly || allocatedHere)
{
TUI_DATA_WIN->generic.content = NULL;
TUI_DATA_WIN->generic.content_size = 0;
- tui_add_content_elements (&TUI_DATA_WIN->generic, num_regs);
+ tui_add_content_elements (&TUI_DATA_WIN->generic, numRegs);
TUI_DATA_WIN->detail.data_display_info.regs_content =
(tui_win_content) TUI_DATA_WIN->generic.content;
- TUI_DATA_WIN->detail.data_display_info.regs_content_count = num_regs;
+ TUI_DATA_WIN->detail.data_display_info.regs_content_count = numRegs;
}
/*
** Now set the register names and values
*/
- for (i = start_reg_num; (i <= end_reg_num); i++)
+ for (i = startRegNum; (i <= endRegNum); i++)
{
- struct tui_gen_win_info * data_item_win;
+ struct tui_gen_win_info * dataItemWin;
- data_item_win = &TUI_DATA_WIN->detail.data_display_info.
- regs_content[i - start_reg_num]->which_element.data_window;
- tui_set_register_element (
+ dataItemWin = &TUI_DATA_WIN->detail.data_display_info.
+ regs_content[i - startRegNum]->which_element.data_window;
+ _tuiSetRegisterElement (
i,
frame,
- &((struct tui_win_element *) data_item_win->content[0])->which_element.data,
- !allocated_here && refresh_values_only);
+ &((struct tui_win_element *) dataItemWin->content[0])->which_element.data,
+ !allocatedHere && refreshValuesOnly);
}
TUI_DATA_WIN->detail.data_display_info.regs_column_count =
- tui_calculate_regs_column_count (dpy_type);
+ tui_calculate_regs_column_count (dpyType);
#ifdef LATER
if (TUI_DATA_WIN->detail.data_display_info.data_content_count > 0)
{
/* delete all the windows? */
/* realloc content equal to data_content_count + regs_content_count */
- /* append TUI_DATA_WIN->detail.data_display_info.data_content to content */
+ /* append TUI_DATA_WIN->detail.data_display_info.dataContent to content */
}
#endif
TUI_DATA_WIN->generic.content_size =
@@ -851,134 +882,143 @@ tui_set_regs_content (int start_reg_num, int end_reg_num,
}
return ret;
-}
+} /* _tuiSetRegsContent */
-/* Function to display a register in a window. If hilite is TRUE,
- than the value will be displayed in reverse video. */
+/*
+ ** _tuiDisplayRegister().
+ ** Function to display a register in a window. If hilite is TRUE,
+ ** than the value will be displayed in reverse video
+ */
static void
-tui_display_register (int reg_num,
- struct tui_gen_win_info * win_info, /* the data item window */
+_tuiDisplayRegister (int regNum,
+ struct tui_gen_win_info * winInfo, /* the data item window */
enum precision_type precision)
{
- if (win_info->handle != (WINDOW *) NULL)
+ if (winInfo->handle != (WINDOW *) NULL)
{
int i;
char buf[40];
- int value_chars_wide, label_width;
- struct tui_data_element * data_element_ptr = &((tui_win_content)
- win_info->content)[0]->which_element.data;
+ int valueCharsWide, labelWidth;
+ struct tui_data_element * dataElementPtr = &((tui_win_content)
+ winInfo->content)[0]->which_element.data;
if (IS_64BIT ||
TUI_DATA_WIN->detail.data_display_info.regs_display_type == TUI_DFLOAT_REGS)
{
- value_chars_wide = DOUBLE_FLOAT_VALUE_WIDTH;
- label_width = DOUBLE_FLOAT_LABEL_WIDTH;
+ valueCharsWide = DOUBLE_FLOAT_VALUE_WIDTH;
+ labelWidth = DOUBLE_FLOAT_LABEL_WIDTH;
}
else
{
if (TUI_DATA_WIN->detail.data_display_info.regs_display_type ==
TUI_SFLOAT_REGS)
{
- value_chars_wide = SINGLE_FLOAT_VALUE_WIDTH;
- label_width = SINGLE_FLOAT_LABEL_WIDTH;
+ valueCharsWide = SINGLE_FLOAT_VALUE_WIDTH;
+ labelWidth = SINGLE_FLOAT_LABEL_WIDTH;
}
else
{
- value_chars_wide = SINGLE_VALUE_WIDTH;
- label_width = SINGLE_LABEL_WIDTH;
+ valueCharsWide = SINGLE_VALUE_WIDTH;
+ labelWidth = SINGLE_LABEL_WIDTH;
}
}
buf[0] = (char) 0;
- tui_register_format (buf,
- value_chars_wide + label_width,
- reg_num,
- data_element_ptr,
+ _tuiRegisterFormat (buf,
+ valueCharsWide + labelWidth,
+ regNum,
+ dataElementPtr,
precision);
- if (data_element_ptr->highlight)
- wstandout (win_info->handle);
+ if (dataElementPtr->highlight)
+ wstandout (winInfo->handle);
- wmove (win_info->handle, 0, 0);
- for (i = 1; i < win_info->width; i++)
- waddch (win_info->handle, ' ');
- wmove (win_info->handle, 0, 0);
- waddstr (win_info->handle, buf);
+ wmove (winInfo->handle, 0, 0);
+ for (i = 1; i < winInfo->width; i++)
+ waddch (winInfo->handle, ' ');
+ wmove (winInfo->handle, 0, 0);
+ waddstr (winInfo->handle, buf);
- if (data_element_ptr->highlight)
- wstandend (win_info->handle);
- tui_refresh_win (win_info);
+ if (dataElementPtr->highlight)
+ wstandend (winInfo->handle);
+ tui_refresh_win (winInfo);
}
-}
+ return;
+} /* _tuiDisplayRegister */
static void
-tui_v_show_registers_command_support (enum tui_register_display_type dpy_type)
+_tui_vShowRegisters_commandSupport (enum tui_register_display_type dpyType)
{
if (TUI_DATA_WIN != NULL && TUI_DATA_WIN->generic.is_visible)
{ /* Data window already displayed, show the registers */
- if (TUI_DATA_WIN->detail.data_display_info.regs_display_type != dpy_type)
- tui_show_registers (dpy_type);
+ if (TUI_DATA_WIN->detail.data_display_info.regs_display_type != dpyType)
+ tui_show_registers (dpyType);
}
else
- (tui_layout_def ())->regs_display_type = dpy_type;
+ (tui_layout_def ())->regs_display_type = dpyType;
return;
-}
+} /* _tui_vShowRegisters_commandSupport */
static void
-tui_show_float_command (char *arg, int from_tty)
+_tuiShowFloat_command (char *arg, int fromTTY)
{
if (TUI_DATA_WIN == NULL || !TUI_DATA_WIN->generic.is_visible ||
(TUI_DATA_WIN->detail.data_display_info.regs_display_type != TUI_SFLOAT_REGS &&
TUI_DATA_WIN->detail.data_display_info.regs_display_type != TUI_DFLOAT_REGS))
- tui_v_show_registers_command_support ((tui_layout_def ())->float_regs_display_type);
-}
+ _tui_vShowRegisters_commandSupport ((tui_layout_def ())->float_regs_display_type);
+
+ return;
+} /* _tuiShowFloat_command */
static void
-tui_show_general_command (char *arg, int from_tty)
+_tuiShowGeneral_command (char *arg, int fromTTY)
{
- tui_v_show_registers_command_support (TUI_GENERAL_REGS);
+ _tui_vShowRegisters_commandSupport (TUI_GENERAL_REGS);
}
static void
-tui_show_special_command (char *arg, int from_tty)
+_tuiShowSpecial_command (char *arg, int fromTTY)
{
- tui_v_show_registers_command_support (TUI_SPECIAL_REGS);
+ _tui_vShowRegisters_commandSupport (TUI_SPECIAL_REGS);
}
static void
-_tui_toggle_float_regs_command (char *arg, int from_tty)
+_tuiToggleFloatRegs_command (char *arg, int fromTTY)
{
if (TUI_DATA_WIN != NULL && TUI_DATA_WIN->generic.is_visible)
- tui_toggle_float_regs ();
+ tuiToggleFloatRegs ();
else
{
- struct tui_layout_def * layout_def = tui_layout_def ();
+ struct tui_layout_def * layoutDef = tui_layout_def ();
- if (layout_def->float_regs_display_type == TUI_SFLOAT_REGS)
- layout_def->float_regs_display_type = TUI_DFLOAT_REGS;
+ if (layoutDef->float_regs_display_type == TUI_SFLOAT_REGS)
+ layoutDef->float_regs_display_type = TUI_DFLOAT_REGS;
else
- layout_def->float_regs_display_type = TUI_SFLOAT_REGS;
+ layoutDef->float_regs_display_type = TUI_SFLOAT_REGS;
}
-}
+
+
+ return;
+} /* _tuiToggleFloatRegs_command */
static void
-tui_scroll_regs_forward_command (char *arg, int from_tty)
+_tuiScrollRegsForward_command (char *arg, int fromTTY)
{
tui_scroll (FORWARD_SCROLL, TUI_DATA_WIN, 1);
}
static void
-tui_scroll_regs_backward_command (char *arg, int from_tty)
+_tuiScrollRegsBackward_command (char *arg, int fromTTY)
{
tui_scroll (BACKWARD_SCROLL, TUI_DATA_WIN, 1);
}
diff --git a/gdb/tui/tui-source.c b/gdb/tui/tui-source.c
index f97de2f..7045f71 100644
--- a/gdb/tui/tui-source.c
+++ b/gdb/tui/tui-source.c
@@ -52,13 +52,13 @@ tui_set_source_content (struct symtab *s, int line_no, int noerror)
if (s != (struct symtab *) NULL && s->filename != (char *) NULL)
{
- FILE *stream;
- int i, desc, c, line_width, nlines;
- char *src_line = 0;
+ register FILE *stream;
+ register int i, desc, c, lineWidth, nlines;
+ register char *srcLine = 0;
if ((ret = tui_alloc_source_buffer (TUI_SRC_WIN)) == TUI_SUCCESS)
{
- line_width = TUI_SRC_WIN->generic.width - 1;
+ lineWidth = TUI_SRC_WIN->generic.width - 1;
/* Take hilite (window border) into account, when calculating
the number of lines */
nlines = (line_no + (TUI_SRC_WIN->generic.height - 2)) - line_no;
@@ -92,7 +92,7 @@ tui_set_source_content (struct symtab *s, int line_no, int noerror)
}
else
{
- int offset, cur_line_no, cur_line, cur_len, threshold;
+ register int offset, curLineNo, curLine, curLen, threshold;
struct tui_gen_win_info * locator = tui_locator_win_info_ptr ();
struct tui_source_info * src = &TUI_SRC_WIN->detail.source_info;
@@ -107,52 +107,52 @@ tui_set_source_content (struct symtab *s, int line_no, int noerror)
/* Determine the threshold for the length of the line
and the offset to start the display. */
offset = src->horizontal_offset;
- threshold = (line_width - 1) + offset;
+ threshold = (lineWidth - 1) + offset;
stream = fdopen (desc, FOPEN_RT);
clearerr (stream);
- cur_line = 0;
- cur_line_no = src->start_line_or_addr.line_no = line_no;
+ curLine = 0;
+ curLineNo = src->start_line_or_addr.line_no = line_no;
if (offset > 0)
- src_line = (char *) xmalloc (
+ srcLine = (char *) xmalloc (
(threshold + 1) * sizeof (char));
- while (cur_line < nlines)
+ while (curLine < nlines)
{
struct tui_win_element * element = (struct tui_win_element *)
- TUI_SRC_WIN->generic.content[cur_line];
+ TUI_SRC_WIN->generic.content[curLine];
/* get the first character in the line */
c = fgetc (stream);
if (offset == 0)
- src_line = ((struct tui_win_element *)
+ srcLine = ((struct tui_win_element *)
TUI_SRC_WIN->generic.content[
- cur_line])->which_element.source.line;
+ curLine])->which_element.source.line;
/* Init the line with the line number */
- sprintf (src_line, "%-6d", cur_line_no);
- cur_len = strlen (src_line);
- i = cur_len -
- ((cur_len / tui_default_tab_len ()) * tui_default_tab_len ());
+ sprintf (srcLine, "%-6d", curLineNo);
+ curLen = strlen (srcLine);
+ i = curLen -
+ ((curLen / tui_default_tab_len ()) * tui_default_tab_len ());
while (i < tui_default_tab_len ())
{
- src_line[cur_len] = ' ';
+ srcLine[curLen] = ' ';
i++;
- cur_len++;
+ curLen++;
}
- src_line[cur_len] = (char) 0;
+ srcLine[curLen] = (char) 0;
/* Set whether element is the execution point and
whether there is a break point on it. */
element->which_element.source.line_or_addr.line_no =
- cur_line_no;
+ curLineNo;
element->which_element.source.is_exec_point =
(strcmp (((struct tui_win_element *)
locator->content[0])->which_element.locator.file_name,
s->filename) == 0
- && cur_line_no == ((struct tui_win_element *)
+ && curLineNo == ((struct tui_win_element *)
locator->content[0])->which_element.locator.line_no);
if (c != EOF)
{
- i = strlen (src_line) - 1;
+ i = strlen (srcLine) - 1;
do
{
if ((c != '\n') &&
@@ -160,13 +160,13 @@ tui_set_source_content (struct symtab *s, int line_no, int noerror)
{
if (c < 040 && c != '\t')
{
- src_line[i++] = '^';
- src_line[i] = c + 0100;
+ srcLine[i++] = '^';
+ srcLine[i] = c + 0100;
}
else if (c == 0177)
{
- src_line[i++] = '^';
- src_line[i] = '?';
+ srcLine[i++] = '^';
+ srcLine[i] = '?';
}
else
{ /* Store the charcter in the line
@@ -176,20 +176,20 @@ tui_set_source_content (struct symtab *s, int line_no, int noerror)
buffer. */
if (c == '\t')
{
- int j, max_tab_len = tui_default_tab_len ();
+ int j, maxTabLen = tui_default_tab_len ();
for (j = i - (
- (i / max_tab_len) * max_tab_len);
- ((j < max_tab_len) &&
+ (i / maxTabLen) * maxTabLen);
+ ((j < maxTabLen) &&
i < threshold);
i++, j++)
- src_line[i] = ' ';
+ srcLine[i] = ' ';
i--;
}
else
- src_line[i] = c;
+ srcLine[i] = c;
}
- src_line[i + 1] = 0;
+ srcLine[i + 1] = 0;
}
else
{ /* If we have not reached EOL, then eat
@@ -202,19 +202,19 @@ tui_set_source_content (struct symtab *s, int line_no, int noerror)
i < threshold && (c = fgetc (stream)));
}
/* Now copy the line taking the offset into account */
- if (strlen (src_line) > offset)
+ if (strlen (srcLine) > offset)
strcpy (((struct tui_win_element *) TUI_SRC_WIN->generic.content[
- cur_line])->which_element.source.line,
- &src_line[offset]);
+ curLine])->which_element.source.line,
+ &srcLine[offset]);
else
((struct tui_win_element *)
TUI_SRC_WIN->generic.content[
- cur_line])->which_element.source.line[0] = (char) 0;
- cur_line++;
- cur_line_no++;
+ curLine])->which_element.source.line[0] = (char) 0;
+ curLine++;
+ curLineNo++;
}
if (offset > 0)
- xfree (src_line);
+ xfree (srcLine);
fclose (stream);
TUI_SRC_WIN->generic.content_size = nlines;
ret = TUI_SUCCESS;
@@ -229,29 +229,29 @@ tui_set_source_content (struct symtab *s, int line_no, int noerror)
/* elz: this function sets the contents of the source window to empty
except for a line in the middle with a warning message about the
source not being available. This function is called by
- tui_erase_source_contents(), which in turn is invoked when the
- source files cannot be accessed. */
+ tuiEraseSourceContents, which in turn is invoked when the source
+ files cannot be accessed. */
void
-tui_set_source_content_nil (struct tui_win_info * win_info, char *warning_string)
+tui_set_source_content_nil (struct tui_win_info * winInfo, char *warning_string)
{
- int line_width;
- int n_lines;
+ int lineWidth;
+ int nLines;
int curr_line = 0;
- line_width = win_info->generic.width - 1;
- n_lines = win_info->generic.height - 2;
+ lineWidth = winInfo->generic.width - 1;
+ nLines = winInfo->generic.height - 2;
/* set to empty each line in the window, except for the one
which contains the message */
- while (curr_line < win_info->generic.content_size)
+ while (curr_line < winInfo->generic.content_size)
{
/* set the information related to each displayed line
to null: i.e. the line number is 0, there is no bp,
it is not where the program is stopped */
struct tui_win_element * element =
- (struct tui_win_element *) win_info->generic.content[curr_line];
+ (struct tui_win_element *) winInfo->generic.content[curr_line];
element->which_element.source.line_or_addr.line_no = 0;
element->which_element.source.is_exec_point = FALSE;
element->which_element.source.has_break = FALSE;
@@ -259,35 +259,35 @@ tui_set_source_content_nil (struct tui_win_info * win_info, char *warning_string
/* set the contents of the line to blank */
element->which_element.source.line[0] = (char) 0;
- /* if the current line is in the middle of the screen, then we
- want to display the 'no source available' message in it.
- Note: the 'weird' arithmetic with the line width and height
- comes from the function tui_erase_source_content(). We need
- to keep the screen and the window's actual contents in synch. */
+ /* if the current line is in the middle of the screen, then we want to
+ display the 'no source available' message in it.
+ Note: the 'weird' arithmetic with the line width and height comes from
+ the function tuiEraseSourceContent. We need to keep the screen and the
+ window's actual contents in synch */
- if (curr_line == (n_lines / 2 + 1))
+ if (curr_line == (nLines / 2 + 1))
{
int i;
int xpos;
int warning_length = strlen (warning_string);
- char *src_line;
+ char *srcLine;
- src_line = element->which_element.source.line;
+ srcLine = element->which_element.source.line;
- if (warning_length >= ((line_width - 1) / 2))
+ if (warning_length >= ((lineWidth - 1) / 2))
xpos = 1;
else
- xpos = (line_width - 1) / 2 - warning_length;
+ xpos = (lineWidth - 1) / 2 - warning_length;
for (i = 0; i < xpos; i++)
- src_line[i] = ' ';
+ srcLine[i] = ' ';
- sprintf (src_line + i, "%s", warning_string);
+ sprintf (srcLine + i, "%s", warning_string);
- for (i = xpos + warning_length; i < line_width; i++)
- src_line[i] = ' ';
+ for (i = xpos + warning_length; i < lineWidth; i++)
+ srcLine[i] = ' ';
- src_line[i] = '\n';
+ srcLine[i] = '\n';
} /* end if */
@@ -320,8 +320,8 @@ tui_source_is_displayed (char *fname)
/* Scroll the source forward or backward vertically. */
void
-tui_vertical_source_scroll (enum tui_scroll_direction scroll_direction,
- int num_to_scroll)
+tui_vertical_source_scroll (enum tui_scroll_direction scrollDirection,
+ int numToScroll)
{
if (TUI_SRC_WIN->generic.content != NULL)
{
@@ -335,19 +335,19 @@ tui_vertical_source_scroll (enum tui_scroll_direction scroll_direction,
else
s = cursal.symtab;
- if (scroll_direction == FORWARD_SCROLL)
+ if (scrollDirection == FORWARD_SCROLL)
{
l.line_no = content[0]->which_element.source.line_or_addr.line_no +
- num_to_scroll;
+ numToScroll;
if (l.line_no > s->nlines)
- /*line = s->nlines - win_info->generic.content_size + 1; */
+ /*line = s->nlines - winInfo->generic.content_size + 1; */
/*elz: fix for dts 23398 */
l.line_no = content[0]->which_element.source.line_or_addr.line_no;
}
else
{
l.line_no = content[0]->which_element.source.line_or_addr.line_no -
- num_to_scroll;
+ numToScroll;
if (l.line_no <= 0)
l.line_no = 1;
}
diff --git a/gdb/tui/tui-stack.c b/gdb/tui/tui-stack.c
index 7285dab..7183bc2 100644
--- a/gdb/tui/tui-stack.c
+++ b/gdb/tui/tui-stack.c
@@ -244,6 +244,7 @@ tui_get_function_from_frame (struct frame_info *fi)
return name;
}
+/* tuiShowLocatorContent(). */
void
tui_show_locator_content (void)
{
@@ -326,19 +327,19 @@ void
tui_show_frame_info (struct frame_info *fi)
{
struct tui_win_info * win_info;
- int i;
+ register int i;
if (fi)
{
- int start_line, i;
+ register int start_line, i;
CORE_ADDR low;
struct tui_gen_win_info * locator = tui_locator_win_info_ptr ();
- int source_already_displayed;
+ int sourceAlreadyDisplayed;
struct symtab_and_line sal;
find_frame_sal (fi, &sal);
- source_already_displayed = sal.symtab != 0
+ sourceAlreadyDisplayed = sal.symtab != 0
&& tui_source_is_displayed (sal.symtab->filename);
tui_set_locator_info (sal.symtab == 0 ? "??" : sal.symtab->filename,
tui_get_function_from_frame (fi),
@@ -372,7 +373,7 @@ tui_show_frame_info (struct frame_info *fi)
{
union tui_line_or_address l;
l.line_no = start_line;
- if (!(source_already_displayed
+ if (!(sourceAlreadyDisplayed
&& tui_line_is_displayed (item->locator.line_no, win_info, TRUE)))
tui_update_source_window (win_info, sal.symtab, l, TRUE);
else
@@ -412,10 +413,9 @@ tui_show_frame_info (struct frame_info *fi)
}
}
-/* Function to initialize gdb commands, for tui window stack
- manipulation. */
+/* Function to initialize gdb commands, for tui window stack manipulation. */
void
-_initialize_tui_stack (void)
+_initialize_tuiStack (void)
{
add_com ("update", class_tui, tui_update_command,
"Update the source window and locator to display the current "
diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c
index 3950a7c..6e5f204 100644
--- a/gdb/tui/tui-win.c
+++ b/gdb/tui/tui-win.c
@@ -54,28 +54,28 @@
#endif
#endif
-#include "gdb_string.h"
+#include <string.h>
#include <ctype.h>
#include <readline/readline.h>
/*******************************
** Static Local Decls
********************************/
-static void make_visible_with_new_height (struct tui_win_info *);
-static void make_invisible_and_set_new_height (struct tui_win_info *, int);
-static enum tui_status tui_adjust_win_heights (struct tui_win_info *, int);
-static int new_height_ok (struct tui_win_info *, int);
-static void tui_set_tab_width_command (char *, int);
-static void tui_refresh_all_command (char *, int);
-static void tui_set_win_height_command (char *, int);
-static void tui_xdb_set_win_height_command (char *, int);
-static void tui_all_windows_info (char *, int);
-static void tui_set_focus_command (char *, int);
-static void tui_scroll_forward_command (char *, int);
-static void tui_scroll_backward_command (char *, int);
-static void tui_scroll_left_command (char *, int);
-static void tui_scroll_right_command (char *, int);
-static void parse_scrolling_args (char *, struct tui_win_info * *, int *);
+static void _makeVisibleWithNewHeight (struct tui_win_info *);
+static void _makeInvisibleAndSetNewHeight (struct tui_win_info *, int);
+static enum tui_status _tuiAdjustWinHeights (struct tui_win_info *, int);
+static int _newHeightOk (struct tui_win_info *, int);
+static void _tuiSetTabWidth_command (char *, int);
+static void _tuiRefreshAll_command (char *, int);
+static void _tuiSetWinHeight_command (char *, int);
+static void _tuiXDBsetWinHeight_command (char *, int);
+static void _tuiAllWindowsInfo (char *, int);
+static void _tuiSetFocus_command (char *, int);
+static void _tuiScrollForward_command (char *, int);
+static void _tuiScrollBackward_command (char *, int);
+static void _tuiScrollLeft_command (char *, int);
+static void _tuiScrollRight_command (char *, int);
+static void _parseScrollingArgs (char *, struct tui_win_info * *, int *);
/***************************************
@@ -241,7 +241,7 @@ translate (const char *name, struct tui_translate *table)
Returns 1 if the configuration has changed and the screen should
be redrawn. */
int
-tui_update_variables (void)
+tui_update_variables ()
{
int need_redraw = 0;
struct tui_translate *entry;
@@ -296,9 +296,12 @@ show_tui_cmd (char *args, int from_tty)
{
}
-/* Function to initialize gdb commands, for tui window manipulation. */
+/*
+ ** _initialize_tuiWin().
+ ** Function to initialize gdb commands, for tui window manipulation.
+ */
void
-_initialize_tui_win (void)
+_initialize_tuiWin (void)
{
struct cmd_list_element *c;
static struct cmd_list_element *tui_setlist;
@@ -319,14 +322,14 @@ _initialize_tui_win (void)
&tui_showlist, "show tui ",
0/*allow-unknown*/, &showlist);
- add_com ("refresh", class_tui, tui_refresh_all_command,
+ add_com ("refresh", class_tui, _tuiRefreshAll_command,
"Refresh the terminal display.\n");
if (xdb_commands)
add_com_alias ("U", "refresh", class_tui, 0);
- add_com ("tabset", class_tui, tui_set_tab_width_command,
+ add_com ("tabset", class_tui, _tuiSetTabWidth_command,
"Set the width (in characters) of tab stops.\n\
Usage: tabset <n>\n");
- add_com ("winheight", class_tui, tui_set_win_height_command,
+ add_com ("winheight", class_tui, _tuiSetWinHeight_command,
"Set the height of a specified window.\n\
Usage: winheight <win_name> [+ | -] <#lines>\n\
Window names are:\n\
@@ -335,9 +338,9 @@ cmd : the command window\n\
asm : the disassembly window\n\
regs : the register display\n");
add_com_alias ("wh", "winheight", class_tui, 0);
- add_info ("win", tui_all_windows_info,
+ add_info ("win", _tuiAllWindowsInfo,
"List of all displayed windows.\n");
- add_com ("focus", class_tui, tui_set_focus_command,
+ add_com ("focus", class_tui, _tuiSetFocus_command,
"Set focus to named window or next/prev window.\n\
Usage: focus {<win> | next | prev}\n\
Valid Window names are:\n\
@@ -346,16 +349,16 @@ asm : the disassembly window\n\
regs : the register display\n\
cmd : the command window\n");
add_com_alias ("fs", "focus", class_tui, 0);
- add_com ("+", class_tui, tui_scroll_forward_command,
+ add_com ("+", class_tui, _tuiScrollForward_command,
"Scroll window forward.\nUsage: + [win] [n]\n");
- add_com ("-", class_tui, tui_scroll_backward_command,
+ add_com ("-", class_tui, _tuiScrollBackward_command,
"Scroll window backward.\nUsage: - [win] [n]\n");
- add_com ("<", class_tui, tui_scroll_left_command,
+ add_com ("<", class_tui, _tuiScrollLeft_command,
"Scroll window forward.\nUsage: < [win] [n]\n");
- add_com (">", class_tui, tui_scroll_right_command,
+ add_com (">", class_tui, _tuiScrollRight_command,
"Scroll window backward.\nUsage: > [win] [n]\n");
if (xdb_commands)
- add_com ("w", class_xdb, tui_xdb_set_win_height_command,
+ add_com ("w", class_xdb, _tuiXDBsetWinHeight_command,
"XDB compatibility command for setting the height of a command window.\n\
Usage: w <#lines>\n");
@@ -404,7 +407,7 @@ Usage: w <#lines>\n");
/* Update gdb's knowledge of the terminal size. */
void
-tui_update_gdb_sizes (void)
+tui_update_gdb_sizes ()
{
char cmd[50];
int screenheight, screenwidth;
@@ -426,105 +429,107 @@ tui_set_win_focus_to (struct tui_win_info * win_info)
{
if (win_info != NULL)
{
- struct tui_win_info * win_with_focus = tui_win_with_focus ();
+ struct tui_win_info * winWithFocus = tui_win_with_focus ();
- if (win_with_focus != NULL
- && win_with_focus->generic.type != CMD_WIN)
- tui_unhighlight_win (win_with_focus);
+ if (winWithFocus != NULL
+ && winWithFocus->generic.type != CMD_WIN)
+ tui_unhighlight_win (winWithFocus);
tui_set_win_with_focus (win_info);
if (win_info->generic.type != CMD_WIN)
tui_highlight_win (win_info);
}
-}
+
+ return;
+} /* tuiSetWinFocusTo */
void
-tui_scroll_forward (struct tui_win_info * win_to_scroll, int num_to_scroll)
+tui_scroll_forward (struct tui_win_info * winToScroll, int numToScroll)
{
- if (win_to_scroll != TUI_CMD_WIN)
+ if (winToScroll != TUI_CMD_WIN)
{
- int _num_to_scroll = num_to_scroll;
+ int _numToScroll = numToScroll;
- if (num_to_scroll == 0)
- _num_to_scroll = win_to_scroll->generic.height - 3;
+ if (numToScroll == 0)
+ _numToScroll = winToScroll->generic.height - 3;
/*
** If we are scrolling the source or disassembly window, do a
** "psuedo" scroll since not all of the source is in memory,
- ** only what is in the viewport. If win_to_scroll is the
+ ** only what is in the viewport. If winToScroll is the
** command window do nothing since the term should handle it.
*/
- if (win_to_scroll == TUI_SRC_WIN)
- tui_vertical_source_scroll (FORWARD_SCROLL, _num_to_scroll);
- else if (win_to_scroll == TUI_DISASM_WIN)
- tui_vertical_disassem_scroll (FORWARD_SCROLL, _num_to_scroll);
- else if (win_to_scroll == TUI_DATA_WIN)
- tui_vertical_data_scroll (FORWARD_SCROLL, _num_to_scroll);
+ if (winToScroll == TUI_SRC_WIN)
+ tui_vertical_source_scroll (FORWARD_SCROLL, _numToScroll);
+ else if (winToScroll == TUI_DISASM_WIN)
+ tui_vertical_disassem_scroll (FORWARD_SCROLL, _numToScroll);
+ else if (winToScroll == TUI_DATA_WIN)
+ tui_vertical_data_scroll (FORWARD_SCROLL, _numToScroll);
}
}
void
-tui_scroll_backward (struct tui_win_info * win_to_scroll, int num_to_scroll)
+tui_scroll_backward (struct tui_win_info * winToScroll, int numToScroll)
{
- if (win_to_scroll != TUI_CMD_WIN)
+ if (winToScroll != TUI_CMD_WIN)
{
- int _num_to_scroll = num_to_scroll;
+ int _numToScroll = numToScroll;
- if (num_to_scroll == 0)
- _num_to_scroll = win_to_scroll->generic.height - 3;
+ if (numToScroll == 0)
+ _numToScroll = winToScroll->generic.height - 3;
/*
** If we are scrolling the source or disassembly window, do a
** "psuedo" scroll since not all of the source is in memory,
- ** only what is in the viewport. If win_to_scroll is the
+ ** only what is in the viewport. If winToScroll is the
** command window do nothing since the term should handle it.
*/
- if (win_to_scroll == TUI_SRC_WIN)
- tui_vertical_source_scroll (BACKWARD_SCROLL, _num_to_scroll);
- else if (win_to_scroll == TUI_DISASM_WIN)
- tui_vertical_disassem_scroll (BACKWARD_SCROLL, _num_to_scroll);
- else if (win_to_scroll == TUI_DATA_WIN)
- tui_vertical_data_scroll (BACKWARD_SCROLL, _num_to_scroll);
+ if (winToScroll == TUI_SRC_WIN)
+ tui_vertical_source_scroll (BACKWARD_SCROLL, _numToScroll);
+ else if (winToScroll == TUI_DISASM_WIN)
+ tui_vertical_disassem_scroll (BACKWARD_SCROLL, _numToScroll);
+ else if (winToScroll == TUI_DATA_WIN)
+ tui_vertical_data_scroll (BACKWARD_SCROLL, _numToScroll);
}
}
void
-tui_scroll_left (struct tui_win_info * win_to_scroll, int num_to_scroll)
+tui_scroll_left (struct tui_win_info * winToScroll, int numToScroll)
{
- if (win_to_scroll != TUI_CMD_WIN)
+ if (winToScroll != TUI_CMD_WIN)
{
- int _num_to_scroll = num_to_scroll;
+ int _numToScroll = numToScroll;
- if (_num_to_scroll == 0)
- _num_to_scroll = 1;
+ if (_numToScroll == 0)
+ _numToScroll = 1;
/*
** If we are scrolling the source or disassembly window, do a
** "psuedo" scroll since not all of the source is in memory,
- ** only what is in the viewport. If win_to_scroll is the
+ ** only what is in the viewport. If winToScroll is the
** command window do nothing since the term should handle it.
*/
- if (win_to_scroll == TUI_SRC_WIN || win_to_scroll == TUI_DISASM_WIN)
- tui_horizontal_source_scroll (win_to_scroll, LEFT_SCROLL, _num_to_scroll);
+ if (winToScroll == TUI_SRC_WIN || winToScroll == TUI_DISASM_WIN)
+ tui_horizontal_source_scroll (winToScroll, LEFT_SCROLL, _numToScroll);
}
}
void
-tui_scroll_right (struct tui_win_info * win_to_scroll, int num_to_scroll)
+tui_scroll_right (struct tui_win_info * winToScroll, int numToScroll)
{
- if (win_to_scroll != TUI_CMD_WIN)
+ if (winToScroll != TUI_CMD_WIN)
{
- int _num_to_scroll = num_to_scroll;
+ int _numToScroll = numToScroll;
- if (_num_to_scroll == 0)
- _num_to_scroll = 1;
+ if (_numToScroll == 0)
+ _numToScroll = 1;
/*
** If we are scrolling the source or disassembly window, do a
** "psuedo" scroll since not all of the source is in memory,
- ** only what is in the viewport. If win_to_scroll is the
+ ** only what is in the viewport. If winToScroll is the
** command window do nothing since the term should handle it.
*/
- if (win_to_scroll == TUI_SRC_WIN || win_to_scroll == TUI_DISASM_WIN)
- tui_horizontal_source_scroll (win_to_scroll, RIGHT_SCROLL, _num_to_scroll);
+ if (winToScroll == TUI_SRC_WIN || winToScroll == TUI_DISASM_WIN)
+ tui_horizontal_source_scroll (winToScroll, RIGHT_SCROLL, _numToScroll);
}
}
@@ -532,22 +537,22 @@ tui_scroll_right (struct tui_win_info * win_to_scroll, int num_to_scroll)
/* Scroll a window. Arguments are passed through a va_list. */
void
tui_scroll (enum tui_scroll_direction direction,
- struct tui_win_info * win_to_scroll,
- int num_to_scroll)
+ struct tui_win_info * winToScroll,
+ int numToScroll)
{
switch (direction)
{
case FORWARD_SCROLL:
- tui_scroll_forward (win_to_scroll, num_to_scroll);
+ tui_scroll_forward (winToScroll, numToScroll);
break;
case BACKWARD_SCROLL:
- tui_scroll_backward (win_to_scroll, num_to_scroll);
+ tui_scroll_backward (winToScroll, numToScroll);
break;
case LEFT_SCROLL:
- tui_scroll_left (win_to_scroll, num_to_scroll);
+ tui_scroll_left (winToScroll, numToScroll);
break;
case RIGHT_SCROLL:
- tui_scroll_right (win_to_scroll, num_to_scroll);
+ tui_scroll_right (winToScroll, numToScroll);
break;
default:
break;
@@ -587,178 +592,187 @@ tui_refresh_all_win (void)
}
-/* Resize all the windows based on the the terminal size. This
- function gets called from within the readline sinwinch handler. */
+/*
+ ** tuiResizeAll().
+ ** Resize all the windows based on the the terminal size. This
+ ** function gets called from within the readline sinwinch handler.
+ */
void
-tui_resize_all (void)
+tuiResizeAll (void)
{
- int height_diff, width_diff;
+ int heightDiff, widthDiff;
int screenheight, screenwidth;
rl_get_screen_size (&screenheight, &screenwidth);
- width_diff = screenwidth - tui_term_width ();
- height_diff = screenheight - tui_term_height ();
- if (height_diff || width_diff)
+ widthDiff = screenwidth - tui_term_width ();
+ heightDiff = screenheight - tui_term_height ();
+ if (heightDiff || widthDiff)
{
- enum tui_layout_type cur_layout = tui_current_layout ();
- struct tui_win_info * win_with_focus = tui_win_with_focus ();
- struct tui_win_info *first_win;
- struct tui_win_info *second_win;
+ enum tui_layout_type curLayout = tui_current_layout ();
+ struct tui_win_info * winWithFocus = tui_win_with_focus ();
+ struct tui_win_info *firstWin;
+ struct tui_win_info *secondWin;
struct tui_gen_win_info * locator = tui_locator_win_info_ptr ();
- enum tui_win_type win_type;
- int new_height, split_diff, cmd_split_diff, num_wins_displayed = 2;
+ enum tui_win_type winType;
+ int newHeight, splitDiff, cmdSplitDiff, numWinsDisplayed = 2;
/* turn keypad off while we resize */
- if (win_with_focus != TUI_CMD_WIN)
+ if (winWithFocus != TUI_CMD_WIN)
keypad (TUI_CMD_WIN->generic.handle, FALSE);
tui_update_gdb_sizes ();
tui_set_term_height_to (screenheight);
tui_set_term_width_to (screenwidth);
- if (cur_layout == SRC_DISASSEM_COMMAND ||
- cur_layout == SRC_DATA_COMMAND || cur_layout == DISASSEM_DATA_COMMAND)
- num_wins_displayed++;
- split_diff = height_diff / num_wins_displayed;
- cmd_split_diff = split_diff;
- if (height_diff % num_wins_displayed)
+ if (curLayout == SRC_DISASSEM_COMMAND ||
+ curLayout == SRC_DATA_COMMAND || curLayout == DISASSEM_DATA_COMMAND)
+ numWinsDisplayed++;
+ splitDiff = heightDiff / numWinsDisplayed;
+ cmdSplitDiff = splitDiff;
+ if (heightDiff % numWinsDisplayed)
{
- if (height_diff < 0)
- cmd_split_diff--;
+ if (heightDiff < 0)
+ cmdSplitDiff--;
else
- cmd_split_diff++;
+ cmdSplitDiff++;
}
/* now adjust each window */
clear ();
refresh ();
- switch (cur_layout)
+ switch (curLayout)
{
case SRC_COMMAND:
case DISASSEM_COMMAND:
- first_win = (struct tui_win_info *) (tui_source_windows ())->list[0];
- first_win->generic.width += width_diff;
- locator->width += width_diff;
+ firstWin = (struct tui_win_info *) (tui_source_windows ())->list[0];
+ firstWin->generic.width += widthDiff;
+ locator->width += widthDiff;
/* check for invalid heights */
- if (height_diff == 0)
- new_height = first_win->generic.height;
- else if ((first_win->generic.height + split_diff) >=
+ if (heightDiff == 0)
+ newHeight = firstWin->generic.height;
+ else if ((firstWin->generic.height + splitDiff) >=
(screenheight - MIN_CMD_WIN_HEIGHT - 1))
- new_height = screenheight - MIN_CMD_WIN_HEIGHT - 1;
- else if ((first_win->generic.height + split_diff) <= 0)
- new_height = MIN_WIN_HEIGHT;
+ newHeight = screenheight - MIN_CMD_WIN_HEIGHT - 1;
+ else if ((firstWin->generic.height + splitDiff) <= 0)
+ newHeight = MIN_WIN_HEIGHT;
else
- new_height = first_win->generic.height + split_diff;
+ newHeight = firstWin->generic.height + splitDiff;
- make_invisible_and_set_new_height (first_win, new_height);
+ _makeInvisibleAndSetNewHeight (firstWin, newHeight);
TUI_CMD_WIN->generic.origin.y = locator->origin.y + 1;
- TUI_CMD_WIN->generic.width += width_diff;
- new_height = screenheight - TUI_CMD_WIN->generic.origin.y;
- make_invisible_and_set_new_height (TUI_CMD_WIN, new_height);
- make_visible_with_new_height (first_win);
- make_visible_with_new_height (TUI_CMD_WIN);
- if (first_win->generic.content_size <= 0)
- tui_erase_source_content (first_win, EMPTY_SOURCE_PROMPT);
+ TUI_CMD_WIN->generic.width += widthDiff;
+ newHeight = screenheight - TUI_CMD_WIN->generic.origin.y;
+ _makeInvisibleAndSetNewHeight (TUI_CMD_WIN, newHeight);
+ _makeVisibleWithNewHeight (firstWin);
+ _makeVisibleWithNewHeight (TUI_CMD_WIN);
+ if (firstWin->generic.content_size <= 0)
+ tui_erase_source_content (firstWin, EMPTY_SOURCE_PROMPT);
break;
default:
- if (cur_layout == SRC_DISASSEM_COMMAND)
+ if (curLayout == SRC_DISASSEM_COMMAND)
{
- first_win = TUI_SRC_WIN;
- first_win->generic.width += width_diff;
- second_win = TUI_DISASM_WIN;
- second_win->generic.width += width_diff;
+ firstWin = TUI_SRC_WIN;
+ firstWin->generic.width += widthDiff;
+ secondWin = TUI_DISASM_WIN;
+ secondWin->generic.width += widthDiff;
}
else
{
- first_win = TUI_DATA_WIN;
- first_win->generic.width += width_diff;
- second_win = (struct tui_win_info *) (tui_source_windows ())->list[0];
- second_win->generic.width += width_diff;
+ firstWin = TUI_DATA_WIN;
+ firstWin->generic.width += widthDiff;
+ secondWin = (struct tui_win_info *) (tui_source_windows ())->list[0];
+ secondWin->generic.width += widthDiff;
}
/* Change the first window's height/width */
/* check for invalid heights */
- if (height_diff == 0)
- new_height = first_win->generic.height;
- else if ((first_win->generic.height +
- second_win->generic.height + (split_diff * 2)) >=
+ if (heightDiff == 0)
+ newHeight = firstWin->generic.height;
+ else if ((firstWin->generic.height +
+ secondWin->generic.height + (splitDiff * 2)) >=
(screenheight - MIN_CMD_WIN_HEIGHT - 1))
- new_height = (screenheight - MIN_CMD_WIN_HEIGHT - 1) / 2;
- else if ((first_win->generic.height + split_diff) <= 0)
- new_height = MIN_WIN_HEIGHT;
+ newHeight = (screenheight - MIN_CMD_WIN_HEIGHT - 1) / 2;
+ else if ((firstWin->generic.height + splitDiff) <= 0)
+ newHeight = MIN_WIN_HEIGHT;
else
- new_height = first_win->generic.height + split_diff;
- make_invisible_and_set_new_height (first_win, new_height);
+ newHeight = firstWin->generic.height + splitDiff;
+ _makeInvisibleAndSetNewHeight (firstWin, newHeight);
- if (first_win == TUI_DATA_WIN && width_diff != 0)
- first_win->detail.data_display_info.regs_column_count =
+ if (firstWin == TUI_DATA_WIN && widthDiff != 0)
+ firstWin->detail.data_display_info.regs_column_count =
tui_calculate_regs_column_count (
- first_win->detail.data_display_info.regs_display_type);
- locator->width += width_diff;
+ firstWin->detail.data_display_info.regs_display_type);
+ locator->width += widthDiff;
/* Change the second window's height/width */
/* check for invalid heights */
- if (height_diff == 0)
- new_height = second_win->generic.height;
- else if ((first_win->generic.height +
- second_win->generic.height + (split_diff * 2)) >=
+ if (heightDiff == 0)
+ newHeight = secondWin->generic.height;
+ else if ((firstWin->generic.height +
+ secondWin->generic.height + (splitDiff * 2)) >=
(screenheight - MIN_CMD_WIN_HEIGHT - 1))
{
- new_height = screenheight - MIN_CMD_WIN_HEIGHT - 1;
- if (new_height % 2)
- new_height = (new_height / 2) + 1;
+ newHeight = screenheight - MIN_CMD_WIN_HEIGHT - 1;
+ if (newHeight % 2)
+ newHeight = (newHeight / 2) + 1;
else
- new_height /= 2;
+ newHeight /= 2;
}
- else if ((second_win->generic.height + split_diff) <= 0)
- new_height = MIN_WIN_HEIGHT;
+ else if ((secondWin->generic.height + splitDiff) <= 0)
+ newHeight = MIN_WIN_HEIGHT;
else
- new_height = second_win->generic.height + split_diff;
- second_win->generic.origin.y = first_win->generic.height - 1;
- make_invisible_and_set_new_height (second_win, new_height);
+ newHeight = secondWin->generic.height + splitDiff;
+ secondWin->generic.origin.y = firstWin->generic.height - 1;
+ _makeInvisibleAndSetNewHeight (secondWin, newHeight);
/* Change the command window's height/width */
TUI_CMD_WIN->generic.origin.y = locator->origin.y + 1;
- make_invisible_and_set_new_height (
- TUI_CMD_WIN, TUI_CMD_WIN->generic.height + cmd_split_diff);
- make_visible_with_new_height (first_win);
- make_visible_with_new_height (second_win);
- make_visible_with_new_height (TUI_CMD_WIN);
- if (first_win->generic.content_size <= 0)
- tui_erase_source_content (first_win, EMPTY_SOURCE_PROMPT);
- if (second_win->generic.content_size <= 0)
- tui_erase_source_content (second_win, EMPTY_SOURCE_PROMPT);
+ _makeInvisibleAndSetNewHeight (
+ TUI_CMD_WIN, TUI_CMD_WIN->generic.height + cmdSplitDiff);
+ _makeVisibleWithNewHeight (firstWin);
+ _makeVisibleWithNewHeight (secondWin);
+ _makeVisibleWithNewHeight (TUI_CMD_WIN);
+ if (firstWin->generic.content_size <= 0)
+ tui_erase_source_content (firstWin, EMPTY_SOURCE_PROMPT);
+ if (secondWin->generic.content_size <= 0)
+ tui_erase_source_content (secondWin, EMPTY_SOURCE_PROMPT);
break;
}
/*
** Now remove all invisible windows, and their content so that they get
** created again when called for with the new size
*/
- for (win_type = SRC_WIN; (win_type < MAX_MAJOR_WINDOWS); win_type++)
+ for (winType = SRC_WIN; (winType < MAX_MAJOR_WINDOWS); winType++)
{
- if (win_type != CMD_WIN && (tui_win_list[win_type] != NULL)
- && !tui_win_list[win_type]->generic.is_visible)
+ if (winType != CMD_WIN && (tui_win_list[winType] != NULL)
+ && !tui_win_list[winType]->generic.is_visible)
{
- tui_free_window (tui_win_list[win_type]);
- tui_win_list[win_type] = (struct tui_win_info *) NULL;
+ tui_free_window (tui_win_list[winType]);
+ tui_win_list[winType] = (struct tui_win_info *) NULL;
}
}
tui_set_win_resized_to (TRUE);
/* turn keypad back on, unless focus is in the command window */
- if (win_with_focus != TUI_CMD_WIN)
+ if (winWithFocus != TUI_CMD_WIN)
keypad (TUI_CMD_WIN->generic.handle, TRUE);
}
-}
+ return;
+} /* tuiResizeAll */
-/* SIGWINCH signal handler for the tui. This signal handler is always
- called, even when the readline package clears signals because it is
- set as the old_sigwinch() (TUI only). */
+/*
+ ** tuiSigwinchHandler()
+ ** SIGWINCH signal handler for the tui. This signal handler is
+ ** always called, even when the readline package clears signals
+ ** because it is set as the old_sigwinch() (TUI only)
+ */
void
-tui_sigwinch_handler (int signal)
+tuiSigwinchHandler (int signal)
{
/*
** Say that a resize was done so that the readline can do it
** later when appropriate.
*/
tui_set_win_resized_to (TRUE);
-}
+
+ return;
+} /* tuiSigwinchHandler */
@@ -767,83 +781,98 @@ tui_sigwinch_handler (int signal)
**************************/
+/*
+ ** _tuiScrollForward_command().
+ */
static void
-tui_scroll_forward_command (char *arg, int from_tty)
+_tuiScrollForward_command (char *arg, int fromTTY)
{
- int num_to_scroll = 1;
- struct tui_win_info * win_to_scroll;
+ int numToScroll = 1;
+ struct tui_win_info * winToScroll;
/* Make sure the curses mode is enabled. */
tui_enable ();
if (arg == (char *) NULL)
- parse_scrolling_args (arg, &win_to_scroll, (int *) NULL);
+ _parseScrollingArgs (arg, &winToScroll, (int *) NULL);
else
- parse_scrolling_args (arg, &win_to_scroll, &num_to_scroll);
- tui_scroll (FORWARD_SCROLL, win_to_scroll, num_to_scroll);
+ _parseScrollingArgs (arg, &winToScroll, &numToScroll);
+ tui_scroll (FORWARD_SCROLL, winToScroll, numToScroll);
}
+/*
+ ** _tuiScrollBackward_command().
+ */
static void
-tui_scroll_backward_command (char *arg, int from_tty)
+_tuiScrollBackward_command (char *arg, int fromTTY)
{
- int num_to_scroll = 1;
- struct tui_win_info * win_to_scroll;
+ int numToScroll = 1;
+ struct tui_win_info * winToScroll;
/* Make sure the curses mode is enabled. */
tui_enable ();
if (arg == (char *) NULL)
- parse_scrolling_args (arg, &win_to_scroll, (int *) NULL);
+ _parseScrollingArgs (arg, &winToScroll, (int *) NULL);
else
- parse_scrolling_args (arg, &win_to_scroll, &num_to_scroll);
- tui_scroll (BACKWARD_SCROLL, win_to_scroll, num_to_scroll);
+ _parseScrollingArgs (arg, &winToScroll, &numToScroll);
+ tui_scroll (BACKWARD_SCROLL, winToScroll, numToScroll);
}
+/*
+ ** _tuiScrollLeft_command().
+ */
static void
-tui_scroll_left_command (char *arg, int from_tty)
+_tuiScrollLeft_command (char *arg, int fromTTY)
{
- int num_to_scroll;
- struct tui_win_info * win_to_scroll;
+ int numToScroll;
+ struct tui_win_info * winToScroll;
/* Make sure the curses mode is enabled. */
tui_enable ();
- parse_scrolling_args (arg, &win_to_scroll, &num_to_scroll);
- tui_scroll (LEFT_SCROLL, win_to_scroll, num_to_scroll);
+ _parseScrollingArgs (arg, &winToScroll, &numToScroll);
+ tui_scroll (LEFT_SCROLL, winToScroll, numToScroll);
}
+/*
+ ** _tuiScrollRight_command().
+ */
static void
-tui_scroll_right_command (char *arg, int from_tty)
+_tuiScrollRight_command (char *arg, int fromTTY)
{
- int num_to_scroll;
- struct tui_win_info * win_to_scroll;
+ int numToScroll;
+ struct tui_win_info * winToScroll;
/* Make sure the curses mode is enabled. */
tui_enable ();
- parse_scrolling_args (arg, &win_to_scroll, &num_to_scroll);
- tui_scroll (RIGHT_SCROLL, win_to_scroll, num_to_scroll);
+ _parseScrollingArgs (arg, &winToScroll, &numToScroll);
+ tui_scroll (RIGHT_SCROLL, winToScroll, numToScroll);
}
-/* Set focus to the window named by 'arg'. */
+/*
+ ** _tuiSetFocus().
+ ** Set focus to the window named by 'arg'
+ */
static void
-tui_set_focus (char *arg, int from_tty)
+_tuiSetFocus (char *arg, int fromTTY)
{
if (arg != (char *) NULL)
{
- char *buf_ptr = (char *) xstrdup (arg);
+ char *bufPtr = (char *) xstrdup (arg);
int i;
struct tui_win_info * win_info = (struct tui_win_info *) NULL;
- for (i = 0; (i < strlen (buf_ptr)); i++)
- buf_ptr[i] = toupper (arg[i]);
+ for (i = 0; (i < strlen (bufPtr)); i++)
+ bufPtr[i] = toupper (arg[i]);
- if (subset_compare (buf_ptr, "NEXT"))
+ if (subset_compare (bufPtr, "NEXT"))
win_info = tui_next_win (tui_win_with_focus ());
- else if (subset_compare (buf_ptr, "PREV"))
+ else if (subset_compare (bufPtr, "PREV"))
win_info = tui_prev_win (tui_win_with_focus ());
else
- win_info = tui_partial_win_by_name (buf_ptr);
+ win_info = tui_partial_win_by_name (bufPtr);
if (win_info == (struct tui_win_info *) NULL || !win_info->generic.is_visible)
warning ("Invalid window specified. \n\
@@ -856,33 +885,41 @@ The window name specified must be valid and visible.\n");
if (TUI_DATA_WIN && TUI_DATA_WIN->generic.is_visible)
tui_refresh_data_win ();
- xfree (buf_ptr);
+ xfree (bufPtr);
printf_filtered ("Focus set to %s window.\n",
tui_win_name ((struct tui_gen_win_info *) tui_win_with_focus ()));
}
else
warning ("Incorrect Number of Arguments.\n%s", FOCUS_USAGE);
-}
+ return;
+} /* _tuiSetFocus */
+
+/*
+ ** _tuiSetFocus_command()
+ */
static void
-tui_set_focus_command (char *arg, int from_tty)
+_tuiSetFocus_command (char *arg, int fromTTY)
{
/* Make sure the curses mode is enabled. */
tui_enable ();
- tui_set_focus (arg, from_tty);
+ _tuiSetFocus (arg, fromTTY);
}
+/*
+ ** _tuiAllWindowsInfo().
+ */
static void
-tui_all_windows_info (char *arg, int from_tty)
+_tuiAllWindowsInfo (char *arg, int fromTTY)
{
enum tui_win_type type;
- struct tui_win_info * win_with_focus = tui_win_with_focus ();
+ struct tui_win_info * winWithFocus = tui_win_with_focus ();
for (type = SRC_WIN; (type < MAX_MAJOR_WINDOWS); type++)
if (tui_win_list[type] && tui_win_list[type]->generic.is_visible)
{
- if (win_with_focus == tui_win_list[type])
+ if (winWithFocus == tui_win_list[type])
printf_filtered (" %s\t(%d lines) <has focus>\n",
tui_win_name (&tui_win_list[type]->generic),
tui_win_list[type]->generic.height);
@@ -891,11 +928,16 @@ tui_all_windows_info (char *arg, int from_tty)
tui_win_name (&tui_win_list[type]->generic),
tui_win_list[type]->generic.height);
}
-}
+
+ return;
+} /* _tuiAllWindowsInfo */
+/*
+ ** _tuiRefreshAll_command().
+ */
static void
-tui_refresh_all_command (char *arg, int from_tty)
+_tuiRefreshAll_command (char *arg, int fromTTY)
{
/* Make sure the curses mode is enabled. */
tui_enable ();
@@ -904,9 +946,12 @@ tui_refresh_all_command (char *arg, int from_tty)
}
-/* Set the height of the specified window. */
+/*
+ ** _tuiSetWinTabWidth_command().
+ ** Set the height of the specified window.
+ */
static void
-tui_set_tab_width_command (char *arg, int from_tty)
+_tuiSetTabWidth_command (char *arg, int fromTTY)
{
/* Make sure the curses mode is enabled. */
tui_enable ();
@@ -920,28 +965,33 @@ tui_set_tab_width_command (char *arg, int from_tty)
else
warning ("Tab widths greater than 0 must be specified.\n");
}
-}
+ return;
+} /* _tuiSetTabWidth_command */
-/* Set the height of the specified window. */
+
+/*
+ ** _tuiSetWinHeight().
+ ** Set the height of the specified window.
+ */
static void
-tui_set_win_height (char *arg, int from_tty)
+_tuiSetWinHeight (char *arg, int fromTTY)
{
/* Make sure the curses mode is enabled. */
tui_enable ();
if (arg != (char *) NULL)
{
char *buf = xstrdup (arg);
- char *buf_ptr = buf;
+ char *bufPtr = buf;
char *wname = (char *) NULL;
- int new_height, i;
+ int newHeight, i;
struct tui_win_info * win_info;
- wname = buf_ptr;
- buf_ptr = strchr (buf_ptr, ' ');
- if (buf_ptr != (char *) NULL)
+ wname = bufPtr;
+ bufPtr = strchr (bufPtr, ' ');
+ if (bufPtr != (char *) NULL)
{
- *buf_ptr = (char) 0;
+ *bufPtr = (char) 0;
/*
** Validate the window name
@@ -956,37 +1006,37 @@ The window name specified must be valid and visible.\n");
else
{
/* Process the size */
- while (*(++buf_ptr) == ' ')
+ while (*(++bufPtr) == ' ')
;
- if (*buf_ptr != (char) 0)
+ if (*bufPtr != (char) 0)
{
int negate = FALSE;
- int fixed_size = TRUE;
- int input_no;;
+ int fixedSize = TRUE;
+ int inputNo;;
- if (*buf_ptr == '+' || *buf_ptr == '-')
+ if (*bufPtr == '+' || *bufPtr == '-')
{
- if (*buf_ptr == '-')
+ if (*bufPtr == '-')
negate = TRUE;
- fixed_size = FALSE;
- buf_ptr++;
+ fixedSize = FALSE;
+ bufPtr++;
}
- input_no = atoi (buf_ptr);
- if (input_no > 0)
+ inputNo = atoi (bufPtr);
+ if (inputNo > 0)
{
if (negate)
- input_no *= (-1);
- if (fixed_size)
- new_height = input_no;
+ inputNo *= (-1);
+ if (fixedSize)
+ newHeight = inputNo;
else
- new_height = win_info->generic.height + input_no;
+ newHeight = win_info->generic.height + inputNo;
/*
** Now change the window's height, and adjust all
** other windows around it
*/
- if (tui_adjust_win_heights (win_info,
- new_height) == TUI_FAILURE)
+ if (_tuiAdjustWinHeights (win_info,
+ newHeight) == TUI_FAILURE)
warning ("Invalid window height specified.\n%s",
WIN_HEIGHT_USAGE);
else
@@ -1006,36 +1056,44 @@ The window name specified must be valid and visible.\n");
}
else
printf_filtered (WIN_HEIGHT_USAGE);
-}
-/* Set the height of the specified window, with va_list. */
+ return;
+} /* _tuiSetWinHeight */
+
+/*
+ ** _tuiSetWinHeight_command().
+ ** Set the height of the specified window, with va_list.
+ */
static void
-tui_set_win_height_command (char *arg, int from_tty)
+_tuiSetWinHeight_command (char *arg, int fromTTY)
{
/* Make sure the curses mode is enabled. */
tui_enable ();
- tui_set_win_height (arg, from_tty);
+ _tuiSetWinHeight (arg, fromTTY);
}
-/* XDB Compatibility command for setting the window height. This will
- increase or decrease the command window by the specified amount. */
+/*
+ ** _tuiXDBsetWinHeight().
+ ** XDB Compatibility command for setting the window height. This will
+ ** increase or decrease the command window by the specified amount.
+ */
static void
-tui_xdb_set_win_height (char *arg, int from_tty)
+_tuiXDBsetWinHeight (char *arg, int fromTTY)
{
/* Make sure the curses mode is enabled. */
tui_enable ();
if (arg != (char *) NULL)
{
- int input_no = atoi (arg);
+ int inputNo = atoi (arg);
- if (input_no > 0)
+ if (inputNo > 0)
{ /* Add 1 for the locator */
- int new_height = tui_term_height () - (input_no + 1);
+ int newHeight = tui_term_height () - (inputNo + 1);
- if (!new_height_ok (tui_win_list[CMD_WIN], new_height) ||
- tui_adjust_win_heights (tui_win_list[CMD_WIN],
- new_height) == TUI_FAILURE)
+ if (!_newHeightOk (tui_win_list[CMD_WIN], newHeight) ||
+ _tuiAdjustWinHeights (tui_win_list[CMD_WIN],
+ newHeight) == TUI_FAILURE)
warning ("Invalid window height specified.\n%s",
XDBWIN_HEIGHT_USAGE);
}
@@ -1045,114 +1103,122 @@ tui_xdb_set_win_height (char *arg, int from_tty)
}
else
warning ("Invalid window height specified.\n%s", XDBWIN_HEIGHT_USAGE);
-}
-/* Set the height of the specified window, with va_list. */
+ return;
+} /* _tuiXDBsetWinHeight */
+
+/*
+ ** _tuiSetWinHeight_command().
+ ** Set the height of the specified window, with va_list.
+ */
static void
-tui_xdb_set_win_height_command (char *arg, int from_tty)
+_tuiXDBsetWinHeight_command (char *arg, int fromTTY)
{
- tui_xdb_set_win_height (arg, from_tty);
+ _tuiXDBsetWinHeight (arg, fromTTY);
}
-/* Function to adjust all window heights around the primary. */
+/*
+ ** _tuiAdjustWinHeights().
+ ** Function to adjust all window heights around the primary
+ */
static enum tui_status
-tui_adjust_win_heights (struct tui_win_info * primary_win_info, int new_height)
+_tuiAdjustWinHeights (struct tui_win_info * primaryWinInfo, int newHeight)
{
enum tui_status status = TUI_FAILURE;
- if (new_height_ok (primary_win_info, new_height))
+ if (_newHeightOk (primaryWinInfo, newHeight))
{
status = TUI_SUCCESS;
- if (new_height != primary_win_info->generic.height)
+ if (newHeight != primaryWinInfo->generic.height)
{
int diff;
struct tui_win_info * win_info;
struct tui_gen_win_info * locator = tui_locator_win_info_ptr ();
- enum tui_layout_type cur_layout = tui_current_layout ();
+ enum tui_layout_type curLayout = tui_current_layout ();
- diff = (new_height - primary_win_info->generic.height) * (-1);
- if (cur_layout == SRC_COMMAND || cur_layout == DISASSEM_COMMAND)
+ diff = (newHeight - primaryWinInfo->generic.height) * (-1);
+ if (curLayout == SRC_COMMAND || curLayout == DISASSEM_COMMAND)
{
- struct tui_win_info * src_win_info;
+ struct tui_win_info * srcWinInfo;
- make_invisible_and_set_new_height (primary_win_info, new_height);
- if (primary_win_info->generic.type == CMD_WIN)
+ _makeInvisibleAndSetNewHeight (primaryWinInfo, newHeight);
+ if (primaryWinInfo->generic.type == CMD_WIN)
{
win_info = (struct tui_win_info *) (tui_source_windows ())->list[0];
- src_win_info = win_info;
+ srcWinInfo = win_info;
}
else
{
win_info = tui_win_list[CMD_WIN];
- src_win_info = primary_win_info;
+ srcWinInfo = primaryWinInfo;
}
- make_invisible_and_set_new_height (win_info,
+ _makeInvisibleAndSetNewHeight (win_info,
win_info->generic.height + diff);
TUI_CMD_WIN->generic.origin.y = locator->origin.y + 1;
- make_visible_with_new_height (win_info);
- make_visible_with_new_height (primary_win_info);
- if (src_win_info->generic.content_size <= 0)
- tui_erase_source_content (src_win_info, EMPTY_SOURCE_PROMPT);
+ _makeVisibleWithNewHeight (win_info);
+ _makeVisibleWithNewHeight (primaryWinInfo);
+ if (srcWinInfo->generic.content_size <= 0)
+ tui_erase_source_content (srcWinInfo, EMPTY_SOURCE_PROMPT);
}
else
{
- struct tui_win_info *first_win;
- struct tui_win_info *second_win;
+ struct tui_win_info *firstWin;
+ struct tui_win_info *secondWin;
- if (cur_layout == SRC_DISASSEM_COMMAND)
+ if (curLayout == SRC_DISASSEM_COMMAND)
{
- first_win = TUI_SRC_WIN;
- second_win = TUI_DISASM_WIN;
+ firstWin = TUI_SRC_WIN;
+ secondWin = TUI_DISASM_WIN;
}
else
{
- first_win = TUI_DATA_WIN;
- second_win = (struct tui_win_info *) (tui_source_windows ())->list[0];
+ firstWin = TUI_DATA_WIN;
+ secondWin = (struct tui_win_info *) (tui_source_windows ())->list[0];
}
- if (primary_win_info == TUI_CMD_WIN)
+ if (primaryWinInfo == TUI_CMD_WIN)
{ /*
** Split the change in height accross the 1st & 2nd windows
** adjusting them as well.
*/
- int first_split_diff = diff / 2; /* subtract the locator */
- int second_split_diff = first_split_diff;
+ int firstSplitDiff = diff / 2; /* subtract the locator */
+ int secondSplitDiff = firstSplitDiff;
if (diff % 2)
{
- if (first_win->generic.height >
- second_win->generic.height)
+ if (firstWin->generic.height >
+ secondWin->generic.height)
if (diff < 0)
- first_split_diff--;
+ firstSplitDiff--;
else
- first_split_diff++;
+ firstSplitDiff++;
else
{
if (diff < 0)
- second_split_diff--;
+ secondSplitDiff--;
else
- second_split_diff++;
+ secondSplitDiff++;
}
}
/* make sure that the minimum hieghts are honored */
- while ((first_win->generic.height + first_split_diff) < 3)
+ while ((firstWin->generic.height + firstSplitDiff) < 3)
{
- first_split_diff++;
- second_split_diff--;
+ firstSplitDiff++;
+ secondSplitDiff--;
}
- while ((second_win->generic.height + second_split_diff) < 3)
+ while ((secondWin->generic.height + secondSplitDiff) < 3)
{
- second_split_diff++;
- first_split_diff--;
+ secondSplitDiff++;
+ firstSplitDiff--;
}
- make_invisible_and_set_new_height (
- first_win,
- first_win->generic.height + first_split_diff);
- second_win->generic.origin.y = first_win->generic.height - 1;
- make_invisible_and_set_new_height (
- second_win, second_win->generic.height + second_split_diff);
+ _makeInvisibleAndSetNewHeight (
+ firstWin,
+ firstWin->generic.height + firstSplitDiff);
+ secondWin->generic.origin.y = firstWin->generic.height - 1;
+ _makeInvisibleAndSetNewHeight (
+ secondWin, secondWin->generic.height + secondSplitDiff);
TUI_CMD_WIN->generic.origin.y = locator->origin.y + 1;
- make_invisible_and_set_new_height (TUI_CMD_WIN, new_height);
+ _makeInvisibleAndSetNewHeight (TUI_CMD_WIN, newHeight);
}
else
{
@@ -1166,53 +1232,56 @@ tui_adjust_win_heights (struct tui_win_info * primary_win_info, int new_height)
int i;
for (i = TUI_CMD_WIN->generic.height + diff;
(i < 1); i++)
- if (primary_win_info == first_win)
- second_win->generic.height--;
+ if (primaryWinInfo == firstWin)
+ secondWin->generic.height--;
else
- first_win->generic.height--;
+ firstWin->generic.height--;
}
}
- if (primary_win_info == first_win)
- make_invisible_and_set_new_height (first_win, new_height);
+ if (primaryWinInfo == firstWin)
+ _makeInvisibleAndSetNewHeight (firstWin, newHeight);
else
- make_invisible_and_set_new_height (
- first_win,
- first_win->generic.height);
- second_win->generic.origin.y = first_win->generic.height - 1;
- if (primary_win_info == second_win)
- make_invisible_and_set_new_height (second_win, new_height);
+ _makeInvisibleAndSetNewHeight (
+ firstWin,
+ firstWin->generic.height);
+ secondWin->generic.origin.y = firstWin->generic.height - 1;
+ if (primaryWinInfo == secondWin)
+ _makeInvisibleAndSetNewHeight (secondWin, newHeight);
else
- make_invisible_and_set_new_height (
- second_win, second_win->generic.height);
+ _makeInvisibleAndSetNewHeight (
+ secondWin, secondWin->generic.height);
TUI_CMD_WIN->generic.origin.y = locator->origin.y + 1;
if ((TUI_CMD_WIN->generic.height + diff) < 1)
- make_invisible_and_set_new_height (TUI_CMD_WIN, 1);
+ _makeInvisibleAndSetNewHeight (TUI_CMD_WIN, 1);
else
- make_invisible_and_set_new_height (
+ _makeInvisibleAndSetNewHeight (
TUI_CMD_WIN, TUI_CMD_WIN->generic.height + diff);
}
- make_visible_with_new_height (TUI_CMD_WIN);
- make_visible_with_new_height (second_win);
- make_visible_with_new_height (first_win);
- if (first_win->generic.content_size <= 0)
- tui_erase_source_content (first_win, EMPTY_SOURCE_PROMPT);
- if (second_win->generic.content_size <= 0)
- tui_erase_source_content (second_win, EMPTY_SOURCE_PROMPT);
+ _makeVisibleWithNewHeight (TUI_CMD_WIN);
+ _makeVisibleWithNewHeight (secondWin);
+ _makeVisibleWithNewHeight (firstWin);
+ if (firstWin->generic.content_size <= 0)
+ tui_erase_source_content (firstWin, EMPTY_SOURCE_PROMPT);
+ if (secondWin->generic.content_size <= 0)
+ tui_erase_source_content (secondWin, EMPTY_SOURCE_PROMPT);
}
}
}
return status;
-}
+} /* _tuiAdjustWinHeights */
-/* Function make the target window (and auxillary windows associated
- with the targer) invisible, and set the new height and location. */
+/*
+ ** _makeInvisibleAndSetNewHeight().
+ ** Function make the target window (and auxillary windows associated
+ ** with the targer) invisible, and set the new height and location.
+ */
static void
-make_invisible_and_set_new_height (struct tui_win_info * win_info, int height)
+_makeInvisibleAndSetNewHeight (struct tui_win_info * win_info, int height)
{
int i;
- struct tui_gen_win_info * gen_win_info;
+ struct tui_gen_win_info * genWinInfo;
tui_make_invisible (&win_info->generic);
win_info->generic.height = height;
@@ -1228,32 +1297,32 @@ make_invisible_and_set_new_height (struct tui_win_info * win_info, int height)
{
case SRC_WIN:
case DISASSEM_WIN:
- gen_win_info = win_info->detail.source_info.execution_info;
- tui_make_invisible (gen_win_info);
- gen_win_info->height = height;
- gen_win_info->origin.y = win_info->generic.origin.y;
+ genWinInfo = win_info->detail.source_info.execution_info;
+ tui_make_invisible (genWinInfo);
+ genWinInfo->height = height;
+ genWinInfo->origin.y = win_info->generic.origin.y;
if (height > 1)
- gen_win_info->viewport_height = height - 1;
+ genWinInfo->viewport_height = height - 1;
else
- gen_win_info->viewport_height = height;
+ genWinInfo->viewport_height = height;
if (win_info != TUI_CMD_WIN)
- gen_win_info->viewport_height--;
+ genWinInfo->viewport_height--;
if (tui_win_has_locator (win_info))
{
- gen_win_info = tui_locator_win_info_ptr ();
- tui_make_invisible (gen_win_info);
- gen_win_info->origin.y = win_info->generic.origin.y + height;
+ genWinInfo = tui_locator_win_info_ptr ();
+ tui_make_invisible (genWinInfo);
+ genWinInfo->origin.y = win_info->generic.origin.y + height;
}
break;
case DATA_WIN:
/* delete all data item windows */
for (i = 0; i < win_info->generic.content_size; i++)
{
- gen_win_info = (struct tui_gen_win_info *) & ((struct tui_win_element *)
+ genWinInfo = (struct tui_gen_win_info *) & ((struct tui_win_element *)
win_info->generic.content[i])->which_element.data_window;
- tui_delete_win (gen_win_info->handle);
- gen_win_info->handle = (WINDOW *) NULL;
+ tui_delete_win (genWinInfo->handle);
+ genWinInfo->handle = (WINDOW *) NULL;
}
break;
default:
@@ -1262,11 +1331,14 @@ make_invisible_and_set_new_height (struct tui_win_info * win_info, int height)
}
-/* Function to make the windows with new heights visible. This means
- re-creating the windows' content since the window had to be
- destroyed to be made invisible. */
+/*
+ ** _makeVisibleWithNewHeight().
+ ** Function to make the windows with new heights visible.
+ ** This means re-creating the windows' content since the window
+ ** had to be destroyed to be made invisible.
+ */
static void
-make_visible_with_new_height (struct tui_win_info * win_info)
+_makeVisibleWithNewHeight (struct tui_win_info * win_info)
{
struct symtab *s;
@@ -1280,18 +1352,18 @@ make_visible_with_new_height (struct tui_win_info * win_info)
tui_make_visible (win_info->detail.source_info.execution_info);
if (win_info->generic.content != NULL)
{
- union tui_line_or_address line_or_addr;
+ union tui_line_or_address lineOrAddr;
struct symtab_and_line cursal
= get_current_source_symtab_and_line ();
if (win_info->generic.type == SRC_WIN)
- line_or_addr.line_no =
+ lineOrAddr.line_no =
win_info->detail.source_info.start_line_or_addr.line_no;
else
- line_or_addr.addr =
+ lineOrAddr.addr =
win_info->detail.source_info.start_line_or_addr.addr;
tui_free_win_content (&win_info->generic);
- tui_update_source_window (win_info, cursal.symtab, line_or_addr, TRUE);
+ tui_update_source_window (win_info, cursal.symtab, lineOrAddr, TRUE);
}
else if (deprecated_selected_frame != (struct frame_info *) NULL)
{
@@ -1327,55 +1399,57 @@ make_visible_with_new_height (struct tui_win_info * win_info)
default:
break;
}
-}
+
+ return;
+} /* _makeVisibleWithNewHeight */
static int
-new_height_ok (struct tui_win_info * primary_win_info, int new_height)
+_newHeightOk (struct tui_win_info * primaryWinInfo, int newHeight)
{
- int ok = (new_height < tui_term_height ());
+ int ok = (newHeight < tui_term_height ());
if (ok)
{
int diff;
enum tui_layout_type cur_layout = tui_current_layout ();
- diff = (new_height - primary_win_info->generic.height) * (-1);
+ diff = (newHeight - primaryWinInfo->generic.height) * (-1);
if (cur_layout == SRC_COMMAND || cur_layout == DISASSEM_COMMAND)
{
- ok = ((primary_win_info->generic.type == CMD_WIN &&
- new_height <= (tui_term_height () - 4) &&
- new_height >= MIN_CMD_WIN_HEIGHT) ||
- (primary_win_info->generic.type != CMD_WIN &&
- new_height <= (tui_term_height () - 2) &&
- new_height >= MIN_WIN_HEIGHT));
+ ok = ((primaryWinInfo->generic.type == CMD_WIN &&
+ newHeight <= (tui_term_height () - 4) &&
+ newHeight >= MIN_CMD_WIN_HEIGHT) ||
+ (primaryWinInfo->generic.type != CMD_WIN &&
+ newHeight <= (tui_term_height () - 2) &&
+ newHeight >= MIN_WIN_HEIGHT));
if (ok)
{ /* check the total height */
struct tui_win_info * win_info;
- if (primary_win_info == TUI_CMD_WIN)
+ if (primaryWinInfo == TUI_CMD_WIN)
win_info = (struct tui_win_info *) (tui_source_windows ())->list[0];
else
win_info = TUI_CMD_WIN;
- ok = ((new_height +
+ ok = ((newHeight +
(win_info->generic.height + diff)) <= tui_term_height ());
}
}
else
{
- int cur_total_height, total_height, min_height = 0;
- struct tui_win_info *first_win;
- struct tui_win_info *second_win;
+ int curTotalHeight, totalHeight, minHeight = 0;
+ struct tui_win_info *firstWin;
+ struct tui_win_info *secondWin;
if (cur_layout == SRC_DISASSEM_COMMAND)
{
- first_win = TUI_SRC_WIN;
- second_win = TUI_DISASM_WIN;
+ firstWin = TUI_SRC_WIN;
+ secondWin = TUI_DISASM_WIN;
}
else
{
- first_win = TUI_DATA_WIN;
- second_win = (struct tui_win_info *) (tui_source_windows ())->list[0];
+ firstWin = TUI_DATA_WIN;
+ secondWin = (struct tui_win_info *) (tui_source_windows ())->list[0];
}
/*
** We could simply add all the heights to obtain the same result
@@ -1383,26 +1457,26 @@ new_height_ok (struct tui_win_info * primary_win_info, int new_height)
** line that the first and second windows share, and add one
** for the locator.
*/
- total_height = cur_total_height =
- (first_win->generic.height + second_win->generic.height - 1)
+ totalHeight = curTotalHeight =
+ (firstWin->generic.height + secondWin->generic.height - 1)
+ TUI_CMD_WIN->generic.height + 1 /*locator */ ;
- if (primary_win_info == TUI_CMD_WIN)
+ if (primaryWinInfo == TUI_CMD_WIN)
{
/* locator included since first & second win share a line */
- ok = ((first_win->generic.height +
- second_win->generic.height + diff) >=
+ ok = ((firstWin->generic.height +
+ secondWin->generic.height + diff) >=
(MIN_WIN_HEIGHT * 2) &&
- new_height >= MIN_CMD_WIN_HEIGHT);
+ newHeight >= MIN_CMD_WIN_HEIGHT);
if (ok)
{
- total_height = new_height + (first_win->generic.height +
- second_win->generic.height + diff);
- min_height = MIN_CMD_WIN_HEIGHT;
+ totalHeight = newHeight + (firstWin->generic.height +
+ secondWin->generic.height + diff);
+ minHeight = MIN_CMD_WIN_HEIGHT;
}
}
else
{
- min_height = MIN_WIN_HEIGHT;
+ minHeight = MIN_WIN_HEIGHT;
/*
** First see if we can increase/decrease the command
** window. And make sure that the command window is
@@ -1414,20 +1488,20 @@ new_height_ok (struct tui_win_info * primary_win_info, int new_height)
** Looks like we have to increase/decrease one of
** the other windows
*/
- if (primary_win_info == first_win)
- ok = (second_win->generic.height + diff) >= min_height;
+ if (primaryWinInfo == firstWin)
+ ok = (secondWin->generic.height + diff) >= minHeight;
else
- ok = (first_win->generic.height + diff) >= min_height;
+ ok = (firstWin->generic.height + diff) >= minHeight;
}
if (ok)
{
- if (primary_win_info == first_win)
- total_height = new_height +
- second_win->generic.height +
+ if (primaryWinInfo == firstWin)
+ totalHeight = newHeight +
+ secondWin->generic.height +
TUI_CMD_WIN->generic.height + diff;
else
- total_height = new_height +
- first_win->generic.height +
+ totalHeight = newHeight +
+ firstWin->generic.height +
TUI_CMD_WIN->generic.height + diff;
}
}
@@ -1436,21 +1510,23 @@ new_height_ok (struct tui_win_info * primary_win_info, int new_height)
** the old total height.
*/
if (ok)
- ok = (new_height >= min_height && total_height <= cur_total_height);
+ ok = (newHeight >= minHeight && totalHeight <= curTotalHeight);
}
}
return ok;
-}
+} /* _newHeightOk */
+/*
+ ** _parseScrollingArgs().
+ */
static void
-parse_scrolling_args (char *arg, struct tui_win_info * * win_to_scroll,
- int *num_to_scroll)
+_parseScrollingArgs (char *arg, struct tui_win_info * * winToScroll, int *numToScroll)
{
- if (num_to_scroll)
- *num_to_scroll = 0;
- *win_to_scroll = tui_win_with_focus ();
+ if (numToScroll)
+ *numToScroll = 0;
+ *winToScroll = tui_win_with_focus ();
/*
** First set up the default window to scroll, in case there is no
@@ -1458,54 +1534,56 @@ parse_scrolling_args (char *arg, struct tui_win_info * * win_to_scroll,
*/
if (arg != (char *) NULL)
{
- char *buf, *buf_ptr;
+ char *buf, *bufPtr;
/* process the number of lines to scroll */
- buf = buf_ptr = xstrdup (arg);
- if (isdigit (*buf_ptr))
+ buf = bufPtr = xstrdup (arg);
+ if (isdigit (*bufPtr))
{
- char *num_str;
+ char *numStr;
- num_str = buf_ptr;
- buf_ptr = strchr (buf_ptr, ' ');
- if (buf_ptr != (char *) NULL)
+ numStr = bufPtr;
+ bufPtr = strchr (bufPtr, ' ');
+ if (bufPtr != (char *) NULL)
{
- *buf_ptr = (char) 0;
- if (num_to_scroll)
- *num_to_scroll = atoi (num_str);
- buf_ptr++;
+ *bufPtr = (char) 0;
+ if (numToScroll)
+ *numToScroll = atoi (numStr);
+ bufPtr++;
}
- else if (num_to_scroll)
- *num_to_scroll = atoi (num_str);
+ else if (numToScroll)
+ *numToScroll = atoi (numStr);
}
/* process the window name if one is specified */
- if (buf_ptr != (char *) NULL)
+ if (bufPtr != (char *) NULL)
{
char *wname;
int i;
- if (*buf_ptr == ' ')
- while (*(++buf_ptr) == ' ')
+ if (*bufPtr == ' ')
+ while (*(++bufPtr) == ' ')
;
- if (*buf_ptr != (char) 0)
- wname = buf_ptr;
+ if (*bufPtr != (char) 0)
+ wname = bufPtr;
else
wname = "?";
/* Validate the window name */
for (i = 0; i < strlen (wname); i++)
wname[i] = toupper (wname[i]);
- *win_to_scroll = tui_partial_win_by_name (wname);
+ *winToScroll = tui_partial_win_by_name (wname);
- if (*win_to_scroll == (struct tui_win_info *) NULL ||
- !(*win_to_scroll)->generic.is_visible)
+ if (*winToScroll == (struct tui_win_info *) NULL ||
+ !(*winToScroll)->generic.is_visible)
warning ("Invalid window specified. \n\
The window name specified must be valid and visible.\n");
- else if (*win_to_scroll == TUI_CMD_WIN)
- *win_to_scroll = (struct tui_win_info *) (tui_source_windows ())->list[0];
+ else if (*winToScroll == TUI_CMD_WIN)
+ *winToScroll = (struct tui_win_info *) (tui_source_windows ())->list[0];
}
xfree (buf);
}
-}
+
+ return;
+} /* _parseScrollingArgs */
diff --git a/gdb/tui/tui-windata.c b/gdb/tui/tui-windata.c
index 6f22d0c..0548536 100644
--- a/gdb/tui/tui-windata.c
+++ b/gdb/tui/tui-windata.c
@@ -48,66 +48,77 @@
******************************************/
-/* Answer the index first element displayed. If none are displayed,
- then return (-1). */
+/*
+ ** tuiFirstDataItemDisplayed()
+ ** Answer the index first element displayed.
+ ** If none are displayed, then return (-1).
+ */
int
-tui_first_data_item_displayed (void)
+tuiFirstDataItemDisplayed (void)
{
- int element_no = (-1);
+ int elementNo = (-1);
int i;
- for (i = 0; (i < TUI_DATA_WIN->generic.content_size && element_no < 0); i++)
+ for (i = 0; (i < TUI_DATA_WIN->generic.content_size && elementNo < 0); i++)
{
- struct tui_gen_win_info * data_item_win;
+ struct tui_gen_win_info * dataItemWin;
- data_item_win = &((tui_win_content)
+ dataItemWin = &((tui_win_content)
TUI_DATA_WIN->generic.content)[i]->which_element.data_window;
- if (data_item_win->handle != (WINDOW *) NULL && data_item_win->is_visible)
- element_no = i;
+ if (dataItemWin->handle != (WINDOW *) NULL && dataItemWin->is_visible)
+ elementNo = i;
}
- return element_no;
-}
+ return elementNo;
+} /* tuiFirstDataItemDisplayed */
-/* Answer the index of the first element in line_no. If line_no is
- past the data area (-1) is returned. */
+/*
+ ** tuiFirstDataElementNoInLine()
+ ** Answer the index of the first element in lineNo. If lineNo is
+ ** past the data area (-1) is returned.
+ */
int
-tui_first_data_element_no_in_line (int line_no)
+tuiFirstDataElementNoInLine (int lineNo)
{
- int first_element_no = (-1);
+ int firstElementNo = (-1);
/*
- ** First see if there is a register on line_no, and if so, set the
+ ** First see if there is a register on lineNo, and if so, set the
** first element number
*/
- if ((first_element_no = tui_first_reg_element_no_inline (line_no)) == -1)
+ if ((firstElementNo = tui_first_reg_element_no_inline (lineNo)) == -1)
{ /*
- ** Looking at the general data, the 1st element on line_no
+ ** Looking at the general data, the 1st element on lineNo
*/
}
- return first_element_no;
-}
+ return firstElementNo;
+} /* tuiFirstDataElementNoInLine */
-/* Function to delete all the item windows in the data window. This
- is usually done when the data window is scrolled. */
+/*
+ ** tuiDeleteDataContentWindows()
+ ** Function to delete all the item windows in the data window.
+ ** This is usually done when the data window is scrolled.
+ */
void
-tui_delete_data_content_windows (void)
+tuiDeleteDataContentWindows (void)
{
int i;
- struct tui_gen_win_info * data_item_win_ptr;
+ struct tui_gen_win_info * dataItemWinPtr;
for (i = 0; (i < TUI_DATA_WIN->generic.content_size); i++)
{
- data_item_win_ptr = &((tui_win_content)
+ dataItemWinPtr = &((tui_win_content)
TUI_DATA_WIN->generic.content)[i]->which_element.data_window;
- tui_delete_win (data_item_win_ptr->handle);
- data_item_win_ptr->handle = (WINDOW *) NULL;
- data_item_win_ptr->is_visible = FALSE;
+ tui_delete_win (dataItemWinPtr->handle);
+ dataItemWinPtr->handle = (WINDOW *) NULL;
+ dataItemWinPtr->is_visible = FALSE;
}
-}
+
+ return;
+} /* tuiDeleteDataContentWindows */
void
@@ -117,16 +128,16 @@ tui_erase_data_content (char *prompt)
tui_check_and_display_highlight_if_needed (TUI_DATA_WIN);
if (prompt != (char *) NULL)
{
- int half_width = (TUI_DATA_WIN->generic.width - 2) / 2;
- int x_pos;
+ int halfWidth = (TUI_DATA_WIN->generic.width - 2) / 2;
+ int xPos;
- if (strlen (prompt) >= half_width)
- x_pos = 1;
+ if (strlen (prompt) >= halfWidth)
+ xPos = 1;
else
- x_pos = half_width - strlen (prompt);
+ xPos = halfWidth - strlen (prompt);
mvwaddstr (TUI_DATA_WIN->generic.handle,
(TUI_DATA_WIN->generic.height / 2),
- x_pos,
+ xPos,
prompt);
}
wrefresh (TUI_DATA_WIN->generic.handle);
@@ -143,7 +154,7 @@ tui_display_all_data (void)
else
{
tui_erase_data_content ((char *) NULL);
- tui_delete_data_content_windows ();
+ tuiDeleteDataContentWindows ();
tui_check_and_display_highlight_if_needed (TUI_DATA_WIN);
tui_display_registers_from (0);
/*
@@ -158,70 +169,80 @@ tui_display_all_data (void)
}
-/* Function to display the data starting at line, line_no, in the data
- window. */
+/*
+ ** tuiDisplayDataFromLine()
+ ** Function to display the data starting at line, lineNo, in the
+ ** data window.
+ */
void
-tui_display_data_from_line (int line_no)
+tuiDisplayDataFromLine (int lineNo)
{
- int _line_no = line_no;
+ int _lineNo = lineNo;
- if (line_no < 0)
- _line_no = 0;
+ if (lineNo < 0)
+ _lineNo = 0;
tui_check_and_display_highlight_if_needed (TUI_DATA_WIN);
/* there is no general data, force regs to display (if there are any) */
if (TUI_DATA_WIN->detail.data_display_info.data_content_count <= 0)
- tui_display_registers_from_line (_line_no, TRUE);
+ tui_display_registers_from_line (_lineNo, TRUE);
else
{
- int element_no, start_line_no;
- int regs_last_line = tui_last_regs_line_no ();
+ int elementNo, startLineNo;
+ int regsLastLine = tui_last_regs_line_no ();
/* display regs if we can */
- if (tui_display_registers_from_line (_line_no, FALSE) < 0)
+ if (tui_display_registers_from_line (_lineNo, FALSE) < 0)
{ /*
- ** _line_no is past the regs display, so calc where the
+ ** _lineNo is past the regs display, so calc where the
** start data element is
*/
- if (regs_last_line < _line_no)
+ if (regsLastLine < _lineNo)
{ /* figure out how many lines each element is to obtain
- the start element_no */
+ the start elementNo */
}
}
else
{ /*
** calculate the starting element of the data display, given
- ** regs_last_line and how many lines each element is, up to
- ** _line_no
+ ** regsLastLine and how many lines each element is, up to
+ ** _lineNo
*/
}
- /* Now display the data , starting at element_no */
+ /* Now display the data , starting at elementNo */
}
-}
+ return;
+} /* tuiDisplayDataFromLine */
-/* Display data starting at element element_no. */
+
+/*
+ ** tuiDisplayDataFrom()
+ ** Display data starting at element elementNo
+ */
void
-tui_display_data_from (int element_no, int reuse_windows)
+tuiDisplayDataFrom (int elementNo, int reuseWindows)
{
- int first_line = (-1);
+ int firstLine = (-1);
- if (element_no < TUI_DATA_WIN->detail.data_display_info.regs_content_count)
- first_line = tui_line_from_reg_element_no (element_no);
+ if (elementNo < TUI_DATA_WIN->detail.data_display_info.regs_content_count)
+ firstLine = tui_line_from_reg_element_no (elementNo);
else
- { /* calculate the first_line from the element number */
+ { /* calculate the firstLine from the element number */
}
- if (first_line >= 0)
+ if (firstLine >= 0)
{
tui_erase_data_content ((char *) NULL);
- if (!reuse_windows)
- tui_delete_data_content_windows ();
- tui_display_data_from_line (first_line);
+ if (!reuseWindows)
+ tuiDeleteDataContentWindows ();
+ tuiDisplayDataFromLine (firstLine);
}
-}
+
+ return;
+} /* tuiDisplayDataFrom */
/* Function to redisplay the contents of the data window. */
@@ -231,10 +252,10 @@ tui_refresh_data_win (void)
tui_erase_data_content ((char *) NULL);
if (TUI_DATA_WIN->generic.content_size > 0)
{
- int first_element = tui_first_data_item_displayed ();
+ int firstElement = tuiFirstDataItemDisplayed ();
- if (first_element >= 0) /* re-use existing windows */
- tui_display_data_from (first_element, TRUE);
+ if (firstElement >= 0) /* re-use existing windows */
+ tuiDisplayDataFrom (firstElement, TRUE);
}
}
@@ -253,18 +274,18 @@ tui_check_data_values (struct frame_info *frame)
for (i = 0; TUI_DATA_WIN->detail.data_display_info.data_content_count; i++)
{
#ifdef LATER
- tui_data_element_ptr data_element_ptr;
- struct tui_gen_win_info * data_item_win_ptr;
- Opaque new_value;
+ TuiDataElementPtr dataElementPtr;
+ struct tui_gen_win_info * dataItemWinPtr;
+ Opaque newValue;
- data_item_ptr = &TUI_DATA_WIN->detail.data_display_info.
+ dataItemPtr = &TUI_DATA_WIN->detail.data_display_info.
data_content[i]->which_element.data_window;
- data_element_ptr = &((tui_win_content)
- data_item_win_ptr->content)[0]->which_element.data;
+ dataElementPtr = &((tui_win_content)
+ dataItemWinPtr->content)[0]->which_element.data;
if value
- has changed (data_element_ptr, frame, &new_value)
+ has changed (dataElementPtr, frame, &newValue)
{
- data_element_ptr->value = new_value;
+ dataElementPtr->value = newValue;
update the display with the new value, hiliting it.
}
#endif
@@ -275,33 +296,35 @@ tui_check_data_values (struct frame_info *frame)
/* Scroll the data window vertically forward or backward. */
void
-tui_vertical_data_scroll (enum tui_scroll_direction scroll_direction, int num_to_scroll)
+tui_vertical_data_scroll (enum tui_scroll_direction scrollDirection, int numToScroll)
{
- int first_element_no;
- int first_line = (-1);
+ int firstElementNo;
+ int firstLine = (-1);
- first_element_no = tui_first_data_item_displayed ();
- if (first_element_no < TUI_DATA_WIN->detail.data_display_info.regs_content_count)
- first_line = tui_line_from_reg_element_no (first_element_no);
+ firstElementNo = tuiFirstDataItemDisplayed ();
+ if (firstElementNo < TUI_DATA_WIN->detail.data_display_info.regs_content_count)
+ firstLine = tui_line_from_reg_element_no (firstElementNo);
else
{ /* calculate the first line from the element number which is in
** the general data content
*/
}
- if (first_line >= 0)
+ if (firstLine >= 0)
{
- int last_element_no, last_line;
+ int lastElementNo, lastLine;
- if (scroll_direction == FORWARD_SCROLL)
- first_line += num_to_scroll;
+ if (scrollDirection == FORWARD_SCROLL)
+ firstLine += numToScroll;
else
- first_line -= num_to_scroll;
+ firstLine -= numToScroll;
tui_erase_data_content ((char *) NULL);
- tui_delete_data_content_windows ();
- tui_display_data_from_line (first_line);
+ tuiDeleteDataContentWindows ();
+ tuiDisplayDataFromLine (firstLine);
}
-}
+
+ return;
+} /* tuiVerticalDataScroll */
/*****************************************
diff --git a/gdb/tui/tui-wingeneral.c b/gdb/tui/tui-wingeneral.c
index 1bd9460..9239a05 100644
--- a/gdb/tui/tui-wingeneral.c
+++ b/gdb/tui/tui-wingeneral.c
@@ -50,13 +50,13 @@ tui_refresh_win (struct tui_gen_win_info * win_info)
for (i = 0; (i < win_info->content_size); i++)
{
- struct tui_gen_win_info * data_item_win_ptr;
+ struct tui_gen_win_info * dataItemWinPtr;
- data_item_win_ptr = &((tui_win_content)
+ dataItemWinPtr = &((tui_win_content)
win_info->content)[i]->which_element.data_window;
- if (data_item_win_ptr != NULL
- && data_item_win_ptr->handle != (WINDOW *) NULL)
- wrefresh (data_item_win_ptr->handle);
+ if (dataItemWinPtr != NULL
+ && dataItemWinPtr->handle != (WINDOW *) NULL)
+ wrefresh (dataItemWinPtr->handle);
}
}
else if (win_info->type == CMD_WIN)
@@ -86,7 +86,7 @@ tui_delete_win (WINDOW * window)
/* Draw a border arround the window. */
void
-box_win (struct tui_gen_win_info * win_info, int highlight_flag)
+boxWin (struct tui_gen_win_info * win_info, int highlightFlag)
{
if (win_info && win_info->handle)
{
@@ -94,7 +94,7 @@ box_win (struct tui_gen_win_info * win_info, int highlight_flag)
int attrs;
win = win_info->handle;
- if (highlight_flag == HILITE)
+ if (highlightFlag == HILITE)
attrs = tui_active_border_attrs;
else
attrs = tui_border_attrs;
@@ -116,7 +116,7 @@ tui_unhighlight_win (struct tui_win_info * win_info)
{
if (win_info != NULL && win_info->generic.handle != (WINDOW *) NULL)
{
- box_win ((struct tui_gen_win_info *) win_info, NO_HILITE);
+ boxWin ((struct tui_gen_win_info *) win_info, NO_HILITE);
wrefresh (win_info->generic.handle);
tui_set_win_highlight (win_info, 0);
}
@@ -130,7 +130,7 @@ tui_highlight_win (struct tui_win_info * win_info)
&& win_info->can_highlight
&& win_info->generic.handle != (WINDOW *) NULL)
{
- box_win ((struct tui_gen_win_info *) win_info, HILITE);
+ boxWin ((struct tui_gen_win_info *) win_info, HILITE);
wrefresh (win_info->generic.handle);
tui_set_win_highlight (win_info, 1);
}
@@ -152,7 +152,7 @@ tui_check_and_display_highlight_if_needed (struct tui_win_info * win_info)
void
-tui_make_window (struct tui_gen_win_info * win_info, int box_it)
+tui_make_window (struct tui_gen_win_info * win_info, int boxIt)
{
WINDOW *handle;
@@ -163,8 +163,8 @@ tui_make_window (struct tui_gen_win_info * win_info, int box_it)
win_info->handle = handle;
if (handle != (WINDOW *) NULL)
{
- if (box_it == BOX_WINDOW)
- box_win (win_info, NO_HILITE);
+ if (boxIt == BOX_WINDOW)
+ boxWin (win_info, NO_HILITE);
win_info->is_visible = TRUE;
scrollok (handle, TRUE);
}
@@ -274,7 +274,9 @@ tui_refresh_all (struct tui_win_info * * list)
touchwin (locator->handle);
tui_refresh_win (locator);
}
-}
+
+ return;
+} /* refreshAll */
/*********************************
diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c
index 6b77c40..1a8775e 100644
--- a/gdb/tui/tui-winsource.c
+++ b/gdb/tui/tui-winsource.c
@@ -76,10 +76,10 @@ tui_display_main (void)
initializes the horizontal scroll to 0. */
void
tui_update_source_window (struct tui_win_info * win_info, struct symtab *s,
- union tui_line_or_address line_or_addr, int noerror)
+ union tui_line_or_address lineOrAddr, int noerror)
{
win_info->detail.source_info.horizontal_offset = 0;
- tui_update_source_window_as_is (win_info, s, line_or_addr, noerror);
+ tui_update_source_window_as_is (win_info, s, lineOrAddr, noerror);
return;
}
@@ -89,14 +89,14 @@ tui_update_source_window (struct tui_win_info * win_info, struct symtab *s,
shows the source as specified by the horizontal offset. */
void
tui_update_source_window_as_is (struct tui_win_info * win_info, struct symtab *s,
- union tui_line_or_address line_or_addr, int noerror)
+ union tui_line_or_address lineOrAddr, int noerror)
{
enum tui_status ret;
if (win_info->generic.type == SRC_WIN)
- ret = tui_set_source_content (s, line_or_addr.line_no, noerror);
+ ret = tui_set_source_content (s, lineOrAddr.line_no, noerror);
else
- ret = tui_set_disassem_content (line_or_addr.addr);
+ ret = tui_set_disassem_content (lineOrAddr.addr);
if (ret == TUI_FAILURE)
{
@@ -112,7 +112,7 @@ tui_update_source_window_as_is (struct tui_win_info * win_info, struct symtab *s
{
struct symtab_and_line sal;
- sal.line = line_or_addr.line_no +
+ sal.line = lineOrAddr.line_no +
(win_info->generic.content_size - 2);
sal.symtab = s;
set_current_source_symtab_and_line (&sal);
@@ -169,7 +169,9 @@ tui_update_source_windows_with_addr (CORE_ADDR addr)
tui_clear_exec_info_content (win_info);
}
}
-}
+
+ return;
+} /* tuiUpdateSourceWindowsWithAddr */
/* Function to ensure that the source and/or disassemly windows
reflect the input address. */
@@ -201,14 +203,14 @@ tui_update_source_windows_with_line (struct symtab *s, int line)
}
void
-tui_clear_source_content (struct tui_win_info * win_info, int display_prompt)
+tui_clear_source_content (struct tui_win_info * win_info, int displayPrompt)
{
if (win_info != NULL)
{
- int i;
+ register int i;
win_info->generic.content_in_use = FALSE;
- tui_erase_source_content (win_info, display_prompt);
+ tui_erase_source_content (win_info, displayPrompt);
for (i = 0; i < win_info->generic.content_size; i++)
{
struct tui_win_element * element =
@@ -217,46 +219,49 @@ tui_clear_source_content (struct tui_win_info * win_info, int display_prompt)
element->which_element.source.is_exec_point = FALSE;
}
}
-}
+
+ return;
+} /* tuiClearSourceContent */
void
-tui_erase_source_content (struct tui_win_info * win_info, int display_prompt)
+tui_erase_source_content (struct tui_win_info * win_info, int displayPrompt)
{
- int x_pos;
- int half_width = (win_info->generic.width - 2) / 2;
+ int xPos;
+ int halfWidth = (win_info->generic.width - 2) / 2;
if (win_info->generic.handle != (WINDOW *) NULL)
{
werase (win_info->generic.handle);
tui_check_and_display_highlight_if_needed (win_info);
- if (display_prompt == EMPTY_SOURCE_PROMPT)
+ if (displayPrompt == EMPTY_SOURCE_PROMPT)
{
- char *no_src_str;
+ char *noSrcStr;
if (win_info->generic.type == SRC_WIN)
- no_src_str = NO_SRC_STRING;
+ noSrcStr = NO_SRC_STRING;
else
- no_src_str = NO_DISASSEM_STRING;
- if (strlen (no_src_str) >= half_width)
- x_pos = 1;
+ noSrcStr = NO_DISASSEM_STRING;
+ if (strlen (noSrcStr) >= halfWidth)
+ xPos = 1;
else
- x_pos = half_width - strlen (no_src_str);
+ xPos = halfWidth - strlen (noSrcStr);
mvwaddstr (win_info->generic.handle,
(win_info->generic.height / 2),
- x_pos,
- no_src_str);
+ xPos,
+ noSrcStr);
/* elz: added this function call to set the real contents of
the window to what is on the screen, so that later calls
to refresh, do display
the correct stuff, and not the old image */
- tui_set_source_content_nil (win_info, no_src_str);
+ tui_set_source_content_nil (win_info, noSrcStr);
}
tui_refresh_win (&win_info->generic);
}
-}
+ return;
+} /* tuiEraseSourceContent */
/* Redraw the complete line of a source or disassembly window. */
@@ -307,7 +312,7 @@ tui_show_source_content (struct tui_win_info * win_info)
void
tui_horizontal_source_scroll (struct tui_win_info * win_info,
enum tui_scroll_direction direction,
- int num_to_scroll)
+ int numToScroll)
{
if (win_info->generic.content != NULL)
{
@@ -321,11 +326,11 @@ tui_horizontal_source_scroll (struct tui_win_info * win_info,
s = cursal.symtab;
if (direction == LEFT_SCROLL)
- offset = win_info->detail.source_info.horizontal_offset + num_to_scroll;
+ offset = win_info->detail.source_info.horizontal_offset + numToScroll;
else
{
if ((offset =
- win_info->detail.source_info.horizontal_offset - num_to_scroll) < 0)
+ win_info->detail.source_info.horizontal_offset - numToScroll) < 0)
offset = 0;
}
win_info->detail.source_info.horizontal_offset = offset;
@@ -336,7 +341,7 @@ tui_horizontal_source_scroll (struct tui_win_info * win_info,
}
return;
-}
+} /* tuiHorizontalSourceScroll */
/* Set or clear the has_break flag in the line whose line is line_no. */
@@ -350,16 +355,16 @@ tui_set_is_exec_point_at (union tui_line_or_address l, struct tui_win_info * win
i = 0;
while (i < win_info->generic.content_size)
{
- int new_state;
+ int newState;
if (content[i]->which_element.source.line_or_addr.addr == l.addr)
- new_state = TRUE;
+ newState = TRUE;
else
- new_state = FALSE;
- if (new_state != content[i]->which_element.source.is_exec_point)
+ newState = FALSE;
+ if (newState != content[i]->which_element.source.is_exec_point)
{
changed++;
- content[i]->which_element.source.is_exec_point = new_state;
+ content[i]->which_element.source.is_exec_point = newState;
tui_show_source_line (win_info, i + 1);
}
i++;
@@ -372,7 +377,7 @@ tui_set_is_exec_point_at (union tui_line_or_address l, struct tui_win_info * win
This is called whenever a breakpoint is inserted, removed or
has its state changed. */
void
-tui_update_all_breakpoint_info (void)
+tui_update_all_breakpoint_info ()
{
struct tui_list *list = tui_source_windows ();
int i;
@@ -448,23 +453,26 @@ tui_update_breakpoint_info (struct tui_win_info * win, int current_only)
}
-/* Function to initialize the content of the execution info window,
- based upon the input window which is either the source or
- disassembly window. */
+/*
+ ** tuiSetExecInfoContent().
+ ** Function to initialize the content of the execution info window,
+ ** based upon the input window which is either the source or
+ ** disassembly window.
+ */
enum tui_status
-tui_set_exec_info_content (struct tui_win_info * win_info)
+tuiSetExecInfoContent (struct tui_win_info * win_info)
{
enum tui_status ret = TUI_SUCCESS;
if (win_info->detail.source_info.execution_info != (struct tui_gen_win_info *) NULL)
{
- struct tui_gen_win_info * exec_info_ptr = win_info->detail.source_info.execution_info;
+ struct tui_gen_win_info * execInfoPtr = win_info->detail.source_info.execution_info;
- if (exec_info_ptr->content == NULL)
- exec_info_ptr->content =
+ if (execInfoPtr->content == NULL)
+ execInfoPtr->content =
(void **) tui_alloc_content (win_info->generic.height,
- exec_info_ptr->type);
- if (exec_info_ptr->content != NULL)
+ execInfoPtr->type);
+ if (execInfoPtr->content != NULL)
{
int i;
@@ -472,11 +480,11 @@ tui_set_exec_info_content (struct tui_win_info * win_info)
for (i = 0; i < win_info->generic.content_size; i++)
{
struct tui_win_element * element;
- struct tui_win_element * src_element;
+ struct tui_win_element * srcElement;
int mode;
- element = (struct tui_win_element *) exec_info_ptr->content[i];
- src_element = (struct tui_win_element *) win_info->generic.content[i];
+ element = (struct tui_win_element *) execInfoPtr->content[i];
+ srcElement = (struct tui_win_element *) win_info->generic.content[i];
memset(element->which_element.simple_string, ' ',
sizeof(element->which_element.simple_string));
@@ -484,7 +492,7 @@ tui_set_exec_info_content (struct tui_win_info * win_info)
/* Now update the exec info content based upon the state
of each line as indicated by the source content. */
- mode = src_element->which_element.source.has_break;
+ mode = srcElement->which_element.source.has_break;
if (mode & TUI_BP_HIT)
element->which_element.simple_string[TUI_BP_HIT_POS] =
(mode & TUI_BP_HARDWARE) ? 'H' : 'B';
@@ -497,10 +505,10 @@ tui_set_exec_info_content (struct tui_win_info * win_info)
else if (mode & TUI_BP_DISABLED)
element->which_element.simple_string[TUI_BP_BREAK_POS] = '-';
- if (src_element->which_element.source.is_exec_point)
+ if (srcElement->which_element.source.is_exec_point)
element->which_element.simple_string[TUI_EXEC_POS] = '>';
}
- exec_info_ptr->content_size = win_info->generic.content_size;
+ execInfoPtr->content_size = win_info->generic.content_size;
}
else
ret = TUI_FAILURE;
@@ -510,32 +518,39 @@ tui_set_exec_info_content (struct tui_win_info * win_info)
}
+/*
+ ** tuiShowExecInfoContent().
+ */
void
-tui_show_exec_info_content (struct tui_win_info * win_info)
+tuiShowExecInfoContent (struct tui_win_info * win_info)
{
- struct tui_gen_win_info * exec_info = win_info->detail.source_info.execution_info;
- int cur_line;
-
- werase (exec_info->handle);
- tui_refresh_win (exec_info);
- for (cur_line = 1; (cur_line <= exec_info->content_size); cur_line++)
- mvwaddstr (exec_info->handle,
- cur_line,
+ struct tui_gen_win_info * execInfo = win_info->detail.source_info.execution_info;
+ int curLine;
+
+ werase (execInfo->handle);
+ tui_refresh_win (execInfo);
+ for (curLine = 1; (curLine <= execInfo->content_size); curLine++)
+ mvwaddstr (execInfo->handle,
+ curLine,
0,
((struct tui_win_element *)
- exec_info->content[cur_line - 1])->which_element.simple_string);
- tui_refresh_win (exec_info);
- exec_info->content_in_use = TRUE;
+ execInfo->content[curLine - 1])->which_element.simple_string);
+ tui_refresh_win (execInfo);
+ execInfo->content_in_use = TRUE;
+
+ return;
}
void
tui_erase_exec_info_content (struct tui_win_info * win_info)
{
- struct tui_gen_win_info * exec_info = win_info->detail.source_info.execution_info;
+ struct tui_gen_win_info * execInfo = win_info->detail.source_info.execution_info;
- werase (exec_info->handle);
- tui_refresh_win (exec_info);
+ werase (execInfo->handle);
+ tui_refresh_win (execInfo);
+
+ return;
}
void
@@ -551,19 +566,19 @@ tui_clear_exec_info_content (struct tui_win_info * win_info)
void
tui_update_exec_info (struct tui_win_info * win_info)
{
- tui_set_exec_info_content (win_info);
- tui_show_exec_info_content (win_info);
-}
+ tuiSetExecInfoContent (win_info);
+ tuiShowExecInfoContent (win_info);
+} /* tuiUpdateExecInfo */
enum tui_status
tui_alloc_source_buffer (struct tui_win_info *win_info)
{
- char *src_line_buf;
- int i, line_width, max_lines;
+ register char *srcLineBuf;
+ register int i, lineWidth, maxLines;
enum tui_status ret = TUI_FAILURE;
- max_lines = win_info->generic.height; /* less the highlight box */
- line_width = win_info->generic.width - 1;
+ maxLines = win_info->generic.height; /* less the highlight box */
+ lineWidth = win_info->generic.width - 1;
/*
** Allocate the buffer for the source lines. Do this only once since they
** will be re-used for all source displays. The only other time this will
@@ -571,8 +586,8 @@ tui_alloc_source_buffer (struct tui_win_info *win_info)
*/
if (win_info->generic.content == NULL)
{
- src_line_buf = (char *) xmalloc ((max_lines * line_width) * sizeof (char));
- if (src_line_buf == (char *) NULL)
+ srcLineBuf = (char *) xmalloc ((maxLines * lineWidth) * sizeof (char));
+ if (srcLineBuf == (char *) NULL)
fputs_unfiltered (
"Unable to Allocate Memory for Source or Disassembly Display.\n",
gdb_stderr);
@@ -580,51 +595,51 @@ tui_alloc_source_buffer (struct tui_win_info *win_info)
{
/* allocate the content list */
if ((win_info->generic.content =
- (void **) tui_alloc_content (max_lines, SRC_WIN)) == NULL)
+ (void **) tui_alloc_content (maxLines, SRC_WIN)) == NULL)
{
- xfree (src_line_buf);
- src_line_buf = (char *) NULL;
+ xfree (srcLineBuf);
+ srcLineBuf = (char *) NULL;
fputs_unfiltered (
"Unable to Allocate Memory for Source or Disassembly Display.\n",
gdb_stderr);
}
}
- for (i = 0; i < max_lines; i++)
+ for (i = 0; i < maxLines; i++)
((struct tui_win_element *)
win_info->generic.content[i])->which_element.source.line =
- src_line_buf + (line_width * i);
+ srcLineBuf + (lineWidth * i);
ret = TUI_SUCCESS;
}
else
ret = TUI_SUCCESS;
return ret;
-}
+} /* tuiAllocSourceBuffer */
/* Answer whether the a particular line number or address is displayed
in the current source window. */
int
tui_line_is_displayed (int line, struct tui_win_info * win_info,
- int check_threshold)
+ int checkThreshold)
{
- int is_displayed = FALSE;
+ int isDisplayed = FALSE;
int i, threshold;
- if (check_threshold)
+ if (checkThreshold)
threshold = SCROLL_THRESHOLD;
else
threshold = 0;
i = 0;
- while (i < win_info->generic.content_size - threshold && !is_displayed)
+ while (i < win_info->generic.content_size - threshold && !isDisplayed)
{
- is_displayed = (((struct tui_win_element *)
+ isDisplayed = (((struct tui_win_element *)
win_info->generic.content[i])->which_element.source.line_or_addr.line_no
== (int) line);
i++;
}
- return is_displayed;
+ return isDisplayed;
}
@@ -632,25 +647,25 @@ tui_line_is_displayed (int line, struct tui_win_info * win_info,
in the current source window. */
int
tui_addr_is_displayed (CORE_ADDR addr, struct tui_win_info * win_info,
- int check_threshold)
+ int checkThreshold)
{
- int is_displayed = FALSE;
+ int isDisplayed = FALSE;
int i, threshold;
- if (check_threshold)
+ if (checkThreshold)
threshold = SCROLL_THRESHOLD;
else
threshold = 0;
i = 0;
- while (i < win_info->generic.content_size - threshold && !is_displayed)
+ while (i < win_info->generic.content_size - threshold && !isDisplayed)
{
- is_displayed = (((struct tui_win_element *)
+ isDisplayed = (((struct tui_win_element *)
win_info->generic.content[i])->which_element.source.line_or_addr.addr
== addr);
i++;
}
- return is_displayed;
+ return isDisplayed;
}
diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c
index 601a579..0e413d4 100644
--- a/gdb/tui/tui.c
+++ b/gdb/tui/tui.c
@@ -1,7 +1,7 @@
/* General functions for the WDB TUI.
- Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation,
- Inc.
+ Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software
+ Foundation, Inc.
Contributed by Hewlett-Packard Company.
@@ -37,15 +37,15 @@
#include <setjmp.h>
#include "defs.h"
#include "gdbcmd.h"
-#include "tui.h"
-#include "tuiData.h"
-#include "tuiLayout.h"
-#include "tuiIO.h"
-#include "tuiRegs.h"
-#include "tuiStack.h"
-#include "tuiWin.h"
-#include "tuiSourceWin.h"
-#include "tuiDataWin.h"
+#include "tui/tui.h"
+#include "tui/tui-data.h"
+#include "tui/tui-layout.h"
+#include "tui/tui-io.h"
+#include "tui/tui-regs.h"
+#include "tui/tui-stack.h"
+#include "tui/tui-win.h"
+#include "tui/tui-winsource.h"
+#include "tui/tui-windata.h"
#include "readline/readline.h"
#include "target.h"
#include "frame.h"
@@ -66,7 +66,7 @@
int tui_active = 0;
static int tui_finish_init = 1;
-enum tui_key_mode tui_current_key_mode = tui_command_mode;
+enum tui_key_mode tui_current_key_mode = TUI_COMMAND_MODE;
struct tui_char_command
{
@@ -137,10 +137,10 @@ tui_rl_change_windows (int notused1, int notused2)
if (tui_active)
{
- TuiLayoutType new_layout;
- TuiRegisterDisplayType regs_type = TUI_UNDEFINED_REGS;
+ enum tui_layout_type new_layout;
+ enum tui_register_display_type regs_type = TUI_UNDEFINED_REGS;
- new_layout = currentLayout ();
+ new_layout = tui_current_layout ();
/* Select a new layout to have a rolling layout behavior
with always two windows (except when undefined). */
@@ -170,7 +170,7 @@ tui_rl_change_windows (int notused1, int notused2)
new_layout = SRC_COMMAND;
break;
}
- tuiSetLayout (new_layout, regs_type);
+ tui_set_layout (new_layout, regs_type);
}
return 0;
}
@@ -185,10 +185,10 @@ tui_rl_delete_other_windows (int notused1, int notused2)
if (tui_active)
{
- TuiLayoutType new_layout;
- TuiRegisterDisplayType regs_type = TUI_UNDEFINED_REGS;
+ enum tui_layout_type new_layout;
+ enum tui_register_display_type regs_type = TUI_UNDEFINED_REGS;
- new_layout = currentLayout ();
+ new_layout = tui_current_layout ();
/* Kill one window. */
switch (new_layout)
@@ -205,7 +205,7 @@ tui_rl_delete_other_windows (int notused1, int notused2)
new_layout = DISASSEM_COMMAND;
break;
}
- tuiSetLayout (new_layout, regs_type);
+ tui_set_layout (new_layout, regs_type);
}
return 0;
}
@@ -215,18 +215,18 @@ tui_rl_delete_other_windows (int notused1, int notused2)
static int
tui_rl_other_window (int count, int key)
{
- TuiWinInfoPtr winInfo;
+ struct tui_win_info * winInfo;
if (!tui_active)
tui_rl_switch_mode (0/*notused*/, 0/*notused*/);
- winInfo = tuiNextWin (tuiWinWithFocus ());
+ winInfo = tui_next_win (tui_win_with_focus ());
if (winInfo)
{
- tuiSetWinFocusTo (winInfo);
- if (dataWin && dataWin->generic.isVisible)
- tuiRefreshDataWin ();
- keypad (cmdWin->generic.handle, (winInfo != cmdWin));
+ tui_set_win_focus_to (winInfo);
+ if (TUI_DATA_WIN && TUI_DATA_WIN->generic.is_visible)
+ tui_refresh_data_win ();
+ keypad (TUI_CMD_WIN->generic.handle, (winInfo != TUI_CMD_WIN));
}
return 0;
}
@@ -261,7 +261,7 @@ tui_rl_command_key (int count, int key)
static int
tui_rl_command_mode (int count, int key)
{
- tui_set_key_mode (tui_one_command_mode);
+ tui_set_key_mode (TUI_ONE_COMMAND_MODE);
return rl_insert (count, key);
}
@@ -273,8 +273,8 @@ tui_rl_next_keymap (int notused1, int notused2)
if (!tui_active)
tui_rl_switch_mode (0/*notused*/, 0/*notused*/);
- tui_set_key_mode (tui_current_key_mode == tui_command_mode
- ? tui_single_key_mode : tui_command_mode);
+ tui_set_key_mode (tui_current_key_mode == TUI_COMMAND_MODE
+ ? TUI_SINGLE_KEY_MODE : TUI_COMMAND_MODE);
return 0;
}
@@ -286,8 +286,8 @@ static int
tui_rl_startup_hook ()
{
rl_already_prompted = 1;
- if (tui_current_key_mode != tui_command_mode)
- tui_set_key_mode (tui_single_key_mode);
+ if (tui_current_key_mode != TUI_COMMAND_MODE)
+ tui_set_key_mode (TUI_SINGLE_KEY_MODE);
tui_redisplay_readline ();
return 0;
}
@@ -297,9 +297,9 @@ void
tui_set_key_mode (enum tui_key_mode mode)
{
tui_current_key_mode = mode;
- rl_set_keymap (mode == tui_single_key_mode
+ rl_set_keymap (mode == TUI_SINGLE_KEY_MODE
? tui_keymap : tui_readline_standard_keymap);
- tuiShowLocatorContent ();
+ tui_show_locator_content ();
}
/* Initialize readline and configure the keymap for the switching
@@ -384,15 +384,15 @@ tui_enable (void)
nl();
keypad (w, TRUE);
rl_initialize ();
- setTermHeightTo (LINES);
- setTermWidthTo (COLS);
+ tui_set_term_height_to (LINES);
+ tui_set_term_width_to (COLS);
def_prog_mode ();
- tuiShowFrameInfo (0);
- tuiSetLayout (SRC_COMMAND, TUI_UNDEFINED_REGS);
- tuiSetWinFocusTo (srcWin);
- keypad (cmdWin->generic.handle, TRUE);
- wrefresh (cmdWin->generic.handle);
+ tui_show_frame_info (0);
+ tui_set_layout (SRC_COMMAND, TUI_UNDEFINED_REGS);
+ tui_set_win_focus_to (TUI_SRC_WIN);
+ keypad (TUI_CMD_WIN->generic.handle, TRUE);
+ wrefresh (TUI_CMD_WIN->generic.handle);
tui_finish_init = 0;
}
else
@@ -413,11 +413,11 @@ tui_enable (void)
tui_active = 1;
if (deprecated_selected_frame)
- tuiShowFrameInfo (deprecated_selected_frame);
+ tui_show_frame_info (deprecated_selected_frame);
/* Restore TUI keymap. */
tui_set_key_mode (tui_current_key_mode);
- tuiRefreshAll ();
+ tui_refresh_all_win ();
/* Update gdb's knowledge of its terminal. */
target_terminal_save_ours ();
@@ -456,17 +456,6 @@ tui_disable (void)
tui_update_gdb_sizes ();
}
-/* Wrapper on top of free() to ensure that input address
- is greater than 0x0. */
-void
-tuiFree (char *ptr)
-{
- if (ptr != (char *) NULL)
- {
- xfree (ptr);
- }
-}
-
void
strcat_to_buf (char *buf, int buflen, const char *itemToAdd)
{
@@ -563,40 +552,40 @@ tui_show_source (const char *file, int line)
{
struct symtab_and_line cursal = get_current_source_symtab_and_line ();
/* make sure that the source window is displayed */
- tuiAddWinToLayout (SRC_WIN);
+ tui_add_win_to_layout (SRC_WIN);
- tuiUpdateSourceWindowsWithLine (cursal.symtab, line);
- tuiUpdateLocatorFilename (file);
+ tui_update_source_windows_with_line (cursal.symtab, line);
+ tui_update_locator_filename (file);
}
void
tui_show_assembly (CORE_ADDR addr)
{
- tuiAddWinToLayout (DISASSEM_WIN);
- tuiUpdateSourceWindowsWithAddr (addr);
+ tui_add_win_to_layout (DISASSEM_WIN);
+ tui_update_source_windows_with_addr (addr);
}
int
-tui_is_window_visible (TuiWinType type)
+tui_is_window_visible (enum tui_win_type type)
{
if (tui_active == 0)
return 0;
- if (winList[type] == 0)
+ if (tui_win_list[type] == 0)
return 0;
- return winList[type]->generic.isVisible;
+ return tui_win_list[type]->generic.is_visible;
}
int
tui_get_command_dimension (int *width, int *height)
{
- if (!tui_active || !m_winPtrNotNull (cmdWin))
+ if (!tui_active || (TUI_CMD_WIN == NULL))
{
return 0;
}
- *width = cmdWin->generic.width;
- *height = cmdWin->generic.height;
+ *width = TUI_CMD_WIN->generic.width;
+ *height = TUI_CMD_WIN->generic.height;
return 1;
}
diff --git a/gdb/tui/tui.h b/gdb/tui/tui.h
index c627b86..9ba1a35 100644
--- a/gdb/tui/tui.h
+++ b/gdb/tui/tui.h
@@ -1,5 +1,8 @@
/* External/Public TUI Header File.
- Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+
+ Copyright 1998, 1999, 2000, 2001, 2004 Free Software Foundation,
+ Inc.
+
Contributed by Hewlett-Packard Company.
This file is part of GDB.
@@ -22,76 +25,46 @@
#ifndef TUI_H
#define TUI_H
-#include <stdarg.h>
-#include <string.h>
-#include "ansidecl.h"
-
-#if defined(reg)
-#undef reg
-#endif
-#if defined(chtype)
-#undef chtype
-#endif
-
struct ui_file;
-/* Opaque data type */
-typedef char *Opaque;
-typedef
-Opaque (*OpaqueFuncPtr) (va_list);
- typedef char **OpaqueList;
- typedef OpaqueList OpaquePtr;
-
-/* Generic function pointer */
- typedef void (*TuiVoidFuncPtr) (va_list);
- typedef int (*TuiIntFuncPtr) (va_list);
-/*
- typedef Opaque (*TuiOpaqueFuncPtr) (va_list);
- */
- typedef OpaqueFuncPtr TuiOpaqueFuncPtr;
-
extern void strcat_to_buf (char *, int, const char *);
-/* Types of error returns */
- typedef enum
- {
- TUI_SUCCESS,
- TUI_FAILURE
- }
-TuiStatus, *TuiStatusPtr;
+/* Types of error returns. */
+enum tui_status
+{
+ TUI_SUCCESS,
+ TUI_FAILURE
+};
/* Types of windows */
- typedef enum
- {
- SRC_WIN = 0,
- DISASSEM_WIN,
- DATA_WIN,
- CMD_WIN,
- /* This must ALWAYS be AFTER the major windows last */
- MAX_MAJOR_WINDOWS,
- /* auxillary windows */
- LOCATOR_WIN,
- EXEC_INFO_WIN,
- DATA_ITEM_WIN,
- /* This must ALWAYS be next to last */
- MAX_WINDOWS,
- UNDEFINED_WIN /* LAST */
- }
-TuiWinType, *TuiWinTypePtr;
-
-/* This is a point definition */
- typedef struct _TuiPoint
- {
- int x, y;
- }
-TuiPoint, *TuiPointPtr;
+enum tui_win_type
+{
+ SRC_WIN = 0,
+ DISASSEM_WIN,
+ DATA_WIN,
+ CMD_WIN,
+ /* This must ALWAYS be AFTER the major windows last. */
+ MAX_MAJOR_WINDOWS,
+ /* Auxillary windows. */
+ LOCATOR_WIN,
+ EXEC_INFO_WIN,
+ DATA_ITEM_WIN,
+ /* This must ALWAYS be next to last. */
+ MAX_WINDOWS,
+ UNDEFINED_WIN /* LAST */
+};
+
+/* This is a point definition. */
+struct tui_point
+{
+ int x, y;
+};
/* GENERAL TUI FUNCTIONS */
/* tui.c */
-extern void tuiFree (char *);
-extern CORE_ADDR tuiGetLowDisassemblyAddress (CORE_ADDR, CORE_ADDR);
+extern CORE_ADDR tui_get_low_disassembly_address (CORE_ADDR, CORE_ADDR);
extern void tui_show_assembly (CORE_ADDR addr);
-extern int tui_is_window_visible (TuiWinType type);
+extern int tui_is_window_visible (enum tui_win_type type);
extern int tui_get_command_dimension (int *width, int *height);
/* Initialize readline and configure the keymap for the switching
@@ -107,13 +80,13 @@ extern void tui_disable (void);
enum tui_key_mode
{
/* Plain command mode to enter gdb commands. */
- tui_command_mode,
+ TUI_COMMAND_MODE,
/* SingleKey mode with some keys bound to gdb commands. */
- tui_single_key_mode,
+ TUI_SINGLE_KEY_MODE,
/* Read/edit one command and return to SingleKey after it's processed. */
- tui_one_command_mode
+ TUI_ONE_COMMAND_MODE
};
extern enum tui_key_mode tui_current_key_mode;
@@ -134,10 +107,11 @@ extern void tui_show_source (const char *file, int line);
extern struct ui_out *tui_out_new (struct ui_file *stream);
-/* tuiLayout.c */
-extern TuiStatus tui_set_layout (const char *);
+/* tui-layout.c */
+extern enum tui_status tui_set_layout_for_display_command (const char *name);
-/* tuiSourceWin.c */
-extern void tuiUpdateAllExecInfos (void);
+/* tui-winsource.c */
+extern void tui_update_all_exec_infos (void);
+
+#endif
-#endif /* TUI_H */
diff --git a/gdb/tui/tuiCommand.c b/gdb/tui/tuiCommand.c
deleted file mode 100644
index 675b34c..0000000
--- a/gdb/tui/tuiCommand.c
+++ /dev/null
@@ -1,138 +0,0 @@
-/* Specific command window processing.
-
- Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation,
- Inc.
-
- Contributed by Hewlett-Packard Company.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include "defs.h"
-#include <ctype.h>
-#include "tui.h"
-#include "tuiData.h"
-#include "tuiWin.h"
-#include "tuiIO.h"
-
-#ifdef HAVE_NCURSES_H
-#include <ncurses.h>
-#else
-#ifdef HAVE_CURSES_H
-#include <curses.h>
-#endif
-#endif
-
-
-/*****************************************
-** STATIC LOCAL FUNCTIONS FORWARD DECLS **
-******************************************/
-
-
-
-/*****************************************
-** PUBLIC FUNCTIONS **
-******************************************/
-
-/*
- ** tuiDispatchCtrlChar().
- ** Dispatch the correct tui function based upon the control character.
- */
-unsigned int
-tuiDispatchCtrlChar (unsigned int ch)
-{
- TuiWinInfoPtr winInfo = tuiWinWithFocus ();
- WINDOW *w = cmdWin->generic.handle;
-
- /*
- ** If the command window has the logical focus, or no-one does
- ** assume it is the command window; in this case, pass the
- ** character on through and do nothing here.
- */
- if (winInfo == (TuiWinInfoPtr) NULL || winInfo == cmdWin)
- return ch;
- else
- {
- unsigned int c = 0, chCopy = ch;
- register int i;
- char *term;
-
- /* If this is an xterm, page next/prev keys aren't returned
- ** by keypad as a single char, so we must handle them here.
- ** Seems like a bug in the curses library?
- */
- term = (char *) getenv ("TERM");
- for (i = 0; (term && term[i]); i++)
- term[i] = toupper (term[i]);
- if ((strcmp (term, "XTERM") == 0) && m_isStartSequence (ch))
- {
- unsigned int pageCh = 0, tmpChar;
-
- tmpChar = 0;
- while (!m_isEndSequence (tmpChar))
- {
- tmpChar = (int) wgetch (w);
- if (tmpChar == ERR)
- {
- return ch;
- }
- if (!tmpChar)
- break;
- if (tmpChar == 53)
- pageCh = KEY_PPAGE;
- else if (tmpChar == 54)
- pageCh = KEY_NPAGE;
- else
- {
- return 0;
- }
- }
- chCopy = pageCh;
- }
-
- switch (chCopy)
- {
- case KEY_NPAGE:
- tuiScrollForward (winInfo, 0);
- break;
- case KEY_PPAGE:
- tuiScrollBackward (winInfo, 0);
- break;
- case KEY_DOWN:
- case KEY_SF:
- tuiScrollForward (winInfo, 1);
- break;
- case KEY_UP:
- case KEY_SR:
- tuiScrollBackward (winInfo, 1);
- break;
- case KEY_RIGHT:
- tuiScrollLeft (winInfo, 1);
- break;
- case KEY_LEFT:
- tuiScrollRight (winInfo, 1);
- break;
- case '\f':
- tuiRefreshAll ();
- break;
- default:
- c = chCopy;
- break;
- }
- return c;
- }
-}
diff --git a/gdb/tui/tuiCommand.h b/gdb/tui/tuiCommand.h
deleted file mode 100644
index 7afeb1b..0000000
--- a/gdb/tui/tuiCommand.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Specific command window processing.
- Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
- Contributed by Hewlett-Packard Company.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#ifndef _TUI_COMMAND_H
-#define _TUI_COMMAND_H
-/*
- ** This header file supports
- */
-
-
-/*****************************************
-** TYPE DEFINITIONS **
-******************************************/
-
-
-
-/*****************************************
-** PUBLIC FUNCTION EXTERNAL DECLS **
-******************************************/
-
-extern unsigned int tuiDispatchCtrlChar (unsigned int);
-
-#endif
-/*_TUI_COMMAND_H*/
diff --git a/gdb/tui/tuiData.c b/gdb/tui/tuiData.c
deleted file mode 100644
index 5acc33c..0000000
--- a/gdb/tui/tuiData.c
+++ /dev/null
@@ -1,1055 +0,0 @@
-/* TUI data manipulation routines.
-
- Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation,
- Inc.
-
- Contributed by Hewlett-Packard Company.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include "defs.h"
-#include "symtab.h"
-#include "tui.h"
-#include "tuiData.h"
-#include "tuiGeneralWin.h"
-
-#ifdef HAVE_NCURSES_H
-#include <ncurses.h>
-#else
-#ifdef HAVE_CURSES_H
-#include <curses.h>
-#endif
-#endif
-
-/****************************
-** GLOBAL DECLARATIONS
-****************************/
-TuiWinInfoPtr winList[MAX_MAJOR_WINDOWS];
-
-/***************************
-** Private data
-****************************/
-static TuiLayoutType _currentLayout = UNDEFINED_LAYOUT;
-static int _termHeight, _termWidth;
-static TuiGenWinInfo _locator;
-static TuiGenWinInfo _execInfo[2];
-static TuiWinInfoPtr _srcWinList[2];
-static TuiList _sourceWindows =
-{(OpaqueList) _srcWinList, 0};
-static int _defaultTabLen = DEFAULT_TAB_LEN;
-static TuiWinInfoPtr _winWithFocus = (TuiWinInfoPtr) NULL;
-static TuiLayoutDef _layoutDef =
-{SRC_WIN, /* displayMode */
- FALSE, /* split */
- TUI_UNDEFINED_REGS, /* regsDisplayType */
- TUI_SFLOAT_REGS}; /* floatRegsDisplayType */
-static int _winResized = FALSE;
-
-
-/*********************************
-** Static function forward decls
-**********************************/
-static void freeContent (TuiWinContent, int, TuiWinType);
-static void freeContentElements (TuiWinContent, int, TuiWinType);
-
-
-
-/*********************************
-** PUBLIC FUNCTIONS
-**********************************/
-
-/******************************************
-** ACCESSORS & MUTATORS FOR PRIVATE DATA
-******************************************/
-
-/*
- ** tuiWinResized().
- ** Answer a whether the terminal window has been resized or not
- */
-int
-tuiWinResized (void)
-{
- return _winResized;
-} /* tuiWinResized */
-
-
-/*
- ** tuiSetWinResized().
- ** Set a whether the terminal window has been resized or not
- */
-void
-tuiSetWinResizedTo (int resized)
-{
- _winResized = resized;
-
- return;
-} /* tuiSetWinResizedTo */
-
-
-/*
- ** tuiLayoutDef().
- ** Answer a pointer to the current layout definition
- */
-TuiLayoutDefPtr
-tuiLayoutDef (void)
-{
- return &_layoutDef;
-} /* tuiLayoutDef */
-
-
-/*
- ** tuiWinWithFocus().
- ** Answer the window with the logical focus
- */
-TuiWinInfoPtr
-tuiWinWithFocus (void)
-{
- return _winWithFocus;
-} /* tuiWinWithFocus */
-
-
-/*
- ** tuiSetWinWithFocus().
- ** Set the window that has the logical focus
- */
-void
-tuiSetWinWithFocus (TuiWinInfoPtr winInfo)
-{
- _winWithFocus = winInfo;
-
- return;
-} /* tuiSetWinWithFocus */
-
-
-/*
- ** tuiDefaultTabLen().
- ** Answer the length in chars, of tabs
- */
-int
-tuiDefaultTabLen (void)
-{
- return _defaultTabLen;
-} /* tuiDefaultTabLen */
-
-
-/*
- ** tuiSetDefaultTabLen().
- ** Set the length in chars, of tabs
- */
-void
-tuiSetDefaultTabLen (int len)
-{
- _defaultTabLen = len;
-
- return;
-} /* tuiSetDefaultTabLen */
-
-
-/*
- ** currentSourceWin()
- ** Accessor for the current source window. Usually there is only
- ** one source window (either source or disassembly), but both can
- ** be displayed at the same time.
- */
-TuiListPtr
-sourceWindows (void)
-{
- return &_sourceWindows;
-} /* currentSourceWindows */
-
-
-/*
- ** clearSourceWindows()
- ** Clear the list of source windows. Usually there is only one
- ** source window (either source or disassembly), but both can be
- ** displayed at the same time.
- */
-void
-clearSourceWindows (void)
-{
- _sourceWindows.list[0] = (Opaque) NULL;
- _sourceWindows.list[1] = (Opaque) NULL;
- _sourceWindows.count = 0;
-
- return;
-} /* currentSourceWindows */
-
-
-/*
- ** clearSourceWindowsDetail()
- ** Clear the pertinant detail in the source windows.
- */
-void
-clearSourceWindowsDetail (void)
-{
- int i;
-
- for (i = 0; i < (sourceWindows ())->count; i++)
- clearWinDetail ((TuiWinInfoPtr) (sourceWindows ())->list[i]);
-
- return;
-} /* currentSourceWindows */
-
-
-/*
- ** addSourceWindowToList().
- ** Add a window to the list of source windows. Usually there is
- ** only one source window (either source or disassembly), but
- ** both can be displayed at the same time.
- */
-void
-addToSourceWindows (TuiWinInfoPtr winInfo)
-{
- if (_sourceWindows.count < 2)
- _sourceWindows.list[_sourceWindows.count++] = (Opaque) winInfo;
-
- return;
-} /* addToSourceWindows */
-
-
-/*
- ** clearWinDetail()
- ** Clear the pertinant detail in the windows.
- */
-void
-clearWinDetail (TuiWinInfoPtr winInfo)
-{
- if (m_winPtrNotNull (winInfo))
- {
- switch (winInfo->generic.type)
- {
- case SRC_WIN:
- case DISASSEM_WIN:
- winInfo->detail.sourceInfo.startLineOrAddr.addr = 0;
- winInfo->detail.sourceInfo.horizontalOffset = 0;
- break;
- case CMD_WIN:
- winInfo->detail.commandInfo.curLine =
- winInfo->detail.commandInfo.curch = 0;
- break;
- case DATA_WIN:
- winInfo->detail.dataDisplayInfo.dataContent =
- (TuiWinContent) NULL;
- winInfo->detail.dataDisplayInfo.dataContentCount = 0;
- winInfo->detail.dataDisplayInfo.regsContent =
- (TuiWinContent) NULL;
- winInfo->detail.dataDisplayInfo.regsContentCount = 0;
- winInfo->detail.dataDisplayInfo.regsDisplayType =
- TUI_UNDEFINED_REGS;
- winInfo->detail.dataDisplayInfo.regsColumnCount = 1;
- winInfo->detail.dataDisplayInfo.displayRegs = FALSE;
- break;
- default:
- break;
- }
- }
-
- return;
-} /* clearWinDetail */
-
-
-/*
- ** sourceExecInfoPtr().
- ** Accessor for the source execution info ptr.
- */
-TuiGenWinInfoPtr
-sourceExecInfoWinPtr (void)
-{
- return &_execInfo[0];
-} /* sourceExecInfoWinPtr */
-
-
-/*
- ** disassemExecInfoPtr().
- ** Accessor for the disassem execution info ptr.
- */
-TuiGenWinInfoPtr
-disassemExecInfoWinPtr (void)
-{
- return &_execInfo[1];
-} /* disassemExecInfoWinPtr */
-
-
-/*
- ** locatorWinInfoPtr().
- ** Accessor for the locator win info. Answers a pointer to the
- ** static locator win info struct.
- */
-TuiGenWinInfoPtr
-locatorWinInfoPtr (void)
-{
- return &_locator;
-} /* locatorWinInfoPtr */
-
-
-/*
- ** termHeight().
- ** Accessor for the termHeight
- */
-int
-termHeight (void)
-{
- return _termHeight;
-} /* termHeight */
-
-
-/*
- ** setTermHeightTo().
- ** Mutator for the term height
- */
-void
-setTermHeightTo (int h)
-{
- _termHeight = h;
-
- return;
-} /* setTermHeightTo */
-
-
-/*
- ** termWidth().
- ** Accessor for the termWidth
- */
-int
-termWidth (void)
-{
- return _termWidth;
-} /* termWidth */
-
-
-/*
- ** setTermWidth().
- ** Mutator for the termWidth
- */
-void
-setTermWidthTo (int w)
-{
- _termWidth = w;
-
- return;
-} /* setTermWidthTo */
-
-
-/*
- ** currentLayout().
- ** Accessor for the current layout
- */
-TuiLayoutType
-currentLayout (void)
-{
- return _currentLayout;
-} /* currentLayout */
-
-
-/*
- ** setCurrentLayoutTo().
- ** Mutator for the current layout
- */
-void
-setCurrentLayoutTo (TuiLayoutType newLayout)
-{
- _currentLayout = newLayout;
-
- return;
-} /* setCurrentLayoutTo */
-
-
-/*
- ** setGenWinOrigin().
- ** Set the origin of the window
- */
-void
-setGenWinOrigin (TuiGenWinInfoPtr winInfo, int x, int y)
-{
- winInfo->origin.x = x;
- winInfo->origin.y = y;
-
- return;
-} /* setGenWinOrigin */
-
-
-/*****************************
-** OTHER PUBLIC FUNCTIONS
-*****************************/
-
-
-/*
- ** tuiNextWin().
- ** Answer the next window in the list, cycling back to the top
- ** if necessary
- */
-TuiWinInfoPtr
-tuiNextWin (TuiWinInfoPtr curWin)
-{
- TuiWinType type = curWin->generic.type;
- TuiWinInfoPtr nextWin = (TuiWinInfoPtr) NULL;
-
- if (curWin->generic.type == CMD_WIN)
- type = SRC_WIN;
- else
- type = curWin->generic.type + 1;
- while (type != curWin->generic.type && m_winPtrIsNull (nextWin))
- {
- if (winList[type] && winList[type]->generic.isVisible)
- nextWin = winList[type];
- else
- {
- if (type == CMD_WIN)
- type = SRC_WIN;
- else
- type++;
- }
- }
-
- return nextWin;
-} /* tuiNextWin */
-
-
-/*
- ** tuiPrevWin().
- ** Answer the prev window in the list, cycling back to the bottom
- ** if necessary
- */
-TuiWinInfoPtr
-tuiPrevWin (TuiWinInfoPtr curWin)
-{
- TuiWinType type = curWin->generic.type;
- TuiWinInfoPtr prev = (TuiWinInfoPtr) NULL;
-
- if (curWin->generic.type == SRC_WIN)
- type = CMD_WIN;
- else
- type = curWin->generic.type - 1;
- while (type != curWin->generic.type && m_winPtrIsNull (prev))
- {
- if (winList[type]->generic.isVisible)
- prev = winList[type];
- else
- {
- if (type == SRC_WIN)
- type = CMD_WIN;
- else
- type--;
- }
- }
-
- return prev;
-}
-
-
-/*
- ** partialWinByName().
- ** Answer the window represented by name
- */
-TuiWinInfoPtr
-partialWinByName (char *name)
-{
- TuiWinInfoPtr winInfo = (TuiWinInfoPtr) NULL;
-
- if (name != (char *) NULL)
- {
- int i = 0;
-
- while (i < MAX_MAJOR_WINDOWS && m_winPtrIsNull (winInfo))
- {
- if (winList[i] != 0)
- {
- char *curName = winName (&winList[i]->generic);
- if (strlen (name) <= strlen (curName) &&
- strncmp (name, curName, strlen (name)) == 0)
- winInfo = winList[i];
- }
- i++;
- }
- }
-
- return winInfo;
-} /* partialWinByName */
-
-
-/*
- ** winName().
- ** Answer the name of the window
- */
-char *
-winName (TuiGenWinInfoPtr winInfo)
-{
- char *name = (char *) NULL;
-
- switch (winInfo->type)
- {
- case SRC_WIN:
- name = SRC_NAME;
- break;
- case CMD_WIN:
- name = CMD_NAME;
- break;
- case DISASSEM_WIN:
- name = DISASSEM_NAME;
- break;
- case DATA_WIN:
- name = DATA_NAME;
- break;
- default:
- name = "";
- break;
- }
-
- return name;
-} /* winName */
-
-
-/*
- ** initializeStaticData
- */
-void
-initializeStaticData (void)
-{
- initGenericPart (sourceExecInfoWinPtr ());
- initGenericPart (disassemExecInfoWinPtr ());
- initGenericPart (locatorWinInfoPtr ());
-
- return;
-} /* initializeStaticData */
-
-
-/*
- ** allocGenericWinInfo().
- */
-TuiGenWinInfoPtr
-allocGenericWinInfo (void)
-{
- TuiGenWinInfoPtr win;
-
- if ((win = (TuiGenWinInfoPtr) xmalloc (
- sizeof (TuiGenWinInfoPtr))) != (TuiGenWinInfoPtr) NULL)
- initGenericPart (win);
-
- return win;
-} /* allocGenericWinInfo */
-
-
-/*
- ** initGenericPart().
- */
-void
-initGenericPart (TuiGenWinInfoPtr win)
-{
- win->width =
- win->height =
- win->origin.x =
- win->origin.y =
- win->viewportHeight =
- win->contentSize =
- win->lastVisibleLine = 0;
- win->handle = (WINDOW *) NULL;
- win->content = (OpaquePtr) NULL;
- win->contentInUse =
- win->isVisible = FALSE;
- win->title = 0;
-}
-
-
-/*
- ** initContentElement().
- */
-void
-initContentElement (TuiWinElementPtr element, TuiWinType type)
-{
- element->highlight = FALSE;
- switch (type)
- {
- case SRC_WIN:
- case DISASSEM_WIN:
- element->whichElement.source.line = (char *) NULL;
- element->whichElement.source.lineOrAddr.lineNo = 0;
- element->whichElement.source.isExecPoint = FALSE;
- element->whichElement.source.hasBreak = FALSE;
- break;
- case DATA_WIN:
- initGenericPart (&element->whichElement.dataWindow);
- element->whichElement.dataWindow.type = DATA_ITEM_WIN;
- ((TuiGenWinInfoPtr) & element->whichElement.dataWindow)->content =
- (OpaquePtr) allocContent (1, DATA_ITEM_WIN);
- ((TuiGenWinInfoPtr)
- & element->whichElement.dataWindow)->contentSize = 1;
- break;
- case CMD_WIN:
- element->whichElement.command.line = (char *) NULL;
- break;
- case DATA_ITEM_WIN:
- element->whichElement.data.name = (char *) NULL;
- element->whichElement.data.type = TUI_REGISTER;
- element->whichElement.data.itemNo = UNDEFINED_ITEM;
- element->whichElement.data.value = (Opaque) NULL;
- element->whichElement.data.highlight = FALSE;
- break;
- case LOCATOR_WIN:
- element->whichElement.locator.fileName[0] =
- element->whichElement.locator.procName[0] = (char) 0;
- element->whichElement.locator.lineNo = 0;
- element->whichElement.locator.addr = 0;
- break;
- case EXEC_INFO_WIN:
- memset(element->whichElement.simpleString, ' ',
- sizeof(element->whichElement.simpleString));
- break;
- default:
- break;
- }
- return;
-} /* initContentElement */
-
-/*
- ** initWinInfo().
- */
-void
-initWinInfo (TuiWinInfoPtr winInfo)
-{
- initGenericPart (&winInfo->generic);
- winInfo->canHighlight =
- winInfo->isHighlighted = FALSE;
- switch (winInfo->generic.type)
- {
- case SRC_WIN:
- case DISASSEM_WIN:
- winInfo->detail.sourceInfo.executionInfo = (TuiGenWinInfoPtr) NULL;
- winInfo->detail.sourceInfo.hasLocator = FALSE;
- winInfo->detail.sourceInfo.horizontalOffset = 0;
- winInfo->detail.sourceInfo.startLineOrAddr.addr = 0;
- winInfo->detail.sourceInfo.filename = 0;
- break;
- case DATA_WIN:
- winInfo->detail.dataDisplayInfo.dataContent = (TuiWinContent) NULL;
- winInfo->detail.dataDisplayInfo.dataContentCount = 0;
- winInfo->detail.dataDisplayInfo.regsContent = (TuiWinContent) NULL;
- winInfo->detail.dataDisplayInfo.regsContentCount = 0;
- winInfo->detail.dataDisplayInfo.regsDisplayType =
- TUI_UNDEFINED_REGS;
- winInfo->detail.dataDisplayInfo.regsColumnCount = 1;
- winInfo->detail.dataDisplayInfo.displayRegs = FALSE;
- break;
- case CMD_WIN:
- winInfo->detail.commandInfo.curLine = 0;
- winInfo->detail.commandInfo.curch = 0;
- break;
- default:
- winInfo->detail.opaque = (Opaque) NULL;
- break;
- }
-
- return;
-} /* initWinInfo */
-
-
-/*
- ** allocWinInfo().
- */
-TuiWinInfoPtr
-allocWinInfo (TuiWinType type)
-{
- TuiWinInfoPtr winInfo = (TuiWinInfoPtr) NULL;
-
- winInfo = (TuiWinInfoPtr) xmalloc (sizeof (TuiWinInfo));
- if (m_winPtrNotNull (winInfo))
- {
- winInfo->generic.type = type;
- initWinInfo (winInfo);
- }
-
- return winInfo;
-} /* allocWinInfo */
-
-
-/*
- ** allocContent().
- ** Allocates the content and elements in a block.
- */
-TuiWinContent
-allocContent (int numElements, TuiWinType type)
-{
- TuiWinContent content = (TuiWinContent) NULL;
- char *elementBlockPtr = (char *) NULL;
- int i;
-
- if ((content = (TuiWinContent)
- xmalloc (sizeof (TuiWinElementPtr) * numElements)) != (TuiWinContent) NULL)
- { /*
- ** All windows, except the data window, can allocate the elements
- ** in a chunk. The data window cannot because items can be
- ** added/removed from the data display by the user at any time.
- */
- if (type != DATA_WIN)
- {
- if ((elementBlockPtr = (char *)
- xmalloc (sizeof (TuiWinElement) * numElements)) != (char *) NULL)
- {
- for (i = 0; i < numElements; i++)
- {
- content[i] = (TuiWinElementPtr) elementBlockPtr;
- initContentElement (content[i], type);
- elementBlockPtr += sizeof (TuiWinElement);
- }
- }
- else
- {
- tuiFree ((char *) content);
- content = (TuiWinContent) NULL;
- }
- }
- }
-
- return content;
-} /* allocContent */
-
-
-/*
- ** addContentElements().
- ** Adds the input number of elements to the windows's content. If
- ** no content has been allocated yet, allocContent() is called to
- ** do this. The index of the first element added is returned,
- ** unless there is a memory allocation error, in which case, (-1)
- ** is returned.
- */
-int
-addContentElements (TuiGenWinInfoPtr winInfo, int numElements)
-{
- TuiWinElementPtr elementPtr;
- int i, indexStart;
-
- if (winInfo->content == (OpaquePtr) NULL)
- {
- winInfo->content = (OpaquePtr) allocContent (numElements, winInfo->type);
- indexStart = 0;
- }
- else
- indexStart = winInfo->contentSize;
- if (winInfo->content != (OpaquePtr) NULL)
- {
- for (i = indexStart; (i < numElements + indexStart); i++)
- {
- if ((elementPtr = (TuiWinElementPtr)
- xmalloc (sizeof (TuiWinElement))) != (TuiWinElementPtr) NULL)
- {
- winInfo->content[i] = (Opaque) elementPtr;
- initContentElement (elementPtr, winInfo->type);
- winInfo->contentSize++;
- }
- else /* things must be really hosed now! We ran out of memory!? */
- return (-1);
- }
- }
-
- return indexStart;
-} /* addContentElements */
-
-
-/* Delete all curses windows associated with winInfo, leaving everything
- else intact. */
-void
-tuiDelWindow (TuiWinInfoPtr winInfo)
-{
- TuiGenWinInfoPtr genericWin;
-
- switch (winInfo->generic.type)
- {
- case SRC_WIN:
- case DISASSEM_WIN:
- genericWin = locatorWinInfoPtr ();
- if (genericWin != (TuiGenWinInfoPtr) NULL)
- {
- tuiDelwin (genericWin->handle);
- genericWin->handle = (WINDOW *) NULL;
- genericWin->isVisible = FALSE;
- }
- if (winInfo->detail.sourceInfo.filename)
- {
- xfree (winInfo->detail.sourceInfo.filename);
- winInfo->detail.sourceInfo.filename = 0;
- }
- genericWin = winInfo->detail.sourceInfo.executionInfo;
- if (genericWin != (TuiGenWinInfoPtr) NULL)
- {
- tuiDelwin (genericWin->handle);
- genericWin->handle = (WINDOW *) NULL;
- genericWin->isVisible = FALSE;
- }
- break;
- case DATA_WIN:
- if (winInfo->generic.content != (OpaquePtr) NULL)
- {
- tuiDelDataWindows (winInfo->detail.dataDisplayInfo.regsContent,
- winInfo->detail.dataDisplayInfo.regsContentCount);
- tuiDelDataWindows (winInfo->detail.dataDisplayInfo.dataContent,
- winInfo->detail.dataDisplayInfo.dataContentCount);
- }
- break;
- default:
- break;
- }
- if (winInfo->generic.handle != (WINDOW *) NULL)
- {
- tuiDelwin (winInfo->generic.handle);
- winInfo->generic.handle = (WINDOW *) NULL;
- winInfo->generic.isVisible = FALSE;
- }
-}
-
-
-/*
- ** freeWindow().
- */
-void
-freeWindow (TuiWinInfoPtr winInfo)
-{
- TuiGenWinInfoPtr genericWin;
-
- switch (winInfo->generic.type)
- {
- case SRC_WIN:
- case DISASSEM_WIN:
- genericWin = locatorWinInfoPtr ();
- if (genericWin != (TuiGenWinInfoPtr) NULL)
- {
- tuiDelwin (genericWin->handle);
- genericWin->handle = (WINDOW *) NULL;
- }
- freeWinContent (genericWin);
- if (winInfo->detail.sourceInfo.filename)
- {
- xfree (winInfo->detail.sourceInfo.filename);
- winInfo->detail.sourceInfo.filename = 0;
- }
- genericWin = winInfo->detail.sourceInfo.executionInfo;
- if (genericWin != (TuiGenWinInfoPtr) NULL)
- {
- tuiDelwin (genericWin->handle);
- genericWin->handle = (WINDOW *) NULL;
- freeWinContent (genericWin);
- }
- break;
- case DATA_WIN:
- if (winInfo->generic.content != (OpaquePtr) NULL)
- {
- freeDataContent (
- winInfo->detail.dataDisplayInfo.regsContent,
- winInfo->detail.dataDisplayInfo.regsContentCount);
- winInfo->detail.dataDisplayInfo.regsContent =
- (TuiWinContent) NULL;
- winInfo->detail.dataDisplayInfo.regsContentCount = 0;
- freeDataContent (
- winInfo->detail.dataDisplayInfo.dataContent,
- winInfo->detail.dataDisplayInfo.dataContentCount);
- winInfo->detail.dataDisplayInfo.dataContent =
- (TuiWinContent) NULL;
- winInfo->detail.dataDisplayInfo.dataContentCount = 0;
- winInfo->detail.dataDisplayInfo.regsDisplayType =
- TUI_UNDEFINED_REGS;
- winInfo->detail.dataDisplayInfo.regsColumnCount = 1;
- winInfo->detail.dataDisplayInfo.displayRegs = FALSE;
- winInfo->generic.content = (OpaquePtr) NULL;
- winInfo->generic.contentSize = 0;
- }
- break;
- default:
- break;
- }
- if (winInfo->generic.handle != (WINDOW *) NULL)
- {
- tuiDelwin (winInfo->generic.handle);
- winInfo->generic.handle = (WINDOW *) NULL;
- freeWinContent (&winInfo->generic);
- }
- if (winInfo->generic.title)
- xfree (winInfo->generic.title);
- xfree (winInfo);
-}
-
-
-/*
- ** freeAllSourceWinsContent().
- */
-void
-freeAllSourceWinsContent (void)
-{
- int i;
-
- for (i = 0; i < (sourceWindows ())->count; i++)
- {
- TuiWinInfoPtr winInfo = (TuiWinInfoPtr) (sourceWindows ())->list[i];
-
- if (m_winPtrNotNull (winInfo))
- {
- freeWinContent (&(winInfo->generic));
- freeWinContent (winInfo->detail.sourceInfo.executionInfo);
- }
- }
-
- return;
-} /* freeAllSourceWinsContent */
-
-
-/*
- ** freeWinContent().
- */
-void
-freeWinContent (TuiGenWinInfoPtr winInfo)
-{
- if (winInfo->content != (OpaquePtr) NULL)
- {
- freeContent ((TuiWinContent) winInfo->content,
- winInfo->contentSize,
- winInfo->type);
- winInfo->content = (OpaquePtr) NULL;
- }
- winInfo->contentSize = 0;
-
- return;
-} /* freeWinContent */
-
-
-void
-tuiDelDataWindows (TuiWinContent content, int contentSize)
-{
- int i;
-
- /*
- ** Remember that data window content elements are of type TuiGenWinInfoPtr,
- ** each of which whose single element is a data element.
- */
- for (i = 0; i < contentSize; i++)
- {
- TuiGenWinInfoPtr genericWin = &content[i]->whichElement.dataWindow;
-
- if (genericWin != (TuiGenWinInfoPtr) NULL)
- {
- tuiDelwin (genericWin->handle);
- genericWin->handle = (WINDOW *) NULL;
- genericWin->isVisible = FALSE;
- }
- }
-
- return;
-} /* tuiDelDataWindows */
-
-
-void
-freeDataContent (TuiWinContent content, int contentSize)
-{
- int i;
-
- /*
- ** Remember that data window content elements are of type TuiGenWinInfoPtr,
- ** each of which whose single element is a data element.
- */
- for (i = 0; i < contentSize; i++)
- {
- TuiGenWinInfoPtr genericWin = &content[i]->whichElement.dataWindow;
-
- if (genericWin != (TuiGenWinInfoPtr) NULL)
- {
- tuiDelwin (genericWin->handle);
- genericWin->handle = (WINDOW *) NULL;
- freeWinContent (genericWin);
- }
- }
- freeContent (content,
- contentSize,
- DATA_WIN);
-
- return;
-} /* freeDataContent */
-
-
-/**********************************
-** LOCAL STATIC FUNCTIONS **
-**********************************/
-
-
-/*
- ** freeContent().
- */
-static void
-freeContent (TuiWinContent content, int contentSize, TuiWinType winType)
-{
- if (content != (TuiWinContent) NULL)
- {
- freeContentElements (content, contentSize, winType);
- tuiFree ((char *) content);
- }
-
- return;
-} /* freeContent */
-
-
-/*
- ** freeContentElements().
- */
-static void
-freeContentElements (TuiWinContent content, int contentSize, TuiWinType type)
-{
- if (content != (TuiWinContent) NULL)
- {
- int i;
-
- if (type == SRC_WIN || type == DISASSEM_WIN)
- {
- /* free whole source block */
- if (content[0]->whichElement.source.line != (char *) NULL)
- tuiFree (content[0]->whichElement.source.line);
- }
- else
- {
- for (i = 0; i < contentSize; i++)
- {
- TuiWinElementPtr element;
-
- element = content[i];
- if (element != (TuiWinElementPtr) NULL)
- {
- switch (type)
- {
- case DATA_WIN:
- tuiFree ((char *) element);
- break;
- case DATA_ITEM_WIN:
- /*
- ** Note that data elements are not allocated
- ** in a single block, but individually, as needed.
- */
- if (element->whichElement.data.type != TUI_REGISTER)
- tuiFree ((char *)
- element->whichElement.data.name);
- tuiFree ((char *) element->whichElement.data.value);
- tuiFree ((char *) element);
- break;
- case CMD_WIN:
- tuiFree ((char *) element->whichElement.command.line);
- break;
- default:
- break;
- }
- }
- }
- }
- if (type != DATA_WIN && type != DATA_ITEM_WIN)
- tuiFree ((char *) content[0]); /* free the element block */
- }
-
- return;
-} /* freeContentElements */
diff --git a/gdb/tui/tuiData.h b/gdb/tui/tuiData.h
deleted file mode 100644
index 6fcf875..0000000
--- a/gdb/tui/tuiData.h
+++ /dev/null
@@ -1,383 +0,0 @@
-/* TUI data manipulation routines.
- Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
- Contributed by Hewlett-Packard Company.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#ifndef TUI_DATA_H
-#define TUI_DATA_H
-
-#if defined (HAVE_NCURSES_H)
-#include <ncurses.h>
-#elif defined (HAVE_CURSES_H)
-#include <curses.h>
-#endif
-
-/* Generic window information */
- typedef struct _TuiGenWinInfo
- {
- WINDOW *handle; /* window handle */
- TuiWinType type; /* type of window */
- int width; /* window width */
- int height; /* window height */
- TuiPoint origin; /* origin of window */
- OpaquePtr content; /* content of window */
- int contentSize; /* Size of content (# of elements) */
- int contentInUse; /* Can it be used, or is it already used? */
- int viewportHeight; /* viewport height */
- int lastVisibleLine; /* index of last visible line */
- int isVisible; /* whether the window is visible or not */
- char* title; /* Window title to display. */
- }
-TuiGenWinInfo, *TuiGenWinInfoPtr;
-
-/* Constant definitions */
-#define DEFAULT_TAB_LEN 8
-#define NO_SRC_STRING "[ No Source Available ]"
-#define NO_DISASSEM_STRING "[ No Assembly Available ]"
-#define NO_REGS_STRING "[ Register Values Unavailable ]"
-#define NO_DATA_STRING "[ No Data Values Displayed ]"
-#define MAX_CONTENT_COUNT 100
-#define SRC_NAME "SRC"
-#define CMD_NAME "CMD"
-#define DATA_NAME "REGS"
-#define DISASSEM_NAME "ASM"
-#define TUI_NULL_STR ""
-#define DEFAULT_HISTORY_COUNT 25
-#define BOX_WINDOW TRUE
-#define DONT_BOX_WINDOW FALSE
-#define HILITE TRUE
-#define NO_HILITE FALSE
-#define WITH_LOCATOR TRUE
-#define NO_LOCATOR FALSE
-#define EMPTY_SOURCE_PROMPT TRUE
-#define NO_EMPTY_SOURCE_PROMPT FALSE
-#define UNDEFINED_ITEM -1
-#define MIN_WIN_HEIGHT 3
-#define MIN_CMD_WIN_HEIGHT 3
-
-/* Strings to display in the TUI status line. */
-#define PROC_PREFIX "In: "
-#define LINE_PREFIX "Line: "
-#define PC_PREFIX "PC: "
-#define SINGLE_KEY "(SingleKey)"
-
-/* Minimum/Maximum length of some fields displayed in the TUI status line. */
-#define MIN_LINE_WIDTH 4 /* Use at least 4 digits for line numbers. */
-#define MIN_PROC_WIDTH 12
-#define MAX_TARGET_WIDTH 10
-#define MAX_PID_WIDTH 14
-
-#define TUI_FLOAT_REGS_NAME "$FREGS"
-#define TUI_FLOAT_REGS_NAME_LOWER "$fregs"
-#define TUI_GENERAL_REGS_NAME "$GREGS"
-#define TUI_GENERAL_REGS_NAME_LOWER "$gregs"
-#define TUI_SPECIAL_REGS_NAME "$SREGS"
-#define TUI_SPECIAL_REGS_NAME_LOWER "$sregs"
-#define TUI_GENERAL_SPECIAL_REGS_NAME "$REGS"
-#define TUI_GENERAL_SPECIAL_REGS_NAME_LOWER "$regs"
-
-/* Scroll direction enum */
-typedef enum
- {
- FORWARD_SCROLL,
- BACKWARD_SCROLL,
- LEFT_SCROLL,
- RIGHT_SCROLL
- }
-TuiScrollDirection, *TuiScrollDirectionPtr;
-
-
-/* General list struct */
-typedef struct _TuiList
- {
- OpaqueList list;
- int count;
- }
-TuiList, *TuiListPtr;
-
-
-/* The kinds of layouts available */
-typedef enum
- {
- SRC_COMMAND,
- DISASSEM_COMMAND,
- SRC_DISASSEM_COMMAND,
- SRC_DATA_COMMAND,
- DISASSEM_DATA_COMMAND,
- UNDEFINED_LAYOUT
- }
-TuiLayoutType, *TuiLayoutTypePtr;
-
-/* Basic data types that can be displayed in the data window. */
-typedef enum _TuiDataType
- {
- TUI_REGISTER,
- TUI_SCALAR,
- TUI_COMPLEX,
- TUI_STRUCT
- }
-TuiDataType, TuiDataTypePtr;
-
-/* Types of register displays */
-typedef enum _TuiRegisterDisplayType
- {
- TUI_UNDEFINED_REGS,
- TUI_GENERAL_REGS,
- TUI_SFLOAT_REGS,
- TUI_DFLOAT_REGS,
- TUI_SPECIAL_REGS,
- TUI_GENERAL_AND_SPECIAL_REGS
- }
-TuiRegisterDisplayType, *TuiRegisterDisplayTypePtr;
-
-/* Structure describing source line or line address */
-typedef union _TuiLineOrAddress
- {
- int lineNo;
- CORE_ADDR addr;
- }
-TuiLineOrAddress, *TuiLineOrAddressPtr;
-
-/* Current Layout definition */
-typedef struct _TuiLayoutDef
- {
- TuiWinType displayMode;
- int split;
- TuiRegisterDisplayType regsDisplayType;
- TuiRegisterDisplayType floatRegsDisplayType;
- }
-TuiLayoutDef, *TuiLayoutDefPtr;
-
-/* Elements in the Source/Disassembly Window */
-typedef struct _TuiSourceElement
- {
- char *line;
- TuiLineOrAddress lineOrAddr;
- int isExecPoint;
- int hasBreak;
- }
-TuiSourceElement, *TuiSourceElementPtr;
-
-
-/* Elements in the data display window content */
-typedef struct _TuiDataElement
- {
- const char *name;
- int itemNo; /* the register number, or data display number */
- TuiDataType type;
- Opaque value;
- int highlight;
- }
-TuiDataElement, *TuiDataElementPtr;
-
-
-/* Elements in the command window content */
-typedef struct _TuiCommandElement
- {
- char *line;
- }
-TuiCommandElement, *TuiCommandElementPtr;
-
-
-#define MAX_LOCATOR_ELEMENT_LEN 100
-
-/* Elements in the locator window content */
-typedef struct _TuiLocatorElement
- {
- char fileName[MAX_LOCATOR_ELEMENT_LEN];
- char procName[MAX_LOCATOR_ELEMENT_LEN];
- int lineNo;
- CORE_ADDR addr;
- }
-TuiLocatorElement, *TuiLocatorElementPtr;
-
-/* Flags to tell what kind of breakpoint is at current line. */
-#define TUI_BP_ENABLED 0x01
-#define TUI_BP_DISABLED 0x02
-#define TUI_BP_HIT 0x04
-#define TUI_BP_CONDITIONAL 0x08
-#define TUI_BP_HARDWARE 0x10
-
-/* Position of breakpoint markers in the exec info string. */
-#define TUI_BP_HIT_POS 0
-#define TUI_BP_BREAK_POS 1
-#define TUI_EXEC_POS 2
-#define TUI_EXECINFO_SIZE 4
-
-typedef char TuiExecInfoContent[TUI_EXECINFO_SIZE];
-
-/* An content element in a window */
-typedef union
- {
- TuiSourceElement source; /* the source elements */
- TuiGenWinInfo dataWindow; /* data display elements */
- TuiDataElement data; /* elements of dataWindow */
- TuiCommandElement command; /* command elements */
- TuiLocatorElement locator; /* locator elements */
- TuiExecInfoContent simpleString; /* simple char based elements */
- }
-TuiWhichElement, *TuiWhichElementPtr;
-
-typedef struct _TuiWinElement
- {
- int highlight;
- TuiWhichElement whichElement;
- }
-TuiWinElement, *TuiWinElementPtr;
-
-
-/* This describes the content of the window. */
-typedef TuiWinElementPtr *TuiWinContent;
-
-
-/* This struct defines the specific information about a data display window */
-typedef struct _TuiDataInfo
- {
- TuiWinContent dataContent; /* start of data display content */
- int dataContentCount;
- TuiWinContent regsContent; /* start of regs display content */
- int regsContentCount;
- TuiRegisterDisplayType regsDisplayType;
- int regsColumnCount;
- int displayRegs; /* Should regs be displayed at all? */
- }
-TuiDataInfo, *TuiDataInfoPtr;
-
-
-typedef struct _TuiSourceInfo
- {
- int hasLocator; /* Does locator belongs to this window? */
- TuiGenWinInfoPtr executionInfo; /* execution information window */
- int horizontalOffset; /* used for horizontal scroll */
- TuiLineOrAddress startLineOrAddr;
- char* filename;
- }
-TuiSourceInfo, *TuiSourceInfoPtr;
-
-
-typedef struct _TuiCommandInfo
- {
- int curLine; /* The current line position */
- int curch; /* The current cursor position */
- int start_line;
- }
-TuiCommandInfo, *TuiCommandInfoPtr;
-
-
-/* This defines information about each logical window */
-typedef struct _TuiWinInfo
- {
- TuiGenWinInfo generic; /* general window information */
- union
- {
- TuiSourceInfo sourceInfo;
- TuiDataInfo dataDisplayInfo;
- TuiCommandInfo commandInfo;
- Opaque opaque;
- }
- detail;
- int canHighlight; /* Can this window ever be highlighted? */
- int isHighlighted; /* Is this window highlighted? */
- }
-TuiWinInfo, *TuiWinInfoPtr;
-
-/* MACROS (prefixed with m_) */
-
-/* Testing macros */
-#define m_genWinPtrIsNull(winInfo) \
- ((winInfo) == (TuiGenWinInfoPtr)NULL)
-#define m_genWinPtrNotNull(winInfo) \
- ((winInfo) != (TuiGenWinInfoPtr)NULL)
-#define m_winPtrIsNull(winInfo) \
- ((winInfo) == (TuiWinInfoPtr)NULL)
-#define m_winPtrNotNull(winInfo) \
- ((winInfo) != (TuiWinInfoPtr)NULL)
-
-#define m_winIsSourceType(type) \
- (type == SRC_WIN || type == DISASSEM_WIN)
-#define m_winIsAuxillary(winType) \
- (winType > MAX_MAJOR_WINDOWS)
-#define m_hasLocator(winInfo) \
- ( ((winInfo) != (TuiWinInfoPtr)NULL) ? \
- (winInfo->detail.sourceInfo.hasLocator) : \
- FALSE )
-
-#define m_setWinHighlightOn(winInfo) \
- if ((winInfo) != (TuiWinInfoPtr)NULL) \
- (winInfo)->isHighlighted = TRUE
-#define m_setWinHighlightOff(winInfo) \
- if ((winInfo) != (TuiWinInfoPtr)NULL) \
- (winInfo)->isHighlighted = FALSE
-
-
-/* Global Data */
-extern TuiWinInfoPtr winList[MAX_MAJOR_WINDOWS];
-
-/* Macros */
-#define srcWin winList[SRC_WIN]
-#define disassemWin winList[DISASSEM_WIN]
-#define dataWin winList[DATA_WIN]
-#define cmdWin winList[CMD_WIN]
-
-/* Data Manipulation Functions */
-extern void initializeStaticData (void);
-extern TuiGenWinInfoPtr allocGenericWinInfo (void);
-extern TuiWinInfoPtr allocWinInfo (TuiWinType);
-extern void initGenericPart (TuiGenWinInfoPtr);
-extern void initWinInfo (TuiWinInfoPtr);
-extern TuiWinContent allocContent (int, TuiWinType);
-extern int addContentElements (TuiGenWinInfoPtr, int);
-extern void initContentElement (TuiWinElementPtr, TuiWinType);
-extern void freeWindow (TuiWinInfoPtr);
-extern void freeWinContent (TuiGenWinInfoPtr);
-extern void freeDataContent (TuiWinContent, int);
-extern void freeAllSourceWinsContent (void);
-extern void tuiDelWindow (TuiWinInfoPtr);
-extern void tuiDelDataWindows (TuiWinContent, int);
-extern TuiWinInfoPtr partialWinByName (char *);
-extern char *winName (TuiGenWinInfoPtr);
-extern TuiLayoutType currentLayout (void);
-extern void setCurrentLayoutTo (TuiLayoutType);
-extern int termHeight (void);
-extern void setTermHeightTo (int);
-extern int termWidth (void);
-extern void setTermWidthTo (int);
-extern void setGenWinOrigin (TuiGenWinInfoPtr, int, int);
-extern TuiGenWinInfoPtr locatorWinInfoPtr (void);
-extern TuiGenWinInfoPtr sourceExecInfoWinPtr (void);
-extern TuiGenWinInfoPtr disassemExecInfoWinPtr (void);
-extern TuiListPtr sourceWindows (void);
-extern void clearSourceWindows (void);
-extern void clearSourceWindowsDetail (void);
-extern void clearWinDetail (TuiWinInfoPtr winInfo);
-extern void tuiAddToSourceWindows (TuiWinInfoPtr);
-extern int tuiDefaultTabLen (void);
-extern void tuiSetDefaultTabLen (int);
-extern TuiWinInfoPtr tuiWinWithFocus (void);
-extern void tuiSetWinWithFocus (TuiWinInfoPtr);
-extern TuiLayoutDefPtr tuiLayoutDef (void);
-extern int tuiWinResized (void);
-extern void tuiSetWinResizedTo (int);
-
-extern TuiWinInfoPtr tuiNextWin (TuiWinInfoPtr);
-extern TuiWinInfoPtr tuiPrevWin (TuiWinInfoPtr);
-
-extern void addToSourceWindows (TuiWinInfoPtr winInfo);
-
-#endif /* TUI_DATA_H */
diff --git a/gdb/tui/tuiDataWin.c b/gdb/tui/tuiDataWin.c
deleted file mode 100644
index f3bedd2..0000000
--- a/gdb/tui/tuiDataWin.c
+++ /dev/null
@@ -1,349 +0,0 @@
-/* Data/register window display.
-
- Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation,
- Inc.
-
- Contributed by Hewlett-Packard Company.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include "defs.h"
-#include "tui.h"
-#include "tuiData.h"
-#include "tuiGeneralWin.h"
-#include "tuiRegs.h"
-
-#ifdef HAVE_NCURSES_H
-#include <ncurses.h>
-#else
-#ifdef HAVE_CURSES_H
-#include <curses.h>
-#endif
-#endif
-
-
-/*****************************************
-** STATIC LOCAL FUNCTIONS FORWARD DECLS **
-******************************************/
-
-
-
-/*****************************************
-** PUBLIC FUNCTIONS **
-******************************************/
-
-
-/*
- ** tuiFirstDataItemDisplayed()
- ** Answer the index first element displayed.
- ** If none are displayed, then return (-1).
- */
-int
-tuiFirstDataItemDisplayed (void)
-{
- int elementNo = (-1);
- int i;
-
- for (i = 0; (i < dataWin->generic.contentSize && elementNo < 0); i++)
- {
- TuiGenWinInfoPtr dataItemWin;
-
- dataItemWin = &((TuiWinContent)
- dataWin->generic.content)[i]->whichElement.dataWindow;
- if (dataItemWin->handle != (WINDOW *) NULL && dataItemWin->isVisible)
- elementNo = i;
- }
-
- return elementNo;
-} /* tuiFirstDataItemDisplayed */
-
-
-/*
- ** tuiFirstDataElementNoInLine()
- ** Answer the index of the first element in lineNo. If lineNo is
- ** past the data area (-1) is returned.
- */
-int
-tuiFirstDataElementNoInLine (int lineNo)
-{
- int firstElementNo = (-1);
-
- /*
- ** First see if there is a register on lineNo, and if so, set the
- ** first element number
- */
- if ((firstElementNo = tuiFirstRegElementNoInLine (lineNo)) == -1)
- { /*
- ** Looking at the general data, the 1st element on lineNo
- */
- }
-
- return firstElementNo;
-} /* tuiFirstDataElementNoInLine */
-
-
-/*
- ** tuiDeleteDataContentWindows()
- ** Function to delete all the item windows in the data window.
- ** This is usually done when the data window is scrolled.
- */
-void
-tuiDeleteDataContentWindows (void)
-{
- int i;
- TuiGenWinInfoPtr dataItemWinPtr;
-
- for (i = 0; (i < dataWin->generic.contentSize); i++)
- {
- dataItemWinPtr = &((TuiWinContent)
- dataWin->generic.content)[i]->whichElement.dataWindow;
- tuiDelwin (dataItemWinPtr->handle);
- dataItemWinPtr->handle = (WINDOW *) NULL;
- dataItemWinPtr->isVisible = FALSE;
- }
-
- return;
-} /* tuiDeleteDataContentWindows */
-
-
-void
-tuiEraseDataContent (char *prompt)
-{
- werase (dataWin->generic.handle);
- checkAndDisplayHighlightIfNeeded (dataWin);
- if (prompt != (char *) NULL)
- {
- int halfWidth = (dataWin->generic.width - 2) / 2;
- int xPos;
-
- if (strlen (prompt) >= halfWidth)
- xPos = 1;
- else
- xPos = halfWidth - strlen (prompt);
- mvwaddstr (dataWin->generic.handle,
- (dataWin->generic.height / 2),
- xPos,
- prompt);
- }
- wrefresh (dataWin->generic.handle);
-
- return;
-} /* tuiEraseDataContent */
-
-
-/*
- ** tuiDisplayAllData().
- ** This function displays the data that is in the data window's
- ** content. It does not set the content.
- */
-void
-tuiDisplayAllData (void)
-{
- if (dataWin->generic.contentSize <= 0)
- tuiEraseDataContent (NO_DATA_STRING);
- else
- {
- tuiEraseDataContent ((char *) NULL);
- tuiDeleteDataContentWindows ();
- checkAndDisplayHighlightIfNeeded (dataWin);
- tuiDisplayRegistersFrom (0);
- /*
- ** Then display the other data
- */
- if (dataWin->detail.dataDisplayInfo.dataContent !=
- (TuiWinContent) NULL &&
- dataWin->detail.dataDisplayInfo.dataContentCount > 0)
- {
- }
- }
- return;
-} /* tuiDisplayAllData */
-
-
-/*
- ** tuiDisplayDataFromLine()
- ** Function to display the data starting at line, lineNo, in the
- ** data window.
- */
-void
-tuiDisplayDataFromLine (int lineNo)
-{
- int _lineNo = lineNo;
-
- if (lineNo < 0)
- _lineNo = 0;
-
- checkAndDisplayHighlightIfNeeded (dataWin);
-
- /* there is no general data, force regs to display (if there are any) */
- if (dataWin->detail.dataDisplayInfo.dataContentCount <= 0)
- tuiDisplayRegistersFromLine (_lineNo, TRUE);
- else
- {
- int elementNo, startLineNo;
- int regsLastLine = tuiLastRegsLineNo ();
-
-
- /* display regs if we can */
- if (tuiDisplayRegistersFromLine (_lineNo, FALSE) < 0)
- { /*
- ** _lineNo is past the regs display, so calc where the
- ** start data element is
- */
- if (regsLastLine < _lineNo)
- { /* figure out how many lines each element is to obtain
- the start elementNo */
- }
- }
- else
- { /*
- ** calculate the starting element of the data display, given
- ** regsLastLine and how many lines each element is, up to
- ** _lineNo
- */
- }
- /* Now display the data , starting at elementNo */
- }
-
- return;
-} /* tuiDisplayDataFromLine */
-
-
-/*
- ** tuiDisplayDataFrom()
- ** Display data starting at element elementNo
- */
-void
-tuiDisplayDataFrom (int elementNo, int reuseWindows)
-{
- int firstLine = (-1);
-
- if (elementNo < dataWin->detail.dataDisplayInfo.regsContentCount)
- firstLine = tuiLineFromRegElementNo (elementNo);
- else
- { /* calculate the firstLine from the element number */
- }
-
- if (firstLine >= 0)
- {
- tuiEraseDataContent ((char *) NULL);
- if (!reuseWindows)
- tuiDeleteDataContentWindows ();
- tuiDisplayDataFromLine (firstLine);
- }
-
- return;
-} /* tuiDisplayDataFrom */
-
-
-/*
- ** tuiRefreshDataWin()
- ** Function to redisplay the contents of the data window.
- */
-void
-tuiRefreshDataWin (void)
-{
- tuiEraseDataContent ((char *) NULL);
- if (dataWin->generic.contentSize > 0)
- {
- int firstElement = tuiFirstDataItemDisplayed ();
-
- if (firstElement >= 0) /* re-use existing windows */
- tuiDisplayDataFrom (firstElement, TRUE);
- }
-
- return;
-} /* tuiRefreshDataWin */
-
-
-/*
- ** tuiCheckDataValues().
- ** Function to check the data values and hilite any that have changed
- */
-void
-tuiCheckDataValues (struct frame_info *frame)
-{
- tuiCheckRegisterValues (frame);
-
- /* Now check any other data values that there are */
- if (m_winPtrNotNull (dataWin) && dataWin->generic.isVisible)
- {
- int i;
-
- for (i = 0; dataWin->detail.dataDisplayInfo.dataContentCount; i++)
- {
-#ifdef LATER
- TuiDataElementPtr dataElementPtr;
- TuiGenWinInfoPtr dataItemWinPtr;
- Opaque newValue;
-
- dataItemPtr = &dataWin->detail.dataDisplayInfo.
- dataContent[i]->whichElement.dataWindow;
- dataElementPtr = &((TuiWinContent)
- dataItemWinPtr->content)[0]->whichElement.data;
- if value
- has changed (dataElementPtr, frame, &newValue)
- {
- dataElementPtr->value = newValue;
- update the display with the new value, hiliting it.
- }
-#endif
- }
- }
-} /* tuiCheckDataValues */
-
-
-/*
- ** tuiVerticalDataScroll()
- ** Scroll the data window vertically forward or backward.
- */
-void
-tuiVerticalDataScroll (TuiScrollDirection scrollDirection, int numToScroll)
-{
- int firstElementNo;
- int firstLine = (-1);
-
- firstElementNo = tuiFirstDataItemDisplayed ();
- if (firstElementNo < dataWin->detail.dataDisplayInfo.regsContentCount)
- firstLine = tuiLineFromRegElementNo (firstElementNo);
- else
- { /* calculate the first line from the element number which is in
- ** the general data content
- */
- }
-
- if (firstLine >= 0)
- {
- int lastElementNo, lastLine;
-
- if (scrollDirection == FORWARD_SCROLL)
- firstLine += numToScroll;
- else
- firstLine -= numToScroll;
- tuiEraseDataContent ((char *) NULL);
- tuiDeleteDataContentWindows ();
- tuiDisplayDataFromLine (firstLine);
- }
-
- return;
-} /* tuiVerticalDataScroll */
-
-
-/*****************************************
-** STATIC LOCAL FUNCTIONS **
-******************************************/
diff --git a/gdb/tui/tuiDataWin.h b/gdb/tui/tuiDataWin.h
deleted file mode 100644
index 0b1e700..0000000
--- a/gdb/tui/tuiDataWin.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* Data/register window display.
- Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
- Contributed by Hewlett-Packard Company.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#ifndef _TUI_DATAWIN_H
-#define _TUI_DATAWIN_H
-
-
-/*****************************************
-** TYPE DEFINITIONS **
-******************************************/
-
-
-
-/*****************************************
-** PUBLIC FUNCTION EXTERNAL DECLS **
-******************************************/
-extern void tuiEraseDataContent (char *);
-extern void tuiDisplayAllData (void);
-extern void tuiCheckDataValues (struct frame_info *);
-extern void tuiDisplayDataFromLine (int);
-extern int tuiFirstDataItemDisplayed (void);
-extern int tuiFirstDataElementNoInLine (int);
-extern void tuiDeleteDataContentWindows (void);
-extern void tuiRefreshDataWin (void);
-extern void tuiDisplayDataFrom (int, int);
-extern void tuiVerticalDataScroll (TuiScrollDirection, int);
-
-#endif
-/*_TUI_DATAWIN_H*/
diff --git a/gdb/tui/tuiDisassem.c b/gdb/tui/tuiDisassem.c
deleted file mode 100644
index e36c5df..0000000
--- a/gdb/tui/tuiDisassem.c
+++ /dev/null
@@ -1,415 +0,0 @@
-/* Disassembly display.
-
- Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation,
- Inc.
-
- Contributed by Hewlett-Packard Company.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include "defs.h"
-#include "symtab.h"
-#include "breakpoint.h"
-#include "frame.h"
-#include "value.h"
-#include "source.h"
-#include "disasm.h"
-
-#include "tui.h"
-#include "tuiData.h"
-#include "tuiWin.h"
-#include "tuiLayout.h"
-#include "tuiSourceWin.h"
-#include "tuiStack.h"
-#include "tui-file.h"
-
-#ifdef HAVE_NCURSES_H
-#include <ncurses.h>
-#else
-#ifdef HAVE_CURSES_H
-#include <curses.h>
-#endif
-#endif
-
-struct tui_asm_line
-{
- CORE_ADDR addr;
- char* addr_string;
- char* insn;
-};
-
-/* Function to set the disassembly window's content.
- Disassemble count lines starting at pc.
- Return address of the count'th instruction after pc. */
-static CORE_ADDR
-tui_disassemble (struct tui_asm_line* lines, CORE_ADDR pc, int count)
-{
- struct ui_file *gdb_dis_out;
-
- /* now init the ui_file structure */
- gdb_dis_out = tui_sfileopen (256);
-
- /* Now construct each line */
- for (; count > 0; count--, lines++)
- {
- if (lines->addr_string)
- xfree (lines->addr_string);
- if (lines->insn)
- xfree (lines->insn);
-
- print_address (pc, gdb_dis_out);
- lines->addr = pc;
- lines->addr_string = xstrdup (tui_file_get_strbuf (gdb_dis_out));
-
- ui_file_rewind (gdb_dis_out);
-
- pc = pc + gdb_print_insn (pc, gdb_dis_out);
-
- lines->insn = xstrdup (tui_file_get_strbuf (gdb_dis_out));
-
- /* reset the buffer to empty */
- ui_file_rewind (gdb_dis_out);
- }
- ui_file_delete (gdb_dis_out);
- return pc;
-}
-
-/* Find the disassembly address that corresponds to FROM lines
- above or below the PC. Variable sized instructions are taken
- into account by the algorithm. */
-static CORE_ADDR
-tui_find_disassembly_address (CORE_ADDR pc, int from)
-{
- register CORE_ADDR newLow;
- int maxLines;
- int i;
- struct tui_asm_line* lines;
-
- maxLines = (from > 0) ? from : - from;
- if (maxLines <= 1)
- return pc;
-
- lines = (struct tui_asm_line*) alloca (sizeof (struct tui_asm_line)
- * maxLines);
- memset (lines, 0, sizeof (struct tui_asm_line) * maxLines);
-
- newLow = pc;
- if (from > 0)
- {
- tui_disassemble (lines, pc, maxLines);
- newLow = lines[maxLines - 1].addr;
- }
- else
- {
- CORE_ADDR last_addr;
- int pos;
- struct minimal_symbol* msymbol;
-
- /* Find backward an address which is a symbol
- and for which disassembling from that address will fill
- completely the window. */
- pos = maxLines - 1;
- do {
- newLow -= 1 * maxLines;
- msymbol = lookup_minimal_symbol_by_pc_section (newLow, 0);
-
- if (msymbol)
- newLow = SYMBOL_VALUE_ADDRESS (msymbol);
- else
- newLow += 1 * maxLines;
-
- tui_disassemble (lines, newLow, maxLines);
- last_addr = lines[pos].addr;
- } while (last_addr > pc && msymbol);
-
- /* Scan forward disassembling one instruction at a time
- until the last visible instruction of the window
- matches the pc. We keep the disassembled instructions
- in the 'lines' window and shift it downward (increasing
- its addresses). */
- if (last_addr < pc)
- do
- {
- CORE_ADDR next_addr;
-
- pos++;
- if (pos >= maxLines)
- pos = 0;
-
- next_addr = tui_disassemble (&lines[pos], last_addr, 1);
-
- /* If there are some problems while disassembling exit. */
- if (next_addr <= last_addr)
- break;
- last_addr = next_addr;
- } while (last_addr <= pc);
- pos++;
- if (pos >= maxLines)
- pos = 0;
- newLow = lines[pos].addr;
- }
- for (i = 0; i < maxLines; i++)
- {
- xfree (lines[i].addr_string);
- xfree (lines[i].insn);
- }
- return newLow;
-}
-
-/* Function to set the disassembly window's content. */
-TuiStatus
-tuiSetDisassemContent (CORE_ADDR pc)
-{
- TuiStatus ret = TUI_FAILURE;
- register int i;
- register int offset = disassemWin->detail.sourceInfo.horizontalOffset;
- register int lineWidth, maxLines;
- CORE_ADDR cur_pc;
- TuiGenWinInfoPtr locator = locatorWinInfoPtr ();
- int tab_len = tuiDefaultTabLen ();
- struct tui_asm_line* lines;
- int insn_pos;
- int addr_size, max_size;
- char* line;
-
- if (pc == 0)
- return TUI_FAILURE;
-
- ret = tuiAllocSourceBuffer (disassemWin);
- if (ret != TUI_SUCCESS)
- return ret;
-
- disassemWin->detail.sourceInfo.startLineOrAddr.addr = pc;
- cur_pc = (CORE_ADDR)
- (((TuiWinElementPtr) locator->content[0])->whichElement.locator.addr);
-
- maxLines = disassemWin->generic.height - 2; /* account for hilite */
-
- /* Get temporary table that will hold all strings (addr & insn). */
- lines = (struct tui_asm_line*) alloca (sizeof (struct tui_asm_line)
- * maxLines);
- memset (lines, 0, sizeof (struct tui_asm_line) * maxLines);
-
- lineWidth = disassemWin->generic.width - 1;
-
- tui_disassemble (lines, pc, maxLines);
-
- /* See what is the maximum length of an address and of a line. */
- addr_size = 0;
- max_size = 0;
- for (i = 0; i < maxLines; i++)
- {
- size_t len = strlen (lines[i].addr_string);
- if (len > addr_size)
- addr_size = len;
-
- len = strlen (lines[i].insn) + tab_len;
- if (len > max_size)
- max_size = len;
- }
- max_size += addr_size + tab_len;
-
- /* Allocate memory to create each line. */
- line = (char*) alloca (max_size);
- insn_pos = (1 + (addr_size / tab_len)) * tab_len;
-
- /* Now construct each line */
- for (i = 0; i < maxLines; i++)
- {
- TuiWinElementPtr element;
- TuiSourceElement* src;
- int curLen;
-
- element = (TuiWinElementPtr) disassemWin->generic.content[i];
- src = &element->whichElement.source;
- strcpy (line, lines[i].addr_string);
- curLen = strlen (line);
-
- /* Add spaces to make the instructions start on the same column */
- while (curLen < insn_pos)
- {
- strcat (line, " ");
- curLen++;
- }
-
- strcat (line, lines[i].insn);
-
- /* Now copy the line taking the offset into account */
- if (strlen (line) > offset)
- strcpy (src->line, &line[offset]);
- else
- src->line[0] = '\0';
-
- src->lineOrAddr.addr = lines[i].addr;
- src->isExecPoint = lines[i].addr == cur_pc;
-
- /* See whether there is a breakpoint installed. */
- src->hasBreak = (!src->isExecPoint
- && breakpoint_here_p (pc) != no_breakpoint_here);
-
- xfree (lines[i].addr_string);
- xfree (lines[i].insn);
- }
- disassemWin->generic.contentSize = i;
- return TUI_SUCCESS;
-}
-
-
-/*
- ** tuiShowDisassem().
- ** Function to display the disassembly window with disassembled code.
- */
-void
-tuiShowDisassem (CORE_ADDR startAddr)
-{
- struct symtab *s = find_pc_symtab (startAddr);
- TuiWinInfoPtr winWithFocus = tuiWinWithFocus ();
- TuiLineOrAddress val;
-
- val.addr = startAddr;
- tuiAddWinToLayout (DISASSEM_WIN);
- tuiUpdateSourceWindow (disassemWin, s, val, FALSE);
- /*
- ** if the focus was in the src win, put it in the asm win, if the
- ** source view isn't split
- */
- if (currentLayout () != SRC_DISASSEM_COMMAND && winWithFocus == srcWin)
- tuiSetWinFocusTo (disassemWin);
-
- return;
-} /* tuiShowDisassem */
-
-
-/*
- ** tuiShowDisassemAndUpdateSource().
- ** Function to display the disassembly window.
- */
-void
-tuiShowDisassemAndUpdateSource (CORE_ADDR startAddr)
-{
- struct symtab_and_line sal;
-
- tuiShowDisassem (startAddr);
- if (currentLayout () == SRC_DISASSEM_COMMAND)
- {
- TuiLineOrAddress val;
-
- /*
- ** Update what is in the source window if it is displayed too,
- ** note that it follows what is in the disassembly window and visa-versa
- */
- sal = find_pc_line (startAddr, 0);
- val.lineNo = sal.line;
- tuiUpdateSourceWindow (srcWin, sal.symtab, val, TRUE);
- if (sal.symtab)
- {
- set_current_source_symtab_and_line (&sal);
- tuiUpdateLocatorFilename (sal.symtab->filename);
- }
- else
- tuiUpdateLocatorFilename ("?");
- }
-
- return;
-} /* tuiShowDisassemAndUpdateSource */
-
-/*
- ** tuiGetBeginAsmAddress().
- */
-CORE_ADDR
-tuiGetBeginAsmAddress (void)
-{
- TuiGenWinInfoPtr locator;
- TuiLocatorElementPtr element;
- CORE_ADDR addr;
-
- locator = locatorWinInfoPtr ();
- element = &((TuiWinElementPtr) locator->content[0])->whichElement.locator;
-
- if (element->addr == 0)
- {
- struct minimal_symbol *main_symbol;
-
- /* Find address of the start of program.
- Note: this should be language specific. */
- main_symbol = lookup_minimal_symbol ("main", NULL, NULL);
- if (main_symbol == 0)
- main_symbol = lookup_minimal_symbol ("MAIN", NULL, NULL);
- if (main_symbol == 0)
- main_symbol = lookup_minimal_symbol ("_start", NULL, NULL);
- if (main_symbol)
- addr = SYMBOL_VALUE_ADDRESS (main_symbol);
- else
- addr = 0;
- }
- else /* the target is executing */
- addr = element->addr;
-
- return addr;
-} /* tuiGetBeginAsmAddress */
-
-/* Determine what the low address will be to display in the TUI's
- disassembly window. This may or may not be the same as the
- low address input. */
-CORE_ADDR
-tuiGetLowDisassemblyAddress (CORE_ADDR low, CORE_ADDR pc)
-{
- int pos;
-
- /* Determine where to start the disassembly so that the pc is about in the
- middle of the viewport. */
- pos = tuiDefaultWinViewportHeight (DISASSEM_WIN, DISASSEM_COMMAND) / 2;
- pc = tui_find_disassembly_address (pc, -pos);
-
- if (pc < low)
- pc = low;
- return pc;
-}
-
-/*
- ** tuiVerticalDisassemScroll().
- ** Scroll the disassembly forward or backward vertically
- */
-void
-tuiVerticalDisassemScroll (TuiScrollDirection scrollDirection,
- int numToScroll)
-{
- if (disassemWin->generic.content != (OpaquePtr) NULL)
- {
- CORE_ADDR pc;
- TuiWinContent content;
- struct symtab *s;
- TuiLineOrAddress val;
- int maxLines, dir;
- struct symtab_and_line cursal = get_current_source_symtab_and_line ();
-
- content = (TuiWinContent) disassemWin->generic.content;
- if (cursal.symtab == (struct symtab *) NULL)
- s = find_pc_symtab (get_frame_pc (deprecated_selected_frame));
- else
- s = cursal.symtab;
-
- /* account for hilite */
- maxLines = disassemWin->generic.height - 2;
- pc = content[0]->whichElement.source.lineOrAddr.addr;
- dir = (scrollDirection == FORWARD_SCROLL) ? maxLines : - maxLines;
-
- val.addr = tui_find_disassembly_address (pc, dir);
- tuiUpdateSourceWindowAsIs (disassemWin, s, val, FALSE);
- }
-}
diff --git a/gdb/tui/tuiDisassem.h b/gdb/tui/tuiDisassem.h
deleted file mode 100644
index 6728425..0000000
--- a/gdb/tui/tuiDisassem.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Disassembly display.
- Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
- Contributed by Hewlett-Packard Company.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#ifndef _TUI_DISASSEM_H
-#define _TUI_DISASSEM_H
-
-/*****************************************
-** TYPE DEFINITIONS **
-******************************************/
-
-
-
-/*****************************************
-** PUBLIC FUNCTION EXTERNAL DECLS **
-******************************************/
-extern TuiStatus tuiSetDisassemContent (CORE_ADDR);
-extern void tuiShowDisassem (CORE_ADDR);
-extern void tuiShowDisassemAndUpdateSource (CORE_ADDR);
-extern void tuiVerticalDisassemScroll (TuiScrollDirection, int);
-extern CORE_ADDR tuiGetBeginAsmAddress (void);
-
-#endif
-/*_TUI_DISASSEM_H*/
diff --git a/gdb/tui/tuiGeneralWin.c b/gdb/tui/tuiGeneralWin.c
deleted file mode 100644
index 42faf75..0000000
--- a/gdb/tui/tuiGeneralWin.c
+++ /dev/null
@@ -1,285 +0,0 @@
-/* General window behavior.
-
- Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation,
- Inc.
-
- Contributed by Hewlett-Packard Company.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include "defs.h"
-#include "tui.h"
-#include "tuiData.h"
-#include "tuiGeneralWin.h"
-#include "tuiWin.h"
-
-#ifdef HAVE_NCURSES_H
-#include <ncurses.h>
-#else
-#ifdef HAVE_CURSES_H
-#include <curses.h>
-#endif
-#endif
-
-/***********************
-** PUBLIC FUNCTIONS
-***********************/
-/*
- ** tuiRefreshWin()
- ** Refresh the window
- */
-void
-tuiRefreshWin (TuiGenWinInfoPtr winInfo)
-{
- if (winInfo->type == DATA_WIN && winInfo->contentSize > 0)
- {
- int i;
-
- for (i = 0; (i < winInfo->contentSize); i++)
- {
- TuiGenWinInfoPtr dataItemWinPtr;
-
- dataItemWinPtr = &((TuiWinContent)
- winInfo->content)[i]->whichElement.dataWindow;
- if (m_genWinPtrNotNull (dataItemWinPtr) &&
- dataItemWinPtr->handle != (WINDOW *) NULL)
- wrefresh (dataItemWinPtr->handle);
- }
- }
- else if (winInfo->type == CMD_WIN)
- {
- /* Do nothing */
- }
- else
- {
- if (winInfo->handle != (WINDOW *) NULL)
- wrefresh (winInfo->handle);
- }
-
- return;
-} /* tuiRefreshWin */
-
-
-/*
- ** tuiDelwin()
- ** Function to delete the curses window, checking for null
- */
-void
-tuiDelwin (WINDOW * window)
-{
- if (window != (WINDOW *) NULL)
- delwin (window);
-
- return;
-} /* tuiDelwin */
-
-
-/* Draw a border arround the window. */
-void
-boxWin (TuiGenWinInfoPtr winInfo, int highlightFlag)
-{
- if (winInfo && winInfo->handle)
- {
- WINDOW *win;
- int attrs;
-
- win = winInfo->handle;
- if (highlightFlag == HILITE)
- attrs = tui_active_border_attrs;
- else
- attrs = tui_border_attrs;
-
- wattron (win, attrs);
- wborder (win, tui_border_vline, tui_border_vline,
- tui_border_hline, tui_border_hline,
- tui_border_ulcorner, tui_border_urcorner,
- tui_border_llcorner, tui_border_lrcorner);
- if (winInfo->title)
- mvwaddstr (win, 0, 3, winInfo->title);
- wattroff (win, attrs);
- }
-}
-
-
-/*
- ** unhighlightWin().
- */
-void
-unhighlightWin (TuiWinInfoPtr winInfo)
-{
- if (m_winPtrNotNull (winInfo) && winInfo->generic.handle != (WINDOW *) NULL)
- {
- boxWin ((TuiGenWinInfoPtr) winInfo, NO_HILITE);
- wrefresh (winInfo->generic.handle);
- m_setWinHighlightOff (winInfo);
- }
-} /* unhighlightWin */
-
-
-/*
- ** highlightWin().
- */
-void
-highlightWin (TuiWinInfoPtr winInfo)
-{
- if (m_winPtrNotNull (winInfo) &&
- winInfo->canHighlight && winInfo->generic.handle != (WINDOW *) NULL)
- {
- boxWin ((TuiGenWinInfoPtr) winInfo, HILITE);
- wrefresh (winInfo->generic.handle);
- m_setWinHighlightOn (winInfo);
- }
-} /* highlightWin */
-
-
-/*
- ** checkAndDisplayHighlightIfNecessay
- */
-void
-checkAndDisplayHighlightIfNeeded (TuiWinInfoPtr winInfo)
-{
- if (m_winPtrNotNull (winInfo) && winInfo->generic.type != CMD_WIN)
- {
- if (winInfo->isHighlighted)
- highlightWin (winInfo);
- else
- unhighlightWin (winInfo);
-
- }
- return;
-} /* checkAndDisplayHighlightIfNeeded */
-
-
-/*
- ** makeWindow().
- */
-void
-makeWindow (TuiGenWinInfoPtr winInfo, int boxIt)
-{
- WINDOW *handle;
-
- handle = newwin (winInfo->height,
- winInfo->width,
- winInfo->origin.y,
- winInfo->origin.x);
- winInfo->handle = handle;
- if (handle != (WINDOW *) NULL)
- {
- if (boxIt == BOX_WINDOW)
- boxWin (winInfo, NO_HILITE);
- winInfo->isVisible = TRUE;
- scrollok (handle, TRUE);
- }
-}
-
-
-/*
- ** makeVisible().
- ** We can't really make windows visible, or invisible. So we
- ** have to delete the entire window when making it visible,
- ** and create it again when making it visible.
- */
-void
-makeVisible (TuiGenWinInfoPtr winInfo, int visible)
-{
- /* Don't tear down/recreate command window */
- if (winInfo->type == CMD_WIN)
- return;
-
- if (visible)
- {
- if (!winInfo->isVisible)
- {
- makeWindow (
- winInfo,
- (winInfo->type != CMD_WIN && !m_winIsAuxillary (winInfo->type)));
- winInfo->isVisible = TRUE;
- }
- }
- else if (!visible &&
- winInfo->isVisible && winInfo->handle != (WINDOW *) NULL)
- {
- winInfo->isVisible = FALSE;
- tuiDelwin (winInfo->handle);
- winInfo->handle = (WINDOW *) NULL;
- }
-
- return;
-} /* makeVisible */
-
-
-/*
- ** makeAllVisible().
- ** Makes all windows invisible (except the command and locator windows)
- */
-void
-makeAllVisible (int visible)
-{
- int i;
-
- for (i = 0; i < MAX_MAJOR_WINDOWS; i++)
- {
- if (m_winPtrNotNull (winList[i]) &&
- ((winList[i])->generic.type) != CMD_WIN)
- {
- if (m_winIsSourceType ((winList[i])->generic.type))
- makeVisible ((winList[i])->detail.sourceInfo.executionInfo,
- visible);
- makeVisible ((TuiGenWinInfoPtr) winList[i], visible);
- }
- }
-
- return;
-} /* makeAllVisible */
-
-/*
- ** refreshAll().
- ** Function to refresh all the windows currently displayed
- */
-void
-refreshAll (TuiWinInfoPtr * list)
-{
- TuiWinType type;
- TuiGenWinInfoPtr locator = locatorWinInfoPtr ();
-
- for (type = SRC_WIN; (type < MAX_MAJOR_WINDOWS); type++)
- {
- if (list[type] && list[type]->generic.isVisible)
- {
- if (type == SRC_WIN || type == DISASSEM_WIN)
- {
- touchwin (list[type]->detail.sourceInfo.executionInfo->handle);
- tuiRefreshWin (list[type]->detail.sourceInfo.executionInfo);
- }
- touchwin (list[type]->generic.handle);
- tuiRefreshWin (&list[type]->generic);
- }
- }
- if (locator->isVisible)
- {
- touchwin (locator->handle);
- tuiRefreshWin (locator);
- }
-
- return;
-} /* refreshAll */
-
-
-/*********************************
-** Local Static Functions
-*********************************/
diff --git a/gdb/tui/tuiGeneralWin.h b/gdb/tui/tuiGeneralWin.h
deleted file mode 100644
index 42d1ce4..0000000
--- a/gdb/tui/tuiGeneralWin.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/* General window behavior.
- Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
- Contributed by Hewlett-Packard Company.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#ifndef TUI_GENERAL_WIN_H
-#define TUI_GENERAL_WIN_H
-
-/*
- ** Functions
- */
-extern void unhighlightWin (TuiWinInfoPtr);
-extern void makeVisible (TuiGenWinInfoPtr, int);
-extern void makeAllVisible (int);
-extern void makeWindow (TuiGenWinInfoPtr, int);
-extern TuiWinInfoPtr copyWin (TuiWinInfoPtr);
-extern void boxWin (TuiGenWinInfoPtr, int);
-extern void highlightWin (TuiWinInfoPtr);
-extern void checkAndDisplayHighlightIfNeeded (TuiWinInfoPtr);
-extern void refreshAll (TuiWinInfoPtr *);
-extern void tuiDelwin (WINDOW * window);
-extern void tuiRefreshWin (TuiGenWinInfoPtr);
-
-/*
- ** Macros
- */
-#define m_beVisible(winInfo) makeVisible((TuiGenWinInfoPtr)(winInfo), TRUE)
-#define m_beInvisible(winInfo) \
- makeVisible((TuiGenWinInfoPtr)(winInfo), FALSE)
-#define m_allBeVisible() makeAllVisible(TRUE)
-#define m_allBeInvisible() makeAllVisible(FALSE)
-
-#endif /*TUI_GENERAL_WIN_H */
diff --git a/gdb/tui/tuiIO.c b/gdb/tui/tuiIO.c
deleted file mode 100644
index 1a8bbc2..0000000
--- a/gdb/tui/tuiIO.c
+++ /dev/null
@@ -1,694 +0,0 @@
-/* TUI support I/O functions.
-
- Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation,
- Inc.
-
- Contributed by Hewlett-Packard Company.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include "defs.h"
-#include "terminal.h"
-#include "target.h"
-#include "event-loop.h"
-#include "event-top.h"
-#include "command.h"
-#include "top.h"
-#include "readline/readline.h"
-#include "tui.h"
-#include "tuiData.h"
-#include "tuiIO.h"
-#include "tuiCommand.h"
-#include "tuiWin.h"
-#include "tuiGeneralWin.h"
-#include "tui-file.h"
-#include "ui-out.h"
-#include "cli-out.h"
-#include <fcntl.h>
-#include <signal.h>
-#include <stdio.h>
-
-#ifdef HAVE_NCURSES_H
-#include <ncurses.h>
-#else
-#ifdef HAVE_CURSES_H
-#include <curses.h>
-#endif
-#endif
-
-/* Use definition from readline 4.3. */
-#undef CTRL_CHAR
-#define CTRL_CHAR(c) ((c) < control_character_threshold && (((c) & 0x80) == 0))
-
-/* This file controls the IO interactions between gdb and curses.
- When the TUI is enabled, gdb has two modes a curses and a standard
- mode.
-
- In curses mode, the gdb outputs are made in a curses command window.
- For this, the gdb_stdout and gdb_stderr are redirected to the specific
- ui_file implemented by TUI. The output is handled by tui_puts().
- The input is also controlled by curses with tui_getc(). The readline
- library uses this function to get its input. Several readline hooks
- are installed to redirect readline output to the TUI (see also the
- note below).
-
- In normal mode, the gdb outputs are restored to their origin, that
- is as if TUI is not used. Readline also uses its original getc()
- function with stdin.
-
- Note SCz/2001-07-21: the current readline is not clean in its management of
- the output. Even if we install a redisplay handler, it sometimes writes on
- a stdout file. It is important to redirect every output produced by
- readline, otherwise the curses window will be garbled. This is implemented
- with a pipe that TUI reads and readline writes to. A gdb input handler
- is created so that reading the pipe is handled automatically.
- This will probably not work on non-Unix platforms. The best fix is
- to make readline clean enougth so that is never write on stdout.
-
- Note SCz/2002-09-01: we now use more readline hooks and it seems that
- with them we don't need the pipe anymore (verified by creating the pipe
- and closing its end so that write causes a SIGPIPE). The old pipe code
- is still there and can be conditionally removed by
- #undef TUI_USE_PIPE_FOR_READLINE. */
-
-/* For gdb 5.3, prefer to continue the pipe hack as a backup wheel. */
-#define TUI_USE_PIPE_FOR_READLINE
-/*#undef TUI_USE_PIPE_FOR_READLINE*/
-
-/* TUI output files. */
-static struct ui_file *tui_stdout;
-static struct ui_file *tui_stderr;
-struct ui_out *tui_out;
-
-/* GDB output files in non-curses mode. */
-static struct ui_file *tui_old_stdout;
-static struct ui_file *tui_old_stderr;
-struct ui_out *tui_old_uiout;
-
-/* Readline previous hooks. */
-static Function *tui_old_rl_getc_function;
-static VFunction *tui_old_rl_redisplay_function;
-static VFunction *tui_old_rl_prep_terminal;
-static VFunction *tui_old_rl_deprep_terminal;
-static int tui_old_readline_echoing_p;
-
-/* Readline output stream.
- Should be removed when readline is clean. */
-static FILE *tui_rl_outstream;
-static FILE *tui_old_rl_outstream;
-#ifdef TUI_USE_PIPE_FOR_READLINE
-static int tui_readline_pipe[2];
-#endif
-
-/* The last gdb prompt that was registered in readline.
- This may be the main gdb prompt or a secondary prompt. */
-static char *tui_rl_saved_prompt;
-
-static unsigned int _tuiHandleResizeDuringIO (unsigned int);
-
-static void
-tui_putc (char c)
-{
- char buf[2];
-
- buf[0] = c;
- buf[1] = 0;
- tui_puts (buf);
-}
-
-/* Print the string in the curses command window. */
-void
-tui_puts (const char *string)
-{
- static int tui_skip_line = -1;
- char c;
- WINDOW *w;
-
- w = cmdWin->generic.handle;
- while ((c = *string++) != 0)
- {
- /* Catch annotation and discard them. We need two \032 and
- discard until a \n is seen. */
- if (c == '\032')
- {
- tui_skip_line++;
- }
- else if (tui_skip_line != 1)
- {
- tui_skip_line = -1;
- waddch (w, c);
- }
- else if (c == '\n')
- tui_skip_line = -1;
- }
- getyx (w, cmdWin->detail.commandInfo.curLine,
- cmdWin->detail.commandInfo.curch);
- cmdWin->detail.commandInfo.start_line = cmdWin->detail.commandInfo.curLine;
-
- /* We could defer the following. */
- wrefresh (w);
- fflush (stdout);
-}
-
-/* Readline callback.
- Redisplay the command line with its prompt after readline has
- changed the edited text. */
-void
-tui_redisplay_readline (void)
-{
- int prev_col;
- int height;
- int col, line;
- int c_pos;
- int c_line;
- int in;
- WINDOW *w;
- char *prompt;
- int start_line;
-
- /* Detect when we temporarily left SingleKey and now the readline
- edit buffer is empty, automatically restore the SingleKey mode. */
- if (tui_current_key_mode == tui_one_command_mode && rl_end == 0)
- tui_set_key_mode (tui_single_key_mode);
-
- if (tui_current_key_mode == tui_single_key_mode)
- prompt = "";
- else
- prompt = tui_rl_saved_prompt;
-
- c_pos = -1;
- c_line = -1;
- w = cmdWin->generic.handle;
- start_line = cmdWin->detail.commandInfo.start_line;
- wmove (w, start_line, 0);
- prev_col = 0;
- height = 1;
- for (in = 0; prompt && prompt[in]; in++)
- {
- waddch (w, prompt[in]);
- getyx (w, line, col);
- if (col < prev_col)
- height++;
- prev_col = col;
- }
- for (in = 0; in < rl_end; in++)
- {
- unsigned char c;
-
- c = (unsigned char) rl_line_buffer[in];
- if (in == rl_point)
- {
- getyx (w, c_line, c_pos);
- }
-
- if (CTRL_CHAR (c) || c == RUBOUT)
- {
- waddch (w, '^');
- waddch (w, CTRL_CHAR (c) ? UNCTRL (c) : '?');
- }
- else
- {
- waddch (w, c);
- }
- if (c == '\n')
- {
- getyx (w, cmdWin->detail.commandInfo.start_line,
- cmdWin->detail.commandInfo.curch);
- }
- getyx (w, line, col);
- if (col < prev_col)
- height++;
- prev_col = col;
- }
- wclrtobot (w);
- getyx (w, cmdWin->detail.commandInfo.start_line,
- cmdWin->detail.commandInfo.curch);
- if (c_line >= 0)
- {
- wmove (w, c_line, c_pos);
- cmdWin->detail.commandInfo.curLine = c_line;
- cmdWin->detail.commandInfo.curch = c_pos;
- }
- cmdWin->detail.commandInfo.start_line -= height - 1;
-
- wrefresh (w);
- fflush(stdout);
-}
-
-/* Readline callback to prepare the terminal. It is called once
- each time we enter readline. Terminal is already setup in curses mode. */
-static void
-tui_prep_terminal (int notused1)
-{
- /* Save the prompt registered in readline to correctly display it.
- (we can't use gdb_prompt() due to secondary prompts and can't use
- rl_prompt because it points to an alloca buffer). */
- xfree (tui_rl_saved_prompt);
- tui_rl_saved_prompt = xstrdup (rl_prompt);
-}
-
-/* Readline callback to restore the terminal. It is called once
- each time we leave readline. There is nothing to do in curses mode. */
-static void
-tui_deprep_terminal (void)
-{
-}
-
-#ifdef TUI_USE_PIPE_FOR_READLINE
-/* Read readline output pipe and feed the command window with it.
- Should be removed when readline is clean. */
-static void
-tui_readline_output (int code, gdb_client_data data)
-{
- int size;
- char buf[256];
-
- size = read (tui_readline_pipe[0], buf, sizeof (buf) - 1);
- if (size > 0 && tui_active)
- {
- buf[size] = 0;
- tui_puts (buf);
- }
-}
-#endif
-
-/* Return the portion of PATHNAME that should be output when listing
- possible completions. If we are hacking filename completion, we
- are only interested in the basename, the portion following the
- final slash. Otherwise, we return what we were passed.
-
- Comes from readline/complete.c */
-static char *
-printable_part (pathname)
- char *pathname;
-{
- char *temp;
-
- temp = rl_filename_completion_desired ? strrchr (pathname, '/') : (char *)NULL;
-#if defined (__MSDOS__)
- if (rl_filename_completion_desired && temp == 0 && isalpha (pathname[0]) && pathname[1] == ':')
- temp = pathname + 1;
-#endif
- return (temp ? ++temp : pathname);
-}
-
-/* Output TO_PRINT to rl_outstream. If VISIBLE_STATS is defined and we
- are using it, check for and output a single character for `special'
- filenames. Return the number of characters we output. */
-
-#define PUTX(c) \
- do { \
- if (CTRL_CHAR (c)) \
- { \
- tui_puts ("^"); \
- tui_putc (UNCTRL (c)); \
- printed_len += 2; \
- } \
- else if (c == RUBOUT) \
- { \
- tui_puts ("^?"); \
- printed_len += 2; \
- } \
- else \
- { \
- tui_putc (c); \
- printed_len++; \
- } \
- } while (0)
-
-static int
-print_filename (to_print, full_pathname)
- char *to_print, *full_pathname;
-{
- int printed_len = 0;
- char *s;
-
- for (s = to_print; *s; s++)
- {
- PUTX (*s);
- }
- return printed_len;
-}
-
-/* The user must press "y" or "n". Non-zero return means "y" pressed.
- Comes from readline/complete.c */
-static int
-get_y_or_n ()
-{
- extern int _rl_abort_internal ();
- int c;
-
- for (;;)
- {
- c = rl_read_key ();
- if (c == 'y' || c == 'Y' || c == ' ')
- return (1);
- if (c == 'n' || c == 'N' || c == RUBOUT)
- return (0);
- if (c == ABORT_CHAR)
- _rl_abort_internal ();
- beep ();
- }
-}
-
-/* A convenience function for displaying a list of strings in
- columnar format on readline's output stream. MATCHES is the list
- of strings, in argv format, LEN is the number of strings in MATCHES,
- and MAX is the length of the longest string in MATCHES.
-
- Comes from readline/complete.c and modified to write in
- the TUI command window using tui_putc/tui_puts. */
-static void
-tui_rl_display_match_list (matches, len, max)
- char **matches;
- int len, max;
-{
- typedef int QSFUNC (const void *, const void *);
- extern int _rl_qsort_string_compare (const void*, const void*);
- extern int _rl_print_completions_horizontally;
-
- int count, limit, printed_len;
- int i, j, k, l;
- char *temp;
-
- /* Screen dimension correspond to the TUI command window. */
- int screenwidth = cmdWin->generic.width;
-
- /* If there are many items, then ask the user if she really wants to
- see them all. */
- if (len >= rl_completion_query_items)
- {
- char msg[256];
-
- sprintf (msg, "\nDisplay all %d possibilities? (y or n)", len);
- tui_puts (msg);
- if (get_y_or_n () == 0)
- {
- tui_puts ("\n");
- return;
- }
- }
-
- /* How many items of MAX length can we fit in the screen window? */
- max += 2;
- limit = screenwidth / max;
- if (limit != 1 && (limit * max == screenwidth))
- limit--;
-
- /* Avoid a possible floating exception. If max > screenwidth,
- limit will be 0 and a divide-by-zero fault will result. */
- if (limit == 0)
- limit = 1;
-
- /* How many iterations of the printing loop? */
- count = (len + (limit - 1)) / limit;
-
- /* Watch out for special case. If LEN is less than LIMIT, then
- just do the inner printing loop.
- 0 < len <= limit implies count = 1. */
-
- /* Sort the items if they are not already sorted. */
- if (rl_ignore_completion_duplicates == 0)
- qsort (matches + 1, len, sizeof (char *),
- (QSFUNC *)_rl_qsort_string_compare);
-
- tui_putc ('\n');
-
- if (_rl_print_completions_horizontally == 0)
- {
- /* Print the sorted items, up-and-down alphabetically, like ls. */
- for (i = 1; i <= count; i++)
- {
- for (j = 0, l = i; j < limit; j++)
- {
- if (l > len || matches[l] == 0)
- break;
- else
- {
- temp = printable_part (matches[l]);
- printed_len = print_filename (temp, matches[l]);
-
- if (j + 1 < limit)
- for (k = 0; k < max - printed_len; k++)
- tui_putc (' ');
- }
- l += count;
- }
- tui_putc ('\n');
- }
- }
- else
- {
- /* Print the sorted items, across alphabetically, like ls -x. */
- for (i = 1; matches[i]; i++)
- {
- temp = printable_part (matches[i]);
- printed_len = print_filename (temp, matches[i]);
- /* Have we reached the end of this line? */
- if (matches[i+1])
- {
- if (i && (limit > 1) && (i % limit) == 0)
- tui_putc ('\n');
- else
- for (k = 0; k < max - printed_len; k++)
- tui_putc (' ');
- }
- }
- tui_putc ('\n');
- }
-}
-
-/* Setup the IO for curses or non-curses mode.
- - In non-curses mode, readline and gdb use the standard input and
- standard output/error directly.
- - In curses mode, the standard output/error is controlled by TUI
- with the tui_stdout and tui_stderr. The output is redirected in
- the curses command window. Several readline callbacks are installed
- so that readline asks for its input to the curses command window
- with wgetch(). */
-void
-tui_setup_io (int mode)
-{
- extern int readline_echoing_p;
-
- if (mode)
- {
- /* Redirect readline to TUI. */
- tui_old_rl_redisplay_function = rl_redisplay_function;
- tui_old_rl_deprep_terminal = rl_deprep_term_function;
- tui_old_rl_prep_terminal = rl_prep_term_function;
- tui_old_rl_getc_function = rl_getc_function;
- tui_old_rl_outstream = rl_outstream;
- tui_old_readline_echoing_p = readline_echoing_p;
- rl_redisplay_function = tui_redisplay_readline;
- rl_deprep_term_function = tui_deprep_terminal;
- rl_prep_term_function = tui_prep_terminal;
- rl_getc_function = tui_getc;
- readline_echoing_p = 0;
- rl_outstream = tui_rl_outstream;
- rl_prompt = 0;
- rl_completion_display_matches_hook = tui_rl_display_match_list;
- rl_already_prompted = 0;
-
- /* Keep track of previous gdb output. */
- tui_old_stdout = gdb_stdout;
- tui_old_stderr = gdb_stderr;
- tui_old_uiout = uiout;
-
- /* Reconfigure gdb output. */
- gdb_stdout = tui_stdout;
- gdb_stderr = tui_stderr;
- gdb_stdlog = gdb_stdout; /* for moment */
- gdb_stdtarg = gdb_stderr; /* for moment */
- uiout = tui_out;
-
- /* Save tty for SIGCONT. */
- savetty ();
- }
- else
- {
- /* Restore gdb output. */
- gdb_stdout = tui_old_stdout;
- gdb_stderr = tui_old_stderr;
- gdb_stdlog = gdb_stdout; /* for moment */
- gdb_stdtarg = gdb_stderr; /* for moment */
- uiout = tui_old_uiout;
-
- /* Restore readline. */
- rl_redisplay_function = tui_old_rl_redisplay_function;
- rl_deprep_term_function = tui_old_rl_deprep_terminal;
- rl_prep_term_function = tui_old_rl_prep_terminal;
- rl_getc_function = tui_old_rl_getc_function;
- rl_outstream = tui_old_rl_outstream;
- rl_completion_display_matches_hook = 0;
- readline_echoing_p = tui_old_readline_echoing_p;
- rl_already_prompted = 0;
-
- /* Save tty for SIGCONT. */
- savetty ();
- }
-}
-
-#ifdef SIGCONT
-/* Catch SIGCONT to restore the terminal and refresh the screen. */
-static void
-tui_cont_sig (int sig)
-{
- if (tui_active)
- {
- /* Restore the terminal setting because another process (shell)
- might have changed it. */
- resetty ();
-
- /* Force a refresh of the screen. */
- tuiRefreshAll ();
-
- /* Update cursor position on the screen. */
- wmove (cmdWin->generic.handle,
- cmdWin->detail.commandInfo.start_line,
- cmdWin->detail.commandInfo.curch);
- wrefresh (cmdWin->generic.handle);
- }
- signal (sig, tui_cont_sig);
-}
-#endif
-
-/* Initialize the IO for gdb in curses mode. */
-void
-tui_initialize_io ()
-{
-#ifdef SIGCONT
- signal (SIGCONT, tui_cont_sig);
-#endif
-
- /* Create tui output streams. */
- tui_stdout = tui_fileopen (stdout);
- tui_stderr = tui_fileopen (stderr);
- tui_out = tui_out_new (tui_stdout);
-
- /* Create the default UI. It is not created because we installed
- a init_ui_hook. */
- tui_old_uiout = uiout = cli_out_new (gdb_stdout);
-
-#ifdef TUI_USE_PIPE_FOR_READLINE
- /* Temporary solution for readline writing to stdout:
- redirect readline output in a pipe, read that pipe and
- output the content in the curses command window. */
- if (pipe (tui_readline_pipe) != 0)
- {
- fprintf_unfiltered (gdb_stderr, "Cannot create pipe for readline");
- exit (1);
- }
- tui_rl_outstream = fdopen (tui_readline_pipe[1], "w");
- if (tui_rl_outstream == 0)
- {
- fprintf_unfiltered (gdb_stderr, "Cannot redirect readline output");
- exit (1);
- }
- setvbuf (tui_rl_outstream, (char*) NULL, _IOLBF, 0);
-
-#ifdef O_NONBLOCK
- (void) fcntl (tui_readline_pipe[0], F_SETFL, O_NONBLOCK);
-#else
-#ifdef O_NDELAY
- (void) fcntl (tui_readline_pipe[0], F_SETFL, O_NDELAY);
-#endif
-#endif
- add_file_handler (tui_readline_pipe[0], tui_readline_output, 0);
-#else
- tui_rl_outstream = stdout;
-#endif
-}
-
-/* Get a character from the command window. This is called from the readline
- package. */
-int
-tui_getc (FILE *fp)
-{
- int ch;
- WINDOW *w;
-
- w = cmdWin->generic.handle;
-
-#ifdef TUI_USE_PIPE_FOR_READLINE
- /* Flush readline output. */
- tui_readline_output (GDB_READABLE, 0);
-#endif
-
- ch = wgetch (w);
- ch = _tuiHandleResizeDuringIO (ch);
-
- /* The \n must be echoed because it will not be printed by readline. */
- if (ch == '\n')
- {
- /* When hitting return with an empty input, gdb executes the last
- command. If we emit a newline, this fills up the command window
- with empty lines with gdb prompt at beginning. Instead of that,
- stay on the same line but provide a visual effect to show the
- user we recognized the command. */
- if (rl_end == 0)
- {
- wmove (w, cmdWin->detail.commandInfo.curLine, 0);
-
- /* Clear the line. This will blink the gdb prompt since
- it will be redrawn at the same line. */
- wclrtoeol (w);
- wrefresh (w);
- napms (20);
- }
- else
- {
- wmove (w, cmdWin->detail.commandInfo.curLine,
- cmdWin->detail.commandInfo.curch);
- waddch (w, ch);
- }
- }
-
- if (m_isCommandChar (ch))
- { /* Handle prev/next/up/down here */
- ch = tuiDispatchCtrlChar (ch);
- }
-
- if (ch == '\n' || ch == '\r' || ch == '\f')
- cmdWin->detail.commandInfo.curch = 0;
-#if 0
- else
- tuiIncrCommandCharCountBy (1);
-#endif
- if (ch == KEY_BACKSPACE)
- return '\b';
-
- return ch;
-}
-
-
-/* Cleanup when a resize has occured.
- Returns the character that must be processed. */
-static unsigned int
-_tuiHandleResizeDuringIO (unsigned int originalCh)
-{
- if (tuiWinResized ())
- {
- tuiRefreshAll ();
- dont_repeat ();
- tuiSetWinResizedTo (FALSE);
- return '\n';
- }
- else
- return originalCh;
-}
diff --git a/gdb/tui/tuiIO.h b/gdb/tui/tuiIO.h
deleted file mode 100644
index 40970b6..0000000
--- a/gdb/tui/tuiIO.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* TUI support I/O functions.
- Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
- Contributed by Hewlett-Packard Company.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#ifndef _TUI_IO_H
-#define _TUI_IO_H
-
-#include <stdio.h>
-
-/* Print the string in the curses command window. */
-extern void tui_puts (const char *);
-
-/* Setup the IO for curses or non-curses mode. */
-extern void tui_setup_io (int mode);
-
-/* Initialize the IO for gdb in curses mode. */
-extern void tui_initialize_io (void);
-
-/* Get a character from the command window. */
-extern int tui_getc (FILE*);
-
-/* Readline callback.
- Redisplay the command line with its prompt after readline has
- changed the edited text. */
-extern void tui_redisplay_readline (void);
-
-extern struct ui_out *tui_out;
-extern struct ui_out *tui_old_uiout;
-
-#define m_tuiStartNewLine tuiStartNewLines(1)
-#define m_isStartSequence(ch) (ch == 27)
-#define m_isEndSequence(ch) (ch == 126)
-#define m_isBackspace(ch) (ch == 8)
-#define m_isDeleteChar(ch) (ch == KEY_DC)
-#define m_isDeleteLine(ch) (ch == KEY_DL)
-#define m_isDeleteToEol(ch) (ch == KEY_EOL)
-#define m_isNextPage(ch) (ch == KEY_NPAGE)
-#define m_isPrevPage(ch) (ch == KEY_PPAGE)
-#define m_isLeftArrow(ch) (ch == KEY_LEFT)
-#define m_isRightArrow(ch) (ch == KEY_RIGHT)
-
-#define m_isCommandChar(ch) (m_isNextPage(ch) || m_isPrevPage(ch) || \
- m_isLeftArrow(ch) || m_isRightArrow(ch) || \
- (ch == KEY_UP) || (ch == KEY_DOWN) || \
- (ch == KEY_SF) || (ch == KEY_SR) || \
- (ch == (int)'\f') || m_isStartSequence(ch))
-
-#define m_isXdbStyleCommandChar(ch) (m_isNextPage(ch) || m_isPrevPage(ch))
-
-
-#endif
-
diff --git a/gdb/tui/tuiLayout.c b/gdb/tui/tuiLayout.c
deleted file mode 100644
index b79bfcb..0000000
--- a/gdb/tui/tuiLayout.c
+++ /dev/null
@@ -1,1148 +0,0 @@
-/* TUI layout window management.
-
- Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation,
- Inc.
-
- Contributed by Hewlett-Packard Company.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include "defs.h"
-#include "command.h"
-#include "symtab.h"
-#include "frame.h"
-#include "source.h"
-#include <ctype.h>
-
-#include "tui.h"
-#include "tuiData.h"
-#include "tuiDataWin.h"
-#include "tuiGeneralWin.h"
-#include "tuiStack.h"
-#include "tuiRegs.h"
-#include "tuiWin.h"
-#include "tuiSourceWin.h"
-#include "tuiDisassem.h"
-
-#ifdef HAVE_NCURSES_H
-#include <ncurses.h>
-#else
-#ifdef HAVE_CURSES_H
-#include <curses.h>
-#endif
-#endif
-
-/*******************************
-** Static Local Decls
-********************************/
-static void showLayout (TuiLayoutType);
-static void _initGenWinInfo (TuiGenWinInfoPtr, TuiWinType, int, int, int, int);
-static void _initAndMakeWin (Opaque *, TuiWinType, int, int, int, int, int);
-static void _showSourceOrDisassemAndCommand (TuiLayoutType);
-static void _makeSourceOrDisassemWindow (TuiWinInfoPtr *, TuiWinType, int, int);
-static void _makeCommandWindow (TuiWinInfoPtr *, int, int);
-static void _makeSourceWindow (TuiWinInfoPtr *, int, int);
-static void _makeDisassemWindow (TuiWinInfoPtr *, int, int);
-static void _makeDataWindow (TuiWinInfoPtr *, int, int);
-static void _showSourceCommand (void);
-static void _showDisassemCommand (void);
-static void _showSourceDisassemCommand (void);
-static void _showData (TuiLayoutType);
-static TuiLayoutType _nextLayout (void);
-static TuiLayoutType _prevLayout (void);
-static void _tuiLayout_command (char *, int);
-static void _tuiToggleLayout_command (char *, int);
-static void _tuiToggleSplitLayout_command (char *, int);
-static CORE_ADDR _extractDisplayStartAddr (void);
-static void _tuiHandleXDBLayout (TuiLayoutDefPtr);
-
-
-/***************************************
-** DEFINITIONS
-***************************************/
-
-#define LAYOUT_USAGE "Usage: layout prev | next | <layout_name> \n"
-
-/* Show the screen layout defined. */
-static void
-showLayout (TuiLayoutType layout)
-{
- TuiLayoutType curLayout = currentLayout ();
-
- if (layout != curLayout)
- {
- /*
- ** Since the new layout may cause changes in window size, we
- ** should free the content and reallocate on next display of
- ** source/asm
- */
- freeAllSourceWinsContent ();
- clearSourceWindows ();
- if (layout == SRC_DATA_COMMAND || layout == DISASSEM_DATA_COMMAND)
- {
- _showData (layout);
- refreshAll (winList);
- }
- else
- {
- /* First make the current layout be invisible */
- m_allBeInvisible ();
- m_beInvisible (locatorWinInfoPtr ());
-
- switch (layout)
- {
- /* Now show the new layout */
- case SRC_COMMAND:
- _showSourceCommand ();
- addToSourceWindows (srcWin);
- break;
- case DISASSEM_COMMAND:
- _showDisassemCommand ();
- addToSourceWindows (disassemWin);
- break;
- case SRC_DISASSEM_COMMAND:
- _showSourceDisassemCommand ();
- addToSourceWindows (srcWin);
- addToSourceWindows (disassemWin);
- break;
- default:
- break;
- }
- }
- }
-}
-
-
-/*
- ** tuiSetLayout()
- ** Function to set the layout to SRC_COMMAND, DISASSEM_COMMAND,
- ** SRC_DISASSEM_COMMAND, SRC_DATA_COMMAND, or DISASSEM_DATA_COMMAND.
- ** If the layout is SRC_DATA_COMMAND, DISASSEM_DATA_COMMAND, or
- ** UNDEFINED_LAYOUT, then the data window is populated according
- ** to regsDisplayType.
- */
-TuiStatus
-tuiSetLayout (TuiLayoutType layoutType,
- TuiRegisterDisplayType regsDisplayType)
-{
- TuiStatus status = TUI_SUCCESS;
-
- if (layoutType != UNDEFINED_LAYOUT || regsDisplayType != TUI_UNDEFINED_REGS)
- {
- TuiLayoutType curLayout = currentLayout (), newLayout = UNDEFINED_LAYOUT;
- int regsPopulate = FALSE;
- CORE_ADDR addr = _extractDisplayStartAddr ();
- TuiWinInfoPtr newWinWithFocus = (TuiWinInfoPtr) NULL, winWithFocus = tuiWinWithFocus ();
- TuiLayoutDefPtr layoutDef = tuiLayoutDef ();
-
-
- if (layoutType == UNDEFINED_LAYOUT &&
- regsDisplayType != TUI_UNDEFINED_REGS)
- {
- if (curLayout == SRC_DISASSEM_COMMAND)
- newLayout = DISASSEM_DATA_COMMAND;
- else if (curLayout == SRC_COMMAND || curLayout == SRC_DATA_COMMAND)
- newLayout = SRC_DATA_COMMAND;
- else if (curLayout == DISASSEM_COMMAND ||
- curLayout == DISASSEM_DATA_COMMAND)
- newLayout = DISASSEM_DATA_COMMAND;
- }
- else
- newLayout = layoutType;
-
- regsPopulate = (newLayout == SRC_DATA_COMMAND ||
- newLayout == DISASSEM_DATA_COMMAND ||
- regsDisplayType != TUI_UNDEFINED_REGS);
- if (newLayout != curLayout || regsDisplayType != TUI_UNDEFINED_REGS)
- {
- if (newLayout != curLayout)
- {
- showLayout (newLayout);
- /*
- ** Now determine where focus should be
- */
- if (winWithFocus != cmdWin)
- {
- switch (newLayout)
- {
- case SRC_COMMAND:
- tuiSetWinFocusTo (srcWin);
- layoutDef->displayMode = SRC_WIN;
- layoutDef->split = FALSE;
- break;
- case DISASSEM_COMMAND:
- /* the previous layout was not showing
- ** code. this can happen if there is no
- ** source available:
- ** 1. if the source file is in another dir OR
- ** 2. if target was compiled without -g
- ** We still want to show the assembly though!
- */
- addr = tuiGetBeginAsmAddress ();
- tuiSetWinFocusTo (disassemWin);
- layoutDef->displayMode = DISASSEM_WIN;
- layoutDef->split = FALSE;
- break;
- case SRC_DISASSEM_COMMAND:
- /* the previous layout was not showing
- ** code. this can happen if there is no
- ** source available:
- ** 1. if the source file is in another dir OR
- ** 2. if target was compiled without -g
- ** We still want to show the assembly though!
- */
- addr = tuiGetBeginAsmAddress ();
- if (winWithFocus == srcWin)
- tuiSetWinFocusTo (srcWin);
- else
- tuiSetWinFocusTo (disassemWin);
- layoutDef->split = TRUE;
- break;
- case SRC_DATA_COMMAND:
- if (winWithFocus != dataWin)
- tuiSetWinFocusTo (srcWin);
- else
- tuiSetWinFocusTo (dataWin);
- layoutDef->displayMode = SRC_WIN;
- layoutDef->split = FALSE;
- break;
- case DISASSEM_DATA_COMMAND:
- /* the previous layout was not showing
- ** code. this can happen if there is no
- ** source available:
- ** 1. if the source file is in another dir OR
- ** 2. if target was compiled without -g
- ** We still want to show the assembly though!
- */
- addr = tuiGetBeginAsmAddress ();
- if (winWithFocus != dataWin)
- tuiSetWinFocusTo (disassemWin);
- else
- tuiSetWinFocusTo (dataWin);
- layoutDef->displayMode = DISASSEM_WIN;
- layoutDef->split = FALSE;
- break;
- default:
- break;
- }
- }
- if (newWinWithFocus != (TuiWinInfoPtr) NULL)
- tuiSetWinFocusTo (newWinWithFocus);
- /*
- ** Now update the window content
- */
- if (!regsPopulate &&
- (newLayout == SRC_DATA_COMMAND ||
- newLayout == DISASSEM_DATA_COMMAND))
- tuiDisplayAllData ();
-
- tuiUpdateSourceWindowsWithAddr (addr);
- }
- if (regsPopulate)
- {
- layoutDef->regsDisplayType =
- (regsDisplayType == TUI_UNDEFINED_REGS ?
- TUI_GENERAL_REGS : regsDisplayType);
- tuiShowRegisters (layoutDef->regsDisplayType);
- }
- }
- }
- else
- status = TUI_FAILURE;
-
- return status;
-}
-
-/*
- ** tuiAddWinToLayout().
- ** Add the specified window to the layout in a logical way.
- ** This means setting up the most logical layout given the
- ** window to be added.
- */
-void
-tuiAddWinToLayout (TuiWinType type)
-{
- TuiLayoutType curLayout = currentLayout ();
-
- switch (type)
- {
- case SRC_WIN:
- if (curLayout != SRC_COMMAND &&
- curLayout != SRC_DISASSEM_COMMAND &&
- curLayout != SRC_DATA_COMMAND)
- {
- clearSourceWindowsDetail ();
- if (curLayout == DISASSEM_DATA_COMMAND)
- showLayout (SRC_DATA_COMMAND);
- else
- showLayout (SRC_COMMAND);
- }
- break;
- case DISASSEM_WIN:
- if (curLayout != DISASSEM_COMMAND &&
- curLayout != SRC_DISASSEM_COMMAND &&
- curLayout != DISASSEM_DATA_COMMAND)
- {
- clearSourceWindowsDetail ();
- if (curLayout == SRC_DATA_COMMAND)
- showLayout (DISASSEM_DATA_COMMAND);
- else
- showLayout (DISASSEM_COMMAND);
- }
- break;
- case DATA_WIN:
- if (curLayout != SRC_DATA_COMMAND &&
- curLayout != DISASSEM_DATA_COMMAND)
- {
- if (curLayout == DISASSEM_COMMAND)
- showLayout (DISASSEM_DATA_COMMAND);
- else
- showLayout (SRC_DATA_COMMAND);
- }
- break;
- default:
- break;
- }
-
- return;
-} /* tuiAddWinToLayout */
-
-
-/*
- ** tuiDefaultWinHeight().
- ** Answer the height of a window. If it hasn't been created yet,
- ** answer what the height of a window would be based upon its
- ** type and the layout.
- */
-int
-tuiDefaultWinHeight (TuiWinType type, TuiLayoutType layout)
-{
- int h;
-
- if (winList[type] != (TuiWinInfoPtr) NULL)
- h = winList[type]->generic.height;
- else
- {
- switch (layout)
- {
- case SRC_COMMAND:
- case DISASSEM_COMMAND:
- if (m_winPtrIsNull (cmdWin))
- h = termHeight () / 2;
- else
- h = termHeight () - cmdWin->generic.height;
- break;
- case SRC_DISASSEM_COMMAND:
- case SRC_DATA_COMMAND:
- case DISASSEM_DATA_COMMAND:
- if (m_winPtrIsNull (cmdWin))
- h = termHeight () / 3;
- else
- h = (termHeight () - cmdWin->generic.height) / 2;
- break;
- default:
- h = 0;
- break;
- }
- }
-
- return h;
-} /* tuiDefaultWinHeight */
-
-
-/*
- ** tuiDefaultWinViewportHeight().
- ** Answer the height of a window. If it hasn't been created yet,
- ** answer what the height of a window would be based upon its
- ** type and the layout.
- */
-int
-tuiDefaultWinViewportHeight (TuiWinType type, TuiLayoutType layout)
-{
- int h;
-
- h = tuiDefaultWinHeight (type, layout);
-
- if (winList[type] == cmdWin)
- h -= 1;
- else
- h -= 2;
-
- return h;
-} /* tuiDefaultWinViewportHeight */
-
-
-/*
- ** _initialize_tuiLayout().
- ** Function to initialize gdb commands, for tui window layout
- ** manipulation.
- */
-void
-_initialize_tuiLayout (void)
-{
- add_com ("layout", class_tui, _tuiLayout_command,
- "Change the layout of windows.\n\
-Usage: layout prev | next | <layout_name> \n\
-Layout names are:\n\
- src : Displays source and command windows.\n\
- asm : Displays disassembly and command windows.\n\
- split : Displays source, disassembly and command windows.\n\
- regs : Displays register window. If existing layout\n\
- is source/command or assembly/command, the \n\
- register window is displayed. If the\n\
- source/assembly/command (split) is displayed, \n\
- the register window is displayed with \n\
- the window that has current logical focus.\n");
- if (xdb_commands)
- {
- add_com ("td", class_tui, _tuiToggleLayout_command,
- "Toggle between Source/Command and Disassembly/Command layouts.\n");
- add_com ("ts", class_tui, _tuiToggleSplitLayout_command,
- "Toggle between Source/Command or Disassembly/Command and \n\
-Source/Disassembly/Command layouts.\n");
- }
-}
-
-
-/*************************
-** STATIC LOCAL FUNCTIONS
-**************************/
-
-
-/*
- ** _tuiSetLayoutTo()
- ** Function to set the layout to SRC, ASM, SPLIT, NEXT, PREV, DATA, REGS,
- ** $REGS, $GREGS, $FREGS, $SREGS.
- */
-TuiStatus
-tui_set_layout (const char *layoutName)
-{
- TuiStatus status = TUI_SUCCESS;
-
- if (layoutName != (char *) NULL)
- {
- register int i;
- register char *bufPtr;
- TuiLayoutType newLayout = UNDEFINED_LAYOUT;
- TuiRegisterDisplayType dpyType = TUI_UNDEFINED_REGS;
- TuiLayoutType curLayout = currentLayout ();
-
- bufPtr = (char *) xstrdup (layoutName);
- for (i = 0; (i < strlen (layoutName)); i++)
- bufPtr[i] = toupper (bufPtr[i]);
-
- /* First check for ambiguous input */
- if (strlen (bufPtr) <= 1 && (*bufPtr == 'S' || *bufPtr == '$'))
- {
- warning ("Ambiguous command input.\n");
- status = TUI_FAILURE;
- }
- else
- {
- if (subset_compare (bufPtr, "SRC"))
- newLayout = SRC_COMMAND;
- else if (subset_compare (bufPtr, "ASM"))
- newLayout = DISASSEM_COMMAND;
- else if (subset_compare (bufPtr, "SPLIT"))
- newLayout = SRC_DISASSEM_COMMAND;
- else if (subset_compare (bufPtr, "REGS") ||
- subset_compare (bufPtr, TUI_GENERAL_SPECIAL_REGS_NAME) ||
- subset_compare (bufPtr, TUI_GENERAL_REGS_NAME) ||
- subset_compare (bufPtr, TUI_FLOAT_REGS_NAME) ||
- subset_compare (bufPtr, TUI_SPECIAL_REGS_NAME))
- {
- if (curLayout == SRC_COMMAND || curLayout == SRC_DATA_COMMAND)
- newLayout = SRC_DATA_COMMAND;
- else
- newLayout = DISASSEM_DATA_COMMAND;
-
-/* could ifdef out the following code. when compile with -z, there are null
- pointer references that cause a core dump if 'layout regs' is the first
- layout command issued by the user. HP has asked us to hook up this code
- - edie epstein
- */
- if (subset_compare (bufPtr, TUI_FLOAT_REGS_NAME))
- {
- if (dataWin->detail.dataDisplayInfo.regsDisplayType !=
- TUI_SFLOAT_REGS &&
- dataWin->detail.dataDisplayInfo.regsDisplayType !=
- TUI_DFLOAT_REGS)
- dpyType = TUI_SFLOAT_REGS;
- else
- dpyType =
- dataWin->detail.dataDisplayInfo.regsDisplayType;
- }
- else if (subset_compare (bufPtr,
- TUI_GENERAL_SPECIAL_REGS_NAME))
- dpyType = TUI_GENERAL_AND_SPECIAL_REGS;
- else if (subset_compare (bufPtr, TUI_GENERAL_REGS_NAME))
- dpyType = TUI_GENERAL_REGS;
- else if (subset_compare (bufPtr, TUI_SPECIAL_REGS_NAME))
- dpyType = TUI_SPECIAL_REGS;
- else if (dataWin)
- {
- if (dataWin->detail.dataDisplayInfo.regsDisplayType !=
- TUI_UNDEFINED_REGS)
- dpyType =
- dataWin->detail.dataDisplayInfo.regsDisplayType;
- else
- dpyType = TUI_GENERAL_REGS;
- }
-
-/* end of potential ifdef
- */
-
-/* if ifdefed out code above, then assume that the user wishes to display the
- general purpose registers
- */
-
-/* dpyType = TUI_GENERAL_REGS;
- */
- }
- else if (subset_compare (bufPtr, "NEXT"))
- newLayout = _nextLayout ();
- else if (subset_compare (bufPtr, "PREV"))
- newLayout = _prevLayout ();
- else
- status = TUI_FAILURE;
- xfree (bufPtr);
-
- tuiSetLayout (newLayout, dpyType);
- }
- }
- else
- status = TUI_FAILURE;
-
- return status;
-}
-
-
-static CORE_ADDR
-_extractDisplayStartAddr (void)
-{
- TuiLayoutType curLayout = currentLayout ();
- CORE_ADDR addr;
- CORE_ADDR pc;
- struct symtab_and_line cursal = get_current_source_symtab_and_line ();
-
- switch (curLayout)
- {
- case SRC_COMMAND:
- case SRC_DATA_COMMAND:
- find_line_pc (cursal.symtab,
- srcWin->detail.sourceInfo.startLineOrAddr.lineNo,
- &pc);
- addr = pc;
- break;
- case DISASSEM_COMMAND:
- case SRC_DISASSEM_COMMAND:
- case DISASSEM_DATA_COMMAND:
- addr = disassemWin->detail.sourceInfo.startLineOrAddr.addr;
- break;
- default:
- addr = 0;
- break;
- }
-
- return addr;
-} /* _extractDisplayStartAddr */
-
-
-static void
-_tuiHandleXDBLayout (TuiLayoutDefPtr layoutDef)
-{
- if (layoutDef->split)
- {
- tuiSetLayout (SRC_DISASSEM_COMMAND, TUI_UNDEFINED_REGS);
- tuiSetWinFocusTo (winList[layoutDef->displayMode]);
- }
- else
- {
- if (layoutDef->displayMode == SRC_WIN)
- tuiSetLayout (SRC_COMMAND, TUI_UNDEFINED_REGS);
- else
- tuiSetLayout (DISASSEM_DATA_COMMAND, layoutDef->regsDisplayType);
- }
-
-
- return;
-} /* _tuiHandleXDBLayout */
-
-
-static void
-_tuiToggleLayout_command (char *arg, int fromTTY)
-{
- TuiLayoutDefPtr layoutDef = tuiLayoutDef ();
-
- /* Make sure the curses mode is enabled. */
- tui_enable ();
- if (layoutDef->displayMode == SRC_WIN)
- layoutDef->displayMode = DISASSEM_WIN;
- else
- layoutDef->displayMode = SRC_WIN;
-
- if (!layoutDef->split)
- _tuiHandleXDBLayout (layoutDef);
-
-}
-
-
-static void
-_tuiToggleSplitLayout_command (char *arg, int fromTTY)
-{
- TuiLayoutDefPtr layoutDef = tuiLayoutDef ();
-
- /* Make sure the curses mode is enabled. */
- tui_enable ();
- layoutDef->split = (!layoutDef->split);
- _tuiHandleXDBLayout (layoutDef);
-
-}
-
-
-static void
-_tuiLayout_command (char *arg, int fromTTY)
-{
- /* Make sure the curses mode is enabled. */
- tui_enable ();
-
- /* Switch to the selected layout. */
- if (tui_set_layout (arg) != TUI_SUCCESS)
- warning ("Invalid layout specified.\n%s", LAYOUT_USAGE);
-
-}
-
-/*
- ** _nextLayout().
- ** Answer the previous layout to cycle to.
- */
-static TuiLayoutType
-_nextLayout (void)
-{
- TuiLayoutType newLayout;
-
- newLayout = currentLayout ();
- if (newLayout == UNDEFINED_LAYOUT)
- newLayout = SRC_COMMAND;
- else
- {
- newLayout++;
- if (newLayout == UNDEFINED_LAYOUT)
- newLayout = SRC_COMMAND;
- }
-
- return newLayout;
-} /* _nextLayout */
-
-
-/*
- ** _prevLayout().
- ** Answer the next layout to cycle to.
- */
-static TuiLayoutType
-_prevLayout (void)
-{
- TuiLayoutType newLayout;
-
- newLayout = currentLayout ();
- if (newLayout == SRC_COMMAND)
- newLayout = DISASSEM_DATA_COMMAND;
- else
- {
- newLayout--;
- if (newLayout == UNDEFINED_LAYOUT)
- newLayout = DISASSEM_DATA_COMMAND;
- }
-
- return newLayout;
-} /* _prevLayout */
-
-
-
-/*
- ** _makeCommandWindow().
- */
-static void
-_makeCommandWindow (TuiWinInfoPtr * winInfoPtr, int height, int originY)
-{
- _initAndMakeWin ((Opaque *) winInfoPtr,
- CMD_WIN,
- height,
- termWidth (),
- 0,
- originY,
- DONT_BOX_WINDOW);
-
- (*winInfoPtr)->canHighlight = FALSE;
-
- return;
-} /* _makeCommandWindow */
-
-
-/*
- ** _makeSourceWindow().
- */
-static void
-_makeSourceWindow (TuiWinInfoPtr * winInfoPtr, int height, int originY)
-{
- _makeSourceOrDisassemWindow (winInfoPtr, SRC_WIN, height, originY);
-
- return;
-} /* _makeSourceWindow */
-
-
-/*
- ** _makeDisassemWindow().
- */
-static void
-_makeDisassemWindow (TuiWinInfoPtr * winInfoPtr, int height, int originY)
-{
- _makeSourceOrDisassemWindow (winInfoPtr, DISASSEM_WIN, height, originY);
-
- return;
-} /* _makeDisassemWindow */
-
-
-/*
- ** _makeDataWindow().
- */
-static void
-_makeDataWindow (TuiWinInfoPtr * winInfoPtr, int height, int originY)
-{
- _initAndMakeWin ((Opaque *) winInfoPtr,
- DATA_WIN,
- height,
- termWidth (),
- 0,
- originY,
- BOX_WINDOW);
-
- return;
-} /* _makeDataWindow */
-
-
-
-/*
- ** _showSourceCommand().
- ** Show the Source/Command layout
- */
-static void
-_showSourceCommand (void)
-{
- _showSourceOrDisassemAndCommand (SRC_COMMAND);
-
- return;
-} /* _showSourceCommand */
-
-
-/*
- ** _showDisassemCommand().
- ** Show the Dissassem/Command layout
- */
-static void
-_showDisassemCommand (void)
-{
- _showSourceOrDisassemAndCommand (DISASSEM_COMMAND);
-
- return;
-} /* _showDisassemCommand */
-
-
-/*
- ** _showSourceDisassemCommand().
- ** Show the Source/Disassem/Command layout
- */
-static void
-_showSourceDisassemCommand (void)
-{
- if (currentLayout () != SRC_DISASSEM_COMMAND)
- {
- int cmdHeight, srcHeight, asmHeight;
-
- if (m_winPtrNotNull (cmdWin))
- cmdHeight = cmdWin->generic.height;
- else
- cmdHeight = termHeight () / 3;
-
- srcHeight = (termHeight () - cmdHeight) / 2;
- asmHeight = termHeight () - (srcHeight + cmdHeight);
-
- if (m_winPtrIsNull (srcWin))
- _makeSourceWindow (&srcWin, srcHeight, 0);
- else
- {
- _initGenWinInfo (&srcWin->generic,
- srcWin->generic.type,
- srcHeight,
- srcWin->generic.width,
- srcWin->detail.sourceInfo.executionInfo->width,
- 0);
- srcWin->canHighlight = TRUE;
- _initGenWinInfo (srcWin->detail.sourceInfo.executionInfo,
- EXEC_INFO_WIN,
- srcHeight,
- 3,
- 0,
- 0);
- m_beVisible (srcWin);
- m_beVisible (srcWin->detail.sourceInfo.executionInfo);
- srcWin->detail.sourceInfo.hasLocator = FALSE;;
- }
- if (m_winPtrNotNull (srcWin))
- {
- TuiGenWinInfoPtr locator = locatorWinInfoPtr ();
-
- tuiShowSourceContent (srcWin);
- if (m_winPtrIsNull (disassemWin))
- {
- _makeDisassemWindow (&disassemWin, asmHeight, srcHeight - 1);
- _initAndMakeWin ((Opaque *) & locator,
- LOCATOR_WIN,
- 2 /* 1 */ ,
- termWidth (),
- 0,
- (srcHeight + asmHeight) - 1,
- DONT_BOX_WINDOW);
- }
- else
- {
- _initGenWinInfo (locator,
- LOCATOR_WIN,
- 2 /* 1 */ ,
- termWidth (),
- 0,
- (srcHeight + asmHeight) - 1);
- disassemWin->detail.sourceInfo.hasLocator = TRUE;
- _initGenWinInfo (
- &disassemWin->generic,
- disassemWin->generic.type,
- asmHeight,
- disassemWin->generic.width,
- disassemWin->detail.sourceInfo.executionInfo->width,
- srcHeight - 1);
- _initGenWinInfo (disassemWin->detail.sourceInfo.executionInfo,
- EXEC_INFO_WIN,
- asmHeight,
- 3,
- 0,
- srcHeight - 1);
- disassemWin->canHighlight = TRUE;
- m_beVisible (disassemWin);
- m_beVisible (disassemWin->detail.sourceInfo.executionInfo);
- }
- if (m_winPtrNotNull (disassemWin))
- {
- srcWin->detail.sourceInfo.hasLocator = FALSE;
- disassemWin->detail.sourceInfo.hasLocator = TRUE;
- m_beVisible (locator);
- tuiShowLocatorContent ();
- tuiShowSourceContent (disassemWin);
-
- if (m_winPtrIsNull (cmdWin))
- _makeCommandWindow (&cmdWin,
- cmdHeight,
- termHeight () - cmdHeight);
- else
- {
- _initGenWinInfo (&cmdWin->generic,
- cmdWin->generic.type,
- cmdWin->generic.height,
- cmdWin->generic.width,
- 0,
- cmdWin->generic.origin.y);
- cmdWin->canHighlight = FALSE;
- m_beVisible (cmdWin);
- }
- if (m_winPtrNotNull (cmdWin))
- tuiRefreshWin (&cmdWin->generic);
- }
- }
- setCurrentLayoutTo (SRC_DISASSEM_COMMAND);
- }
-
- return;
-} /* _showSourceDisassemCommand */
-
-
-/*
- ** _showData().
- ** Show the Source/Data/Command or the Dissassembly/Data/Command layout
- */
-static void
-_showData (TuiLayoutType newLayout)
-{
- int totalHeight = (termHeight () - cmdWin->generic.height);
- int srcHeight, dataHeight;
- TuiWinType winType;
- TuiGenWinInfoPtr locator = locatorWinInfoPtr ();
-
-
- dataHeight = totalHeight / 2;
- srcHeight = totalHeight - dataHeight;
- m_allBeInvisible ();
- m_beInvisible (locator);
- _makeDataWindow (&dataWin, dataHeight, 0);
- dataWin->canHighlight = TRUE;
- if (newLayout == SRC_DATA_COMMAND)
- winType = SRC_WIN;
- else
- winType = DISASSEM_WIN;
- if (m_winPtrIsNull (winList[winType]))
- {
- if (winType == SRC_WIN)
- _makeSourceWindow (&winList[winType], srcHeight, dataHeight - 1);
- else
- _makeDisassemWindow (&winList[winType], srcHeight, dataHeight - 1);
- _initAndMakeWin ((Opaque *) & locator,
- LOCATOR_WIN,
- 2 /* 1 */ ,
- termWidth (),
- 0,
- totalHeight - 1,
- DONT_BOX_WINDOW);
- }
- else
- {
- _initGenWinInfo (&winList[winType]->generic,
- winList[winType]->generic.type,
- srcHeight,
- winList[winType]->generic.width,
- winList[winType]->detail.sourceInfo.executionInfo->width,
- dataHeight - 1);
- _initGenWinInfo (winList[winType]->detail.sourceInfo.executionInfo,
- EXEC_INFO_WIN,
- srcHeight,
- 3,
- 0,
- dataHeight - 1);
- m_beVisible (winList[winType]);
- m_beVisible (winList[winType]->detail.sourceInfo.executionInfo);
- _initGenWinInfo (locator,
- LOCATOR_WIN,
- 2 /* 1 */ ,
- termWidth (),
- 0,
- totalHeight - 1);
- }
- winList[winType]->detail.sourceInfo.hasLocator = TRUE;
- m_beVisible (locator);
- tuiShowLocatorContent ();
- addToSourceWindows (winList[winType]);
- setCurrentLayoutTo (newLayout);
-
- return;
-} /* _showData */
-
-/*
- ** _initGenWinInfo().
- */
-static void
-_initGenWinInfo (TuiGenWinInfoPtr winInfo, TuiWinType type,
- int height, int width, int originX, int originY)
-{
- int h = height;
-
- winInfo->type = type;
- winInfo->width = width;
- winInfo->height = h;
- if (h > 1)
- {
- winInfo->viewportHeight = h - 1;
- if (winInfo->type != CMD_WIN)
- winInfo->viewportHeight--;
- }
- else
- winInfo->viewportHeight = 1;
- winInfo->origin.x = originX;
- winInfo->origin.y = originY;
-
- return;
-} /* _initGenWinInfo */
-
-/*
- ** _initAndMakeWin().
- */
-static void
-_initAndMakeWin (Opaque * winInfoPtr, TuiWinType winType,
- int height, int width, int originX, int originY, int boxIt)
-{
- Opaque opaqueWinInfo = *winInfoPtr;
- TuiGenWinInfoPtr generic;
-
- if (opaqueWinInfo == (Opaque) NULL)
- {
- if (m_winIsAuxillary (winType))
- opaqueWinInfo = (Opaque) allocGenericWinInfo ();
- else
- opaqueWinInfo = (Opaque) allocWinInfo (winType);
- }
- if (m_winIsAuxillary (winType))
- generic = (TuiGenWinInfoPtr) opaqueWinInfo;
- else
- generic = &((TuiWinInfoPtr) opaqueWinInfo)->generic;
-
- if (opaqueWinInfo != (Opaque) NULL)
- {
- _initGenWinInfo (generic, winType, height, width, originX, originY);
- if (!m_winIsAuxillary (winType))
- {
- if (generic->type == CMD_WIN)
- ((TuiWinInfoPtr) opaqueWinInfo)->canHighlight = FALSE;
- else
- ((TuiWinInfoPtr) opaqueWinInfo)->canHighlight = TRUE;
- }
- makeWindow (generic, boxIt);
- }
- *winInfoPtr = opaqueWinInfo;
-}
-
-
-/*
- ** _makeSourceOrDisassemWindow().
- */
-static void
-_makeSourceOrDisassemWindow (TuiWinInfoPtr * winInfoPtr, TuiWinType type,
- int height, int originY)
-{
- TuiGenWinInfoPtr executionInfo = (TuiGenWinInfoPtr) NULL;
-
- /*
- ** Create the exeuction info window.
- */
- if (type == SRC_WIN)
- executionInfo = sourceExecInfoWinPtr ();
- else
- executionInfo = disassemExecInfoWinPtr ();
- _initAndMakeWin ((Opaque *) & executionInfo,
- EXEC_INFO_WIN,
- height,
- 3,
- 0,
- originY,
- DONT_BOX_WINDOW);
- /*
- ** Now create the source window.
- */
- _initAndMakeWin ((Opaque *) winInfoPtr,
- type,
- height,
- termWidth () - executionInfo->width,
- executionInfo->width,
- originY,
- BOX_WINDOW);
-
- (*winInfoPtr)->detail.sourceInfo.executionInfo = executionInfo;
-
- return;
-} /* _makeSourceOrDisassemWindow */
-
-
-/*
- ** _showSourceOrDisassemAndCommand().
- ** Show the Source/Command or the Disassem layout
- */
-static void
-_showSourceOrDisassemAndCommand (TuiLayoutType layoutType)
-{
- if (currentLayout () != layoutType)
- {
- TuiWinInfoPtr *winInfoPtr;
- int srcHeight, cmdHeight;
- TuiGenWinInfoPtr locator = locatorWinInfoPtr ();
-
- if (m_winPtrNotNull (cmdWin))
- cmdHeight = cmdWin->generic.height;
- else
- cmdHeight = termHeight () / 3;
- srcHeight = termHeight () - cmdHeight;
-
-
- if (layoutType == SRC_COMMAND)
- winInfoPtr = &srcWin;
- else
- winInfoPtr = &disassemWin;
-
- if (m_winPtrIsNull (*winInfoPtr))
- {
- if (layoutType == SRC_COMMAND)
- _makeSourceWindow (winInfoPtr, srcHeight - 1, 0);
- else
- _makeDisassemWindow (winInfoPtr, srcHeight - 1, 0);
- _initAndMakeWin ((Opaque *) & locator,
- LOCATOR_WIN,
- 2 /* 1 */ ,
- termWidth (),
- 0,
- srcHeight - 1,
- DONT_BOX_WINDOW);
- }
- else
- {
- _initGenWinInfo (locator,
- LOCATOR_WIN,
- 2 /* 1 */ ,
- termWidth (),
- 0,
- srcHeight - 1);
- (*winInfoPtr)->detail.sourceInfo.hasLocator = TRUE;
- _initGenWinInfo (
- &(*winInfoPtr)->generic,
- (*winInfoPtr)->generic.type,
- srcHeight - 1,
- (*winInfoPtr)->generic.width,
- (*winInfoPtr)->detail.sourceInfo.executionInfo->width,
- 0);
- _initGenWinInfo ((*winInfoPtr)->detail.sourceInfo.executionInfo,
- EXEC_INFO_WIN,
- srcHeight - 1,
- 3,
- 0,
- 0);
- (*winInfoPtr)->canHighlight = TRUE;
- m_beVisible (*winInfoPtr);
- m_beVisible ((*winInfoPtr)->detail.sourceInfo.executionInfo);
- }
- if (m_winPtrNotNull (*winInfoPtr))
- {
- (*winInfoPtr)->detail.sourceInfo.hasLocator = TRUE;
- m_beVisible (locator);
- tuiShowLocatorContent ();
- tuiShowSourceContent (*winInfoPtr);
-
- if (m_winPtrIsNull (cmdWin))
- {
- _makeCommandWindow (&cmdWin, cmdHeight, srcHeight);
- tuiRefreshWin (&cmdWin->generic);
- }
- else
- {
- _initGenWinInfo (&cmdWin->generic,
- cmdWin->generic.type,
- cmdWin->generic.height,
- cmdWin->generic.width,
- cmdWin->generic.origin.x,
- cmdWin->generic.origin.y);
- cmdWin->canHighlight = FALSE;
- m_beVisible (cmdWin);
- }
- }
- setCurrentLayoutTo (layoutType);
- }
-
- return;
-} /* _showSourceOrDisassemAndCommand */
diff --git a/gdb/tui/tuiLayout.h b/gdb/tui/tuiLayout.h
deleted file mode 100644
index f6b0ed7..0000000
--- a/gdb/tui/tuiLayout.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* TUI layout window management.
- Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
- Contributed by Hewlett-Packard Company.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#ifndef TUI_LAYOUT_H
-#define TUI_LAYOUT_H
-
-extern void tuiAddWinToLayout (TuiWinType);
-extern int tuiDefaultWinHeight (TuiWinType, TuiLayoutType);
-extern int tuiDefaultWinViewportHeight (TuiWinType, TuiLayoutType);
-extern TuiStatus tuiSetLayout (TuiLayoutType, TuiRegisterDisplayType);
-
-#endif /*TUI_LAYOUT_H */
diff --git a/gdb/tui/tuiRegs.c b/gdb/tui/tuiRegs.c
deleted file mode 100644
index 3a0c459..0000000
--- a/gdb/tui/tuiRegs.c
+++ /dev/null
@@ -1,1047 +0,0 @@
-/* TUI display registers in window.
-
- Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation,
- Inc.
-
- Contributed by Hewlett-Packard Company.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include "defs.h"
-#include "tui.h"
-#include "tuiData.h"
-#include "symtab.h"
-#include "gdbtypes.h"
-#include "gdbcmd.h"
-#include "frame.h"
-#include "regcache.h"
-#include "inferior.h"
-#include "target.h"
-#include "tuiLayout.h"
-#include "tuiWin.h"
-#include "tuiDataWin.h"
-#include "tuiGeneralWin.h"
-#include "tui-file.h"
-
-#ifdef HAVE_NCURSES_H
-#include <ncurses.h>
-#else
-#ifdef HAVE_CURSES_H
-#include <curses.h>
-#endif
-#endif
-
-/*****************************************
-** LOCAL DEFINITIONS **
-******************************************/
-#define DOUBLE_FLOAT_LABEL_WIDTH 6
-#define DOUBLE_FLOAT_LABEL_FMT "%6.6s: "
-#define DOUBLE_FLOAT_VALUE_WIDTH 30 /*min of 16 but may be in sci notation */
-
-#define SINGLE_FLOAT_LABEL_WIDTH 6
-#define SINGLE_FLOAT_LABEL_FMT "%6.6s: "
-#define SINGLE_FLOAT_VALUE_WIDTH 25 /* min of 8 but may be in sci notation */
-
-#define SINGLE_LABEL_WIDTH 16
-#define SINGLE_LABEL_FMT "%10.10s: "
-#define SINGLE_VALUE_WIDTH 20 /* minimum of 8 but may be in sci notation */
-
-/* In the code HP gave Cygnus, this was actually a function call to a
- PA-specific function, which was supposed to determine whether the
- target was a 64-bit or 32-bit processor. However, the 64-bit
- support wasn't complete, so we didn't merge that in, so we leave
- this here as a stub. */
-#define IS_64BIT 0
-
-/*****************************************
-** STATIC DATA **
-******************************************/
-
-
-/*****************************************
-** STATIC LOCAL FUNCTIONS FORWARD DECLS **
-******************************************/
-static TuiStatus _tuiSetRegsContent
- (int, int, struct frame_info *, TuiRegisterDisplayType, int);
-static const char *_tuiRegisterName (int);
-static TuiStatus _tuiGetRegisterRawValue (int, char *, struct frame_info *);
-static void _tuiSetRegisterElement
- (int, struct frame_info *, TuiDataElementPtr, int);
-static void _tuiDisplayRegister (int, TuiGenWinInfoPtr, enum precision_type);
-static void _tuiRegisterFormat
- (char *, int, int, TuiDataElementPtr, enum precision_type);
-static TuiStatus _tuiSetGeneralRegsContent (int);
-static TuiStatus _tuiSetSpecialRegsContent (int);
-static TuiStatus _tuiSetGeneralAndSpecialRegsContent (int);
-static TuiStatus _tuiSetFloatRegsContent (TuiRegisterDisplayType, int);
-static int _tuiRegValueHasChanged
- (TuiDataElementPtr, struct frame_info *, char *);
-static void _tuiShowFloat_command (char *, int);
-static void _tuiShowGeneral_command (char *, int);
-static void _tuiShowSpecial_command (char *, int);
-static void _tui_vShowRegisters_commandSupport (TuiRegisterDisplayType);
-static void _tuiToggleFloatRegs_command (char *, int);
-static void _tuiScrollRegsForward_command (char *, int);
-static void _tuiScrollRegsBackward_command (char *, int);
-
-
-
-/*****************************************
-** PUBLIC FUNCTIONS **
-******************************************/
-
-/*
- ** tuiLastRegsLineNo()
- ** Answer the number of the last line in the regs display.
- ** If there are no registers (-1) is returned.
- */
-int
-tuiLastRegsLineNo (void)
-{
- register int numLines = (-1);
-
- if (dataWin->detail.dataDisplayInfo.regsContentCount > 0)
- {
- numLines = (dataWin->detail.dataDisplayInfo.regsContentCount /
- dataWin->detail.dataDisplayInfo.regsColumnCount);
- if (dataWin->detail.dataDisplayInfo.regsContentCount %
- dataWin->detail.dataDisplayInfo.regsColumnCount)
- numLines++;
- }
- return numLines;
-} /* tuiLastRegsLineNo */
-
-
-/*
- ** tuiLineFromRegElementNo()
- ** Answer the line number that the register element at elementNo is
- ** on. If elementNo is greater than the number of register elements
- ** there are, -1 is returned.
- */
-int
-tuiLineFromRegElementNo (int elementNo)
-{
- if (elementNo < dataWin->detail.dataDisplayInfo.regsContentCount)
- {
- int i, line = (-1);
-
- i = 1;
- while (line == (-1))
- {
- if (elementNo <
- (dataWin->detail.dataDisplayInfo.regsColumnCount * i))
- line = i - 1;
- else
- i++;
- }
-
- return line;
- }
- else
- return (-1);
-} /* tuiLineFromRegElementNo */
-
-
-/*
- ** tuiFirstRegElementNoInLine()
- ** Answer the index of the first element in lineNo. If lineNo is
- ** past the register area (-1) is returned.
- */
-int
-tuiFirstRegElementNoInLine (int lineNo)
-{
- if ((lineNo * dataWin->detail.dataDisplayInfo.regsColumnCount)
- <= dataWin->detail.dataDisplayInfo.regsContentCount)
- return ((lineNo + 1) *
- dataWin->detail.dataDisplayInfo.regsColumnCount) -
- dataWin->detail.dataDisplayInfo.regsColumnCount;
- else
- return (-1);
-} /* tuiFirstRegElementNoInLine */
-
-
-/*
- ** tuiLastRegElementNoInLine()
- ** Answer the index of the last element in lineNo. If lineNo is past
- ** the register area (-1) is returned.
- */
-int
-tuiLastRegElementNoInLine (int lineNo)
-{
- if ((lineNo * dataWin->detail.dataDisplayInfo.regsColumnCount) <=
- dataWin->detail.dataDisplayInfo.regsContentCount)
- return ((lineNo + 1) *
- dataWin->detail.dataDisplayInfo.regsColumnCount) - 1;
- else
- return (-1);
-} /* tuiLastRegElementNoInLine */
-
-
-/*
- ** tuiCalculateRegsColumnCount
- ** Calculate the number of columns that should be used to display
- ** the registers.
- */
-int
-tuiCalculateRegsColumnCount (TuiRegisterDisplayType dpyType)
-{
- int colCount, colWidth;
-
- if (IS_64BIT || dpyType == TUI_DFLOAT_REGS)
- colWidth = DOUBLE_FLOAT_VALUE_WIDTH + DOUBLE_FLOAT_LABEL_WIDTH;
- else
- {
- if (dpyType == TUI_SFLOAT_REGS)
- colWidth = SINGLE_FLOAT_VALUE_WIDTH + SINGLE_FLOAT_LABEL_WIDTH;
- else
- colWidth = SINGLE_VALUE_WIDTH + SINGLE_LABEL_WIDTH;
- }
- colCount = (dataWin->generic.width - 2) / colWidth;
-
- return colCount;
-} /* tuiCalulateRegsColumnCount */
-
-
-/*
- ** tuiShowRegisters().
- ** Show the registers int the data window as indicated by dpyType.
- ** If there is any other registers being displayed, then they are
- ** cleared. What registers are displayed is dependent upon dpyType.
- */
-void
-tuiShowRegisters (TuiRegisterDisplayType dpyType)
-{
- TuiStatus ret = TUI_FAILURE;
- int refreshValuesOnly = FALSE;
-
- /* Say that registers should be displayed, even if there is a problem */
- dataWin->detail.dataDisplayInfo.displayRegs = TRUE;
-
- if (target_has_registers)
- {
- refreshValuesOnly =
- (dpyType == dataWin->detail.dataDisplayInfo.regsDisplayType);
- switch (dpyType)
- {
- case TUI_GENERAL_REGS:
- ret = _tuiSetGeneralRegsContent (refreshValuesOnly);
- break;
- case TUI_SFLOAT_REGS:
- case TUI_DFLOAT_REGS:
- ret = _tuiSetFloatRegsContent (dpyType, refreshValuesOnly);
- break;
-
-/* could ifdef out */
-
- case TUI_SPECIAL_REGS:
- ret = _tuiSetSpecialRegsContent (refreshValuesOnly);
- break;
- case TUI_GENERAL_AND_SPECIAL_REGS:
- ret = _tuiSetGeneralAndSpecialRegsContent (refreshValuesOnly);
- break;
-
-/* end of potential if def */
-
- default:
- break;
- }
- }
- if (ret == TUI_FAILURE)
- {
- dataWin->detail.dataDisplayInfo.regsDisplayType = TUI_UNDEFINED_REGS;
- tuiEraseDataContent (NO_REGS_STRING);
- }
- else
- {
- int i;
-
- /* Clear all notation of changed values */
- for (i = 0; (i < dataWin->detail.dataDisplayInfo.regsContentCount); i++)
- {
- TuiGenWinInfoPtr dataItemWin;
-
- dataItemWin = &dataWin->detail.dataDisplayInfo.
- regsContent[i]->whichElement.dataWindow;
- (&((TuiWinElementPtr)
- dataItemWin->content[0])->whichElement.data)->highlight = FALSE;
- }
- dataWin->detail.dataDisplayInfo.regsDisplayType = dpyType;
- tuiDisplayAllData ();
- }
- (tuiLayoutDef ())->regsDisplayType = dpyType;
-
- return;
-} /* tuiShowRegisters */
-
-
-/*
- ** tuiDisplayRegistersFrom().
- ** Function to display the registers in the content from
- ** 'startElementNo' until the end of the register content or the
- ** end of the display height. No checking for displaying past
- ** the end of the registers is done here.
- */
-void
-tuiDisplayRegistersFrom (int startElementNo)
-{
- if (dataWin->detail.dataDisplayInfo.regsContent != (TuiWinContent) NULL &&
- dataWin->detail.dataDisplayInfo.regsContentCount > 0)
- {
- register int i = startElementNo;
- int j, valueCharsWide, itemWinWidth, curY, labelWidth;
- enum precision_type precision;
-
- precision = (dataWin->detail.dataDisplayInfo.regsDisplayType
- == TUI_DFLOAT_REGS) ?
- double_precision : unspecified_precision;
- if (IS_64BIT ||
- dataWin->detail.dataDisplayInfo.regsDisplayType == TUI_DFLOAT_REGS)
- {
- valueCharsWide = DOUBLE_FLOAT_VALUE_WIDTH;
- labelWidth = DOUBLE_FLOAT_LABEL_WIDTH;
- }
- else
- {
- if (dataWin->detail.dataDisplayInfo.regsDisplayType ==
- TUI_SFLOAT_REGS)
- {
- valueCharsWide = SINGLE_FLOAT_VALUE_WIDTH;
- labelWidth = SINGLE_FLOAT_LABEL_WIDTH;
- }
- else
- {
- valueCharsWide = SINGLE_VALUE_WIDTH;
- labelWidth = SINGLE_LABEL_WIDTH;
- }
- }
- itemWinWidth = valueCharsWide + labelWidth;
- /*
- ** Now create each data "sub" window, and write the display into it.
- */
- curY = 1;
- while (i < dataWin->detail.dataDisplayInfo.regsContentCount &&
- curY <= dataWin->generic.viewportHeight)
- {
- for (j = 0;
- (j < dataWin->detail.dataDisplayInfo.regsColumnCount &&
- i < dataWin->detail.dataDisplayInfo.regsContentCount); j++)
- {
- TuiGenWinInfoPtr dataItemWin;
- TuiDataElementPtr dataElementPtr;
-
- /* create the window if necessary */
- dataItemWin = &dataWin->detail.dataDisplayInfo.
- regsContent[i]->whichElement.dataWindow;
- dataElementPtr = &((TuiWinElementPtr)
- dataItemWin->content[0])->whichElement.data;
- if (dataItemWin->handle == (WINDOW *) NULL)
- {
- dataItemWin->height = 1;
- dataItemWin->width = (precision == double_precision) ?
- itemWinWidth + 2 : itemWinWidth + 1;
- dataItemWin->origin.x = (itemWinWidth * j) + 1;
- dataItemWin->origin.y = curY;
- makeWindow (dataItemWin, DONT_BOX_WINDOW);
- scrollok (dataItemWin->handle, FALSE);
- }
- touchwin (dataItemWin->handle);
-
- /*
- ** Get the printable representation of the register
- ** and display it
- */
- _tuiDisplayRegister (
- dataElementPtr->itemNo, dataItemWin, precision);
- i++; /* next register */
- }
- curY++; /* next row; */
- }
- }
-
- return;
-} /* tuiDisplayRegistersFrom */
-
-
-/*
- ** tuiDisplayRegElementAtLine().
- ** Function to display the registers in the content from
- ** 'startElementNo' on 'startLineNo' until the end of the
- ** register content or the end of the display height.
- ** This function checks that we won't display off the end
- ** of the register display.
- */
-void
-tuiDisplayRegElementAtLine (int startElementNo, int startLineNo)
-{
- if (dataWin->detail.dataDisplayInfo.regsContent != (TuiWinContent) NULL &&
- dataWin->detail.dataDisplayInfo.regsContentCount > 0)
- {
- register int elementNo = startElementNo;
-
- if (startElementNo != 0 && startLineNo != 0)
- {
- register int lastLineNo, firstLineOnLastPage;
-
- lastLineNo = tuiLastRegsLineNo ();
- firstLineOnLastPage = lastLineNo - (dataWin->generic.height - 2);
- if (firstLineOnLastPage < 0)
- firstLineOnLastPage = 0;
- /*
- ** If there is no other data displayed except registers,
- ** and the elementNo causes us to scroll past the end of the
- ** registers, adjust what element to really start the display at.
- */
- if (dataWin->detail.dataDisplayInfo.dataContentCount <= 0 &&
- startLineNo > firstLineOnLastPage)
- elementNo = tuiFirstRegElementNoInLine (firstLineOnLastPage);
- }
- tuiDisplayRegistersFrom (elementNo);
- }
-
- return;
-} /* tuiDisplayRegElementAtLine */
-
-
-
-/*
- ** tuiDisplayRegistersFromLine().
- ** Function to display the registers starting at line lineNo in
- ** the data window. Answers the line number that the display
- ** actually started from. If nothing is displayed (-1) is returned.
- */
-int
-tuiDisplayRegistersFromLine (int lineNo, int forceDisplay)
-{
- if (dataWin->detail.dataDisplayInfo.regsContentCount > 0)
- {
- int line, elementNo;
-
- if (lineNo < 0)
- line = 0;
- else if (forceDisplay)
- { /*
- ** If we must display regs (forceDisplay is true), then make
- ** sure that we don't display off the end of the registers.
- */
- if (lineNo >= tuiLastRegsLineNo ())
- {
- if ((line = tuiLineFromRegElementNo (
- dataWin->detail.dataDisplayInfo.regsContentCount - 1)) < 0)
- line = 0;
- }
- else
- line = lineNo;
- }
- else
- line = lineNo;
-
- elementNo = tuiFirstRegElementNoInLine (line);
- if (elementNo < dataWin->detail.dataDisplayInfo.regsContentCount)
- tuiDisplayRegElementAtLine (elementNo, line);
- else
- line = (-1);
-
- return line;
- }
-
- return (-1); /* nothing was displayed */
-} /* tuiDisplayRegistersFromLine */
-
-
-/*
- ** tuiCheckRegisterValues()
- ** This function check all displayed registers for changes in
- ** values, given a particular frame. If the values have changed,
- ** they are updated with the new value and highlighted.
- */
-void
-tuiCheckRegisterValues (struct frame_info *frame)
-{
- if (m_winPtrNotNull (dataWin) && dataWin->generic.isVisible)
- {
- if (dataWin->detail.dataDisplayInfo.regsContentCount <= 0 &&
- dataWin->detail.dataDisplayInfo.displayRegs)
- tuiShowRegisters ((tuiLayoutDef ())->regsDisplayType);
- else
- {
- int i, j;
- char rawBuf[MAX_REGISTER_SIZE];
-
- for (i = 0;
- (i < dataWin->detail.dataDisplayInfo.regsContentCount); i++)
- {
- TuiDataElementPtr dataElementPtr;
- TuiGenWinInfoPtr dataItemWinPtr;
- int wasHilighted;
-
- dataItemWinPtr = &dataWin->detail.dataDisplayInfo.
- regsContent[i]->whichElement.dataWindow;
- dataElementPtr = &((TuiWinElementPtr)
- dataItemWinPtr->content[0])->whichElement.data;
- wasHilighted = dataElementPtr->highlight;
- dataElementPtr->highlight =
- _tuiRegValueHasChanged (dataElementPtr, frame, &rawBuf[0]);
- if (dataElementPtr->highlight)
- {
- int size;
-
- size = DEPRECATED_REGISTER_RAW_SIZE (dataElementPtr->itemNo);
- for (j = 0; j < size; j++)
- ((char *) dataElementPtr->value)[j] = rawBuf[j];
- _tuiDisplayRegister (
- dataElementPtr->itemNo,
- dataItemWinPtr,
- ((dataWin->detail.dataDisplayInfo.regsDisplayType ==
- TUI_DFLOAT_REGS) ?
- double_precision : unspecified_precision));
- }
- else if (wasHilighted)
- {
- dataElementPtr->highlight = FALSE;
- _tuiDisplayRegister (
- dataElementPtr->itemNo,
- dataItemWinPtr,
- ((dataWin->detail.dataDisplayInfo.regsDisplayType ==
- TUI_DFLOAT_REGS) ?
- double_precision : unspecified_precision));
- }
- }
- }
- }
- return;
-} /* tuiCheckRegisterValues */
-
-
-/*
- ** tuiToggleFloatRegs().
- */
-void
-tuiToggleFloatRegs (void)
-{
- TuiLayoutDefPtr layoutDef = tuiLayoutDef ();
-
- if (layoutDef->floatRegsDisplayType == TUI_SFLOAT_REGS)
- layoutDef->floatRegsDisplayType = TUI_DFLOAT_REGS;
- else
- layoutDef->floatRegsDisplayType = TUI_SFLOAT_REGS;
-
- if (m_winPtrNotNull (dataWin) && dataWin->generic.isVisible &&
- (dataWin->detail.dataDisplayInfo.regsDisplayType == TUI_SFLOAT_REGS ||
- dataWin->detail.dataDisplayInfo.regsDisplayType == TUI_DFLOAT_REGS))
- tuiShowRegisters (layoutDef->floatRegsDisplayType);
-
- return;
-} /* tuiToggleFloatRegs */
-
-
-void
-_initialize_tuiRegs (void)
-{
- if (xdb_commands)
- {
- add_com ("fr", class_tui, _tuiShowFloat_command,
- "Display only floating point registers\n");
- add_com ("gr", class_tui, _tuiShowGeneral_command,
- "Display only general registers\n");
- add_com ("sr", class_tui, _tuiShowSpecial_command,
- "Display only special registers\n");
- add_com ("+r", class_tui, _tuiScrollRegsForward_command,
- "Scroll the registers window forward\n");
- add_com ("-r", class_tui, _tuiScrollRegsBackward_command,
- "Scroll the register window backward\n");
- add_com ("tf", class_tui, _tuiToggleFloatRegs_command,
- "Toggle between single and double precision floating point registers.\n");
- add_cmd (TUI_FLOAT_REGS_NAME_LOWER,
- class_tui,
- _tuiToggleFloatRegs_command,
- "Toggle between single and double precision floating point \
-registers.\n",
- &togglelist);
- }
-}
-
-
-/*****************************************
-** STATIC LOCAL FUNCTIONS **
-******************************************/
-
-
-/*
- ** _tuiRegisterName().
- ** Return the register name.
- */
-static const char *
-_tuiRegisterName (int regNum)
-{
- return REGISTER_NAME (regNum);
-}
-extern int pagination_enabled;
-
-static void
-tui_restore_gdbout (void *ui)
-{
- ui_file_delete (gdb_stdout);
- gdb_stdout = (struct ui_file*) ui;
- pagination_enabled = 1;
-}
-
-/*
- ** _tuiRegisterFormat
- ** Function to format the register name and value into a buffer,
- ** suitable for printing or display
- */
-static void
-_tuiRegisterFormat (char *buf, int bufLen, int regNum,
- TuiDataElementPtr dataElement,
- enum precision_type precision)
-{
- struct ui_file *stream;
- struct ui_file *old_stdout;
- const char *name;
- struct cleanup *cleanups;
- char *p;
- int pos;
-
- name = REGISTER_NAME (regNum);
- if (name == 0)
- {
- strcpy (buf, "");
- return;
- }
-
- pagination_enabled = 0;
- old_stdout = gdb_stdout;
- stream = tui_sfileopen (bufLen);
- gdb_stdout = stream;
- cleanups = make_cleanup (tui_restore_gdbout, (void*) old_stdout);
- gdbarch_print_registers_info (current_gdbarch, stream, deprecated_selected_frame,
- regNum, 1);
-
- /* Save formatted output in the buffer. */
- p = tui_file_get_strbuf (stream);
- pos = 0;
- while (*p && *p == *name++ && bufLen)
- {
- *buf++ = *p++;
- bufLen--;
- pos++;
- }
- while (*p == ' ')
- p++;
- while (pos < 8 && bufLen)
- {
- *buf++ = ' ';
- bufLen--;
- pos++;
- }
- strncpy (buf, p, bufLen);
-
- /* Remove the possible \n. */
- p = strchr (buf, '\n');
- if (p)
- *p = 0;
-
- do_cleanups (cleanups);
-}
-
-
-#define NUM_GENERAL_REGS 32
-/*
- ** _tuiSetGeneralRegsContent().
- ** Set the content of the data window to consist of the general registers.
- */
-static TuiStatus
-_tuiSetGeneralRegsContent (int refreshValuesOnly)
-{
- return (_tuiSetRegsContent (0,
- NUM_GENERAL_REGS - 1,
- deprecated_selected_frame,
- TUI_GENERAL_REGS,
- refreshValuesOnly));
-
-} /* _tuiSetGeneralRegsContent */
-
-
-#ifndef PCOQ_HEAD_REGNUM
-#define START_SPECIAL_REGS 0
-#else
-#define START_SPECIAL_REGS PCOQ_HEAD_REGNUM
-#endif
-
-/*
- ** _tuiSetSpecialRegsContent().
- ** Set the content of the data window to consist of the special registers.
- */
-static TuiStatus
-_tuiSetSpecialRegsContent (int refreshValuesOnly)
-{
- TuiStatus ret = TUI_FAILURE;
- int endRegNum;
-
- endRegNum = FP0_REGNUM - 1;
- ret = _tuiSetRegsContent (START_SPECIAL_REGS,
- endRegNum,
- deprecated_selected_frame,
- TUI_SPECIAL_REGS,
- refreshValuesOnly);
-
- return ret;
-} /* _tuiSetSpecialRegsContent */
-
-
-/*
- ** _tuiSetGeneralAndSpecialRegsContent().
- ** Set the content of the data window to consist of the special registers.
- */
-static TuiStatus
-_tuiSetGeneralAndSpecialRegsContent (int refreshValuesOnly)
-{
- TuiStatus ret = TUI_FAILURE;
- int endRegNum = (-1);
-
- endRegNum = FP0_REGNUM - 1;
- ret = _tuiSetRegsContent (
- 0, endRegNum, deprecated_selected_frame, TUI_SPECIAL_REGS, refreshValuesOnly);
-
- return ret;
-} /* _tuiSetGeneralAndSpecialRegsContent */
-
-/*
- ** _tuiSetFloatRegsContent().
- ** Set the content of the data window to consist of the float registers.
- */
-static TuiStatus
-_tuiSetFloatRegsContent (TuiRegisterDisplayType dpyType, int refreshValuesOnly)
-{
- TuiStatus ret = TUI_FAILURE;
- int startRegNum;
-
- startRegNum = FP0_REGNUM;
- ret = _tuiSetRegsContent (startRegNum,
- NUM_REGS - 1,
- deprecated_selected_frame,
- dpyType,
- refreshValuesOnly);
-
- return ret;
-} /* _tuiSetFloatRegsContent */
-
-
-/*
- ** _tuiRegValueHasChanged().
- ** Answer TRUE if the register's value has changed, FALSE otherwise.
- ** If TRUE, newValue is filled in with the new value.
- */
-static int
-_tuiRegValueHasChanged (TuiDataElementPtr dataElement,
- struct frame_info *frame,
- char *newValue)
-{
- int hasChanged = FALSE;
-
- if (dataElement->itemNo != UNDEFINED_ITEM &&
- _tuiRegisterName (dataElement->itemNo) != (char *) NULL)
- {
- char rawBuf[MAX_REGISTER_SIZE];
- int i;
-
- if (_tuiGetRegisterRawValue (
- dataElement->itemNo, rawBuf, frame) == TUI_SUCCESS)
- {
- int size = DEPRECATED_REGISTER_RAW_SIZE (dataElement->itemNo);
-
- for (i = 0; (i < size && !hasChanged); i++)
- hasChanged = (((char *) dataElement->value)[i] != rawBuf[i]);
- if (hasChanged && newValue != (char *) NULL)
- {
- for (i = 0; i < size; i++)
- newValue[i] = rawBuf[i];
- }
- }
- }
- return hasChanged;
-} /* _tuiRegValueHasChanged */
-
-
-
-/*
- ** _tuiGetRegisterRawValue().
- ** Get the register raw value. The raw value is returned in regValue.
- */
-static TuiStatus
-_tuiGetRegisterRawValue (int regNum, char *regValue, struct frame_info *frame)
-{
- TuiStatus ret = TUI_FAILURE;
-
- if (target_has_registers)
- {
- get_frame_register (frame, regNum, regValue);
- /* NOTE: cagney/2003-03-13: This is bogus. It is refering to
- the register cache and not the frame which could have pulled
- the register value off the stack. */
- if (register_cached (regNum) >= 0)
- ret = TUI_SUCCESS;
- }
- return ret;
-} /* _tuiGetRegisterRawValue */
-
-
-
-/*
- ** _tuiSetRegisterElement().
- ** Function to initialize a data element with the input and
- ** the register value.
- */
-static void
-_tuiSetRegisterElement (int regNum, struct frame_info *frame,
- TuiDataElementPtr dataElement,
- int refreshValueOnly)
-{
- if (dataElement != (TuiDataElementPtr) NULL)
- {
- if (!refreshValueOnly)
- {
- dataElement->itemNo = regNum;
- dataElement->name = _tuiRegisterName (regNum);
- dataElement->highlight = FALSE;
- }
- if (dataElement->value == (Opaque) NULL)
- dataElement->value = (Opaque) xmalloc (MAX_REGISTER_SIZE);
- if (dataElement->value != (Opaque) NULL)
- _tuiGetRegisterRawValue (regNum, dataElement->value, frame);
- }
-
- return;
-} /* _tuiSetRegisterElement */
-
-
-/*
- ** _tuiSetRegsContent().
- ** Set the content of the data window to consist of the registers
- ** numbered from startRegNum to endRegNum. Note that if
- ** refreshValuesOnly is TRUE, startRegNum and endRegNum are ignored.
- */
-static TuiStatus
-_tuiSetRegsContent (int startRegNum, int endRegNum,
- struct frame_info *frame,
- TuiRegisterDisplayType dpyType,
- int refreshValuesOnly)
-{
- TuiStatus ret = TUI_FAILURE;
- int numRegs = endRegNum - startRegNum + 1;
- int allocatedHere = FALSE;
-
- if (dataWin->detail.dataDisplayInfo.regsContentCount > 0 &&
- !refreshValuesOnly)
- {
- freeDataContent (dataWin->detail.dataDisplayInfo.regsContent,
- dataWin->detail.dataDisplayInfo.regsContentCount);
- dataWin->detail.dataDisplayInfo.regsContentCount = 0;
- }
- if (dataWin->detail.dataDisplayInfo.regsContentCount <= 0)
- {
- dataWin->detail.dataDisplayInfo.regsContent =
- allocContent (numRegs, DATA_WIN);
- allocatedHere = TRUE;
- }
-
- if (dataWin->detail.dataDisplayInfo.regsContent != (TuiWinContent) NULL)
- {
- int i;
-
- if (!refreshValuesOnly || allocatedHere)
- {
- dataWin->generic.content = (OpaquePtr) NULL;
- dataWin->generic.contentSize = 0;
- addContentElements (&dataWin->generic, numRegs);
- dataWin->detail.dataDisplayInfo.regsContent =
- (TuiWinContent) dataWin->generic.content;
- dataWin->detail.dataDisplayInfo.regsContentCount = numRegs;
- }
- /*
- ** Now set the register names and values
- */
- for (i = startRegNum; (i <= endRegNum); i++)
- {
- TuiGenWinInfoPtr dataItemWin;
-
- dataItemWin = &dataWin->detail.dataDisplayInfo.
- regsContent[i - startRegNum]->whichElement.dataWindow;
- _tuiSetRegisterElement (
- i,
- frame,
- &((TuiWinElementPtr) dataItemWin->content[0])->whichElement.data,
- !allocatedHere && refreshValuesOnly);
- }
- dataWin->detail.dataDisplayInfo.regsColumnCount =
- tuiCalculateRegsColumnCount (dpyType);
-#ifdef LATER
- if (dataWin->detail.dataDisplayInfo.dataContentCount > 0)
- {
- /* delete all the windows? */
- /* realloc content equal to dataContentCount + regsContentCount */
- /* append dataWin->detail.dataDisplayInfo.dataContent to content */
- }
-#endif
- dataWin->generic.contentSize =
- dataWin->detail.dataDisplayInfo.regsContentCount +
- dataWin->detail.dataDisplayInfo.dataContentCount;
- ret = TUI_SUCCESS;
- }
-
- return ret;
-} /* _tuiSetRegsContent */
-
-
-/*
- ** _tuiDisplayRegister().
- ** Function to display a register in a window. If hilite is TRUE,
- ** than the value will be displayed in reverse video
- */
-static void
-_tuiDisplayRegister (int regNum,
- TuiGenWinInfoPtr winInfo, /* the data item window */
- enum precision_type precision)
-{
- if (winInfo->handle != (WINDOW *) NULL)
- {
- int i;
- char buf[40];
- int valueCharsWide, labelWidth;
- TuiDataElementPtr dataElementPtr = &((TuiWinContent)
- winInfo->content)[0]->whichElement.data;
-
- if (IS_64BIT ||
- dataWin->detail.dataDisplayInfo.regsDisplayType == TUI_DFLOAT_REGS)
- {
- valueCharsWide = DOUBLE_FLOAT_VALUE_WIDTH;
- labelWidth = DOUBLE_FLOAT_LABEL_WIDTH;
- }
- else
- {
- if (dataWin->detail.dataDisplayInfo.regsDisplayType ==
- TUI_SFLOAT_REGS)
- {
- valueCharsWide = SINGLE_FLOAT_VALUE_WIDTH;
- labelWidth = SINGLE_FLOAT_LABEL_WIDTH;
- }
- else
- {
- valueCharsWide = SINGLE_VALUE_WIDTH;
- labelWidth = SINGLE_LABEL_WIDTH;
- }
- }
-
- buf[0] = (char) 0;
- _tuiRegisterFormat (buf,
- valueCharsWide + labelWidth,
- regNum,
- dataElementPtr,
- precision);
-
- if (dataElementPtr->highlight)
- wstandout (winInfo->handle);
-
- wmove (winInfo->handle, 0, 0);
- for (i = 1; i < winInfo->width; i++)
- waddch (winInfo->handle, ' ');
- wmove (winInfo->handle, 0, 0);
- waddstr (winInfo->handle, buf);
-
- if (dataElementPtr->highlight)
- wstandend (winInfo->handle);
- tuiRefreshWin (winInfo);
- }
- return;
-} /* _tuiDisplayRegister */
-
-
-static void
-_tui_vShowRegisters_commandSupport (TuiRegisterDisplayType dpyType)
-{
-
- if (m_winPtrNotNull (dataWin) && dataWin->generic.isVisible)
- { /* Data window already displayed, show the registers */
- if (dataWin->detail.dataDisplayInfo.regsDisplayType != dpyType)
- tuiShowRegisters (dpyType);
- }
- else
- (tuiLayoutDef ())->regsDisplayType = dpyType;
-
- return;
-} /* _tui_vShowRegisters_commandSupport */
-
-
-static void
-_tuiShowFloat_command (char *arg, int fromTTY)
-{
- if (m_winPtrIsNull (dataWin) || !dataWin->generic.isVisible ||
- (dataWin->detail.dataDisplayInfo.regsDisplayType != TUI_SFLOAT_REGS &&
- dataWin->detail.dataDisplayInfo.regsDisplayType != TUI_DFLOAT_REGS))
- _tui_vShowRegisters_commandSupport ((tuiLayoutDef ())->floatRegsDisplayType);
-
- return;
-} /* _tuiShowFloat_command */
-
-
-static void
-_tuiShowGeneral_command (char *arg, int fromTTY)
-{
- _tui_vShowRegisters_commandSupport (TUI_GENERAL_REGS);
-}
-
-
-static void
-_tuiShowSpecial_command (char *arg, int fromTTY)
-{
- _tui_vShowRegisters_commandSupport (TUI_SPECIAL_REGS);
-}
-
-
-static void
-_tuiToggleFloatRegs_command (char *arg, int fromTTY)
-{
- if (m_winPtrNotNull (dataWin) && dataWin->generic.isVisible)
- tuiToggleFloatRegs ();
- else
- {
- TuiLayoutDefPtr layoutDef = tuiLayoutDef ();
-
- if (layoutDef->floatRegsDisplayType == TUI_SFLOAT_REGS)
- layoutDef->floatRegsDisplayType = TUI_DFLOAT_REGS;
- else
- layoutDef->floatRegsDisplayType = TUI_SFLOAT_REGS;
- }
-
-
- return;
-} /* _tuiToggleFloatRegs_command */
-
-
-static void
-_tuiScrollRegsForward_command (char *arg, int fromTTY)
-{
- tui_scroll (FORWARD_SCROLL, dataWin, 1);
-}
-
-
-static void
-_tuiScrollRegsBackward_command (char *arg, int fromTTY)
-{
- tui_scroll (BACKWARD_SCROLL, dataWin, 1);
-}
diff --git a/gdb/tui/tuiRegs.h b/gdb/tui/tuiRegs.h
deleted file mode 100644
index 8fbfbbf..0000000
--- a/gdb/tui/tuiRegs.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* TUI display registers in window.
- Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
- Contributed by Hewlett-Packard Company.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#ifndef _TUI_REGS_H
-#define _TUI_REGS_H
-
-/*****************************************
-** TYPE DEFINITIONS **
-******************************************/
-
-
-
-/*****************************************
-** PUBLIC FUNCTION EXTERNAL DECLS **
-******************************************/
-extern void tuiCheckRegisterValues (struct frame_info *);
-extern void tuiShowRegisters (TuiRegisterDisplayType);
-extern void tuiDisplayRegistersFrom (int);
-extern int tuiDisplayRegistersFromLine (int, int);
-extern int tuiLastRegsLineNo (void);
-extern int tuiFirstRegElementInLine (int);
-extern int tuiLastRegElementInLine (int);
-extern int tuiLineFromRegElementNo (int);
-extern void tuiToggleFloatRegs (void);
-extern int tuiCalculateRegsColumnCount (TuiRegisterDisplayType);
-extern int tuiFirstRegElementNoInLine (int lineno);
-
-#endif
-/*_TUI_REGS_H*/
diff --git a/gdb/tui/tuiSource.c b/gdb/tui/tuiSource.c
deleted file mode 100644
index 6428130..0000000
--- a/gdb/tui/tuiSource.c
+++ /dev/null
@@ -1,356 +0,0 @@
-/* TUI display source window.
-
- Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation,
- Inc.
-
- Contributed by Hewlett-Packard Company.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include "defs.h"
-#include <ctype.h>
-#include "symtab.h"
-#include "frame.h"
-#include "breakpoint.h"
-#include "source.h"
-#include "symtab.h"
-
-#include "tui.h"
-#include "tuiData.h"
-#include "tuiStack.h"
-#include "tuiSourceWin.h"
-#include "tuiSource.h"
-
-#ifdef HAVE_NCURSES_H
-#include <ncurses.h>
-#else
-#ifdef HAVE_CURSES_H
-#include <curses.h>
-#endif
-#endif
-
-/* Function to display source in the source window. */
-TuiStatus
-tuiSetSourceContent (struct symtab *s, int lineNo, int noerror)
-{
- TuiStatus ret = TUI_FAILURE;
-
- if (s != (struct symtab *) NULL && s->filename != (char *) NULL)
- {
- register FILE *stream;
- register int i, desc, c, lineWidth, nlines;
- register char *srcLine = 0;
-
- if ((ret = tuiAllocSourceBuffer (srcWin)) == TUI_SUCCESS)
- {
- lineWidth = srcWin->generic.width - 1;
- /* Take hilite (window border) into account, when calculating
- the number of lines */
- nlines = (lineNo + (srcWin->generic.height - 2)) - lineNo;
- desc = open_source_file (s);
- if (desc < 0)
- {
- if (!noerror)
- {
- char *name = alloca (strlen (s->filename) + 100);
- sprintf (name, "%s:%d", s->filename, lineNo);
- print_sys_errmsg (name, errno);
- }
- ret = TUI_FAILURE;
- }
- else
- {
- if (s->line_charpos == 0)
- find_source_lines (s, desc);
-
- if (lineNo < 1 || lineNo > s->nlines)
- {
- close (desc);
- printf_unfiltered (
- "Line number %d out of range; %s has %d lines.\n",
- lineNo, s->filename, s->nlines);
- }
- else if (lseek (desc, s->line_charpos[lineNo - 1], 0) < 0)
- {
- close (desc);
- perror_with_name (s->filename);
- }
- else
- {
- register int offset, curLineNo, curLine, curLen, threshold;
- TuiGenWinInfoPtr locator = locatorWinInfoPtr ();
- TuiSourceInfoPtr src = &srcWin->detail.sourceInfo;
-
- if (srcWin->generic.title)
- xfree (srcWin->generic.title);
- srcWin->generic.title = xstrdup (s->filename);
-
- if (src->filename)
- xfree (src->filename);
- src->filename = xstrdup (s->filename);
-
- /* Determine the threshold for the length of the line
- and the offset to start the display. */
- offset = src->horizontalOffset;
- threshold = (lineWidth - 1) + offset;
- stream = fdopen (desc, FOPEN_RT);
- clearerr (stream);
- curLine = 0;
- curLineNo = src->startLineOrAddr.lineNo = lineNo;
- if (offset > 0)
- srcLine = (char *) xmalloc (
- (threshold + 1) * sizeof (char));
- while (curLine < nlines)
- {
- TuiWinElementPtr element = (TuiWinElementPtr)
- srcWin->generic.content[curLine];
-
- /* get the first character in the line */
- c = fgetc (stream);
-
- if (offset == 0)
- srcLine = ((TuiWinElementPtr)
- srcWin->generic.content[
- curLine])->whichElement.source.line;
- /* Init the line with the line number */
- sprintf (srcLine, "%-6d", curLineNo);
- curLen = strlen (srcLine);
- i = curLen -
- ((curLen / tuiDefaultTabLen ()) * tuiDefaultTabLen ());
- while (i < tuiDefaultTabLen ())
- {
- srcLine[curLen] = ' ';
- i++;
- curLen++;
- }
- srcLine[curLen] = (char) 0;
-
- /* Set whether element is the execution point and
- whether there is a break point on it. */
- element->whichElement.source.lineOrAddr.lineNo =
- curLineNo;
- element->whichElement.source.isExecPoint =
- (strcmp (((TuiWinElementPtr)
- locator->content[0])->whichElement.locator.fileName,
- s->filename) == 0
- && curLineNo == ((TuiWinElementPtr)
- locator->content[0])->whichElement.locator.lineNo);
- if (c != EOF)
- {
- i = strlen (srcLine) - 1;
- do
- {
- if ((c != '\n') &&
- (c != '\r') && (++i < threshold))
- {
- if (c < 040 && c != '\t')
- {
- srcLine[i++] = '^';
- srcLine[i] = c + 0100;
- }
- else if (c == 0177)
- {
- srcLine[i++] = '^';
- srcLine[i] = '?';
- }
- else
- { /* Store the charcter in the line
- buffer. If it is a tab, then
- translate to the correct number of
- chars so we don't overwrite our
- buffer. */
- if (c == '\t')
- {
- int j, maxTabLen = tuiDefaultTabLen ();
-
- for (j = i - (
- (i / maxTabLen) * maxTabLen);
- ((j < maxTabLen) &&
- i < threshold);
- i++, j++)
- srcLine[i] = ' ';
- i--;
- }
- else
- srcLine[i] = c;
- }
- srcLine[i + 1] = 0;
- }
- else
- { /* If we have not reached EOL, then eat
- chars until we do */
- while (c != EOF && c != '\n' && c != '\r')
- c = fgetc (stream);
- }
- }
- while (c != EOF && c != '\n' && c != '\r' &&
- i < threshold && (c = fgetc (stream)));
- }
- /* Now copy the line taking the offset into account */
- if (strlen (srcLine) > offset)
- strcpy (((TuiWinElementPtr) srcWin->generic.content[
- curLine])->whichElement.source.line,
- &srcLine[offset]);
- else
- ((TuiWinElementPtr)
- srcWin->generic.content[
- curLine])->whichElement.source.line[0] = (char) 0;
- curLine++;
- curLineNo++;
- }
- if (offset > 0)
- tuiFree (srcLine);
- fclose (stream);
- srcWin->generic.contentSize = nlines;
- ret = TUI_SUCCESS;
- }
- }
- }
- }
- return ret;
-}
-
-
-/* elz: this function sets the contents of the source window to empty
- except for a line in the middle with a warning message about the
- source not being available. This function is called by
- tuiEraseSourceContents, which in turn is invoked when the source files
- cannot be accessed */
-
-void
-tuiSetSourceContentNil (TuiWinInfoPtr winInfo, char *warning_string)
-{
- int lineWidth;
- int nLines;
- int curr_line = 0;
-
- lineWidth = winInfo->generic.width - 1;
- nLines = winInfo->generic.height - 2;
-
- /* set to empty each line in the window, except for the one
- which contains the message */
- while (curr_line < winInfo->generic.contentSize)
- {
- /* set the information related to each displayed line
- to null: i.e. the line number is 0, there is no bp,
- it is not where the program is stopped */
-
- TuiWinElementPtr element =
- (TuiWinElementPtr) winInfo->generic.content[curr_line];
- element->whichElement.source.lineOrAddr.lineNo = 0;
- element->whichElement.source.isExecPoint = FALSE;
- element->whichElement.source.hasBreak = FALSE;
-
- /* set the contents of the line to blank */
- element->whichElement.source.line[0] = (char) 0;
-
- /* if the current line is in the middle of the screen, then we want to
- display the 'no source available' message in it.
- Note: the 'weird' arithmetic with the line width and height comes from
- the function tuiEraseSourceContent. We need to keep the screen and the
- window's actual contents in synch */
-
- if (curr_line == (nLines / 2 + 1))
- {
- int i;
- int xpos;
- int warning_length = strlen (warning_string);
- char *srcLine;
-
- srcLine = element->whichElement.source.line;
-
- if (warning_length >= ((lineWidth - 1) / 2))
- xpos = 1;
- else
- xpos = (lineWidth - 1) / 2 - warning_length;
-
- for (i = 0; i < xpos; i++)
- srcLine[i] = ' ';
-
- sprintf (srcLine + i, "%s", warning_string);
-
- for (i = xpos + warning_length; i < lineWidth; i++)
- srcLine[i] = ' ';
-
- srcLine[i] = '\n';
-
- } /* end if */
-
- curr_line++;
-
- } /* end while */
-}
-
-
-/* Function to display source in the source window. This function
- initializes the horizontal scroll to 0. */
-void
-tuiShowSource (struct symtab *s, TuiLineOrAddress line, int noerror)
-{
- srcWin->detail.sourceInfo.horizontalOffset = 0;
- tuiUpdateSourceWindowAsIs(srcWin, s, line, noerror);
-}
-
-
-/* Answer whether the source is currently displayed in the source window. */
-int
-tuiSourceIsDisplayed (char *fname)
-{
- return (srcWin->generic.contentInUse &&
- (strcmp (((TuiWinElementPtr) (locatorWinInfoPtr ())->
- content[0])->whichElement.locator.fileName, fname) == 0));
-}
-
-
-/* Scroll the source forward or backward vertically. */
-void
-tuiVerticalSourceScroll (TuiScrollDirection scrollDirection,
- int numToScroll)
-{
- if (srcWin->generic.content != (OpaquePtr) NULL)
- {
- TuiLineOrAddress l;
- struct symtab *s;
- TuiWinContent content = (TuiWinContent) srcWin->generic.content;
- struct symtab_and_line cursal = get_current_source_symtab_and_line ();
-
- if (cursal.symtab == (struct symtab *) NULL)
- s = find_pc_symtab (get_frame_pc (deprecated_selected_frame));
- else
- s = cursal.symtab;
-
- if (scrollDirection == FORWARD_SCROLL)
- {
- l.lineNo = content[0]->whichElement.source.lineOrAddr.lineNo +
- numToScroll;
- if (l.lineNo > s->nlines)
- /*line = s->nlines - winInfo->generic.contentSize + 1; */
- /*elz: fix for dts 23398 */
- l.lineNo = content[0]->whichElement.source.lineOrAddr.lineNo;
- }
- else
- {
- l.lineNo = content[0]->whichElement.source.lineOrAddr.lineNo -
- numToScroll;
- if (l.lineNo <= 0)
- l.lineNo = 1;
- }
-
- print_source_lines (s, l.lineNo, l.lineNo + 1, 0);
- }
-}
diff --git a/gdb/tui/tuiSource.h b/gdb/tui/tuiSource.h
deleted file mode 100644
index 96cf865..0000000
--- a/gdb/tui/tuiSource.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* TUI display source window.
- Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
- Contributed by Hewlett-Packard Company.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#ifndef _TUI_SOURCE_H
-#define _TUI_SOURCE_H
-
-#include "defs.h"
-
-extern TuiStatus tuiSetSourceContent (struct symtab *, int, int);
-extern void tuiShowSource (struct symtab *, TuiLineOrAddress, int);
-extern int tuiSourceIsDisplayed (char *);
-extern void tuiVerticalSourceScroll (TuiScrollDirection, int);
-
-#endif
-/*_TUI_SOURCE_H*/
diff --git a/gdb/tui/tuiSourceWin.c b/gdb/tui/tuiSourceWin.c
deleted file mode 100644
index cf5a079..0000000
--- a/gdb/tui/tuiSourceWin.c
+++ /dev/null
@@ -1,715 +0,0 @@
-/* TUI display source/assembly window.
-
- Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation,
- Inc.
-
- Contributed by Hewlett-Packard Company.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include "defs.h"
-#include <ctype.h>
-#include "symtab.h"
-#include "frame.h"
-#include "breakpoint.h"
-#include "value.h"
-#include "source.h"
-
-#include "tui.h"
-#include "tuiData.h"
-#include "tuiStack.h"
-#include "tuiWin.h"
-#include "tuiGeneralWin.h"
-#include "tuiSourceWin.h"
-#include "tuiSource.h"
-#include "tuiDisassem.h"
-
-#ifdef HAVE_NCURSES_H
-#include <ncurses.h>
-#else
-#ifdef HAVE_CURSES_H
-#include <curses.h>
-#endif
-#endif
-
-/* Function to display the "main" routine. */
-void
-tui_display_main (void)
-{
- if ((sourceWindows ())->count > 0)
- {
- CORE_ADDR addr;
-
- addr = tuiGetBeginAsmAddress ();
- if (addr != (CORE_ADDR) 0)
- {
- struct symtab_and_line sal;
-
- tuiUpdateSourceWindowsWithAddr (addr);
- sal = find_pc_line (addr, 0);
- if (sal.symtab)
- tuiUpdateLocatorFilename (sal.symtab->filename);
- else
- tuiUpdateLocatorFilename ("??");
- }
- }
-}
-
-
-
-/*
- ** tuiUpdateSourceWindow().
- ** Function to display source in the source window. This function
- ** initializes the horizontal scroll to 0.
- */
-void
-tuiUpdateSourceWindow (TuiWinInfoPtr winInfo, struct symtab *s,
- TuiLineOrAddress lineOrAddr, int noerror)
-{
- winInfo->detail.sourceInfo.horizontalOffset = 0;
- tuiUpdateSourceWindowAsIs (winInfo, s, lineOrAddr, noerror);
-
- return;
-} /* tuiUpdateSourceWindow */
-
-
-/*
- ** tuiUpdateSourceWindowAsIs().
- ** Function to display source in the source/asm window. This
- ** function shows the source as specified by the horizontal offset.
- */
-void
-tuiUpdateSourceWindowAsIs (TuiWinInfoPtr winInfo, struct symtab *s,
- TuiLineOrAddress lineOrAddr, int noerror)
-{
- TuiStatus ret;
-
- if (winInfo->generic.type == SRC_WIN)
- ret = tuiSetSourceContent (s, lineOrAddr.lineNo, noerror);
- else
- ret = tuiSetDisassemContent (lineOrAddr.addr);
-
- if (ret == TUI_FAILURE)
- {
- tuiClearSourceContent (winInfo, EMPTY_SOURCE_PROMPT);
- tuiClearExecInfoContent (winInfo);
- }
- else
- {
- tui_update_breakpoint_info (winInfo, 0);
- tuiShowSourceContent (winInfo);
- tuiUpdateExecInfo (winInfo);
- if (winInfo->generic.type == SRC_WIN)
- {
- struct symtab_and_line sal;
-
- sal.line = lineOrAddr.lineNo +
- (winInfo->generic.contentSize - 2);
- sal.symtab = s;
- set_current_source_symtab_and_line (&sal);
- /*
- ** If the focus was in the asm win, put it in the src
- ** win if we don't have a split layout
- */
- if (tuiWinWithFocus () == disassemWin &&
- currentLayout () != SRC_DISASSEM_COMMAND)
- tuiSetWinFocusTo (srcWin);
- }
- }
-
-
- return;
-} /* tuiUpdateSourceWindowAsIs */
-
-
-/*
- ** tuiUpdateSourceWindowsWithAddr().
- ** Function to ensure that the source and/or disassemly windows
- ** reflect the input address.
- */
-void
-tuiUpdateSourceWindowsWithAddr (CORE_ADDR addr)
-{
- if (addr != 0)
- {
- struct symtab_and_line sal;
- TuiLineOrAddress l;
-
- switch (currentLayout ())
- {
- case DISASSEM_COMMAND:
- case DISASSEM_DATA_COMMAND:
- tuiShowDisassem (addr);
- break;
- case SRC_DISASSEM_COMMAND:
- tuiShowDisassemAndUpdateSource (addr);
- break;
- default:
- sal = find_pc_line (addr, 0);
- l.lineNo = sal.line;
- tuiShowSource (sal.symtab, l, FALSE);
- break;
- }
- }
- else
- {
- int i;
-
- for (i = 0; i < (sourceWindows ())->count; i++)
- {
- TuiWinInfoPtr winInfo = (TuiWinInfoPtr) (sourceWindows ())->list[i];
-
- tuiClearSourceContent (winInfo, EMPTY_SOURCE_PROMPT);
- tuiClearExecInfoContent (winInfo);
- }
- }
-
- return;
-} /* tuiUpdateSourceWindowsWithAddr */
-
-/*
- ** tuiUpdateSourceWindowsWithLine().
- ** Function to ensure that the source and/or disassemly windows
- ** reflect the input address.
- */
-void
-tuiUpdateSourceWindowsWithLine (struct symtab *s, int line)
-{
- CORE_ADDR pc;
- TuiLineOrAddress l;
-
- switch (currentLayout ())
- {
- case DISASSEM_COMMAND:
- case DISASSEM_DATA_COMMAND:
- find_line_pc (s, line, &pc);
- tuiUpdateSourceWindowsWithAddr (pc);
- break;
- default:
- l.lineNo = line;
- tuiShowSource (s, l, FALSE);
- if (currentLayout () == SRC_DISASSEM_COMMAND)
- {
- find_line_pc (s, line, &pc);
- tuiShowDisassem (pc);
- }
- break;
- }
-
- return;
-} /* tuiUpdateSourceWindowsWithLine */
-
-/*
- ** tuiClearSourceContent().
- */
-void
-tuiClearSourceContent (TuiWinInfoPtr winInfo, int displayPrompt)
-{
- if (m_winPtrNotNull (winInfo))
- {
- register int i;
-
- winInfo->generic.contentInUse = FALSE;
- tuiEraseSourceContent (winInfo, displayPrompt);
- for (i = 0; i < winInfo->generic.contentSize; i++)
- {
- TuiWinElementPtr element =
- (TuiWinElementPtr) winInfo->generic.content[i];
- element->whichElement.source.hasBreak = FALSE;
- element->whichElement.source.isExecPoint = FALSE;
- }
- }
-
- return;
-} /* tuiClearSourceContent */
-
-
-/*
- ** tuiEraseSourceContent().
- */
-void
-tuiEraseSourceContent (TuiWinInfoPtr winInfo, int displayPrompt)
-{
- int xPos;
- int halfWidth = (winInfo->generic.width - 2) / 2;
-
- if (winInfo->generic.handle != (WINDOW *) NULL)
- {
- werase (winInfo->generic.handle);
- checkAndDisplayHighlightIfNeeded (winInfo);
- if (displayPrompt == EMPTY_SOURCE_PROMPT)
- {
- char *noSrcStr;
-
- if (winInfo->generic.type == SRC_WIN)
- noSrcStr = NO_SRC_STRING;
- else
- noSrcStr = NO_DISASSEM_STRING;
- if (strlen (noSrcStr) >= halfWidth)
- xPos = 1;
- else
- xPos = halfWidth - strlen (noSrcStr);
- mvwaddstr (winInfo->generic.handle,
- (winInfo->generic.height / 2),
- xPos,
- noSrcStr);
-
- /* elz: added this function call to set the real contents of
- the window to what is on the screen, so that later calls
- to refresh, do display
- the correct stuff, and not the old image */
-
- tuiSetSourceContentNil (winInfo, noSrcStr);
- }
- tuiRefreshWin (&winInfo->generic);
- }
- return;
-} /* tuiEraseSourceContent */
-
-
-/* Redraw the complete line of a source or disassembly window. */
-static void
-tui_show_source_line (TuiWinInfoPtr winInfo, int lineno)
-{
- TuiWinElementPtr line;
- int x, y;
-
- line = (TuiWinElementPtr) winInfo->generic.content[lineno - 1];
- if (line->whichElement.source.isExecPoint)
- wattron (winInfo->generic.handle, A_STANDOUT);
-
- mvwaddstr (winInfo->generic.handle, lineno, 1,
- line->whichElement.source.line);
- if (line->whichElement.source.isExecPoint)
- wattroff (winInfo->generic.handle, A_STANDOUT);
-
- /* Clear to end of line but stop before the border. */
- getyx (winInfo->generic.handle, y, x);
- while (x + 1 < winInfo->generic.width)
- {
- waddch (winInfo->generic.handle, ' ');
- getyx (winInfo->generic.handle, y, x);
- }
-}
-
-/*
- ** tuiShowSourceContent().
- */
-void
-tuiShowSourceContent (TuiWinInfoPtr winInfo)
-{
- if (winInfo->generic.contentSize > 0)
- {
- int lineno;
-
- for (lineno = 1; lineno <= winInfo->generic.contentSize; lineno++)
- tui_show_source_line (winInfo, lineno);
- }
- else
- tuiEraseSourceContent (winInfo, TRUE);
-
- checkAndDisplayHighlightIfNeeded (winInfo);
- tuiRefreshWin (&winInfo->generic);
- winInfo->generic.contentInUse = TRUE;
-}
-
-
-/*
- ** tuiHorizontalSourceScroll().
- ** Scroll the source forward or backward horizontally
- */
-void
-tuiHorizontalSourceScroll (TuiWinInfoPtr winInfo,
- TuiScrollDirection direction,
- int numToScroll)
-{
- if (winInfo->generic.content != (OpaquePtr) NULL)
- {
- int offset;
- struct symtab *s;
- struct symtab_and_line cursal = get_current_source_symtab_and_line ();
-
- if (cursal.symtab == (struct symtab *) NULL)
- s = find_pc_symtab (get_frame_pc (deprecated_selected_frame));
- else
- s = cursal.symtab;
-
- if (direction == LEFT_SCROLL)
- offset = winInfo->detail.sourceInfo.horizontalOffset + numToScroll;
- else
- {
- if ((offset =
- winInfo->detail.sourceInfo.horizontalOffset - numToScroll) < 0)
- offset = 0;
- }
- winInfo->detail.sourceInfo.horizontalOffset = offset;
- tuiUpdateSourceWindowAsIs (
- winInfo,
- s,
- ((TuiWinElementPtr)
- winInfo->generic.content[0])->whichElement.source.lineOrAddr,
- FALSE);
- }
-
- return;
-} /* tuiHorizontalSourceScroll */
-
-
-/* Set or clear the hasBreak flag in the line whose line is lineNo. */
-void
-tuiSetIsExecPointAt (TuiLineOrAddress l, TuiWinInfoPtr winInfo)
-{
- int changed = 0;
- int i;
- TuiWinContent content = (TuiWinContent) winInfo->generic.content;
-
- i = 0;
- while (i < winInfo->generic.contentSize)
- {
- int newState;
-
- if (content[i]->whichElement.source.lineOrAddr.addr == l.addr)
- newState = TRUE;
- else
- newState = FALSE;
- if (newState != content[i]->whichElement.source.isExecPoint)
- {
- changed++;
- content[i]->whichElement.source.isExecPoint = newState;
- tui_show_source_line (winInfo, i + 1);
- }
- i++;
- }
- if (changed)
- tuiRefreshWin (&winInfo->generic);
-}
-
-/* Update the execution windows to show the active breakpoints.
- This is called whenever a breakpoint is inserted, removed or
- has its state changed. */
-void
-tui_update_all_breakpoint_info ()
-{
- TuiList* list = sourceWindows ();
- int i;
-
- for (i = 0; i < list->count; i++)
- {
- TuiWinInfoPtr win = (TuiWinInfoPtr) list->list[i];
-
- if (tui_update_breakpoint_info (win, FALSE))
- {
- tuiUpdateExecInfo (win);
- }
- }
-}
-
-
-/* Scan the source window and the breakpoints to update the
- hasBreak information for each line.
- Returns 1 if something changed and the execution window
- must be refreshed. */
-int
-tui_update_breakpoint_info (TuiWinInfoPtr win, int current_only)
-{
- int i;
- int need_refresh = 0;
- TuiSourceInfoPtr src = &win->detail.sourceInfo;
-
- for (i = 0; i < win->generic.contentSize; i++)
- {
- struct breakpoint *bp;
- extern struct breakpoint *breakpoint_chain;
- int mode;
- TuiSourceElement* line;
-
- line = &((TuiWinElementPtr) win->generic.content[i])->whichElement.source;
- if (current_only && !line->isExecPoint)
- continue;
-
- /* Scan each breakpoint to see if the current line has something to
- do with it. Identify enable/disabled breakpoints as well as
- those that we already hit. */
- mode = 0;
- for (bp = breakpoint_chain;
- bp != (struct breakpoint *) NULL;
- bp = bp->next)
- {
- if ((win == srcWin
- && bp->source_file
- && (strcmp (src->filename, bp->source_file) == 0)
- && bp->line_number == line->lineOrAddr.lineNo)
- || (win == disassemWin
- && bp->address == line->lineOrAddr.addr))
- {
- if (bp->enable_state == bp_disabled)
- mode |= TUI_BP_DISABLED;
- else
- mode |= TUI_BP_ENABLED;
- if (bp->hit_count)
- mode |= TUI_BP_HIT;
- if (bp->cond)
- mode |= TUI_BP_CONDITIONAL;
- if (bp->type == bp_hardware_breakpoint)
- mode |= TUI_BP_HARDWARE;
- }
- }
- if (line->hasBreak != mode)
- {
- line->hasBreak = mode;
- need_refresh = 1;
- }
- }
- return need_refresh;
-}
-
-
-/*
- ** tuiSetExecInfoContent().
- ** Function to initialize the content of the execution info window,
- ** based upon the input window which is either the source or
- ** disassembly window.
- */
-TuiStatus
-tuiSetExecInfoContent (TuiWinInfoPtr winInfo)
-{
- TuiStatus ret = TUI_SUCCESS;
-
- if (winInfo->detail.sourceInfo.executionInfo != (TuiGenWinInfoPtr) NULL)
- {
- TuiGenWinInfoPtr execInfoPtr = winInfo->detail.sourceInfo.executionInfo;
-
- if (execInfoPtr->content == (OpaquePtr) NULL)
- execInfoPtr->content =
- (OpaquePtr) allocContent (winInfo->generic.height,
- execInfoPtr->type);
- if (execInfoPtr->content != (OpaquePtr) NULL)
- {
- int i;
-
- tui_update_breakpoint_info (winInfo, 1);
- for (i = 0; i < winInfo->generic.contentSize; i++)
- {
- TuiWinElementPtr element;
- TuiWinElementPtr srcElement;
- int mode;
-
- element = (TuiWinElementPtr) execInfoPtr->content[i];
- srcElement = (TuiWinElementPtr) winInfo->generic.content[i];
-
- memset(element->whichElement.simpleString, ' ',
- sizeof(element->whichElement.simpleString));
- element->whichElement.simpleString[TUI_EXECINFO_SIZE - 1] = 0;
-
- /* Now update the exec info content based upon the state
- of each line as indicated by the source content. */
- mode = srcElement->whichElement.source.hasBreak;
- if (mode & TUI_BP_HIT)
- element->whichElement.simpleString[TUI_BP_HIT_POS] =
- (mode & TUI_BP_HARDWARE) ? 'H' : 'B';
- else if (mode & (TUI_BP_ENABLED | TUI_BP_DISABLED))
- element->whichElement.simpleString[TUI_BP_HIT_POS] =
- (mode & TUI_BP_HARDWARE) ? 'h' : 'b';
-
- if (mode & TUI_BP_ENABLED)
- element->whichElement.simpleString[TUI_BP_BREAK_POS] = '+';
- else if (mode & TUI_BP_DISABLED)
- element->whichElement.simpleString[TUI_BP_BREAK_POS] = '-';
-
- if (srcElement->whichElement.source.isExecPoint)
- element->whichElement.simpleString[TUI_EXEC_POS] = '>';
- }
- execInfoPtr->contentSize = winInfo->generic.contentSize;
- }
- else
- ret = TUI_FAILURE;
- }
-
- return ret;
-}
-
-
-/*
- ** tuiShowExecInfoContent().
- */
-void
-tuiShowExecInfoContent (TuiWinInfoPtr winInfo)
-{
- TuiGenWinInfoPtr execInfo = winInfo->detail.sourceInfo.executionInfo;
- int curLine;
-
- werase (execInfo->handle);
- tuiRefreshWin (execInfo);
- for (curLine = 1; (curLine <= execInfo->contentSize); curLine++)
- mvwaddstr (execInfo->handle,
- curLine,
- 0,
- ((TuiWinElementPtr)
- execInfo->content[curLine - 1])->whichElement.simpleString);
- tuiRefreshWin (execInfo);
- execInfo->contentInUse = TRUE;
-
- return;
-} /* tuiShowExecInfoContent */
-
-
-/*
- ** tuiEraseExecInfoContent().
- */
-void
-tuiEraseExecInfoContent (TuiWinInfoPtr winInfo)
-{
- TuiGenWinInfoPtr execInfo = winInfo->detail.sourceInfo.executionInfo;
-
- werase (execInfo->handle);
- tuiRefreshWin (execInfo);
-
- return;
-} /* tuiEraseExecInfoContent */
-
-/*
- ** tuiClearExecInfoContent().
- */
-void
-tuiClearExecInfoContent (TuiWinInfoPtr winInfo)
-{
- winInfo->detail.sourceInfo.executionInfo->contentInUse = FALSE;
- tuiEraseExecInfoContent (winInfo);
-
- return;
-} /* tuiClearExecInfoContent */
-
-/*
- ** tuiUpdateExecInfo().
- ** Function to update the execution info window
- */
-void
-tuiUpdateExecInfo (TuiWinInfoPtr winInfo)
-{
- tuiSetExecInfoContent (winInfo);
- tuiShowExecInfoContent (winInfo);
-} /* tuiUpdateExecInfo */
-
-TuiStatus
-tuiAllocSourceBuffer (TuiWinInfoPtr winInfo)
-{
- register char *srcLineBuf;
- register int i, lineWidth, maxLines;
- TuiStatus ret = TUI_FAILURE;
-
- maxLines = winInfo->generic.height; /* less the highlight box */
- lineWidth = winInfo->generic.width - 1;
- /*
- ** Allocate the buffer for the source lines. Do this only once since they
- ** will be re-used for all source displays. The only other time this will
- ** be done is when a window's size changes.
- */
- if (winInfo->generic.content == (OpaquePtr) NULL)
- {
- srcLineBuf = (char *) xmalloc ((maxLines * lineWidth) * sizeof (char));
- if (srcLineBuf == (char *) NULL)
- fputs_unfiltered (
- "Unable to Allocate Memory for Source or Disassembly Display.\n",
- gdb_stderr);
- else
- {
- /* allocate the content list */
- if ((winInfo->generic.content =
- (OpaquePtr) allocContent (maxLines, SRC_WIN)) == (OpaquePtr) NULL)
- {
- tuiFree (srcLineBuf);
- srcLineBuf = (char *) NULL;
- fputs_unfiltered (
- "Unable to Allocate Memory for Source or Disassembly Display.\n",
- gdb_stderr);
- }
- }
- for (i = 0; i < maxLines; i++)
- ((TuiWinElementPtr)
- winInfo->generic.content[i])->whichElement.source.line =
- srcLineBuf + (lineWidth * i);
- ret = TUI_SUCCESS;
- }
- else
- ret = TUI_SUCCESS;
-
- return ret;
-} /* tuiAllocSourceBuffer */
-
-
-/*
- ** tuiLineIsDisplayed().
- ** Answer whether the a particular line number or address is displayed
- ** in the current source window.
- */
-int
-tuiLineIsDisplayed (int line, TuiWinInfoPtr winInfo,
- int checkThreshold)
-{
- int isDisplayed = FALSE;
- int i, threshold;
-
- if (checkThreshold)
- threshold = SCROLL_THRESHOLD;
- else
- threshold = 0;
- i = 0;
- while (i < winInfo->generic.contentSize - threshold && !isDisplayed)
- {
- isDisplayed = (((TuiWinElementPtr)
- winInfo->generic.content[i])->whichElement.source.lineOrAddr.lineNo
- == (int) line);
- i++;
- }
-
- return isDisplayed;
-} /* tuiLineIsDisplayed */
-
-
-/*
- ** tuiLineIsDisplayed().
- ** Answer whether the a particular line number or address is displayed
- ** in the current source window.
- */
-int
-tuiAddrIsDisplayed (CORE_ADDR addr, TuiWinInfoPtr winInfo,
- int checkThreshold)
-{
- int isDisplayed = FALSE;
- int i, threshold;
-
- if (checkThreshold)
- threshold = SCROLL_THRESHOLD;
- else
- threshold = 0;
- i = 0;
- while (i < winInfo->generic.contentSize - threshold && !isDisplayed)
- {
- isDisplayed = (((TuiWinElementPtr)
- winInfo->generic.content[i])->whichElement.source.lineOrAddr.addr
- == addr);
- i++;
- }
-
- return isDisplayed;
-}
-
-
-/*****************************************
-** STATIC LOCAL FUNCTIONS **
-******************************************/
diff --git a/gdb/tui/tuiSourceWin.h b/gdb/tui/tuiSourceWin.h
deleted file mode 100644
index cb00449..0000000
--- a/gdb/tui/tuiSourceWin.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* TUI display source/assembly window.
- Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
- Contributed by Hewlett-Packard Company.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#ifndef _TUI_SOURCEWIN_H
-#define _TUI_SOURCEWIN_H
-
-/* Update the execution windows to show the active breakpoints.
- This is called whenever a breakpoint is inserted, removed or
- has its state changed. */
-extern void tui_update_all_breakpoint_info (void);
-
-/* Scan the source window and the breakpoints to update the
- hasBreak information for each line.
- Returns 1 if something changed and the execution window
- must be refreshed. */
-extern int tui_update_breakpoint_info (TuiWinInfoPtr win, int current_only);
-
-/* Function to display the "main" routine. */
-extern void tui_display_main (void);
-extern void tuiUpdateSourceWindow (TuiWinInfoPtr, struct symtab *, TuiLineOrAddress,
- int);
-extern void tuiUpdateSourceWindowAsIs (TuiWinInfoPtr, struct symtab *, TuiLineOrAddress,
- int);
-extern void tuiUpdateSourceWindowsWithAddr (CORE_ADDR);
-extern void tuiUpdateSourceWindowsWithLine (struct symtab *, int);
-extern void tuiClearSourceContent (TuiWinInfoPtr, int);
-extern void tuiEraseSourceContent (TuiWinInfoPtr, int);
-extern void tuiSetSourceContentNil (TuiWinInfoPtr, char *);
-extern void tuiShowSourceContent (TuiWinInfoPtr);
-extern void tuiHorizontalSourceScroll (TuiWinInfoPtr, TuiScrollDirection,
- int);
-extern TuiStatus tuiSetExecInfoContent (TuiWinInfoPtr);
-extern void tuiShowExecInfoContent (TuiWinInfoPtr);
-extern void tuiEraseExecInfoContent (TuiWinInfoPtr);
-extern void tuiClearExecInfoContent (TuiWinInfoPtr);
-extern void tuiUpdateExecInfo (TuiWinInfoPtr);
-
-extern void tuiSetIsExecPointAt (TuiLineOrAddress, TuiWinInfoPtr);
-extern TuiStatus tuiAllocSourceBuffer (TuiWinInfoPtr);
-extern int tuiLineIsDisplayed (int, TuiWinInfoPtr, int);
-extern int tuiAddrIsDisplayed (CORE_ADDR, TuiWinInfoPtr, int);
-
-
-/*
- ** Constant definitions
- */
-#define SCROLL_THRESHOLD 2 /* threshold for lazy scroll */
-
-#endif
-/*_TUI_SOURCEWIN_H */
diff --git a/gdb/tui/tuiStack.c b/gdb/tui/tuiStack.c
deleted file mode 100644
index a6ad07a..0000000
--- a/gdb/tui/tuiStack.c
+++ /dev/null
@@ -1,435 +0,0 @@
-/* TUI display locator.
-
- Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation,
- Inc.
-
- Contributed by Hewlett-Packard Company.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include "defs.h"
-#include "symtab.h"
-#include "breakpoint.h"
-#include "frame.h"
-#include "command.h"
-#include "inferior.h"
-#include "target.h"
-#include "top.h"
-
-#include "tui.h"
-#include "tuiData.h"
-#include "tuiStack.h"
-#include "tuiGeneralWin.h"
-#include "tuiSource.h"
-#include "tuiSourceWin.h"
-#include "tui-file.h"
-
-#ifdef HAVE_NCURSES_H
-#include <ncurses.h>
-#else
-#ifdef HAVE_CURSES_H
-#include <curses.h>
-#endif
-#endif
-
-/* Get a printable name for the function at the address.
- The symbol name is demangled if demangling is turned on.
- Returns a pointer to a static area holding the result. */
-static char* tui_get_function_from_frame (struct frame_info *fi);
-
-/* Set the filename portion of the locator. */
-static void tui_set_locator_filename (const char *filename);
-
-/* Update the locator, with the provided arguments. */
-static void tui_set_locator_info (const char *filename, const char *procname,
- int lineno, CORE_ADDR addr);
-
-static void tui_update_command (char *, int);
-
-
-/* Create the status line to display as much information as we
- can on this single line: target name, process number, current
- function, current line, current PC, SingleKey mode. */
-static char*
-tui_make_status_line (TuiLocatorElement* loc)
-{
- char* string;
- char line_buf[50], *pname;
- char* buf;
- int status_size;
- int i, proc_width;
- const char* pid_name;
- const char* pc_buf;
- int target_width;
- int pid_width;
- int line_width;
- int pc_width;
- struct ui_file *pc_out;
-
- if (ptid_equal (inferior_ptid, null_ptid))
- pid_name = "No process";
- else
- pid_name = target_pid_to_str (inferior_ptid);
-
- target_width = strlen (target_shortname);
- if (target_width > MAX_TARGET_WIDTH)
- target_width = MAX_TARGET_WIDTH;
-
- pid_width = strlen (pid_name);
- if (pid_width > MAX_PID_WIDTH)
- pid_width = MAX_PID_WIDTH;
-
- status_size = termWidth ();
- string = (char *) xmalloc (status_size + 1);
- buf = (char*) alloca (status_size + 1);
-
- /* Translate line number and obtain its size. */
- if (loc->lineNo > 0)
- sprintf (line_buf, "%d", loc->lineNo);
- else
- strcpy (line_buf, "??");
- line_width = strlen (line_buf);
- if (line_width < MIN_LINE_WIDTH)
- line_width = MIN_LINE_WIDTH;
-
- /* Translate PC address. */
- pc_out = tui_sfileopen (128);
- print_address_numeric (loc->addr, 1, pc_out);
- pc_buf = tui_file_get_strbuf (pc_out);
- pc_width = strlen (pc_buf);
-
- /* First determine the amount of proc name width we have available.
- The +1 are for a space separator between fields.
- The -1 are to take into account the \0 counted by sizeof. */
- proc_width = (status_size
- - (target_width + 1)
- - (pid_width + 1)
- - (sizeof (PROC_PREFIX) - 1 + 1)
- - (sizeof (LINE_PREFIX) - 1 + line_width + 1)
- - (sizeof (PC_PREFIX) - 1 + pc_width + 1)
- - (tui_current_key_mode == tui_single_key_mode
- ? (sizeof (SINGLE_KEY) - 1 + 1)
- : 0));
-
- /* If there is no room to print the function name, try by removing
- some fields. */
- if (proc_width < MIN_PROC_WIDTH)
- {
- proc_width += target_width + 1;
- target_width = 0;
- if (proc_width < MIN_PROC_WIDTH)
- {
- proc_width += pid_width + 1;
- pid_width = 0;
- if (proc_width <= MIN_PROC_WIDTH)
- {
- proc_width += pc_width + sizeof (PC_PREFIX) - 1 + 1;
- pc_width = 0;
- if (proc_width < 0)
- {
- proc_width += line_width + sizeof (LINE_PREFIX) - 1 + 1;
- line_width = 0;
- if (proc_width < 0)
- proc_width = 0;
- }
- }
- }
- }
-
- /* Now convert elements to string form */
- pname = loc->procName;
-
- /* Now create the locator line from the string version
- of the elements. We could use sprintf() here but
- that wouldn't ensure that we don't overrun the size
- of the allocated buffer. strcat_to_buf() will. */
- *string = (char) 0;
-
- if (target_width > 0)
- {
- sprintf (buf, "%*.*s ",
- -target_width, target_width, target_shortname);
- strcat_to_buf (string, status_size, buf);
- }
- if (pid_width > 0)
- {
- sprintf (buf, "%*.*s ",
- -pid_width, pid_width, pid_name);
- strcat_to_buf (string, status_size, buf);
- }
-
- /* Show whether we are in SingleKey mode. */
- if (tui_current_key_mode == tui_single_key_mode)
- {
- strcat_to_buf (string, status_size, SINGLE_KEY);
- strcat_to_buf (string, status_size, " ");
- }
-
- /* procedure/class name */
- if (proc_width > 0)
- {
- if (strlen (pname) > proc_width)
- sprintf (buf, "%s%*.*s* ", PROC_PREFIX,
- 1 - proc_width, proc_width - 1, pname);
- else
- sprintf (buf, "%s%*.*s ", PROC_PREFIX,
- -proc_width, proc_width, pname);
- strcat_to_buf (string, status_size, buf);
- }
-
- if (line_width > 0)
- {
- sprintf (buf, "%s%*.*s ", LINE_PREFIX,
- -line_width, line_width, line_buf);
- strcat_to_buf (string, status_size, buf);
- }
- if (pc_width > 0)
- {
- strcat_to_buf (string, status_size, PC_PREFIX);
- strcat_to_buf (string, status_size, pc_buf);
- }
-
-
- for (i = strlen (string); i < status_size; i++)
- string[i] = ' ';
- string[status_size] = (char) 0;
-
- ui_file_delete (pc_out);
- return string;
-}
-
-/* Get a printable name for the function at the address.
- The symbol name is demangled if demangling is turned on.
- Returns a pointer to a static area holding the result. */
-static char*
-tui_get_function_from_frame (struct frame_info *fi)
-{
- static char name[256];
- struct ui_file *stream = tui_sfileopen (256);
- char *p;
-
- print_address_symbolic (get_frame_pc (fi), stream, demangle, "");
- p = tui_file_get_strbuf (stream);
-
- /* Use simple heuristics to isolate the function name. The symbol can
- be demangled and we can have function parameters. Remove them because
- the status line is too short to display them. */
- if (*p == '<')
- p++;
- strncpy (name, p, sizeof (name));
- p = strchr (name, '(');
- if (!p)
- p = strchr (name, '>');
- if (p)
- *p = 0;
- p = strchr (name, '+');
- if (p)
- *p = 0;
- ui_file_delete (stream);
- return name;
-}
-
-/*
- ** tuiShowLocatorContent()
- */
-void
-tuiShowLocatorContent (void)
-{
- char *string;
- TuiGenWinInfoPtr locator;
-
- locator = locatorWinInfoPtr ();
-
- if (m_genWinPtrNotNull (locator) && locator->handle != (WINDOW *) NULL)
- {
- TuiWinElementPtr element;
-
- element = (TuiWinElementPtr) locator->content[0];
-
- string = tui_make_status_line (&element->whichElement.locator);
- wmove (locator->handle, 0, 0);
- wstandout (locator->handle);
- waddstr (locator->handle, string);
- wclrtoeol (locator->handle);
- wstandend (locator->handle);
- tuiRefreshWin (locator);
- wmove (locator->handle, 0, 0);
- xfree (string);
- locator->contentInUse = TRUE;
- }
-}
-
-
-/* Set the filename portion of the locator. */
-static void
-tui_set_locator_filename (const char *filename)
-{
- TuiGenWinInfoPtr locator = locatorWinInfoPtr ();
- TuiLocatorElementPtr element;
-
- if (locator->content[0] == (Opaque) NULL)
- {
- tui_set_locator_info (filename, NULL, 0, 0);
- return;
- }
-
- element = &((TuiWinElementPtr) locator->content[0])->whichElement.locator;
- element->fileName[0] = 0;
- strcat_to_buf (element->fileName, MAX_LOCATOR_ELEMENT_LEN, filename);
-}
-
-/* Update the locator, with the provided arguments. */
-static void
-tui_set_locator_info (const char *filename, const char *procname, int lineno,
- CORE_ADDR addr)
-{
- TuiGenWinInfoPtr locator = locatorWinInfoPtr ();
- TuiLocatorElementPtr element;
-
- /* Allocate the locator content if necessary. */
- if (locator->contentSize <= 0)
- {
- locator->content = (OpaquePtr) allocContent (1, locator->type);
- locator->contentSize = 1;
- }
-
- element = &((TuiWinElementPtr) locator->content[0])->whichElement.locator;
- element->procName[0] = (char) 0;
- strcat_to_buf (element->procName, MAX_LOCATOR_ELEMENT_LEN, procname);
- element->lineNo = lineno;
- element->addr = addr;
- tui_set_locator_filename (filename);
-}
-
-/* Update only the filename portion of the locator. */
-void
-tuiUpdateLocatorFilename (const char *filename)
-{
- tui_set_locator_filename (filename);
- tuiShowLocatorContent ();
-}
-
-/* Function to print the frame information for the TUI. */
-void
-tuiShowFrameInfo (struct frame_info *fi)
-{
- TuiWinInfoPtr winInfo;
- register int i;
-
- if (fi)
- {
- register int startLine, i;
- CORE_ADDR low;
- TuiGenWinInfoPtr locator = locatorWinInfoPtr ();
- int sourceAlreadyDisplayed;
- struct symtab_and_line sal;
-
- find_frame_sal (fi, &sal);
-
- sourceAlreadyDisplayed = sal.symtab != 0
- && tuiSourceIsDisplayed (sal.symtab->filename);
- tui_set_locator_info (sal.symtab == 0 ? "??" : sal.symtab->filename,
- tui_get_function_from_frame (fi),
- sal.line,
- get_frame_pc (fi));
- tuiShowLocatorContent ();
- startLine = 0;
- for (i = 0; i < (sourceWindows ())->count; i++)
- {
- TuiWhichElement *item;
- winInfo = (TuiWinInfoPtr) (sourceWindows ())->list[i];
-
- item = &((TuiWinElementPtr) locator->content[0])->whichElement;
- if (winInfo == srcWin)
- {
- startLine = (item->locator.lineNo -
- (winInfo->generic.viewportHeight / 2)) + 1;
- if (startLine <= 0)
- startLine = 1;
- }
- else
- {
- if (find_pc_partial_function (get_frame_pc (fi), (char **) NULL,
- &low, (CORE_ADDR) NULL) == 0)
- error ("No function contains program counter for selected frame.\n");
- else
- low = tuiGetLowDisassemblyAddress (low, get_frame_pc (fi));
- }
-
- if (winInfo == srcWin)
- {
- TuiLineOrAddress l;
- l.lineNo = startLine;
- if (!(sourceAlreadyDisplayed
- && tuiLineIsDisplayed (item->locator.lineNo, winInfo, TRUE)))
- tuiUpdateSourceWindow (winInfo, sal.symtab, l, TRUE);
- else
- {
- l.lineNo = item->locator.lineNo;
- tuiSetIsExecPointAt (l, winInfo);
- }
- }
- else
- {
- if (winInfo == disassemWin)
- {
- TuiLineOrAddress a;
- a.addr = low;
- if (!tuiAddrIsDisplayed (item->locator.addr, winInfo, TRUE))
- tuiUpdateSourceWindow (winInfo, sal.symtab, a, TRUE);
- else
- {
- a.addr = item->locator.addr;
- tuiSetIsExecPointAt (a, winInfo);
- }
- }
- }
- tuiUpdateExecInfo (winInfo);
- }
- }
- else
- {
- tui_set_locator_info (NULL, NULL, 0, (CORE_ADDR) 0);
- tuiShowLocatorContent ();
- for (i = 0; i < (sourceWindows ())->count; i++)
- {
- winInfo = (TuiWinInfoPtr) (sourceWindows ())->list[i];
- tuiClearSourceContent (winInfo, EMPTY_SOURCE_PROMPT);
- tuiUpdateExecInfo (winInfo);
- }
- }
-}
-
-/* Function to initialize gdb commands, for tui window stack manipulation. */
-void
-_initialize_tuiStack (void)
-{
- add_com ("update", class_tui, tui_update_command,
- "Update the source window and locator to display the current "
- "execution point.\n");
-}
-
-/* Command to update the display with the current execution point. */
-static void
-tui_update_command (char *arg, int from_tty)
-{
- char cmd[sizeof("frame 0")];
-
- strcpy (cmd, "frame 0");
- execute_command (cmd, from_tty);
-}
diff --git a/gdb/tui/tuiStack.h b/gdb/tui/tuiStack.h
deleted file mode 100644
index 14be497..0000000
--- a/gdb/tui/tuiStack.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* TUI display locator.
- Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
- Contributed by Hewlett-Packard Company.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#ifndef _TUI_STACK_H
-#define _TUI_STACK_H
-/*
- ** This header file supports
- */
-
-extern void tuiUpdateLocatorFilename (const char *);
-extern void tuiShowLocatorContent (void);
-extern void tuiShowFrameInfo (struct frame_info *);
-
-#endif
-/*_TUI_STACK_H*/
diff --git a/gdb/tui/tuiWin.c b/gdb/tui/tuiWin.c
deleted file mode 100644
index ecd4920..0000000
--- a/gdb/tui/tuiWin.c
+++ /dev/null
@@ -1,1615 +0,0 @@
-/* TUI window generic functions.
-
- Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation,
- Inc.
-
- Contributed by Hewlett-Packard Company.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-/* This module contains procedures for handling tui window functions
- like resize, scrolling, scrolling, changing focus, etc.
-
- Author: Susan B. Macchia */
-
-#include "defs.h"
-#include "command.h"
-#include "symtab.h"
-#include "breakpoint.h"
-#include "frame.h"
-#include "cli/cli-cmds.h"
-#include "top.h"
-#include "source.h"
-
-#include "tui.h"
-#include "tuiData.h"
-#include "tuiGeneralWin.h"
-#include "tuiStack.h"
-#include "tuiRegs.h"
-#include "tuiDisassem.h"
-#include "tuiSource.h"
-#include "tuiSourceWin.h"
-#include "tuiDataWin.h"
-
-#ifdef HAVE_NCURSES_H
-#include <ncurses.h>
-#else
-#ifdef HAVE_CURSES_H
-#include <curses.h>
-#endif
-#endif
-
-#include <string.h>
-#include <ctype.h>
-#include <readline/readline.h>
-
-/*******************************
-** Static Local Decls
-********************************/
-static void _makeVisibleWithNewHeight (TuiWinInfoPtr);
-static void _makeInvisibleAndSetNewHeight (TuiWinInfoPtr, int);
-static TuiStatus _tuiAdjustWinHeights (TuiWinInfoPtr, int);
-static int _newHeightOk (TuiWinInfoPtr, int);
-static void _tuiSetTabWidth_command (char *, int);
-static void _tuiRefreshAll_command (char *, int);
-static void _tuiSetWinHeight_command (char *, int);
-static void _tuiXDBsetWinHeight_command (char *, int);
-static void _tuiAllWindowsInfo (char *, int);
-static void _tuiSetFocus_command (char *, int);
-static void _tuiScrollForward_command (char *, int);
-static void _tuiScrollBackward_command (char *, int);
-static void _tuiScrollLeft_command (char *, int);
-static void _tuiScrollRight_command (char *, int);
-static void _parseScrollingArgs (char *, TuiWinInfoPtr *, int *);
-
-
-/***************************************
-** DEFINITIONS
-***************************************/
-#define WIN_HEIGHT_USAGE "Usage: winheight <win_name> [+ | -] <#lines>\n"
-#define XDBWIN_HEIGHT_USAGE "Usage: w <#lines>\n"
-#define FOCUS_USAGE "Usage: focus {<win> | next | prev}\n"
-
-/***************************************
-** PUBLIC FUNCTIONS
-***************************************/
-
-#ifndef ACS_LRCORNER
-# define ACS_LRCORNER '+'
-#endif
-#ifndef ACS_LLCORNER
-# define ACS_LLCORNER '+'
-#endif
-#ifndef ACS_ULCORNER
-# define ACS_ULCORNER '+'
-#endif
-#ifndef ACS_URCORNER
-# define ACS_URCORNER '+'
-#endif
-#ifndef ACS_HLINE
-# define ACS_HLINE '-'
-#endif
-#ifndef ACS_VLINE
-# define ACS_VLINE '|'
-#endif
-
-/* Possible values for tui-border-kind variable. */
-static const char *tui_border_kind_enums[] = {
- "space",
- "ascii",
- "acs",
- NULL
-};
-
-/* Possible values for tui-border-mode and tui-active-border-mode. */
-static const char *tui_border_mode_enums[] = {
- "normal",
- "standout",
- "reverse",
- "half",
- "half-standout",
- "bold",
- "bold-standout",
- NULL
-};
-
-struct tui_translate
-{
- const char *name;
- int value;
-};
-
-/* Translation table for border-mode variables.
- The list of values must be terminated by a NULL.
- After the NULL value, an entry defines the default. */
-struct tui_translate tui_border_mode_translate[] = {
- { "normal", A_NORMAL },
- { "standout", A_STANDOUT },
- { "reverse", A_REVERSE },
- { "half", A_DIM },
- { "half-standout", A_DIM | A_STANDOUT },
- { "bold", A_BOLD },
- { "bold-standout", A_BOLD | A_STANDOUT },
- { 0, 0 },
- { "normal", A_NORMAL }
-};
-
-/* Translation tables for border-kind, one for each border
- character (see wborder, border curses operations).
- -1 is used to indicate the ACS because ACS characters
- are determined at run time by curses (depends on terminal). */
-struct tui_translate tui_border_kind_translate_vline[] = {
- { "space", ' ' },
- { "ascii", '|' },
- { "acs", -1 },
- { 0, 0 },
- { "ascii", '|' }
-};
-
-struct tui_translate tui_border_kind_translate_hline[] = {
- { "space", ' ' },
- { "ascii", '-' },
- { "acs", -1 },
- { 0, 0 },
- { "ascii", '-' }
-};
-
-struct tui_translate tui_border_kind_translate_ulcorner[] = {
- { "space", ' ' },
- { "ascii", '+' },
- { "acs", -1 },
- { 0, 0 },
- { "ascii", '+' }
-};
-
-struct tui_translate tui_border_kind_translate_urcorner[] = {
- { "space", ' ' },
- { "ascii", '+' },
- { "acs", -1 },
- { 0, 0 },
- { "ascii", '+' }
-};
-
-struct tui_translate tui_border_kind_translate_llcorner[] = {
- { "space", ' ' },
- { "ascii", '+' },
- { "acs", -1 },
- { 0, 0 },
- { "ascii", '+' }
-};
-
-struct tui_translate tui_border_kind_translate_lrcorner[] = {
- { "space", ' ' },
- { "ascii", '+' },
- { "acs", -1 },
- { 0, 0 },
- { "ascii", '+' }
-};
-
-
-/* Tui configuration variables controlled with set/show command. */
-const char *tui_active_border_mode = "bold-standout";
-const char *tui_border_mode = "normal";
-const char *tui_border_kind = "acs";
-
-/* Tui internal configuration variables. These variables are
- updated by tui_update_variables to reflect the tui configuration
- variables. */
-chtype tui_border_vline;
-chtype tui_border_hline;
-chtype tui_border_ulcorner;
-chtype tui_border_urcorner;
-chtype tui_border_llcorner;
-chtype tui_border_lrcorner;
-
-int tui_border_attrs;
-int tui_active_border_attrs;
-
-/* Identify the item in the translation table.
- When the item is not recognized, use the default entry. */
-static struct tui_translate *
-translate (const char *name, struct tui_translate *table)
-{
- while (table->name)
- {
- if (name && strcmp (table->name, name) == 0)
- return table;
- table++;
- }
-
- /* Not found, return default entry. */
- table++;
- return table;
-}
-
-/* Update the tui internal configuration according to gdb settings.
- Returns 1 if the configuration has changed and the screen should
- be redrawn. */
-int
-tui_update_variables ()
-{
- int need_redraw = 0;
- struct tui_translate *entry;
-
- entry = translate (tui_border_mode, tui_border_mode_translate);
- if (tui_border_attrs != entry->value)
- {
- tui_border_attrs = entry->value;
- need_redraw = 1;
- }
- entry = translate (tui_active_border_mode, tui_border_mode_translate);
- if (tui_active_border_attrs != entry->value)
- {
- tui_active_border_attrs = entry->value;
- need_redraw = 1;
- }
-
- /* If one corner changes, all characters are changed.
- Only check the first one. The ACS characters are determined at
- run time by curses terminal management. */
- entry = translate (tui_border_kind, tui_border_kind_translate_lrcorner);
- if (tui_border_lrcorner != (chtype) entry->value)
- {
- tui_border_lrcorner = (entry->value < 0) ? ACS_LRCORNER : entry->value;
- need_redraw = 1;
- }
- entry = translate (tui_border_kind, tui_border_kind_translate_llcorner);
- tui_border_llcorner = (entry->value < 0) ? ACS_LLCORNER : entry->value;
-
- entry = translate (tui_border_kind, tui_border_kind_translate_ulcorner);
- tui_border_ulcorner = (entry->value < 0) ? ACS_ULCORNER : entry->value;
-
- entry = translate (tui_border_kind, tui_border_kind_translate_urcorner);
- tui_border_urcorner = (entry->value < 0) ? ACS_URCORNER : entry->value;
-
- entry = translate (tui_border_kind, tui_border_kind_translate_hline);
- tui_border_hline = (entry->value < 0) ? ACS_HLINE : entry->value;
-
- entry = translate (tui_border_kind, tui_border_kind_translate_vline);
- tui_border_vline = (entry->value < 0) ? ACS_VLINE : entry->value;
-
- return need_redraw;
-}
-
-static void
-set_tui_cmd (char *args, int from_tty)
-{
-}
-
-static void
-show_tui_cmd (char *args, int from_tty)
-{
-}
-
-/*
- ** _initialize_tuiWin().
- ** Function to initialize gdb commands, for tui window manipulation.
- */
-void
-_initialize_tuiWin (void)
-{
- struct cmd_list_element *c;
- static struct cmd_list_element *tui_setlist;
- static struct cmd_list_element *tui_showlist;
-
- /* Define the classes of commands.
- They will appear in the help list in the reverse of this order. */
- add_cmd ("tui", class_tui, NULL,
- "Text User Interface commands.",
- &cmdlist);
-
- add_prefix_cmd ("tui", class_tui, set_tui_cmd,
- "TUI configuration variables",
- &tui_setlist, "set tui ",
- 0/*allow-unknown*/, &setlist);
- add_prefix_cmd ("tui", class_tui, show_tui_cmd,
- "TUI configuration variables",
- &tui_showlist, "show tui ",
- 0/*allow-unknown*/, &showlist);
-
- add_com ("refresh", class_tui, _tuiRefreshAll_command,
- "Refresh the terminal display.\n");
- if (xdb_commands)
- add_com_alias ("U", "refresh", class_tui, 0);
- add_com ("tabset", class_tui, _tuiSetTabWidth_command,
- "Set the width (in characters) of tab stops.\n\
-Usage: tabset <n>\n");
- add_com ("winheight", class_tui, _tuiSetWinHeight_command,
- "Set the height of a specified window.\n\
-Usage: winheight <win_name> [+ | -] <#lines>\n\
-Window names are:\n\
-src : the source window\n\
-cmd : the command window\n\
-asm : the disassembly window\n\
-regs : the register display\n");
- add_com_alias ("wh", "winheight", class_tui, 0);
- add_info ("win", _tuiAllWindowsInfo,
- "List of all displayed windows.\n");
- add_com ("focus", class_tui, _tuiSetFocus_command,
- "Set focus to named window or next/prev window.\n\
-Usage: focus {<win> | next | prev}\n\
-Valid Window names are:\n\
-src : the source window\n\
-asm : the disassembly window\n\
-regs : the register display\n\
-cmd : the command window\n");
- add_com_alias ("fs", "focus", class_tui, 0);
- add_com ("+", class_tui, _tuiScrollForward_command,
- "Scroll window forward.\nUsage: + [win] [n]\n");
- add_com ("-", class_tui, _tuiScrollBackward_command,
- "Scroll window backward.\nUsage: - [win] [n]\n");
- add_com ("<", class_tui, _tuiScrollLeft_command,
- "Scroll window forward.\nUsage: < [win] [n]\n");
- add_com (">", class_tui, _tuiScrollRight_command,
- "Scroll window backward.\nUsage: > [win] [n]\n");
- if (xdb_commands)
- add_com ("w", class_xdb, _tuiXDBsetWinHeight_command,
- "XDB compatibility command for setting the height of a command window.\n\
-Usage: w <#lines>\n");
-
- /* Define the tui control variables. */
- c = add_set_enum_cmd
- ("border-kind", no_class,
- tui_border_kind_enums, &tui_border_kind,
- "Set the kind of border for TUI windows.\n"
- "This variable controls the border of TUI windows:\n"
- "space use a white space\n"
- "ascii use ascii characters + - | for the border\n"
- "acs use the Alternate Character Set\n",
- &tui_setlist);
- add_show_from_set (c, &tui_showlist);
-
- c = add_set_enum_cmd
- ("border-mode", no_class,
- tui_border_mode_enums, &tui_border_mode,
- "Set the attribute mode to use for the TUI window borders.\n"
- "This variable controls the attributes to use for the window borders:\n"
- "normal normal display\n"
- "standout use highlight mode of terminal\n"
- "reverse use reverse video mode\n"
- "half use half bright\n"
- "half-standout use half bright and standout mode\n"
- "bold use extra bright or bold\n"
- "bold-standout use extra bright or bold with standout mode\n",
- &tui_setlist);
- add_show_from_set (c, &tui_showlist);
-
- c = add_set_enum_cmd
- ("active-border-mode", no_class,
- tui_border_mode_enums, &tui_active_border_mode,
- "Set the attribute mode to use for the active TUI window border.\n"
- "This variable controls the attributes to use for the active window border:\n"
- "normal normal display\n"
- "standout use highlight mode of terminal\n"
- "reverse use reverse video mode\n"
- "half use half bright\n"
- "half-standout use half bright and standout mode\n"
- "bold use extra bright or bold\n"
- "bold-standout use extra bright or bold with standout mode\n",
- &tui_setlist);
- add_show_from_set (c, &tui_showlist);
-}
-
-/* Update gdb's knowledge of the terminal size. */
-void
-tui_update_gdb_sizes ()
-{
- char cmd[50];
- int screenheight, screenwidth;
-
- rl_get_screen_size (&screenheight, &screenwidth);
- /* Set to TUI command window dimension or use readline values. */
- sprintf (cmd, "set width %d",
- tui_active ? cmdWin->generic.width : screenwidth);
- execute_command (cmd, 0);
- sprintf (cmd, "set height %d",
- tui_active ? cmdWin->generic.height : screenheight);
- execute_command (cmd, 0);
-}
-
-
-/*
- ** tuiSetWinFocusTo
- ** Set the logical focus to winInfo
- */
-void
-tuiSetWinFocusTo (TuiWinInfoPtr winInfo)
-{
- if (m_winPtrNotNull (winInfo))
- {
- TuiWinInfoPtr winWithFocus = tuiWinWithFocus ();
-
- if (m_winPtrNotNull (winWithFocus) &&
- winWithFocus->generic.type != CMD_WIN)
- unhighlightWin (winWithFocus);
- tuiSetWinWithFocus (winInfo);
- if (winInfo->generic.type != CMD_WIN)
- highlightWin (winInfo);
- }
-
- return;
-} /* tuiSetWinFocusTo */
-
-
-/*
- ** tuiScrollForward().
- */
-void
-tuiScrollForward (TuiWinInfoPtr winToScroll, int numToScroll)
-{
- if (winToScroll != cmdWin)
- {
- int _numToScroll = numToScroll;
-
- if (numToScroll == 0)
- _numToScroll = winToScroll->generic.height - 3;
- /*
- ** If we are scrolling the source or disassembly window, do a
- ** "psuedo" scroll since not all of the source is in memory,
- ** only what is in the viewport. If winToScroll is the
- ** command window do nothing since the term should handle it.
- */
- if (winToScroll == srcWin)
- tuiVerticalSourceScroll (FORWARD_SCROLL, _numToScroll);
- else if (winToScroll == disassemWin)
- tuiVerticalDisassemScroll (FORWARD_SCROLL, _numToScroll);
- else if (winToScroll == dataWin)
- tuiVerticalDataScroll (FORWARD_SCROLL, _numToScroll);
- }
-
- return;
-} /* tuiScrollForward */
-
-
-/*
- ** tuiScrollBackward().
- */
-void
-tuiScrollBackward (TuiWinInfoPtr winToScroll, int numToScroll)
-{
- if (winToScroll != cmdWin)
- {
- int _numToScroll = numToScroll;
-
- if (numToScroll == 0)
- _numToScroll = winToScroll->generic.height - 3;
- /*
- ** If we are scrolling the source or disassembly window, do a
- ** "psuedo" scroll since not all of the source is in memory,
- ** only what is in the viewport. If winToScroll is the
- ** command window do nothing since the term should handle it.
- */
- if (winToScroll == srcWin)
- tuiVerticalSourceScroll (BACKWARD_SCROLL, _numToScroll);
- else if (winToScroll == disassemWin)
- tuiVerticalDisassemScroll (BACKWARD_SCROLL, _numToScroll);
- else if (winToScroll == dataWin)
- tuiVerticalDataScroll (BACKWARD_SCROLL, _numToScroll);
- }
- return;
-} /* tuiScrollBackward */
-
-
-/*
- ** tuiScrollLeft().
- */
-void
-tuiScrollLeft (TuiWinInfoPtr winToScroll, int numToScroll)
-{
- if (winToScroll != cmdWin)
- {
- int _numToScroll = numToScroll;
-
- if (_numToScroll == 0)
- _numToScroll = 1;
- /*
- ** If we are scrolling the source or disassembly window, do a
- ** "psuedo" scroll since not all of the source is in memory,
- ** only what is in the viewport. If winToScroll is the
- ** command window do nothing since the term should handle it.
- */
- if (winToScroll == srcWin || winToScroll == disassemWin)
- tuiHorizontalSourceScroll (winToScroll, LEFT_SCROLL, _numToScroll);
- }
- return;
-} /* tuiScrollLeft */
-
-
-/*
- ** tuiScrollRight().
- */
-void
-tuiScrollRight (TuiWinInfoPtr winToScroll, int numToScroll)
-{
- if (winToScroll != cmdWin)
- {
- int _numToScroll = numToScroll;
-
- if (_numToScroll == 0)
- _numToScroll = 1;
- /*
- ** If we are scrolling the source or disassembly window, do a
- ** "psuedo" scroll since not all of the source is in memory,
- ** only what is in the viewport. If winToScroll is the
- ** command window do nothing since the term should handle it.
- */
- if (winToScroll == srcWin || winToScroll == disassemWin)
- tuiHorizontalSourceScroll (winToScroll, RIGHT_SCROLL, _numToScroll);
- }
- return;
-} /* tuiScrollRight */
-
-
-/*
- ** tui_scroll().
- ** Scroll a window. Arguments are passed through a va_list.
- */
-void
-tui_scroll (TuiScrollDirection direction,
- TuiWinInfoPtr winToScroll,
- int numToScroll)
-{
- switch (direction)
- {
- case FORWARD_SCROLL:
- tuiScrollForward (winToScroll, numToScroll);
- break;
- case BACKWARD_SCROLL:
- tuiScrollBackward (winToScroll, numToScroll);
- break;
- case LEFT_SCROLL:
- tuiScrollLeft (winToScroll, numToScroll);
- break;
- case RIGHT_SCROLL:
- tuiScrollRight (winToScroll, numToScroll);
- break;
- default:
- break;
- }
-}
-
-
-/*
- ** tuiRefreshAll().
- */
-void
-tuiRefreshAll (void)
-{
- TuiWinType type;
-
- clearok (curscr, TRUE);
- refreshAll (winList);
- for (type = SRC_WIN; type < MAX_MAJOR_WINDOWS; type++)
- {
- if (winList[type] && winList[type]->generic.isVisible)
- {
- switch (type)
- {
- case SRC_WIN:
- case DISASSEM_WIN:
- tuiShowSourceContent (winList[type]);
- checkAndDisplayHighlightIfNeeded (winList[type]);
- tuiEraseExecInfoContent (winList[type]);
- tuiUpdateExecInfo (winList[type]);
- break;
- case DATA_WIN:
- tuiRefreshDataWin ();
- break;
- default:
- break;
- }
- }
- }
- tuiShowLocatorContent ();
-}
-
-
-/*
- ** tuiResizeAll().
- ** Resize all the windows based on the the terminal size. This
- ** function gets called from within the readline sinwinch handler.
- */
-void
-tuiResizeAll (void)
-{
- int heightDiff, widthDiff;
- int screenheight, screenwidth;
-
- rl_get_screen_size (&screenheight, &screenwidth);
- widthDiff = screenwidth - termWidth ();
- heightDiff = screenheight - termHeight ();
- if (heightDiff || widthDiff)
- {
- TuiLayoutType curLayout = currentLayout ();
- TuiWinInfoPtr winWithFocus = tuiWinWithFocus ();
- TuiWinInfoPtr firstWin, secondWin;
- TuiGenWinInfoPtr locator = locatorWinInfoPtr ();
- TuiWinType winType;
- int newHeight, splitDiff, cmdSplitDiff, numWinsDisplayed = 2;
-
- /* turn keypad off while we resize */
- if (winWithFocus != cmdWin)
- keypad (cmdWin->generic.handle, FALSE);
- tui_update_gdb_sizes ();
- setTermHeightTo (screenheight);
- setTermWidthTo (screenwidth);
- if (curLayout == SRC_DISASSEM_COMMAND ||
- curLayout == SRC_DATA_COMMAND || curLayout == DISASSEM_DATA_COMMAND)
- numWinsDisplayed++;
- splitDiff = heightDiff / numWinsDisplayed;
- cmdSplitDiff = splitDiff;
- if (heightDiff % numWinsDisplayed)
- {
- if (heightDiff < 0)
- cmdSplitDiff--;
- else
- cmdSplitDiff++;
- }
- /* now adjust each window */
- clear ();
- refresh ();
- switch (curLayout)
- {
- case SRC_COMMAND:
- case DISASSEM_COMMAND:
- firstWin = (TuiWinInfoPtr) (sourceWindows ())->list[0];
- firstWin->generic.width += widthDiff;
- locator->width += widthDiff;
- /* check for invalid heights */
- if (heightDiff == 0)
- newHeight = firstWin->generic.height;
- else if ((firstWin->generic.height + splitDiff) >=
- (screenheight - MIN_CMD_WIN_HEIGHT - 1))
- newHeight = screenheight - MIN_CMD_WIN_HEIGHT - 1;
- else if ((firstWin->generic.height + splitDiff) <= 0)
- newHeight = MIN_WIN_HEIGHT;
- else
- newHeight = firstWin->generic.height + splitDiff;
-
- _makeInvisibleAndSetNewHeight (firstWin, newHeight);
- cmdWin->generic.origin.y = locator->origin.y + 1;
- cmdWin->generic.width += widthDiff;
- newHeight = screenheight - cmdWin->generic.origin.y;
- _makeInvisibleAndSetNewHeight (cmdWin, newHeight);
- _makeVisibleWithNewHeight (firstWin);
- _makeVisibleWithNewHeight (cmdWin);
- if (firstWin->generic.contentSize <= 0)
- tuiEraseSourceContent (firstWin, EMPTY_SOURCE_PROMPT);
- break;
- default:
- if (curLayout == SRC_DISASSEM_COMMAND)
- {
- firstWin = srcWin;
- firstWin->generic.width += widthDiff;
- secondWin = disassemWin;
- secondWin->generic.width += widthDiff;
- }
- else
- {
- firstWin = dataWin;
- firstWin->generic.width += widthDiff;
- secondWin = (TuiWinInfoPtr) (sourceWindows ())->list[0];
- secondWin->generic.width += widthDiff;
- }
- /* Change the first window's height/width */
- /* check for invalid heights */
- if (heightDiff == 0)
- newHeight = firstWin->generic.height;
- else if ((firstWin->generic.height +
- secondWin->generic.height + (splitDiff * 2)) >=
- (screenheight - MIN_CMD_WIN_HEIGHT - 1))
- newHeight = (screenheight - MIN_CMD_WIN_HEIGHT - 1) / 2;
- else if ((firstWin->generic.height + splitDiff) <= 0)
- newHeight = MIN_WIN_HEIGHT;
- else
- newHeight = firstWin->generic.height + splitDiff;
- _makeInvisibleAndSetNewHeight (firstWin, newHeight);
-
- if (firstWin == dataWin && widthDiff != 0)
- firstWin->detail.dataDisplayInfo.regsColumnCount =
- tuiCalculateRegsColumnCount (
- firstWin->detail.dataDisplayInfo.regsDisplayType);
- locator->width += widthDiff;
-
- /* Change the second window's height/width */
- /* check for invalid heights */
- if (heightDiff == 0)
- newHeight = secondWin->generic.height;
- else if ((firstWin->generic.height +
- secondWin->generic.height + (splitDiff * 2)) >=
- (screenheight - MIN_CMD_WIN_HEIGHT - 1))
- {
- newHeight = screenheight - MIN_CMD_WIN_HEIGHT - 1;
- if (newHeight % 2)
- newHeight = (newHeight / 2) + 1;
- else
- newHeight /= 2;
- }
- else if ((secondWin->generic.height + splitDiff) <= 0)
- newHeight = MIN_WIN_HEIGHT;
- else
- newHeight = secondWin->generic.height + splitDiff;
- secondWin->generic.origin.y = firstWin->generic.height - 1;
- _makeInvisibleAndSetNewHeight (secondWin, newHeight);
-
- /* Change the command window's height/width */
- cmdWin->generic.origin.y = locator->origin.y + 1;
- _makeInvisibleAndSetNewHeight (
- cmdWin, cmdWin->generic.height + cmdSplitDiff);
- _makeVisibleWithNewHeight (firstWin);
- _makeVisibleWithNewHeight (secondWin);
- _makeVisibleWithNewHeight (cmdWin);
- if (firstWin->generic.contentSize <= 0)
- tuiEraseSourceContent (firstWin, EMPTY_SOURCE_PROMPT);
- if (secondWin->generic.contentSize <= 0)
- tuiEraseSourceContent (secondWin, EMPTY_SOURCE_PROMPT);
- break;
- }
- /*
- ** Now remove all invisible windows, and their content so that they get
- ** created again when called for with the new size
- */
- for (winType = SRC_WIN; (winType < MAX_MAJOR_WINDOWS); winType++)
- {
- if (winType != CMD_WIN && m_winPtrNotNull (winList[winType]) &&
- !winList[winType]->generic.isVisible)
- {
- freeWindow (winList[winType]);
- winList[winType] = (TuiWinInfoPtr) NULL;
- }
- }
- tuiSetWinResizedTo (TRUE);
- /* turn keypad back on, unless focus is in the command window */
- if (winWithFocus != cmdWin)
- keypad (cmdWin->generic.handle, TRUE);
- }
- return;
-} /* tuiResizeAll */
-
-
-/*
- ** tuiSigwinchHandler()
- ** SIGWINCH signal handler for the tui. This signal handler is
- ** always called, even when the readline package clears signals
- ** because it is set as the old_sigwinch() (TUI only)
- */
-void
-tuiSigwinchHandler (int signal)
-{
- /*
- ** Say that a resize was done so that the readline can do it
- ** later when appropriate.
- */
- tuiSetWinResizedTo (TRUE);
-
- return;
-} /* tuiSigwinchHandler */
-
-
-
-/*************************
-** STATIC LOCAL FUNCTIONS
-**************************/
-
-
-/*
- ** _tuiScrollForward_command().
- */
-static void
-_tuiScrollForward_command (char *arg, int fromTTY)
-{
- int numToScroll = 1;
- TuiWinInfoPtr winToScroll;
-
- /* Make sure the curses mode is enabled. */
- tui_enable ();
- if (arg == (char *) NULL)
- _parseScrollingArgs (arg, &winToScroll, (int *) NULL);
- else
- _parseScrollingArgs (arg, &winToScroll, &numToScroll);
- tui_scroll (FORWARD_SCROLL, winToScroll, numToScroll);
-}
-
-
-/*
- ** _tuiScrollBackward_command().
- */
-static void
-_tuiScrollBackward_command (char *arg, int fromTTY)
-{
- int numToScroll = 1;
- TuiWinInfoPtr winToScroll;
-
- /* Make sure the curses mode is enabled. */
- tui_enable ();
- if (arg == (char *) NULL)
- _parseScrollingArgs (arg, &winToScroll, (int *) NULL);
- else
- _parseScrollingArgs (arg, &winToScroll, &numToScroll);
- tui_scroll (BACKWARD_SCROLL, winToScroll, numToScroll);
-}
-
-
-/*
- ** _tuiScrollLeft_command().
- */
-static void
-_tuiScrollLeft_command (char *arg, int fromTTY)
-{
- int numToScroll;
- TuiWinInfoPtr winToScroll;
-
- /* Make sure the curses mode is enabled. */
- tui_enable ();
- _parseScrollingArgs (arg, &winToScroll, &numToScroll);
- tui_scroll (LEFT_SCROLL, winToScroll, numToScroll);
-}
-
-
-/*
- ** _tuiScrollRight_command().
- */
-static void
-_tuiScrollRight_command (char *arg, int fromTTY)
-{
- int numToScroll;
- TuiWinInfoPtr winToScroll;
-
- /* Make sure the curses mode is enabled. */
- tui_enable ();
- _parseScrollingArgs (arg, &winToScroll, &numToScroll);
- tui_scroll (RIGHT_SCROLL, winToScroll, numToScroll);
-}
-
-
-/*
- ** _tuiSetFocus().
- ** Set focus to the window named by 'arg'
- */
-static void
-_tuiSetFocus (char *arg, int fromTTY)
-{
- if (arg != (char *) NULL)
- {
- char *bufPtr = (char *) xstrdup (arg);
- int i;
- TuiWinInfoPtr winInfo = (TuiWinInfoPtr) NULL;
-
- for (i = 0; (i < strlen (bufPtr)); i++)
- bufPtr[i] = toupper (arg[i]);
-
- if (subset_compare (bufPtr, "NEXT"))
- winInfo = tuiNextWin (tuiWinWithFocus ());
- else if (subset_compare (bufPtr, "PREV"))
- winInfo = tuiPrevWin (tuiWinWithFocus ());
- else
- winInfo = partialWinByName (bufPtr);
-
- if (winInfo == (TuiWinInfoPtr) NULL || !winInfo->generic.isVisible)
- warning ("Invalid window specified. \n\
-The window name specified must be valid and visible.\n");
- else
- {
- tuiSetWinFocusTo (winInfo);
- keypad (cmdWin->generic.handle, (winInfo != cmdWin));
- }
-
- if (dataWin && dataWin->generic.isVisible)
- tuiRefreshDataWin ();
- tuiFree (bufPtr);
- printf_filtered ("Focus set to %s window.\n",
- winName ((TuiGenWinInfoPtr) tuiWinWithFocus ()));
- }
- else
- warning ("Incorrect Number of Arguments.\n%s", FOCUS_USAGE);
-
- return;
-} /* _tuiSetFocus */
-
-/*
- ** _tuiSetFocus_command()
- */
-static void
-_tuiSetFocus_command (char *arg, int fromTTY)
-{
- /* Make sure the curses mode is enabled. */
- tui_enable ();
- _tuiSetFocus (arg, fromTTY);
-}
-
-
-/*
- ** _tuiAllWindowsInfo().
- */
-static void
-_tuiAllWindowsInfo (char *arg, int fromTTY)
-{
- TuiWinType type;
- TuiWinInfoPtr winWithFocus = tuiWinWithFocus ();
-
- for (type = SRC_WIN; (type < MAX_MAJOR_WINDOWS); type++)
- if (winList[type] && winList[type]->generic.isVisible)
- {
- if (winWithFocus == winList[type])
- printf_filtered (" %s\t(%d lines) <has focus>\n",
- winName (&winList[type]->generic),
- winList[type]->generic.height);
- else
- printf_filtered (" %s\t(%d lines)\n",
- winName (&winList[type]->generic),
- winList[type]->generic.height);
- }
-
- return;
-} /* _tuiAllWindowsInfo */
-
-
-/*
- ** _tuiRefreshAll_command().
- */
-static void
-_tuiRefreshAll_command (char *arg, int fromTTY)
-{
- /* Make sure the curses mode is enabled. */
- tui_enable ();
-
- tuiRefreshAll ();
-}
-
-
-/*
- ** _tuiSetWinTabWidth_command().
- ** Set the height of the specified window.
- */
-static void
-_tuiSetTabWidth_command (char *arg, int fromTTY)
-{
- /* Make sure the curses mode is enabled. */
- tui_enable ();
- if (arg != (char *) NULL)
- {
- int ts;
-
- ts = atoi (arg);
- if (ts > 0)
- tuiSetDefaultTabLen (ts);
- else
- warning ("Tab widths greater than 0 must be specified.\n");
- }
-
- return;
-} /* _tuiSetTabWidth_command */
-
-
-/*
- ** _tuiSetWinHeight().
- ** Set the height of the specified window.
- */
-static void
-_tuiSetWinHeight (char *arg, int fromTTY)
-{
- /* Make sure the curses mode is enabled. */
- tui_enable ();
- if (arg != (char *) NULL)
- {
- char *buf = xstrdup (arg);
- char *bufPtr = buf;
- char *wname = (char *) NULL;
- int newHeight, i;
- TuiWinInfoPtr winInfo;
-
- wname = bufPtr;
- bufPtr = strchr (bufPtr, ' ');
- if (bufPtr != (char *) NULL)
- {
- *bufPtr = (char) 0;
-
- /*
- ** Validate the window name
- */
- for (i = 0; i < strlen (wname); i++)
- wname[i] = toupper (wname[i]);
- winInfo = partialWinByName (wname);
-
- if (winInfo == (TuiWinInfoPtr) NULL || !winInfo->generic.isVisible)
- warning ("Invalid window specified. \n\
-The window name specified must be valid and visible.\n");
- else
- {
- /* Process the size */
- while (*(++bufPtr) == ' ')
- ;
-
- if (*bufPtr != (char) 0)
- {
- int negate = FALSE;
- int fixedSize = TRUE;
- int inputNo;;
-
- if (*bufPtr == '+' || *bufPtr == '-')
- {
- if (*bufPtr == '-')
- negate = TRUE;
- fixedSize = FALSE;
- bufPtr++;
- }
- inputNo = atoi (bufPtr);
- if (inputNo > 0)
- {
- if (negate)
- inputNo *= (-1);
- if (fixedSize)
- newHeight = inputNo;
- else
- newHeight = winInfo->generic.height + inputNo;
- /*
- ** Now change the window's height, and adjust all
- ** other windows around it
- */
- if (_tuiAdjustWinHeights (winInfo,
- newHeight) == TUI_FAILURE)
- warning ("Invalid window height specified.\n%s",
- WIN_HEIGHT_USAGE);
- else
- tui_update_gdb_sizes ();
- }
- else
- warning ("Invalid window height specified.\n%s",
- WIN_HEIGHT_USAGE);
- }
- }
- }
- else
- printf_filtered (WIN_HEIGHT_USAGE);
-
- if (buf != (char *) NULL)
- tuiFree (buf);
- }
- else
- printf_filtered (WIN_HEIGHT_USAGE);
-
- return;
-} /* _tuiSetWinHeight */
-
-/*
- ** _tuiSetWinHeight_command().
- ** Set the height of the specified window, with va_list.
- */
-static void
-_tuiSetWinHeight_command (char *arg, int fromTTY)
-{
- /* Make sure the curses mode is enabled. */
- tui_enable ();
- _tuiSetWinHeight (arg, fromTTY);
-}
-
-
-/*
- ** _tuiXDBsetWinHeight().
- ** XDB Compatibility command for setting the window height. This will
- ** increase or decrease the command window by the specified amount.
- */
-static void
-_tuiXDBsetWinHeight (char *arg, int fromTTY)
-{
- /* Make sure the curses mode is enabled. */
- tui_enable ();
- if (arg != (char *) NULL)
- {
- int inputNo = atoi (arg);
-
- if (inputNo > 0)
- { /* Add 1 for the locator */
- int newHeight = termHeight () - (inputNo + 1);
-
- if (!_newHeightOk (winList[CMD_WIN], newHeight) ||
- _tuiAdjustWinHeights (winList[CMD_WIN],
- newHeight) == TUI_FAILURE)
- warning ("Invalid window height specified.\n%s",
- XDBWIN_HEIGHT_USAGE);
- }
- else
- warning ("Invalid window height specified.\n%s",
- XDBWIN_HEIGHT_USAGE);
- }
- else
- warning ("Invalid window height specified.\n%s", XDBWIN_HEIGHT_USAGE);
-
- return;
-} /* _tuiXDBsetWinHeight */
-
-/*
- ** _tuiSetWinHeight_command().
- ** Set the height of the specified window, with va_list.
- */
-static void
-_tuiXDBsetWinHeight_command (char *arg, int fromTTY)
-{
- _tuiXDBsetWinHeight (arg, fromTTY);
-}
-
-
-/*
- ** _tuiAdjustWinHeights().
- ** Function to adjust all window heights around the primary
- */
-static TuiStatus
-_tuiAdjustWinHeights (TuiWinInfoPtr primaryWinInfo, int newHeight)
-{
- TuiStatus status = TUI_FAILURE;
-
- if (_newHeightOk (primaryWinInfo, newHeight))
- {
- status = TUI_SUCCESS;
- if (newHeight != primaryWinInfo->generic.height)
- {
- int diff;
- TuiWinInfoPtr winInfo;
- TuiGenWinInfoPtr locator = locatorWinInfoPtr ();
- TuiLayoutType curLayout = currentLayout ();
-
- diff = (newHeight - primaryWinInfo->generic.height) * (-1);
- if (curLayout == SRC_COMMAND || curLayout == DISASSEM_COMMAND)
- {
- TuiWinInfoPtr srcWinInfo;
-
- _makeInvisibleAndSetNewHeight (primaryWinInfo, newHeight);
- if (primaryWinInfo->generic.type == CMD_WIN)
- {
- winInfo = (TuiWinInfoPtr) (sourceWindows ())->list[0];
- srcWinInfo = winInfo;
- }
- else
- {
- winInfo = winList[CMD_WIN];
- srcWinInfo = primaryWinInfo;
- }
- _makeInvisibleAndSetNewHeight (winInfo,
- winInfo->generic.height + diff);
- cmdWin->generic.origin.y = locator->origin.y + 1;
- _makeVisibleWithNewHeight (winInfo);
- _makeVisibleWithNewHeight (primaryWinInfo);
- if (srcWinInfo->generic.contentSize <= 0)
- tuiEraseSourceContent (srcWinInfo, EMPTY_SOURCE_PROMPT);
- }
- else
- {
- TuiWinInfoPtr firstWin, secondWin;
-
- if (curLayout == SRC_DISASSEM_COMMAND)
- {
- firstWin = srcWin;
- secondWin = disassemWin;
- }
- else
- {
- firstWin = dataWin;
- secondWin = (TuiWinInfoPtr) (sourceWindows ())->list[0];
- }
- if (primaryWinInfo == cmdWin)
- { /*
- ** Split the change in height accross the 1st & 2nd windows
- ** adjusting them as well.
- */
- int firstSplitDiff = diff / 2; /* subtract the locator */
- int secondSplitDiff = firstSplitDiff;
-
- if (diff % 2)
- {
- if (firstWin->generic.height >
- secondWin->generic.height)
- if (diff < 0)
- firstSplitDiff--;
- else
- firstSplitDiff++;
- else
- {
- if (diff < 0)
- secondSplitDiff--;
- else
- secondSplitDiff++;
- }
- }
- /* make sure that the minimum hieghts are honored */
- while ((firstWin->generic.height + firstSplitDiff) < 3)
- {
- firstSplitDiff++;
- secondSplitDiff--;
- }
- while ((secondWin->generic.height + secondSplitDiff) < 3)
- {
- secondSplitDiff++;
- firstSplitDiff--;
- }
- _makeInvisibleAndSetNewHeight (
- firstWin,
- firstWin->generic.height + firstSplitDiff);
- secondWin->generic.origin.y = firstWin->generic.height - 1;
- _makeInvisibleAndSetNewHeight (
- secondWin, secondWin->generic.height + secondSplitDiff);
- cmdWin->generic.origin.y = locator->origin.y + 1;
- _makeInvisibleAndSetNewHeight (cmdWin, newHeight);
- }
- else
- {
- if ((cmdWin->generic.height + diff) < 1)
- { /*
- ** If there is no way to increase the command window
- ** take real estate from the 1st or 2nd window.
- */
- if ((cmdWin->generic.height + diff) < 1)
- {
- int i;
- for (i = cmdWin->generic.height + diff;
- (i < 1); i++)
- if (primaryWinInfo == firstWin)
- secondWin->generic.height--;
- else
- firstWin->generic.height--;
- }
- }
- if (primaryWinInfo == firstWin)
- _makeInvisibleAndSetNewHeight (firstWin, newHeight);
- else
- _makeInvisibleAndSetNewHeight (
- firstWin,
- firstWin->generic.height);
- secondWin->generic.origin.y = firstWin->generic.height - 1;
- if (primaryWinInfo == secondWin)
- _makeInvisibleAndSetNewHeight (secondWin, newHeight);
- else
- _makeInvisibleAndSetNewHeight (
- secondWin, secondWin->generic.height);
- cmdWin->generic.origin.y = locator->origin.y + 1;
- if ((cmdWin->generic.height + diff) < 1)
- _makeInvisibleAndSetNewHeight (cmdWin, 1);
- else
- _makeInvisibleAndSetNewHeight (
- cmdWin, cmdWin->generic.height + diff);
- }
- _makeVisibleWithNewHeight (cmdWin);
- _makeVisibleWithNewHeight (secondWin);
- _makeVisibleWithNewHeight (firstWin);
- if (firstWin->generic.contentSize <= 0)
- tuiEraseSourceContent (firstWin, EMPTY_SOURCE_PROMPT);
- if (secondWin->generic.contentSize <= 0)
- tuiEraseSourceContent (secondWin, EMPTY_SOURCE_PROMPT);
- }
- }
- }
-
- return status;
-} /* _tuiAdjustWinHeights */
-
-
-/*
- ** _makeInvisibleAndSetNewHeight().
- ** Function make the target window (and auxillary windows associated
- ** with the targer) invisible, and set the new height and location.
- */
-static void
-_makeInvisibleAndSetNewHeight (TuiWinInfoPtr winInfo, int height)
-{
- int i;
- TuiGenWinInfoPtr genWinInfo;
-
-
- m_beInvisible (&winInfo->generic);
- winInfo->generic.height = height;
- if (height > 1)
- winInfo->generic.viewportHeight = height - 1;
- else
- winInfo->generic.viewportHeight = height;
- if (winInfo != cmdWin)
- winInfo->generic.viewportHeight--;
-
- /* Now deal with the auxillary windows associated with winInfo */
- switch (winInfo->generic.type)
- {
- case SRC_WIN:
- case DISASSEM_WIN:
- genWinInfo = winInfo->detail.sourceInfo.executionInfo;
- m_beInvisible (genWinInfo);
- genWinInfo->height = height;
- genWinInfo->origin.y = winInfo->generic.origin.y;
- if (height > 1)
- genWinInfo->viewportHeight = height - 1;
- else
- genWinInfo->viewportHeight = height;
- if (winInfo != cmdWin)
- genWinInfo->viewportHeight--;
-
- if (m_hasLocator (winInfo))
- {
- genWinInfo = locatorWinInfoPtr ();
- m_beInvisible (genWinInfo);
- genWinInfo->origin.y = winInfo->generic.origin.y + height;
- }
- break;
- case DATA_WIN:
- /* delete all data item windows */
- for (i = 0; i < winInfo->generic.contentSize; i++)
- {
- genWinInfo = (TuiGenWinInfoPtr) & ((TuiWinElementPtr)
- winInfo->generic.content[i])->whichElement.dataWindow;
- tuiDelwin (genWinInfo->handle);
- genWinInfo->handle = (WINDOW *) NULL;
- }
- break;
- default:
- break;
- }
-}
-
-
-/*
- ** _makeVisibleWithNewHeight().
- ** Function to make the windows with new heights visible.
- ** This means re-creating the windows' content since the window
- ** had to be destroyed to be made invisible.
- */
-static void
-_makeVisibleWithNewHeight (TuiWinInfoPtr winInfo)
-{
- struct symtab *s;
-
- m_beVisible (&winInfo->generic);
- checkAndDisplayHighlightIfNeeded (winInfo);
- switch (winInfo->generic.type)
- {
- case SRC_WIN:
- case DISASSEM_WIN:
- freeWinContent (winInfo->detail.sourceInfo.executionInfo);
- m_beVisible (winInfo->detail.sourceInfo.executionInfo);
- if (winInfo->generic.content != (OpaquePtr) NULL)
- {
- TuiLineOrAddress lineOrAddr;
- struct symtab_and_line cursal
- = get_current_source_symtab_and_line ();
-
- if (winInfo->generic.type == SRC_WIN)
- lineOrAddr.lineNo =
- winInfo->detail.sourceInfo.startLineOrAddr.lineNo;
- else
- lineOrAddr.addr =
- winInfo->detail.sourceInfo.startLineOrAddr.addr;
- freeWinContent (&winInfo->generic);
- tuiUpdateSourceWindow (winInfo,
- cursal.symtab, lineOrAddr, TRUE);
- }
- else if (deprecated_selected_frame != (struct frame_info *) NULL)
- {
- TuiLineOrAddress line;
- struct symtab_and_line cursal = get_current_source_symtab_and_line ();
-
-
- s = find_pc_symtab (get_frame_pc (deprecated_selected_frame));
- if (winInfo->generic.type == SRC_WIN)
- line.lineNo = cursal.line;
- else
- {
- find_line_pc (s, cursal.line, &line.addr);
- }
- tuiUpdateSourceWindow (winInfo, s, line, TRUE);
- }
- if (m_hasLocator (winInfo))
- {
- m_beVisible (locatorWinInfoPtr ());
- tuiShowLocatorContent ();
- }
- break;
- case DATA_WIN:
- tuiDisplayAllData ();
- break;
- case CMD_WIN:
- winInfo->detail.commandInfo.curLine = 0;
- winInfo->detail.commandInfo.curch = 0;
- wmove (winInfo->generic.handle,
- winInfo->detail.commandInfo.curLine,
- winInfo->detail.commandInfo.curch);
- break;
- default:
- break;
- }
-
- return;
-} /* _makeVisibleWithNewHeight */
-
-
-static int
-_newHeightOk (TuiWinInfoPtr primaryWinInfo, int newHeight)
-{
- int ok = (newHeight < termHeight ());
-
- if (ok)
- {
- int diff;
- TuiLayoutType curLayout = currentLayout ();
-
- diff = (newHeight - primaryWinInfo->generic.height) * (-1);
- if (curLayout == SRC_COMMAND || curLayout == DISASSEM_COMMAND)
- {
- ok = ((primaryWinInfo->generic.type == CMD_WIN &&
- newHeight <= (termHeight () - 4) &&
- newHeight >= MIN_CMD_WIN_HEIGHT) ||
- (primaryWinInfo->generic.type != CMD_WIN &&
- newHeight <= (termHeight () - 2) &&
- newHeight >= MIN_WIN_HEIGHT));
- if (ok)
- { /* check the total height */
- TuiWinInfoPtr winInfo;
-
- if (primaryWinInfo == cmdWin)
- winInfo = (TuiWinInfoPtr) (sourceWindows ())->list[0];
- else
- winInfo = cmdWin;
- ok = ((newHeight +
- (winInfo->generic.height + diff)) <= termHeight ());
- }
- }
- else
- {
- int curTotalHeight, totalHeight, minHeight = 0;
- TuiWinInfoPtr firstWin, secondWin;
-
- if (curLayout == SRC_DISASSEM_COMMAND)
- {
- firstWin = srcWin;
- secondWin = disassemWin;
- }
- else
- {
- firstWin = dataWin;
- secondWin = (TuiWinInfoPtr) (sourceWindows ())->list[0];
- }
- /*
- ** We could simply add all the heights to obtain the same result
- ** but below is more explicit since we subtract 1 for the
- ** line that the first and second windows share, and add one
- ** for the locator.
- */
- totalHeight = curTotalHeight =
- (firstWin->generic.height + secondWin->generic.height - 1)
- + cmdWin->generic.height + 1 /*locator */ ;
- if (primaryWinInfo == cmdWin)
- {
- /* locator included since first & second win share a line */
- ok = ((firstWin->generic.height +
- secondWin->generic.height + diff) >=
- (MIN_WIN_HEIGHT * 2) &&
- newHeight >= MIN_CMD_WIN_HEIGHT);
- if (ok)
- {
- totalHeight = newHeight + (firstWin->generic.height +
- secondWin->generic.height + diff);
- minHeight = MIN_CMD_WIN_HEIGHT;
- }
- }
- else
- {
- minHeight = MIN_WIN_HEIGHT;
- /*
- ** First see if we can increase/decrease the command
- ** window. And make sure that the command window is
- ** at least 1 line
- */
- ok = ((cmdWin->generic.height + diff) > 0);
- if (!ok)
- { /*
- ** Looks like we have to increase/decrease one of
- ** the other windows
- */
- if (primaryWinInfo == firstWin)
- ok = (secondWin->generic.height + diff) >= minHeight;
- else
- ok = (firstWin->generic.height + diff) >= minHeight;
- }
- if (ok)
- {
- if (primaryWinInfo == firstWin)
- totalHeight = newHeight +
- secondWin->generic.height +
- cmdWin->generic.height + diff;
- else
- totalHeight = newHeight +
- firstWin->generic.height +
- cmdWin->generic.height + diff;
- }
- }
- /*
- ** Now make sure that the proposed total height doesn't exceed
- ** the old total height.
- */
- if (ok)
- ok = (newHeight >= minHeight && totalHeight <= curTotalHeight);
- }
- }
-
- return ok;
-} /* _newHeightOk */
-
-
-/*
- ** _parseScrollingArgs().
- */
-static void
-_parseScrollingArgs (char *arg, TuiWinInfoPtr * winToScroll, int *numToScroll)
-{
- if (numToScroll)
- *numToScroll = 0;
- *winToScroll = tuiWinWithFocus ();
-
- /*
- ** First set up the default window to scroll, in case there is no
- ** window name arg
- */
- if (arg != (char *) NULL)
- {
- char *buf, *bufPtr;
-
- /* process the number of lines to scroll */
- buf = bufPtr = xstrdup (arg);
- if (isdigit (*bufPtr))
- {
- char *numStr;
-
- numStr = bufPtr;
- bufPtr = strchr (bufPtr, ' ');
- if (bufPtr != (char *) NULL)
- {
- *bufPtr = (char) 0;
- if (numToScroll)
- *numToScroll = atoi (numStr);
- bufPtr++;
- }
- else if (numToScroll)
- *numToScroll = atoi (numStr);
- }
-
- /* process the window name if one is specified */
- if (bufPtr != (char *) NULL)
- {
- char *wname;
- int i;
-
- if (*bufPtr == ' ')
- while (*(++bufPtr) == ' ')
- ;
-
- if (*bufPtr != (char) 0)
- wname = bufPtr;
- else
- wname = "?";
-
- /* Validate the window name */
- for (i = 0; i < strlen (wname); i++)
- wname[i] = toupper (wname[i]);
- *winToScroll = partialWinByName (wname);
-
- if (*winToScroll == (TuiWinInfoPtr) NULL ||
- !(*winToScroll)->generic.isVisible)
- warning ("Invalid window specified. \n\
-The window name specified must be valid and visible.\n");
- else if (*winToScroll == cmdWin)
- *winToScroll = (TuiWinInfoPtr) (sourceWindows ())->list[0];
- }
- tuiFree (buf);
- }
-
- return;
-} /* _parseScrollingArgs */
diff --git a/gdb/tui/tuiWin.h b/gdb/tui/tuiWin.h
deleted file mode 100644
index bc26080..0000000
--- a/gdb/tui/tuiWin.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* TUI window generic functions.
- Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
- Contributed by Hewlett-Packard Company.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#ifndef _TUI_WIN_H
-#define _TUI_WIN_H
-
-/*****************************************
-** TYPE DEFINITIONS **
-******************************************/
-
-
-
-/*****************************************
-** PUBLIC FUNCTION EXTERNAL DECLS **
-******************************************/
-extern void tuiScrollForward (TuiWinInfoPtr, int);
-extern void tuiScrollBackward (TuiWinInfoPtr, int);
-extern void tuiScrollLeft (TuiWinInfoPtr, int);
-extern void tuiScrollRight (TuiWinInfoPtr, int);
-extern void tui_scroll (TuiScrollDirection, TuiWinInfoPtr, int);
-extern void tuiSetWinFocusTo (TuiWinInfoPtr);
-extern void tuiResizeAll (void);
-extern void tuiRefreshAll (void);
-extern void tuiSigwinchHandler (int);
-
-extern chtype tui_border_ulcorner;
-extern chtype tui_border_urcorner;
-extern chtype tui_border_lrcorner;
-extern chtype tui_border_llcorner;
-extern chtype tui_border_vline;
-extern chtype tui_border_hline;
-extern int tui_border_attrs;
-extern int tui_active_border_attrs;
-
-extern int tui_update_variables ();
-
-/* Update gdb's knowledge of the terminal size. */
-extern void tui_update_gdb_sizes (void);
-
-#endif
-/*_TUI_WIN_H*/
diff --git a/gdb/ui-out.c b/gdb/ui-out.c
index 5fb8eaa..854ec49 100644
--- a/gdb/ui-out.c
+++ b/gdb/ui-out.c
@@ -1,6 +1,6 @@
/* Output generating routines for GDB.
- Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright 1999, 2000, 2001, 2002, 2004 Free Software Foundation, Inc.
Contributed by Cygnus Solutions.
Written by Fernando Nasser for Cygnus.
@@ -269,8 +269,6 @@ static void clear_header_list (struct ui_out *uiout);
static void verify_field (struct ui_out *uiout, int *fldno, int *width,
int *align);
-static void init_ui_out_state (struct ui_out *uiout);
-
/* exported functions (ui_out API) */
/* Mark beginning of a table */
diff --git a/gdb/utils.c b/gdb/utils.c
index ba936d5..556486b 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -1,7 +1,7 @@
/* General utility routines for GDB, the GNU debugger.
Copyright 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
- 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software
+ 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software
Foundation, Inc.
This file is part of GDB.
@@ -61,10 +61,6 @@
#include <readline/readline.h>
-#ifdef USE_MMALLOC
-#include "mmalloc.h"
-#endif
-
#ifdef NEED_DECLARATION_MALLOC
extern PTR malloc (); /* OK: PTR */
#endif
@@ -98,10 +94,6 @@ static void fputs_maybe_filtered (const char *, struct ui_file *, int);
static void do_my_cleanups (struct cleanup **, struct cleanup *);
-#if defined (USE_MMALLOC) && !defined (NO_MMCHECK)
-static void malloc_botch (void);
-#endif
-
static void prompt_for_continue (void);
static void set_screen_size (void);
@@ -628,6 +620,38 @@ do_write (void *data, const char *buffer, long length_buffer)
ui_file_write (data, buffer, length_buffer);
}
+/* Cause a silent error to occur. Any error message is recorded
+ though it is not issued. */
+NORETURN void
+error_silent (const char *string, ...)
+{
+ va_list args;
+ struct ui_file *tmp_stream = mem_fileopen ();
+ va_start (args, string);
+ make_cleanup_ui_file_delete (tmp_stream);
+ vfprintf_unfiltered (tmp_stream, string, args);
+ /* Copy the stream into the GDB_LASTERR buffer. */
+ ui_file_rewind (gdb_lasterr);
+ ui_file_put (tmp_stream, do_write, gdb_lasterr);
+ va_end (args);
+
+ throw_exception (RETURN_ERROR);
+}
+
+/* Output an error message including any pre-print text to gdb_stderr. */
+void
+error_output_message (char *pre_print, char *msg)
+{
+ target_terminal_ours ();
+ wrap_here (""); /* Force out any buffered output */
+ gdb_flush (gdb_stdout);
+ annotate_error_begin ();
+ if (pre_print)
+ fputs_filtered (pre_print, gdb_stderr);
+ fputs_filtered (msg, gdb_stderr);
+ fprintf_filtered (gdb_stderr, "\n");
+}
+
NORETURN void
error_stream (struct ui_file *stream)
{
@@ -961,8 +985,6 @@ request_quit (int signo)
/* Memory management stuff (malloc friends). */
-#if !defined (USE_MMALLOC)
-
static void *
mmalloc (void *md, size_t size)
{
@@ -990,63 +1012,13 @@ mfree (void *md, void *ptr)
free (ptr); /* NOTE: GDB's only call to free() */
}
-#endif /* USE_MMALLOC */
-
-#if !defined (USE_MMALLOC) || defined (NO_MMCHECK)
-
-void
-init_malloc (void *md)
-{
-}
-
-#else /* Have mmalloc and want corruption checking */
-
-static void
-malloc_botch (void)
-{
- fprintf_unfiltered (gdb_stderr, "Memory corruption\n");
- internal_error (__FILE__, __LINE__, "failed internal consistency check");
-}
-
-/* Attempt to install hooks in mmalloc/mrealloc/mfree for the heap specified
- by MD, to detect memory corruption. Note that MD may be NULL to specify
- the default heap that grows via sbrk.
-
- Note that for freshly created regions, we must call mmcheckf prior to any
- mallocs in the region. Otherwise, any region which was allocated prior to
- installing the checking hooks, which is later reallocated or freed, will
- fail the checks! The mmcheck function only allows initial hooks to be
- installed before the first mmalloc. However, anytime after we have called
- mmcheck the first time to install the checking hooks, we can call it again
- to update the function pointer to the memory corruption handler.
-
- Returns zero on failure, non-zero on success. */
-
-#ifndef MMCHECK_FORCE
-#define MMCHECK_FORCE 0
-#endif
-
+/* This used to do something interesting with USE_MMALLOC.
+ * It can be retired any time. -- chastain 2004-01-19. */
void
init_malloc (void *md)
{
- if (!mmcheckf (md, malloc_botch, MMCHECK_FORCE))
- {
- /* Don't use warning(), which relies on current_target being set
- to something other than dummy_target, until after
- initialize_all_files(). */
-
- fprintf_unfiltered
- (gdb_stderr,
- "warning: failed to install memory consistency checks; ");
- fprintf_unfiltered (gdb_stderr,
- "configuration should define NO_MMCHECK or MMCHECK_FORCE\n");
- }
-
- mmtrace ();
}
-#endif /* Have mmalloc and want corruption checking */
-
/* Called when a memory allocation fails, with the number of bytes of
memory requested in SIZE. */
@@ -1610,12 +1582,14 @@ init_page_info (void)
if (!tui_get_command_dimension (&chars_per_line, &lines_per_page))
#endif
{
-#if defined(__GO32__)
- lines_per_page = ScreenRows ();
- chars_per_line = ScreenCols ();
-#else
int rows, cols;
+#if defined(__GO32__)
+ rows = ScreenRows ();
+ cols = ScreenCols ();
+ lines_per_page = rows;
+ chars_per_line = cols;
+#else
/* Make sure Readline has initialized its terminal settings. */
rl_reset_terminal (NULL);
@@ -1641,8 +1615,8 @@ init_page_info (void)
/* If the output is not a terminal, don't paginate it. */
if (!ui_file_isatty (gdb_stdout))
lines_per_page = UINT_MAX;
- }
#endif
+ }
set_screen_size ();
set_width ();
diff --git a/gdb/v850-tdep.c b/gdb/v850-tdep.c
index a9ca9dd..321e97a 100644
--- a/gdb/v850-tdep.c
+++ b/gdb/v850-tdep.c
@@ -1,6 +1,7 @@
/* Target-dependent code for the NEC V850 for GDB, the GNU debugger.
- Copyright 1996, 1998, 1999, 2000, 2001, 2002, 2003
- Free Software Foundation, Inc.
+
+ Copyright 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free
+ Software Foundation, Inc.
This file is part of GDB.
@@ -247,16 +248,6 @@ v850_register_raw_size (int regnum)
return v850_reg_size;
}
-/* Function: v850_register_virtual_size
- Returns the number of bytes occupied by the register as represented
- internally by gdb. */
-
-static int
-v850_register_virtual_size (int regnum)
-{
- return v850_register_raw_size (regnum);
-}
-
/* Function: v850_reg_virtual_type
Returns the default type for register N. */
@@ -1088,13 +1079,6 @@ v850_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
return breakpoint;
}
-static CORE_ADDR
-v850_extract_struct_value_address (char *regbuf)
-{
- return extract_unsigned_integer (regbuf + v850_register_byte (E_V0_REGNUM),
- v850_register_raw_size (E_V0_REGNUM));
-}
-
static void
v850_store_return_value (struct type *type, char *valbuf)
{
@@ -1259,11 +1243,6 @@ v850_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
*/
/* Stack grows up. */
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
- /* PC stops zero byte after a trap instruction
- (which means: exactly on trap instruction). */
- set_gdbarch_decr_pc_after_break (gdbarch, 0);
- /* This value is almost never non-zero... */
- set_gdbarch_function_start_offset (gdbarch, 0);
/* This value is almost never non-zero... */
set_gdbarch_frame_args_skip (gdbarch, 0);
@@ -1277,7 +1256,6 @@ v850_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_deprecated_pop_frame (gdbarch, v850_pop_frame);
set_gdbarch_deprecated_store_struct_return (gdbarch, v850_store_struct_return);
set_gdbarch_deprecated_store_return_value (gdbarch, v850_store_return_value);
- set_gdbarch_deprecated_extract_struct_value_address (gdbarch, v850_extract_struct_value_address);
set_gdbarch_use_struct_convention (gdbarch, v850_use_struct_convention);
set_gdbarch_deprecated_call_dummy_words (gdbarch, call_dummy_nil);
set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, 0);
diff --git a/gdb/valops.c b/gdb/valops.c
index 5f302ca..6042277 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -1,6 +1,6 @@
/* Perform non-arithmetic operations on values, for GDB.
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
- 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+ 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
This file is part of GDB.
@@ -62,19 +62,55 @@ static struct value *search_struct_method (char *, struct value **,
struct value **,
int, int *, struct type *);
-static int check_field_in (struct type *, const char *);
+static int find_oload_champ_namespace (struct type **arg_types, int nargs,
+ const char *func_name,
+ const char *qualified_name,
+ struct symbol ***oload_syms,
+ struct badness_vector **oload_champ_bv);
+
+static
+int find_oload_champ_namespace_loop (struct type **arg_types, int nargs,
+ const char *func_name,
+ const char *qualified_name,
+ int namespace_len,
+ struct symbol ***oload_syms,
+ struct badness_vector **oload_champ_bv,
+ int *oload_champ);
+
+static int find_oload_champ (struct type **arg_types, int nargs, int method,
+ int num_fns,
+ struct fn_field *fns_ptr,
+ struct symbol **oload_syms,
+ struct badness_vector **oload_champ_bv);
+
+static int oload_method_static (int method, struct fn_field *fns_ptr,
+ int index);
+
+enum oload_classification { STANDARD, NON_STANDARD, INCOMPATIBLE };
+
+static enum
+oload_classification classify_oload_match (struct badness_vector
+ * oload_champ_bv,
+ int nargs,
+ int static_offset);
+static int check_field_in (struct type *, const char *);
static struct value *value_struct_elt_for_reference (struct type *domain,
int offset,
struct type *curtype,
char *name,
- struct type *intype);
+ struct type *intype,
+ enum noside noside);
static struct value *value_namespace_elt (const struct type *curtype,
- const char *name,
+ char *name,
enum noside noside);
+static struct value *value_maybe_namespace_elt (const struct type *curtype,
+ char *name,
+ enum noside noside);
+
static CORE_ADDR allocate_space_in_inferior (int);
static struct value *cast_into_complex (struct type *, struct value *);
@@ -1889,19 +1925,10 @@ find_overload_match (struct type **arg_types, int nargs, char *name, int method,
int lax, struct value **objp, struct symbol *fsym,
struct value **valp, struct symbol **symp, int *staticp)
{
- int nparms;
- struct type **parm_types;
- int champ_nparms = 0;
struct value *obj = (objp ? *objp : NULL);
- short oload_champ = -1; /* Index of best overloaded function */
- short oload_ambiguous = 0; /* Current ambiguity state for overload resolution */
- /* 0 => no ambiguity, 1 => two good funcs, 2 => incomparable funcs */
- short oload_ambig_champ = -1; /* 2nd contender for best match */
- short oload_non_standard = 0; /* did we have to use non-standard conversions? */
- short oload_incompatible = 0; /* are args supplied incompatible with any function? */
+ int oload_champ; /* Index of best overloaded function */
- struct badness_vector *bv; /* A measure of how good an overloaded instance is */
struct badness_vector *oload_champ_bv = NULL; /* The measure for the current best match */
struct value *temp = obj;
@@ -1910,13 +1937,13 @@ find_overload_match (struct type **arg_types, int nargs, char *name, int method,
int num_fns = 0; /* Number of overloaded instances being considered */
struct type *basetype = NULL;
int boffset;
- int jj;
int ix;
int static_offset;
- struct cleanup *cleanups = NULL;
+ struct cleanup *old_cleanups = NULL;
- char *obj_type_name = NULL;
+ const char *obj_type_name = NULL;
char *func_name = NULL;
+ enum oload_classification match_quality;
/* Get the list of overloaded methods or functions */
if (method)
@@ -1940,38 +1967,269 @@ find_overload_match (struct type **arg_types, int nargs, char *name, int method,
been resolved by find_method_list via value_find_oload_method_list
above. */
gdb_assert (TYPE_DOMAIN_TYPE (fns_ptr[0].type) != NULL);
+ oload_champ = find_oload_champ (arg_types, nargs, method, num_fns,
+ fns_ptr, oload_syms, &oload_champ_bv);
}
else
{
- int i = -1;
- func_name = cplus_demangle (DEPRECATED_SYMBOL_NAME (fsym), DMGL_NO_OPTS);
+ const char *qualified_name = SYMBOL_CPLUS_DEMANGLED_NAME (fsym);
+ func_name = cp_func_name (qualified_name);
/* If the name is NULL this must be a C-style function.
Just return the same symbol. */
- if (!func_name)
+ if (func_name == NULL)
{
*symp = fsym;
return 0;
}
- oload_syms = make_symbol_overload_list (fsym);
- cleanups = make_cleanup (xfree, oload_syms);
- while (oload_syms[++i])
- num_fns++;
- if (!num_fns)
- error ("Couldn't find function %s", func_name);
+ old_cleanups = make_cleanup (xfree, func_name);
+ make_cleanup (xfree, oload_syms);
+ make_cleanup (xfree, oload_champ_bv);
+
+ oload_champ = find_oload_champ_namespace (arg_types, nargs,
+ func_name,
+ qualified_name,
+ &oload_syms,
+ &oload_champ_bv);
+ }
+
+ /* Check how bad the best match is. */
+
+ match_quality
+ = classify_oload_match (oload_champ_bv, nargs,
+ oload_method_static (method, fns_ptr,
+ oload_champ));
+
+ if (match_quality == INCOMPATIBLE)
+ {
+ if (method)
+ error ("Cannot resolve method %s%s%s to any overloaded instance",
+ obj_type_name,
+ (obj_type_name && *obj_type_name) ? "::" : "",
+ name);
+ else
+ error ("Cannot resolve function %s to any overloaded instance",
+ func_name);
+ }
+ else if (match_quality == NON_STANDARD)
+ {
+ if (method)
+ warning ("Using non-standard conversion to match method %s%s%s to supplied arguments",
+ obj_type_name,
+ (obj_type_name && *obj_type_name) ? "::" : "",
+ name);
+ else
+ warning ("Using non-standard conversion to match function %s to supplied arguments",
+ func_name);
+ }
+
+ if (method)
+ {
+ if (staticp != NULL)
+ *staticp = oload_method_static (method, fns_ptr, oload_champ);
+ if (TYPE_FN_FIELD_VIRTUAL_P (fns_ptr, oload_champ))
+ *valp = value_virtual_fn_field (&temp, fns_ptr, oload_champ, basetype, boffset);
+ else
+ *valp = value_fn_field (&temp, fns_ptr, oload_champ, basetype, boffset);
+ }
+ else
+ {
+ *symp = oload_syms[oload_champ];
+ }
+
+ if (objp)
+ {
+ if (TYPE_CODE (VALUE_TYPE (temp)) != TYPE_CODE_PTR
+ && TYPE_CODE (VALUE_TYPE (*objp)) == TYPE_CODE_PTR)
+ {
+ temp = value_addr (temp);
+ }
+ *objp = temp;
+ }
+ if (old_cleanups != NULL)
+ do_cleanups (old_cleanups);
+
+ switch (match_quality)
+ {
+ case INCOMPATIBLE:
+ return 100;
+ case NON_STANDARD:
+ return 10;
+ default: /* STANDARD */
+ return 0;
}
+}
+
+/* Find the best overload match, searching for FUNC_NAME in namespaces
+ contained in QUALIFIED_NAME until it either finds a good match or
+ runs out of namespaces. It stores the overloaded functions in
+ *OLOAD_SYMS, and the badness vector in *OLOAD_CHAMP_BV. The
+ calling function is responsible for freeing *OLOAD_SYMS and
+ *OLOAD_CHAMP_BV. */
+
+static int
+find_oload_champ_namespace (struct type **arg_types, int nargs,
+ const char *func_name,
+ const char *qualified_name,
+ struct symbol ***oload_syms,
+ struct badness_vector **oload_champ_bv)
+{
+ int oload_champ;
+
+ find_oload_champ_namespace_loop (arg_types, nargs,
+ func_name,
+ qualified_name, 0,
+ oload_syms, oload_champ_bv,
+ &oload_champ);
+
+ return oload_champ;
+}
+
+/* Helper function for find_oload_champ_namespace; NAMESPACE_LEN is
+ how deep we've looked for namespaces, and the champ is stored in
+ OLOAD_CHAMP. The return value is 1 if the champ is a good one, 0
+ if it isn't.
+
+ It is the caller's responsibility to free *OLOAD_SYMS and
+ *OLOAD_CHAMP_BV. */
+
+static int
+find_oload_champ_namespace_loop (struct type **arg_types, int nargs,
+ const char *func_name,
+ const char *qualified_name,
+ int namespace_len,
+ struct symbol ***oload_syms,
+ struct badness_vector **oload_champ_bv,
+ int *oload_champ)
+{
+ int next_namespace_len = namespace_len;
+ int searched_deeper = 0;
+ int num_fns = 0;
+ struct cleanup *old_cleanups;
+ int new_oload_champ;
+ struct symbol **new_oload_syms;
+ struct badness_vector *new_oload_champ_bv;
+ char *new_namespace;
+
+ if (next_namespace_len != 0)
+ {
+ gdb_assert (qualified_name[next_namespace_len] == ':');
+ next_namespace_len += 2;
+ }
+ next_namespace_len
+ += cp_find_first_component (qualified_name + next_namespace_len);
+
+ /* Initialize these to values that can safely be xfree'd. */
+ *oload_syms = NULL;
+ *oload_champ_bv = NULL;
+
+ /* First, see if we have a deeper namespace we can search in. If we
+ get a good match there, use it. */
+
+ if (qualified_name[next_namespace_len] == ':')
+ {
+ searched_deeper = 1;
+
+ if (find_oload_champ_namespace_loop (arg_types, nargs,
+ func_name, qualified_name,
+ next_namespace_len,
+ oload_syms, oload_champ_bv,
+ oload_champ))
+ {
+ return 1;
+ }
+ };
+
+ /* If we reach here, either we're in the deepest namespace or we
+ didn't find a good match in a deeper namespace. But, in the
+ latter case, we still have a bad match in a deeper namespace;
+ note that we might not find any match at all in the current
+ namespace. (There's always a match in the deepest namespace,
+ because this overload mechanism only gets called if there's a
+ function symbol to start off with.) */
+
+ old_cleanups = make_cleanup (xfree, *oload_syms);
+ old_cleanups = make_cleanup (xfree, *oload_champ_bv);
+ new_namespace = alloca (namespace_len + 1);
+ strncpy (new_namespace, qualified_name, namespace_len);
+ new_namespace[namespace_len] = '\0';
+ new_oload_syms = make_symbol_overload_list (func_name,
+ new_namespace);
+ while (new_oload_syms[num_fns])
+ ++num_fns;
+
+ new_oload_champ = find_oload_champ (arg_types, nargs, 0, num_fns,
+ NULL, new_oload_syms,
+ &new_oload_champ_bv);
+
+ /* Case 1: We found a good match. Free earlier matches (if any),
+ and return it. Case 2: We didn't find a good match, but we're
+ not the deepest function. Then go with the bad match that the
+ deeper function found. Case 3: We found a bad match, and we're
+ the deepest function. Then return what we found, even though
+ it's a bad match. */
+
+ if (new_oload_champ != -1
+ && classify_oload_match (new_oload_champ_bv, nargs, 0) == STANDARD)
+ {
+ *oload_syms = new_oload_syms;
+ *oload_champ = new_oload_champ;
+ *oload_champ_bv = new_oload_champ_bv;
+ do_cleanups (old_cleanups);
+ return 1;
+ }
+ else if (searched_deeper)
+ {
+ xfree (new_oload_syms);
+ xfree (new_oload_champ_bv);
+ discard_cleanups (old_cleanups);
+ return 0;
+ }
+ else
+ {
+ gdb_assert (new_oload_champ != -1);
+ *oload_syms = new_oload_syms;
+ *oload_champ = new_oload_champ;
+ *oload_champ_bv = new_oload_champ_bv;
+ discard_cleanups (old_cleanups);
+ return 0;
+ }
+}
+
+/* Look for a function to take NARGS args of types ARG_TYPES. Find
+ the best match from among the overloaded methods or functions
+ (depending on METHOD) given by FNS_PTR or OLOAD_SYMS, respectively.
+ The number of methods/functions in the list is given by NUM_FNS.
+ Return the index of the best match; store an indication of the
+ quality of the match in OLOAD_CHAMP_BV.
+
+ It is the caller's responsibility to free *OLOAD_CHAMP_BV. */
+
+static int
+find_oload_champ (struct type **arg_types, int nargs, int method,
+ int num_fns, struct fn_field *fns_ptr,
+ struct symbol **oload_syms,
+ struct badness_vector **oload_champ_bv)
+{
+ int ix;
+ struct badness_vector *bv; /* A measure of how good an overloaded instance is */
+ int oload_champ = -1; /* Index of best overloaded function */
+ int oload_ambiguous = 0; /* Current ambiguity state for overload resolution */
+ /* 0 => no ambiguity, 1 => two good funcs, 2 => incomparable funcs */
- oload_champ_bv = NULL;
+ *oload_champ_bv = NULL;
/* Consider each candidate in turn */
for (ix = 0; ix < num_fns; ix++)
{
- static_offset = 0;
+ int jj;
+ int static_offset = oload_method_static (method, fns_ptr, ix);
+ int nparms;
+ struct type **parm_types;
+
if (method)
{
- if (TYPE_FN_FIELD_STATIC_P (fns_ptr, ix))
- static_offset = 1;
nparms = TYPE_NFIELDS (TYPE_FN_FIELD_TYPE (fns_ptr, ix));
}
else
@@ -1992,30 +2250,25 @@ find_overload_match (struct type **arg_types, int nargs, char *name, int method,
bv = rank_function (parm_types, nparms, arg_types + static_offset,
nargs - static_offset);
- if (!oload_champ_bv)
+ if (!*oload_champ_bv)
{
- oload_champ_bv = bv;
+ *oload_champ_bv = bv;
oload_champ = 0;
- champ_nparms = nparms;
}
else
/* See whether current candidate is better or worse than previous best */
- switch (compare_badness (bv, oload_champ_bv))
+ switch (compare_badness (bv, *oload_champ_bv))
{
case 0:
oload_ambiguous = 1; /* top two contenders are equally good */
- oload_ambig_champ = ix;
break;
case 1:
oload_ambiguous = 2; /* incomparable top contenders */
- oload_ambig_champ = ix;
break;
case 2:
- oload_champ_bv = bv; /* new champion, record details */
+ *oload_champ_bv = bv; /* new champion, record details */
oload_ambiguous = 0;
oload_champ = ix;
- oload_ambig_champ = -1;
- champ_nparms = nparms;
break;
case 3:
default:
@@ -2032,90 +2285,41 @@ find_overload_match (struct type **arg_types, int nargs, char *name, int method,
fprintf_filtered (gdb_stderr,"...Badness @ %d : %d\n", jj, bv->rank[jj]);
fprintf_filtered (gdb_stderr,"Overload resolution champion is %d, ambiguous? %d\n", oload_champ, oload_ambiguous);
}
- } /* end loop over all candidates */
- /* NOTE: dan/2000-03-10: Seems to be a better idea to just pick one
- if they have the exact same goodness. This is because there is no
- way to differentiate based on return type, which we need to in
- cases like overloads of .begin() <It's both const and non-const> */
-#if 0
- if (oload_ambiguous)
- {
- if (method)
- error ("Cannot resolve overloaded method %s%s%s to unique instance; disambiguate by specifying function signature",
- obj_type_name,
- (obj_type_name && *obj_type_name) ? "::" : "",
- name);
- else
- error ("Cannot resolve overloaded function %s to unique instance; disambiguate by specifying function signature",
- func_name);
}
-#endif
- /* Check how bad the best match is. */
- static_offset = 0;
- if (method && TYPE_FN_FIELD_STATIC_P (fns_ptr, oload_champ))
- static_offset = 1;
- for (ix = 1; ix <= nargs - static_offset; ix++)
- {
- if (oload_champ_bv->rank[ix] >= 100)
- oload_incompatible = 1; /* truly mismatched types */
+ return oload_champ;
+}
- else if (oload_champ_bv->rank[ix] >= 10)
- oload_non_standard = 1; /* non-standard type conversions needed */
- }
- if (oload_incompatible)
- {
- if (method)
- error ("Cannot resolve method %s%s%s to any overloaded instance",
- obj_type_name,
- (obj_type_name && *obj_type_name) ? "::" : "",
- name);
- else
- error ("Cannot resolve function %s to any overloaded instance",
- func_name);
- }
- else if (oload_non_standard)
- {
- if (method)
- warning ("Using non-standard conversion to match method %s%s%s to supplied arguments",
- obj_type_name,
- (obj_type_name && *obj_type_name) ? "::" : "",
- name);
- else
- warning ("Using non-standard conversion to match function %s to supplied arguments",
- func_name);
- }
+/* Return 1 if we're looking at a static method, 0 if we're looking at
+ a non-static method or a function that isn't a method. */
- if (method)
- {
- if (staticp && TYPE_FN_FIELD_STATIC_P (fns_ptr, oload_champ))
- *staticp = 1;
- else if (staticp)
- *staticp = 0;
- if (TYPE_FN_FIELD_VIRTUAL_P (fns_ptr, oload_champ))
- *valp = value_virtual_fn_field (&temp, fns_ptr, oload_champ, basetype, boffset);
- else
- *valp = value_fn_field (&temp, fns_ptr, oload_champ, basetype, boffset);
- }
+static int
+oload_method_static (int method, struct fn_field *fns_ptr, int index)
+{
+ if (method && TYPE_FN_FIELD_STATIC_P (fns_ptr, index))
+ return 1;
else
- {
- *symp = oload_syms[oload_champ];
- xfree (func_name);
- }
+ return 0;
+}
- if (objp)
+/* Check how good an overload match OLOAD_CHAMP_BV represents. */
+
+static enum oload_classification
+classify_oload_match (struct badness_vector *oload_champ_bv,
+ int nargs,
+ int static_offset)
+{
+ int ix;
+
+ for (ix = 1; ix <= nargs - static_offset; ix++)
{
- if (TYPE_CODE (VALUE_TYPE (temp)) != TYPE_CODE_PTR
- && TYPE_CODE (VALUE_TYPE (*objp)) == TYPE_CODE_PTR)
- {
- temp = value_addr (temp);
- }
- *objp = temp;
+ if (oload_champ_bv->rank[ix] >= 100)
+ return INCOMPATIBLE; /* truly mismatched types */
+ else if (oload_champ_bv->rank[ix] >= 10)
+ return NON_STANDARD; /* non-standard type conversions needed */
}
- if (cleanups != NULL)
- do_cleanups (cleanups);
- return oload_incompatible ? 100 : (oload_non_standard ? 10 : 0);
+ return STANDARD; /* Only standard conversions needed. */
}
/* C++: return 1 is NAME is a legitimate name for the destructor
@@ -2234,7 +2438,8 @@ value_aggregate_elt (struct type *curtype,
{
case TYPE_CODE_STRUCT:
case TYPE_CODE_UNION:
- return value_struct_elt_for_reference (curtype, 0, curtype, name, NULL);
+ return value_struct_elt_for_reference (curtype, 0, curtype, name, NULL,
+ noside);
case TYPE_CODE_NAMESPACE:
return value_namespace_elt (curtype, name, noside);
default:
@@ -2250,10 +2455,11 @@ value_aggregate_elt (struct type *curtype,
"pointers to member functions". This function is used
to resolve user expressions of the form "DOMAIN::NAME". */
-struct value *
+static struct value *
value_struct_elt_for_reference (struct type *domain, int offset,
struct type *curtype, char *name,
- struct type *intype)
+ struct type *intype,
+ enum noside noside)
{
struct type *t = curtype;
int i;
@@ -2376,11 +2582,17 @@ value_struct_elt_for_reference (struct type *domain, int offset,
offset + base_offset,
TYPE_BASECLASS (t, i),
name,
- intype);
+ intype,
+ noside);
if (v)
return v;
}
- return 0;
+
+ /* As a last chance, pretend that CURTYPE is a namespace, and look
+ it up that way; this (frequently) works for types nested inside
+ classes. */
+
+ return value_maybe_namespace_elt (curtype, name, noside);
}
/* C++: Return the member NAME of the namespace given by the type
@@ -2388,33 +2600,46 @@ value_struct_elt_for_reference (struct type *domain, int offset,
static struct value *
value_namespace_elt (const struct type *curtype,
- const char *name,
+ char *name,
enum noside noside)
{
+ struct value *retval = value_maybe_namespace_elt (curtype, name,
+ noside);
+
+ if (retval == NULL)
+ error ("No symbol \"%s\" in namespace \"%s\".", name,
+ TYPE_TAG_NAME (curtype));
+
+ return retval;
+}
+
+/* A helper function used by value_namespace_elt and
+ value_struct_elt_for_reference. It looks up NAME inside the
+ context CURTYPE; this works if CURTYPE is a namespace or if CURTYPE
+ is a class and NAME refers to a type in CURTYPE itself (as opposed
+ to, say, some base class of CURTYPE). */
+
+static struct value *
+value_maybe_namespace_elt (const struct type *curtype,
+ char *name,
+ enum noside noside)
+{
const char *namespace_name = TYPE_TAG_NAME (curtype);
struct symbol *sym;
- struct value *retval;
sym = cp_lookup_symbol_namespace (namespace_name, name, NULL,
get_selected_block (0), VAR_DOMAIN,
NULL);
if (sym == NULL)
- retval = NULL;
+ return NULL;
else if ((noside == EVAL_AVOID_SIDE_EFFECTS)
&& (SYMBOL_CLASS (sym) == LOC_TYPEDEF))
- retval = allocate_value (SYMBOL_TYPE (sym));
+ return allocate_value (SYMBOL_TYPE (sym));
else
- retval = value_of_variable (sym, get_selected_block (0));
-
- if (retval == NULL)
- error ("No symbol \"%s\" in namespace \"%s\".", name,
- TYPE_TAG_NAME (curtype));
-
- return retval;
+ return value_of_variable (sym, get_selected_block (0));
}
-
/* Given a pointer value V, find the real (RTTI) type
of the object it points to.
Other parameters FULL, TOP, USING_ENC as with value_rtti_type()
diff --git a/gdb/values.c b/gdb/values.c
index 386e3bf..87baf21 100644
--- a/gdb/values.c
+++ b/gdb/values.c
@@ -1247,9 +1247,9 @@ register_value_being_returned (struct type *valtype, struct regcache *retbuf)
return val;
}
-/* Should we use EXTRACT_STRUCT_VALUE_ADDRESS instead of
- EXTRACT_RETURN_VALUE? GCC_P is true if compiled with gcc
- and TYPE is the type (which is known to be struct, union or array).
+/* Should we use DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS instead of
+ EXTRACT_RETURN_VALUE? GCC_P is true if compiled with gcc and TYPE
+ is the type (which is known to be struct, union or array).
On most machines, the struct convention is used unless we are
using gcc and the type is of a special size. */
diff --git a/gdb/vax-tdep.c b/gdb/vax-tdep.c
index 5c99aa8..169b532 100644
--- a/gdb/vax-tdep.c
+++ b/gdb/vax-tdep.c
@@ -1,6 +1,7 @@
/* Print VAX instructions for GDB, the GNU debugger.
- Copyright 1986, 1989, 1991, 1992, 1995, 1996, 1998, 1999, 2000, 2002, 2003
- Free Software Foundation, Inc.
+
+ Copyright 1986, 1989, 1991, 1992, 1995, 1996, 1998, 1999, 2000,
+ 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of GDB.
@@ -41,8 +42,6 @@ static gdbarch_frame_num_args_ftype vax_frame_num_args;
static gdbarch_deprecated_frame_chain_ftype vax_frame_chain;
static gdbarch_deprecated_extract_return_value_ftype vax_extract_return_value;
-static gdbarch_deprecated_extract_struct_value_address_ftype
- vax_extract_struct_value_address;
static gdbarch_deprecated_push_dummy_frame_ftype vax_push_dummy_frame;
@@ -188,9 +187,6 @@ vax_frame_chain (struct frame_info *frame)
{
/* In the case of the VAX, the frame's nominal address is the FP value,
and 12 bytes later comes the saved previous FP value as a 4-byte word. */
- if (deprecated_inside_entry_file (get_frame_pc (frame)))
- return (0);
-
return (read_memory_integer (get_frame_base (frame) + 12, 4));
}
@@ -275,13 +271,6 @@ vax_store_return_value (struct type *valtype, char *valbuf)
{
deprecated_write_register_bytes (0, valbuf, TYPE_LENGTH (valtype));
}
-
-static CORE_ADDR
-vax_extract_struct_value_address (char *regbuf)
-{
- return (extract_unsigned_integer (regbuf + DEPRECATED_REGISTER_BYTE (0),
- DEPRECATED_REGISTER_RAW_SIZE (0)));
-}
static const unsigned char *
vax_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
@@ -391,7 +380,6 @@ vax_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_deprecated_store_struct_return (gdbarch, vax_store_struct_return);
set_gdbarch_deprecated_extract_return_value (gdbarch, vax_extract_return_value);
set_gdbarch_deprecated_store_return_value (gdbarch, vax_store_return_value);
- set_gdbarch_deprecated_extract_struct_value_address (gdbarch, vax_extract_struct_value_address);
/* Call dummy info */
set_gdbarch_deprecated_push_dummy_frame (gdbarch, vax_push_dummy_frame);
@@ -406,7 +394,6 @@ vax_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
/* Breakpoint info */
set_gdbarch_breakpoint_from_pc (gdbarch, vax_breakpoint_from_pc);
- set_gdbarch_decr_pc_after_break (gdbarch, 0);
/* Misc info */
set_gdbarch_function_start_offset (gdbarch, 2);
diff --git a/gdb/version.in b/gdb/version.in
index 1e51b21..262e48e 100644
--- a/gdb/version.in
+++ b/gdb/version.in
@@ -1 +1 @@
-2004-01-12-cvs
+2004-02-07-cvs
diff --git a/gdb/x86-64-tdep.c b/gdb/x86-64-tdep.c
index fcb29ed..b19372f 100644
--- a/gdb/x86-64-tdep.c
+++ b/gdb/x86-64-tdep.c
@@ -1109,8 +1109,6 @@ x86_64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
set_gdbarch_value_to_register (gdbarch, i387_value_to_register);
set_gdbarch_return_value (gdbarch, amd64_return_value);
- /* Override, since this is handled by amd64_extract_return_value. */
- set_gdbarch_extract_struct_value_address (gdbarch, NULL);
set_gdbarch_skip_prologue (gdbarch, amd64_skip_prologue);
diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c
index 4375d18..0f67a8d 100644
--- a/gdb/xcoffread.c
+++ b/gdb/xcoffread.c
@@ -1,6 +1,6 @@
/* Read AIX xcoff symbol tables and convert to internal format, for GDB.
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
- 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+ 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
Derived from coffread.c, dbxread.c, and a lot of hacking.
Contributed by IBM Corporation.
@@ -988,7 +988,7 @@ read_xcoff_symtab (struct partial_symtab *pst)
if (cs->c_name[E_SYMNMLEN - 1] != '\0')
{
char *p;
- p = obstack_alloc (&objfile->symbol_obstack, E_SYMNMLEN + 1);
+ p = obstack_alloc (&objfile->objfile_obstack, E_SYMNMLEN + 1);
strncpy (p, cs->c_name, E_SYMNMLEN);
p[E_SYMNMLEN] = '\0';
cs->c_name = p;
@@ -1422,12 +1422,12 @@ read_xcoff_symtab (struct partial_symtab *pst)
#define SYMBOL_DUP(SYMBOL1, SYMBOL2) \
(SYMBOL2) = (struct symbol *) \
- obstack_alloc (&objfile->symbol_obstack, sizeof (struct symbol)); \
+ obstack_alloc (&objfile->objfile_obstack, sizeof (struct symbol)); \
*(SYMBOL2) = *(SYMBOL1);
#define SYMNAME_ALLOC(NAME, ALLOCED) \
- (ALLOCED) ? (NAME) : obsavestring ((NAME), strlen (NAME), &objfile->symbol_obstack);
+ (ALLOCED) ? (NAME) : obsavestring ((NAME), strlen (NAME), &objfile->objfile_obstack);
static struct type *func_symbol_type;
@@ -1894,10 +1894,10 @@ init_stringtab (bfd *abfd, file_ptr offset, struct objfile *objfile)
if (val != sizeof lengthbuf || length < sizeof lengthbuf)
return;
- /* Allocate string table from symbol_obstack. We will need this table
+ /* Allocate string table from objfile_obstack. We will need this table
as long as we have its symbol table around. */
- strtbl = (char *) obstack_alloc (&objfile->symbol_obstack, length);
+ strtbl = (char *) obstack_alloc (&objfile->objfile_obstack, length);
((struct coff_symfile_info *) objfile->sym_private)->strtbl = strtbl;
/* Copy length buffer, the first byte is usually zero and is
@@ -1946,7 +1946,7 @@ xcoff_start_psymtab (struct objfile *objfile, char *filename, int first_symnum,
global_syms, static_syms);
result->read_symtab_private = (char *)
- obstack_alloc (&objfile->psymbol_obstack, sizeof (struct symloc));
+ obstack_alloc (&objfile->objfile_obstack, sizeof (struct symloc));
((struct symloc *) result->read_symtab_private)->first_symnum = first_symnum;
result->read_symtab = xcoff_psymtab_to_symtab;
@@ -1993,7 +1993,7 @@ xcoff_end_psymtab (struct partial_symtab *pst, char **include_list,
if (number_dependencies)
{
pst->dependencies = (struct partial_symtab **)
- obstack_alloc (&objfile->psymbol_obstack,
+ obstack_alloc (&objfile->objfile_obstack,
number_dependencies * sizeof (struct partial_symtab *));
memcpy (pst->dependencies, dependency_list,
number_dependencies * sizeof (struct partial_symtab *));
@@ -2008,7 +2008,7 @@ xcoff_end_psymtab (struct partial_symtab *pst, char **include_list,
subpst->section_offsets = pst->section_offsets;
subpst->read_symtab_private =
- (char *) obstack_alloc (&objfile->psymbol_obstack,
+ (char *) obstack_alloc (&objfile->objfile_obstack,
sizeof (struct symloc));
((struct symloc *) subpst->read_symtab_private)->first_symnum = 0;
((struct symloc *) subpst->read_symtab_private)->numsyms = 0;
@@ -2018,7 +2018,7 @@ xcoff_end_psymtab (struct partial_symtab *pst, char **include_list,
/* We could save slight bits of space by only making one of these,
shared by the entire set of include files. FIXME-someday. */
subpst->dependencies = (struct partial_symtab **)
- obstack_alloc (&objfile->psymbol_obstack,
+ obstack_alloc (&objfile->objfile_obstack,
sizeof (struct partial_symtab *));
subpst->dependencies[0] = pst;
subpst->number_of_dependencies = 1;
@@ -2081,7 +2081,7 @@ swap_sym (struct internal_syment *symbol, union internal_auxent *aux,
/* FIXME: wastes memory for symbols which we don't end up putting
into the minimal symbols. */
char *p;
- p = obstack_alloc (&objfile->psymbol_obstack, E_SYMNMLEN + 1);
+ p = obstack_alloc (&objfile->objfile_obstack, E_SYMNMLEN + 1);
strncpy (p, symbol->n_name, E_SYMNMLEN);
p[E_SYMNMLEN] = '\0';
*name = p;
@@ -2890,7 +2890,7 @@ xcoff_initial_scan (struct objfile *objfile, int mainline)
if (length)
{
debugsec =
- (char *) obstack_alloc (&objfile->symbol_obstack, length);
+ (char *) obstack_alloc (&objfile->objfile_obstack, length);
if (!bfd_get_section_contents (abfd, secp, debugsec,
(file_ptr) 0, length))
@@ -2913,7 +2913,7 @@ xcoff_initial_scan (struct objfile *objfile, int mainline)
name, bfd_errmsg (bfd_get_error ()));
size = coff_data (abfd)->local_symesz * num_symbols;
((struct coff_symfile_info *) objfile->sym_private)->symtbl =
- obstack_alloc (&objfile->symbol_obstack, size);
+ obstack_alloc (&objfile->objfile_obstack, size);
((struct coff_symfile_info *) objfile->sym_private)->symtbl_num_syms =
num_symbols;
@@ -2959,7 +2959,7 @@ xcoff_symfile_offsets (struct objfile *objfile, struct section_addr_info *addrs)
objfile->num_sections = bfd_count_sections (objfile->obfd);
objfile->section_offsets = (struct section_offsets *)
- obstack_alloc (&objfile->psymbol_obstack,
+ obstack_alloc (&objfile->objfile_obstack,
SIZEOF_N_SECTION_OFFSETS (objfile->num_sections));
/* Initialize the section indexes for future use. */
diff --git a/gdb/xstormy16-tdep.c b/gdb/xstormy16-tdep.c
index e4bebc8..48ac1a2 100644
--- a/gdb/xstormy16-tdep.c
+++ b/gdb/xstormy16-tdep.c
@@ -1,6 +1,6 @@
/* Target-dependent code for the Sanyo Xstormy16a (LC590000) processor.
- Copyright 2001, 2002, 2003 Free Software Foundation, Inc.
+ Copyright 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of GDB.
@@ -151,16 +151,6 @@ xstormy16_register_raw_size (int regnum)
return xstormy16_reg_size;
}
-/* Function: xstormy16_register_virtual_size
- Returns the number of bytes occupied by the register as represented
- internally by gdb. */
-
-static int
-xstormy16_register_virtual_size (int regnum)
-{
- return xstormy16_register_raw_size (regnum);
-}
-
/* Function: xstormy16_reg_virtual_type
Returns the default type for register N. */
@@ -409,10 +399,14 @@ xstormy16_store_return_value (struct type *type, char *valbuf)
*/
static CORE_ADDR
-xstormy16_extract_struct_value_address (char *regbuf)
+xstormy16_extract_struct_value_address (struct regcache *regcache)
{
- return extract_unsigned_integer (regbuf + xstormy16_register_byte (E_PTR_RET_REGNUM),
- xstormy16_reg_size);
+ /* FIXME: cagney/2004-01-17: Does the ABI guarantee that the return
+ address regster is preserved across function calls? Probably
+ not, making this function wrong. */
+ ULONGEST val;
+ regcache_raw_read_unsigned (regcache, E_PTR_RET_REGNUM, &val);
+ return val;
}
/* Function: xstormy16_use_struct_convention
@@ -1069,11 +1063,6 @@ xstormy16_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
*/
/* Stack grows up. */
set_gdbarch_inner_than (gdbarch, core_addr_greaterthan);
- /* PC stops zero byte after a trap instruction
- (which means: exactly on trap instruction). */
- set_gdbarch_decr_pc_after_break (gdbarch, 0);
- /* This value is almost never non-zero... */
- set_gdbarch_function_start_offset (gdbarch, 0);
/* This value is almost never non-zero... */
set_gdbarch_frame_args_skip (gdbarch, 0);
diff --git a/gettext.m4 b/gettext.m4
index 82a5277..6735696 100644
--- a/gettext.m4
+++ b/gettext.m4
@@ -11,7 +11,7 @@
# serial 3
-AC_DEFUN(CY_WITH_NLS,
+AC_DEFUN([CY_WITH_NLS],
[AC_MSG_CHECKING([whether NLS is requested])
dnl Default is enabled NLS
AC_ARG_ENABLE(nls,
@@ -158,7 +158,7 @@ AC_DEFUN(CY_WITH_NLS,
AC_SUBST(POSUB)
])
-AC_DEFUN(CY_GNU_GETTEXT,
+AC_DEFUN([CY_GNU_GETTEXT],
[AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_PROG_RANLIB])dnl
@@ -286,7 +286,7 @@ __argz_count __argz_stringify __argz_next])
dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
-AC_DEFUN(AM_PATH_PROG_WITH_TEST,
+AC_DEFUN([AM_PATH_PROG_WITH_TEST],
[# Extract the first word of "$2", so it can be a program name with args.
set dummy $2; ac_word=[$]2
AC_MSG_CHECKING([for $ac_word])
@@ -332,7 +332,7 @@ AC_SUBST($1)dnl
# serial 1
-AC_DEFUN(AM_LC_MESSAGES,
+AC_DEFUN([AM_LC_MESSAGES],
[if test $ac_cv_header_locale_h = yes; then
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
diff --git a/include/ChangeLog b/include/ChangeLog
index ee8677e..e2fa68f 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,5 +1,10 @@
2004-01-12 Ian Lance Taylor <ian@wasabisystems.com>
+ * demangle.h: Instead of checking ANSI_PROTOTYPES, just include
+ "libiberty.h".
+
+ * demangle.h: If ANSI_PROTOTYPES is defined, include <stddef.h>.
+
* demangle.h (enum demangle_component_type): Define.
(struct demangle_operator_info): Declare.
(struct demangle_builtin_type_info): Declare.
@@ -523,8 +528,8 @@ Tue May 30 16:53:34 2000 Andrew Cagney <cagney@b1.cygnus.com>
2000-05-06 Zack Weinberg <zack@wolery.cumb.org>
- * ansidecl.h: #define __extension__ to nothing if
- GCC_VERSION < 2008.
+ * ansidecl.h: #define __extension__ to nothing if
+ GCC_VERSION < 2008.
2000-05-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
@@ -607,8 +612,1534 @@ Sat Jan 1 19:06:52 2000 Hans-Peter Nilsson <hp@bitrange.com>
* symcat.h (STRINGX) [!__STDC__ || ALMOST_STDC]: Change "?" to "s"
to stringify argument s.
+1999-12-05 Mark Mitchell <mark@codesourcery.com>
+
+ * splay-tree.h (struct splay_tree_node): Rename to ...
+ (struct splay_tree_node_s): ... this.
+ (struct splay_tree): Rename to ...
+ (struct splay_tree_s): ... this.
+
+1999-11-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * ansidecl.h (ATTRIBUTE_MALLOC): New macro.
+
+ * libiberty.h (buildargv, dupargv, concat, choose_temp_base,
+ make_temp_file, xmalloc, xcalloc, xstrdup, xmemdup): Add
+ ATTRIBUTE_MALLOC.
+ (xatexit): Remove __GNUC__ check, add ATTRIBUTE_NORETURN.
+
+1999-11-28 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * libiberty.h: Include stdarg.h when ANSI_PROTOTYPES is defined.
+ (asprintf, vasprintf): Provide declarations.
+
+Wed Nov 10 12:43:21 1999 Philippe De Muyter <phdm@macqel.be>
+ Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * ansidecl.h: Define and test `GCC_VERSION', not `HAVE_GCC_VERSION'.
+
+1999-10-23 08:51 -0700 Zack Weinberg <zack@bitmover.com>
+
+ * hashtab.h: Give hash_table_t a struct tag. Add prototypes
+ for clear_hash_table_slot and traverse_hash_table. Correct
+ prototype of all_hash_table_collisions.
+
+Fri Oct 15 01:47:51 1999 Vladimir Makarov <vmakarov@loony.cygnus.com>
+
+ * hashtab.h: New file.
+
+1999-10-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * ansidecl.h (HAVE_GCC_VERSION): New macro. Use it instead of
+ explicitly testing __GNUC__ and __GNUC_MINOR__.
+
+ (ATTRIBUTE_PRINTF): Use `__format__', not `format'.
+
+1999-09-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * libiberty.h (make_temp_file): Add a prototype.
+
+Tue Sep 14 00:35:02 1999 Marc Espie <espie@cvs.openbsd.org>
+
+ * libiberty.h (basename): OpenBSD has a correct prototype.
+ (xrealloc): Remove outdated comment.
+
+1999-09-07 Jeff Garzik <jgarzik@pobox.com>
+
+ * libiberty.h (xmemdup): Add prototype for new function.
+
+1999-09-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * obstack.h (obstack_grow, obstack_grow0): Move (char*) casts
+ in calls to `_obstack_memcpy' from here ...
+
+ (_obstack_memcpy): ... to here, except in the __STDC__ case which
+ doesn't need it.
+
+1999-08-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * libiberty.h (getpwd): Prototype.
+
+1999-08-01 Mark Mitchell <mark@codesourcery.com>
+
+ * splay-tree.h (splay_tree_insert): Return the new node.
+
+1999-07-11 Ian Lance Taylor <ian@zembu.com>
+
+ * ansidecl.h: Copy attribute support macros from egcs.
+
+1999-04-02 Mark Mitchell <mark@codesourcery.com>
+
+ * splay-tree.h (splay_tree_compare_pointers): Declare.
+
+1999-03-30 Mark Mitchell <mark@codesourcery.com>
+
+ * splay-tree.h (splay_tree_compare_ints): Declare.
+
+Wed Mar 24 12:46:29 1999 Andrew Cagney <cagney@amy.cygnus.com>
+
+ * libiberty.h (basename): Cygwin{,32} should have the prototype.
+
+Mon Dec 14 09:53:31 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * demangle.h: Don't check IN_GCC anymore.
+ * splay-tree.h: Likewise.
+
+Tue Dec 8 00:30:31 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * demangle.h: (DMGL_EDG): new macro for Kuck and Associates
+ (DMGL_STYLE_MASK): modify to include Kuck and Assoc style
+ (demangling_styles): add new edg_demangling style
+ (EDG_DEMANGLING_STYLE_STRING): new macro
+ (EDG_DEMANGLING): new macro
+ (DMGL_HP): new macro, for HP/aCC compiler.
+ (DMGL_STYLE_MASK): modify to include new HP's style.
+ (demangling_styles): add new hp_demangling value.
+ (HP_DEMANGLING_STYLE_STRING): new macro.
+ (ARM_DEMANGLING): coerce to int.
+ (HP_DEMANGLING): new macro.
+
+Fri Nov 20 13:14:00 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * libiberty.h (basename): Add prototype for FreeBSD.
+
+Fri Nov 13 19:19:11 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * libiberty.h: Prototype xcalloc.
+
+Sun Nov 8 17:42:25 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * ansidecl.h: Wrap problematic macros with !IN_GCC.
+
+ * demangle.h: Never define PARAMS().
+ * splay-tree.h: Likewise.
+
+Sat Nov 7 16:04:03 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * demangle.h: Don't include gansidecl.h.
+ * splay-tree.h: Likewise.
+
+Thu Oct 22 19:58:00 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * splay-tree.h: Wrap function pointer parameter declarations in
+ PARAMS() macro.
+
+1998-10-21 Mark Mitchell <mark@markmitchell.com>
+
+ * splay-tree.h: New file.
+
+Fri Oct 9 00:02:03 1998 Jeffrey A Law (law@cygnus.com)
+
+ * Merge devo and egcs include directories.
+
+Sat Sep 5 12:16:33 1998 Jeffrey A Law (law@cygnus.com)
+
+ * getopt.h, obstack.h: Updated from gcc.
+
+1998-08-03 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * libiberty.h (xexit): Change decl to use modern GCC attribute
+ to indicate exit does not return.
+
+Mon Jun 1 13:48:32 1998 Jason Molenda (crash@bugshack.cygnus.com)
+
+ * obstack.h: Update to latest FSF version.
+
+Tue Feb 24 13:05:02 1998 Doug Evans <devans@canuck.cygnus.com>
+
+ * dis-asm.h (disassemble_info): Member `symbol' renamed to `symbols'
+ and made an "asymbol **". New member num_symbols.
+ (INIT_DISASSEMBLE_INFO_NO_ARCH): Update.
+
+Tue Feb 17 12:32:18 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote-sim.h (sim_fetch_register, sim_store_register): Add
+ register length parameter. Functions return actual length of
+ register.
+
+Thu Feb 12 16:29:01 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * getopt.h: Update to latest FSF version.
+
+Wed Feb 11 16:56:06 1998 Doug Evans <devans@canuck.cygnus.com>
+
+ * symcat.h: New file.
+
+Mon Feb 2 17:13:31 1998 Steve Haworth <steve@pm.cse.rmit.EDU.AU>
+
+ * dis-asm.h (print_insn_tic30): Declare.
+
+Thu Jan 22 16:23:59 1998 Fred Fish <fnf@cygnus.com>
+
+ * dis-asm.h: Add flag INSN_HAS_RELOC to tell disassembly
+ function there is a reloc on this line.
+
+Mon Dec 8 11:22:23 1997 Nick Clifton <nickc@cygnus.com>
+
+ * dis-asm.h: Remove prototype of disasm_symaddr() as this function
+ no longer exists.
+
+Tue Dec 2 10:20:53 1997 Nick Clifton <nickc@cygnus.com>
+
+ * dis-asm.h (disasm_symaddr): New prototype.
+
+Mon Dec 1 20:24:18 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
+
+ * coff/sh.h (R_SH_SWITCH8): New.
+
+Mon Dec 1 11:29:35 1997 Doug Evans <devans@canuck.cygnus.com>
+
+ * callback.h (CB_SYSCALL): Comment out arg names in prototypes.
+
+Wed Nov 26 16:47:58 1997 Michael Meissner <meissner@cygnus.com>
+
+ * callback.h (CB_SYSCALL): Consistantly use names for prototype
+ arguments.
+
+Wed Nov 26 11:39:30 1997 Doug Evans <devans@canuck.cygnus.com>
+
+ * callback.h (CB_SYSCALL): Change byte count arguments to
+ {read,write}_mem to `int'. New member `magic'.
+ (CB_SYSCALL_MAGIC,CB_SYSCALL_INIT): New macros.
+
+Tue Nov 25 01:35:52 1997 Doug Evans <devans@seba.cygnus.com>
+
+ * callback.h (struct stat): Move forward decl up.
+ (host_callback): Pass stat struct pointer to stat,fstat.
+ (CB_SYS_nnn): Reorganize.
+ (CB_SYSCALL): New members p1,p2.
+ (cb_host_to_target_stat): Delete fourth arg.
+
+Sat Nov 22 23:34:15 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote-sim.h (sim_stop_reason): Clarify sim_signalled SIGRC
+ argument.
+
+Mon Nov 17 14:00:51 1997 Doug Evans <devans@seba.cygnus.com>
+
+ * callback.h (CB_TARGET_DEFS_MAP): Renamed from target_defs_map.
+ (host_callback): Add stat, fstat, syscall_map, errno_map, open_map,
+ signal_map, stat_map.
+ (errn_map,open_map): Renamed to cb_init_foo_map.
+ (cb_host_to_target_errno,cb_target_to_host_open): Renamed from
+ host_to_target_errno,target_to_host_open.
+ (cb_read_target_syscall_maps): Add prototype.
+ (cb_target_to_host_syscall): Likewise.
+ (cb_host_to_target_stat): Likewise.
+ (cb_syscall): Likewise.
+ (CB_SYS_{exit,open,close,read,write,lseek,unlink,getpid,kill,fstat,
+ argvlen,argv,chdir,stat,chmod,utime,time}): Define.
+ (CB_SYSCALL): New type.
+ (CB_RC): New enum.
+
+Fri Nov 7 10:34:09 1997 Rob Savoye <rob@darkstar.cygnus.com>
+
+ * libiberty.h: Add extern "C" { so it can be used with C++
+ programs.
+ * remote-sim.h: Add extern "C" { so it can be used with C++
+ programs.
+
+Tue Oct 14 16:07:51 1997 Nick Clifton <nickc@cygnus.com>
+
+ * dis-asm.h (struct disassemble_info): New field
+ 'symbol_at_address_func'.
+ (INIT_DISASSEMBLE_INFO_NO_ARCH): Initialise new field with
+ generic_symbol_at_address.
+
+Mon Oct 13 10:17:15 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote-sim.h: Clarify sim_read, sim_write MEM argument.
+
+Wed Sep 24 18:03:10 1997 Stu Grossman <grossman@babylon-5.cygnus.com>
+
+ * remote-sim.h (SIM_RC): Add a bunch of new return codes for
+ breakpoint stuff.
+ * Add functions to tell the simulator to set/clear/enable/disable
+ intrinsic breakpoints.
+
+Thu Aug 28 19:41:42 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * libiberty.h (dupargv): Add prototype.
+
+Tue Aug 26 12:25:49 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote-sim.h (sim_create_inferior): Add ABFD arg. Document.
+
+Mon Aug 25 10:50:51 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote-sim.h (sim_open): Add ABFD arg. Document.
+
+Fri Aug 8 16:43:56 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * dis-asm.h (arc_get_disassembler): Declare.
+
+Wed Jul 30 11:39:50 1997 Per Bothner <bothner@deneb.cygnus.com>
+
+ * demangle.h (DMGL_JAVA): New option to request Java demangling.
+
+Tue Jul 22 17:59:54 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * libiberty.h (PEXECUTE_*): Define.
+ (pexecute, pwait): Declare.
+
+Fri Jun 6 13:02:33 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote-sim.h (sim_kill): Mark as depreciated.
+
+Fri May 23 13:43:41 1997 Fred Fish <fnf@cygnus.com>
+
+ * bfdlink.h (struct bfd_link_info): Add task_link member.
+
+Thu May 22 11:32:49 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote-sim.h: Review documentation. Clarify restrictions on
+ when functions can be called.
+
+Wed May 21 16:47:53 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote-sim.h (sim_set_profile_size): Add prototype, document as
+ depreciated.
+
+Tue May 20 09:32:22 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote-sim.h (sim_open): Add callback struct.
+ (sim_set_callbacks): Drop SIM_DESC argument. Document.
+ (sim_size): Remove recently added SIM_DESC argument. Document.
+
+Mon May 19 19:14:44 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote-sim.h: Pass SD into sim_size.
+
+Thu May 15 01:24:16 1997 Mark Alexander <marka@cygnus.com>
+
+ * obstack.h (obstack_specify_allocation_with_arg, obstack_chunkfun,
+ obstack_freefun): Eliminate compile warnings in gdb.
+
+Tue May 13 10:21:14 1997 Nick Clifton <nickc@cygnus.com>
+
+ * coff/arm.h (constants): Added new flag bits F_APCS_26 and
+ F_APCS_SET for the f_flags field of the filehdr structure. Added new
+ flags: F_APCS26, F_ARM_2, F_ARM_3, F_ARM_7, F_ARM_7T to store
+ information in the flags field of the internal_f structure used by BFD
+ routines.
+
+Tue Apr 22 10:24:34 1997 Fred Fish <fnf@cygnus.com>
+
+ * floatformat.h (floatformat_byteorders): Add comments for previous
+ formats and add floatformat_littlebyte_bigword, primarily for ARM.
+ Add declaration for floatformat_ieee_double_littlebyte_bigword.
+
+Fri Apr 18 13:04:49 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote-sim.h (sim_stop): New interface - asynchronous
+ notification of a request to stop / suspend the running
+ simulation.
+
+ * remote-sim.h (enum sim_stop): Add sim_running and sim_polling as
+ states for use internal to simulators.
+
+ * callback.h (struct host_callback_strut): Put a magic number at
+ the end of the struct to allow basic checking.
+ (struct host_callback_struct ): Add poll_quit - so
+ that the console etc can be polled at regular intervals.
+
+Thu Apr 17 02:17:12 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * remote-sim.h (struct _bfd): Declare.
+ (sim_load): Return SIM_RC. New arg `abfd'.
+ (sim_create_inferior): Return SIM_RC. Delete arg `start_address'.
+
+Wed Apr 2 17:09:12 1997 Andrew Cagney <cagney@kremvax.cygnus.com>
+
+ * remote-sim.h (sim_trace, sim_size): Make these global. They
+ will go away shortly.
+
+Wed Apr 2 15:23:49 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * remote-sim.h (SIM_OPEN_KIND, SIM_RC): New enums.
+ (sim_open): New argument `kind'.
+
+Wed Apr 2 14:45:51 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * COPYING: Update FSF address.
+
+Fri Mar 28 15:29:54 1997 Mike Meissner <meissner@cygnus.com>
+
+ * callback.h (top level): Include stdarg.h or varargs.h if
+ va_start is not defined.
+ (host_callback_struct): Make {,e}vprintf_filtered take a va_list
+ instead of void *, since va_list might be an array or structure
+ type.
+
+Fri Mar 28 15:44:41 1997 H.J. Lu <hjl@gnu.ai.mit.edu>
+
+ * libiberty.h (basename): Add prototype for glibc and linux.
+
+Mon Mar 17 19:22:12 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * objalloc.h: New file.
+
+Mon Mar 17 14:57:55 1997 Andrew Cagney <cagney@kremvax.cygnus.com>
+
+ * remote-sim.h: New file, copied in from gdb/remote-sim.h. One
+ day this will be placed in a directory of its own.
+
+Sat Mar 15 19:00:14 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * obstack.h: Update to current FSF version.
+
+Thu Mar 6 15:46:59 1997 Andrew Cagney <cagney@kremvax.cygnus.com>
+
+ * callback.h (struct host_callback_struct): Add callbacks -
+ flush_stdout, write_stderr, flush_stderr, vprintf_filtered,
+ evprintf_filtered. Delete redundant callbacks - printf_filtered.
+
+Thu Feb 27 23:18:27 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * bfdlink.h (struct bfd_link_info): Remove lprefix and lprefix_len
+ fields.
+
+Tue Feb 25 00:10:49 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * dis-asm.h (INIT_DISASSEMBLE_INFO_NO_ARCH): Initialize
+ bytes_per_chunk and display_endian.
+
+Mon Feb 24 17:47:02 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ From Eric Youngdale <eric@andante.jic.com>:
+ * bfdlink.h (struct bfd_elf_version_expr): Define.
+ (struct bfd_elf_version_deps): Define.
+ (struct bfd_elf_version_tree): Define.
+
+Thu Feb 6 14:20:01 1997 Martin M. Hunt <hunt@pizza.cygnus.com>
+
+ * dis-asm.h: (disassemble_info): Add new fields
+ bytes_per_chunk and display_endian to control the
+ display of raw instructions.
+
+Sun Dec 8 17:11:12 1996 Doug Evans <dje@canuck.cygnus.com>
+
+ * callback.h (host_callback): New member `error'.
+
+Wed Nov 20 00:40:23 1996 Doug Evans <dje@canuck.cygnus.com>
+
+ * callback.h: New file, moved here from gdb.
+
+Mon Nov 18 16:34:00 1996 Dawn Perchik <dawn@critters.cygnus.com>
+
+ * libiberty.h: Checkin again; last checkin failed due to sticky tag.
+
+Wed Nov 13 08:22:00 1996 Dawn Perchik <dawn@critters.cygnus.com>
+
+ * libiberty.h: Revert last commit due to conflicts with hpux
+ system headers.
+
+Tue Nov 12 16:31:00 1996 Dawn Perchik <dawn@critters.cygnus.com>
+
+ * libiberty.h: Move prototypes from argv.c here.
+
+Thu Oct 31 14:56:18 1996 Doug Evans <dje@canuck.cygnus.com>
+
+ * ansidecl.h (VPARAMS,VA_START): Define.
+
+Fri Oct 25 12:08:04 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * dis-asm.h (disassemble_info): Add bytes_per_line field.
+ (INIT_DISASSEMBLE_INFO_NO_ARCH): Initialize bytes_per_line field.
+
+Thu Oct 24 17:10:01 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * dis-asm.h (disassemble_info): Add symbol field.
+ (INIT_DISASSEMBLE_INFO_NO_ARCH): Initialize symbol field.
+
+Thu Oct 17 11:17:40 1996 Doug Evans <dje@canuck.cygnus.com>
+
+ * dis-asm.h (print_insn_m32r): Declare.
+
+Mon Oct 14 23:56:52 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * libiberty.h: Declare parameter types for xmalloc and xrealloc.
+
+Thu Oct 3 13:45:27 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * fnmatch.h: New file.
+
+Thu Oct 3 10:33:14 1996 Jeffrey A Law (law@cygnus.com)
+
+ * dis-asm.h (print_insn_mn10x00): Delete declaration.
+ (print_insn_mn10200, print_insn_mn10300): Declare.
+
+Wed Oct 2 21:24:43 1996 Jeffrey A Law (law@cygnus.com)
+
+ * dis-asm.h (print_insn_mn10x00): Declare.
+
+Mon Sep 30 13:56:11 1996 Fred Fish <fnf@cygnus.com>
+
+ * libiberty.h: Remove #ifndef PRIVATE_XMALLOC.
+
+Sat Aug 31 13:27:06 1996 Jeffrey A Law (law@cygnus.com)
+
+ * dis-asm.h (print_insn_v850): Declare.
+
+Tue Aug 13 16:10:30 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * obstack.h: Change bcopy to memcpy. Works better on Posix
+ systems, which generally lack bcopy.
+
+Mon Aug 12 17:03:18 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * ansidecl.h: Change WIN32 to _WIN32.
+
+Fri Jul 26 13:58:18 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * dis-asm.h: Add flavour field.
+ (print_insn_alpha): Declare.
+ (print_insn_alpha_osf, print_insn_alpha_vms): Don't declare.
+ (INIT_DISASSEMBLE_INFO): Initialize flavour field.
+
+Tue Jul 23 17:37:58 1996 Fred Fish <fnf@cygnus.com>
+
+ * libiberty.h (PRIVATE_XMALLOC): Enclose xmalloc/xrealloc
+ definitions inside #ifndef so that programs that want to
+ can define PRIVATE_XMALLOC and then define xmalloc and
+ xrealloc anyway they want.
+ (basename): Document in source that we can't declare the
+ parameter type because it is declared inconsistently across
+ different systems.
+
+Mon Jul 22 13:16:13 1996 Richard Henderson <rth@tamu.edu>
+
+ * dis-asm.h (print_insn_alpha): Don't declare.
+ (print_insn_alpha_osf, print_insn_alpha_vms): Declare.
+
+Wed Jul 17 14:45:12 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
+
+ * dis-asm.h: (print_insn_d10v): Declare.
+
+Mon Jul 15 16:55:38 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * dis-asm.h: Get rid of decls for print_insn_i8086,
+ print_insn_sparc64 and print_insn_sparclite.
+ * (INIT_DISASSEMBLE_INFO): Split into two pieces. One,
+ INIT_DISASSEMBLE_INFO_NO_ARCH inits everything except for endian,
+ mach, and arch.
+
+Fri Jul 12 10:19:27 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * dis-asm.h (print_insn_i8086): Declare.
+
+Wed Jul 3 16:02:39 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * dis-asm.h (print_insn_sparclite): Declare.
+
+Tue Jun 18 16:02:46 1996 Jeffrey A. Law <law@rtl.cygnus.com>
+
+ * dis-asm.h (print_insn_h8300s): Declare.
+
+Tue Jun 18 15:11:33 1996 Klaus Kaempf <kkaempf@progis.de>
+
+ * fopen-vms.h: New file.
+
+Tue Jun 4 18:58:16 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * bfdlink.h (struct bfd_link_info): Add notice_all field.
+
+Fri Apr 26 10:33:12 1996 Doug Evans <dje@canuck.cygnus.com>
+
+ * demangle.h (#ifdef IN_GCC): #include "gansidecl.h".
+ (PROTO,PTR,const): Delete.
+
+Mon Apr 22 17:27:42 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * bfdlink.h (struct bfd_link_info): Add traditional_format field.
+
+Mon Apr 15 15:16:56 1996 Doug Evans <dje@canuck.cygnus.com>
+
+ * libiberty.h (choose_temp_base): Add prototype.
+
+Tue Mar 12 17:29:46 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * bfdlink.h (bfd_wrapped_link_hash_lookup): Declare.
+ (struct bfd_link_info): Add wrap_hash field.
+
+Wed Feb 14 16:49:17 1996 Martin Anantharaman <martin@mail.imech.uni-duisburg.de>
+
+ * ieee.h (ieee_record_enum_type): Define
+ ieee_external_reference_info_enum.
+
+Fri Feb 2 17:09:25 1996 Doug Evans <dje@charmed.cygnus.com>
+
+ * dis-asm.h (DISASM_RAW_INSN): Delete.
+
+Tue Jan 23 09:21:47 1996 Doug Evans <dje@charmed.cygnus.com>
+
+ * dis-asm.h (INIT_DISASSEMBLE_INFO): Set endian to BFD_ENDIAN_UNKNOWN.
+ New argument FPRINTF_FUNC.
+
+Mon Jan 22 16:37:59 1996 Doug Evans <dje@charmed.cygnus.com>
+
+ * dis-asm.h (disassemble_info): New members arch, mach, endian.
+ (INIT_DISASSEMBLE_INFO): Initialize them.
+ (DISASM_RAW_INSN{,FLAG}): Define.
+
+Thu Jan 18 11:32:38 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * demangle.h (cplus_demangle_opname): Change opname parameter to
+ const char *.
+ (cplus_mangle_opname): Change return type and opname parameter to
+ const char *.
+
+Fri Jan 5 00:01:22 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * ieee.h (enum ieee_record): Add ieee_asn_record_enum,
+ ieee_at_record_enum, ieee_ty_record_enum, ieee_atn_record_enum,
+ ieee_bb_record_enum, and ieee_be_record_enum.
+
+Wed Jan 3 13:12:09 1996 Fred Fish <fnf@cygnus.com>
+
+ * obstack.h: Update copyright to 1996.
+ (_obstack_memory_used): Declare.
+ (obstack_memory_used): Define macro.
+
+Thu Dec 28 11:42:12 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * libiberty.h (xstrdup): Declare.
+
+Thu Dec 21 14:47:17 1995 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * wait.h: Protect all macros with #ifndef.
+
+Tue Oct 24 21:45:40 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * bfdlink.h (struct bfd_link_info): Add static_link field.
+
+Tue Sep 12 16:28:04 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * bfdlink.h (struct bfd_link_callbacks): Add symbol parameter to
+ warning callback.
+
+Fri Sep 1 13:11:51 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * bfdlink.h (struct bfd_link_callbacks): Change warning callback
+ to take BFD, section, and address arguments.
+
+Thu Aug 31 16:45:12 1995 steve chamberlain <sac@slash.cygnus.com>
+
+ * bfdlink.h (struct bfd_link_info): Remove PE stuff.
+
+Tue Aug 22 03:18:23 1995 Ken Raeburn <raeburn@kr-laptop.cygnus.com>
+
+ * libiberty.h: Declare xstrerror. From Pat Rankin.
+
+Mon Aug 21 18:11:36 1995 steve chamberlain <sac@slash.cygnus.com>
+
+ * bfdlink.h (struct bfd_link_info): Remove PE stuff.
+
+Wed Aug 2 08:14:12 1995 Doug Evans <dje@canuck.cygnus.com>
+
+ * dis-asm.h (print_insn_sparc64): Declare.
+
+Mon Jul 10 13:26:49 1995 Eric Youngdale <eric@aib.com>
+
+ * bfdlink.h (struct bfd_link_info): Add new field symbolic.
+
+Sun Jul 2 17:48:40 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * bfdlink.h (struct bfd_link_info): Change type of base_file to
+ PTR.
+
+Thu Jun 29 00:02:45 1995 Steve Chamberlain <sac@slash.cygnus.com>
+
+ * bfdlink.h (struct bfd_link_info): Added base_file member.
+
+Tue Jun 20 16:40:04 1995 Steve Chamberlain <sac@slash.cygnus.com>
+
+ * ansidecl.h: win32s is ANSI enough.
+
+Thu May 18 04:25:50 1995 Ken Raeburn <raeburn@kr-laptop.cygnus.com>
+
+ Wed May 10 14:28:16 1995 Richard Earnshaw (rearnsha@armltd.co.uk)
+
+ * dis-asm.h (print_insn_arm): Delete declaration.
+ (print_insn_{little,big}_arm): New declarations.
+
+ * floatformat.h (floatformat_arm_ext): Declare.
+
+Sat May 13 10:14:08 1995 Steve Chamberlain <sac@slash.cygnus.com>
+
+ * coff/pe.h: New file.
+ * bfdlink.h (subsytem, stack_heap_parameters): New.
+ * coff/i386.h (NT_SECTION_ALIGNMENT, NT_FILE_ALIGNMENT,
+ NT_DEF_RESERVE, NT_DEF_COMMIT): New.
+ * coff/internal.h (internal_filehdr): New fields for PE.
+ (IMAGE_DATA_DIRECTORY): New.
+ (internal_aouthdr): New fields for PE.
+
+Thu May 4 14:36:42 1995 Jason Merrill <jason@phydeaux.cygnus.com>
+
+ * demangle.h: Don't include ansidecl.h if IN_GCC.
+
+Tue Feb 21 00:37:28 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * hp-symtab.h: Don't use bitfield enumerations, the HP C compiler
+ does not handle them correctly.
+
+Thu Feb 9 14:20:27 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * libiberty.h (basename): Don't declare parameter type; some
+ systems have this in their header files.
+
+Wed Feb 8 17:35:38 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * bfdlink.h (struct bfd_link_hash_entry): Change format of common
+ symbol information, to remove restrictions on maximum size and
+ alignment power, by using a pointer to a structure instead.
+
+Mon Feb 6 14:55:32 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * bfdlink.h (enum bfd_link_hash_type): Rename bfd_link_hash_weak
+ to bfd_link_hash_undefweak. Add bfd_link_hash_defweak.
+
+Mon Jan 16 21:00:23 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * dis-asm.h (GDB_INIT_DISASSEMBLE_INFO, etc): Remove all
+ GDB-specific definitions.
+
+Sun Jan 15 18:39:35 1995 Steve Chamberlain <sac@splat>
+
+ * dis-asm.h (print_insn_w65): Declare.
+
+Thu Jan 12 17:51:17 1995 Ken Raeburn <raeburn@cujo.cygnus.com>
+
+ * libiberty.h (hex_p): Fix sense of test.
+
+Wed Jan 11 22:36:40 1995 Ken Raeburn <raeburn@cujo.cygnus.com>
+
+ * libiberty.h (_hex_array_size, _hex_bad, _hex_value, hex_init,
+ hex_p, hex_value): New macros and declarations, for hex.c.
+
+Fri Jan 6 17:44:14 1995 Ian Lance Taylor <ian@sanguine.cygnus.com>
+
+ * dis-asm.h: Make idempotent.
+
+Wed Dec 14 13:08:43 1994 Stan Shebs <shebs@andros.cygnus.com>
+
+ * progress.h: New file, empty definitions for progress macros.
+
+Fri Nov 25 00:14:05 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * hp-symtab.h: New file describing the debug symbols emitted
+ by the HP C compilers.
+
+Fri Nov 11 15:48:37 1994 Ian Lance Taylor <ian@sanguine.cygnus.com>
+
+ * bfdlink.h (struct bfd_link_hash_entry): Change u.c.size from 24
+ to 26 bits, and change u.c.alignment_power from 8 to 6 bits. 6
+ bit in the alignment power is enough for a 64 bit address space.
+
+Mon Oct 31 13:02:51 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * demangle.h (cplus_mangle_opname): Declare.
+
+Tue Oct 25 11:38:02 1994 Ian Lance Taylor <ian@sanguine.cygnus.com>
+
+ * bfdlink.h (struct bfd_link_callbacks): Fix comments for
+ multiple_common field.
+
+Sun Sep 04 17:58:10 1994 Richard Earnshaw (rwe@pegasus.esprit.ec.org)
+
+ * aout/aout64.h: Only define QMAGIC if it isn't already defined.
+
+ * dis-asm.h: Add support for the ARM.
+
+Wed Aug 10 12:51:41 1994 Doug Evans (dje@canuck.cygnus.com)
+
+ * libiberty.h (strsignal): Document its existence even if we
+ can't declare it.
+
+Tue Aug 2 14:40:03 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * os9k.h: Remove u_int16, u_int32, and owner_id typedefs and
+ expand their uses. Those names conflict with Mach headers.
+
+Fri Jul 22 14:17:12 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ * bfdlink.h (struct bfd_link_hash_entry): Change u.c.size into a
+ bitfield. Add field u.c.alignment_power.
+
+Sun Jul 10 00:26:39 1994 Ian Dall (dall@hfrd.dsto.gov.au)
+
+ * dis-asm.h: Add print_insn_ns32k declaration.
+
+Mon Jun 20 17:13:29 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ * bfdlink.h (bfd_link_hash_table): Make creator a const pointer.
+
+Sat Jun 18 16:09:32 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * demangle.h (cplus_demangle_opname): Declare.
+
+Thu Jun 16 15:19:03 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * bfdlink.h (struct bfd_link_info): Add new field shared.
+
+Mon Jun 6 14:39:44 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * bfdlink.h (struct bfd_link_hash_entry): Remove written field:
+ not needed for all backends.
+
+Thu Apr 28 19:06:50 1994 Ken Raeburn (raeburn@cujo.cygnus.com)
+
+ * dis-asm.h (disassembler): Declare.
+
+Fri Apr 1 00:38:17 1994 Jim Wilson (wilson@mole.gnu.ai.mit.edu)
+
+ * obstack.h: Delete use of IN_GCC to control whether
+ stddef.h or gstddef.h is included.
+
+Tue Mar 22 13:06:02 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * bfdlink.h (enum bfd_link_order_type): Add bfd_data_link_order.
+ (struct bfd_link_order): Add data field to union.
+
+Mon Mar 21 18:45:26 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * bfdlink.h (struct bfd_link_callbacks): Change bitsize argument
+ to add_to_set to reloc. Remove bitsize argument from constructor.
+ Comment that reloc_overflow, reloc_dangerous and unattached_reloc
+ must handle NULL pointers for reloc location.
+ (enum bfd_link_order_type): Add bfd_section_reloc_link_order and
+ bfd_symbol_reloc_link_order.
+ (struct bfd_link_order): Add reloc field to union.
+ (struct bfd_link_order_reloc): Define.
+
+Mon Mar 14 12:27:50 1994 Ian Lance Taylor (ian@cygnus.com)
+
+ * ieee-float.h: Removed; no longer used.
+
+Tue Mar 1 18:10:49 1994 Kung Hsu (kung@mexican.cygnus.com)
+
+ * os9k.h: os9000 target specific header file, the header of the
+ object file is used now.
+
+Sun Feb 27 21:52:26 1994 Jim Kingdon (kingdon@deneb.cygnus.com)
+
+ * floatformat.h: New file, intended to replace ieee-float.h.
+
+Sun Feb 20 17:15:42 1994 Ian Lance Taylor (ian@lisa.cygnus.com)
+
+ * ansidecl.h (ANSI_PROTOTYPES): Define if using ANSI prototypes.
+
+Wed Feb 16 01:07:12 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * libiberty.h: Don't declare strsignal, to avoid conflicts with
+ Solaris system header files.
+
+Sat Feb 12 22:11:32 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * libiberty.h (xexit): Use __volatile__ to avoid losing if
+ compiling with gcc -traditional.
+
+Thu Feb 10 14:05:41 1994 Ian Lance Taylor (ian@cygnus.com)
+
+ * libiberty.h: New file. Declares functions provided by
+ libiberty.
+
+Tue Feb 8 05:19:52 1994 David J. Mackenzie (djm@thepub.cygnus.com)
+
+ Handle obstack_chunk_alloc returning NULL. This allows
+ obstacks to be used by libraries, without forcing them
+ to call exit or longjmp.
+ * obstack.h (struct obstack): Add alloc_failed flag.
+ _obstack_begin, _obstack_begin_1): Declare to return int, not void.
+ (obstack_finish): If alloc_failed, return NULL.
+ (obstack_base, obstack_next_free, objstack_object_size):
+ If alloc_failed, return 0.
+ (obstack_grow, obstack_grow0, obstack_1grow, obstack_ptr_grow,
+ obstack_int_grow, obstack_blank): If alloc_failed, do nothing that
+ could corrupt the obstack.
+
+Mon Jan 24 15:06:05 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * bfdlink.h (struct bfd_link_callbacks): Add name, reloc_name and
+ addend argments to reloc_overflow callback.
+
+Fri Jan 21 19:13:12 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * dis-asm.h (print_insn_big_powerpc, print_insn_little_powerpc,
+ print_insn_rs6000): Declare.
+
+Thu Jan 6 14:15:55 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * bfdlink.h (struct bfd_link_callbacks): Add bitsize argument to
+ add_to_set field. Add new callback named constructor.
+
+Thu Dec 30 10:44:06 1993 Ian Lance Taylor (ian@rtl.cygnus.com)
+
+ * bfdlink.h: New file for new BFD linker backend routines.
+
+Mon Nov 29 10:43:57 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * dis-asm.h (enum dis_insn_tyupe): Remove non-ANSI trailing comma.
+
+Sat Oct 2 20:42:26 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * dis-asm.h: Move comment to right place.
+
+Mon Aug 9 19:03:35 1993 David J. Mackenzie (djm@thepub.cygnus.com)
+
+ * obstack.h (obstack_chunkfun, obstack_freefun): Add defns from
+ previous version. Are these Cygnus local changes?
+
+Fri Aug 6 17:05:47 1993 David J. Mackenzie (djm@thepub.cygnus.com)
+
+ * getopt.h, obstack.h: Update to latest FSF version.
+
+Mon Aug 2 16:37:14 1993 Stu Grossman (grossman at cygnus.com)
+
+ * coff/i386.h: Add Lynx magic number.
+
+Mon Aug 2 14:45:29 1993 John Gilmore (gnu@cygnus.com)
+
+ * dis-asm.h: Move enum outside of struct defn to avoid warnings.
+
+Mon Aug 2 08:49:30 1993 Stu Grossman (grossman at cygnus.com)
+
+ * wait.h (WEXITSTATUS, WSTOPSIG): Mask down to 8 bits. This is
+ for systems that store stuff into the high 16 bits of a wait
+ status.
+
+Fri Jul 30 18:38:02 1993 John Gilmore (gnu@cygnus.com)
+
+ * dis-asm.h: Add new fields insn_info_valid, branch_delay_insns,
+ data_size, insn_type, target, target2. These are used to return
+ information from the instruction decoders back to the calling
+ program. Add comments, make more readable.
+
+Mon Jul 19 22:14:14 1993 Fred Fish (fnf@deneb.cygnus.com)
+
+ * nlm: New directory containing NLM/NetWare includes.
+
+Thu Jul 15 12:10:04 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * dis-asm.h (struct disassemble_info): New field application_data.
+
+Thu Jul 15 12:41:15 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * dis-asm.h: Added declaration of print_insn_m88k.
+
+Thu Jul 8 09:05:26 1993 Doug Evans (dje@canuck.cygnus.com)
+
+ * opcode/h8300.h: Lots of little fixes for the h8/300h.
+
+Fri Jul 2 10:31:59 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * ansidecl.h: Use ANSI macros if __mips and _SYSTYPE_SVR4 are
+ defined, since RISC/OS cc handles ANSI declarations in SVR4 mode
+ but does not define __STDC__.
+
+Sun Jun 20 18:27:52 1993 Ken Raeburn (raeburn@poseidon.cygnus.com)
+
+ * dis-asm.h: Don't need to include ansidecl.h any more.
+
+Fri Jun 18 03:22:10 1993 John Gilmore (gnu@cygnus.com)
+
+ * oasys.h: Eliminate "int8_type", "int16_type", "int32_type", and
+ their variants. These changes are coordinated with corresponding
+ changes in ../bfd/oasys.c.
+
+Wed Jun 16 10:43:08 1993 Fred Fish (fnf@cygnus.com)
+
+ * bfd.h: Note that it has been removed.
+
+Tue Jun 8 12:16:03 1993 Steve Chamberlain (sac@phydeaux.cygnus.com)
+
+ Support for H8/300-H
+ * dis-asm.h (print_insn_h8300, print_insn_h8300h): Declare it.
+ * coff/h8300.h: New magic number.
+ * coff/internal.h: New relocations.
+ * opcode/h8300.h: Lots of new opcodes.
+
+Tue Jun 1 07:35:03 1993 Ken Raeburn (raeburn@kr-pc.cygnus.com)
+
+ * ansidecl.h (const): Don't define it if it's already defined.
+
+Thu May 27 18:19:51 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * dis-asm.h (print_insn_hppa): Declare it.
+
+ * bfd.h: Moved to bfd directory. Small stub here includes it
+ without requiring "-I../bfd".
+
+Thu Apr 29 12:06:13 1993 Ken Raeburn (raeburn@deneb.cygnus.com)
+
+ * bfd.h: Updated with BSF_FUNCTION.
+
+Mon Apr 26 18:15:50 1993 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * bfd.h, dis-asm.h: Updated with Hitachi SH.
+
+Fri Apr 23 18:41:38 1993 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * bfd.h: Updated with alpha changes.
+ * dis-asm.h: Added alpha.
+
+Fri Apr 16 17:35:30 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * bfd.h: Update for signed bfd_*get_*.
+
+Thu Apr 15 09:24:21 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * bfd.h: Updated for file_truncated error.
+
+Thu Apr 8 10:53:47 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * ansidecl.h: If no ANSI, define const to be empty.
+
+Thu Apr 1 09:00:10 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * dis-asm.h: Declare a29k and i960 print_insn_*.
+
+ * dis-asm.h: Add print_address_func and related stuff.
+
+ * dis-asm.h (dis_asm_read_memory): Fix prototype.
+
+Wed Mar 31 17:40:16 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * dis-asm.h: Add print_insn_sparc.
+
+Wed Mar 31 17:51:42 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * bfd.h: Updated for BFD_RELOC_MIPS_GPREL and bfd_[gs]et_gp_size
+ prototypes.
+
+Wed Mar 31 16:35:12 1993 Stu Grossman (grossman@cygnus.com)
+
+ * dis-asm.h: (disassemble_info): Fix typo in prototype of
+ dis_asm_memory_error().
+
+Tue Mar 30 19:09:23 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * dis-asm.h (disassembler_info): Add read_memory_func,
+ memory_error_func, buffer, and length.
+ ({GDB_,}INIT_DISASSEMBLE_INFO): Set them.
+ print_insn_*: Remove second argument.
+
+Tue Mar 30 14:48:55 1993 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * bfd.h: Update for lma field of section.
+
+Tue Mar 30 12:22:55 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * ansidecl.h: Use ANSI versions on AIX regardless of __STDC__.
+
+Fri Mar 19 14:49:49 1993 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * dis-asm.h: Add h8500.
+
+Thu Mar 18 13:49:09 1993 Per Bothner (bothner@rtl.cygnus.com)
+
+ * ieee-float.h: Moved from ../gdb.
+ * dis-asm.h: New file. Interface to dis-assembler.
+
+Thu Mar 11 10:52:57 1993 Fred Fish (fnf@cygnus.com)
+
+ * demangle.h (DMGL_NO_OPTS): Add define (set to 0) to use
+ in place of bare 0, for readability reasons.
+
+Tue Mar 2 17:50:11 1993 Fred Fish (fnf@cygnus.com)
+
+ * demangle.h: Replace all references to cfront with ARM.
+
+Tue Feb 23 12:21:14 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * bfd.h: Update for new elements in JUMP_TABLE.
+
+Tue Feb 16 00:51:30 1993 John Gilmore (gnu@cygnus.com)
+
+ * bfd.h: Update for BFD_VERSION 2.1.
+
+Tue Jan 26 11:49:20 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * bfd.h: Update for SEC_IS_COMMON flag.
+
+Tue Jan 19 12:25:12 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * bfd.h: Update for bfd_asymbol_value bug fix.
+
+Fri Jan 8 16:37:18 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * bfd.h: Update to include ECOFF tdata and target_flavour.
+
+Sun Dec 27 17:52:30 1992 Fred Fish (fnf@cygnus.com)
+
+ * bfd.h: Add declaration for bfd_get_size().
+
+Tue Dec 22 22:42:46 1992 Fred Fish (fnf@cygnus.com)
+
+ * demangle.h: Protect file from multiple inclusions with
+ #if !defined(DEMANGLE_H)...#define DEMANGLE_H...#endif.
+
+Mon Dec 21 21:25:50 1992 Stu Grossman (grossman at cygnus.com)
+
+ * bfd.h: Update to get hppa_core_struct from bfd.c.
+
+Thu Dec 17 00:42:35 1992 John Gilmore (gnu@cygnus.com)
+
+ * bfd.h: Update to get tekhex tdata name change from bfd.
+
+Mon Nov 9 23:55:42 1992 John Gilmore (gnu@cygnus.com)
+
+ * ansidecl.h: Update comments to discourage use of EXFUN.
+
+Thu Nov 5 16:35:44 1992 Ian Lance Taylor (ian@cygnus.com)
+
+ * bfd.h: Update to bring in SEC_SHARED_LIBRARY.
+
+Thu Nov 5 03:21:32 1992 John Gilmore (gnu@cygnus.com)
+
+ * bfd.h: Update to match EXFUN, bfd_seclet_struct, and SDEF
+ cleanups in bfd.
+
+Wed Nov 4 07:28:05 1992 Ken Raeburn (raeburn@cygnus.com)
+
+ * bout.h (N_CALLNAME, N_BALNAME): Define as char-type values, so
+ widening works consistently.
+
+Fri Oct 16 03:17:08 1992 John Gilmore (gnu@cygnus.com)
+
+ * getopt.h: Update to Revised Standard FSF Version.
+
+Thu Oct 15 21:43:22 1992 K. Richard Pixley (rich@sendai.cygnus.com)
+
+ * getopt.h (struct option): use the provided enum for has_arg.
+
+ * demangle.h (AUTO_DEMANGLING, GNU_DEMANGLING,
+ LUCID_DEMANGLING): ultrix compilers require enums to be
+ enums and ints to be ints and casts where they meet. cast some
+ enums into ints.
+
+Thu Oct 15 04:35:51 1992 John Gilmore (gnu@cygnus.com)
+
+ * bfd.h: Update after comment changes.
+
+Thu Oct 8 09:03:02 1992 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * bfd.h (bfd_get_symbol_leading_char): new macro for getting in xvec
+
+Thu Sep 3 09:10:50 1992 Stu Grossman (grossman at cygnus.com)
+
+ * bfd.h (struct reloc_howto_struct): size needs to be signed if
+ it's going to hold negative values.
+
+Sun Aug 30 17:50:27 1992 Per Bothner (bothner@rtl.cygnus.com)
+
+ * demangle.h: New file, moved from ../gdb. Made independent
+ of gdb. Allow demangling style option to be passed as a
+ parameter to cplus_demangle(), but using the
+ current_demangling_style global as the default.
+
+Sat Aug 29 10:07:55 1992 Fred Fish (fnf@cygnus.com)
+
+ * obstack.h: Merge comment change from current FSF version.
+
+Thu Aug 27 12:59:29 1992 Brendan Kehoe (brendan@cygnus.com)
+
+ * bfd.h: add we32k
+
+Tue Aug 25 15:07:47 1992 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * bfd.h: new after Z8000 stuff
+
+Mon Aug 17 09:01:23 1992 Ken Raeburn (raeburn@cygnus.com)
+
+ * bfd.h: Regenerated after page/segment size changes.
+
+Sat Aug 1 13:46:31 1992 Fred Fish (fnf@cygnus.com)
+
+ * obstack.h: Merge changes from current FSF version.
+
+Mon Jul 20 21:06:23 1992 Fred Fish (fnf@cygnus.com)
+
+ * obstack.h (area_id, flags): Remove, replace with extra_arg,
+ use_extra_arg, and maybe_empty_object.
+ * obstack.h (OBSTACK_MAYBE_EMPTY_OBJECT, OBSTACK_MMALLOC_LIKE):
+ Remove, replaced by maybe_empty_object and use_extra_arg bitfields.
+ * obstack.h (obstack_full_begin, _obstack_begin): Remove area_id
+ and flags arguments.
+ * obstack.h (obstack_alloc_arg): New macro to set extra_arg.
+
+Thu Jul 16 08:12:44 1992 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * bfd.h: new after adding BFD_IS_RELAXABLE
+
+Sat Jul 4 03:22:23 1992 John Gilmore (gnu at cygnus.com)
+
+ * bfd.h: Regen after adding BSF_FILE.
+
+Mon Jun 29 14:18:36 1992 Fred Fish (fnf at sunfish)
+
+ * obstack.h: Convert bcopy() use to memcpy(), which is more
+ portable, more standard, and can take advantage of gcc's builtin
+ functions for increased performance.
+
+Thu Jun 25 04:46:08 1992 John Gilmore (gnu at cygnus.com)
+
+ * ansidecl.h (PARAMS): Incorporate this macro from gdb's defs.h.
+ It's a cleaner way to forward-declare function prototypes.
+
+Fri Jun 19 15:46:32 1992 Stu Grossman (grossman at cygnus.com)
+
+ * bfd.h: HPPA merge.
+
+Tue Jun 16 21:30:56 1992 K. Richard Pixley (rich@cygnus.com)
+
+ * getopt.h: gratuitous white space changes merged from other prep
+ releases.
+
+Thu Jun 11 01:10:55 1992 John Gilmore (gnu at cygnus.com)
+
+ * bfd.h: Regen'd from bfd.c after removing elf_core_tdata_struct.
+
+Mon May 18 17:29:03 1992 K. Richard Pixley (rich@cygnus.com)
+
+ * getopt.h: merged changes from make-3.62.11.
+
+ * getopt.h: merged changes from grep-1.6 (alpha).
+
+Fri May 8 14:53:32 1992 K. Richard Pixley (rich@cygnus.com)
+
+ * getopt.h: merged changes from bison-1.18.
+
+Sat Mar 14 17:25:20 1992 Fred Fish (fnf@cygnus.com)
+
+ * obstack.h: Add "area_id" and "flags" members to obstack
+ structure. Add obstack_chunkfun() and obstack_freefun() to
+ set functions explicitly. Convert maybe_empty_object to
+ a bit in "flags".
+
+Thu Feb 27 22:01:02 1992 Per Bothner (bothner@cygnus.com)
+
+ * wait.h (WIFSTOPPED): Add IBM rs6000-specific version.
+
+Fri Feb 21 20:49:20 1992 John Gilmore (gnu at cygnus.com)
+
+ * obstack.h: Add obstack_full_begin.
+ * bfd.h, obstack.h: Protolint.
+
+Thu Jan 30 01:18:42 1992 John Gilmore (gnu at cygnus.com)
+
+ * bfd.h: Remove comma from enum declaration.
+
+Mon Jan 27 22:01:13 1992 Steve Chamberlain (sac at cygnus.com)
+
+ * bfd.h : new target entr, bfd_relax_section
+
+Wed Dec 18 17:19:44 1991 Stu Grossman (grossman at cygnus.com)
+
+ * bfd.h, ieee.h, opcode/m68k.h, opcode/sparc.h: ANSIfy enums.
+
+Thu Dec 12 20:59:56 1991 John Gilmore (gnu at cygnus.com)
+
+ * fopen-same.h, fopen-bin.h: New files for configuring
+ whether fopen distinguishes binary files or not. For use
+ by host-dependent config files.
+
+Sat Nov 30 20:46:43 1991 Steve Chamberlain (sac at rtl.cygnus.com)
+
+ * bfd.h: change the documentation format.
+
+ * created coff, elf and opcode and aout directories. Moved:
+
+ aout64.h ==> aout/aout64.h
+ ar.h ==> aout/ar.h
+ a.out.encap.h ==> aout/encap.h
+ a.out.host.h ==> aout/host.h
+ a.out.hp.h ==> aout/hp.h
+ a.out.sun4.h ==> aout/sun4.h
+ ranlib.h ==> aout/ranlib.h
+ reloc.h ==> aout/reloc.h
+ stab.def ==> aout/stab.def
+ stab.gnu.h ==> aout/stab_gnu.h
+
+ coff-a29k.h ==> coff/a29k.h
+ coff-h8300.h ==> coff/h8300.h
+ coff-i386.h ==> coff/i386.h
+ coff-i960.h ==> coff/i960.h
+ internalcoff.h ==> coff/internal.h
+ coff-m68k.h ==> coff/m68k.h
+ coff-m88k.h ==> coff/m88k.h
+ coff-mips.h ==> coff/mips.h
+ coff-rs6000.h ==> coff/rs6000.h
+
+ elf-common.h ==> elf/common.h
+ dwarf.h ==> elf/dwarf.h
+ elf-external.h ==> elf/external.h
+ elf-internal.h ==> elf/internal.h
+
+ a29k-opcode.h ==> opcode/a29k.h
+ arm-opcode.h ==> opcode/arm.h
+ h8300-opcode.h ==> opcode/h8300.h
+ i386-opcode.h ==> opcode/i386.h
+ i860-opcode.h ==> opcode/i860.h
+ i960-opcode.h ==> opcode/i960.h
+ m68k-opcode.h ==> opcode/m68k.h
+ m88k-opcode.h ==> opcode/m88k.h
+ mips-opcode.h ==> opcode/mips.h
+ np1-opcode.h ==> opcode/np1.h
+ ns32k-opcode.h ==> opcode/ns32k.h
+ pn-opcode.h ==> opcode/pn.h
+ pyr-opcode.h ==> opcode/pyr.h
+ sparc-opcode.h ==> opcode/sparc.h
+ tahoe-opcode.h ==> opcode/tahoe.h
+ vax-opcode.h ==> opcode/vax.h
+
+
+
+Wed Nov 27 10:38:31 1991 Steve Chamberlain (sac at rtl.cygnus.com)
+
+ * internalcoff.h: (internal_scnhdr) took out #def dependency, now
+ s_nreloc and s_nlnno are always long. (internal_reloc): allways
+ has an offset field now.
+
+Fri Nov 22 08:12:58 1991 John Gilmore (gnu at cygnus.com)
+
+ * coff-rs6000.h: Lint; use unsigned chars for external fields.
+ * internalcoff.h: Lint; cast storage classes to signed char.
+
+Thu Nov 21 21:01:05 1991 Per Bothner (bothner at cygnus.com)
+
+ * stab.def: Remove the GNU extended type codes (e.g. N_SETT).
+ * aout64.h: The heuristic for distinguishing between
+ sunos-style and bsd-style ZMAGIC files (wrt. where the
+ text segment starts) is moved into (the default definition of)
+ the macro N_HEADER_IN_TEXT. This definition is only used
+ if no other definition is used - e.g. bfd/newsos3.c defines
+ N_HEADER_IN_TEXT(x) to be always 0 (as before).
+
+Thu Nov 21 11:53:03 1991 John Gilmore (gnu at cygnus.com)
+
+ * aout64.h (N_TXTADDR, N_TXTOFF, N_TXTSIZE): New definitions
+ that should handle all uses. LOGICAL_ versions deleted.
+ Eliminate N_HEADER_IN_TEXT, using a_entry to determine which
+ kind of zmagic a.out file we are looking at.
+ * coff-rs6000.h: Typo.
+
+Tue Nov 19 18:43:37 1991 Per Bothner (bothner at cygnus.com)
+
+ (Note: This is a revised entry, as was aout64.h.)
+ * aout64.h: Some cleanups of N_TXTADDR and N_TXTOFF:
+ Will now work for both old- and new-style ZMAGIC files,
+ depending on N_HEADER_IN_TEXT macro.
+ Add LOGICAL_TXTADDR, LOICAL_TXTOFF and LOGICAL_TXTSIZE
+ that don't count the exec header as part
+ of the text segment, to be consistent with bfd.
+ * a.out.sun4.h: Simplified/fixed for previous change.
+
+Mon Nov 18 00:02:06 1991 Fred Fish (fnf at cygnus.com)
+
+ * dwarf.h: Update to DWARF draft 5 version from gcc2.
+
+Thu Nov 14 19:44:59 1991 Per Bothner (bothner at cygnus.com)
+
+ * stab.def: Added defs for extended GNU symbol types,
+ such as N_SETT. These are normally ifdef'd out (because
+ of conflicts with a.out.gnu.h), but are used by bfb_stab_name().
+
+Thu Nov 14 19:17:03 1991 Fred Fish (fnf at cygnus.com)
+
+ * elf-common.h: Add defines to support ELF symbol table code.
+
+Mon Nov 11 19:01:06 1991 Fred Fish (fnf at cygnus.com)
+
+ * elf-internal.h, elf-external.h, elf-common.h: Add support for
+ note sections, which are used in ELF core files to hold copies
+ of various /proc structures.
+
+Thu Nov 7 08:58:26 1991 Steve Chamberlain (sac at cygnus.com)
+
+ * internalcoff.h: took out the M88 dependency in the lineno
+ struct.
+ * coff-m88k.h: defines GET_LINENO_LNNO and PUT_LINENO_LNNO to use
+ 32bit linno entries.
+ * a29k-opcode.h: fixed encoding of mtacc
+
+Sun Nov 3 11:54:22 1991 Per Bothner (bothner at cygnus.com)
+
+ * bfd.h: Updated from ../bfd/bfd-in.h (q.v).
+
+Fri Nov 1 11:13:53 1991 John Gilmore (gnu at cygnus.com)
+
+ * internalcoff.h: Add x_csect defines.
+
+Fri Oct 25 03:18:20 1991 John Gilmore (gnu at cygnus.com)
+
+ * Rename COFF-related files in `coff-ARCH.h' form.
+ coff-a29k.h, coff-i386.h, coff-i960.h, coff-m68k.h, coff-m88k.h,
+ coff-mips.h, coff-rs6000.h to be exact.
+
+Thu Oct 24 22:11:11 1991 John Gilmore (gnu at cygnus.com)
+
+ RS/6000 support, by Metin G. Ozisik, Mimi Phûông-Thåo Võ, and
+ John Gilmore.
+
+ * a.out.gnu.h: Update slightly.
+ * bfd.h: Add new error code, fix doc, add bfd_arch_rs6000.
+ * internalcoff.h: Add more F_ codes for filehdr. Add
+ rs/6000-dependent fields to aouthdr. Add storage classes
+ to syments. Add 6000-specific auxent. Add r_size in reloc.
+ * rs6000coff.c: New file.
+
+Thu Oct 24 04:13:20 1991 Fred Fish (fnf at cygnus.com)
+
+ * dwarf.h: New file for dwarf support. Copied from gcc2
+ distribution.
+
+Wed Oct 16 13:31:45 1991 John Gilmore (gnu at cygnus.com)
+
+ * aout64.h: Remove PAGE_SIZE defines; they are target-dependent.
+ Add N_FN_SEQ for N_FN symbol type used on Sequent machines.
+ * stab.def: Include N_FN_SEQ in table.
+ * bout.h: External formats of structures use unsigned chars.
+
+Fri Oct 11 12:40:43 1991 Steve Chamberlain (steve at cygnus.com)
+
+ * bfd.h:upgrade from bfd.c
+ * internalcoff.h: add n_name, n_zeroes and n_offset macros
+ * amdcoff.h: Define OMAGIC and AOUTHDRSZ.
+
+Fri Oct 11 10:58:06 1991 Per Bothner (bothner at cygnus.com)
+
+ * a.out.host.h: Change SEGMENT_SIZE to 0x1000 for Sony.
+ * bfd.h (align_power): Add (actually move) comment.
+
+Tue Oct 8 15:29:32 1991 Per Bothner (bothner at cygnus.com)
+
+ * sys/h-rtbsd.h: Define MISSING_VFPRINT (for binutils/bucomm.c).
+
+Sun Oct 6 19:24:39 1991 John Gilmore (gnu at cygnus.com)
+
+ * aout64.h: Move struct internal_exec to ../bfd/libaout.h so
+ it can be shared by all `a.out-family' code. Rename
+ EXTERNAL_LIST_SIZE to EXTERNAL_NLIST_SIZE. Use basic types
+ for nlist members, and make strx integral rather than pointer.
+ More commentary on n_type values.
+ * bout.h: Provide a struct external_exec rather than an
+ internal_exec.
+ * m68kcoff.h: Remove `tagentries' which snuck in from the i960
+ COFF port.
+
+Fri Oct 4 01:25:59 1991 John Gilmore (gnu at cygnus.com)
+
+ * h8300-opcode.h: Remove `_enum' from the typedef for an enum.
+ * bfd.h: Update to match bfd changes.
+
+ * sys/h-i386mach.h, sysdep.h: Add 386 Mach host support.
+
+Tue Oct 1 04:58:42 1991 John Gilmore (gnu at cygnus.com)
+
+ * bfd.h, elf-common.h, elf-external.h, elf-internal.h:
+ Add preliminary ELF support, sufficient for GDB, from Fred Fish.
+ * sysdep.h, sys/h-amix.h: Support Amiga SVR4.
+
+ * sys/h-vaxult.h: Make it work. (David Taylor <taylor@think.com>)
+ * a.out.vax.h: Remove unused and confusing file.
+
+Mon Sep 30 12:52:35 1991 Per Bothner (bothner at cygnus.com)
+
+ * sysdep.h: Define NEWSOS3_SYS, and use it.
+
+Fri Sep 20 13:38:21 1991 John Gilmore (gnu at cygnus.com)
+
+ * a.out.gnu.h (N_FN): Its value *really is* 0x1F.
+ Fix it, and add comments warning about or-ing N_EXT with it
+ and/or N_WARNING.
+ * aout64.h (N_FN): Fix value, add comments about N_EXT.
+ * stab.def (table at end): Update to show all the type
+ values <0x20, including low order bits. Move N_FN to
+ its rightful place.
+
+Tue Sep 17 17:41:37 1991 Stu Grossman (grossman at cygnus.com)
+
+ * sys/h-irix3.h: sgi/irix support.
+
+Tue Sep 17 07:52:59 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * stab.def (N_DEFD): Add GNU Modula-2 debug stab, from Andrew
+ Beers.
+
+Thu Sep 12 14:12:59 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * internalcoff.h (SYMNMLEN, FILNMLEN, DIMNUM): Define these
+ for internalcoff, separately from the various external coff's.
+ * amdcoff.h, bcs88kcoff.h, i386coff.h, intel-coff.h, m68kcoff.h,
+ m88k-bcs.h: Prefix SYMNMLEN, FILNMLEN, and DIMNUM with E_'s for
+ the external struct definitions.
+ * ecoff.h: Remove these #define's, kludge no longer needed.
+
+ * sys/h-ultra3.h: Add new Ultracomputer host.
+ * sysdep.h: Add ULTRA3_SYM1_SYS and use it.
+
+Tue Sep 10 10:11:46 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * i386coff.h (LINESZ): Always 6, not based on sizeof().
+ (Fix from Peter Schauer <pes@regent.e-technik.tu-muenchen.de>.)
+
+Wed Sep 4 08:58:37 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * a.out.gnu.h, aout64.h: Add N_WARNING. Change N_FN to 0x0E,
+ to match SunOS and BSD. Add N_COMM as 0x12 for SunOS shared lib
+ support.
+ * stab.def: Add N_COMM to table, fix overlap comment.
+
+Tue Sep 3 06:29:20 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ Merge with latest FSF versions of these files.
+
+ * stab.gnu.h: Add LAST_UNUSED_STAB_CODE.
+ * stab.def: Update to GPL2. Move N_WARNING out, since not a
+ debug symbol. Change comments, and reorder table to numeric
+ order. Update final table comment.
+ (N_DSLINE, N_BSLINE): Renumber from 0x66 and 0x68, to 0x46 and 0x48.
+
+ * obstack.h: GPL2. Merge.
+
+Fri Aug 23 01:54:23 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * a.out.gnu.h, a.out.sun4.h: Make SEGMENT_SIZE able to depend
+ on the particular a.out being examined.
+ * a.out.sun4.h: Define segment sizes for Sun-3's and Sun-4's.
+ * FIXME: a.out.gnu.h is almost obsolete.
+ * FIXME: a.out.sun4.h should be renamed a.out.sun.h now.
+
+Wed Aug 21 20:32:13 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * Start a ChangeLog for the includes directory.
+
+ * a.out.gnu.h (N_FN): Fix value -- was 15, should be 0x1E.
+ * stab.def: Update allocation table in comments at end,
+ to reflect reality as I know it.
-For older changes see ChangeLog-9103
Local Variables:
mode: change-log
diff --git a/include/demangle.h b/include/demangle.h
index c3fdb03..6e995e4 100644
--- a/include/demangle.h
+++ b/include/demangle.h
@@ -21,7 +21,7 @@
#if !defined (DEMANGLE_H)
#define DEMANGLE_H
-#include "ansidecl.h"
+#include "libiberty.h"
#ifdef __cplusplus
extern "C" {
diff --git a/include/elf/ChangeLog b/include/elf/ChangeLog
index 9c7b588..ea008d6 100644
--- a/include/elf/ChangeLog
+++ b/include/elf/ChangeLog
@@ -1,3 +1,19 @@
+2004-01-28 Roland McGrath <roland@redhat.com>
+
+ * common.h (AT_SECURE): New macro.
+
+2004-01-21 Roland McGrath <roland@redhat.com>
+
+ * common.h (AT_SUN_UID, AT_SUN_RUID, AT_SUN_GID): New macros.
+ (AT_SUN_RGID, AT_SUN_LDELF, AT_SUN_LDSHDR, AT_SUN_LDNAME,
+ AT_SUN_LPAGESZ, AT_SUN_PLATFORM, AT_SUN_HWCAP, AT_SUN_IFLUSH,
+ AT_SUN_CPU, AT_SUN_EMUL_ENTRY, AT_SUN_EMUL_EXECFD,
+ AT_SUN_EXECNAME) AT_SUN_MMU, AT_SUN_LDDATA): Likewise.
+
+2004-01-17 Mark Kettenis <kettenis@gnu.org>
+
+ * common.h (NT_OPENBSD_IDENT): Define.
+
2004-01-06 Alexandre Oliva <aoliva@redhat.com>
2003-09-18 Alexandre Oliva <aoliva@redhat.com>
diff --git a/include/elf/common.h b/include/elf/common.h
index 3c4fabe..bf233f6 100644
--- a/include/elf/common.h
+++ b/include/elf/common.h
@@ -404,6 +404,10 @@
#define NT_NETBSD_IDENT 1
+/* Values for OpenBSD .note.openbsd.ident notes. Note name is "OpenBSD". */
+
+#define NT_OPENBSD_IDENT 1
+
/* Values for FreeBSD .note.ABI-tag notes. Note name is "FreeBSD". */
#define NT_FREEBSD_ABI_TAG 1
@@ -717,9 +721,30 @@
#define AT_ICACHEBSIZE 20 /* Instruction cache block size. */
#define AT_UCACHEBSIZE 21 /* Unified cache block size. */
#define AT_IGNOREPPC 22 /* Entry should be ignored */
+#define AT_SECURE 23 /* Boolean, was exec setuid-like? */
/* Pointer to the global system page used for system calls and other
nice things. */
#define AT_SYSINFO 32
-#define AT_SYSINFO_EHDR 33
+#define AT_SYSINFO_EHDR 33 /* Pointer to ELF header of system-supplied DSO. */
+
+#define AT_SUN_UID 2000 /* Effective user ID. */
+#define AT_SUN_RUID 2001 /* Real user ID. */
+#define AT_SUN_GID 2002 /* Effective group ID. */
+#define AT_SUN_RGID 2003 /* Real group ID. */
+#define AT_SUN_LDELF 2004 /* Dynamic linker's ELF header. */
+#define AT_SUN_LDSHDR 2005 /* Dynamic linker's section headers. */
+#define AT_SUN_LDNAME 2006 /* String giving name of dynamic linker. */
+#define AT_SUN_LPAGESZ 2007 /* Large pagesize. */
+#define AT_SUN_PLATFORM 2008 /* Platform name string. */
+#define AT_SUN_HWCAP 2009 /* Machine dependent hints about
+ processor capabilities. */
+#define AT_SUN_IFLUSH 2010 /* Should flush icache? */
+#define AT_SUN_CPU 2011 /* CPU name string. */
+#define AT_SUN_EMUL_ENTRY 2012 /* COFF entry point address. */
+#define AT_SUN_EMUL_EXECFD 2013 /* COFF executable file descriptor. */
+#define AT_SUN_EXECNAME 2014 /* Canonicalized file name given to execve. */
+#define AT_SUN_MMU 2015 /* String for name of MMU module. */
+#define AT_SUN_LDDATA 2016 /* Dynamic linker's data segment address. */
+
#endif /* _ELF_COMMON_H */
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 9bc2903..10c7f46 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,31 @@
+2004-01-25 Ian Lance Taylor <ian@wasabisystems.com>
+
+ * configure.ac: Add m4_pattern_allow(LIBOBJS).
+ * configure: Regenerate.
+
+2004-01-22 DJ Delorie <dj@redhat.com>
+
+ * Makefile.in: Convert to ./ throughout. Rebuild dependencies
+ with explicit build rules.
+ (VPATH): Remove.
+ (.c.o): Poison.
+ * configure.ac (pexecute, LIBOBJS): Add ./ .
+ * maint-tool: Build dependencies with explicit rules.
+
+2004-01-15 Kazu Hirata <kazu@cs.umass.edu>
+
+ * strdup.c (strdup): Constify the argument.
+
+2004-01-14 Loren J. Rittle <ljrittle@acm.org>
+
+ * Makefile.in (distclean): Remove config.cache.
+
+2004-01-13 Daniel Jacobowitz <drow@mvista.com>
+
+ * cp-demangle.c (d_make_comp): DEMANGLE_COMPONENT_CONSTRUCTION_VTABLE
+ takes two parameters.
+ * cp-demint.c (cplus_demangle_fill_component): Likewise.
+
2004-01-12 Ian Lance Taylor <ian@wasabisystems.com>
* cp-demangle.c: Include "cp-demangle.h". If IN_GLIBCPP_V3 is
diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in
index 139cb68..bbb5c2a 100644
--- a/libiberty/Makefile.in
+++ b/libiberty/Makefile.in
@@ -28,7 +28,6 @@
libiberty_topdir = @libiberty_topdir@
srcdir = @srcdir@
-VPATH = @srcdir@
prefix = @prefix@
@@ -70,8 +69,8 @@ PICFLAG =
MAKEOVERRIDES =
-TARGETLIB = libiberty.a
-TESTLIB = testlib.a
+TARGETLIB = ./libiberty.a
+TESTLIB = ./testlib.a
LIBOBJS = @LIBOBJS@
@@ -118,19 +117,19 @@ installcheck: installcheck-subdir
INCDIR=$(srcdir)/$(MULTISRCTOP)../include
COMPILE.c = $(CC) -c @DEFS@ $(LIBCFLAGS) -I. -I$(INCDIR) $(HDEFINES) @ac_libiberty_warn_cflags@
+
+# Just to make sure we don't use a built-in rule with VPATH
.c.o:
- if [ x"$(PICFLAG)" != x ]; then \
- $(COMPILE.c) $(PICFLAG) $< -o pic/$@; \
- else true; fi
- $(COMPILE.c) $< $(OUTPUT_OPTION)
+ false
# NOTE: If you add new files to the library, add them to this list
# (alphabetical), and add them to REQUIRED_OFILES, or
-# CONFIGURED_OFILES and funcs in configure.ac.
+# CONFIGURED_OFILES and funcs in configure.ac. Also run "make maint-deps"
+# to build the new rules.
CFILES = alloca.c argv.c asprintf.c atexit.c \
basename.c bcmp.c bcopy.c bsearch.c bzero.c \
calloc.c choose-temp.c clock.c concat.c cp-demangle.c \
- cp-demint.c cplus-dem.c \
+ cp-demint.c cplus-dem.c \
dyn-string.c \
fdmatch.c ffs.c fibheap.c floatformat.c fnmatch.c \
getcwd.c getopt.c getopt1.c getpagesize.c getpwd.c getruntime.c \
@@ -158,45 +157,45 @@ CFILES = alloca.c argv.c asprintf.c atexit.c \
# These are always included in the library. The first four are listed
# first and by compile time to optimize parallel builds.
-REQUIRED_OFILES = regex.o cplus-dem.o cp-demangle.o cp-demint.o md5.o \
- alloca.o argv.o \
- choose-temp.o concat.o \
- dyn-string.o \
- fdmatch.o fibheap.o floatformat.o fnmatch.o \
- getopt.o getopt1.o getpwd.o getruntime.o \
- hashtab.o hex.o \
- lbasename.o \
- lrealpath.o \
- make-relative-prefix.o \
- make-temp-file.o \
- objalloc.o obstack.o \
- partition.o physmem.o @pexecute@ \
- safe-ctype.o sort.o spaces.o splay-tree.o strerror.o \
- strsignal.o \
- ternary.o \
- xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o
+REQUIRED_OFILES = ./regex.o ./cplus-dem.o ./cp-demangle.o ./cp-demint.o ./md5.o \
+ ./alloca.o ./argv.o \
+ ./choose-temp.o ./concat.o \
+ ./dyn-string.o \
+ ./fdmatch.o ./fibheap.o ./floatformat.o ./fnmatch.o \
+ ./getopt.o ./getopt1.o ./getpwd.o ./getruntime.o \
+ ./hashtab.o ./hex.o \
+ ./lbasename.o \
+ ./lrealpath.o \
+ ./make-relative-prefix.o \
+ ./make-temp-file.o \
+ ./objalloc.o ./obstack.o \
+ ./partition.o ./physmem.o @pexecute@ \
+ ./safe-ctype.o ./sort.o ./spaces.o ./splay-tree.o ./strerror.o \
+ ./strsignal.o \
+ ./ternary.o \
+ ./xatexit.o ./xexit.o ./xmalloc.o ./xmemdup.o ./xstrdup.o ./xstrerror.o
# These are all the objects that configure may add to the library via
# $funcs or EXTRA_OFILES. This list exists here only for "make
# maint-missing" and "make check".
-CONFIGURED_OFILES = asprintf.o atexit.o \
- basename.o bcmp.o bcopy.o bsearch.o bzero.o \
- calloc.o clock.o copysign.o \
- _doprnt.o \
- ffs.o \
- getcwd.o getpagesize.o \
- index.o insque.o \
- memchr.o memcmp.o memcpy.o memmove.o mempcpy.o memset.o mkstemps.o \
- pex-djgpp.o pex-mpw.o pex-msdos.o pex-os2.o \
- pex-unix.o pex-win32.o \
- putenv.o \
- random.o rename.o rindex.o \
- setenv.o sigsetmask.o snprintf.o stpcpy.o stpncpy.o strcasecmp.o \
- strchr.o strdup.o strncasecmp.o strncmp.o strrchr.o strstr.o \
- strtod.o strtol.o strtoul.o \
- tmpnam.o \
- vasprintf.o vfork.o vfprintf.o vprintf.o vsnprintf.o vsprintf.o \
- waitpid.o
+CONFIGURED_OFILES = ./asprintf.o ./atexit.o \
+ ./basename.o ./bcmp.o ./bcopy.o ./bsearch.o ./bzero.o \
+ ./calloc.o ./clock.o ./copysign.o \
+ ./_doprnt.o \
+ ./ffs.o \
+ ./getcwd.o ./getpagesize.o \
+ ./index.o ./insque.o \
+ ./memchr.o ./memcmp.o ./memcpy.o ./memmove.o ./mempcpy.o ./memset.o ./mkstemps.o \
+ ./pex-djgpp.o ./pex-mpw.o ./pex-msdos.o ./pex-os2.o \
+ ./pex-unix.o ./pex-win32.o \
+ ./putenv.o \
+ ./random.o ./rename.o ./rindex.o \
+ ./setenv.o ./sigsetmask.o ./snprintf.o ./stpcpy.o ./stpncpy.o ./strcasecmp.o \
+ ./strchr.o ./strdup.o ./strncasecmp.o ./strncmp.o ./strrchr.o ./strstr.o \
+ ./strtod.o ./strtol.o ./strtoul.o \
+ ./tmpnam.o \
+ ./vasprintf.o ./vfork.o ./vfprintf.o ./vprintf.o ./vsnprintf.o ./vsprintf.o \
+ ./waitpid.o
# These files are installed if the library has been configured to do so.
INSTALLED_HEADERS = \
@@ -376,7 +375,7 @@ clean: clean-subdir
distclean: distclean-subdir
$(MAKE) SUBDIRS="" clean
@$(MULTICLEAN) multi-clean DO=distclean
- -rm -f *~ Makefile config.status xhost-mkfrag TAGS multilib.out
+ -rm -f *~ Makefile config.cache config.status xhost-mkfrag TAGS multilib.out
-rm -f config.log
-rmdir testsuite 2>/dev/null
maintainer-clean realclean: maintainer-clean-subdir
@@ -390,8 +389,8 @@ Makefile: $(srcdir)/Makefile.in config.status
# Depending on Makefile makes sure that config.status has been re-run
# if needed. This prevents problems with parallel builds.
config.h: stamp-h ; @true
-stamp-h: config.in config.status Makefile
- CONFIG_FILES= CONFIG_HEADERS=config.h:config.in $(SHELL) ./config.status
+stamp-h: $(srcdir)/config.in config.status Makefile
+ CONFIG_FILES= CONFIG_HEADERS=config.h:$(srcdir)/config.in $(SHELL) ./config.status
config.status: $(srcdir)/configure $(srcdir)/config.table
$(SHELL) ./config.status --recheck
@@ -415,113 +414,643 @@ $(CONFIGURED_OFILES): stamp-picdir
# The dependencies in the remainder of this file are automatically
# generated by "make maint-deps". Manual edits will be lost.
-_doprnt.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h
-alloca.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
-argv.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
-asprintf.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
-atexit.o: config.h
-basename.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
+./_doprnt.o: $(srcdir)/_doprnt.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/safe-ctype.h
-bsearch.o: config.h $(INCDIR)/ansidecl.h
-calloc.o: $(INCDIR)/ansidecl.h
-choose-temp.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
-clock.o: config.h
-concat.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
-copysign.o: $(INCDIR)/ansidecl.h
-cp-demangle.o: config.h $(INCDIR)/ansidecl.h $(srcdir)/cp-demangle.h \
- $(INCDIR)/demangle.h $(INCDIR)/dyn-string.h $(INCDIR)/getopt.h \
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/_doprnt.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/_doprnt.c $(OUTPUT_OPTION)
+
+./alloca.o: $(srcdir)/alloca.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h
-cp-demint.o: config.h $(INCDIR)/ansidecl.h $(srcdir)/cp-demangle.h \
- $(INCDIR)/demangle.h $(INCDIR)/libiberty.h
-cplus-dem.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/demangle.h \
- $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h
-dyn-string.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/dyn-string.h \
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/alloca.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/alloca.c $(OUTPUT_OPTION)
+
+./argv.o: $(srcdir)/argv.c $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/argv.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/argv.c $(OUTPUT_OPTION)
+
+./asprintf.o: $(srcdir)/asprintf.c $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/asprintf.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/asprintf.c $(OUTPUT_OPTION)
+
+./atexit.o: $(srcdir)/atexit.c config.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/atexit.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/atexit.c $(OUTPUT_OPTION)
+
+./basename.o: $(srcdir)/basename.c $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
+ $(INCDIR)/safe-ctype.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/basename.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/basename.c $(OUTPUT_OPTION)
+
+./bcmp.o: $(srcdir)/bcmp.c
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/bcmp.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/bcmp.c $(OUTPUT_OPTION)
+
+./bcopy.o: $(srcdir)/bcopy.c
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/bcopy.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/bcopy.c $(OUTPUT_OPTION)
+
+./bsearch.o: $(srcdir)/bsearch.c config.h $(INCDIR)/ansidecl.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/bsearch.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/bsearch.c $(OUTPUT_OPTION)
+
+./bzero.o: $(srcdir)/bzero.c
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/bzero.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/bzero.c $(OUTPUT_OPTION)
+
+./calloc.o: $(srcdir)/calloc.c $(INCDIR)/ansidecl.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/calloc.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/calloc.c $(OUTPUT_OPTION)
+
+./choose-temp.o: $(srcdir)/choose-temp.c config.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/libiberty.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/choose-temp.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/choose-temp.c $(OUTPUT_OPTION)
+
+./clock.o: $(srcdir)/clock.c config.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/clock.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/clock.c $(OUTPUT_OPTION)
+
+./concat.o: $(srcdir)/concat.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h
-fdmatch.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
-fibheap.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/fibheap.h \
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/concat.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/concat.c $(OUTPUT_OPTION)
+
+./copysign.o: $(srcdir)/copysign.c $(INCDIR)/ansidecl.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/copysign.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/copysign.c $(OUTPUT_OPTION)
+
+./cp-demangle.o: $(srcdir)/cp-demangle.c config.h $(INCDIR)/ansidecl.h \
+ $(srcdir)/cp-demangle.h $(INCDIR)/demangle.h \
+ $(INCDIR)/dyn-string.h $(INCDIR)/getopt.h $(INCDIR)/libiberty.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/cp-demangle.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/cp-demangle.c $(OUTPUT_OPTION)
+
+./cp-demint.o: $(srcdir)/cp-demint.c config.h $(INCDIR)/ansidecl.h \
+ $(srcdir)/cp-demangle.h $(INCDIR)/demangle.h \
$(INCDIR)/libiberty.h
-floatformat.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/floatformat.h \
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/cp-demint.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/cp-demint.c $(OUTPUT_OPTION)
+
+./cplus-dem.o: $(srcdir)/cplus-dem.c config.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/demangle.h $(INCDIR)/libiberty.h \
+ $(INCDIR)/safe-ctype.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/cplus-dem.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/cplus-dem.c $(OUTPUT_OPTION)
+
+./dyn-string.o: $(srcdir)/dyn-string.c config.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/dyn-string.h $(INCDIR)/libiberty.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/dyn-string.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/dyn-string.c $(OUTPUT_OPTION)
+
+./fdmatch.o: $(srcdir)/fdmatch.c $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/fdmatch.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/fdmatch.c $(OUTPUT_OPTION)
+
+./ffs.o: $(srcdir)/ffs.c
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/ffs.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/ffs.c $(OUTPUT_OPTION)
+
+./fibheap.o: $(srcdir)/fibheap.c config.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/fibheap.h $(INCDIR)/libiberty.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/fibheap.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/fibheap.c $(OUTPUT_OPTION)
+
+./floatformat.o: $(srcdir)/floatformat.c config.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/floatformat.h $(INCDIR)/libiberty.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/floatformat.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/floatformat.c $(OUTPUT_OPTION)
+
+./fnmatch.o: $(srcdir)/fnmatch.c config.h $(INCDIR)/fnmatch.h \
+ $(INCDIR)/safe-ctype.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/fnmatch.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/fnmatch.c $(OUTPUT_OPTION)
+
+./getcwd.o: $(srcdir)/getcwd.c config.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/getcwd.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/getcwd.c $(OUTPUT_OPTION)
+
+./getopt.o: $(srcdir)/getopt.c config.h $(INCDIR)/getopt.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/getopt.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/getopt.c $(OUTPUT_OPTION)
+
+./getopt1.o: $(srcdir)/getopt1.c config.h $(INCDIR)/getopt.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/getopt1.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/getopt1.c $(OUTPUT_OPTION)
+
+./getpagesize.o: $(srcdir)/getpagesize.c config.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/getpagesize.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/getpagesize.c $(OUTPUT_OPTION)
+
+./getpwd.o: $(srcdir)/getpwd.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h
-fnmatch.o: config.h $(INCDIR)/fnmatch.h $(INCDIR)/safe-ctype.h
-getcwd.o: config.h
-getopt.o: config.h $(INCDIR)/getopt.h
-getopt1.o: config.h $(INCDIR)/getopt.h
-getpagesize.o: config.h
-getpwd.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
-getruntime.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
-hashtab.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/hashtab.h \
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/getpwd.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/getpwd.c $(OUTPUT_OPTION)
+
+./getruntime.o: $(srcdir)/getruntime.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h
-hex.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/getruntime.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/getruntime.c $(OUTPUT_OPTION)
+
+./hashtab.o: $(srcdir)/hashtab.c config.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/hashtab.h $(INCDIR)/libiberty.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/hashtab.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/hashtab.c $(OUTPUT_OPTION)
+
+./hex.o: $(srcdir)/hex.c $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
$(INCDIR)/safe-ctype.h
-lbasename.o: $(INCDIR)/ansidecl.h $(INCDIR)/filenames.h \
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/hex.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/hex.c $(OUTPUT_OPTION)
+
+./index.o: $(srcdir)/index.c
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/index.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/index.c $(OUTPUT_OPTION)
+
+./insque.o: $(srcdir)/insque.c
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/insque.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/insque.c $(OUTPUT_OPTION)
+
+./lbasename.o: $(srcdir)/lbasename.c $(INCDIR)/ansidecl.h $(INCDIR)/filenames.h \
$(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h
-lrealpath.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
-make-relative-prefix.o: config.h $(INCDIR)/ansidecl.h \
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/lbasename.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/lbasename.c $(OUTPUT_OPTION)
+
+./lrealpath.o: $(srcdir)/lrealpath.c config.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/libiberty.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/lrealpath.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/lrealpath.c $(OUTPUT_OPTION)
+
+./make-relative-prefix.o: $(srcdir)/make-relative-prefix.c config.h \
+ $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/make-relative-prefix.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/make-relative-prefix.c $(OUTPUT_OPTION)
+
+./make-temp-file.o: $(srcdir)/make-temp-file.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h
-make-temp-file.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
-md5.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/md5.h
-memchr.o: $(INCDIR)/ansidecl.h
-memcmp.o: $(INCDIR)/ansidecl.h
-memcpy.o: $(INCDIR)/ansidecl.h
-memmove.o: $(INCDIR)/ansidecl.h
-mempcpy.o: $(INCDIR)/ansidecl.h
-memset.o: $(INCDIR)/ansidecl.h
-mkstemps.o: config.h $(INCDIR)/ansidecl.h
-objalloc.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/objalloc.h
-obstack.o: config.h $(INCDIR)/obstack.h
-partition.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
- $(INCDIR)/partition.h
-pex-djgpp.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
- $(srcdir)/pex-common.h
-pex-mpw.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
- $(srcdir)/pex-common.h
-pex-msdos.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
- $(srcdir)/pex-common.h $(INCDIR)/safe-ctype.h
-pex-os2.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
- $(srcdir)/pex-common.h
-pex-unix.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
- $(srcdir)/pex-common.h
-pex-win32.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
- $(srcdir)/pex-common.h
-physmem.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
-putenv.o: config.h $(INCDIR)/ansidecl.h
-random.o: $(INCDIR)/ansidecl.h
-regex.o: config.h $(INCDIR)/xregex.h $(INCDIR)/xregex2.h
-rename.o: config.h $(INCDIR)/ansidecl.h
-safe-ctype.o: $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h
-setenv.o: config.h $(INCDIR)/ansidecl.h
-sigsetmask.o: $(INCDIR)/ansidecl.h
-snprintf.o: $(INCDIR)/ansidecl.h
-sort.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/make-temp-file.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/make-temp-file.c $(OUTPUT_OPTION)
+
+./md5.o: $(srcdir)/md5.c config.h $(INCDIR)/ansidecl.h $(INCDIR)/md5.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/md5.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/md5.c $(OUTPUT_OPTION)
+
+./memchr.o: $(srcdir)/memchr.c $(INCDIR)/ansidecl.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/memchr.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/memchr.c $(OUTPUT_OPTION)
+
+./memcmp.o: $(srcdir)/memcmp.c $(INCDIR)/ansidecl.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/memcmp.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/memcmp.c $(OUTPUT_OPTION)
+
+./memcpy.o: $(srcdir)/memcpy.c $(INCDIR)/ansidecl.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/memcpy.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/memcpy.c $(OUTPUT_OPTION)
+
+./memmove.o: $(srcdir)/memmove.c $(INCDIR)/ansidecl.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/memmove.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/memmove.c $(OUTPUT_OPTION)
+
+./mempcpy.o: $(srcdir)/mempcpy.c $(INCDIR)/ansidecl.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/mempcpy.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/mempcpy.c $(OUTPUT_OPTION)
+
+./memset.o: $(srcdir)/memset.c $(INCDIR)/ansidecl.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/memset.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/memset.c $(OUTPUT_OPTION)
+
+./mkstemps.o: $(srcdir)/mkstemps.c config.h $(INCDIR)/ansidecl.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/mkstemps.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/mkstemps.c $(OUTPUT_OPTION)
+
+./mpw.o: $(srcdir)/mpw.c
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/mpw.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/mpw.c $(OUTPUT_OPTION)
+
+./msdos.o: $(srcdir)/msdos.c
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/msdos.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/msdos.c $(OUTPUT_OPTION)
+
+./objalloc.o: $(srcdir)/objalloc.c config.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/objalloc.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/objalloc.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/objalloc.c $(OUTPUT_OPTION)
+
+./obstack.o: $(srcdir)/obstack.c config.h $(INCDIR)/obstack.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/obstack.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/obstack.c $(OUTPUT_OPTION)
+
+./partition.o: $(srcdir)/partition.c config.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/libiberty.h $(INCDIR)/partition.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/partition.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/partition.c $(OUTPUT_OPTION)
+
+./pex-djgpp.o: $(srcdir)/pex-djgpp.c config.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/libiberty.h $(srcdir)/pex-common.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/pex-djgpp.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/pex-djgpp.c $(OUTPUT_OPTION)
+
+./pex-mpw.o: $(srcdir)/pex-mpw.c config.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/libiberty.h $(srcdir)/pex-common.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/pex-mpw.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/pex-mpw.c $(OUTPUT_OPTION)
+
+./pex-msdos.o: $(srcdir)/pex-msdos.c config.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/libiberty.h $(srcdir)/pex-common.h \
+ $(INCDIR)/safe-ctype.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/pex-msdos.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/pex-msdos.c $(OUTPUT_OPTION)
+
+./pex-os2.o: $(srcdir)/pex-os2.c config.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/libiberty.h $(srcdir)/pex-common.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/pex-os2.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/pex-os2.c $(OUTPUT_OPTION)
+
+./pex-unix.o: $(srcdir)/pex-unix.c config.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/libiberty.h $(srcdir)/pex-common.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/pex-unix.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/pex-unix.c $(OUTPUT_OPTION)
+
+./pex-win32.o: $(srcdir)/pex-win32.c config.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/libiberty.h $(srcdir)/pex-common.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/pex-win32.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/pex-win32.c $(OUTPUT_OPTION)
+
+./physmem.o: $(srcdir)/physmem.c config.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/libiberty.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/physmem.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/physmem.c $(OUTPUT_OPTION)
+
+./putenv.o: $(srcdir)/putenv.c config.h $(INCDIR)/ansidecl.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/putenv.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/putenv.c $(OUTPUT_OPTION)
+
+./random.o: $(srcdir)/random.c $(INCDIR)/ansidecl.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/random.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/random.c $(OUTPUT_OPTION)
+
+./regex.o: $(srcdir)/regex.c config.h $(INCDIR)/xregex.h $(INCDIR)/xregex2.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/regex.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/regex.c $(OUTPUT_OPTION)
+
+./rename.o: $(srcdir)/rename.c config.h $(INCDIR)/ansidecl.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/rename.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/rename.c $(OUTPUT_OPTION)
+
+./rindex.o: $(srcdir)/rindex.c
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/rindex.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/rindex.c $(OUTPUT_OPTION)
+
+./safe-ctype.o: $(srcdir)/safe-ctype.c $(INCDIR)/ansidecl.h \
+ $(INCDIR)/safe-ctype.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/safe-ctype.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/safe-ctype.c $(OUTPUT_OPTION)
+
+./setenv.o: $(srcdir)/setenv.c config.h $(INCDIR)/ansidecl.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/setenv.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/setenv.c $(OUTPUT_OPTION)
+
+./sigsetmask.o: $(srcdir)/sigsetmask.c $(INCDIR)/ansidecl.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/sigsetmask.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/sigsetmask.c $(OUTPUT_OPTION)
+
+./snprintf.o: $(srcdir)/snprintf.c $(INCDIR)/ansidecl.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/snprintf.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/snprintf.c $(OUTPUT_OPTION)
+
+./sort.o: $(srcdir)/sort.c config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
$(INCDIR)/sort.h
-spaces.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
-splay-tree.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
- $(INCDIR)/splay-tree.h
-stpcpy.o: $(INCDIR)/ansidecl.h
-stpncpy.o: $(INCDIR)/ansidecl.h
-strcasecmp.o: $(INCDIR)/ansidecl.h
-strchr.o: $(INCDIR)/ansidecl.h
-strdup.o: $(INCDIR)/ansidecl.h
-strerror.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
-strncasecmp.o: $(INCDIR)/ansidecl.h
-strncmp.o: $(INCDIR)/ansidecl.h
-strrchr.o: $(INCDIR)/ansidecl.h
-strsignal.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
-strtod.o: $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h
-strtol.o: config.h $(INCDIR)/safe-ctype.h
-strtoul.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h
-ternary.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ternary.h
-vasprintf.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
-vfork.o: $(INCDIR)/ansidecl.h
-vfprintf.o: $(INCDIR)/ansidecl.h
-vprintf.o: $(INCDIR)/ansidecl.h
-vsnprintf.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
-vsprintf.o: $(INCDIR)/ansidecl.h
-waitpid.o: config.h
-xatexit.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
-xexit.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
-xmalloc.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
-xmemdup.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
-xstrdup.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
-xstrerror.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/sort.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/sort.c $(OUTPUT_OPTION)
+
+./spaces.o: $(srcdir)/spaces.c $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/spaces.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/spaces.c $(OUTPUT_OPTION)
+
+./splay-tree.o: $(srcdir)/splay-tree.c config.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/libiberty.h $(INCDIR)/splay-tree.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/splay-tree.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/splay-tree.c $(OUTPUT_OPTION)
+
+./stpcpy.o: $(srcdir)/stpcpy.c $(INCDIR)/ansidecl.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/stpcpy.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/stpcpy.c $(OUTPUT_OPTION)
+
+./stpncpy.o: $(srcdir)/stpncpy.c $(INCDIR)/ansidecl.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/stpncpy.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/stpncpy.c $(OUTPUT_OPTION)
+
+./strcasecmp.o: $(srcdir)/strcasecmp.c $(INCDIR)/ansidecl.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/strcasecmp.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/strcasecmp.c $(OUTPUT_OPTION)
+
+./strchr.o: $(srcdir)/strchr.c $(INCDIR)/ansidecl.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/strchr.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/strchr.c $(OUTPUT_OPTION)
+
+./strdup.o: $(srcdir)/strdup.c $(INCDIR)/ansidecl.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/strdup.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/strdup.c $(OUTPUT_OPTION)
+
+./strerror.o: $(srcdir)/strerror.c config.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/libiberty.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/strerror.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/strerror.c $(OUTPUT_OPTION)
+
+./strncasecmp.o: $(srcdir)/strncasecmp.c $(INCDIR)/ansidecl.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/strncasecmp.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/strncasecmp.c $(OUTPUT_OPTION)
+
+./strncmp.o: $(srcdir)/strncmp.c $(INCDIR)/ansidecl.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/strncmp.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/strncmp.c $(OUTPUT_OPTION)
+
+./strrchr.o: $(srcdir)/strrchr.c $(INCDIR)/ansidecl.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/strrchr.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/strrchr.c $(OUTPUT_OPTION)
+
+./strsignal.o: $(srcdir)/strsignal.c config.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/libiberty.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/strsignal.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/strsignal.c $(OUTPUT_OPTION)
+
+./strstr.o: $(srcdir)/strstr.c
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/strstr.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/strstr.c $(OUTPUT_OPTION)
+
+./strtod.o: $(srcdir)/strtod.c $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/strtod.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/strtod.c $(OUTPUT_OPTION)
+
+./strtol.o: $(srcdir)/strtol.c config.h $(INCDIR)/safe-ctype.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/strtol.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/strtol.c $(OUTPUT_OPTION)
+
+./strtoul.o: $(srcdir)/strtoul.c config.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/safe-ctype.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/strtoul.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/strtoul.c $(OUTPUT_OPTION)
+
+./ternary.o: $(srcdir)/ternary.c config.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/libiberty.h $(INCDIR)/ternary.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/ternary.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/ternary.c $(OUTPUT_OPTION)
+
+./tmpnam.o: $(srcdir)/tmpnam.c
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/tmpnam.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/tmpnam.c $(OUTPUT_OPTION)
+
+./vasprintf.o: $(srcdir)/vasprintf.c config.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/libiberty.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/vasprintf.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/vasprintf.c $(OUTPUT_OPTION)
+
+./vfork.o: $(srcdir)/vfork.c $(INCDIR)/ansidecl.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/vfork.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/vfork.c $(OUTPUT_OPTION)
+
+./vfprintf.o: $(srcdir)/vfprintf.c $(INCDIR)/ansidecl.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/vfprintf.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/vfprintf.c $(OUTPUT_OPTION)
+
+./vprintf.o: $(srcdir)/vprintf.c $(INCDIR)/ansidecl.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/vprintf.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/vprintf.c $(OUTPUT_OPTION)
+
+./vsnprintf.o: $(srcdir)/vsnprintf.c config.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/libiberty.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/vsnprintf.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/vsnprintf.c $(OUTPUT_OPTION)
+
+./vsprintf.o: $(srcdir)/vsprintf.c $(INCDIR)/ansidecl.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/vsprintf.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/vsprintf.c $(OUTPUT_OPTION)
+
+./waitpid.o: $(srcdir)/waitpid.c config.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/waitpid.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/waitpid.c $(OUTPUT_OPTION)
+
+./xatexit.o: $(srcdir)/xatexit.c $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/xatexit.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/xatexit.c $(OUTPUT_OPTION)
+
+./xexit.o: $(srcdir)/xexit.c config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/xexit.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/xexit.c $(OUTPUT_OPTION)
+
+./xmalloc.o: $(srcdir)/xmalloc.c config.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/libiberty.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/xmalloc.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/xmalloc.c $(OUTPUT_OPTION)
+
+./xmemdup.o: $(srcdir)/xmemdup.c config.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/libiberty.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/xmemdup.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/xmemdup.c $(OUTPUT_OPTION)
+
+./xstrdup.o: $(srcdir)/xstrdup.c config.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/libiberty.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/xstrdup.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/xstrdup.c $(OUTPUT_OPTION)
+
+./xstrerror.o: $(srcdir)/xstrerror.c config.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/libiberty.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/xstrerror.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/xstrerror.c $(OUTPUT_OPTION)
+
diff --git a/libiberty/configure b/libiberty/configure
index 71f14e8..2f65976 100755
--- a/libiberty/configure
+++ b/libiberty/configure
@@ -5679,11 +5679,11 @@ fi
# Figure out which version of pexecute to use.
case "${host}" in
- *-*-mingw* | *-*-winnt*) pexecute=pex-win32.o ;;
- *-*-msdosdjgpp*) pexecute=pex-djgpp.o ;;
- *-*-msdos*) pexecute=pex-msdos.o ;;
- *-*-os2-emx*) pexecute=pex-os2.o ;;
- *) pexecute=pex-unix.o ;;
+ *-*-mingw* | *-*-winnt*) pexecute=./pex-win32.o ;;
+ *-*-msdosdjgpp*) pexecute=./pex-djgpp.o ;;
+ *-*-msdos*) pexecute=./pex-msdos.o ;;
+ *-*-os2-emx*) pexecute=./pex-os2.o ;;
+ *) pexecute=./pex-unix.o ;;
esac
@@ -6134,6 +6134,16 @@ else
fi
+
+L=""
+for l in x $LIBOBJS; do
+ case $l in
+ x) ;;
+ *) L="$L ./$l" ;;
+ esac
+done
+LIBOBJS="$L"
+
# We need multilib support, but only if configuring for the target.
ac_config_files="$ac_config_files Makefile testsuite/Makefile"
ac_config_commands="$ac_config_commands default"
diff --git a/libiberty/configure.ac b/libiberty/configure.ac
index eb8a99d..e8907e7 100644
--- a/libiberty/configure.ac
+++ b/libiberty/configure.ac
@@ -477,11 +477,11 @@ fi
# Figure out which version of pexecute to use.
case "${host}" in
- *-*-mingw* | *-*-winnt*) pexecute=pex-win32.o ;;
- *-*-msdosdjgpp*) pexecute=pex-djgpp.o ;;
- *-*-msdos*) pexecute=pex-msdos.o ;;
- *-*-os2-emx*) pexecute=pex-os2.o ;;
- *) pexecute=pex-unix.o ;;
+ *-*-mingw* | *-*-winnt*) pexecute=./pex-win32.o ;;
+ *-*-msdosdjgpp*) pexecute=./pex-djgpp.o ;;
+ *-*-msdos*) pexecute=./pex-msdos.o ;;
+ *-*-os2-emx*) pexecute=./pex-os2.o ;;
+ *) pexecute=./pex-unix.o ;;
esac
AC_SUBST(pexecute)
@@ -496,6 +496,16 @@ else
fi
AC_SUBST(INSTALL_DEST)
+m4_pattern_allow(LIBOBJS)
+L=""
+for l in x $LIBOBJS; do
+ case $l in
+ x) ;;
+ *) L="$L ./$l" ;;
+ esac
+done
+LIBOBJS="$L"
+
# We need multilib support, but only if configuring for the target.
AC_OUTPUT(Makefile testsuite/Makefile,
[test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c
index 1c43eb8..19f191e 100644
--- a/libiberty/cp-demangle.c
+++ b/libiberty/cp-demangle.c
@@ -751,6 +751,7 @@ d_make_comp (di, type, left, right)
case DEMANGLE_COMPONENT_LOCAL_NAME:
case DEMANGLE_COMPONENT_TYPED_NAME:
case DEMANGLE_COMPONENT_TEMPLATE:
+ case DEMANGLE_COMPONENT_CONSTRUCTION_VTABLE:
case DEMANGLE_COMPONENT_VENDOR_TYPE_QUAL:
case DEMANGLE_COMPONENT_PTRMEM_TYPE:
case DEMANGLE_COMPONENT_UNARY:
@@ -768,7 +769,6 @@ d_make_comp (di, type, left, right)
/* These types only require one parameter. */
case DEMANGLE_COMPONENT_VTABLE:
case DEMANGLE_COMPONENT_VTT:
- case DEMANGLE_COMPONENT_CONSTRUCTION_VTABLE:
case DEMANGLE_COMPONENT_TYPEINFO:
case DEMANGLE_COMPONENT_TYPEINFO_NAME:
case DEMANGLE_COMPONENT_TYPEINFO_FN:
diff --git a/libiberty/cp-demint.c b/libiberty/cp-demint.c
index 833e89e..533202d 100644
--- a/libiberty/cp-demint.c
+++ b/libiberty/cp-demint.c
@@ -70,6 +70,7 @@ cplus_demangle_fill_component (p, type, left, right)
case DEMANGLE_COMPONENT_LOCAL_NAME:
case DEMANGLE_COMPONENT_TYPED_NAME:
case DEMANGLE_COMPONENT_TEMPLATE:
+ case DEMANGLE_COMPONENT_CONSTRUCTION_VTABLE:
case DEMANGLE_COMPONENT_VENDOR_TYPE_QUAL:
case DEMANGLE_COMPONENT_FUNCTION_TYPE:
case DEMANGLE_COMPONENT_ARRAY_TYPE:
@@ -89,7 +90,6 @@ cplus_demangle_fill_component (p, type, left, right)
/* These component types only have one subtree. */
case DEMANGLE_COMPONENT_VTABLE:
case DEMANGLE_COMPONENT_VTT:
- case DEMANGLE_COMPONENT_CONSTRUCTION_VTABLE:
case DEMANGLE_COMPONENT_TYPEINFO:
case DEMANGLE_COMPONENT_TYPEINFO_NAME:
case DEMANGLE_COMPONENT_TYPEINFO_FN:
diff --git a/libiberty/getpwd.c b/libiberty/getpwd.c
index f508b1e..31c7d20 100644
--- a/libiberty/getpwd.c
+++ b/libiberty/getpwd.c
@@ -35,6 +35,9 @@ extern int errno;
#if HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
+#if HAVE_LIMITS_H
+#include <limits.h>
+#endif
/* Prototype these in case the system headers don't provide them. */
extern char *getpwd ();
diff --git a/libiberty/maint-tool b/libiberty/maint-tool
index 6b9bf7f..bfc5304 100644
--- a/libiberty/maint-tool
+++ b/libiberty/maint-tool
@@ -213,6 +213,12 @@ sub locals_first {
sub deps {
+ $crule = "\tif [ x\"\$(PICFLAG)\" != x ]; then \\\n";
+ $crule .= "\t \$(COMPILE.c) \$(PICFLAG) \$< -o pic/\$@; \\\n";
+ $crule .= "\telse true; fi\n";
+ $crule .= "\t\$(COMPILE.c) \$< \$(OUTPUT_OPTION)\n";
+ $crule .= "\n";
+
$incdir = shift @ARGV;
opendir(INC, $incdir);
@@ -260,10 +266,10 @@ sub deps {
@deps = sort { &locals_first($a,$b) } keys %scanned;
$obj = $f;
$obj =~ s/\.c$/.o/;
- $obj = "$obj:";
+ $obj = "./$obj:";
if ($#deps >= 0) {
- print OUT $obj;
- $len = length($obj);
+ print OUT "$obj \$(srcdir)/$f";
+ $len = length("$obj $f");
for $dt (@deps) {
$d = $mine{$dt};
if ($len + length($d) > 70) {
@@ -275,7 +281,12 @@ sub deps {
}
}
print OUT "\n";
+ } else {
+ print OUT "$obj \$(srcdir)/$f\n";
}
+ $c = $crule;
+ $c =~ s@\$\<@\$\(srcdir\)\/$f@g;
+ print OUT $c;
}
}
closedir(S);
diff --git a/libiberty/strdup.c b/libiberty/strdup.c
index 071a4a4..a3f17d3 100644
--- a/libiberty/strdup.c
+++ b/libiberty/strdup.c
@@ -22,7 +22,7 @@ extern PTR memcpy PARAMS ((PTR, const PTR, size_t));
char *
strdup(s)
- char *s;
+ const char *s;
{
size_t len = strlen (s) + 1;
char *result = (char*) malloc (len);
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index df95ada..c8a2ded 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,36 @@
+2004-01-27 Michael Snyder <msnyder@redhat.com>
+
+ * sh-opc.h (sh_table): "fsrra", not "fssra".
+
+2004-01-23 Andrew Over <andrew.over@cs.anu.edu.au>
+
+ * sparc-opc.c (fdtox, fstox, fqtox, fxtod, fxtos, fxtoq): Tighten
+ contraints.
+
+2004-01-19 Andrew Over <andrew.over@cs.anu.edu.au>
+
+ * sparc-opc.c (sparc_opcodes) <f[dsq]tox, fxto[dsq]>: Fix args.
+
+2004-01-19 Alan Modra <amodra@bigpond.net.au>
+
+ * i386-dis.c (OP_E): Print scale factor on intel mode sib when not
+ 1. Don't print scale factor on AT&T mode when index missing.
+
+2004-01-16 Alexandre Oliva <aoliva@redhat.com>
+
+ * m10300-opc.c (mov): 8- and 24-bit immediates are zero-extended
+ when loaded into XR registers.
+
+2004-01-14 Richard Sandiford <rsandifo@redhat.com>
+
+ * frv-desc.h: Regenerate.
+ * frv-desc.c: Regenerate.
+ * frv-opc.c: Regenerate.
+
+2004-01-13 Michael Snyder <msnyder@redhat.com>
+
+ * sh-dis.c (print_insn_sh): Allocate 4 bytes for insn.
+
2004-01-09 Paul Brook <paul@codesourcery.com>
* arm-opc.h (arm_opcodes): Move generic mcrr after known
diff --git a/opcodes/frv-desc.c b/opcodes/frv-desc.c
index 9cc85fe..35659c7 100644
--- a/opcodes/frv-desc.c
+++ b/opcodes/frv-desc.c
@@ -84,6 +84,7 @@ static const CGEN_ATTR_ENTRY UNIT_attr[] =
{ "B01", UNIT_B01 },
{ "C", UNIT_C },
{ "MULT_DIV", UNIT_MULT_DIV },
+ { "IACC", UNIT_IACC },
{ "LOAD", UNIT_LOAD },
{ "STORE", UNIT_STORE },
{ "SCAN", UNIT_SCAN },
@@ -2397,17 +2398,17 @@ static const CGEN_IBASE frv_cgen_insn_table[MAX_INSNS] =
/* smu$pack $GRi,$GRj */
{
FRV_INSN_SMU, "smu", "smu", 32,
- { 0, { (1<<MACH_FR400), UNIT_MULT_DIV, FR400_MAJOR_I_1, FR500_MAJOR_NONE, FR550_MAJOR_NONE } }
+ { 0, { (1<<MACH_FR400), UNIT_IACC, FR400_MAJOR_I_1, FR500_MAJOR_NONE, FR550_MAJOR_NONE } }
},
/* smass$pack $GRi,$GRj */
{
FRV_INSN_SMASS, "smass", "smass", 32,
- { 0, { (1<<MACH_FR400), UNIT_MULT_DIV, FR400_MAJOR_I_1, FR500_MAJOR_NONE, FR550_MAJOR_NONE } }
+ { 0, { (1<<MACH_FR400), UNIT_IACC, FR400_MAJOR_I_1, FR500_MAJOR_NONE, FR550_MAJOR_NONE } }
},
/* smsss$pack $GRi,$GRj */
{
FRV_INSN_SMSSS, "smsss", "smsss", 32,
- { 0, { (1<<MACH_FR400), UNIT_MULT_DIV, FR400_MAJOR_I_1, FR500_MAJOR_NONE, FR550_MAJOR_NONE } }
+ { 0, { (1<<MACH_FR400), UNIT_IACC, FR400_MAJOR_I_1, FR500_MAJOR_NONE, FR550_MAJOR_NONE } }
},
/* sll$pack $GRi,$GRj,$GRk */
{
diff --git a/opcodes/frv-desc.h b/opcodes/frv-desc.h
index 5f72800..f46c3f9 100644
--- a/opcodes/frv-desc.h
+++ b/opcodes/frv-desc.h
@@ -549,9 +549,9 @@ typedef enum unit_attr {
, UNIT_I2, UNIT_I3, UNIT_IALL, UNIT_FM0
, UNIT_FM1, UNIT_FM01, UNIT_FM2, UNIT_FM3
, UNIT_FMALL, UNIT_FMLOW, UNIT_B0, UNIT_B1
- , UNIT_B01, UNIT_C, UNIT_MULT_DIV, UNIT_LOAD
- , UNIT_STORE, UNIT_SCAN, UNIT_DCPL, UNIT_MDUALACC
- , UNIT_MCLRACC_1, UNIT_NUM_UNITS
+ , UNIT_B01, UNIT_C, UNIT_MULT_DIV, UNIT_IACC
+ , UNIT_LOAD, UNIT_STORE, UNIT_SCAN, UNIT_DCPL
+ , UNIT_MDUALACC, UNIT_MCLRACC_1, UNIT_NUM_UNITS
} UNIT_ATTR;
/* Enum declaration for fr400 major insn categories. */
diff --git a/opcodes/frv-opc.c b/opcodes/frv-opc.c
index 61bdb45..1560d20 100644
--- a/opcodes/frv-opc.c
+++ b/opcodes/frv-opc.c
@@ -239,6 +239,7 @@ static CGEN_ATTR_VALUE_TYPE fr400_unit_mapping[] =
/* B01 */ UNIT_B0,
/* C */ UNIT_C,
/* MULT-DIV */ UNIT_I0, /* multiply and divide only in I0 unit. */
+/* IACC */ UNIT_I01, /* iacc multiply in I0 or I1 unit. */
/* LOAD */ UNIT_I0, /* load only in I0 unit. */
/* STORE */ UNIT_I0, /* store only in I0 unit. */
/* SCAN */ UNIT_I0, /* scan only in I0 unit. */
@@ -269,6 +270,7 @@ static CGEN_ATTR_VALUE_TYPE fr500_unit_mapping[] =
/* B01 */ UNIT_B01,
/* C */ UNIT_C,
/* MULT-DIV */ UNIT_I01, /* multiply and divide in I0 or I1 unit. */
+/* IACC */ UNIT_NIL, /* iacc multiply not implemented */
/* LOAD */ UNIT_I01, /* load in I0 or I1 unit. */
/* STORE */ UNIT_I0, /* store only in I0 unit. */
/* SCAN */ UNIT_I01, /* scan in I0 or I1 unit. */
@@ -299,6 +301,7 @@ static CGEN_ATTR_VALUE_TYPE fr550_unit_mapping[] =
/* B01 */ UNIT_B01,
/* C */ UNIT_C,
/* MULT-DIV */ UNIT_I01, /* multiply and divide in I0 or I1 unit. */
+/* IACC */ UNIT_NIL, /* iacc multiply not implemented. */
/* LOAD */ UNIT_I01, /* load in I0 or I1 unit. */
/* STORE */ UNIT_I01, /* store in I0 or I1 unit. */
/* SCAN */ UNIT_IALL, /* scan in any integer unit. */
diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c
index 0ef57ef..f9a0a9b 100644
--- a/opcodes/i386-dis.c
+++ b/opcodes/i386-dis.c
@@ -3173,11 +3173,7 @@ OP_E (int bytemode, int sizeflag)
? names64[index] : names32[index]);
oappend (scratchbuf);
}
- if (!intel_syntax
- || (intel_syntax
- && bytemode != b_mode
- && bytemode != w_mode
- && bytemode != v_mode))
+ if (scale != 0 || (!intel_syntax && index != 4))
{
*obufp++ = scale_char;
*obufp = '\0';
diff --git a/opcodes/m10300-opc.c b/opcodes/m10300-opc.c
index d1a2ea2..4082b29 100644
--- a/opcodes/m10300-opc.c
+++ b/opcodes/m10300-opc.c
@@ -1,5 +1,5 @@
/* Assemble Matsushita MN10300 instructions.
- Copyright 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+ Copyright 1996, 1997, 1998, 1999, 2000, 2004 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
@@ -561,8 +561,8 @@ const struct mn10300_opcode mn10300_opcodes[] = {
{ "mov", 0xfb080000, 0xffff0000, 0, FMT_D7, AM33, {SIMM8, RN02}},
{ "mov", 0xfd080000, 0xffff0000, 0, FMT_D8, AM33, {SIMM24, RN02}},
{ "mov", 0xfe080000, 0xffff0000, 0, FMT_D9, AM33, {IMM32_HIGH8, RN02}},
-{ "mov", 0xfbf80000, 0xffff0000, 0, FMT_D7, AM33, {SIMM8, XRN02}},
-{ "mov", 0xfdf80000, 0xffff0000, 0, FMT_D8, AM33, {SIMM24, XRN02}},
+{ "mov", 0xfbf80000, 0xffff0000, 0, FMT_D7, AM33, {IMM8, XRN02}},
+{ "mov", 0xfdf80000, 0xffff0000, 0, FMT_D8, AM33, {IMM24, XRN02}},
{ "mov", 0xfef80000, 0xffff0000, 0, FMT_D9, AM33, {IMM32_HIGH8, XRN02}},
{ "mov", 0xfe0e0000, 0xffff0f00, 0, FMT_D9, AM33, {MEM(IMM32_HIGH8_MEM), RN2}},
{ "mov", 0xfe1e0000, 0xffff0f00, 0, FMT_D9, AM33, {RM2, MEM(IMM32_HIGH8_MEM)}},
diff --git a/opcodes/sh-dis.c b/opcodes/sh-dis.c
index c0e1a2e..70fdffb 100644
--- a/opcodes/sh-dis.c
+++ b/opcodes/sh-dis.c
@@ -397,7 +397,7 @@ print_insn_sh (memaddr, info)
{
fprintf_ftype fprintf_fn = info->fprintf_func;
void *stream = info->stream;
- unsigned char insn[2];
+ unsigned char insn[4];
unsigned char nibs[4];
int status;
bfd_vma relmask = ~(bfd_vma) 0;
diff --git a/opcodes/sh-opc.h b/opcodes/sh-opc.h
index b9e103c..4b0b0a8 100644
--- a/opcodes/sh-opc.h
+++ b/opcodes/sh-opc.h
@@ -935,7 +935,7 @@ const sh_opcode_info sh_table[] =
/* 1111nnnn01101101 fsqrt <F_REG_N> */{"fsqrt",{F_REG_N},{HEX_F,REG_N,HEX_6,HEX_D}, arch_sh3e_up},
/* 1111nnnn01101101 fsqrt <D_REG_N> */{"fsqrt",{D_REG_N},{HEX_F,REG_N,HEX_6,HEX_D}, arch_sh4_up},
-/* 1111nnnn01111101 fssra <F_REG_N> */{"fssra",{F_REG_N},{HEX_F,REG_N,HEX_7,HEX_D}, arch_sh4a_up},
+/* 1111nnnn01111101 fsrra <F_REG_N> */{"fsrra",{F_REG_N},{HEX_F,REG_N,HEX_7,HEX_D}, arch_sh4a_up},
/* 1111nnnn00001101 fsts FPUL,<F_REG_N>*/{"fsts",{FPUL_M,F_REG_N},{HEX_F,REG_N,HEX_0,HEX_D}, arch_sh2e_up},
diff --git a/opcodes/sparc-opc.c b/opcodes/sparc-opc.c
index 0010232..22f18fa 100644
--- a/opcodes/sparc-opc.c
+++ b/opcodes/sparc-opc.c
@@ -1,6 +1,6 @@
/* Table of opcodes for the sparc.
Copyright 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000
+ 2000, 2002, 2004
Free Software Foundation, Inc.
This file is part of the BFD library.
@@ -1525,17 +1525,17 @@ CONDFC ("fbule", "cb013", 0xe, F_CONDBR),
{ "fstoi", F3F(2, 0x34, 0x0d1), F3F(~2, ~0x34, ~0x0d1)|RS1_G0, "f,g", F_FLOAT, v6 },
{ "fqtoi", F3F(2, 0x34, 0x0d3), F3F(~2, ~0x34, ~0x0d3)|RS1_G0, "R,g", F_FLOAT, v8 },
-{ "fdtox", F3F(2, 0x34, 0x082), F3F(~2, ~0x34, ~0x082)|RS1_G0, "B,g", F_FLOAT, v9 },
-{ "fstox", F3F(2, 0x34, 0x081), F3F(~2, ~0x34, ~0x081)|RS1_G0, "f,g", F_FLOAT, v9 },
-{ "fqtox", F3F(2, 0x34, 0x083), F3F(~2, ~0x34, ~0x083)|RS1_G0, "R,g", F_FLOAT, v9 },
+{ "fdtox", F3F(2, 0x34, 0x082), F3F(~2, ~0x34, ~0x082)|RS1_G0, "B,H", F_FLOAT, v9 },
+{ "fstox", F3F(2, 0x34, 0x081), F3F(~2, ~0x34, ~0x081)|RS1_G0, "f,H", F_FLOAT, v9 },
+{ "fqtox", F3F(2, 0x34, 0x083), F3F(~2, ~0x34, ~0x083)|RS1_G0, "R,H", F_FLOAT, v9 },
{ "fitod", F3F(2, 0x34, 0x0c8), F3F(~2, ~0x34, ~0x0c8)|RS1_G0, "f,H", F_FLOAT, v6 },
{ "fitos", F3F(2, 0x34, 0x0c4), F3F(~2, ~0x34, ~0x0c4)|RS1_G0, "f,g", F_FLOAT, v6 },
{ "fitoq", F3F(2, 0x34, 0x0cc), F3F(~2, ~0x34, ~0x0cc)|RS1_G0, "f,J", F_FLOAT, v8 },
-{ "fxtod", F3F(2, 0x34, 0x088), F3F(~2, ~0x34, ~0x088)|RS1_G0, "f,H", F_FLOAT, v9 },
-{ "fxtos", F3F(2, 0x34, 0x084), F3F(~2, ~0x34, ~0x084)|RS1_G0, "f,g", F_FLOAT, v9 },
-{ "fxtoq", F3F(2, 0x34, 0x08c), F3F(~2, ~0x34, ~0x08c)|RS1_G0, "f,J", F_FLOAT, v9 },
+{ "fxtod", F3F(2, 0x34, 0x088), F3F(~2, ~0x34, ~0x088)|RS1_G0, "B,H", F_FLOAT, v9 },
+{ "fxtos", F3F(2, 0x34, 0x084), F3F(~2, ~0x34, ~0x084)|RS1_G0, "B,g", F_FLOAT, v9 },
+{ "fxtoq", F3F(2, 0x34, 0x08c), F3F(~2, ~0x34, ~0x08c)|RS1_G0, "B,J", F_FLOAT, v9 },
{ "fdtoq", F3F(2, 0x34, 0x0ce), F3F(~2, ~0x34, ~0x0ce)|RS1_G0, "B,J", F_FLOAT, v8 },
{ "fdtos", F3F(2, 0x34, 0x0c6), F3F(~2, ~0x34, ~0x0c6)|RS1_G0, "B,g", F_FLOAT, v6 },
diff --git a/readline/ChangeLog.gdb b/readline/ChangeLog.gdb
index abf3282..5e90d29 100644
--- a/readline/ChangeLog.gdb
+++ b/readline/ChangeLog.gdb
@@ -1,3 +1,31 @@
+2004-01-27 Elena Zannoni <ezannoni@redhat.com>
+
+ Merge in official patches to readline-4.3 from
+ ftp://ftp.cwru.edu/pub/bash/readline-4.3-patches:
+ NOTE: Patch-ID readline-43-004 was already applied (see below).
+
+ * bind.c (rl_generic_bind): Pressing certain key sequences
+ causes an infinite loop in _rl_dispatch_subseq with the `key' argument
+ set to 256. This eventually causes bash to exceed the stack size
+ limit and crash with a segmentation violation.
+ Patch-ID: readline43-001.
+
+ * readline.c (_rl_dispatch_subseq): Repeating an edit in
+ vi-mode with `.' does not work.
+ Patch-ID: readline43-002.
+
+ * mbutil.c (_rl_get_char_len, _rl_compare_chars,
+ _rl_adjust_point): When in a locale with multibyte characters, the
+ readline display updater will occasionally cause a
+ segmentation fault when attempting to compute the length of the first
+ multibyte character on the line.
+ Patch-ID: readline43-003.
+
+ * vi_mode.c (_rl_vi_change_mbchar_case): Using the vi editing
+ mode's case-changing commands in a locale with multibyte characters
+ will cause garbage characters to be inserted into the editing buffer.
+ Patch-ID: readline43-005.
+
2003-12-28 Eli Zaretskii <eliz@elta.co.il>
* readline.c (rl_save_state, rl_restore_state): Support systems
@@ -57,7 +85,14 @@
2003-01-09 Michael Chastain <mec@shout.net>
From Chet Ramey, <chet@po.cwru.edu>, the readline maintainer:
+ ftp://ftp.cwru.edu/pub/bash/readline-4.3-patches/readline43-004
+
* display.c: Fix perverse screen refresh with UTF-8.
+ When running in a locale with multibyte characters, the
+ readline display updater will use carriage returns when
+ drawing the line, overwriting any partial output already on
+ the screen and not terminated by a newline.
+ Patch-ID: readline43-004
2003-01-08 Chris Demetriou <cgd@broadcom.com>
@@ -76,7 +111,8 @@
2002-12-06 Elena Zannoni <ezannoni@redhat.com>
- Import of readline 4.3:
+ Import of readline 4.3. NB: This import includes those gdb
+ local changes that aren't in the official readline sources.
* compat.c, mbutil.c, misc.c, rlmbutil.h, rltypedefs.h,
text.c, doc/history.0, doc/history.3, support/wcwidth.c,
diff --git a/readline/bind.c b/readline/bind.c
index 65ef401..7103888 100644
--- a/readline/bind.c
+++ b/readline/bind.c
@@ -311,7 +311,7 @@ rl_generic_bind (type, keyseq, data, map)
mapped to something, `abc' to be mapped to something else,
and the function bound to `a' to be executed when the user
types `abx', leaving `bx' in the input queue. */
- if (k.function /* && k.type == ISFUNC */)
+ if (k.function && ((k.type == ISFUNC && k.function != rl_do_lowercase_version) || k.type == ISMACR))
{
map[ANYOTHERKEY] = k;
k.function = 0;
diff --git a/readline/mbutil.c b/readline/mbutil.c
index 50302f0..8794d02 100644
--- a/readline/mbutil.c
+++ b/readline/mbutil.c
@@ -205,14 +205,16 @@ _rl_get_char_len (src, ps)
if (tmp == (size_t)(-2))
{
/* shorted to compose multibyte char */
- memset (ps, 0, sizeof(mbstate_t));
+ if (ps)
+ memset (ps, 0, sizeof(mbstate_t));
return -2;
}
else if (tmp == (size_t)(-1))
{
/* invalid to compose multibyte char */
/* initialize the conversion state */
- memset (ps, 0, sizeof(mbstate_t));
+ if (ps)
+ memset (ps, 0, sizeof(mbstate_t));
return -1;
}
else if (tmp == (size_t)0)
@@ -225,9 +227,12 @@ _rl_get_char_len (src, ps)
return 1. Otherwise return 0. */
int
_rl_compare_chars (buf1, pos1, ps1, buf2, pos2, ps2)
- char *buf1, *buf2;
- mbstate_t *ps1, *ps2;
- int pos1, pos2;
+ char *buf1;
+ int pos1;
+ mbstate_t *ps1;
+ char *buf2;
+ int pos2;
+ mbstate_t *ps2;
{
int i, w1, w2;
@@ -276,8 +281,11 @@ _rl_adjust_point(string, point, ps)
pos++;
/* clear the state of the byte sequence, because
in this case effect of mbstate is undefined */
- memset (ps, 0, sizeof (mbstate_t));
+ if (ps)
+ memset (ps, 0, sizeof (mbstate_t));
}
+ else if (tmp == 0)
+ pos++;
else
pos += tmp;
}
diff --git a/readline/readline.c b/readline/readline.c
index efa0bf8..aed0235 100644
--- a/readline/readline.c
+++ b/readline/readline.c
@@ -684,6 +684,7 @@ _rl_dispatch_subseq (key, map, got_subseq)
}
#if defined (VI_MODE)
if (rl_editing_mode == vi_mode && _rl_keymap == vi_movement_keymap &&
+ key != ANYOTHERKEY &&
_rl_vi_textmod_command (key))
_rl_vi_set_last (key, rl_numeric_arg, rl_arg_sign);
#endif
diff --git a/readline/vi_mode.c b/readline/vi_mode.c
index 5d146b3f..8930364 100644
--- a/readline/vi_mode.c
+++ b/readline/vi_mode.c
@@ -680,7 +680,8 @@ _rl_vi_change_mbchar_case (count)
int count;
{
wchar_t wc;
- char mb[MB_LEN_MAX];
+ char mb[MB_LEN_MAX+1];
+ int mblen;
mbstate_t ps;
memset (&ps, 0, sizeof (mbstate_t));
@@ -703,7 +704,9 @@ _rl_vi_change_mbchar_case (count)
/* Vi is kind of strange here. */
if (wc)
{
- wctomb (mb, wc);
+ mblen = wctomb (mb, wc);
+ if (mblen >= 0)
+ mb[mblen] = '\0';
rl_begin_undo_group ();
rl_delete (1, 0);
rl_insert_text (mb);
diff --git a/sim/ChangeLog b/sim/ChangeLog
index 97fecf2..dec01da 100644
--- a/sim/ChangeLog
+++ b/sim/ChangeLog
@@ -1,3 +1,8 @@
+2004-01-26 Chris Demetriou <cgd@broadcom.com>
+
+ * configure.in (mips*-*-*): Configure in testsuite.
+ * configure: Regenerate.
+
2003-10-08 Dave Brolley <brolley@redhat.com>
* configure.in: Move frv handling to alphabetically correct placement.
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index c2d7584..d287cdf 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -1,3 +1,7 @@
+2004-01-16 Ben Elliston <bje@wasabisystems.com>
+
+ * Makefile.in (clean): Remove rm -f $(ALL), as $(ALL) is empty.
+
2003-12-19 Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com>
* sim-core.c (sim_core_trans_addr): Added for m32r-linux-run.
diff --git a/sim/common/Makefile.in b/sim/common/Makefile.in
index d021566..915598c 100644
--- a/sim/common/Makefile.in
+++ b/sim/common/Makefile.in
@@ -105,7 +105,6 @@ TAGS: force
clean:
rm -f *.[oa] *~ core
- rm -f $(ALL)
distclean mostlyclean maintainer-clean realclean: clean
rm -f TAGS
diff --git a/sim/configure b/sim/configure
index b342d39..d09adab 100755
--- a/sim/configure
+++ b/sim/configure
@@ -1426,11 +1426,11 @@ case "${target}" in
# OBSOLETE extra_subdirs="${extra_subdirs} igen"
# OBSOLETE ;;
# OBSOLETE fr30-*-*) sim_target=fr30 ;;
- h8300*-*-*)
- sim_target=h8300
+ frv-*-*) sim_target=frv
extra_subdirs="${extra_subdirs} testsuite"
;;
- frv-*-*) sim_target=frv
+ h8300*-*-*)
+ sim_target=h8300
extra_subdirs="${extra_subdirs} testsuite"
;;
h8500-*-*) sim_target=h8500 ;;
@@ -1442,7 +1442,7 @@ case "${target}" in
# The MIPS simulator can only be compiled by gcc.
sim_target=mips
only_if_gcc=yes
- extra_subdirs="${extra_subdirs} igen"
+ extra_subdirs="${extra_subdirs} igen testsuite"
;;
mn10300*-*-*)
# The mn10300 simulator can only be compiled by gcc.
diff --git a/sim/configure.in b/sim/configure.in
index d992470..c66a413 100644
--- a/sim/configure.in
+++ b/sim/configure.in
@@ -81,7 +81,7 @@ case "${target}" in
# The MIPS simulator can only be compiled by gcc.
sim_target=mips
only_if_gcc=yes
- extra_subdirs="${extra_subdirs} igen"
+ extra_subdirs="${extra_subdirs} igen testsuite"
;;
mn10300*-*-*)
# The mn10300 simulator can only be compiled by gcc.
diff --git a/sim/m32r/ChangeLog b/sim/m32r/ChangeLog
index 92cbd04..7c2294c 100644
--- a/sim/m32r/ChangeLog
+++ b/sim/m32r/ChangeLog
@@ -1,3 +1,10 @@
+2004-02-04 Andrew Cagney <cagney@redhat.com>
+
+ Committed by Andrew Cagney.
+ * mloopx.in: Update copyright.
+ (xextract-pbb): Fixed trap for system calls operation in parallel.
+ * mloop2.in (xextract-pbb): Ditto.
+
2003-12-19 Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com>
* configure.in: Changed for dummy simulator of m32r-linux.
diff --git a/sim/m32r/mloop2.in b/sim/m32r/mloop2.in
index bb9b0b2..69c6ec7 100644
--- a/sim/m32r/mloop2.in
+++ b/sim/m32r/mloop2.in
@@ -1,5 +1,6 @@
# Simulator main loop for m32r2. -*- C -*-
-# Copyright (C) 1996, 1997, 1998, 2003 Free Software Foundation, Inc.
+#
+# Copyright 1996, 1997, 1998, 2003, 2004 Free Software Foundation, Inc.
#
# This file is part of GDB, the GNU debugger.
#
@@ -289,15 +290,33 @@ cat <<EOF
{
if ((insn & 0x8000) != 0) /* parallel? */
{
- /* Yep. Here's the "interesting" [sic] part. */
- idesc = emit_parallel (current_cpu, pc, insn, sc, 1);
- sc += 3;
- max_insns -= 3;
+ int up_count;
+
+ if (((insn >> 16) & 0xfff0) == 0x10f0)
+ {
+ /* FIXME: No need to handle this sequentially if system
+ calls will be able to execute after second insn in
+ parallel. ( trap #num || insn ) */
+ /* insn */
+ idesc = emit_16 (current_cpu, pc + 2, insn & 0x7fff,
+ sc, 1, 0);
+ /* trap */
+ emit_16 (current_cpu, pc, insn >> 16, sc + 1, 1, 0);
+ up_count = 2;
+ }
+ else
+ {
+ /* Yep. Here's the "interesting" [sic] part. */
+ idesc = emit_parallel (current_cpu, pc, insn, sc, 1);
+ up_count = 3;
+ }
+ sc += up_count;
+ max_insns -= up_count;
icount += 2;
pc += 4;
if (IDESC_CTI_P (idesc))
{
- SET_CTI_VPC (sc - 3);
+ SET_CTI_VPC (sc - up_count);
break;
}
}
@@ -375,18 +394,51 @@ cat <<EOF
Only emit before/after handlers if necessary. */
if (trace_p || profile_p)
{
- idesc = emit_full_parallel (current_cpu, pc, insn, sc,
- trace_p, profile_p);
+ if (((insn >> 16) & 0xfff0) == 0x10f0)
+ {
+ /* FIXME: No need to handle this sequentially if
+ system calls will be able to execute after second
+ insn in parallel. ( trap #num || insn ) */
+ /* insn */
+ idesc = emit_full16 (current_cpu, pc + 2,
+ insn & 0x7fff, sc, 0, 0);
+ /* trap */
+ emit_full16 (current_cpu, pc, insn >> 16, sc + 3,
+ 0, 0);
+ }
+ else
+ {
+ idesc = emit_full_parallel (current_cpu, pc, insn,
+ sc, trace_p, profile_p);
+ }
cti_sc = sc + 1;
sc += 6;
max_insns -= 6;
}
else
{
- idesc = emit_parallel (current_cpu, pc, insn, sc, 0);
+ int up_count;
+
+ if (((insn >> 16) & 0xfff0) == 0x10f0)
+ {
+ /* FIXME: No need to handle this sequentially if
+ system calls will be able to execute after second
+ insn in parallel. ( trap #num || insn ) */
+ /* insn */
+ idesc = emit_16 (current_cpu, pc + 2, insn & 0x7fff,
+ sc, 0, 0);
+ /* trap */
+ emit_16 (current_cpu, pc, insn >> 16, sc + 1, 0, 0);
+ up_count = 2;
+ }
+ else
+ {
+ idesc = emit_parallel (current_cpu, pc, insn, sc, 0);
+ up_count = 3;
+ }
cti_sc = sc;
- sc += 3;
- max_insns -= 3;
+ sc += up_count;
+ max_insns -= up_count;
}
icount += 2;
pc += 4;
diff --git a/sim/m32r/mloopx.in b/sim/m32r/mloopx.in
index e1663f7..5ca20a1 100644
--- a/sim/m32r/mloopx.in
+++ b/sim/m32r/mloopx.in
@@ -1,5 +1,6 @@
# Simulator main loop for m32rx. -*- C -*-
-# Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
+#
+# Copyright 1996, 1997, 1998, 2004 Free Software Foundation, Inc.
#
# This file is part of the GNU Simulators.
#
@@ -289,15 +290,33 @@ cat <<EOF
{
if ((insn & 0x8000) != 0) /* parallel? */
{
- /* Yep. Here's the "interesting" [sic] part. */
- idesc = emit_parallel (current_cpu, pc, insn, sc, 1);
- sc += 3;
- max_insns -= 3;
+ int up_count;
+
+ if (((insn >> 16) & 0xfff0) == 0x10f0)
+ {
+ /* FIXME: No need to handle this sequentially if system
+ calls will be able to execute after second insn in
+ parallel. ( trap #num || insn ) */
+ /* insn */
+ idesc = emit_16 (current_cpu, pc + 2, insn & 0x7fff,
+ sc, 1, 0);
+ /* trap */
+ emit_16 (current_cpu, pc, insn >> 16, sc + 1, 1, 0);
+ up_count = 2;
+ }
+ else
+ {
+ /* Yep. Here's the "interesting" [sic] part. */
+ idesc = emit_parallel (current_cpu, pc, insn, sc, 1);
+ up_count = 3;
+ }
+ sc += up_count;
+ max_insns -= up_count;
icount += 2;
pc += 4;
if (IDESC_CTI_P (idesc))
{
- SET_CTI_VPC (sc - 3);
+ SET_CTI_VPC (sc - up_count);
break;
}
}
@@ -375,18 +394,51 @@ cat <<EOF
Only emit before/after handlers if necessary. */
if (trace_p || profile_p)
{
- idesc = emit_full_parallel (current_cpu, pc, insn, sc,
- trace_p, profile_p);
+ if (((insn >> 16) & 0xfff0) == 0x10f0)
+ {
+ /* FIXME: No need to handle this sequentially if
+ system calls will be able to execute after second
+ insn in parallel. ( trap #num || insn ) */
+ /* insn */
+ idesc = emit_full16 (current_cpu, pc + 2,
+ insn & 0x7fff, sc, 0, 0);
+ /* trap */
+ emit_full16 (current_cpu, pc, insn >> 16, sc + 3,
+ 0, 0);
+ }
+ else
+ {
+ idesc = emit_full_parallel (current_cpu, pc, insn,
+ sc, trace_p, profile_p);
+ }
cti_sc = sc + 1;
sc += 6;
max_insns -= 6;
}
else
{
- idesc = emit_parallel (current_cpu, pc, insn, sc, 0);
+ int up_count;
+
+ if (((insn >> 16) & 0xfff0) == 0x10f0)
+ {
+ /* FIXME: No need to handle this sequentially if
+ system calls will be able to execute after second
+ insn in parallel. ( trap #num || insn ) */
+ /* insn */
+ idesc = emit_16 (current_cpu, pc + 2, insn & 0x7fff,
+ sc, 0, 0);
+ /* trap */
+ emit_16 (current_cpu, pc, insn >> 16, sc + 1, 0, 0);
+ up_count = 2;
+ }
+ else
+ {
+ idesc = emit_parallel (current_cpu, pc, insn, sc, 0);
+ up_count = 3;
+ }
cti_sc = sc;
- sc += 3;
- max_insns -= 3;
+ sc += up_count;
+ max_insns -= up_count;
}
icount += 2;
pc += 4;
diff --git a/sim/mips/ChangeLog b/sim/mips/ChangeLog
index e5b5216..fab4c6e 100644
--- a/sim/mips/ChangeLog
+++ b/sim/mips/ChangeLog
@@ -1,3 +1,11 @@
+2004-01-19 Chris Demetriou <cgd@broadcom.com>
+
+ * mips.igen (check_mf_cycles, check_mt_hilo, check_mf_hilo)
+ (check_mult_hilo): Improve comments.
+ (check_div_hilo): Likewise. Also, fork off a new version
+ to handle mips32/mips64 (since there are no hazards to check
+ in MIPS32/MIPS64).
+
2003-06-17 Richard Sandiford <rsandifo@redhat.com>
* mips.igen (do_dmultx): Fix check for negative operands.
diff --git a/sim/mips/mips.igen b/sim/mips/mips.igen
index 358c8ab..cfc2d6d 100644
--- a/sim/mips/mips.igen
+++ b/sim/mips/mips.igen
@@ -218,18 +218,39 @@
}
-// Helper:
+// Helpers:
//
// Check that an access to a HI/LO register meets timing requirements
//
-// The following requirements exist:
+// In all MIPS ISAs,
//
-// - A MT {HI,LO} update was not immediatly preceeded by a MF {HI,LO} read
-// - A OP {HI,LO} update was not immediatly preceeded by a MF {HI,LO} read
-// - A MF {HI,LO} read was not corrupted by a preceeding MT{LO,HI} update
-// corruption occures when MT{LO,HI} is preceeded by a OP {HI,LO}.
+// OP {HI and LO} followed by MT{LO or HI} (and not MT{HI or LO})
+// makes subsequent MF{HI or LO} UNPREDICTABLE. (1)
+//
+// The following restrictions exist for MIPS I - MIPS III:
+//
+// MF{HI or LO} followed by MT{HI or LO} w/ less than 2 instructions
+// in between makes MF UNPREDICTABLE. (2)
+//
+// MF{HI or LO} followed by OP {HI and LO} w/ less than 2 instructions
+// in between makes MF UNPREDICTABLE. (3)
+//
+// On the r3900, restriction (2) is not present, and restriction (3) is not
+// present for multiplication.
+//
+// For now this code is paranoid. Historically the simulator
+// enforced restrictions (2) and (3) for more ISAs and CPU types than
+// necessary. Unfortunately, at least some MIPS IV and later parts'
+// documentation describes them as having these hazards (e.g. vr5000),
+// so they can't be removed for at leats MIPS IV. MIPS V hasn't been
+// checked (since there are no known hardware implementations).
+//
+
+// check_mf_cycles:
+//
+// Helper used by check_mt_hilo, check_mult_hilo, and check_div_hilo
+// to check for restrictions (2) and (3) above.
//
-
:function:::int:check_mf_cycles:hilo_history *history, signed64 time, const char *new
{
if (history->mf.timestamp + 3 > time)
@@ -243,6 +264,12 @@
return 1;
}
+
+// check_mt_hilo:
+//
+// Check for restriction (2) above (for ISAs/processors that have it),
+// and record timestamps for restriction (1) above.
+//
:function:::int:check_mt_hilo:hilo_history *history
*mipsI:
*mipsII:
@@ -271,6 +298,11 @@
}
+// check_mf_hilo:
+//
+// Check for restriction (1) above, and record timestamps for
+// restriction (2) and (3) above.
+//
:function:::int:check_mf_hilo:hilo_history *history, hilo_history *peer
*mipsI:
*mipsII:
@@ -309,6 +341,11 @@
+// check_mult_hilo:
+//
+// Check for restriction (3) above (for ISAs/processors that have it)
+// for MULT ops, and record timestamps for restriction (1) above.
+//
:function:::int:check_mult_hilo:hilo_history *hi, hilo_history *lo
*mipsI:
*mipsII:
@@ -328,8 +365,6 @@
return ok;
}
-// The r3900 mult and multu insns _can_ be exectuted immediatly after
-// a mf{hi,lo}
:function:::int:check_mult_hilo:hilo_history *hi, hilo_history *lo
*mips32:
*mips64:
@@ -345,14 +380,17 @@
}
+// check_div_hilo:
+//
+// Check for restriction (3) above (for ISAs/processors that have it)
+// for DIV ops, and record timestamps for restriction (1) above.
+//
:function:::int:check_div_hilo:hilo_history *hi, hilo_history *lo
*mipsI:
*mipsII:
*mipsIII:
*mipsIV:
*mipsV:
-*mips32:
-*mips64:
*vr4100:
*vr5000:
*r3900:
@@ -367,6 +405,18 @@
return ok;
}
+:function:::int:check_div_hilo:hilo_history *hi, hilo_history *lo
+*mips32:
+*mips64:
+{
+ signed64 time = sim_events_time (SD);
+ hi->op.timestamp = time;
+ lo->op.timestamp = time;
+ hi->op.cia = CIA;
+ lo->op.cia = CIA;
+ return 1;
+}
+
// Helper:
//
diff --git a/sim/ppc/ChangeLog b/sim/ppc/ChangeLog
index dac646a..d4f94c3 100644
--- a/sim/ppc/ChangeLog
+++ b/sim/ppc/ChangeLog
@@ -1,3 +1,8 @@
+2004-01-27 Andrew Cagney <cagney@redhat.com>
+
+ * ppc-instructions: Update copyright.
+ (convert_to_integer): Add trailing ";" to label.
+
2003-10-16 Michael Snyder <msnyder@redhat.com>
* emul_netbsd.c: Only a comment may follow an #endif.
diff --git a/sim/ppc/ppc-instructions b/sim/ppc/ppc-instructions
index a930dc8..1991c49 100644
--- a/sim/ppc/ppc-instructions
+++ b/sim/ppc/ppc-instructions
@@ -1,7 +1,7 @@
#
# This file is part of the program psim.
#
-# Copyright 1994, 1995, 1996, 1997, 2003 Andrew Cagney
+# Copyright 1994, 1995, 1996, 1997, 2003, 2004 Andrew Cagney
#
# --
#
@@ -1281,7 +1281,7 @@ void::function::convert_to_integer:cpu *processor, unsigned_word cia, unsigned64
/* FPSCR[fprf] = undefined */
}
/**/
- LABEL(Done):
+ LABEL(Done):;
# extract out raw fields of a FP number
diff --git a/sim/sh/ChangeLog b/sim/sh/ChangeLog
index 9659f95..62edf59 100644
--- a/sim/sh/ChangeLog
+++ b/sim/sh/ChangeLog
@@ -1,3 +1,11 @@
+2004-01-27 Michael Snyder <msnyder@redhat.com>
+
+ * gencode.c: (op tab): Some refs and defs fixes.
+ "fsrra" -> "fsrra <FREG_N>".
+ "sleep": replace array ref with array addr.
+ "trapa": ditto.
+ Comment and whitespace clean-ups.
+
2004-01-07 Michael Snyder <msnyder@redhat.com>
* gencode.c: Whitespace cleanup.
diff --git a/sim/sh/gencode.c b/sim/sh/gencode.c
index 52e611f..9769d73 100644
--- a/sim/sh/gencode.c
+++ b/sim/sh/gencode.c
@@ -4,7 +4,7 @@
Written by Steve Chamberlain of Cygnus Support.
sac@cygnus.com
- This file is part of SH sim
+ This file is part of SH sim.
THIS SOFTWARE IS NOT COPYRIGHTED
@@ -20,7 +20,7 @@
*/
/* This program generates the opcode table for the assembler and
- the simulator code
+ the simulator code.
-t prints a pretty table for the assembler manual
-s generates the simulator code jump table
@@ -72,7 +72,7 @@ op tab[] =
"R[n] = ult;",
},
- { "0", "", "and #<imm>,R0", "11001001i8*1....",
+ { "0", "0", "and #<imm>,R0", "11001001i8*1....",
"R0 &= i;",
},
{ "n", "nm", "and <REG_M>,<REG_N>", "0010nnnnmmmm1001",
@@ -201,8 +201,8 @@ op tab[] =
"SET_SR_T (0);",
},
- { "", "nm", "div1 <REG_M>,<REG_N>", "0011nnnnmmmm0100",
- "div1 (R, m, n/*, T*/);",
+ { "n", "nm", "div1 <REG_M>,<REG_N>", "0011nnnnmmmm0100",
+ "div1 (&R0, m, n/*, T*/);",
},
{ "", "nm", "dmuls.l <REG_M>,<REG_N>", "0011nnnnmmmm1101",
@@ -287,7 +287,7 @@ op tab[] =
/* sh2e */
{ "", "", "fdiv <FREG_M>,<FREG_N>", "1111nnnnmmmm0011",
"FP_OP (n, /, m);",
- "/* FIXME: check for DP and (n & 1) == 0? */",
+ "/* FIXME: check for DP and (n & 1) == 0? */",
},
/* sh4 */
@@ -309,13 +309,13 @@ op tab[] =
/* sh2e */
{ "", "", "fldi0 <FREG_N>", "1111nnnn10001101",
"SET_FR (n, (float) 0.0);",
- "/* FIXME: check for DP and (n & 1) == 0? */",
+ "/* FIXME: check for DP and (n & 1) == 0? */",
},
/* sh2e */
{ "", "", "fldi1 <FREG_N>", "1111nnnn10011101",
"SET_FR (n, (float) 1.0);",
- "/* FIXME: check for DP and (n & 1) == 0? */",
+ "/* FIXME: check for DP and (n & 1) == 0? */",
},
/* sh2e */
@@ -443,7 +443,8 @@ op tab[] =
"}",
},
- /* sh4: See fmov instructions above for move to/from extended fp registers */
+ /* sh4:
+ See fmov instructions above for move to/from extended fp registers. */
/* sh2e */
{ "", "", "fmul <FREG_M>,<FREG_N>", "1111nnnnmmmm0010",
@@ -490,7 +491,7 @@ op tab[] =
},
/* sh4 */
- { "", "", "fsrra", "1111nnnn01111101",
+ { "", "", "fsrra <FREG_N>", "1111nnnn01111101",
"if (FPSCR_PR)",
" RAISE_EXCEPTION (SIGILL);",
"else",
@@ -662,11 +663,11 @@ op tab[] =
},
{ "nm", "nm", "mac.l @<REG_M>+,@<REG_N>+", "0000nnnnmmmm1111",
- "macl (&R0,memory,n,m);",
+ "macl (&R0, memory, n, m);",
},
{ "nm", "nm", "mac.w @<REG_M>+,@<REG_N>+", "0100nnnnmmmm1111",
- "macw (&R0,memory,n,m,endianw);",
+ "macw (&R0, memory, n, m, endianw);",
},
{ "n", "", "mov #<imm>,<REG_N>", "1110nnnni8*1....",
@@ -840,7 +841,7 @@ op tab[] =
"WLAT (R[n], R[0]);",
},
- { "n", "0", "movco.l R0, @<REG_N>", "0000nnnn01110011",
+ { "", "n0", "movco.l R0, @<REG_N>", "0000nnnn01110011",
"/* LDST -> T */",
"SET_SR_T (LDST);",
"/* if (T) R0 -> (Rn) */",
@@ -1101,7 +1102,7 @@ op tab[] =
},
{ "", "", "sleep", "0000000000011011",
- "nip += trap (0xc3, R0, PC, memory, maskl, maskw, endianw);",
+ "nip += trap (0xc3, &R0, PC, memory, maskl, maskw, endianw);",
},
{ "n", "", "stc <CREG_M>,<REG_N>", "0000nnnnmmmm0010",
@@ -1192,7 +1193,7 @@ op tab[] =
{ "0", "", "trapa #<imm>", "11000011i8*1....",
"long imm = 0xff & i;",
"if (i < 20 || i == 33 || i == 34 || i == 0xc3)",
- " nip += trap (i, R, PC, memory, maskl, maskw,endianw);",
+ " nip += trap (i, &R0, PC, memory, maskl, maskw, endianw);",
#if 0
"else {",
/* SH-[12] */
@@ -1242,10 +1243,10 @@ op tab[] =
#if 0
{ "divs.l <REG_M>,<REG_N>", "0100nnnnmmmm1110",
- "divl (0,R[n],R[m]);",
+ "divl (0, R[n], R[m]);",
},
{ "divu.l <REG_M>,<REG_N>", "0100nnnnmmmm1101",
- "divl (0,R[n],R[m]);",
+ "divl (0, R[n], R[m]);",
},
#endif
@@ -2262,8 +2263,6 @@ gengastab ()
{
printf ("%s %-30s\n", p->code, p->name);
}
-
-
}
static unsigned char table[1 << 16];
@@ -2395,7 +2394,7 @@ expand_opcode (val, i, s)
}
/* Print the jump table used to index an opcode into a switch
- statement entry. */
+ statement entry. */
static void
dumptable (name, size, start)
@@ -2643,7 +2642,7 @@ gensim_caselist (p)
printf (" TL (n);\n");
{
- /* Do the refs */
+ /* Do the refs. */
char *r;
for (r = p->refs; *r; r++)
{
@@ -2666,7 +2665,7 @@ gensim_caselist (p)
printf (" }\n");
{
- /* Do the defs */
+ /* Do the defs. */
char *r;
for (r = p->defs; *r; r++)
{
@@ -2975,12 +2974,12 @@ main (ac, av)
int ac;
char **av;
{
- /* verify the table before anything else */
+ /* Verify the table before anything else. */
{
op *p;
for (p = tab; p->name; p++)
{
- /* check that the code field contains 16 bits */
+ /* Check that the code field contains 16 bits. */
if (strlen (p->code) != 16)
{
fprintf (stderr, "Code `%s' length wrong (%d) for `%s'\n",
@@ -2990,7 +2989,7 @@ main (ac, av)
}
}
- /* now generate the requested data */
+ /* Now generate the requested data. */
if (ac > 1)
{
if (strcmp (av[1], "-t") == 0)
diff --git a/sim/testsuite/ChangeLog b/sim/testsuite/ChangeLog
index cbd36e3..4e7b230 100644
--- a/sim/testsuite/ChangeLog
+++ b/sim/testsuite/ChangeLog
@@ -1,3 +1,12 @@
+2004-01-26 Chris Demetriou <cgd@broadcom.com>
+
+ * sim/mips: New directory. Tests for the MIPS simulator.
+
+2004-01-23 Ben Elliston <bje@wasabisystems.com>
+
+ * lib/sim-defs.exp (run_sim_test): Delete the .o and .x files if a
+ test passes.
+
2003-10-10 Dave Brolley <brolley@redhat.com>
* sim/frv/testutils.inc (or_gr_immed): New macro.
diff --git a/sim/testsuite/lib/sim-defs.exp b/sim/testsuite/lib/sim-defs.exp
index 017fcef..e755717 100644
--- a/sim/testsuite/lib/sim-defs.exp
+++ b/sim/testsuite/lib/sim-defs.exp
@@ -289,6 +289,7 @@ proc run_sim_test { name requested_machs } {
if { "$opts(xerror)" == "no" } {
if [string match $opts(output) $output] {
pass "$mach $testname"
+ file delete ${name}.o ${name}.x
} else {
verbose -log "output: $output" 3
verbose -log "pattern: $opts(output)" 3
@@ -304,6 +305,7 @@ proc run_sim_test { name requested_machs } {
} else {
if [string match $opts(output) $output] {
pass "$mach $testname"
+ file delete ${name}.o ${name}.x
} else {
verbose -log "output: $output" 3
verbose -log "pattern: $opts(output)" 3
diff --git a/sim/v850/ChangeLog b/sim/v850/ChangeLog
index 6f528ef..26b25aa 100644
--- a/sim/v850/ChangeLog
+++ b/sim/v850/ChangeLog
@@ -1,3 +1,7 @@
+2004-01-18 Mark Kettenis <kettenis@gnu.org>
+
+ * simops.c: Include <sys/types.h>.
+
2003-09-05 Andrew Cagney <cagney@redhat.com>
Nick Clifton <nickc@redhat.com>
diff --git a/sim/v850/simops.c b/sim/v850/simops.c
index 87868f5..38ec0a6 100644
--- a/sim/v850/simops.c
+++ b/sim/v850/simops.c
@@ -2,6 +2,8 @@
#include "v850_sim.h"
#include "simops.h"
+#include <sys/types.h>
+
#ifdef HAVE_UTIME_H
#include <utime.h>
#endif
diff --git a/src-release b/src-release
index 51539e8..403ce14 100644
--- a/src-release
+++ b/src-release
@@ -1,5 +1,5 @@
# Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-# 1999, 2000, 2001, 2002, 2003 Free Software Foundation
+# 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -136,7 +136,7 @@ do-proto-toplev: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
<Makefile.in >tmp
mv -f tmp Makefile.in
#
- ./configure sun4
+ ./configure i686-pc-linux-gnu
$(MAKE) configure-host configure-target \
ALL_GCC="" ALL_GCC_C="" ALL_GCC_CXX="" \
CC_FOR_TARGET="$(CC)" CXX_FOR_TARGET="$(CXX)"
@@ -329,24 +329,5 @@ insight+dejagnu.tar: $(DIST_SUPPORT) $(INSIGHTD_SUPPORT_DIRS) gdb
MD5PROG="$(MD5PROG)" \
SUPPORT_FILES="$(INSIGHTD_SUPPORT_DIRS)"
-.PHONY: newlib.tar.bz2
-NEWLIB_SUPPORT_DIRS=libgloss
-# taz configures for the sun4 target which won't configure newlib.
-# We need newlib configured so that the .info files are made.
-# Unfortunately, it is not enough to just configure newlib separately:
-# taz will build the .info files but since SUBDIRS won't contain newlib,
-# distclean won't be run (leaving Makefile, config.status, and the tmp files
-# used in building the .info files, eg: *.def, *.ref).
-# The problem isn't solvable however without a lot of extra work because
-# target libraries are built in subdir $(target_alias) which gets nuked during
-# the make distclean. For now punt on the issue of shipping newlib info files
-# with newlib net releases and wait for a day when some native target (sun4?)
-# supports newlib (if only minimally).
-newlib.tar.bz2: $(DIST_SUPPORT) $(NEWLIB_SUPPORT_DIRS) newlib
- $(MAKE) -f $(SELF) taz TOOL=newlib \
- MD5PROG="$(MD5PROG)" \
- SUPPORT_FILES="$(NEWLIB_SUPPORT_DIRS)" \
- DEVO_SUPPORT="$(DEVO_SUPPORT) COPYING.NEWLIB" newlib
-
.NOEXPORT:
MAKEOVERRIDES=