public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM]  archer-jankratochvil-fortran-module: Fix library-module.exp - fix RH Bug 497567.
@ 2009-05-05 16:43 jkratoch
  0 siblings, 0 replies; only message in thread
From: jkratoch @ 2009-05-05 16:43 UTC (permalink / raw)
  To: archer-commits

The branch, archer-jankratochvil-fortran-module has been updated
       via  0dd1802e6766490129ac7e2c33a7d72d5c855d82 (commit)
       via  851f11ea79572e029bb701d92b6597295bdc04d3 (commit)
       via  1f8404f8051a6c0c60833af521aab857083d1c63 (commit)
       via  8c9cabb8019291e9ed0f293ac2a460fdc04231f8 (commit)
      from  3ba6611c46d04dc9ab81a86c836c2f9d68a42e21 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit 0dd1802e6766490129ac7e2c33a7d72d5c855d82
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Tue May 5 18:42:34 2009 +0200

    Fix library-module.exp - fix RH Bug 497567.

commit 851f11ea79572e029bb701d92b6597295bdc04d3
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Tue May 5 18:00:09 2009 +0200

    Fortran module library testcase improvement; breaks GDB now.

commit 1f8404f8051a6c0c60833af521aab857083d1c63
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Tue May 5 17:49:10 2009 +0200

    Fixup testcase to be more safe; no real change involved.

commit 8c9cabb8019291e9ed0f293ac2a460fdc04231f8
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Tue May 5 13:13:35 2009 +0200

    Simplify the patch - remove no longer used change.

-----------------------------------------------------------------------

Summary of changes:
 gdb/dwarf2read.c                                  |   26 +++++++++++---------
 gdb/symtab.c                                      |    5 ----
 gdb/testsuite/gdb.fortran/library-module-lib.f90  |    7 +++++-
 gdb/testsuite/gdb.fortran/library-module-main.f90 |    6 +++-
 gdb/testsuite/gdb.fortran/library-module.exp      |   12 +++++++--
 5 files changed, 33 insertions(+), 23 deletions(-)

First 500 lines of diff:
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 375dda1..8910a42 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -4956,13 +4956,15 @@ read_module_type (struct die_info *die, struct dwarf2_cu *cu)
   save_global_symbols = global_symbols;
   global_symbols = NULL;
   save_list_in_scope = cu->list_in_scope;
-  cu->list_in_scope = &global_symbols;
 
   /* Process the child DIEs.  */
 
   child_die = die->child;
   while (child_die && child_die->tag)
     {
+      /* Any DW_TAG_subprogram will reset LIST_IN_SCOPE to LOCAL_SYMBOLS.  */
+      cu->list_in_scope = &global_symbols;
+
       process_die (child_die, cu);
       child_die = sibling_die (child_die);
     }
@@ -7899,6 +7901,17 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
 	      dwarf2_const_value (attr, sym, cu);
 	      attr2 = dwarf2_attr (die, DW_AT_external, cu);
 	      if (attr2 && (DW_UNSND (attr2) != 0))
+		add_symbol_to_list (sym, &global_symbols);
+	      else
+		add_symbol_to_list (sym, cu->list_in_scope);
+	      break;
+	    }
+	  attr = dwarf2_attr (die, DW_AT_location, cu);
+	  if (attr)
+	    {
+	      var_decode_location (attr, sym, cu);
+	      attr2 = dwarf2_attr (die, DW_AT_external, cu);
+	      if (attr2 && (DW_UNSND (attr2) != 0))
 		{
 		  /* Workaround gfortran bug - see dwarf2_linkage_name.  */
 		  if (cu->language == language_fortran && die->parent
@@ -7916,17 +7929,6 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
 		}
 	      else
 		add_symbol_to_list (sym, cu->list_in_scope);
-	      break;
-	    }
-	  attr = dwarf2_attr (die, DW_AT_location, cu);
-	  if (attr)
-	    {
-	      var_decode_location (attr, sym, cu);
-	      attr2 = dwarf2_attr (die, DW_AT_external, cu);
-	      if (attr2 && (DW_UNSND (attr2) != 0))
-		add_symbol_to_list (sym, &global_symbols);
-	      else
-		add_symbol_to_list (sym, cu->list_in_scope);
 	    }
 	  else
 	    {
diff --git a/gdb/symtab.c b/gdb/symtab.c
index a7d452c..95ba97d 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -1694,11 +1694,6 @@ symbol_matches_domain (enum language symbol_language,
 	  && symbol_domain == STRUCT_DOMAIN)
 	return 1;
     }
-  if (symbol_language == language_fortran)
-    {
-      if (domain == STRUCT_DOMAIN && symbol_domain == MODULE_DOMAIN)
-	return 1;
-    }
   /* For all other languages, strict match is required.  */
   return (symbol_domain == domain);
 }
diff --git a/gdb/testsuite/gdb.fortran/library-module-lib.f90 b/gdb/testsuite/gdb.fortran/library-module-lib.f90
index 3727af6..aff2e2b 100644
--- a/gdb/testsuite/gdb.fortran/library-module-lib.f90
+++ b/gdb/testsuite/gdb.fortran/library-module-lib.f90
@@ -14,5 +14,10 @@
 ! along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 module lib
-        integer :: i = 1
+        integer :: var_i = 1
+contains
+        subroutine lib_func
+        if (var_i .ne. 1) call abort
+        var_i = 2
+        end subroutine lib_func
 end module lib
diff --git a/gdb/testsuite/gdb.fortran/library-module-main.f90 b/gdb/testsuite/gdb.fortran/library-module-main.f90
index 26d8835..729ac61 100644
--- a/gdb/testsuite/gdb.fortran/library-module-main.f90
+++ b/gdb/testsuite/gdb.fortran/library-module-main.f90
@@ -14,6 +14,8 @@
 ! along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
         use lib
-        if (i .ne. 1) call abort
-        i = i                     ! i-is-1
+        if (var_i .ne. 1) call abort
+	call lib_func
+        if (var_i .ne. 2) call abort
+        var_i = var_i                 ! i-is-2
 end
diff --git a/gdb/testsuite/gdb.fortran/library-module.exp b/gdb/testsuite/gdb.fortran/library-module.exp
index 88dae11..2d1bf4d 100644
--- a/gdb/testsuite/gdb.fortran/library-module.exp
+++ b/gdb/testsuite/gdb.fortran/library-module.exp
@@ -19,6 +19,12 @@ set srclibfile ${testfile}-lib.f90
 set libfile ${testfile}-lib.so
 set binfile ${testfile}
 
+# Required for -fPIC by gdb_compile_shlib.
+if [get_compiler_info not-used] {
+   warning "Could not get compiler info"
+   return -1
+}
+
 if  { [gdb_compile_shlib "${srcdir}/${subdir}/${srclibfile}" $srcdir/$subdir/$libfile {debug f77}] != "" } {
     untested "Couldn't compile ${srclibfile}"
     return -1
@@ -40,6 +46,6 @@ if ![runto MAIN__] then {
     continue
 }
 
-gdb_breakpoint [gdb_get_line_number "i-is-1"]
-gdb_continue_to_breakpoint "is-is-1" ".*i-is-1.*"
-gdb_test "print i" " = 1" "print i value 1"
+gdb_breakpoint [gdb_get_line_number "i-is-2"]
+gdb_continue_to_breakpoint "i-is-2" ".*i-is-2.*"
+gdb_test "print var_i" " = 2"


hooks/post-receive
--
Repository for Project Archer.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-05-05 16:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-05 16:43 [SCM] archer-jankratochvil-fortran-module: Fix library-module.exp - fix RH Bug 497567 jkratoch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).