gdb.trace: Fix unavailable-dwarf-piece.exp on big endian targets
authorMarcin Kościelnicki <koriakin@0x04.net>
Sat, 23 Jan 2016 12:17:34 +0000 (13:17 +0100)
committerMarcin Kościelnicki <koriakin@0x04.net>
Sat, 23 Jan 2016 13:54:59 +0000 (14:54 +0100)
The test constructs fake DWARF info for a C structure involving bitfields.
DWARF bitfields are always counted from LSB, while the order in which
bitfields are allocated in a C struct depends on the target endianness -
thus the generated DWARF marks different bitfields as unavailable when
target is big endian.  Accordingly, we need different expected outputs.

Tested on s390 and s390x, no regression on x86_64.

gdb/testsuite/ChangeLog:

* gdb.trace/unavailable-dwarf-piece.exp: Fix bitfield handling on big
endian targets.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.trace/unavailable-dwarf-piece.exp

index 8f7dc6d01eb4094ca5b22e6b6d790776cf4a4dd0..8ee2efa8054deb8a4ac7013ac811f159c8417886 100644 (file)
@@ -1,3 +1,8 @@
+2016-01-23  Marcin Kościelnicki  <koriakin@0x04.net>
+
+       * gdb.trace/unavailable-dwarf-piece.exp: Fix bitfield handling on big
+       endian targets.
+
 2016-01-22  Jan Kratochvil  <jan.kratochvil@redhat.com>
            Pedro Alves  <palves@redhat.com>
 
index 60820ddacafa21b67f2edcefb1447b051b56e5e4..b5052d114e5380da11ea8e75fe07a230b13b3814 100644 (file)
@@ -325,10 +325,24 @@ with_test_prefix "tracing bar" {
     gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*"
     gdb_test_no_output "tstop"
 
+    set endian ""
+    gdb_test_multiple "show endian" "show endian" {
+       -re ".* (big|little) endian.*$gdb_prompt $" {
+           set endian $expect_out(1,string)
+           pass "endianness: $endian"
+       }
+    }
+
     gdb_test "tfind 0" "Found trace frame 0, tracepoint .*"
-    gdb_test "p/d x" "\\\$${decimal} = {a = 0, b = <unavailable>, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0, i = 0, j = 0}"
-    gdb_test "p/d y" "\\\$${decimal} = {a = 0, b = 0, c = 0, d = 0, e = <unavailable>, f = 0, g = 0, h = 0, i = 0, j = 0}"
-    gdb_test "p/d z" "\\\$${decimal} = {a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0, i = <unavailable>, j = 0}"
+    if { $endian == "little" } {
+        gdb_test "p/d x" "\\\$${decimal} = {a = 0, b = <unavailable>, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0, i = 0, j = 0}"
+        gdb_test "p/d y" "\\\$${decimal} = {a = 0, b = 0, c = 0, d = 0, e = <unavailable>, f = 0, g = 0, h = 0, i = 0, j = 0}"
+        gdb_test "p/d z" "\\\$${decimal} = {a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0, i = <unavailable>, j = 0}"
+    } else {
+        gdb_test "p/d x" "\\\$${decimal} = {a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0, i = <unavailable>, j = 0}"
+        gdb_test "p/d y" "\\\$${decimal} = {a = 0, b = 0, c = 0, d = 0, e = 0, f = <unavailable>, g = 0, h = 0, i = 0, j = 0}"
+        gdb_test "p/d z" "\\\$${decimal} = {a = 0, b = <unavailable>, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0, i = 0, j = 0}"
+    }
 
     gdb_test "tfind none" "No longer looking at any trace frame.*"
 }
This page took 0.033889 seconds and 4 git commands to generate.