* gdb.trace/unavailable.exp (gdb_collect_globals_test): Update
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.trace / unavailable.exp
index 199e2198e8fd1c682f3f71af3a337ee924e63568..60bb41b7fc7b417d0c7055ef2deeafaa325a1e7e 100644 (file)
@@ -136,7 +136,7 @@ proc test_maybe_regvar_display { var } {
 # Test procs
 #
 
-proc gdb_collect_args_test {} { with_test_prefix " unavailable arguments:" {
+proc gdb_collect_args_test {} { with_test_prefix "unavailable arguments" {
     global cr
     global gdb_prompt
 
@@ -203,7 +203,7 @@ proc gdb_collect_args_test {} { with_test_prefix " unavailable arguments:" {
        "cease trace debugging"
 }}
 
-proc gdb_collect_locals_test { func msg } { with_test_prefix " unavailable locals: $msg:" {
+proc gdb_collect_locals_test { func msg } { with_test_prefix "unavailable locals: $msg" {
     global cr
     global gdb_prompt
 
@@ -254,7 +254,7 @@ proc gdb_collect_locals_test { func msg } { with_test_prefix " unavailable local
        "cease trace debugging"
 }}
 
-proc gdb_unavailable_registers_test { } { with_test_prefix " unavailable registers:" {
+proc gdb_unavailable_registers_test { } { with_test_prefix "unavailable registers" {
     global gdb_prompt
     global spreg
     global pcreg
@@ -305,7 +305,40 @@ proc gdb_unavailable_registers_test { } { with_test_prefix " unavailable registe
     gdb_test "tfind none" "#0  end .*" "cease trace debugging"
 }}
 
-proc gdb_collect_globals_test { } { with_test_prefix " collect globals:" {
+proc gdb_unavailable_floats { } {
+    global gdb_prompt
+
+    with_test_prefix "unavailable floats" {
+       prepare_for_trace_test
+
+       # We'll simply re-use the globals_test_function for this test
+       gdb_test "trace globals_test_func" \
+           "Tracepoint \[0-9\]+ at .*" \
+           "set tracepoint"
+
+       # Collect nothing.
+
+       # Begin the test.
+       run_trace_experiment globals_test_func
+
+       # Necessarily target specific.
+       if {[istarget "x86_64-*-*"] || [istarget i?86-*]} {
+           send_gdb "info float\n"
+           gdb_expect_list "info float" ".*$gdb_prompt $" {
+               "Status Word:         <unavailable>"
+               "Control Word:        <unavailable>"
+               "Tag Word:            <unavailable>"
+               "Instruction Pointer: <unavailable>:<unavailable>"
+               "Operand Pointer:     <unavailable>:<unavailable>"
+               "Opcode:              <unavailable>"
+           }
+       }
+
+       gdb_test "tfind none" "#0  end .*" "cease trace debugging"
+    }
+}
+
+proc gdb_collect_globals_test { } { with_test_prefix "collect globals" {
     global ws
     global cr
     global gdb_prompt
@@ -442,7 +475,7 @@ proc gdb_collect_globals_test { } { with_test_prefix " collect globals:" {
        "non collected const string is still printable"
 
     gdb_test "print g_string_p" \
-       " = $hex \"hello world\"" \
+       " = $hex <g_const_string> \"hello world\"" \
        "printing constant string through collected pointer"
 
     gdb_test "print g_string_unavail" \
@@ -496,49 +529,43 @@ proc gdb_collect_globals_test { } { with_test_prefix " collect globals:" {
 
     gdb_test_no_output "set print object on"
 
-    global pf_prefix
-    set old_pf_prefix $pf_prefix
-    append pf_prefix " print object on:"
-
-    # With print object on, printing a pointer may need to fetch the
-    # pointed-to object, to check its run-time type.  Make sure that
-    # fails gracefully and transparently when the pointer itself is
-    # unavailable.
-    gdb_test "print virtualp" " = \\(Virtual \\*\\) <unavailable>"
-
-    # no vtable pointer available
-    gdb_test "print derived_unavail" \
-       " = {<Middle> = <unavailable>, _vptr.Derived = <unavailable>, z = <unavailable>}"
+    with_test_prefix "print object on" {
+       # With print object on, printing a pointer may need to fetch
+       # the pointed-to object, to check its run-time type.  Make
+       # sure that fails gracefully and transparently when the
+       # pointer itself is unavailable.
+       gdb_test "print virtualp" " = \\(Virtual \\*\\) <unavailable>"
 
-    # vtable pointer available, but nothing else
-    gdb_test "print derived_partial" \
-       " = \\(Derived\\) {<Middle> = {<Base> = <unavailable>, _vptr.Middle = <unavailable>, y = <unavailable>}, _vptr.Derived = $hex, z = <unavailable>}"
+       # no vtable pointer available
+       gdb_test "print derived_unavail" \
+           " = {<Middle> = <unavailable>, _vptr.Derived = <unavailable>, z = <unavailable>}"
 
-    # whole object available
-    gdb_test "print derived_whole" \
-       " = \\(Derived\\) {<Middle> = {<Base> = {x = 2}, _vptr.Middle = $hex, y = 3}, _vptr.Derived = $hex, z = 4}"
+       # vtable pointer available, but nothing else
+       gdb_test "print derived_partial" \
+           " = \\(Derived\\) {<Middle> = {<Base> = <unavailable>, _vptr.Middle = <unavailable>, y = <unavailable>}, _vptr.Derived = $hex <vtable for Derived.*>, z = <unavailable>}"
 
-    set pf_prefix $old_pf_prefix
+       # whole object available
+       gdb_test "print derived_whole" \
+           " = \\(Derived\\) {<Middle> = {<Base> = {x = 2}, _vptr.Middle = $hex, y = 3}, _vptr.Derived = $hex <vtable for Derived.*>, z = 4}"
+    }
 
     gdb_test_no_output "set print object off"
 
-    append pf_prefix " print object off:"
-
-    gdb_test "print virtualp" " = \\(Virtual \\*\\) <unavailable>"
+    with_test_prefix "print object off" {
+       gdb_test "print virtualp" " = \\(Virtual \\*\\) <unavailable>"
 
-    # no vtable pointer available
-    gdb_test "print derived_unavail" \
-       " = {<Middle> = <unavailable>, _vptr.Derived = <unavailable>, z = <unavailable>}"
+       # no vtable pointer available
+       gdb_test "print derived_unavail" \
+           " = {<Middle> = <unavailable>, _vptr.Derived = <unavailable>, z = <unavailable>}"
 
-    # vtable pointer available, but nothing else
-    gdb_test "print derived_partial" \
-       " = {<Middle> = {<Base> = <unavailable>, _vptr.Middle = <unavailable>, y = <unavailable>}, _vptr.Derived = $hex, z = <unavailable>}"
+       # vtable pointer available, but nothing else
+       gdb_test "print derived_partial" \
+           " = {<Middle> = {<Base> = <unavailable>, _vptr.Middle = <unavailable>, y = <unavailable>}, _vptr.Derived = $hex <vtable for Derived.*>, z = <unavailable>}"
 
-    # whole object available
-    gdb_test "print derived_whole" \
-       " = {<Middle> = {<Base> = {x = 2}, _vptr.Middle = $hex, y = 3}, _vptr.Derived = $hex, z = 4}"
-
-    set pf_prefix $old_pf_prefix
+       # whole object available
+       gdb_test "print derived_whole" \
+           " = {<Middle> = {<Base> = {x = 2}, _vptr.Middle = $hex, y = 3}, _vptr.Derived = $hex <vtable for Derived.*>, z = 4}"
+    }
 
     # An instance of a virtual class where we collected everything but
     # the vptr.
@@ -553,6 +580,7 @@ proc gdb_collect_globals_test { } { with_test_prefix " collect globals:" {
 proc gdb_trace_collection_test {} {
     gdb_collect_globals_test
     gdb_unavailable_registers_test
+    gdb_unavailable_floats
 
     gdb_collect_args_test
     gdb_collect_locals_test local_test_func "auto locals"
This page took 0.028346 seconds and 4 git commands to generate.