From 03de7209a3add77f3c071125e7d71a943160754b Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Sat, 6 Mar 2010 23:40:14 +0000 Subject: [PATCH] - archer-jankratochvil-fedora13 commit: 59c35a31f0981a0f0b884b32c91ae6325b2126cd --- .cvsignore | 2 +- gdb-6.3-readnever-20050907.patch | 38 +- gdb-6.3-test-pie-20050107.patch | 58 +- gdb-6.5-bz203661-emit-relocs.patch | 12 +- gdb-6.6-buildid-locate-core-as-arg.patch | 32 +- gdb-archer-pie-addons.patch | 96 +- gdb-archer.patch | 3809 +++++++++++++++++----- gdb-stale-related_breakpoint.patch | 154 - gdb-stale-sectindex.patch | 112 - gdb.spec | 17 +- sources | 2 +- 11 files changed, 3136 insertions(+), 1196 deletions(-) delete mode 100644 gdb-stale-related_breakpoint.patch delete mode 100644 gdb-stale-sectindex.patch diff --git a/.cvsignore b/.cvsignore index 3b34e37..21f7256 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1,2 +1,2 @@ -gdb-7.0.50.20100203.tar.bz2 +gdb-7.0.90.20100306.tar.bz2 libstdc++-v3-python-r155978.tar.bz2 diff --git a/gdb-6.3-readnever-20050907.patch b/gdb-6.3-readnever-20050907.patch index bd89dd5..132f3bf 100644 --- a/gdb-6.3-readnever-20050907.patch +++ b/gdb-6.3-readnever-20050907.patch @@ -11,11 +11,11 @@ * gdb.texinfo (File Options): Document --readnever. -Index: gdb-7.0.50.20100121/gdb/doc/gdb.texinfo +Index: gdb-7.0.90.20100306/gdb/doc/gdb.texinfo =================================================================== ---- gdb-7.0.50.20100121.orig/gdb/doc/gdb.texinfo 2010-01-21 15:11:09.000000000 +0100 -+++ gdb-7.0.50.20100121/gdb/doc/gdb.texinfo 2010-01-21 15:13:02.000000000 +0100 -@@ -997,6 +997,12 @@ Read each symbol file's entire symbol ta +--- gdb-7.0.90.20100306.orig/gdb/doc/gdb.texinfo 2010-03-06 23:19:13.000000000 +0100 ++++ gdb-7.0.90.20100306/gdb/doc/gdb.texinfo 2010-03-06 23:20:35.000000000 +0100 +@@ -995,6 +995,12 @@ Read each symbol file's entire symbol ta the default, which is to read it incrementally as it is needed. This makes startup slower, but makes future operations faster. @@ -28,10 +28,10 @@ Index: gdb-7.0.50.20100121/gdb/doc/gdb.texinfo @end table @node Mode Options -Index: gdb-7.0.50.20100121/gdb/main.c +Index: gdb-7.0.90.20100306/gdb/main.c =================================================================== ---- gdb-7.0.50.20100121.orig/gdb/main.c 2010-01-21 15:11:18.000000000 +0100 -+++ gdb-7.0.50.20100121/gdb/main.c 2010-01-21 15:13:02.000000000 +0100 +--- gdb-7.0.90.20100306.orig/gdb/main.c 2010-03-06 23:20:23.000000000 +0100 ++++ gdb-7.0.90.20100306/gdb/main.c 2010-03-06 23:20:35.000000000 +0100 @@ -382,6 +382,7 @@ captured_main (void *data) {"xdb", no_argument, &xdb_commands, 1}, {"dbx", no_argument, &dbx_commands, 1}, @@ -48,10 +48,10 @@ Index: gdb-7.0.50.20100121/gdb/main.c "), stream); fputs_unfiltered (_("\ --se=FILE Use FILE as symbol file and executable file.\n\ -Index: gdb-7.0.50.20100121/gdb/symfile.c +Index: gdb-7.0.90.20100306/gdb/symfile.c =================================================================== ---- gdb-7.0.50.20100121.orig/gdb/symfile.c 2010-01-21 15:11:09.000000000 +0100 -+++ gdb-7.0.50.20100121/gdb/symfile.c 2010-01-21 15:13:02.000000000 +0100 +--- gdb-7.0.90.20100306.orig/gdb/symfile.c 2010-03-06 23:19:13.000000000 +0100 ++++ gdb-7.0.90.20100306/gdb/symfile.c 2010-03-06 23:20:35.000000000 +0100 @@ -79,6 +79,7 @@ static void clear_symtab_users_cleanup ( /* Global variables owned by this file */ @@ -60,19 +60,19 @@ Index: gdb-7.0.50.20100121/gdb/symfile.c /* External variables and functions referenced. */ -Index: gdb-7.0.50.20100121/gdb/dwarf2read.c +Index: gdb-7.0.90.20100306/gdb/dwarf2read.c =================================================================== ---- gdb-7.0.50.20100121.orig/gdb/dwarf2read.c 2010-01-21 15:11:09.000000000 +0100 -+++ gdb-7.0.50.20100121/gdb/dwarf2read.c 2010-01-21 15:13:15.000000000 +0100 -@@ -53,6 +53,7 @@ +--- gdb-7.0.90.20100306.orig/gdb/dwarf2read.c 2010-03-06 23:19:13.000000000 +0100 ++++ gdb-7.0.90.20100306/gdb/dwarf2read.c 2010-03-06 23:20:54.000000000 +0100 +@@ -52,6 +52,7 @@ + #include "f-lang.h" #include "typeprint.h" #include "jv-lang.h" - #include "vec.h" +#include "top.h" #include #include "gdb_string.h" -@@ -1237,7 +1238,8 @@ dwarf2_has_info (struct objfile *objfile +@@ -1222,7 +1223,8 @@ dwarf2_has_info (struct objfile *objfile bfd_map_over_sections (objfile->obfd, dwarf2_locate_sections, NULL); } @@ -82,10 +82,10 @@ Index: gdb-7.0.50.20100121/gdb/dwarf2read.c && dwarf2_per_objfile->abbrev.asection != NULL); } -Index: gdb-7.0.50.20100121/gdb/top.h +Index: gdb-7.0.90.20100306/gdb/top.h =================================================================== ---- gdb-7.0.50.20100121.orig/gdb/top.h 2010-01-01 08:31:42.000000000 +0100 -+++ gdb-7.0.50.20100121/gdb/top.h 2010-01-21 15:13:02.000000000 +0100 +--- gdb-7.0.90.20100306.orig/gdb/top.h 2010-01-01 08:31:42.000000000 +0100 ++++ gdb-7.0.90.20100306/gdb/top.h 2010-03-06 23:20:35.000000000 +0100 @@ -63,6 +63,7 @@ extern void set_prompt (char *); /* From random places. */ diff --git a/gdb-6.3-test-pie-20050107.patch b/gdb-6.3-test-pie-20050107.patch index e4227ef..f9d5bb4 100644 --- a/gdb-6.3-test-pie-20050107.patch +++ b/gdb-6.3-test-pie-20050107.patch @@ -1,29 +1,29 @@ -Index: gdb-6.8.50.20090909/gdb/testsuite/configure.ac +Index: gdb-7.0.90.20100306/gdb/testsuite/configure.ac =================================================================== ---- gdb-6.8.50.20090909.orig/gdb/testsuite/configure.ac 2009-07-31 17:38:16.000000000 +0200 -+++ gdb-6.8.50.20090909/gdb/testsuite/configure.ac 2009-09-09 19:06:01.000000000 +0200 +--- gdb-7.0.90.20100306.orig/gdb/testsuite/configure.ac 2010-02-19 20:16:36.000000000 +0100 ++++ gdb-7.0.90.20100306/gdb/testsuite/configure.ac 2010-03-06 23:19:56.000000000 +0100 @@ -144,6 +144,6 @@ AC_OUTPUT([Makefile \ gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile \ - gdb.fortran/Makefile gdb.server/Makefile \ - gdb.java/Makefile gdb.mi/Makefile gdb.modula2/Makefile \ + gdb.fortran/Makefile gdb.server/Makefile gdb.java/Makefile \ + gdb.mi/Makefile gdb.modula2/Makefile gdb.multi/Makefile \ - gdb.objc/Makefile gdb.opt/Makefile gdb.pascal/Makefile \ + gdb.objc/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.pie/Makefile \ gdb.python/Makefile gdb.reverse/Makefile \ gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile]) -Index: gdb-6.8.50.20090909/gdb/testsuite/configure +Index: gdb-7.0.90.20100306/gdb/testsuite/configure =================================================================== ---- gdb-6.8.50.20090909.orig/gdb/testsuite/configure 2009-08-22 18:56:43.000000000 +0200 -+++ gdb-6.8.50.20090909/gdb/testsuite/configure 2009-09-09 19:06:27.000000000 +0200 +--- gdb-7.0.90.20100306.orig/gdb/testsuite/configure 2010-02-19 20:16:36.000000000 +0100 ++++ gdb-7.0.90.20100306/gdb/testsuite/configure 2010-03-06 23:20:12.000000000 +0100 @@ -3515,7 +3515,7 @@ done --ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.fortran/Makefile gdb.server/Makefile gdb.java/Makefile gdb.mi/Makefile gdb.modula2/Makefile gdb.objc/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.python/Makefile gdb.reverse/Makefile gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile" -+ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.fortran/Makefile gdb.server/Makefile gdb.java/Makefile gdb.mi/Makefile gdb.modula2/Makefile gdb.objc/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.pie/Makefile gdb.python/Makefile gdb.reverse/Makefile gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile" +-ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.fortran/Makefile gdb.server/Makefile gdb.java/Makefile gdb.mi/Makefile gdb.modula2/Makefile gdb.multi/Makefile gdb.objc/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.python/Makefile gdb.reverse/Makefile gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile" ++ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.fortran/Makefile gdb.server/Makefile gdb.java/Makefile gdb.mi/Makefile gdb.modula2/Makefile gdb.multi/Makefile gdb.objc/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.pie/Makefile gdb.python/Makefile gdb.reverse/Makefile gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure -@@ -4231,6 +4231,7 @@ do +@@ -4232,6 +4232,7 @@ do "gdb.objc/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.objc/Makefile" ;; "gdb.opt/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.opt/Makefile" ;; "gdb.pascal/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.pascal/Makefile" ;; @@ -31,10 +31,10 @@ Index: gdb-6.8.50.20090909/gdb/testsuite/configure "gdb.python/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.python/Makefile" ;; "gdb.reverse/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.reverse/Makefile" ;; "gdb.threads/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.threads/Makefile" ;; -Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/attach.c +Index: gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/attach.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/attach.c 2009-09-09 19:06:01.000000000 +0200 ++++ gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/attach.c 2010-03-06 23:19:31.000000000 +0100 @@ -0,0 +1,20 @@ +/* This program is intended to be started outside of gdb, and then + attached to by gdb. Thus, it simply spins in a loop. The loop @@ -56,10 +56,10 @@ Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/attach.c + } + return 0; +} -Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/attach2.c +Index: gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/attach2.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/attach2.c 2009-09-09 19:06:01.000000000 +0200 ++++ gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/attach2.c 2010-03-06 23:19:31.000000000 +0100 @@ -0,0 +1,24 @@ +/* This program is intended to be started outside of gdb, and then + attached to by gdb. Thus, it simply spins in a loop. The loop @@ -85,10 +85,10 @@ Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/attach2.c + } + return (0); +} -Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/break.c +Index: gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/break.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/break.c 2009-09-09 19:06:01.000000000 +0200 ++++ gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/break.c 2010-03-06 23:19:31.000000000 +0100 @@ -0,0 +1,146 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -236,10 +236,10 @@ Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/break.c + } + return 0; +} -Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/break1.c +Index: gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/break1.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/break1.c 2009-09-09 19:06:01.000000000 +0200 ++++ gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/break1.c 2010-03-06 23:19:31.000000000 +0100 @@ -0,0 +1,44 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -285,10 +285,10 @@ Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/break1.c +void marker3 (a, b) char *a, *b; {} /* set breakpoint 18 here */ +void marker4 (d) long d; {} /* set breakpoint 13 here */ +#endif -Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/coremaker.c +Index: gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/coremaker.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/coremaker.c 2009-09-09 19:06:01.000000000 +0200 ++++ gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/coremaker.c 2010-03-06 23:19:31.000000000 +0100 @@ -0,0 +1,142 @@ +/* Copyright 1992, 1993, 1994, 1995, 1996, 1999 + Free Software Foundation, Inc. @@ -432,10 +432,10 @@ Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/coremaker.c + return 0; +} + -Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/attach.exp +Index: gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/attach.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/attach.exp 2009-09-09 19:06:01.000000000 +0200 ++++ gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/attach.exp 2010-03-06 23:19:31.000000000 +0100 @@ -0,0 +1,433 @@ +# Copyright 1997, 1999, 2002 Free Software Foundation, Inc. + @@ -870,10 +870,10 @@ Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/attach.exp +do_call_attach_tests + +return 0 -Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/break.exp +Index: gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/break.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/break.exp 2009-09-09 19:06:01.000000000 +0200 ++++ gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/break.exp 2010-03-06 23:19:31.000000000 +0100 @@ -0,0 +1,977 @@ +# Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2002, 2003, 2004 @@ -1852,10 +1852,10 @@ Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/break.exp + send_gdb "set args main\n" + gdb_expect -re ".*$gdb_prompt $" {} +} -Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/corefile.exp +Index: gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/corefile.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/corefile.exp 2009-09-09 19:06:01.000000000 +0200 ++++ gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/corefile.exp 2010-03-06 23:19:31.000000000 +0100 @@ -0,0 +1,243 @@ +# Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 +# Free Software Foundation, Inc. @@ -2100,10 +2100,10 @@ Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/corefile.exp +gdb_test "up" "#\[0-9\]* *\[0-9xa-fH'\]* in .* \\(.*\\).*" "up in corefile.exp (reinit)" + +gdb_test "core" "No core file now." -Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/Makefile.in +Index: gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/Makefile.in =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/Makefile.in 2009-09-09 19:06:01.000000000 +0200 ++++ gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/Makefile.in 2010-03-06 23:19:31.000000000 +0100 @@ -0,0 +1,19 @@ +VPATH = @srcdir@ +srcdir = @srcdir@ diff --git a/gdb-6.5-bz203661-emit-relocs.patch b/gdb-6.5-bz203661-emit-relocs.patch index f58cc9e..61e0d56 100644 --- a/gdb-6.5-bz203661-emit-relocs.patch +++ b/gdb-6.5-bz203661-emit-relocs.patch @@ -1,11 +1,11 @@ -Index: gdb-6.8.50.20090802/gdb/symfile.c +Index: gdb-7.0.90.20100306/gdb/symfile.c =================================================================== ---- gdb-6.8.50.20090802.orig/gdb/symfile.c 2009-08-03 12:29:58.000000000 +0200 -+++ gdb-6.8.50.20090802/gdb/symfile.c 2009-08-03 12:40:58.000000000 +0200 -@@ -4012,6 +4012,12 @@ symfile_dummy_outputs (bfd *abfd, asecti - bfd_byte * - symfile_relocate_debug_section (bfd *abfd, asection *sectp, bfd_byte *buf) +--- gdb-7.0.90.20100306.orig/gdb/symfile.c 2010-03-06 23:20:35.000000000 +0100 ++++ gdb-7.0.90.20100306/gdb/symfile.c 2010-03-06 23:26:25.000000000 +0100 +@@ -3642,6 +3642,12 @@ default_symfile_relocate (struct objfile { + bfd *abfd = objfile->obfd; + + /* Executable files have all the relocations already resolved. + * Handle files linked with --emit-relocs. + * http://sources.redhat.com/ml/gdb/2006-08/msg00137.html */ diff --git a/gdb-6.6-buildid-locate-core-as-arg.patch b/gdb-6.6-buildid-locate-core-as-arg.patch index f2fd4fe..442399b 100644 --- a/gdb-6.6-buildid-locate-core-as-arg.patch +++ b/gdb-6.6-buildid-locate-core-as-arg.patch @@ -58,10 +58,10 @@ Http://sourceware.org/ml/gdb-patches/2010-01/msg00517.html * exec.c (exec_file_attach): Print a more useful error message if the user did "gdb core". -Index: gdb-7.0.50.20100128/gdb/exceptions.h +Index: gdb-7.0.90.20100306/gdb/exceptions.h =================================================================== ---- gdb-7.0.50.20100128.orig/gdb/exceptions.h 2010-01-18 07:25:22.000000000 +0100 -+++ gdb-7.0.50.20100128/gdb/exceptions.h 2010-01-28 22:49:00.000000000 +0100 +--- gdb-7.0.90.20100306.orig/gdb/exceptions.h 2010-01-18 07:25:22.000000000 +0100 ++++ gdb-7.0.90.20100306/gdb/exceptions.h 2010-03-06 23:30:56.000000000 +0100 @@ -78,6 +78,9 @@ enum errors { /* Feature is not supported in this copy of GDB. */ UNSUPPORTED_ERROR, @@ -72,11 +72,11 @@ Index: gdb-7.0.50.20100128/gdb/exceptions.h /* Add more errors here. */ NR_ERRORS }; -Index: gdb-7.0.50.20100128/gdb/exec.c +Index: gdb-7.0.90.20100306/gdb/exec.c =================================================================== ---- gdb-7.0.50.20100128.orig/gdb/exec.c 2010-01-28 22:48:59.000000000 +0100 -+++ gdb-7.0.50.20100128/gdb/exec.c 2010-01-28 22:58:45.000000000 +0100 -@@ -34,6 +34,7 @@ +--- gdb-7.0.90.20100306.orig/gdb/exec.c 2010-03-06 23:29:06.000000000 +0100 ++++ gdb-7.0.90.20100306/gdb/exec.c 2010-03-06 23:31:40.000000000 +0100 +@@ -35,6 +35,7 @@ #include "gdbthread.h" #include "progspace.h" #include "solib.h" @@ -84,7 +84,7 @@ Index: gdb-7.0.50.20100128/gdb/exec.c #include #include "readline/readline.h" -@@ -258,6 +259,17 @@ exec_file_attach (char *filename, int fr +@@ -264,6 +265,17 @@ exec_file_attach (char *filename, int fr /* Make sure to close exec_bfd, or else "run" might try to use it. */ exec_close (); @@ -95,17 +95,17 @@ Index: gdb-7.0.50.20100128/gdb/exec.c + "trad-core". */ + if (bfd_check_format (exec_bfd, bfd_core)) + throw_error (IS_CORE_ERROR, -+ _("\"%s\" is a core file.\n" -+ "Please specify an executable to debug."), -+ scratch_pathname); ++ _("\"%s\" is a core file.\n" ++ "Please specify an executable to debug."), ++ scratch_pathname); + error (_("\"%s\": not in executable format: %s"), - scratch_pathname, bfd_errmsg (bfd_get_error ())); - } -Index: gdb-7.0.50.20100128/gdb/main.c + scratch_pathname, + gdb_bfd_errmsg (bfd_get_error (), matching)); +Index: gdb-7.0.90.20100306/gdb/main.c =================================================================== ---- gdb-7.0.50.20100128.orig/gdb/main.c 2010-01-28 22:48:59.000000000 +0100 -+++ gdb-7.0.50.20100128/gdb/main.c 2010-01-28 22:49:00.000000000 +0100 +--- gdb-7.0.90.20100306.orig/gdb/main.c 2010-03-06 23:20:35.000000000 +0100 ++++ gdb-7.0.90.20100306/gdb/main.c 2010-03-06 23:30:56.000000000 +0100 @@ -241,6 +241,36 @@ captured_command_loop (void *data) return 1; } diff --git a/gdb-archer-pie-addons.patch b/gdb-archer-pie-addons.patch index 6575d5d..0c92628 100644 --- a/gdb-archer-pie-addons.patch +++ b/gdb-archer-pie-addons.patch @@ -1,8 +1,8 @@ -Index: gdb-7.0.50.20100115/gdb/dwarf2read.c +Index: gdb-7.0.90.20100306/gdb/dwarf2read.c =================================================================== ---- gdb-7.0.50.20100115.orig/gdb/dwarf2read.c 2010-01-15 21:41:32.000000000 +0100 -+++ gdb-7.0.50.20100115/gdb/dwarf2read.c 2010-01-15 21:42:19.000000000 +0100 -@@ -5821,7 +5821,12 @@ read_common_block (struct die_info *die, +--- gdb-7.0.90.20100306.orig/gdb/dwarf2read.c 2010-03-06 23:27:30.000000000 +0100 ++++ gdb-7.0.90.20100306/gdb/dwarf2read.c 2010-03-06 23:28:43.000000000 +0100 +@@ -5910,7 +5910,12 @@ read_common_block (struct die_info *die, { struct attribute *attr; struct symbol *sym; @@ -16,7 +16,7 @@ Index: gdb-7.0.50.20100115/gdb/dwarf2read.c attr = dwarf2_attr (die, DW_AT_location, cu); if (attr) -@@ -5830,6 +5835,7 @@ read_common_block (struct die_info *die, +@@ -5919,6 +5924,7 @@ read_common_block (struct die_info *die, if (attr_form_is_block (attr)) { base = decode_locdesc (DW_BLOCK (attr), cu); @@ -24,7 +24,7 @@ Index: gdb-7.0.50.20100115/gdb/dwarf2read.c } else if (attr_form_is_section_offset (attr)) { -@@ -5891,12 +5897,15 @@ read_common_block (struct die_info *die, +@@ -5980,12 +5986,15 @@ read_common_block (struct die_info *die, else dwarf2_complex_location_expr_complaint (); @@ -42,7 +42,7 @@ Index: gdb-7.0.50.20100115/gdb/dwarf2read.c else SET_FIELD_PHYSNAME (*field, SYMBOL_LINKAGE_NAME (sym)); FIELD_TYPE (*field) = SYMBOL_TYPE (sym); -@@ -5910,7 +5919,7 @@ read_common_block (struct die_info *die, +@@ -5999,7 +6008,7 @@ read_common_block (struct die_info *die, sym = new_symbol (die, type, cu); /* SYMBOL_VALUE_ADDRESS never gets used as all its fields are static. */ @@ -51,11 +51,11 @@ Index: gdb-7.0.50.20100115/gdb/dwarf2read.c set_die_type (die, type, cu); } -Index: gdb-7.0.50.20100115/gdb/exec.c +Index: gdb-7.0.90.20100306/gdb/exec.c =================================================================== ---- gdb-7.0.50.20100115.orig/gdb/exec.c 2010-01-15 21:35:14.000000000 +0100 -+++ gdb-7.0.50.20100115/gdb/exec.c 2010-01-15 21:47:19.000000000 +0100 -@@ -35,6 +35,7 @@ +--- gdb-7.0.90.20100306.orig/gdb/exec.c 2010-03-06 23:21:01.000000000 +0100 ++++ gdb-7.0.90.20100306/gdb/exec.c 2010-03-06 23:29:06.000000000 +0100 +@@ -34,6 +34,7 @@ #include "arch-utils.h" #include "gdbthread.h" #include "progspace.h" @@ -63,10 +63,10 @@ Index: gdb-7.0.50.20100115/gdb/exec.c #include #include "readline/readline.h" -@@ -225,6 +226,10 @@ exec_file_attach (char *filename, int fr - char *scratch_pathname; +@@ -220,6 +221,10 @@ exec_file_attach (char *filename, int fr int scratch_chan; struct target_section *sections = NULL, *sections_end = NULL; + char **matching; + struct target_section *p; + int addr_bit; + CORE_ADDR mask = CORE_ADDR_MAX; @@ -74,7 +74,7 @@ Index: gdb-7.0.50.20100115/gdb/exec.c scratch_chan = openp (getenv ("PATH"), OPF_TRY_CWD_FIRST, filename, write_files ? O_RDWR | O_BINARY : O_RDONLY | O_BINARY, -@@ -293,12 +298,23 @@ exec_file_attach (char *filename, int fr +@@ -289,12 +294,23 @@ exec_file_attach (char *filename, int fr scratch_pathname, bfd_errmsg (bfd_get_error ())); } @@ -100,11 +100,11 @@ Index: gdb-7.0.50.20100115/gdb/exec.c /* Add the executable's sections to the current address spaces' list of sections. This possibly pushes the exec_ops target. */ -Index: gdb-7.0.50.20100115/gdb/gdbtypes.h +Index: gdb-7.0.90.20100306/gdb/gdbtypes.h =================================================================== ---- gdb-7.0.50.20100115.orig/gdb/gdbtypes.h 2010-01-15 21:35:16.000000000 +0100 -+++ gdb-7.0.50.20100115/gdb/gdbtypes.h 2010-01-15 21:44:24.000000000 +0100 -@@ -406,6 +406,7 @@ enum type_instance_flag_value +--- gdb-7.0.90.20100306.orig/gdb/gdbtypes.h 2010-03-06 23:26:34.000000000 +0100 ++++ gdb-7.0.90.20100306/gdb/gdbtypes.h 2010-03-06 23:28:43.000000000 +0100 +@@ -412,6 +412,7 @@ enum type_instance_flag_value enum field_loc_kind { FIELD_LOC_KIND_BITPOS, /* bitpos */ @@ -112,7 +112,7 @@ Index: gdb-7.0.50.20100115/gdb/gdbtypes.h FIELD_LOC_KIND_PHYSADDR, /* physaddr */ FIELD_LOC_KIND_PHYSNAME /* physname */ }; -@@ -582,6 +583,7 @@ struct main_type +@@ -591,6 +592,7 @@ struct main_type is the location (in the target) of the static field. Otherwise, physname is the mangled label of the static field. */ @@ -120,7 +120,7 @@ Index: gdb-7.0.50.20100115/gdb/gdbtypes.h CORE_ADDR physaddr; char *physname; } -@@ -1100,6 +1102,7 @@ extern void allocate_gnat_aux_type (stru +@@ -1091,6 +1093,7 @@ extern void allocate_gnat_aux_type (stru #define FIELD_LOC_KIND(thisfld) ((thisfld).loc_kind) #define FIELD_BITPOS(thisfld) ((thisfld).loc.bitpos) #define FIELD_STATIC_PHYSNAME(thisfld) ((thisfld).loc.physname) @@ -128,7 +128,7 @@ Index: gdb-7.0.50.20100115/gdb/gdbtypes.h #define FIELD_STATIC_PHYSADDR(thisfld) ((thisfld).loc.physaddr) #define SET_FIELD_BITPOS(thisfld, bitpos) \ (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_BITPOS, \ -@@ -1107,6 +1110,7 @@ extern void allocate_gnat_aux_type (stru +@@ -1098,6 +1101,7 @@ extern void allocate_gnat_aux_type (stru #define SET_FIELD_PHYSNAME(thisfld, name) \ (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSNAME, \ FIELD_STATIC_PHYSNAME (thisfld) = (name)) @@ -136,7 +136,7 @@ Index: gdb-7.0.50.20100115/gdb/gdbtypes.h #define SET_FIELD_PHYSADDR(thisfld, addr) \ (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSADDR, \ FIELD_STATIC_PHYSADDR (thisfld) = (addr)) -@@ -1119,6 +1123,7 @@ extern void allocate_gnat_aux_type (stru +@@ -1110,6 +1114,7 @@ extern void allocate_gnat_aux_type (stru #define TYPE_FIELD_LOC_KIND(thistype, n) FIELD_LOC_KIND (TYPE_FIELD (thistype, n)) #define TYPE_FIELD_BITPOS(thistype, n) FIELD_BITPOS (TYPE_FIELD (thistype, n)) #define TYPE_FIELD_STATIC_PHYSNAME(thistype, n) FIELD_STATIC_PHYSNAME (TYPE_FIELD (thistype, n)) @@ -144,10 +144,10 @@ Index: gdb-7.0.50.20100115/gdb/gdbtypes.h #define TYPE_FIELD_STATIC_PHYSADDR(thistype, n) FIELD_STATIC_PHYSADDR (TYPE_FIELD (thistype, n)) #define TYPE_FIELD_ARTIFICIAL(thistype, n) FIELD_ARTIFICIAL(TYPE_FIELD(thistype,n)) #define TYPE_FIELD_BITSIZE(thistype, n) FIELD_BITSIZE(TYPE_FIELD(thistype,n)) -Index: gdb-7.0.50.20100115/gdb/jv-lang.c +Index: gdb-7.0.90.20100306/gdb/jv-lang.c =================================================================== ---- gdb-7.0.50.20100115.orig/gdb/jv-lang.c 2010-01-15 21:35:13.000000000 +0100 -+++ gdb-7.0.50.20100115/gdb/jv-lang.c 2010-01-15 21:41:58.000000000 +0100 +--- gdb-7.0.90.20100306.orig/gdb/jv-lang.c 2010-03-06 23:19:13.000000000 +0100 ++++ gdb-7.0.90.20100306/gdb/jv-lang.c 2010-03-06 23:28:43.000000000 +0100 @@ -416,7 +416,8 @@ java_link_class_type (struct gdbarch *gd fields = NULL; @@ -168,11 +168,11 @@ Index: gdb-7.0.50.20100115/gdb/jv-lang.c else TYPE_FIELD_BITPOS (type, i) = 8 * boffset; if (accflags & 0x8000) /* FIELD_UNRESOLVED_FLAG */ -Index: gdb-7.0.50.20100115/gdb/solib-svr4.c +Index: gdb-7.0.90.20100306/gdb/solib-svr4.c =================================================================== ---- gdb-7.0.50.20100115.orig/gdb/solib-svr4.c 2010-01-15 21:35:16.000000000 +0100 -+++ gdb-7.0.50.20100115/gdb/solib-svr4.c 2010-01-15 21:44:55.000000000 +0100 -@@ -1689,7 +1689,10 @@ svr4_exec_displacement (void) +--- gdb-7.0.90.20100306.orig/gdb/solib-svr4.c 2010-03-06 23:26:34.000000000 +0100 ++++ gdb-7.0.90.20100306/gdb/solib-svr4.c 2010-03-06 23:28:43.000000000 +0100 +@@ -1767,7 +1767,10 @@ svr4_exec_displacement (void) if (target_auxv_search (¤t_target, AT_ENTRY, &entry_point) == 1) return entry_point - bfd_get_start_address (exec_bfd); @@ -184,7 +184,7 @@ Index: gdb-7.0.50.20100115/gdb/solib-svr4.c } /* Relocate the main executable. This function should be called upon -@@ -1700,7 +1703,7 @@ svr4_exec_displacement (void) +@@ -1778,7 +1781,7 @@ svr4_exec_displacement (void) static void svr4_relocate_main_executable (void) { @@ -193,7 +193,7 @@ Index: gdb-7.0.50.20100115/gdb/solib-svr4.c /* Even if DISPLACEMENT is 0 still try to relocate it as this is a new difference of in-memory vs. in-file addresses and we could already -@@ -2054,6 +2057,7 @@ _initialize_svr4_solib (void) +@@ -2130,6 +2133,7 @@ _initialize_svr4_solib (void) svr4_so_ops.free_so = svr4_free_so; svr4_so_ops.clear_solib = svr4_clear_solib; svr4_so_ops.solib_create_inferior_hook = svr4_solib_create_inferior_hook; @@ -201,11 +201,11 @@ Index: gdb-7.0.50.20100115/gdb/solib-svr4.c svr4_so_ops.special_symbol_handling = svr4_special_symbol_handling; svr4_so_ops.current_sos = svr4_current_sos; svr4_so_ops.open_symbol_file_object = open_symbol_file_object; -Index: gdb-7.0.50.20100115/gdb/solib.c +Index: gdb-7.0.90.20100306/gdb/solib.c =================================================================== ---- gdb-7.0.50.20100115.orig/gdb/solib.c 2010-01-15 21:35:16.000000000 +0100 -+++ gdb-7.0.50.20100115/gdb/solib.c 2010-01-15 21:41:58.000000000 +0100 -@@ -1037,6 +1037,19 @@ solib_create_inferior_hook (int from_tty +--- gdb-7.0.90.20100306.orig/gdb/solib.c 2010-03-06 23:26:34.000000000 +0100 ++++ gdb-7.0.90.20100306/gdb/solib.c 2010-03-06 23:28:43.000000000 +0100 +@@ -1039,6 +1039,19 @@ solib_create_inferior_hook (int from_tty ops->solib_create_inferior_hook (from_tty); } @@ -225,10 +225,10 @@ Index: gdb-7.0.50.20100115/gdb/solib.c /* GLOBAL FUNCTION in_solib_dynsym_resolve_code -- check to see if an address is in -Index: gdb-7.0.50.20100115/gdb/solib.h +Index: gdb-7.0.90.20100306/gdb/solib.h =================================================================== ---- gdb-7.0.50.20100115.orig/gdb/solib.h 2010-01-08 23:52:04.000000000 +0100 -+++ gdb-7.0.50.20100115/gdb/solib.h 2010-01-15 21:42:36.000000000 +0100 +--- gdb-7.0.90.20100306.orig/gdb/solib.h 2010-01-08 23:52:04.000000000 +0100 ++++ gdb-7.0.90.20100306/gdb/solib.h 2010-03-06 23:28:43.000000000 +0100 @@ -44,6 +44,8 @@ extern int solib_read_symbols (struct so extern void solib_create_inferior_hook (int from_tty); @@ -238,10 +238,10 @@ Index: gdb-7.0.50.20100115/gdb/solib.h /* If ADDR lies in a shared library, return its name. */ extern char *solib_name_from_address (struct program_space *, CORE_ADDR); -Index: gdb-7.0.50.20100115/gdb/solist.h +Index: gdb-7.0.90.20100306/gdb/solist.h =================================================================== ---- gdb-7.0.50.20100115.orig/gdb/solist.h 2010-01-08 23:52:04.000000000 +0100 -+++ gdb-7.0.50.20100115/gdb/solist.h 2010-01-15 21:41:58.000000000 +0100 +--- gdb-7.0.90.20100306.orig/gdb/solist.h 2010-03-06 23:19:13.000000000 +0100 ++++ gdb-7.0.90.20100306/gdb/solist.h 2010-03-06 23:28:43.000000000 +0100 @@ -92,6 +92,9 @@ struct target_so_ops /* Target dependent code to run after child process fork. */ void (*solib_create_inferior_hook) (int from_tty); @@ -252,11 +252,11 @@ Index: gdb-7.0.50.20100115/gdb/solist.h /* Do additional symbol handling, lookup, etc. after symbols for a shared object have been loaded. */ void (*special_symbol_handling) (void); -Index: gdb-7.0.50.20100115/gdb/symfile.c +Index: gdb-7.0.90.20100306/gdb/symfile.c =================================================================== ---- gdb-7.0.50.20100115.orig/gdb/symfile.c 2010-01-15 21:35:14.000000000 +0100 -+++ gdb-7.0.50.20100115/gdb/symfile.c 2010-01-15 21:41:58.000000000 +0100 -@@ -832,15 +832,36 @@ syms_from_objfile (struct objfile *objfi +--- gdb-7.0.90.20100306.orig/gdb/symfile.c 2010-03-06 23:26:25.000000000 +0100 ++++ gdb-7.0.90.20100306/gdb/symfile.c 2010-03-06 23:28:43.000000000 +0100 +@@ -827,15 +827,36 @@ syms_from_objfile (struct objfile *objfi if an error occurs during symbol reading. */ old_chain = make_cleanup_free_objfile (objfile); @@ -300,10 +300,10 @@ Index: gdb-7.0.50.20100115/gdb/symfile.c } /* Now either addrs or offsets is non-zero. */ -Index: gdb-7.0.50.20100115/gdb/value.c +Index: gdb-7.0.90.20100306/gdb/value.c =================================================================== ---- gdb-7.0.50.20100115.orig/gdb/value.c 2010-01-15 21:35:13.000000000 +0100 -+++ gdb-7.0.50.20100115/gdb/value.c 2010-01-15 21:41:58.000000000 +0100 +--- gdb-7.0.90.20100306.orig/gdb/value.c 2010-03-06 23:19:13.000000000 +0100 ++++ gdb-7.0.90.20100306/gdb/value.c 2010-03-06 23:28:43.000000000 +0100 @@ -1897,7 +1897,8 @@ value_static_field (struct type *type, i if (TYPE_FIELD_LOC_KIND (type, fieldno) == FIELD_LOC_KIND_PHYSADDR) { diff --git a/gdb-archer.patch b/gdb-archer.patch index 3ec58c3..a63780f 100644 --- a/gdb-archer.patch +++ b/gdb-archer.patch @@ -2,17 +2,17 @@ http://sourceware.org/gdb/wiki/ProjectArcher http://sourceware.org/gdb/wiki/ArcherBranchManagement GIT snapshot: -commit 285cf618d9b90b7f8f201f094bcfead3c9ba8925 +commit cb854301ce799ed6c96a80a03d829f3d186e4811 branch `archer' - the merge of branches: -archer-tromey-delayed-symfile +archer-tromey-delayed-symfile2 archer-tromey-python -archer-pmuldoon-next-over-throw -archer-jankratochvil-fortran-module -archer-jankratochvil-watchpoint +archer-pmuldoon-next-over-throw2 +archer-jankratochvil-fortran-module2 +archer-jankratochvil-watchpoint2 archer-jankratochvil-vla archer-keiths-expr-cumulative -archer-jankratochvil-ifunc +# plus older archer-jankratochvil-ifunc diff --git a/gdb/Makefile.in b/gdb/Makefile.in @@ -190,7 +190,7 @@ index 98f42b9..dbf8273 100644 # Dependency tracking. Most of this is conditional on GNU Make being # found by configure; if GNU Make is not found, we fall back to a diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c -index 40b70ab..b291d40 100644 +index 7a2d2ca..4bf4e31 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -4781,14 +4781,10 @@ ada_lookup_symbol (const char *name, const struct block *block0, @@ -209,7 +209,7 @@ index 40b70ab..b291d40 100644 } -@@ -10931,6 +10927,40 @@ ada_operator_length (struct expression *exp, int pc, int *oplenp, int *argsp) +@@ -10938,6 +10934,40 @@ ada_operator_length (struct expression *exp, int pc, int *oplenp, int *argsp) } } @@ -250,7 +250,7 @@ index 40b70ab..b291d40 100644 static char * ada_op_name (enum exp_opcode opcode) { -@@ -11319,6 +11349,7 @@ parse (void) +@@ -11326,6 +11356,7 @@ parse (void) static const struct exp_descriptor ada_exp_descriptor = { ada_print_subexp, ada_operator_length, @@ -314,7 +314,7 @@ index 5c9e558..55a1873 100644 /* Override the GNU/Linux inferior startup hook. */ diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c -index 01cc1ce..2a0fa84 100644 +index c28eef7..02c11e1 100644 --- a/gdb/amd64-linux-tdep.c +++ b/gdb/amd64-linux-tdep.c @@ -1481,6 +1481,9 @@ amd64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) @@ -342,10 +342,10 @@ index af409f6..406c066 100644 /* Provide a prototype to silence -Wmissing-prototypes. */ diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c -index 5776bb0..6099e99 100644 +index 3e151de..ddbcb6e 100644 --- a/gdb/ax-gdb.c +++ b/gdb/ax-gdb.c -@@ -1810,7 +1810,7 @@ gen_expr (struct expression *exp, union exp_element **pc, +@@ -1812,7 +1812,7 @@ gen_expr (struct expression *exp, union exp_element **pc, /* Calling lookup_block_symbol is necessary to get the LOC_REGISTER symbol instead of the LOC_ARG one (if both exist). */ @@ -432,7 +432,7 @@ index 7eedb6c..b147826 100644 + #endif /* BLOCK_H */ diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c -index 0d55862..9258c6a 100644 +index 8c97949..0b66740 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -61,6 +61,7 @@ @@ -788,7 +788,7 @@ index 0d55862..9258c6a 100644 case bp_tracepoint: case bp_fast_tracepoint: case bp_jit_event: -@@ -4818,6 +4906,8 @@ allocate_bp_location (struct breakpoint *bpt) +@@ -4816,6 +4904,8 @@ allocate_bp_location (struct breakpoint *bpt) case bp_finish: case bp_longjmp: case bp_longjmp_resume: @@ -797,7 +797,7 @@ index 0d55862..9258c6a 100644 case bp_step_resume: case bp_watchpoint_scope: case bp_call_dummy: -@@ -4826,6 +4916,7 @@ allocate_bp_location (struct breakpoint *bpt) +@@ -4824,6 +4914,7 @@ allocate_bp_location (struct breakpoint *bpt) case bp_overlay_event: case bp_jit_event: case bp_longjmp_master: @@ -855,7 +855,7 @@ index 0d55862..9258c6a 100644 break; } -@@ -7508,6 +7602,7 @@ struct until_break_command_continuation_args +@@ -7509,6 +7603,7 @@ struct until_break_command_continuation_args { struct breakpoint *breakpoint; struct breakpoint *breakpoint2; @@ -863,7 +863,7 @@ index 0d55862..9258c6a 100644 }; /* This function is called by fetch_inferior_event via the -@@ -7522,6 +7617,7 @@ until_break_command_continuation (void *arg) +@@ -7523,6 +7618,7 @@ until_break_command_continuation (void *arg) delete_breakpoint (a->breakpoint); if (a->breakpoint2) delete_breakpoint (a->breakpoint2); @@ -871,7 +871,7 @@ index 0d55862..9258c6a 100644 } void -@@ -7533,6 +7629,8 @@ until_break_command (char *arg, int from_tty, int anywhere) +@@ -7534,6 +7630,8 @@ until_break_command (char *arg, int from_tty, int anywhere) struct breakpoint *breakpoint; struct breakpoint *breakpoint2 = NULL; struct cleanup *old_chain; @@ -880,7 +880,7 @@ index 0d55862..9258c6a 100644 clear_proceed_status (); -@@ -7571,6 +7669,9 @@ until_break_command (char *arg, int from_tty, int anywhere) +@@ -7572,6 +7670,9 @@ until_break_command (char *arg, int from_tty, int anywhere) old_chain = make_cleanup_delete_breakpoint (breakpoint); @@ -890,7 +890,7 @@ index 0d55862..9258c6a 100644 /* Keep within the current frame, or in frames called by the current one. */ -@@ -7583,6 +7684,10 @@ until_break_command (char *arg, int from_tty, int anywhere) +@@ -7584,6 +7685,10 @@ until_break_command (char *arg, int from_tty, int anywhere) frame_unwind_caller_id (frame), bp_until); make_cleanup_delete_breakpoint (breakpoint2); @@ -901,7 +901,7 @@ index 0d55862..9258c6a 100644 } proceed (-1, TARGET_SIGNAL_DEFAULT, 0); -@@ -7599,6 +7704,7 @@ until_break_command (char *arg, int from_tty, int anywhere) +@@ -7600,6 +7705,7 @@ until_break_command (char *arg, int from_tty, int anywhere) args->breakpoint = breakpoint; args->breakpoint2 = breakpoint2; @@ -909,7 +909,7 @@ index 0d55862..9258c6a 100644 discard_cleanups (old_chain); add_continuation (inferior_thread (), -@@ -8784,6 +8890,7 @@ delete_command (char *arg, int from_tty) +@@ -8796,6 +8902,7 @@ delete_command (char *arg, int from_tty) && b->type != bp_thread_event && b->type != bp_overlay_event && b->type != bp_longjmp_master @@ -917,7 +917,7 @@ index 0d55862..9258c6a 100644 && b->number >= 0) { breaks_to_delete = 1; -@@ -8803,6 +8910,7 @@ delete_command (char *arg, int from_tty) +@@ -8815,6 +8922,7 @@ delete_command (char *arg, int from_tty) && b->type != bp_jit_event && b->type != bp_overlay_event && b->type != bp_longjmp_master @@ -925,7 +925,7 @@ index 0d55862..9258c6a 100644 && b->number >= 0) delete_breakpoint (b); } -@@ -9113,6 +9221,7 @@ breakpoint_re_set_one (void *bint) +@@ -9125,6 +9233,7 @@ breakpoint_re_set_one (void *bint) reset later by breakpoint_re_set. */ case bp_overlay_event: case bp_longjmp_master: @@ -933,7 +933,7 @@ index 0d55862..9258c6a 100644 delete_breakpoint (b); break; -@@ -9135,6 +9244,8 @@ breakpoint_re_set_one (void *bint) +@@ -9147,6 +9256,8 @@ breakpoint_re_set_one (void *bint) case bp_step_resume: case bp_longjmp: case bp_longjmp_resume: @@ -942,7 +942,7 @@ index 0d55862..9258c6a 100644 case bp_jit_event: break; } -@@ -9177,6 +9288,7 @@ breakpoint_re_set (void) +@@ -9189,6 +9300,7 @@ breakpoint_re_set (void) create_longjmp_master_breakpoint ("_longjmp"); create_longjmp_master_breakpoint ("siglongjmp"); create_longjmp_master_breakpoint ("_siglongjmp"); @@ -950,7 +950,7 @@ index 0d55862..9258c6a 100644 } /* Reset the thread number of this breakpoint: -@@ -10172,6 +10284,22 @@ all_tracepoints () +@@ -10187,6 +10299,22 @@ all_tracepoints () return tp_vec; } @@ -973,7 +973,7 @@ index 0d55862..9258c6a 100644 /* This help string is used for the break, hbreak, tbreak and thbreak commands. It is defined as a macro to prevent duplication. -@@ -10716,4 +10844,5 @@ inferior in all-stop mode, gdb behaves as if always-inserted mode is off."), +@@ -10731,4 +10859,5 @@ inferior in all-stop mode, gdb behaves as if always-inserted mode is off."), automatic_hardware_breakpoints = 1; observer_attach_about_to_proceed (breakpoint_about_to_proceed); @@ -1029,10 +1029,49 @@ index 6b373a3..59aa412 100644 extern struct breakpoint *get_tracepoint (int num); diff --git a/gdb/c-exp.y b/gdb/c-exp.y -index 8e00979..b86fc8e 100644 +index 845771c..7a74d7e 100644 --- a/gdb/c-exp.y +++ b/gdb/c-exp.y -@@ -418,6 +418,24 @@ exp : exp '(' nonempty_typelist ')' const_or_volatile +@@ -186,6 +186,7 @@ static struct stoken operator_stoken (const char *); + %token STRING + %token CHAR + %token NAME /* BLOCKNAME defined below to give it higher precedence. */ ++%token UNKNOWN_CPP_NAME + %token COMPLETE + %token TYPENAME + %type name +@@ -391,6 +392,30 @@ exp : exp '(' + write_exp_elt_opcode (OP_FUNCALL); } + ; + ++exp : UNKNOWN_CPP_NAME '(' ++ { ++ ++ /* This could potentially be a an argument defined ++ lookup function (Koenig). */ ++ write_exp_elt_opcode (OP_ADL_FUNC); ++ write_exp_elt_block (expression_context_block); ++ write_exp_elt_sym (NULL); /* Place holder */ ++ write_exp_string ($1.stoken); ++ write_exp_elt_opcode (OP_ADL_FUNC); ++ ++ /* This is to save the value of arglist_len ++ being accumulated by an outer function call. */ ++ ++ start_arglist (); ++ } ++ arglist ')' %prec ARROW ++ { ++ write_exp_elt_opcode (OP_FUNCALL); ++ write_exp_elt_longcst ((LONGEST) end_arglist ()); ++ write_exp_elt_opcode (OP_FUNCALL); ++ } ++ ; ++ + lcurly : '{' + { start_arglist (); } + ; +@@ -418,6 +443,24 @@ exp : exp '(' nonempty_typelist ')' const_or_volatile } ; @@ -1057,7 +1096,7 @@ index 8e00979..b86fc8e 100644 rcurly : '}' { $$ = end_arglist () - 1; } ; -@@ -785,12 +803,13 @@ qualified_name: typebase COLONCOLON name +@@ -785,12 +828,13 @@ qualified_name: typebase COLONCOLON name ; variable: qualified_name @@ -1072,10 +1111,19 @@ index 8e00979..b86fc8e 100644 sym = lookup_symbol (name, (const struct block *) NULL, VAR_DOMAIN, (int *) NULL); -@@ -1298,6 +1317,14 @@ name_not_typename : NAME +@@ -1286,6 +1330,7 @@ name : NAME { $$ = $1.stoken; } + | BLOCKNAME { $$ = $1.stoken; } + | TYPENAME { $$ = $1.stoken; } + | NAME_OR_INT { $$ = $1.stoken; } ++ | UNKNOWN_CPP_NAME { $$ = $1.stoken; } + | operator { $$ = $1; } + ; + +@@ -1298,6 +1343,15 @@ name_not_typename : NAME context where only a name could occur, this might be useful. | NAME_OR_INT */ ++ | UNKNOWN_CPP_NAME + | operator + { + $$.stoken = $1; @@ -1087,7 +1135,7 @@ index 8e00979..b86fc8e 100644 ; %% -@@ -2033,6 +2060,13 @@ static int last_was_structop; +@@ -2033,6 +2087,13 @@ static int last_was_structop; static int yylex (void) { @@ -1101,7 +1149,7 @@ index 8e00979..b86fc8e 100644 int c; int namelen; unsigned int i; -@@ -2041,9 +2075,19 @@ yylex (void) +@@ -2041,9 +2102,19 @@ yylex (void) char *copy; last_was_structop = 0; @@ -1123,7 +1171,7 @@ index 8e00979..b86fc8e 100644 /* Check if this is a macro invocation that we need to expand. */ if (! scanning_macro_expansion ()) { -@@ -2079,10 +2123,19 @@ yylex (void) +@@ -2079,10 +2150,19 @@ yylex (void) && parse_language->la_language != language_cplus) break; @@ -1143,7 +1191,7 @@ index 8e00979..b86fc8e 100644 return tokentab2[i].token; } -@@ -2111,6 +2164,8 @@ yylex (void) +@@ -2111,6 +2191,8 @@ yylex (void) return 0; case ' ': @@ -1152,7 +1200,7 @@ index 8e00979..b86fc8e 100644 case '\t': case '\n': lexptr++; -@@ -2268,11 +2323,13 @@ yylex (void) +@@ -2268,11 +2350,13 @@ yylex (void) error ("Invalid character '%c' in expression.", c); /* It's a name. See how long it is. */ @@ -1166,7 +1214,7 @@ index 8e00979..b86fc8e 100644 /* Template parameter lists are part of the name. FIXME: This mishandles `print $a<4&&$a>3'. */ -@@ -2357,14 +2414,29 @@ yylex (void) +@@ -2357,14 +2441,33 @@ yylex (void) currently as names of types; NAME for other symbols. The caller is not constrained to care about the distinction. */ { @@ -1177,7 +1225,11 @@ index 8e00979..b86fc8e 100644 - sym = lookup_symbol (copy, expression_context_block, + if (name_prefix != NULL) -+ tmp = savestring (name_prefix, name_prefix_len+namelen); ++ { ++ tmp = alloca (name_prefix_len + namelen + 1); ++ memcpy (tmp, name_prefix, name_prefix_len + namelen); ++ tmp[name_prefix_len + namelen] = '\0'; ++ } + + sym = lookup_symbol (tmp, expression_context_block, VAR_DOMAIN, @@ -1197,11 +1249,16 @@ index 8e00979..b86fc8e 100644 /* Call lookup_symtab, not lookup_partial_symtab, in case there are no psymtabs (coff, xcoff, or some future change to blow away the psymtabs once once symbols are read). */ -@@ -2423,6 +2495,7 @@ yylex (void) +@@ -2423,6 +2526,12 @@ yylex (void) yylval.ssym.is_a_field_of_this = is_a_field_of_this; if (in_parse_field && *lexptr == '\0') saw_name_at_eof = 1; + ++ if (sym == NULL ++ && parse_language->la_language == language_cplus ++ && !lookup_minimal_symbol (tmp, NULL, NULL)) ++ return UNKNOWN_CPP_NAME; ++ return NAME; } } @@ -1218,7 +1275,7 @@ index d620881..34cb34a 100644 dump_subexp_body_standard, evaluate_subexp_c diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c -index 27746d9..d4da180 100644 +index ed98381..a405826 100644 --- a/gdb/c-typeprint.c +++ b/gdb/c-typeprint.c @@ -32,6 +32,7 @@ @@ -1325,7 +1382,7 @@ index 27746d9..d4da180 100644 passed_a_ptr, 0); break; diff --git a/gdb/coffread.c b/gdb/coffread.c -index 8e5dca9..7e7fb8b 100644 +index ba413ad..44676a8 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -2123,6 +2123,7 @@ static struct sym_fns coff_sym_fns = @@ -1365,7 +1422,7 @@ index ebde876..907b275 100644 #undef RELOC_SRCDIR diff --git a/gdb/configure b/gdb/configure -index d444b08..d4ced89 100755 +index 1983d04..8dca37e 100755 --- a/gdb/configure +++ b/gdb/configure @@ -676,6 +676,8 @@ REPORT_BUGS_TO @@ -1480,7 +1537,7 @@ index d444b08..d4ced89 100755 # Flags needed to compile Python code (taken from python-config --cflags). diff --git a/gdb/configure.ac b/gdb/configure.ac -index 8da6867..8e39254 100644 +index 6f873b5..77985c8 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -108,6 +108,51 @@ AS_HELP_STRING([--with-relocated-sources=PATH], [automatically relocate this pat @@ -1656,7 +1713,7 @@ index 81f6a5d..097db65 100644 { $$ = $1.comp; if ($2) $$ = fill_comp (DEMANGLE_COMPONENT_LOCAL_NAME, $$, $2); } diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c -index 8ca9c20..21e013a 100644 +index 5e894d4..6325ead 100644 --- a/gdb/cp-namespace.c +++ b/gdb/cp-namespace.c @@ -34,14 +34,17 @@ @@ -1683,8 +1740,8 @@ index 8ca9c20..21e013a 100644 anonymous namespace. So add symbols in it to the namespace given by the previous component if there is one, or to the global namespace if there isn't. */ -- cp_add_using_directive (dest, src); -+ cp_add_using_directive (dest, src, "", "", 0); +- cp_add_using_directive (dest, src, NULL); ++ cp_add_using_directive (dest, src, NULL, "", 0); } /* The "+ 2" is for the "::". */ previous_component = next_component + 2; @@ -1692,39 +1749,41 @@ index 8ca9c20..21e013a 100644 has already been added, don't add it twice. */ void --cp_add_using_directive (const char *dest, const char *src) -+cp_add_using_directive (const char *dest, const char *src, const char* alias, +-cp_add_using_directive (const char *dest, const char *src, const char *alias) ++cp_add_using_directive (const char *dest, const char *src, const char *alias, + const char *declaration, const int line_number) { struct using_direct *current; struct using_direct *new; -@@ -146,7 +150,8 @@ cp_add_using_directive (const char *dest, const char *src) +@@ -146,7 +150,8 @@ cp_add_using_directive (const char *dest, const char *src, const char *alias) return; } -- using_directives = cp_add_using (dest, src, using_directives); +- using_directives = cp_add_using (dest, src, alias, using_directives); + using_directives = cp_add_using (dest, src, alias, declaration, + line_number, using_directives); } -@@ -199,7 +204,10 @@ cp_is_anonymous (const char *namespace) +@@ -198,9 +203,11 @@ cp_is_anonymous (const char *namespace) + != NULL); } - /* Create a new struct using direct which imports the namespace SRC -- into the scope DEST. +-/* Create a new struct using direct which imports the namespace SRC into the +- scope DEST. ALIAS is the name of the imported namespace in the current +- scope. If ALIAS is NULL then the namespace is known by its original name. ++/* Create a new struct using direct which imports the namespace SRC + into the scope DEST. ALIAS is the name of the imported namespace -+ in the current scope. If ALIAS is an empty string then the ++ in the current scope. If ALIAS is NULL then the + namespace is known by its original name. + Set its next member in the linked list to NEXT; allocate all memory using xmalloc. It copies the strings, so NAME can be a temporary string. */ -@@ -207,13 +215,19 @@ cp_is_anonymous (const char *namespace) - struct using_direct * +@@ -209,19 +216,23 @@ struct using_direct * cp_add_using (const char *dest, const char *src, -+ const char *alias, + const char *alias, + const char *declaration, + const int line_number, struct using_direct *next) @@ -1736,13 +1795,18 @@ index 8ca9c20..21e013a 100644 - retval->import_dest = savestring (dest, strlen(dest)); + retval->import_src = savestring (src, strlen (src)); + retval->import_dest = savestring (dest, strlen (dest)); -+ retval->alias = savestring (alias, strlen (alias)); + + if (alias != NULL) + retval->alias = savestring (alias, strlen (alias)); + else + retval->alias = NULL; + + retval->declaration = savestring (declaration, strlen (declaration)); + retval->line_number = line_number; retval->next = next; retval->searched = 0; -@@ -230,19 +244,100 @@ cp_add_using (const char *dest, +@@ -238,19 +249,100 @@ cp_add_using (const char *dest, struct symbol * cp_lookup_symbol_nonlocal (const char *name, @@ -1848,7 +1912,7 @@ index 8ca9c20..21e013a 100644 } /* Look up NAME in the C++ namespace NAMESPACE. Other arguments are as in -@@ -250,25 +345,24 @@ cp_lookup_symbol_nonlocal (const char *name, +@@ -258,25 +350,24 @@ cp_lookup_symbol_nonlocal (const char *name, static struct symbol * cp_lookup_symbol_in_namespace (const char *namespace, @@ -1883,7 +1947,7 @@ index 8ca9c20..21e013a 100644 } } -@@ -283,9 +377,17 @@ reset_directive_searched (void *data) +@@ -291,9 +382,17 @@ reset_directive_searched (void *data) } /* Search for NAME by applying all import statements belonging @@ -1903,7 +1967,7 @@ index 8ca9c20..21e013a 100644 Example: namespace A{ -@@ -299,26 +401,33 @@ reset_directive_searched (void *data) +@@ -307,26 +406,33 @@ reset_directive_searched (void *data) and Y will be considered. If SEARCH_PARENTS is false only the import of Y is considered. */ @@ -1946,27 +2010,25 @@ index 8ca9c20..21e013a 100644 /* Go through the using directives. If any of them add new names to the namespace we're searching in, see if we can find a match by applying them. */ -@@ -327,123 +436,78 @@ cp_lookup_symbol_imports (const char *scope, +@@ -335,7 +441,10 @@ cp_lookup_symbol_imports (const char *scope, current != NULL; current = current->next) { - len = strlen (current->import_dest); -- directive_match = (search_parents -- ? (strncmp (scope, current->import_dest, -- strlen (current->import_dest)) == 0 -- && (len == 0 -- || scope[len] == ':' || scope[len] == '\0')) -- : strcmp (scope, current->import_dest) == 0); -- + - /* If the import destination is the current scope or one of its ancestors then - it is applicable. */ ++ /* If the import destination is the current scope or one of its ancestors then ++ it is applicable. */ ++ int len = strlen (current->import_dest); + directive_match = (search_parents + ? (strncmp (scope, current->import_dest, + strlen (current->import_dest)) == 0 +@@ -343,130 +452,70 @@ cp_lookup_symbol_imports (const char *scope, + || scope[len] == ':' || scope[len] == '\0')) + : strcmp (scope, current->import_dest) == 0); + +- /* If the import destination is the current scope or one of its ancestors then +- it is applicable. */ - if (directive_match && !current->searched) -+ directive_match = search_parents ? -+ strncmp (scope, current->import_dest, -+ strlen(current->import_dest)) == 0 : -+ strcmp (scope, current->import_dest) == 0; -+ + if (directive_match && + current->line_number < current_line && + !current->searched) @@ -1976,13 +2038,65 @@ index 8ca9c20..21e013a 100644 - current->searched = 1; - searched_cleanup = make_cleanup (reset_directive_searched, current); - -- sym = cp_lookup_symbol_namespace (current->import_src, -- name, -- linkage_name, -- block, -- domain, -- 0); -- +- if (current->alias != NULL && strcmp (name, current->alias) == 0) +- /* If the import is creating an alias and the alias matches the +- sought name. Pass current->import_src as the NAME to direct the +- search towards the aliased namespace. */ +- { ++ current->searched = 1; ++ searched_cleanup = make_cleanup (reset_directive_searched, current); ++ ++ /* If there is an import of a single declaration, compare the imported ++ declaration with the sought out name. If there is a match pass ++ current->import_src as NAMESPACE to direct the search towards the ++ imported namespace. */ ++ if (strcmp ("", current->declaration) != 0) ++ { ++ if (strcmp (name, current->declaration) == 0) ++ { ++ sym = cp_lookup_symbol_in_namespace (current->import_src, ++ name, ++ block, ++ domain); ++ } ++ ++ current->searched = 0; ++ if (sym) ++ return sym; ++ ++ continue; ++ } ++ ++ if (declaration_only) ++ { ++ current->searched = 0; ++ discard_cleanups (searched_cleanup); ++ continue; ++ } ++ ++ if (current->alias != NULL && strcmp (name, current->alias) == 0) ++ /* If the import is creating an alias and the alias matches the ++ sought name. Pass current->inner as the NAME to direct the ++ search towards the aliased namespace */ ++ { + sym = cp_lookup_symbol_in_namespace (scope, + current->import_src, +- linkage_name, + block, + domain); +- } +- else if (current->alias == NULL) +- { ++ } else if (current->alias == NULL){ + /* If this import statement creates no alias, pass current->inner as +- NAMESPACE to direct the search towards the imported namespace. */ +- sym = cp_lookup_symbol_imports (current->import_src, +- name, +- linkage_name, +- block, +- domain, +- 0); +- } - current->searched = 0; - discard_cleanups (searched_cleanup); - @@ -2047,51 +2161,10 @@ index 8ca9c20..21e013a 100644 - int scope_len) -{ - char *namespace; -+ current->searched = 1; -+ searched_cleanup = make_cleanup (reset_directive_searched, current); -+ -+ /* If there is an import of a single declaration, compare the imported -+ declaration with the sought out name. If there is a match pass -+ current->import_src as NAMESPACE to direct the search towards the -+ imported namespace. */ -+ if (strcmp ("", current->declaration) != 0) -+ { -+ if (strcmp (name, current->declaration) == 0) -+ { -+ sym = cp_lookup_symbol_in_namespace (current->import_src, -+ name, -+ block, -+ domain); -+ } -+ -+ current->searched = 0; -+ if (sym) -+ return sym; -+ -+ continue; -+ } -+ -+ if (declaration_only) -+ { -+ current->searched = 0; -+ discard_cleanups (searched_cleanup); -+ continue; -+ } - +- - if (scope[scope_len] != '\0') - { - /* Recursively search for names in child namespaces first. */ -+ if (strcmp (name, current->alias) == 0) -+ /* If the import is creating an alias and the alias matches the -+ sought name. Pass current->inner as the NAME to direct the -+ search towards the aliased namespace */ -+ { -+ sym = cp_lookup_symbol_in_namespace (scope, -+ current->import_src, -+ block, -+ domain); -+ } else if (strcmp ("", current->alias) == 0){ -+ /* If this import statement creates no alias, pass current->inner as + NAMESPACE to direct the search towards the imported namespace. */ + sym = cp_lookup_symbol_imports (current->import_src, + name, @@ -2133,7 +2206,7 @@ index 8ca9c20..21e013a 100644 } /* Look up NAME in BLOCK's static block and in global blocks. If -@@ -453,17 +517,15 @@ lookup_namespace_scope (const char *name, +@@ -476,17 +525,15 @@ lookup_namespace_scope (const char *name, static struct symbol * lookup_symbol_file (const char *name, @@ -2152,7 +2225,7 @@ index 8ca9c20..21e013a 100644 if (anonymous_namespace) { /* Symbols defined in anonymous namespaces have external linkage -@@ -473,12 +535,11 @@ lookup_symbol_file (const char *name, +@@ -496,12 +543,11 @@ lookup_symbol_file (const char *name, const struct block *global_block = block_global_block (block); if (global_block != NULL) @@ -2167,7 +2240,7 @@ index 8ca9c20..21e013a 100644 } if (sym != NULL) -@@ -499,6 +560,7 @@ lookup_symbol_file (const char *name, +@@ -522,6 +568,7 @@ lookup_symbol_file (const char *name, sym = lookup_possible_namespace_symbol (name); if (sym != NULL) return sym; @@ -2175,7 +2248,7 @@ index 8ca9c20..21e013a 100644 } return NULL; -@@ -527,10 +589,9 @@ cp_lookup_nested_type (struct type *parent_type, +@@ -550,10 +597,9 @@ cp_lookup_nested_type (struct type *parent_type, const char *parent_name = TYPE_TAG_NAME (parent_type); struct symbol *sym = cp_lookup_symbol_in_namespace (parent_name, @@ -2189,7 +2262,7 @@ index 8ca9c20..21e013a 100644 if (sym == NULL || SYMBOL_CLASS (sym) != LOC_TYPEDEF) return NULL; else -@@ -774,7 +835,7 @@ check_one_possible_namespace_symbol (const char *name, int len, +@@ -797,7 +843,7 @@ check_one_possible_namespace_symbol (const char *name, int len, memcpy (name_copy, name, len); name_copy[len] = '\0'; @@ -2198,7 +2271,7 @@ index 8ca9c20..21e013a 100644 if (sym == NULL) { -@@ -815,7 +876,7 @@ lookup_possible_namespace_symbol (const char *name) +@@ -838,7 +884,7 @@ lookup_possible_namespace_symbol (const char *name) struct symbol *sym; sym = lookup_block_symbol (get_possible_namespace_block (objfile), @@ -2208,9 +2281,18 @@ index 8ca9c20..21e013a 100644 if (sym != NULL) return sym; diff --git a/gdb/cp-support.c b/gdb/cp-support.c -index c31fcff..fc294ae 100644 +index c31fcff..8c5d56f 100644 --- a/gdb/cp-support.c +++ b/gdb/cp-support.c +@@ -50,7 +50,7 @@ static void demangled_name_complaint (const char *name); + + /* Functions/variables related to overload resolution. */ + +-static int sym_return_val_size; ++static int sym_return_val_size = -1; + static int sym_return_val_index; + static struct symbol **sym_return_val; + @@ -190,7 +190,8 @@ mangled_name_to_comp (const char *mangled_name, int options, return ret; } @@ -2221,7 +2303,112 @@ index c31fcff..fc294ae 100644 char * cp_class_name_from_physname (const char *physname) -@@ -840,9 +841,9 @@ read_in_psymtabs (const char *func_name) +@@ -711,6 +712,82 @@ make_symbol_overload_list (const char *func_name, + + return sym_return_val; + } ++/* Adds the function FUNC_NAME from NAMESPACE to the overload set. */ ++ ++static void ++make_symbol_overload_list_namespace (const char *func_name, ++ const char *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); ++ } ++} ++ ++/* Search the namespace of the given type and namespace of and public base ++ types. */ ++static void make_symbol_overload_list_adl_namespace (struct type *type, ++ const char *func_name) ++{ ++ char *namespace; ++ char *type_name; ++ int i, prefix_len; ++ ++ if (TYPE_CODE (type) == TYPE_CODE_PTR || TYPE_CODE (type) == TYPE_CODE_REF ++ || TYPE_CODE (type) == TYPE_CODE_ARRAY) ++ return make_symbol_overload_list_adl_namespace (TYPE_TARGET_TYPE (type), ++ func_name); ++ ++ type_name = TYPE_NAME (type); ++ ++ prefix_len = cp_entire_prefix_len (type_name); ++ ++ if (prefix_len != 0) ++ { ++ namespace = alloca (prefix_len + 1); ++ strncpy (namespace, type_name, prefix_len); ++ namespace[prefix_len] = '\0'; ++ ++ make_symbol_overload_list_namespace (func_name, namespace); ++ } ++ ++ /* Check public base type */ ++ if (TYPE_CODE(type) == TYPE_CODE_CLASS) ++ for (i = 0; i < TYPE_N_BASECLASSES (type); i++) ++ { ++ if (BASETYPE_VIA_PUBLIC (type, i)) ++ make_symbol_overload_list_adl_namespace (TYPE_BASECLASS (type, i), ++ func_name); ++ } ++ ++} ++ ++/* Adds the the overload list overload candidates for FUNC_NAME found through ++ argument dependent lookup. */ ++ ++struct symbol ** ++make_symbol_overload_list_adl (struct type **arg_types, int nargs, ++ const char *func_name) ++{ ++ int i; ++ ++ gdb_assert (sym_return_val_size != -1); ++ ++ for (i = 1; i <= nargs; i++) ++ make_symbol_overload_list_adl_namespace (arg_types[i - 1], func_name); ++ ++ 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 +@@ -739,20 +816,7 @@ make_symbol_overload_list_using (const char *func_name, + } + + /* 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); +- } ++ make_symbol_overload_list_namespace (func_name, namespace); + } + + /* This does the bulk of the work of finding overloaded symbols. +@@ -840,9 +904,9 @@ read_in_psymtabs (const char *func_name) if (ps->readin) continue; @@ -2234,43 +2421,41 @@ index c31fcff..fc294ae 100644 psymtab_to_symtab (ps); } diff --git a/gdb/cp-support.h b/gdb/cp-support.h -index 33b1b44..50f8fe9 100644 +index a6a9af1..57aa5e5 100644 --- a/gdb/cp-support.h +++ b/gdb/cp-support.h -@@ -38,14 +38,29 @@ struct demangle_component; +@@ -38,20 +38,24 @@ struct demangle_component; /* This struct is designed to store data from using directives. It says that names from namespace IMPORT_SRC should be visible within -- namespace IMPORT_DEST. IMPORT_DEST should always be a strict initial -- substring of IMPORT_SRC. These form a linked list; NEXT is the next element -- of the list. */ -+ namespace IMPORT_DEST. IMPORT_DEST should always be a strict initial -+ substring of IMPORT_SRC. These form a linked list; NEXT is the next +- namespace IMPORT_DEST. These form a linked list; NEXT is the next element +- of the list. If the imported namespace has been aliased, ALIAS is set to a +- string representing the alias. Otherwise, ALIAS is NULL. +- Eg: +- namespace C = A::B; ++ namespace IMPORT_DEST. These form a linked list; NEXT is the next + element of the list. ALIAS is set to a non empty string if the imported + namespace has been aliased.Eg: + namespace C=A::B; -+ ALIAS = "C" + ALIAS = "C" + DECLARATION is the name of the imported declaration, if this import + statement represents one. Eg: + using A::x; + Where x is variable in namespace A. declaration is set to x. -+*/ + */ struct using_direct { char *import_src; char *import_dest; -+ -+ char *alias; -+ +- + char *alias; + char *declaration; -+ + int line_number; -+ + struct using_direct *next; - /* Used during import search to temporarily mark this node as searched. */ -@@ -57,6 +72,7 @@ struct using_direct +@@ -64,6 +68,7 @@ struct using_direct extern char *cp_canonicalize_string (const char *string); @@ -2278,25 +2463,35 @@ index 33b1b44..50f8fe9 100644 extern char *cp_class_name_from_physname (const char *physname); extern char *method_name_from_physname (const char *physname); -@@ -82,10 +98,16 @@ extern int cp_validate_operator (const char *input); - extern int cp_is_anonymous (const char *namespace); +@@ -79,6 +84,10 @@ extern char *cp_remove_params (const char *demangled_name); + extern struct symbol **make_symbol_overload_list (const char *, + const char *); + ++extern struct symbol **make_symbol_overload_list_adl (struct type **arg_types, ++ int nargs, ++ const char *func_name); ++ + extern struct type *cp_lookup_rtti_type (const char *name, + struct block *block); + +@@ -90,11 +99,15 @@ extern int cp_is_anonymous (const char *namespace); extern void cp_add_using_directive (const char *dest, -- const char *src); -+ const char *src, + const char *src, +- const char *alias); + const char *alias, + const char *declaration, + const int line_number); extern struct using_direct *cp_add_using (const char *dest, const char *src, -+ const char *alias, + const char *alias, + const char *declaration, + const int line_number, struct using_direct *next); extern void cp_initialize_namespace (void); -@@ -102,16 +124,20 @@ extern void cp_set_block_scope (const struct symbol *symbol, +@@ -111,16 +124,20 @@ extern void cp_set_block_scope (const struct symbol *symbol, extern void cp_scan_for_anonymous_namespaces (const struct symbol *symbol); extern struct symbol *cp_lookup_symbol_nonlocal (const char *name, @@ -2324,7 +2519,7 @@ index 33b1b44..50f8fe9 100644 extern struct type *cp_lookup_nested_type (struct type *parent_type, const char *nested_name, diff --git a/gdb/dbxread.c b/gdb/dbxread.c -index 6ef6767..5f4825c 100644 +index c9a5754..fc33da2 100644 --- a/gdb/dbxread.c +++ b/gdb/dbxread.c @@ -3565,6 +3565,7 @@ static struct sym_fns aout_sym_fns = @@ -2336,7 +2531,7 @@ index 6ef6767..5f4825c 100644 default_symfile_offsets, /* sym_offsets: parse user's offsets to internal form */ diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo -index 2145f2b..84cadd4 100644 +index 0e3e093..661ba18 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -1157,6 +1157,16 @@ for remote debugging. @@ -2356,7 +2551,7 @@ index 2145f2b..84cadd4 100644 @c resolve the situation of these eventually @item -tui @cindex @code{--tui} -@@ -19206,7 +19216,7 @@ using the @code{script-extension} setting. +@@ -19215,7 +19225,7 @@ using the @code{script-extension} setting. @table @code @kindex source @cindex execute commands from a file @@ -2365,7 +2560,7 @@ index 2145f2b..84cadd4 100644 Execute the command file @var{filename}. @end table -@@ -19484,8 +19494,6 @@ containing @code{end}. For example: +@@ -19493,8 +19503,6 @@ containing @code{end}. For example: @smallexample (@value{GDBP}) python @@ -2374,7 +2569,7 @@ index 2145f2b..84cadd4 100644 >print 23 >end 23 -@@ -19498,6 +19506,14 @@ in a Python script. This can be controlled using @code{maint set +@@ -19507,6 +19515,14 @@ in a Python script. This can be controlled using @code{maint set python print-stack}: if @code{on}, the default, then Python stack printing is enabled; if @code{off}, then Python stack printing is disabled. @@ -2389,7 +2584,7 @@ index 2145f2b..84cadd4 100644 @end table It is also possible to execute a Python script from the @value{GDBN} -@@ -19519,6 +19535,14 @@ and thus is always available. +@@ -19528,6 +19544,14 @@ and thus is always available. @cindex python api @cindex programming in python @@ -2404,7 +2599,7 @@ index 2145f2b..84cadd4 100644 @cindex python stdout @cindex python pagination At startup, @value{GDBN} overrides Python's @code{sys.stdout} and -@@ -19531,13 +19555,17 @@ situation, a Python @code{KeyboardInterrupt} exception is thrown. +@@ -19540,13 +19564,17 @@ situation, a Python @code{KeyboardInterrupt} exception is thrown. * Basic Python:: Basic Python Functions. * Exception Handling:: * Auto-loading:: Automatically loading Python code. @@ -2423,7 +2618,7 @@ index 2145f2b..84cadd4 100644 * Frames In Python:: Acessing inferior stack frames from Python. * Lazy Strings In Python:: Python representation of lazy strings. @end menu -@@ -19565,6 +19593,12 @@ command as having originated from the user invoking it interactively. +@@ -19574,6 +19602,12 @@ command as having originated from the user invoking it interactively. It must be a boolean value. If omitted, it defaults to @code{False}. @end defun @@ -2436,7 +2631,7 @@ index 2145f2b..84cadd4 100644 @findex gdb.parameter @defun parameter parameter Return the value of a @value{GDBN} parameter. @var{parameter} is a -@@ -19581,6 +19615,7 @@ a Python value of the appropriate type, and returned. +@@ -19590,6 +19624,7 @@ a Python value of the appropriate type, and returned. @defun history number Return a value from @value{GDBN}'s value history (@pxref{Value History}). @var{number} indicates which history element to return. @@ -2444,7 +2639,7 @@ index 2145f2b..84cadd4 100644 If @var{number} is negative, then @value{GDBN} will take its absolute value and count backward from the last element (i.e., the most recent element) to find the value to return. If @var{number} is zero, then @value{GDBN} will -@@ -19605,6 +19640,21 @@ compute values, for example, it is the only way to get the value of a +@@ -19614,6 +19649,21 @@ compute values, for example, it is the only way to get the value of a convenience variable (@pxref{Convenience Vars}) as a @code{gdb.Value}. @end defun @@ -2466,7 +2661,7 @@ index 2145f2b..84cadd4 100644 @findex gdb.write @defun write string Print a string to @value{GDBN}'s paginated standard output stream. -@@ -19619,6 +19669,11 @@ Flush @value{GDBN}'s paginated standard output stream. Flushing +@@ -19628,6 +19678,11 @@ Flush @value{GDBN}'s paginated standard output stream. Flushing function. @end defun @@ -2478,7 +2673,7 @@ index 2145f2b..84cadd4 100644 @node Exception Handling @subsubsection Exception Handling @cindex python exceptions -@@ -19857,6 +19912,9 @@ module: +@@ -19866,6 +19921,9 @@ module: This function looks up a type by name. @var{name} is the name of the type to look up. It must be a string. @@ -2488,7 +2683,7 @@ index 2145f2b..84cadd4 100644 Ordinarily, this function will return an instance of @code{gdb.Type}. If the named type cannot be found, it will throw an exception. @end defun -@@ -19979,7 +20037,7 @@ If the type does not have a target, this method will throw an +@@ -19988,7 +20046,7 @@ If the type does not have a target, this method will throw an exception. @end defmethod @@ -2497,7 +2692,7 @@ index 2145f2b..84cadd4 100644 If this @code{gdb.Type} is an instantiation of a template, this will return a new @code{gdb.Type} which represents the type of the @var{n}th template argument. -@@ -19987,7 +20045,8 @@ return a new @code{gdb.Type} which represents the type of the +@@ -19996,7 +20054,8 @@ return a new @code{gdb.Type} which represents the type of the If this @code{gdb.Type} is not a template type, this will throw an exception. Ordinarily, only C@t{++} code will have template types. @@ -2507,7 +2702,7 @@ index 2145f2b..84cadd4 100644 @end defmethod @end table -@@ -20341,6 +20400,121 @@ import gdb.libstdcxx.v6 +@@ -20350,6 +20409,121 @@ import gdb.libstdcxx.v6 gdb.libstdcxx.v6.register_printers (gdb.current_objfile ()) @end smallexample @@ -2629,7 +2824,7 @@ index 2145f2b..84cadd4 100644 @node Commands In Python @subsubsection Commands In Python -@@ -20593,6 +20767,135 @@ registration of the command with @value{GDBN}. Depending on how the +@@ -20602,6 +20776,135 @@ registration of the command with @value{GDBN}. Depending on how the Python code is read into @value{GDBN}, you may need to import the @code{gdb} module explicitly. @@ -2765,7 +2960,7 @@ index 2145f2b..84cadd4 100644 @node Functions In Python @subsubsection Writing new convenience functions -@@ -20697,6 +21000,82 @@ which is used to format the value. @xref{Pretty Printing}, for more +@@ -20706,6 +21009,82 @@ which is used to format the value. @xref{Pretty Printing}, for more information. @end defivar @@ -2848,7 +3043,7 @@ index 2145f2b..84cadd4 100644 @node Frames In Python @subsubsection Acessing inferior stack frames from Python. -@@ -20761,6 +21140,14 @@ function to a string. +@@ -20770,6 +21149,14 @@ function to a string. Returns the frame's resume address. @end defmethod @@ -2863,7 +3058,7 @@ index 2145f2b..84cadd4 100644 @defmethod Frame older Return the frame that called this frame. @end defmethod -@@ -20769,10 +21156,18 @@ Return the frame that called this frame. +@@ -20778,10 +21165,18 @@ Return the frame that called this frame. Return the frame called by this frame. @end defmethod @@ -2883,7 +3078,7 @@ index 2145f2b..84cadd4 100644 @node Lazy Strings In Python diff --git a/gdb/doc/gdbint.texinfo b/gdb/doc/gdbint.texinfo -index 347c860..5d7002e 100644 +index 7741855..df3fc87 100644 --- a/gdb/doc/gdbint.texinfo +++ b/gdb/doc/gdbint.texinfo @@ -2107,6 +2107,18 @@ time, and so we attempt to handle symbols incrementally. For instance, @@ -3089,7 +3284,7 @@ index 437ca39..f7fce92 100644 /* The current depth of dwarf expression recursion, via DW_OP_call*, DW_OP_fbreg, DW_OP_push_object_address, etc., and the maximum diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c -index 6679d74..54d2bae 100644 +index 1c4d057..ac67f22 100644 --- a/gdb/dwarf2loc.c +++ b/gdb/dwarf2loc.c @@ -121,6 +121,9 @@ struct dwarf_expr_baton @@ -3275,7 +3470,7 @@ index 6679d74..54d2bae 100644 struct piece_closure { /* The number of pieces used to describe this variable. */ -@@ -408,9 +545,8 @@ dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame, +@@ -406,9 +543,8 @@ dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame, struct dwarf2_per_cu_data *per_cu) { struct value *retval; @@ -3286,7 +3481,7 @@ index 6679d74..54d2bae 100644 if (size == 0) { -@@ -420,22 +556,8 @@ dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame, +@@ -418,22 +554,8 @@ dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame, return retval; } @@ -3310,7 +3505,7 @@ index 6679d74..54d2bae 100644 if (ctx->num_pieces > 0) { struct piece_closure *c; -@@ -465,6 +587,11 @@ dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame, +@@ -463,6 +585,11 @@ dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame, CORE_ADDR address = dwarf_expr_fetch (ctx, 0); int in_stack_memory = dwarf_expr_fetch_in_stack_memory (ctx, 0); @@ -3322,7 +3517,7 @@ index 6679d74..54d2bae 100644 retval = allocate_value (SYMBOL_TYPE (var)); VALUE_LVAL (retval) = lval_memory; set_value_lazy (retval, 1); -@@ -872,7 +999,7 @@ static int +@@ -868,7 +995,7 @@ static int loclist_describe_location (struct symbol *symbol, struct ui_file *stream) { /* FIXME: Could print the entire list of locations. */ @@ -3331,7 +3526,7 @@ index 6679d74..54d2bae 100644 return 1; } -@@ -888,16 +1015,56 @@ loclist_tracepoint_var_ref (struct symbol *symbol, struct gdbarch *gdbarch, +@@ -884,16 +1011,56 @@ loclist_tracepoint_var_ref (struct symbol *symbol, struct gdbarch *gdbarch, data = find_location_expression (dlbaton, &size, ax->scope); if (data == NULL) @@ -3408,10 +3603,10 @@ index fa0bd11..fdea2b4 100644 #endif /* dwarf2loc.h */ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c -index 86bfecb..ddf2189 100644 +index a05c946..285c58e 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c -@@ -48,6 +48,11 @@ +@@ -48,6 +48,10 @@ #include "gdbcmd.h" #include "block.h" #include "addrmap.h" @@ -3419,11 +3614,10 @@ index 86bfecb..ddf2189 100644 +#include "f-lang.h" +#include "typeprint.h" +#include "jv-lang.h" -+#include "vec.h" #include #include "gdb_string.h" -@@ -96,7 +101,7 @@ typedef struct pubnames_header +@@ -96,7 +100,7 @@ typedef struct pubnames_header _PUBNAMES_HEADER; #define _ACTUAL_PUBNAMES_HEADER_SIZE 13 @@ -3432,7 +3626,7 @@ index 86bfecb..ddf2189 100644 Because of alignment constraints, this structure has padding and cannot be mapped directly onto the beginning of the .debug_info section. */ typedef struct aranges_header -@@ -153,7 +158,10 @@ struct dwarf2_section_info +@@ -153,7 +157,10 @@ struct dwarf2_section_info asection *asection; gdb_byte *buffer; bfd_size_type size; @@ -3444,7 +3638,7 @@ index 86bfecb..ddf2189 100644 }; struct dwarf2_per_objfile -@@ -333,6 +341,19 @@ struct dwarf2_cu +@@ -333,6 +340,19 @@ struct dwarf2_cu DIEs for namespaces, we don't need to try to infer them from mangled names. */ unsigned int has_namespace_info : 1; @@ -3464,7 +3658,7 @@ index 86bfecb..ddf2189 100644 }; /* Persistent data held for a compilation unit, even when not -@@ -487,8 +508,7 @@ struct partial_die_info +@@ -487,8 +507,7 @@ struct partial_die_info unsigned int has_byte_size : 1; /* The name of this DIE. Normally the value of DW_AT_name, but @@ -3474,31 +3668,17 @@ index 86bfecb..ddf2189 100644 char *name; /* The scope to prepend to our children. This is generally -@@ -677,6 +697,11 @@ struct field_info - int nfnfields; - }; - -+/* A vector used during linkage name generation. */ -+typedef struct die_info *die_info_p; -+DEF_VEC_P (die_info_p); -+static VEC(die_info_p) *die_list; -+ - /* One item on the queue of compilation units to read in full symbols - for. */ - struct dwarf2_queue_item -@@ -788,7 +813,10 @@ static void scan_partial_symbols (struct partial_die_info *, +@@ -788,7 +807,8 @@ static void scan_partial_symbols (struct partial_die_info *, static void add_partial_symbol (struct partial_die_info *, struct dwarf2_cu *); -static int pdi_needs_namespace (enum dwarf_tag tag); +static gdb_byte *read_comp_unit_head (struct comp_unit_head *, gdb_byte *, + bfd *); -+ -+static int die_needs_namespace (struct die_info *, struct dwarf2_cu *); static void add_partial_namespace (struct partial_die_info *pdi, CORE_ADDR *lowpc, CORE_ADDR *highpc, -@@ -813,6 +841,10 @@ static void dwarf2_psymtab_to_symtab (struct partial_symtab *); +@@ -813,6 +833,10 @@ static void dwarf2_psymtab_to_symtab (struct partial_symtab *); static void psymtab_to_symtab_1 (struct partial_symtab *); @@ -3509,19 +3689,7 @@ index 86bfecb..ddf2189 100644 static void dwarf2_read_abbrevs (bfd *abfd, struct dwarf2_cu *cu); static void dwarf2_free_abbrev_table (void *); -@@ -940,6 +972,11 @@ static struct type *tag_type_to_type (struct die_info *, struct dwarf2_cu *); - - static struct type *read_type_die (struct die_info *, struct dwarf2_cu *); - -+static char *physname_prefix (struct die_info *die, struct dwarf2_cu *); -+ -+static void physname_prefix_1 (struct ui_file *, struct die_info *, -+ struct dwarf2_cu *); -+ - static char *determine_prefix (struct die_info *die, struct dwarf2_cu *); - - static char *typename_concat (struct obstack *, -@@ -984,17 +1021,25 @@ static void dwarf2_attach_fn_fields_to_type (struct field_info *, +@@ -984,17 +1008,25 @@ static void dwarf2_attach_fn_fields_to_type (struct field_info *, static void process_structure_scope (struct die_info *, struct dwarf2_cu *); @@ -3550,19 +3718,17 @@ index 86bfecb..ddf2189 100644 static const char *namespace_name (struct die_info *die, int *is_anonymous, struct dwarf2_cu *); -@@ -1028,7 +1073,10 @@ static gdb_byte *read_full_die (const struct die_reader_specs *reader, +@@ -1028,7 +1060,8 @@ static gdb_byte *read_full_die (const struct die_reader_specs *reader, static void process_die (struct die_info *, struct dwarf2_cu *); -static char *dwarf2_linkage_name (struct die_info *, struct dwarf2_cu *); -+static char *dwarf2_physname (struct die_info *, struct dwarf2_cu *); -+ +static char *fortran_module_linkage_name (struct die_info *die, + struct dwarf2_cu *cu); static char *dwarf2_canonicalize_name (char *, struct dwarf2_cu *, struct obstack *); -@@ -1144,6 +1192,9 @@ static void age_cached_comp_units (void); +@@ -1144,6 +1177,9 @@ static void age_cached_comp_units (void); static void free_one_cached_comp_unit (void *); @@ -3572,7 +3738,7 @@ index 86bfecb..ddf2189 100644 static struct type *set_die_type (struct die_info *, struct type *, struct dwarf2_cu *); -@@ -1163,22 +1214,31 @@ static void dwarf2_clear_marks (struct dwarf2_per_cu_data *); +@@ -1163,22 +1199,31 @@ static void dwarf2_clear_marks (struct dwarf2_per_cu_data *); static struct type *get_die_type (struct die_info *die, struct dwarf2_cu *cu); @@ -3613,7 +3779,7 @@ index 86bfecb..ddf2189 100644 } /* When loading sections, we can either look for ".", or for -@@ -1271,10 +1331,13 @@ dwarf2_locate_sections (bfd *abfd, asection *sectp, void *ignore_ptr) +@@ -1271,10 +1316,13 @@ dwarf2_locate_sections (bfd *abfd, asection *sectp, void *ignore_ptr) } /* Decompress a section that was compressed using zlib. Store the @@ -3629,7 +3795,7 @@ index 86bfecb..ddf2189 100644 gdb_byte **outbuf, bfd_size_type *outsize) { bfd *abfd = objfile->obfd; -@@ -1291,6 +1354,7 @@ zlib_decompress_section (struct objfile *objfile, asection *sectp, +@@ -1291,6 +1339,7 @@ zlib_decompress_section (struct objfile *objfile, asection *sectp, z_stream strm; int rc; int header_size = 12; @@ -3637,7 +3803,7 @@ index 86bfecb..ddf2189 100644 if (bfd_seek (abfd, sectp->filepos, SEEK_SET) != 0 || bfd_bread (compressed_buffer, compressed_size, abfd) != compressed_size) -@@ -1320,8 +1384,13 @@ zlib_decompress_section (struct objfile *objfile, asection *sectp, +@@ -1320,8 +1369,13 @@ zlib_decompress_section (struct objfile *objfile, asection *sectp, strm.avail_in = compressed_size - header_size; strm.next_in = (Bytef*) compressed_buffer + header_size; strm.avail_out = uncompressed_size; @@ -3653,7 +3819,7 @@ index 86bfecb..ddf2189 100644 rc = inflateInit (&strm); while (strm.avail_in > 0) { -@@ -1342,26 +1411,176 @@ zlib_decompress_section (struct objfile *objfile, asection *sectp, +@@ -1342,26 +1396,176 @@ zlib_decompress_section (struct objfile *objfile, asection *sectp, error (_("Dwarf Error: concluding DWARF uncompression in '%s': %d"), bfd_get_filename (abfd), rc); @@ -3835,7 +4001,7 @@ index 86bfecb..ddf2189 100644 if (info->asection == NULL || info->size == 0) return; -@@ -1374,7 +1593,7 @@ dwarf2_read_section (struct objfile *objfile, struct dwarf2_section_info *info) +@@ -1374,7 +1578,7 @@ dwarf2_read_section (struct objfile *objfile, struct dwarf2_section_info *info) /* Upon decompression, update the buffer and its size. */ if (strncmp (header, "ZLIB", sizeof (header)) == 0) { @@ -3844,7 +4010,7 @@ index 86bfecb..ddf2189 100644 &info->size); return; } -@@ -1397,7 +1616,7 @@ dwarf2_read_section (struct objfile *objfile, struct dwarf2_section_info *info) +@@ -1397,7 +1601,7 @@ dwarf2_read_section (struct objfile *objfile, struct dwarf2_section_info *info) if (retbuf != MAP_FAILED) { @@ -3853,7 +4019,7 @@ index 86bfecb..ddf2189 100644 info->buffer = retbuf + (sectp->filepos & (pagesize - 1)) ; return; } -@@ -1405,8 +1624,15 @@ dwarf2_read_section (struct objfile *objfile, struct dwarf2_section_info *info) +@@ -1405,8 +1609,15 @@ dwarf2_read_section (struct objfile *objfile, struct dwarf2_section_info *info) #endif /* If we get here, we are a normal, not-compressed section. */ @@ -3871,8 +4037,8 @@ index 86bfecb..ddf2189 100644 /* When debugging .o files, we may need to apply relocations; see http://sourceware.org/ml/gdb-patches/2002-04/msg00136.html . -@@ -1415,6 +1641,8 @@ dwarf2_read_section (struct objfile *objfile, struct dwarf2_section_info *info) - retbuf = symfile_relocate_debug_section (abfd, sectp, buf); +@@ -1415,6 +1626,8 @@ dwarf2_read_section (struct objfile *objfile, struct dwarf2_section_info *info) + retbuf = symfile_relocate_debug_section (objfile, sectp, buf); if (retbuf != NULL) { + if (old) @@ -3880,7 +4046,7 @@ index 86bfecb..ddf2189 100644 info->buffer = retbuf; return; } -@@ -1423,6 +1651,19 @@ dwarf2_read_section (struct objfile *objfile, struct dwarf2_section_info *info) +@@ -1423,6 +1636,19 @@ dwarf2_read_section (struct objfile *objfile, struct dwarf2_section_info *info) || bfd_bread (buf, info->size, abfd) != info->size) error (_("Dwarf Error: Can't read DWARF data from '%s'"), bfd_get_filename (abfd)); @@ -3900,7 +4066,62 @@ index 86bfecb..ddf2189 100644 } /* Fill in SECTP, BUFP and SIZEP with section info, given OBJFILE and -@@ -2389,11 +2630,18 @@ partial_die_parent_scope (struct partial_die_info *pdi, +@@ -2070,6 +2296,29 @@ build_type_psymtabs (struct objfile *objfile) + process_type_comp_unit, objfile); + } + ++/* A cleanup function that clears an objfile's psymtabs. There are ++ two cases to consider. If we are reading symbols directly, then on ++ a failure the objfile will be destroyed. In this case, clearing ++ the psymtabs is fine -- a little wasted time, but nothing serious. ++ If we are reading symbols lazily, then it is too late to destroy ++ the objfile. Instead we just make it look like the objfile has no ++ psymtabs. */ ++ ++static void ++do_clear_psymtabs (void *arg) ++{ ++ struct objfile *objfile = arg; ++ ++ objfile->psymtabs_addrmap = NULL; ++ objfile->psymtabs = NULL; ++ bcache_xfree (objfile->psymbol_cache); ++ objfile->psymbol_cache = bcache_xmalloc (); ++ xfree (objfile->global_psymbols.list); ++ memset (&objfile->global_psymbols, 0, sizeof (objfile->global_psymbols)); ++ xfree (objfile->static_psymbols.list); ++ memset (&objfile->static_psymbols, 0, sizeof (objfile->static_psymbols)); ++} ++ + /* Build the partial symbol table by doing a quick pass through the + .debug_info and .debug_abbrev sections. */ + +@@ -2080,7 +2329,7 @@ dwarf2_build_psymtabs_hard (struct objfile *objfile) + mmap() on architectures that support it. (FIXME) */ + bfd *abfd = objfile->obfd; + gdb_byte *info_ptr; +- struct cleanup *back_to; ++ struct cleanup *back_to, *clear_psymtabs; + + info_ptr = dwarf2_per_objfile->info.buffer; + +@@ -2094,6 +2343,7 @@ dwarf2_build_psymtabs_hard (struct objfile *objfile) + + objfile->psymtabs_addrmap = + addrmap_create_mutable (&objfile->objfile_obstack); ++ clear_psymtabs = make_cleanup (do_clear_psymtabs, objfile); + + /* Since the objects we're extracting from .debug_info vary in + length, only the individual functions to extract them (like +@@ -2123,6 +2373,7 @@ dwarf2_build_psymtabs_hard (struct objfile *objfile) + dwarf2_per_objfile->info.size); + } + ++ discard_cleanups (clear_psymtabs); + objfile->psymtabs_addrmap = addrmap_create_fixed (objfile->psymtabs_addrmap, + &objfile->objfile_obstack); + +@@ -2389,11 +2640,18 @@ partial_die_parent_scope (struct partial_die_info *pdi, || parent->tag == DW_TAG_union_type || parent->tag == DW_TAG_enumeration_type) { @@ -3921,7 +4142,7 @@ index 86bfecb..ddf2189 100644 } else if (parent->tag == DW_TAG_enumerator) /* Enumerators should not get the name of the enumeration as a prefix. */ -@@ -2405,7 +2653,7 @@ partial_die_parent_scope (struct partial_die_info *pdi, +@@ -2405,7 +2663,7 @@ partial_die_parent_scope (struct partial_die_info *pdi, ignoring them. */ complaint (&symfile_complaints, _("unhandled containing DIE tag %d for DIE at %d"), @@ -3930,7 +4151,7 @@ index 86bfecb..ddf2189 100644 parent->scope = grandparent_scope; } -@@ -2420,12 +2668,22 @@ partial_die_full_name (struct partial_die_info *pdi, +@@ -2420,12 +2678,22 @@ partial_die_full_name (struct partial_die_info *pdi, struct dwarf2_cu *cu) { char *parent_scope; @@ -3957,7 +4178,7 @@ index 86bfecb..ddf2189 100644 } static void -@@ -2441,12 +2699,9 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu) +@@ -2441,12 +2709,9 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu) baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); @@ -3973,7 +4194,7 @@ index 86bfecb..ddf2189 100644 if (actual_name == NULL) actual_name = pdi->name; -@@ -2543,6 +2798,13 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu) +@@ -2543,6 +2808,13 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu) &objfile->global_psymbols, 0, (CORE_ADDR) 0, cu->language, objfile); break; @@ -3987,7 +4208,7 @@ index 86bfecb..ddf2189 100644 case DW_TAG_class_type: case DW_TAG_interface_type: case DW_TAG_structure_type: -@@ -2586,34 +2848,17 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu) +@@ -2586,49 +2858,10 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu) break; } @@ -4014,50 +4235,30 @@ index 86bfecb..ddf2189 100644 -/* Determine whether a die of type TAG living in a C++ class or - namespace needs to have the name of the scope prepended to the - name listed in the die. */ -+/* Determine whether DIE needs to have the name of the scope prepended -+ to the name listed in the die. */ - - static int +- +-static int -pdi_needs_namespace (enum dwarf_tag tag) -+die_needs_namespace (struct die_info *die, struct dwarf2_cu *cu) - { +-{ - switch (tag) -+ switch (die->tag) - { - case DW_TAG_namespace: - case DW_TAG_typedef: -@@ -2623,7 +2868,30 @@ pdi_needs_namespace (enum dwarf_tag tag) - case DW_TAG_union_type: - case DW_TAG_enumeration_type: - case DW_TAG_enumerator: -+ case DW_TAG_subprogram: -+ case DW_TAG_member: - return 1; -+ -+ case DW_TAG_variable: -+ { -+ struct attribute *attr; -+ attr = dwarf2_attr (die, DW_AT_specification, cu); -+ if (attr) -+ return 1; -+ attr = dwarf2_attr (die, DW_AT_external, cu); -+ if (attr == NULL && die->parent->tag != DW_TAG_namespace) -+ return 0; -+ /* A variable in a lexical block of some kind does not need a -+ namespace, even though in C++ such variables may be -+ external and have a mangled name. */ -+ if (die->parent->tag == DW_TAG_lexical_block -+ || die->parent->tag == DW_TAG_try_block -+ || die->parent->tag == DW_TAG_catch_block) -+ return 0; -+ return 1; -+ } -+ break; -+ - default: - return 0; - } -@@ -2656,12 +2924,12 @@ static void +- { +- case DW_TAG_namespace: +- case DW_TAG_typedef: +- case DW_TAG_class_type: +- case DW_TAG_interface_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. */ +@@ -2656,12 +2889,12 @@ static void add_partial_module (struct partial_die_info *pdi, CORE_ADDR *lowpc, CORE_ADDR *highpc, int need_pc, struct dwarf2_cu *cu) { @@ -4074,7 +4275,15 @@ index 86bfecb..ddf2189 100644 } /* Read a partial die corresponding to a subprogram and create a partial -@@ -2752,27 +3020,6 @@ guess_structure_name (struct partial_die_info *struct_pdi, +@@ -2739,7 +2972,6 @@ guess_structure_name (struct partial_die_info *struct_pdi, + could fix this by only using the demangled name to get the + prefix (but see comment in read_structure_type). */ + +- struct partial_die_info *child_pdi = struct_pdi->die_child; + struct partial_die_info *real_pdi; + + /* If this DIE (this DIE's specification, if any) has a parent, then +@@ -2752,27 +2984,6 @@ guess_structure_name (struct partial_die_info *struct_pdi, if (real_pdi->die_parent != NULL) return; @@ -4091,7 +4300,7 @@ index 86bfecb..ddf2189 100644 - struct_pdi->name - = obsavestring (actual_class_name, - strlen (actual_class_name), -- &cu->comp_unit_obstack); +- &cu->objfile->objfile_obstack); - xfree (actual_class_name); - } - break; @@ -4102,7 +4311,7 @@ index 86bfecb..ddf2189 100644 } } -@@ -3325,6 +3572,14 @@ process_die (struct die_info *die, struct dwarf2_cu *cu) +@@ -3325,6 +3536,14 @@ process_die (struct die_info *die, struct dwarf2_cu *cu) case DW_TAG_imported_declaration: case DW_TAG_imported_module: processing_has_namespace_info = 1; @@ -4117,31 +4326,81 @@ index 86bfecb..ddf2189 100644 if (die->child != NULL && (die->tag == DW_TAG_imported_declaration || cu->language != language_fortran)) complaint (&symfile_complaints, _("Tag '%s' has unexpected children"), -@@ -3340,41 +3595,71 @@ process_die (struct die_info *die, struct dwarf2_cu *cu) - /* Return the fully qualified name of DIE, based on its DW_AT_name. - If scope qualifiers are appropriate they will be added. The result - will be allocated on the objfile_obstack, or NULL if the DIE does -- not have a name. */ -+ not have a name. +@@ -3337,42 +3556,183 @@ process_die (struct die_info *die, struct dwarf2_cu *cu) + } + } + ++/* A helper function for dwarf2_compute_name which determines whether DIE ++ needs to have the name of the scope prepended to the name listed in the ++ die. */ + -+ The output string will be canonicalized (if C++/Java). */ - - static const char * - dwarf2_full_name (struct die_info *die, struct dwarf2_cu *cu) - { -- struct attribute *attr; -- char *prefix, *name; -- struct ui_file *buf = NULL; -+ char *name; - - name = dwarf2_name (die, cu); -- if (!name) -- return NULL; - - /* These are the only languages we know how to qualify names in. */ -- if (cu->language != language_cplus -- && cu->language != language_java) -- return name; ++static int ++die_needs_namespace (struct die_info *die, struct dwarf2_cu *cu) ++{ ++ switch (die->tag) ++ { ++ case DW_TAG_namespace: ++ case DW_TAG_typedef: ++ case DW_TAG_class_type: ++ case DW_TAG_interface_type: ++ case DW_TAG_structure_type: ++ case DW_TAG_union_type: ++ case DW_TAG_enumeration_type: ++ case DW_TAG_enumerator: ++ case DW_TAG_subprogram: ++ case DW_TAG_member: ++ return 1; ++ ++ case DW_TAG_variable: ++ { ++ struct attribute *attr; ++ ++ /* We only need to prefix "globally" visible variables. These include ++ any variable marked with DW_AT_external or any variable that ++ lives in a namespace. [Variables in anonymous namespaces ++ require prefixing, but they are not DW_AT_external.] */ ++ ++ if (dwarf2_attr (die, DW_AT_specification, cu)) ++ { ++ struct dwarf2_cu *spec_cu = cu; ++ return die_needs_namespace (die_specification (die, &spec_cu), ++ spec_cu); ++ } ++ ++ /* A variable in a lexical block of some kind does not need ++ a namespace, even though in C++ such variables may be ++ external and have a mangled name. */ ++ if (die->parent->tag == DW_TAG_lexical_block ++ || die->parent->tag == DW_TAG_try_block ++ || die->parent->tag == DW_TAG_catch_block) ++ return 0; ++ ++ attr = dwarf2_attr (die, DW_AT_external, cu); ++ if (attr || die->parent->tag == DW_TAG_namespace) ++ return 1; ++ ++ return 0; ++ } ++ ++ default: ++ return 0; ++ } ++} ++ ++/* Compute the fully qualified name of DIE in CU. If PHYSNAME is nonzero, ++ compute the physname for the object, which include a method's ++ formal parameters (C++/Java) and return type (Java). ++ ++ The result is allocated on the objfile_obstack and canonicalized. */ ++ ++static const char * ++dwarf2_compute_name (char *name, struct die_info *die, struct dwarf2_cu *cu, ++ int physname) ++{ ++ if (name == NULL) ++ name = dwarf2_name (die, cu); ++ ++ /* These are the only languages we know how to qualify names in. */ + if (name != NULL + && (cu->language == language_cplus || cu->language == language_java)) + { @@ -4150,17 +4409,9 @@ index 86bfecb..ddf2189 100644 + long length; + char *prefix; + struct ui_file *buf; - -- /* If no prefix is necessary for this type of DIE, return the -- unqualified name. The other three tags listed could be handled -- in pdi_needs_namespace, but that requires broader changes. */ -- if (!pdi_needs_namespace (die->tag) -- && die->tag != DW_TAG_subprogram -- && die->tag != DW_TAG_variable -- && die->tag != DW_TAG_member) -- return name; -+ buf = mem_fileopen (); ++ + prefix = determine_prefix (die, cu); ++ buf = mem_fileopen (); + if (*prefix != '\0') + { + char *prefixed_name = typename_concat (NULL, prefix, name, cu); @@ -4168,12 +4419,36 @@ index 86bfecb..ddf2189 100644 + xfree (prefixed_name); + } + else -+ fputs_unfiltered (name, buf); - -- prefix = determine_prefix (die, cu); -- if (*prefix != '\0') -- name = typename_concat (&cu->objfile->objfile_obstack, prefix, -- name, cu); ++ fputs_unfiltered (name ? name : "", buf); ++ ++ /* For Java and C++ methods, append formal parameter type ++ information, if PHYSNAME. */ ++ ++ if (physname && die->tag == DW_TAG_subprogram ++ && (cu->language == language_cplus ++ || cu->language == language_java)) ++ { ++ struct type *type = read_type_die (die, cu); ++ ++ c_type_print_args (type, buf, 0, cu->language); ++ ++ if (cu->language == language_java) ++ { ++ /* For java, we must append the return type to method ++ names. */ ++ if (die->tag == DW_TAG_subprogram) ++ java_print_type (TYPE_TARGET_TYPE (type), "", buf, ++ 0, 0); ++ } ++ else if (cu->language == language_cplus) ++ { ++ if (TYPE_NFIELDS (type) > 0 ++ && TYPE_FIELD_ARTIFICIAL (type, 0) ++ && TYPE_CONST (TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (type, 0)))) ++ fputs_unfiltered (" const", buf); ++ } ++ } ++ + name = ui_file_obsavestring (buf, &cu->objfile->objfile_obstack, + &length); + ui_file_delete (buf); @@ -4188,10 +4463,64 @@ index 86bfecb..ddf2189 100644 + } + } + } ++ ++ return name; ++} ++ + /* Return the fully qualified name of DIE, based on its DW_AT_name. + If scope qualifiers are appropriate they will be added. The result + will be allocated on the objfile_obstack, or NULL if the DIE does +- not have a name. */ ++ not have a name. NAME may either be from a previous call to ++ dwarf2_name or NULL. ++ ++ The output string will be canonicalized (if C++/Java). */ - return name; - } + static const char * +-dwarf2_full_name (struct die_info *die, struct dwarf2_cu *cu) ++dwarf2_full_name (char *name, struct die_info *die, struct dwarf2_cu *cu) + { +- struct attribute *attr; +- char *prefix, *name; +- struct ui_file *buf = NULL; ++ return dwarf2_compute_name (name, die, cu, 0); ++} +- name = dwarf2_name (die, cu); +- if (!name) +- return NULL; ++/* Construct a physname for the given DIE in CU. NAME may either be ++ from a previous call to dwarf2_name or NULL. The result will be ++ allocated on teh objfile_objstack or NULL if the DIE does not have a ++ name. + +- /* These are the only languages we know how to qualify names in. */ +- if (cu->language != language_cplus +- && cu->language != language_java) +- return name; +- +- /* If no prefix is necessary for this type of DIE, return the +- unqualified name. The other three tags listed could be handled +- in pdi_needs_namespace, but that requires broader changes. */ +- if (!pdi_needs_namespace (die->tag) +- && die->tag != DW_TAG_subprogram +- && die->tag != DW_TAG_variable +- && die->tag != DW_TAG_member) +- return name; +- +- prefix = determine_prefix (die, cu); +- if (*prefix != '\0') +- name = typename_concat (&cu->objfile->objfile_obstack, prefix, +- name, cu); ++ The output string will be canonicalized (if C++/Java). */ + +- return name; ++static const char * ++dwarf2_physname (char *name, struct die_info *die, struct dwarf2_cu *cu) ++{ ++ return dwarf2_compute_name (name, die, cu, 1); ++} ++ +/* Read the given DIE's DW_AT_decl_line number. Return -1 if in case of an + error. */ + @@ -4205,15 +4534,15 @@ index 86bfecb..ddf2189 100644 + return DW_UNSND (line_attr); + + return -1; -+} -+ - /* Read the import statement specified by the given die and record it. */ + } - static void -@@ -3385,9 +3670,15 @@ read_import_statement (struct die_info *die, struct dwarf2_cu *cu) + /* Read the import statement specified by the given die and record it. */ +@@ -3385,11 +3745,15 @@ read_import_statement (struct die_info *die, struct dwarf2_cu *cu) struct dwarf2_cu *imported_cu; const char *imported_name; const char *imported_name_prefix; +- char *import_alias; +- - const char *import_prefix; char *canonical_name; - @@ -4228,18 +4557,14 @@ index 86bfecb..ddf2189 100644 import_attr = dwarf2_attr (die, DW_AT_import, cu); if (import_attr == NULL) { -@@ -3436,17 +3727,27 @@ read_import_statement (struct die_info *die, struct dwarf2_cu *cu) - return; +@@ -3439,19 +3803,25 @@ read_import_statement (struct die_info *die, struct dwarf2_cu *cu) } -- /* FIXME: dwarf2_name (die); for the local name after import. */ -- -- /* Figure out where the statement is being imported to. */ -+ /* Figure out the local name after import. */ + /* Figure out the local name after import. */ +- import_alias = dwarf2_name (die, cu); + import_alias = dwarf2_name(die, cu); -+ if(import_alias == NULL){ -+ import_alias = ""; -+ } + +- /* Figure out where the statement is being imported to. */ + + /* Determine the line number at which the import was made */ + line_number = dwarf2_read_decl_line(die, cu); @@ -4249,38 +4574,38 @@ index 86bfecb..ddf2189 100644 /* Figure out what the scope of the imported die is and prepend it to the name of the imported die. */ -- imported_name_prefix = determine_prefix (imported_die, imported_cu); + imported_name_prefix = determine_prefix (imported_die, imported_cu); - - if (strlen (imported_name_prefix) > 0) - { -+ imported_name_prefix = determine_prefix (imported_die, cu); +- canonical_name = alloca (strlen (imported_name_prefix) +- + 2 + strlen (imported_name) + 1); + + if(imported_die->tag != DW_TAG_namespace){ + imported_declaration = imported_name; + canonical_name = (char*)imported_name_prefix; + }else{ + if(strlen (imported_name_prefix) > 0){ - canonical_name = alloca (strlen (imported_name_prefix) + 2 + strlen (imported_name) + 1); ++ canonical_name = alloca (strlen (imported_name_prefix) + 2 + strlen (imported_name) + 1); strcpy (canonical_name, imported_name_prefix); strcat (canonical_name, "::"); -@@ -3457,8 +3758,14 @@ read_import_statement (struct die_info *die, struct dwarf2_cu *cu) + strcat (canonical_name, imported_name); +@@ -3461,10 +3831,13 @@ read_import_statement (struct die_info *die, struct dwarf2_cu *cu) canonical_name = alloca (strlen (imported_name) + 1); strcpy (canonical_name, imported_name); } - -- using_directives = cp_add_using (import_prefix,canonical_name, using_directives); + } + -+ using_directives = cp_add_using (import_prefix, -+ canonical_name, -+ import_alias, + using_directives = cp_add_using (import_prefix, + canonical_name, + import_alias, + imported_declaration, + line_number, -+ using_directives); + using_directives); } - static void -@@ -3727,6 +4034,14 @@ inherit_abstract_dies (struct die_info *die, struct dwarf2_cu *cu) +@@ -3734,6 +4107,14 @@ inherit_abstract_dies (struct die_info *die, struct dwarf2_cu *cu) struct attribute *attr; attr = dwarf2_attr (die, DW_AT_abstract_origin, cu); @@ -4295,7 +4620,7 @@ index 86bfecb..ddf2189 100644 if (!attr) return; -@@ -3825,6 +4140,7 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) +@@ -3832,6 +4213,7 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) char *name; CORE_ADDR baseaddr; struct block *block; @@ -4303,7 +4628,7 @@ index 86bfecb..ddf2189 100644 int inlined_func = (die->tag == DW_TAG_inlined_subroutine); if (inlined_func) -@@ -3843,13 +4159,23 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) +@@ -3850,13 +4232,23 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); @@ -4330,7 +4655,7 @@ index 86bfecb..ddf2189 100644 lowpc += baseaddr; highpc += baseaddr; -@@ -3876,14 +4202,19 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) +@@ -3883,14 +4275,19 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) cu->list_in_scope = &local_symbols; @@ -4357,7 +4682,7 @@ index 86bfecb..ddf2189 100644 } inherit_abstract_dies (die, cu); -@@ -3899,6 +4230,13 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) +@@ -3906,6 +4303,13 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) determine_prefix (die, cu), processing_has_namespace_info); @@ -4371,31 +4696,31 @@ index 86bfecb..ddf2189 100644 /* If we have address ranges, record them. */ dwarf2_record_block_ranges (die, block, baseaddr, cu); -@@ -4517,7 +4855,7 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die, +@@ -4524,7 +4928,7 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die, return; /* Get physical name. */ - physname = dwarf2_linkage_name (die, cu); -+ physname = dwarf2_physname (die, cu); ++ physname = (char *) dwarf2_physname (fieldname, die, cu); /* The name is already allocated along with this objfile, so we don't need to duplicate it for the type. */ -@@ -4679,7 +5017,7 @@ dwarf2_add_member_fn (struct field_info *fip, struct die_info *die, +@@ -4686,7 +5090,7 @@ dwarf2_add_member_fn (struct field_info *fip, struct die_info *die, return; /* Get the mangled name. */ - physname = dwarf2_linkage_name (die, cu); -+ physname = dwarf2_physname (die, cu); ++ physname = (char *) dwarf2_physname (fieldname, die, cu); /* Look up member function name in fieldlist. */ for (i = 0; i < fip->nfnfields; i++) -@@ -4986,14 +5324,18 @@ read_structure_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -4993,14 +5397,18 @@ read_structure_type (struct die_info *die, struct dwarf2_cu *cu) if (cu->language == language_cplus || cu->language == language_java) { - const char *new_prefix = determine_class_name (die, cu); - TYPE_TAG_NAME (type) = (char *) new_prefix; -+ TYPE_TAG_NAME (type) = (char *) dwarf2_full_name (die, cu); ++ TYPE_TAG_NAME (type) = (char *) dwarf2_full_name (name, die, cu); + if (die->tag == DW_TAG_structure_type + || die->tag == DW_TAG_class_type) + TYPE_NAME (type) = TYPE_TAG_NAME (type); @@ -4411,7 +4736,16 @@ index 86bfecb..ddf2189 100644 } } -@@ -5237,51 +5579,6 @@ read_enumeration_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -5219,7 +5627,7 @@ read_enumeration_type (struct die_info *die, struct dwarf2_cu *cu) + type = alloc_type (objfile); + + TYPE_CODE (type) = TYPE_CODE_ENUM; +- name = dwarf2_full_name (die, cu); ++ name = dwarf2_full_name (NULL, die, cu); + if (name != NULL) + TYPE_TAG_NAME (type) = (char *) name; + +@@ -5244,51 +5652,6 @@ read_enumeration_type (struct die_info *die, struct dwarf2_cu *cu) return set_die_type (die, type, cu); } @@ -4463,7 +4797,7 @@ index 86bfecb..ddf2189 100644 /* Given a pointer to a die which begins an enumeration, process all the dies that define the members of the enumeration, and create the symbol for the enumeration type. -@@ -5359,6 +5656,29 @@ process_enumeration_scope (struct die_info *die, struct dwarf2_cu *cu) +@@ -5366,6 +5729,29 @@ process_enumeration_scope (struct die_info *die, struct dwarf2_cu *cu) new_symbol (die, this_type, cu); } @@ -4493,7 +4827,7 @@ index 86bfecb..ddf2189 100644 /* Extract all information from a DW_TAG_array_type DIE and put it in the DIE's type field. For now, this only handles one dimensional arrays. */ -@@ -5372,7 +5692,7 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -5379,7 +5765,7 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) struct type *element_type, *range_type, *index_type; struct type **range_types = NULL; struct attribute *attr; @@ -4502,7 +4836,7 @@ index 86bfecb..ddf2189 100644 struct cleanup *back_to; char *name; -@@ -5419,16 +5739,11 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -5426,16 +5812,11 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) type = element_type; if (read_array_order (die, cu) == DW_ORD_col_major) @@ -4524,16 +4858,16 @@ index 86bfecb..ddf2189 100644 /* Understand Dwarf2 support for vector types (like they occur on the PowerPC w/ AltiVec). Gcc just adds another attribute to the -@@ -5617,7 +5932,7 @@ read_namespace (struct die_info *die, struct dwarf2_cu *cu) +@@ -5624,7 +6005,7 @@ read_namespace (struct die_info *die, struct dwarf2_cu *cu) if (is_anonymous) { const char *previous_prefix = determine_prefix (die, cu); -- cp_add_using_directive (previous_prefix, TYPE_NAME (type)); -+ cp_add_using_directive (previous_prefix, TYPE_NAME (type), "", "", dwarf2_read_decl_line(die, cu)); +- cp_add_using_directive (previous_prefix, TYPE_NAME (type), NULL); ++ cp_add_using_directive (previous_prefix, TYPE_NAME (type), NULL, "", dwarf2_read_decl_line(die, cu)); } } -@@ -5633,20 +5948,155 @@ read_namespace (struct die_info *die, struct dwarf2_cu *cu) +@@ -5640,20 +6021,155 @@ read_namespace (struct die_info *die, struct dwarf2_cu *cu) } } @@ -4546,20 +4880,20 @@ index 86bfecb..ddf2189 100644 { - struct die_info *child_die = die->child; + struct type *type; - -- /* FIXME: Support the separate Fortran module namespaces. */ ++ + type = read_module_type (die, cu); + + if (type) + new_symbol (die, type, cu); +} - -+/* Read a Fortran module as type. + ++/* Read a Fortran module as type. + +- /* FIXME: Support the separate Fortran module namespaces. */ + Modules present only as declarations - being used only for DW_AT_import of + DW_TAG_imported_module - are ignored here. They are read in only in form of + the module name by read_fortran_imported_module. */ -+ + +static struct type * +read_module_type (struct die_info *die, struct dwarf2_cu *cu) +{ @@ -4692,7 +5026,7 @@ index 86bfecb..ddf2189 100644 } /* Return the name of the namespace represented by DIE. Set -@@ -5811,29 +6261,113 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -5818,29 +6334,113 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu) struct gdbarch *gdbarch = get_objfile_arch (objfile); struct type *type, *range_type, *index_type, *char_type; struct attribute *attr; @@ -4820,7 +5154,7 @@ index 86bfecb..ddf2189 100644 char_type = language_string_char_type (cu->language_defn, gdbarch); type = create_string_type (NULL, char_type, range_type); -@@ -5933,7 +6467,6 @@ static struct type * +@@ -5940,11 +6540,10 @@ static struct type * read_typedef (struct die_info *die, struct dwarf2_cu *cu) { struct objfile *objfile = cu->objfile; @@ -4828,7 +5162,12 @@ index 86bfecb..ddf2189 100644 const char *name = NULL; struct type *this_type; -@@ -6041,8 +6574,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +- name = dwarf2_full_name (die, cu); ++ name = dwarf2_full_name (NULL, die, cu); + this_type = init_type (TYPE_CODE_TYPEDEF, 0, + TYPE_FLAG_TARGET_STUB, NULL, objfile); + TYPE_NAME (this_type) = (char *) name; +@@ -6048,8 +6647,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) struct type *base_type; struct type *range_type; struct attribute *attr; @@ -4838,7 +5177,7 @@ index 86bfecb..ddf2189 100644 char *name; LONGEST negative_mask; -@@ -6056,49 +6588,101 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -6063,49 +6661,101 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) 0, NULL, cu->objfile); } @@ -4943,7 +5282,8 @@ index 86bfecb..ddf2189 100644 + if (attr && attr_form_is_constant (attr)) + { + LONGEST high; -+ + +- range_type = create_range_type (NULL, base_type, low, high); + high = dwarf2_get_attr_constant_value (attr, 0); + if (!TYPE_UNSIGNED (base_type) && (high & negative_mask)) + high |= negative_mask; @@ -4955,8 +5295,7 @@ index 86bfecb..ddf2189 100644 + TYPE_HIGH_BOUND (range_type) = low - 1; + } + } - -- range_type = create_range_type (NULL, base_type, low, high); ++ + /* DW_AT_bit_stride is currently unsupported as we count in bytes. */ + attr = dwarf2_attr (die, DW_AT_byte_stride, cu); + if (attr && attr_form_is_block (attr)) @@ -4976,7 +5315,7 @@ index 86bfecb..ddf2189 100644 name = dwarf2_name (die, cu); if (name) -@@ -6557,6 +7141,7 @@ load_partial_dies (bfd *abfd, gdb_byte *buffer, gdb_byte *info_ptr, +@@ -6564,6 +7214,7 @@ load_partial_dies (bfd *abfd, gdb_byte *buffer, gdb_byte *info_ptr, && abbrev->tag != DW_TAG_lexical_block && abbrev->tag != DW_TAG_variable && abbrev->tag != DW_TAG_namespace @@ -4984,18 +5323,17 @@ index 86bfecb..ddf2189 100644 && abbrev->tag != DW_TAG_member) { /* Otherwise we skip to the next sibling, if any. */ -@@ -6765,8 +7350,8 @@ read_partial_die (struct partial_die_info *part_die, +@@ -6772,7 +7423,8 @@ read_partial_die (struct partial_die_info *part_die, } break; case DW_AT_MIPS_linkage_name: - part_die->name = DW_STRING (&attr); -- break; + if (cu->language == language_ada) + part_die->name = DW_STRING (&attr); + break; case DW_AT_low_pc: has_low_pc_attr = 1; - part_die->lowpc = DW_ADDR (&attr); -@@ -6963,7 +7548,8 @@ fixup_partial_die (struct partial_die_info *part_die, +@@ -6970,7 +7622,8 @@ fixup_partial_die (struct partial_die_info *part_die, /* If we found a reference attribute and the DIE has no name, try to find a name in the referred to DIE. */ @@ -5005,7 +5343,7 @@ index 86bfecb..ddf2189 100644 { struct partial_die_info *spec_die; -@@ -8305,10 +8891,12 @@ var_decode_location (struct attribute *attr, struct symbol *sym, +@@ -8312,10 +8965,12 @@ var_decode_location (struct attribute *attr, struct symbol *sym, (i.e. when the value of a register or memory location is referenced, or a thread-local block, etc.). Then again, it might not be worthwhile. I'm assuming that it isn't unless performance @@ -5020,7 +5358,7 @@ index 86bfecb..ddf2189 100644 } /* Given a pointer to a DWARF information entry, figure out if we need -@@ -8330,21 +8918,29 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu) +@@ -8337,21 +8992,27 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu) baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); @@ -5041,13 +5379,10 @@ index 86bfecb..ddf2189 100644 + /* Some methods are called w/o checking SYMBOL_COMPUTED_OPS validity. */ + SYMBOL_COMPUTED_OPS (sym) = &dwarf2_missing_funcs; -- /* Cache this symbol's name and the name's demangled form (if any). */ + /* Cache this symbol's name and the name's demangled form (if any). */ SYMBOL_LANGUAGE (sym) = cu->language; - SYMBOL_SET_NAMES (sym, name, strlen (name), 0, objfile); -+ -+ /* Cache this symbol's name and the name's demangled form (if any). */ -+ -+ linkagename = dwarf2_physname (die, cu); ++ linkagename = dwarf2_physname (name, die, cu); + SYMBOL_SET_NAMES (sym, linkagename, strlen (linkagename), 0, objfile); + if (cu->language == language_fortran) + { @@ -5057,7 +5392,7 @@ index 86bfecb..ddf2189 100644 /* Default assumptions. Use the passed type or decode it from the die. */ -@@ -8444,7 +9040,24 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu) +@@ -8451,7 +9112,24 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu) var_decode_location (attr, sym, cu); attr2 = dwarf2_attr (die, DW_AT_external, cu); if (attr2 && (DW_UNSND (attr2) != 0)) @@ -5083,7 +5418,27 @@ index 86bfecb..ddf2189 100644 else add_symbol_to_list (sym, cu->list_in_scope); } -@@ -8605,6 +9218,11 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu) +@@ -8576,7 +9254,8 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu) + } + break; + case DW_TAG_typedef: +- SYMBOL_LINKAGE_NAME (sym) = (char *) dwarf2_full_name (die, cu); ++ SYMBOL_LINKAGE_NAME (sym) ++ = (char *) dwarf2_full_name (name, die, cu); + SYMBOL_CLASS (sym) = LOC_TYPEDEF; + SYMBOL_DOMAIN (sym) = VAR_DOMAIN; + add_symbol_to_list (sym, cu->list_in_scope); +@@ -8588,7 +9267,8 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu) + add_symbol_to_list (sym, cu->list_in_scope); + break; + case DW_TAG_enumerator: +- SYMBOL_LINKAGE_NAME (sym) = (char *) dwarf2_full_name (die, cu); ++ SYMBOL_LINKAGE_NAME (sym) ++ = (char *) dwarf2_full_name (name, die, cu); + attr = dwarf2_attr (die, DW_AT_const_value, cu); + if (attr) + { +@@ -8612,6 +9292,11 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu) SYMBOL_CLASS (sym) = LOC_TYPEDEF; add_symbol_to_list (sym, &global_symbols); break; @@ -5095,7 +5450,7 @@ index 86bfecb..ddf2189 100644 default: /* Not a tag we recognize. Hopefully we aren't processing trash data, but since we must specifically ignore things -@@ -8618,8 +9236,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu) +@@ -8625,8 +9310,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu) /* For the benefit of old versions of GCC, check for anonymous namespaces based on the demangled name. */ if (!processing_has_namespace_info @@ -5105,7 +5460,7 @@ index 86bfecb..ddf2189 100644 cp_scan_for_anonymous_namespaces (sym); } return (sym); -@@ -8931,12 +9548,18 @@ read_type_die (struct die_info *die, struct dwarf2_cu *cu) +@@ -8938,12 +9622,18 @@ read_type_die (struct die_info *die, struct dwarf2_cu *cu) case DW_TAG_namespace: this_type = read_namespace_type (die, cu); break; @@ -5124,7 +5479,18 @@ index 86bfecb..ddf2189 100644 return this_type; } -@@ -9018,10 +9641,103 @@ determine_prefix (struct die_info *die, struct dwarf2_cu *cu) +@@ -9011,6 +9701,10 @@ determine_prefix (struct die_info *die, struct dwarf2_cu *cu) + case DW_TAG_namespace: + parent_type = read_type_die (parent, cu); + /* We give a name to even anonymous namespaces. */ ++ ++ /* G++ 4.1 produced DW_TAG_namespace with DW_AT_name "::". */ ++ if (strcmp (TYPE_TAG_NAME (parent_type), "::") == 0) ++ return ""; + return TYPE_TAG_NAME (parent_type); + case DW_TAG_class_type: + case DW_TAG_interface_type: +@@ -9025,7 +9719,7 @@ determine_prefix (struct die_info *die, struct dwarf2_cu *cu) So it does not need a prefix. */ return ""; default: @@ -5133,192 +5499,19 @@ index 86bfecb..ddf2189 100644 } } -+/* Determines the prefix for a symbol's physname. Unlike determine_prefix, -+ this method does not simply look at the DIE's immediate parent. -+ It will compute the symbol's physname by scanning through all parent -+ DIEs until it gets to the compilation unit's DIE. */ -+ -+static char * -+physname_prefix (struct die_info *die, struct dwarf2_cu *cu) -+{ -+ long length; -+ struct ui_file *buf; -+ struct die_info *d, *spec_die; -+ struct dwarf2_cu *spec_cu; -+ char *name; -+ -+ /* Construct a stack containing all of the DIE's parents. Caution -+ must be observed for dealing with DW_AT_specification. */ -+ spec_cu = cu; -+ spec_die = die_specification (die, &spec_cu); -+ if (spec_die != NULL) -+ d = spec_die->parent; -+ else -+ d = die->parent; -+ while (d != NULL && d->tag != DW_TAG_compile_unit) -+ { -+ struct attribute *attr; -+ -+ spec_die = die_specification (d, &spec_cu); -+ if (spec_die != NULL) -+ d = spec_die; -+ -+ VEC_quick_push (die_info_p, die_list, d); -+ d = d->parent; -+ } -+ -+ /* Now pop all the elements, printing their names as we go. */ -+ buf = mem_fileopen (); -+ while (!VEC_empty (die_info_p, die_list)) -+ { -+ d = VEC_pop (die_info_p, die_list); -+ physname_prefix_1 (buf, d, cu); -+ -+ if (!VEC_empty (die_info_p, die_list)) -+ { -+ if (cu->language == language_cplus) -+ fputs_unfiltered ("::", buf); -+ else -+ fputs_unfiltered (".", buf); -+ } -+ } -+ -+ name = ui_file_obsavestring (buf, &cu->objfile->objfile_obstack, &length); -+ ui_file_delete (buf); -+ return name; -+} -+ -+static void -+physname_prefix_1 (struct ui_file *buf, struct die_info *die, -+ struct dwarf2_cu *cu) -+{ -+ const char *name = NULL; -+ gdb_assert (buf != NULL); -+ -+ if (die != NULL) -+ { -+ switch (die->tag) -+ { -+ case DW_TAG_namespace: -+ name = dwarf2_name (die, cu); -+ if (name == NULL) -+ name = "(anonymous namespace)"; -+ /* G++ 4.1 produced DW_TAG_namespace with DW_AT_name "::". */ -+ else if (strcmp (name, "::") == 0) -+ name = NULL; -+ break; -+ -+ case DW_TAG_class_type: -+ case DW_TAG_structure_type: -+ case DW_TAG_union_type: -+ case DW_TAG_enumeration_type: -+ case DW_TAG_interface_type: -+ case DW_TAG_subprogram: -+ name = dwarf2_name (die, cu); -+ break; -+ -+ default: -+ break; -+ } -+ } -+ -+ if (name != NULL) -+ fputs_unfiltered (name, buf); -+} -+ - /* Return a newly-allocated string formed by concatenating PREFIX and - SUFFIX with appropriate separator. If PREFIX or SUFFIX is NULL or empty, then - simply copy the SUFFIX or PREFIX, respectively. If OBS is non-null, -@@ -9071,17 +9787,111 @@ sibling_die (struct die_info *die) +@@ -9078,17 +9772,37 @@ sibling_die (struct die_info *die) return die->sibling; } -/* Get linkage name of a die, return NULL if not found. */ -+/* Construct a physname for the given DIE in CU. */ ++/* Return the fully qualified .symtab name for symbols contained in Fortran ++ modules. Return DWARF2_NAME otherwise. */ static char * -dwarf2_linkage_name (struct die_info *die, struct dwarf2_cu *cu) -+dwarf2_physname (struct die_info *die, struct dwarf2_cu *cu) - { - struct attribute *attr; -+ char *name; - -- attr = dwarf2_attr (die, DW_AT_MIPS_linkage_name, cu); -- if (attr && DW_STRING (attr)) -- return DW_STRING (attr); -- return dwarf2_name (die, cu); -+ name = dwarf2_name (die, cu); -+ -+ /* These are the only languages we know how to qualify names in. */ -+ if (cu->language != language_cplus -+ && cu->language != language_java) -+ return name; -+ -+ if (die_needs_namespace (die, cu)) -+ { -+ long length; -+ char *prefix; -+ struct ui_file *buf; -+ -+ prefix = physname_prefix (die, cu); -+ buf = mem_fileopen (); -+ if (*prefix != '\0') -+ { -+ char *prefixed_name = typename_concat (NULL, prefix, name, cu); -+ fputs_unfiltered (prefixed_name, buf); -+ xfree (prefixed_name); -+ } -+ else -+ fputs_unfiltered (name ? name : "", buf); -+ -+ /* For Java and C++ methods, append formal parameter type -+ information. */ -+ if ((cu->language == language_cplus || cu->language == language_java) -+ && die->tag == DW_TAG_subprogram) -+ { -+ struct type *type = read_type_die (die, cu); -+ -+ c_type_print_args (type, buf, 0, cu->language); -+ -+ if (cu->language == language_java) -+ { -+ /* For java, we must append the return type to method names. */ -+ if (die->tag == DW_TAG_subprogram) -+ java_print_type (TYPE_TARGET_TYPE (type), "", buf, 0, 0); -+ } -+ else if (cu->language == language_cplus) -+ { -+ /* c_type_print_args adds argument types, but it does -+ not add any necessary "const". */ -+ if (TYPE_NFIELDS (type) > 0 && TYPE_FIELD_ARTIFICIAL (type, 0) -+ && TYPE_CONST (TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (type, 0)))) -+ fputs_unfiltered (" const", buf); -+ } -+ } -+ -+ name = ui_file_obsavestring (buf, &cu->objfile->objfile_obstack, -+ &length); -+ ui_file_delete (buf); -+ -+ if (cu->language == language_cplus) -+ { -+ char *cname -+ = dwarf2_canonicalize_name (name, cu, -+ &cu->objfile->objfile_obstack); -+ if (cname != NULL) -+ name = cname; -+ } -+ } -+ -+ return name; -+} -+ -+/* Return the fully qualified .symtab name for symbols contained in Fortran -+ modules. Return DWARF2_NAME otherwise. */ -+ -+static char * +fortran_module_linkage_name (struct die_info *die, struct dwarf2_cu *cu) -+{ + { +- struct attribute *attr; + char *name; + + gdb_assert (cu->language == language_fortran); @@ -5342,12 +5535,16 @@ index 86bfecb..ddf2189 100644 + return retval; + } + } -+ + +- attr = dwarf2_attr (die, DW_AT_MIPS_linkage_name, cu); +- if (attr && DW_STRING (attr)) +- return DW_STRING (attr); +- return dwarf2_name (die, cu); + return name; } /* Get name of a die, return NULL if not found. */ -@@ -11429,6 +12239,34 @@ attr_form_is_constant (struct attribute *attr) +@@ -11436,6 +12150,34 @@ attr_form_is_constant (struct attribute *attr) } } @@ -5382,7 +5579,7 @@ index 86bfecb..ddf2189 100644 static void dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym, struct dwarf2_cu *cu) -@@ -11458,35 +12296,25 @@ dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym, +@@ -11465,35 +12207,25 @@ dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym, SYMBOL_COMPUTED_OPS (sym) = &dwarf2_loclist_funcs; SYMBOL_LOCATION_BATON (sym) = baton; } @@ -5433,7 +5630,7 @@ index 86bfecb..ddf2189 100644 } } -@@ -11774,6 +12602,31 @@ offset_and_type_eq (const void *item_lhs, const void *item_rhs) +@@ -11781,6 +12513,31 @@ offset_and_type_eq (const void *item_lhs, const void *item_rhs) return ofs_lhs->offset == ofs_rhs->offset; } @@ -5465,7 +5662,7 @@ index 86bfecb..ddf2189 100644 /* Set the type associated with DIE to TYPE. Save it in CU's hash table if necessary. For convenience, return TYPE. */ -@@ -11782,6 +12635,8 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) +@@ -11789,6 +12546,8 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) { struct dwarf2_offset_and_type **slot, ofs; @@ -5474,7 +5671,7 @@ index 86bfecb..ddf2189 100644 /* For Ada types, make sure that the gnat-specific data is always initialized (if not already set). There are a few types where we should not be doing so, because the type-specific area is -@@ -11937,23 +12792,13 @@ show_dwarf2_cmd (char *args, int from_tty) +@@ -11944,23 +12703,13 @@ show_dwarf2_cmd (char *args, int from_tty) cmd_show_list (show_dwarf2_cmdlist, from_tty, ""); } @@ -5502,7 +5699,7 @@ index 86bfecb..ddf2189 100644 } /* munmap debug sections for OBJFILE, if necessary. */ -@@ -11962,15 +12807,15 @@ static void +@@ -11969,15 +12718,15 @@ static void dwarf2_per_objfile_free (struct objfile *objfile, void *d) { struct dwarf2_per_objfile *data = d; @@ -5527,16 +5724,8 @@ index 86bfecb..ddf2189 100644 } void _initialize_dwarf2_read (void); -@@ -11978,6 +12823,7 @@ void _initialize_dwarf2_read (void); - void - _initialize_dwarf2_read (void) - { -+ die_list = VEC_alloc (die_info_p, 32); - dwarf2_objfile_data_key - = register_objfile_data_with_cleanup (NULL, dwarf2_per_objfile_free); - diff --git a/gdb/elfread.c b/gdb/elfread.c -index 78e9163..dc8a752 100644 +index 9a2a1e3..72b1d13 100644 --- a/gdb/elfread.c +++ b/gdb/elfread.c @@ -179,7 +179,8 @@ record_minimal_symbol (const char *name, int name_len, int copy_name, @@ -5615,7 +5804,7 @@ index 78e9163..dc8a752 100644 default_symfile_offsets, /* sym_offsets: Translate ext. to int. relocation */ elf_symfile_segments, /* sym_segments: Get segment information from diff --git a/gdb/eval.c b/gdb/eval.c -index a0556cf..abe6a06 100644 +index e2ceea7..1bcb4a7 100644 --- a/gdb/eval.c +++ b/gdb/eval.c @@ -43,6 +43,7 @@ @@ -5631,10 +5820,18 @@ index a0556cf..abe6a06 100644 struct type **arg_types; int save_pos1; + struct cleanup *old_chain; + struct symbol *function = NULL; + char *function_name = NULL; - pc = (*pos)++; - op = exp->elts[pc].opcode; -@@ -1332,7 +1334,6 @@ evaluate_subexp_standard (struct type *expect_type, +@@ -731,6 +733,7 @@ evaluate_subexp_standard (struct type *expect_type, + return value_from_decfloat (exp->elts[pc + 1].type, + exp->elts[pc + 2].decfloatconst); + ++ case OP_ADL_FUNC: + case OP_VAR_VALUE: + (*pos) += 3; + if (noside == EVAL_SKIP) +@@ -1334,7 +1337,6 @@ evaluate_subexp_standard (struct type *expect_type, argvec = (struct value **) alloca (sizeof (struct value *) * (nargs + 3)); if (op == STRUCTOP_MEMBER || op == STRUCTOP_MPTR) { @@ -5642,7 +5839,7 @@ index a0556cf..abe6a06 100644 /* First, evaluate the structure into arg2 */ pc2 = (*pos)++; -@@ -1356,21 +1357,40 @@ evaluate_subexp_standard (struct type *expect_type, +@@ -1358,21 +1360,40 @@ evaluate_subexp_standard (struct type *expect_type, arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); @@ -5695,7 +5892,71 @@ index a0556cf..abe6a06 100644 } else if (op == STRUCTOP_STRUCT || op == STRUCTOP_PTR) { -@@ -1496,8 +1516,7 @@ evaluate_subexp_standard (struct type *expect_type, +@@ -1412,6 +1433,17 @@ evaluate_subexp_standard (struct type *expect_type, + /* Now, say which argument to start evaluating from */ + tem = 2; + } ++ else if (op == OP_ADL_FUNC) ++ { ++ /* Save the function position and move pos so that the arguments ++ can be evaluated. */ ++ int func_name_len; ++ save_pos1 = *pos; ++ tem = 1; ++ ++ func_name_len = longest_to_int (exp->elts[save_pos1 + 3].longconst); ++ (*pos) += 6 + BYTES_TO_EXP_ELEM (func_name_len + 1); ++ } + else if (op == OP_SCOPE + && overload_resolution + && (exp->language_defn->la_language == language_cplus)) +@@ -1433,9 +1465,9 @@ evaluate_subexp_standard (struct type *expect_type, + if (TYPE_CODE (type) == TYPE_CODE_NAMESPACE) + { + function = cp_lookup_symbol_namespace (TYPE_TAG_NAME (type), +- name, NULL, ++ name, + get_selected_block (0), +- VAR_DOMAIN, 1); ++ VAR_DOMAIN); + if (function == NULL) + error (_("No symbol \"%s\" in namespace \"%s\"."), + name, TYPE_TAG_NAME (type)); +@@ -1484,6 +1516,33 @@ evaluate_subexp_standard (struct type *expect_type, + /* signal end of arglist */ + argvec[tem] = 0; + ++ if (op == OP_ADL_FUNC) ++ { ++ struct symbol *symp; ++ char *func_name; ++ int name_len; ++ int string_pc = save_pos1 + 3; ++ ++ /* Extract the function name. */ ++ name_len = longest_to_int (exp->elts[string_pc].longconst); ++ func_name = (char *) alloca (name_len + 1); ++ strcpy (func_name, &exp->elts[string_pc + 1].string); ++ ++ /* Prepare list of argument types for overload resolution */ ++ arg_types = (struct type **) alloca (nargs * (sizeof (struct type *))); ++ for (ix = 1; ix <= nargs; ix++) ++ arg_types[ix - 1] = value_type (argvec[ix]); ++ ++ find_overload_match (arg_types, nargs, func_name, ++ 0 /* not method */ , 0 /* strict match */ , ++ NULL, NULL /* pass NULL symbol since symbol is unknown */ , ++ NULL, &symp, NULL); ++ ++ /* Now fix the expression being evaluated */ ++ exp->elts[save_pos1 + 2].symbol = symp; ++ argvec[0] = evaluate_subexp_with_coercion (exp, &save_pos1, noside); ++ } ++ + if (op == STRUCTOP_STRUCT || op == STRUCTOP_PTR + || (op == OP_SCOPE && function_name != NULL)) + { +@@ -1552,8 +1611,7 @@ evaluate_subexp_standard (struct type *expect_type, } else if (op == STRUCTOP_MEMBER || op == STRUCTOP_MPTR) { @@ -5703,9 +5964,9 @@ index a0556cf..abe6a06 100644 - argvec[0] = arg1; + /* Pointer to member. argvec is already set up. */ } - else if (op == OP_VAR_VALUE) + else if (op == OP_VAR_VALUE || (op == OP_SCOPE && function != NULL)) { -@@ -1588,6 +1607,8 @@ evaluate_subexp_standard (struct type *expect_type, +@@ -1653,6 +1711,8 @@ evaluate_subexp_standard (struct type *expect_type, /* First determine the type code we are dealing with. */ arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); @@ -5714,7 +5975,7 @@ index a0556cf..abe6a06 100644 type = check_typedef (value_type (arg1)); code = TYPE_CODE (type); -@@ -1608,6 +1629,7 @@ evaluate_subexp_standard (struct type *expect_type, +@@ -1673,6 +1733,7 @@ evaluate_subexp_standard (struct type *expect_type, code = TYPE_CODE (type); } } @@ -5722,7 +5983,7 @@ index a0556cf..abe6a06 100644 switch (code) { -@@ -1769,6 +1791,27 @@ evaluate_subexp_standard (struct type *expect_type, +@@ -1834,6 +1895,26 @@ evaluate_subexp_standard (struct type *expect_type, xfree (expect_type); return arg1; @@ -5732,7 +5993,6 @@ index a0556cf..abe6a06 100644 + struct symbol *sym; + struct type **arg_types; + (*pos) += 3; -+ printf ("TYPE_INSTANCE_LOOKUP\n"); + arg_types = (struct type **) alloca (TYPE_NFIELDS (expect_type) + * sizeof (struct type *)); + for (i = 0; i < TYPE_NFIELDS (expect_type); ++i) @@ -5750,7 +6010,7 @@ index a0556cf..abe6a06 100644 case BINOP_CONCAT: arg1 = evaluate_subexp_with_coercion (exp, pos, noside); arg2 = evaluate_subexp_with_coercion (exp, pos, noside); -@@ -2040,13 +2083,19 @@ evaluate_subexp_standard (struct type *expect_type, +@@ -2105,13 +2186,19 @@ evaluate_subexp_standard (struct type *expect_type, { int subscript_array[MAX_FORTRAN_DIMS]; int array_size_array[MAX_FORTRAN_DIMS]; @@ -5770,7 +6030,7 @@ index a0556cf..abe6a06 100644 tmp_type = check_typedef (value_type (arg1)); ndimensions = calc_f77_array_dims (type); -@@ -2076,6 +2125,9 @@ evaluate_subexp_standard (struct type *expect_type, +@@ -2141,6 +2228,9 @@ evaluate_subexp_standard (struct type *expect_type, upper = f77_get_upperbound (tmp_type); lower = f77_get_lowerbound (tmp_type); @@ -5780,7 +6040,7 @@ index a0556cf..abe6a06 100644 array_size_array[nargs - i - 1] = upper - lower + 1; /* Zero-normalize subscripts so that offsetting will work. */ -@@ -2094,13 +2146,25 @@ evaluate_subexp_standard (struct type *expect_type, +@@ -2159,13 +2249,25 @@ evaluate_subexp_standard (struct type *expect_type, tmp_type = check_typedef (TYPE_TARGET_TYPE (tmp_type)); } @@ -5810,7 +6070,7 @@ index a0556cf..abe6a06 100644 /* Let us now play a dirty trick: we will take arg1 which is a value node pointing to the topmost level -@@ -2110,7 +2174,7 @@ evaluate_subexp_standard (struct type *expect_type, +@@ -2175,7 +2277,7 @@ evaluate_subexp_standard (struct type *expect_type, returns the correct type value */ deprecated_set_value_type (arg1, tmp_type); @@ -5819,7 +6079,7 @@ index a0556cf..abe6a06 100644 } case BINOP_LOGICAL_AND: -@@ -2344,14 +2408,22 @@ evaluate_subexp_standard (struct type *expect_type, +@@ -2409,14 +2511,22 @@ evaluate_subexp_standard (struct type *expect_type, if (expect_type && TYPE_CODE (expect_type) == TYPE_CODE_PTR) expect_type = TYPE_TARGET_TYPE (check_typedef (expect_type)); arg1 = evaluate_subexp (expect_type, exp, pos, noside); @@ -5844,7 +6104,7 @@ index a0556cf..abe6a06 100644 else if (noside == EVAL_AVOID_SIDE_EFFECTS) { type = check_typedef (value_type (arg1)); -@@ -2360,12 +2432,18 @@ evaluate_subexp_standard (struct type *expect_type, +@@ -2425,12 +2535,18 @@ evaluate_subexp_standard (struct type *expect_type, /* In C you can dereference an array to get the 1st elt. */ || TYPE_CODE (type) == TYPE_CODE_ARRAY ) @@ -5868,7 +6128,7 @@ index a0556cf..abe6a06 100644 else error (_("Attempt to take contents of a non-pointer value.")); } -@@ -2375,9 +2453,14 @@ evaluate_subexp_standard (struct type *expect_type, +@@ -2440,9 +2556,14 @@ evaluate_subexp_standard (struct type *expect_type, do. "long long" variables are rare enough that BUILTIN_TYPE_LONGEST would seem to be a mistake. */ if (TYPE_CODE (type) == TYPE_CODE_INT) @@ -5886,7 +6146,7 @@ index a0556cf..abe6a06 100644 case UNOP_ADDR: /* C++: check for and handle pointer to members. */ -@@ -2712,7 +2795,7 @@ evaluate_subexp_with_coercion (struct expression *exp, +@@ -2777,7 +2898,7 @@ evaluate_subexp_with_coercion (struct expression *exp, { enum exp_opcode op; int pc; @@ -5895,7 +6155,7 @@ index a0556cf..abe6a06 100644 struct symbol *var; struct type *type; -@@ -2723,12 +2806,17 @@ evaluate_subexp_with_coercion (struct expression *exp, +@@ -2788,12 +2909,17 @@ evaluate_subexp_with_coercion (struct expression *exp, { case OP_VAR_VALUE: var = exp->elts[pc + 2].symbol; @@ -5914,7 +6174,7 @@ index a0556cf..abe6a06 100644 return value_cast (lookup_pointer_type (TYPE_TARGET_TYPE (type)), val); } -@@ -2780,9 +2868,13 @@ evaluate_subexp_for_sizeof (struct expression *exp, int *pos) +@@ -2845,9 +2971,13 @@ evaluate_subexp_for_sizeof (struct expression *exp, int *pos) case OP_VAR_VALUE: (*pos) += 4; @@ -5931,8 +6191,21 @@ index a0556cf..abe6a06 100644 default: val = evaluate_subexp (NULL_TYPE, exp, pos, EVAL_AVOID_SIDE_EFFECTS); +diff --git a/gdb/expprint.c b/gdb/expprint.c +index e378831..45deffe 100644 +--- a/gdb/expprint.c ++++ b/gdb/expprint.c +@@ -816,6 +816,8 @@ op_name_standard (enum exp_opcode opcode) + return "OP_TYPE"; + case OP_LABELED: + return "OP_LABELED"; ++ case OP_ADL_FUNC: ++ return "OP_ADL_FUNC"; + } + } + diff --git a/gdb/expression.h b/gdb/expression.h -index ca216cf..2195fef 100644 +index ca216cf..6be0b1e 100644 --- a/gdb/expression.h +++ b/gdb/expression.h @@ -95,6 +95,11 @@ enum exp_opcode @@ -5947,7 +6220,18 @@ index ca216cf..2195fef 100644 /* end of C++. */ /* For Modula-2 integer division DIV */ -@@ -451,4 +456,5 @@ extern char *op_string (enum exp_opcode); +@@ -347,6 +352,10 @@ enum exp_opcode + Then comes another OP_DECFLOAT. */ + OP_DECFLOAT, + ++ /* OP_ADL_FUNC specifies that the argument is to be looked up in an ++ Argument Dependent manner (Koenig lookup) */ ++ OP_ADL_FUNC, ++ + /* First extension operator. Individual language modules define + extra operators in *.inc include files below always starting with + numbering at OP_EXTENDED0: +@@ -451,4 +460,5 @@ extern char *op_string (enum exp_opcode); extern void dump_raw_expression (struct expression *, struct ui_file *, char *); extern void dump_prefix_expression (struct expression *, struct ui_file *); @@ -8258,10 +8542,10 @@ index e642894..6ac95cc 100644 } else if (code == TYPE_CODE_INT) diff --git a/gdb/infcmd.c b/gdb/infcmd.c -index f99a4ae..5599908 100644 +index 29cf427..0ec598e 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c -@@ -806,7 +806,7 @@ nexti_command (char *count_string, int from_tty) +@@ -808,7 +808,7 @@ nexti_command (char *count_string, int from_tty) step_1 (1, 1, count_string); } @@ -8270,7 +8554,7 @@ index f99a4ae..5599908 100644 delete_longjmp_breakpoint_cleanup (void *arg) { int thread = * (int *) arg; -@@ -846,10 +846,13 @@ step_1 (int skip_subroutines, int single_inst, char *count_string) +@@ -848,10 +848,13 @@ step_1 (int skip_subroutines, int single_inst, char *count_string) if (!single_inst || skip_subroutines) /* leave si command alone */ { @@ -8284,7 +8568,7 @@ index f99a4ae..5599908 100644 make_cleanup (delete_longjmp_breakpoint_cleanup, &thread); } -@@ -1198,6 +1201,15 @@ signal_command (char *signum_exp, int from_tty) +@@ -1200,6 +1203,15 @@ signal_command (char *signum_exp, int from_tty) proceed ((CORE_ADDR) -1, oursig, 0); } @@ -8300,7 +8584,7 @@ index f99a4ae..5599908 100644 /* Proceed until we reach a different source line with pc greater than our current one or exit the function. We skip calls in both cases. -@@ -1214,6 +1226,8 @@ until_next_command (int from_tty) +@@ -1216,6 +1228,8 @@ until_next_command (int from_tty) struct symbol *func; struct symtab_and_line sal; struct thread_info *tp = inferior_thread (); @@ -8309,7 +8593,7 @@ index f99a4ae..5599908 100644 clear_proceed_status (); set_step_frame (); -@@ -1249,7 +1263,19 @@ until_next_command (int from_tty) +@@ -1251,7 +1265,19 @@ until_next_command (int from_tty) tp->step_multi = 0; /* Only one call to proceed */ @@ -8329,7 +8613,7 @@ index f99a4ae..5599908 100644 } static void -@@ -1426,6 +1452,7 @@ finish_command_continuation (void *arg) +@@ -1428,6 +1454,7 @@ finish_command_continuation (void *arg) if (bs != NULL && tp->proceed_to_finish) observer_notify_normal_stop (bs, 1 /* print frame */); delete_breakpoint (a->breakpoint); @@ -8337,7 +8621,7 @@ index f99a4ae..5599908 100644 } static void -@@ -1509,6 +1536,7 @@ finish_forward (struct symbol *function, struct frame_info *frame) +@@ -1511,6 +1538,7 @@ finish_forward (struct symbol *function, struct frame_info *frame) struct breakpoint *breakpoint; struct cleanup *old_chain; struct finish_command_continuation_args *cargs; @@ -8345,7 +8629,7 @@ index f99a4ae..5599908 100644 sal = find_pc_line (get_frame_pc (frame), 0); sal.pc = get_frame_pc (frame); -@@ -1519,6 +1547,10 @@ finish_forward (struct symbol *function, struct frame_info *frame) +@@ -1521,6 +1549,10 @@ finish_forward (struct symbol *function, struct frame_info *frame) old_chain = make_cleanup_delete_breakpoint (breakpoint); @@ -8370,7 +8654,7 @@ index e557d6c..d4ae1df 100644 extern void notice_new_inferior (ptid_t, int, int); diff --git a/gdb/infrun.c b/gdb/infrun.c -index 8307986..b4110a8 100644 +index 9a5c3a8..ed2f530 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -45,6 +45,8 @@ @@ -8382,7 +8666,7 @@ index 8307986..b4110a8 100644 #include "gdb_assert.h" #include "mi/mi-common.h" #include "event-top.h" -@@ -2013,6 +2015,8 @@ static void insert_step_resume_breakpoint_at_sal (struct gdbarch *gdbarch, +@@ -2024,6 +2026,8 @@ static void insert_step_resume_breakpoint_at_sal (struct gdbarch *gdbarch, struct symtab_and_line sr_sal, struct frame_id sr_id); static void insert_longjmp_resume_breakpoint (struct gdbarch *, CORE_ADDR); @@ -8391,7 +8675,7 @@ index 8307986..b4110a8 100644 static void stop_stepping (struct execution_control_state *ecs); static void prepare_to_wait (struct execution_control_state *ecs); -@@ -2958,6 +2962,10 @@ handle_inferior_event (struct execution_control_state *ecs) +@@ -2971,6 +2975,10 @@ handle_inferior_event (struct execution_control_state *ecs) stop_pc = regcache_read_pc (get_thread_regcache (ecs->ptid)); @@ -8402,7 +8686,7 @@ index 8307986..b4110a8 100644 ecs->event_thread->stop_bpstat = bpstat_stop_status (get_regcache_aspace (get_current_regcache ()), stop_pc, ecs->ptid); -@@ -3042,6 +3050,10 @@ handle_inferior_event (struct execution_control_state *ecs) +@@ -3055,6 +3063,10 @@ handle_inferior_event (struct execution_control_state *ecs) stop_pc = regcache_read_pc (get_thread_regcache (ecs->ptid)); @@ -8413,7 +8697,7 @@ index 8307986..b4110a8 100644 /* Do whatever is necessary to the parent branch of the vfork. */ handle_vfork_child_exec_or_exit (1); -@@ -3780,23 +3792,33 @@ process_event_stop_test: +@@ -3793,23 +3805,33 @@ process_event_stop_test: ecs->event_thread->stepping_over_breakpoint = 1; @@ -8459,7 +8743,7 @@ index 8307986..b4110a8 100644 keep_going (ecs); return; -@@ -3808,6 +3830,53 @@ infrun: BPSTAT_WHAT_SET_LONGJMP_RESUME (!gdbarch_get_longjmp_target)\n"); +@@ -3821,6 +3843,53 @@ infrun: BPSTAT_WHAT_SET_LONGJMP_RESUME (!gdbarch_get_longjmp_target)\n"); gdb_assert (ecs->event_thread->step_resume_breakpoint != NULL); delete_step_resume_breakpoint (ecs->event_thread); @@ -8513,7 +8797,7 @@ index 8307986..b4110a8 100644 ecs->event_thread->stop_step = 1; print_stop_reason (END_STEPPING_RANGE, 0); stop_stepping (ecs); -@@ -4827,6 +4896,96 @@ insert_longjmp_resume_breakpoint (struct gdbarch *gdbarch, CORE_ADDR pc) +@@ -4840,6 +4909,96 @@ insert_longjmp_resume_breakpoint (struct gdbarch *gdbarch, CORE_ADDR pc) set_momentary_breakpoint_at_pc (gdbarch, pc, bp_longjmp_resume); } @@ -8635,14 +8919,14 @@ index 4f78a28..e0096f5 100644 const domain_enum); diff --git a/gdb/linespec.c b/gdb/linespec.c -index 74902b6..4e54a3a 100644 +index 75a74e2..ec4d569 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -40,6 +40,7 @@ #include "interps.h" #include "mi/mi-cmds.h" #include "target.h" -+#include ++#include "arch-utils.h" /* We share this one with symtab.c, but it is not exported widely. */ @@ -8655,7 +8939,57 @@ index 74902b6..4e54a3a 100644 static struct symtabs_and_lines decode_indirect (char **argptr); static char *locate_first_half (char **argptr, int *is_quote_enclosed); -@@ -688,9 +687,6 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab, +@@ -313,10 +312,7 @@ add_matching_methods (int method_counter, struct type *t, + NULL, VAR_DOMAIN, + language, + (int *) NULL); +- /* See PR10966. Remove check on symbol domain and class when +- we stop using (bad) linkage names on constructors. */ +- if (sym_arr[i1] && (SYMBOL_DOMAIN (sym_arr[i1]) == VAR_DOMAIN +- && SYMBOL_CLASS (sym_arr[i1]) == LOC_BLOCK)) ++ if (sym_arr[i1]) + i1++; + else + { +@@ -631,6 +627,37 @@ See set/show multiple-symbol.")); + discard_cleanups (old_chain); + return return_values; + } ++ ++/* A helper function for decode_line_1 and friends which skips P ++ past any method overload information at the beginning of P, e.g., ++ "(const struct foo *)". ++ ++ This function assumes that P has already been validated to contain ++ overload information, and it will assert if *P != '('. */ ++static char * ++find_method_overload_end (char *p) ++{ ++ int depth = 0; ++ ++ gdb_assert (*p == '('); ++ ++ while (*p) ++ { ++ if (*p == '(') ++ ++depth; ++ else if (*p == ')') ++ { ++ if (--depth == 0) ++ { ++ ++p; ++ break; ++ } ++ } ++ ++p; ++ } ++ ++ return p; ++} + + /* The parser of linespec itself. */ + +@@ -691,18 +718,17 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab, struct symtab *file_symtab = NULL; char *copy; @@ -8665,7 +8999,19 @@ index 74902b6..4e54a3a 100644 /* This says whether or not something in *ARGPTR is quoted with completer_quotes (i.e. with single quotes). */ int is_quoted; -@@ -711,12 +707,9 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab, +- /* Is part of *ARGPTR is enclosed in double quotes? */ ++ /* Is *ARGPTR is enclosed in double quotes? */ + int is_quote_enclosed; + int is_objc_method = 0; + char *saved_arg = *argptr; + /* If IS_QUOTED, the end of the quoted bit. */ + char *end_quote = NULL; ++ /* The "first half" of the linespec. */ ++ char *first_half; + + if (not_found_ptr) + *not_found_ptr = 0; +@@ -716,12 +742,9 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab, if (**argptr == '*') return decode_indirect (argptr); @@ -8678,10 +9024,16 @@ index 74902b6..4e54a3a 100644 + is_quoted = (*argptr + && strchr (get_gdb_completer_quote_characters (), + **argptr) != NULL); + if (is_quoted) + end_quote = skip_quoted (*argptr); + +@@ -734,15 +757,12 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab, + will point to "". If this is a C++ name, like "A::B::foo", p will + point to "::B::foo". Argptr is not changed by this call. */ + +- p = locate_first_half (argptr, &is_quote_enclosed); ++ first_half = p = locate_first_half (argptr, &is_quote_enclosed); - /* Check to see if it's a multipart linespec (with colons or - periods). */ -@@ -732,10 +725,7 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab, /* Check if this is an Objective-C method (anything that starts with a '+' or '-' and a '['). */ if (is_objc_method_format (p)) @@ -8693,43 +9045,53 @@ index 74902b6..4e54a3a 100644 /* Check if the symbol could be an Objective-C selector. */ -@@ -749,11 +739,11 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab, +@@ -754,9 +774,6 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab, + return values; + } +- if (is_quoted) +- *argptr = *argptr + 1; +- /* Does it look like there actually were two parts? */ -- if ((p[0] == ':' || p[0] == '.') && paren_pointer == NULL) -+ if (p[0] == ':' || p[0] == '.') - { - if (is_quoted) - *argptr = *argptr + 1; -- -+ - /* Is it a C++ or Java compound data structure? - The check on p[1] == ':' is capturing the case of "::", - since p[0]==':' was checked above. -@@ -762,48 +752,31 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab, - can return now. */ + if (p[0] == ':' || p[0] == '.') +@@ -770,67 +787,48 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab, if (p[0] == '.' || p[1] == ':') -- return decode_compound (argptr, funfirstline, canonical, -- saved_arg, p, not_found_ptr); -+ { + { +- if (paren_pointer == NULL) +- return decode_compound (argptr, funfirstline, canonical, + struct symtabs_and_lines values; + + if (is_quote_enclosed) + ++saved_arg; + values = decode_compound (argptr, funfirstline, canonical, -+ saved_arg, p, not_found_ptr); + saved_arg, p, not_found_ptr); +- /* Otherwise, fall through to decode_variable below. */ + if (is_quoted && **argptr == '\'') + *argptr = *argptr + 1; + return values; -+ } + } +- else +- { +- /* No, the first part is a filename; set file_symtab to be that file's +- symtab. Also, move argptr past the filename. */ - /* No, the first part is a filename; set file_symtab to be that file's - symtab. Also, move argptr past the filename. */ +- file_symtab = symtab_from_filename (argptr, p, is_quote_enclosed, +- not_found_ptr); ++ /* No, the first part is a filename; set file_symtab to be that file's ++ symtab. Also, move argptr past the filename. */ - file_symtab = symtab_from_filename (argptr, p, is_quote_enclosed, - not_found_ptr); +- /* Check for single quotes on the non-filename part. */ +- if (!is_quoted) +- { +- is_quoted = (**argptr +- && strchr (get_gdb_completer_quote_characters (), +- **argptr) != NULL); +- if (is_quoted) +- end_quote = skip_quoted (*argptr); +- } +- } - } -#if 0 - /* No one really seems to know why this was added. It certainly @@ -8742,7 +9104,9 @@ index 74902b6..4e54a3a 100644 - else - { - /* Check if what we have till now is a symbol name */ -- ++ file_symtab = symtab_from_filename (argptr, p, is_quote_enclosed, ++ not_found_ptr); + - /* We may be looking at a template instantiation such - as "foo". Check here whether we know about it, - instead of falling through to the code below which @@ -8756,14 +9120,16 @@ index 74902b6..4e54a3a 100644 - copy[p - *argptr] = '\000'; - sym = lookup_symbol (copy, 0, VAR_DOMAIN, 0); - if (sym) -+ if (file_symtab != NULL) ++ /* Check for single quotes on the non-filename part. */ ++ if (!is_quoted) { - *argptr = (*p == '\'') ? p + 1 : p; - return symbol_found (funfirstline, canonical, copy, sym, NULL); -+ /* Double-check if the remainder of the argument is quoted. -+ The rbreak command uses syntax like this. */ -+ if (**argptr == '\'') -+ is_quoted = 1; ++ is_quoted = (**argptr ++ && strchr (get_gdb_completer_quote_characters (), ++ **argptr) != NULL); ++ if (is_quoted) ++ end_quote = skip_quoted (*argptr); } - /* Otherwise fall out from here and go to file/line spec - processing, etc. */ @@ -8772,7 +9138,22 @@ index 74902b6..4e54a3a 100644 /* file_symtab is specified file's symtab, or 0 if no file specified. arg no longer contains the file name. */ -@@ -838,10 +811,6 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab, + ++ /* If the filename was quoted, we must re-check the quotation. */ ++ ++ if (end_quote == first_half && *end_quote!= '\0') ++ { ++ is_quoted = (**argptr ++ && strchr (get_gdb_completer_quote_characters (), ++ **argptr) != NULL); ++ if (is_quoted) ++ end_quote = skip_quoted (*argptr); ++ } ++ + /* Check whether arg is all digits (and sign). */ + + q = *argptr; +@@ -861,10 +859,6 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab, /* allow word separators in method names for Obj-C */ p = skip_quoted_chars (*argptr, NULL, ""); } @@ -8783,20 +9164,13 @@ index 74902b6..4e54a3a 100644 else { p = skip_quoted (*argptr); -@@ -851,6 +820,21 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab, +@@ -874,6 +868,14 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab, if (*p == '<') p = find_template_name_end (p); + /* Keep method overload information. */ -+ q = strchr (p, '('); -+ if (q != NULL) -+ { -+ /* Ignore '(' used after " if". */ -+ while (q > p && isspace (q[-1])) -+ q--; -+ if (!(q >= p + 3 && strncmp (&q[-2], "if", 2) == 0 && isspace (q[-3]))) -+ p = strrchr (q, ')') + 1; -+ } ++ if (*p == '(') ++ p = find_method_overload_end (p); + + /* Make sure we keep important kewords like "const" */ + if (strncmp (p, " const", 6) == 0) @@ -8805,7 +9179,21 @@ index 74902b6..4e54a3a 100644 copy = (char *) alloca (p - *argptr + 1); memcpy (copy, *argptr, p - *argptr); copy[p - *argptr] = '\0'; -@@ -926,44 +910,6 @@ initialize_defaults (struct symtab **default_symtab, int *default_line) +@@ -921,10 +923,9 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab, + function is passed ARGPTR as an argument, it modifies what ARGPTR + points to; typically, it advances *ARGPTR past whatever substring + it has just looked at. (If it doesn't modify *ARGPTR, then the +- function gets passed *ARGPTR instead, which is then called ARG: see +- set_flags, for example.) Also, functions that return a struct +- symtabs_and_lines may modify CANONICAL, as in the description of +- decode_line_1. ++ function gets passed *ARGPTR instead, which is then called ARG.) ++ Also, functions that return a struct symtabs_and_lines may modify ++ CANONICAL, as in the description of decode_line_1. + + If a function returns a struct symtabs_and_lines, then that struct + will immediately make its way up the call chain to be returned by +@@ -951,44 +952,6 @@ initialize_defaults (struct symtab **default_symtab, int *default_line) } } @@ -8850,7 +9238,43 @@ index 74902b6..4e54a3a 100644 /* Decode arg of the form *PC. */ -@@ -1264,7 +1210,8 @@ decode_compound (char **argptr, int funfirstline, char ***canonical, +@@ -1059,7 +1022,14 @@ locate_first_half (char **argptr, int *is_quote_enclosed) + p++; + } + else +- *is_quote_enclosed = 0; ++ { ++ *is_quote_enclosed = 0; ++ if (strchr (get_gdb_completer_quote_characters (), *p)) ++ { ++ ++(*argptr); ++ ++p; ++ } ++ } + for (; *p; p++) + { + if (p[0] == '<') +@@ -1088,8 +1058,9 @@ locate_first_half (char **argptr, int *is_quote_enclosed) + if (p[0] == '.' && strchr (p, ':') == NULL) + { + /* Java qualified method. Find the *last* '.', since the +- others are package qualifiers. */ +- for (p1 = p; *p1; p1++) ++ others are package qualifiers. Stop at any open parenthesis ++ which might provide overload information. */ ++ for (p1 = p; *p1 && *p1 != '('; p1++) + { + if (*p1 == '.') + p = p1; +@@ -1241,6 +1212,7 @@ decode_compound (char **argptr, int funfirstline, char ***canonical, + struct symbol *sym_class; + struct symbol **sym_arr; + struct type *t; ++ char *saved_java_argptr = NULL; + + /* First check for "global" namespace specification, of the form + "::foo". If found, skip over the colons and jump to normal +@@ -1289,7 +1261,8 @@ decode_compound (char **argptr, int funfirstline, char ***canonical, /* PASS2: p2->"::fun", p->":fun" */ /* Move pointer ahead to next double-colon. */ @@ -8860,7 +9284,7 @@ index 74902b6..4e54a3a 100644 { if (current_language->la_language == language_cplus) p += cp_validate_operator (p); -@@ -1342,8 +1289,10 @@ decode_compound (char **argptr, int funfirstline, char ***canonical, +@@ -1367,8 +1340,10 @@ decode_compound (char **argptr, int funfirstline, char ***canonical, else { /* At this point argptr->"fun". */ @@ -8872,7 +9296,7 @@ index 74902b6..4e54a3a 100644 p++; /* At this point p->"". String ended. */ /* Nope, C++ operators could have spaces in them -@@ -1355,6 +1304,19 @@ decode_compound (char **argptr, int funfirstline, char ***canonical, +@@ -1380,6 +1355,42 @@ decode_compound (char **argptr, int funfirstline, char ***canonical, /* The above loop has already swallowed "operator". */ p += cp_validate_operator (p - 8) - 8; } @@ -8884,15 +9308,68 @@ index 74902b6..4e54a3a 100644 + /* Keep method overload information. */ + a = strchr (p, '('); + if (a != NULL) -+ p = strrchr (a, ')') + 1; ++ p = find_method_overload_end (a); + + /* Make sure we keep important kewords like "const" */ + if (strncmp (p, " const", 6) == 0) + p += 6; ++ ++ /* Java may append typenames, so assume that if there is ++ anything else left in *argptr, it must be a typename. */ ++ if (*p && current_language->la_language == language_java) ++ { ++ struct type *type; ++ p2 = p; ++ while (*p2) ++ ++p2; ++ copy = (char *) alloca (p2 - p + 1); ++ memcpy (copy, p, p2 - p); ++ copy[p2 - p] = '\0'; ++ type = lookup_typename (current_language, get_current_arch (), ++ copy, NULL, 1); ++ if (type != NULL) ++ { ++ /* Save the location of this just in case this ++ method/type combination isn't actually defined. ++ It will be checked later. */ ++ saved_java_argptr = p; ++ p = p2; ++ } ++ } } /* Allocate our own copy of the substring between argptr and -@@ -1509,8 +1471,39 @@ find_method (int funfirstline, char ***canonical, char *saved_arg, +@@ -1408,9 +1419,26 @@ decode_compound (char **argptr, int funfirstline, char ***canonical, + here, we return. If not, and we are at the and of the string, + we'll lookup the whole string in the symbol tables. */ + +- return find_method (funfirstline, canonical, saved_arg, +- copy, t, sym_class, not_found_ptr); +- ++ values = find_method (funfirstline, canonical, saved_arg, ++ copy, t, sym_class, not_found_ptr); ++ if (saved_java_argptr != NULL && values.nelts == 1) ++ { ++ /* The user specified a specific return type for a java method. ++ Double-check that it really is the one the user specified. ++ [This is a necessary evil because strcmp_iw_ordered stops ++ comparisons too prematurely.] */ ++ sym = find_pc_sect_function (values.sals[0].pc, ++ values.sals[0].section); ++ /* We just found a SAL, we had better be able to go backwards! */ ++ gdb_assert (sym != NULL); ++ if (strcmp_iw (SYMBOL_LINKAGE_NAME (sym), saved_arg) != 0) ++ { ++ xfree (values.sals); ++ error (_("the class `%s' does not have any method instance named %s\n"), ++ SYMBOL_PRINT_NAME (sym_class), copy); ++ } ++ } ++ return values; + } /* End if symbol found */ + + +@@ -1534,8 +1562,39 @@ find_method (int funfirstline, char ***canonical, char *saved_arg, } if (i1 > 0) { @@ -8928,13 +9405,23 @@ index 74902b6..4e54a3a 100644 + } + + error (_("the class `%s' does not have any method instance named %s\n"), -+ SYMBOL_PRINT_NAME (sym_class), copy); ++ SYMBOL_PRINT_NAME (sym_class), copy); + } + return decode_line_2 (sym_arr, i1, funfirstline, canonical); } else -@@ -1815,7 +1808,7 @@ symbol_found (int funfirstline, char ***canonical, char *copy, +@@ -1577,7 +1636,8 @@ symtab_from_filename (char **argptr, char *p, int is_quote_enclosed, + copy = (char *) alloca (p - *argptr + 1); + memcpy (copy, *argptr, p - *argptr); + /* It may have the ending quote right after the file name. */ +- if (is_quote_enclosed && copy[p - *argptr - 1] == '"') ++ if ((is_quote_enclosed && copy[p - *argptr - 1] == '"') ++ || copy[p - *argptr - 1] == '\'') + copy[p - *argptr - 1] = 0; + else + copy[p - *argptr] = 0; +@@ -1840,7 +1900,7 @@ symbol_found (int funfirstline, char ***canonical, char *copy, { struct blockvector *bv = BLOCKVECTOR (SYMBOL_SYMTAB (sym)); struct block *b = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK); @@ -8944,10 +9431,10 @@ index 74902b6..4e54a3a 100644 } return values; diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c -index 7fc9584..b286dfd 100644 +index e55d958..e41ed74 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c -@@ -2624,6 +2624,39 @@ linux_nat_stopped_data_address (struct target_ops *ops, CORE_ADDR *addr_p) +@@ -2618,6 +2618,39 @@ linux_nat_stopped_data_address (struct target_ops *ops, CORE_ADDR *addr_p) return lp->stopped_data_address_p; } @@ -8987,7 +9474,7 @@ index 7fc9584..b286dfd 100644 /* Wait until LP is stopped. */ static int -@@ -5500,6 +5533,8 @@ linux_nat_add_target (struct target_ops *t) +@@ -5584,6 +5617,8 @@ linux_nat_add_target (struct target_ops *t) t->to_thread_address_space = linux_nat_thread_address_space; t->to_stopped_by_watchpoint = linux_nat_stopped_by_watchpoint; t->to_stopped_data_address = linux_nat_stopped_data_address; @@ -9104,10 +9591,10 @@ index 6804609..2cb1bf9 100644 /* Provide a prototype to silence -Wmissing-prototypes. */ diff --git a/gdb/machoread.c b/gdb/machoread.c -index 02b61d3..13ab595 100644 +index a810bb2..b416970 100644 --- a/gdb/machoread.c +++ b/gdb/machoread.c -@@ -755,6 +755,7 @@ static struct sym_fns macho_sym_fns = { +@@ -842,6 +842,7 @@ static struct sym_fns macho_sym_fns = { macho_new_init, /* sym_new_init: init anything gbl to entire symtab */ macho_symfile_init, /* sym_init: read initial info, setup for sym_read() */ macho_symfile_read, /* sym_read: read a symbol file into symtab */ @@ -9369,7 +9856,7 @@ index 287f9de..1fe0fbe 100644 SYMBOL_LINKAGE_NAME (tsymbol)) == 0) return SYMBOL_VALUE_ADDRESS (msymbol); diff --git a/gdb/mips-linux-tdep.c b/gdb/mips-linux-tdep.c -index 6bb4eb6..2b07942 100644 +index 5924b30..2957024 100644 --- a/gdb/mips-linux-tdep.c +++ b/gdb/mips-linux-tdep.c @@ -38,6 +38,7 @@ @@ -9380,7 +9867,7 @@ index 6bb4eb6..2b07942 100644 static struct target_so_ops mips_svr4_so_ops; -@@ -1225,6 +1226,9 @@ mips_linux_init_abi (struct gdbarch_info info, +@@ -1222,6 +1223,9 @@ mips_linux_init_abi (struct gdbarch_info info, tdesc_numbered_register (feature, tdesc_data, MIPS_RESTART_REGNUM, "restart"); } @@ -9391,7 +9878,7 @@ index 6bb4eb6..2b07942 100644 /* Provide a prototype to silence -Wmissing-prototypes. */ diff --git a/gdb/mipsread.c b/gdb/mipsread.c -index 4ef817e..1c53574 100644 +index 093313e..9144d00 100644 --- a/gdb/mipsread.c +++ b/gdb/mipsread.c @@ -394,6 +394,7 @@ static struct sym_fns ecoff_sym_fns = @@ -9464,10 +9951,10 @@ index a050f15..04d1f1c 100644 if (sym != NULL) { diff --git a/gdb/objfiles.c b/gdb/objfiles.c -index 0b07e37..5de5300 100644 +index c2763c2..5d62020 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c -@@ -789,6 +789,10 @@ objfile_relocate1 (struct objfile *objfile, struct section_offsets *new_offsets) +@@ -792,6 +792,10 @@ objfile_relocate1 (struct objfile *objfile, struct section_offsets *new_offsets) } } @@ -9478,7 +9965,7 @@ index 0b07e37..5de5300 100644 { struct partial_symbol **psym; -@@ -914,7 +918,7 @@ objfile_relocate (struct objfile *objfile, struct section_offsets *new_offsets) +@@ -917,7 +921,7 @@ objfile_relocate (struct objfile *objfile, struct section_offsets *new_offsets) int objfile_has_partial_symbols (struct objfile *objfile) { @@ -9487,7 +9974,7 @@ index 0b07e37..5de5300 100644 } /* Return non-zero if OBJFILE has full symbols. */ -@@ -954,6 +958,20 @@ have_partial_symbols (void) +@@ -957,6 +961,20 @@ have_partial_symbols (void) if (objfile_has_partial_symbols (ofp)) return 1; } @@ -9555,7 +10042,7 @@ index c689622..eb3ae10 100644 ALL_PSPACE_OBJFILES (ss, objfile) \ ALL_OBJFILE_PSYMTABS (objfile, p) diff --git a/gdb/parse.c b/gdb/parse.c -index d5a199b..c3ef9e1 100644 +index aabc461..e2ab8d9 100644 --- a/gdb/parse.c +++ b/gdb/parse.c @@ -62,6 +62,7 @@ const struct exp_descriptor exp_descriptor_standard = @@ -9566,7 +10053,7 @@ index d5a199b..c3ef9e1 100644 op_name_standard, dump_subexp_body_standard, evaluate_subexp_standard -@@ -511,6 +512,11 @@ write_exp_msymbol (struct minimal_symbol *msymbol) +@@ -523,6 +524,11 @@ write_exp_msymbol (struct minimal_symbol *msymbol) write_exp_elt_type (objfile_type (objfile)->nodebug_text_symbol); break; @@ -9578,7 +10065,7 @@ index d5a199b..c3ef9e1 100644 case mst_data: case mst_file_data: case mst_bss: -@@ -841,6 +847,10 @@ operator_length_standard (struct expression *expr, int endpos, +@@ -853,6 +859,10 @@ operator_length_standard (struct expression *expr, int endpos, args = 1; break; @@ -9589,7 +10076,21 @@ index d5a199b..c3ef9e1 100644 case OP_OBJC_MSGCALL: /* Objective C message (method) call */ oplen = 4; args = 1 + longest_to_int (expr->elts[endpos - 2].longconst); -@@ -1361,6 +1371,151 @@ parser_fprintf (FILE *x, const char *y, ...) +@@ -889,6 +899,13 @@ operator_length_standard (struct expression *expr, int endpos, + args = 1; + break; + ++ case OP_ADL_FUNC: ++ oplen = longest_to_int (expr->elts[endpos - 2].longconst); ++ oplen = 4 + BYTES_TO_EXP_ELEM (oplen + 1); ++ oplen++; ++ oplen++; ++ break; ++ + case OP_LABELED: + case STRUCTOP_STRUCT: + case STRUCTOP_PTR: +@@ -1373,6 +1390,151 @@ parser_fprintf (FILE *x, const char *y, ...) va_end (args); } @@ -9742,10 +10243,10 @@ index d5a199b..c3ef9e1 100644 _initialize_parse (void) { diff --git a/gdb/parser-defs.h b/gdb/parser-defs.h -index 6fcf7ae..3f5efe8 100644 +index c4eb1a0..2a43fe3 100644 --- a/gdb/parser-defs.h +++ b/gdb/parser-defs.h -@@ -190,6 +190,13 @@ extern void operator_length (struct expression *, int, int *, int *); +@@ -192,6 +192,13 @@ extern void operator_length (struct expression *, int, int *, int *); extern void operator_length_standard (struct expression *, int, int *, int *); @@ -9759,7 +10260,7 @@ index 6fcf7ae..3f5efe8 100644 extern char *op_name_standard (enum exp_opcode); extern struct type *follow_types (struct type *); -@@ -268,6 +275,20 @@ struct exp_descriptor +@@ -270,6 +277,20 @@ struct exp_descriptor the number of subexpressions it takes. */ void (*operator_length) (struct expression*, int, int*, int *); @@ -9780,7 +10281,7 @@ index 6fcf7ae..3f5efe8 100644 /* Name of this operator for dumping purposes. */ char *(*op_name) (enum exp_opcode); -@@ -300,4 +321,8 @@ extern void print_subexp_standard (struct expression *, int *, +@@ -302,4 +323,8 @@ extern void print_subexp_standard (struct expression *, int *, extern void parser_fprintf (FILE *, const char *, ...) ATTR_FORMAT (printf, 2 ,3); @@ -15451,7 +15952,7 @@ index a792819..bdac80e 100644 diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h -index 9196f08..5230a8c 100644 +index 1bfa700..52f9b39 100644 --- a/gdb/python/python-internal.h +++ b/gdb/python/python-internal.h @@ -61,36 +61,79 @@ typedef int Py_ssize_t; @@ -16166,10 +16667,10 @@ index 94a77fb..7ea68d2 100644 } diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c -index 5689bf3..2b609af 100644 +index 8edc889..5ea1779 100644 --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c -@@ -1218,7 +1218,8 @@ svr4_in_dynsym_resolve_code (CORE_ADDR pc) +@@ -1241,7 +1241,8 @@ svr4_in_dynsym_resolve_code (CORE_ADDR pc) && pc < info->interp_text_sect_high) || (pc >= info->interp_plt_sect_low && pc < info->interp_plt_sect_high) @@ -16179,7 +16680,7 @@ index 5689bf3..2b609af 100644 } /* Given an executable's ABFD and target, compute the entry-point -@@ -1971,7 +1972,6 @@ struct target_so_ops svr4_so_ops; +@@ -2038,7 +2039,6 @@ struct target_so_ops svr4_so_ops; static struct symbol * elf_lookup_lib_symbol (const struct objfile *objfile, const char *name, @@ -16187,7 +16688,7 @@ index 5689bf3..2b609af 100644 const domain_enum domain) { bfd *abfd; -@@ -1989,8 +1989,7 @@ elf_lookup_lib_symbol (const struct objfile *objfile, +@@ -2056,8 +2056,7 @@ elf_lookup_lib_symbol (const struct objfile *objfile, if (abfd == NULL || scan_dyntag (DT_SYMBOLIC, abfd, NULL) != 1) return NULL; @@ -16237,7 +16738,7 @@ index 573f736..51bfce9 100644 #endif diff --git a/gdb/somread.c b/gdb/somread.c -index c7beaba..e31164c 100644 +index 3d93c5e..a943806 100644 --- a/gdb/somread.c +++ b/gdb/somread.c @@ -432,6 +432,7 @@ static struct sym_fns som_sym_fns = @@ -16353,10 +16854,10 @@ index 2caf9d2..7adc399 100644 for (i = 0, fi = trailing; fi && count--; i++, fi = get_prev_frame (fi)) { diff --git a/gdb/symfile.c b/gdb/symfile.c -index bc52406..5d5d83f 100644 +index 8705420..16f96a1 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c -@@ -966,13 +966,16 @@ symbol_file_add_with_addrs_or_offsets (bfd *abfd, +@@ -968,13 +968,16 @@ symbol_file_add_with_addrs_or_offsets (bfd *abfd, /* Give user a chance to burp if we'd be interactively wiping out any existing symbols. */ @@ -16375,7 +16876,7 @@ index bc52406..5d5d83f 100644 discard_cleanups (my_cleanups); /* We either created a new mapped symbol table, mapped an existing -@@ -999,6 +1002,8 @@ symbol_file_add_with_addrs_or_offsets (bfd *abfd, +@@ -1001,6 +1004,8 @@ symbol_file_add_with_addrs_or_offsets (bfd *abfd, if ((flags & OBJF_READNOW) || readnow_symbol_files) { @@ -16384,7 +16885,7 @@ index bc52406..5d5d83f 100644 if (from_tty || info_verbose) { printf_unfiltered (_("expanding to full symbols...")); -@@ -2321,6 +2326,7 @@ reread_symbols (void) +@@ -2323,6 +2328,7 @@ reread_symbols (void) objfile->symtabs = NULL; objfile->psymtabs = NULL; objfile->psymtabs_addrmap = NULL; @@ -16392,7 +16893,7 @@ index bc52406..5d5d83f 100644 objfile->free_psymtabs = NULL; objfile->cp_namespace_symtab = NULL; objfile->msymbols = NULL; -@@ -2331,6 +2337,8 @@ reread_symbols (void) +@@ -2333,6 +2339,8 @@ reread_symbols (void) memset (&objfile->msymbol_demangled_hash, 0, sizeof (objfile->msymbol_demangled_hash)); @@ -16402,10 +16903,10 @@ index bc52406..5d5d83f 100644 objfile->macro_cache = bcache_xmalloc (); objfile->filename_cache = bcache_xmalloc (); diff --git a/gdb/symfile.h b/gdb/symfile.h -index efa069e..b520b93 100644 +index fe95255..075610b 100644 --- a/gdb/symfile.h +++ b/gdb/symfile.h -@@ -139,6 +139,12 @@ struct sym_fns +@@ -141,6 +141,12 @@ struct sym_fns void (*sym_read) (struct objfile *, int); @@ -16418,7 +16919,7 @@ index efa069e..b520b93 100644 /* Called when we are finished with an objfile. Should do all cleanup that is specific to the object file format for the particular objfile. */ -@@ -315,8 +321,7 @@ extern int auto_solib_limit; +@@ -330,8 +336,7 @@ extern int auto_solib_limit; extern void set_initial_language (void); @@ -16428,7 +16929,7 @@ index efa069e..b520b93 100644 extern void discard_psymtab (struct partial_symtab *); -@@ -387,7 +392,7 @@ void free_symfile_segment_data (struct symfile_segment_data *data); +@@ -402,7 +407,7 @@ void free_symfile_segment_data (struct symfile_segment_data *data); /* From dwarf2read.c */ extern int dwarf2_has_info (struct objfile *); @@ -19178,18 +19679,18 @@ index 0000000..5da7378 +gdb_test "p temp2" " = '2' " "second: print temp2" +gdb_test "p temp3" " = '3' " "second: print temp3" diff --git a/gdb/testsuite/gdb.cp/Makefile.in b/gdb/testsuite/gdb.cp/Makefile.in -index c990a64..c964db9 100644 +index d78258e..1774244 100644 --- a/gdb/testsuite/gdb.cp/Makefile.in +++ b/gdb/testsuite/gdb.cp/Makefile.in @@ -4,7 +4,7 @@ srcdir = @srcdir@ EXECUTABLES = ambiguous annota2 anon-union cplusfuncs cttiadd \ derivation inherit local member-ptr method misc \ overload ovldbreak ref-typ ref-typ2 templates userdef virtfunc namespace \ -- ref-types ref-params method2 pr9594 gdb2495 virtfunc2 -+ ref-types ref-params method2 pr9594 gdb2495 gdb9593 virtfunc2 +- ref-types ref-params method2 pr9594 gdb2495 virtfunc2 pr9067 \ ++ ref-types ref-params method2 pr9594 gdb2495 gdb9593 virtfunc2 pr9067 \ + pr1072 all info install-info dvi install uninstall installcheck check: - @echo "Nothing to be done for $@..." diff --git a/gdb/testsuite/gdb.cp/cp-relocate.exp b/gdb/testsuite/gdb.cp/cp-relocate.exp index f81a212..30d362a 100644 --- a/gdb/testsuite/gdb.cp/cp-relocate.exp @@ -19213,6 +19714,1173 @@ index f81a212..30d362a 100644 -gdb_test "break *'$func2_name'" \ +gdb_test "break *$func2_name" \ "Breakpoint $decimal at 0x2....: file .*" +diff --git a/gdb/testsuite/gdb.cp/cpexprs.cc b/gdb/testsuite/gdb.cp/cpexprs.cc +new file mode 100644 +index 0000000..2bca4cd +--- /dev/null ++++ b/gdb/testsuite/gdb.cp/cpexprs.cc +@@ -0,0 +1,431 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2008, 2009, 2010 Free Software Foundation, Inc. ++ ++ Contributed by Red Hat, originally written by Keith Seitz. ++ ++ 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 3 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, see . ++ ++ Please email any bugs, comments, and/or additions to this file to: ++ bug-gdb@gnu.org */ ++ ++#include ++#include ++ ++// Forward decls ++class base; ++class derived; ++ ++// A simple template with specializations ++template ++class tclass ++{ ++public: ++ void do_something () { } // tclass::do_something ++}; ++ ++template <> ++void tclass::do_something () { } // tclass::do_something ++ ++template <> ++void tclass::do_something () { } // tclass::do_something ++ ++template<> ++void tclass::do_something () { } // tclass::do_something ++ ++template<> ++void tclass::do_something () { } // tclass::do_something ++ ++// A simple template with multiple template parameters ++template ++void flubber (void) // flubber ++{ ++ A a; ++ B b; ++ C c; ++ D d; ++ E e; ++ ++ ++a; ++ ++b; ++ ++c; ++ ++d; ++ ++e; ++} ++ ++// Some contrived policies ++template ++struct operation_1 ++{ ++ static void function (void) { } // operation_1::function ++}; ++ ++template ++struct operation_2 ++{ ++ static void function (void) { } // operation_2::function ++}; ++ ++template ++struct operation_3 ++{ ++ static void function (void) { } // operation_3::function ++}; ++ ++template ++struct operation_4 ++{ ++ static void function (void) { } // operation_4::function ++}; ++ ++// A policy-based class w/ and w/o default policy ++template ++class policy : public Policy ++{ ++public: ++ policy (T obj) : obj_ (obj) { } // policy::policy ++ ++private: ++ T obj_; ++}; ++ ++template > ++class policyd : public Policy ++{ ++public: ++ policyd (T obj) : obj_ (obj) { } // policyd::policyd ++ ~policyd (void) { } // policyd::~policyd ++ ++private: ++ T obj_; ++}; ++ ++typedef policy > policy1; ++typedef policy > policy2; ++typedef policy > policy3; ++typedef policy > policy4; ++ ++typedef policyd policyd1; ++typedef policyd policyd2; ++typedef policyd policyd3; ++typedef policyd policyd4; ++typedef policyd > policyd5; ++ ++class fluff { }; ++static fluff *g_fluff = new fluff (); ++ ++class base ++{ ++protected: ++ int foo_; ++ ++public: ++ base (void) : foo_ (42) { } // base::base(void) ++ base (int foo) : foo_ (foo) { } // base::base(int) ++ ~base (void) { } // base::~base ++ ++ // Some overloaded methods ++ int overload (void) const { return 0; } // base::overload(void) const ++ int overload (int i) const { return 1; } // base::overload(int) const ++ int overload (short s) const { return 2; } // base::overload(short) const ++ int overload (long l) const { return 3; } // base::overload(long) const ++ int overload (char* a) const { return 4; } // base::overload(char*) const ++ int overload (base& b) const { return 5; } // base::overload(base&) const ++ ++ // Operators ++ int operator+ (base const& o) const // base::operator+ ++ { return foo_ + o.foo_; } ++ ++ base operator++ (void) // base::operator++ ++ { ++foo_; return *this; } ++ ++ base operator+=(base const& o) // base::operator+= ++ { foo_ += o.foo_; return *this; } ++ ++ int operator- (base const& o) const // base::operator- ++ { return foo_ - o.foo_; } ++ ++ base operator-- (void) // base::operator-- ++ { --foo_; return *this; } ++ ++ base operator-= (base const& o) // base::operator-= ++ { foo_ -= o.foo_; return *this; } ++ ++ int operator* (base const& o) const // base::operator* ++ { return foo_ * o.foo_; } ++ ++ base operator*= (base const& o) // base::operator*= ++ { foo_ *= o.foo_; return *this; } ++ ++ int operator/ (base const& o) const // base::operator/ ++ { return foo_ / o.foo_; } ++ ++ base operator/= (base const& o) // base::operator/= ++ { foo_ /= o.foo_; return *this; } ++ ++ int operator% (base const& o) const // base::operator% ++ { return foo_ % o.foo_; } ++ ++ base operator%= (base const& o) // base::operator%= ++ { foo_ %= o.foo_; return *this; } ++ ++ bool operator< (base const& o) const // base::operator< ++ { return foo_ < o.foo_; } ++ ++ bool operator<= (base const& o) const // base::operator<= ++ { return foo_ <= o.foo_; } ++ ++ bool operator> (base const& o) const // base::operator> ++ { return foo_ > o.foo_; } ++ ++ bool operator>= (base const& o) const // base::operator>= ++ { return foo_ >= o.foo_; } ++ ++ bool operator!= (base const& o) const // base::operator!= ++ { return foo_ != o.foo_; } ++ ++ bool operator== (base const& o) const // base::operator== ++ { return foo_ == o.foo_; } ++ ++ bool operator! (void) const // base::operator! ++ { return !foo_; } ++ ++ bool operator&& (base const& o) const // base::operator&& ++ { return foo_ && o.foo_; } ++ ++ bool operator|| (base const& o) const // base::operator|| ++ { return foo_ || o.foo_; } ++ ++ int operator<< (int value) const // base::operator<< ++ { return foo_ << value; } ++ ++ base operator<<= (int value) // base::operator<<= ++ { foo_ <<= value; return *this; } ++ ++ int operator>> (int value) const // base::operator>> ++ { return foo_ >> value; } ++ ++ base operator>>= (int value) // base::operator>>= ++ { foo_ >>= value; return *this; } ++ ++ int operator~ (void) const // base::operator~ ++ { return ~foo_; } ++ ++ int operator& (base const& o) const // base::operator& ++ { return foo_ & o.foo_; } ++ ++ base operator&= (base const& o) // base::operator&= ++ { foo_ &= o.foo_; return *this; } ++ ++ int operator| (base const& o) const // base::operator| ++ { return foo_ | o.foo_; } ++ ++ base operator|= (base const& o) // base::operator|= ++ { foo_ |= o.foo_; return *this; } ++ ++ int operator^ (base const& o) const // base::operator^ ++ { return foo_ ^ o.foo_; } ++ ++ base operator^= (base const& o) // base::operator^= ++ { foo_ ^= o.foo_; return *this; } ++ ++ base operator= (base const& o) // base::operator= ++ { foo_ = o.foo_; return *this; } ++ ++ void operator() (void) const // base::operator() ++ { return; } ++ ++ int operator[] (int idx) const // base::operator[] ++ { return idx; } ++ ++ void* operator new (size_t size) throw () // base::operator new ++ { return malloc (size); } ++ ++ void operator delete (void* ptr) // base::operator delete ++ { free (ptr); } ++ ++ void* operator new[] (size_t size) throw () // base::operator new[] ++ { return malloc (size); } ++ ++ void operator delete[] (void* ptr) // base::operator delete[] ++ { free (ptr); } ++ ++ base const* operator-> (void) const // base::opeartor-> ++ { return this; } ++ ++ int operator->* (base const& b) const // base::operator->* ++ { return foo_ * b.foo_; } ++ ++ operator char* () const { return const_cast ("hello"); } // base::operator char* ++ operator int () const { return 21; } // base::operator int ++ operator fluff* () const { return new fluff (); } // base::operator fluff* ++ operator fluff** () const { return &g_fluff; } // base::operator fluff** ++}; ++ ++class base1 : public virtual base ++{ ++public: ++ base1 (void) : foo_ (21) { } // base1::base1(void) ++ base1 (int a) : foo_(a) { } // base1::base1(int) ++ void a_function (void) const { } // base1::a_function ++ ++protected: ++ int foo_; ++}; ++ ++class base2 : public virtual base ++{ ++public: ++ base2 () : foo_ (3) { } // base2::base2 ++ ++protected: ++ void a_function (void) const { } // base2::a_function ++ int foo_; ++}; ++ ++class derived : public base1, public base2 ++{ ++ public: ++ derived(void) : foo_ (4) { } // derived::derived ++ void a_function (void) const // derived::a_function ++ { ++ this->base1::a_function (); ++ this->base2::a_function (); ++ } ++ ++ protected: ++ int foo_; ++}; ++ ++int ++main (int argc, char* argv[]) // main ++{ // main ++ derived d; ++ void (derived::*pfunc) (void) const = &derived::a_function; ++ (d.*pfunc) (); ++ ++ base a (1), b (3), c (8); ++ (void) a.overload (); ++ (void) a.overload (static_cast (0)); ++ (void) a.overload (static_cast (0)); ++ (void) a.overload (static_cast (0)); ++ (void) a.overload (static_cast (0)); ++ (void) a.overload (a); ++ ++ int r; ++ r = b + c; ++ ++a; ++ a += b; ++ r = b - c; ++ --a; ++ a -= b; ++ r = b * c; ++ a *= b; ++ r = b / c; ++ a /= b; ++ r = b % c; ++ a %= b; ++ bool x = (b < c); ++ x = (b <= c); ++ x = (b > c); ++ x = (b >= c); ++ x = (b != c); ++ x = (b == c); ++ x = (!b); ++ x = (b && c); ++ x = (b || c); ++ r = b << 2; ++ a <<= 1; ++ r = b >> 2; ++ a >>= 1; ++ r = ~b; ++ r = b & c; ++ a &= c; ++ r = b | c; ++ a |= c; ++ r = b ^ c; ++ a ^= c; ++ a = c; ++ a (); ++ int i = a[3]; ++ derived* f = new derived (); ++ derived* g = new derived[3]; ++ delete f; ++ delete[] g; ++ a->overload (); ++ r = a->*b; ++ ++ tclass char_tclass; ++ tclass int_tclass; ++ tclass short_tclass; ++ tclass long_tclass; ++ tclass base_tclass; ++ char_tclass.do_something (); ++ int_tclass.do_something (); ++ short_tclass.do_something (); ++ long_tclass.do_something (); ++ base_tclass.do_something (); ++ ++ flubber (); ++ flubber (); ++ flubber (); ++ flubber (); ++ flubber (); ++ flubber (); ++ flubber (); ++ flubber (); ++ flubber (); ++ flubber (); ++ flubber (); ++ flubber (); ++ flubber (); ++ flubber (); ++ flubber (); ++ flubber (); ++ flubber (); ++ flubber (); ++ flubber (); ++ flubber (); ++ flubber (); ++ flubber (); ++ flubber (); ++ ++ policy1 p1 (1); ++ p1.function (); ++ policy2 p2 (2); ++ p2.function (); ++ policy3 p3 (3); ++ p3.function (); ++ policy4 p4 (4); ++ p4.function (); ++ ++ policyd1 pd1 (5); ++ pd1.function (); ++ policyd2 pd2 (6); ++ pd2.function (); ++ policyd3 pd3 (7); ++ pd3.function (); ++ policyd4 pd4 (d); ++ pd4.function (); ++ policyd5 pd5 (int_tclass); ++ pd5.function (); ++ ++ base1 b1 (3); ++ ++ r = a; ++ char* str = a; ++ fluff* flp = a; ++ fluff** flpp = a; ++} ++ +diff --git a/gdb/testsuite/gdb.cp/cpexprs.exp b/gdb/testsuite/gdb.cp/cpexprs.exp +new file mode 100644 +index 0000000..6074763 +--- /dev/null ++++ b/gdb/testsuite/gdb.cp/cpexprs.exp +@@ -0,0 +1,724 @@ ++# cpexprs.exp - C++ expressions tests ++# ++# Copyright 2008, 2009, 2010 Free Software Foundation, Inc. ++# ++# Contributed by Red Hat, originally written by Keith Seitz. ++# ++# 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 3 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, see . ++ ++# This file is part of the gdb testsuite. ++ ++# A helper proc which sets a breakpoint at FUNC and attempts to ++# run to the breakpoint. ++proc test_breakpoint {func} { ++ global DEC ++ ++ # Restart every time ++ if {![runto_main]} { ++ perror "could not run to main when attempting to break at $func" ++ } else { ++ gdb_breakpoint "$func" ++ set i [expr {[string last : $func] + 1}] ++ set efunc [string_to_regexp [string range $func $i end]] ++ gdb_test "continue" \ ++ "Continuing.\r\n\r\nBreakpoint $DEC+,.*$efunc.*" \ ++ "continue to $func" ++ } ++} ++ ++# Add a function to the list of tested functions ++# FUNC is the name of the function (which will be passed to gdb commands) ++# TYPE is the type of the function, as expected from the "print" command ++# PRINT is the name of the function, as expected result of the print command ++# *OR* "-", indicating that FUNC should be used (needed for virtual/inherited ++# funcs) ++# LST is either the expected result of the list command (the comment from ++# the source code) *OR* "-", in which case FUNC will be used ++# ++# Usage: ++# add NAME TYPE PRINT LST ++# add NAME TYPE PRINT - ++proc add {func type print lst} { ++ global all_functions CONVAR ADDR ++ ++ set all_functions($func,type) $type ++ if {$print == "-"} { ++ set print $func ++ } ++ ++ # An exception: since gdb canonicalizes C++ output, ++ # "(void)" must be mutated to "()". ++ regsub {\(void\)} $print {()} print ++ ++ set all_functions($func,print) \ ++ "$CONVAR = {[string_to_regexp $type]} $ADDR <[string_to_regexp $print].*>" ++ if {$lst == "-"} { ++ set lst "$func" ++ } ++ set all_functions($func,list) ".*// [string_to_regexp $lst]" ++} ++ ++proc get {func cmd} { ++ global all_functions ++ return $all_functions($func,$cmd) ++} ++ ++# Returns a list of function names for a given command ++proc get_functions {cmd} { ++ global all_functions ++ set result {} ++ foreach i [array names all_functions *,$cmd] { ++ if {$all_functions($i) != ""} { ++ set idx [string last , $i] ++ if {$idx != -1} { ++ lappend result [string range $i 0 [expr {$idx - 1}]] ++ } ++ } ++ } ++ ++ return [lsort $result] ++} ++ ++# Some convenience variables for this test ++set DEC {[0-9]}; # a decimal number ++set HEX {[0-9a-fA-F]}; # a hexidecimal number ++set CONVAR "\\\$$DEC+"; # convenience variable regexp ++set ADDR "0x$HEX+"; # address ++ ++# An array of functions/methods that we are testing... ++# Each element consists is indexed by NAME,COMMAND, where ++# NAME is the function name and COMMAND is the gdb command that ++# we are testing. The value of the array for any index pair is ++# the expected result of running COMMAND with the NAME as argument. ++ ++# The array holding all functions/methods to test. Valid subindexes ++# are (none need character escaping -- "add" will take care of that): ++ ++# add name type print_name list ++# NAME,type: value is type of function ++# NAME,print: value is print name of function (careful w/inherited/virtual!) ++# NAME,list: value is comment in source code on first line of function ++# (without the leading "//") ++array set all_functions {} ++ ++# "Normal" functions/methods ++add {main} \ ++ {int (int, char **)} \ ++ - \ ++ - ++add {derived::a_function} \ ++ {void (const derived * const)} \ ++ - \ ++ - ++add {base1::a_function} \ ++ {void (const base1 * const)} \ ++ - \ ++ - ++add {base2::a_function} \ ++ {void (const base2 * const)} \ ++ - \ ++ - ++ ++# Constructors ++ ++# On targets using the ARM EABI, the constructor is expected to return ++# "this". ++proc ctor { type arglist } { ++ if { [istarget arm*-*eabi*] } { ++ set ret "$type *" ++ } else { ++ set ret "void " ++ } ++ if { $arglist != "" } { ++ set arglist ", $arglist" ++ } ++ return "${ret}($type * const$arglist)" ++} ++ ++add {derived::derived} \ ++ [ctor derived ""] \ ++ - \ ++ - ++add {base1::base1(void)} \ ++ [ctor base1 "const void ** const"] \ ++ - \ ++ - ++add {base1::base1(int)} \ ++ [ctor base1 "int"] \ ++ - \ ++ - ++add {base2::base2} \ ++ [ctor base2 "const void ** const"] \ ++ - \ ++ - ++add {base::base(void)} \ ++ [ctor base ""] \ ++ - \ ++ - ++add {base::base(int)} \ ++ [ctor base "int"] \ ++ - \ ++ - ++ ++# Destructors ++ ++# On targets using the ARM EABI, some destructors are expected ++# to return "this". Others are void. For internal reasons, ++# GCC returns void * instead of $type *; RealView appears to do ++# the same. ++proc dtor { type } { ++ if { [istarget arm*-*eabi*] } { ++ set ret "void *" ++ } else { ++ set ret "void " ++ } ++ return "${ret}($type * const)" ++} ++ ++add {base::~base} \ ++ [dtor base] \ ++ - \ ++ - ++ ++# Overloaded methods (all are const -- we try to use the void ++# method with and without specifying "const") ++add {base::overload(void)} \ ++ {int (const base * const)} \ ++ - \ ++ {base::overload(void) const} ++add {base::overload(void) const} \ ++ {int (const base * const)} \ ++ - \ ++ {base::overload(void) const} ++add {base::overload(int) const} \ ++ {int (const base * const, int)} \ ++ - \ ++ - ++add {base::overload(short) const} \ ++ {int (const base * const, short)} \ ++ - \ ++ - ++add {base::overload(long) const} \ ++ {int (const base * const, long)} \ ++ - \ ++ - ++add {base::overload(char*) const} \ ++ {int (const base * const, char *)} \ ++ - \ ++ - ++add {base::overload(base&) const} \ ++ {int (const base * const, base &)} \ ++ - \ ++ - ++ ++# Operators ++add {base::operator+} \ ++ {int (const base * const, const base &)} \ ++ - \ ++ - ++add {base::operator++} \ ++ {base (base * const)} \ ++ - \ ++ - ++add {base::operator+=} \ ++ {base (base * const, const base &)} \ ++ - \ ++ - ++add {base::operator-} \ ++ {int (const base * const, const base &)} \ ++ - \ ++ - ++add {base::operator--} \ ++ {base (base * const)} \ ++ - \ ++ - ++add {base::operator-=} \ ++ {base (base * const, const base &)} \ ++ - \ ++ - ++add {base::operator*} \ ++ {int (const base * const, const base &)} \ ++ - \ ++ - ++add {base::operator*=} \ ++ {base (base * const, const base &)} \ ++ - \ ++ - ++add {base::operator/} \ ++ {int (const base * const, const base &)} \ ++ - \ ++ - ++add {base::operator/=} \ ++ {base (base * const, const base &)} \ ++ - \ ++ - ++add {base::operator%} \ ++ {int (const base * const, const base &)} \ ++ - \ ++ - ++add {base::operator%=} \ ++ {base (base * const, const base &)} \ ++ - \ ++ - ++add {base::operator<} \ ++ {bool (const base * const, const base &)} \ ++ - \ ++ - ++add {base::operator<=} \ ++ {bool (const base * const, const base &)} \ ++ - \ ++ - ++add {base::operator>} \ ++ {bool (const base * const, const base &)} \ ++ - \ ++ - ++add {base::operator>=} \ ++ {bool (const base * const, const base &)} \ ++ - \ ++ - ++add {base::operator!=} \ ++ {bool (const base * const, const base &)} \ ++ - \ ++ - ++add {base::operator==} \ ++ {bool (const base * const, const base &)} \ ++ - \ ++ - ++add {base::operator!} \ ++ {bool (const base * const)} \ ++ - \ ++ - ++add {base::operator&&} \ ++ {bool (const base * const, const base &)} \ ++ - \ ++ - ++add {base::operator||} \ ++ {bool (const base * const, const base &)} \ ++ - \ ++ - ++add {base::operator<<} \ ++ {int (const base * const, int)} \ ++ - \ ++ - ++add {base::operator<<=} \ ++ {base (base * const, int)} \ ++ - \ ++ - ++add {base::operator>>} \ ++ {int (const base * const, int)} \ ++ - \ ++ - ++add {base::operator>>=} \ ++ {base (base * const, int)} \ ++ - \ ++ - ++add {base::operator~} \ ++ {int (const base * const)} \ ++ - \ ++ - ++add {base::operator&} \ ++ {int (const base * const, const base &)} \ ++ - \ ++ - ++add {base::operator&=} \ ++ {base (base * const, const base &)} \ ++ - \ ++ - ++add {base::operator|} \ ++ {int (const base * const, const base &)} \ ++ - \ ++ - ++add {base::operator|=} \ ++ {base (base * const, const base &)} \ ++ - \ ++ - ++add {base::operator^} \ ++ {int (const base * const, const base &)} \ ++ - \ ++ - ++add {base::operator^=} \ ++ {base (base * const, const base &)} \ ++ - \ ++ - ++add {base::operator=} \ ++ {base (base * const, const base &)} \ ++ - \ ++ - ++add {base::operator()} \ ++ {void (const base * const)} \ ++ - \ ++ - ++add {base::operator[]} \ ++ {int (const base * const, int)} \ ++ - \ ++ - ++add {base::operator new} \ ++ {void *(size_t)} \ ++ - \ ++ - ++add {base::operator delete} \ ++ {void (void *)} \ ++ - \ ++ - ++add {base::operator new[]} \ ++ {void *(size_t)} \ ++ - \ ++ - ++add {base::operator delete[]} \ ++ {void (void *)} \ ++ - \ ++ - ++add {base::operator char*} \ ++ {char *(const base * const)} \ ++ - \ ++ - ++add {base::operator fluff*} \ ++ {fluff *(const base * const)} \ ++ - \ ++ - ++add {base::operator fluff**} \ ++ {fluff **(const base * const)} \ ++ - \ ++ - ++add {base::operator int} \ ++ {int (const base * const)} \ ++ - \ ++ - ++ ++# Templates ++add {tclass::do_something} \ ++ {void (tclass * const)} \ ++ - \ ++ - ++add {tclass::do_something} \ ++ {void (tclass * const)} \ ++ - \ ++ - ++add {tclass::do_something} \ ++ {void (tclass * const)} \ ++ - \ ++ - ++add {tclass::do_something} \ ++ {void (tclass * const)} \ ++ - \ ++ - ++add {tclass::do_something} \ ++ {void (tclass * const)} \ ++ - \ ++ - ++add {flubber} \ ++ {void (void)} \ ++ - \ ++ flubber ++add {flubber} \ ++ {void (void)} \ ++ - \ ++ flubber ++add {flubber} \ ++ {void (void)} \ ++ - \ ++ flubber ++add {flubber} \ ++ {void (void)} \ ++ - \ ++ flubber ++add {flubber} \ ++ {void (void)} \ ++ - \ ++ flubber ++add {flubber} \ ++ {void (void)} \ ++ - \ ++ flubber ++add {flubber} \ ++ {void (void)} \ ++ - \ ++ flubber ++add {flubber} \ ++ {void (void)} \ ++ - \ ++ flubber ++add {flubber} \ ++ {void (void)} \ ++ - \ ++ flubber ++add {flubber} \ ++ {void (void)} \ ++ - \ ++ flubber ++add {flubber} \ ++ {void (void)} \ ++ - \ ++ flubber ++add {flubber} \ ++ {void (void)} \ ++ - \ ++ flubber ++add {flubber} \ ++ {void (void)} \ ++ - \ ++ flubber ++add {flubber} \ ++ {void (void)} \ ++ - \ ++ flubber ++add {flubber} \ ++ {void (void)} \ ++ - \ ++ flubber ++add {flubber} \ ++ {void (void)} \ ++ - \ ++ flubber ++add {flubber} \ ++ {void (void)} \ ++ - \ ++ flubber ++add {flubber} \ ++ {void (void)} \ ++ - \ ++ flubber ++add {flubber} \ ++ {void (void)} \ ++ - \ ++ flubber ++add {flubber} \ ++ {void (void)} \ ++ - \ ++ flubber ++add {flubber} \ ++ {void (void)} \ ++ - \ ++ flubber ++add {flubber} \ ++ {void (void)} \ ++ - \ ++ flubber ++add {flubber} \ ++ {void (void)} \ ++ - \ ++ flubber ++add {tclass::do_something} \ ++ {void (tclass * const)} \ ++ - \ ++ {tclass::do_something} ++add {policy1::policy} \ ++ [ctor "policy >" "int"] \ ++ {policy >::policy} \ ++ {policy::policy} ++add {policy2::policy} \ ++ [ctor "policy >" int] \ ++ {policy >::policy} \ ++ {policy::policy} ++add {policy3::policy} \ ++ [ctor "policy >" "int"] \ ++ {policy >::policy} \ ++ {policy::policy} ++add {policy4::policy} \ ++ [ctor "policy >" "int"] \ ++ {policy >::policy} \ ++ {policy::policy} ++add {policy1::function} \ ++ {void (void)} \ ++ {operation_1::function} \ ++ {operation_1::function} ++add {policy2::function} \ ++ {void (void)} \ ++ {operation_2::function} \ ++ {operation_2::function} ++add {policy3::function} \ ++ {void (void)} \ ++ {operation_3::function} \ ++ {operation_3::function} ++add {policy4::function} \ ++ {void (void)} \ ++ {operation_4::function} \ ++ {operation_4::function} ++add {policyd >::policyd} \ ++ [ctor "policyd >" "int"] \ ++ - \ ++ {policyd::policyd} ++add {policyd1::policyd} \ ++ [ctor "policyd >" "int"] \ ++ {policyd >::policyd} \ ++ {policyd::policyd} ++add {policyd >::~policyd} \ ++ [dtor "policyd >"] \ ++ - \ ++ {policyd::~policyd} ++add {policyd1::~policyd} \ ++ [dtor "policyd >"] \ ++ {policyd >::~policyd} \ ++ {policyd::~policyd} ++add {policyd >::policyd} \ ++ [ctor "policyd >" "long"] \ ++ - \ ++ {policyd::policyd} ++add {policyd2::policyd} \ ++ [ctor "policyd >" "long"] \ ++ {policyd >::policyd} \ ++ {policyd::policyd} ++add {policyd >::~policyd} \ ++ [dtor "policyd >"] \ ++ - \ ++ {policyd::~policyd} ++add {policyd2::~policyd} \ ++ [dtor "policyd >"] \ ++ {policyd >::~policyd} \ ++ {policyd::~policyd} ++add {policyd >::policyd} \ ++ [ctor "policyd >" "char"] \ ++ - \ ++ {policyd::policyd} ++add {policyd3::policyd} \ ++ [ctor "policyd >" "char"] \ ++ {policyd >::policyd} \ ++ {policyd::policyd} ++add {policyd >::~policyd} \ ++ [dtor "policyd >"] \ ++ - \ ++ {policyd::~policyd} ++add {policyd3::~policyd} \ ++ [dtor "policyd >"] \ ++ {policyd >::~policyd} \ ++ {policyd::~policyd} ++add {policyd >::policyd} \ ++ [ctor "policyd >" "base"] \ ++ - \ ++ {policyd::policyd} ++add {policyd4::policyd} \ ++ [ctor "policyd >" "base"] \ ++ {policyd >::policyd} \ ++ {policyd::policyd} ++add {policyd >::~policyd} \ ++ [dtor "policyd >"] \ ++ - \ ++ {policyd::~policyd} ++add {policyd4::~policyd} \ ++ [dtor "policyd >"] \ ++ {policyd >::~policyd} \ ++ {policyd::~policyd} ++add {policyd, operation_1 > >::policyd} \ ++ [ctor "policyd, operation_1 > >" "tclass"] \ ++ - \ ++ {policyd::policyd} ++add {policyd5::policyd} \ ++ [ctor "policyd, operation_1 > >" "tclass"] \ ++ {policyd, operation_1 > >::policyd} \ ++ {policyd::policyd} ++add {policyd, operation_1 > >::~policyd} \ ++ [dtor "policyd, operation_1 > >"] \ ++ - \ ++ {policyd::~policyd} ++add {policyd5::~policyd} \ ++ [dtor "policyd, operation_1 > >"] \ ++ {policyd, operation_1 > >::~policyd} \ ++ {policyd::~policyd} ++add {policyd >::function} \ ++ {void (void)} \ ++ {operation_1::function}\ ++ {operation_1::function} ++add {policyd1::function} \ ++ {void (void)} \ ++ {operation_1::function} \ ++ {operation_1::function} ++add {policyd2::function} \ ++ {void (void)} \ ++ {operation_1::function} \ ++ {operation_1::function} ++add {policyd >::function} \ ++ {void (void)} \ ++ {operation_1::function} \ ++ {operation_1::function} ++add {policyd3::function} \ ++ {void (void)} \ ++ {operation_1::function} \ ++ {operation_1::function} ++add {policyd >::function} \ ++ {void (void)} \ ++ {operation_1::function} \ ++ {operation_1::function} ++add {policyd4::function} \ ++ {void (void)} \ ++ {operation_1::function} \ ++ {operation_1::function} ++add {policyd, operation_1 > >::function} \ ++ {void (void)} \ ++ {operation_1 >::function} \ ++ {operation_1::function} ++add {policyd5::function} \ ++ {void (void)} \ ++ {operation_1 >::function} \ ++ {operation_1::function} ++ ++# Start the test ++if {$tracelevel} { ++ strace $tracelevel ++} ++ ++if {[skip_cplus_tests]} { continue } ++ ++# ++# test running programs ++# ++set prms_id 0 ++set bug_id 0 ++ ++set testfile "cpexprs" ++set srcfile "${testfile}.cc" ++set binfile [file join $objdir $subdir $testfile] ++ ++if {[gdb_compile [file join $srcdir $subdir $srcfile] $binfile \ ++ executable {debug c++}] != "" } { ++ untested "$testfile.exp" ++ return -1 ++} ++ ++if {[get_compiler_info $binfile "c++"]} { ++ return -1 ++} ++ ++gdb_exit ++gdb_start ++gdb_reinitialize_dir [file join $srcdir $subdir] ++gdb_load $binfile ++ ++if {![runto_main]} { ++ perror "couldn't run to breakpoint" ++ continue ++} ++ ++# Set the listsize to one. This will help with testing "list". ++gdb_test "set listsize 1" ++ ++# "print METHOD" ++foreach name [get_functions print] { ++ gdb_test "print $name" [get $name print] "print $name" ++} ++ ++# "list METHOD" ++foreach name [get_functions list] { ++ gdb_test "list $name" [get $name list] "list $name" ++} ++ ++# Running to breakpoint -- use any function we can "list" ++foreach name [get_functions list] { ++ # Skip "main", since test_breakpoint uses it ++ if {[string compare $name "main"] != 0} { ++ test_breakpoint $name ++ } ++} ++ ++gdb_exit ++return 0 diff --git a/gdb/testsuite/gdb.cp/cplusfuncs.cc b/gdb/testsuite/gdb.cp/cplusfuncs.cc index f4f78a6..11dba06 100644 --- a/gdb/testsuite/gdb.cp/cplusfuncs.cc @@ -20134,6 +21802,362 @@ index 6832f3b..baf08d7 100644 -gdb_test "print null_pmf = &A::foo" "$vhn = $hex " +gdb_test "print null_pmf = &A::foo" "$vhn = \\(int \\(A::\\*\\)\\(A \\*, int\\)\\) $hex " gdb_test "print null_pmf = 0" "$vhn = NULL" +diff --git a/gdb/testsuite/gdb.cp/namespace-koenig.cc b/gdb/testsuite/gdb.cp/namespace-koenig.cc +new file mode 100644 +index 0000000..3c30cb2 +--- /dev/null ++++ b/gdb/testsuite/gdb.cp/namespace-koenig.cc +@@ -0,0 +1,232 @@ ++namespace A ++{ ++ class C ++ { ++ public: ++ static const int x = 11; ++ }; ++ ++ int ++ first (C c) ++ { ++ return 11; ++ } ++ ++ int ++ first (int a, C c) ++ { ++ return 22; ++ } ++ ++ int ++ second (int a, int b, C cc, int c, int d) ++ { ++ return 33; ++ } ++ ++} ++ ++struct B ++{ ++ A::C c; ++}; ++ ++//------------ ++ ++namespace E ++{ ++ class O{}; ++ int foo (O o){return 1; } ++ int foo (O o, O o2){return 2; } ++ int foo (O o, O o2, int i){return 3; } ++} ++ ++namespace F ++{ ++ class O{}; ++ int foo ( O fo, ::E::O eo){ return 4;} ++ int foo (int i, O fo, ::E::O eo){ return 5;} ++} ++ ++namespace G ++{ ++ class O{}; ++ int foo (O go, ::F::O fo, ::E::O eo){ return 6; } ++} ++ ++//------------ ++ ++namespace H ++{ ++ class O{}; ++ int foo (O){ return 7;} ++} ++ ++namespace I ++{ ++ class O: public H::O {}; ++ class X: H::O{}; ++} ++ ++//------------ ++ ++namespace J ++{ ++ union U{}; ++ struct S{}; ++ enum E{}; ++ ++ class A{ ++ public: ++ class B{}; ++ }; ++ ++ class C{}; ++ ++ int foo (U){ return 8;} ++ int foo (S){ return 9;} ++ int foo (E){ return 10;} ++ int foo (A::B){ return 11;} ++ int foo (A*){ return 12;} ++ int foo (A**){ return 13;} ++ int foo (C[]){ return 14;} ++ ++} ++//------------ ++ ++namespace K{ ++ class O{}; ++ ++ int foo(O, int){ ++ return 15; ++ } ++ ++ int bar(O, int){ ++ return 15; ++ } ++} ++ ++int foo(K::O, float){ ++ return 16; ++} ++ ++int bar(K::O, int){ ++ return 16; ++} ++//------------ ++ ++namespace L { ++ namespace A{ ++ namespace B{ ++ class O {}; ++ ++ int foo (O){ ++ return 17; ++ } ++ ++ } ++ } ++} ++ ++//------------ ++ ++namespace M { ++ class O{ ++ public: ++ int operator== (int){ ++ return 18; ++ } ++ ++ int operator== (float){ ++ return 19; ++ } ++ ++ int operator+ (float){ ++ return 22; ++ } ++ ++ }; ++ ++ int operator!= (O, int){ ++ return 20; ++ } ++ ++ int operator!= (O, double){ ++ return 21; ++ } ++ ++ int operator+ (O, int){ ++ return 23; ++ } ++ ++ int operator++ (O){ ++ return 24; ++ } ++ ++} ++//------------ ++int ++main () ++{ ++ A::C c; ++ B b; ++ ++ A::first (c); ++ first (0, c); ++ second (0, 0, c, 0, 0); ++ A::first (b.c); ++ ++ E::O eo; ++ F::O fo; ++ G::O go; ++ ++ foo (eo); ++ foo (eo, eo); ++ foo (eo, eo, 1); ++ foo (fo, eo); ++ foo (1 ,fo, eo); ++ foo (go, fo, eo); ++ ++ I::O io; ++ I::X ix; ++ ++ foo (io); ++//foo (ix); ++ ++ J::U ju; ++ J::S js; ++ J::E je; ++ J::A::B jab; ++ J::A *jap; ++ J::A **japp; ++ J::C jca[3]; ++ ++ foo (ju); ++ foo (js); ++ foo (je); ++ foo (jab); ++ foo (jap); ++ foo (japp); ++ foo (jca); ++ ++ K::O ko; ++ foo (ko, 1); ++ foo (ko, 1.0f); ++ //bar(ko,1); ++ ++ L::A::B::O labo; ++ foo (labo); ++ ++ M::O o; ++ o == 5; ++ o == 5.0f; ++ o != 5; ++ o != 5.0f; ++ o + 5; ++ o + 5.0f; ++ ++ return first (0, c) + foo (eo) + ++ foo (eo, eo) + foo (eo, eo, 1) + ++ foo (fo, eo) + foo (1 ,fo, eo) + ++ foo (go, fo, eo); ++} +diff --git a/gdb/testsuite/gdb.cp/namespace-koenig.exp b/gdb/testsuite/gdb.cp/namespace-koenig.exp +new file mode 100644 +index 0000000..c73e239 +--- /dev/null ++++ b/gdb/testsuite/gdb.cp/namespace-koenig.exp +@@ -0,0 +1,112 @@ ++# Copyright 2008 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 3 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, see . ++ ++if $tracelevel then { ++ strace $tracelevel ++} ++ ++set prms_id 0 ++set bug_id 0 ++ ++set testfile namespace-koenig ++set srcfile ${testfile}.cc ++set binfile ${objdir}/${subdir}/${testfile} ++if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } { ++ untested "Couldn't compile test program" ++ return -1 ++} ++ ++# Get things started. ++ ++gdb_exit ++gdb_start ++gdb_reinitialize_dir $srcdir/$subdir ++gdb_load ${binfile} ++ ++############################################ ++ ++if ![runto_main] then { ++ perror "couldn't run to breakpoint main" ++ continue ++} ++ ++# Test that koenig lookup finds correct function ++gdb_test "p first(c)" "= 11" ++ ++# Change the number of parameters and position of ++# the qualifying parameter ++gdb_test "p second(0,0,c,0,0)" "= 33" ++ ++# Test that koenig lookup finds correct function ++# even if it is overloaded ++gdb_test "p first(0,c)" "= 22" ++ ++# Test that koenig lookup finds correct function ++# when the argument is an expression ++gdb_test "p first(b.c)" "= 11" ++ ++# test that resolutions can be made across namespaces ++gdb_test "p foo(eo)" "= 1" ++gdb_test "p foo(eo, eo)" "= 2" ++gdb_test "p foo(eo, eo, 1)" "= 3" ++gdb_test "p foo(fo, eo)" "= 4" ++gdb_test "p foo(1 ,fo, eo)" "= 5" ++gdb_test "p foo(go, fo, eo)" "= 6" ++ ++#test that gdb fails gracefully ++gdb_test "p fake(eo)" "No symbol \"fake\" in current context." ++ ++#test that namespaces of base classes are searched ++gdb_test "p foo(io)" "= 7" ++gdb_test "p foo(ix)" "Cannot resolve function foo to any overloaded instance" ++ ++#test for other types ++gdb_test "p foo(ju)" "= 8" ++gdb_test "p foo(js)" "= 9" ++gdb_test "p foo(je)" "= 10" ++ ++#test for class members ++setup_xfail "*-*-*" ++gdb_test "p foo(jab)" "= 11" ++ ++gdb_test "p foo(jap)" "= 12" ++gdb_test "p foo(japp)" "= 13" ++gdb_test "p foo(jca)" "= 14" ++ ++#test overload resolution ++gdb_test "p foo(ko,1)" "= 15" ++gdb_test "p foo(ko,1.0f)" "= 16" ++setup_xfail "*-*-*" ++gdb_test "p bar(ko,1)" "= -1" ++ ++#test lookup of objects belonging to nested namespaces ++gdb_test "p foo(labo)" "= 17" ++ ++# test lookup of namespace user-defined operators ++# and overload resolution: ++ ++# within class ++gdb_test "p o == 5" "= 18" ++gdb_test "p o == 5.0f" "= 19" ++ ++# within namespace ++gdb_test "p o != 5" "= 20" ++gdb_test "p o != 5.0f" "= 21" ++ ++# across namespace and class ++gdb_test "p o + 5.0f" "= 22" ++gdb_test "p o + 5" "= 23" ++ ++gdb_test "p o++" "= 24" diff --git a/gdb/testsuite/gdb.cp/namespace-multiple-imports.cc b/gdb/testsuite/gdb.cp/namespace-multiple-imports.cc new file mode 100644 index 0000000..6b180d6 @@ -20907,7 +22931,7 @@ index 4362fd8..f7cfd57 100644 # Some anonymous namespace tests. diff --git a/gdb/testsuite/gdb.cp/nsusing.exp b/gdb/testsuite/gdb.cp/nsusing.exp -index bd115c4..5f80f7d 100644 +index 72a616e..fd99f87 100644 --- a/gdb/testsuite/gdb.cp/nsusing.exp +++ b/gdb/testsuite/gdb.cp/nsusing.exp @@ -30,7 +30,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable \ @@ -20920,7 +22944,7 @@ index bd115c4..5f80f7d 100644 diff --git a/gdb/testsuite/gdb.cp/overload.exp b/gdb/testsuite/gdb.cp/overload.exp -index 1bfa0f3..9fd31a8 100644 +index ae8fd26..8291022 100644 --- a/gdb/testsuite/gdb.cp/overload.exp +++ b/gdb/testsuite/gdb.cp/overload.exp @@ -74,12 +74,12 @@ set re_methods "${re_methods}${ws}int overload1arg\\((void|)\\);" @@ -23875,6 +25899,43 @@ index 9e787f0..5ca15d5 100644 -re ".*time_at_startup = get_run_time.*$gdb_prompt $" { set description "next over get_run_time and everything it calls" set command "next" +diff --git a/gdb/testsuite/gdb.java/jmain.exp b/gdb/testsuite/gdb.java/jmain.exp +index ab95247..9814921 100644 +--- a/gdb/testsuite/gdb.java/jmain.exp ++++ b/gdb/testsuite/gdb.java/jmain.exp +@@ -65,7 +65,7 @@ gdb_test "break jmain.main" "${bpmain}" + + # Check that a fully qualified "main" works. + gdb_load "${binfile}" +-set cmd "break \'${testfile}.main(java.lang.String\[\])\'" ++set cmd "break ${testfile}.main(java.lang.String\[\])" + set msg $cmd + gdb_test_multiple $cmd $msg { + -re "${bpmain}\r\n$gdb_prompt $" { +@@ -79,7 +79,7 @@ gdb_test_multiple $cmd $msg { + gdb_test "n" "" "" + + # Check again with a method signature at the end. +- set cmd "break \'${testfile}.main(java.lang.String\[\])void\'" ++ set cmd "break ${testfile}.main(java.lang.String\[\])void" + set msg $cmd + gdb_test_multiple $cmd $msg { + -re "${bpmain}\r\n$gdb_prompt $" { +diff --git a/gdb/testsuite/gdb.java/jmisc.exp b/gdb/testsuite/gdb.java/jmisc.exp +index 6f7188d..e3ab657 100644 +--- a/gdb/testsuite/gdb.java/jmisc.exp ++++ b/gdb/testsuite/gdb.java/jmisc.exp +@@ -71,8 +71,8 @@ if ![set_lang_java] then { + # signature. + runto_main + set function "${testfile}.main(java.lang.String\[\])" +- gdb_breakpoint "\'$function\'" { allow-pending } +- gdb_breakpoint "\'${function}void\'" { allow-pending } ++ gdb_breakpoint "$function" { allow-pending } ++ gdb_breakpoint "${function}void" { allow-pending } + gdb_continue_to_breakpoint $function + + send_gdb "ptype jmisc\n" diff --git a/gdb/testsuite/gdb.java/jnpe.exp b/gdb/testsuite/gdb.java/jnpe.exp new file mode 100644 index 0000000..e71391e @@ -24002,6 +26063,21 @@ index 0000000..3524830 + } + } +} +diff --git a/gdb/testsuite/gdb.java/jprint.exp b/gdb/testsuite/gdb.java/jprint.exp +index 29dbf4b..447ca73 100644 +--- a/gdb/testsuite/gdb.java/jprint.exp ++++ b/gdb/testsuite/gdb.java/jprint.exp +@@ -70,8 +70,8 @@ if ![set_lang_java] then { + # signature. + runto_main + set function "${testfile}.main(java.lang.String\[\])" +- gdb_breakpoint "\'$function\'" { allow-pending } +- gdb_breakpoint "\'${function}void\'" { allow-pending } ++ gdb_breakpoint "$function" { allow-pending } ++ gdb_breakpoint "${function}void" { allow-pending } + gdb_continue_to_breakpoint $function + + gdb_test "p jvclass.addprint(4,5,6)" "sum is 15\r\n.*" "unambiguous static call" diff --git a/gdb/testsuite/gdb.opt/array-from-register-func.c b/gdb/testsuite/gdb.opt/array-from-register-func.c new file mode 100644 index 0000000..729f457 @@ -24792,10 +26868,10 @@ index 713ad5f..5d17b26 100644 global testfile srcdir subdir srcfile binfile if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \ diff --git a/gdb/testsuite/gdb.python/py-value.exp b/gdb/testsuite/gdb.python/py-value.exp -index aa4e519..f87277d 100644 +index d980a3d..6a75595 100644 --- a/gdb/testsuite/gdb.python/py-value.exp +++ b/gdb/testsuite/gdb.python/py-value.exp -@@ -305,6 +305,15 @@ proc test_value_after_death {} { +@@ -307,6 +307,15 @@ proc test_value_after_death {} { "print value's type" } @@ -24811,7 +26887,7 @@ index aa4e519..f87277d 100644 # Regression test for invalid subscript operations. The bug was that # the type of the value was not being checked before allowing a # subscript operation to proceed. -@@ -390,16 +399,23 @@ proc test_parse_and_eval {} { +@@ -392,16 +401,23 @@ proc test_parse_and_eval {} { gdb_exit gdb_start gdb_reinitialize_dir $srcdir/$subdir @@ -24842,7 +26918,7 @@ index aa4e519..f87277d 100644 test_value_creation test_value_numeric_ops test_value_boolean -@@ -417,6 +433,7 @@ if ![runto_main] then { +@@ -419,6 +435,7 @@ if ![runto_main] then { test_value_in_inferior test_lazy_strings test_value_after_death @@ -25415,7 +27491,7 @@ index 6fbee84..1189cfd 100644 # Check the actual key. It would be nice to require that it match diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp -index 9b06a2f..419d5a9 100644 +index 627941d..1f9b228 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -27,6 +27,7 @@ if {$tool == ""} { @@ -25662,36 +27738,19 @@ index 6155699..bb94f4b 100644 extern long ui_file_read (struct ui_file *file, char *buf, long length_buf); -diff --git a/gdb/utils.c b/gdb/utils.c -index 82a66a1..c305506 100644 ---- a/gdb/utils.c -+++ b/gdb/utils.c -@@ -2656,7 +2656,10 @@ fprintf_symbol_filtered (struct ui_file *stream, char *name, - As an extra hack, string1=="FOO(ARGS)" matches string2=="FOO". - This "feature" is useful when searching for matching C++ function names - (such as if the user types 'break FOO', where FOO is a mangled C++ -- function). */ -+ function). -+ -+ As an extra-special hack, we do the same with ' ', so that -+ "FOO(ARGS) const" can match "FOO", too. */ - - int - strcmp_iw (const char *string1, const char *string2) -@@ -2681,7 +2684,7 @@ strcmp_iw (const char *string1, const char *string2) - string2++; - } - } -- return (*string1 != '\0' && *string1 != '(') || (*string2 != '\0'); -+ return (*string1 != ' ' && *string1 != '\0' && *string1 != '(') || (*string2 != '\0' && *string2 != '('); - } - - /* This is like strcmp except that it ignores whitespace and treats diff --git a/gdb/valarith.c b/gdb/valarith.c -index ed76b09..8bf3634 100644 +index 9f91f4e..753927f 100644 --- a/gdb/valarith.c +++ b/gdb/valarith.c -@@ -139,7 +139,6 @@ an integer nor a pointer of the same type.")); +@@ -31,6 +31,7 @@ + #include "dfp.h" + #include + #include "infcall.h" ++#include "exceptions.h" + + /* Define whether or not the C operator '/' truncates towards zero for + differently signed operands (truncation direction is undefined in C). */ +@@ -146,7 +147,6 @@ an integer nor a pointer of the same type.")); struct value * value_subscript (struct value *array, LONGEST index) { @@ -25699,7 +27758,7 @@ index ed76b09..8bf3634 100644 int c_style = current_language->c_style_arrays; struct type *tarray; -@@ -154,12 +153,26 @@ value_subscript (struct value *array, LONGEST index) +@@ -161,12 +161,26 @@ value_subscript (struct value *array, LONGEST index) get_discrete_bounds (range_type, &lowerbound, &upperbound); if (VALUE_LVAL (array) != lval_memory) @@ -25728,7 +27787,7 @@ index ed76b09..8bf3634 100644 /* Emit warning unless we have an array of unknown size. An array of unknown size has lowerbound 0 and upperbound -1. */ if (upperbound > -1) -@@ -178,33 +191,37 @@ value_subscript (struct value *array, LONGEST index) +@@ -185,33 +199,37 @@ value_subscript (struct value *array, LONGEST index) error (_("not an array or string")); } @@ -25777,8 +27836,97 @@ index ed76b09..8bf3634 100644 return v; } +@@ -318,6 +336,68 @@ unop_user_defined_p (enum exp_opcode op, struct value *arg1) + } + } + ++/* Try to find OPERATOR as through argument dependent lookup. */ ++ ++static struct value * ++value_user_defined_adl_op (struct value **args, int nargs, char *operator) ++{ ++ ++ struct symbol *symp; ++ struct type **arg_types; ++ int i; ++ ++ /* This function, if found, will not be a member function ++ and does not expect a pointer as its first argument ++ rather the explicit structure. */ ++ args[0] = value_ind (args[0]); ++ ++ arg_types = (struct type **)alloca (nargs * (sizeof (struct type *))); ++ /* Prepare list of argument types for overload resolution */ ++ for (i = 0; i < nargs; i++) ++ arg_types [i] = value_type (args [i]); ++ ++ find_overload_match (arg_types, nargs, operator, 0 /* not method */, ++ 0 /* strict match */, NULL, ++ NULL /* pass NULL symbol since symbol is unknown */, ++ NULL, &symp, NULL); ++ ++ if (symp) ++ return value_of_variable (symp, 0); ++ ++ return NULL; ++} ++ ++/* Lookup user defined operator NAME. First try to find it as a member ++ of the struct ARGP[0]. If not found try to find the operator through ++ argument dependent lookup. */ ++ ++static struct value * ++value_user_defined_op (struct value **argp, struct value **args, char *name, ++ int *static_memfuncp, int nargs) ++{ ++ struct value *result = NULL; ++ volatile struct gdb_exception except; ++ ++ TRY_CATCH (except, RETURN_MASK_ERROR) ++ { ++ result = value_struct_elt (argp, args, name, static_memfuncp, ++ "structure"); ++ } ++ ++ if (except.reason < 0) ++ { ++ ++ if (current_language->la_language == language_cplus) ++ /* Try ADL. */ ++ result = value_user_defined_adl_op (args, nargs, name); ++ ++ if (!result) ++ error ("%s", except.message); ++ } ++ ++ return result; ++} ++ + /* We know either arg1 or arg2 is a structure, so try to find the right + user defined function. Create an argument vector that calls + arg1.operator @ (arg1,arg2) and return that value (where '@' is any +@@ -458,7 +538,8 @@ value_x_binop (struct value *arg1, struct value *arg2, enum exp_opcode op, + error (_("Invalid binary operation specified.")); + } + +- argvec[0] = value_struct_elt (&arg1, argvec + 1, tstr, &static_memfuncp, "structure"); ++ argvec[0] = value_user_defined_op (&arg1, argvec + 1, tstr, ++ &static_memfuncp, 2); + + if (argvec[0]) + { +@@ -555,7 +636,8 @@ value_x_unop (struct value *arg1, enum exp_opcode op, enum noside noside) + error (_("Invalid unary operation specified.")); + } + +- argvec[0] = value_struct_elt (&arg1, argvec + 1, tstr, &static_memfuncp, "structure"); ++ argvec[0] = value_user_defined_op (&arg1, argvec + 1, tstr, ++ &static_memfuncp, 1); + + if (argvec[0]) + { diff --git a/gdb/valops.c b/gdb/valops.c -index cee10fb..b08cb21 100644 +index b94c411..9875f96 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -38,6 +38,7 @@ @@ -25934,7 +28082,16 @@ index cee10fb..b08cb21 100644 } /* Given a value which is a function, return a value which is a pointer -@@ -2352,12 +2431,25 @@ find_overload_match (struct type **arg_types, int nargs, +@@ -2336,7 +2415,7 @@ find_overload_match (struct type **arg_types, int nargs, + int boffset; + int ix; + int static_offset; +- struct cleanup *old_cleanups = NULL; ++ struct cleanup *old_cleanups = make_cleanup (null_cleanup, NULL); + + const char *obj_type_name = NULL; + char *func_name = NULL; +@@ -2346,12 +2425,25 @@ find_overload_match (struct type **arg_types, int nargs, if (method) { gdb_assert (obj); @@ -25965,45 +28122,108 @@ index cee10fb..b08cb21 100644 fns_ptr = value_find_oload_method_list (&temp, name, 0, &num_fns, -@@ -2377,16 +2469,29 @@ find_overload_match (struct type **arg_types, int nargs, +@@ -2371,23 +2463,45 @@ find_overload_match (struct type **arg_types, int nargs, } else { - const char *qualified_name = SYMBOL_CPLUS_DEMANGLED_NAME (fsym); -+ const char *qualified_name = SYMBOL_NATURAL_NAME (fsym); ++ const char *qualified_name = NULL; - /* If we have a C++ name, try to extract just the function - part. */ - if (qualified_name) - func_name = cp_func_name (qualified_name); -+ /* If we have a function with a C++ name, try to extract just -+ the function part. Do not try this for non-functions (e.g. -+ function pointers). */ -+ if (qualified_name -+ && TYPE_CODE (check_typedef (SYMBOL_TYPE (fsym))) == TYPE_CODE_FUNC) -+ { -+ func_name = cp_func_name (qualified_name); -+ -+ /* If cp_func_name did not remove anything, the name of the -+ symbol did not include scope or argument types - it was -+ probably a C-style function. */ -+ if (func_name && strcmp (func_name, qualified_name) == 0) -+ { -+ xfree (func_name); -+ func_name = NULL; -+ } -+ } - +- - /* If there was no C++ name, this must be a C-style function. - Just return the same symbol. Do the same if cp_func_name - fails for some reason. */ ++ if (fsym) ++ { ++ qualified_name = SYMBOL_NATURAL_NAME (fsym); ++ ++ /* If we have a function with a C++ name, try to extract just ++ the function part. Do not try this for non-functions (e.g. ++ function pointers). */ ++ if (qualified_name ++ && TYPE_CODE (check_typedef (SYMBOL_TYPE (fsym))) == TYPE_CODE_FUNC) ++ { ++ func_name = cp_func_name (qualified_name); ++ ++ /* If cp_func_name did not remove anything, the name of the ++ symbol did not include scope or argument types - it was ++ probably a C-style function. */ ++ if (func_name && strcmp (func_name, qualified_name) == 0) ++ { ++ xfree (func_name); ++ func_name = NULL; ++ } ++ } ++ } ++ else ++ { ++ func_name = (char *) name; ++ qualified_name = name; ++ } ++ + /* If there was no C++ name, this must be a C-style function or + not a function at all. Just return the same symbol. Do the + same if cp_func_name fails for some reason. */ if (func_name == NULL) { *symp = fsym; -@@ -3123,9 +3228,9 @@ value_maybe_namespace_elt (const struct type *curtype, + return 0; + } + +- old_cleanups = make_cleanup (xfree, func_name); + make_cleanup (xfree, oload_syms); + make_cleanup (xfree, oload_champ_bv); + +@@ -2398,8 +2512,11 @@ find_overload_match (struct type **arg_types, int nargs, + &oload_champ_bv); + } + +- /* Check how bad the best match is. */ ++ /* Did we find a match ? */ ++ if (oload_champ == -1) ++ error ("No symbol \"%s\" in current context.", name); + ++ /* Check how bad the best match is. */ + match_quality = + classify_oload_match (oload_champ_bv, nargs, + oload_method_static (method, fns_ptr, +@@ -2456,8 +2573,8 @@ find_overload_match (struct type **arg_types, int nargs, + } + *objp = temp; + } +- if (old_cleanups != NULL) +- do_cleanups (old_cleanups); ++ ++ do_cleanups (old_cleanups); + + switch (match_quality) + { +@@ -2565,6 +2682,12 @@ find_oload_champ_namespace_loop (struct type **arg_types, int nargs, + new_namespace[namespace_len] = '\0'; + new_oload_syms = make_symbol_overload_list (func_name, + new_namespace); ++ ++ /* If we have reached the deepesst level perform argument ++ determined lookup. */ ++ if (!searched_deeper) ++ make_symbol_overload_list_adl (arg_types, nargs, func_name); ++ + while (new_oload_syms[num_fns]) + ++num_fns; + +@@ -2597,7 +2720,6 @@ find_oload_champ_namespace_loop (struct type **arg_types, int nargs, + } + else + { +- gdb_assert (new_oload_champ != -1); + *oload_syms = new_oload_syms; + *oload_champ = new_oload_champ; + *oload_champ_bv = new_oload_champ_bv; +@@ -3117,9 +3239,9 @@ value_maybe_namespace_elt (const struct type *curtype, struct symbol *sym; struct value *result; @@ -26016,7 +28236,7 @@ index cee10fb..b08cb21 100644 if (sym == NULL) return NULL; -@@ -3267,7 +3372,7 @@ value_of_local (const char *name, int complain) +@@ -3261,7 +3383,7 @@ value_of_local (const char *name, int complain) /* Calling lookup_block_symbol is necessary to get the LOC_REGISTER symbol instead of the LOC_ARG one (if both exist). */ @@ -26025,7 +28245,7 @@ index cee10fb..b08cb21 100644 if (sym == NULL) { if (complain) -@@ -3321,8 +3426,6 @@ value_slice (struct value *array, int lowbound, int length) +@@ -3315,8 +3437,6 @@ value_slice (struct value *array, int lowbound, int length) || lowbound + length - 1 > upperbound) error (_("slice out of range")); @@ -26318,7 +28538,7 @@ index a462ee4..968cdf4 100644 + observer_attach_mark_used (value_types_mark_used); } diff --git a/gdb/value.h b/gdb/value.h -index 42b4497..6f9923c 100644 +index 1f2086e..dd503ad 100644 --- a/gdb/value.h +++ b/gdb/value.h @@ -342,11 +342,16 @@ extern LONGEST unpack_field_as_long (struct type *type, @@ -26338,7 +28558,7 @@ index 42b4497..6f9923c 100644 extern struct value *value_at (struct type *type, CORE_ADDR addr); extern struct value *value_at_lazy (struct type *type, CORE_ADDR addr); -@@ -689,7 +694,7 @@ extern struct value *value_allocate_space_in_inferior (int); +@@ -694,7 +699,7 @@ extern struct value *value_allocate_space_in_inferior (int); extern struct value *value_of_local (const char *name, int complain); extern struct value *value_subscripted_rvalue (struct value *array, @@ -26348,7 +28568,7 @@ index 42b4497..6f9923c 100644 /* User function handler. */ diff --git a/gdb/varobj.c b/gdb/varobj.c -index 6ec87b3..b274ade 100644 +index b4b2461..3a7a884 100644 --- a/gdb/varobj.c +++ b/gdb/varobj.c @@ -26,6 +26,8 @@ @@ -26360,17 +28580,8 @@ index 6ec87b3..b274ade 100644 #include "gdb_assert.h" #include "gdb_string.h" -@@ -3495,7 +3497,7 @@ all_root_varobjs (void (*func) (struct varobj *var, void *data), void *data) - (*func) (var_root->rootvar, data); - } - } -- -+ - extern void _initialize_varobj (void); - void - _initialize_varobj (void) diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c -index 25cc2d9..6784654 100644 +index acd7b50..0929a33 100644 --- a/gdb/xcoffread.c +++ b/gdb/xcoffread.c @@ -3030,6 +3030,7 @@ static struct sym_fns xcoff_sym_fns = diff --git a/gdb-stale-related_breakpoint.patch b/gdb-stale-related_breakpoint.patch deleted file mode 100644 index 65b94c4..0000000 --- a/gdb-stale-related_breakpoint.patch +++ /dev/null @@ -1,154 +0,0 @@ -http://sourceware.org/ml/gdb-patches/2009-12/msg00364.html -Subject: [patch] related_breakpoint stale ref crash fix - -Hi, - -getting occasional random: - PASS: gdb.threads/local-watch-wrong-thread.exp: local watchpoint still triggers - PASS: gdb.threads/local-watch-wrong-thread.exp: let thread_function0 return - PASS: gdb.threads/local-watch-wrong-thread.exp: breakpoint on thread_function0's caller --PASS: gdb.threads/local-watch-wrong-thread.exp: local watchpoint automatically deleted -+ERROR: Process no longer exists -+UNRESOLVED: gdb.threads/local-watch-wrong-thread.exp: local watchpoint automatically deleted - -It is even reproducible on HEAD using "input" file below and: - valgrind ../gdb -nx type == bp_none) - return; -[...] - bpt->type = bp_none; - - xfree (bpt); -} - - -While fixing this part may be difficult I find the attached patch easy enough -fixing the IMO currently most common crash due to it. - -No regressions on {x86_64,x86_64-m32,i686}-fedora12-linux-gnu. - - -Thanks, -Jan - - -"input": -set height 0 -set width 0 -set confirm no -file ../testsuite/gdb.threads/local-watch-wrong-thread -set can-use-hw-watchpoints 1 -break main -run -break local-watch-wrong-thread.c:36 -continue -delete breakpoints -watch *myp -continue -delete breakpoints -echo MAKE watch\n -watch *myp if trigger != 0 -echo MAKE break\n -break local-watch-wrong-thread.c:60 -info break -continue -echo DELETE five\n -delete 5 -set trigger=1 -continue -set *myp=0 -break local-watch-wrong-thread.c:47 -continue - - - -2009-12-23 Jan Kratochvil - - * breakpoint.c (delete_breakpoint related_breakpoint != NULL>): - New. - ---- a/gdb/breakpoint.c -+++ b/gdb/breakpoint.c -@@ -8649,6 +8649,16 @@ delete_breakpoint (struct breakpoint *bpt) - if (bpt->type == bp_none) - return; - -+ /* At least avoid this stale reference until the reference counting of -+ breakpoints gets resolved. */ -+ if (bpt->related_breakpoint != NULL) -+ { -+ gdb_assert (bpt->related_breakpoint->related_breakpoint == bpt); -+ bpt->related_breakpoint->disposition = disp_del_at_next_stop; -+ bpt->related_breakpoint->related_breakpoint = NULL; -+ bpt->related_breakpoint = NULL; -+ } -+ - observer_notify_breakpoint_deleted (bpt->number); - - if (breakpoint_chain == bpt) - diff --git a/gdb-stale-sectindex.patch b/gdb-stale-sectindex.patch deleted file mode 100644 index 828b7eb..0000000 --- a/gdb-stale-sectindex.patch +++ /dev/null @@ -1,112 +0,0 @@ -http://sourceware.org/ml/gdb-patches/2010-02/msg00477.html -Subject: Re: [patch] Fix crash on stale addrinfo->sectindex - -On Fri, 19 Feb 2010 04:01:05 +0100, Tom Tromey wrote: -> >>>>> "Jan" == Jan Kratochvil writes: -> I think you ought to move this comment as well. -> It appears to just be hanging at the end of a block after the patch. - -Yes; forgot. - -> This is ok with that change. Thanks. - -Checked-in. - -On Fri, 19 Feb 2010 04:10:30 +0100, Tom Tromey wrote: -> Oh, by the way, I think this is reasonable for 7.1. It is -> straightforward and fixes a reported crash. If Joel agrees, please put -> it on the branch. Thanks. - -OK for the branch? - - -Thanks, -Jan - - -http://sourceware.org/ml/gdb-cvs/2010-02/msg00162.html - -### src/gdb/ChangeLog 2010/02/19 00:35:53 1.11380 -### src/gdb/ChangeLog 2010/02/19 06:19:44 1.11381 -## -1,3 +1,10 @@ -+2010-02-19 Jan Kratochvil -+ -+ * symfile.c (addr_info_make_relative): Extend comment. Move SECT to -+ a more inner block. Initialize ADDR by LOWER_OFFSET only if it was -+ found by bfd_get_section_by_name. -+ * symfile.h (struct section_addr_info) : New comment. -+ - 2010-02-19 Joel Brobecker - - * NEWS: Add new "[...] since 7.1" section. Rename the "[...] since ---- src/gdb/symfile.c 2010/02/18 19:17:00 1.272 -+++ src/gdb/symfile.c 2010/02/19 06:19:45 1.273 -@@ -562,13 +562,13 @@ - } - - /* Relativize absolute addresses in ADDRS into offsets based on ABFD. Fill-in -- also SECTINDEXes there. */ -+ also SECTINDEXes specific to ABFD there. This function can be used to -+ rebase ADDRS to start referencing different BFD than before. */ - - void - addr_info_make_relative (struct section_addr_info *addrs, bfd *abfd) - { - asection *lower_sect; -- asection *sect; - CORE_ADDR lower_offset; - int i; - -@@ -597,25 +597,29 @@ - - for (i = 0; i < addrs->num_sections && addrs->other[i].name; i++) - { -- if (addrs->other[i].addr != 0) -+ asection *sect = bfd_get_section_by_name (abfd, addrs->other[i].name); -+ -+ if (sect) - { -- sect = bfd_get_section_by_name (abfd, addrs->other[i].name); -- if (sect) -+ /* This is the index used by BFD. */ -+ addrs->other[i].sectindex = sect->index; -+ -+ if (addrs->other[i].addr != 0) - { - addrs->other[i].addr -= bfd_section_vma (abfd, sect); - lower_offset = addrs->other[i].addr; -- /* This is the index used by BFD. */ -- addrs->other[i].sectindex = sect->index; - } - else -- { -- warning (_("section %s not found in %s"), addrs->other[i].name, -- bfd_get_filename (abfd)); -- addrs->other[i].addr = 0; -- } -+ addrs->other[i].addr = lower_offset; - } - else -- addrs->other[i].addr = lower_offset; -+ { -+ warning (_("section %s not found in %s"), addrs->other[i].name, -+ bfd_get_filename (abfd)); -+ addrs->other[i].addr = 0; -+ -+ /* SECTINDEX is invalid if ADDR is zero. */ -+ } - } - } - ---- src/gdb/symfile.h 2010/02/03 14:13:16 1.64 -+++ src/gdb/symfile.h 2010/02/19 06:19:45 1.65 -@@ -80,6 +80,8 @@ - { - CORE_ADDR addr; - char *name; -+ -+ /* SECTINDEX must be valid for associated BFD if ADDR is not zero. */ - int sectindex; - } other[1]; - }; - diff --git a/gdb.spec b/gdb.spec index a9867a6..0d8001c 100644 --- a/gdb.spec +++ b/gdb.spec @@ -32,11 +32,11 @@ Name: gdb%{?_with_debug:-debug} # Set version to contents of gdb/version.in. # NOTE: the FSF gdb versions are numbered N.M for official releases, like 6.3 # and, since January 2005, X.Y.Z.date for daily snapshots, like 6.3.50.20050112 # (daily snapshot from mailine), or 6.3.0.20040112 (head of the release branch). -Version: 7.0.50.20100203 +Version: 7.0.90.20100306 # The release always contains a leading reserved number, start it at 1. # `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing. -Release: 17%{?_with_upstream:.upstream}%{dist} +Release: 18%{?_with_upstream:.upstream}%{dist} License: GPLv3+ Group: Development/Debuggers @@ -405,9 +405,6 @@ Patch335: gdb-rhel5-compat.patch # Fix regression by python on ia64 due to stale current frame. Patch397: gdb-follow-child-stale-parent.patch -# Fix related_breakpoint stale ref crash. -Patch400: gdb-stale-related_breakpoint.patch - # Workaround ccache making lineno non-zero for command-line definitions. Patch403: gdb-ccache-workaround.patch @@ -430,9 +427,6 @@ Patch412: gdb-unused-revert.patch # Fix i386+x86_64 rwatch+awatch before run, regression against 6.8 (BZ 541866). Patch417: gdb-bz541866-rwatch-before-run.patch -# Fix crash on stale addrinfo->sectindex (more sensitive due to the PIE patch). -Patch421: gdb-stale-sectindex.patch - # Remove false gdb_assert on $sp underflow. Patch422: gdb-infcall-sp-underflow.patch @@ -678,7 +672,6 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c %patch391 -p1 %patch392 -p1 %patch397 -p1 -%patch400 -p1 %patch403 -p1 %patch404 -p1 %patch405 -p1 @@ -689,7 +682,6 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c %patch408 -p1 %patch412 -p1 %patch417 -p1 -%patch421 -p1 %patch422 -p1 %patch425 -p1 @@ -699,7 +691,7 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c # Patch415: gdb-6.6-buildid-locate-core-as-arg.patch # Currently disabled for RHEL as it is a new experimental feature not present # in FSF GDB and possibly affecting new user scripts. -%if 0%{!?rhel:1} +%if 0%{?rhel:1} %patch415 -p1 -R %endif %if 0%{!?el5:1} @@ -1024,6 +1016,9 @@ fi %endif %changelog +* Sun Mar 7 2010 Jan Kratochvil - 7.0.90.20100306-18.fc13 +- archer-jankratochvil-fedora13 commit: 59c35a31f0981a0f0b884b32c91ae6325b2126cd + * Sun Feb 28 2010 Jan Kratochvil - 7.0.50.20100203-17.fc13 - Fix false warning: section .gnu.liblist not found in ... - Fix crash on stale addrinfo->sectindex (more sensitive due to the PIE patch). diff --git a/sources b/sources index 85caab6..f493332 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -179d5e54575f7a4d8dfbe423e1ee6678 gdb-7.0.50.20100203.tar.bz2 +9d52988c5b2a2085e0ee5df89393e5a0 gdb-7.0.90.20100306.tar.bz2 04e5c4b1b9e633422cc48990fe61958d libstdc++-v3-python-r155978.tar.bz2