This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] testsuite: gdb.dwarf2/pr11465.exp: Fix s390x


Hi,

on s390x-linux-gnu it now fails:
	(gdb) p N::c.C
	$1 = {void (N::C * const @mode32, void (* @mode32)(N::C))} 0
	(gdb) FAIL: gdb.dwarf2/pr11465.exp: p N::c.C

because DW_TAG_pointer_type there had DW_AT_byte_size == 4.

expected:
	(gdb) p N::c.C
	$1 = {void (N::C * const, void (*)(N::C))} 0
	(gdb) PASS: gdb.dwarf2/pr11465.exp: p N::c.C


Used is_ilp32_target and not is_lp64_target as this way it may work even for
MS-Windows LLP64 (not tested).

It would be probably more correct to also use 8 for the DWARF pointer size but
it currently is OK for GDB.

I will check it in in some days.


Thanks,
Jan


gdb/testsuite/
2010-10-02  Jan Kratochvil  <jan.kratochvil@redhat.com>

	Fix s390x compatibility.
	* gdb.dwarf2/pr11465.S (DW_TAG_pointer_type): Use PTRBITS.  Twice.
	* gdb.dwarf2/pr11465.exp: Set ptrbits, use it for -DPTRBITS.

--- a/gdb/testsuite/gdb.dwarf2/pr11465.S
+++ b/gdb/testsuite/gdb.dwarf2/pr11465.S
@@ -88,14 +92,14 @@ die77:	.uleb128 0x9		/* DW_TAG_formal_parameter */
 	.byte	0x0
 	.byte	0x0
 die7e:	.uleb128 0xa		/* DW_TAG_pointer_type */
-	.byte	0x4		/* DW_AT_byte_size */
+	.byte	PTRBITS / 8	/* DW_AT_byte_size */
 	.long	die84-d		/* DW_AT_type */
 die84:	.uleb128 0xb		/* DW_TAG_subroutine_type */
 die89:	.uleb128 0x9		/* DW_TAG_formal_parameter */
 	.long	die5e-d		/* DW_AT_type */
 	.byte	0x0
 die8f:	.uleb128 0xa		/* DW_TAG_pointer_type */
-	.byte	0x4		/* DW_AT_byte_size */
+	.byte	PTRBITS / 8	/* DW_AT_byte_size */
 	.long	die5e-d		/* DW_AT_type */
 die95:	.uleb128 0xc		/* DW_TAG_subprogram */
 	.long	die6a-d		/* DW_AT_specification */
--- a/gdb/testsuite/gdb.dwarf2/pr11465.exp
+++ b/gdb/testsuite/gdb.dwarf2/pr11465.exp
@@ -29,8 +29,14 @@ set srcfile "$testfile.S"
 set executable "$testfile.x"
 set binfile [file join $objdir $subdir $executable]
 
+if [is_ilp32_target] {
+    set ptrbits 32
+} else {
+    set ptrbits 64
+}
+
 if  { [gdb_compile [file join $srcdir $subdir $srcfile] \
-	   $binfile object {}] != "" } {
+	   $binfile object [list additional_flags=-DPTRBITS=$ptrbits]] != "" } {
     return -1
 }
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]