Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [commit 2/2] testsuite: code_elim.exp: Fix false FAIL
@ 2012-06-03 17:17 Jan Kratochvil
  2012-06-03 17:29 ` Andreas Schwab
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Jan Kratochvil @ 2012-06-03 17:17 UTC (permalink / raw)
  To: gdb-patches

Hi,

with Fedora 18 x86_64 (Rawhide) there is a false FAIl since:
2167931cf70f91206efb8b01e848a55d82a347ce is the first bad commit
Author: Tom Tromey <tromey@redhat.com>
Date:   Fri May 18 15:31:39 2012 +0000
http://sourceware.org/bugzilla/show_bug.cgi?id=13907

 print &my_global_symbol
-$1 = (int *) 0x804a004
-(gdb) PASS: gdb.base/code_elim.exp: get address of my_global_symbol
+$1 = (int *) 0x804a004 <completed.5732>
+(gdb) FAIL: gdb.base/code_elim.exp: get address of my_global_symbol

Nothing really changed, just GDB now prints <completed.5732> and the testcase
expects either none or <my_global_symbol> suffix.

This is because the two symbol files (their sections .data/.bss) have
overlapped so GDB chooses randomly which symbol to display.  And since
Fedora 18 GCC puts there that "completed.5732" symbol.

This may be because add-symbol-file FILE ADDR relocates to ADDR on the .text
section and leaves other sections at their original place, which is IMO a bit
unexpected; it is a FAQ people expect more ADDR to be relocation displacement
(and not relative to .text and not limited to .text).  But this is really
outside of the scope of this testcase false FAIL.

Checked in.


Thanks,
Jan


http://sourceware.org/ml/gdb-cvs/2012-06/msg00012.html

--- src/gdb/testsuite/ChangeLog	2012/06/03 17:06:04	1.3210
+++ src/gdb/testsuite/ChangeLog	2012/06/03 17:10:28	1.3211
@@ -11,6 +11,16 @@
 	(get address of my_global_func, get address of main): Wrap them to
 	'order1' and 'order2'.
 
+	* gdb.base/code_elim.exp
+	(add-symbol-file ${testfile1} 0x100000)
+	(add-symbol-file ${testfile2} 0x200000): Wrap them to 'order1' and
+	'order2'.
+	(order1: add-symbol-file ${testfile1} 0x100000)
+	(order1: add-symbol-file ${testfile2} 0x200000)
+	(order2: add-symbol-file ${testfile2} 0x200000)
+	(order2: add-symbol-file ${testfile1} 0x100000): Add -s .data and -s
+	.bss as appropriate.
+
 2012-05-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
 	* gdb.server/solib-list-lib.c: New file.
--- src/gdb/testsuite/gdb.base/code_elim.exp	2012/06/03 17:06:04	1.5
+++ src/gdb/testsuite/gdb.base/code_elim.exp	2012/06/03 17:10:28	1.6
@@ -128,19 +128,19 @@
 gdb_exit
 gdb_start
 
-gdb_test "add-symbol-file ${binfile1} 0x100000" \
-	"Reading symbols from .*${testfile1}\\.\\.\\.done\\." \
-	"add-symbol-file ${testfile1} 0x100000" \
-	"add symbol table from file \".*${testfile1}\" at\[ \t\r\n\]+\.text_addr = 0x100000\[\r\n\]+\\(y or n\\) " \
-	"y"
-
-gdb_test "add-symbol-file ${binfile2} 0x200000" \
-	"Reading symbols from .*${testfile2}\\.\\.\\.done\\." \
-	"add-symbol-file ${testfile2} 0x200000" \
-	"add symbol table from file \".*${testfile2}\" at\[ \t\r\n\]+\.text_addr = 0x200000\[\r\n\]+\\(y or n\\) " \
-	"y"
-
 with_test_prefix "order1" {
+    gdb_test "add-symbol-file ${binfile1} 0x100000 -s .bss 0x120000" \
+	    "Reading symbols from .*${testfile1}\\.\\.\\.done\\." \
+	    "add-symbol-file ${testfile1} 0x100000" \
+	    "add symbol table from file \".*${testfile1}\" at.*\\(y or n\\) " \
+	    "y"
+
+    gdb_test "add-symbol-file ${binfile2} 0x200000 -s .data 0x210000 -s .bss 0x220000" \
+	    "Reading symbols from .*${testfile2}\\.\\.\\.done\\." \
+	    "add-symbol-file ${testfile2} 0x200000" \
+	    "add symbol table from file \".*${testfile2}\" at.*\\(y or n\\) " \
+	    "y"
+
     not_null_var_address my_global_symbol
     not_null_var_address my_static_symbol
     not_null_var_address my_global_func
@@ -152,19 +152,19 @@
 gdb_exit
 gdb_start
 
-gdb_test "add-symbol-file ${binfile2} 0x200000" \
-	"Reading symbols from .*${testfile2}\\.\\.\\.done\\." \
-	"add-symbol-file ${testfile2} 0x200000" \
-	"add symbol table from file \".*${testfile2}\" at\[ \t\r\n\]+\.text_addr = 0x200000\[\r\n\]+\\(y or n\\) " \
-	"y"
-
-gdb_test "add-symbol-file ${binfile1} 0x100000" \
-	"Reading symbols from .*${testfile1}\\.\\.\\.done\\." \
-	"add-symbol-file ${testfile1} 0x100000" \
-	"add symbol table from file \".*${testfile1}\" at\[ \t\r\n\]+\.text_addr = 0x100000\[\r\n\]+\\(y or n\\) " \
-	"y"
-
 with_test_prefix "order2" {
+    gdb_test "add-symbol-file ${binfile2} 0x200000 -s .data 0x210000 -s .bss 0x220000" \
+	    "Reading symbols from .*${testfile2}\\.\\.\\.done\\." \
+	    "add-symbol-file ${testfile2} 0x200000" \
+	    "add symbol table from file \".*${testfile2}\" at.*\\(y or n\\) " \
+	    "y"
+
+    gdb_test "add-symbol-file ${binfile1} 0x100000 -s .bss 0x120000" \
+	    "Reading symbols from .*${testfile1}\\.\\.\\.done\\." \
+	    "add-symbol-file ${testfile1} 0x100000" \
+	    "add symbol table from file \".*${testfile1}\" at.*\\(y or n\\) " \
+	    "y"
+
     not_null_var_address my_global_symbol
     not_null_var_address my_static_symbol
     not_null_var_address my_global_func


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

* Re: [commit 2/2] testsuite: code_elim.exp: Fix false FAIL
  2012-06-03 17:17 [commit 2/2] testsuite: code_elim.exp: Fix false FAIL Jan Kratochvil
@ 2012-06-03 17:29 ` Andreas Schwab
  2012-06-03 17:37   ` Jan Kratochvil
  2012-06-04  2:16 ` Yao Qi
  2012-07-19  7:40 ` Andreas Schwab
  2 siblings, 1 reply; 5+ messages in thread
From: Andreas Schwab @ 2012-06-03 17:29 UTC (permalink / raw)
  To: Jan Kratochvil; +Cc: gdb-patches

Jan Kratochvil <jan.kratochvil@redhat.com> writes:

> +	(order2: add-symbol-file ${testfile1} 0x100000): Add -s .data and -s
> +	.bss as appropriate.

What about .sdata or .sbss (or whatever other section the compiler
chooses)?

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


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

* Re: [commit 2/2] testsuite: code_elim.exp: Fix false FAIL
  2012-06-03 17:29 ` Andreas Schwab
@ 2012-06-03 17:37   ` Jan Kratochvil
  0 siblings, 0 replies; 5+ messages in thread
From: Jan Kratochvil @ 2012-06-03 17:37 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: gdb-patches

On Sun, 03 Jun 2012 19:29:15 +0200, Andreas Schwab wrote:
> Jan Kratochvil <jan.kratochvil@redhat.com> writes:
> > +	(order2: add-symbol-file ${testfile1} 0x100000): Add -s .data and -s
> > +	.bss as appropriate.
> 
> What about .sdata or .sbss (or whatever other section the compiler
> chooses)?

As I stated I do not know how to easily do a real fix of this testcase so
I just made non-regressing improvement for the platforms I regression test.

IMO a real fix is to implement add-symbol-file to (also) accept full
displacement but this seems to be outside of the scope of this testfile/fixup
and I have too many open other work to get into another task.

If you state non-existing sections GDB will make a warning in such case.
(Sure the testcase can ignore such warning.)


Thanks,
Jan


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

* Re: [commit 2/2] testsuite: code_elim.exp: Fix false FAIL
  2012-06-03 17:17 [commit 2/2] testsuite: code_elim.exp: Fix false FAIL Jan Kratochvil
  2012-06-03 17:29 ` Andreas Schwab
@ 2012-06-04  2:16 ` Yao Qi
  2012-07-19  7:40 ` Andreas Schwab
  2 siblings, 0 replies; 5+ messages in thread
From: Yao Qi @ 2012-06-04  2:16 UTC (permalink / raw)
  To: Jan Kratochvil; +Cc: gdb-patches

On 06/04/2012 01:17 AM, Jan Kratochvil wrote:
>  with_test_prefix "order1" {
> +    gdb_test "add-symbol-file ${binfile1} 0x100000 -s .bss 0x120000" \
> +	    "Reading symbols from .*${testfile1}\\.\\.\\.done\\." \
> +	    "add-symbol-file ${testfile1} 0x100000" \
> +	    "add symbol table from file \".*${testfile1}\" at.*\\(y or n\\) " \
> +	    "y"
> +
> +    gdb_test "add-symbol-file ${binfile2} 0x200000 -s .data 0x210000 -s .bss 0x220000" \
> +	    "Reading symbols from .*${testfile2}\\.\\.\\.done\\." \
> +	    "add-symbol-file ${testfile2} 0x200000" \
> +	    "add symbol table from file \".*${testfile2}\" at.*\\(y or n\\) " \
> +	    "y"
Hi Jan,
We should first check whether '.bss' exists (by "maint info sections")
and then run this part conditionally.  We don't have '.bss' on some
ports, such as tic6x-elf.

-- 
Yao (齐尧)


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

* Re: [commit 2/2] testsuite: code_elim.exp: Fix false FAIL
  2012-06-03 17:17 [commit 2/2] testsuite: code_elim.exp: Fix false FAIL Jan Kratochvil
  2012-06-03 17:29 ` Andreas Schwab
  2012-06-04  2:16 ` Yao Qi
@ 2012-07-19  7:40 ` Andreas Schwab
  2 siblings, 0 replies; 5+ messages in thread
From: Andreas Schwab @ 2012-07-19  7:40 UTC (permalink / raw)
  To: Jan Kratochvil; +Cc: gdb-patches

Jan Kratochvil <jan.kratochvil@redhat.com> writes:

> +    gdb_test "add-symbol-file ${binfile2} 0x200000 -s .data 0x210000 -s .bss 0x220000" \
> +	    "Reading symbols from .*${testfile2}\\.\\.\\.done\\." \
> +	    "add-symbol-file ${testfile2} 0x200000" \
> +	    "add symbol table from file \".*${testfile2}\" at.*\\(y or n\\) " \
> +	    "y"
> +

add-symbol-file /home/abuild/rpmbuild/BUILD/gdb-7.4.91/gdb/testsuite/gdb.base/code_elim2 0x200000 -s .data 0x210000 -s .bss 0x220000
add symbol table from file "/home/abuild/rpmbuild/BUILD/gdb-7.4.91/gdb/testsuite/gdb.base/code_elim2" at
	.text_addr = 0x200000
	.data_addr = 0x210000
	.bss_addr = 0x220000
(y or n) y
Reading symbols from /home/abuild/rpmbuild/BUILD/gdb-7.4.91/gdb/testsuite/gdb.base/code_elim2...warning: section .data not found in /home/abuild/rpmbuild/BUILD/gdb-7.4.91/gdb/testsuite/gdb.base/code_elim2
done.
(gdb) FAIL: gdb.base/code_elim.exp: order1: add-symbol-file code_elim2 0x200000
print &my_global_symbol

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


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

end of thread, other threads:[~2012-07-19  7:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-03 17:17 [commit 2/2] testsuite: code_elim.exp: Fix false FAIL Jan Kratochvil
2012-06-03 17:29 ` Andreas Schwab
2012-06-03 17:37   ` Jan Kratochvil
2012-06-04  2:16 ` Yao Qi
2012-07-19  7:40 ` Andreas Schwab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox