# 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
"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
"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
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
"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" \
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.
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"