public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH][gdb/testsuite] Add KFAILs for PR symtab/24549
@ 2021-01-29 15:47 Tom de Vries
  2021-02-05 15:25 ` Tom Tromey
  0 siblings, 1 reply; 9+ messages in thread
From: Tom de Vries @ 2021-01-29 15:47 UTC (permalink / raw)
  To: gdb-patches

Hi,

When an executable contains an index such as a .gdb_index or .debug_names
section, gdb ignores the DW_AT_subprogram attribute.

This problem has been filed as PR symtab/24549.

Add KFAILs for this PR in test-cases gdb.dwarf2/main-subprogram.exp and
gdb.fortran/mixed-lang-stack.exp.

Tested on x86_64-linux.

Any comments?

Thanks,
- Tom

[gdb/testsuite] Add KFAILs for PR symtab/24549

gdb/testsuite/ChangeLog:

2021-01-29  Tom de Vries  <tdevries@suse.de>

	* gdb.dwarf2/main-subprogram.exp: Add KFAIL for PR symtab/24549.
	* gdb.fortran/mixed-lang-stack.exp: Same.

---
 gdb/testsuite/gdb.dwarf2/main-subprogram.exp   | 14 +++++++++++++-
 gdb/testsuite/gdb.fortran/mixed-lang-stack.exp | 21 +++++++++++++++++++--
 2 files changed, 32 insertions(+), 3 deletions(-)

diff --git a/gdb/testsuite/gdb.dwarf2/main-subprogram.exp b/gdb/testsuite/gdb.dwarf2/main-subprogram.exp
index ad0113e404d..c618a40f2fb 100644
--- a/gdb/testsuite/gdb.dwarf2/main-subprogram.exp
+++ b/gdb/testsuite/gdb.dwarf2/main-subprogram.exp
@@ -55,6 +55,8 @@ if {[prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
+set have_index [exec_has_index_section $binfile]
+
 # Test that the "start" command stops in the "mymain" function.
 # This should happen because we used DW_AT_main_subprogram to tell gdb
 # that this was the real "main".
@@ -64,4 +66,14 @@ if {[gdb_start_cmd] < 0} {
     return -1
 }
 
-gdb_test "" "Temporary breakpoint .* mymain.*" "stopped at mymain"
+gdb_test_multiple "" "stopped at mymain" {
+    -re -wrap "Temporary breakpoint .* mymain.*" {
+	pass $gdb_test_name
+    }
+    -re -wrap "Temporary breakpoint .* main.*" {
+	if { $have_index } {
+	    setup_kfail "gdb/24549" *-*-*
+	}
+	fail $gdb_test_name
+    }
+}
diff --git a/gdb/testsuite/gdb.fortran/mixed-lang-stack.exp b/gdb/testsuite/gdb.fortran/mixed-lang-stack.exp
index 411fd784dc0..6a249e60f2f 100644
--- a/gdb/testsuite/gdb.fortran/mixed-lang-stack.exp
+++ b/gdb/testsuite/gdb.fortran/mixed-lang-stack.exp
@@ -35,11 +35,13 @@ if {[prepare_for_testing_full "failed to prepare" \
     return -1
 }
 
+set have_index [exec_has_index_section $binfile]
+
 # Runs the test program and examins the stack.  LANG is a string, the
 # value to pass to GDB's 'set language ...' command.
 proc run_tests { lang } {
     with_test_prefix "lang=${lang}" {
-	global binfile hex
+	global binfile hex have_index
 
 	clean_restart ${binfile}
 
@@ -74,7 +76,22 @@ proc run_tests { lang } {
 		 "#7\\s+$hex in mixed_func_1b \\($1b_args\\) at \[^\r\n\]+" \
 		 "#8\\s+$hex in mixed_func_1a \\(\\) at \[^\r\n\]+" \
 		 "#9\\s+$hex in mixed_stack_main \\(\\) at \[^\r\n\]+" ]
-	gdb_test "bt -frame-arguments all" $bt_stack
+	set main_args "argc=1, argv=${hex}( \[^\r\n\]+)?"
+	set bt_stack_kfail \
+	    [multi_line \
+		 $bt_stack \
+		 "#10\\s+$hex in main \\($main_args\\) at \[^\r\n\]+"]
+	gdb_test_multiple "bt -frame-arguments all" "" {
+	    -re -wrap $bt_stack {
+		pass $gdb_test_name
+	    }
+	    -re -wrap $bt_stack_kfail {
+		if { $have_index } {
+		    setup_kfail "gdb/24549" *-*-*
+		}
+		fail $gdb_test_name
+	    }
+	}
 
 	# Check the language for frame #0.
 	gdb_test "info frame" "source language fortran\..*" \

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-03-02 15:08 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-29 15:47 [PATCH][gdb/testsuite] Add KFAILs for PR symtab/24549 Tom de Vries
2021-02-05 15:25 ` Tom Tromey
2021-02-05 17:28   ` Tom de Vries
2021-02-08 11:46     ` [RFC][gdb/symtab] Add DW_IDX_GNU_main_subprogram Tom de Vries
2021-02-24 20:46       ` Tom Tromey
2021-02-24 20:51         ` Tom Tromey
2021-03-02  1:44       ` Tom Tromey
2021-03-02  6:49         ` Tom de Vries
2021-03-02 15:01           ` Tom Tromey

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).