2013-11-20 Walfred Tedeschi <walfred.tedeschi@intel.com>
- * gdb.python/py-pp-maint.exp: Consider new pretty-print added
+ * gdb.python/py-pp-maint.exp: Consider new pretty-print added
for bnd registers.
2013-11-20 Walfred Tedeschi <walfred.tedeschi@intel.com>
2013-11-11 Phil Muldoon <pmuldoon@redhat.com>
- * gdb.python/py-linetable.S: New file.
+ * gdb.python/py-linetable.S: New file.
* gdb.python/py-linetable.c: New file.
- * gdb.python/py-linetable.exp: New file.
+ * gdb.python/py-linetable.exp: New file.
2013-11-11 Joel Brobecker <brobecker@adacore.com>
PR gdb/15501
* gdb.base/ena-dis-br.exp: Add test to verify
- enable/disable commands work correctly with
+ enable/disable commands work correctly with
multiple arguments that include multiple locations.
2013-08-22 Samuel Bronson <naesten@gmail.com>
load_lib ../config/monitor.exp
set timeout 1000
verbose "Timeout is now $timeout seconds" 2
-
load_lib ../config/monitor.exp
set timeout 120
verbose "Timeout is now $timeout seconds" 2
-
load_lib ../config/monitor.exp
set timeout 1000
verbose "Timeout is now $timeout seconds" 2
-
if {[target_info exists sim,defaultendian]} {
set sidendian [target_info sim,defaultendian]
} else {
- # rely on endianness settings in sid configuration defaults
- set sidendian ""
+ # rely on endianness settings in sid configuration defaults
+ set sidendian ""
}
}
}
sleep 4
if ![target_info exists gdb,no_push_conn] {
- remote_push_conn host
+ remote_push_conn host
}
}
Increment (Val, "Verbose_Increment");
end Verbose_Increment;
end Caller;
-
package Caller is
procedure Verbose_Increment (Val : in out Float; Msg : String);
end Caller;
-
# the value of all the parameters.
gdb_test "continue" \
- ".*Breakpoint $decimal, pck\\.inspect \\(obj=$hex, <objL>=\[1-9\]\\) at .*"
+ ".*Breakpoint $decimal, pck\\.inspect \\(obj=$hex, <objL>=\[1-9\]\\) at .*"
}
gdb_test "print something'address + 0" \
- "\\(system\\.address\\) $hex <pck\\.something>"
+ "\\(system\\.address\\) $hex <pck\\.something>"
gdb_test "print 0 + something'address" \
- "\\(system\\.address\\) $hex <pck\\.something>"
+ "\\(system\\.address\\) $hex <pck\\.something>"
gdb_test "print something'address - 0" \
- "\\(system\\.address\\) $hex <pck\\.something>"
+ "\\(system\\.address\\) $hex <pck\\.something>"
gdb_test "print 0 - something'address" \
- "\\(system\\.address\\) $hex.*"
+ "\\(system\\.address\\) $hex.*"
runto "foo.adb:$bp_location"
gdb_test "print bt" " = \\(1, 2, 3\\)"
-
begin
Do_Nothing (BT'Address); -- STOP
end Foo;
-
}
gdb_test "print itable'first" \
- "= 2"
+ "= 2"
gdb_test "print itable'last" \
- "= 5"
+ "= 5"
gdb_test "print table'first" \
- "= zero"
+ "= zero"
gdb_test "print table'last" \
- "= two"
+ "= two"
Table (Zero) := 5; -- START
ITable (3) := 10;
end Bar;
-
clean_restart ${testfile}
gdb_test "ptype char_table" \
- "= array \\(character\\) of natural"
+ "= array \\(character\\) of natural"
gdb_test "ptype global_char_table" \
- "= array \\(character\\) of natural"
+ "= array \\(character\\) of natural"
# Some more recent versions of gcc can statically initialize this
# array, so we allow either 0 or 4874.
gdb_test "print my_table" "= \\((0|4874) <repeats 256 times>\\)" \
- "Display my_table"
+ "Display my_table"
# the "finish" command.
gdb_test "break create_small" \
- "Breakpoint \[0-9\]+ at.*: file .*pck.adb, line \[0-9\]+." \
- "insert breakpoint in create_small"
+ "Breakpoint \[0-9\]+ at.*: file .*pck.adb, line \[0-9\]+." \
+ "insert breakpoint in create_small"
gdb_test "break create_large" \
- "Breakpoint \[0-9\]+ at.*: file .*pck.adb, line \[0-9\]+." \
- "insert breakpoint in create_large"
+ "Breakpoint \[0-9\]+ at.*: file .*pck.adb, line \[0-9\]+." \
+ "insert breakpoint in create_large"
gdb_test "break create_small_float_vector" \
- "Breakpoint \[0-9\]+ at.*: file .*pck.adb, line \[0-9\]+." \
- "insert breakpoint in create_small_float_vector"
+ "Breakpoint \[0-9\]+ at.*: file .*pck.adb, line \[0-9\]+." \
+ "insert breakpoint in create_small_float_vector"
# Then continue until reaching the first breakpoint inside Create_Small,
# and then do a "finish".
gdb_test "cont" \
- "Breakpoint \[0-9\]+, pck.create_small \\(\\).*" \
- "continuing to Create_Small"
+ "Breakpoint \[0-9\]+, pck.create_small \\(\\).*" \
+ "continuing to Create_Small"
gdb_test "finish" \
- "Value returned is \\\$\[0-9\]+ = \\(1, 1\\)" \
- "value printed by finish of Create_Small"
+ "Value returned is \\\$\[0-9\]+ = \\(1, 1\\)" \
+ "value printed by finish of Create_Small"
# Now continue until reaching the second breakpoint inside Create_Large,
# and then do another "finish".
gdb_test "cont" \
- "Breakpoint \[0-9\]+, pck.create_large \\(\\).*" \
- "continuing to Create_Large"
+ "Breakpoint \[0-9\]+, pck.create_large \\(\\).*" \
+ "continuing to Create_Large"
# On hppa32, the value returned is too large to be returned via a register.
# Instead, it is returned using the struct convention, and the debugger
}
gdb_test "finish" \
- "Value returned is \\\$\[0-9\]+ = \\(2, 2, 2, 2\\)" \
- "value printed by finish of Create_Large"
+ "Value returned is \\\$\[0-9\]+ = \\(2, 2, 2, 2\\)" \
+ "value printed by finish of Create_Large"
# Now continue until reaching the third breakpoint, and then do another
# "finish" again.
gdb_test "cont" \
- "Breakpoint \[0-9\]+, pck.create_small_float_vector \\(\\).*" \
- "continuing to Create_Small_Float_Vector"
+ "Breakpoint \[0-9\]+, pck.create_small_float_vector \\(\\).*" \
+ "continuing to Create_Small_Float_Vector"
gdb_test "finish" \
- "Value returned is \\\$\[0-9\]+ = \\(4.25, 4.25\\)" \
- "value printed by finish of Create_Small_Float_Vector"
-
+ "Value returned is \\\$\[0-9\]+ = \\(4.25, 4.25\\)" \
+ "value printed by finish of Create_Small_Float_Vector"
function Create_Small_Float_Vector return Small_Float_Vector;
end Pck;
-
# Verify that we can compare a string slice with another string.
gdb_test "print a(2)'Address" \
- "= \\(system\\.address\\) 0x\[0-9a-fA-F\]+"
+ "= \\(system\\.address\\) 0x\[0-9a-fA-F\]+"
begin
C := A (1) + A (2); -- STOP
end P;
-
runto "foo.adb:$bp_location"
gdb_test "ptype m" \
- "array \\(1 \\.\\. 1, 2 \\.\\. 3, 4 \\.\\. 6\\) of integer"
+ "array \\(1 \\.\\. 1, 2 \\.\\. 3, 4 \\.\\. 6\\) of integer"
gdb_test "print m'first" " = 1"
gdb_test "print m'last" " = 1"
gdb_test "print m'length(3)" " = 3"
gdb_test "ptype global_3dim_for_gdb_testing" \
- "array \\(0 \\.\\. 0, 0 \\.\\. 1, 0 \\.\\. 2\\) of int"
+ "array \\(0 \\.\\. 0, 0 \\.\\. 1, 0 \\.\\. 2\\) of int"
gdb_test "print global_3dim_for_gdb_testing'first" " = 0"
gdb_test "print global_3dim_for_gdb_testing'last" " = 0"
null;
end Do_Nothing;
end Pck;
-
package Pck is
procedure Do_Nothing (A : System.Address);
end Pck;
-
setup_xfail "*-*-*"
}
gdb_test "print one_two_three" \
- "= \\(1, 2, 3\\)" \
- "print one_two_three, indexes off"
+ "= \\(1, 2, 3\\)" \
+ "print one_two_three, indexes off"
gdb_test "print e_one_two_three" \
- "= \\(1, 2, 3\\)" \
- "print e_one_two_three, indexes off"
+ "= \\(1, 2, 3\\)" \
+ "print e_one_two_three, indexes off"
gdb_test "print r_two_three" \
- "= \\(two => 2, 3\\)" \
- "print r_two_three, indexes off"
+ "= \\(two => 2, 3\\)" \
+ "print r_two_three, indexes off"
gdb_test "print u_one_two_three" \
- "= \\(1, 2, 3\\)" \
- "print u_one_two_three, indexes off"
+ "= \\(1, 2, 3\\)" \
+ "print u_one_two_three, indexes off"
gdb_test "print p_one_two_three" \
- "= \\(false, true, true\\)" \
- "print p_one_two_three, indexes off"
+ "= \\(false, true, true\\)" \
+ "print p_one_two_three, indexes off"
if {$old_gcc} {
setup_xfail "*-*-*"
}
gdb_test "print few_reps" \
- "= \\(1, 2, 3, 3, 3, 3, 3, 4, 5\\)" \
- "print few_reps, indexes off"
+ "= \\(1, 2, 3, 3, 3, 3, 3, 4, 5\\)" \
+ "print few_reps, indexes off"
if {$old_gcc} {
setup_xfail "*-*-*"
}
gdb_test "print many_reps" \
- "= \\(1, 2, 3 <repeats 12 times>, 4, 5\\)" \
- "print many_reps, indexes off"
+ "= \\(1, 2, 3 <repeats 12 times>, 4, 5\\)" \
+ "print many_reps, indexes off"
if {$old_gcc} {
setup_xfail "*-*-*"
}
gdb_test "print empty" \
- "= \\(\\)" \
- "print empty, indexes off"
+ "= \\(\\)" \
+ "print empty, indexes off"
# Next, print all the arrays with the indexes
setup_xfail "*-*-*"
}
gdb_test "print one_two_three" \
- "= \\(1 => 1, 2 => 2, 3 => 3\\)"
+ "= \\(1 => 1, 2 => 2, 3 => 3\\)"
gdb_test "print e_one_two_three" \
- "= \\(one => 1, two => 2, three => 3\\)"
+ "= \\(one => 1, two => 2, three => 3\\)"
gdb_test "print r_two_three" \
- "= \\(two => 2, three => 3\\)"
+ "= \\(two => 2, three => 3\\)"
gdb_test "print u_one_two_three" \
- "= \\(1 => 1, 2 => 2, 3 => 3\\)"
+ "= \\(1 => 1, 2 => 2, 3 => 3\\)"
gdb_test "print p_one_two_three" \
- "= \\(one => false, two => true, three => true\\)"
+ "= \\(one => false, two => true, three => true\\)"
if {$old_gcc} {
setup_xfail "*-*-*"
}
gdb_test "print few_reps" \
- "= \\(1 => 1, 2 => 2, 3 => 3, 4 => 3, 5 => 3, 6 => 3, 7 => 3, 8 => 4, 9 => 5\\)"
+ "= \\(1 => 1, 2 => 2, 3 => 3, 4 => 3, 5 => 3, 6 => 3, 7 => 3, 8 => 4, 9 => 5\\)"
if {$old_gcc} {
setup_xfail "*-*-*"
}
gdb_test "print many_reps" \
- "= \\(1 => 1, 2 => 2, 3 => 3 <repeats 12 times>, 15 => 4, 16 => 5\\)"
+ "= \\(1 => 1, 2 => 2, 3 => 3 <repeats 12 times>, 15 => 4, 16 => 5\\)"
if {$old_gcc} {
setup_xfail "*-*-*"
}
gdb_test "print empty" \
- "= \\(\\)"
+ "= \\(\\)"
Length := -1;
Call_Me (My_String); -- STOP
end Foo;
-
procedure Call_Me (Str : String);
end Pck;
-
# Force the language to Ada, as this will not happen automatically
# in this case (no test program).
gdb_test_no_output "set lang ada" \
- "changing the language to ada"
+ "changing the language to ada"
gdb_test "print \$xxx := 1" \
- "= 1" \
- "set convenience variable \$xxx to 1"
+ "= 1" \
+ "set convenience variable \$xxx to 1"
gdb_test "print \$xxx := @ + 23 + @" \
runto "main_p324_051.adb:$bp_location"
gdb_test "print assign_arr_input.u2 :=(0.25,0.5,0.75)" \
- " = \\(0\\.25, 0\\.5, 0\\.75\\)"
+ " = \\(0\\.25, 0\\.5, 0\\.75\\)"
gdb_test "print assign_arr_input.u2 :=(0.25, others => 0.125)" \
- " = \\(0\\.25, 0\\.125, 0\\.125\\)"
+ " = \\(0\\.25, 0\\.125, 0\\.125\\)"
set line [gdb_get_line_number "STOP2" ${testdir}/target_wrapper.adb]
gdb_breakpoint target_wrapper.adb:$line
set test "ptype pck.data_flag"
gdb_test_multiple "$test" $test {
-re "type = \\(one, two, three\\).*$gdb_prompt $" {
- pass $test
- }
+ pass $test
+ }
-re "type = \\(\\).*$gdb_prompt $" {
- # This is a known compiler problem with Stabs.
- xfail $test
- }
+ # This is a known compiler problem with Stabs.
+ xfail $test
+ }
}
-
}
gdb_test "continue" \
- ".*Breakpoint \[0-9\]+, foo\\.p \\(s=.*\\) at .*foo.adb:\[0-9\]+.*"
+ ".*Breakpoint \[0-9\]+, foo\\.p \\(s=.*\\) at .*foo.adb:\[0-9\]+.*"
with_test_prefix "cont" {
gdb_test "print s'first" " = 4"
# report an error. Try various weird combinations too.
gdb_test "break *break_me'address TASK 2" \
- "Garbage 'TASK 2' at end of command"
+ "Garbage 'TASK 2' at end of command"
set test "break *break_me'address TASK Task TaSK 2"
gdb_test_multiple "$test" $test {
-re "Garbage 'TASK Task TaSK 2' at end of command\[\r\n\]+$gdb_prompt $" {
- pass $test
- }
+ pass $test
+ }
-re "Garbage 'TaSK 2' at end of command\[\r\n\]+$gdb_prompt $" {
- kfail gdb/14111 "$test"
- }
+ kfail gdb/14111 "$test"
+ }
}
gdb_test "break *break_me'address TASK if" \
- "Garbage 'TASK if' at end of command"
+ "Garbage 'TASK if' at end of command"
set re_xfail2 "= \\(0 => 0 <repeats 24 times>, ($decimal)\\)"
gdb_test_multiple "print bad" "" {
-re -wrap $re {
- pass $gdb_test_name
+ pass $gdb_test_name
}
-re -wrap $re_xfail {
- if { $have_xfail } {
- # gcc/101643
- setup_xfail *-*-*
- }
- fail $gdb_test_name
+ if { $have_xfail } {
+ # gcc/101643
+ setup_xfail *-*-*
+ }
+ fail $gdb_test_name
}
-re -wrap $re_xfail2 {
set last $expect_out(1,string)
} else {
set mask 0xf0
}
- if { $have_xfail && [string is integer $last] \
+ if { $have_xfail && [string is integer $last] \
&& [expr ($last & $mask) == 0] } {
- # gcc/101643
- setup_xfail *-*-*
- }
- fail $gdb_test_name
+ # gcc/101643
+ setup_xfail *-*-*
+ }
+ fail $gdb_test_name
}
}
}
# Force the language to Ada, as this will not happen automatically
# in this case (no test program).
gdb_test_no_output "set lang ada" \
- "changing the language to ada"
+ "changing the language to ada"
gdb_test "print 1 = 2" \
- "= false"
+ "= false"
gdb_test "print 3 = 3" \
- "= true"
+ "= true"
# Verify that the current language is Ada.
gdb_test "show lang" \
- "\"auto; currently ada\"\\."
+ "\"auto; currently ada\"\\."
# Before running to the C function (and thus switching out of Ada
# mode), try printing the function using the "<...>" notation.
gdb_test "p <MixedCaseFunc>" \
- " = void" \
- "p <MixedCaseFunc>, in Ada"
+ " = void" \
+ "p <MixedCaseFunc>, in Ada"
gdb_test "p <NoDebugMixedCaseFunc>" \
- " = {<text variable, no debug info>} $hex <NoDebugMixedCaseFunc>" \
- "p <NoDebugMixedCaseFunc>, in Ada"
+ " = {<text variable, no debug info>} $hex <NoDebugMixedCaseFunc>" \
+ "p <NoDebugMixedCaseFunc>, in Ada"
# Try inserting a breakpoint inside a C function. Because the function's
# name has some uppercase letters, we need to use the "<...>" notation.
# The purpose of this testcase is to verify that we can in fact do so
# and that it inserts the breakpoint at the expected location.
gdb_test "break <MixedCaseFunc>" \
- "Breakpoint $decimal at $hex: file .*bar.c, line $decimal\\."
+ "Breakpoint $decimal at $hex: file .*bar.c, line $decimal\\."
# Same, but this time on the function with no debug info.
gdb_test "break <NoDebugMixedCaseFunc>" \
- "Breakpoint $decimal at $hex"
+ "Breakpoint $decimal at $hex"
# Resume the program's execution, verifying that it lands at the expected
# location.
gdb_test "continue" \
- "Breakpoint $decimal, MixedCaseFunc \\(\\) at .*bar\\.c:$decimal.*"
+ "Breakpoint $decimal, MixedCaseFunc \\(\\) at .*bar\\.c:$decimal.*"
# Try printing again using the "<...>" notation. This shouldn't work
# now, since the current frame is a C function.
gdb_test "p <MixedCaseFunc>" \
- "A syntax error in expression, near `<MixedCaseFunc>'\\." \
- "p <MixedCaseFunc>, in C"
+ "A syntax error in expression, near `<MixedCaseFunc>'\\." \
+ "p <MixedCaseFunc>, in C"
gdb_test "p <NoDebugMixedCaseFunc>" \
- "A syntax error in expression, near `<NoDebugMixedCaseFunc>'\\." \
- "p <NoDebugMixedCaseFunc>, in C"
+ "A syntax error in expression, near `<NoDebugMixedCaseFunc>'\\." \
+ "p <NoDebugMixedCaseFunc>, in C"
set test "break <MixedCaseFunc>, in C"
gdb_test_multiple "break <MixedCaseFunc>" $test {
# Force GDB to convert the psymtab of pck.adb into a symtab.
gdb_test "list pck.adb:1" \
- "$decimal\[ \t\]+-- Copyright.*"
+ "$decimal\[ \t\]+-- Copyright.*"
# Break on subprogram "Archive". There is an enumeral that's an
# homonym, so verify that GDB doesn't provide the choice between
# Instead, it should insert the breakpoint on the function alone.
gdb_test "break archive" \
- "Breakpoint $decimal at $hex: file .*pck.adb, line $decimal\\."
+ "Breakpoint $decimal at $hex: file .*pck.adb, line $decimal\\."
# Run the program. Make sure the program runs until it hits
# the breakpoint and that the debugger does not unexpectedly ask
gdb_run_cmd
gdb_test "" \
- "Breakpoint $decimal, pck\\.archive \\(\\).*" \
- "run to pck.archive breakpoint"
-
+ "Breakpoint $decimal, pck\\.archive \\(\\).*" \
+ "run to pck.archive breakpoint"
Archive;
end if;
end P;
-
clean_restart ${testfile}
gdb_test "break *bp_fun_addr'address" \
- "Breakpoint \[0-9\]+ at.*: file .*bp_fun_addr.adb, line \[0-9\]+."
+ "Breakpoint \[0-9\]+ at.*: file .*bp_fun_addr.adb, line \[0-9\]+."
gdb_run_cmd
gdb_test "" \
- "Breakpoint $decimal, bp_fun_addr \\(\\).*" \
- "run until breakpoint at bp_fun_addr'address"
-
+ "Breakpoint $decimal, bp_fun_addr \\(\\).*" \
+ "run until breakpoint at bp_fun_addr'address"
# 4 breakpoints (or possibly 5, including the read_small function itself).
gdb_test "break read_small" \
- "Breakpoint $decimal at $hex: read_small\\. \\(\[45\] locations\\)" \
- "set breakpoint at read_small"
+ "Breakpoint $decimal at $hex: read_small\\. \\(\[45\] locations\\)" \
+ "set breakpoint at read_small"
# We do not verify each breakpoint info, but use continue commands instead
# to verify that we properly stop on each expected breakpoint.
}
gdb_test "continue" \
- "Continuing\\..*$inferior_exited_re.*" \
- "continuing to program completion"
+ "Continuing\\..*$inferior_exited_re.*" \
+ "continuing to program completion"
gdb_test_no_output "set breakpoint pending off" "disable pending breakpoints"
gdb_test "break pck.my_global_variable" \
- "Function \"pck\\.my_global_variable\" not defined\\."
+ "Function \"pck\\.my_global_variable\" not defined\\."
# Test inserting breakpoint on pck.my_hidden_variable.
"disable pending breakpoints after restart"
gdb_test "break pck.my_hidden_variable" \
- "Function \"pck\\.my_hidden_variable\" not defined\\."
+ "Function \"pck\\.my_hidden_variable\" not defined\\."
My_Hidden_Variable := My_Hidden_Variable + 1;
end Do_Something;
end Pck;
-
My_Global_Variable : Integer := 11;
procedure Do_Something (I : in out Integer);
end Pck;
-
set bp_location [gdb_get_line_number "STOP" ${testdir}/foo.adb]
gdb_test "break foo.adb:$bp_location if small_value > 20" \
- "Breakpoint $decimal at $hex: file .*foo.adb, line $decimal\\."
+ "Breakpoint $decimal at $hex: file .*foo.adb, line $decimal\\."
gdb_run_cmd
gdb_test "" \
- "Breakpoint $decimal, foo \\(\\).*" \
- "run to breakpoint"
+ "Breakpoint $decimal, foo \\(\\).*" \
+ "run to breakpoint"
# Verify that we stopped at the correct iteration.
gdb_test "print small_value" " = 25"
clean_restart ${testfile}
gdb_test "break nested_sub" \
- "Breakpoint $decimal at $hex: file .*foo.adb, line $decimal\\."
+ "Breakpoint $decimal at $hex: file .*foo.adb, line $decimal\\."
gdb_test "break do_nothing" \
- "Breakpoint $decimal at $hex: file .*pck.adb, line $decimal\\."
+ "Breakpoint $decimal at $hex: file .*pck.adb, line $decimal\\."
# Run the program. Make sure the program runs until it hits
# the first breakpoint inside nested_sub.
runto "reprod.adb:$bp_location"
gdb_test "print broken" \
- " = \\(len => 1, data => \\(\\(i => 1\\)\\)\\)"
+ " = \\(len => 1, data => \\(\\(i => 1\\)\\)\\)"
begin
New_Node := Pn (1234); -- STOP
end Foo;
-
return N;
end Pn;
end Pck;
-
function Pn (N : Node_Id) return Node_Id;
end Pck;
-
}
gdb_test "catch assert if Global_Var = 2" \
- "Catchpoint $decimal: failed Ada assertions" \
- "insert catchpoint on failed assertions with condition"
+ "Catchpoint $decimal: failed Ada assertions" \
+ "insert catchpoint on failed assertions with condition"
# Check that condition is stored and properly displayed.
"Catchpoint $decimal, failed assertion at $hex in bla \\\(\\\).*at .*bla.adb:$bp_location"
gdb_test "continue" \
"Continuing\\.$eol$eol$catchpoint_msg$eol.*STOP" \
- "continuing to expected failed assertion"
+ "continuing to expected failed assertion"
gdb_test "continue" \
- "Continuing\\..*$inferior_exited_re.*" \
- "continuing to program completion"
+ "Continuing\\..*$inferior_exited_re.*" \
+ "continuing to program completion"
package Pck is
Global_Var : Integer := 0;
end Pck;
-
"insert catchpoint on all Ada exceptions"
gdb_test "info break" \
- "$info_break_header$eol.*$catch_exception_info" \
- "info break, catch all Ada exceptions"
+ "$info_break_header$eol.*$catch_exception_info" \
+ "info break, catch all Ada exceptions"
set catchpoint_msg \
"Catchpoint $any_nb, CONSTRAINT_ERROR (\\\(ignore C_E\\\) )?at $any_addr in foo \\\(\\\).*at .*foo.adb:$any_nb"
gdb_test "continue" \
"Continuing\\.$eol$eol$catchpoint_msg$eol.*SPOT1" \
- "continuing to first exception"
+ "continuing to first exception"
set catchpoint_msg \
"Catchpoint $any_nb, PROGRAM_ERROR (\\\(foo\\.adb:$decimal explicit raise\\\) )?at $any_addr in foo \\\(\\\).*at .*foo.adb:$any_nb"
gdb_test "continue" \
"Continuing\\.$eol$eol$catchpoint_msg$eol.*SPOT2" \
- "continuing to second exception"
+ "continuing to second exception"
################################################
# 2. Try catching only some of the exceptions. #
}
gdb_test "catch exception Program_Error" \
- "Catchpoint $any_nb: \`Program_Error' Ada exception" \
- "insert catchpoint on Program_Error"
+ "Catchpoint $any_nb: \`Program_Error' Ada exception" \
+ "insert catchpoint on Program_Error"
gdb_test "catch assert" \
- "Catchpoint $any_nb: failed Ada assertions" \
- "insert catchpoint on failed assertions"
+ "Catchpoint $any_nb: failed Ada assertions" \
+ "insert catchpoint on failed assertions"
gdb_test "catch exception unhandled" \
- "Catchpoint $any_nb: unhandled Ada exceptions" \
- "insert catchpoint on unhandled exceptions"
+ "Catchpoint $any_nb: unhandled Ada exceptions" \
+ "insert catchpoint on unhandled exceptions"
set catch_exception_entry \
"$any_nb${sp}catchpoint${sp}keep${sp}y${sp}\`Program_Error' Ada exception"
"$any_nb${sp}catchpoint${sp}keep${sp}y${sp}unhandled Ada exceptions"
gdb_test "info break" \
- "$info_break_header$eol.*$catch_exception_entry$eol$catch_assert_entry$eol$catch_unhandled_entry" \
- "info break, second run"
+ "$info_break_header$eol.*$catch_exception_entry$eol$catch_assert_entry$eol$catch_unhandled_entry" \
+ "info break, second run"
set catchpoint_msg \
"Catchpoint $any_nb, PROGRAM_ERROR (\\\(foo.adb:$decimal explicit raise\\\) )?at $any_addr in foo \\\(\\\).*at .*foo.adb:$any_nb"
gdb_test "continue" \
"Continuing\\.$eol$eol$catchpoint_msg$eol.*SPOT2" \
- "continuing to Program_Error exception"
+ "continuing to Program_Error exception"
set catchpoint_msg \
"Catchpoint $any_nb, failed assertion at $any_addr in foo \\\(\\\).*at .*foo.adb:$any_nb"
gdb_test "continue" \
"Continuing\\.$eol$eol$catchpoint_msg$eol.*SPOT3" \
- "continuing to failed assertion"
+ "continuing to failed assertion"
set catchpoint_msg \
"Catchpoint $any_nb, unhandled CONSTRAINT_ERROR at $any_addr in foo \\\(\\\).*at .*foo.adb:$any_nb"
gdb_test "continue" \
"Continuing\\.$eol$eol$catchpoint_msg$eol.*SPOT4" \
- "continuing to unhandled exception"
+ "continuing to unhandled exception"
gdb_test "continue" \
- "Continuing\\..*$inferior_exited_re.*" \
- "continuing to program completion"
+ "Continuing\\..*$inferior_exited_re.*" \
+ "continuing to program completion"
#################################
# 3. Try temporary catchpoints. #
}
gdb_test "tcatch exception" \
- "Temporary catchpoint $any_nb: all Ada exceptions"
+ "Temporary catchpoint $any_nb: all Ada exceptions"
set temp_catchpoint_msg \
"Temporary catchpoint $any_nb, CONSTRAINT_ERROR (\\\(.*\\\) )?at $any_addr in foo \\\(\\\).*at .*foo.adb:$any_nb"
gdb_test "continue" \
"Continuing\\.$eol$eol$temp_catchpoint_msg$eol.*SPOT1" \
- "continuing to temporary catchpoint"
+ "continuing to temporary catchpoint"
with_test_prefix "temporary catchpoint" {
gdb_test "continue" \
"Continuing\\..*$inferior_exited_re.*" \
"continuing to program completion"
}
-
-
null;
end Do_Nothing;
end Pck;
-
type Global_Enum_Type is ('x', 'Y', '+');
procedure Do_Nothing (A : System.Address);
end Pck;
-
# the function call.
gdb_test "print procedure_result" \
- "= 32 ' '" \
- "print procedure_result before calling same"
+ "= 32 ' '" \
+ "print procedure_result before calling same"
gdb_test "call same (first)" \
- "" \
- "call same"
+ "" \
+ "call same"
gdb_test "print procedure_result" \
- "= 97 'a'" \
- "print procedure_result after calling same"
+ "= 97 'a'" \
+ "print procedure_result after calling same"
gdb_test "call next (first)" \
- "= 98 'b'" \
- "call next"
+ "= 98 'b'" \
+ "call next"
gdb_test "print procedure_result" \
- "= 98 'b'" \
- "print procedure_result after calling next"
-
-
+ "= 98 'b'" \
+ "print procedure_result after calling next"
Same (First); -- STOP
Next (First);
end Foo;
-
-
-
set msg $cmd
}
gdb_test "complete p $expr" \
- "$expected_output" $msg
+ "$expected_output" $msg
}
# A convenience function that verifies that the "complete EXPR" command
# Try a global variable, only one match should be found:
test_gdb_complete "my_glob" \
- "p my_global_variable"
+ "p my_global_variable"
# A global variable, inside a nested package:
test_gdb_complete "insi" \
- "p inside_variable"
+ "p inside_variable"
# A global variable inside a nested package, but only giving part of
# the fully qualified name (top level package name missing):
# An incomplete nested package name, were lies a single symbol:
test_gdb_complete "pck.inne" \
- "p pck.inner.inside_variable" \
- "complete nested package name"
+ "p pck.inner.inside_variable" \
+ "complete nested package name"
# A fully qualified symbol name, mangled...
test_gdb_complete "pck__inner__ins" \
- "p pck__inner__inside_variable"
+ "p pck__inner__inside_variable"
# A fully qualified symbol name...
test_gdb_complete "pck.inner.ins" \
- "p pck.inner.inside_variable"
+ "p pck.inner.inside_variable"
# Make sure that "inside" is not returned as a possible completion
# for "side"...
# check the "<...>" notation.
test_gdb_complete "<Exported" \
- "p <Exported_Capitalized>"
+ "p <Exported_Capitalized>"
# While at it, make sure we can print the symbol too, using the '<'
# notation.
# A global symbol, created by the binder, that starts with __gnat...
test_gdb_complete "__gnat_ada_main_progra" \
- "p __gnat_ada_main_program_name"
+ "p __gnat_ada_main_program_name"
# A global symbol, created by the binder, that starts with __gnat,
# and using the '<' notation.
test_gdb_complete "<__gnat_ada_main_prog" \
- "p <__gnat_ada_main_program_name>"
+ "p <__gnat_ada_main_program_name>"
# A local variable
test_gdb_complete "some" \
- "p some_local_variable"
+ "p some_local_variable"
# A local variable variable, but in a different procedure. No match
# should be returned.
# A fully qualified variable name that does exist...
test_gdb_complete "pck.my" \
- "p pck.my_global_variable"
+ "p pck.my_global_variable"
# A fully qualified package name
test_gdb_complete "pck.inner" \
# A fully qualified package name, with a dot at the end
test_gdb_complete "pck.inner." \
- "p pck.inner.inside_variable"
+ "p pck.inner.inside_variable"
# Two matches, from the global scope:
test_gdb_complete "local_ident" \
- [multi_line "p local_identical_one" \
- "p local_identical_two" ]
+ [multi_line "p local_identical_one" \
+ "p local_identical_two" ]
# Two matches, from the global scope, but using fully qualified names:
test_gdb_complete "pck.local_ident" \
- [multi_line "p pck.local_identical_one" \
- "p pck.local_identical_two" ]
+ [multi_line "p pck.local_identical_one" \
+ "p pck.local_identical_two" ]
# Two matches, from the global scope, but using mangled fully qualified
# names:
test_gdb_complete "pck__local_ident" \
- [multi_line "p pck__local_identical_one" \
- "p pck__local_identical_two" ]
+ [multi_line "p pck__local_identical_one" \
+ "p pck__local_identical_two" ]
# Two matches, one from the global scope, the other from the local scope:
test_gdb_complete "external_ident" \
- [multi_line "p external_identical_one" \
- "p external_identical_two" ]
+ [multi_line "p external_identical_one" \
+ "p external_identical_two" ]
# Complete on the name of package.
test_gdb_complete "pck" \
# Complete a mangled symbol name, but using the '<...>' notation.
test_gdb_complete "<pck__my" \
- "p <pck__my_global_variable>"
+ "p <pck__my_global_variable>"
# Very simple completion, but using the interactive form, this time.
# The verification we are trying to make involves the event loop,
# which users can select a specific function. This should not happen during
# completion, though.
test_gdb_complete "ambig" \
- [multi_line "p ambiguous_func" \
- "p ambiguous_proc" ]
+ [multi_line "p ambiguous_func" \
+ "p ambiguous_proc" ]
test_gdb_complete "ambiguous_f" \
- "p ambiguous_func"
+ "p ambiguous_func"
test_gdb_complete "ambiguous_func" \
- "p ambiguous_func"
+ "p ambiguous_func"
# Perform a test intended to verify the behavior where the number
# of possible completions is very large. The goal is not to verify
Aux_Pck.Ambiguous_Proc;
Pck.Ambiguous_Func;
end Foo;
-
# Run to c_function an verify that the language automatically gets set to C.
runto c_function
gdb_test "show lang" \
- "The current source language is \"auto; currently c\"\\."
+ "The current source language is \"auto; currently c\"\\."
# Now, insert a breakpoint inside an Ada unit, using a condition written
# in Ada. Even though the current language is "auto; currently c", we
# current language mode is auto, and the breakpoint is inside Ada code.
set bp_location [gdb_get_line_number "STOP" ${testdir}/mixed.adb]
gdb_test "break mixed.adb:${bp_location} if light = green" \
- "Breakpoint \[0-9\]* at .*: file (.*/)?mixed.adb, line \[0-9\]*\\."
+ "Breakpoint \[0-9\]* at .*: file (.*/)?mixed.adb, line \[0-9\]*\\."
# Now, continue until we hit the breakpoint. If the condition is
# evaluated correctly, the first hit will be ignored, and the debugger
# will stop at the second hit only, when the "light" argument is equal
# to green.
gdb_test "continue" \
- "Breakpoint \[0-9\]*, mixed\\.break_me \\(light=green\\) at .*"
-
-
+ "Breakpoint \[0-9\]*, mixed\\.break_me \\(light=green\\) at .*"
}
gdb_test "print r" \
- " = \\(n => 10, a => \\(10, 20, 30, 40, 50, 60, 70, 80, 90, 100\\)\\)"
+ " = \\(n => 10, a => \\(10, 20, 30, 40, 50, 60, 70, 80, 90, 100\\)\\)"
gdb_test "print r.a" \
- " = \\(10, 20, 30, 40, 50, 60, 70, 80, 90, 100\\)"
+ " = \\(10, 20, 30, 40, 50, 60, 70, 80, 90, 100\\)"
end Do_Nothing;
end Pck;
-
-
package Pck is
procedure Do_Nothing (A : System.Address);
end Pck;
-
-
gdb_test_no_output "maintenance set ada ignore-descriptive-types"
gdb_test "ptype array_type" \
- " = array \\(5 \\.\\. 10\\) of natural" \
+ " = array \\(5 \\.\\. 10\\) of natural" \
set test "info locals"
gdb_test_multiple "$test" "$test" {
-re "i = \"AA\"${eol}s = \" \"" {
- pass $test
+ pass $test
}
-re "i = \"AA\"${eol}.*${eol}s = \" \"" {
- # The debugger printed the two local variable correctly, but
- # it probably failed to NOT print some variables internally
- # generated by the compiler. This is a known issue.
- xfail $test
+ # The debugger printed the two local variable correctly, but
+ # it probably failed to NOT print some variables internally
+ # generated by the compiler. This is a known issue.
+ xfail $test
}
}
-
}
gdb_test "print A1(1)" \
- "\\(i => 0, s => \"\"\\)"
+ "\\(i => 0, s => \"\"\\)"
gdb_test "print A1(2)" \
- "\\(i => 1, s => \"A\"\\)"
+ "\\(i => 1, s => \"A\"\\)"
gdb_test "print A1(3)" \
- "\\(i => 2, s => \"AB\"\\)"
+ "\\(i => 2, s => \"AB\"\\)"
gdb_test "print A1(1..3)" \
- "\\(\\(i => 0, s => \"\"\\), \\(i => 1, s => \"A\"\\), \\(i => 2, s => \"AB\"\\)\\)"
+ "\\(\\(i => 0, s => \"\"\\), \\(i => 1, s => \"A\"\\), \\(i => 2, s => \"AB\"\\)\\)"
# Test the use of the "repeat" operator (@).
#
# of the array).
gdb_test "print a1(1)@3" \
- " = \\(\\(i => 0, s => \"\"\\), \\(i => -?$decimal, s => .*\\), \\(i => -?$decimal, s => .*\\)\\)"
+ " = \\(\\(i => 0, s => \"\"\\), \\(i => -?$decimal, s => .*\\), \\(i => -?$decimal, s => .*\\)\\)"
"continuing and stopping in Storage_Error exception handlers"
gdb_test_no_output "delete 2" \
- "delete catchpoint on all Ada exceptions handlers"
+ "delete catchpoint on all Ada exceptions handlers"
##################################################
# 2. Try catching some named exception handlers. #
# Insert a catchpoint on Program_Error Ada exception handlers.
gdb_test "catch handlers Program_Error" \
- "Catchpoint $decimal: `Program_Error' Ada exception handlers" \
- "insert catchpoint on Program_Error Ada exception handlers"
+ "Catchpoint $decimal: `Program_Error' Ada exception handlers" \
+ "insert catchpoint on Program_Error Ada exception handlers"
# Continue, we should not stop at ABORT_SIGNAL but at Program_Error one.
# Insert a catchpoint on Storage_Error Ada exception handlers.
gdb_test "catch handlers Storage_Error" \
- "Catchpoint $decimal: `Storage_Error' Ada exception handlers" \
- "insert catchpoint on Storage_Error Ada exception handlers"
+ "Catchpoint $decimal: `Storage_Error' Ada exception handlers" \
+ "insert catchpoint on Storage_Error Ada exception handlers"
# Continue, we should stop at Storage_Error handlers.
# Insert a catchpoint on all Ada exceptions handlers with condition.
gdb_test "catch handlers if Global_Var = 2" \
- "Catchpoint $decimal: all Ada exceptions handlers" \
- "insert catchpoint on all Ada exception handlers with condition"
+ "Catchpoint $decimal: all Ada exceptions handlers" \
+ "insert catchpoint on all Ada exception handlers with condition"
# Check that condition is stored and properly displayed.
gdb_test "info breakpoint" "stop only if Global_Var = 2" \
- "Check catch handlers with condition"
+ "Check catch handlers with condition"
# Continue, we should not stop at ABORT_SIGNAL but at Program_Error one.
# Continue, the program should exit properly.
gdb_test "continue" \
- "Continuing\\..*$inferior_exited_re.*" \
- "continuing to program completion"
+ "Continuing\\..*$inferior_exited_re.*" \
+ "continuing to program completion"
}
gdb_test "" \
- "first \\(\\) at .*first.adb.*" \
- "start first"
+ "first \\(\\) at .*first.adb.*" \
+ "start first"
# Restore first executable to its original name, and move
# second executable into its place. Ensure that the new
fail "start second"
} else {
gdb_test "" \
- "second \\(\\) at .*second.adb.*" \
- "start second"
+ "second \\(\\) at .*second.adb.*" \
+ "start second"
}
# Try again, this time with just changing the file time of first.
gdb_test "" "Breakpoint $decimal, foo \\(\\).*" \
"run to foo"
gdb_test "continue" \
- "Continuing\\..*Breakpoint $decimal, foo \\(\\).*"
+ "Continuing\\..*Breakpoint $decimal, foo \\(\\).*"
# Make sure that "thread" may be used as a variable without being mistaken
# for an expression delimiter.
gdb_test "print thread" \
- "= 1" \
- "print variable 'thread'"
+ "= 1" \
+ "print variable 'thread'"
gdb_test_no_output "delete 1"
gdb_test "watch thread" \
- ".*atchpoint \[0-9\]+: thread" \
- "set plain watchpoint on variable 'thread'"
+ ".*atchpoint \[0-9\]+: thread" \
+ "set plain watchpoint on variable 'thread'"
# Make sure that 'if' when followed by an expression beginning
# with 'i' works.
gdb_test "watch thread if i = 2" \
- ".*atchpoint \[0-9\]+: thread" \
- "set conditional watchpoint."
+ ".*atchpoint \[0-9\]+: thread" \
+ "set conditional watchpoint."
gdb_test "info break" \
- ".*${ws}.*atchpoint${ws}keep${ws}y${ws}thread${ws}.*atchpoint${ws}keep${ws}y${ws}thread${ws}stop only if i = 2" \
- "check that watchpoint is set correctly."
+ ".*${ws}.*atchpoint${ws}keep${ws}y${ws}thread${ws}.*atchpoint${ws}keep${ws}y${ws}thread${ws}stop only if i = 2" \
+ "check that watchpoint is set correctly."
# Check for right error when using both 'if' and 'thread' clauses.
gdb_test "break foo.adb:$bp_location if thread = 10 thread 999" \
- ".*Unknown thread 999\\." \
- "combination of 'if' and 'thread' delimiters."
+ ".*Unknown thread 999\\." \
+ "combination of 'if' and 'thread' delimiters."
begin
Do_Nothing (Val'Address); -- STOP
end Expr_R821_013;
-
# to display, depending on the ABI. The objective of the test is
# to verify that we don't crash, so keep the expected output simple...
gdb_test "finish" \
- ".*Value returned.*"
+ ".*Value returned.*"
# Verify that GDB is still alive...
gdb_test "print 1" \
- "= 1"
+ "= 1"
# With some ABIs the return value cannot be determined. Accept this,
# or the correct result.
gdb_test "finish" \
- "Value returned .*($value|Cannot determine contents)"
+ "Value returned .*($value|Cannot determine contents)"
# Test that an inferior call yields the correct result.
gdb_test "print pck.get(True)" $value
runto "fixed.adb:$bp_location"
gdb_test "print My_Var > 10.0" \
- "= true"
+ "= true"
gdb_test "print My_Var > 20.0" \
- "= false"
+ "= false"
# Do the same, but with integer values.
gdb_test "print My_Var > 10" \
- "= true"
+ "= true"
gdb_test "print My_Var > 20" \
- "= false"
+ "= false"
}
null;
end Do_Nothing;
end pck;
-
procedure Do_Nothing (A : System.Address);
end pck;
-
runto "fixed_points_function.adb:$bp_location"
gdb_test "print call_fp1(1)" \
- " = 1"
+ " = 1"
gdb_test "print call_fp1(0.5)" \
- " = 0.5"
+ " = 0.5"
gdb_test "print call_fp1(-0.5)" \
- " = -0.5"
+ " = -0.5"
gdb_test_no_output "call set_float(2.0)"
gdb_test "print global_float" \
- " = 2\\.0"
+ " = 2\\.0"
gdb_test_no_output "call set_double(1, 3.0)"
gdb_test "print global_double" \
- " = 3\\.0"
+ " = 3\\.0"
gdb_test_no_output "call set_long_double(1, global_small_struct, 4.0)"
gdb_test "print global_long_double" \
- " = 4\\.0"
-
-
+ " = 4\\.0"
gdb_test_multiple "print $var'access" "address of $var" {
-re "\\$\[0-9\]+ = \\(.*\\) (0x\[0-9a-f\]+).*$gdb_prompt $" {
- return $expect_out(1,string)
- }
+ return $expect_out(1,string)
+ }
}
return ""
}
set test "print/x $var"
gdb_test_multiple "$test" $test {
- -re "\\$\[0-9\]+ = [string_to_regexp $val].*$gdb_prompt $" {
+ -re "\\$\[0-9\]+ = [string_to_regexp $val].*$gdb_prompt $" {
pass $test
}
-re "\\$\[0-9\]+ = $addr.*$gdb_prompt $" {
- fail "$test (prints just address)"
- }
+ fail "$test (prints just address)"
+ }
-re "\\$\[0-9\]+ = 0x\[a-f0-9\]+.*$gdb_prompt $" {
- fail "$test (prints unexpected address)"
- }
+ fail "$test (prints unexpected address)"
+ }
}
return 0
}
# First, print all the arrays without indexes
gdb_test_no_output "set print frame-arguments scalars" \
- "set print frame-arguments scalars"
+ "set print frame-arguments scalars"
gdb_test "frame 1" \
- "#1$sp$any_addr in pck.call_me \\(int=1, flt=2.0, bln=true, ary=\\.\\.\\., chr=106 'j', sad=\\(system.address\\) $any_addr, rec=\\.\\.\\.\\).*" \
- "display frame 1 with frame-arguments set to scalars"
-
-
+ "#1$sp$any_addr in pck.call_me \\(int=1, flt=2.0, bln=true, ary=\\.\\.\\., chr=106 'j', sad=\\(system.address\\) $any_addr, rec=\\.\\.\\.\\).*" \
+ "display frame 1 with frame-arguments set to scalars"
Rec : Struct); -- Non scalar
end Pck;
-
# Break on "pck.hello" rather than just "hello" to make sure we trigger
# the non-wild symbol lookup.
gdb_test "break pck.hello" \
- "Breakpoint \[0-9\]+ at 0x\[0-9a-f\]+: file .*pck.adb, line \[0-9\]+."
+ "Breakpoint \[0-9\]+ at 0x\[0-9a-f\]+: file .*pck.adb, line \[0-9\]+."
# Do the same, but this time using a linespec where the user also
# provided a filename.
clean_restart ${testfile}
gdb_test "break pck.adb:pck.hello" \
- "Breakpoint \[0-9\]+ at 0x\[0-9a-f\]+: file .*pck.adb, line \[0-9\]+."
+ "Breakpoint \[0-9\]+ at 0x\[0-9a-f\]+: file .*pck.adb, line \[0-9\]+."
# Same scenarios as above, but with a function name that is spelled
# with upper-case letters.
clean_restart ${testfile}
gdb_test "break Pck.Hello" \
- "Breakpoint \[0-9\]+ at 0x\[0-9a-f\]+: file .*pck.adb, line \[0-9\]+."
+ "Breakpoint \[0-9\]+ at 0x\[0-9a-f\]+: file .*pck.adb, line \[0-9\]+."
clean_restart ${testfile}
gdb_test "break pck.adb:Pck.Hello" \
- "Breakpoint \[0-9\]+ at 0x\[0-9a-f\]+: file .*pck.adb, line \[0-9\]+."
+ "Breakpoint \[0-9\]+ at 0x\[0-9a-f\]+: file .*pck.adb, line \[0-9\]+."
null;
end There;
end Pck;
-
-
-- The name of that procedure needs to be greater (in terms
-- of alphabetical order) than the name of the procedure above.
end Pck;
-
# the inferior is *not* running (no frame).
gdb_test "print foo'address" \
- "= .* 0x\[0-9a-zA-Z\]+ <foo>"
+ "= .* 0x\[0-9a-zA-Z\]+ <foo>"
set bp_location [gdb_get_line_number "STOP" ${testdir}/foo.adb]
gdb_test "break foo.adb:$bp_location" \
- "Breakpoint $any_nb at $any_addr: file .*foo.adb, line $any_nb." \
- "insert breakpoint inside foo.call_me"
+ "Breakpoint $any_nb at $any_addr: file .*foo.adb, line $any_nb." \
+ "insert breakpoint inside foo.call_me"
gdb_test "continue" \
- ".*Breakpoint $any_nb, foo\\.call_me \\(\\) at .*foo.adb:$any_nb.*" \
- "decoding of function name"
-
+ ".*Breakpoint $any_nb, foo\\.call_me \\(\\) at .*foo.adb:$any_nb.*" \
+ "decoding of function name"
"> $"]
set test_name "multiple matches for $function {$expr}"
gdb_test_multiple "print $expr" "$test_name" {
- -re "$menu1" {
- pass "$test_name"
- }
- -re "$menu2" {
- pass "$test_name"
+ -re "$menu1" {
+ pass "$test_name"
+ }
+ -re "$menu2" {
+ pass "$test_name"
# Make sure we pick the correct one.
set selection [expr {3 - $selection}]
- }
- default {
- fail "$test_name"
- }
+ }
+ default {
+ fail "$test_name"
+ }
}
gdb_test "$selection" "$output"
}
set test "print fun_rename_test_n(1)"
gdb_test_multiple $test $test {
-wrap -re " = 2" {
- pass $test
+ pass $test
}
-wrap -re "No definition of \"fun_rename_test_n\" in current context\\." {
if {[gnat_version_compare >= 6]} {
- fail $test
- } else {
- xfail $test
- }
+ fail $test
+ } else {
+ xfail $test
+ }
}
}
set test "print renamed_fun_rename_test_next(1)"
gdb_test_multiple $test $test {
-wrap -re " = 2" {
- pass $test
+ pass $test
}
-wrap -re "No definition of \"renamed_fun_rename_test_next\" in current context\\." {
if {[gnat_version_compare >= 6]} {
- fail $test
- } else {
- xfail $test
- }
+ fail $test
+ } else {
+ xfail $test
+ }
}
}
set test "print pack.renamed_fun_rename_test_next(1)"
gdb_test_multiple $test $test {
-wrap -re " = 2" {
- pass $test
+ pass $test
}
-wrap -re "No definition of \"pack\\.renamed_fun_rename_test_next\" in current context\\." {
if {[gnat_version_compare >= 6]} {
- fail $test
- } else {
- xfail $test
- }
+ fail $test
+ } else {
+ xfail $test
+ }
}
-wrap -re "Type <data variable, no debug info> is not a structure or union type\\." {
if {[gnat_version_compare >= 6]} {
- fail $test
- } else {
- xfail $test
- }
+ fail $test
+ } else {
+ xfail $test
+ }
}
}
# class-wide.
gdb_test "p ident (ident (my_parameter))" \
- "= \\(one => 1, two => 2, three => 3\\)" "value of ident"
+ "= \\(one => 1, two => 2, three => 3\\)" "value of ident"
runto "foo.adb:$bp_location"
gdb_test "print pck.ga" " = \\(access integer\\) 0x0" \
- "Check that initial value of GA is null"
+ "Check that initial value of GA is null"
gdb_test_no_output "call pck.p(0x1234)"
# procedure hence should be 0x1234 after the call above.
gdb_test "print pck.ga" " = \\(access integer\\) 0x1234" \
- "Check that value of GA is 0x1234"
+ "Check that value of GA is 0x1234"
# sure that the debugger doesn't get mixed up.
gdb_test "ptype local_type" \
- "type = range -100 \\.\\. 100" \
- "ptype local_type at BREAK_1"
+ "type = range -100 \\.\\. 100" \
+ "ptype local_type at BREAK_1"
gdb_test "ptype local_type_subtype" \
- "type = range -100 \\.\\. 100" \
- "ptype local_type_subtype at BREAK_1"
+ "type = range -100 \\.\\. 100" \
+ "ptype local_type_subtype at BREAK_1"
gdb_test "ptype int_type" \
- "type = range -100 \\.\\. 100" \
- "ptype int_type at BREAK_1"
+ "type = range -100 \\.\\. 100" \
+ "ptype int_type at BREAK_1"
gdb_test "ptype lcl" \
- "type = range -100 \\.\\. 100" \
- "ptype lcl at BREAK_1"
+ "type = range -100 \\.\\. 100" \
+ "ptype lcl at BREAK_1"
gdb_test "print lcl" \
- "= 29" \
- "print lcl at BREAK_1"
+ "= 29" \
+ "print lcl at BREAK_1"
# Now, continue until reaching BREAK_2, and do the same commands
# as above. The result should be different since the definitions
set bp_location [gdb_get_line_number "BREAK_2" ${testdir}/homonym.adb]
gdb_test "break homonym.adb:$bp_location" \
- "Breakpoint \[0-9\]+ at 0x\[0-9a-fA-F\]+: file .*homonym\\.adb, line \[0-9\]+\\." \
- "break at BREAK_2"
+ "Breakpoint \[0-9\]+ at 0x\[0-9a-fA-F\]+: file .*homonym\\.adb, line \[0-9\]+\\." \
+ "break at BREAK_2"
gdb_test "continue" \
- ".*Breakpoint \[0-9\]+, homonym\\.get_value \\(\\) at .*homonym\\.adb:.*" \
- "continue until BREAK_2"
+ ".*Breakpoint \[0-9\]+, homonym\\.get_value \\(\\) at .*homonym\\.adb:.*" \
+ "continue until BREAK_2"
gdb_test "ptype local_type" \
- "type = range 1 \\.\\. 19740804" \
- "ptype local_type at BREAK_2"
+ "type = range 1 \\.\\. 19740804" \
+ "ptype local_type at BREAK_2"
gdb_test "ptype local_type_subtype" \
- "type = range 1 \\.\\. 19740804" \
- "ptype local_type_subtype at BREAK_2"
+ "type = range 1 \\.\\. 19740804" \
+ "ptype local_type_subtype at BREAK_2"
gdb_test "ptype lcl" \
- "type = range 1 \\.\\. 19740804" \
- "ptype lcl at BREAK_2"
+ "type = range 1 \\.\\. 19740804" \
+ "ptype lcl at BREAK_2"
gdb_test "print lcl" \
- "= 17" \
- "print lcl at BREAK_2"
+ "= 17" \
+ "print lcl at BREAK_2"
end Do_Nothing;
end Pck;
-
procedure Do_Nothing (A : System.Address);
end Pck;
-
gdb_test "info exceptions" \
[multi_line "All defined Ada exceptions:" \
- "constraint_error: $hex" \
- "program_error: $hex" \
- "storage_error: $hex" \
- "tasking_error: $hex" \
- ".*\[\r\n\]*const.aint_global_gdb_e: $hex\[\r\n\]*.*" ]
+ "constraint_error: $hex" \
+ "program_error: $hex" \
+ "storage_error: $hex" \
+ "tasking_error: $hex" \
+ ".*\[\r\n\]*const.aint_global_gdb_e: $hex\[\r\n\]*.*" ]
gdb_test "info exceptions task" \
[multi_line "All Ada exceptions matching regular expression \"task\":" \
- "tasking_error: $hex"]
+ "tasking_error: $hex"]
gdb_test "info exceptions global_gdb" \
[multi_line "All Ada exceptions matching regular expression \"global_gdb\":" \
- "const.aint_global_gdb_e: $hex"]
+ "const.aint_global_gdb_e: $hex"]
gdb_test "info exceptions const.aint" \
[multi_line "All Ada exceptions matching regular expression \"const\\.aint\":" \
- "constraint_error: $hex" \
- "const.aint_global_gdb_e: $hex"]
+ "constraint_error: $hex" \
+ "const.aint_global_gdb_e: $hex"]
foreach cmd {exception handlers} {
gdb_test "complete catch $cmd const.a" \
runto "foo.adb:$bp_location"
gdb_test "info locals" "gv = 1"
-
do_something(&toto);
return 0;
}
-
set eol "\r\n"
gdb_test "info types new_integer_type" \
- "All types matching regular expression \"new_integer_type\":${eol}${eol}File .*info_types.c:${eol}.*\tint"
-
+ "All types matching regular expression \"new_integer_type\":${eol}${eol}File .*info_types.c:${eol}.*\tint"
# Hijack a bit this testcase, to verify that name decoding works
# when doing symbolic address printing.
gdb_test "print watch'address" \
- " = \\(system\\.address\\) $hex <pck\\.watch>"
+ " = \\(system\\.address\\) $hex <pck\\.watch>"
gdb_test "print *long_integer(watch'address)" \
- " = 4874"
+ " = 4874"
gdb_test "print long_integer(watch'address).all" \
- " = 4874"
-
+ " = 4874"
runto "foo.adb:$bp_location"
gdb_test "print r" \
- "= \\(x => 1, y => 2, w => 3, h => 4\\)"
+ "= \\(x => 1, y => 2, w => 3, h => 4\\)"
gdb_test "print s" \
- "= \\(x => 1, y => 2, w => 3, h => 4\\)"
+ "= \\(x => 1, y => 2, w => 3, h => 4\\)"
set r_re "r = \[^\r\n\]*"
set s_re "s = \[^\r\n\]*"
Do_Nothing (R); -- STOP
Do_Nothing (S);
end Foo;
-
end Do_Nothing;
end Types;
-
}
gdb_test "print My_Drawable" \
- "= \\(center => \\(x => 1, y => 2\\), radius => 3\\)"
+ "= \\(center => \\(x => 1, y => 2\\), radius => 3\\)"
gdb_test "print s_access.all" \
- "\\(center => \\(x => 1, y => 2\\), radius => 3\\)"
+ "\\(center => \\(x => 1, y => 2\\), radius => 3\\)"
gdb_test "print sp_access.all" \
- "\\(center => \\(x => 1, y => 2\\), radius => 3\\)"
+ "\\(center => \\(x => 1, y => 2\\), radius => 3\\)"
gdb_test "print d_access.all" \
- "\\(center => \\(x => 1, y => 2\\), radius => 3\\)"
+ "\\(center => \\(x => 1, y => 2\\), radius => 3\\)"
gdb_test "print dp_access.all" \
- "\\(center => \\(x => 1, y => 2\\), radius => 3\\)"
+ "\\(center => \\(x => 1, y => 2\\), radius => 3\\)"
# Make sure that the language is switched to Ada for the second frame
# by checking the string parameter.
gdb_test "bt" \
- ".*#1.*lang_switch\\.ada_procedure\\s*\\(msg=\"msg\"\\).*" \
- "backtrace"
+ ".*#1.*lang_switch\\.ada_procedure\\s*\\(msg=\"msg\"\\).*" \
+ "backtrace"
# Now, make sure that the language doesn't get automatically switched
# if the current language is not "auto".
# -fgnat-encodings=all, but since we don't care so much about the
# precise details here, we just accept anything.
gdb_test "bt" \
- ".*#1.*lang_switch\\.ada_procedure\\s*\\(msg=(@$hex: +)?.*\\).*" \
- "backtrace with lang set to C"
+ ".*#1.*lang_switch\\.ada_procedure\\s*\\(msg=(@$hex: +)?.*\\).*" \
+ "backtrace with lang set to C"
Do_Nothing (Large_1d_Array'Address);
Do_Nothing (Large_3d_Array'Address); -- STOP
end Foo;
-
}
mi_gdb_test "-catch-assert -c \"Global_Var = 2\"" \
- "\\^done,bkptno=\"$decimal\",bkpt={.*disp=\"keep\",enabled=\"y\",what=\"failed Ada assertions\",.*,cond=\"Global_Var = 2\",.*}" \
- "catch assert failures with condition"
+ "\\^done,bkptno=\"$decimal\",bkpt={.*disp=\"keep\",enabled=\"y\",what=\"failed Ada assertions\",.*,cond=\"Global_Var = 2\",.*}" \
+ "catch assert failures with condition"
set bp_location [gdb_get_line_number "STOP" ${testdir}/bla.adb]
mi_execute_to "exec-continue" \
- "\"breakpoint-hit\",disp=\"keep\",bkptno=\"$decimal\"" \
- "bla" "" ".*" "$bp_location" \
- ".*" \
- "continue to assert failure catchpoint hit"
+ "\"breakpoint-hit\",disp=\"keep\",bkptno=\"$decimal\"" \
+ "bla" "" ".*" "$bp_location" \
+ ".*" \
+ "continue to assert failure catchpoint hit"
# Exit the inferior.
mi_send_resuming_command "exec-continue" "continuing to inferior exit"
package Pck is
Global_Var : Integer := 0;
end Pck;
-
}
mi_gdb_test "-catch-exception" \
- "\\^done,bkptno=\"$decimal\",bkpt={.*disp=\"keep\",enabled=\"y\",what=\"all Ada exceptions\",.*}" \
- "catch all exceptions"
+ "\\^done,bkptno=\"$decimal\",bkpt={.*disp=\"keep\",enabled=\"y\",what=\"all Ada exceptions\",.*}" \
+ "catch all exceptions"
# Continue to caught exception.
}
mi_gdb_test "-catch-exception -e Program_Error" \
- "\\^done,bkptno=\"$decimal\",bkpt={.*disp=\"keep\",enabled=\"y\",what=\"`Program_Error' Ada exception\",.*}" \
- "catch Program_Error"
+ "\\^done,bkptno=\"$decimal\",bkpt={.*disp=\"keep\",enabled=\"y\",what=\"`Program_Error' Ada exception\",.*}" \
+ "catch Program_Error"
mi_gdb_test "-catch-assert" \
- "\\^done,bkptno=\"$decimal\",bkpt={.*disp=\"keep\",enabled=\"y\",what=\"failed Ada assertions\",.*}" \
- "catch assert failures"
+ "\\^done,bkptno=\"$decimal\",bkpt={.*disp=\"keep\",enabled=\"y\",what=\"failed Ada assertions\",.*}" \
+ "catch assert failures"
mi_gdb_test "-catch-exception -u" \
- "\\^done,bkptno=\"$decimal\",bkpt={.*disp=\"keep\",enabled=\"y\",what=\"unhandled Ada exceptions\",.*}" \
- "catch unhandled exceptions"
+ "\\^done,bkptno=\"$decimal\",bkpt={.*disp=\"keep\",enabled=\"y\",what=\"unhandled Ada exceptions\",.*}" \
+ "catch unhandled exceptions"
mi_execute_to "exec-continue" \
- "\"breakpoint-hit\",disp=\"keep\",bkptno=\"$any_nb\",exception-name=\"PROGRAM_ERROR(\",exception-message=\"foo\\.adb:$decimal explicit raise)?\"" \
- "foo" "" ".*" ".*" \
- ".*" \
- "continue to exception catchpoint hit"
+ "\"breakpoint-hit\",disp=\"keep\",bkptno=\"$any_nb\",exception-name=\"PROGRAM_ERROR(\",exception-message=\"foo\\.adb:$decimal explicit raise)?\"" \
+ "foo" "" ".*" ".*" \
+ ".*" \
+ "continue to exception catchpoint hit"
mi_execute_to "exec-continue" \
- "\"breakpoint-hit\",disp=\"keep\",bkptno=\"$any_nb\"" \
- "foo" "" ".*" ".*" \
- ".*" \
- "continue to assert failure catchpoint hit"
+ "\"breakpoint-hit\",disp=\"keep\",bkptno=\"$any_nb\"" \
+ "foo" "" ".*" ".*" \
+ ".*" \
+ "continue to assert failure catchpoint hit"
mi_execute_to "exec-continue" \
- "\"breakpoint-hit\",disp=\"keep\",bkptno=\"$any_nb\",exception-name=\"CONSTRAINT_ERROR\"" \
- "foo" "" ".*" ".*" \
- ".*" \
- "continue to unhandled exception catchpoint hit"
-
+ "\"breakpoint-hit\",disp=\"keep\",bkptno=\"$any_nb\",exception-name=\"CONSTRAINT_ERROR\"" \
+ "foo" "" ".*" ".*" \
+ ".*" \
+ "continue to unhandled exception catchpoint hit"
}
mi_gdb_test "-catch-handlers" \
- "\\^done,bkptno=\"$decimal\",bkpt={.*disp=\"keep\",enabled=\"y\",what=\"all Ada exceptions handlers\",.*}" \
- "catch all exceptions handlers"
+ "\\^done,bkptno=\"$decimal\",bkpt={.*disp=\"keep\",enabled=\"y\",what=\"all Ada exceptions handlers\",.*}" \
+ "catch all exceptions handlers"
# Continue to exception handler.
"\"breakpoint-hit\",disp=\"keep\",bkptno=\"$decimal\",exception-name=\"exception\"" \
"foo" "" ".*" "$line" \
".*" \
- $test
+ $test
}
# We don't have the exception name info when stopping at the exception handlers
}
mi_gdb_test "-catch-handlers -e Constraint_Error" \
- "\\^done,bkptno=\"$decimal\",bkpt={.*disp=\"keep\",enabled=\"y\",what=\"`Constraint_Error' Ada exception handlers\",.*}" \
- "catch Constraint_Error"
+ "\\^done,bkptno=\"$decimal\",bkpt={.*disp=\"keep\",enabled=\"y\",what=\"`Constraint_Error' Ada exception handlers\",.*}" \
+ "catch Constraint_Error"
mi_execute_to "exec-continue" \
- "\"breakpoint-hit\",disp=\"keep\",bkptno=\"$decimal\",exception-name=\"exception\"" \
- "foo" "" ".*" "$bp_ce_location" \
- ".*" \
- "continue to exception catchpoint hit"
+ "\"breakpoint-hit\",disp=\"keep\",bkptno=\"$decimal\",exception-name=\"exception\"" \
+ "foo" "" ".*" "$bp_ce_location" \
+ ".*" \
+ "continue to exception catchpoint hit"
# Exit the inferior.
mi_send_resuming_command "exec-continue" "continuing to inferior exit"
begin
Do_Nothing (BT'Address); -- STOP
end Foo;
-
# catchpoint that uses both conditions and exception name.
mi_gdb_test "-catch-exception -c \"i = 2\" -e constraint_error" \
- "\\^done,bkptno=\"$decimal\",bkpt={.*disp=\"keep\",enabled=\"y\",what=\"`constraint_error' Ada exception\",.*,cond=\"i = 2\",.*}" \
- "catch C_E if i = 2"
+ "\\^done,bkptno=\"$decimal\",bkpt={.*disp=\"keep\",enabled=\"y\",what=\"`constraint_error' Ada exception\",.*,cond=\"i = 2\",.*}" \
+ "catch C_E if i = 2"
# It is important that we start the program's execution after having
# inserted the exception catchpoint above. We want to verify that
mi_gdb_test "-info-ada-exceptions const.aint" \
"\\^done,ada-exceptions={nr_rows=\"2\",nr_cols=\"2\",hdr=\\\[{width=\"1\",alignment=\"-1\",col_name=\"name\",colhdr=\"Name\"},{width=\"1\",alignment=\"-1\",col_name=\"address\",colhdr=\"Address\"}\\\],body=\\\[{name=\"constraint_error\",address=\"$hex\"},{name=\"const.aint_global_gdb_e\",address=\"$hex\"}\\\]}" \
"-info-ada-exceptions const.aint"
-
mi_gdb_test "-ada-task-info 3" \
"\\^done,tasks={nr_rows=\"1\",nr_cols=\"8\",$ada_task_info_hdr,body=\\\[$task_3\\\]}" \
"-ada-task-info 3"
-
gdb_test_no_output "set language ada"
gdb_test "print some_minsym" \
- "'some_minsym' has unknown type; cast it to its declared type"
+ "'some_minsym' has unknown type; cast it to its declared type"
gdb_test "print integer(some_minsym)" \
- " = 1234"
+ " = 1234"
gdb_test "print &some_minsym" \
- " = \\(access <data variable, no debug info>\\) $hex <some_minsym>"
+ " = \\(access <data variable, no debug info>\\) $hex <some_minsym>"
gdb_test "print /x integer(&some_minsym)" \
- " = $hex"
+ " = $hex"
begin
Slice (4) := 4; -- START
end Foo;
-
runto "foo.adb:$bp_location"
gdb_test "ptype var" \
- "= array \\(0 .. -1\\) of integer"
+ "= array \\(0 .. -1\\) of integer"
# Try breaking on a nested function.
gdb_test "break first" \
- "Breakpoint $any_nb at $any_addr: file .*hello.adb, line $any_nb." \
- "break on nested function First"
+ "Breakpoint $any_nb at $any_addr: file .*hello.adb, line $any_nb." \
+ "break on nested function First"
gdb_test "break fourth" \
"Breakpoint $any_nb at $any_addr: file .*hello.adb, line $any_nb." \
clean_restart ${testfile}
gdb_test "print /x <symada__cS>" \
- "= \\(a => 0x60287af\\)" \
- "print <symada__cS> before loading symbols from ver.ads"
+ "= \\(a => 0x60287af\\)" \
+ "print <symada__cS> before loading symbols from ver.ads"
# Force the partial symbosl from ver.ads to be expanded into full symbols.
gdb_test \
"list ver.ads:16" \
[multi_line ".*" \
- "16\\s+package Ver is" \
- "17\\s+type Wrapper is record" \
- "18\\s+A : Integer;" \
- "19\\s+end record;" \
- "20\\s+u00045 : constant Wrapper := \\(A => 16#060287af#\\);"]
+ "16\\s+package Ver is" \
+ "17\\s+type Wrapper is record" \
+ "18\\s+A : Integer;" \
+ "19\\s+end record;" \
+ "20\\s+u00045 : constant Wrapper := \\(A => 16#060287af#\\);"]
gdb_test "print /x <symada__cS>" \
- "= \\(a => 0x60287af\\)" \
- "print <symada__cS> after loading symbols from ver.ads"
+ "= \\(a => 0x60287af\\)" \
+ "print <symada__cS> after loading symbols from ver.ads"
setup_xfail *-*-*
}
gdb_test "print my_table" \
- "= \\(\\)"
+ "= \\(\\)"
gdb_test "ptype my_table" \
- "type = array \\(10 \\.\\. 1\\) of integer"
+ "type = array \\(10 \\.\\. 1\\) of integer"
gdb_test "print my_matrix" \
- "= \\(m => \\((\"\", ){9}\"\"\\)\\)"
+ "= \\(m => \\((\"\", ){9}\"\"\\)\\)"
runto "null_record.adb:$bp_location"
gdb_test "ptype empty" \
- "type = record null; end record" \
- "ptype on null record"
+ "type = record null; end record" \
+ "ptype on null record"
begin
Do_Nothing (E); -- START
end Null_Record;
-
foreach op { "+" "-" "*" "/" "mod" "rem" "**" "<" "<=" ">" ">=" "=" "and" "or" "xor" "&" "abs" "not"} {
set op_re [string_to_regexp $op]
gdb_test "continue" \
- "Breakpoint $bkptno_numopt_re, ops\\.\"$op_re\" .*"\
- "continue to \"$op\""
+ "Breakpoint $bkptno_numopt_re, ops\\.\"$op_re\" .*"\
+ "continue to \"$op\""
}
# Perform the same test, but using the qualified name of the operator,
foreach op { "+" "-" } {
set op_re [string_to_regexp $op]
gdb_test "break ops.\"$op\"" \
- "Breakpoint $decimal at $hex: ops\\.\"$op_re\"\\. \\(2 locations\\)"
+ "Breakpoint $decimal at $hex: ops\\.\"$op_re\"\\. \\(2 locations\\)"
}
foreach op { "*" "/" "mod" "rem" "**" "<" "<=" ">" ">=" "=" "and" "or" "xor" "&" "abs" "not"} {
set op_re [string_to_regexp $op]
gdb_test "break ops.\"$op\"" \
- "Breakpoint $decimal at $hex: file .*ops.adb, line $decimal."
+ "Breakpoint $decimal at $hex: file .*ops.adb, line $decimal."
}
# Make sure we stop correctly in each operator function.
foreach op { "+" "-" "*" "/" "mod" "rem" "**" "<" "<=" ">" ">=" "=" "and" "or" "xor" "&" "abs" "not"} {
set op_re [string_to_regexp $op]
gdb_test "continue" \
- "Breakpoint $bkptno_numopt_re, ops\\.\"$op_re\" .*"\
- "continue to ops.\"$op\""
+ "Breakpoint $bkptno_numopt_re, ops\\.\"$op_re\" .*"\
+ "continue to ops.\"$op\""
}
-
-
end Dummy;
end Ops;
-
-
-
type Int is new IntRep;
end Ops;
-
-
}
gdb_test "print z" \
- "= (\\(a => .*, b => .*, c => .*\\)|<optimized out>)"
-
-
+ "= (\\(a => .*, b => .*, c => .*\\)|<optimized out>)"
begin
Do_Nothing (A2'Address); -- STOP
end Foo;
-
runto "foo_o508_021.adb:$bp_location"
gdb_test "print SSA" \
- "= \\(-1, 2, -3, 4\\)"
+ "= \\(-1, 2, -3, 4\\)"
gdb_test "print SSA(1)" \
- "= -1"
+ "= -1"
gdb_test "print SSA(2)" \
- "= 2"
+ "= 2"
gdb_test "print SSA(3)" \
- "= -3"
+ "= -3"
gdb_test "print SSA(4)" \
- "= 4"
+ "= 4"
}
gdb_test "print test.str" \
- "= \\(33 'A', nul <repeats 99 times>\\)"
+ "= \\(33 'A', nul <repeats 99 times>\\)"
gdb_test "print test.str(1)" \
- "= 33 'A'"
+ "= 33 'A'"
Test.Length := 1;
Do_Nothing (Test'Address); -- START
end;
-
runto "foo.adb:$bp_location"
gdb_test "print before" \
- " = Thu Nov 14 02:22:23 2013 \\(1384395743\\)"
+ " = Thu Nov 14 02:22:23 2013 \\(1384395743\\)"
gdb_test "print /r before" \
- " = \\(secs => 1384395743\\)"
+ " = \\(secs => 1384395743\\)"
gdb_test "print C" \
- "= 97 'a'"
+ "= 97 'a'"
gdb_test "print WC" \
- "= 98 'b'"
+ "= 98 'b'"
gdb_test "print WWC" \
- "= 99 'c'"
+ "= 99 'c'"
gdb_test "print MC" " = 77 'M'"
runto "dummy.adb:$bp_location"
gdb_test "p /x \$pc" \
- "= 0x\[0-9a-zA-Z\]+"
+ "= 0x\[0-9a-zA-Z\]+"
runto "foo.adb:$bp_location"
gdb_test "print my_blob.bees(1)" "= \\(access boolean\\) 0x0"
-
-
clean_restart
gdb_test_no_output "set lang ada" \
- "set lang ada"
+ "set lang ada"
gdb_test "ptype 3 * 2.0" \
- "= <\[0-9\]+-byte float>"
+ "= <\[0-9\]+-byte float>"
gdb_test "ptype 3 / 2.0" \
- "= <\[0-9\]+-byte float>"
+ "= <\[0-9\]+-byte float>"
null;
end Do_Nothing;
end Pck;
-
-
runto "foo.adb:$bp_location"
gdb_test "ptype circle" \
- [multi_line "type = record" \
- " pos: pck\\.position;" \
- " radius: integer;" \
- "end record" ]
+ [multi_line "type = record" \
+ " pos: pck\\.position;" \
+ " radius: integer;" \
+ "end record" ]
gdb_test "ptype circle.pos" \
- [multi_line "type = record" \
- " x: integer;" \
- " y: integer;" \
- "end record" ]
+ [multi_line "type = record" \
+ " x: integer;" \
+ " y: integer;" \
+ "end record" ]
gdb_test "ptype circle.pos.x" \
- "type = <\[0-9\]+-byte integer>"
+ "type = <\[0-9\]+-byte integer>"
gdb_test "complete print my_circ" "print my_circle"
gdb_test "complete print my_circle.r" "print my_circle\\.radius"
function Area (C : in Circle) return Integer;
end Pck;
-
runto "foo.adb:$bp_location"
gdb_test "python print(int(gdb.parse_and_eval('sr')))" \
- "48"
+ "48"
gdb_test "python print(int(gdb.parse_and_eval('si')))" \
- "740804"
+ "740804"
gdb_test "python print(int(gdb.parse_and_eval('ir')))" \
- "974"
+ "974"
# Accept "foo." prefix for older versions of GNAT.
gdb_test "python print(gdb.parse_and_eval('si').type)" \
# Switch to task 2, and verify that GDB is able to unwind all the way
# to foo.T.
gdb_test "task 2" \
- [join {"\\\[Switching to task 2 \"mit\"\\\].*" \
- ".*foo\\.t \\(.*\\).*foo\\.adb:.*"} ""]
+ [join {"\\\[Switching to task 2 \"mit\"\\\].*" \
+ ".*foo\\.t \\(.*\\).*foo\\.adb:.*"} ""]
gdb_test "task apply 1 -q frame" ".*pck\\.break_me.*"
Do_Nothing (R'Address);
Do_Nothing (IA'Address);
end Bar_O203_012;
-
}
gdb_test "print bar" \
- "= \\(x => 42, s => \"ABCDEFGH\"\\)"
+ "= \\(x => 42, s => \"ABCDEFGH\"\\)"
Q := Bar; -- STOP HERE
Do_Nothing (Q'Address);
end Foo;
-
null;
end Do_Nothing;
end Pck;
-
procedure Do_Nothing (A : System.Address);
end Pck;
-
set expected_d "\\(one => 1, two => 2, three => 3, four => 4, five => 5, six => 6\\)"
gdb_test "frame" \
- "#0\[ \t\]*pck\\.call_me \\(d=${expected_d}\\).*" \
- "frame argument value printed"
-
+ "#0\[ \t\]*pck\\.call_me \\(d=${expected_d}\\).*" \
+ "frame argument value printed"
# the size of d1.
gdb_test "print d1'size = d2'size" \
- "= true"
+ "= true"
Do_Nothing (D1'Address); -- START
Do_Nothing (D2'Address);
end P;
-
runto "pkg.adb:$bp_location"
gdb_test "print rename_subscript_param_b" \
- " = false" \
- "print rename_subscript_param_b before changing its value"
+ " = false" \
+ "print rename_subscript_param_b before changing its value"
set bp_location [gdb_get_line_number "Do_Nothing" ${testdir}/pkg.adb]
gdb_test "break pkg.adb:$bp_location" \
- "Breakpoint \[0-9\]+ at.*: file .*pkg.adb, line \[0-9\]+." \
- "insert second breakpoint in pkg.adb"
+ "Breakpoint \[0-9\]+ at.*: file .*pkg.adb, line \[0-9\]+." \
+ "insert second breakpoint in pkg.adb"
gdb_test "cont" \
- "Breakpoint \[0-9\]+, pkg.flip \\(.*" \
- "Continuing to breakpoint on call to Do_Nothing"
+ "Breakpoint \[0-9\]+, pkg.flip \\(.*" \
+ "Continuing to breakpoint on call to Do_Nothing"
gdb_test "print rename_subscript_param_b" \
- " = true" \
- "print rename_subscript_param_b after changing its value"
+ " = true" \
+ "print rename_subscript_param_b after changing its value"
runto "foo_oc22_002.adb:$bp_location"
gdb_test "print a1(1)@3" \
- " = \\(3, 5, 8\\)"
+ " = \\(3, 5, 8\\)"
null;
end Do_Nothing;
end Pck;
-
procedure Do_Nothing (A : System.Address);
end Pck;
-
# Insert a watchpoint on local variable "result"
gdb_test "watch result" \
- ".*atchpoint \[0-9\]+: result"
+ ".*atchpoint \[0-9\]+: result"
# Insert a breakpoint we'll reach after returning from the current
# function.
set bp_location [gdb_get_line_number "Do_Nothing" ${testdir}/foo_p708_025.adb]
gdb_test "break foo_p708_025.adb:$bp_location" \
- "Breakpoint \[0-9\]+ at.*: file .*foo_p708_025.adb, line \[0-9\]+."
+ "Breakpoint \[0-9\]+ at.*: file .*foo_p708_025.adb, line \[0-9\]+."
# This breakpoint will be there to stop us after we test what happens
# during a continue (see below...)
gdb_test "break pck.increment" \
- "Breakpoint \[0-9\]+ at.*: file .*pck.adb, line \[0-9\]+."
+ "Breakpoint \[0-9\]+ at.*: file .*pck.adb, line \[0-9\]+."
# Continue until we reach our watchpoint. It isn't strictly necessary
# for our purpose that the watchpoint actually triggers, but this shows
# that the watchpoint exists and is active.
gdb_test "cont" \
- ".*atchpoint \[0-9\]+: result.*Old value = 8.*New value = 64.*" \
- "continuing to watchpoint hit"
+ ".*atchpoint \[0-9\]+: result.*Old value = 8.*New value = 64.*" \
+ "continuing to watchpoint hit"
# Continue again. We should be stopped at the (internal) breakpoint
# that we setup to delete the watchpoint as soon as the program leaves
# (on the call to Do_Nothing) we set earlier.
gdb_test "cont" \
- "Breakpoint \[0-9\]+.*Do_Nothing.*" \
- "continuing to breakpoint on call to Do_Nothing"
+ "Breakpoint \[0-9\]+.*Do_Nothing.*" \
+ "continuing to breakpoint on call to Do_Nothing"
# Do a next, to verify that it works...
gdb_test "next" \
- ".* Call_Me;" \
- "next to call to Call_Me"
+ ".* Call_Me;" \
+ "next to call to Call_Me"
# And finally, one more continue.
gdb_test "cont" \
- "Breakpoint \[0-9\]+.*pck\\.increment.*" \
- "continuing to breakpoint in pck.increment"
+ "Breakpoint \[0-9\]+.*pck\\.increment.*" \
+ "continuing to breakpoint in pck.increment"
gdb_breakpoint "update_small"
gdb_test "continue" \
- "Breakpoint .*, pck\\.update_small \\(s=9\\) at .*pck.adb:.*" \
- "continue to update_small"
+ "Breakpoint .*, pck\\.update_small \\(s=9\\) at .*pck.adb:.*" \
+ "continue to update_small"
# And again for the second call.
gdb_test "continue" \
- "Breakpoint .*, pck\\.update_small \\(s=15\\) at .*pck.adb:.*" \
- "continue to update_small for va.t"
+ "Breakpoint .*, pck\\.update_small \\(s=15\\) at .*pck.adb:.*" \
+ "continue to update_small for va.t"
}
# Verify that assigning to Nnn (a basic string) works...
gdb_test "print nnn" \
- "= \"12345\"" \
- "print nnn before assignment"
+ "= \"12345\"" \
+ "print nnn before assignment"
gdb_test_no_output "set variable nnn := \"qcyom\""
gdb_test "print nnn" \
- "= \"qcyom\"" \
- "print nnn after assignment"
+ "= \"qcyom\"" \
+ "print nnn after assignment"
# Same with Www (a wide string)...
gdb_test "print www" \
- "= \"12345\"" \
- "print www before assignment"
+ "= \"12345\"" \
+ "print www before assignment"
gdb_test_no_output "set variable www := \"zenrk\""
gdb_test "print www" \
- "= \"zenrk\"" \
- "print www after assignment"
+ "= \"zenrk\"" \
+ "print www after assignment"
# Same with Rws (a wide wide string)...
gdb_test "print rws" \
- "= \"12345\"" \
- "print rws before assignment"
+ "= \"12345\"" \
+ "print rws before assignment"
gdb_test_no_output "set variable rws := \"ndhci\""
gdb_test "print rws" \
- "= \"ndhci\"" \
- "print rws after assignment"
+ "= \"ndhci\"" \
+ "print rws after assignment"
# Also, check that GDB doesn't get tricked if we assign to Www a
# string twice the length of Www. The debugger should reject the
# used to get tricked because the array size was the same).
gdb_test "set variable www := \"1#2#3#4#5#\"" \
- "cannot assign arrays of different length"
+ "cannot assign arrays of different length"
# However, reassigning an array of a different length should work when
# the LHS is a convenience variable.
# And just to make sure, we also verify that the parameter value
# is correct when we print it manually.
gdb_test "print w" " = 50"
-
}
gdb_test "" \
- "dummy \\(\\) at .*dummy.adb.*" \
- "start"
+ "dummy \\(\\) at .*dummy.adb.*" \
+ "start"
runto "foo_p211_061.adb:$bp_location"
gdb_test "print my_str = my_str" \
- " = true"
+ " = true"
gdb_test "print my_str = \"ABCD\"" \
" = true"
gdb_test "print my_str = \"EFGH\"" \
- " = false"
+ " = false"
gdb_test "print my_str = \"AB\"" \
- " = false"
+ " = false"
null;
end Do_Nothing;
end pck;
-
# Verify that we can compare a string slice with another string.
gdb_test "print String_Var (1 .. 3) = \"Hel\"" \
- "= true"
+ "= true"
gdb_test "print String_Var (1 .. 3) = \"hel\"" \
- "= false"
+ "= false"
gdb_test_multiple "print integervar" "$test_name" \
{
-re "$menu" {
- pass "$test_name"
+ pass "$test_name"
}
default {
- fail "$test_name"
+ fail "$test_name"
}
}
# Select the first choice from the multiple-choice menu above.
gdb_test "1" \
- "= 48" \
- "select first choice from multiple-choice menu"
-
+ "= 48" \
+ "select first choice from multiple-choice menu"
}
gdb_test "print w.e.all" \
- "= \\(month => 8, year => 1974\\)"
+ "= \\(month => 8, year => 1974\\)"
begin
W := Create;
end P; -- START
-
# class-wide.
gdb_test "ptype segm" \
- [multi_line "type = new pck\\.object with record" \
- " width: integer;" \
- "end record" ]
+ [multi_line "type = new pck\\.object with record" \
+ " width: integer;" \
+ "end record" ]
gdb_test "print segm" \
- "= \\(position => 74, width => 8\\)"
+ "= \\(position => 74, width => 8\\)"
# Now, test printing of an class-wide object.
gdb_test "ptype obj" \
- [multi_line "type = new pck\\.object with record" \
- " width: integer;" \
- "end record" ]
+ [multi_line "type = new pck\\.object with record" \
+ " width: integer;" \
+ "end record" ]
gdb_test "print obj" \
- "= \\(position => 74, width => 8\\)"
+ "= \\(position => 74, width => 8\\)"
end Do_Nothing;
end Pck;
-
-
procedure Do_Nothing (A : System.Address);
end Pck;
-
-
runto "foo.adb:$bp_location"
gdb_test "print obj" " = \\(x => -?$decimal\\)"
-
}
set all_linespecs { "pck.dummy_task" "dummy_task"
- "pck.adb:pck.dummy_task" "pck.adb:dummy_task"}
+ "pck.adb:pck.dummy_task" "pck.adb:dummy_task"}
# First, test the linespecs when the associated symtab hasn't been
# expanded yet.
# First, switch to task 1.
gdb_test "task 1" \
- "crash\\.request_for_crash \\(\\) at .*crash\\.adb:$decimal.*"
+ "crash\\.request_for_crash \\(\\) at .*crash\\.adb:$decimal.*"
gdb_test "info tasks" \
- [multi_line "\\s+ID\\s+TID\\s+P-ID\\s+Pri\\s+State\\s+Name" \
- "\\*\\s+1\\s+.*main_task" \
- "\\s+2.*my_t"] \
- "info tasks after switching to task 1"
+ [multi_line "\\s+ID\\s+TID\\s+P-ID\\s+Pri\\s+State\\s+Name" \
+ "\\*\\s+1\\s+.*main_task" \
+ "\\s+2.*my_t"] \
+ "info tasks after switching to task 1"
# Switch to task 2. Unlike in the case where we tested the switch to
# task 1, don't check the location where the debugger says the program
# we will verify right after with an additional test that the current
# task is now task 2.
gdb_test "task 2" \
- "\\\[Switching to task 2 \"my_t\"\\\].*"
+ "\\\[Switching to task 2 \"my_t\"\\\].*"
gdb_test "info tasks" \
- [multi_line "\\s+ID\\s+TID\\s+P-ID\\s+Pri\\s+State\\s+Name" \
- "\\s+1\\s+.*main_task" \
- "\\*\\s+2.*my_t"] \
- "info tasks after switching to task 2"
+ [multi_line "\\s+ID\\s+TID\\s+P-ID\\s+Pri\\s+State\\s+Name" \
+ "\\s+1\\s+.*main_task" \
+ "\\*\\s+2.*my_t"] \
+ "info tasks after switching to task 2"
# Make sure that all tasks appear in the "info tasks" listing, and
# that the active task is the environment task.
gdb_test "info tasks" \
- [join {" +ID +TID P-ID Pri State +Name" \
- "\\* +1 .* main_task" \
- " +2 .* task_list\\(1\\)" \
- " +3 .* task_list\\(2\\)" \
- " +4 .* task_list\\(3\\)"} \
- "\r\n"] \
- "info tasks before inserting breakpoint"
+ [join {" +ID +TID P-ID Pri State +Name" \
+ "\\* +1 .* main_task" \
+ " +2 .* task_list\\(1\\)" \
+ " +3 .* task_list\\(2\\)" \
+ " +4 .* task_list\\(3\\)"} \
+ "\r\n"] \
+ "info tasks before inserting breakpoint"
# Confirm that the "info threads" output lines up with the tasks list.
gdb_test "info threads" \
# task 3 will hit our breakpoint, and GDB is expected to stop at that
# point. Also make sure that GDB reports the correct breakpoint number.
gdb_test "continue" \
- ".*Breakpoint $bp_number, foo.break_me \\(\\).*" \
- "continue to breakpoint"
+ ".*Breakpoint $bp_number, foo.break_me \\(\\).*" \
+ "continue to breakpoint"
# Check that it is indeed task 3 that hit the breakpoint by checking
# which is the active task.
gdb_test "info tasks" \
- [join {" +ID +TID P-ID Pri State +Name" \
- " +1 .* main_task" \
- " +2 .* task_list\\(1\\)" \
- "\\* +3 .* task_list\\(2\\)" \
- " +4 .* task_list\\(3\\)"} \
- "\r\n"] \
- "info tasks after hitting breakpoint"
+ [join {" +ID +TID P-ID Pri State +Name" \
+ " +1 .* main_task" \
+ " +2 .* task_list\\(1\\)" \
+ "\\* +3 .* task_list\\(2\\)" \
+ " +4 .* task_list\\(3\\)"} \
+ "\r\n"] \
+ "info tasks after hitting breakpoint"
# Now, resume the execution and make sure that GDB does not stop when
# task 4 hits the breakpoint. Continuing thus results in our program
# The actual value printed is of no interest in this testcase.
gdb_test "print short_integer'first" \
- "= -\[0-9\]+" \
- "print short-integer'first"
+ "= -\[0-9\]+" \
+ "print short-integer'first"
gdb_test "print short_integer'last" \
- "= \[0-9\]+" \
- "print short-integer'last"
-
+ "= \[0-9\]+" \
+ "print short-integer'last"
null;
end Do_Nothing;
end Pck;
-
-
procedure Do_Nothing (A : System.Address);
end Pck;
-
runto "assign.adb:$bp_location"
gdb_test "p q" \
- "= \\(2, 3, 5, 7, 11\\)" "initial value of q"
+ "= \\(2, 3, 5, 7, 11\\)" "initial value of q"
gdb_test_no_output "set \$addr := q'address" \
- "save q'address in convenience variable"
+ "save q'address in convenience variable"
gdb_test "p {Integer} \$addr" \
- "= 2" \
- "print {Integer} \$addr"
+ "= 2" \
+ "print {Integer} \$addr"
# Now change the value at $addr using the same "{TYPE}" syntax.
gdb_test_no_output "set {Integer} \$addr := 19" \
- "set {Integer} \$addr := 19"
+ "set {Integer} \$addr := 19"
gdb_test "p q" \
- "= \\(19, 3, 5, 7, 11\\)" "modified value of q"
+ "= \\(19, 3, 5, 7, 11\\)" "modified value of q"
Do_Nothing (My_Object'Address); -- STOP2
Do_Nothing (My_P_Object'Address);
end Foo;
-
# Check that printing uninitialized variables does not crash the debugger.
gdb_test "info locals" \
- ".*"
+ ".*"
Do_Nothing (My_Object'Address); -- STOP
Do_Nothing (My_Small_Object'Address);
end Foo_O115_002;
-
set a "\\($va, $va, $vb, $vb\\)"
gdb_test "print va" \
- " = $va"
+ " = $va"
gdb_test "print vb" \
- " = $vb"
+ " = $vb"
gdb_test "print a" \
- " = $a"
+ " = $a"
runto "vla.adb:$bp_location"
gdb_test "print r00" \
- "= \\(l1 => 0, l2 => 0, i1 => 1, a1 => \\(\\), i2 => 2, a2 => \\(\\), i3 => 3\\)"
+ "= \\(l1 => 0, l2 => 0, i1 => 1, a1 => \\(\\), i2 => 2, a2 => \\(\\), i3 => 3\\)"
gdb_test "print r01" \
- "= \\(l1 => 0, l2 => 1, i1 => 1, a1 => \\(\\), i2 => 2, a2 => \\(20\\), i3 => 3\\)"
+ "= \\(l1 => 0, l2 => 1, i1 => 1, a1 => \\(\\), i2 => 2, a2 => \\(20\\), i3 => 3\\)"
gdb_test "print r10" \
- "= \\(l1 => 1, l2 => 0, i1 => 1, a1 => \\(10\\), i2 => 2, a2 => \\(\\), i3 => 3\\)"
+ "= \\(l1 => 1, l2 => 0, i1 => 1, a1 => \\(10\\), i2 => 2, a2 => \\(\\), i3 => 3\\)"
gdb_test "print r22" \
- "= \\(l1 => 2, l2 => 2, i1 => 1, a1 => \\(10, 10\\), i2 => 2, a2 => \\(20, 20\\), i3 => 3\\)"
+ "= \\(l1 => 2, l2 => 2, i1 => 1, a1 => \\(10, 10\\), i2 => 2, a2 => \\(20, 20\\), i3 => 3\\)"
# Insert a watchpoint on argument X
gdb_test "watch x" \
- ".*atchpoint \[0-9\]+: x" \
- "set watchpoint on function argument X"
+ ".*atchpoint \[0-9\]+: x" \
+ "set watchpoint on function argument X"
# Then insert a breakpoint at the location we'd like to continue to...
set bp_location [gdb_get_line_number "BREAK2" ${testdir}/watch.adb]
gdb_test "break watch.adb:$bp_location" \
- "Breakpoint \[0-9\]+ at.*: file .*watch.adb, line \[0-9\]+." \
- "insert second breakpoint in watch.adb"
+ "Breakpoint \[0-9\]+ at.*: file .*watch.adb, line \[0-9\]+." \
+ "insert second breakpoint in watch.adb"
# Continue again. We should be stopped at the (internal) breakpoint
# that we setup to delete the watchpoint as soon as the program leaves
# we inserted.
gdb_test "cont" \
- "Breakpoint \[0-9\]+, watch \\(\\).*" \
- "continuing to second breakpoint"
-
-
+ "Breakpoint \[0-9\]+, watch \\(\\).*" \
+ "continuing to second breakpoint"
Foo (X);
X := 2; -- BREAK2
end Watch;
-
# Insert a watchpoint on argument X
gdb_test "watch -location pck.global_var" \
- ".*atchpoint \[0-9\]+: -location pck.global_var"
+ ".*atchpoint \[0-9\]+: -location pck.global_var"
# Continue again. We should be stopped at the (internal) breakpoint
# that we setup to delete the watchpoint as soon as the program leaves
# Accept "foo." prefix for older versions of GNAT.
gdb_test "whatis full" \
- "type = (foo\\.)?full_table"
+ "type = (foo\\.)?full_table"
gdb_test "print full" \
- " = \\(144, 233, 377, 610, 987\\)"
+ " = \\(144, 233, 377, 610, 987\\)"
gdb_test "whatis $" \
- "type = (foo\\.)?full_table"
-
+ "type = (foo\\.)?full_table"
begin
Do_Nothing (Full'Address); -- STOP
end Foo;
-
set loc [gdb_get_line_number "Integer" ${testdir}/foo.adb]
gdb_test "info line foo.adb:$loc" \
- "Line $decimal of \".*foo\\.adb\" starts at address $hex <_ada_foo\\+$decimal> and ends at $hex <_ada_foo\\+$decimal>\\." \
- "info line on variable declaration"
+ "Line $decimal of \".*foo\\.adb\" starts at address $hex <_ada_foo\\+$decimal> and ends at $hex <_ada_foo\\+$decimal>\\." \
+ "info line on variable declaration"
set loc [gdb_get_line_number "Do_Nothing" ${testdir}/foo.adb]
gdb_test "info line foo.adb:$loc" \
- "Line $decimal of \".*foo\\.adb\" starts at address $hex <_ada_foo\\+$decimal> and ends at $hex <_ada_foo\\+$decimal>\\." \
- "info line on Do_Nothing call"
-
+ "Line $decimal of \".*foo\\.adb\" starts at address $hex <_ada_foo\\+$decimal> and ends at $hex <_ada_foo\\+$decimal>\\." \
+ "info line on Do_Nothing call"
/* Test that we can step over ldxr/stxr. This sequence should step from
ldxr to the following __asm __volatile. */
__asm __volatile ("1: ldxr %0,%2\n" \
- " cmp %0,#1\n" \
- " b.eq out\n" \
- " add %0,%0,1\n" \
- " stxr %w1,%0,%2\n" \
- " cbnz %w1,1b" \
- : "=&r" (tmp), "=&r" (cond), "+Q" (dword) \
- : : "memory");
+ " cmp %0,#1\n" \
+ " b.eq out\n" \
+ " add %0,%0,1\n" \
+ " stxr %w1,%0,%2\n" \
+ " cbnz %w1,1b" \
+ : "=&r" (tmp), "=&r" (cond), "+Q" (dword) \
+ : : "memory");
/* This sequence should take the conditional branch and step from ldxr
to the return dword line. */
__asm __volatile ("1: ldxr %0,%2\n" \
- " cmp %0,#1\n" \
- " b.eq out\n" \
- " add %0,%0,1\n" \
- " stxr %w1,%0,%2\n" \
- " cbnz %w1,1b\n" \
- : "=&r" (tmp), "=&r" (cond), "+Q" (dword) \
- : : "memory");
+ " cmp %0,#1\n" \
+ " b.eq out\n" \
+ " add %0,%0,1\n" \
+ " stxr %w1,%0,%2\n" \
+ " cbnz %w1,1b\n" \
+ : "=&r" (tmp), "=&r" (cond), "+Q" (dword) \
+ : : "memory");
dword = -1;
__asm __volatile ("out:\n");
iov.iov_base = &dreg_state;
iov.iov_len = (offsetof (struct user_hwdebug_state, dbg_regs)
- + sizeof (dreg_state.dbg_regs[0]));
+ + sizeof (dreg_state.dbg_regs[0]));
errno = 0;
l = ptrace (PTRACE_SETREGSET, pid, NT_ARM_HW_WATCH, &iov);
if (errno != 0)
set test "continue to exit"
gdb_test_multiple "continue" "$test" {
-re "exited with code 01.*$gdb_prompt $" {
- # For case that the PTRACE_SETREGSET call fails.
- pass "$test"
+ # For case that the PTRACE_SETREGSET call fails.
+ pass "$test"
}
-re "exited normally.*$gdb_prompt $" {
- pass "$test"
+ pass "$test"
}
}
main (void)
{
char buf0[] = {0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
- 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f};
+ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f};
char buf1[] = {0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
- 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f};
+ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f};
long val;
void *addr;
return 1;
}
-
"$ne_1:\n"
" ret $31,($26),1\n"
" .end ne\n");
-
-
# of the previous tests, this makes sure that it doesn't affect
# this series of tests.
if {![runto_main]} {
- return 0
+ return 0
}
# Insert a breakpoint on the FP branch instruction inside FUNCTION.
# Since the function has been hand written, we know this instruction
# is a "fb$function" located at FUNCTION+4.
gdb_test "break *$function+4" \
- "Breakpoint .* at .*" \
- "breakpoint on fb$function instruction"
+ "Breakpoint .* at .*" \
+ "breakpoint on fb$function instruction"
gdb_test "continue" \
- "Breakpoint .*, 0x\[0-9a-fA-F\]+ in $function\(\).*" \
- "continue to fb$function instruction (first call)"
+ "Breakpoint .*, 0x\[0-9a-fA-F\]+ in $function\(\).*" \
+ "continue to fb$function instruction (first call)"
# Extra check to make sure we stopped on the FP branch instruction.
gdb_test "x /i \$pc" \
- "0x\[0-9a-fA-F\]+ <.*>:\[ \t\]+fb$function.*" \
- "Check breakpoint on fb$function instruction (first call)"
+ "0x\[0-9a-fA-F\]+ <.*>:\[ \t\]+fb$function.*" \
+ "Check breakpoint on fb$function instruction (first call)"
# Step test, followed by the check that we landed on the expected
# instruction (the testcase should be written in such a way that
# the branch is taken on the first call to this function.
gdb_test "stepi" \
- "0x\[0-9a-fA-F\]+.*" \
- "stepi on fb$function (first call)"
+ "0x\[0-9a-fA-F\]+.*" \
+ "stepi on fb$function (first call)"
gdb_test "x /i \$pc" \
- "0x\[0-9a-fA-F\]+ <.*>:\[ \t\]+ret.*" \
- "Check stepi over fb$function stopped on ret"
+ "0x\[0-9a-fA-F\]+ <.*>:\[ \t\]+ret.*" \
+ "Check stepi over fb$function stopped on ret"
# Continue again. FUNCTION should be called a second time, this time
# with an argument such that the FP branch will not be taken.
gdb_test "continue" \
- "Breakpoint .*, 0x\[0-9a-fA-F\]+ in $function\(\).*" \
- "continue to fb$function instruction (second call)"
+ "Breakpoint .*, 0x\[0-9a-fA-F\]+ in $function\(\).*" \
+ "continue to fb$function instruction (second call)"
# Extra check to make sure we stopped on the FP branch instruction.
gdb_test "x /i \$pc" \
- "0x\[0-9a-fA-F\]+ <.*>:\[ \t\]+fb$function.*" \
- "Check breakpoint on fb$function instruction (second call)"
+ "0x\[0-9a-fA-F\]+ <.*>:\[ \t\]+fb$function.*" \
+ "Check breakpoint on fb$function instruction (second call)"
# Step test, branch should not be taken.
gdb_test "stepi" \
- "0x\[0-9a-fA-F\]+.*" \
- "stepi on fb$function (branch not taken)"
+ "0x\[0-9a-fA-F\]+.*" \
+ "stepi on fb$function (branch not taken)"
# Extra check to verify that we landed on the instruction we expected.
gdb_test "x /i \$pc" \
- "0x\[0-9a-fA-F\]+ <.*>:\[ \t\]+fneg.*" \
- "check stepi over fb$function stopped on fneg instruction"
+ "0x\[0-9a-fA-F\]+ <.*>:\[ \t\]+fneg.*" \
+ "check stepi over fb$function stopped on fneg instruction"
}
test_stepi "le"
test_stepi "eq"
test_stepi "ne"
-
vector int
vec_func (vector short vshort_f, /* goes in v2 */
- vector unsigned short vushort_f, /* goes in v3 */
- vector int vint_f, /* goes in v4 */
- vector unsigned int vuint_f, /* goes in v5 */
- vector char vchar_f, /* goes in v6 */
- vector unsigned char vuchar_f, /* goes in v7 */
- vector float vfloat_f, /* goes in v8 */
- vector short x_f, /* goes in v9 */
- vector int y_f, /* goes in v10 */
- vector char a_f, /* goes in v11 */
- vector float b_f, /* goes in v12 */
- vector float c_f, /* goes in v13 */
- vector int intv_on_stack_f)
+ vector unsigned short vushort_f, /* goes in v3 */
+ vector int vint_f, /* goes in v4 */
+ vector unsigned int vuint_f, /* goes in v5 */
+ vector char vchar_f, /* goes in v6 */
+ vector unsigned char vuchar_f, /* goes in v7 */
+ vector float vfloat_f, /* goes in v8 */
+ vector short x_f, /* goes in v9 */
+ vector int y_f, /* goes in v10 */
+ vector char a_f, /* goes in v11 */
+ vector float b_f, /* goes in v12 */
+ vector float c_f, /* goes in v13 */
+ vector int intv_on_stack_f)
{
vector int vint_res;
vuint_res = vec_add (vuint_f, ((vector unsigned int) {5,6,7,8}));
vshort_res = vec_add (vshort_f, x_f);
vushort_res = vec_add (vushort_f,
- ((vector unsigned short) {1,2,3,4,5,6,7,8}));
+ ((vector unsigned short) {1,2,3,4,5,6,7,8}));
vchar_res = vec_add (vchar_f, a_f);
vfloat_res = vec_add (vfloat_f, b_f);
vfloat_res = vec_add (c_f, ((vector float) {1.1,1.1,1.1,1.1}));
vuchar_res = vec_add (vuchar_f,
- ((vector unsigned char) {'a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a'}));
+ ((vector unsigned char) {'a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a'}));
return vint_res;
}
vec_func(vshort,vushort,vint,vuint,vchar,vuchar,vfloat,x,y,a,b,c,intv_on_stack)
#endif
result = vec_func (vshort, /* goes in v2 */
- vushort, /* goes in v3 */
- vint, /* goes in v4 */
- vuint, /* goes in v5 */
- vchar, /* goes in v6 */
- vuchar, /* goes in v7 */
- vfloat, /* goes in v8 */
- x, /* goes in v9 */
- y, /* goes in v10 */
- a, /* goes in v11 */
- b, /* goes in v12 */
- c, /* goes in v13 */
- intv_on_stack);
+ vushort, /* goes in v3 */
+ vint, /* goes in v4 */
+ vuint, /* goes in v5 */
+ vchar, /* goes in v6 */
+ vuchar, /* goes in v7 */
+ vfloat, /* goes in v8 */
+ x, /* goes in v9 */
+ y, /* goes in v10 */
+ a, /* goes in v11 */
+ b, /* goes in v12 */
+ c, /* goes in v13 */
+ intv_on_stack);
struct_of_vector_func (vect_struct);
array_of_vector_func (test4);
return 0;
}
-
# set all the registers integer portions to 1
for {set i 0} {$i < 32} {incr i 1} {
- for {set j 0} {$j < 4} {incr j 1} {
- gdb_test "set \$vr$i.v4_int32\[$j\] = 1" "" "set reg vr$i.v4si.f\[$j\]"
- }
+ for {set j 0} {$j < 4} {incr j 1} {
+ gdb_test "set \$vr$i.v4_int32\[$j\] = 1" "" "set reg vr$i.v4si.f\[$j\]"
+ }
}
gdb_test "set \$vscr = 1" "" ""
gdb_test "finish" \
"Run till exit from .0 vector_fun \\(a=.0x2020202, 0x2020202, 0x2020202, 0x2020202., b=.0x3030303, 0x3030303, 0x3030303, 0x3030303.\\) at.*altivec-regs.c.*in main \\(\\) at.*altivec-regs.c.*z = vector_fun \\(x, y\\);.*Value returned is.*= .0x5050505, 0x5050505, 0x5050505, 0x5050505." \
"finish returned correct value"
-
-
-
#
set ws "\[\t \]+"
set info_reg_out [multi_line "info register fs_base gs_base" \
- "fs_base${ws}0x2${ws}2"\
- "gs_base${ws}0x3${ws}3" ]
+ "fs_base${ws}0x2${ws}2"\
+ "gs_base${ws}0x3${ws}3" ]
gdb_test "info register fs_base gs_base" $info_reg_out\
"info registers fs_base and gs_base with value"
gdb_continue_to_breakpoint "first time in g" ".* v = 2;"
gdb_test "return" { f \(\); /\* second \*/} "return" \
- {Make g return now\? \(y or n\) } "y"
+ {Make g return now\? \(y or n\) } "y"
gdb_continue_to_breakpoint "second time in g" ".* v = 2;"
set regs [saved_regs_to_str {fp blink} alloca_inner]
gdb_test "info frame 1" ".*Saved registers:$regs" \
"saved registers in alloca_outer"
-
foreach test $branch_test_list {
test_branch_insn $test
}
-
gdb_test "show disassembler-options" \
"The current disassembler options are '$option'.*" \
"show disassembler-options $option, modified architecture"
-
gdb_test_multiple "break *test_ldr_literal" "" {
-re "Breakpoint.*at.* file .*$srcfile, line.*\r\n$gdb_prompt $" {
- pass $gdb_test_name
+ pass $gdb_test_name
}
-re "No symbol.*\r\n$gdb_prompt $" {
- return 0
+ return 0
}
}
vector int
vec_func (vector unsigned int a_vec_f,
- vector int b_vec_f,
- vector float c_vec_f,
- vector unsigned int d_vec_f,
- vector int e_vec_f,
- vector unsigned short f_vec_f,
- vector short g_vec_f,
- vector float h_vec_f,
- vector float i_vec_f,
- vector unsigned int l_vec_f,
- vector int m_vec_f)
+ vector int b_vec_f,
+ vector float c_vec_f,
+ vector unsigned int d_vec_f,
+ vector int e_vec_f,
+ vector unsigned short f_vec_f,
+ vector short g_vec_f,
+ vector float h_vec_f,
+ vector float i_vec_f,
+ vector unsigned int l_vec_f,
+ vector int m_vec_f)
{
vector int n_vec;
#endif
res_vec = vec_func (a_vec, /* goes in r3 */
- b_vec, /* goes in r4 */
- c_vec, /* goes in r5 */
- d_vec, /* goes in r6 */
- e_vec, /* goes in r7 */
- f_vec, /* goes in r8 */
- g_vec, /* goes in r9 */
- h_vec, /* goes in r10 */
- i_vec, /* goes in stack */
- l_vec, /* goes in stack */
- m_vec); /* goes in stack */
+ b_vec, /* goes in r4 */
+ c_vec, /* goes in r5 */
+ d_vec, /* goes in r6 */
+ e_vec, /* goes in r7 */
+ f_vec, /* goes in r8 */
+ g_vec, /* goes in r9 */
+ h_vec, /* goes in r10 */
+ i_vec, /* goes in stack */
+ l_vec, /* goes in stack */
+ m_vec); /* goes in stack */
return 0;
}
# Insert a breakpoint using the given function name, and extract
# the breakpoint address for the output.
gdb_test_multiple "break $function" "set breakpoint in $function" {
- -re "Breakpoint 1 at ($hex).*$gdb_prompt $" {
- set address $expect_out(1,string)
- }
- default {
- fail "set breakpoint in $function"
- }
+ -re "Breakpoint 1 at ($hex).*$gdb_prompt $" {
+ set address $expect_out(1,string)
+ }
+ default {
+ fail "set breakpoint in $function"
+ }
}
# If we managed to get the breakpoing address, then check that
# the instruction).
if {$address != ""} {
gdb_test "x /i $address" \
- ".*<$function\\+$expected_location>.*" \
- "check $function breakpoint address"
+ ".*<$function\\+$expected_location>.*" \
+ "check $function breakpoint address"
} else {
fail "unable to compute breakpoint address"
}
# set all the registers integer portions to 1
for {set i 0} {$i < 32} {incr i 1} {
- for {set j 0} {$j < 2} {incr j 1} {
- gdb_test "set \$ev$i.v2_int32\[$j\] = 1" "" "set reg ev$i.v4si.f\[$j\]"
- }
+ for {set j 0} {$j < 2} {incr j 1} {
+ gdb_test "set \$ev$i.v2_int32\[$j\] = 1" "" "set reg ev$i.v4si.f\[$j\]"
+ }
}
# Now execute some target code, so that GDB's register cache is flushed.
}
for {set i 0} {$i < 32} {incr i 1} {
- gdb_test "info reg ev$i" "ev$i.*$vector_register" "info reg ev$i"
+ gdb_test "info reg ev$i" "ev$i.*$vector_register" "info reg ev$i"
}
# Test whether the GPRs are updated accordingly. (GPRs are just the lower
set general_register "0x1\[ \t\]+1"
for {set i 0} {$i < 32} {incr i 1} {
- gdb_test "info reg r$i" "r$i.*$general_register" "info reg r$i"
+ gdb_test "info reg r$i" "r$i.*$general_register" "info reg r$i"
}
# Now redo the same tests, but using the print command.
}
for {set i 0} {$i < 32} {incr i 1} {
- gdb_test "print \$ev$i" ".* = $decimal_vector" "print ev$i"
+ gdb_test "print \$ev$i" ".* = $decimal_vector" "print ev$i"
}
for {set i 0} {$i < 32} {incr i 1} {
- set pattern$i ".*ev$i.*"
- append pattern$i $vector_register
+ set pattern$i ".*ev$i.*"
+ append pattern$i $vector_register
}
send_gdb "info vector\n"
gdb_test "finish" \
"Run till exit from .0 vector_fun \\(a=.2, 2., b=.3, 3.\\) at.*e500-regs.c.*main \\(\\) at.*e500-regs.c.*z = vector_fun \\(x, y\\);.*Value returned is.*= .2, 2." \
"finish returned correct value"
-
-
-
}
gdb_test "break [gdb_get_line_number "first breakpoint here"]" \
- "Breakpoint .* at .*i386-avx.c.*" \
- "set first breakpoint in main"
+ "Breakpoint .* at .*i386-avx.c.*" \
+ "set first breakpoint in main"
gdb_continue_to_breakpoint "continue to first breakpoint in main"
if {[is_amd64_regs_target]} {
for { set r 0 } { $r < $nr_regs } { incr r } {
gdb_test "print \$ymm$r.v8_float" \
- ".. = \\{$r, $r.125, $r.25, $r.375, $r.5, $r.625, $r.75, $r.875\\}.*" \
- "check float contents of %ymm$r"
+ ".. = \\{$r, $r.125, $r.25, $r.375, $r.5, $r.625, $r.75, $r.875\\}.*" \
+ "check float contents of %ymm$r"
gdb_test "print \$ymm$r.v32_int8" \
- ".. = \\{(-?\[0-9\]+, ){31}-?\[0-9\]+\\}.*" \
- "check int8 contents of %ymm$r"
+ ".. = \\{(-?\[0-9\]+, ){31}-?\[0-9\]+\\}.*" \
+ "check int8 contents of %ymm$r"
}
for { set r 0 } { $r < $nr_regs } { incr r } {
}
gdb_test "break [gdb_get_line_number "second breakpoint here"]" \
- "Breakpoint .* at .*i386-avx.c.*" \
- "set second breakpoint in main"
+ "Breakpoint .* at .*i386-avx.c.*" \
+ "set second breakpoint in main"
gdb_continue_to_breakpoint "continue to second breakpoint in main"
for { set r 0 } { $r < $nr_regs } { incr r } {
gdb_test "print data\[$r\]" \
- ".. = \\{f = \\{[expr {$r + 10}], $r.125, $r.25, $r.375, $r.5, $r.625, $r.75, $r.875\\}\\}.*" \
- "check contents of data\[$r\]"
+ ".. = \\{f = \\{[expr {$r + 10}], $r.125, $r.25, $r.375, $r.5, $r.625, $r.75, $r.875\\}\\}.*" \
+ "check contents of data\[$r\]"
}
# If testing with a remote protocol target, check that we can
set test "probe AVX512 support"
gdb_test_multiple "print have_avx512()" $test {
-re ".. = 1\r\n$gdb_prompt $" {
- pass $test
- set supports_avx512 1
+ pass $test
+ set supports_avx512 1
}
-re ".. = 0\r\n$gdb_prompt $" {
- pass $test
+ pass $test
}
}
for { set r 1 } { $r < $nr_regs } { incr r } {
gdb_test "print/x \$k$r" \
- ".. = 0x[format %x $r]2[format %x $r]1" \
- "check contents of %k$r"
+ ".. = 0x[format %x $r]2[format %x $r]1" \
+ "check contents of %k$r"
}
for { set r 1 } { $r < $nr_regs } { incr r } {
for { set r 0 } { $r < $nr_regs } { incr r } {
set val [expr {$r + 1}]
gdb_test "print/x k_data\[$r\]" \
- ".. = 0x$val$val$val$val" \
- "check contents of k_data\[$r\]"
+ ".. = 0x$val$val$val$val" \
+ "check contents of k_data\[$r\]"
}
gdb_test "break [gdb_get_line_number "third breakpoint here"]" \
for { set r 0 } { $r < $nr_regs } { incr r } {
gdb_test "print \$zmm$r.v8_double" \
- ".. = \\{$r, $r.125, $r.25, $r.375, $r.5, $r.625, $r.75, $r.875\\}.*" \
- "check double contents of %zmm$r"
+ ".. = \\{$r, $r.125, $r.25, $r.375, $r.5, $r.625, $r.75, $r.875\\}.*" \
+ "check double contents of %zmm$r"
gdb_test "print \$zmm$r.v32_int16" \
- ".. = \\{(-?\[0-9\]+, ){31}-?\[0-9\]+\\}.*" \
- "check int16 contents of %zmm$r"
+ ".. = \\{(-?\[0-9\]+, ){31}-?\[0-9\]+\\}.*" \
+ "check int16 contents of %zmm$r"
gdb_test "print \$ymm$r.v4_double" \
- ".. = \\{$r, $r.125, $r.25, $r.375\\}.*" \
- "check float contents of %ymm$r"
+ ".. = \\{$r, $r.125, $r.25, $r.375\\}.*" \
+ "check float contents of %ymm$r"
gdb_test "print \$ymm$r.v16_int16" \
- ".. = \\{(-?\[0-9\]+, ){15}-?\[0-9\]+\\}.*" \
- "check int16 contents of %ymm$r"
+ ".. = \\{(-?\[0-9\]+, ){15}-?\[0-9\]+\\}.*" \
+ "check int16 contents of %ymm$r"
gdb_test "print \$xmm$r.v2_double" \
- ".. = \\{$r, $r.125\\}.*" \
- "check float contents of %xmm$r"
+ ".. = \\{$r, $r.125\\}.*" \
+ "check float contents of %xmm$r"
gdb_test "print \$xmm$r.v8_int16" \
- ".. = \\{(-?\[0-9\]+, ){7}-?\[0-9\]+\\}.*" \
- "check int16 contents of %xmm$r"
+ ".. = \\{(-?\[0-9\]+, ){7}-?\[0-9\]+\\}.*" \
+ "check int16 contents of %xmm$r"
}
for { set r 0 } { $r < $nr_regs } { incr r } {
for { set r 0 } { $r < $nr_regs } { incr r } {
gdb_test "print zmm_data\[$r\]" \
- ".. = \\{f = \\{[expr {$r + 10}], [expr {$r + 10.125}], [expr {$r + 10.25}], [expr {$r + 10.375}], [expr {$r + 10.5}], [expr {$r + 10.625}], [expr {$r +10.75}], [expr {$r + 10.875}]\\}\\}.*" \
- "check contents of zmm_data\[$r\] after writing ZMM regs"
+ ".. = \\{f = \\{[expr {$r + 10}], [expr {$r + 10.125}], [expr {$r + 10.25}], [expr {$r + 10.375}], [expr {$r + 10.5}], [expr {$r + 10.625}], [expr {$r +10.75}], [expr {$r + 10.875}]\\}\\}.*" \
+ "check contents of zmm_data\[$r\] after writing ZMM regs"
}
for { set r 0 } { $r < $nr_regs } { incr r } {
for { set r 0 } { $r < $nr_regs } { incr r } {
gdb_test "print zmm_data\[$r\]" \
- ".. = \\{f = \\{[expr {$r + 20}], [expr {$r + 20.125}], [expr {$r + 20.25}], [expr {$r + 20.375}], [expr {$r + 10.5}], [expr {$r + 10.625}], [expr {$r + 10.75}], [expr {$r + 10.875}]\\}\\}.*" \
- "check contents of zmm_data\[$r\] after writing YMM regs"
+ ".. = \\{f = \\{[expr {$r + 20}], [expr {$r + 20.125}], [expr {$r + 20.25}], [expr {$r + 20.375}], [expr {$r + 10.5}], [expr {$r + 10.625}], [expr {$r + 10.75}], [expr {$r + 10.875}]\\}\\}.*" \
+ "check contents of zmm_data\[$r\] after writing YMM regs"
}
for { set r 0 } { $r < $nr_regs } { incr r } {
for { set r 0 } { $r < $nr_regs } { incr r } {
gdb_test "print zmm_data\[$r\]" \
- ".. = \\{f = \\{[expr {$r + 30}], [expr {$r + 30.125}], [expr {$r + 20.25}], [expr {$r + 20.375}], [expr {$r + 10.5}], [expr {$r + 10.625}], [expr {$r + 10.75}], [expr {$r + 10.875}]\\}\\}.*" \
- "check contents of zmm_data\[$r\] after writing XMM regs"
+ ".. = \\{f = \\{[expr {$r + 30}], [expr {$r + 30.125}], [expr {$r + 20.25}], [expr {$r + 20.375}], [expr {$r + 10.5}], [expr {$r + 10.625}], [expr {$r + 10.75}], [expr {$r + 10.875}]\\}\\}.*" \
+ "check contents of zmm_data\[$r\] after writing XMM regs"
}
gdb_test "break [gdb_get_line_number "seventh breakpoint here"]" \
using the following source file:
- void *gate (void *(*gate) (void *data), void *data)
- {
- return 1 + (*gate) (data);
- }
+ void *gate (void *(*gate) (void *data), void *data)
+ {
+ return 1 + (*gate) (data);
+ }
Changes are marked as `CHANGE' below. */
# We see there the original CFI-stored filename `gate.c'.
gdb_test "frame $gate_n" \
- "gate \\(\[^()\]*\\) at .*gate.c.*" \
- "shift up to the modified frame"
+ "gate \\(\[^()\]*\\) at .*gate.c.*" \
+ "shift up to the modified frame"
gdb_test_multiple "info frame" "existence of the CFI inserted register" {
-re "Stack level $gate_n, frame at (0x\[0-9a-f\]+):.*Saved registers:.* ecx at (0x\[0-9a-f\]+),.*" {
unsigned int pkru;
asm volatile (".byte 0x0f,0x01,0xee\n\t"
- : "=a" (eax), "=d" (edx)
- : "c" (ecx));
+ : "=a" (eax), "=d" (edx)
+ : "c" (ecx));
pkru = eax;
return pkru;
}
unsigned int edx = 0;
asm volatile (".byte 0x0f,0x01,0xef\n\t"
- : : "a" (eax), "c" (ecx), "d" (edx));
+ : : "a" (eax), "c" (ecx), "d" (edx));
}
unsigned int NOINLINE
set test "probe PKRU support"
gdb_test_multiple "print have_pkru()" $test {
-re ".. = 1\r\n$gdb_prompt $" {
- pass $test
- set supports_pkru 1
+ pass $test
+ set supports_pkru 1
}
-re ".. = 0\r\n$gdb_prompt $" {
- pass $test
+ pass $test
}
}
" popl %ebp\n"
" leal -4(%eax), %esp\n"
" ret\n");
-
"check jump_at_beginning prologue end"
}
default {
- fail "set breakpoint in jump_at_beginning"
+ fail "set breakpoint in jump_at_beginning"
}
}
if (have_sse ())
{
asm ("movaps 0(%0), %%xmm0\n\t"
- "movaps 16(%0), %%xmm1\n\t"
- "movaps 32(%0), %%xmm2\n\t"
- "movaps 48(%0), %%xmm3\n\t"
- "movaps 64(%0), %%xmm4\n\t"
- "movaps 80(%0), %%xmm5\n\t"
- "movaps 96(%0), %%xmm6\n\t"
- "movaps 112(%0), %%xmm7\n\t"
- : /* no output operands */
- : "r" (data)
- : "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7");
+ "movaps 16(%0), %%xmm1\n\t"
+ "movaps 32(%0), %%xmm2\n\t"
+ "movaps 48(%0), %%xmm3\n\t"
+ "movaps 64(%0), %%xmm4\n\t"
+ "movaps 80(%0), %%xmm5\n\t"
+ "movaps 96(%0), %%xmm6\n\t"
+ "movaps 112(%0), %%xmm7\n\t"
+ : /* no output operands */
+ : "r" (data)
+ : "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7");
#ifdef __x86_64__
asm ("movaps 128(%0), %%xmm8\n\t"
- "movaps 144(%0), %%xmm9\n\t"
- "movaps 160(%0), %%xmm10\n\t"
- "movaps 176(%0), %%xmm11\n\t"
- "movaps 192(%0), %%xmm12\n\t"
- "movaps 208(%0), %%xmm13\n\t"
- "movaps 224(%0), %%xmm14\n\t"
- "movaps 240(%0), %%xmm15\n\t"
- : /* no output operands */
- : "r" (data)
- : "xmm8", "xmm9", "xmm10", "xmm11", "xmm12", "xmm13", "xmm14", "xmm15");
+ "movaps 144(%0), %%xmm9\n\t"
+ "movaps 160(%0), %%xmm10\n\t"
+ "movaps 176(%0), %%xmm11\n\t"
+ "movaps 192(%0), %%xmm12\n\t"
+ "movaps 208(%0), %%xmm13\n\t"
+ "movaps 224(%0), %%xmm14\n\t"
+ "movaps 240(%0), %%xmm15\n\t"
+ : /* no output operands */
+ : "r" (data)
+ : "xmm8", "xmm9", "xmm10", "xmm11", "xmm12", "xmm13", "xmm14", "xmm15");
#endif
asm ("nop"); /* first breakpoint here */
asm (
- "movaps %%xmm0, 0(%0)\n\t"
- "movaps %%xmm1, 16(%0)\n\t"
- "movaps %%xmm2, 32(%0)\n\t"
- "movaps %%xmm3, 48(%0)\n\t"
- "movaps %%xmm4, 64(%0)\n\t"
- "movaps %%xmm5, 80(%0)\n\t"
- "movaps %%xmm6, 96(%0)\n\t"
- "movaps %%xmm7, 112(%0)\n\t"
- : /* no output operands */
- : "r" (data)
- : "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7");
+ "movaps %%xmm0, 0(%0)\n\t"
+ "movaps %%xmm1, 16(%0)\n\t"
+ "movaps %%xmm2, 32(%0)\n\t"
+ "movaps %%xmm3, 48(%0)\n\t"
+ "movaps %%xmm4, 64(%0)\n\t"
+ "movaps %%xmm5, 80(%0)\n\t"
+ "movaps %%xmm6, 96(%0)\n\t"
+ "movaps %%xmm7, 112(%0)\n\t"
+ : /* no output operands */
+ : "r" (data)
+ : "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7");
#ifdef __x86_64__
asm (
- "movaps %%xmm8, 128(%0)\n\t"
- "movaps %%xmm9, 144(%0)\n\t"
- "movaps %%xmm10, 160(%0)\n\t"
- "movaps %%xmm11, 176(%0)\n\t"
- "movaps %%xmm12, 192(%0)\n\t"
- "movaps %%xmm13, 208(%0)\n\t"
- "movaps %%xmm14, 224(%0)\n\t"
- "movaps %%xmm15, 240(%0)\n\t"
- : /* no output operands */
- : "r" (data)
- : "xmm8", "xmm9", "xmm10", "xmm11", "xmm12", "xmm13", "xmm14", "xmm15");
+ "movaps %%xmm8, 128(%0)\n\t"
+ "movaps %%xmm9, 144(%0)\n\t"
+ "movaps %%xmm10, 160(%0)\n\t"
+ "movaps %%xmm11, 176(%0)\n\t"
+ "movaps %%xmm12, 192(%0)\n\t"
+ "movaps %%xmm13, 208(%0)\n\t"
+ "movaps %%xmm14, 224(%0)\n\t"
+ "movaps %%xmm15, 240(%0)\n\t"
+ : /* no output operands */
+ : "r" (data)
+ : "xmm8", "xmm9", "xmm10", "xmm11", "xmm12", "xmm13", "xmm14", "xmm15");
#endif
puts ("Bye!"); /* second breakpoint here */
send_gdb "print have_sse ()\r"
gdb_expect {
-re ".. = 1\r\n$gdb_prompt " {
- pass "check whether processor supports SSE"
+ pass "check whether processor supports SSE"
}
-re ".. = 0\r\n$gdb_prompt " {
- verbose "processor does not support SSE; skipping SSE tests"
- return
+ verbose "processor does not support SSE; skipping SSE tests"
+ return
}
-re ".*$gdb_prompt $" {
- fail "check whether processor supports SSE"
+ fail "check whether processor supports SSE"
}
timeout {
- fail "check whether processor supports SSE (timeout)"
+ fail "check whether processor supports SSE (timeout)"
}
}
gdb_test "break [gdb_get_line_number "first breakpoint here"]" \
- "Breakpoint .* at .*i386-sse.c.*" \
- "set first breakpoint in main"
+ "Breakpoint .* at .*i386-sse.c.*" \
+ "set first breakpoint in main"
gdb_continue_to_breakpoint "continue to first breakpoint in main"
if {[is_amd64_regs_target]} {
for { set r 0 } { $r < $nr_regs } { incr r } {
gdb_test "print \$xmm$r.v4_float" \
- ".. = \\{$r, $r.25, $r.5, $r.75\\}.*" \
- "check float contents of %xmm$r"
+ ".. = \\{$r, $r.25, $r.5, $r.75\\}.*" \
+ "check float contents of %xmm$r"
gdb_test "print \$xmm$r.v16_int8" \
- ".. = \\{(-?\[0-9\]+, ){15}-?\[0-9\]+\\}.*" \
- "check int8 contents of %xmm$r"
+ ".. = \\{(-?\[0-9\]+, ){15}-?\[0-9\]+\\}.*" \
+ "check int8 contents of %xmm$r"
}
for { set r 0 } { $r < $nr_regs } { incr r } {
}
gdb_test "break [gdb_get_line_number "second breakpoint here"]" \
- "Breakpoint .* at .*i386-sse.c.*" \
- "set second breakpoint in main"
+ "Breakpoint .* at .*i386-sse.c.*" \
+ "set second breakpoint in main"
gdb_continue_to_breakpoint "continue to second breakpoint in main"
for { set r 0 } { $r < $nr_regs } { incr r } {
gdb_test "print data\[$r\]" \
- ".. = \\{f = \\{[expr {$r + 10}], $r.25, $r.5, $r.75\\}\\}.*" \
- "check contents of data\[$r\]"
+ ".. = \\{f = \\{[expr {$r + 10}], $r.25, $r.5, $r.75\\}\\}.*" \
+ "check contents of data\[$r\]"
}
set test "disassembly without breakpoints"
gdb_test_multiple "disass main" $test {
-re $match {
- set orig $expect_out(1,string)
+ set orig $expect_out(1,string)
pass $test
}
}
set test "disassembly with breakpoints"
gdb_test_multiple "disass main" $test {
-re $match {
- set got $expect_out(1,string)
+ set got $expect_out(1,string)
if {[string equal -nocase $orig $got]} {
pass $test
} else {
int ok = 0;
asm goto (" adr x0, %l0\n"
- "set_point12:\n"
- " br x0\n"
- :
- :
- : "x0"
- : madejump);
+ "set_point12:\n"
+ " br x0\n"
+ :
+ :
+ : "x0"
+ : madejump);
fail ();
return;
mips-fpregset-core.f: In function 'main':
mips-fpregset-core.f:66:3: error: more than 30 operands in 'asm'
- asm (
- ^~~
+ asm (
+ ^~~
and still have complete 32 FGR coverage with FP64 ABIs. Using
a complex type breaks o32 GCC though, so use plain `double' with
gdb_test_multiple "show mipsfpu" "check for MIPS floating-point coprocessor" {
-re "The MIPS floating-point coprocessor\
.*\(absent\|unknown\).*$gdb_prompt $" {
- unsupported "no MIPS floating-point coprocessor in the processor"
- return
+ unsupported "no MIPS floating-point coprocessor in the processor"
+ return
}
-re "The MIPS floating-point coprocessor .*$gdb_prompt $" {
- verbose "MIPS floating-point coprocessor check successful."
+ verbose "MIPS floating-point coprocessor check successful."
}
default {
- fail
- return
+ fail
+ return
}
}
set testfile "pa64-nullify"
}
"*" {
- unsupported "Skipping hppa nullification tests."
- return
+ unsupported "Skipping hppa nullification tests."
+ return
}
}
gdb_test "info break"
gdb_test "info register r3 r4 r5 r6 r7 r8 r9"
gdb_test "disas main"
-
# Insert a breakpoint using the given function name, and extract
# the breakpoint address for the output.
gdb_test_multiple "break $function" "set breakpoint in $function" {
- -re "Breakpoint .* at ($hex).*$gdb_prompt $" {
- set address $expect_out(1,string)
- }
- default {
- fail "set breakpoint in $function"
- }
+ -re "Breakpoint .* at ($hex).*$gdb_prompt $" {
+ set address $expect_out(1,string)
+ }
+ default {
+ fail "set breakpoint in $function"
+ }
}
# If we managed to get the breakpoing address, then check that
# the instruction).
if {$address != ""} {
gdb_test "x /i $address" \
- ".*<$function\\+$expected_location>.*" \
- "check $function breakpoint address"
+ ".*<$function\\+$expected_location>.*" \
+ "check $function breakpoint address"
} else {
fail "unable to compute breakpoint address"
}
insert_breakpoint "stack_check_probe_2" 40
insert_breakpoint "stack_check_probe_loop_1" 68
insert_breakpoint "stack_check_probe_loop_2" 60
-
gdb_test "show disassembler-options" \
"The current disassembler options are '$option'.*" \
"show disassembler-options $option after set arch $arch2"
-
test_register_match "vs$i.uint128" "cvs$i" 1
}
}
-
# Let the inferior store all vector registers in a buffer, then dump
# the buffer and check it.
-
gdb_test "info break"
gdb_test "info register vs4 vs5 vs6 vs7 "
gdb_test "disas main #2"
-
}
gdb_test "bt" \
- "#0\[ \t\]*$hex in bar.*\r\n#1\[ \t\]*$hex in foo.*\r\n#2\[ \t\]*$hex in main.*" \
- "Backtrace to the main frame"
+ "#0\[ \t\]*$hex in bar.*\r\n#1\[ \t\]*$hex in foo.*\r\n#2\[ \t\]*$hex in main.*" \
+ "Backtrace to the main frame"
incr count
if {$count < $expected_traps} {
- set keep_going 1
+ set keep_going 1
}
}
}
gdb_test "info frame" \
".*Saved registers:.*r30 at.*pc at.*lr at.*" \
"saved registers in optimized"
-
# We get this warning even with the nowarnings option ...
regsub -all "(^|\n)\[^\n\]*using \[^\n\]* extended precision long double" $lines "" lines
if {$lines != ""} {
- return
+ return
}
clean_restart ${::testfile}.${name}
if {![runto_main]} {
- return
+ return
}
# Run to the breakpoint at return.
do_test default { -mfloat128 }
do_test ieee128 { -mfloat128 -mabi=ieeelongdouble }
do_test ibm128 { -mfloat128 -mabi=ibmlongdouble }
-
for (i = 0; auxv[i].a_type != AT_NULL; i++)
if (auxv[i].a_type == AT_HWCAP2) {
if (!(auxv[i].a_un.a_val & PPC_FEATURE2_ARCH_2_07))
- return 1;
+ return 1;
break;
}
gdb_continue_to_breakpoint "bar"
gdb_test "bt" \
[multi_line \
- "#0\[ \t\]*$hex in bar \\\(\\\)" \
- "#1\[ \t\]*$hex in foo \\\(\\\)" \
- "#2\[ \t\]*$hex in main \\\(\\\)"] \
+ "#0\[ \t\]*$hex in bar \\\(\\\)" \
+ "#1\[ \t\]*$hex in foo \\\(\\\)" \
+ "#2\[ \t\]*$hex in main \\\(\\\)"] \
"Backtrace to the main frame"
gdb_test "finish" "foo \\\(\\\)" "finish bar"
gdb_test "finish" "main \\\(\\\)" "finish foo"
gdb_continue_to_breakpoint "bar"
gdb_test "bt" \
[multi_line \
- "#0\[ \t\]*$hex in bar \\\(\\\)" \
- "#1\[ \t\]*$hex in foo \\\(\\\)" \
- "#2\[ \t\]*$hex in main \\\(\\\)"] \
+ "#0\[ \t\]*$hex in bar \\\(\\\)" \
+ "#1\[ \t\]*$hex in foo \\\(\\\)" \
+ "#2\[ \t\]*$hex in main \\\(\\\)"] \
"Backtrace to the main frame"
gdb_test "finish" "foo \\\(\\\)" "finish bar"
gdb_test "finish" "main \\\(\\\)" "finish foo"
if (fd < 0)
exit(1);
char *maddr = (char *)mmap (NULL, MAPSIZE, PROT_READ|PROT_WRITE,
- MAP_PRIVATE, fd, 0);
+ MAP_PRIVATE, fd, 0);
if (maddr == (char *)-1)
exit(1);
/* Enable ADI. */
standard_testfile
if { [prepare_for_testing "failed to prepare" $testfile $srcfile \
- [list debug libs=-ladi]] } {
+ [list debug libs=-ladi]] } {
return -1
}
}
gdb_test "break [gdb_get_line_number "line breakpoint here"]" \
- "Breakpoint .* at .*${srcfile}.*" \
- "set line breakpoint in main"
+ "Breakpoint .* at .*${srcfile}.*" \
+ "set line breakpoint in main"
gdb_continue_to_breakpoint "continue to line breakpoint in main"
##########################################
gdb_test "adi x shmaddr" "${hex}00:\t0" "examine ADI"
gdb_test_no_output "adi a/100 shmaddr=${newadi}" "assign ADI"
gdb_test "adi x/100 shmaddr" "${hex}00:\t${newadi} ${newadi}" \
- "examine new ADI"
+ "examine new ADI"
gdb_test_no_output "adi a/100 shmaddr=0x0" "reset ADI"
gdb_test "continue" \
- [multi_line "Program received signal SIGSEGV, Segmentation fault.*" \
- "ADI precise mismatch while accessing address $hex.*" ] \
+ [multi_line "Program received signal SIGSEGV, Segmentation fault.*" \
+ "ADI precise mismatch while accessing address $hex.*" ] \
"continue to sigsegv"
proc test_ccr {exp_value exp_text {exp_insn "wr .*"}} {
gdb_test "info register ccr" \
- "ccr $exp_value .*$exp_text.*" \
- "check %ccr register value equal to $exp_text"
+ "ccr $exp_value .*$exp_text.*" \
+ "check %ccr register value equal to $exp_text"
gdb_test "si" "$exp_insn" "single step to a next %ccr test after $exp_text"
}
proc test_fsr {exp_value exp_text} {
gdb_test "info register fsr" \
- "fsr $exp_value .*$exp_text.*" \
- "check %fsr register value equal to $exp_text"
+ "fsr $exp_value .*$exp_text.*" \
+ "check %fsr register value equal to $exp_text"
gdb_test "si" "stx .*" "single step to a next %fsr test (I.) after $exp_text"
gdb_test "si" "ldx .*" "single step to a next %fsr test (II.) after $exp_text"
# pass instruction "push".
gdb_test "si" "blx foo.*" "single step"
gdb_test "si" "foo \\(\\) at .*${srcfile}.*mov r0,#42.*" "step into foo"
-
# 2: Set VS0~VS31 registers and check if it reflects on F0~F31.
for {set i 0} {$i < 32} {incr i 1} {
- for {set j 0} {$j < 4} {incr j 1} {
- gdb_test_no_output "set \$vs$i.v4_int32\[$j\] = 0xdeadbeef"
- }
+ for {set j 0} {$j < 4} {incr j 1} {
+ gdb_test_no_output "set \$vs$i.v4_int32\[$j\] = 0xdeadbeef"
+ }
}
for {set i 0} {$i < 32} {incr i 1} {
# 1: Set VR0~VR31 registers and check if it reflects on VS32~VS63.
for {set i 0} {$i < 32} {incr i 1} {
- for {set j 0} {$j < 4} {incr j 1} {
- gdb_test_no_output "set \$vr$i.v4_int32\[$j\] = 1"
- }
+ for {set j 0} {$j < 4} {incr j 1} {
+ gdb_test_no_output "set \$vr$i.v4_int32\[$j\] = 1"
+ }
}
for {set i 32} {$i < 64} {incr i 1} {
}
# 2: Set VS32~VS63 registers and check if it reflects on VR0~VR31.
for {set i 32} {$i < 64} {incr i 1} {
- for {set j 0} {$j < 4} {incr j 1} {
- gdb_test_no_output "set \$vs$i.v4_int32\[$j\] = 1"
- }
+ for {set j 0} {$j < 4} {incr j 1} {
+ gdb_test_no_output "set \$vs$i.v4_int32\[$j\] = 1"
+ }
}
for {set i 0} {$i < 32} {incr i 1} {
# 2: Set VR0~VR31 registers and check if it reflects on F32~F63.
for {set i 0} {$i < 32} {incr i 1} {
- for {set j 0} {$j < 4} {incr j 1} {
- gdb_test_no_output "set \$vr$i.v4_int32\[$j\] = 0xdeadbeef"
- }
+ for {set j 0} {$j < 4} {incr j 1} {
+ gdb_test_no_output "set \$vr$i.v4_int32\[$j\] = 0xdeadbeef"
+ }
}
for {set i 32} {$i < 64} {incr i 1} {
gdb_test "p/f \$vs1" "$vector_field"
gdb_exit
-
-
-
.macro gdbasm_startup
mov x0, sp
.endm
-
mov fp, #0
mov r7, #0
.endm
-
switch -glob -- [istarget] {
"alpha*-*-*" {
- set asm-arch alpha
+ set asm-arch alpha
# ??? Won't work with ecoff systems like Tru64, but then we also
# don't have any other -g flag that creates mdebug output.
- set asm-flags "-no-mdebug -I${srcdir}/${subdir} $obj_include"
+ set asm-flags "-no-mdebug -I${srcdir}/${subdir} $obj_include"
set debug-flags "-gdwarf-2"
}
"arm*-*-*" {
- set asm-arch arm
+ set asm-arch arm
}
"aarch64*-*-*" {
set asm-arch aarch64
}
"bfin-*-*" {
- set asm-arch bfin
+ set asm-arch bfin
}
"frv-*-*" {
set asm-arch frv
}
"s390-*-*" {
- set asm-arch s390
+ set asm-arch s390
}
"s390x-*-*" {
- set asm-arch s390x
+ set asm-arch s390x
}
"x86_64-*-*" {
- set asm-arch x86_64
+ set asm-arch x86_64
set debug-flags "-gdwarf-2"
}
"i\[3456\]86-*-*" {
- set asm-arch i386
+ set asm-arch i386
}
"lm32-*" {
- set asm-arch lm32
+ set asm-arch lm32
}
"m32r*-linux*" {
- set asm-arch m32r-linux
+ set asm-arch m32r-linux
}
"m32c-*-*" {
- set asm-arch m32c
+ set asm-arch m32c
}
"m32r*-*" {
- set asm-arch m32r
- append link-flags "--whole-archive -lgloss --no-whole-archive"
+ set asm-arch m32r
+ append link-flags "--whole-archive -lgloss --no-whole-archive"
}
"m6811-*-*" {
- set asm-arch m68hc11
- set asm-flags "-mshort-double -m68hc11 --no-warn -I${srcdir}/${subdir} $obj_include"
+ set asm-arch m68hc11
+ set asm-flags "-mshort-double -m68hc11 --no-warn -I${srcdir}/${subdir} $obj_include"
set debug-flags "-gdwarf-2"
# This asm test is specific and uses the linker directly.
# We must not use the target board linker script defined for other
unset_board_info "ldscript"
}
"m6812-*-*" {
- set asm-arch m68hc11
- set asm-flags "-mshort-double -m68hc12 --no-warn -I${srcdir}/${subdir} $obj_include"
+ set asm-arch m68hc11
+ set asm-flags "-mshort-double -m68hc12 --no-warn -I${srcdir}/${subdir} $obj_include"
set debug-flags "-gdwarf-2"
# This asm test is specific and uses the linker directly.
# We must not use the target board linker script defined for other
set_board_info ldscript ""
}
"mips*-*" {
- set asm-arch mips
+ set asm-arch mips
}
"powerpc64le-*" {
- set asm-arch powerpc64le
- set asm-flags "-a64 -I${srcdir}/${subdir} $obj_include"
- append link-flags " -m elf64lppc"
+ set asm-arch powerpc64le
+ set asm-flags "-a64 -I${srcdir}/${subdir} $obj_include"
+ append link-flags " -m elf64lppc"
}
"powerpc*-*" {
- if { [is_lp64_target] } {
- set asm-arch powerpc64
- set asm-flags "-a64 -I${srcdir}/${subdir} $obj_include"
- append link-flags " -m elf64ppc"
- } else {
- set asm-arch powerpc
- set asm-flags "-a32 -I${srcdir}/${subdir} $obj_include"
- append link-flags " -m elf32ppc"
- }
+ if { [is_lp64_target] } {
+ set asm-arch powerpc64
+ set asm-flags "-a64 -I${srcdir}/${subdir} $obj_include"
+ append link-flags " -m elf64ppc"
+ } else {
+ set asm-arch powerpc
+ set asm-flags "-a32 -I${srcdir}/${subdir} $obj_include"
+ append link-flags " -m elf32ppc"
+ }
}
"sh*-*-*" {
- set asm-arch sh
+ set asm-arch sh
set debug-flags "-gdwarf-2"
}
"sparc-*-*" {
- set asm-arch sparc
+ set asm-arch sparc
}
"sparc64-*-*" {
- set asm-arch sparc64
- set asm-flags "-xarch=v9 -I${srcdir}/${subdir} $obj_include"
+ set asm-arch sparc64
+ set asm-flags "-xarch=v9 -I${srcdir}/${subdir} $obj_include"
set debug-flags "-gdwarf-2"
}
"xstormy16-*-*" {
- set asm-arch xstormy16
+ set asm-arch xstormy16
set debug-flags "-gdwarf-2"
}
"v850-*-*" {
- set asm-arch v850
- set gdb_wrapper_initialized 1
+ set asm-arch v850
+ set gdb_wrapper_initialized 1
}
"m68k-*-*" {
- set asm-arch m68k
+ set asm-arch m68k
}
"ia64-*-*" {
- set asm-arch ia64
+ set asm-arch ia64
set debug-flags "-gdwarf-2"
}
"iq2000-*-*" {
- set asm-arch iq2000
+ set asm-arch iq2000
}
"hppa*-linux-*" {
- set asm-arch pa
+ set asm-arch pa
set debug-flags "-gdwarf-2"
}
"hppa-*-openbsd*" {
- set asm-arch pa
+ set asm-arch pa
set debug-flags "-gdwarf-2"
}
"h83*-*" {
set asm-arch h8300
- set debug-flags "-gdwarf-2"
+ set debug-flags "-gdwarf-2"
}
}
set entry_symbol ""
gdb_test_multiple "info symbol 0x$entry_point" "info symbol" {
-re "info symbol 0x$entry_point\[\r\n\]+(\[^\r\n\]*) in section .*$gdb_prompt $" {
- # We match the echoed `info symbol' command here, to help us
- # reliably identify the beginning of the start symbol in the
- # command's output. You might think we could just use '^' to
- # start matching at the beginning of the line, but
- # unfortunately, in Expect, '^' matches the beginning of the
- # input that hasn't been matched by any expect clause yet. If
- # every expect clause consumes a complete line, along with its
- # terminating CR/LF, this is equivalent to the beginning of a
- # line. But expect clauses that end with `.*' will consume as
- # much as happened to arrive from the TTY --- exactly where
- # they leave you depends on inter-process timing. :(
+ # We match the echoed `info symbol' command here, to help us
+ # reliably identify the beginning of the start symbol in the
+ # command's output. You might think we could just use '^' to
+ # start matching at the beginning of the line, but
+ # unfortunately, in Expect, '^' matches the beginning of the
+ # input that hasn't been matched by any expect clause yet. If
+ # every expect clause consumes a complete line, along with its
+ # terminating CR/LF, this is equivalent to the beginning of a
+ # line. But expect clauses that end with `.*' will consume as
+ # much as happened to arrive from the TTY --- exactly where
+ # they leave you depends on inter-process timing. :(
set entry_symbol $expect_out(1,string)
pass "info symbol"
}
# again as well as the statement after.
gdb_test_multiple "finish" "finish from foo3" {
-re "Run till exit from.*\[\r\n\]$line_call_foo3\[ \t\]+gdbasm_call foo3.*$gdb_prompt $" {
- pass "finish from foo3"
- gdb_test "s" ".*" "s after finish"
+ pass "finish from foo3"
+ gdb_test "s" ".*" "s after finish"
}
-re "Run till exit from.*\[\r\n\]$line_call_foo3_again\[ \t\]+gdbasm_call foo3.*$gdb_prompt $" {
- pass "finish from foo3"
+ pass "finish from foo3"
}
}
set seen_asmsrc_2 0
gdb_test_multiple "info sources" "info sources" {
-re "^\[^,\]*asmsrc1.s(, |\[\r\n\]+)" {
- set seen_asmsrc_1 1
- exp_continue
+ set seen_asmsrc_1 1
+ exp_continue
}
-re "^\[^,\]*asmsrc2.s(, |\[\r\n\]+)" {
- set seen_asmsrc_2 1
- exp_continue
+ set seen_asmsrc_2 1
+ exp_continue
}
-re ", " {
- exp_continue
+ exp_continue
}
-re "$gdb_prompt $" {
- if {$seen_asmsrc_1 && $seen_asmsrc_2} {
- pass "info sources"
- } else {
- fail "info sources"
- }
+ if {$seen_asmsrc_1 && $seen_asmsrc_2} {
+ pass "info sources"
+ } else {
+ fail "info sources"
+ }
}
}
# line again or the statement after, depending on the architecture.
gdb_test_multiple "return" "return from foo2" {
-re "Make (foo2|selected stack frame) return now\\? .y or n. " {
- send_gdb "y\n"
- exp_continue
+ send_gdb "y\n"
+ exp_continue
}
-re "\#0.*main .*$line_call_foo2\[ \t\]+gdbasm_call foo2.*$gdb_prompt $" {
- pass "return from foo2"
- gdb_test "s" ".*" "s after return"
+ pass "return from foo2"
+ gdb_test "s" ".*" "s after return"
}
-re "\#0.*main .*$line_main_exit\[ \t\]+gdbasm_exit0.*$gdb_prompt $" {
- pass "return from foo2"
+ pass "return from foo2"
}
}
andi %0, %0, 0
addiu %29, %0, 0xffc
.endm
-
comment "exit (0)"
.macro gdbasm_exit0
mov.w #0, r1
- mov.b #1, r0l
+ mov.b #1, r0l
ste.b r0l,0xe0000
.endm
comment "crt0 startup"
.macro gdbasm_startup
- ldc #0xfc00, sp
+ ldc #0xfc00, sp
.endm
-
comment "openbsd .note"
- .section ".note.openbsd.ident", "a"
+ .section ".note.openbsd.ident", "a"
.p2align 2
.long 8
\name:
.long \value
.endm
-
# Reserve space for the standard stack frame:
# back chain, and space for the callee to save its registers.
ahi %r15,-104
-
+
# Zero this frame's back chain pointer.
xc 0(4,%r15),0(%r15)
.endm
# Reserve space for the standard stack frame:
# back chain, and space for the callee to save its registers.
aghi %r15,-168
-
+
# Zero this frame's back chain pointer.
xc 0(8,%r15),0(%r15)
.endm
.macro gdbasm_startup
clr %fp
.endm
-
.macro gdbasm_startup
clr %fp
.endm
-
ori 65535, r0, r21
movhi 32, r0, sp
.endm
-
.macro gdbasm_startup
mov r15,#8
.endm
-
result = bar (b + foo (c));
return 0; /* advance malformed */
}
-
gdb_test "advance" \
"Argument required \\(a location\\)."\
"advance with no argument"
-
gdb_test "print v_int && v_double" " = $false" \
"print value of v_int&&v_double"
-
-
-
-
-
return 0; /* after loop */
}
-
send_gdb "run\n"
gdb_expect {
-re "pre-query.*already.*$y_or_n.*query\r\n" {
- send_gdb "y\n"
- gdb_expect {
+ send_gdb "y\n"
+ gdb_expect {
-re ".*post-query.*$gdb_prompt$" \
{ pass "re-run" }
-re ".*$gdb_prompt$" { fail "re-run" }
return 0; /* after loop */
}
-
gdb_test_multiple "end" "end if construct" {
-re "^end\r\n\r\n\032\032post-commands\r\n$gdb_prompt$" {
- pass "end if construct"
+ pass "end if construct"
}
}
send_gdb "run\n"
gdb_expect {
-re "pre-query.*already.*\\(y or n\\).*query\r\n" {
- send_gdb "y\n"
- gdb_expect {
+ send_gdb "y\n"
+ gdb_expect {
-re ".*post-query.*$gdb_prompt$" \
{ pass "re-run" }
-re ".*$gdb_prompt$" { fail "re-run" }
# First, print the array without the indexes
gdb_test_no_output "set print array-indexes off" \
- "set print array-indexes to off"
+ "set print array-indexes to off"
gdb_test "show print array-indexes" \
- "Printing of array indexes is off\\." \
- "show print array-indexes is off"
+ "Printing of array indexes is off\\." \
+ "show print array-indexes is off"
gdb_test "print array" \
- "\\{1, 2, 3, 4\\}" \
- "print array with array-indexes off"
+ "\\{1, 2, 3, 4\\}" \
+ "print array with array-indexes off"
# Second, print the same array with the indexes
gdb_test_no_output "set print array-indexes on" \
- "set print array-indexes to on"
+ "set print array-indexes to on"
gdb_test "show print array-indexes" \
- "Printing of array indexes is on\\." \
- "show print array-indexes is on"
+ "Printing of array indexes is on\\." \
+ "show print array-indexes is on"
gdb_test "print array" \
- "\\{\\\[0\\\] = 1, \\\[1\\\] = 2, \\\[2\\\] = 3, \\\[3\\\] = 4\\}" \
- "print array with array-indexes on"
-
-
+ "\\{\\\[0\\\] = 1, \\\[1\\\] = 2, \\\[2\\\] = 3, \\\[3\\\] = 4\\}" \
+ "print array with array-indexes on"
global gdb_prompt
if {$message eq ""} {
- set message $command
+ set message $command
}
send_gdb "$command\n"
/* Cannot sleep a very long time, as attach.exp assumes the
process will exit before the standard GDB timeout. */
sleep( 10 ); /* System call causes register fetch to fail */
- /* This is a known HPUX "feature" */
+ /* This is a known HPUX "feature" */
while (! should_exit)
{
local_i++;
int local_i = 0;
sleep( 60 ); /* System call causes register fetch to fail */
- /* This is a known HPUX "feature" */
+ /* This is a known HPUX "feature" */
while (! should_exit)
{
local_i++;
void print_average(int *list, int low, int high)
{
- int total = 0, num_elements = 0, average = 0;
- total = sum(list, low, high);
- num_elements = high - low; /* note this is an off-by-one bug */
+ int total = 0, num_elements = 0, average = 0;
+ total = sum(list, low, high);
+ num_elements = high - low; /* note this is an off-by-one bug */
- average = total / num_elements;
- printf("%10.d\n", average);
+ average = total / num_elements;
+ printf("%10.d\n", average);
}
int main(void)
# Count number of distinct BFD error messages via 'bfd_error_count'
# array while using add-symbol-file to "load" the shared library.
gdb_test_multiple "add-symbol-file -readnow $binfile_lib" \
- "load library with add-symbol-file" {
+ "load library with add-symbol-file" {
-re "add symbol table from file.*\(y or n\)" {
send_gdb "y\n" answer
exp_continue
set test "most negative signed bitfield values"
if {$has_signed_bitfields} {
- gdb_test "print flags" "u1 = 0, u2 = 0, u3 = 0, s1 = -16384, s2 = -4294967296, s3 = -32768.*" $test
+ gdb_test "print flags" "u1 = 0, u2 = 0, u3 = 0, s1 = -16384, s2 = -4294967296, s3 = -32768.*" $test
} else {
unsupported $test
}
bitfield_unsignedness
bitfield_signedness
bitfield_set
-
gdb_test "print 0 == 8 > 128 >> 1 + 2 * 2" ".\[0-9\]* = 0" \
"print value of 0 == 8 > 128 >> 1 + 2 * 2"
-
set test "permanent breakpoint causes random signal"
gdb_test_multiple "continue" $test {
-re "exited normally.*$gdb_prompt $" {
- unsupported "failed to stop at permanent breakpoint"
+ unsupported "failed to stop at permanent breakpoint"
return
}
-re "received signal SIGTRAP.*$gdb_prompt $" {
- pass $test
+ pass $test
}
}
with_test_prefix "${testfile1}" {
gdb_test "break *main" \
- "Breakpoint.*at.* file .*$srcfile1, line .*" \
+ "Breakpoint.*at.* file .*$srcfile1, line .*" \
gdb_run_cmd
gdb_test "" \
- "Breakpoint.* main \\(\\) at .*$srcfile1:.*" \
- "run to breakpoint at *main"
+ "Breakpoint.* main \\(\\) at .*$srcfile1:.*" \
+ "run to breakpoint at *main"
# Verify also that we stopped at the start of the function...
gdb_test "p \$pc == main" " = 1"
gdb_run_cmd
gdb_test "" \
- "Breakpoint.* main \\(\\) at .*$srcfile2:.*" \
- "run to breakpoint at *main"
+ "Breakpoint.* main \\(\\) at .*$srcfile2:.*" \
+ "run to breakpoint at *main"
gdb_test "p \$pc == main" " = 1"
}
# Now test 'break' with no arguments.
gdb_test "break" "Breakpoint.*"
-
fail $test
return 0
} else {
- pass $test
+ pass $test
return 1
}
}
set test "disassembly without breakpoints"
gdb_test_multiple "disass main" $test {
-re $match {
- set orig $expect_out(1,string)
+ set orig $expect_out(1,string)
pass $test
}
}
# of the founction also provided by the same using.
gdb_test "break do_something_other_cu" \
- "Breakpoint $decimal at $hex: file .*$srcfile2, line $decimal\\."
+ "Breakpoint $decimal at $hex: file .*$srcfile2, line $decimal\\."
# Verify that partial symtab expansion has taken place for
# c-linkage-name-2.c.
# symtab expansion.
gdb_test "print symada__cS" \
- " = {a = 100829103}" \
- "print symada__cS after partial symtab expansion"
+ " = {a = 100829103}" \
+ "print symada__cS after partial symtab expansion"
int index;
for (index = 0; index < 4; index++) {
- array[index].value = index*seed;
+ array[index].value = index*seed;
array[index].head = (index+1)*seed;
}
{
init_bit_flags(flags, (unsigned)1, (unsigned)0, (unsigned)1,
- (unsigned)0, (unsigned)1, (unsigned)0 );
+ (unsigned)0, (unsigned)1, (unsigned)0 );
init_bit_flags_combo(flags_combo, (unsigned)1, (unsigned)0, 'y',
(unsigned)1, (unsigned)0, 'n',
- (unsigned)1, (unsigned)0 );
+ (unsigned)1, (unsigned)0 );
init_three_chars(three_char, 'a', 'b', 'c');
init_five_chars(five_char, 'l', 'm', 'n', 'o', 'p');
init_int_char_combo(int_char_combo, 123, 'z');
for (index = 0; index < 10; index++) {
- sum = seed + linked_list1.values[index] + linked_list2.values[index] +
+ sum = seed + linked_list1.values[index] + linked_list2.values[index] +
linked_list3.values[index] + linked_list4.values[index];
- printf("%10d%10d\n", index, sum);
+ printf("%10d%10d\n", index, sum);
}
}
return 0;
}
-
-
-
-
-
return 0; /* -finish1- */
}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
exp_continue
}
}
- -re "Function return value unknown.\[\r\n\]+$gdb_prompt $" {
- unsupported "$command"
+ -re "Function return value unknown.\[\r\n\]+$gdb_prompt $" {
+ unsupported "$command"
return
- }
+ }
}
verbose -log "inferior_matched=$inferior_matched, gdb_matched=$gdb_matched"
}
if {$allow_float_test && \
- ![gdb_skip_stdio_test "print print_one_double(*d1)"] } {
+ ![gdb_skip_stdio_test "print print_one_double(*d1)"] } {
print_struct_call "print_one_double(*d1)" \
".*Contents of one_double_t:\[ \r\n\]+1\\.111110\[ \r\n\]+" \
".\[0-9\]+ = \\{double1 = 1\\.111\[0-9\]*\\}"
}
if {$allow_float_test && \
- ![gdb_skip_stdio_test "print print_two_floats(*f3)"] } {
+ ![gdb_skip_stdio_test "print print_two_floats(*f3)"] } {
print_struct_call "print_two_floats(*f3)" \
".*Contents of two_floats_t:\[ \r\n\]+-2\\.345000\[ \t]+1\\.000000\[ \r\n\]+" \
".\[0-9\]+ = \\{float1 = -2\\.34500003, float2 = 1\\}"
set test "return foo; synchronize pc to main() for '${testfile}'"
for {set loop_count 0} {$loop_count < 2} {incr loop_count} {
gdb_test_multiple "backtrace 1" $test {
- -re "#0.*main \\(\\).*${gdb_prompt} $" {
- pass $test
- set loop_count 2
- }
- -re "#0.*fun \\(\\).*${gdb_prompt} $" {
- if {$loop_count < 1} {
- gdb_test "finish" ".*" ""
- } else {
- fail $test
- set loop_count 2
- }
- }
+ -re "#0.*main \\(\\).*${gdb_prompt} $" {
+ pass $test
+ set loop_count 2
+ }
+ -re "#0.*fun \\(\\).*${gdb_prompt} $" {
+ if {$loop_count < 1} {
+ gdb_test "finish" ".*" ""
+ } else {
+ fail $test
+ set loop_count 2
+ }
+ }
}
}
str_func1("abcd");
return 0;
}
-
gdb_exit
set timeout $prev_timeout
-
#endif
{
return ((*func_arg1) (5,5) == (*func_val1) (5,5)
- && (*func_arg2) (6) == (*func_val2) (6));
+ && (*func_arg2) (6) == (*func_val2) (6));
}
#ifdef PROTOTYPES
}
gdb_test "p t_structs_a(struct_val1)" "= (.unsigned char .. )?<.*buf.*> \"foo\"" \
- "call inferior func with struct - returns char *"
+ "call inferior func with struct - returns char *"
# Restore default value.
gdb_test_no_output "set unwind-on-signal off"
raise (SIGHUP); /* third HUP */
}
-
"1st line of save breakpoints for '$arg'"
# Check the second line.
gdb_assert {[string match "break main" [lindex $data 1]]} \
- "2nd line of save breakpoints for '$arg'"
+ "2nd line of save breakpoints for '$arg'"
# Check the trailing newline.
gdb_assert {[string match "" [lindex $data 2]]} \
- "Trailing newline of save breakpoints for '$arg'"
+ "Trailing newline of save breakpoints for '$arg'"
incr i
}
/* Initialize ascii_string. */
init_string (ascii_string,
- 120,
- 7, 8, 12,
- 10, 13, 9,
- 11, 120, 17);
+ 120,
+ 7, 8, 12,
+ 10, 13, 9,
+ 11, 120, 17);
fill_run (ascii_string, 7, 26, 65);
fill_run (ascii_string, 33, 26, 97);
fill_run (ascii_string, 59, 10, 48);
/* Initialize iso_8859_1_string. */
init_string (iso_8859_1_string,
- 120,
- 7, 8, 12,
- 10, 13, 9,
- 11, 162, 17);
+ 120,
+ 7, 8, 12,
+ 10, 13, 9,
+ 11, 162, 17);
fill_run (iso_8859_1_string, 7, 26, 65);
fill_run (iso_8859_1_string, 33, 26, 97);
fill_run (iso_8859_1_string, 59, 10, 48);
/* Initialize ebcdic_us_string. */
init_string (ebcdic_us_string,
- 167,
- 47, 22, 12,
- 37, 13, 5,
- 11, 74, 17);
+ 167,
+ 47, 22, 12,
+ 37, 13, 5,
+ 11, 74, 17);
/* In EBCDIC, the upper-case letters are broken into three separate runs. */
fill_run (ebcdic_us_string, 7, 9, 193);
fill_run (ebcdic_us_string, 16, 9, 209);
/* Initialize ibm1047_string. */
init_string (ibm1047_string,
- 167,
- 47, 22, 12,
- 37, 13, 5,
- 11, 74, 17);
+ 167,
+ 47, 22, 12,
+ 37, 13, 5,
+ 11, 74, 17);
/* In IBM1047, the upper-case letters are broken into three separate runs. */
fill_run (ibm1047_string, 7, 9, 193);
fill_run (ibm1047_string, 16, 9, 209);
global gdb_prompt
gdb_expect {
- -re "The host character set is \"(.*)\"\\.\[\r\n\]+The target character set is \"(.*)\"\\.\[\r\n\]+The target wide character set is \"(.*)\"\\.\[\r\n\]+$gdb_prompt $" {
- set host_charset $expect_out(1,string)
- set target_charset $expect_out(2,string)
+ -re "The host character set is \"(.*)\"\\.\[\r\n\]+The target character set is \"(.*)\"\\.\[\r\n\]+The target wide character set is \"(.*)\"\\.\[\r\n\]+$gdb_prompt $" {
+ set host_charset $expect_out(1,string)
+ set target_charset $expect_out(2,string)
set retlist [list $host_charset $target_charset]
- pass $testname
- }
- -re "The host character set is \"(.*)\"\\.\[\r\n\]+$gdb_prompt $" {
- set host_charset $expect_out(1,string)
+ pass $testname
+ }
+ -re "The host character set is \"(.*)\"\\.\[\r\n\]+$gdb_prompt $" {
+ set host_charset $expect_out(1,string)
set retlist [list $host_charset]
- pass $testname
- }
- -re "The target character set is \"(.*)\"\\.\[\r\n\]+$gdb_prompt $" {
- set target_charset $expect_out(1,string)
+ pass $testname
+ }
+ -re "The target character set is \"(.*)\"\\.\[\r\n\]+$gdb_prompt $" {
+ set target_charset $expect_out(1,string)
set retlist [list $target_charset]
- pass $testname
- }
- -re ".*$gdb_prompt $" {
- fail $testname
- }
- timeout {
- fail "$testname (timeout)"
- }
+ pass $testname
+ }
+ -re ".*$gdb_prompt $" {
+ fail $testname
+ }
+ timeout {
+ fail "$testname (timeout)"
+ }
}
return $retlist
# Try using `set host-charset' on an invalid character set.
gdb_test "set host-charset my_grandma_bonnie" \
- "Undefined item: \"my_grandma_bonnie\"." \
- "try `set host-charset' with invalid charset"
+ "Undefined item: \"my_grandma_bonnie\"." \
+ "try `set host-charset' with invalid charset"
# Try using `set target-charset' on an invalid character set.
gdb_test "set target-charset my_grandma_bonnie" \
- "Undefined item: \"my_grandma_bonnie\"." \
- "try `set target-charset' with invalid charset"
+ "Undefined item: \"my_grandma_bonnie\"." \
+ "try `set target-charset' with invalid charset"
# A Tcl array mapping the names of all the character sets we've seen
# to "1" if the character set can be used as a host character set, or
foreach_with_prefix host_charset $charset_subset {
if {[valid_host_charset $host_charset]} {
- set testname "try `set host-charset $host_charset'"
- send_gdb "set host-charset $host_charset\n"
- gdb_expect {
- -re "GDB doesn't know of any character set named.*\[\r\n]+${gdb_prompt} $" {
- # How did it get into `charsets' then?
- fail "$testname (didn't recognize name)"
- }
- -re "GDB can't use `.*' as its host character set\\.\[\r\n]+${gdb_prompt} $" {
- # Well, then why does its `charsets' entry say it can?
- fail $testname
- }
- -re "${gdb_prompt} $" {
- pass $testname
- }
- timeout {
- fail "$testname (timeout)"
- }
- }
-
- # Check that the command actually had its intended effect:
- # $host_charset should now be the host character set.
- send_gdb "show charset\n"
- set result [parse_show_charset_output "parse `show charset' after `set host-charset $host_charset'"]
- if {! [string compare [lindex $result 0] $host_charset]} {
- pass "check effect of `set host-charset $host_charset'"
- } else {
- fail "check effect of `set host-charset $host_charset'"
- }
-
- # Now try setting every possible target character set,
- # given that host charset.
- foreach target_charset $charset_subset {
+ set testname "try `set host-charset $host_charset'"
+ send_gdb "set host-charset $host_charset\n"
+ gdb_expect {
+ -re "GDB doesn't know of any character set named.*\[\r\n]+${gdb_prompt} $" {
+ # How did it get into `charsets' then?
+ fail "$testname (didn't recognize name)"
+ }
+ -re "GDB can't use `.*' as its host character set\\.\[\r\n]+${gdb_prompt} $" {
+ # Well, then why does its `charsets' entry say it can?
+ fail $testname
+ }
+ -re "${gdb_prompt} $" {
+ pass $testname
+ }
+ timeout {
+ fail "$testname (timeout)"
+ }
+ }
+
+ # Check that the command actually had its intended effect:
+ # $host_charset should now be the host character set.
+ send_gdb "show charset\n"
+ set result [parse_show_charset_output "parse `show charset' after `set host-charset $host_charset'"]
+ if {! [string compare [lindex $result 0] $host_charset]} {
+ pass "check effect of `set host-charset $host_charset'"
+ } else {
+ fail "check effect of `set host-charset $host_charset'"
+ }
+
+ # Now try setting every possible target character set,
+ # given that host charset.
+ foreach target_charset $charset_subset {
if {![valid_target_charset $target_charset]} {
continue
}
- set testname "try `set target-charset $target_charset'"
- send_gdb "set target-charset $target_charset\n"
- gdb_expect {
- -re "GDB doesn't know of any character set named.*\[\r\n]+${gdb_prompt} $" {
- fail "$testname (didn't recognize name)"
- }
- -re "GDB can't convert from the .* character set to .*\\.\[\r\n\]+${gdb_prompt} $" {
- # This is a serious problem. GDB should be able to convert
- # between any arbitrary pair of character sets.
- fail "$testname (can't convert)"
- }
- -re "${gdb_prompt} $" {
- pass $testname
- }
- timeout {
- fail "$testname (timeout)"
- }
- }
-
- # Check that the command actually had its intended effect:
- # $target_charset should now be the target charset.
- send_gdb "show charset\n"
- set result [parse_show_charset_output "parse `show charset' after `set target-charset $target_charset'"]
- if {! [string compare $result [list $host_charset $target_charset]]} {
- pass "check effect of `set target-charset $target_charset'"
- } else {
- fail "check effect of `set target-charset $target_charset'"
- }
-
- # Test handling of characters in the host charset which
- # can't be translated into the target charset. \xA2 is
- # `cent' in ISO-8859-1, which has no equivalent in ASCII.
- #
- # On some systems, the pseudo-tty through which we
- # communicate with GDB insists on stripping the high bit
- # from input characters, meaning that `cent' turns into
- # `"'. Since ISO-8859-1 and ASCII are identical in the
- # lower 128 characters, it's tough to see how we can test
- # this behavior on such systems, so we just xfail it.
+ set testname "try `set target-charset $target_charset'"
+ send_gdb "set target-charset $target_charset\n"
+ gdb_expect {
+ -re "GDB doesn't know of any character set named.*\[\r\n]+${gdb_prompt} $" {
+ fail "$testname (didn't recognize name)"
+ }
+ -re "GDB can't convert from the .* character set to .*\\.\[\r\n\]+${gdb_prompt} $" {
+ # This is a serious problem. GDB should be able to convert
+ # between any arbitrary pair of character sets.
+ fail "$testname (can't convert)"
+ }
+ -re "${gdb_prompt} $" {
+ pass $testname
+ }
+ timeout {
+ fail "$testname (timeout)"
+ }
+ }
+
+ # Check that the command actually had its intended effect:
+ # $target_charset should now be the target charset.
+ send_gdb "show charset\n"
+ set result [parse_show_charset_output "parse `show charset' after `set target-charset $target_charset'"]
+ if {! [string compare $result [list $host_charset $target_charset]]} {
+ pass "check effect of `set target-charset $target_charset'"
+ } else {
+ fail "check effect of `set target-charset $target_charset'"
+ }
+
+ # Test handling of characters in the host charset which
+ # can't be translated into the target charset. \xA2 is
+ # `cent' in ISO-8859-1, which has no equivalent in ASCII.
+ #
+ # On some systems, the pseudo-tty through which we
+ # communicate with GDB insists on stripping the high bit
+ # from input characters, meaning that `cent' turns into
+ # `"'. Since ISO-8859-1 and ASCII are identical in the
+ # lower 128 characters, it's tough to see how we can test
+ # this behavior on such systems, so we just xfail it.
#
# Note: the \x16 (Control-V) is an escape to allow \xA2 to
# get past readline.
- if {! [string compare $host_charset iso-8859-1] && ! [string compare $target_charset ascii]} {
-
- set testname "untranslatable character in character literal"
- send_gdb "print '\x16\xA2'\n"
- gdb_expect {
- -re "There is no character corresponding to .* in the target character set .*\\.\[\r\n\]+$gdb_prompt $" {
- pass $testname
- }
- -re " = 34 '\"'\[\r\n\]+$gdb_prompt $" {
- xfail "$testname (DejaGNU's pseudo-tty strips eighth bit)"
- }
- -re "$gdb_prompt $" {
- fail $testname
- }
- timeout {
- fail "$testname (timeout)"
- }
- }
-
- set testname "untranslatable character in string literal"
- # If the PTTY zeros bit seven, then this turns into
- # print """
- # which gets us a syntax error. We don't care.
- send_gdb "print \"\x16\xA2\"\n"
- gdb_expect {
- -re "There is no character corresponding to .* in the target character set .*\\.\[\r\n\]+$gdb_prompt $" {
- pass $testname
- }
- -re "Unterminated string in expression.\[\r\n\]+$gdb_prompt $" {
- xfail "$testname (DejaGNU's pseudo-tty strips eighth bit)"
- }
- -re "$gdb_prompt $" {
- fail $testname
- }
- timeout {
- fail "$testname (timeout)"
- }
- }
-
- set testname "untranslatable characters in backslash escape"
- send_gdb "print '\\\x16\xA2'\n"
- gdb_expect {
- -re "The escape sequence .* is equivalent to plain .*, which has no equivalent\[\r\n\]+in the .* character set\\.\[\r\n\]+$gdb_prompt $" {
- pass $testname
- }
- -re " = 34 '\"'\[\r\n\]+$gdb_prompt $" {
- xfail "$testname (DejaGNU's pseudo-tty strips eighth bit)"
- }
- -re "$gdb_prompt $" {
- fail $testname
- }
- timeout {
- fail "$testname (timeout)"
- }
- }
- }
- }
+ if {! [string compare $host_charset iso-8859-1] && ! [string compare $target_charset ascii]} {
+
+ set testname "untranslatable character in character literal"
+ send_gdb "print '\x16\xA2'\n"
+ gdb_expect {
+ -re "There is no character corresponding to .* in the target character set .*\\.\[\r\n\]+$gdb_prompt $" {
+ pass $testname
+ }
+ -re " = 34 '\"'\[\r\n\]+$gdb_prompt $" {
+ xfail "$testname (DejaGNU's pseudo-tty strips eighth bit)"
+ }
+ -re "$gdb_prompt $" {
+ fail $testname
+ }
+ timeout {
+ fail "$testname (timeout)"
+ }
+ }
+
+ set testname "untranslatable character in string literal"
+ # If the PTTY zeros bit seven, then this turns into
+ # print """
+ # which gets us a syntax error. We don't care.
+ send_gdb "print \"\x16\xA2\"\n"
+ gdb_expect {
+ -re "There is no character corresponding to .* in the target character set .*\\.\[\r\n\]+$gdb_prompt $" {
+ pass $testname
+ }
+ -re "Unterminated string in expression.\[\r\n\]+$gdb_prompt $" {
+ xfail "$testname (DejaGNU's pseudo-tty strips eighth bit)"
+ }
+ -re "$gdb_prompt $" {
+ fail $testname
+ }
+ timeout {
+ fail "$testname (timeout)"
+ }
+ }
+
+ set testname "untranslatable characters in backslash escape"
+ send_gdb "print '\\\x16\xA2'\n"
+ gdb_expect {
+ -re "The escape sequence .* is equivalent to plain .*, which has no equivalent\[\r\n\]+in the .* character set\\.\[\r\n\]+$gdb_prompt $" {
+ pass $testname
+ }
+ -re " = 34 '\"'\[\r\n\]+$gdb_prompt $" {
+ xfail "$testname (DejaGNU's pseudo-tty strips eighth bit)"
+ }
+ -re "$gdb_prompt $" {
+ fail $testname
+ }
+ timeout {
+ fail "$testname (timeout)"
+ }
+ }
+ }
+ }
}
}
# test program to the point at which the strings have been
# initialized.
gdb_test "break ${srcfile}:[gdb_get_line_number "all strings initialized"]" \
- ".*Breakpoint.* at .*" \
- "set breakpoint after all strings have been initialized"
+ ".*Breakpoint.* at .*" \
+ "set breakpoint after all strings have been initialized"
gdb_run_cmd
gdb_test "" "Breakpoint.*all strings initialized.*" "run until all strings have been initialized"
# gdb_test that requires us to use gdb_expect here.
send_gdb "print $L'\\0'\n"
gdb_expect {
- -re "\\\$${decimal} = 0 $L'\\\\000'\[\r\n\]+$gdb_prompt $" {
- pass "print the null character in ${target_charset}"
- }
- -re "$gdb_prompt $" {
- fail "print the null character in ${target_charset}"
- }
- timeout {
- fail "print the null character in ${target_charset} (timeout)"
- }
+ -re "\\\$${decimal} = 0 $L'\\\\000'\[\r\n\]+$gdb_prompt $" {
+ pass "print the null character in ${target_charset}"
+ }
+ -re "$gdb_prompt $" {
+ fail "print the null character in ${target_charset}"
+ }
+ timeout {
+ fail "print the null character in ${target_charset} (timeout)"
+ }
}
# Compute the name of the variable in the test program that holds
send_gdb "print $var_name\n"
# ${escapes}${uppercase}${lowercase}${digits}${octal}${octal}
gdb_expect {
- -re ".* = $L\"(\\\\a|x)(\\\\b|x)(\\\\f|x)(\\\\n|x)(\\\\r|x)(\\\\t|x)(\\\\v|x)${uppercase}${lowercase}${digits}(${octal_escape}|x)+\"\[\r\n\]+$gdb_prompt $" {
- pass "print string in $target_charset"
- }
- -re "$gdb_prompt $" {
- fail "print string in $target_charset"
- }
- timeout {
- fail "print string in $target_charset (timeout)"
- }
+ -re ".* = $L\"(\\\\a|x)(\\\\b|x)(\\\\f|x)(\\\\n|x)(\\\\r|x)(\\\\t|x)(\\\\v|x)${uppercase}${lowercase}${digits}(${octal_escape}|x)+\"\[\r\n\]+$gdb_prompt $" {
+ pass "print string in $target_charset"
+ }
+ -re "$gdb_prompt $" {
+ fail "print string in $target_charset"
+ }
+ timeout {
+ fail "print string in $target_charset (timeout)"
+ }
}
# Try entering a character literal, and see if it comes back unchanged.
gdb_test "print $L'A'" \
- " = \[0-9-\]+ $L'A'" \
- "parse character literal in ${target_charset}"
+ " = \[0-9-\]+ $L'A'" \
+ "parse character literal in ${target_charset}"
# Check that the character literal was encoded correctly.
gdb_test "print /d $L'A' == $var_name\[7\]" \
- " = 1" \
- "check value of parsed character literal in ${target_charset}"
+ " = 1" \
+ "check value of parsed character literal in ${target_charset}"
# Try entering a string literal, and see if it comes back unchanged.
gdb_test "print $L\"abcdefABCDEF012345\"" \
- " = $L\"abcdefABCDEF012345\"" \
- "parse string literal in ${target_charset}"
+ " = $L\"abcdefABCDEF012345\"" \
+ "parse string literal in ${target_charset}"
# Check that the string literal was encoded correctly.
gdb_test "print /d $L\"q\"\[0\] == $var_name\[49\]" \
- " = 1" \
- "check value of parsed string literal in ${target_charset}"
+ " = 1" \
+ "check value of parsed string literal in ${target_charset}"
# Test handling of characters in the target charset which
# can't be translated into the host charset.
if {! [string compare $target_charset iso-8859-1]} {
- gdb_test "print iso_8859_1_string\[69\]" \
- " = \[0-9-\]+ '\\\\242'" \
- "print character with no equivalent in host character set"
- gdb_test "print iso_8859_1_string + 70" \
- " = ${hex} \"\\\\242.*\"" \
- "print string with no equivalent in host character set"
+ gdb_test "print iso_8859_1_string\[69\]" \
+ " = \[0-9-\]+ '\\\\242'" \
+ "print character with no equivalent in host character set"
+ gdb_test "print iso_8859_1_string + 70" \
+ " = ${hex} \"\\\\242.*\"" \
+ "print string with no equivalent in host character set"
}
# Make sure that we don't apply the ISO-8859-1 `print_literally'
# function to ASCII.
if {! [string compare $target_charset ascii]} {
- gdb_test "print iso_8859_1_string\[69\]" \
- " = \[0-9-\]+ '\\\\242'" \
- "print ASCII unprintable character"
- gdb_test "print iso_8859_1_string + 70" \
- " = ${hex} \"\\\\242.*\"" \
- "print ASCII unprintable string"
+ gdb_test "print iso_8859_1_string\[69\]" \
+ " = \[0-9-\]+ '\\\\242'" \
+ "print ASCII unprintable character"
+ gdb_test "print iso_8859_1_string + 70" \
+ " = ${hex} \"\\\\242.*\"" \
+ "print ASCII unprintable string"
}
# Try printing characters with backslash escape equivalents.
set escapees {a b f n r t v}
for {set i 0} {$i < [llength $escapees]} {incr i} {
- set escape [lindex $escapees $i]
- send_gdb "print $var_name\[$i\]\n"
- set have_escape 1
- gdb_expect {
- -re "= \[0-9-\]+ $L'\\\\${escape}'\[\r\n\]+$gdb_prompt $" {
- pass "try printing '\\${escape}' in ${target_charset}"
- }
- -re "= \[0-9-\]+ 'x'\[\r\n\]+$gdb_prompt $" {
- xfail "try printing '\\${escape}' in ${target_charset} (no such escape)"
- set have_escape 0
- }
- -re "$gdb_prompt $" {
- fail "try printing '\\${escape}' in ${target_charset}"
- }
- timeout {
- fail "try printing '\\${escape}' in ${target_charset} (timeout)"
- }
- }
-
- if {$have_escape} {
-
- # Try parsing a backslash escape in a character literal.
- gdb_test "print /d $L'\\${escape}' == $var_name\[$i\]" \
- " = 1" \
- "check value of '\\${escape}' in ${target_charset}"
-
- # Try parsing a backslash escape in a string literal.
- gdb_test "print /d $L\"\\${escape}\"\[0\] == $var_name\[$i\]" \
- " = 1" \
- "check value of \"\\${escape}\" in ${target_charset}"
- }
+ set escape [lindex $escapees $i]
+ send_gdb "print $var_name\[$i\]\n"
+ set have_escape 1
+ gdb_expect {
+ -re "= \[0-9-\]+ $L'\\\\${escape}'\[\r\n\]+$gdb_prompt $" {
+ pass "try printing '\\${escape}' in ${target_charset}"
+ }
+ -re "= \[0-9-\]+ 'x'\[\r\n\]+$gdb_prompt $" {
+ xfail "try printing '\\${escape}' in ${target_charset} (no such escape)"
+ set have_escape 0
+ }
+ -re "$gdb_prompt $" {
+ fail "try printing '\\${escape}' in ${target_charset}"
+ }
+ timeout {
+ fail "try printing '\\${escape}' in ${target_charset} (timeout)"
+ }
+ }
+
+ if {$have_escape} {
+
+ # Try parsing a backslash escape in a character literal.
+ gdb_test "print /d $L'\\${escape}' == $var_name\[$i\]" \
+ " = 1" \
+ "check value of '\\${escape}' in ${target_charset}"
+
+ # Try parsing a backslash escape in a string literal.
+ gdb_test "print /d $L\"\\${escape}\"\[0\] == $var_name\[$i\]" \
+ " = 1" \
+ "check value of \"\\${escape}\" in ${target_charset}"
+ }
}
# Try printing a character escape that doesn't exist. We should
# get the unescaped character, in the target character set.
gdb_test "print $L'\\q'" " = \[0-9-\]+ $L'q'" \
- "print escape that doesn't exist in $target_charset"
+ "print escape that doesn't exist in $target_charset"
gdb_test "print /d $L'\\q' == $var_name\[49\]" " = 1" \
- "check value of escape that doesn't exist in $target_charset"
+ "check value of escape that doesn't exist in $target_charset"
}
# Reset the target charset.
stop_here ();
exit (0);
}
-
gdb_test "maint info break $bp_num" \
"$bp_num.*$bp_addr.*" \
"maint info breakpoint \$bp_num after clear"
-
#
# Function pointers TODO
#
-
set wp_id -1
gdb_test_multiple "watch local_var" "watch local_var" {
- -re "\[Ww\]atchpoint (\[0-9\]*): local_var.*$gdb_prompt $" {
- set wp_id $expect_out(1,string)
- pass "watch local_var"
- }
+ -re "\[Ww\]atchpoint (\[0-9\]*): local_var.*$gdb_prompt $" {
+ set wp_id $expect_out(1,string)
+ pass "watch local_var"
+ }
}
if {$wp_id == -1} {return}
proc_with_prefix deprecated_command_test {} {
gdb_test "maintenance deprecate blah" "Can't find command.*" \
- "tried to deprecate non-existing command"
+ "tried to deprecate non-existing command"
gdb_test_no_output "maintenance deprecate p \"new_p\"" "maintenance deprecate p \"new_p\" /1/"
gdb_test "p 5" \
# Create a breakpoint, and associate a command-list to it, with
# one command that deletes this breakpoint.
gdb_test "break factorial" \
- "Breakpoint \[0-9\]+ at .*: file .*run.c, line \[0-9\]+\."
+ "Breakpoint \[0-9\]+ at .*: file .*run.c, line \[0-9\]+\."
gdb_test_multiple "commands" "begin commands" {
-re "Type commands for breakpoint.*>$" {
- pass "begin commands"
+ pass "begin commands"
}
}
gdb_test_multiple "silent" "add silent command" {
- -re ">$" {
+ -re ">$" {
pass "add silent command"
}
}
gdb_test_multiple "clear factorial" "add clear command" {
- -re ">$" {
+ -re ">$" {
pass "add clear command"
}
}
gdb_test_multiple "printf \"factorial command-list executed\\n\"" \
"add printf command" {
- -re ">$" {
+ -re ">$" {
pass "add printf command"
}
}
gdb_test_multiple "cont" "add cont command" {
- -re ">$" {
+ -re ">$" {
pass "add cont command"
}
}
-re "Default output radix for printing of values is 10\\..*$gdb_prompt $" {
pass "$test"
}
- }
+ }
}
}
-re "The history is empty\\..*$gdb_prompt $" {
pass "$test"
}
- }
+ }
}
}
send_gdb "p no_var_named_this-arg\t"
gdb_test_multiple "" "$test" {
-re "^p no_var_named_this-arg\\\x07$" {
- send_gdb "\n"
+ send_gdb "\n"
gdb_test_multiple "" "$test" {
- -re "No symbol \"no_var_named_this\" in current context\\..*$gdb_prompt $" {
+ -re "No symbol \"no_var_named_this\" in current context\\..*$gdb_prompt $" {
pass "$test"
- }
- }
+ }
+ }
}
}
}
}
}
- }
+ }
}
}
# regexp operator. We use string_to_regexp for this purpose.
gdb_test "cd ${fullsrcdir}" \
- "Working directory [string_to_regexp ${fullsrcdir}].*" \
- "cd to \${srcdir}"
+ "Working directory [string_to_regexp ${fullsrcdir}].*" \
+ "cd to \${srcdir}"
# GDB used to fail adding / on directories, on the first try only.
} else {
fail $testname
}
-
gdb_test "whatis (0 ? 3 : 4)" "type = int" \
"print whatis of cond expr"
-
-
-
-
-
-
-
-
-
-
-
# Enable dumping of excluded mappings (i.e. VM_DONTDUMP).
if { $dump_excluded == 1 } {
- gdb_test_no_output "set dump-excluded-mappings on"
+ gdb_test_no_output "set dump-excluded-mappings on"
}
# Generate a corefile.
# Restore original status.
if { $dump_excluded == 1 } {
- gdb_test_no_output "set dump-excluded-mappings off"
+ gdb_test_no_output "set dump-excluded-mappings off"
}
}
# Access the memory the addresses point to.
if { $dump_excluded == 0 } {
- gdb_test "print/x *(char *) $coredump_var_addr($var)" "\(\\\$$decimal = <error: \)?Cannot access memory at address $hex\(>\)?" \
+ gdb_test "print/x *(char *) $coredump_var_addr($var)" "\(\\\$$decimal = <error: \)?Cannot access memory at address $hex\(>\)?" \
"printing $var when core is loaded (should not work)"
- gdb_test "print/x *(char *) $coredump_var_addr($working_var)" " = $working_value.*" \
+ gdb_test "print/x *(char *) $coredump_var_addr($working_var)" " = $working_value.*" \
"print/x *$working_var ( = $working_value)"
} else {
- # Check if VM_DONTDUMP mappings are present in the core file.
- gdb_test "print/x *(char *) $coredump_var_addr($var)" " = $working_value.*" \
+ # Check if VM_DONTDUMP mappings are present in the core file.
+ gdb_test "print/x *(char *) $coredump_var_addr($var)" " = $working_value.*" \
"print/x *$var ( = $working_value)"
}
}
/* Create yet another region which is allocated, but not written to. */
buf3 = mmap (NULL, MAPSIZE, PROT_READ | PROT_WRITE,
- MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
+ MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
if (buf3 == (char *) -1)
{
perror ("mmap failed");
}
mbuf_ro = mmap ((void *) addr, pagesize, PROT_READ,
- MAP_ANONYMOUS | MAP_PRIVATE | MAP_FIXED, -1, 0);
+ MAP_ANONYMOUS | MAP_PRIVATE | MAP_FIXED, -1, 0);
if (mbuf_ro == MAP_FAILED)
{
}
mbuf_rw = mmap ((void *) addr, pagesize, PROT_READ,
- MAP_ANONYMOUS | MAP_PRIVATE | MAP_FIXED, -1, 0);
+ MAP_ANONYMOUS | MAP_PRIVATE | MAP_FIXED, -1, 0);
if (mbuf_rw == MAP_FAILED)
{
# correctly printed (at nesting level 1 and 2).
gdb_test "ptype the_highest" \
- "type = struct highest \{.*\[\r\n\] *int a;.*\[\r\n\] *struct \{.*\[\r\n\] *int b;.*\[\r\n\] *struct \{\.\.\.\} anonymous_level_2;.*\[\r\n\] *\} anonymous_level_1;.*\[\r\n\]}.*" \
- "ptype the_highest"
+ "type = struct highest \{.*\[\r\n\] *int a;.*\[\r\n\] *struct \{.*\[\r\n\] *int b;.*\[\r\n\] *struct \{\.\.\.\} anonymous_level_2;.*\[\r\n\] *\} anonymous_level_1;.*\[\r\n\]}.*" \
+ "ptype the_highest"
# Print the type descrption for one of the fields of variable the_highest.
# The purpose is to verify that the type of a field that was printed above
# nesting level is now one level less).
gdb_test "ptype the_highest.anonymous_level_1" \
- "type = struct \{.*\[\r\n\] *int b;.*\[\r\n\] *struct \{.*\[\r\n\] *int c;.*\[\r\n\] *\} anonymous_level_2;.*\[\r\n\]}.*" \
- "ptype the_highest.anonymous_level_1"
+ "type = struct \{.*\[\r\n\] *int b;.*\[\r\n\] *struct \{.*\[\r\n\] *int c;.*\[\r\n\] *\} anonymous_level_2;.*\[\r\n\]}.*" \
+ "ptype the_highest.anonymous_level_1"
# Print the type of the identifier ID, and check the response:
# - Expect to see PROTOTYPED as the type. PROTOTYPED is not a regular
}
gdb_test_multiple "ptype $id" "ptype $id" {
- -re "type = $prototyped\[\r\n\]+$gdb_prompt $" {
- pass "ptype $id"
- }
- -re "type = $plain\[\r\n\]+$gdb_prompt $" {
- if {$gcc_compiled} { setup_xfail_format "stabs" }
- fail "ptype $id (compiler doesn't emit prototyped types)"
- }
- -re "type = $overprototyped\[\r\n\]+$gdb_prompt $" {
- if { [test_compiler_info "armcc-*"] } {
+ -re "type = $prototyped\[\r\n\]+$gdb_prompt $" {
+ pass "ptype $id"
+ }
+ -re "type = $plain\[\r\n\]+$gdb_prompt $" {
+ if {$gcc_compiled} { setup_xfail_format "stabs" }
+ fail "ptype $id (compiler doesn't emit prototyped types)"
+ }
+ -re "type = $overprototyped\[\r\n\]+$gdb_prompt $" {
+ if { [test_compiler_info "armcc-*"] } {
setup_xfail "*-*-*"
}
- fail "ptype $id (compiler doesn't emit unprototyped types)"
- }
+ fail "ptype $id (compiler doesn't emit unprototyped types)"
+ }
}
}
ptype_maybe_prototyped "func_type" "int (*)(int (*)(int, float), float)" \
- "int (*)()"
+ "int (*)()"
ptype_maybe_prototyped "old_fptr" "double (*)()" "double (*)()" \
- "double (*)(void)"
+ "double (*)(void)"
ptype_maybe_prototyped "new_fptr" "double (*)()" "double (*)()"
ptype_maybe_prototyped "fptr" "int (*)(int, float)" "int (*)()"
ptype_maybe_prototyped "fptr2" "int *(*)(int (*)(int, float), float)" \
- "int *(*)()"
+ "int *(*)()"
ptype_maybe_prototyped "xptr" "int (*)(int (*)(), int (*)(), int)" \
- "int (*)()" \
- "int (*)(int (*)(void), int (*)(void), int)"
+ "int (*)()" \
+ "int (*)(int (*)(void), int (*)(void), int)"
ptype_maybe_prototyped "ffptr" "int (*(*)(char))(short int)" \
- "int (*(*)())()"
+ "int (*(*)())()"
ptype_maybe_prototyped "fffptr" "int (*(*(*)(char))(short int))(long int)" \
- "int (*(*(*)())())()"
+ "int (*(*(*)())())()"
# Test printing type of string constants and array constants, but
# requires a running process. These call malloc, and can take a long
# in that SO while the variable's associated symtab has not been created
# yet.
set libsrc [list "${srcdir}/${subdir}/ctxobj-v.c" \
- "${srcdir}/${subdir}/ctxobj-f.c"]
+ "${srcdir}/${subdir}/ctxobj-f.c"]
set libobj1 [standard_output_file libctxobj1.so]
set libobj2 [standard_output_file libctxobj2.so]
set libobj1_opts { debug
- additional_flags=-DVERSION=104
- additional_flags=-DGET_VERSION=get_version_1 }
+ additional_flags=-DVERSION=104
+ additional_flags=-DGET_VERSION=get_version_1 }
set libobj2_opts { debug
- additional_flags=-DVERSION=203
- additional_flags=-DGET_VERSION=get_version_2 }
+ additional_flags=-DVERSION=203
+ additional_flags=-DGET_VERSION=get_version_2 }
if { [gdb_compile_shlib $libsrc $libobj1 $libobj1_opts ] != "" } {
return -1
return -1
}
if { [gdb_compile "${srcdir}/${subdir}/${executable}.c" \
- [standard_output_file ${executable}] \
- executable \
- [list debug shlib=${libobj1} shlib=${libobj2}]]
+ [standard_output_file ${executable}] \
+ executable \
+ [list debug shlib=${libobj1} shlib=${libobj2}]]
!= ""} {
return -1
}
set bp_location [gdb_get_line_number "STOP" "ctxobj-f.c"]
gdb_test "break ctxobj-f.c:$bp_location" \
- "Breakpoint \[0-9\]+ at 0x\[0-9a-fA-F\]+: .*" \
- "break in get_version functions"
+ "Breakpoint \[0-9\]+ at 0x\[0-9a-fA-F\]+: .*" \
+ "break in get_version functions"
global expect_out
set test "continue to get_version_1"
# seen by the program itself.
gdb_test "print this_version_num == v" \
- " = 1" \
- "print libctxobj1's this_version_num from partial symtab"
+ " = 1" \
+ "print libctxobj1's this_version_num from partial symtab"
gdb_test "print this_version_num == v" \
- " = 1" \
- "print libctxobj1's this_version_num from symtab"
+ " = 1" \
+ "print libctxobj1's this_version_num from symtab"
# Do the same, but from get_version_2.
set test "continue to get_version_2"
"$test \$_hit_bpnum.\$_hit_locno is $bpno"
gdb_test "print this_version_num == v" \
- " = 1" \
- "print libctxobj2's this_version_num from partial symtab"
+ " = 1" \
+ "print libctxobj2's this_version_num from partial symtab"
gdb_test "print this_version_num == v" \
- " = 1" \
- "print libctxobj2's this_version_num from symtab"
+ " = 1" \
+ "print libctxobj2's this_version_num from symtab"
'---'---'---'---'---'---.
| | | | <- line alignment
^^^^^^^ ^^^^^^^
- | |
- + line1 + line2
+ | |
+ + line1 + line2
Or:
.---.---.---.---.---.---.
| U | M | U | U | M | U |
'---'---'---'---'---'---.
- | | | <- line alignment
- ^^^^^^^ ^^^^^^^
- | |
- line1 + + line2
+ | | | <- line alignment
+ ^^^^^^^ ^^^^^^^
+ | |
+ line1 + + line2
Note we really want to test that dcache behaves correctly when
reading a cache line fails. We're just using unmapped memory as
gdb_test "define-prefix abc-prefix something-not-existing something-else" \
"Undefined abc-prefix command: \"something-not-existing\".*"
-
send_gdb "define nextwhere\n"
gdb_expect {
-re "Redefine command \"nextwhere\".*y or n. $"\
- {send_gdb "y\n"
- gdb_expect {
- -re "Type commands for definition of \"nextwhere\".\r\nEnd with a line saying just \"end\".\r\n>$"\
- {send_gdb "bt\nnext\nend\n"
- gdb_expect {
- -re "$gdb_prompt $"\
- {pass "redefine user command: nextwhere"}
- timeout {fail "(timeout) redefine user command: nextwhere"}
- }
- }
- timeout {fail "(timeout) redefine user command: nextwhere"}
- }
- }
+ {send_gdb "y\n"
+ gdb_expect {
+ -re "Type commands for definition of \"nextwhere\".\r\nEnd with a line saying just \"end\".\r\n>$"\
+ {send_gdb "bt\nnext\nend\n"
+ gdb_expect {
+ -re "$gdb_prompt $"\
+ {pass "redefine user command: nextwhere"}
+ timeout {fail "(timeout) redefine user command: nextwhere"}
+ }
+ }
+ timeout {fail "(timeout) redefine user command: nextwhere"}
+ }
+ }
-re "$gdb_prompt $"\
- {fail "redefine user command: nextwhere"}
+ {fail "redefine user command: nextwhere"}
timeout {fail "(timeout) redefine user command: nextwhere"}
}
-re "Type commands for definition of \"ifnospace\".\r\nEnd with a line saying just \"end\".\r\n>$" \
{
gdb_test_multiple "if(3<4)\nprint \"hi there\\n\"\nend\nend" "send body of ifnospace" \
- {
- -re "$gdb_prompt $"\
- {pass "define user command: ifnospace"}
- }
+ {
+ -re "$gdb_prompt $"\
+ {pass "define user command: ifnospace"}
+ }
}
}
-re "Type commands for definition of \"whilenospace\".\r\nEnd with a line saying just \"end\".\r\n>$" \
{
gdb_test_multiple "set \$i=1\nwhile(\$i<2)\nset \$i=2\nprint \"hi there\\n\"\nend\nend" "send body of whilenospace" \
- {
- -re "$gdb_prompt $" \
- {pass "define user command: whilenospace"}
- }
+ {
+ -re "$gdb_prompt $" \
+ {pass "define user command: whilenospace"}
+ }
}
}
send_gdb "define hook-bar\n"
gdb_expect {
-re "warning: Your new `hook-bar' command does not hook any existing command.\r\nProceed.*y or n. $"\
- {send_gdb "y\n"
- gdb_expect {
- -re "Type commands for definition of \"hook-bar\".\r\nEnd with a line saying just \"end\".\r\n>$"\
- {send_gdb "nextwhere\nend\n"
- gdb_expect {
- -re "$gdb_prompt $"\
- {pass "define hook undefined command: bar"}
- timeout {fail "(timeout) define hook undefined command: bar"}
- }
- }
- -re "$gdb_prompt $"\
- {fail "define hook undefined command: bar"}
- timeout {fail "(timeout) define hook undefined command: bar"}
- }
- }
+ {send_gdb "y\n"
+ gdb_expect {
+ -re "Type commands for definition of \"hook-bar\".\r\nEnd with a line saying just \"end\".\r\n>$"\
+ {send_gdb "nextwhere\nend\n"
+ gdb_expect {
+ -re "$gdb_prompt $"\
+ {pass "define hook undefined command: bar"}
+ timeout {fail "(timeout) define hook undefined command: bar"}
+ }
+ }
+ -re "$gdb_prompt $"\
+ {fail "define hook undefined command: bar"}
+ timeout {fail "(timeout) define hook undefined command: bar"}
+ }
+ }
-re "$gdb_prompt $"\
- {fail "define hook undefined command: bar"}
+ {fail "define hook undefined command: bar"}
timeout {fail "(timeout) define hook undefined command: bar"}
}
# First of all, remove all previous breakpoints if there were any,
# and then verify that we do not have any breakpoint lying around.
gdb_test_no_output "delete" \
- "remove all breakpoints"
+ "remove all breakpoints"
gdb_test "info break" \
"No breakpoints, watchpoints, tracepoints, or catchpoints." \
- "info break after clearing breakpoints"
+ "info break after clearing breakpoints"
# Now, insert a breakpoint at an easy location, and then remove it
# using $alias. We verified that the removal worked by checking
# the list of breakpoints.
gdb_test "break -q main" \
- "Breakpoint.*at.* file .*$srcfile, line.*" \
- "breakpoint insertion"
+ "Breakpoint.*at.* file .*$srcfile, line.*" \
+ "breakpoint insertion"
gdb_test_no_output "$alias \$bpnum" \
- "Remove last breakpoint"
+ "Remove last breakpoint"
gdb_test "info break" \
"No breakpoints, watchpoints, tracepoints, or catchpoints." \
- "info break after removing break on main"
+ "info break after removing break on main"
}
# Test various shortcut forms of the "delete" command.
set dsuffix {"dd" "df" "dl"}
foreach l $dsuffix {
- foreach r $dsuffix {
+ foreach r $dsuffix {
gdb_test "p 1.2${l} == 1.2${r}" " = 1"
gdb_test "p 1.2${l} == 1.3${r}" " = 0"
static _Decimal32
arg0_32 (_Decimal32 arg0, _Decimal32 arg1, _Decimal32 arg2,
- _Decimal32 arg3, _Decimal32 arg4, _Decimal32 arg5)
+ _Decimal32 arg3, _Decimal32 arg4, _Decimal32 arg5)
{
return arg0;
}
static _Decimal64
arg0_64 (_Decimal64 arg0, _Decimal64 arg1, _Decimal64 arg2,
- _Decimal64 arg3, _Decimal64 arg4, _Decimal64 arg5)
+ _Decimal64 arg3, _Decimal64 arg4, _Decimal64 arg5)
{
return arg0;
}
static _Decimal128
arg0_128 (_Decimal128 arg0, _Decimal128 arg1, _Decimal128 arg2,
- _Decimal128 arg3, _Decimal128 arg4, _Decimal128 arg5)
+ _Decimal128 arg3, _Decimal128 arg4, _Decimal128 arg5)
{
return arg0;
}
gdb_test_multiple "disassemble /m ${main_addr},${dummy_3_addr}" "disassemble address range with source" {
-re "Dump of assembler code from ${main_addr} to ${dummy_3_addr}:\r\nEnd of assembler dump\." {
- fail "no output from the disassemble command"
+ fail "no output from the disassemble command"
}
-re "Line number 0 out of range;.* has $decimal lines\." {
- fail "the disassemble command failed"
+ fail "the disassemble command failed"
}
-re "Dump of assembler code from ${main_addr} to ${dummy_3_addr}:\r\n.*main.*End of assembler dump\." {
- pass "disassemble command returned some output"
+ pass "disassemble command returned some output"
}
-re ".*$gdb_prompt $" {
- fail "unexpected output from disassemble command"
+ fail "unexpected output from disassemble command"
}
}
int *p_i = &i;
for( i = 0; i < LOOP; i++ ) { /* set breakpoint 1 here */
- for( j = 0; j < LOOP; j++ ) {
- for( k = 0; k < LOOP; k++ ) {
- sum++; f++; force_mem (&k);
- }
- }
+ for( j = 0; j < LOOP; j++ ) {
+ for( k = 0; k < LOOP; k++ ) {
+ sum++; f++; force_mem (&k);
+ }
+ }
}
return i; /* set breakpoint 2 here */
}
/* Need some code here to set breaks on.
*/
for( j = 0; j < LOOP; j++ ) {
- if( p_c[j] == c ) { /* set breakpoint 3 here */
- j++;
- }
- else {
- i++;
- }
+ if( p_c[j] == c ) { /* set breakpoint 3 here */
+ j++;
+ }
+ else {
+ i++;
+ }
}
return *p_i;
set ns $expect_out(3,string)
set name $expect_out(4,string)
- lappend libs [list $from $to $ns $name]
+ lappend libs [list $from $to $ns $name]
exp_continue
}
set dmsym_o [standard_output_file dmsym.o]
if {[gdb_compile "${srcdir}/${subdir}/dmsym.c" \
- $dmsym_o \
- object {}] != ""} {
+ $dmsym_o \
+ object {}] != ""} {
untested "failed to compile object file"
return -1
}
# should not be used for breakpoint purposes.
gdb_test "break test_minsym" \
- "Breakpoint $num at $addr.: file .*dmsym_main\\.c, line $num\\."
+ "Breakpoint $num at $addr.: file .*dmsym_main\\.c, line $num\\."
# However, verify that the `info line' command, on the other hand,
# finds both locations.
gdb_test "info line test_minsym" \
- "Line $num of \".*dmsym_main\\.c\" .*\r\nNo line number information available for address $addr <test_minsym>"
+ "Line $num of \".*dmsym_main\\.c\" .*\r\nNo line number information available for address $addr <test_minsym>"
# Now, run the program until we get past the call to test_minsym.
# Except when using hardware breakpoints, inferior behavior is going
gdb_run_cmd
gdb_test "" \
- "Breakpoint $num, test_minsym \\(\\) at.*" \
- "run until breakpoint at BREAK"
+ "Breakpoint $num, test_minsym \\(\\) at.*" \
+ "run until breakpoint at BREAK"
gdb_test "continue" \
- "Breakpoint $num, main \\(\\) at.*"
+ "Breakpoint $num, main \\(\\) at.*"
gdb_test "print val" \
- " = 124"
+ " = 124"
return 1;
return 0;
}
-
-
"y"
gdb_test "info break" \
- "Num Type\[ \]+Disp Enb Address\[ \]+What.*
+ "Num Type\[ \]+Disp Enb Address\[ \]+What.*
\[0-9\]+\[\t \]+dprintf.*keep y.*PENDING.*pendfunc1.*" \
"single pending dprintf info"
standard_testfile
if {[dtrace_build_usdt_test_program] == -1} {
- untested "failed to compile"
- return -1
+ untested "failed to compile"
+ return -1
}
clean_restart
gdb_load $binfile
if {![runto_main]} {
- return -1
+ return -1
}
gdb_test "print \$_probe_argc" "No probe at PC $hex" \
- "check argument not at probe point"
+ "check argument not at probe point"
# Test the 'info probes' command.
gdb_test "info probes dtrace" \
- "test *progress-counter *$hex +no.*test *two-locations *$hex +always.*test *two-locations *$hex +always.*" \
- "info probes dtrace"
+ "test *progress-counter *$hex +no.*test *two-locations *$hex +always.*test *two-locations *$hex +always.*" \
+ "info probes dtrace"
# Disabling the probe test:two-locations shall have no effect,
# since no is-enabled probes are defined for it in the object
# Test probe arguments.
gdb_test "print \$_probe_argc" " = 2" \
- "print \$_probe_argc for probe progress-counter"
+ "print \$_probe_argc for probe progress-counter"
gdb_test "print \$_probe_arg0" \
- " = $hex \"application\"" \
- "print \$_probe_arg0 for probe progress-counter"
+ " = $hex \"application\"" \
+ "print \$_probe_arg0 for probe progress-counter"
gdb_test "print \$_probe_arg1" " = 1" \
- "print \$_probe_arg1 for probe progress-counter"
+ "print \$_probe_arg1 for probe progress-counter"
# Set a breakpoint with multiple probe locations.
gdb_test "break -pdtrace test:two-locations" \
- "Breakpoint \[0-9\]+ at $hex.*2 locations.*" \
- "set multi-location probe breakpoint (probe two-locations)"
+ "Breakpoint \[0-9\]+ at $hex.*2 locations.*" \
+ "set multi-location probe breakpoint (probe two-locations)"
return 0
}
# Make sure that the "file" command rejects an empty filename,
# rather than crash.
gdb_test "file ''" \
- ": No such file or directory\\."
+ ": No such file or directory\\."
# And to make extra sure that GDB is still alive, do a quick
# sanity check.
# Now $b1.1 and $b2.1 should be enabled(disabled).
gdb_test_multiple "info break" "$test1" {
-re "(${b1})(\[^\n\r\]*)( n.*)(${b2})(\[^\n\r\]*)( n.*)$gdb_prompt $" {
- $p1 "$test1"
+ $p1 "$test1"
}
-re ".*$gdb_prompt $" {
- $p2 "$test1"
+ $p2 "$test1"
}
}
# $b4.1 should be enabled(disabled).
gdb_test_multiple "info break" "$test1" {
- -re "(${b4})(\[^\n\r\]*)( n.*)$gdb_prompt $" {
- $p1 "$test1"
+ -re "(${b4})(\[^\n\r\]*)( n.*)$gdb_prompt $" {
+ $p1 "$test1"
}
-re ".*$gdb_prompt $" {
- $p2 "$test1"
+ $p2 "$test1"
}
}
}
p = (int *) malloc( 4 );
for (i = 1; i < 10; i++)
- {
- printf( "%d ", callee( i ));
- fflush (stdout);
- }
+ {
+ printf( "%d ", callee( i ));
+ fflush (stdout);
+ }
printf( " Goodbye!\n" ); fflush (stdout); /* -break2- */
return 0;
}
gdb_test_multiple "info line ending-run.c:$break1_line" "" {
-re ".*address (0x\[0-9a-fA-F]*).*$gdb_prompt $" {
- set line_nine $expect_out(1,string)
+ set line_nine $expect_out(1,string)
gdb_test "b ending-run.c:$break1_line" ".*Breakpoint 4.*ending-run.c, line $break1_line.*"
gdb_test "b *$line_nine" ".*Note.*also.*Breakpoint 5.*" "breakpoint 7 at *ending-run.c:$break1_line"
gdb_test "cle" "Deleted breakpoints 4 5 " "clear 2 by default"
}
-re ".*$gdb_prompt $" {
- fail "need to fix test for new compile outcome"
+ fail "need to fix test for new compile outcome"
}
}
gdb_test_multiple "i b" "all set to continue" {
-re ".* breakpoint .* breakpoint .*$gdb_prompt $" {
- fail "all set to continue (didn't clear bps)"
+ fail "all set to continue (didn't clear bps)"
}
-re ".*2.*main.*$break2_line.*$gdb_prompt $" {
- pass "all set to continue"
+ pass "all set to continue"
}
-re ".*$gdb_prompt $" {
- fail "all set to continue (missing bp at end)"
+ fail "all set to continue (missing bp at end)"
}
}
gdb_test "next" ".*in start_l ().*" "step out of main"
}
-re ".*in.*currently asm.*$gdb_prompt $" {
- pass "step out of main"
+ pass "step out of main"
}
-re "_*start\[0-9\]* \\(\[^)\]*\\).*$gdb_prompt $" {
- pass "step out of main"
+ pass "step out of main"
}
-re ".*Program received signal SIGTRAP.*$gdb_prompt $" {
- pass "step out of main"
+ pass "step out of main"
}
-re ".*in.*__uClibc_main.*$gdb_prompt $" {
# This is what happens on system using uClibc.
set program_in_exit 1
}
-re ".*Single.*_int_reset.*$gdb_prompt $" {
- pass "step to end of run"
+ pass "step to end of run"
if {![istarget "xstormy16-*-*"]} {
set program_exited_normally 1
}
}
if {$program_exited_normally} {
- gdb_test "n" ".*The program is not being run.*" "don't step after run"
+ gdb_test "n" ".*The program is not being run.*" "don't step after run"
} elseif {$program_not_exited} {
unresolved "don't step after run"
} else {
set timeout $old_timeout
#remote_exec build "rm -f ${binfile}"
-
-
-
-
-
}
gdb_test "break call_me if param.e == 1" \
- "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal\\."
+ "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal\\."
# Continue. We should hit our breakpoint...
gdb_test "continue" \
- "Breakpoint $decimal, call_me \\(param=\\.\\.\\.\\) at .*" \
- "continue to conditional breakpoint in call_me"
-
+ "Breakpoint $decimal, call_me \\(param=\\.\\.\\.\\) at .*" \
+ "continue to conditional breakpoint in call_me"
for (i = 0; i < len - 1; ++i)
{
for (j = i; j < len; ++j)
- {
- if (n[j] < n[i])
- {
- int tmp = n[i];
- n[i] = n[j];
- n[j] = tmp;
- }
- }
+ {
+ if (n[j] < n[i])
+ {
+ int tmp = n[i];
+ n[i] = n[j];
+ n[j] = tmp;
+ }
+ }
}
return 42;
}
standard_testfile
if { [prepare_for_testing "failed to prepare for examine-backward" \
- ${testfile} ${srcfile}] } {
+ ${testfile} ${srcfile}] } {
return -1
}
set addr "0"
gdb_test_multiple "info proc mappings" "info proc mappings" {
- -re "objfile\[\r\n\t \]+(0x\[0-9a-fA-F\]+).*\[\r\n\]*$gdb_prompt $" {
- set addr $expect_out(1,string)
- }
- -re "$gdb_prompt $" {
- unsupported "current target does not support 'info proc mappings'"
- }
+ -re "objfile\[\r\n\t \]+(0x\[0-9a-fA-F\]+).*\[\r\n\]*$gdb_prompt $" {
+ set addr $expect_out(1,string)
+ }
+ -re "$gdb_prompt $" {
+ unsupported "current target does not support 'info proc mappings'"
+ }
}
return ${addr}
}
with_test_prefix "invalid format" {
gdb_test "x/- 10xb main" "Invalid number \"10xb\"\." \
- "a whitespace after a leading hyphen"
+ "a whitespace after a leading hyphen"
gdb_test "x/--10xb main" "Invalid number \"10xb\"\." \
- "double hyphen"
+ "double hyphen"
gdb_test "x/-a10xb main" "Invalid number \"10xb\"\." \
- "an alphabet after a leading hyphen"
+ "an alphabet after a leading hyphen"
gdb_test_no_output "x/-0i main" "zero with backward disassemble"
gdb_test_no_output "x/-0sh main" "zero with backward examine string"
}
with_test_prefix "memory page boundary" {
set boundary [get_first_mapped_address]
if {![is_address_zero_readable] && $boundary != 0} {
- gdb_test_no_output "set print elements 0"
- gdb_test_sequence "x/3s ${boundary}" "take 3 strings forward" {
- "0x"
- "0x"
- "0x"
- }
- gdb_test_sequence "x/-4s" "take 4 strings backward" {
- "Cannot access memory at address 0x"
- "0x"
- "0x"
- "0x"
- }
- gdb_test_sequence "x/3s ${boundary}" "take 3 strings forward again" {
- "0x"
- "0x"
- "0x"
- }
- gdb_test_sequence "x/-3s" "take 3 strings backward" {
- "Cannot access memory at address 0x"
- "0x"
- "0x"
- "0x"
- }
+ gdb_test_no_output "set print elements 0"
+ gdb_test_sequence "x/3s ${boundary}" "take 3 strings forward" {
+ "0x"
+ "0x"
+ "0x"
+ }
+ gdb_test_sequence "x/-4s" "take 4 strings backward" {
+ "Cannot access memory at address 0x"
+ "0x"
+ "0x"
+ "0x"
+ }
+ gdb_test_sequence "x/3s ${boundary}" "take 3 strings forward again" {
+ "0x"
+ "0x"
+ "0x"
+ }
+ gdb_test_sequence "x/-3s" "take 3 strings backward" {
+ "Cannot access memory at address 0x"
+ "0x"
+ "0x"
+ "0x"
+ }
}
}
with_test_prefix "char-width=1, print-max=20" {
gdb_test_no_output "set print elements 20"
gdb_test_sequence "x/6s TestStrings" "take 6 strings forward" {
- "\"ABCDEFGHIJKLMNOPQRST\"\.\.\."
- "\"UVWXYZ\""
- "\"\""
- "\"\""
- "\"[^\"]+\""
- "\"01234567890123456789\"\.\.\."
+ "\"ABCDEFGHIJKLMNOPQRST\"\.\.\."
+ "\"UVWXYZ\""
+ "\"\""
+ "\"\""
+ "\"[^\"]+\""
+ "\"01234567890123456789\"\.\.\."
}
gdb_test "x/-1xb" "0x39" "take 1 char backward"
gdb_test_sequence "x/-6s" "take 6 strings backward" {
- "\"ABCDEFGHIJKLMNOPQRST\"\.\.\."
- "\"UVWXYZ\""
- "\"\""
- "\"\""
- "\"[^\"]+\""
- "\"01234567890123456789\"\.\.\."
+ "\"ABCDEFGHIJKLMNOPQRST\"\.\.\."
+ "\"UVWXYZ\""
+ "\"\""
+ "\"\""
+ "\"[^\"]+\""
+ "\"01234567890123456789\"\.\.\."
}
gdb_test_sequence "x/6s TestStrings" "take 6 strings forward again" {
- "\"ABCDEFGHIJKLMNOPQRST\"\.\.\."
- "\"UVWXYZ\""
- "\"\""
- "\"\""
- "\"[^\"]+\""
- "\"01234567890123456789\"\.\.\."
+ "\"ABCDEFGHIJKLMNOPQRST\"\.\.\."
+ "\"UVWXYZ\""
+ "\"\""
+ "\"\""
+ "\"[^\"]+\""
+ "\"01234567890123456789\"\.\.\."
}
gdb_test "x/-xb" "0x39" "take 1 char backward again"
gdb_test "x/-s" "\"01234567890123456789\"\.\.\." \
with_test_prefix "char-width=2, print-max=20" {
gdb_test_no_output "set print elements 20"
gdb_test_sequence "x/6sh TestStringsH" "take 6 strings forward" {
- "u\"ABCDEFGHIJKLMNOPQRST\"\.\.\."
- "u\"UVWXYZ\""
- "u\"\""
- "u\"\""
- "u\"[^\"]+\""
- "u\"01234567890123456789\"\.\.\."
+ "u\"ABCDEFGHIJKLMNOPQRST\"\.\.\."
+ "u\"UVWXYZ\""
+ "u\"\""
+ "u\"\""
+ "u\"[^\"]+\""
+ "u\"01234567890123456789\"\.\.\."
}
gdb_test "x/-1xh" "0x0039" "take 1 char backward"
gdb_test_sequence "x/-6sh" "take 6 strings backward" {
- "u\"ABCDEFGHIJKLMNOPQRST\"\.\.\."
- "u\"UVWXYZ\""
- "u\"\""
- "u\"\""
- "u\"[^\"]+\""
- "u\"01234567890123456789\"\.\.\."
+ "u\"ABCDEFGHIJKLMNOPQRST\"\.\.\."
+ "u\"UVWXYZ\""
+ "u\"\""
+ "u\"\""
+ "u\"[^\"]+\""
+ "u\"01234567890123456789\"\.\.\."
}
gdb_test_sequence "x/6sh TestStringsH" "take 6 strings forward again" {
- "u\"ABCDEFGHIJKLMNOPQRST\"\.\.\."
- "u\"UVWXYZ\""
- "u\"\""
- "u\"\""
- "u\"[^\"]+\""
- "u\"01234567890123456789\"\.\.\."
+ "u\"ABCDEFGHIJKLMNOPQRST\"\.\.\."
+ "u\"UVWXYZ\""
+ "u\"\""
+ "u\"\""
+ "u\"[^\"]+\""
+ "u\"01234567890123456789\"\.\.\."
}
gdb_test "x/-xh" "0x0039" "take 1 char backward again"
gdb_test "x/-sh" "u\"01234567890123456789\"\.\.\." \
with_test_prefix "char-width=4, print-max=20" {
gdb_test_no_output "set print elements 20"
gdb_test_sequence "x/6sw TestStringsW" "take 6 strings forward" {
- "U\"ABCDEFGHIJKLMNOPQRST\"\.\.\."
- "U\"UVWXYZ\""
- "U\"\""
- "U\"\""
- "U\"[^\"]+\""
- "U\"01234567890123456789\"\.\.\."
+ "U\"ABCDEFGHIJKLMNOPQRST\"\.\.\."
+ "U\"UVWXYZ\""
+ "U\"\""
+ "U\"\""
+ "U\"[^\"]+\""
+ "U\"01234567890123456789\"\.\.\."
}
gdb_test "x/-1xw" "0x00000039" "take 1 char backward"
gdb_test_sequence "x/-6sw" "take 6 strings backward" {
- "U\"ABCDEFGHIJKLMNOPQRST\"\.\.\."
- "U\"UVWXYZ\""
- "U\"\""
- "U\"\""
- "U\"[^\"]+\""
- "U\"01234567890123456789\"\.\.\."
+ "U\"ABCDEFGHIJKLMNOPQRST\"\.\.\."
+ "U\"UVWXYZ\""
+ "U\"\""
+ "U\"\""
+ "U\"[^\"]+\""
+ "U\"01234567890123456789\"\.\.\."
}
gdb_test_sequence "x/6sw TestStringsW" "take 6 strings forward again" {
- "U\"ABCDEFGHIJKLMNOPQRST\"\.\.\."
- "U\"UVWXYZ\""
- "U\"\""
- "U\"\""
- "U\"[^\"]+\""
- "U\"01234567890123456789\"\.\.\."
+ "U\"ABCDEFGHIJKLMNOPQRST\"\.\.\."
+ "U\"UVWXYZ\""
+ "U\"\""
+ "U\"\""
+ "U\"[^\"]+\""
+ "U\"01234567890123456789\"\.\.\."
}
gdb_test "x/-xw" "0x00000039" "take 1 char backward again"
gdb_test "x/-sw" "U\"01234567890123456789\"\.\.\." \
with_test_prefix "char-width=2, print-max=0" {
gdb_test_no_output "set print elements 0"
gdb_test_sequence "x/6sh TestStringsH" "take 6 strings forward" {
- "u\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\""
- "u\"\""
- "u\"\""
- "u\"\\\\x307b\\\\x3052\\\\x307b\\\\x3052\""
- "u\"012345678901234567890123456789\""
- "u\"!!!!!!\""
+ "u\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\""
+ "u\"\""
+ "u\"\""
+ "u\"\\\\x307b\\\\x3052\\\\x307b\\\\x3052\""
+ "u\"012345678901234567890123456789\""
+ "u\"!!!!!!\""
}
gdb_test "x/-4xh" "0x0021\[\t \]+0x0021\[\t \]+0x0021\[\t \]+0x0000" \
- "take 4 characters backward"
+ "take 4 characters backward"
gdb_test_sequence "x/-6sh" "take 6 strings backward" {
- "u\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\""
- "u\"\""
- "u\"\""
- "u\"[^\"]+\""
- "u\"012345678901234567890123456789\""
- "u\"!!!!!!\""
+ "u\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\""
+ "u\"\""
+ "u\"\""
+ "u\"[^\"]+\""
+ "u\"012345678901234567890123456789\""
+ "u\"!!!!!!\""
}
gdb_test_sequence "x/6sh TestStringsH" "take 6 strings forward again" {
- "u\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\""
- "u\"\""
- "u\"\""
- "u\"\\\\x307b\\\\x3052\\\\x307b\\\\x3052\""
- "u\"012345678901234567890123456789\""
- "u\"!!!!!!\""
+ "u\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\""
+ "u\"\""
+ "u\"\""
+ "u\"\\\\x307b\\\\x3052\\\\x307b\\\\x3052\""
+ "u\"012345678901234567890123456789\""
+ "u\"!!!!!!\""
}
gdb_test "x/-xh" "0x0000" "take 1 char backward"
gdb_test "x/-sh" "u\"!!!!!!\"" \
with_test_prefix "char-width=1, print-max=4" {
gdb_test_no_output "set print elements 4"
gdb_test_sequence "x/9s TestStrings" "take 9 strings forward" {
- "\"ABCD\"\.\.\."
- "\"EFGH\"\.\.\."
- "\"IJKL\"\.\.\."
- "\"MNOP\"\.\.\."
- "\"QRST\"\.\.\."
- "\"UVWX\"\.\.\."
- "\"YZ\""
- "\"\""
- "\"\""
+ "\"ABCD\"\.\.\."
+ "\"EFGH\"\.\.\."
+ "\"IJKL\"\.\.\."
+ "\"MNOP\"\.\.\."
+ "\"QRST\"\.\.\."
+ "\"UVWX\"\.\.\."
+ "\"YZ\""
+ "\"\""
+ "\"\""
}
gdb_test "x/-xb" "0x00" "take 1 byte backward"
gdb_test_sequence "x/-4s" "take 4 strings backward, 1/2" {
- "\"TUVW\"\.\.\."
- "\"XYZ\""
- "\"\""
- "\"\""
+ "\"TUVW\"\.\.\."
+ "\"XYZ\""
+ "\"\""
+ "\"\""
}
gdb_test_sequence "x/-4s" "take 4 strings backward, 2/2" {
- "\"CDEF\"\.\.\."
- "\"GHIJ\"\.\.\."
- "\"KLMN\"\.\.\."
- "\"OPQR\"\.\.\."
+ "\"CDEF\"\.\.\."
+ "\"GHIJ\"\.\.\."
+ "\"KLMN\"\.\.\."
+ "\"OPQR\"\.\.\."
}
}
gdb_test "x/-i" "0x\[0-9a-fA-F\]+ <$main_re>:\t.*" \
"move the current position to main, x/-i"
for {set i 0} {$i < [llength $length_to_examine]} {incr i} {
- set len [lindex $length_to_examine $i]
- set instructions [capture_command_output "x/${len}i" ""]
- lappend disassmbly $instructions
+ set len [lindex $length_to_examine $i]
+ set instructions [capture_command_output "x/${len}i" ""]
+ lappend disassmbly $instructions
}
for {set i 0} {$i < [llength $length_to_examine]} {incr i} {
- set idx [expr {[llength $length_to_examine] - $i - 1}]
- set len [lindex $length_to_examine $idx]
- set actual [capture_command_output "x/-${len}i" ""]
- set expected [lindex $disassmbly $idx]
- if {$actual == $expected} {
- pass "inst:$idx"
- } else {
- fail "inst:$idx"
- }
+ set idx [expr {[llength $length_to_examine] - $i - 1}]
+ set len [lindex $length_to_examine $idx]
+ set actual [capture_command_output "x/-${len}i" ""]
+ set expected [lindex $disassmbly $idx]
+ if {$actual == $expected} {
+ pass "inst:$idx"
+ } else {
+ fail "inst:$idx"
+ }
}
}
if { [file exists $binfile] } {
fail "executable still exists (${binfile})"
}
-
-
set foo_bp [gdb_get_line_number "Break here"]
gdb_test "break $foo_bp" "Breakpoint.*" "expand psymtabs"
-
errno = 0;
ret = write (fd, STRING, strlen (STRING));
printf ("write 1: ret = %d, errno = %d %s\n", ret, errno,
- ret == strlen (STRING) ? "OK" : "");
+ ret == strlen (STRING) ? "OK" : "");
close (fd);
}
else
ret = read (fd, buf, 16);
buf[15] = '\0'; /* Don't trust anybody... */
if (ret == strlen (STRING))
- printf ("read 1: %s %s\n", buf, !strcmp (buf, STRING) ? "OK" : "");
+ printf ("read 1: %s %s\n", buf, !strcmp (buf, STRING) ? "OK" : "");
else
printf ("read 1: ret = %d, errno = %d\n", ret, errno);
close (fd);
errno = 0;
ret = lseek (fd, 0, SEEK_CUR);
printf ("lseek 1: ret = %ld, errno = %d, %s\n", (long) ret, errno,
- ret == 0 ? "OK" : "");
+ ret == 0 ? "OK" : "");
stop ();
errno = 0;
ret = lseek (fd, 0, SEEK_END);
printf ("lseek 2: ret = %ld, errno = %d, %s\n", (long) ret, errno,
- ret == 11 ? "OK" : "");
+ ret == 11 ? "OK" : "");
stop ();
errno = 0;
ret = lseek (fd, 3, SEEK_SET);
printf ("lseek 3: ret = %ld, errno = %d, %s\n", (long) ret, errno,
- ret == 3 ? "OK" : "");
+ ret == 3 ? "OK" : "");
close (fd);
}
else
errno = 0;
ret = close (fd);
printf ("close 1: ret = %d, errno = %d, %s\n", ret, errno,
- ret == 0 ? "OK" : "");
+ ret == 0 ? "OK" : "");
}
else
printf ("close 1: errno = %d\n", errno);
errno = 0;
ret = close (999);
printf ("close 2: ret = %d, errno = %d, %s\n", ret, errno,
- strerrno (errno));
+ strerrno (errno));
stop ();
}
errno = 0;
ret = stat (null_str, &st);
printf ("stat 2: ret = %d, errno = %d %s\n", ret, errno,
- strerrno (errno));
+ strerrno (errno));
stop ();
/* Empty pathname */
errno = 0;
ret = stat ("", &st);
printf ("stat 3: ret = %d, errno = %d %s\n", ret, errno,
- strerrno (errno));
+ strerrno (errno));
stop ();
/* Nonexistant file */
errno = 0;
ret = stat (NONEXISTANT, &st);
printf ("stat 4: ret = %d, errno = %d %s\n", ret, errno,
- strerrno (errno));
+ strerrno (errno));
stop ();
}
errno = 0;
ret = fstat (999, &st);
printf ("fstat 2: ret = %d, errno = %d %s\n", ret, errno,
- strerrno (errno));
+ strerrno (errno));
stop ();
}
errno = 0;
ret = stat (FILENAME, &st);
if (ret && errno == ENOENT)
- {
+ {
errno = 0;
ret = stat (OUTDIR RENAMED, &st);
printf ("rename 1: ret = %d, errno = %d %s\n", ret, errno,
errno = 0;
ret = rename (OUTDIR TESTDIR2, OUTDIR TESTDIR1);
printf ("rename 3: ret = %d, errno = %d %s\n", ret, errno,
- strerrno (errno));
+ strerrno (errno));
stop ();
/* newpath is a subdirectory of old path */
errno = 0;
sprintf (sys, "chmod -w %s/%s", OUTDIR, TESTDIR2);
ret = system (sys);
if (!ret)
- {
+ {
errno = 0;
ret = unlink (name);
printf ("unlink 2: ret = %d, errno = %d %s\n", ret, errno,
strerrno (errno));
- }
+ }
else
printf ("unlink 2: ret = %d chmod failed, errno= %d\n", ret, errno);
}
errno = 0;
ret = unlink (OUTDIR NONEXISTANT);
printf ("unlink 3: ret = %d, errno = %d %s\n", ret, errno,
- strerrno (errno));
+ strerrno (errno));
stop ();
}
proc finish_abbreviation { abbrev } {
if {![runto "int_func"]} {
- return -1
+ return -1
}
gdb_test "$abbrev" \
- "Value returned is .* = 1" \
- "Testing the \"$abbrev\" abbreviation for \"finish\""
+ "Value returned is .* = 1" \
+ "Testing the \"$abbrev\" abbreviation for \"finish\""
}
# Test "set print finish off".
# if we have NEON.
pass "info float (VFP)"
}
- -re "No floating.point info available for this processor.*$gdb_prompt $" {
- pass "info float (without FPU)"
+ -re "No floating.point info available for this processor.*$gdb_prompt $" {
+ pass "info float (without FPU)"
}
}
} elseif {[istarget "i?86-*-*"] || [istarget "x86_64-*-*"]} {
gdb_test "info float" "f0.*f1.*f127.*"
} elseif {[istarget "m68k-*-*"]} {
gdb_test_multiple "info float" "info_float" {
- -re "fp0.*fp1.*fp7.*$gdb_prompt $" {
- pass "info float (with FPU)"
+ -re "fp0.*fp1.*fp7.*$gdb_prompt $" {
+ pass "info float (with FPU)"
}
- -re "No floating.point info available for this processor.*$gdb_prompt $" {
- pass "info float (without FPU)"
+ -re "No floating.point info available for this processor.*$gdb_prompt $" {
+ pass "info float (without FPU)"
}
}
} elseif {[istarget "mips*-*-*"]} {
}
} elseif {[istarget "nds32*-*-*"]} {
gdb_test_multiple "info float" "info_float" {
- -re "fd0.*fd3.*$gdb_prompt $" {
- pass "info float (with FPU)"
+ -re "fd0.*fd3.*$gdb_prompt $" {
+ pass "info float (with FPU)"
}
- -re "No floating.point info available for this processor.*$gdb_prompt $" {
- pass "info float (without FPU)"
+ -re "No floating.point info available for this processor.*$gdb_prompt $" {
+ pass "info float (without FPU)"
}
}
} elseif {[istarget "powerpc*-*-*"]} {
gdb_test_multiple "info float" "info_float" {
- -re "f0.*f1.*f31.*fpscr.*$gdb_prompt $" {
- pass "info float (with FPU)"
+ -re "f0.*f1.*f31.*fpscr.*$gdb_prompt $" {
+ pass "info float (with FPU)"
}
- -re "No floating.point info available for this processor.*$gdb_prompt $" {
- pass "info float (without FPU)"
+ -re "No floating.point info available for this processor.*$gdb_prompt $" {
+ pass "info float (without FPU)"
}
}
} elseif {[istarget "s390*-*-*"]} {
send_gdb "print global_i\n"
gdb_expect {
-re ".* = 100.*$gdb_prompt $"\
- {pass "print follow-exec/global_i"}
+ {pass "print follow-exec/global_i"}
-re "$gdb_prompt $" {fail "print follow-exec/global_i"}
timeout {fail "(timeout) print follow-exec/global_i"}
}
send_gdb "print local_j\n"
gdb_expect {
-re ".* = 101.*$gdb_prompt $"\
- {pass "print follow-exec/local_j"}
+ {pass "print follow-exec/local_j"}
-re "$gdb_prompt $" {fail "print follow-exec/local_j"}
timeout {fail "(timeout) print follow-exec/local_j"}
}
send_gdb "print local_k\n"
gdb_expect {
-re ".* = 102.*$gdb_prompt $"\
- {pass "print follow-exec/local_k"}
+ {pass "print follow-exec/local_k"}
-re "$gdb_prompt $" {fail "print follow-exec/local_k"}
timeout {fail "(timeout) print follow-exec/local_k"}
}
send_gdb "next\n"
gdb_expect {
-re ".*xecuting new program: .*${execee_testfile_re}.*${srcfile2}:${execd_line}.*int local_j = argc;.*$gdb_prompt $"\
- {pass "step through execlp call"}
+ {pass "step through execlp call"}
-re "$gdb_prompt $" {fail "step through execlp call"}
timeout {fail "(timeout) step through execlp call"}
}
send_gdb "next\n"
gdb_expect {
-re "printf \\(.Hello .*$gdb_prompt $"\
- {pass "step after execlp call"}
+ {pass "step after execlp call"}
-re "$gdb_prompt $" {fail "step after execlp call"}
timeout {fail "(timeout) step after execlp call"}
}
send_gdb "catch exec\n"
gdb_expect {
-re "Catchpoint .*(exec).*$gdb_prompt $"\
- {pass "set catch exec"}
+ {pass "set catch exec"}
-re "$gdb_prompt $" {fail "set catch exec"}
timeout {fail "(timeout) set catch exec"}
}
set msg "info shows catchpoint without exec pathname"
gdb_test_multiple "info breakpoints" $msg {
-re ".*catchpoint.*keep y.*exec\[\n\r\]+$gdb_prompt $" {
- pass $msg
+ pass $msg
}
}
send_gdb "continue\n"
gdb_expect {
-re ".*xecuting new program:.*${execee_testfile_re}.*Catchpoint .*(exec\'d .*${execee_testfile_re}).*$gdb_prompt $"\
- {pass "hit catch exec"}
+ {pass "hit catch exec"}
-re "$gdb_prompt $" {fail "hit catch exec"}
timeout {fail "(timeout) hit catch exec"}
}
set msg "info shows catchpoint exec pathname"
gdb_test_multiple "info breakpoints" $msg {
-re ".*catchpoint.*keep y.*exec, program \".*${execee_testfile_re}\".*$gdb_prompt $" {
- pass $msg
+ pass $msg
}
}
send_gdb "continue\n"
gdb_expect {
-re ".*${srcfile2}:${execd_line}.*$gdb_prompt $"\
- {pass "continue after hit catch exec"}
+ {pass "continue after hit catch exec"}
-re "$gdb_prompt $" {fail "continue after hit catch exec"}
timeout {fail "(timeout) continue after hit catch exec"}
}
send_gdb "tbreak ${tbreak_line}\n"
gdb_expect {
-re "Temporary breakpoint .*file .*${srcfile}, line ${tbreak_line}.*$gdb_prompt $"\
- {pass "prepare to jump to execl call"}
+ {pass "prepare to jump to execl call"}
-re "$gdb_prompt $" {fail "prepare to jump to execl call"}
timeout {fail "(timeout) prepare to jump to execl call"}
}
send_gdb "jump ${tbreak_line}\n"
gdb_expect {
-re "main.* at .*${srcfile}:${tbreak_line}.*$gdb_prompt $"\
- {pass "jump to execl call"}
+ {pass "jump to execl call"}
-re "$gdb_prompt $" {fail "jump to execl call"}
timeout {fail "(timeout) jump to execl call"}
}
send_gdb "next 2\n"
gdb_expect {
-re ".*xecuting new program: .*${execee_testfile_re}.*${srcfile2}:${execd_line}.*int local_j = argc;.*$gdb_prompt $"\
- {pass "step through execl call"}
+ {pass "step through execl call"}
-re "$gdb_prompt $" {fail "step through execl call"}
timeout {fail "(timeout) step through execl call"}
}
send_gdb "next\n"
gdb_expect {
-re "printf \\(.Hello .*$gdb_prompt $"\
- {pass "step after execl call"}
+ {pass "step after execl call"}
-re "$gdb_prompt $" {fail "step after execl call"}
timeout {fail "(timeout) step after execl call"}
}
send_gdb "tbreak ${tbreak_line}\n"
gdb_expect {
-re "Temporary breakpoint .*file .*${srcfile}, line ${tbreak_line}.*$gdb_prompt $"\
- {pass "prepare to jump to execv call"}
+ {pass "prepare to jump to execv call"}
-re "$gdb_prompt $" {fail "prepare to jump to execv call"}
timeout {fail "(timeout) prepare to jump to execv call"}
}
send_gdb "jump ${tbreak_line}\n"
gdb_expect {
-re "main.* at .*${srcfile}:${tbreak_line}.*$gdb_prompt $"\
- {pass "jump to execv call"}
+ {pass "jump to execv call"}
-re "$gdb_prompt $" {fail "jump to execv call"}
timeout {fail "(timeout) jump to execv call"}
}
send_gdb "next\n"
gdb_expect {
-re ".*xecuting new program: .*${execee_testfile_re}.*${srcfile2}:${execd_line}.*int local_j = argc;.*$gdb_prompt $"\
- {pass "step through execv call"}
+ {pass "step through execv call"}
-re "$gdb_prompt $" {fail "step through execv call"}
timeout {fail "(timeout) step through execv call"}
}
send_gdb "next\n"
gdb_expect {
-re "printf \\(.Hello .*$gdb_prompt $"\
- {pass "step after execv call"}
+ {pass "step after execv call"}
-re "$gdb_prompt $" {fail "step after execv call"}
timeout {fail "(timeout) step after execv call"}
}
send_gdb "continue\n"
gdb_expect {
-re ".*xecuting new program: .*${execee_testfile_re}.*${srcfile2}:${execd_line}.*int local_j = argc;.*$gdb_prompt $"\
- {pass "continue through exec"}
+ {pass "continue through exec"}
-re "$gdb_prompt $" {fail "continue through exec"}
timeout {fail "(timeout) continue through exec"}
}
# Test with "print frame-arguments" set to "all"
gdb_test_no_output "set print frame-arguments all" \
- "set print frame-arguments all"
+ "set print frame-arguments all"
gdb_test "frame 1" \
- ".*in call_me \\(i=3, f=5, s=({a = 3, b = 5}|<optimized out>), ss=0x\[0-9a-f\]\+, u=({.*}|<optimized out>), e=green\\) at .*frame-args\\.c:.*" \
- "frame 1 with print frame-arguments set to all"
+ ".*in call_me \\(i=3, f=5, s=({a = 3, b = 5}|<optimized out>), ss=0x\[0-9a-f\]\+, u=({.*}|<optimized out>), e=green\\) at .*frame-args\\.c:.*" \
+ "frame 1 with print frame-arguments set to all"
# Test with "print frame-arguments" set to "scalars"
gdb_test_no_output "set print frame-arguments scalars" \
- "set print frame-arguments scalars"
+ "set print frame-arguments scalars"
gdb_test "frame 1" \
- ".*in call_me \\(i=3, f=5, s=\\.\\.\\., ss=0x\[0-9a-f\]\+, u=\\.\\.\\., e=green\\) at .*frame-args\\.c:.*" \
- "frame 1 with print frame-arguments set to scalars"
+ ".*in call_me \\(i=3, f=5, s=\\.\\.\\., ss=0x\[0-9a-f\]\+, u=\\.\\.\\., e=green\\) at .*frame-args\\.c:.*" \
+ "frame 1 with print frame-arguments set to scalars"
# Test with "print frame-arguments" set to "none"
gdb_test_no_output "set print frame-arguments none" \
- "set print frame-arguments none"
+ "set print frame-arguments none"
gdb_test "frame 1" \
- ".*in call_me \\(i=\\.\\.\\., f=\\.\\.\\., s=\\.\\.\\., ss=\\.\\.\\., u=\\.\\.\\., e=\\.\\.\\.\\) at .*frame-args\\.c:.*" \
- "frame 1 with print frame-arguments set to none"
+ ".*in call_me \\(i=\\.\\.\\., f=\\.\\.\\., s=\\.\\.\\., ss=\\.\\.\\., u=\\.\\.\\., e=\\.\\.\\.\\) at .*frame-args\\.c:.*" \
+ "frame 1 with print frame-arguments set to none"
# Test with "print frame-arguments" set to "presence"
gdb_test_no_output "set print frame-arguments presence" \
- "set print frame-arguments presence"
+ "set print frame-arguments presence"
gdb_test "frame 1" \
- ".*in call_me \\(\\.\\.\\.\\) at .*frame-args\\.c:.*" \
- "frame 1 with print frame-arguments set to presence"
+ ".*in call_me \\(\\.\\.\\.\\) at .*frame-args\\.c:.*" \
+ "frame 1 with print frame-arguments set to presence"
gdb_test "frame 2" \
- ".*in main \\(\\) at .*frame-args\\.c:.*" \
- "frame 2 (no args) with print frame-arguments set to presence"
+ ".*in main \\(\\) at .*frame-args\\.c:.*" \
+ "frame 2 (no args) with print frame-arguments set to presence"
# Test with "print frame-info" set to "location-and-address"
gdb_continue_to_breakpoint frame_2
gdb_test "bt" \
"#0 frame_2.*#1 $hex in recursive.*#2 $hex in recursive.*#3 $hex in recursive.*#4 $hex in main.*" \
- "backtrace at breakpoint with recursive frames"
+ "backtrace at breakpoint with recursive frames"
# Check "frame function" when a function name occurs multiple times in
# the stack. The inner most (lowest level) should always be selected.
{echo Invalid i value\n}
{else}
{if (i%2) == 0}
- {echo "even "}
- {print i}
- {else}
- {echo "odd "}
- {print i}
- {end}
- {set variable $foo = 0}
- {set variable $j = 0}
- {while $j < i}
- {set variable $foo += $j}
- {set variable $j++}
- {end}
- {print $foo}
- {if i != 40}
- {c}
- {end}
+ {echo "even "}
+ {print i}
+ {else}
+ {echo "odd "}
+ {print i}
+ {end}
+ {set variable $foo = 0}
+ {set variable $j = 0}
+ {while $j < i}
+ {set variable $foo += $j}
+ {set variable $j++}
+ {end}
+ {print $foo}
+ {if i != 40}
+ {c}
+ {end}
{end}
- {end}}
+ {end}}
send_gdb "commands\n"
for {set i 0} {$i < [llength $lines]} {incr i} {
gdb_expect {
- -re ".*>" {
- send_gdb "[lindex $lines $i]\n"
- }
- -re "$gdb_prompt $" {
- set reason "got top-level prompt early"
- break
- }
- timeout {
- set reason "timeout"
- break
- }
+ -re ".*>" {
+ send_gdb "[lindex $lines $i]\n"
+ }
+ -re "$gdb_prompt $" {
+ set reason "got top-level prompt early"
+ break
+ }
+ timeout {
+ set reason "timeout"
+ break
+ }
}
}
if {$i >= [llength $lines]} {
# include <alloca.h>
# define HAVE_STACK_ALLOCA 1
# ifdef __STDC__
- void *alloca ();
+ void *alloca ();
# else
- char *alloca ();
+ char *alloca ();
# endif /* __STDC__ */
# endif /* sparc */
# endif /* Not AIX */
set res [remote_spawn target "$binfile $detached \"$gcore_cmd\" $corefile"]
if { ![gdb_assert { ![expr {$res < 0 || $res == ""}] } \
"spawned gcore"] } {
- return
+ return
}
set saw_corefile_created false
}
}
gdb_test "print 1U/0" ".*Division by zero.*" "test unsigned division by zero"
-
{
union
{
- int i;
+ int i;
};
} a;
{
return sizeof (a.i);
}
-
gdb_test "print a.i" " = 0"
gdb_test "print sizeof (a.i)" " = \[0-9\]+"
gdb_test "print sizeof (a.i) == sizeof (int)" " = 1"
-
myrec.x = 78;
return myrec.x;
}
-
gdb_test "continue" \
".*${nl}.*atchpoint \[0-9\]+: myrec\.x${nl}Old value = 5${nl}New value = 78${nl}.*" \
"watchpoint variable triggers at continue"
-
kfail "gdb/1555" $name
}
}
-
return
}
gdb_test "print /x bar" "{x__0 = 0x0, y__0 = 0x0, z__1 = 0x0}"
-
gdb_test_no_output "show commands"
} elseif { $size != "1" } {
gdb_test "show commands" \
- " . show history size\r\n . show commands"
+ " . show history size\r\n . show commands"
}
- }
+ }
}
}
gdb_start
gdb_test "server show commands" " . print 1.*"
}
- }
+ }
}
}
"index-cache is now enabled"
with_test_prefix "deprecated commands" {
- gdb_test "set index-cache off" ".*is deprecated.*" "disable index cache"
+ gdb_test "set index-cache off" ".*is deprecated.*" "disable index cache"
gdb_test \
"show index-cache enabled" \
"The index cache is off." \
"index-cache is now disabled"
- gdb_test "set index-cache on" ".*is deprecated.*" "enable index cache"
+ gdb_test "set index-cache on" ".*is deprecated.*" "enable index cache"
gdb_test \
"show index-cache enabled" \
"The index cache is on." \
global gdb_prompt
foreach {name} {struct_01_01 struct_01_02 struct_01_03 struct_01_04
- struct_02_01 struct_02_02 struct_02_03 struct_02_04
- struct_04_01 struct_04_02 struct_04_03 struct_04_04
- struct_05_01 struct_05_02 struct_05_03 struct_05_04
- struct_static_02_01 struct_static_02_02 struct_static_02_03 struct_static_02_04
- struct_static_04_01 struct_static_04_02 struct_static_04_03 struct_static_04_04
- struct_static_06_01 struct_static_06_02 struct_static_06_03 struct_static_06_04} {
+ struct_02_01 struct_02_02 struct_02_03 struct_02_04
+ struct_04_01 struct_04_02 struct_04_03 struct_04_04
+ struct_05_01 struct_05_02 struct_05_03 struct_05_04
+ struct_static_02_01 struct_static_02_02 struct_static_02_03 struct_static_02_04
+ struct_static_04_01 struct_static_04_02 struct_static_04_03 struct_static_04_04
+ struct_static_06_01 struct_static_06_02 struct_static_06_03 struct_static_06_04} {
# Only run static member tests on C++
if { $lang == "c" && [regexp "static" $name match] } {
# it is formatted properly. For instance, make sure that no '\n' is
# missing at the end some lines.
gdb_test "info target" \
- "Symbols from \".*${testfile}.*\"\\..*${eol}Local exec file:${eol}.*Entry point: 0x\[0-9a-zA-Z\]+${eol}.*"
+ "Symbols from \".*${testfile}.*\"\\..*${eol}Local exec file:${eol}.*Entry point: 0x\[0-9a-zA-Z\]+${eol}.*"
# at <twice+N> where N is different from zero.
set fun_decl_line [gdb_get_line_number "THIS LINE"]
gdb_test "info line ${srcfile}:${fun_decl_line}" \
- "Line ${fun_decl_line} of \".*${testfile}\.c\" starts at address 0x\[0-9a-f\]+ <twice> and ends at .*"
+ "Line ${fun_decl_line} of \".*${testfile}\.c\" starts at address 0x\[0-9a-f\]+ <twice> and ends at .*"
# change of the interactive-mode setting.
gdb_test_no_output "set interactive-mode auto"
gdb_test "source $script" "$script_output" \
- "source script with interactive-mode auto"
+ "source script with interactive-mode auto"
gdb_test "print 3" "= 3" "sanity check with interactive-mode auto"
gdb_test "show interactive-mode" \
- "Debugger's interactive mode is auto \\(currently .*\\)\\." \
+ "Debugger's interactive mode is auto \\(currently .*\\)\\." \
"show interactive-mode, auto"
# Test sourcing of the script with interactive mode `on'.
# change of the interactive-mode setting.
gdb_test_no_output "set interactive-mode on"
gdb_test "source $script" "$script_output" \
- "source script with interactive-mode on"
+ "source script with interactive-mode on"
gdb_test "print 4" "= 4" "sanity check with interactive-mode on"
gdb_test "show interactive-mode" \
- "Debugger's interactive mode is on\\." \
+ "Debugger's interactive mode is on\\." \
"show interactive-mode, on"
# Test sourcing of the script with interactive mode `off'.
# change of the interactive-mode setting.
gdb_test_no_output "set interactive-mode off"
gdb_test "source $script" "$script_output" \
- "source script with interactive-mode off"
+ "source script with interactive-mode off"
gdb_test "print 5" "= 5" "sanity check with interactive-mode off"
gdb_test "show interactive-mode" \
- "Debugger's interactive mode is off\\." \
+ "Debugger's interactive mode is off\\." \
"show interactive-mode, off"
-
}
}
- if { ! [target_info exists gdb,nosignals] } {
+ if { ! [target_info exists gdb,nosignals] } {
# Wait until the program is in the read system call again.
sleep 2
{
const char *s = strtab + p->st_name;
if (strcmp (s, sym_name) == 0)
- return (void *) p->st_value;
+ return (void *) p->st_value;
}
}
}
}
void *addr = mmap (load_addr, st.st_size,
- PROT_READ | PROT_WRITE | PROT_EXEC,
+ PROT_READ | PROT_WRITE | PROT_EXEC,
load_addr != NULL ? MAP_PRIVATE | MAP_FIXED : MAP_PRIVATE,
fd, 0);
close (fd);
#ifdef JIT_H
#error "We don't include jit.h directly since we'd like the jit-reader unit \
- tests to break if we make ABI incompatible changes to the structures \
- re-declared here."
+ tests to break if we make ABI incompatible changes to the structures \
+ re-declared here."
#endif
#ifndef JIT_PROTOCOL_H
static enum gdb_status
read_debug_info (struct gdb_reader_funcs *self,
struct gdb_symbol_callbacks *cbs,
- void *memory, long memory_sz)
+ void *memory, long memory_sz)
{
struct jithost_abi *symfile = memory;
struct gdb_object *object = cbs->object_open (cbs);
static void
write_register (struct gdb_unwind_callbacks *callbacks, int dw_reg,
- uintptr_t value)
+ uintptr_t value)
{
const int size = sizeof (uintptr_t);
struct gdb_reg_value *reg_val =
-re ".*= ($decimal).*\r\n$gdb_prompt $" {
set value $expect_out(1,string)
pass "$msg"
- }
+ }
}
return ${value}
}
return cppsub_(&c__10000);
#line 7 "langs1.f"
} /* fsub_ */
-
gdb_test_no_output "set variable ldbl_308 = 1.6e+308l"
gdb_test "print ldbl_308" \
- "= 1\..*e\\+308"
-
+ "= 1\..*e\\+308"
}
gdb_test "break $srcfile:65535" \
- ".*Breakpoint 1 at .*: file .*$srcfile, line 65535\\..*" \
+ ".*Breakpoint 1 at .*: file .*$srcfile, line 65535\\..*" \
"break at line 65535"
set test_name "tolerate macro info with multiple #inclusions per line"
gdb_test_multiple "break -q main" $test_name {
-re "Breakpoint 1 at 0x.*: file .*lineinc.c.*\\.\r\n${gdb_prompt}" {
- pass $test_name
+ pass $test_name
}
-re ".*internal-error:.*.y or n. " {
- fail $test_name
- send_gdb "y\n"
- gdb_expect {
- -re ".*.y or n. " {
- send_gdb "n\n"
- exp_continue
- }
- -re "$gdb_prompt" {
- }
- timeout {
- fail "$test_name (timeout)"
- }
- }
+ fail $test_name
+ send_gdb "y\n"
+ gdb_expect {
+ -re ".*.y or n. " {
+ send_gdb "n\n"
+ exp_continue
+ }
+ -re "$gdb_prompt" {
+ }
+ timeout {
+ fail "$test_name (timeout)"
+ }
+ }
}
}
"Producer is \[^\n\r\]+" \
"Compiled with DWARF $decimal debugging format." \
"Does not include preprocessor macro info." ]
-
-i $inferior_spawn_id
-ex "this is line number $i" {
incr i
- if {$i != $expected_lines} {
+ if {$i != $expected_lines} {
set more 1
}
}
{
*(.data)
*(.gnu.linkonce.d*)
- _ovly_table = .;
+ _ovly_table = .;
_ovly0_entry = .;
LONG(ABSOLUTE(ADDR(.ovly0)));
LONG(SIZEOF(.ovly0));
if {$debug_me} {exp_internal 1}
gdb_expect {
- -re "Defined at \[^\r\n\]*(${filepat}):${nonzero}\[\r\n\]" {
- # `location' and `definition' should be empty when we see
- # this message.
- if {[llength $location] == 0 && [llength $definition] == 0} {
- set location $expect_out(1,string)
- exp_continue
- } else {
- # Exit this expect loop, with a result indicating failure.
- set definition {}
- }
- }
- -re "The symbol `${macro}' has no definition as a C/C\\+\\+ preprocessor macro\[^\r\n\]*\[\r\n\]" {
- # `location' and `definition' should be empty when we see
- # this message.
- if {[llength $location] == 0 && [llength $definition] == 0} {
- set definition undefined
- exp_continue
- } else {
- # Exit this expect loop, with a result indicating failure.
- set definition {}
- }
- }
- -re "^\[\r\n\]* included at \[^\r\n\]*(${filepat}):${nonzero}\[\r\n\]" {
- # `location' should *not* be empty when we see this
- # message. It should have recorded at least the initial
- # `Defined at ' message (for definitions) or ` at' message
- # (for undefined symbols).
- if {[llength $location] != 0} {
- lappend location $expect_out(1,string)
- exp_continue
- } else {
- # Exit this expect loop, with a result indicating failure.
- set definition {}
- }
- }
- -re "^\[\r\n\]*at \[^\r\n\]*(${filepat}):${nonzero}\[\r\n\]" {
- # This appears after a `has no definition' message.
- # `location' should be empty when we see it.
- if {[string compare $definition undefined] == 0 \
- && [llength $location] == 0} {
- set location $expect_out(1,string)
- exp_continue
- } else {
- # Exit this expect loop, with a result indicating failure.
- set definition {}
- }
- }
- -re "#define ${macro} (\[^\r\n\]*)\[\r\n\]" {
- # `definition' should be empty when we see this message.
- if {[string compare $definition ""] == 0} {
- set definition $expect_out(1,string)
- exp_continue
- } else {
- # Exit this expect loop, with a result indicating failure.
- set definition {}
- }
- }
- -re "has no preprocessor macro information.*$gdb_prompt $" {
- set definition no-macro-info
- }
- -re "$gdb_prompt $" {
- # Exit the expect loop; let the existing value of `definition'
- # indicate failure or success.
- }
- timeout {
- set definition timeout
- }
+ -re "Defined at \[^\r\n\]*(${filepat}):${nonzero}\[\r\n\]" {
+ # `location' and `definition' should be empty when we see
+ # this message.
+ if {[llength $location] == 0 && [llength $definition] == 0} {
+ set location $expect_out(1,string)
+ exp_continue
+ } else {
+ # Exit this expect loop, with a result indicating failure.
+ set definition {}
+ }
+ }
+ -re "The symbol `${macro}' has no definition as a C/C\\+\\+ preprocessor macro\[^\r\n\]*\[\r\n\]" {
+ # `location' and `definition' should be empty when we see
+ # this message.
+ if {[llength $location] == 0 && [llength $definition] == 0} {
+ set definition undefined
+ exp_continue
+ } else {
+ # Exit this expect loop, with a result indicating failure.
+ set definition {}
+ }
+ }
+ -re "^\[\r\n\]* included at \[^\r\n\]*(${filepat}):${nonzero}\[\r\n\]" {
+ # `location' should *not* be empty when we see this
+ # message. It should have recorded at least the initial
+ # `Defined at ' message (for definitions) or ` at' message
+ # (for undefined symbols).
+ if {[llength $location] != 0} {
+ lappend location $expect_out(1,string)
+ exp_continue
+ } else {
+ # Exit this expect loop, with a result indicating failure.
+ set definition {}
+ }
+ }
+ -re "^\[\r\n\]*at \[^\r\n\]*(${filepat}):${nonzero}\[\r\n\]" {
+ # This appears after a `has no definition' message.
+ # `location' should be empty when we see it.
+ if {[string compare $definition undefined] == 0 \
+ && [llength $location] == 0} {
+ set location $expect_out(1,string)
+ exp_continue
+ } else {
+ # Exit this expect loop, with a result indicating failure.
+ set definition {}
+ }
+ }
+ -re "#define ${macro} (\[^\r\n\]*)\[\r\n\]" {
+ # `definition' should be empty when we see this message.
+ if {[string compare $definition ""] == 0} {
+ set definition $expect_out(1,string)
+ exp_continue
+ } else {
+ # Exit this expect loop, with a result indicating failure.
+ set definition {}
+ }
+ }
+ -re "has no preprocessor macro information.*$gdb_prompt $" {
+ set definition no-macro-info
+ }
+ -re "$gdb_prompt $" {
+ # Exit the expect loop; let the existing value of `definition'
+ # indicate failure or success.
+ }
+ timeout {
+ set definition timeout
+ }
}
if {$debug_me} {exp_internal 0}
switch -exact -- $definition {
- no-macro-info { return no-macro-info }
- timeout { return timeout }
- undefined { return undefined }
- default {
- if {[llength $location] >= 1} {
- return [concat $location [list $definition]]
- } else {
- return {}
- }
- }
+ no-macro-info { return no-macro-info }
+ timeout { return timeout }
+ undefined { return undefined }
+ default {
+ if {[llength $location] >= 1} {
+ return [concat $location [list $definition]]
+ } else {
+ return {}
+ }
+ }
}
}
proc check_macro {macro expected where} {
set func_def [info_macro $macro]
if {[string compare $func_def $expected] == 0} {
- pass "info macro $macro $where"
+ pass "info macro $macro $where"
} else {
- switch -exact -- $func_def {
- no-macro-info {
- xfail "executable includes no macro debugging information"
- return 1
- }
+ switch -exact -- $func_def {
+ no-macro-info {
+ xfail "executable includes no macro debugging information"
+ return 1
+ }
undefined {
fail "info macro $macro $where (undefined)"
return 1
}
- timeout {
- fail "info macro $macro $where (timeout)"
- }
- default {
- fail "info macro $macro $where"
- }
- }
+ timeout {
+ fail "info macro $macro $where (timeout)"
+ }
+ default {
+ fail "info macro $macro $where"
+ }
+ }
}
return 0
}
gdb_test "list macscp4_2_from_macscp2" ".*macscp4_2_, MACSCP4_INCLUSION.*"
switch -exact -- [info_macro WHERE] {
{macscp4.h macscp2.h macscp1.c {before macscp4_2_..., from macscp2.h}} {
- pass "info macro WHERE after `list macscp_4_2_from_macscp2'"
+ pass "info macro WHERE after `list macscp_4_2_from_macscp2'"
}
{macscp4.h macscp3.h macscp1.c {before macscp4_2_..., from macscp3.h}} {
- setup_kfail "gdb/7660" *-*-*
- fail "info macro WHERE after `list macscp_4_2_from_macscp2' (gdb/7660)"
+ setup_kfail "gdb/7660" *-*-*
+ fail "info macro WHERE after `list macscp_4_2_from_macscp2' (gdb/7660)"
}
timeout {
- fail "info macro WHERE after `list macscp_4_2_from_macscp2' (timeout)"
+ fail "info macro WHERE after `list macscp_4_2_from_macscp2' (timeout)"
}
default { fail "info macro WHERE after `list macscp_4_2_from_macscp2'" }
}
gdb_test "list macscp4_2_from_macscp3" ".*macscp4_2_, MACSCP4_INCLUSION.*"
switch -exact -- [info_macro WHERE] {
{macscp4.h macscp3.h macscp1.c {before macscp4_2_..., from macscp3.h}} {
- pass "info macro WHERE after `list macscp_4_2_from_macscp3'"
+ pass "info macro WHERE after `list macscp_4_2_from_macscp3'"
}
{macscp4.h macscp2.h macscp1.c {before macscp4_2_..., from macscp2.h}} {
- setup_kfail "gdb/7660" *-*-*
- fail "info macro WHERE after `list macscp_4_2_from_macscp3' (gdb/7660)"
+ setup_kfail "gdb/7660" *-*-*
+ fail "info macro WHERE after `list macscp_4_2_from_macscp3' (gdb/7660)"
}
timeout {
- fail "info macro WHERE after `list macscp_4_2_from_macscp3' (timeout)"
+ fail "info macro WHERE after `list macscp_4_2_from_macscp3' (timeout)"
}
default { fail "info macro WHERE after `list macscp_4_2_from_macscp3'" }
}
set funcs {
{
- macscp1_1
- {macscp1.c {before macscp1_1}}
+ macscp1_1
+ {macscp1.c {before macscp1_1}}
}
{
- macscp2_1
- {macscp2.h macscp1.c {before macscp2_1}}
+ macscp2_1
+ {macscp2.h macscp1.c {before macscp2_1}}
}
{
- macscp4_1_from_macscp2
- {macscp4.h macscp2.h macscp1.c {before macscp4_1_..., from macscp2.h}}
- {macscp4.h macscp3.h macscp1.c {before macscp4_1_..., from macscp3.h}}
+ macscp4_1_from_macscp2
+ {macscp4.h macscp2.h macscp1.c {before macscp4_1_..., from macscp2.h}}
+ {macscp4.h macscp3.h macscp1.c {before macscp4_1_..., from macscp3.h}}
}
{
- macscp4_2_from_macscp2
- {macscp4.h macscp2.h macscp1.c {before macscp4_2_..., from macscp2.h}}
- {macscp4.h macscp3.h macscp1.c {before macscp4_2_..., from macscp3.h}}
+ macscp4_2_from_macscp2
+ {macscp4.h macscp2.h macscp1.c {before macscp4_2_..., from macscp2.h}}
+ {macscp4.h macscp3.h macscp1.c {before macscp4_2_..., from macscp3.h}}
}
{
- macscp2_2
- {macscp2.h macscp1.c {before macscp2_2}}
+ macscp2_2
+ {macscp2.h macscp1.c {before macscp2_2}}
}
{
- macscp1_2
- {macscp1.c {before macscp1_2}}
+ macscp1_2
+ {macscp1.c {before macscp1_2}}
}
{
- macscp3_1
- {macscp3.h macscp1.c {before macscp3_1}}
+ macscp3_1
+ {macscp3.h macscp1.c {before macscp3_1}}
}
{
- macscp4_1_from_macscp3
- {macscp4.h macscp3.h macscp1.c {before macscp4_1_..., from macscp3.h}}
- {macscp4.h macscp2.h macscp1.c {before macscp4_1_..., from macscp2.h}}
+ macscp4_1_from_macscp3
+ {macscp4.h macscp3.h macscp1.c {before macscp4_1_..., from macscp3.h}}
+ {macscp4.h macscp2.h macscp1.c {before macscp4_1_..., from macscp2.h}}
}
{
- macscp4_2_from_macscp3
- {macscp4.h macscp3.h macscp1.c {before macscp4_2_..., from macscp3.h}}
- {macscp4.h macscp2.h macscp1.c {before macscp4_2_..., from macscp2.h}}
+ macscp4_2_from_macscp3
+ {macscp4.h macscp3.h macscp1.c {before macscp4_2_..., from macscp3.h}}
+ {macscp4.h macscp2.h macscp1.c {before macscp4_2_..., from macscp2.h}}
}
{
- macscp3_2
- {macscp3.h macscp1.c {before macscp3_2}}
+ macscp3_2
+ {macscp3.h macscp1.c {before macscp3_2}}
}
{
- macscp1_3
- {macscp1.c {before macscp1_3}}
+ macscp1_3
+ {macscp1.c {before macscp1_3}}
}
}
# Check the macro WHERE.
set result [info_macro WHERE]
if {[string compare $result $expected] == 0} {
- pass "info macro WHERE stopped in $func"
+ pass "info macro WHERE stopped in $func"
} elseif {[string compare $result $kfail_expected] == 0} {
- setup_kfail "gdb/7660" *-*-*
- fail "info macro WHERE stopped in $func (gdb/7660)"
+ setup_kfail "gdb/7660" *-*-*
+ fail "info macro WHERE stopped in $func (gdb/7660)"
} elseif {[string compare $result timeout] == 0} {
- fail "info macro WHERE stopped in $func (timeout)"
+ fail "info macro WHERE stopped in $func (timeout)"
} else {
- fail "info macro WHERE stopped in $func"
+ fail "info macro WHERE stopped in $func"
}
# Check that the BEFORE_<func> macros for all prior functions are
# #defined, and that those for all subsequent functions are not.
for {set j 0} {$j < [llength $funcs]} {incr j} {
- if {$j != $i} {
- set func_j_entry [lindex $funcs $j]
- set func_j [lindex $func_j_entry 0]
-
- set before_macro "BEFORE_[string toupper $func_j]"
- set test_name \
- "$before_macro defined/undefined when stopped at $func"
- set result [info_macro $before_macro]
-
- if {$j < $i} {
- if {[llength $result] >= 2 && \
- [string compare [lindex $result end] {}] == 0} {
- pass $test_name
- } elseif {[string compare $result timeout] == 0} {
- fail "$test_name (timeout)"
- } else {
- maybe_kfail $func "$test_name"
- }
- } elseif {$j > $i} {
- switch -- [lindex $result end] {
- undefined { pass $test_name }
- timeout { fail "$test_name (timeout)" }
- default {
- maybe_kfail $func "$test_name"
- }
- }
- }
-
- set until_macro "UNTIL_[string toupper $func_j]"
- set test_name \
- "$until_macro defined/undefined when stopped at $func"
- set result [info_macro $until_macro]
-
- if {$j <= $i} {
- switch -- [lindex $result end] {
- undefined { pass $test_name }
- timeout { fail "$test_name (timeout)" }
- default {
- maybe_kfail $func "$test_name"
- }
- }
- } elseif {$j > $i} {
- if {[llength $result] >= 2 && \
- [string compare [lindex $result end] {}] == 0} {
- pass $test_name
- } elseif {[string compare $result timeout] == 0} {
- fail "$test_name (timeout)"
- } else {
- maybe_kfail $func "$test_name"
- }
- }
- }
+ if {$j != $i} {
+ set func_j_entry [lindex $funcs $j]
+ set func_j [lindex $func_j_entry 0]
+
+ set before_macro "BEFORE_[string toupper $func_j]"
+ set test_name \
+ "$before_macro defined/undefined when stopped at $func"
+ set result [info_macro $before_macro]
+
+ if {$j < $i} {
+ if {[llength $result] >= 2 && \
+ [string compare [lindex $result end] {}] == 0} {
+ pass $test_name
+ } elseif {[string compare $result timeout] == 0} {
+ fail "$test_name (timeout)"
+ } else {
+ maybe_kfail $func "$test_name"
+ }
+ } elseif {$j > $i} {
+ switch -- [lindex $result end] {
+ undefined { pass $test_name }
+ timeout { fail "$test_name (timeout)" }
+ default {
+ maybe_kfail $func "$test_name"
+ }
+ }
+ }
+
+ set until_macro "UNTIL_[string toupper $func_j]"
+ set test_name \
+ "$until_macro defined/undefined when stopped at $func"
+ set result [info_macro $until_macro]
+
+ if {$j <= $i} {
+ switch -- [lindex $result end] {
+ undefined { pass $test_name }
+ timeout { fail "$test_name (timeout)" }
+ default {
+ maybe_kfail $func "$test_name"
+ }
+ }
+ } elseif {$j > $i} {
+ if {[llength $result] >= 2 && \
+ [string compare [lindex $result end] {}] == 0} {
+ pass $test_name
+ } elseif {[string compare $result timeout] == 0} {
+ fail "$test_name (timeout)"
+ } else {
+ maybe_kfail $func "$test_name"
+ }
+ }
+ }
}
}
exp_continue
}
-re "\[0-9\]+\[^\r\n\]+\[0-9\]+\[^\r\n\]+\[0-9\]+\[^\r\n\]+\[0-9\]+\[^\r\n\]+\r\n" {
- set saw_registers 1
- exp_continue
+ set saw_registers 1
+ exp_continue
}
-re "^\\*\[0-9\]+\[^\r\n\]+\r\n" {
- exp_continue
+ exp_continue
}
-re "$gdb_prompt $" {
- gdb_assert { $saw_registers && $saw_headers } $test
+ gdb_assert { $saw_registers && $saw_headers } $test
}
}
set msg "maint print type"
gdb_test_multiple "maint print type argc" $msg {
-re "type node $hex\r\nname .int. \\($hex\\)\r\ncode $hex \\(TYPE_CODE_INT\\)\r\nlength \[24\]\r\nobjfile $hex\r\ntarget_type $hex\r\npointer_type $hex\r\nreference_type $hex\r\ntype_chain $hex\r\ninstance_flags $hex\r\nflags\r\nnfields 0 $hex\r\n$gdb_prompt $" {
- pass $msg
+ pass $msg
}
}
if {[istarget "hppa*-*-11*"]} {
setup_xfail hppa*-*-*11* CLLbs14860
gdb_test_multiple "maint print unwind &main" "maint print unwind" {
- -re ".*unwind_table_entry \\($hex\\):\r\n\tregion_start = $hex <main>\r\n\tregion_end = $hex <main\\+\[0-9\]*>\r\n\tflags = Args_stored Save_RP\r\n\tRegion_description = $hex\r\n\tEntry_FR = $hex\r\n\tEntry_GR = $hex\r\n\tTotal_frame_size = $hex\r\n$gdb_prompt $" {
+ -re ".*unwind_table_entry \\($hex\\):\r\n\tregion_start = $hex <main>\r\n\tregion_end = $hex <main\\+\[0-9\]*>\r\n\tflags = Args_stored Save_RP\r\n\tRegion_description = $hex\r\n\tEntry_FR = $hex\r\n\tEntry_GR = $hex\r\n\tTotal_frame_size = $hex\r\n$gdb_prompt $" {
pass "maint print unwind"
}
- -re ".*unwind_table_entry \\($hex\\):\r\n\tregion_start = $hex <main>\r\n\tregion_end = $hex <main\\+\[0-9\]*>\r\n\tflags = Args_stored Save_RP\r\n\tFLD = $hex\r\n\tFLD = $hex\r\n\tFLD = $hex\r\n\tFLD = $hex\r\n$gdb_prompt $" {
+ -re ".*unwind_table_entry \\($hex\\):\r\n\tregion_start = $hex <main>\r\n\tregion_end = $hex <main\\+\[0-9\]*>\r\n\tflags = Args_stored Save_RP\r\n\tFLD = $hex\r\n\tFLD = $hex\r\n\tFLD = $hex\r\n\tFLD = $hex\r\n$gdb_prompt $" {
xfail "maint print unwind"
}
}
int a;
struct
{
- int b;
- int c;
+ int b;
+ int c;
};
} d1;
};
int a;
struct
{
- int b[10];
- int c;
+ int b[10];
+ int c;
};
} d1;
};
gdb_test_multiple "print &cbig.c\[0\]" "" {
-re ".\[0-9\]* = $hex \"\".*$gdb_prompt $" {
- pass $gdb_test_name
+ pass $gdb_test_name
}
-re ".\[0-9\]* = $hex \"*\".*$gdb_prompt $" {
- pass $gdb_test_name
+ pass $gdb_test_name
}
}
gdb_test_multiple "print &sbig.s\[0\]" "" {
-re ".\[0-9\]* = \\(short \\*\\) $hex.*$gdb_prompt $" {
- pass $gdb_test_name
+ pass $gdb_test_name
}
-re ".\[0-9\]* = \\(short int \\*\\) $hex.*$gdb_prompt $" {
- pass $gdb_test_name
+ pass $gdb_test_name
}
}
gdb_test_multiple "print &lbig.l\[0\]" "" {
-re ".\[0-9\]* = \\(long \\*\\) $hex.*$gdb_prompt $" {
- pass $gdb_test_name
+ pass $gdb_test_name
}
-re ".\[0-9\]* = \\(long int \\*\\) $hex.*$gdb_prompt $" {
- pass $gdb_test_name
+ pass $gdb_test_name
}
}
gdb_test "print sbig.s\[90\] >> 4" " = 15"
gdb_test "print lbig.l\[333\] >> 6" " = 15624999"
-
if (i == 500)
{
if (munmap (reserved, RESERVED_SIZE) != 0)
- abort ();
+ abort ();
reserved = NULL;
}
}
if { [gdb_compile "${srcdir}/${subdir}/${testcase}.c" \
- [standard_output_file "${testcase}"] \
- executable \
- [list debug "additional_flags=-std=gnu99"]] != "" } {
+ [standard_output_file "${testcase}"] \
+ executable \
+ [list debug "additional_flags=-std=gnu99"]] != "" } {
return -1
}
set bp_location [gdb_get_line_number "STOP" "${testcase}.c"]
gdb_test "break ${testcase}.c:${bp_location}" \
- "Breakpoint \[0-9\]+ at 0x\[0-9a-fA-F\]+: .*" \
- "breakpoint to the STOP marker"
+ "Breakpoint \[0-9\]+ at 0x\[0-9a-fA-F\]+: .*" \
+ "breakpoint to the STOP marker"
gdb_test "continue" \
- "Breakpoint \[0-9\]+, nested .*" \
- "continue to the STOP marker"
+ "Breakpoint \[0-9\]+, nested .*" \
+ "continue to the STOP marker"
# Check we get correct values for both local and non-local variable references.
set bp_location [gdb_get_line_number "STOP" "${testcase}.c"]
gdb_test "break ${testcase}.c:${bp_location}" \
- "Breakpoint \[0-9\]+ at 0x\[0-9a-fA-F\]+: .*" \
- "breakpoint to the STOP marker"
+ "Breakpoint \[0-9\]+ at 0x\[0-9a-fA-F\]+: .*" \
+ "breakpoint to the STOP marker"
with_test_prefix "stop at first iteration" {
gdb_test "continue" \
set bp_location [gdb_get_line_number "STOP" "${testcase}.c"]
gdb_test "break ${testcase}.c:${bp_location}" \
- "Breakpoint \[0-9\]+ at 0x\[0-9a-fA-F\]+: .*" \
- "breakpoint to the STOP marker"
+ "Breakpoint \[0-9\]+ at 0x\[0-9a-fA-F\]+: .*" \
+ "breakpoint to the STOP marker"
gdb_test "continue" \
- "Breakpoint \[0-9\]+, child .*" \
- "continue to the STOP marker"
+ "Breakpoint \[0-9\]+, child .*" \
+ "continue to the STOP marker"
# Check we get correct values for both local and non-local variable references.
gdb_load $binfile
gdb_test "ptype struct not_empty" \
- "type = struct not_empty {$eol${sp}void \\*e;$eol${sp}void \\*u;$eol}"
+ "type = struct not_empty {$eol${sp}void \\*e;$eol${sp}void \\*u;$eol}"
gdb_test "ptype struct empty" \
- "type = struct empty {$eol$sp<no data fields>$eol}"
+ "type = struct empty {$eol$sp<no data fields>$eol}"
gdb_test "ptype union empty_union" \
- "type = union empty_union {$eol$sp<no data fields>$eol}"
+ "type = union empty_union {$eol$sp<no data fields>$eol}"
setup_xfail "vax-*-*" "i*86-sequent-bsd*"
if {!$gcc_compiled} {
- setup_xfail "alpha-*-*"
+ setup_xfail "alpha-*-*"
}
}
+ 'g' + 'r' + 'b' + 'x'));
}
-
send_gdb "overlay list\n"
gdb_expect {
- -re ".*[string_to_regexp $sec1], " { set seen_sec1 1; exp_continue }
- -re ".*[string_to_regexp $sec2], " { set seen_sec2 1; exp_continue }
- -re ".*$gdb_prompt $" {
- if {$seen_sec1 && $seen_sec2} {
- pass "$pairname"
- } else {
- fail "$pairname"
- }
- }
- timeout { fail "(timeout) $pairname" }
+ -re ".*[string_to_regexp $sec1], " { set seen_sec1 1; exp_continue }
+ -re ".*[string_to_regexp $sec2], " { set seen_sec2 1; exp_continue }
+ -re ".*$gdb_prompt $" {
+ if {$seen_sec1 && $seen_sec2} {
+ pass "$pairname"
+ } else {
+ fail "$pairname"
+ }
+ }
+ timeout { fail "(timeout) $pairname" }
}
}
-re ".*$gdb_prompt $" { fail "BT grbx" }
timeout { fail "(timeout) BT grbx" }
}
-
}
-i "$inferior_spawn_id" -re "pie-execl: re-exec" {
# output from inferior
- incr matches_found
+ incr matches_found
if { $matches_found == 2 } {
pass $test
} else {
-i "$gdb_spawn_id"
-re "executing new program.*\r\nBreakpoint \[0-9\]+,\[^\r\n\]* pie_execl_marker .*\r\n$gdb_prompt $" {
# output from gdb
- incr matches_found
+ incr matches_found
if { $matches_found == 2 } {
pass $test
} else {
if { $found == 0 } {
set names [glob -nocomplain -directory $coredir core.*]
if {[llength $names] == 1} {
- set corefile [file join $coredir [lindex $names 0]]
- remote_exec build "mv $corefile [standard_output_file prelink.core]"
- set found 1
+ set corefile [file join $coredir [lindex $names 0]]
+ remote_exec build "mv $corefile [standard_output_file prelink.core]"
+ set found 1
}
}
"({{0, 1}, {2, 3}, {4, 5}}|\[Cc\]annot.*)" \
{p int1dim[0]@2@3}
gdb_test_escape_braces "p int1dim\[0\]${ctrlv}@FE_TWO" " = {0, 1}" \
- {p int1dim[0]@TWO}
+ {p int1dim[0]@TWO}
gdb_test_escape_braces "p int1dim\[0\]${ctrlv}@FE_TWO${ctrlv}@three" \
"({{0, 1}, {2, 3}, {4, 5}}|\[Cc\]annot.*)" \
{p int1dim[0]@TWO@three}
#include "prologue-include.h"
return 0;
}
-
# Test setting default display to hex
gdb_test_no_output "set print type hex on"
gdb_test "show print type hex" \
- "Display of struct members offsets and sizes in hexadecimal is on"
+ "Display of struct members offsets and sizes in hexadecimal is on"
# test "ptype /o" is now equivalent to "ptype /ox"
gdb_test "ptype /o struct abc" \
# correctly printed (at nesting level 1 and 2).
gdb_test "ptype the_highest" \
- "type = struct highest \{.*\[\r\n\] *int a;.*\[\r\n\] *struct \{.*\[\r\n\] *int b;.*\[\r\n\] *struct \{\.\.\.\} anonymous_level_2;.*\[\r\n\] *\} anonymous_level_1;.*\[\r\n\]}.*"
+ "type = struct highest \{.*\[\r\n\] *int a;.*\[\r\n\] *struct \{.*\[\r\n\] *int b;.*\[\r\n\] *struct \{\.\.\.\} anonymous_level_2;.*\[\r\n\] *\} anonymous_level_1;.*\[\r\n\]}.*"
# Print the type descrption for one of the fields of variable the_highest.
# The purpose is to verify that the type of a field that was printed above
# nesting level is now one level less).
gdb_test "ptype the_highest.anonymous_level_1" \
- "type = struct \{.*\[\r\n\] *int b;.*\[\r\n\] *struct \{.*\[\r\n\] *int c;.*\[\r\n\] *\} anonymous_level_2;.*\[\r\n\]}.*" \
- "ptype the_highest.anonymous_level_1"
+ "type = struct \{.*\[\r\n\] *int b;.*\[\r\n\] *struct \{.*\[\r\n\] *int c;.*\[\r\n\] *\} anonymous_level_2;.*\[\r\n\]}.*" \
+ "ptype the_highest.anonymous_level_1"
get_debug_format
}
gdb_test_multiple "ptype $id" "ptype $id" {
- -re "type = $prototyped\[\r\n\]+$gdb_prompt $" {
- pass "ptype $id"
- }
- -re "type = $plain\[\r\n\]+$gdb_prompt $" {
- if {$gcc_compiled} { setup_xfail_format "stabs" }
- fail "ptype $id (compiler doesn't emit prototyped types)"
- }
- -re "type = $overprototyped\[\r\n\]+$gdb_prompt $" {
+ -re "type = $prototyped\[\r\n\]+$gdb_prompt $" {
+ pass "ptype $id"
+ }
+ -re "type = $plain\[\r\n\]+$gdb_prompt $" {
+ if {$gcc_compiled} { setup_xfail_format "stabs" }
+ fail "ptype $id (compiler doesn't emit prototyped types)"
+ }
+ -re "type = $overprototyped\[\r\n\]+$gdb_prompt $" {
# C23 no longer supports non-prototype function declaration, in which
# case the overprototyped regexp is the expected one. Simply pass
# in all cases.
pass "ptype $id (overprototyped)"
- }
+ }
}
}
ptype_maybe_prototyped "func_type" "int (*)(int (*)(int, float), float)" \
- "int (*)()"
+ "int (*)()"
ptype_maybe_prototyped "old_fptr" "double (*)()" "double (*)()" \
- "double (*)(void)"
+ "double (*)(void)"
ptype_maybe_prototyped "new_fptr" "double (*)(void)" "double (*)()"
ptype_maybe_prototyped "fptr" "int (*)(int, float)" "int (*)()"
ptype_maybe_prototyped "fptr2" "int *(*)(int (*)(int, float), float)" \
- "int *(*)()"
+ "int *(*)()"
ptype_maybe_prototyped "xptr" "int (*)(int (*)(), int (*)(void), int)" \
- "int (*)()" \
- "int (*)(int (*)(void), int (*)(void), int)"
+ "int (*)()" \
+ "int (*)(int (*)(void), int (*)(void), int)"
ptype_maybe_prototyped "ffptr" "int (*(*)(char))(short int)" \
- "int (*(*)())()"
+ "int (*(*)())()"
ptype_maybe_prototyped "fffptr" "int (*(*(*)(char))(short int))(long int)" \
- "int (*(*(*)())())()"
+ "int (*(*(*)())())()"
# Test printing type of typedefs in different scopes, with same name
# but different type.
}
}
gdb_test "show disable-randomization" \
- "Disabling randomization .* is off." \
- "show disable-randomization off"
+ "Disabling randomization .* is off." \
+ "show disable-randomization off"
set addr1 [address_get "randomized first address"]
set addr2 [address_get "randomized second address"]
gdb_test_no_output "set disable-randomization on"
gdb_test "show disable-randomization" \
- "Disabling randomization .* is on." \
- "show disable-randomization on"
+ "Disabling randomization .* is on." \
+ "show disable-randomization on"
set addr1 [address_get "fixed first address"]
set addr2 [address_get "fixed second address"]
}
gdb_test "break fun_three" \
- "Breakpoint $decimal at $hex"
+ "Breakpoint $decimal at $hex"
gdb_test "continue" \
- "Breakpoint $decimal, $hex in fun_three \\(\\)"
+ "Breakpoint $decimal, $hex in fun_three \\(\\)"
gdb_test "backtrace" \
- [multi_line "#0 $hex in fun_three \\(\\)" \
- "#1 $hex in fun_two \\(\\)" \
- "#2 $hex in fun_one \\(\\)" \
- "#3 $hex in main \\(\\)" ]
+ [multi_line "#0 $hex in fun_three \\(\\)" \
+ "#1 $hex in fun_two \\(\\)" \
+ "#2 $hex in fun_one \\(\\)" \
+ "#3 $hex in main \\(\\)" ]
gdb_test_no_output "maint info symtabs" \
"maint info symtabs no output for --readnever"
}
gdb_test "break $srcfile:[gdb_get_line_number BREAK $srcfile] if n == 3" \
- "Breakpoint $decimal at $hex: file .*recpar\\.c, line $decimal\\."
+ "Breakpoint $decimal at $hex: file .*recpar\\.c, line $decimal\\."
gdb_test "continue" \
- "Breakpoint .* foo \\(n=3\\) at .*$srcfile:$decimal.*"
+ "Breakpoint .* foo \\(n=3\\) at .*$srcfile:$decimal.*"
gdb_test "backtrace" \
- "#0 +foo \\(n=3\\).*\r\n#1.* foo \\(n=4\\).*\r\n#2.* foo \\(n=5\\).*#3.* main \\(\\).*"
+ "#0 +foo \\(n=3\\).*\r\n#1.* foo \\(n=4\\).*\r\n#2.* foo \\(n=5\\).*#3.* main \\(\\).*"
gdb_test "frame 2" \
- "#2 .* foo \\(n=5\\) .*"
+ "#2 .* foo \\(n=5\\) .*"
# In the currently selected frame, n=5, and thus foo::val should be 5
# as well.
gdb_test "print foo::val" \
- " = 5"
+ " = 5"
# Restore the preserved old timeout value.
set timeout $oldtimeout
verbose "Timeout is now $timeout seconds" 2
-
# 1 3 4
gdb_test "print (x == y) < z" "$true" "print value of (x==y)<z"
}
-
# (gdb)
gdb_test "bt" \
- ".*\[^a-zA-Z\]pause\[^a-zA-Z\].*" \
- "pause found in backtrace"
+ ".*\[^a-zA-Z\]pause\[^a-zA-Z\].*" \
+ "pause found in backtrace"
(defun local-sum (n)
(if (zerop n) (insert "0")
(let ((j 1))
- (while (<= j n)
- (insert (local j))
- (if (< j n) (insert "+"))
- (setq j (1+ j))))))
+ (while (<= j n)
+ (insert (local j))
+ (if (< j n) (insert "+"))
+ (setq j (1+ j))))))
(defun local-chain (n previous first-end)
(let ((j 1))
(while (<= j n)
(insert " register int " (local j)
- " = increment (" previous ");")
+ " = increment (" previous ");")
(if first-end
(progn
- (insert " /" "* " first-end " prologue *" "/")
- (setq first-end nil)))
+ (insert " /" "* " first-end " prologue *" "/")
+ (setq first-end nil)))
(insert "\n")
(setq previous (local j))
(setq j (1+ j))))
;; Generate callee functions.
(let ((i 0))
(while (<= i limit)
- (insert (format "/%s Returns n * %d + %d %s/\n"
- "*" i (/ (+ i (* i i)) 2) "*"))
+ (insert (format "/%s Returns n * %d + %d %s/\n"
+ "*" i (/ (+ i (* i i)) 2) "*"))
(insert "int\n")
(insert (callee i) " (int n)\n")
(insert "{\n")
(insert " register int n;\n")
(let ((j 0))
(while (<= j limit)
- (insert " n = " (callee j) " ("
- (if (> j 0) "n + " "")
- last ");\n")
- (setq j (1+ j)))))
+ (insert " n = " (callee j) " ("
+ (if (> j 0) "n + " "")
+ last ");\n")
+ (setq j (1+ j)))))
(insert " return n+")
(local-sum i)
- (insert ";\n")
+ (insert ";\n")
(insert "}\n\n")
(setq i (1+ i))))
for {set c 1} {$c <= $limit} {incr c} {
- # Set a breakpoint at the next caller function.
- gdb_test "tbreak caller$c" "Temporary breakpoint.*\[0-9\]*\\."
+ # Set a breakpoint at the next caller function.
+ gdb_test "tbreak caller$c" "Temporary breakpoint.*\[0-9\]*\\."
# Continue to the next caller function.
gdb_test "continue" " caller$c prologue .*" "run to caller$c"
# Do each callee function.
- for {set e 1} {$e <= $limit} {incr e} {
+ for {set e 1} {$e <= $limit} {incr e} {
- gdb_test "tbreak callee$e" "Temporary breakpoint.*\[0-9\]*\\." \
+ gdb_test "tbreak callee$e" "Temporary breakpoint.*\[0-9\]*\\." \
"caller$c calls callee$e; tbreak callee"
- gdb_test "continue" " callee$e prologue .*/" \
+ gdb_test "continue" " callee$e prologue .*/" \
"caller$c calls callee$e; continue to callee"
- # Do a forced return from the callee.
+ # Do a forced return from the callee.
set test "caller$c calls callee$e; return callee now"
gdb_test "return 0" \
"Make .* return now.*y or n. $" \
"y"
- # Check that the values of the local variables are what
+ # Check that the values of the local variables are what
# they should be.
- for {set var 1} {$var <= $c} {incr var} {
- set expected [expr {0x7eeb + $var}]
+ for {set var 1} {$var <= $c} {incr var} {
+ set expected [expr {0x7eeb + $var}]
set test "caller$c calls callee$e; return restored l$var to $expected"
set pass_pattern " = $expected"
set unsupported_pattern " = <optimized out>"
- gdb_test_multiple "print l$var" $test {
+ gdb_test_multiple "print l$var" $test {
-re "\[\r\n\]*(?:$pass_pattern)\[\r\n\]+$gdb_prompt $" {
pass $test
}
unsupported $test
}
}
- }
- }
+ }
+ }
}
gdb_continue_to_end "" continue 1
return_1 "int"
return_1 "long"
if {![istarget "m6811-*-*"] && ![istarget "h8300*-*"]} {
- return_1 "long_long"
+ return_1 "long_long"
}
if {$allow_float_test} {
return_1 "float"
break_me (); /* Finally, try a breakpoint with commands. */
return 0; /* Return line. */
}
-
say_hello ();
return 0;
}
-
# decides later to reformat sep-proc.c.
gdb_test "list sep-proc.c:$location" \
- "void.*say_hello.*" \
- "list using location inside included file"
+ "void.*say_hello.*" \
+ "list using location inside included file"
# Try the same, but this time with a breakpoint. We need to exit
# GDB to make sure that we havn't loaded the full symbols yet when
set test "breakpoint inside included file"
gdb_test_multiple "break sep-proc.c:$location" "$test" {
-re "Breakpoint.*at.* file .*sep-proc.c, line .*" {
- pass "$test"
+ pass "$test"
}
-re "No source file named sep-proc.c.*" {
- fail "$test"
+ fail "$test"
}
}
-
}
gdb_test "break -q main" \
- "Breakpoint.*at.* file .*$srcfile, line .*"
+ "Breakpoint.*at.* file .*$srcfile, line .*"
# Try deleting all breakpoints, using the "server" command prefix.
# Prefixing the "delete breakpoints" with "server" should turn
# Check the language after the binary has been loaded. It should be
# "auto; currently c".
gdb_test "show lang" \
- "The current source language is \"auto; currently c\"\\." \
- "show lang after loading binary"
+ "The current source language is \"auto; currently c\"\\." \
+ "show lang after loading binary"
# Now, switch the language to a specific language, instead of leaving it
# on auto.
gdb_test_no_output "set lang ada" \
- "forcing the language to ada"
+ "forcing the language to ada"
# Verify that the language is now "ada".
gdb_test "show lang" \
- "The current source language is \"ada\"\\." \
- "show lang after switching language to ada"
+ "The current source language is \"ada\"\\." \
+ "show lang after switching language to ada"
# Then, switch back to auto...
gdb_test_no_output "set lang auto" \
- "switching the language back to auto"
+ "switching the language back to auto"
# ... And verify that the language mode is back to auto *and* that
# the selected language is C.
gdb_test "show lang" \
- "The current source language is \"auto; currently c\"\\." \
- "show lang after having switched back to auto"
-
-
+ "The current source language is \"auto; currently c\"\\." \
+ "show lang after having switched back to auto"
# "No type information for GDB functions"
# Test 'type int', so as to make it fail if ptype is changed.
gdb_test "ptype \$_gdb_maint_setting(\"$setting\")" \
- "type = int"
+ "type = int"
}
}
standard_testfile .c share-psymtabs-bt-2.c
if { [prepare_for_testing "failed to prepare" $testfile "$srcfile $srcfile2" \
- {debug}] } {
+ {debug}] } {
untested "failed to compile"
return -1
}
if { $thissig == "URG" } {
setup_xfail "i*86-pc-linuxoldld-gnu" "i*86-pc-linuxaout-gnu"
}
- # Either Lynx or GDB screws up on SIGPRIO
+ # Either Lynx or GDB screws up on SIGPRIO
if { $thissig == "PRIO" } {
setup_xfail "*-*-*lynx*"
}
if {$missed_handler == "0"} {
gdb_test_multiple "signal 0" "advance to $nextsig" {
-re "Breakpoint.*gen_$nextsig.*\r\n\[0-9\]+\[ \t\]+kill \\(.*\r\n$gdb_prompt $" {
- pass "advance to $nextsig"
- set sig_supported 1
+ pass "advance to $nextsig"
+ set sig_supported 1
}
-re "Breakpoint.*gen_$nextsig.*\r\n\[0-9\]+\[ \t\]+handle_.*\r\n$gdb_prompt $" {
- pass "advance to $nextsig"
- set sig_supported 0
+ pass "advance to $nextsig"
+ set sig_supported 0
}
- }
+ }
}
set thissig $nextsig
}
runto_main
gdb_test "b [gdb_get_line_number "good, not blocked"]" \
- ".*Breakpoint .*sigchld.*" "set breakpoint at success exit"
+ ".*Breakpoint .*sigchld.*" "set breakpoint at success exit"
gdb_test "b [gdb_get_line_number "bad, blocked"]" \
- ".*Breakpoint .*sigchld.*" "set breakpoint at failure exit"
+ ".*Breakpoint .*sigchld.*" "set breakpoint at failure exit"
gdb_test "continue" ".*good, not blocked.*" "SIGCHLD blocked in inferior"
set timeout [expr {$timeout + 60}]
verbose "Timeout is now $timeout seconds" 2
if { ![istarget "*-*-linux*"]
- && ( [istarget "*-*-gnu*"]
- || [istarget "*-*-mach*"] ) } {
+ && ( [istarget "*-*-gnu*"]
+ || [istarget "*-*-mach*"] ) } {
gdb_test_sequence "handle all print" "" \
{
"Signal\[ \]+Stop\[ \]+Print\[ \]+Pass to program\[ \]+Description\r\nSIGHUP\[ \]+Yes\[ \]+Yes\[ \]+Yes\[ \]+Hangup"
# Run until we hit the SIGSEGV (or SIGBUS on some platforms).
gdb_test "continue" \
".*Program received signal (SIGBUS|SIGSEGV).*bowler.*" \
- "continue to fault"
+ "continue to fault"
# Insert conditional breakpoint at faulting instruction
gdb_test "break if 0" ".*" "set conditional breakpoint"
# Step off the faulting instruction into the handler, triggering nested faults
gdb_test "continue" \
- ".*Program received signal (SIGBUS|SIGSEGV).*Program received signal (SIGBUS|SIGSEGV).*exited normally.*" \
+ ".*Program received signal (SIGBUS|SIGSEGV).*Program received signal (SIGBUS|SIGSEGV).*exited normally.*" \
"run through nested faults"
-
test_gdb_complete_none "skip delete a1"
test_gdb_complete_none "skip delete 2-33"
}
-
test_backtrace 0
gdb_test "p lib1_size" " = 8192"
gdb_test "p lib2_size" " = 8192"
-
printf ("foo2 in main\n");
return;
}
-
gdb_test "next" \
"" \
"next succeeds"
-
# All of these pathname and directory manipulations assume
# host == build, so do not attempt this set of tests on remote host.
if {[is_remote host]} {
- return
+ return
}
set working_dir [build_standard_output_file ""]
gdb_load $binfile
if { [ishost *-*-mingw*] } {
- gdb_test_no_output "set directories \$cdir;\$cwd"
+ gdb_test_no_output "set directories \$cdir;\$cwd"
} else {
gdb_test_no_output "set directories \$cdir:\$cwd"
}
# comes from the a command entered at the GDB prompt, and when
# it comes from a script being sourced.
gdb_test "source for-sure-nonexistant-file" \
- "for-sure-nonexistant-file: No such file or directory\."
+ "for-sure-nonexistant-file: No such file or directory\."
gdb_test "source source-nofile.gdb" \
- "warning: for-sure-nonexistant-file: No such file or directory\.\[\r\n\]*source error not fatal"
+ "warning: for-sure-nonexistant-file: No such file or directory\.\[\r\n\]*source error not fatal"
# Test commands that error out in sourced files, including in nested sourced
gdb_breakpoint "foo"
if { $protection == "-fstack-protector-all"
- && [test_compiler_info "gcc-*"] } {
+ && [test_compiler_info "gcc-*"] } {
setup_xfail "gcc/88432" "*-*-linux*"
}
gdb_continue_to_breakpoint "foo" ".*break here.*"
gdb_test "print \$_probe_arg0 == x" " = 1" \
"check \$_probe_arg0 for probe user"
gdb_test "print \$_probe_arg1" \
- "Invalid probe argument 1 -- probe has 1 arguments available" \
- "check \$_probe_arg1 for probe user"
+ "Invalid probe argument 1 -- probe has 1 arguments available" \
+ "check \$_probe_arg1 for probe user"
# Set a breakpoint with multiple probe locations.
gdb_test "break -pstap test:two" \
gdb_test "print \$_probe_arg0 == 23" " = 1" \
"check \$_probe_arg0 for probe user"
gdb_test "print \$_probe_arg1" \
- "Invalid probe argument 1 -- probe has 1 arguments available" \
- "check \$_probe_arg1 for probe user"
+ "Invalid probe argument 1 -- probe has 1 arguments available" \
+ "check \$_probe_arg1 for probe user"
# Set a breakpoint with multiple probe locations.
# In this scenario, we may expect more than 2 locations because of
}
gdb_test "" \
- "Temporary breakpoint $decimal at $hex: file.*main \\(\\) at .*start-cpp.cc:.*" \
- "start"
+ "Temporary breakpoint $decimal at $hex: file.*main \\(\\) at .*start-cpp.cc:.*" \
+ "start"
}
gdb_test "" \
- "main \\(\\) at .*start.c.*" \
- "start"
+ "main \\(\\) at .*start.c.*" \
+ "start"
}
gdb_test "break *hello" \
- "Breakpoint.*at.* file .*$srcfile, line .*" \
- "breakpoint at first instruction of hello()"
+ "Breakpoint.*at.* file .*$srcfile, line .*" \
+ "breakpoint at first instruction of hello()"
gdb_run_cmd
gdb_test "" "Breakpoint.* hello .* at .*$srcfile:.*" "run to hello()"
gdb_test "stepi" \
- ".*" \
- "step first instruction"
+ ".*" \
+ "step first instruction"
gdb_test "bt" \
- "#0 +(0x\[0-9a-z\]+ in )?hello .*#1 +(0x\[0-9a-z\]* in )?main.*" \
- "backtrace after first instruction step"
+ "#0 +(0x\[0-9a-z\]+ in )?hello .*#1 +(0x\[0-9a-z\]* in )?main.*" \
+ "backtrace after first instruction step"
gdb_test "stepi" \
- ".*" \
- "step second instruction"
+ ".*" \
+ "step second instruction"
gdb_test "bt" \
- "#0 +(0x\[0-9a-z\]+ in )?hello .*#1 +(0x\[0-9a-z\]* in )?main.*" \
- "backtrace after second instruction step"
-
+ "#0 +(0x\[0-9a-z\]+ in )?hello .*#1 +(0x\[0-9a-z\]* in )?main.*" \
+ "backtrace after second instruction step"
append cflags " -fcf-protection=none"
}
if { [prepare_for_testing "failed to prepare" $testfile $srcfile \
- [list debug "additional_flags=$cflags"]] } {
+ [list debug "additional_flags=$cflags"]] } {
return -1
}
set count 0
gdb_test_multiple "stepi" "$test" {
- -re "$current.*$gdb_prompt $" {
- incr count
- if { $count < 100 } {
- send_gdb "stepi\n"
- exp_continue
- } else {
- fail "$test"
- }
- }
- -re "$target.*$gdb_prompt $" {
- pass "$test"
- }
+ -re "$current.*$gdb_prompt $" {
+ incr count
+ if { $count < 100 } {
+ send_gdb "stepi\n"
+ exp_continue
+ } else {
+ fail "$test"
+ }
+ }
+ -re "$target.*$gdb_prompt $" {
+ pass "$test"
+ }
}
}
gdb_test "break f1" ".*Breakpoint 2 at .* file .*step-line.c.*"
gdb_test "continue" \
- "Continuing.*Breakpoint 2, f1 \\(i=4\\).*dummy \\(1, i\\);" \
+ "Continuing.*Breakpoint 2, f1 \\(i=4\\).*dummy \\(1, i\\);" \
"continue to f1"
gdb_test "next" \
- ".*i = f2 \\(i\\);.*" \
+ ".*i = f2 \\(i\\);.*" \
"next over dummy 1"
gdb_test "next" \
- ".*dummy \\(2, i\\);.*" \
+ ".*dummy \\(2, i\\);.*" \
"next to dummy 2"
gdb_test "next" \
- ".*i = f2 \\(i\\);.*" \
+ ".*i = f2 \\(i\\);.*" \
"next over dummy 2"
gdb_test "step" \
- ".*f2 \\(i=4\\).*dummy \\(4, i\\);.*" \
+ ".*f2 \\(i=4\\).*dummy \\(4, i\\);.*" \
"step into f2"
gdb_test "next" \
- ".*j = i;.*" \
+ ".*j = i;.*" \
"next over dummy 4"
gdb_test "next" \
- ".*dummy \\(5, i\\);.*" \
+ ".*dummy \\(5, i\\);.*" \
"next to dummy 5"
gdb_test "next" \
- ".*dummy \\(6, j\\);.*" \
+ ".*dummy \\(6, j\\);.*" \
"next to dummy 6"
gdb_test "next" \
- ".*j = SUCC \\(j\\);.*" \
+ ".*j = SUCC \\(j\\);.*" \
"next over dummy 6"
gdb_test "next" \
- ".*dummy \\(7, i\\);.*" \
+ ".*dummy \\(7, i\\);.*" \
"next to dummy 7"
gdb_test "next" \
- ".*dummy \\(8, j\\);.*" \
+ ".*dummy \\(8, j\\);.*" \
"next to dummy 8"
gdb_test "next" \
- ".*j = j - i;.*" \
+ ".*j = j - i;.*" \
"next over dummy 8"
gdb_test "next" \
- ".*dummy \\(9, i\\);.*" \
+ ".*dummy \\(9, i\\);.*" \
"next to dummy 9"
gdb_test "next" \
- ".*dummy \\(10, j\\);.*" \
+ ".*dummy \\(10, j\\);.*" \
"next to dummy 10"
gdb_test "next" \
- ".*RETURN \\(j\\);.*" \
+ ".*RETURN \\(j\\);.*" \
"next over dummy 10"
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
-#
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set test "step out"
if { [istarget "ia64-*-*"] || [istarget "mips*-*-*"]} {
gdb_test_multiple "finish" "$test" {
- -re ".*${decimal}.*a.*5.*= a.*3.*$gdb_prompt $" {
+ -re ".*${decimal}.*a.*5.*= a.*3.*$gdb_prompt $" {
pass "$test"
}
- -re ".*${decimal}.*callee.*INTO.*$gdb_prompt $" {
+ -re ".*${decimal}.*callee.*INTO.*$gdb_prompt $" {
pass "$test"
}
}
".*Breakpoint.* at .*" \
"set breakpoint at call to large_struct_by_value"
gdb_test "continue" \
- ".*Breakpoint ${decimal},.*large_struct_by_value.*" \
+ ".*Breakpoint ${decimal},.*large_struct_by_value.*" \
"run to pass large struct"
set test "large struct by value"
gdb_test_multiple "step" "$test" {
# WANTED: A fairly portable way of convincing the compiler to split a
# value across memory and registers.
-
set test "value foo<n> returned; ${tests}"
gdb_test_multiple "p/c L${n}" "${test}" {
-re " = [foo ${n}].*${gdb_prompt} $" {
- # This answer is okay regardless of whether GDB claims to
- # have set the return value: if it did, then this is what
- # we expected; and if it didn't, then any answer is okay.
- pass "${test}"
+ # This answer is okay regardless of whether GDB claims to
+ # have set the return value: if it did, then this is what
+ # we expected; and if it didn't, then any answer is okay.
+ pass "${test}"
}
-re " = [any $n].*${gdb_prompt} $" {
if {$return_value_known} {
# the location of the return value.
fail "${test}"
} else {
- # We expected L${n} to be set to garbage, so any
- # answer is acceptable.
+ # We expected L${n} to be set to garbage, so any
+ # answer is acceptable.
pass "${test}"
}
}
# commands that do not require the presence of an executable.
gdb_test_no_output "set confirm off" \
- "deactivate GDB's confirmation interface"
+ "deactivate GDB's confirmation interface"
# Clear any substitution rules that are available by default due
# to GDB being configured with --with-relocated-sources.
gdb_test_no_output "unset substitute-path" \
- "remove default substitution rules"
+ "remove default substitution rules"
gdb_test "show substitute-path" \
- "List of all source path substitution rules:" \
- "show substitute-path, no rule entered yet"
+ "List of all source path substitution rules:" \
+ "show substitute-path, no rule entered yet"
gdb_test "show substitute-path from" \
- "Source path substitution rule matching `from':" \
- "show substitute-path from, no rule entered yet"
+ "Source path substitution rule matching `from':" \
+ "show substitute-path from, no rule entered yet"
gdb_test "show substitute-path too many" \
- "Too many arguments in command" \
- "show substitute-path, too many arguments"
+ "Too many arguments in command" \
+ "show substitute-path, too many arguments"
gdb_test "unset substitute-path from" \
- "No substitution rule defined for `from'" \
- "unset substitute-path from, no rule entered yet"
+ "No substitution rule defined for `from'" \
+ "unset substitute-path from, no rule entered yet"
gdb_test_no_output "unset substitute-path" \
- "unset substitute-path, no rule entered yet"
+ "unset substitute-path, no rule entered yet"
gdb_test "unset substitute-path from" \
- "No substitution rule defined for `from'" \
- "unset substitute-path from, after unset substitute-path"
+ "No substitution rule defined for `from'" \
+ "unset substitute-path from, after unset substitute-path"
gdb_test "unset substitute-path from to" \
- "Incorrect usage, too many arguments in command" \
- "unset substitute-path, too many arguments"
+ "Incorrect usage, too many arguments in command" \
+ "unset substitute-path, too many arguments"
gdb_test "set substitute-path too many arguments" \
- "Incorrect usage, too many arguments in command" \
- "set substitute-path, too many arguments"
+ "Incorrect usage, too many arguments in command" \
+ "set substitute-path, too many arguments"
gdb_test "set substitute-path missing" \
- "Incorrect usage, too few arguments in command" \
- "set substitute-path, too few arguments"
+ "Incorrect usage, too few arguments in command" \
+ "set substitute-path, too few arguments"
gdb_test "set substitute-path '' to" \
- "First argument must be at least one character long" \
- "set substitute-path, first argument is empty string"
+ "First argument must be at least one character long" \
+ "set substitute-path, first argument is empty string"
gdb_test_no_output "set substitute-path from to" \
- "add from -> to substitution rule"
+ "add from -> to substitution rule"
gdb_test_no_output "set substitute-path from1 to1/" \
- "add from1 -> to1 substitution rule"
+ "add from1 -> to1 substitution rule"
gdb_test_no_output "set substitute-path source destination" \
- "add source -> destination substitution rule"
+ "add source -> destination substitution rule"
gdb_test_no_output "set substitute-path depuis/ vers" \
- "add depuis -> vers substitution rule"
+ "add depuis -> vers substitution rule"
gdb_test_no_output "set substitute-path empty ''" \
- "add substitution rule to empty string"
+ "add substitution rule to empty string"
gdb_test "show substitute-path" \
- "List of all source path substitution rules:\r\n +`from' -> `to'.\r\n +`from1' -> `to1'.\r\n +`source' -> `destination'.\r\n\ +`depuis' -> `vers'.\r\n +`empty' -> `'." \
- "show substitute-path after all paths added"
+ "List of all source path substitution rules:\r\n +`from' -> `to'.\r\n +`from1' -> `to1'.\r\n +`source' -> `destination'.\r\n\ +`depuis' -> `vers'.\r\n +`empty' -> `'." \
+ "show substitute-path after all paths added"
gdb_test "show substitute-path from" \
- "Source path substitution rule matching `from':\r\n +`from' -> `to'." \
- "show substitute-path from, after all paths added"
+ "Source path substitution rule matching `from':\r\n +`from' -> `to'." \
+ "show substitute-path from, after all paths added"
gdb_test "show substitute-path depuis" \
- "Source path substitution rule matching `depuis':\r\n +`depuis' -> `vers'." \
- "show substitute-path depuis, after all paths added"
+ "Source path substitution rule matching `depuis':\r\n +`depuis' -> `vers'." \
+ "show substitute-path depuis, after all paths added"
gdb_test "show substitute-path from/path" \
- "Source path substitution rule matching `from/path':\r\n +`from' -> `to'." \
- "show substitute-path from/path, after all paths added"
+ "Source path substitution rule matching `from/path':\r\n +`from' -> `to'." \
+ "show substitute-path from/path, after all paths added"
gdb_test "show substitute-path from_a_bad_path" \
- "Source path substitution rule matching `from_a_bad_path':" \
- "show substitute-path from_a_bad_path, after all paths added"
+ "Source path substitution rule matching `from_a_bad_path':" \
+ "show substitute-path from_a_bad_path, after all paths added"
gdb_test "show substitute-path garbage" \
- "Source path substitution rule matching `garbage':" \
- "show substitute-path garbage, after all paths added"
+ "Source path substitution rule matching `garbage':" \
+ "show substitute-path garbage, after all paths added"
gdb_test_no_output "unset substitute-path from" \
- "unset substitute-path from"
+ "unset substitute-path from"
gdb_test "show substitute-path from" \
- "Source path substitution rule matching `from':" \
- "show substitute-path from, after unsetting it"
+ "Source path substitution rule matching `from':" \
+ "show substitute-path from, after unsetting it"
gdb_test "show substitute-path" \
- "List of all source path substitution rules:\r\n +`from1' -> `to1'.\r\n +`source' -> `destination'.\r\n\ +`depuis' -> `vers'.\r\n +`empty' -> `'." \
- "show substitute-path after from rule removed"
+ "List of all source path substitution rules:\r\n +`from1' -> `to1'.\r\n +`source' -> `destination'.\r\n\ +`depuis' -> `vers'.\r\n +`empty' -> `'." \
+ "show substitute-path after from rule removed"
gdb_test "unset substitute-path from" \
- "No substitution rule defined for `from'" \
- "unset substitute-path from after the rule was removed"
+ "No substitution rule defined for `from'" \
+ "unset substitute-path from after the rule was removed"
gdb_test_no_output "unset substitute-path depuis" \
- "unset substitute-path depuis (middle of list)"
+ "unset substitute-path depuis (middle of list)"
gdb_test "show substitute-path" \
- "List of all source path substitution rules:\r\n +`from1' -> `to1'.\r\n +`source' -> `destination'.\r\n\ +`empty' -> `'." \
- "show substitute-path after depuis rule removed"
+ "List of all source path substitution rules:\r\n +`from1' -> `to1'.\r\n +`source' -> `destination'.\r\n\ +`empty' -> `'." \
+ "show substitute-path after depuis rule removed"
gdb_test_no_output "unset substitute-path empty" \
- "unset substitute-path empty (end of list)"
+ "unset substitute-path empty (end of list)"
gdb_test "show substitute-path" \
- "List of all source path substitution rules:\r\n +`from1' -> `to1'.\r\n +`source' -> `destination'." \
- "show substitute-path after empty rule removed"
+ "List of all source path substitution rules:\r\n +`from1' -> `to1'.\r\n +`source' -> `destination'." \
+ "show substitute-path after empty rule removed"
gdb_test_no_output "unset substitute-path" \
- "remove all remaining substitution rules"
+ "remove all remaining substitution rules"
gdb_test "show substitute-path" \
- "List of all source path substitution rules:" \
- "show substitute-path after all remaining rules removed"
-
-
+ "List of all source path substitution rules:" \
+ "show substitute-path after all remaining rules removed"
int sum(int *list, int low, int high)
{
- int i = 0, s = 0; /* stop-in-sum */
- for (i = low; i <= high; i++)
- s += list[i];
- return(s);
+ int i = 0, s = 0; /* stop-in-sum */
+ for (i = low; i <= high; i++)
+ s += list[i];
+ return(s);
}
gdb_test "info terminal" \
[multi_line "Inferior's terminal status .currently saved by GDB.:" \
- "File descriptor flags = .*" \
- "Process group = $decimal" \
- "c_iflag = ${termios(c_iflag)}, c_oflag = ${termios(c_oflag)}," \
- "c_cflag = ${termios(c_cflag)}, c_lflag = ${termios(c_lflag)}.*" ]
+ "File descriptor flags = .*" \
+ "Process group = $decimal" \
+ "c_iflag = ${termios(c_iflag)}, c_oflag = ${termios(c_oflag)}," \
+ "c_cflag = ${termios(c_cflag)}, c_lflag = ${termios(c_lflag)}.*" ]
}
if {[target_info gdb_protocol] == ""} {
# Record the initial terminal settings. Verify that GDB's version of the
# inferior's terminal settings is right.
with_test_prefix "initial" {
- array set termios1 [read_term_settings_from_inferior]
- compare_gdb_and_inferior_settings [array get termios1]
+ array set termios1 [read_term_settings_from_inferior]
+ compare_gdb_and_inferior_settings [array get termios1]
}
# Continue until after the inferior removes ECHO from its terminal settings.
# After the inferior has changed its terminal settings, check that GDB's
# saved version reflects the new settings correctly.
with_test_prefix "post tcsetattr" {
- array set termios2 [read_term_settings_from_inferior]
- compare_gdb_and_inferior_settings [array get termios2]
+ array set termios2 [read_term_settings_from_inferior]
+ compare_gdb_and_inferior_settings [array get termios2]
- # Make sure that the current settings are different than the initial
- # settings... otherwise this test is meaningless.
- gdb_assert {${termios1(c_lflag)} != ${termios2(c_lflag)}}
+ # Make sure that the current settings are different than the initial
+ # settings... otherwise this test is meaningless.
+ gdb_assert {${termios1(c_lflag)} != ${termios2(c_lflag)}}
}
# Continue again...
# ... and verify again, to validate that when resuming, GDB restored the
# inferior's terminal settings correctly.
with_test_prefix "after last resume" {
- array set termios3 [read_term_settings_from_inferior]
- compare_gdb_and_inferior_settings [array get termios3]
- gdb_assert {${termios2(c_iflag)} == ${termios3(c_iflag)}}
- gdb_assert {${termios2(c_oflag)} == ${termios3(c_oflag)}}
- gdb_assert {${termios2(c_cflag)} == ${termios3(c_cflag)}}
- gdb_assert {${termios2(c_lflag)} == ${termios3(c_lflag)}}
+ array set termios3 [read_term_settings_from_inferior]
+ compare_gdb_and_inferior_settings [array get termios3]
+ gdb_assert {${termios2(c_iflag)} == ${termios3(c_iflag)}}
+ gdb_assert {${termios2(c_oflag)} == ${termios3(c_oflag)}}
+ gdb_assert {${termios2(c_cflag)} == ${termios3(c_cflag)}}
+ gdb_assert {${termios2(c_lflag)} == ${termios3(c_lflag)}}
}
} else {
# While only native targets save terminal status, we still test
printf ("Program found %d variables starting with TEST_GDB\n", j);
return 0; /* set breakpoint here. */
}
-
gdb_test "until marker3" \
"($hex in |)main.*argc.*argv.*envp.*at.*${srcfile}:($bp_location20.*marker2 \\(43\\)|$bp_location21.*marker3 \\(.stack., .trace.\\)).*" \
"until func, not called by current frame"
-
gdb_test "print unsigned_short_vla" " = \\\{0, 2, 4, 6, 8\\\}"
gdb_test "print unsigned_char_vla" " = \"AAAAA\""
gdb_test "print foo_vla" \
- "\\\{\\\{a = 0\\\}, \\\{a = 2\\\}, \\\{a = 4\\\}, \\\{a = 6\\\}, \\\{a = 8\\\}\\\}"
+ "\\\{\\\{a = 0\\\}, \\\{a = 2\\\}, \\\{a = 4\\\}, \\\{a = 6\\\}, \\\{a = 8\\\}\\\}"
gdb_test "print bar_vla" \
- "\\\{\\\{x = 0, y = \\\{a = 0\\\}\\\}, \\\{x = 2, y = \\\{a = 2\\\}\\\}, \\\{x = 4, y = \\\{a = 4\\\}\\\}, \\\{x = 6, y = \\\{a = 6\\\}\\\}, \\\{x = 8, y = \\\{a = 8\\\}\\\}\\\}"
+ "\\\{\\\{x = 0, y = \\\{a = 0\\\}\\\}, \\\{x = 2, y = \\\{a = 2\\\}\\\}, \\\{x = 4, y = \\\{a = 4\\\}\\\}, \\\{x = 6, y = \\\{a = 6\\\}\\\}, \\\{x = 8, y = \\\{a = 8\\\}\\\}\\\}"
# Check whatis of VLA's.
gdb_test "whatis int_vla" "type = int \\\[5\\\]"
gdb_test "whatis float_vla" "type = float \\\[5\\\]"
gdb_test "whatis long_vla" "type = long( int)? \\\[5\\\]"
gdb_test "whatis unsigned_long_vla" \
- "type = (long unsigned int|unsigned long) \\\[5\\\]"
+ "type = (long unsigned int|unsigned long) \\\[5\\\]"
gdb_test "whatis char_vla" "type = char \\\[5\\\]"
gdb_test "whatis short_vla" "type = short( int)? \\\[5\\\]"
gdb_test "whatis unsigned_short_vla" \
- "type = (short unsigned int|unsigned short) \\\[5\\\]"
+ "type = (short unsigned int|unsigned short) \\\[5\\\]"
gdb_test "whatis unsigned_char_vla" "type = unsigned char \\\[5\\\]"
gdb_test "whatis foo_vla" "type = struct foo \\\[5\\\]"
gdb_test "whatis bar_vla" "type = BAR \\\[5\\\]"
gdb_test "ptype unsigned_char_vla" "type = unsigned char \\\[5\\\]"
gdb_test "ptype foo_vla" "type = struct foo {\r\n\\s+int a;\r\n} \\\[5\\\]"
gdb_test "ptype bar_vla" \
- "type = struct bar {\r\n\\s+int x;\r\n\\s+struct foo y;\r\n} \\\[5\\\]"
+ "type = struct bar {\r\n\\s+int x;\r\n\\s+struct foo y;\r\n} \\\[5\\\]"
# Check the size of the VLA's.
gdb_breakpoint [gdb_get_line_number "break_end_of_vla_factory"]
gdb_continue_to_breakpoint "break_end_of_vla_factory"
gdb_test "print int_size == sizeof(int_vla)" " = 1" "size of int_vla"
gdb_test "print uint_size == sizeof(unsigned_int_vla)" " = 1" \
- "size of unsigned_int_vla"
+ "size of unsigned_int_vla"
gdb_test "print double_size == sizeof(double_vla)" " = 1" \
- "size of double_vla"
+ "size of double_vla"
gdb_test "print float_size == sizeof(float_vla)" " = 1" \
- "size of float_vla"
+ "size of float_vla"
gdb_test "print long_size == sizeof(long_vla)" " = 1" \
- "size of long_vla"
+ "size of long_vla"
gdb_test "print char_size == sizeof(char_vla)" " = 1" \
- "size of char_vla"
+ "size of char_vla"
gdb_test "print short_size == sizeof(short_vla)" " = 1" \
- "size of short_vla"
+ "size of short_vla"
gdb_test "print ushort_size == sizeof(unsigned_short_vla)" " = 1" \
- "size of unsigned_short_vla"
+ "size of unsigned_short_vla"
gdb_test "print uchar_size == sizeof(unsigned_char_vla)" " = 1" \
- "size of unsigned_char_vla"
+ "size of unsigned_char_vla"
gdb_test "print foo_size == sizeof(foo_vla)" " = 1" "size of foo_vla"
gdb_test "print bar_size == sizeof(bar_vla)" " = 1" "size of bar_vla"
# Check side effects for sizeof argument.
set sizeof_int [get_sizeof "int" 4]
gdb_test_no_output "set variable int_vla\[0\] = 42" \
- "set variable int_vla\[0\] = 42"
+ "set variable int_vla\[0\] = 42"
gdb_test "print sizeof (++int_vla\[0\])" " = ${sizeof_int}"
gdb_test "print int_vla\[0\]" " = 42" \
- "print int_vla\[0\] - sizeof no side effects"
+ "print int_vla\[0\] - sizeof no side effects"
gdb_test "ptype ++int_vla\[0\]" "type = int"
gdb_test "print int_vla\[0\]" " = 42" \
- "print int_vla\[0\] - ptype no side effects"
+ "print int_vla\[0\] - ptype no side effects"
gdb_test "whatis ++int_vla\[0\]" "type = int"
gdb_test "print int_vla\[0\]" " = 42" \
- "print int_vla\[0\] - whatis no side effects"
+ "print int_vla\[0\] - whatis no side effects"
vla_optimized_out $test_prefix $options
}
}
-
gdb_test "print sizeof (vla1\[i++\])" " = ${sizeof_int}"
gdb_test "print i" " = 0" \
- "print i - sizeof no side effects"
+ "print i - sizeof no side effects"
gdb_test "print sizeof (++vla1\[0\])" " = ${sizeof_int}"
gdb_test "print vla1\[0\]" " = 10" \
- "print vla1\[0\] - sizeof no side effects"
+ "print vla1\[0\] - sizeof no side effects"
gdb_test "ptype ++vla1\[0\]" "type = int"
gdb_test "print vla1\[0\]" " = 10" \
- "print vla1\[0\] - ptype no side effects"
+ "print vla1\[0\] - ptype no side effects"
gdb_test "whatis ++vla1\[0\]" "type = int"
gdb_test "print vla1\[0\]" " = 10" \
- "print vla1\[0\] - whatis no side effects"
+ "print vla1\[0\] - whatis no side effects"
gdb_test "print sizeof (vla2\[i++\])" " = ${sizeof_vla}"
gdb_test "print i" " = 2" \
"print i - sizeof with side effects, 2"
gdb_test "print j" " = 0" \
- "print j - sizeof with no side effects"
+ "print j - sizeof with no side effects"
gdb_test "ptype vla2\[i++\]" "type = int \\\[10\\\]"
gdb_test "print i" " = 2" \
gdb_test "print i" " = 2" \
"print i - ptype with side effects, 2"
gdb_test "print j" " = 0" \
- "print j - ptype with no side effects"
+ "print j - ptype with no side effects"
gdb_test "whatis vla2\[i++\]" "type = int \\\[10\\\]"
gdb_test "print i" " = 2" \
gdb_test "print i" " = 2" \
"print i - whatis with side effects, 2"
gdb_test "print j" " = 0" \
- "print j - whatis with no side effects"
+ "print j - whatis with no side effects"
for (i = 0; i < NUM; i++)
{
- res = pthread_create (&threads[i],
- NULL,
- thread_function,
+ res = pthread_create (&threads[i],
+ NULL,
+ thread_function,
(void *) i);
}
pthread_exit (NULL);
}
-
}
gdb_test "thread" ".*Current thread is $thread_num .*" $check
}
-
gdb_test "cont" "Continuing.*Breakpoint.*marker5 \\(\\).*" \
"did not trigger wrong watchpoint"
- # Test watches of things declared locally in a function.
- # In particular, test that a watch of stack-based things
- # is deleted when the stack-based things go out of scope.
- #
+ # Test watches of things declared locally in a function.
+ # In particular, test that a watch of stack-based things
+ # is deleted when the stack-based things go out of scope.
+ #
gdb_test_no_output "disable" "disable in test_complex_watchpoint, first time"
- gdb_test "break marker6" ".*Breakpoint.*"
- gdb_test "cont" "Continuing.*Breakpoint.*marker6 \\(\\).*" \
- "continue to marker6"
+ gdb_test "break marker6" ".*Breakpoint.*"
+ gdb_test "cont" "Continuing.*Breakpoint.*marker6 \\(\\).*" \
+ "continue to marker6"
gdb_breakpoint [gdb_get_line_number "func2 breakpoint here"]
gdb_continue_to_breakpoint "func2 breakpoint here, first time"
- # Test a watch of a single stack-based variable, whose scope
- # is the function we're now in. This should auto-delete when
- # execution exits the scope of the watchpoint.
- #
+ # Test a watch of a single stack-based variable, whose scope
+ # is the function we're now in. This should auto-delete when
+ # execution exits the scope of the watchpoint.
+ #
gdb_test "watch local_a" \
"^(?:Hardware w|W)atchpoint $::decimal: local_a" \
"set local watch"
- gdb_test "cont" "\[Ww\]atchpoint.*local_a.*" "trigger local watch"
+ gdb_test "cont" "\[Ww\]atchpoint.*local_a.*" "trigger local watch"
set test "self-delete local watch"
- gdb_test_multiple "cont" $test {
+ gdb_test_multiple "cont" $test {
-re "Continuing.*\[Ww\]atchpoint .* deleted because the program has left the block in.*which its expression is valid.*\r\n$gdb_prompt $" {
pass $test
}
}
gdb_continue_to_breakpoint "func2 breakpoint here, second time"
- # We should be in "func2" again now. Test a watch of an
- # expression which includes both a stack-based local and
- # something whose scope is larger than this invocation
- # of "func2". This should also auto-delete.
- #
+ # We should be in "func2" again now. Test a watch of an
+ # expression which includes both a stack-based local and
+ # something whose scope is larger than this invocation
+ # of "func2". This should also auto-delete.
+ #
gdb_test "watch local_a + ival5" \
"^(?:Hardware w|W)atchpoint $::decimal: local_a . ival5" \
"set partially local watch"
- gdb_test "cont" "Continuing.*\[Ww\]atchpoint .*: local_a . ival5.*" \
- "trigger1 partially local watch"
- gdb_test "cont" "Continuing.*\[Ww\]atchpoint .*: local_a . ival5.*" \
- "trigger2 partially local watch"
- gdb_test "cont" "Continuing.*\[Ww\]atchpoint .* deleted because the program has left the block in.*which its expression is valid.*" \
- "self-delete partially local watch"
-
- # We should be in "func2" again now. Test a watch of a
- # static (non-stack-based) local. Since this has scope
- # across any invocations of "func2", it should not auto-
- # delete.
- #
+ gdb_test "cont" "Continuing.*\[Ww\]atchpoint .*: local_a . ival5.*" \
+ "trigger1 partially local watch"
+ gdb_test "cont" "Continuing.*\[Ww\]atchpoint .*: local_a . ival5.*" \
+ "trigger2 partially local watch"
+ gdb_test "cont" "Continuing.*\[Ww\]atchpoint .* deleted because the program has left the block in.*which its expression is valid.*" \
+ "self-delete partially local watch"
+
+ # We should be in "func2" again now. Test a watch of a
+ # static (non-stack-based) local. Since this has scope
+ # across any invocations of "func2", it should not auto-
+ # delete.
+ #
gdb_continue_to_breakpoint "func2 breakpoint here, third time"
gdb_test "watch static_b" \
"^(?:Hardware w|W)atchpoint $::decimal: static_b" \
- "set static local watch"
- gdb_test "cont" "Continuing.*\[Ww\]atchpoint .*: static_b.*" \
- "trigger static local watch"
- gdb_test "cont" "Continuing.*marker6 \\(\\).*" \
- "continue after trigger static local watch"
- gdb_test "info break" ".*watchpoint.*static_b.*" \
- "static local watch did not self-delete"
-
- # We should be in "recurser" now. Test a watch of a stack-
- # based local. Symbols mentioned in a watchpoint are bound
- # at watchpoint-creation. Thus, a watch of a stack-based
- # local to a recursing function should be bound only to that
- # one invocation, and should not trigger for other invocations.
- #
+ "set static local watch"
+ gdb_test "cont" "Continuing.*\[Ww\]atchpoint .*: static_b.*" \
+ "trigger static local watch"
+ gdb_test "cont" "Continuing.*marker6 \\(\\).*" \
+ "continue after trigger static local watch"
+ gdb_test "info break" ".*watchpoint.*static_b.*" \
+ "static local watch did not self-delete"
+
+ # We should be in "recurser" now. Test a watch of a stack-
+ # based local. Symbols mentioned in a watchpoint are bound
+ # at watchpoint-creation. Thus, a watch of a stack-based
+ # local to a recursing function should be bound only to that
+ # one invocation, and should not trigger for other invocations.
+ #
with_test_prefix "local_x" {
gdb_test "tbreak recurser" ".*breakpoint.*"
gdb_test "cont" "Continuing.*recurser.*"
"self-delete local watch in recursive call"
}
- # Repeat the preceding test, but this time use "recurser::local_x" as
- # the variable to track.
+ # Repeat the preceding test, but this time use "recurser::local_x" as
+ # the variable to track.
with_test_prefix "recurser::local_x" {
gdb_test "cont" "Continuing.*marker6.*" "continue to marker6"
gdb_test "tbreak recurser" ".*breakpoint.*"
# Platforms where the target can't watch such a large region
# should clear hw_expected below.
if { $no_hw || !$allow_hw_watchpoint_tests_p
- || [istarget arm*-*-*]
- || ([istarget powerpc*-*-*] && ![is_lp64_target])} {
+ || [istarget arm*-*-*]
+ || ([istarget powerpc*-*-*] && ![is_lp64_target])} {
set hw_expected 0
} else {
set hw_expected 1
# Platforms where the target can't watch such a large region
# should clear hw_expected below.
if { $no_hw || !$allow_hw_watchpoint_tests_p
- || [istarget arm*-*-*]
- || [istarget powerpc*-*-*]} {
+ || [istarget arm*-*-*]
+ || [istarget powerpc*-*-*]} {
set hw_expected 0
} else {
set hw_expected 1
gdb_test "watch ival3 if count > 1 thread 1 " \
"watch ival3 if count > 1 thread 1 \r\nWatchpoint \[0-9\]*: ival3.*" \
- "set slow condition watch w/thread"
+ "set slow condition watch w/thread"
gdb_test_no_output "delete \$bpnum" "delete watch w/condition and thread"
# Re-enable hardware watchpoints if necessary.
if {$allow_hw_watchpoint_tests_p} {
- gdb_test_no_output "set can-use-hw-watchpoints 1" ""
+ gdb_test_no_output "set can-use-hw-watchpoints 1" ""
}
}
# hardware watchpoint.
gdb_test_no_output "set can-use-hw-watchpoints 0" ""
gdb_test "watch ival1" "Watchpoint \[0-9\]+: ival1" \
- "create watchpoint"
+ "create watchpoint"
# The next tests are written to match the current state of gdb: access
# and read watchpoints require hardware watchpoint support, with this
# turned off these can't be created.
gdb_test "awatch ival1" \
- "Can't set read/access watchpoint when hardware watchpoints are disabled." \
- "create access watchpoint"
+ "Can't set read/access watchpoint when hardware watchpoints are disabled." \
+ "create access watchpoint"
gdb_test "rwatch ival1" \
- "Can't set read/access watchpoint when hardware watchpoints are disabled." \
- "create read watchpoint"
+ "Can't set read/access watchpoint when hardware watchpoints are disabled." \
+ "create read watchpoint"
}
# This will turn hardware watchpoints back on and delete the watchpoint
# Disable hardware watchpoints if necessary.
if {!$allow_hw_watchpoint_tests_p} {
- gdb_test_no_output "set can-use-hw-watchpoints 0" ""
+ gdb_test_no_output "set can-use-hw-watchpoints 0" ""
}
runto_main
do_nothing (difficile);
do_nothing (mixed);
}
-
set opaque_objfile [standard_output_file "$opaque_testfile.o"]
if {[gdb_compile "${srcdir}/${subdir}/$opaque_testfile.c" \
- $opaque_objfile \
- object {}] != ""} {
+ $opaque_objfile \
+ object {}] != ""} {
untested "failed to compile"
return -1
}
proc test_good { arg } {
gdb_test_no_output "set record btrace cpu $arg" "set cpu $arg"
gdb_test "show record btrace cpu" "btrace cpu is '$arg'\." \
- "show cpu $arg"
+ "show cpu $arg"
}
proc test_bad { arg current } {
gdb_test "set record btrace cpu $arg" \
- "Bad format\. See \"help set record btrace cpu\"\." \
- "set cpu $arg"
+ "Bad format\. See \"help set record btrace cpu\"\." \
+ "set cpu $arg"
gdb_test "show record btrace cpu" "btrace cpu is '$current'\." \
- "show cpu $arg"
+ "show cpu $arg"
}
proc test_junk { arg junk current } {
gdb_test "set record btrace cpu $arg" \
- "Trailing junk: '$junk'\." \
- "set cpu $arg"
+ "Trailing junk: '$junk'\." \
+ "set cpu $arg"
gdb_test "show record btrace cpu" "btrace cpu is '$current'\." \
- "show cpu $arg"
+ "show cpu $arg"
}
gdb_test "show record btrace cpu" "btrace cpu is 'auto'\." "default cpu"
global gdb_prompt
with_test_prefix "thread $thread" {
- gdb_test "thread $thread" "(running).*" "is running"
-
- # We can't read the trace while the thread is running.
- gdb_test "info record" "Selected thread is running\." \
- "info record while running"
-
- # Try various commands that try to read trace.
- gdb_test "record instruction-history" "Selected thread is running\."
- gdb_test "record function-call-history" "Selected thread is running\."
-
- # Including reverse-stepping commands.
- gdb_test "reverse-continue" "\[Ss\]elected thread is running\."
- gdb_test "reverse-step" "\[Ss\]elected thread is running\."
- gdb_test "reverse-next" "\[Ss\]elected thread is running\."
- gdb_test "reverse-finish" "\[Ss\]elected thread is running\."
-
- # Stop the thread before reading the trace.
- gdb_test_multiple "interrupt" "interrupt" {
- -re "interrupt\r\n$gdb_prompt " {
- pass "interrupt"
- }
- }
- # Wait until the thread actually stopped.
- gdb_test_multiple "" "stopped" {
- -re "Thread $thread.*stopped\." {
- pass "stopped"
- }
- }
- # We will consume the thread's current location as part of the
- # "info record" output.
- gdb_test "info record" [multi_line \
- "Active record target: record-btrace" \
- "Recording format: .*" \
- "Recorded \[0-9\]+ instructions \[^\\\r\\\n\]*" \
- ]
-
- # Continue the thread again.
- gdb_test "cont&" "Continuing\."
+ gdb_test "thread $thread" "(running).*" "is running"
+
+ # We can't read the trace while the thread is running.
+ gdb_test "info record" "Selected thread is running\." \
+ "info record while running"
+
+ # Try various commands that try to read trace.
+ gdb_test "record instruction-history" "Selected thread is running\."
+ gdb_test "record function-call-history" "Selected thread is running\."
+
+ # Including reverse-stepping commands.
+ gdb_test "reverse-continue" "\[Ss\]elected thread is running\."
+ gdb_test "reverse-step" "\[Ss\]elected thread is running\."
+ gdb_test "reverse-next" "\[Ss\]elected thread is running\."
+ gdb_test "reverse-finish" "\[Ss\]elected thread is running\."
+
+ # Stop the thread before reading the trace.
+ gdb_test_multiple "interrupt" "interrupt" {
+ -re "interrupt\r\n$gdb_prompt " {
+ pass "interrupt"
+ }
+ }
+ # Wait until the thread actually stopped.
+ gdb_test_multiple "" "stopped" {
+ -re "Thread $thread.*stopped\." {
+ pass "stopped"
+ }
+ }
+ # We will consume the thread's current location as part of the
+ # "info record" output.
+ gdb_test "info record" [multi_line \
+ "Active record target: record-btrace" \
+ "Recording format: .*" \
+ "Recorded \[0-9\]+ instructions \[^\\\r\\\n\]*" \
+ ]
+
+ # Continue the thread again.
+ gdb_test "cont&" "Continuing\."
}
}
set testname "determine number of recorded instructions"
gdb_test_multiple "info record" $testname {
-re "Active record target: record-btrace\r\n.*\r\nRecorded \(\[0-9\]*\) instructions in \(\[0-9\]*\) functions \\\(0 gaps\\\) for thread 1 .*\\.\r\n$gdb_prompt $" {
- set traced $expect_out(1,string)
- pass $testname
+ set traced $expect_out(1,string)
+ pass $testname
}
}
global gdb_prompt
set message "test_lines_output: $message"
gdb_test_multiple $command $message {
- -re "\n\(.*\)\r\n$gdb_prompt $" {
- return [split [string trim $expect_out(1,string)] "\n"]
- }
+ -re "\n\(.*\)\r\n$gdb_prompt $" {
+ return [split [string trim $expect_out(1,string)] "\n"]
+ }
}
}
proc check_replay_insn { thread insn } {
gdb_test "thread apply $thread info record" \
- "Replay in progress\. At instruction $insn\."
+ "Replay in progress\. At instruction $insn\."
}
proc check_not_replaying { thread } {
set test "thread $thread not replaying"
gdb_test_multiple "thread apply $thread info record" $test {
- -re "Replay in progress" {
- fail $test
- }
- -re "$gdb_prompt $" {
- pass $test
- }
+ -re "Replay in progress" {
+ fail $test
+ }
+ -re "$gdb_prompt $" {
+ pass $test
+ }
}
}
proc test_navigate {} {
with_test_prefix "navigate" {
- gdb_test "thread 1" ".*"
- with_test_prefix "thread 1" {
- gdb_test "record goto begin" ".*"
-
- check_replay_insn 1 1
- check_not_replaying 2
- }
- gdb_test "thread 2" ".*"
- with_test_prefix "thread 2" {
- gdb_test "record goto begin" ".*"
-
- check_replay_insn 1 1
- check_replay_insn 2 1
- }
+ gdb_test "thread 1" ".*"
+ with_test_prefix "thread 1" {
+ gdb_test "record goto begin" ".*"
+
+ check_replay_insn 1 1
+ check_not_replaying 2
+ }
+ gdb_test "thread 2" ".*"
+ with_test_prefix "thread 2" {
+ gdb_test "record goto begin" ".*"
+
+ check_replay_insn 1 1
+ check_replay_insn 2 1
+ }
}
}
proc test_step {} {
with_test_prefix "step" {
- gdb_test "thread 1" ".*"
- with_test_prefix "thread 1" {
- gdb_test "stepi" ".*"
-
- check_replay_insn 1 2
- check_replay_insn 2 1
- }
- gdb_test "thread 2" ".*"
- with_test_prefix "thread 2" {
- gdb_test "stepi" ".*"
-
- check_replay_insn 1 2
- check_replay_insn 2 2
- }
+ gdb_test "thread 1" ".*"
+ with_test_prefix "thread 1" {
+ gdb_test "stepi" ".*"
+
+ check_replay_insn 1 2
+ check_replay_insn 2 1
+ }
+ gdb_test "thread 2" ".*"
+ with_test_prefix "thread 2" {
+ gdb_test "stepi" ".*"
+
+ check_replay_insn 1 2
+ check_replay_insn 2 2
+ }
}
}
proc test_cont {} {
with_test_prefix "cont" {
- gdb_test "thread 1" ".*"
- with_test_prefix "thread 1" {
- gdb_test "continue" "Reached end of recorded history.*"
-
- check_not_replaying 1
- check_replay_insn 2 2
- }
- gdb_test "thread 2" ".*"
- with_test_prefix "thread 2" {
- gdb_test "continue" "Reached end of recorded history.*"
-
- check_not_replaying 1
- check_not_replaying 2
- }
+ gdb_test "thread 1" ".*"
+ with_test_prefix "thread 1" {
+ gdb_test "continue" "Reached end of recorded history.*"
+
+ check_not_replaying 1
+ check_replay_insn 2 2
+ }
+ gdb_test "thread 2" ".*"
+ with_test_prefix "thread 2" {
+ gdb_test "continue" "Reached end of recorded history.*"
+
+ check_not_replaying 1
+ check_not_replaying 2
+ }
}
}
proc test_cont_all {} {
with_test_prefix "cont-all" {
- gdb_test "continue" "Reached end of recorded history.*"
+ gdb_test "continue" "Reached end of recorded history.*"
- # this works because we're lock-stepping threads that executed exactly
- # the same code starting from the same instruction.
+ # this works because we're lock-stepping threads that executed exactly
+ # the same code starting from the same instruction.
- check_not_replaying 1
- check_not_replaying 2
+ check_not_replaying 1
+ check_not_replaying 2
}
}
proc test_rstep {} {
with_test_prefix "reverse-step" {
- gdb_test "thread apply all record goto 3"
-
- gdb_test "thread 1" ".*"
- with_test_prefix "thread 1" {
- gdb_test "reverse-stepi" ".*"
-
- check_replay_insn 1 2
- check_replay_insn 2 3
- }
- gdb_test "thread 2" ".*"
- with_test_prefix "thread 2" {
- gdb_test "reverse-stepi" ".*"
-
- check_replay_insn 1 2
- check_replay_insn 2 2
- }
+ gdb_test "thread apply all record goto 3"
+
+ gdb_test "thread 1" ".*"
+ with_test_prefix "thread 1" {
+ gdb_test "reverse-stepi" ".*"
+
+ check_replay_insn 1 2
+ check_replay_insn 2 3
+ }
+ gdb_test "thread 2" ".*"
+ with_test_prefix "thread 2" {
+ gdb_test "reverse-stepi" ".*"
+
+ check_replay_insn 1 2
+ check_replay_insn 2 2
+ }
}
}
proc test_goto_end {} {
with_test_prefix "goto-end" {
- gdb_test "thread apply all record goto end"
+ gdb_test "thread apply all record goto end"
- check_not_replaying 1
- check_not_replaying 2
+ check_not_replaying 1
+ check_not_replaying 2
}
}
foreach schedlock { "replay" "on" "step" } {
with_test_prefix "schedlock-$schedlock" {
- gdb_test_no_output "set scheduler-locking $schedlock"
-
- test_navigate
- test_step
- if { $schedlock == "step" } {
- test_cont_all
- } else {
- test_cont
- }
- test_rstep
- test_goto_end
+ gdb_test_no_output "set scheduler-locking $schedlock"
+
+ test_navigate
+ test_step
+ if { $schedlock == "step" } {
+ test_cont_all
+ } else {
+ test_cont
+ }
+ test_rstep
+ test_goto_end
}
}
gdb_test "thread 1" ".*"
with_test_prefix "thread 1" {
- gdb_test "record goto begin" ".*"
+ gdb_test "record goto begin" ".*"
- check_replay_insn 1 1
+ check_replay_insn 1 1
}
gdb_test "thread 2" ".*"
with_test_prefix "thread 2" {
- gdb_test "record goto end" ".*"
+ gdb_test "record goto end" ".*"
- check_not_replaying 2
+ check_not_replaying 2
- # if we reach the breakpoint, thread 2 terminated...
- gdb_cont_to_line $srcfile:$bp_3
+ # if we reach the breakpoint, thread 2 terminated...
+ gdb_cont_to_line $srcfile:$bp_3
- # and thread 1 stopped replaying
- check_not_replaying 1
+ # and thread 1 stopped replaying
+ check_not_replaying 1
}
}
# consume the prompt. since we started the command in the background,
# the prompt precedes any further output except some errors.
gdb_test_multiple "$full_cmd &" "$full_cmd: prompt" {
- -re "$gdb_prompt " {
- pass $gdb_test_name
- }
+ -re "$gdb_prompt " {
+ pass $gdb_test_name
+ }
}
# now check for the expected line - one per thread.
for {set i 0} {$i < $nthreads} {incr i} {
- gdb_test_multiple "" "$full_cmd: thread $i" {
- -re "$line\[^\\\r\\\n\]*\r\n" {
- pass $gdb_test_name
- }
- }
+ gdb_test_multiple "" "$full_cmd: thread $i" {
+ -re "$line\[^\\\r\\\n\]*\r\n" {
+ pass $gdb_test_name
+ }
+ }
}
}
proc gdb_cont_to_bp_line { line threads nthreads } {
gdb_cont_to $threads "continue" \
- [multi_line \
- "Breakpoint\[^\\\r\\\n\]*$line" \
- "\[^\\\r\\\n\]*" \
- ] \
- $nthreads
+ [multi_line \
+ "Breakpoint\[^\\\r\\\n\]*$line" \
+ "\[^\\\r\\\n\]*" \
+ ] \
+ $nthreads
}
proc gdb_cont_to_no_history_backward { threads cmd nthreads } {
gdb_test "thread apply 1 record goto 3" "$loop_line"
gdb_test "thread apply 2 record goto 4" "$loop_line"
gdb_test "thread apply 1 info record" \
- ".*Replay in progress\. At instruction 3\." "thread 1 at insn 3"
+ ".*Replay in progress\. At instruction 3\." "thread 1 at insn 3"
gdb_test "thread apply 2 info record" \
- ".*Replay in progress\. At instruction 4\." "thread 2 at insn 4"
+ ".*Replay in progress\. At instruction 4\." "thread 2 at insn 4"
gdb_test "thread apply all record goto 5" "$loop_line"
gdb_test "thread apply 1 info record" \
- ".*Replay in progress\. At instruction 5\." "thread 1 at insn 5"
+ ".*Replay in progress\. At instruction 5\." "thread 1 at insn 5"
gdb_test "thread apply 2 info record" \
- ".*Replay in progress\. At instruction 5\." "thread 2 at insn 5"
+ ".*Replay in progress\. At instruction 5\." "thread 2 at insn 5"
}
with_test_prefix "step" {
with_test_prefix "thread 1" {
- gdb_test "thread apply 1 stepi 2" "$loop_line"
- gdb_test "thread apply 1 info record" \
- ".*Replay in progress\. At instruction 7\."
- gdb_test "thread apply 2 info record" \
- ".*Replay in progress\. At instruction 5\."
+ gdb_test "thread apply 1 stepi 2" "$loop_line"
+ gdb_test "thread apply 1 info record" \
+ ".*Replay in progress\. At instruction 7\."
+ gdb_test "thread apply 2 info record" \
+ ".*Replay in progress\. At instruction 5\."
}
with_test_prefix "thread 2" {
- gdb_test "thread apply 2 stepi 3" "$loop_line"
- gdb_test "thread apply 1 info record" \
- ".*Replay in progress\. At instruction 7\."
- gdb_test "thread apply 2 info record" \
- ".*Replay in progress\. At instruction 8\."
+ gdb_test "thread apply 2 stepi 3" "$loop_line"
+ gdb_test "thread apply 1 info record" \
+ ".*Replay in progress\. At instruction 7\."
+ gdb_test "thread apply 2 info record" \
+ ".*Replay in progress\. At instruction 8\."
}
with_test_prefix "all" {
- gdb_cont_to all "stepi 4" "$loop_line" 2
- gdb_test "thread apply 1 info record" \
- ".*Replay in progress\. At instruction 11\."
- gdb_test "thread apply 2 info record" \
- ".*Replay in progress\. At instruction 12\."
+ gdb_cont_to all "stepi 4" "$loop_line" 2
+ gdb_test "thread apply 1 info record" \
+ ".*Replay in progress\. At instruction 11\."
+ gdb_test "thread apply 2 info record" \
+ ".*Replay in progress\. At instruction 12\."
}
}
with_test_prefix "reverse-step" {
with_test_prefix "thread 1" {
- gdb_test "thread apply 1 reverse-stepi 2" "$loop_line"
- gdb_test "thread apply 1 info record" \
- ".*Replay in progress\. At instruction 9\."
- gdb_test "thread apply 2 info record" \
- ".*Replay in progress\. At instruction 12\."
+ gdb_test "thread apply 1 reverse-stepi 2" "$loop_line"
+ gdb_test "thread apply 1 info record" \
+ ".*Replay in progress\. At instruction 9\."
+ gdb_test "thread apply 2 info record" \
+ ".*Replay in progress\. At instruction 12\."
}
with_test_prefix "thread 2" {
- gdb_test "thread apply 2 reverse-stepi 3" "$loop_line"
- gdb_test "thread apply 1 info record" \
- ".*Replay in progress\. At instruction 9\."
- gdb_test "thread apply 2 info record" \
- ".*Replay in progress\. At instruction 9\."
+ gdb_test "thread apply 2 reverse-stepi 3" "$loop_line"
+ gdb_test "thread apply 1 info record" \
+ ".*Replay in progress\. At instruction 9\."
+ gdb_test "thread apply 2 info record" \
+ ".*Replay in progress\. At instruction 9\."
}
with_test_prefix "all" {
- gdb_cont_to all "reverse-stepi 4" "$loop_line" 2
- gdb_test "thread apply 1 info record" \
- ".*Replay in progress\. At instruction 5\."
- gdb_test "thread apply 2 info record" \
- ".*Replay in progress\. At instruction 5\."
+ gdb_cont_to all "reverse-stepi 4" "$loop_line" 2
+ gdb_test "thread apply 1 info record" \
+ ".*Replay in progress\. At instruction 5\."
+ gdb_test "thread apply 2 info record" \
+ ".*Replay in progress\. At instruction 5\."
}
}
# a thread may only resume if no thread is still replaying
with_test_prefix "no progress" {
with_test_prefix "thread 1" {
- gdb_test "thread apply 1 record goto end" ".*"
- gdb_test "thread apply 2 record goto begin" ".*"
-
- gdb_cont_to_no_history_forward 1 "continue" 1
- gdb_cont_to_no_history_forward 1 "step" 1
- gdb_test "thread apply 1 info record" \
- ".*Recorded \[0-9\]+ instructions \[^\\\r\\\n\]*"
- gdb_test "thread apply 2 info record" \
- ".*Replay in progress\. At instruction 1\."
+ gdb_test "thread apply 1 record goto end" ".*"
+ gdb_test "thread apply 2 record goto begin" ".*"
+
+ gdb_cont_to_no_history_forward 1 "continue" 1
+ gdb_cont_to_no_history_forward 1 "step" 1
+ gdb_test "thread apply 1 info record" \
+ ".*Recorded \[0-9\]+ instructions \[^\\\r\\\n\]*"
+ gdb_test "thread apply 2 info record" \
+ ".*Replay in progress\. At instruction 1\."
}
with_test_prefix "thread 2" {
- gdb_test "thread apply 1 record goto begin" ".*"
- gdb_test "thread apply 2 record goto end" ".*"
-
- gdb_cont_to_no_history_forward 2 "continue" 1
- gdb_cont_to_no_history_forward 2 "step" 1
- gdb_test "thread apply 1 info record" \
- ".*Replay in progress\. At instruction 1\."
- gdb_test "thread apply 2 info record" \
- ".*Recorded \[0-9\]+ instructions \[^\\\r\\\n\]*"
+ gdb_test "thread apply 1 record goto begin" ".*"
+ gdb_test "thread apply 2 record goto end" ".*"
+
+ gdb_cont_to_no_history_forward 2 "continue" 1
+ gdb_cont_to_no_history_forward 2 "step" 1
+ gdb_test "thread apply 1 info record" \
+ ".*Replay in progress\. At instruction 1\."
+ gdb_test "thread apply 2 info record" \
+ ".*Recorded \[0-9\]+ instructions \[^\\\r\\\n\]*"
}
with_test_prefix "all" {
- gdb_test "thread apply all record goto begin" ".*"
+ gdb_test "thread apply all record goto begin" ".*"
- gdb_cont_to_no_history_forward all "continue" 2
- gdb_test "thread apply 1 info record" \
- ".*Recorded \[0-9\]+ instructions \[^\\\r\\\n\]*"
- gdb_test "thread apply 2 info record" \
- ".*Recorded \[0-9\]+ instructions \[^\\\r\\\n\]*"
+ gdb_cont_to_no_history_forward all "continue" 2
+ gdb_test "thread apply 1 info record" \
+ ".*Recorded \[0-9\]+ instructions \[^\\\r\\\n\]*"
+ gdb_test "thread apply 2 info record" \
+ ".*Recorded \[0-9\]+ instructions \[^\\\r\\\n\]*"
}
}
set test "speculation indication"
gdb_test_multiple "record instruction-history" $test {
-re "$abort_1.*$gdb_prompt $" {
- pass $test
+ pass $test
}
-re "$abort_2.*$gdb_prompt $" {
- pass $test
+ pass $test
}
-re -wrap "$abort_3.*" {
- pass $gdb_test_name
+ pass $gdb_test_name
}
-re "$begin_to_end.*$gdb_prompt $" {
- pass $test
+ pass $test
}
}
{
namespace N4
{
- static int n4static = 400;
-
- struct S4
- {
- static int s4static;
- int s4int_;
- S4 () : s4int_ (4) {};
- ~S4 () { --s4static; }
-
- int get_var () { return s4int_; }
- static int get_svar () { return s4static; }
- };
- int S4::s4static = 40;
+ static int n4static = 400;
+
+ struct S4
+ {
+ static int s4static;
+ int s4int_;
+ S4 () : s4int_ (4) {};
+ ~S4 () { --s4static; }
+
+ int get_var () { return s4int_; }
+ static int get_svar () { return s4static; }
+ };
+ int S4::s4static = 40;
}
}
}
printf ("a.x is %d\n", a.x);
return 0;
}
-
send_gdb "delete\n"
gdb_expect {
-re ".*Delete all breakpoints, watchpoints, tracepoints, and catchpoints. \\(y or n\\) \r\n\032\032query.*$" {
- send_gdb "y\n"
- gdb_expect {
+ send_gdb "y\n"
+ gdb_expect {
-re "\r\n\032\032post-query\r\n${breakpoints_invalid}$gdb_prompt$" { pass "delete bps" }
-re ".*$gdb_prompt$" { fail "delete bps" }
timeout { fail "delete bps (timeout)" }
# reinstall the old prompt for the rest of the testsuite.
set gdb_prompt $old_gdb_prompt
-
printf ("a.x is %d\n", a.x);
return 0;
}
-
send_gdb "delete\n"
gdb_expect {
-re ".*Delete all breakpoints, watchpoints, tracepoints, and catchpoints. \\(y or n\\) \r\n\032\032query.*$" {
- send_gdb "y\n"
- gdb_expect {
+ send_gdb "y\n"
+ gdb_expect {
-re "\r\n\032\032post-query\r\n$gdb_prompt$" { pass "delete bps" }
-re ".*$gdb_prompt$" { fail "delete bps" }
timeout { fail "delete bps (timeout)" }
# reinstall the old prompt for the rest of the testsuite.
set gdb_prompt $old_gdb_prompt
-
nc.test (N::A::X);
return 0;
}
-
gdb_breakpoint [gdb_get_line_number "breakpoint 2" $srcfile]
gdb_continue_to_breakpoint "breakpoint 2"
gdb_test "print X" "= N::A::X" \
- "Print enum constant X of class A in namespace N"
+ "Print enum constant X of class A in namespace N"
# ptype on the enum member
gdb_test_multiple "ptype obj_with_enum.priv_enum" "ptype obj_with_enum.priv_enum" {
- -re "type = enum ClassWithEnum::PrivEnum (: unsigned (int|short|char) )?\{ ?(ClassWithEnum::)?red, (ClassWithEnum::)?green, (ClassWithEnum::)?blue, (ClassWithEnum::)?yellow = 42 ?\}$nl$gdb_prompt $" {
+ -re "type = enum ClassWithEnum::PrivEnum (: unsigned (int|short|char) )?\{ ?(ClassWithEnum::)?red, (ClassWithEnum::)?green, (ClassWithEnum::)?blue, (ClassWithEnum::)?yellow = 42 ?\}$nl$gdb_prompt $" {
pass "ptype obj_with_enum.priv_enum"
- }
+ }
-re "type = enum PrivEnum \{ ?(ClassWithEnum::)?red, (ClassWithEnum::)?green, (ClassWithEnum::)?blue, (ClassWithEnum::)?yellow = 42 ?\}$nl$gdb_prompt $" {
# gcc 2.95.3 -gdwarf-2
# gcc 3.3.2 -gdwarf-2
foo f;
return f.baz (foo::bar () + 3);
}
-
info_func "operator>>=(" "void foo::operator>>=($dm_type_foo_ref);"
info_func "operator|=(" "void foo::operator|=($dm_type_foo_ref);"
info_func "operator$dm_operator_comma\(" \
- "void foo::operator$dm_operator_comma\($dm_type_foo_ref);"
+ "void foo::operator$dm_operator_comma\($dm_type_foo_ref);"
info_func "operator/(" "void foo::operator/($dm_type_foo_ref);"
info_func "operator+(" "void foo::operator+($dm_type_foo_ref);"
info_func "operator<<(" "void foo::operator<<($dm_type_foo_ref);"
int i = 3;
while (i > 0)
- --i;
+ --i;
}
};
}
A()
{
- a=1;
- aa=2;
+ a=1;
+ aa=2;
}
value_type afoo();
value_type foo();
B()
{
- b=3;
- bb=4;
+ b=3;
+ bb=4;
}
A::value_type bfoo();
A::value_type foo();
C()
{
- c=5;
- cc=6;
+ c=5;
+ cc=6;
}
int cfoo();
int foo();
D()
{
- d =7;
- dd=8;
+ d =7;
+ dd=8;
}
value_type dfoo();
value_type foo();
E()
{
- e =9;
- ee=10;
+ e =9;
+ ee=10;
}
value_type efoo();
value_type foo();
F()
{
- f =11;
- ff=12;
+ f =11;
+ ff=12;
}
value_type ffoo();
value_type foo();
G()
{
- g =13;
- gg =14;
- a=15;
- b=16;
- c=17;
+ g =13;
+ gg =14;
+ a=15;
+ b=16;
+ c=17;
}
int gfoo();
gdb_test_multiple "frame" "re-selected 'main' frame after inferior call" {
-re "#0 marker1.*$gdb_prompt $" {
- setup_kfail "gdb/1155" s390-*-linux-gnu
- fail "re-selected 'main' frame after inferior call"
- gdb_test "finish" ".*main.*at .*derivation.cc:.*// marker1-returns-here.*" \
- "finish call to marker1"
+ setup_kfail "gdb/1155" s390-*-linux-gnu
+ fail "re-selected 'main' frame after inferior call"
+ gdb_test "finish" ".*main.*at .*derivation.cc:.*// marker1-returns-here.*" \
+ "finish call to marker1"
}
-re "#1 ($hex in )?main.*$gdb_prompt $" {
- pass "re-selected 'main' frame after inferior call"
+ pass "re-selected 'main' frame after inferior call"
}
}
A2()
{
- a=1;
+ a=1;
}
};
D2()
{
- d=7;
+ d=7;
}
};
k.method();
return k.m2();
}
-
gdb_test_multiple "print &$var" "find address of $var" {
-re "\\$\[0-9\]+ = \\(.*\\) (0x\[0-9a-f\]+).*$gdb_prompt $" {
- return $expect_out(1,string)
- }
- timeout {
+ return $expect_out(1,string)
+ }
+ timeout {
perror "couldn't find address of $var"
return ""
- }
+ }
}
return ""
}
set test "print/x $var"
gdb_test_multiple $test $test {
- -re "\\$\[0-9\]+ = \\([string_to_regexp $type]\\) @0x\[a-f0-9\]+: [string_to_regexp $val].*$gdb_prompt $" {
+ -re "\\$\[0-9\]+ = \\([string_to_regexp $type]\\) @0x\[a-f0-9\]+: [string_to_regexp $val].*$gdb_prompt $" {
pass $test
}
-re "\\$\[0-9\]+ = $addr.*$gdb_prompt $" {
- fail "$test (prints just address)"
- }
+ fail "$test (prints just address)"
+ }
-re "\\$\[0-9\]+ = 0x\[a-f0-9\]+.*$gdb_prompt $" {
- fail "$test (prints unexpected address)"
- }
+ fail "$test (prints unexpected address)"
+ }
}
return 0
}
set test "print/x &$var"
gdb_test_multiple $test $test {
- -re "\\$\[0-9\]+ = $addr.*$gdb_prompt $" {
+ -re "\\$\[0-9\]+ = $addr.*$gdb_prompt $" {
pass $test
}
-re "\\$\[0-9\]+ = 0x\[a-f0-9+\]+.*$gdb_prompt $" {
- fail "$test (prints unexpected address)"
- }
+ fail "$test (prints unexpected address)"
+ }
}
return 0
}
set test "print/x *(&(&$var))"
gdb_test_multiple $test $test {
- -re "\\$\[0-9\]+ = $addr.*$gdb_prompt $" {
+ -re "\\$\[0-9\]+ = $addr.*$gdb_prompt $" {
pass $test
}
-re "Attempt to take address of value not located in memory.*$gdb_prompt $" {
pass $test
}
-re "\\$\[0-9\]+ = 0x\[a-f0-9+\]+.*$gdb_prompt $" {
- fail "$test (prints unexpected address)"
- }
+ fail "$test (prints unexpected address)"
+ }
}
return 0
}
gdb_test "print d2.meth ()" \
".*24.*" \
"gdb2384 at 'Second breakpoint'"
-
public:
int operator== (int)
{
- return 24;
+ return 24;
}
int operator== (float)
{
- return 25;
+ return 25;
}
int operator+ (float)
{
- return 26;
+ return 26;
}
};
r.rfoo();
return first (0, c) + foo (eo) +
- foo (eo, eo) + foo (eo, eo, 1) +
- foo (fo, eo) + foo (1 ,fo, eo) +
- foo (go, fo, eo);
+ foo (eo, eo) + foo (eo, eo, 1) +
+ foo (fo, eo) + foo (1 ,fo, eo) +
+ foo (go, fo, eo);
}
int nil;
int nil_foo (int i)
{
- return i * 27;
+ return i * 27;
}
};
NestedInnerLocal nest1;
set eol "\[\t \]*\r\n\[\t \]*"
gdb_test_multiple "ptype Local" "local out of scope" {
-re "No symbol \"Local\" in current context.*${gdb_prompt} $" {
- pass "local out of scope"
+ pass "local out of scope"
}
-re "ptype Local${eol}type = class Local {${eol} public:${eol} int loc1;${eol}.*${eol} char loc_foo\\(char\\);${eol}}${eol}${gdb_prompt} " {
- # GCC emits STABS debugging information in a way that doesn't
- # properly preserve the scoping of local classes. I think
- # we'd need to start using Sun's extensions to stabs to get
- # this right.
- kfail gdb/825 "Local out of scope"
+ # GCC emits STABS debugging information in a way that doesn't
+ # properly preserve the scoping of local classes. I think
+ # we'd need to start using Sun's extensions to stabs to get
+ # this right.
+ kfail gdb/825 "Local out of scope"
}
-re "ptype Local${eol}type = class Local {${eol} public:${eol} int loc1;${eol} char loc_foo\\(char\\);${eol}.*${eol}}${eol}${gdb_prompt} " {
# gcc 3.X abi-2 -gstabs+
- kfail gdb/825 "Local out of scope"
+ kfail gdb/825 "Local out of scope"
}
}
// try to ensure test4 is actually allocated
int dummy;
};
-
set namespace_help "Deprecated placeholder for removed functionality\\."
test_prefix_command_help {"maintenance cplus"} {
- "C\\+\\+ maintenance commands\.\[\r\n\]+"
+ "C\\+\\+ maintenance commands\.\[\r\n\]+"
}
test_prefix_command_help {"maint cp" "maintenance cplus"} {
- "C\\+\\+ maintenance commands.\r\n\r\n"
+ "C\\+\\+ maintenance commands.\r\n\r\n"
}
set multiple_help_body "List of \"maintenance cplus\" subcommands:.*Command name abbreviations are allowed if unambiguous."
{
return (memcmp (&this->static_field, &rhs.static_field,
sizeof (this->static_field)) == 0
- && this->aa == rhs.aa);
+ && this->aa == rhs.aa);
}
};
bool
check_val (ss v1, ss v2, ss v3, ss v4, ss v5, ss v6, ss v7, ss v8,
- ss v9, ss v10, ss v11, ss v12, ss v13, ss v14, ss v15,
- ss v16, ss v17, ss v18, ss v19, ss v20, ss v21, ss v22,
- ss v23, ss v24, ss v25, ss v26, ss v27, ss v28, ss v29,
- ss v30, ss v31, ss v32, ss v33, ss v34, ss v35, ss v36,
- ss v37, ss v38, ss v39, ss v40)
+ ss v9, ss v10, ss v11, ss v12, ss v13, ss v14, ss v15,
+ ss v16, ss v17, ss v18, ss v19, ss v20, ss v21, ss v22,
+ ss v23, ss v24, ss v25, ss v26, ss v27, ss v28, ss v29,
+ ss v30, ss v31, ss v32, ss v33, ss v34, ss v35, ss v36,
+ ss v37, ss v38, ss v39, ss v40)
{
return (v1 == ref_val && v2 == ref_val && v3 == ref_val && v4 == ref_val
- && v5 == ref_val && v6 == ref_val && v7 == ref_val
- && v8 == ref_val && v9 == ref_val && v10 == ref_val
- && v11 == ref_val && v12 == ref_val && v13 == ref_val
- && v14 == ref_val && v15 == ref_val && v16 == ref_val
- && v17 == ref_val && v18 == ref_val && v19 == ref_val
- && v20 == ref_val && v21 == ref_val && v22 == ref_val
- && v23 == ref_val && v24 == ref_val && v25 == ref_val
- && v26 == ref_val && v27 == ref_val && v28 == ref_val
- && v29 == ref_val && v30 == ref_val && v31 == ref_val
- && v32 == ref_val && v33 == ref_val && v34 == ref_val
- && v35 == ref_val && v36 == ref_val && v37 == ref_val
- && v38 == ref_val && v39 == ref_val && v40 == ref_val);
+ && v5 == ref_val && v6 == ref_val && v7 == ref_val
+ && v8 == ref_val && v9 == ref_val && v10 == ref_val
+ && v11 == ref_val && v12 == ref_val && v13 == ref_val
+ && v14 == ref_val && v15 == ref_val && v16 == ref_val
+ && v17 == ref_val && v18 == ref_val && v19 == ref_val
+ && v20 == ref_val && v21 == ref_val && v22 == ref_val
+ && v23 == ref_val && v24 == ref_val && v25 == ref_val
+ && v26 == ref_val && v27 == ref_val && v28 == ref_val
+ && v29 == ref_val && v30 == ref_val && v31 == ref_val
+ && v32 == ref_val && v33 == ref_val && v34 == ref_val
+ && v35 == ref_val && v36 == ref_val && v37 == ref_val
+ && v38 == ref_val && v39 == ref_val && v40 == ref_val);
}
int
gdb_test "continue" \
".*exited normally.*" \
"run to exit"
-
-
-
delete_breakpoints
gdb_test "kill" "" "kill" \
- {Kill the program being debugged\? \(y or n\) } "y"
+ {Kill the program being debugged\? \(y or n\) } "y"
gdb_test "break $srcfile:$bp_location" \
"Breakpoint.*at.*: $srcfile:$bp_location. \\(2 locations\\).*" \
f.getFunky(1, 2);
return 0;
}
-
-
-
pass "finish program (exit wrapper)"
}
}
-
set ovlds [lsort {"" "int" "A*"}]
set items {"cancel" "all"}
foreach ovld $ovlds {
- lappend items "A::method($ovld)"
+ lappend items "A::method($ovld)"
}
set menu_items {}
set idx 0
foreach item $items {
- lappend menu_items ".$idx. .*[string_to_regexp $item]"
- incr idx
+ lappend menu_items ".$idx. .*[string_to_regexp $item]"
+ incr idx
}
set expect [join $menu_items {.*[\r\n]*}]
gdb_test_multiple "break A::method" "breaking in method, $lang" {
- -re $expect {
+ -re $expect {
gdb_test "0" \
"canceled" \
$gdb_test_name
gdb_test "print foo::B::B_B" "`foo::B' is not defined as an aggregate type."
gdb_test "print foo::B_B" "foo::B_B"
gdb_test "print A_A" "A_A"
-
struct S12 {
enum E12 {A12, B12, C12};
union U12 {
- int a;
- char c;
+ int a;
+ char c;
};
int i12;
U12 u12;
struct S13 {
- enum E13 {A13, B13, C13};
- union U13 {
- int a;
- char c;
- };
-
- int i13;
- E13 e13;
- U13 u13;
-
- struct S14 {
- enum E14 {A14, B14, C14};
- union U14 {
- int a;
- char c;
- };
-
- int i14;
- E14 e14;
- U14 u14;
-
- struct S15 {
- enum E15 {A15, B15, C15};
- union U15 {
- int a;
- char c;
- };
-
- int i15;
- E15 e15;
- U15 u15;
-
- struct S16 {
- enum E16 {A16, B16, C16};
- union U16 {
- int a;
- char c;
- };
-
- int i16;
- E16 e16;
- U16 u16;
-
- struct S17 {
- enum E17 {A17, B17, C17};
- union U17 {
- int a;
- char c;
- };
-
- int i17;
- E17 e17;
- U17 u17;
-
- struct S18 {
- enum E18 {A18, B18, C18};
- union U18 {
- int a;
- char c;
- };
-
- int i18;
- E18 e18;
- U18 u18;
-
- struct S19 {
- enum E19 {A19, B19, C19};
- union U19 {
- int a;
- char c;
- };
-
- int i19;
- E19 e19;
- U19 u19;
-
- };
- };
- };
- };
- };
- };
+ enum E13 {A13, B13, C13};
+ union U13 {
+ int a;
+ char c;
+ };
+
+ int i13;
+ E13 e13;
+ U13 u13;
+
+ struct S14 {
+ enum E14 {A14, B14, C14};
+ union U14 {
+ int a;
+ char c;
+ };
+
+ int i14;
+ E14 e14;
+ U14 u14;
+
+ struct S15 {
+ enum E15 {A15, B15, C15};
+ union U15 {
+ int a;
+ char c;
+ };
+
+ int i15;
+ E15 e15;
+ U15 u15;
+
+ struct S16 {
+ enum E16 {A16, B16, C16};
+ union U16 {
+ int a;
+ char c;
+ };
+
+ int i16;
+ E16 e16;
+ U16 u16;
+
+ struct S17 {
+ enum E17 {A17, B17, C17};
+ union U17 {
+ int a;
+ char c;
+ };
+
+ int i17;
+ E17 e17;
+ U17 u17;
+
+ struct S18 {
+ enum E18 {A18, B18, C18};
+ union U18 {
+ int a;
+ char c;
+ };
+
+ int i18;
+ E18 e18;
+ U18 u18;
+
+ struct S19 {
+ enum E19 {A19, B19, C19};
+ union U19 {
+ int a;
+ char c;
+ };
+
+ int i19;
+ E19 e19;
+ U19 u19;
+
+ };
+ };
+ };
+ };
+ };
+ };
};
};
};
struct S22 {
enum E22 {A22, B22, C22};
union U22 {
- int a;
- char c;
+ int a;
+ char c;
};
int i22;
U22 u22;
struct S23 {
- enum E23 {A23, B23, C23};
- union U23 {
- int a;
- char c;
- };
-
- int i23;
- E23 e23;
- U23 u23;
-
- struct S24 {
- enum E24 {A24, B24, C24};
- union U24 {
- int a;
- char c;
- };
-
- int i24;
- E24 e24;
- U24 u24;
-
- struct S25 {
- enum E25 {A25, B25, C25};
- union U25 {
- int a;
- char c;
- };
-
- int i25;
- E25 e25;
- U25 u25;
-
- struct S26 {
- enum E26 {A26, B26, C26};
- union U26 {
- int a;
- char c;
- };
-
- int i26;
- E26 e26;
- U26 u26;
-
- struct S27 {
- enum E27 {A27, B27, C27};
- union U27 {
- int a;
- char c;
- };
-
- int i27;
- E27 e27;
- U27 u27;
-
- struct S28 {
- enum E28 {A28, B28, C28};
- union U28 {
- int a;
- char c;
- };
-
- int i28;
- E28 e28;
- U28 u28;
-
- struct S29 {
- enum E29 {A29, B29, C29};
- union U29 {
- int a;
- char c;
- };
-
- int i29;
- E29 e29;
- U29 u29;
-
- };
- };
- };
- };
- };
- };
+ enum E23 {A23, B23, C23};
+ union U23 {
+ int a;
+ char c;
+ };
+
+ int i23;
+ E23 e23;
+ U23 u23;
+
+ struct S24 {
+ enum E24 {A24, B24, C24};
+ union U24 {
+ int a;
+ char c;
+ };
+
+ int i24;
+ E24 e24;
+ U24 u24;
+
+ struct S25 {
+ enum E25 {A25, B25, C25};
+ union U25 {
+ int a;
+ char c;
+ };
+
+ int i25;
+ E25 e25;
+ U25 u25;
+
+ struct S26 {
+ enum E26 {A26, B26, C26};
+ union U26 {
+ int a;
+ char c;
+ };
+
+ int i26;
+ E26 e26;
+ U26 u26;
+
+ struct S27 {
+ enum E27 {A27, B27, C27};
+ union U27 {
+ int a;
+ char c;
+ };
+
+ int i27;
+ E27 e27;
+ U27 u27;
+
+ struct S28 {
+ enum E28 {A28, B28, C28};
+ union U28 {
+ int a;
+ char c;
+ };
+
+ int i28;
+ E28 e28;
+ U28 u28;
+
+ struct S29 {
+ enum E29 {A29, B29, C29};
+ union U29 {
+ int a;
+ char c;
+ };
+
+ int i29;
+ E29 e29;
+ U29 u29;
+
+ };
+ };
+ };
+ };
+ };
+ };
};
};
};
struct S32 {
enum E32 {A32, B32, C32};
union U32 {
- int a;
- char c;
+ int a;
+ char c;
};
int i32;
U32 u32;
struct S33 {
- enum E33 {A33, B33, C33};
- union U33 {
- int a;
- char c;
- };
-
- int i33;
- E33 e33;
- U33 u33;
-
- struct S34 {
- enum E34 {A34, B34, C34};
- union U34 {
- int a;
- char c;
- };
-
- int i34;
- E34 e34;
- U34 u34;
-
- struct S35 {
- enum E35 {A35, B35, C35};
- union U35 {
- int a;
- char c;
- };
-
- int i35;
- E35 e35;
- U35 u35;
-
- struct S36 {
- enum E36 {A36, B36, C36};
- union U36 {
- int a;
- char c;
- };
-
- int i36;
- E36 e36;
- U36 u36;
-
- struct S37 {
- enum E37 {A37, B37, C37};
- union U37 {
- int a;
- char c;
- };
-
- int i37;
- E37 e37;
- U37 u37;
-
- struct S38 {
- enum E38 {A38, B38, C38};
- union U38 {
- int a;
- char c;
- };
-
- int i38;
- E38 e38;
- U38 u38;
-
- struct S39 {
- enum E39 {A39, B39, C39};
- union U39 {
- int a;
- char c;
- };
-
- int i39;
- E39 e39;
- U39 u39;
-
- };
- };
- };
- };
- };
- };
+ enum E33 {A33, B33, C33};
+ union U33 {
+ int a;
+ char c;
+ };
+
+ int i33;
+ E33 e33;
+ U33 u33;
+
+ struct S34 {
+ enum E34 {A34, B34, C34};
+ union U34 {
+ int a;
+ char c;
+ };
+
+ int i34;
+ E34 e34;
+ U34 u34;
+
+ struct S35 {
+ enum E35 {A35, B35, C35};
+ union U35 {
+ int a;
+ char c;
+ };
+
+ int i35;
+ E35 e35;
+ U35 u35;
+
+ struct S36 {
+ enum E36 {A36, B36, C36};
+ union U36 {
+ int a;
+ char c;
+ };
+
+ int i36;
+ E36 e36;
+ U36 u36;
+
+ struct S37 {
+ enum E37 {A37, B37, C37};
+ union U37 {
+ int a;
+ char c;
+ };
+
+ int i37;
+ E37 e37;
+ U37 u37;
+
+ struct S38 {
+ enum E38 {A38, B38, C38};
+ union U38 {
+ int a;
+ char c;
+ };
+
+ int i38;
+ E38 e38;
+ U38 u38;
+
+ struct S39 {
+ enum E39 {A39, B39, C39};
+ union U39 {
+ int a;
+ char c;
+ };
+
+ int i39;
+ E39 e39;
+ U39 u39;
+
+ };
+ };
+ };
+ };
+ };
+ };
};
};
};
struct S42 {
enum E42 {A42, B42, C42};
union U42 {
- int a;
- char c;
+ int a;
+ char c;
};
int i42;
U42 u42;
struct S43 {
- enum E43 {A43, B43, C43};
- union U43 {
- int a;
- char c;
- };
-
- int i43;
- E43 e43;
- U43 u43;
-
- struct S44 {
- enum E44 {A44, B44, C44};
- union U44 {
- int a;
- char c;
- };
-
- int i44;
- E44 e44;
- U44 u44;
-
- struct S45 {
- enum E45 {A45, B45, C45};
- union U45 {
- int a;
- char c;
- };
-
- int i45;
- E45 e45;
- U45 u45;
-
- struct S46 {
- enum E46 {A46, B46, C46};
- union U46 {
- int a;
- char c;
- };
-
- int i46;
- E46 e46;
- U46 u46;
-
- struct S47 {
- enum E47 {A47, B47, C47};
- union U47 {
- int a;
- char c;
- };
-
- int i47;
- E47 e47;
- U47 u47;
-
- struct S48 {
- enum E48 {A48, B48, C48};
- union U48 {
- int a;
- char c;
- };
-
- int i48;
- E48 e48;
- U48 u48;
-
- struct S49 {
- enum E49 {A49, B49, C49};
- union U49 {
- int a;
- char c;
- };
-
- int i49;
- E49 e49;
- U49 u49;
-
- };
- };
- };
- };
- };
- };
+ enum E43 {A43, B43, C43};
+ union U43 {
+ int a;
+ char c;
+ };
+
+ int i43;
+ E43 e43;
+ U43 u43;
+
+ struct S44 {
+ enum E44 {A44, B44, C44};
+ union U44 {
+ int a;
+ char c;
+ };
+
+ int i44;
+ E44 e44;
+ U44 u44;
+
+ struct S45 {
+ enum E45 {A45, B45, C45};
+ union U45 {
+ int a;
+ char c;
+ };
+
+ int i45;
+ E45 e45;
+ U45 u45;
+
+ struct S46 {
+ enum E46 {A46, B46, C46};
+ union U46 {
+ int a;
+ char c;
+ };
+
+ int i46;
+ E46 e46;
+ U46 u46;
+
+ struct S47 {
+ enum E47 {A47, B47, C47};
+ union U47 {
+ int a;
+ char c;
+ };
+
+ int i47;
+ E47 e47;
+ U47 u47;
+
+ struct S48 {
+ enum E48 {A48, B48, C48};
+ union U48 {
+ int a;
+ char c;
+ };
+
+ int i48;
+ E48 e48;
+ U48 u48;
+
+ struct S49 {
+ enum E49 {A49, B49, C49};
+ union U49 {
+ int a;
+ char c;
+ };
+
+ int i49;
+ E49 e49;
+ U49 u49;
+
+ };
+ };
+ };
+ };
+ };
+ };
};
};
};
struct S52 {
enum E52 {A52, B52, C52};
union U52 {
- int a;
- char c;
+ int a;
+ char c;
};
int i52;
U52 u52;
struct S53 {
- enum E53 {A53, B53, C53};
- union U53 {
- int a;
- char c;
- };
-
- int i53;
- E53 e53;
- U53 u53;
-
- struct S54 {
- enum E54 {A54, B54, C54};
- union U54 {
- int a;
- char c;
- };
-
- int i54;
- E54 e54;
- U54 u54;
-
- struct S55 {
- enum E55 {A55, B55, C55};
- union U55 {
- int a;
- char c;
- };
-
- int i55;
- E55 e55;
- U55 u55;
-
- struct S56 {
- enum E56 {A56, B56, C56};
- union U56 {
- int a;
- char c;
- };
-
- int i56;
- E56 e56;
- U56 u56;
-
- struct S57 {
- enum E57 {A57, B57, C57};
- union U57 {
- int a;
- char c;
- };
-
- int i57;
- E57 e57;
- U57 u57;
-
- struct S58 {
- enum E58 {A58, B58, C58};
- union U58 {
- int a;
- char c;
- };
-
- int i58;
- E58 e58;
- U58 u58;
-
- struct S59 {
- enum E59 {A59, B59, C59};
- union U59 {
- int a;
- char c;
- };
-
- int i59;
- E59 e59;
- U59 u59;
-
- };
- };
- };
- };
- };
- };
+ enum E53 {A53, B53, C53};
+ union U53 {
+ int a;
+ char c;
+ };
+
+ int i53;
+ E53 e53;
+ U53 u53;
+
+ struct S54 {
+ enum E54 {A54, B54, C54};
+ union U54 {
+ int a;
+ char c;
+ };
+
+ int i54;
+ E54 e54;
+ U54 u54;
+
+ struct S55 {
+ enum E55 {A55, B55, C55};
+ union U55 {
+ int a;
+ char c;
+ };
+
+ int i55;
+ E55 e55;
+ U55 u55;
+
+ struct S56 {
+ enum E56 {A56, B56, C56};
+ union U56 {
+ int a;
+ char c;
+ };
+
+ int i56;
+ E56 e56;
+ U56 u56;
+
+ struct S57 {
+ enum E57 {A57, B57, C57};
+ union U57 {
+ int a;
+ char c;
+ };
+
+ int i57;
+ E57 e57;
+ U57 u57;
+
+ struct S58 {
+ enum E58 {A58, B58, C58};
+ union U58 {
+ int a;
+ char c;
+ };
+
+ int i58;
+ E58 e58;
+ U58 u58;
+
+ struct S59 {
+ enum E59 {A59, B59, C59};
+ union U59 {
+ int a;
+ char c;
+ };
+
+ int i59;
+ E59 e59;
+ U59 u59;
+
+ };
+ };
+ };
+ };
+ };
+ };
};
};
};
int abc = 33;
int second(){
- return 0;
+ return 0;
}
}
gdb_test "print ab" "= 22"
gdb_test "print abc" "= 33"
}
-
int total = 0;
{
int b = 1;
- {
- using namespace A;
- int c = 2;
- {
- int d = 3;
- total = _a + b + c + d + marker2 (); // marker1 stop
- }
- }
+ {
+ using namespace A;
+ int c = 2;
+ {
+ int d = 3;
+ total = _a + b + c + d + marker2 (); // marker1 stop
+ }
+ }
}
return marker2 () + total;
}
// - S1 is a subsequence of S2
int foo101 (volatile const char*) { return 217; } // array-to-pointer conversion
- // plus qualification conversion
+ // plus qualification conversion
int foo101 ( const char*) { return 218; } // array-to-pointer conversion
int test101 () {
Function F1 is better than function F2 if: */
// - F1 is a non-template function and F2 is a template function
template<class T> int foo12(T) { return 41; }
- int foo12(int) { return 42; }
+ int foo12(int) { return 42; }
int test12 (){
return foo12(1); //42
}
int overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8);
int overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9);
int overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7,
- int a8, int a9, int a10);
+ int a8, int a9, int a10);
int overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7,
- int a8, int a9, int a10, int a11);
+ int a8, int a9, int a10, int a11);
};
return 7;}
int foo::overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7,
- int a8)
+ int a8)
{ a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = 0;
return 8;}
int foo::overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7,
- int a8, int a9)
+ int a8, int a9)
{
a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = a9 = 0;
return 9;
}
int foo::overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7,
- int a8, int a9, int a10)
- { a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = a9 =
- a10 = 0; return 10;}
+ int a8, int a9, int a10)
+ { a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = a9 =
+ a10 = 0; return 10;}
int foo::overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7,
- int a8, int a9, int a10, int a11)
- { a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = a9 =
- a10 = a11 = 0; return 11;}
+ int a8, int a9, int a10, int a11)
+ { a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = a9 =
+ a10 = a11 = 0; return 11;}
gdb_test_multiple "frame" "re-selected 'main' frame after inferior call" {
-re "#0 marker1.*$gdb_prompt $" {
- setup_kfail "gdb/1155" s390-*-linux-gnu
- fail "re-selected 'main' frame after inferior call"
- gdb_test "finish" ".*main.*at .*overload.cc:.*// marker1-returns-here.*" \
- "finish call to marker1"
+ setup_kfail "gdb/1155" s390-*-linux-gnu
+ fail "re-selected 'main' frame after inferior call"
+ gdb_test "finish" ".*main.*at .*overload.cc:.*// marker1-returns-here.*" \
+ "finish call to marker1"
}
-re "#1 ($hex in )?main.*$gdb_prompt $" {
- pass "re-selected 'main' frame after inferior call"
+ pass "re-selected 'main' frame after inferior call"
}
}
int overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8);
int overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9);
int overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7,
- int a8, int a9, int a10);
+ int a8, int a9, int a10);
int overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7,
- int a8, int a9, int a10, int a11);
+ int a8, int a9, int a10, int a11);
};
return 7;}
int foo::overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7,
- int a8)
+ int a8)
{ a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = 0;
return 8;}
int foo::overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7,
- int a8, int a9)
+ int a8, int a9)
{
a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = a9 = 0;
return 9;
}
int foo::overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7,
- int a8, int a9, int a10)
- { a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = a9 =
- a10 = 0; return 10;}
+ int a8, int a9, int a10)
+ { a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = a9 =
+ a10 = 0; return 10;}
int foo::overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7,
- int a8, int a9, int a10, int a11)
- { a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = a9 =
- a10 = a11 = 0; return 11;}
+ int a8, int a9, int a10, int a11)
+ { a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = a9 =
+ a10 = a11 = 0; return 11;}
void foo::foofunc (int a)
void foo::foofunc (int b, signed char *c)
{
}
-
proc take_gdb_out_of_choice_menu {} {
global gdb_prompt
gdb_test_multiple " " " " {
- -re ".*$gdb_prompt $" {
- }
+ -re ".*$gdb_prompt $" {
+ }
timeout {
perror "could not resynchronize to command prompt (timeout)"
continue
-re "$gdb_prompt $" {
gdb_assert {!$bad_bp && $seen_bps == $expected_bps} \
$gdb_test_name
- }
- timeout {
- fail "$gdb_test_name (timeout)"
- take_gdb_out_of_choice_menu
- }
- }
- }
- -re ".*\r\n> " {
- fail "$gdb_test_name (bad menu)"
- take_gdb_out_of_choice_menu
- }
- -re ".*$gdb_prompt $" {
- fail "$gdb_test_name (no menu)"
- }
- timeout {
- fail "$gdb_test_name (timeout)"
- take_gdb_out_of_choice_menu
- }
+ }
+ timeout {
+ fail "$gdb_test_name (timeout)"
+ take_gdb_out_of_choice_menu
+ }
+ }
+ }
+ -re ".*\r\n> " {
+ fail "$gdb_test_name (bad menu)"
+ take_gdb_out_of_choice_menu
+ }
+ -re ".*$gdb_prompt $" {
+ fail "$gdb_test_name (no menu)"
+ }
+ timeout {
+ fail "$gdb_test_name (timeout)"
+ take_gdb_out_of_choice_menu
+ }
}
}
# Probe for the actual type.
gdb_test_multiple "print &foo::overload1arg($types($type))" \
- "probe $types($type)" {
- -re ".*\<foo::.*\>.*$gdb_prompt $" {
- regexp {<.*>} $expect_out(0,string) func
- regexp {\(.*\)} $func real_type
-
- # Store the real type into TYPES.
- set types($type) [string trim $real_type {()}]
-
- # Create an inverse mapping of the actual type to
- # the synthetic type.
- set type_map("$types($type)") $type
- pass "detect $type"
+ "probe $types($type)" {
+ -re ".*\<foo::.*\>.*$gdb_prompt $" {
+ regexp {<.*>} $expect_out(0,string) func
+ regexp {\(.*\)} $func real_type
+
+ # Store the real type into TYPES.
+ set types($type) [string trim $real_type {()}]
+
+ # Create an inverse mapping of the actual type to
+ # the synthetic type.
+ set type_map("$types($type)") $type
+ pass "detect $type"
}
}
}
send_gdb "break foo::overload1arg\n"
gdb_expect {
-re "$menu_overload1arg" {
- pass "bp menu for foo::overload1arg choice cancel"
- # Choose cancel.
- send_gdb "0\n"
- gdb_expect {
- -re "canceled\r\n$gdb_prompt $" {
- pass "set bp on overload1arg canceled"
- }
+ pass "bp menu for foo::overload1arg choice cancel"
+ # Choose cancel.
+ send_gdb "0\n"
+ gdb_expect {
+ -re "canceled\r\n$gdb_prompt $" {
+ pass "set bp on overload1arg canceled"
+ }
-re "cancelled\r\n$gdb_prompt $" {
pass "set bp on overload1arg canceled"
}
- -re ".*$gdb_prompt $" {
- fail "set bp on overload1arg canceled (bad message)"
- }
- timeout {
- fail "set bp on overload1arg canceled (timeout)"
- take_gdb_out_of_choice_menu
- }
- }
+ -re ".*$gdb_prompt $" {
+ fail "set bp on overload1arg canceled (bad message)"
+ }
+ timeout {
+ fail "set bp on overload1arg canceled (timeout)"
+ take_gdb_out_of_choice_menu
+ }
+ }
}
-re ".*\r\n> " {
- fail "bp menu for foo::overload1arg choice cancel (bad menu)"
- take_gdb_out_of_choice_menu
+ fail "bp menu for foo::overload1arg choice cancel (bad menu)"
+ take_gdb_out_of_choice_menu
}
-re ".*$gdb_prompt $" {
- fail "bp menu for foo::overload1arg choice cancel (no menu)"
+ fail "bp menu for foo::overload1arg choice cancel (no menu)"
}
timeout {
- fail "bp menu for foo::overload1arg choice cancel (timeout)"
- take_gdb_out_of_choice_menu
+ fail "bp menu for foo::overload1arg choice cancel (timeout)"
+ take_gdb_out_of_choice_menu
}
}
send_gdb "delete breakpoints\n"
gdb_expect {
-re "Delete all breakpoints, watchpoints, tracepoints, and catchpoints.* $" {
- send_gdb "y\n"
- gdb_expect {
- -re ".*$gdb_prompt $" {
+ send_gdb "y\n"
+ gdb_expect {
+ -re ".*$gdb_prompt $" {
pass "delete all breakpoints, watchpoints, tracepoints, and catchpoints"
- }
- timeout {
+ }
+ timeout {
fail "delete all breakpoints, watchpoints, tracepoints, and catchpoints (timeout)"
- }
- }
+ }
+ }
}
timeout {
fail "delete all breakpoints, watchpoints, tracepoints, and catchpoints (timeout)"
send_gdb "break foo::overload1arg\n"
gdb_expect {
-re "$menu_overload1arg" {
- pass "bp menu for foo::overload1arg choice all"
- # Choose all.
- send_gdb "1\n"
- gdb_expect {
+ pass "bp menu for foo::overload1arg choice all"
+ # Choose all.
+ send_gdb "1\n"
+ gdb_expect {
-re "Breakpoint $bpnum at $hex: foo::overload1arg. .12 locations.\r\n.*$gdb_prompt $" {
- pass "set bp on overload1arg all"
- }
- -re ".*$gdb_prompt $" {
- fail "set bp on overload1arg all (bad message)"
- }
- timeout {
- fail "set bp on overload1arg all (timeout)"
- take_gdb_out_of_choice_menu
- }
- }
+ pass "set bp on overload1arg all"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "set bp on overload1arg all (bad message)"
+ }
+ timeout {
+ fail "set bp on overload1arg all (timeout)"
+ take_gdb_out_of_choice_menu
+ }
+ }
}
-re ".*\r\n> " {
- fail "bp menu for foo::overload1arg choice all (bad menu)"
- take_gdb_out_of_choice_menu
+ fail "bp menu for foo::overload1arg choice all (bad menu)"
+ take_gdb_out_of_choice_menu
}
-re ".*$gdb_prompt $" {
- fail "bp menu for foo::overload1arg choice all (no menu)"
+ fail "bp menu for foo::overload1arg choice all (no menu)"
}
timeout {
- fail "bp menu for foo::overload1arg choice all (timeout)"
- take_gdb_out_of_choice_menu
+ fail "bp menu for foo::overload1arg choice all (timeout)"
+ take_gdb_out_of_choice_menu
}
}
global gdb_prompt hex decimal srcfile bkptno_num_re
if {$argument == ""} {
- set actuals ""
+ set actuals ""
} else {
- set actuals "arg=$argument"
- if {[regexp {char} $argtype]} {
+ set actuals "arg=$argument"
+ if {[regexp {char} $argtype]} {
append actuals " \\'\\\\00$argument\\'"
}
}
if {[string match $argtype "void"]} {
- set body "return $decimal;"
+ set body "return $decimal;"
} else {
- set body "arg = 0; return $decimal;"
+ set body "arg = 0; return $decimal;"
}
gdb_test_multiple "continue" "continue to bp overloaded : $argtype" {
- -re "Continuing.\r\n\r\nBreakpoint $bkptno_num_re, foo::overload1arg \\(this=${hex}(, )?$actuals\\) at .*$srcfile:$line\r\n$decimal\[\t \]+{ $body }.*$gdb_prompt $" {
- pass "continue to bp overloaded : $argtype"
- }
-
- -re "Continuing.\r\n\r\nBreakpoint $bkptno_num_re, foo::overload1arg \\(this=${hex}, arg=.*\\) at .*$srcfile:$line\r\n$decimal\[\t \]+{ $body }.*$gdb_prompt $" {
- if {$might_kfail} {
- kfail "c++/8130" "continue to bp overloaded : $argtype"
- } else {
- fail "continue to bp overloaded : $argtype"
- }
- }
+ -re "Continuing.\r\n\r\nBreakpoint $bkptno_num_re, foo::overload1arg \\(this=${hex}(, )?$actuals\\) at .*$srcfile:$line\r\n$decimal\[\t \]+{ $body }.*$gdb_prompt $" {
+ pass "continue to bp overloaded : $argtype"
+ }
+
+ -re "Continuing.\r\n\r\nBreakpoint $bkptno_num_re, foo::overload1arg \\(this=${hex}, arg=.*\\) at .*$srcfile:$line\r\n$decimal\[\t \]+{ $body }.*$gdb_prompt $" {
+ if {$might_kfail} {
+ kfail "c++/8130" "continue to bp overloaded : $argtype"
+ } else {
+ fail "continue to bp overloaded : $argtype"
+ }
+ }
}
}
explicit {
set declaration "$signature;\n"
set definition "$classname\:\:$signature
- {
- data\[0\] = $CUSTOM;
- data\[[expr {$length - 1}]\] = $CUSTOM;
- tracer = $TRACE;
- }\n"
+ {
+ data\[0\] = $CUSTOM;
+ data\[[expr {$length - 1}]\] = $CUSTOM;
+ tracer = $TRACE;
+ }\n"
}
defaultedIn {
set declaration "$signature = default;\n"
/*** C++ class $classname ***/
class ${classname} {
public:
- $classname (void);
- $declarations
+ $classname (void);
+ $declarations
- int data\[$length\];
+ int data\[$length\];
};
$classname\:\:$classname (void)
{
- data\[0\] = $ORIGINAL;
- data\[[expr {$length - 1}]\] = $ORIGINAL;
+ data\[0\] = $ORIGINAL;
+ data\[[expr {$length - 1}]\] = $ORIGINAL;
}
$definitions
/*** Class that contains $contained ***/
class $classname {
public:
- $contained item;
+ $contained item;
};
$classname ${classname}_var; /* global var */
class C : public A
{
protected:
- B myB;
+ B myB;
};
int main()
gdb_continue_to_breakpoint "marker"
gdb_test "p a" "{static axis = {{static axis = <same as static member of an already.*"
-
return 0; // marker
}
-
-
setup_xfail *-*-*
}
gdb_test "p b" "{<A<int, B>> = {<ATB<int>> = {data = 0}, static DEFAULT_INSTANCE = <optimized out>}, <No data fields>}"
-
gdb_test_multiple "print rs" "print value of rs" {
-re ".\[0-9\]* = \\(short &\\) @$hex: -1.*$gdb_prompt $" {
- pass "print value of rs"
+ pass "print value of rs"
}
-re ".\[0-9\]* = \\(short int &\\) @$hex: -1.*$gdb_prompt $" {
- pass "print value of rs"
+ pass "print value of rs"
}
eof { fail "print rs ($GDB dumped core) (FIXME)" ; gdb_start_again ; }
}
gdb_test_multiple "print rS" "print value of rS" {
-re ".\[0-9\]* = \\(short &\\) @$hex: -14.*$gdb_prompt $" {
- pass "print value of rS"
+ pass "print value of rS"
}
-re ".\[0-9\]* = \\(short int &\\) @$hex: -14.*$gdb_prompt $" {
- pass "print value of rS"
+ pass "print value of rS"
}
}
gdb_test_multiple "print rUS" "print value of rUS" {
-re ".\[0-9\]* = \\(unsigned short &\\) @$hex: 7.*$gdb_prompt $" {
- pass "print value of rUS"
+ pass "print value of rUS"
}
-re ".\[0-9\]* = \\(short unsigned int &\\) @$hex: 7.*$gdb_prompt $" {
- pass "print value of rUS"
+ pass "print value of rUS"
}
}
gdb_test "print rUI" \
".\[0-9\]* = \\(unsigned int &\\) @$hex: 1002" \
- "print value of rUI"
+ "print value of rUI"
gdb_test_multiple "print rL" "print value of rL" {
-re ".\[0-9\]* = \\(long &\\) @$hex: -234.*$gdb_prompt $" {
- pass "print value of rL"
+ pass "print value of rL"
}
-re ".\[0-9\]* = \\(long int &\\) @$hex: -234.*$gdb_prompt $" {
- pass "print value of rL"
+ pass "print value of rL"
}
}
gdb_test_multiple "print rUL" "print value of rUL" {
-re ".\[0-9\]* = \\(unsigned long &\\) @$hex: 234.*$gdb_prompt $" {
- pass "print value of rUL"
+ pass "print value of rUL"
}
-re ".\[0-9\]* = \\(long unsigned int &\\) @$hex: 234.*$gdb_prompt $" {
- pass "print value of rUL"
+ pass "print value of rUL"
}
}
gdb_test "print rD" \
".\[0-9\]* = \\(double &\\) @$hex: -1.375e-123.*" \
"print value of rD"
-
"print value of rrUC"
gdb_test "print rrS" "$decimal = \\(short( int)? &&\\) @$hex: -14" \
- "print value of rrS"
+ "print value of rrS"
gdb_test "print rrUS" \
- "$decimal = \\(unsigned short( int)? &&\\) @$hex: 7" \
- "print value of rrUS"
+ "$decimal = \\(unsigned short( int)? &&\\) @$hex: 7" \
+ "print value of rrUS"
gdb_test "print rrI" "$decimal = \\(int &&\\) @$hex: 102" \
"print value of rrI"
gdb_test "print rrUI" \
"$decimal = \\(unsigned int &&\\) @$hex: 1002" \
- "print value of rrUI"
+ "print value of rrUI"
gdb_test "print rrL" \
"$decimal = \\(long( int)? &&\\) @$hex: -234" \
- "print value of rrL"
+ "print value of rrL"
gdb_test "print rrUL" \
"$decimal = \\((unsigned long|long unsigned int)? &&\\) @$hex: 234" \
y++; // marker1
{
- int x = 44;
- y++; // marker2
-
- {
- int x = 55;
- y++; // marker3
-
- {
- using namespace A;
- y++; // marker4
-
- {
- using A::x;
- y++; // marker5
- }
- }
- }
+ int x = 44;
+ y++; // marker2
+
+ {
+ int x = 55;
+ y++; // marker3
+
+ {
+ using namespace A;
+ y++; // marker4
+
+ {
+ using A::x;
+ y++; // marker5
+ }
+ }
+ }
}
return 0;
}
return 0; // end of main
}
-
gdb_test "p c->inta" "= 77"
gdb_test "p c2->inta" "= 77"
-
# Return to the top of the test function every time.
delete_breakpoints
if {![gdb_breakpoint test_function]} {
- fail "set test_function breakpoint for $func"
+ fail "set test_function breakpoint for $func"
} elseif {[gdb_test "continue" \
"Continuing.\r\n\r\nBreakpoint $DEC+,.*test_function.*" \
"continue to test_function for $func"] != 0} {
} else {
- gdb_breakpoint "$func"
- gdb_test "continue" \
- "Continuing.\r\n\r\nBreakpoint $DEC+,.*$result.*" \
- "continue to $func"
+ gdb_breakpoint "$func"
+ gdb_test "continue" \
+ "Continuing.\r\n\r\nBreakpoint $DEC+,.*$result.*" \
+ "continue to $func"
}
}
int main() {
A a;
if (a == A::INSTANCE) {
- return -1;
+ return -1;
}
return 0;
}
}
gdb_test "print a" \
- "static INSTANCE = <same as static member of an already seen type>}}.*" \
- "print static member"
+ "static INSTANCE = <same as static member of an already seen type>}}.*" \
+ "print static member"
}
gdb_test_multiple "ptype/r t5i" "ptype t5i" {
- -re "type = class T5<int> \\{${ws}public:${ws}static int X;${ws}int x;${ws}int val;\r\n${ws}T5\\(int\\);${ws}T5\\(T5<int> const ?&\\);${ws}~T5\\((void|)\\);${ws}static void \\* operator new\\(unsigned( int| long)?\\);${ws}static void operator delete\\(void ?\\*\\);${ws}int value\\((void|)\\);${ws}\\}\r\n$gdb_prompt $" {
+ -re "type = class T5<int> \\{${ws}public:${ws}static int X;${ws}int x;${ws}int val;\r\n${ws}T5\\(int\\);${ws}T5\\(T5<int> const ?&\\);${ws}~T5\\((void|)\\);${ws}static void \\* operator new\\(unsigned( int| long)?\\);${ws}static void operator delete\\(void ?\\*\\);${ws}int value\\((void|)\\);${ws}\\}\r\n$gdb_prompt $" {
xfail "ptype T5<int> -- with several fixes from 4.17 -- without size_t"
}
- -re "type = class T5<int> \\{${ws}public:${ws}static int X;${ws}int x;${ws}int val;\r\n${ws}T5 \\(int\\);${ws}T5 \\(const class T5<int> &\\);${ws}void ~T5 \\(\\);${ws}static void \\* new \\(unsigned int\\);${ws}static void delete \\(void ?\\*\\);${ws}int value \\((void|)\\);${ws}\\}\r\n$gdb_prompt $" {
+ -re "type = class T5<int> \\{${ws}public:${ws}static int X;${ws}int x;${ws}int val;\r\n${ws}T5 \\(int\\);${ws}T5 \\(const class T5<int> &\\);${ws}void ~T5 \\(\\);${ws}static void \\* new \\(unsigned int\\);${ws}static void delete \\(void ?\\*\\);${ws}int value \\((void|)\\);${ws}\\}\r\n$gdb_prompt $" {
xfail "ptype t5i<int> -- new with unsigned int -- without size_t"
}
- -re "type = class T5<int> \\{${ws}public:${ws}static int X;${ws}int x;${ws}int val;\r\n${ws}T5 \\(int\\);${ws}T5 \\(const class T5<int> &\\);${ws}void ~T5 \\(\\);${ws}static void \\* new \\(unsigned long\\);${ws}static void delete \\(void ?\\*\\);${ws}int value \\((void|)\\);${ws}\\}\r\n$gdb_prompt $" {
+ -re "type = class T5<int> \\{${ws}public:${ws}static int X;${ws}int x;${ws}int val;\r\n${ws}T5 \\(int\\);${ws}T5 \\(const class T5<int> &\\);${ws}void ~T5 \\(\\);${ws}static void \\* new \\(unsigned long\\);${ws}static void delete \\(void ?\\*\\);${ws}int value \\((void|)\\);${ws}\\}\r\n$gdb_prompt $" {
xfail "ptype t5i<int> -- new with unsigned long -- without size_t"
}
- -re "type = class T5<int> \{.*public:.*static int X;.*int x;.*int val;.*.*T5 \\(int\\);.*.*void ~T5 \\(\\).*.*.*int value \\((void|)\\);.*\}.*$gdb_prompt $" {
- xfail "ptype t5i -- without size_t"
- }
+ -re "type = class T5<int> \{.*public:.*static int X;.*int x;.*int val;.*.*T5 \\(int\\);.*.*void ~T5 \\(\\).*.*.*int value \\((void|)\\);.*\}.*$gdb_prompt $" {
+ xfail "ptype t5i -- without size_t"
+ }
-re "type = class T5<int> \{${ws}public:${ws}static int X;${ws}int x;${ws}int val;${ws}T5<int> & operator=\\(T5<int> const ?&\\);${ws}T5\\(int\\);${ws}T5\\((T5<int> const|const T5<int>) ?&\\);${ws}~T5\\((void|)\\);${ws}static void \\* operator new\\(unsigned( int| long)?\\);${ws}static void operator delete\\(void ?\\*\\);${ws}int value\\((void|)\\);${ws}\}\r\n$gdb_prompt $" {
xfail "ptype t5i -- without size_t"
}
"nonsense intended to insure that this test fails" \
"constructor breakpoint"
}
- -re ".*\n> $" {
+ -re ".*\n> $" {
gdb_test "0" \
"nonsense intended to insure that this test fails" \
"constructor breakpoint (bad menu choices)"
"value method breakpoint"
set bp_location [gdb_get_line_number \
- "set breakpoint on a line with no real code"]
+ "set breakpoint on a line with no real code"]
gdb_test_multiple "break ${testfile}.cc:${bp_location}" \
"breakpoint on a line with no real code" {
-re "Cannot invoke functions on this machine.*$gdb_prompt $" {
fail "print t5i.value()"
}
- -re "Cannot resolve .* to any overloaded instance.*$gdb_prompt $" {
+ -re "Cannot resolve .* to any overloaded instance.*$gdb_prompt $" {
setup_xfail hppa*-*-* CLLbs16899
- xfail "print t5i.value"
+ xfail "print t5i.value"
}
}
}
}
gdb_test "ptype C::x" \
- "type = int" \
- "ptype typedef base struct member"
+ "type = int" \
+ "ptype typedef base struct member"
# that the rest of the tests can run undisturbed.
gdb_test_multiple "frame" "re-selected 'main' frame after inferior call" {
-re "#0 marker1.*$gdb_prompt $" {
- setup_kfail "gdb/1155" s390-*-linux-gnu
- fail "re-selected 'main' frame after inferior call"
- gdb_test "finish" ".*main.*at .*userdef.cc:.*// marker1-returns-here.*" \
- "finish call to marker1"
+ setup_kfail "gdb/1155" s390-*-linux-gnu
+ fail "re-selected 'main' frame after inferior call"
+ gdb_test "finish" ".*main.*at .*userdef.cc:.*// marker1-returns-here.*" \
+ "finish call to marker1"
}
-re "#1 ($hex in )?main.*$gdb_prompt $" {
- pass "re-selected 'main' frame after inferior call"
+ pass "re-selected 'main' frame after inferior call"
}
}
proc make_scope_list { scopes } {
if { [llength $scopes] == 1 } {
- return [list "" "${scopes}::"]
+ return [list "" "${scopes}::"]
}
# Pop the first element, save the first scope.
# ... and a copy of the child's result with this scope.
foreach r $child_result {
- lappend result "${this_scope}::$r"
+ lappend result "${this_scope}::$r"
}
return $result
TEST(pBe->vvb(), 411);
TEST(pDe->vvb(), 411);
- TEST(pEe->vd(), 282);
- TEST(pEe->fvb(), 311);
+ TEST(pEe->vd(), 282);
+ TEST(pEe->fvb(), 311);
- TEST(pEe->D::vg(), 102);
+ TEST(pEe->D::vg(), 102);
printf("Did %d tests, of which %d failed.\n", all_count, failed_count);
}
struct B *b;
struct A *next;
};
-
struct C *c;
int wombat;
};
-
stop_debuginfod
# Spare debug files may confuse testsuite runs in the future.
remote_exec build "rm -f $debugfile"
-
all_fp_move_and_load_tests
all_fp_arithmetic_tests
all_fp_misc_tests
-
}
if { [prepare_for_testing "failed to prepare" ${testfile} \
- [list $srcfile $asm_file] {nodebug}] } {
+ [list $srcfile $asm_file] {nodebug}] } {
return -1
}
}
if { [prepare_for_testing "failed to prepare" ${testfile} \
- [list $srcfile $asm_file] {nodebug}] } {
+ [list $srcfile $asm_file] {nodebug}] } {
return -1
}
DW_AT_language @DW_LANG_Ada95
DW_AT_name $srcfile
DW_AT_comp_dir /tmp
- } {
+ } {
declare_labels b_l
b_l: DW_TAG_base_type {
DW_AT_name bool
}
- DW_TAG_subprogram {
+ DW_TAG_subprogram {
DW_AT_name pck__xtra__function.cold
MACRO_AT_range {first}
DW_AT_type :$b_l
}
- DW_TAG_subprogram {
+ DW_TAG_subprogram {
DW_AT_name pck__xtra__function
MACRO_AT_range {second}
DW_AT_type :$b_l
DW_AT_name $srcfile
DW_AT_comp_dir /tmp
- } {
+ } {
declare_labels b_l
b_l: DW_TAG_base_type {
DW_AT_name bool
}
# Here the name comes first and the linkage name second.
- DW_TAG_subprogram {
+ DW_TAG_subprogram {
DW_AT_name system__namefirst
DW_AT_linkage_name __gnat_namefirst
MACRO_AT_range {first}
DW_AT_type :$b_l
}
# Here the linkage name comes first and the name second.
- DW_TAG_subprogram {
+ DW_TAG_subprogram {
DW_AT_linkage_name __gnat_namesecond
DW_AT_name system__namesecond
MACRO_AT_range {second}
DW_TAG_compile_unit {
DW_AT_language @DW_LANG_Ada95
DW_AT_name $srcfile
- } {
+ } {
declare_labels integer array array_pointer bounds_pointer
- integer: DW_TAG_base_type {
+ integer: DW_TAG_base_type {
DW_AT_byte_size 8 DW_FORM_sdata
DW_AT_encoding @DW_ATE_signed
DW_AT_name integer
- }
+ }
array: DW_TAG_array_type {
DW_AT_name array_type
DW_AT_language @DW_LANG_Ada95
DW_AT_name fd.adb
DW_AT_comp_dir /tmp
- } {
+ } {
declare_labels array_elt_label integer_label array_label \
- typedef_label ref_type_label
- set ptr_size [get_sizeof "void *" 96]
- set int_size [get_sizeof "int" 4]
+ typedef_label ref_type_label
+ set ptr_size [get_sizeof "void *" 96]
+ set int_size [get_sizeof "int" 4]
- # A structure with no size attribute, to mimick structures
- # in Ada that have a dynamic size...
- array_elt_label: structure_type {
+ # A structure with no size attribute, to mimick structures
+ # in Ada that have a dynamic size...
+ array_elt_label: structure_type {
DW_AT_name fd__Tints_doubledC
DW_AT_artificial 1 DW_FORM_flag_present
- }
-
- # ... and a corresponding XVZ variable, supposed to be there
- # to provide the actual size. Except that, in this case,
- # the variable has no address, to simulate the fact that
- # it has been optimized out (which the compiler can do,
- # even if it at the expense of debuggability).
- DW_TAG_variable {
+ }
+
+ # ... and a corresponding XVZ variable, supposed to be there
+ # to provide the actual size. Except that, in this case,
+ # the variable has no address, to simulate the fact that
+ # it has been optimized out (which the compiler can do,
+ # even if it at the expense of debuggability).
+ DW_TAG_variable {
DW_AT_name fd__Tints_doubledC___XVZ
DW_AT_type :$integer_label
DW_AT_artificial 1 DW_FORM_flag_present
- }
+ }
- integer_label: DW_TAG_base_type {
+ integer_label: DW_TAG_base_type {
DW_AT_byte_size $int_size DW_FORM_sdata
DW_AT_encoding @DW_ATE_signed
DW_AT_name integer
- }
+ }
array_label: DW_TAG_array_type {
DW_AT_name fd__ints_doubled
}
}
- typedef_label: DW_TAG_typedef {
+ typedef_label: DW_TAG_typedef {
DW_AT_name fd__ints_doubled
DW_AT_type :$array_label
- }
+ }
- ref_type_label: DW_TAG_reference_type {
+ ref_type_label: DW_TAG_reference_type {
DW_AT_byte_size $ptr_size DW_FORM_sdata
DW_AT_type :$typedef_label
- }
+ }
- DW_TAG_variable {
+ DW_TAG_variable {
DW_AT_name fd__global
DW_AT_type :$ref_type_label
DW_AT_location {
DW_OP_addr [gdb_target_symbol fd__global]
} SPECIAL_expr
DW_AT_external 1 flag
- }
+ }
}
}
gdb_test_no_output "set language ada"
gdb_test "print fd.global" \
- " = <error reading variable: unable to read value of fd__Tints_doubledC___XVZ \\(value has been optimized out\\)>"
+ " = <error reading variable: unable to read value of fd__Tints_doubledC___XVZ \\(value has been optimized out\\)>"
set asm_file [standard_output_file $srcfile2]
Dwarf::assemble $asm_file {
cu {} {
- DW_TAG_compile_unit {
+ DW_TAG_compile_unit {
DW_AT_language @DW_LANG_Ada95
DW_AT_name foo.adb
DW_AT_comp_dir /tmp
- } {
+ } {
declare_labels integer_label array_elt_label array_label \
- big_array_label struct_label
+ big_array_label struct_label
- integer_label: DW_TAG_base_type {
+ integer_label: DW_TAG_base_type {
DW_AT_byte_size 4 DW_FORM_sdata
DW_AT_encoding @DW_ATE_signed
DW_AT_name integer
- }
+ }
- array_elt_label: DW_TAG_subrange_type {
+ array_elt_label: DW_TAG_subrange_type {
DW_AT_lower_bound 0xe0 DW_FORM_data1
DW_AT_upper_bound 0x1f DW_FORM_data1
DW_AT_name pck__item
DW_AT_type :$integer_label
- }
+ }
- DW_TAG_typedef {
+ DW_TAG_typedef {
DW_AT_name pck__table
DW_AT_type :$array_label
- }
+ }
array_label: DW_TAG_array_type {
DW_AT_name pck__table
}
}
- DW_TAG_typedef {
+ DW_TAG_typedef {
DW_AT_name pck__big_table
DW_AT_type :$big_array_label
- }
+ }
big_array_label: DW_TAG_array_type {
DW_AT_name pck__big_table
gdb_test_no_output "set language ada"
gdb_test "ptype pck.table" \
- "type = array \\(0 \\.\\. 4\\) of pck\\.item <packed: 6-bit elements>"
+ "type = array \\(0 \\.\\. 4\\) of pck\\.item <packed: 6-bit elements>"
gdb_test "ptype pck.big_table" \
- "type = array \\(0 \\.\\. 4\\) of pck\\.item <packed: 8-bit elements>"
+ "type = array \\(0 \\.\\. 4\\) of pck\\.item <packed: 8-bit elements>"
gdb_test "print the_struct" \
"\\(intfield => 1, arrayfield => \\(0 => <optimized out>\\)\\)"
gdb_test_no_output "set language ada"
gdb_test "ptype pck.table" \
- "type = array \\(enum_000 \\.\\. enum_128\\) of boolean"
+ "type = array \\(enum_000 \\.\\. enum_128\\) of boolean"
"Not confirmed" \
"return 35" \
[multi_line \
- "Function 'foo' does not follow the target calling convention\\." \
- "If you continue, setting the return value will probably lead to unpredictable behaviors\\." \
- "Make foo return now\\? \\(y or n\\) $"] \
+ "Function 'foo' does not follow the target calling convention\\." \
+ "If you continue, setting the return value will probably lead to unpredictable behaviors\\." \
+ "Make foo return now\\? \\(y or n\\) $"] \
"n"
gdb_test "finish" [multi_line \
# foo.three
gdb_test "print foo.three" \
- " = \\(1, 2, 3\\)"
+ " = \\(1, 2, 3\\)"
gdb_test "ptype foo.three" \
- "type = array \\(<>\\) of integer"
+ "type = array \\(<>\\) of integer"
gdb_test "print foo.three(1)" \
- " = 1"
+ " = 1"
gdb_test "print foo.three(2)" \
- " = 2"
+ " = 2"
gdb_test "print foo.three(3)" \
- " = 3"
+ " = 3"
gdb_test "print foo.three'first" \
- " = 1"
+ " = 1"
gdb_test "print foo.three'last" \
- " = 3"
+ " = 3"
gdb_test "print foo.three'length" \
- " = 3"
+ " = 3"
# foo.three_tdef
gdb_test "print foo.three_tdef.all" \
- " = \\(1, 2, 3\\)"
+ " = \\(1, 2, 3\\)"
gdb_test "ptype foo.three_tdef" \
- "type = access array \\(<>\\) of integer"
+ "type = access array \\(<>\\) of integer"
gdb_test "print foo.three_tdef(1)" \
- " = 1"
+ " = 1"
gdb_test "print foo.three_tdef(2)" \
- " = 2"
+ " = 2"
gdb_test "print foo.three_tdef(3)" \
- " = 3"
+ " = 3"
gdb_test "print foo.three_tdef'first" \
- " = 1"
+ " = 1"
gdb_test "print foo.three_tdef'last" \
- " = 3"
+ " = 3"
gdb_test "print foo.three_tdef'length" \
- " = 3"
+ " = 3"
gdb_test "print foo.five" \
- " = \\(2 => 5, 8, 13, 21, 34\\)"
+ " = \\(2 => 5, 8, 13, 21, 34\\)"
gdb_test "ptype foo.five" \
- "type = array \\(<>\\) of integer"
+ "type = array \\(<>\\) of integer"
gdb_test "ptype foo.array_type" \
- "type = array \\(<>\\) of integer"
+ "type = array \\(<>\\) of integer"
# foo.five
gdb_test "print foo.five(2)" \
- " = 5"
+ " = 5"
gdb_test "print foo.five(3)" \
- " = 8"
+ " = 8"
gdb_test "print foo.five(4)" \
- " = 13"
+ " = 13"
gdb_test "print foo.five(5)" \
- " = 21"
+ " = 21"
gdb_test "print foo.five(6)" \
- " = 34"
+ " = 34"
gdb_test "print foo.five'first" \
- " = 2"
+ " = 2"
gdb_test "print foo.five'last" \
- " = 6"
+ " = 6"
gdb_test "print foo.five'length" \
- " = 5"
+ " = 5"
# foo.five_tdef
gdb_test "print foo.five_tdef.all" \
- " = \\(2 => 5, 8, 13, 21, 34\\)"
+ " = \\(2 => 5, 8, 13, 21, 34\\)"
gdb_test "ptype foo.five_tdef" \
- "type = access array \\(<>\\) of integer"
+ "type = access array \\(<>\\) of integer"
gdb_test "print foo.five_tdef(2)" \
- " = 5"
+ " = 5"
gdb_test "print foo.five_tdef(3)" \
- " = 8"
+ " = 8"
gdb_test "print foo.five_tdef(4)" \
- " = 13"
+ " = 13"
gdb_test "print foo.five_tdef(5)" \
- " = 21"
+ " = 21"
gdb_test "print foo.five_tdef(6)" \
- " = 34"
+ " = 34"
gdb_test "print foo.five_tdef'first" \
- " = 2"
+ " = 2"
gdb_test "print foo.five_tdef'last" \
- " = 6"
+ " = 6"
gdb_test "print foo.five_tdef'length" \
- " = 5"
+ " = 5"
.byte 1 /* Minimum insn length */
.byte 1 /* default_is_stmt */
.byte 1 /* line_base */
- .byte 1 /* line_range */
+ .byte 1 /* line_range */
.byte 0x10 /* opcode_base */
/* Standard lengths */
.byte 1 /* Minimum insn length */
.byte 1 /* default_is_stmt */
.byte 1 /* line_base */
- .byte 1 /* line_range */
+ .byte 1 /* line_range */
.byte 0x10 /* opcode_base */
/* Standard lengths */
.byte 1 /* Minimum insn length */
.byte 1 /* default_is_stmt */
.byte 1 /* line_base */
- .byte 1 /* line_range */
+ .byte 1 /* line_range */
.byte 4 /* opcode_base */
/* Standard lengths */
.byte 1 /* Minimum insn length */
.byte 1 /* default_is_stmt */
.byte 1 /* line_base */
- .byte 1 /* line_range */
+ .byte 1 /* line_range */
.byte 4 /* opcode_base */
/* Standard lengths */
.byte 1 /* Minimum insn length */
.byte 1 /* default_is_stmt */
.byte 1 /* line_base */
- .byte 1 /* line_range */
+ .byte 1 /* line_range */
.byte 0x10 /* opcode_base */
/* Standard lengths */
.byte 1 /* Minimum insn length */
.byte 1 /* default_is_stmt */
.byte 1 /* line_base */
- .byte 1 /* line_range */
+ .byte 1 /* line_range */
.byte 0x10 /* opcode_base */
/* Standard lengths */
gdb_test_no_output "set lang ada"
gdb_test "print pck.fp1_var" \
- " = 0.25"
+ " = 0.25"
gdb_test "print /x pck.fp1_var" \
- " = 0x0"
+ " = 0x0"
gdb_test "print pck.fp2_var" \
- " = -0.01"
+ " = -0.01"
gdb_test "print /x pck.fp2_var" \
- " = 0x0"
+ " = 0x0"
gdb_test "print pck.fp3_var" \
- " = 0.1"
+ " = 0.1"
gdb_test "print /x pck.fp3_var" \
- " = 0x0"
+ " = 0x0"
gdb_test "print pck.fp1_range_var" \
- " = 1"
+ " = 1"
gdb_test "print /x pck.fp1_range_var" \
- " = 0x1"
+ " = 0x1"
gdb_test "print pck.fp1_var + 0.25" \
- " = 0.5"
+ " = 0.5"
gdb_test "print pck.fp2_var - pck.fp2_var" \
- " = 0"
+ " = 0"
gdb_test "print pck.fp3_var * 1" \
- " = 0.1"
+ " = 0.1"
gdb_test "print pck.fp3_var / pck.fp3_var" \
- " = 1"
+ " = 1"
gdb_test "print pck.fp3_var / 0" \
- "Division by zero"
+ "Division by zero"
gdb_test "print pck.fp1_range_var - 0.5" \
- " = 0.5"
+ " = 0.5"
gdb_test "print -pck.fp1_var" \
- " = -0.25"
+ " = -0.25"
gdb_test "print pck.fp1_var = pck.fp1_var" \
- " = true"
+ " = true"
gdb_test "print pck.fp1_var = pck.fp1_var2" \
- " = false"
+ " = false"
gdb_test "print pck.fp1_var /= pck.fp1_var" \
- " = false"
+ " = false"
gdb_test "print pck.fp1_var /= pck.fp1_var2" \
- " = true"
+ " = true"
gdb_test "print pck.fp1_var < pck.fp1_var" \
- " = false"
+ " = false"
gdb_test "print pck.fp1_var < pck.fp1_var2" \
- " = true"
+ " = true"
gdb_test "print pck.fp1_var <= pck.fp1_var2" \
- " = true"
+ " = true"
gdb_test "print pck.fp1_var <= pck.fp1_var" \
- " = true"
+ " = true"
gdb_test "print pck.fp1_var > pck.fp1_var2" \
- " = false"
+ " = false"
gdb_test "print pck.fp1_var2 > pck.fp1_var" \
- " = true"
+ " = true"
gdb_test "print pck.fp1_var >= pck.fp1_var" \
- " = true"
+ " = true"
gdb_test "print pck.fp1_var >= pck.fp1_var2" \
- " = false"
+ " = false"
# Same as above, but with litterals...
gdb_test "print pck.fp1_var = 0.25" \
- " = true"
+ " = true"
gdb_test "print pck.fp1_var = 0.5" \
- " = false"
+ " = false"
gdb_test "print pck.fp1_var = 1" \
- " = false"
+ " = false"
gdb_test "print pck.fp1_var /= 0.25" \
- " = false"
+ " = false"
gdb_test "print pck.fp1_var /= 0.5" \
- " = true"
+ " = true"
gdb_test "print pck.fp1_var /= 1" \
- " = true"
+ " = true"
gdb_test "print pck.fp1_var < 0.25" \
- " = false"
+ " = false"
gdb_test "print pck.fp1_var < 0.5" \
- " = true"
+ " = true"
gdb_test "print pck.fp1_var < 1" \
- " = true"
+ " = true"
gdb_test "print pck.fp1_var <= 0.25" \
- " = true"
+ " = true"
gdb_test "print pck.fp1_var <= 0.5" \
- " = true"
+ " = true"
gdb_test "print pck.fp1_var <= 1" \
- " = true"
+ " = true"
gdb_test "print pck.fp1_var > 0.25" \
- " = false"
+ " = false"
gdb_test "print pck.fp1_var > 0.5" \
- " = false"
+ " = false"
gdb_test "print pck.fp1_var > 1" \
- " = false"
+ " = false"
gdb_test "print pck.fp1_var >= 0.25" \
- " = true"
+ " = true"
gdb_test "print pck.fp1_var >= 0.5" \
- " = false"
+ " = false"
gdb_test "print pck.fp1_var >= 1" \
- " = false"
+ " = false"
# Set the language to LANG and do a ptype test on pck__fp1_var,
proc do_ptype_test {lang fp1_re fp2_re fp3_re fp1_range_re} {
with_test_prefix "lang=$lang" {
- gdb_test_no_output "set language $lang" \
- "set language to $lang for ptype test"
+ gdb_test_no_output "set language $lang" \
+ "set language to $lang for ptype test"
- gdb_test "ptype pck__fp1_var" $fp1_re
+ gdb_test "ptype pck__fp1_var" $fp1_re
- gdb_test "ptype pck__fp2_var" $fp2_re
+ gdb_test "ptype pck__fp2_var" $fp2_re
- gdb_test "ptype pck__fp3_var" $fp3_re
+ gdb_test "ptype pck__fp3_var" $fp3_re
- gdb_test "ptype pck__fp1_range_var" $fp1_range_re
+ gdb_test "ptype pck__fp1_range_var" $fp1_range_re
}
}
do_ptype_test "ada" \
- " = <1-byte fixed point \\(small = 1/16\\)>" \
- " = <1-byte fixed point \\(small = 1/100\\)>" \
- " = <1-byte fixed point \\(small = 1/30\\)>" \
- " = <1-byte fixed point \\(small = 1/16\\)>"
+ " = <1-byte fixed point \\(small = 1/16\\)>" \
+ " = <1-byte fixed point \\(small = 1/100\\)>" \
+ " = <1-byte fixed point \\(small = 1/30\\)>" \
+ " = <1-byte fixed point \\(small = 1/16\\)>"
foreach lang [list "c" "d" "go" "objective-c" "opencl" ] {
do_ptype_test $lang \
- " = 1-byte fixed point \\(small = 1/16\\)" \
- " = 1-byte fixed point \\(small = 1/100\\)" \
- " = 1-byte fixed point \\(small = 1/30\\)" \
- " = <range type>"
+ " = 1-byte fixed point \\(small = 1/16\\)" \
+ " = 1-byte fixed point \\(small = 1/100\\)" \
+ " = 1-byte fixed point \\(small = 1/30\\)" \
+ " = <range type>"
}
do_ptype_test "fortran" \
- " = pck__fp1_type" \
- " = pck__fp2_type" \
- " = pck__fp3_type" \
- " = <range type>"
+ " = pck__fp1_type" \
+ " = pck__fp2_type" \
+ " = pck__fp3_type" \
+ " = <range type>"
do_ptype_test "modula-2" \
- " = pck__fp1_type" \
- " = pck__fp2_type" \
- " = pck__fp3_type" \
- " = \\\[1-byte fixed point \\(small = 1/16\\)\\.\\.1-byte fixed point \\(small = 1/16\\)\\\]"
+ " = pck__fp1_type" \
+ " = pck__fp2_type" \
+ " = pck__fp3_type" \
+ " = \\\[1-byte fixed point \\(small = 1/16\\)\\.\\.1-byte fixed point \\(small = 1/16\\)\\\]"
do_ptype_test "pascal" \
- " = pck__fp1_type" \
- " = pck__fp2_type" \
- " = pck__fp3_type" \
- " = 1-byte fixed point \\(small = 1/16\\)\\.\\.1-byte fixed point \\(small = 1/16\\)"
-
+ " = pck__fp1_type" \
+ " = pck__fp2_type" \
+ " = pck__fp3_type" \
+ " = 1-byte fixed point \\(small = 1/16\\)\\.\\.1-byte fixed point \\(small = 1/16\\)"
.byte 1 /* Minimum insn length */
.byte 1 /* default_is_stmt */
.byte 1 /* line_base */
- .byte 1 /* line_range */
+ .byte 1 /* line_range */
.byte 0x10 /* opcode_base */
/* Standard lengths */
.byte 1 /* Minimum insn length */
.byte 1 /* default_is_stmt */
.byte 1 /* line_base */
- .byte 1 /* line_range */
+ .byte 1 /* line_range */
.byte 0x10 /* opcode_base */
/* Standard lengths */
.byte 1 /* Minimum insn length */
.byte 1 /* default_is_stmt */
.byte 1 /* line_base */
- .byte 1 /* line_range */
+ .byte 1 /* line_range */
.byte 0x10 /* opcode_base */
/* Standard lengths */
.byte 1 /* Minimum insn length */
.byte 1 /* default_is_stmt */
.byte 1 /* line_base */
- .byte 1 /* line_range */
+ .byte 1 /* line_range */
.byte 0x10 /* opcode_base */
/* Standard lengths */
set host_binfile_inner [gdb_remote_download host $binfile_inner]
gdb_test "add-symbol-file $host_binfile_inner outer_inner" \
- {Reading symbols from .*\.\.\.} "add-symbol-file" \
+ {Reading symbols from .*\.\.\.} "add-symbol-file" \
"\r\n\t\\.text_addr = 0x\[0-9a-f\]+\r\n\\(y or n\\) \$" "y"
# Expand symtab for ${binfile_outer}.
.quad .Ltext5b /* start */
.quad .Ltext7-.Ltext5b /* length */
/* Instructions */
- .byte 0x4
+ .byte 0x4
.long .Ltext6-.Ltext5b
.byte 0xe
.uleb128 0x10
.quad .Ltext8 /* start */
.quad .Ltext10-.Ltext8 /* length */
/* Instructions */
- .byte 0x4
+ .byte 0x4
.long .Ltext9-.Ltext8
.byte 0xe
.uleb128 0x10
.quad .Ltext11 /* start */
.quad .Ltext13-.Ltext11 /* length */
/* Instructions */
- .byte 0x4
+ .byte 0x4
.long .Ltext12-.Ltext11
.byte 0xe
.uleb128 0x10
.quad .Ltext14 /* start */
.quad .Ltext16-.Ltext14 /* length */
/* Instructions */
- .byte 0x4
+ .byte 0x4
.long .Ltext15-.Ltext14
.byte 0xe
.uleb128 0x10
.quad .Ltext1 /* start */
.quad .Ltext3-.Ltext1 /* length */
/* Instructions */
- .byte 0x4
+ .byte 0x4
.long .Ltext2-.Ltext1
.byte 0xe
.uleb128 0x10
.byte 1 /* Minimum insn length */
.byte 1 /* default_is_stmt */
.byte 1 /* line_base */
- .byte 1 /* line_range */
+ .byte 1 /* line_range */
.byte 0x10 /* opcode_base */
/* Standard lengths */
asm ("main_label: .globl main_label");
frame2 ();
}
-
asm ("main_label2: .globl main_label2");
return 0; /* main return */
} /* main end */
-
asm ("main_label2: .globl main_label2");
return 0; /* main return */
} /* main end */
-
DW_LNE_end_sequence
DW_LNE_set_address $foo_cold_start
- line [gdb_get_line_number "foo_cold prologue"]
+ line [gdb_get_line_number "foo_cold prologue"]
DW_LNS_copy
DW_LNE_set_address foo_cold_label
line [gdb_get_line_number "foo_cold baz call"]
set test "x/2i foo_cold"
gdb_test_multiple $test $test {
-re " (?:$hex) <foo_cold>.*?\n (?:$hex) <foo\[+-\](\[0-9\]+)>.*${gdb_prompt}" {
- set foo_cold_offset $expect_out(1,string)
+ set foo_cold_offset $expect_out(1,string)
pass $test
}
}
standard_testfile .S -func.c -main.c
lassign [function_range func_nofb \
- "${srcdir}/${subdir}/${srcfile2} ${srcdir}/${subdir}/${srcfile3}"] \
+ "${srcdir}/${subdir}/${srcfile2} ${srcdir}/${subdir}/${srcfile3}"] \
func_nofb_start func_nofb_len
lassign [function_range func_loopfb \
- "${srcdir}/${subdir}/${srcfile2} ${srcdir}/${subdir}/${srcfile3}"] \
+ "${srcdir}/${subdir}/${srcfile2} ${srcdir}/${subdir}/${srcfile3}"] \
func_loopfb_start func_loopfb_len
set flags {}
gdb_test "step" [multi_line \
"main \\(\\) at \[^\r\n\]*$srcfile:36" \
"36\t\[^\r\n\]*"]
-
# behavior).
set pattern1 \
[multi_line \
- $line1 \
- $dwarf_error \
- "\\(No debugging symbols \[^\r\n\]+\\)"]
+ $line1 \
+ $dwarf_error \
+ "\\(No debugging symbols \[^\r\n\]+\\)"]
# This pattern is hit when GDB does use -readnow (e.g. running with
# --target_board=readnow).
set pattern2 \
[multi_line \
- $line1 \
- "Expanding full symbols from \[^\r\n\]+" \
- $dwarf_error]
+ $line1 \
+ "Expanding full symbols from \[^\r\n\]+" \
+ $dwarf_error]
# This pattern is hit when gcc adds an index (e.g. running with
# --target_board=cc-with-gdb-index).
set pattern3 \
[multi_line \
- $line1 \
- $dwarf_error]
+ $line1 \
+ $dwarf_error]
# Load the executable, we expect an error from the DWARF parser.
gdb_test "file $binfile_no_debug_str" "($pattern1|$pattern2|$pattern3)" \
if (val < root->id)
{
if (root->left)
- tree_insert (root->left, val);
+ tree_insert (root->left, val);
else
- root->left = make_node(val);
+ root->left = make_node(val);
}
else if (val > root->id)
{
if (root->right)
- tree_insert (root->right, val);
+ tree_insert (root->right, val);
else
- root->right = make_node(val);
+ root->right = make_node(val);
}
}
node *curr = todo.back();
todo.pop_back(); /* break-here */
if (curr->visited)
- std::cout << curr->id << " ";
+ std::cout << curr->id << " ";
else
- {
- curr->visited = true;
- if (curr->right)
- todo.push_back (curr->right);
- todo.push_back (curr);
- if (curr->left)
- todo.push_back (curr->left);
- }
+ {
+ curr->visited = true;
+ if (curr->right)
+ todo.push_back (curr->right);
+ todo.push_back (curr);
+ if (curr->left)
+ todo.push_back (curr->left);
+ }
}
}
# we let that be the test of whether the target supports it.
if { [prepare_for_testing "failed to prepare" "${testfile}" \
- $srcfile {debug c++ dwarf5 additional_flags=-O0}] } {
+ $srcfile {debug c++ dwarf5 additional_flags=-O0}] } {
return -1
}
global pair pair2 negative
cu { addr_size 4 } {
- compile_unit {} {
+ compile_unit {} {
declare_labels int_label sint_label
int_label: DW_TAG_base_type {
# Creating a CU with 4-byte addresses lets this test link on both
# 32- and 64-bit machines.
cu { addr_size 4 } {
- compile_unit {} {
+ compile_unit {} {
declare_labels byte_label size_type_label array_label
declare_labels var_label ptr_label
# also check for a sign-extension bug in the
# DW_OP_GNU_implicit_pointer code.
cu { addr_size 2 } {
- compile_unit {} {
+ compile_unit {} {
declare_labels struct_label short_type_label
declare_labels char_type_label ptr_label
declare_labels var_label
DW_AT_type :${int_label}
DW_AT_external 1 DW_FORM_flag
} {
- DW_TAG_variable {
+ DW_TAG_variable {
DW_AT_name "ref"
DW_AT_type :${ref_label}
DW_AT_location {
DW_AT_abstract_origin %$doit_self_label
}
}
- DW_TAG_variable {
+ DW_TAG_variable {
DW_AT_abstract_origin %$foo_label
DW_AT_location 4 data1
}
# symbols will be present for this compilation, because we want to print some
# type information.
if {[gdb_compile_shlib $libsrc $lib_so \
- {debug}] != ""} {
+ {debug}] != ""} {
untested "failed to compile shared library"
return
}
DW_AT_language @DW_LANG_C_plus_plus
DW_AT_name ${::srcfile}
DW_AT_stmt_list $L DW_FORM_sec_offset
- } {
+ } {
declare_labels int_label class_A_label class_B_label \
- B_ptr_label
+ B_ptr_label
int_label: DW_TAG_base_type {
DW_AT_byte_size ${::long_size} DW_FORM_udata
# Any debugging information that we need will be provided by the DWARF info
# created above.
if {[gdb_compile_shlib [list $libsrc $asm_file] $lib_so \
- {nodebug}] != ""} {
+ {nodebug}] != ""} {
untested "failed to compile shared library"
return
}
.byte 1 /* Minimum insn length */
.byte 1 /* default_is_stmt */
.byte 1 /* line_base */
- .byte 1 /* line_range */
+ .byte 1 /* line_range */
.byte 0x10 /* opcode_base */
/* Standard lengths */
set asm_file [standard_output_file $srcfile2]
Dwarf::assemble $asm_file {
cu {} {
- compile_unit {} {
+ compile_unit {} {
declare_labels typedef_label
# This signature is intentionally wrong.
# multidictionaries, it will either crash, assert, or throw an
# internal_error.
gdb_test "p 1" "= 1" "GDB is alive"
-
set asm_file [standard_output_file $srcfile2]
Dwarf::assemble $asm_file {
cu {} {
- compile_unit {
+ compile_unit {
DW_AT_low_pc 0x104320 DW_FORM_addr
DW_AT_high_pc 0x1045ed DW_FORM_addr
} {
v += foo (v);
return v + 5 + s.a;
}
-
gdb_test "p s.c" " = <optimized out>" "print s.c"
gdb_test "p s.d" " = <optimized out>" "print s.d"
gdb_test "p s.d + 1" "value has been optimized out" "print s.d + 1"
-
DW_AT_language @DW_LANG_C
DW_AT_name symtab-producer-dw.c
DW_AT_comp_dir /tmp
- } {
+ } {
declare_labels integer_label
integer_label: DW_TAG_base_type {
DW_AT_language @DW_LANG_C
DW_AT_name symtab-producer2-dw.c
DW_AT_comp_dir /tmp
- } {
+ } {
declare_labels integer_label
integer_label: DW_TAG_base_type {
cu { label cu_start } {
DW_TAG_compile_unit {
DW_AT_language @DW_LANG_C_plus_plus
- } {
+ } {
declare_labels templated_subprogram int
int: DW_TAG_base_type {
# referring to integral/pointer typed variables)."
gdb_test "print structval" \
- "Type of DW_OP_GNU_variable_value DIE must be an integer or pointer\\."
+ "Type of DW_OP_GNU_variable_value DIE must be an integer or pointer\\."
gdb_test "print untypedval" \
- "Type of DW_OP_GNU_variable_value DIE must be an integer or pointer\\."
+ "Type of DW_OP_GNU_variable_value DIE must be an integer or pointer\\."
if { [setup_exec 1] == -1 } {
return -1
gdb_test "print bad_die_val1" \
{DWARF Error: could not find unit containing offset 0xabcdef11 \[in module .*/varval\]}
gdb_test "print bad_die_val2" \
- "Bad DW_OP_GNU_variable_value DIE\\."
+ "Bad DW_OP_GNU_variable_value DIE\\."
print *, 'bounds of foo - ', lb, ':', ub
stop
end
-
gdb_test "print a(1)" ".*1 = 1.*" "print the first element of array a"
gdb_test "print a(2)" ".*2 = 2.*" "print the second element of array a"
-
subroutine sub(a,n)
dimension a(n)
- do 100 i = 1, n
+ do 100 i = 1, n
a(i) = i
100 continue
return
call aRec%print_area
end program rectangle_Test
-
set test "print this%b"
gdb_test_multiple $test $test {
-re " = 'abcdefg'\r\n$gdb_prompt $" {
- pass $test
+ pass $test
}
-re $result_line_2 {
- setup_xfail "*-*-*"
- fail $test
+ setup_xfail "*-*-*"
+ fail $test
}
}
set test "print this"
gdb_test_multiple $test $test {
-re $result_line {
- pass $test
+ pass $test
}
-re $result_line_2 {
- setup_xfail "*-*-*"
- fail $test
+ setup_xfail "*-*-*"
+ fail $test
}
}
} else {
warning "$test_name tests suppressed." 0
}
-
-re -wrap "$re_kfail.*" {
kfail symtab/27388 $gdb_test_name
}
- -re "^$cmd_regexp\r\n$gdb_prompt $" {
+ -re "^$cmd_regexp\r\n$gdb_prompt $" {
pass $gdb_test_name
}
}
"${real4} mod1::mod1_var_1;"
GDBInfoModuleSymbols::check_no_entry "${srcfile}" ".*"
GDBInfoModuleSymbols::check_no_entry "${srcfile2}" ".*"
-
&& [gcc_major_version {gfortran-*} f90] >= 4.9}]
if { $supported } {
gdb_test "ptype nml" \
- "type = Type nml\r\n *$int :: a\r\n *$int :: b\r\n *End Type nml"
+ "type = Type nml\r\n *$int :: a\r\n *$int :: b\r\n *End Type nml"
gdb_test "print nml" \
- "\\$\[0-9\]+ = \\( a = 10, b = 20 \\)"
+ "\\$\[0-9\]+ = \\( a = 10, b = 20 \\)"
} else {
gdb_test "ptype nml" \
- "No symbol \"nml\" in current context\\."
+ "No symbol \"nml\" in current context\\."
gdb_test "print nml" \
- "No symbol \"nml\" in current context\\."
+ "No symbol \"nml\" in current context\\."
}
-! Copyright 2016-2025 Free Software Foundation, Inc.\r
-!\r
-! This program is free software; you can redistribute it and/or modify\r
-! it under the terms of the GNU General Public License as published by\r
-! the Free Software Foundation; either version 3 of the License, or\r
-! (at your option) any later version.\r
-!\r
-! This program is distributed in the hope that it will be useful,\r
-! but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-! GNU General Public License for more details.\r
-!\r
-! You should have received a copy of the GNU General Public License\r
-! along with this program. If not, see <http://www.gnu.org/licenses/>.\r
-\r
-module mod1\r
- integer :: var_i = 1\r
- integer :: var_const\r
- parameter (var_const = 20)\r
-\r
-CONTAINS\r
-\r
- SUBROUTINE sub_nested_outer\r
- integer :: local_int\r
- character (len=20) :: name\r
-\r
- name = 'sub_nested_outer_mod1'\r
- local_int = 11\r
-\r
- END SUBROUTINE sub_nested_outer\r
-end module mod1\r
-\r
-! Public sub_nested_outer\r
-SUBROUTINE sub_nested_outer\r
- integer :: local_int\r
- character (len=16) :: name\r
-\r
- name = 'sub_nested_outer external'\r
- local_int = 11\r
-END SUBROUTINE sub_nested_outer\r
-\r
-! Needed indirection to call public sub_nested_outer from main\r
-SUBROUTINE sub_nested_outer_ind\r
- character (len=20) :: name\r
-\r
- name = 'sub_nested_outer_ind'\r
- CALL sub_nested_outer\r
-END SUBROUTINE sub_nested_outer_ind\r
-\r
-! public routine with internal subroutine\r
-SUBROUTINE sub_with_sub_nested_outer()\r
- integer :: local_int\r
- character (len=16) :: name\r
-\r
- name = 'subroutine_with_int_sub'\r
- local_int = 1\r
-\r
- CALL sub_nested_outer ! Should call the internal fct\r
-\r
-CONTAINS\r
-\r
- SUBROUTINE sub_nested_outer\r
- integer :: local_int\r
- local_int = 11\r
- END SUBROUTINE sub_nested_outer\r
-\r
-END SUBROUTINE sub_with_sub_nested_outer\r
-\r
-! Main\r
-program TestNestedFuncs\r
- USE mod1, sub_nested_outer_use_mod1 => sub_nested_outer\r
- IMPLICIT NONE\r
-\r
- TYPE :: t_State\r
- integer :: code\r
- END TYPE t_State\r
-\r
- TYPE (t_State) :: v_state\r
- integer index, local_int\r
-\r
- index = 13\r
- CALL sub_nested_outer ! Call internal sub_nested_outer\r
- CALL sub_nested_outer_ind ! Call external sub_nested_outer via sub_nested_outer_ind\r
- CALL sub_with_sub_nested_outer ! Call external routine with nested sub_nested_outer\r
- CALL sub_nested_outer_use_mod1 ! Call sub_nested_outer imported via module\r
- index = 11 ! BP_main\r
- v_state%code = 27\r
-\r
-CONTAINS\r
-\r
- SUBROUTINE sub_nested_outer\r
- integer local_int\r
- local_int = 19\r
- v_state%code = index + local_int ! BP_outer\r
- call sub_nested_inner\r
- local_int = 22 ! BP_outer_2\r
- RETURN\r
- END SUBROUTINE sub_nested_outer\r
-\r
- SUBROUTINE sub_nested_inner\r
- integer local_int\r
- local_int = 17\r
- v_state%code = index + local_int ! BP_inner\r
- RETURN\r
- END SUBROUTINE sub_nested_inner\r
-\r
-end program TestNestedFuncs\r
+! Copyright 2016-2025 Free Software Foundation, Inc.
+!
+! This program is free software; you can redistribute it and/or modify
+! it under the terms of the GNU General Public License as published by
+! the Free Software Foundation; either version 3 of the License, or
+! (at your option) any later version.
+!
+! This program is distributed in the hope that it will be useful,
+! but WITHOUT ANY WARRANTY; without even the implied warranty of
+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+! GNU General Public License for more details.
+!
+! You should have received a copy of the GNU General Public License
+! along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+module mod1
+ integer :: var_i = 1
+ integer :: var_const
+ parameter (var_const = 20)
+
+CONTAINS
+
+ SUBROUTINE sub_nested_outer
+ integer :: local_int
+ character (len=20) :: name
+
+ name = 'sub_nested_outer_mod1'
+ local_int = 11
+
+ END SUBROUTINE sub_nested_outer
+end module mod1
+
+! Public sub_nested_outer
+SUBROUTINE sub_nested_outer
+ integer :: local_int
+ character (len=16) :: name
+
+ name = 'sub_nested_outer external'
+ local_int = 11
+END SUBROUTINE sub_nested_outer
+
+! Needed indirection to call public sub_nested_outer from main
+SUBROUTINE sub_nested_outer_ind
+ character (len=20) :: name
+
+ name = 'sub_nested_outer_ind'
+ CALL sub_nested_outer
+END SUBROUTINE sub_nested_outer_ind
+
+! public routine with internal subroutine
+SUBROUTINE sub_with_sub_nested_outer()
+ integer :: local_int
+ character (len=16) :: name
+
+ name = 'subroutine_with_int_sub'
+ local_int = 1
+
+ CALL sub_nested_outer ! Should call the internal fct
+
+CONTAINS
+
+ SUBROUTINE sub_nested_outer
+ integer :: local_int
+ local_int = 11
+ END SUBROUTINE sub_nested_outer
+
+END SUBROUTINE sub_with_sub_nested_outer
+
+! Main
+program TestNestedFuncs
+ USE mod1, sub_nested_outer_use_mod1 => sub_nested_outer
+ IMPLICIT NONE
+
+ TYPE :: t_State
+ integer :: code
+ END TYPE t_State
+
+ TYPE (t_State) :: v_state
+ integer index, local_int
+
+ index = 13
+ CALL sub_nested_outer ! Call internal sub_nested_outer
+ CALL sub_nested_outer_ind ! Call external sub_nested_outer via sub_nested_outer_ind
+ CALL sub_with_sub_nested_outer ! Call external routine with nested sub_nested_outer
+ CALL sub_nested_outer_use_mod1 ! Call sub_nested_outer imported via module
+ index = 11 ! BP_main
+ v_state%code = 27
+
+CONTAINS
+
+ SUBROUTINE sub_nested_outer
+ integer local_int
+ local_int = 19
+ v_state%code = index + local_int ! BP_outer
+ call sub_nested_inner
+ local_int = 22 ! BP_outer_2
+ RETURN
+ END SUBROUTINE sub_nested_outer
+
+ SUBROUTINE sub_nested_inner
+ integer local_int
+ local_int = 17
+ v_state%code = index + local_int ! BP_inner
+ RETURN
+ END SUBROUTINE sub_nested_inner
+
+end program TestNestedFuncs
" $real :: angle" \
"End Type waypoint(, allocatable)?"]
set output_kfail_wp [multi_line "type = Type waypoint" \
- " Type point :: point" \
- " $real :: angle" \
- "End Type waypoint(, allocatable)?"]
+ " Type point :: point" \
+ " $real :: angle" \
+ "End Type waypoint(, allocatable)?"]
set test "ptype wp"
gdb_test_multiple "$test" "$test" {
gdb_continue_to_breakpoint "Before value assignment"
gdb_test "ptype twop" \
[multi_line "type = PTR TO -> \\( Type two" \
- " $int, allocatable :: ivla1\\(:\\)" \
- " $int, allocatable :: ivla2\\(:,:\\)" \
- "End Type two \\)"]
+ " $int, allocatable :: ivla1\\(:\\)" \
+ " $int, allocatable :: ivla2\\(:,:\\)" \
+ "End Type two \\)"]
gdb_breakpoint [gdb_get_line_number "After value assignment"]
gdb_continue_to_breakpoint "After value assignment"
set test "ptype intap"
gdb_test_multiple $test $test {
-re "type = $int \\(10,2\\)\r\n$gdb_prompt $" {
- pass $test
+ pass $test
}
-re "type = PTR TO -> \\( $int \\(10,2\\)\\)\r\n$gdb_prompt $" {
- pass $test
+ pass $test
}
}
gdb_test "ptype realp" "type = PTR TO -> \\( $real \\)"
# Check the indentation when using ptype on pointers in user-defined types.
gdb_test "ptype tinsta" \
[multi_line "type = Type tuserdef" \
- " $int :: i" \
- " PTR TO -> \\( $real :: ptr \\)" \
- "End Type tuserdef"]
+ " $int :: i" \
+ " PTR TO -> \\( $real :: ptr \\)" \
+ "End Type tuserdef"]
character *7 str
integer array(7)
-c Initialize character array "str" and integer array "array".
+c Initialize character array "str" and integer array "array".
str = 'abcdefg'
do i = 1, 7
array(i) = i
gdb_test "print onev%ivla(1, 2, 3)" " = 123"
gdb_test "print onev%ivla(3, 2, 1)" " = 321"
gdb_test "ptype onev" \
- [multi_line "type = Type one" \
- "\\s+$int, allocatable :: ivla\\\(11,22,33\\\)" \
- "End Type one" ]
+ [multi_line "type = Type one" \
+ "\\s+$int, allocatable :: ivla\\\(11,22,33\\\)" \
+ "End Type one" ]
# Check type with two VLA's inside
gdb_breakpoint [gdb_get_line_number "twov-filled"]
gdb_test "print twov%ivla1(1, 2, 3)" " = 123"
gdb_test "print twov%ivla1(3, 2, 1)" " = 321"
gdb_test "ptype twov" \
- [multi_line "type = Type two" \
- "\\s+$int, allocatable :: ivla1\\\(5,12,99\\\)" \
- "\\s+$int, allocatable :: ivla2\\\(9,12\\\)" \
- "End Type two" ]
+ [multi_line "type = Type two" \
+ "\\s+$int, allocatable :: ivla1\\\(5,12,99\\\)" \
+ "\\s+$int, allocatable :: ivla2\\\(9,12\\\)" \
+ "End Type two" ]
gdb_test "print twov" " = \\\( ivla1 = \\\(\\\(\\\(1, 1, 1, 1, 1\\\)\
\\\(1, 1, 321, 1, 1\\\)\
\\\(1, 1, 1, 1, 1\\\) .*"
gdb_test "print threev%ivla(14)" " = 24"
gdb_test "print threev%ivar" " = 3"
gdb_test "ptype threev" \
- [multi_line "type = Type three" \
- "\\s+$int :: ivar" \
- "\\s+$int, allocatable :: ivla\\\(20\\\)" \
- "End Type three" ]
+ [multi_line "type = Type three" \
+ "\\s+$int :: ivar" \
+ "\\s+$int, allocatable :: ivla\\\(20\\\)" \
+ "End Type three" ]
# Check type with attribute at end of type
gdb_breakpoint [gdb_get_line_number "fourv-filled"]
gdb_test "print fourv%ivla(12)" "no such vector element"
gdb_test "print fourv%ivar" " = 3"
gdb_test "ptype fourv" \
- [multi_line "type = Type four" \
- "\\s+$int, allocatable :: ivla\\\(10\\\)" \
- "\\s+$int :: ivar" \
- "End Type four" ]
+ [multi_line "type = Type four" \
+ "\\s+$int, allocatable :: ivla\\\(10\\\)" \
+ "\\s+$int :: ivar" \
+ "End Type four" ]
# Check nested types containing a VLA
gdb_breakpoint [gdb_get_line_number "fivev-filled"]
gdb_test "print fivev%tone%ivla(1, 2, 3)" " = 123"
gdb_test "print fivev%tone%ivla(3, 2, 1)" " = 321"
gdb_test "ptype fivev" \
- [multi_line "type = Type five" \
- "\\s+Type one :: tone" \
- "End Type five" ]
+ [multi_line "type = Type five" \
+ "\\s+Type one :: tone" \
+ "End Type five" ]
gdb_test "ptype fivev%tone" \
- [multi_line "type = Type one" \
- " $int, allocatable :: ivla\\(10,10,10\\)" \
- "End Type one" ]
+ [multi_line "type = Type one" \
+ " $int, allocatable :: ivla\\(10,10,10\\)" \
+ "End Type one" ]
# Check array of types containing a VLA
gdb_breakpoint [gdb_get_line_number "fivearr-filled"]
gdb_test "print fivearr(2)%tone%ivla(12, 14, 16)" " = 2"
gdb_test "print fivearr(2)%tone%ivla(6, 7, 8)" " = 678"
gdb_test "ptype fivearr(1)" \
- [multi_line "type = Type five" \
- "\\s+Type one :: tone" \
- "End Type five" ]
+ [multi_line "type = Type five" \
+ "\\s+Type one :: tone" \
+ "End Type five" ]
gdb_test "ptype fivearr(1)%tone" \
- [multi_line "type = Type one" \
- " $int, allocatable :: ivla\\(2,4,6\\)" \
- "End Type one" ]
+ [multi_line "type = Type one" \
+ " $int, allocatable :: ivla\\(2,4,6\\)" \
+ "End Type one" ]
gdb_test "ptype fivearr(2)" \
- [multi_line "type = Type five" \
- "\\s+Type one :: tone" \
- "End Type five" ]
+ [multi_line "type = Type five" \
+ "\\s+Type one :: tone" \
+ "End Type five" ]
gdb_test "ptype fivearr(2)%tone" \
- [multi_line "type = Type one" \
- " $int, allocatable :: ivla\\(12,14,16\\)" \
- "End Type one" ]
+ [multi_line "type = Type one" \
+ " $int, allocatable :: ivla\\(12,14,16\\)" \
+ "End Type one" ]
# Check allocation status of dynamic array and it's dynamic members
gdb_test "ptype fivedynarr" \
- [multi_line "type = Type five" \
- " Type one :: tone" \
- "End Type five, allocatable \\(:\\)" ]
+ [multi_line "type = Type five" \
+ " Type one :: tone" \
+ "End Type five, allocatable \\(:\\)" ]
gdb_test "next" ""
gdb_test "ptype fivedynarr(2)" \
- [multi_line "type = Type five" \
- "\\s+Type one :: tone" \
- "End Type five" ] \
- "ptype fivedynarr(2), tone is not allocated"
+ [multi_line "type = Type five" \
+ "\\s+Type one :: tone" \
+ "End Type five" ] \
+ "ptype fivedynarr(2), tone is not allocated"
gdb_test "ptype fivedynarr(2)%tone" \
- [multi_line "type = Type one" \
- " $int, allocatable :: ivla\\(:,:,:\\)" \
- "End Type one" ] \
- "ptype fivedynarr(2)%tone, not allocated"
+ [multi_line "type = Type one" \
+ " $int, allocatable :: ivla\\(:,:,:\\)" \
+ "End Type one" ] \
+ "ptype fivedynarr(2)%tone, not allocated"
# Check dynamic array of types containing a VLA
gdb_breakpoint [gdb_get_line_number "fivedynarr-filled"]
gdb_test "print fivedynarr(2)%tone%ivla(12, 14, 16)" " = 2"
gdb_test "print fivedynarr(2)%tone%ivla(6, 7, 8)" " = 678"
gdb_test "ptype fivedynarr(1)" \
- [multi_line "type = Type five" \
- "\\s+Type one :: tone" \
- "End Type five" ]
+ [multi_line "type = Type five" \
+ "\\s+Type one :: tone" \
+ "End Type five" ]
gdb_test "ptype fivedynarr(1)%tone" \
- [multi_line "type = Type one" \
- " $int, allocatable :: ivla\\(2,4,6\\)" \
- "End Type one" ]
+ [multi_line "type = Type one" \
+ " $int, allocatable :: ivla\\(2,4,6\\)" \
+ "End Type one" ]
gdb_test "ptype fivedynarr(2)" \
- [multi_line "type = Type five" \
- "\\s+Type one :: tone" \
- "End Type five" ]
+ [multi_line "type = Type five" \
+ "\\s+Type one :: tone" \
+ "End Type five" ]
gdb_test "ptype fivedynarr(2)%tone" \
- [multi_line "type = Type one" \
- " $int, allocatable :: ivla\\(12,14,16\\)" \
- "End Type one" ]
+ [multi_line "type = Type one" \
+ " $int, allocatable :: ivla\\(12,14,16\\)" \
+ "End Type one" ]
gdb_test "p sub_arr1(1, 1)" " = 30" "sub_arr1(1, 1) after finish"
gdb_test "p sub_arr2(1, 1, 1)" " = 30" "sub_arr2(1, 1, 1) after finish"
gdb_test "p sub_arr2(2, 1, 1)" " = 20" "sub_arr2(2, 1, 1) after finish"
-
load_lib "fortran.exp"
if { [prepare_for_testing "failed to prepare" ${testfile} \
- ${srcfile} {debug f90}] } {
+ ${srcfile} {debug f90}] } {
return -1
}
gdb_test "ptype t1" \
[multi_line "type = Type t1" \
- " $t1_i" \
- " $t1_r" \
- "End Type t1"]
+ " $t1_i" \
+ " $t1_r" \
+ "End Type t1"]
gdb_test "ptype t1v" \
[multi_line "type = Type t1" \
- " $t1_i" \
- " $t1_r" \
- "End Type t1"]
+ " $t1_i" \
+ " $t1_r" \
+ "End Type t1"]
gdb_test "ptype t2v" \
[multi_line "type = Type t2" \
- " $int :: t2_i" \
- " Type t1 :: t1_n" \
- "End Type t2"]
+ " $int :: t2_i" \
+ " Type t1 :: t1_n" \
+ "End Type t2"]
gdb_test "ptype t3v" \
[multi_line "type = Type t3" \
- " $int :: t3_i" \
- " Type t2 :: t2_n" \
- "End Type t3"]
+ " $int :: t3_i" \
+ " Type t2 :: t2_n" \
+ "End Type t3"]
gdb_test "ptype t3p" \
[multi_line "type = PTR TO -> \\( Type t3" \
- " $int :: t3_i" \
- " Type t2 :: t2_n" \
- "End Type t3 \\)"]
+ " $int :: t3_i" \
+ " Type t2 :: t2_n" \
+ "End Type t3 \\)"]
(hash-set! dict "ss" make-pp_ss-printer)
(hash-set! dict "const S &" make-pp_s-printer)
(hash-set! dict "SSS" make-pp_sss-printer)
-
+
(hash-set! dict "VirtualTest" make-pp_multiple_virtual-printer)
(hash-set! dict "Vbase1" make-pp_vbase1-printer)
(hash-set! dict "struct nullstr" make-pp_nullstr-printer)
(hash-set! dict "nullstr" make-pp_nullstr-printer)
-
+
;; Note that we purposely omit the typedef names here.
;; Printer lookup is based on canonical name.
;; However, we do need both tagged and untagged variants, to handle
"(define one (make-value 1))" "" \
"(define two (make-value 2))" "" \
"(define three (make-value 3))" "" \
- "(define vdict (make-hash-table 5))" "" \
+ "(define vdict (make-hash-table 5))" "" \
"(hash-set! vdict one \"one str\")" "" \
"(hash-set! vdict two \"two str\")" "" \
"(hash-set! vdict three \"three str\")" "" \
gdb_test "break $asm_file0:func" \
"Breakpoint 3 at 0x\[0-9a-fA-F\]+: .*$asm_file0.*(2 locations).*" \
"set a break-point at function in all instances for a selected ASM file."
-
untested "breakpoints using dir/file:line"
} else {
gdb_test "break one/thefile.cc:$l1" \
- "Breakpoint $decimal at $hex: file .*thefile.cc, line $l1." \
- "single-location break using dir/file:line"
+ "Breakpoint $decimal at $hex: file .*thefile.cc, line $l1." \
+ "single-location break using dir/file:line"
gdb_test "clear one/thefile.cc:$l1" \
- "Deleted breakpoint $decimal *" \
- "clear breakpoint using dir/file:line"
+ "Deleted breakpoint $decimal *" \
+ "clear breakpoint using dir/file:line"
if { [readline_is_used] } {
# There are functions named 'twodup' in both source files.
if {[info exists compiler_info]} {
# Unsetting compiler_info allows us to switch compilers
# used by prepare_for_testing.
- unset compiler_info
+ unset compiler_info
}
set options {debug}
* mi-stack.exp: Update. Output for args=... and
locals=... changed to a list.
-
+
2001-06-26 Andrew Cagney <ac131313@redhat.com>
* mi-stack.exp: Update. Output for stack=..., args=... and
* mi0-var-cmd.exp: Copy mi-var-cmd.exp.
* mi0-var-display.exp: Copy mi-var-display.exp.
* mi0-watch.exp: Copy mi-watch.exp.
-
+
2001-05-11 Fernando Nasser <fnasser@redhat.com>
* mi-var-child.exp: Adjust for the fact that now (char *) can be
Tue Mar 14 15:54:57 2000 Andrew Cagney <cagney@b1.cygnus.com>
* basics.c: Add EMACS local variable pointing change-log at this
- file.
+ file.
* Makefile.in: Ditto
2000-03-13 James Ingham <jingham@leda.cygnus.com>
2000-03-06 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* mi-disassemble.exp: Don't assume numbers for the offset
- values. They can be different depending on the architecture.
+ values. They can be different depending on the architecture.
* mi-watch.exp (test_watchpoint_triggering): In same cases the
- type can be 'hw wathcpoint' not just 'watchpoint'. Adjust for that.
+ type can be 'hw wathcpoint' not just 'watchpoint'. Adjust for that.
* basics.c (callee4): Make the function return something,
- otherwise the return value is undefined.
+ otherwise the return value is undefined.
2000-03-06 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* mi-basics.exp: Comment out test for a still unimplemented operation.
* mi-disassemble.exp: Rewrite most of the tests to conform to new
- disassemble interface.
+ disassemble interface.
Sat Mar 4 13:55:08 2000 Andrew Cagney <cagney@b1.cygnus.com>
From Fri 3 Mar 2000 Peter Schauer:
* mi-support.exp (mi_gdb_start): When GDB doesn't recongize -i=mi
- option, assume no MI support present.
+ option, assume no MI support present.
2000-02-01 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* mi-support.exp (mi_gdb_start): Update to recognize start up
- message with 'UI_OUT' instead of 'HEADLESS'.
+ message with 'UI_OUT' instead of 'HEADLESS'.
2000-01-27 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* mi-regs.exp (test_running_the_program): Add global var 'hex'.
* mi-stack.exp, mi-stepi.exp, mi-until.exp, mi-watch.exp,
- mi-var-display.exp, mi-var-cmd.exp, mi-var-child.exp,
- mi-var-block.exp: Update all stopped messages.
+ mi-var-display.exp, mi-var-cmd.exp, mi-var-child.exp,
+ mi-var-block.exp: Update all stopped messages.
2000-01-17 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* mi-console.exp, mi-disassemble.exp, mi-eval.exp,
- mi-read-memory.exp, mi-regs.exp, mi-return.exp, mi-simplerun.exp:
- Update stopped messages, update copyright.
-
+ mi-read-memory.exp, mi-regs.exp, mi-return.exp, mi-simplerun.exp:
+ Update stopped messages, update copyright.
+
* mi-disassemble.exp: Update error messages output.
-
+
* mi-support.exp (proc mi_step): Make gdb do a 'step' command, not
- a 'next'. Update stopped message.
+ a 'next'. Update stopped message.
(proc mi_next): Update stop message.
(proc mi_run_to_main): Update stopped message.
Update copyright.
* mi-stack.exp: New file, tests for stack commands.
* mi-support.exp (mi_run_to_main, mi_next, mi_step) : Update to
- include thread-id in stopped message.
+ include thread-id in stopped message.
* mi-regs.exp: Update break-insert output.
* (mi-console.exp, mi-disassemble.exp, mi-eval.exp,
- mi-read-memory.exp, mi-regs.exp, mi-return.exp, mi-simplerun.exp,
- mi-stepi.exp, mi-until.exp, mi-var-block.exp, mi-var-child.exp,
- mi-var-cmd.exp, mi-var-display.exp, mi-watch.exp): Update stopped
- message to include thread-id.
+ mi-read-memory.exp, mi-regs.exp, mi-return.exp, mi-simplerun.exp,
+ mi-stepi.exp, mi-until.exp, mi-var-block.exp, mi-var-child.exp,
+ mi-var-cmd.exp, mi-var-display.exp, mi-watch.exp): Update stopped
+ message to include thread-id.
Wed Dec 29 22:06:05 1999 Andrew Cagney <cagney@b1.cygnus.com>
* mi-watch.exp, mi-var-display.exp, mi-var-cmd.exp,
- mi-var-child.exp, mi-var-block.exp, mi-until.exp, mi-stepi.exp,
- mi-simplerun.exp, mi-return.exp, mi-support.exp, mi-eval.exp,
- mi-console.exp, mi-disassemble.exp, mi-break.exp: Update to
- reflect extended output from -break-insert command.
-
+ mi-var-child.exp, mi-var-block.exp, mi-until.exp, mi-stepi.exp,
+ mi-simplerun.exp, mi-return.exp, mi-support.exp, mi-eval.exp,
+ mi-console.exp, mi-disassemble.exp, mi-break.exp: Update to
+ reflect extended output from -break-insert command.
+
* mi-break.exp (test_rbreak_creation_and_listing): XFAIL regexp
- tests. -r flag broken by above.
-
+ tests. -r flag broken by above.
+
Sun Dec 19 19:28:13 1999 Andrew Cagney <cagney@b1.cygnus.com>
* cpp_variable.cc, cpp_variable.h, c_variable.c: Delete.
* mi-var-block.exp: Set up xfails fro known problems.
* mi-var-display.exp: Set up printing of values of 'e' and 'anone'
- as xfails.
+ as xfails.
* mi-var-child.exp: Fix typos.
Wed Dec 15 19:23:38 1999 Andrew Cagney <cagney@b1.cygnus.com>
* mi-read-memory.exp: Add test for ``-o <offset>''. Update checks
- and match next-row et.al.
+ and match next-row et.al.
1999-12-14 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* mi-var-display.exp : New file. Tests for format and type, with
- unions, structs and enums.
-
+ unions, structs and enums.
+
* mi-var-cmd.exp: Add some var-assign tests.
-1999-12-14 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+1999-12-14 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* mi-var-cmd.exp, mi-var-block.exp, mi-var-child.exp: New files
- some tests for -var* commands.
+ some tests for -var* commands.
* var-cmd.c: New source file for var-* commands tests.
* gdb.mi/Makefile.in (PROGS): Add var-cmd.
-
+
Mon Dec 13 18:06:09 1999 Andrew Cagney <cagney@b1.cygnus.com>
* mi-break.exp: Fix quoting. Changed "srcfile.c":6 to
- "\"srcfile.c\":6".
+ "\"srcfile.c\":6".
* mi-simplerun.exp: Fix quoting.
Sat Dec 11 21:33:37 1999 Andrew Cagney <cagney@b1.cygnus.com>
* mi-simplerun.exp (exec-finish): Fix return value was zero,
- should have been three.
+ should have been three.
* mi-disassemble.exp: Reduce number of wild card matches in
- * patterns. Remove all numeric constants.
+ * patterns. Remove all numeric constants.
1999-12-09 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* mi-eval.exp: New file. Some initial tests for
- -data-evaluate-expression.
+ -data-evaluate-expression.
1999-12-09 Fernando Nasser <fnasser@totem.to.cygnus.com>
1999-12-08 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* mi-regs.exp: Fix test for format 'N' for
- data-list-register-values.
+ data-list-register-values.
1999-12-07 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* mi-disassemble.exp: Update expected output. Break test of
- disassembly in mixed mode into 2 functions.
+ disassembly in mixed mode into 2 functions.
* mi-regs.exp: Initial register tests. Works only on sparc right
- now.
+ now.
1999-12-02 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* mi-stepi.exp: New file. Tests exec-step-instruction and
- exec-next-instruction.
+ exec-next-instruction.
* mi-until.exp: New file. Tests exec-until.
* until.c: New file.
* mi-return.exp: New file. Tests exec-return.
Thu Dec 2 09:38:23 1999 Andrew Cagney <cagney@b1.cygnus.com>
* mi-hack-cli.exp: New test. Check the hacked up access to the
- CLI.
+ CLI.
Wed Dec 1 16:47:40 1999 Andrew Cagney <cagney@b1.cygnus.com>
* mi-basics.exp: Delete calls to mi_delete_breakpoints,
- mi_gdb_reinitialize_dir and mi_gdb_load. This test is checking
- that these can work.
+ mi_gdb_reinitialize_dir and mi_gdb_load. This test is checking
+ that these can work.
* mi-support.exp (mi_step, mi_next, mi_run_to_main): New
procedures.
* mi-read-memory.exp, mi-read-memory.c: New files. Test
- data-read-memory command.
-
+ data-read-memory command.
+
Tue Nov 30 23:54:16 1999 Andrew Cagney <cagney@b1.cygnus.com>
* mi-support.exp: Don't start SID until after GDB has been started
- and verified.
-
+ and verified.
+
Tue Nov 30 22:21:33 1999 Andrew Cagney <cagney@b1.cygnus.com>
* mi-support.exp (mi_uncatched_gdb_exit): When SID, call sid_exit.
(mi_gdb_start): When SID, call sid_start.
(mi_gdb_start): Add MIFLAGS to spawn-GDB command. Check for
- HEADLESS gdb. Return non-zero when GDB fails to start.
+ HEADLESS gdb. Return non-zero when GDB fails to start.
(mi_gdb_load): When SID or SIM, download program.
(mi_run_cmd): Don't do download here. Assume target supports the
- 00-exec-run command.
+ 00-exec-run command.
(skip_mi_tests, setup_gdbmi, unset_gdbmi): Delete. Merged into
- mi_gdb_start.
+ mi_gdb_start.
* mi-basics.exp, mi-break.exp, mi-console.exp, mi-disassemble.exp,
- mi-simplerun.exp, mi-watch.exp: Update. Check status from
- mi_gdb_start indicating that GDB started correctly.
+ mi-simplerun.exp, mi-watch.exp: Update. Check status from
+ mi_gdb_start indicating that GDB started correctly.
Tue Nov 30 15:22:08 1999 Andrew Cagney <cagney@b1.cygnus.com>
* mi-support.exp (setup_gdbmi, unset_gdbmi): New
- procedures. Setup/unset dejagnu for mi tests.
+ procedures. Setup/unset dejagnu for mi tests.
* mi-basics.exp, mi-console.exp, mi-simplerun.exp, mi-break.exp,
- mi-disassemble.exp, mi-watch.exp: Update.
+ mi-disassemble.exp, mi-watch.exp: Update.
1999-11-29 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* mi-simplerun.exp (test_running_the_program): Remove XFAIL. The
- output is fixed now.
+ output is fixed now.
(test_program_termination): Update output pattern.
Tue Nov 30 00:19:10 1999 Andrew Cagney <cagney@b1.cygnus.com>
Mon Nov 29 17:59:13 1999 Andrew Cagney <cagney@b1.cygnus.com>
* mi-support.exp (mi_run_command): Check for exec-run command
- failure due to MI not having an active target.
+ failure due to MI not having an active target.
(mi_run_command): Check for and handle a builtin simulator target.
(mi_run_command): Don't check/handle for ``The program has been
- started already'', not a valid MI response.
-
+ started already'', not a valid MI response.
+
* mi-simplerun.exp (test_running_the_program): Update all patterns
- to match async output.
+ to match async output.
(test_running_the_program): Mark ``step to callee4'' as XFAIL. MI
- output contains {,reason="end-stepping-range"}+.
+ output contains {,reason="end-stepping-range"}+.
* mi-simplerun.exp: Limit the timeout for ``step to callee4'' to
- 30 seconds.
+ 30 seconds.
Mon Nov 29 17:30:00 1999 Andrew Cagney <cagney@b1.cygnus.com>
* mi-support.exp (skip_mi_tests): Print UNTESTED when MI interface
- isn't available. Start/stop instead of assuming GDB is running.
+ isn't available. Start/stop instead of assuming GDB is running.
(MIFLAGS): Define.
* mi-simplerun.exp, mi-disassemble.exp, mi-break.exp,
- mi-basics.exp, mi-watch.exp: Update.
+ mi-basics.exp, mi-watch.exp: Update.
1999-11-26 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
Wed Nov 24 17:31:04 1999 Andrew Cagney <cagney@b1.cygnus.com>
* gdb.mi/mi-basics.exp, gdb.mi/mi-disassemble.exp,
- gdb.mi/mi-simplerun.exp: Print warning message when test isn't
- run.
+ gdb.mi/mi-simplerun.exp: Print warning message when test isn't
+ run.
1999-11-23 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
1999-11-04 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* gdb.mi/mi-disassemble.exp: Update output of execution commands
- to reflect new 'reason' field.
+ to reflect new 'reason' field.
* gdb.mi/mi-simplerun.exp: Ditto.
1999-10-25 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* gdb.mi/mi-simplerun.exp: Add more stack-list-frames tests.
- * gdb.mi/mi-disassemble.exp: Update 'run to main' output.
+ * gdb.mi/mi-disassemble.exp: Update 'run to main' output.
* gdb.mi/mi-simplerun.exp: Update execution commands
- output. Update backtrace output.
-
+ output. Update backtrace output.
+
1999-10-18 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* gdb.mi/mi-disassemble.exp: Add new tests for the new
Mon Oct 11 13:57:21 1999 Andrew Cagney <cagney@amy.cygnus.com>
* lib/mi-support.exp: Break complicated gdb_expect containing
- exp_continue into a while within an expect. Don't attempt a start
- more than three times. Check return value from gdb_load.
-
+ exp_continue into a while within an expect. Don't attempt a start
+ more than three times. Check return value from gdb_load.
+
1999-10-06 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* gdb.mi/mi-disassemble.exp: New file.
Wed Oct 6 12:05:58 1999 Andrew Cagney <cagney@b1.cygnus.com>
* lib/mi-support.exp (mi_run_cmd): Give up after two restart
- attempts.
+ attempts.
1999-09290 Fernando Nasser <fnasser@totem.to.cygnus.com>
1999-06-24 Fernando Nasser <fnasser@totem.to.cygnus.com>
* lib/mi-support.exp (mi_run_cmd): Fix pattern and add a timeout
- clause.
+ clause.
1999-06-24 Fernando Nasser <fnasser@totem.to.cygnus.com>
1999-06-22 Fernando Nasser <fnasser@totem.to.cygnus.com>
- * gdb.mi/mi-simplerun.exp: New file. Tests simple debugging tasks.
+ * gdb.mi/mi-simplerun.exp: New file. Tests simple debugging tasks.
* gdb.mi/mi-basics.exp: Remove tests moved to above new file.
* lib/mi-support.exp: New file. Support procedures for mi tests.
set test "-list-thread-groups --available"
gdb_test_multiple $test $test {
-re "\}" {
- exp_continue
+ exp_continue
}
-re "\r\n$gdb_prompt " {
- pass $test
+ pass $test
}
}
# Verify that GDB is still alive.
mi_gdb_test "-data-evaluate-expression 1" \
- ".*\\^done,value=\"1\"" \
- "GDB is still alive"
+ ".*\\^done,value=\"1\"" \
+ "GDB is still alive"
# "file-clear operation"
mi_gdb_test "-file-exec-file ${filename}" \
- "\\\^done" \
- "file-exec-file operation"
+ "\\\^done" \
+ "file-exec-file operation"
mi_gdb_test "-file-symbol-file ${filename}" \
- "\\\^done" \
- "file-symbol-file operation"
+ "\\\^done" \
+ "file-symbol-file operation"
# We need to return != 0.
return 1
# The all parameter is actually no parameter.
mi_gdb_test "200-break-delete" \
- "200\\\^done" \
- "break-delete (all) operation"
+ "200\\\^done" \
+ "break-delete (all) operation"
mi_gdb_test "201-break-list" \
- ".*\\\^done,BreakpointTable=\\\{.*,body=\\\[\\\]\\\}" \
- "all breakpoints removed"
+ ".*\\\^done,BreakpointTable=\\\{.*,body=\\\[\\\]\\\}" \
+ "all breakpoints removed"
}
proc test_dir_specification {} {
# -environment-directory -r
mi_gdb_test "202-environment-directory ${testsubdir}" \
- "202\\\^done,source-path=\"${envirodir}.\\\$cdir.\\\$cwd\"" \
- "environment-directory arg operation"
+ "202\\\^done,source-path=\"${envirodir}.\\\$cdir.\\\$cwd\"" \
+ "environment-directory arg operation"
mi_gdb_test "203-environment-directory" \
- "203\\\^done,source-path=\"${envirodir}.\\\$cdir.\\\$cwd\"" \
- "environment-directory empty-string operation"
+ "203\\\^done,source-path=\"${envirodir}.\\\$cdir.\\\$cwd\"" \
+ "environment-directory empty-string operation"
mi_gdb_test "204-environment-directory -r" \
- "204\\\^done,source-path=\"\\\$cdir.\\\$cwd\"" \
- "environment-directory operation"
+ "204\\\^done,source-path=\"\\\$cdir.\\\$cwd\"" \
+ "environment-directory operation"
}
proc test_cwd_specification {} {
# -environment-pwd
mi_gdb_test "205-environment-cd ${objdir}" \
- "205\\\^done" \
- "environment-cd arg operation"
+ "205\\\^done" \
+ "environment-cd arg operation"
# The canonical name of the working directory may differ on a
# remote host from that on the build system.
if {![is_remote host]} {
mi_gdb_test "206-environment-pwd" \
- "206\\\^done,cwd=\"${escapedobjdir}\"" \
- "environment-pwd operation"
+ "206\\\^done,cwd=\"${escapedobjdir}\"" \
+ "environment-pwd operation"
}
}
set orig_path [string_to_regexp ${orig_path}]
mi_gdb_test "207-environment-path" \
- "207\\\^done,path=\"$orig_path\"" \
- "environment-path no-args operation"
+ "207\\\^done,path=\"$orig_path\"" \
+ "environment-path no-args operation"
mi_gdb_test "208-environment-path $objdir ${testsubdir}" \
- "208\\\^done,path=\"$escapedobjdir.${envirodir}.$orig_path\"" \
- "environment-path dir1 dir2 operation"
+ "208\\\^done,path=\"$escapedobjdir.${envirodir}.$orig_path\"" \
+ "environment-path dir1 dir2 operation"
mi_gdb_test "209-environment-path -r $objdir" \
- "209\\\^done,path=\"$escapedobjdir.$orig_path\"" \
- "environment-path -r dir operation"
+ "209\\\^done,path=\"$escapedobjdir.$orig_path\"" \
+ "environment-path -r dir operation"
mi_gdb_test "210-environment-path -r" \
- "210\\\^done,path=\"$orig_path\"" \
- "environment-path -r operation"
+ "210\\\^done,path=\"$orig_path\"" \
+ "environment-path -r operation"
}
"send -fix-multi-location-breakpoint-output"
}
- # Create a breakpoint.
+ # Create a breakpoint.
mi_gdb_test "-break-insert main" ".*" "add breakpoint on main"
- set pattern [make_pattern $expect_fixed_output]
+ set pattern [make_pattern $expect_fixed_output]
- # Add commands. Use the CLI command, so we can verify the
- # =breakpoint-modified output.
- mi_gdb_test "commands\nabc\ndef\nend" ".*=breakpoint-modified,$pattern\r\n\\^done" "add breakpoint commands"
+ # Add commands. Use the CLI command, so we can verify the
+ # =breakpoint-modified output.
+ mi_gdb_test "commands\nabc\ndef\nend" ".*=breakpoint-modified,$pattern\r\n\\^done" "add breakpoint commands"
# Check the -break-info output.
mi_gdb_test "-break-info" \
# debug info of shared libraries like glibc, libgcc, etc.
mi_gdb_test "1-complete br" \
- "1\\^done,completion=\"break\",matches=\\\[.*\"break\",.*\"break-range\".*\\\],max_completions_reached=\"0\"" \
- "-complete br"
+ "1\\^done,completion=\"break\",matches=\\\[.*\"break\",.*\"break-range\".*\\\],max_completions_reached=\"0\"" \
+ "-complete br"
# Check empty completion list.
mi_gdb_test "5-complete bogus" \
- "5\\^done,matches=\\\[\\\],max_completions_reached=\"0\"" \
- "-complete bogus"
+ "5\\^done,matches=\\\[\\\],max_completions_reached=\"0\"" \
+ "-complete bogus"
# Check completions for commands with space.
mi_gdb_test "4-complete \"b mai\"" \
- "4\\^done,completion=\"b main\",matches=\\\[.*\"b main\".*\\\],max_completions_reached=\"0\"" \
- "-complete \"b mai\""
+ "4\\^done,completion=\"b main\",matches=\\\[.*\"b main\".*\\\],max_completions_reached=\"0\"" \
+ "-complete \"b mai\""
# Check wildmatching.
mi_gdb_test "5-complete \"b push_ba\"" \
- "5\\^done,completion=\"b push_back\\(\",matches=\\\[.*\"b A::push_back\\(void\\*\\)\".*\\\],max_completions_reached=\"0\"" \
- "-complete \"b push_ba\", wildmatching"
+ "5\\^done,completion=\"b push_back\\(\",matches=\\\[.*\"b A::push_back\\(void\\*\\)\".*\\\],max_completions_reached=\"0\"" \
+ "-complete \"b push_ba\", wildmatching"
mi_gdb_test "-info-gdb-mi-command complete" \
- "\\^done,command=\{exists=\"true\"\}" \
- "-info-gdb-mi-command complete"
+ "\\^done,command=\{exists=\"true\"\}" \
+ "-info-gdb-mi-command complete"
# Limit max completions and check that max_completions_reached=\"0\" is set
# to 1.
"set max-completions 1"
mi_gdb_test "2-complete br" \
- ".*2\\^done,completion=\"br\[A-Za-z0-9-\]+\",matches=\\\[\"br\[A-Za-z0-9-\]+\"\\\],max_completions_reached=\"1\"" \
- "-complete br, max-completions 1"
+ ".*2\\^done,completion=\"br\[A-Za-z0-9-\]+\",matches=\\\[\"br\[A-Za-z0-9-\]+\"\\\],max_completions_reached=\"1\"" \
+ "-complete br, max-completions 1"
# Disable completions and check an error is returned
mi_gdb_test "set max-completions 0" ".*=cmd-param-changed.*\\^done" \
"set max-completions 0"
mi_gdb_test "3-complete br" \
- ".*3\\^error,msg=\".*" \
- "-complete br, max-completions 0"
+ ".*3\\^error,msg=\".*" \
+ "-complete br, max-completions 0"
mi_gdb_test "print/x \$pc" "" ""
mi_gdb_test "222-data-disassemble -f basics.c -l $line_main_body -n 20 -- 0" \
"222\\^done,asm_insns=\\\[\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\},.*,\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\\\]" \
- "data-disassemble file, line, number assembly only"
+ "data-disassemble file, line, number assembly only"
mi_gdb_test "222-data-disassemble -f basics.c -l $line_main_body -n 0 -- 0" \
"222\\^done,asm_insns=\\\[\\\]" \
- "data-disassemble file, line, number (zero lines) assembly only"
+ "data-disassemble file, line, number (zero lines) assembly only"
mi_gdb_test "222-data-disassemble -f basics.c -l $line_main_body -n 50 -- 0" \
"222\\^done,asm_insns=\\\[\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\},.*,\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\\\]" \
- "data-disassemble file, line, number (more than main lines) assembly only"
+ "data-disassemble file, line, number (more than main lines) assembly only"
}
mi_gdb_test "002-data-disassemble -f basics.c -l $line_callee2_open_brace -- 1" \
"002\\^done,asm_insns=\\\[src_and_asm_line=\{line=\"$line_callee2_open_brace\",file=\".*basics.c\",fullname=\"${fullname_syntax}basics.c\",line_asm_insn=\\\[\{address=\"$hex\",func-name=\"callee2\",offset=\"0\",inst=\".*\"\}.*\\\]\}.*,src_and_asm_line=\{line=\"$decimal\",file=\".*basics.c\",fullname=\"${fullname_syntax}basics.c\",line_asm_insn=\\\[.*\{address=\"$hex\",func-name=\"callee2\",offset=\"$decimal\",inst=\".*\"\}\\\]\}\\\]" \
- "data-disassemble file, line assembly mixed"
+ "data-disassemble file, line assembly mixed"
#
# In mixed mode, the lowest level of granularity is the source line.
#
mi_gdb_test "003-data-disassemble -s \$pc -e \"\$pc+4\" -- 1" \
"003\\^done,asm_insns=\\\[src_and_asm_line=\{line=\"$decimal\",file=\".*basics.c\",fullname=\"${fullname_syntax}basics.c\",line_asm_insn=\\\[\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}.*\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\\\]\}\\\]" \
- "data-disassemble range assembly mixed"
+ "data-disassemble range assembly mixed"
}
proc test_disassembly_mixed_with_opcodes {} {
# -data-disassembly -s $pc -e "$pc+8" -- 3
mi_gdb_test "002-data-disassemble -f basics.c -l $line_callee2_open_brace -- 3" \
- "002\\^done,asm_insns=\\\[src_and_asm_line=\{line=\"$line_callee2_open_brace\",file=\".*basics.c\",fullname=\"${fullname_syntax}basics.c\",line_asm_insn=\\\[\{address=\"$hex\",func-name=\"callee2\",offset=\"0\",opcodes=\".*\",inst=\".*\"\}.*\\\]\}.*,src_and_asm_line=\{line=\"$decimal\",file=\".*basics.c\",fullname=\"${fullname_syntax}basics.c\",line_asm_insn=\\\[.*\{address=\"$hex\",func-name=\"callee2\",offset=\"$decimal\",opcodes=\".*\",inst=\".*\"\}\\\]\}\\\]" \
- "data-disassemble file, line assembly mixed with opcodes"
+ "002\\^done,asm_insns=\\\[src_and_asm_line=\{line=\"$line_callee2_open_brace\",file=\".*basics.c\",fullname=\"${fullname_syntax}basics.c\",line_asm_insn=\\\[\{address=\"$hex\",func-name=\"callee2\",offset=\"0\",opcodes=\".*\",inst=\".*\"\}.*\\\]\}.*,src_and_asm_line=\{line=\"$decimal\",file=\".*basics.c\",fullname=\"${fullname_syntax}basics.c\",line_asm_insn=\\\[.*\{address=\"$hex\",func-name=\"callee2\",offset=\"$decimal\",opcodes=\".*\",inst=\".*\"\}\\\]\}\\\]" \
+ "data-disassemble file, line assembly mixed with opcodes"
#
# In mixed mode, the lowest level of granularity is the source line.
# which we are now, even if we have specified that the range is only 2 insns.
#
mi_gdb_test "003-data-disassemble -s \$pc -e \"\$pc+4\" -- 3" \
- "003\\^done,asm_insns=\\\[src_and_asm_line=\{line=\"$decimal\",file=\".*basics.c\",fullname=\"${fullname_syntax}basics.c\",line_asm_insn=\\\[\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",opcodes=\".*\",inst=\".*\"\}.*\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",opcodes=\".*\",inst=\".*\"\}\\\]\}\\\]" \
- "data-disassemble range assembly mixed with opcodes"
+ "003\\^done,asm_insns=\\\[src_and_asm_line=\{line=\"$decimal\",file=\".*basics.c\",fullname=\"${fullname_syntax}basics.c\",line_asm_insn=\\\[\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",opcodes=\".*\",inst=\".*\"\}.*\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",opcodes=\".*\",inst=\".*\"\}\\\]\}\\\]" \
+ "data-disassemble range assembly mixed with opcodes"
}
proc test_disassembly_mixed_lines_limit {} {
mi_gdb_test "print/x \$pc" "" ""
mi_gdb_test "222-data-disassemble -f basics.c -l $line_main_body -n 20 -- 1" \
"222\\^done,asm_insns=\\\[src_and_asm_line=\{line=\"$decimal\",file=\".*basics.c\",fullname=\"${fullname_syntax}basics.c\",line_asm_insn=\\\[\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\},.*,\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\\\]\}\]" \
- "data-disassemble file, line, number assembly mixed"
+ "data-disassemble file, line, number assembly mixed"
mi_gdb_test "222-data-disassemble -f basics.c -l $line_main_body -n 0 -- 1" \
"222\\^done,asm_insns=\\\[src_and_asm_line=\{line=\"$line_main_open_brace\",file=\".*basics.c\",fullname=\"${fullname_syntax}basics.c\",line_asm_insn=\\\[\\\]\}\\\]" \
- "data-disassemble file, line, number (zero lines) assembly mixed"
+ "data-disassemble file, line, number (zero lines) assembly mixed"
mi_gdb_test "222-data-disassemble -f basics.c -l $line_main_body -n 50 -- 1" \
"222\\^done,asm_insns=\\\[src_and_asm_line=\{line=\"$decimal\",file=\".*basics.c\",fullname=\"${fullname_syntax}basics.c\",line_asm_insn=\\\[\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\}.*,\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\\\]\}\]" \
- "data-disassemble file, line, number (more than main lines) assembly mixed"
+ "data-disassemble file, line, number (more than main lines) assembly mixed"
}
proc test_disassembly_bogus_args {} {
# -data-disassembly -f basics.c -l 32 -- 9
mi_gdb_test "123-data-disassemble -f foo -l abc -n 0 -- 0" \
- "123\\^error,msg=\"-data-disassemble: Invalid filename.\"" \
- "data-disassemble bogus filename"
+ "123\\^error,msg=\"-data-disassemble: Invalid filename.\"" \
+ "data-disassemble bogus filename"
mi_gdb_test "321-data-disassemble -s foo -e bar -- 0" \
- "321\\^error,msg=\"No symbol \\\\\"foo\\\\\" in current context.\"" \
- "data-disassemble bogus address, -s -e"
+ "321\\^error,msg=\"No symbol \\\\\"foo\\\\\" in current context.\"" \
+ "data-disassemble bogus address, -s -e"
mi_gdb_test "322-data-disassemble -a foo -- 0" \
- "322\\^error,msg=\"No symbol \\\\\"foo\\\\\" in current context.\"" \
- "data-disassemble bogus address, -a"
+ "322\\^error,msg=\"No symbol \\\\\"foo\\\\\" in current context.\"" \
+ "data-disassemble bogus address, -a"
mi_gdb_test "456-data-disassemble -s \$pc -f basics.c -- 0" \
"456\\^error,msg=\"-data-disassemble: Usage: \\( -f filename -l linenum .-n howmany. \\| -s startaddr -e endaddr \\| -a addr \\) . --opcodes mode . . --source . . .--. mode .\\.\"" \
"data-disassemble mix different args"
mi_gdb_test "789-data-disassemble -f basics.c -l $line_main_body -- 9" \
- "789\\^error,msg=\"-data-disassemble: Mode argument must be in the range 0-5.\"" \
+ "789\\^error,msg=\"-data-disassemble: Mode argument must be in the range 0-5.\"" \
"data-disassemble wrong mode arg"
foreach mode { 1 2 3 4 5 } {
mi_gdb_test "111-file-list-exec-source-file" \
"111\\\^done,line=\"$line_default\",file=\"${srcfilepath}\",fullname=\"$fullname_syntax${srcfile}\",macro-info=\"0\"" \
- "request path info of current source file (${srcfile})"
+ "request path info of current source file (${srcfile})"
}
proc test_file_list_exec_source_files {} {
# get the path and absolute path to the current executable
mi_gdb_test "222-file-list-exec-source-files" \
"222\\\^done,files=\\\[\{file=\".*${srcfile}\",fullname=\"$fullname_syntax${srcfile}\",debug-fully-read=\"\[^\"\]+\"\}.*]" \
- "Getting a list of source files."
+ "Getting a list of source files."
}
test_file_list_exec_source_file
# First, verify that the debugger correctly advertises support
# for the -info-gdb-mi-command command.
mi_gdb_test "-list-features" \
- "\\^done,features=\\\[.*\"info-gdb-mi-command\".*\\\]" \
- "-list-features includes \"info-gdb-mi-command\""
+ "\\^done,features=\\\[.*\"info-gdb-mi-command\".*\\\]" \
+ "-list-features includes \"info-gdb-mi-command\""
mi_gdb_test "-info-gdb-mi-command unsupported-command" \
- "\\^done,command=\\\{exists=\"false\"\\\}" \
- "-info-gdb-mi-command unsupported-command"
+ "\\^done,command=\\\{exists=\"false\"\\\}" \
+ "-info-gdb-mi-command unsupported-command"
# Same test as above, but including the leading '-' in the command name.
mi_gdb_test "-info-gdb-mi-command -unsupported-command" \
- "\\^done,command=\\\{exists=\"false\"\\\}" \
- "-info-gdb-mi-command -unsupported-command"
+ "\\^done,command=\\\{exists=\"false\"\\\}" \
+ "-info-gdb-mi-command -unsupported-command"
mi_gdb_test "-info-gdb-mi-command symbol-list-lines" \
- "\\^done,command=\\\{exists=\"true\"\\\}" \
- "-info-gdb-mi-command symbol-list-lines"
+ "\\^done,command=\\\{exists=\"true\"\\\}" \
+ "-info-gdb-mi-command symbol-list-lines"
# Same test as above, but including the leading '-' in the command name.
mi_gdb_test "-info-gdb-mi-command -symbol-list-lines" \
- "\\^done,command=\\\{exists=\"true\"\\\}" \
- "-info-gdb-mi-command -symbol-list-lines"
+ "\\^done,command=\\\{exists=\"true\"\\\}" \
+ "-info-gdb-mi-command -symbol-list-lines"
# First, verify that the debugger correctly advertises support
# for the --language option.
mi_gdb_test "-list-features" \
- "\\^done,features=\\\[.*\"language-option\".*\\\]" \
- "-list-features should include \"language-option\""
+ "\\^done,features=\\\[.*\"language-option\".*\\\]" \
+ "-list-features should include \"language-option\""
mi_gdb_test "set lang ada" \
- ".*=cmd-param-changed,param=\"language\",value=\"ada\".*"
+ ".*=cmd-param-changed,param=\"language\",value=\"ada\".*"
# Evaluate an expression that the Ada language is unable to parse.
mi_gdb_test "-data-evaluate-expression \"sizeof (void*)\"" \
- "\\^error,.*" \
- "sizeof expression using current language"
+ "\\^error,.*" \
+ "sizeof expression using current language"
# Now, ask for the same expression to be parsed, but using the C
# language.
mi_gdb_test "-data-evaluate-expression --language c \"sizeof (void*)\"" \
- "\\^done,value=\"$decimal\"" \
- "sizeof expression using C language"
+ "\\^done,value=\"$decimal\"" \
+ "sizeof expression using C language"
# Double-check that the current language has not changed.
mi_gdb_test "show lang ada" \
- ".*The current source language is \\\\\"ada\\\\\".*"
+ ".*The current source language is \\\\\"ada\\\\\".*"
# Test what happens when specifying an invalid language name...
mi_gdb_test "-data-evaluate-expression --language invlang \"sizeof (void*)\"" \
- "\\^error,msg=\"Invalid --language argument: invlang\"" \
- "data-evaluate-expression with invalid language name"
+ "\\^error,msg=\"Invalid --language argument: invlang\"" \
+ "data-evaluate-expression with invalid language name"
# Make sure that "--language auto" is also rejected.
mi_gdb_test "-data-evaluate-expression --language auto \"sizeof (void*)\"" \
- "\\^error,msg=\"Invalid --language argument: auto\"" \
- "data-evaluate-expression with language auto"
+ "\\^error,msg=\"Invalid --language argument: auto\"" \
+ "data-evaluate-expression with language auto"
# Make sure that "--language local" is also rejected.
mi_gdb_test "-data-evaluate-expression --language local \"sizeof (void*)\"" \
- "\\^error,msg=\"Invalid --language argument: local\"" \
- "data-evaluate-expression with language local"
+ "\\^error,msg=\"Invalid --language argument: local\"" \
+ "data-evaluate-expression with language local"
# Make sure that "--language unknown" is also rejected.
mi_gdb_test "-data-evaluate-expression --language unknown \"sizeof (void*)\"" \
- "\\^error,msg=\"Invalid --language argument: unknown\"" \
- "data-evaluate-expression with language unknown"
+ "\\^error,msg=\"Invalid --language argument: unknown\"" \
+ "data-evaluate-expression with language unknown"
foreach_with_prefix iteration {1 2} {
mi_delete_breakpoints
if { [mi_runto_main] < 0 } {
- continue
+ continue
}
mi_send_resuming_command "exec-continue" "continue"
check_mi_thread_command_set
mi_gdb_exit
-
# Test exec-reverse-next
mi_execute_to "exec-next --reverse" \
- "end-stepping-range" "main" "" \
- "basics.c" $line_main_hello "" \
- "reverse next to get over the call to do_nothing"
+ "end-stepping-range" "main" "" \
+ "basics.c" $line_main_hello "" \
+ "reverse next to get over the call to do_nothing"
# Test exec-reverse-step
mi_execute_to "exec-step --reverse" \
- "end-stepping-range" "callee1" \
+ "end-stepping-range" "callee1" \
"\{name=\"intarg\",value=\"2\"\},\{name=\"strarg\",value=\"$hex \\\\\"A string argument\.\\\\\"\"\},\{name=\"fltarg\",value=\"3.5\[0-9\]*\"\}" \
- "basics.c" $line_callee1_close "" \
- "reverse step to callee1"
+ "basics.c" $line_callee1_close "" \
+ "reverse step to callee1"
mi_execute_to "exec-step --reverse" \
- "end-stepping-range" "callee2" \
+ "end-stepping-range" "callee2" \
"\{name=\"intarg\",value=\"2\"\},\{name=\"strarg\",value=\"$hex \\\\\"A string argument\.\\\\\"\"\}" \
- "basics.c" $line_callee2_close "" \
- "reverse step to callee2"
+ "basics.c" $line_callee2_close "" \
+ "reverse step to callee2"
mi_execute_to "exec-step --reverse" \
- "end-stepping-range" "callee3" \
+ "end-stepping-range" "callee3" \
"\{name=\"strarg\",value=\"$hex \\\\\"A string argument\.\\\\\"\"\}" \
- "basics.c" $line_callee3_close "" \
- "reverse step to callee3"
+ "basics.c" $line_callee3_close "" \
+ "reverse step to callee3"
mi_execute_to "exec-step --reverse" \
- "end-stepping-range" "callee4" "" \
- "basics.c" "\[0-9\]+" "" \
- "reverse step to callee4"
+ "end-stepping-range" "callee4" "" \
+ "basics.c" "\[0-9\]+" "" \
+ "reverse step to callee4"
# Test exec-reverse-[step|next]-instruction
mi_execute_to "exec-step-instruction --reverse" \
- "end-stepping-range" "callee4" "" \
- "basics.c" "\[0-9\]+" "" \
- "reverse-step-instruction at callee4"
+ "end-stepping-range" "callee4" "" \
+ "basics.c" "\[0-9\]+" "" \
+ "reverse-step-instruction at callee4"
mi_execute_to "exec-next-instruction --reverse" \
- "end-stepping-range" "callee4" "" \
- "basics.c" "\[0-9\]+" "" \
- "reverse-next-instruction at callee4"
+ "end-stepping-range" "callee4" "" \
+ "basics.c" "\[0-9\]+" "" \
+ "reverse-next-instruction at callee4"
# Test exec-reverse-continue
-line $line_callee3_body
mi_execute_to "exec-continue --reverse" \
- "breakpoint-hit" "callee3" \
+ "breakpoint-hit" "callee3" \
"\{name=\"strarg\",value=\"$hex \\\\\"A string argument\.\\\\\"\"\}" \
- "basics.c" "\[0-9\]+" \
+ "basics.c" "\[0-9\]+" \
{ "" "disp=\"del\""} \
- "reverse-continue at callee3"
+ "reverse-continue at callee3"
mi_execute_to "exec-continue --reverse" \
- "no-history" "main" "" \
- "basics.c" $line_main_body "" \
- "reverse-continue at main"
+ "no-history" "main" "" \
+ "basics.c" $line_main_body "" \
+ "reverse-continue at main"
}
test_controlled_execution_reverse
"list of breakpoints"
mi_gdb_test "205-break-disable 2 3 4" \
- "205\\^done.*" \
- "disabling of breakpoints"
+ "205\\^done.*" \
+ "disabling of breakpoints"
set bp2 [mi_make_breakpoint -number 2 -enabled n]
mi_gdb_test "206-break-info 2" \
# First, verify that the debugger correctly advertises support
# for the --start option of the -exec-run command.
mi_gdb_test "-list-features" \
- "\\^done,features=\\\[.*\"exec-run-start-option\".*\\\]" \
- "-list-features includes \"exec-run-start-option\""
+ "\\^done,features=\\\[.*\"exec-run-start-option\".*\\\]" \
+ "-list-features includes \"exec-run-start-option\""
mi_run_cmd "--start"
mi_expect_stop "breakpoint-hit" "main" "" ".*mi-start.c" "$decimal" \
{ "" "disp=\"del\"" } "run to main"
-
set line_main_hello [gdb_get_line_number "Hello, World!"]
set line [mi_execute_to "exec-step-instruction" "end-stepping-range" "main" "" \
- ".*basics.c" "\[0-9\]+" "" "step-instruction at main"]
+ ".*basics.c" "\[0-9\]+" "" "step-instruction at main"]
if { $line >= $line_main_body && $line <= $line_main_hello } {
pass "step-instruction at main, line check"
} else {
}
set line [mi_execute_to "exec-next-instruction" "end-stepping-range" "main" "" \
- ".*basics.c" "\[0-9\]+" "" "next-instruction at main"]
+ ".*basics.c" "\[0-9\]+" "" "next-instruction at main"]
if { $line >= $line_main_body && $line <= $line_main_hello } {
pass "next-instruction at main, line check"
} else {
}
set line [mi_execute_to "exec-next-instruction" "end-stepping-range" "main" "" \
- ".*basics.c" "\[0-9\]+" "" "next-instruction at main 2"]
+ ".*basics.c" "\[0-9\]+" "" "next-instruction at main 2"]
if { $line >= $line_main_body && $line <= $line_main_hello } {
pass "next-instruction at main 2, line check"
} else {
alarm (1);
sleep (2); /* We'll receive that signal while sleeping */
}
-
# First, verify that the debugger correctly advertises support
# for the "undefined-command" error code...
mi_gdb_test "-list-features" \
- "\\^done,features=\\\[.*\"undefined-command-error-code\".*\\\]" \
- "-list-features should include \"undefined-command-error-code\""
+ "\\^done,features=\\\[.*\"undefined-command-error-code\".*\\\]" \
+ "-list-features should include \"undefined-command-error-code\""
mi_gdb_test "-undefined-command" \
- "\\^error,.*,code=\"undefined-command\"" \
- "error code when executing undefined command"
+ "\\^error,.*,code=\"undefined-command\"" \
+ "error code when executing undefined command"
setup_kfail gdb/2104 "*-*-*"
set line [gdb_get_line_number "after-loop"]
mi_execute_to "exec-until" "end-stepping-range" "foo" "" ".*until.c" $line "" \
- "until after while loop"
+ "until after while loop"
set line [gdb_get_line_number "until-here"]
mi_execute_to "exec-until $line" "location-reached" "foo" "" ".*until.c" $line ""\
- "until line number"
+ "until line number"
set line [gdb_get_line_number "until-there"]
mi_execute_to "exec-until until.c:$line" "location-reached" "foo" "" ".*until.c" $line ""\
- "until line number:file"
+ "until line number:file"
# This is supposed to NOT stop at the return statement, but right
# after foo is over.
set line [gdb_get_line_number "at-return"]
mi_execute_to "exec-until until.c:$line" "location-reached" "main" ""\
".*until.c" "([expr {$line-2}]|[expr {$line-1}])" ""\
- "until after current function"
+ "until after current function"
}
test_running_to_foo
struct {
union {
struct {
- int d;
- char e[10];
- int *(*func) (void);
- efoo foo;
+ int d;
+ char e[10];
+ int *(*func) (void);
+ efoo foo;
} u1s1;
long f;
struct {
- char array_ptr[2];
- int (*func) (int, char *);
+ char array_ptr[2];
+ int (*func) (int, char *);
} u1s2;
} u2;
int foo2;
foo2 = 123;
{
- int foo;
- foo = 321;
+ int foo;
+ foo = 321;
}
foo2 = 0;
}
do_child_deletion ();
exit (0);
}
-
-
{struct_declarations.long_array long_array 12 "long \\[12\\]"}
{struct_declarations.func_ptr func_ptr 0 "void \\(\\*\\)\\((void)?\\)"}
{struct_declarations.func_ptr_struct func_ptr_struct 0 \
- "struct _struct_decl \\(\\*\\)(\\(int, char \\*, long\\))?"}
+ "struct _struct_decl \\(\\*\\)(\\(int, char \\*, long\\))?"}
{struct_declarations.func_ptr_ptr func_ptr_ptr 0 \
- "struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long)?\\)"}
+ "struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long)?\\)"}
{struct_declarations.u1 u1 4 "union \\{\\.\\.\\.\\}"}
{struct_declarations.s2 s2 4 "struct \\{\\.\\.\\.\\}"}
} "get children of struct_declarations"
# Desc: children of struct_declarations.int_ptr_ptr.*int_ptr_ptr
mi_list_varobj_children "struct_declarations.int_ptr_ptr.*int_ptr_ptr" {
{{struct_declarations.int_ptr_ptr.\*int_ptr_ptr.\*\*int_ptr_ptr} \
- {\*\*int_ptr_ptr} 0 int}
+ {\*\*int_ptr_ptr} 0 int}
} "get children of struct_declarations.int_ptr_ptr.*int_ptr_ptr"
# Test: c_variable-4.80
{weird.long_array long_array 12 "long \\[12\\]"}
{weird.func_ptr func_ptr 0 "void \\(\\*\\)\\((void)?\\)"}
{weird.func_ptr_struct func_ptr_struct 0 \
- "struct _struct_decl \\(\\*\\)(\\(int, char \\*, long\\))?"}
+ "struct _struct_decl \\(\\*\\)(\\(int, char \\*, long\\))?"}
{weird.func_ptr_ptr func_ptr_ptr 0 \
- "struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long)?\\)"}
+ "struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long)?\\)"}
{weird.u1 u1 4 "union \\{\\.\\.\\.\\}"}
{weird.s2 s2 4 "struct \\{\\.\\.\\.\\}"}
} "get children of weird"
# Desc: children of *(weird->int_ptr_ptr)
mi_list_varobj_children "weird->int_ptr_ptr.*weird->int_ptr_ptr" {
{{weird->int_ptr_ptr.\*weird->int_ptr_ptr.\*\*weird->int_ptr_ptr} \
- {\*\*weird->int_ptr_ptr} 0 int}
+ {\*\*weird->int_ptr_ptr} 0 int}
} "get children of weird->int_ptr_ptr.*weird->int_ptr_ptr"
# Test: c_variable-4.94
mi_list_varobj_children {struct_declarations --simple-values} \
[list \
- {struct_declarations.integer integer 0 int 123} \
- {struct_declarations.character character 0 char {0 '\\\\000'}} \
- [list struct_declarations.char_ptr char_ptr 1 "char \\*" "$hex \\\\\"hello\\\\\""] \
- {struct_declarations.long_int long_int 0 "long" 0} \
- [list struct_declarations.int_ptr_ptr int_ptr_ptr 1 "int \\*\\*" "$hex"] \
- {struct_declarations.long_array long_array 12 "long \\[12\\]"} \
- [list struct_declarations.func_ptr func_ptr 0 "void \\(\\*\\)\\((void)?\\)" "(@$hex: |)$hex <nothing>"] \
- [list struct_declarations.func_ptr_struct func_ptr_struct 0 \
- "struct _struct_decl \\(\\*\\)(\\(int, char \\*, long\\))?" "$hex <nothing1>"] \
- [list struct_declarations.func_ptr_ptr func_ptr_ptr 0 \
- "struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long)?\\)" "$hex <nothing2>"] \
- {struct_declarations.u1 u1 4 "union \\{\\.\\.\\.\\}"} \
- {struct_declarations.s2 s2 4 "struct \\{\\.\\.\\.\\}"} \
+ {struct_declarations.integer integer 0 int 123} \
+ {struct_declarations.character character 0 char {0 '\\\\000'}} \
+ [list struct_declarations.char_ptr char_ptr 1 "char \\*" "$hex \\\\\"hello\\\\\""] \
+ {struct_declarations.long_int long_int 0 "long" 0} \
+ [list struct_declarations.int_ptr_ptr int_ptr_ptr 1 "int \\*\\*" "$hex"] \
+ {struct_declarations.long_array long_array 12 "long \\[12\\]"} \
+ [list struct_declarations.func_ptr func_ptr 0 "void \\(\\*\\)\\((void)?\\)" "(@$hex: |)$hex <nothing>"] \
+ [list struct_declarations.func_ptr_struct func_ptr_struct 0 \
+ "struct _struct_decl \\(\\*\\)(\\(int, char \\*, long\\))?" "$hex <nothing1>"] \
+ [list struct_declarations.func_ptr_ptr func_ptr_ptr 0 \
+ "struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long)?\\)" "$hex <nothing2>"] \
+ {struct_declarations.u1 u1 4 "union \\{\\.\\.\\.\\}"} \
+ {struct_declarations.s2 s2 4 "struct \\{\\.\\.\\.\\}"} \
] "listing of children, simple types: names, type and values, complex types: names and types"
# Delete all variables
# Desc: children of *(psnp->char_ptr)
mi_list_varobj_children "psnp->char_ptr.*psnp->char_ptr" {
{{psnp->char_ptr.\*psnp->char_ptr.\*\*psnp->char_ptr} \
- {\*\*psnp->char_ptr} 1 {char \*\*}}
+ {\*\*psnp->char_ptr} 1 {char \*\*}}
} "get children of psnp->char_ptr.*psnp->char_ptr"
# Test: c_variable-5.14
# Desc: children of *(*(psnp->char_ptr))
mi_list_varobj_children "psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr" {
{{psnp->char_ptr.\*psnp->char_ptr.\*\*psnp->char_ptr.\*\*\*psnp->char_ptr} \
- {\*\*\*psnp->char_ptr} 1 {char \*}}
+ {\*\*\*psnp->char_ptr} 1 {char \*}}
} "get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr"
# Test: c_variable-5.15B
# Desc: children of *(*(*(psnp->char_ptr)))
mi_list_varobj_children "psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr" {
{{psnp->char_ptr.\*psnp->char_ptr.\*\*psnp->char_ptr.\*\*\*psnp->char_ptr.\*\*\*\*psnp->char_ptr} \
- {\*\*\*\*psnp->char_ptr} 0 char}
+ {\*\*\*\*psnp->char_ptr} 0 char}
} "get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr"
# Test: c_variable-5.16
# Desc: children of *(*(*(psnp->char_ptr)))
mi_list_varobj_children "psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr" {
{{psnp->char_ptr.\*psnp->char_ptr.\*\*psnp->char_ptr.\*\*\*psnp->char_ptr.\*\*\*\*psnp->char_ptr} \
- {\*\*\*\*psnp->char_ptr} 0 char}
+ {\*\*\*\*psnp->char_ptr} 0 char}
} "get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr after counting children"
# Test: c_variable-5.18
# Desc: children of *(*(psnp->long_ptr))
mi_list_varobj_children "psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr" {
{{psnp->long_ptr.\*psnp->long_ptr.\*\*psnp->long_ptr.\*\*\*psnp->long_ptr} \
- {\*\*\*psnp->long_ptr} 1 {long \*}}
+ {\*\*\*psnp->long_ptr} 1 {long \*}}
} "get children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr"
# Test: c_variable-5.25
# Desc: children of *(*(*(psnp->long_ptr)))
mi_list_varobj_children "psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr" {
{{psnp->long_ptr.\*psnp->long_ptr.\*\*psnp->long_ptr.\*\*\*psnp->long_ptr.\*\*\*\*psnp->long_ptr}
- {\*\*\*\*psnp->long_ptr} 0 {long}}
+ {\*\*\*\*psnp->long_ptr} 0 {long}}
} "get children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr"
# Test: c_variable-5.27
# Desc: children of **psnp->ptrs[0]->next->char_ptr
mi_list_varobj_children "psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr" {
{{psnp->ptrs.0.next.char_ptr.\*char_ptr.\*\*char_ptr.\*\*\*char_ptr} \
- {\*\*\*char_ptr} 1 {char \*}}
+ {\*\*\*char_ptr} 1 {char \*}}
} "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr"
# Test: c_variable-5.41B
# Desc: children of ***psnp->ptrs[0]->next->char_ptr
mi_list_varobj_children "psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" {
{{psnp->ptrs.0.next.char_ptr.\*char_ptr.\*\*char_ptr.\*\*\*char_ptr.\*\*\*\*char_ptr} \
- {\*\*\*\*char_ptr} 0 char}
+ {\*\*\*\*char_ptr} 0 char}
} "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr"
# Test: c_variable-5.42
# Desc: children of ***psnp->ptrs[0]->next->char_ptr
mi_list_varobj_children "psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" {
{{psnp->ptrs.0.next.char_ptr.\*char_ptr.\*\*char_ptr.\*\*\*char_ptr.\*\*\*\*char_ptr} \
- {\*\*\*\*char_ptr} 0 char}
+ {\*\*\*\*char_ptr} 0 char}
} "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr after counting children"
# Test: c_variable-5.44
proc set_frozen {varobjs flag} {
foreach v $varobjs {
- mi_gdb_test "-var-set-frozen $v $flag" \
- "\\^done" \
- "-var-set-frozen $v $flag"
+ mi_gdb_test "-var-set-frozen $v $flag" \
+ "\\^done" \
+ "-var-set-frozen $v $flag"
}
}
/*: mi_create_varobj IP ip "create varobj for ip"
mi_list_varobj_children IP {{IP.\\*ip \\*ip 0 int}} "list children of IP"
mi_gdb_test "-var-info-path-expression IP.*ip" \
- "\\^done,path_expr=\"\\*\\(ip\\)\"" \
+ "\\^done,path_expr=\"\\*\\(ip\\)\"" \
"-var-info-path-expression IP.*ip"
:*/
Derived d;
{DP.Base2 Base2 1 Base2} \
{DP.public public 1}} "list children of DP"
mi_gdb_test "-var-info-path-expression DP.Base1" \
- "\\^done,path_expr=\"\\(\\*\\(class Base1\\*\\) dp\\)\"" \
+ "\\^done,path_expr=\"\\(\\*\\(class Base1\\*\\) dp\\)\"" \
"-var-info-path-expression DP.Base1"
mi_list_varobj_children DP.public { \
- {DP.public.i i 0 int} \
+ {DP.public.i i 0 int} \
} "list children of DP.public"
mi_gdb_test "-var-info-path-expression DP.public.i" \
- "\\^done,path_expr=\"\\(\\(dp\\)->i\\)\"" \
+ "\\^done,path_expr=\"\\(\\(dp\\)->i\\)\"" \
"-var-info-path-expression DP.public.i"
mi_list_varobj_children DP.Base1 { \
- {DP.Base1.public public 1} \
+ {DP.Base1.public public 1} \
} "list children of DP.Base1"
mi_list_varobj_children DP.Base1.public { \
- {DP.Base1.public.i i 0 int} \
+ {DP.Base1.public.i i 0 int} \
} "list children of DP.Base1.public"
mi_gdb_test "-var-info-path-expression DP.Base1.public.i" \
- "\\^done,path_expr=\"\\(\\(\\(\\*\\(class Base1\\*\\) dp\\)\\).i\\)\"" \
+ "\\^done,path_expr=\"\\(\\(\\(\\*\\(class Base1\\*\\) dp\\)\\).i\\)\"" \
"-var-info-path-expression DP.Base1.public.i"
mi_gdb_test "-var-info-path-expression DP.public" \
- "\\^done,path_expr=\"\"" \
+ "\\^done,path_expr=\"\"" \
"-var-info-path-expression DP.public"
mi_create_varobj D d "create varobj for d"
{D.Base2 Base2 1 Base2} \
{D.public public 1}} "list children of D"
mi_gdb_test "-var-info-path-expression D.Base1" \
- "\\^done,path_expr=\"\\(\\(class Base1\\) d\\)\"" \
+ "\\^done,path_expr=\"\\(\\(class Base1\\) d\\)\"" \
"-var-info-path-expression D.Base1"
:*/
int array[4] = {1,2,3};
array[3] = 10;
/*: mi_create_varobj A array "create varobj for array"
mi_list_varobj_children A { \
- {A.0 0 0 int}
- {A.1 1 0 int}
- {A.2 2 0 int}
- {A.3 3 0 int}} "list children of A"
+ {A.0 0 0 int}
+ {A.1 1 0 int}
+ {A.2 2 0 int}
+ {A.3 3 0 int}} "list children of A"
mi_gdb_test "-var-info-path-expression A.2" \
- "\\^done,path_expr=\"\\(array\\)\\\[2\\\]\"" \
+ "\\^done,path_expr=\"\\(array\\)\\\[2\\\]\"" \
"-var-info-path-expression A.2"
:*/
struct { /* index: 1 */
int e;
struct { /* index: 0 */
- int f;
- union { /* index: 0 */
- int g;
- char h;
- };
+ int f;
+ union { /* index: 0 */
+ int g;
+ char h;
+ };
};
union { /* index: 0 */
- int i;
- char j;
+ int i;
+ char j;
};
};
};
Anonymous a {
{} public {
anonymous struct {
- {} public {
- int b {}
- }
+ {} public {
+ int b {}
+ }
}
anonymous struct {
- {} public {
- int c {}
- }
+ {} public {
+ int c {}
+ }
}
anonymous struct {
- {} public {
- int d {}
- anonymous struct {
- {} public {
- int e {}
- anonymous struct {
- {} public {
- int f {}
- anonymous union {
- {} public {
- int g {}
- char h {}
- }
- }
- }
- }
+ {} public {
+ int d {}
+ anonymous struct {
+ {} public {
+ int e {}
+ anonymous struct {
+ {} public {
+ int f {}
+ anonymous union {
+ {} public {
+ int g {}
+ char h {}
+ }
+ }
+ }
+ }
anonymous union {
{} public {
int i {}
mi_create_varobj weird weird "create local variable weird"
mi_list_varobj_children weird {
- {weird.integer integer 0 int}
- {weird.character character 0 char}
- {weird.char_ptr char_ptr 1 "char \\*"}
- {weird.long_int long_int 0 "long"}
- {weird.int_ptr_ptr int_ptr_ptr 1 "int \\*\\*"}
- {weird.long_array long_array 10 "long \\[10\\]"}
- {weird.func_ptr func_ptr 0 "void \\(\\*\\)\\((void)?\\)"}
- {weird.func_ptr_struct func_ptr_struct 0 \
- "struct _struct_decl \\(\\*\\)(\\(int, char \\*, long\\))?"}
- {weird.func_ptr_ptr func_ptr_ptr 0 \
- "struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long)?\\)"}
- {weird.u1 u1 4 "union \\{\\.\\.\\.\\}"}
- {weird.s2 s2 4 "struct \\{\\.\\.\\.\\}"}
+ {weird.integer integer 0 int}
+ {weird.character character 0 char}
+ {weird.char_ptr char_ptr 1 "char \\*"}
+ {weird.long_int long_int 0 "long"}
+ {weird.int_ptr_ptr int_ptr_ptr 1 "int \\*\\*"}
+ {weird.long_array long_array 10 "long \\[10\\]"}
+ {weird.func_ptr func_ptr 0 "void \\(\\*\\)\\((void)?\\)"}
+ {weird.func_ptr_struct func_ptr_struct 0 \
+ "struct _struct_decl \\(\\*\\)(\\(int, char \\*, long\\))?"}
+ {weird.func_ptr_ptr func_ptr_ptr 0 \
+ "struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long)?\\)"}
+ {weird.u1 u1 4 "union \\{\\.\\.\\.\\}"}
+ {weird.s2 s2 4 "struct \\{\\.\\.\\.\\}"}
} "get children local variable weird"
# Test: c_variable-7.15
# Desc: children of u
mi_list_varobj_children u {
- {u.integer integer 0 int}
- {u.char_ptr char_ptr 1 {char \*}}
+ {u.integer integer 0 int}
+ {u.char_ptr char_ptr 1 {char \*}}
} "get children of u"
# Test: c_variable-7.20
# Test: c_variable-7.25
# Desc: children of anonu
mi_list_varobj_children "anonu" {
- {anonu.a a 0 int}
- {anonu.b b 0 char}
- {anonu.c c 0 "long"}
+ {anonu.a a 0 int}
+ {anonu.b b 0 char}
+ {anonu.c c 0 "long"}
} "get children of anonu"
# Test: c_variable-7.30
# Test: c_variable-7.35
# Desc: children of s
mi_list_varobj_children s {
- {s.integer integer 0 int}
- {s.unsigned_integer unsigned_integer 0 "unsigned int"}
- {s.character character 0 char}
- {s.signed_character signed_character 0 "signed char"}
- {s.char_ptr char_ptr 1 {char \*}}
- {s.array_of_10 array_of_10 10 {int \[10\]}}
+ {s.integer integer 0 int}
+ {s.unsigned_integer unsigned_integer 0 "unsigned int"}
+ {s.character character 0 char}
+ {s.signed_character signed_character 0 "signed char"}
+ {s.char_ptr char_ptr 1 {char \*}}
+ {s.array_of_10 array_of_10 10 {int \[10\]}}
} "get children of s"
#} {integer unsigned_integer character signed_character char_ptr array_of_10}
# Test: c_variable-7.45
# Desc: children of anons
mi_list_varobj_children anons {
- {anons.a a 0 int}
- {anons.b b 0 char}
- {anons.c c 0 "long"}
+ {anons.a a 0 int}
+ {anons.b b 0 char}
+ {anons.c c 0 "long"}
} "get children of anons"
# Test: c_variable-7.50
mi_gdb_test "-var-update var1" "\\^done,changelist=\\\[{name=\"var1\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"},{name=\"var1.inner\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"}\\\]" "update variable object"
mi_gdb_test "-var-list-children var1" "\\^done,numchild=\"1\",children=\\\[child={name=\"var1.inner\",exp=\"inner\",numchild=\"1\",type=\"struct inner \\*\",thread-id=\"1\"}\\\],has_more=\"0\"" "list children #2"
-
ptr = &d;
s.ptr = &d;
/*:
- with_test_prefix "ptr points at d" {
+ with_test_prefix "ptr points at d" {
mi_varobj_update PTR {PTR PTR.public.A} \
"update ptr to derived type in $testname"
check_derived_without_rtti PTR ptr $testname
ptr = 0;
s.ptr = 0;
/*:
- with_test_prefix "ptr is nullptr again" {
+ with_test_prefix "ptr is nullptr again" {
mi_varobj_update PTR {PTR PTR.public.A} \
"update ptr back to base type in $testname"
mi_delete_varobj PTR "delete varobj for ptr in $testname"
proc set_print_object {state testname} {
mi_gdb_test "-interpreter-exec console \"set print object ${state}\"" \
"(.*=cmd-param-changed,param=\"print object\",value=\"${state}\".*|)\\^done" \
- "-interpreter-exec console \"set print object ${state}\" in $testname"
+ "-interpreter-exec console \"set print object ${state}\" in $testname"
}
proc check_derived_children_without_rtti {varobj_name var_name testname} {
mi_list_varobj_children ${varobj_name} "
- { ${varobj_name}.public public 1 }
+ { ${varobj_name}.public public 1 }
" "list children of ${var_name} (without RTTI) in $testname"
mi_list_varobj_children "${varobj_name}.public" "
- { ${varobj_name}.public.A A 0 int }
+ { ${varobj_name}.public.A A 0 int }
" "list children of ${var_name}.public (without RTTI) in $testname"
}
proc check_derived_content_without_rtti {varobj_name var_name testname} {
mi_check_varobj_value ${varobj_name}.public.A 1 \
- "check ${var_name}->A (without RTTI) in $testname"
+ "check ${var_name}->A (without RTTI) in $testname"
}
proc check_derived_without_rtti {varobj_name var_name testname} {
proc check_new_derived_without_rtti {var_name var_type testname} {
set varobj_name VAR
mi_create_varobj_checked ${varobj_name} ${var_name} ${var_type} \
- "create varobj for ${var_name} (without RTTI) in ${testname}"
+ "create varobj for ${var_name} (without RTTI) in ${testname}"
check_derived_without_rtti ${varobj_name} ${var_name} ${testname}
mi_delete_varobj ${varobj_name} \
- "delete varobj for ${var_name} (without RTTI) in ${testname}"
+ "delete varobj for ${var_name} (without RTTI) in ${testname}"
}
proc check_derived_children_with_rtti {varobj_name var_name testname} {
mi_list_varobj_children ${varobj_name} "
- { ${varobj_name}.Base Base 1 Base }
- { ${varobj_name}.public public 2 }
+ { ${varobj_name}.Base Base 1 Base }
+ { ${varobj_name}.public public 2 }
" "list children of ${var_name} (with RTTI) in $testname"
mi_list_varobj_children "${varobj_name}.Base" "
- { ${varobj_name}.Base.public public 1 }
+ { ${varobj_name}.Base.public public 1 }
" "list children of ${var_name}.Base (with RTTI) in $testname"
mi_list_varobj_children "${varobj_name}.Base.public" "
- { ${varobj_name}.Base.public.A A 0 int }
+ { ${varobj_name}.Base.public.A A 0 int }
" "list children of ${var_name}.Base.public (with RTTI) in $testname"
mi_list_varobj_children "${varobj_name}.public" "
- { ${varobj_name}.public.B B 0 int }
- { ${varobj_name}.public.C C 0 int }
+ { ${varobj_name}.public.B B 0 int }
+ { ${varobj_name}.public.C C 0 int }
" "list children of ${var_name}.public (with RTTI) in $testname"
}
proc check_derived_content_with_rtti {varobj_name var_name testname} {
mi_check_varobj_value ${varobj_name}.Base.public.A 1 \
- "check ${var_name}->A (with RTTI) in $testname"
+ "check ${var_name}->A (with RTTI) in $testname"
mi_check_varobj_value ${varobj_name}.public.B 2 \
- "check ${var_name}->B (with RTTI) in $testname"
+ "check ${var_name}->B (with RTTI) in $testname"
mi_check_varobj_value ${varobj_name}.public.C 3 \
- "check ${var_name}->C (with RTTI) in $testname"
+ "check ${var_name}->C (with RTTI) in $testname"
}
proc check_derived_with_rtti {varobj_name var_name testname} {
proc check_new_derived_with_rtti {var_name var_type testname} {
set varobj_name VAR
mi_create_varobj_checked ${varobj_name} ${var_name} ${var_type} \
- "create varobj for ${var_name} (with RTTI) in $testname"
+ "create varobj for ${var_name} (with RTTI) in $testname"
check_derived_with_rtti ${varobj_name} ${var_name} $testname
mi_delete_varobj ${varobj_name} \
- "delete varobj for ${var_name} (with RTTI) in $testname"
+ "delete varobj for ${var_name} (with RTTI) in $testname"
}
set inline_tests {
standard_testfile vla.c
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" \
- "${binfile}" executable {debug}] != "" } {
+ "${binfile}" executable {debug}] != "" } {
untested "failed to compile"
return -1
}
mi_run_cmd
mi_expect_stop "breakpoint-hit" "func" "\{name=\"n\",value=\"5\"\}" \
- ".*vla.c" "$bp_lineno" { "" "disp=\"del\"" } \
- "run to breakpoint at line $bp_lineno"
+ ".*vla.c" "$bp_lineno" { "" "disp=\"del\"" } \
+ "run to breakpoint at line $bp_lineno"
mi_gdb_test "500-data-evaluate-expression vla" \
"500\\^done,value=\"\\{0, 1, 2, 3, 4\\}\"" "evaluate complete vla"
"503\\^done,value=\"4\"" "evaluate vla\[4\]"
mi_create_varobj_checked vla vla "int \\\[5\\\]" \
- "create local variable vla"
+ "create local variable vla"
mi_gdb_test "504-var-info-type vla" \
"504\\^done,type=\"int \\\[5\\\]\"" \
# -break-list
mi_gdb_test "111-break-watch C" \
- "111\\^done,wpt=\{number=\"2\",exp=\"C\"\}" \
- "break-watch operation"
+ "111\\^done,wpt=\{number=\"2\",exp=\"C\"\}" \
+ "break-watch operation"
mi_gdb_test "222-break-list" \
"222\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"2\",type=\".*watchpoint\",disp=\"keep\",enabled=\"y\",what=\"C\",thread-groups=\\\[\"i1\"\\\],times=\"0\",original-location=\"C\"\}\\\]\}" \
- "list of watchpoints"
+ "list of watchpoints"
}
# -break-list
mi_gdb_test "333-break-watch -a A" \
- "333\\^done,bkpt=\{number=\"1\",addr=\"$hex\",file=\".*basics.c\",line=\"$line_main_body\"\}" \
- "break-watch -a operation"
+ "333\\^done,bkpt=\{number=\"1\",addr=\"$hex\",file=\".*basics.c\",line=\"$line_main_body\"\}" \
+ "break-watch -a operation"
mi_gdb_test "444-break-list" \
"444\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"3\",type=\"watchpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",thread-groups=\\\[\"i1\"\\\],times=\"0\"\},.*\}\\\]\}" \
- "list of watchpoints awatch"
+ "list of watchpoints awatch"
mi_gdb_test "777-break-delete 3" \
"777\\^done" \
# -break-list
mi_gdb_test "200-break-watch -r C" \
- "200\\^done,bkpt=\{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"$line_main_body\",times=\"0\"\}" \
- "break-watch -r operation"
+ "200\\^done,bkpt=\{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"$line_main_body\",times=\"0\"\}" \
+ "break-watch -r operation"
mi_gdb_test "300-break-list" \
"300\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",thread-groups=\\\[\"i1\"\\\],times=\"0\"\},.*\}\\\}\}" \
- "list of breakpoints"
+ "list of breakpoints"
mi_gdb_test "177-break-delete 4" \
"177\\^done" \
# -exec-continue (Here wp goes out of scope)
mi_execute_to "exec-continue" "watchpoint-trigger" "callee4" "" \
- ".*basics.c" $line_callee4_return_0 \
- {"" "wpt=\{number=\"2\",exp=\"C\"\},value=\{old=\".*\",new=\"3\"\}"} \
- "watchpoint trigger"
+ ".*basics.c" $line_callee4_return_0 \
+ {"" "wpt=\{number=\"2\",exp=\"C\"\},value=\{old=\".*\",new=\"3\"\}"} \
+ "watchpoint trigger"
mi_execute_to "exec-continue" "watchpoint-scope" "callee3" ".*" \
- ".*basics.c" $line_callee3_close_brace \
- {"" "wpnum=\"2\""} \
- "watchpoint scope"
+ ".*basics.c" $line_callee3_close_brace \
+ {"" "wpnum=\"2\""} \
+ "watchpoint scope"
}
proc test_watchpoint_all {mi_mode type} {
{struct_declarations.long_array long_array 10 "long \\[10\\]"}
{struct_declarations.func_ptr func_ptr 0 "void \\(\\*\\)\\((void)?\\)"}
{struct_declarations.func_ptr_struct func_ptr_struct 0 \
- "struct _struct_decl \\(\\*\\)(\\(int, char \\*, long\\))?"}
+ "struct _struct_decl \\(\\*\\)(\\(int, char \\*, long\\))?"}
{struct_declarations.func_ptr_ptr func_ptr_ptr 0 \
- "struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long)?\\)"}
+ "struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long)?\\)"}
{struct_declarations.u1 u1 4 "union \\{\\.\\.\\.\\}"}
{struct_declarations.s2 s2 4 "struct \\{\\.\\.\\.\\}"}
} "get children of struct_declarations"
# Desc: children of struct_declarations.int_ptr_ptr.*int_ptr_ptr
mi_list_varobj_children "struct_declarations.int_ptr_ptr.*int_ptr_ptr" {
{{struct_declarations.int_ptr_ptr.\*int_ptr_ptr.\*\*int_ptr_ptr} \
- {\*\*int_ptr_ptr} 0 int}
+ {\*\*int_ptr_ptr} 0 int}
} "get children of struct_declarations.int_ptr_ptr.*int_ptr_ptr"
# Test: c_variable-4.80
{weird.long_array long_array 10 "long \\[10\\]"}
{weird.func_ptr func_ptr 0 "void \\(\\*\\)\\((void)?\\)"}
{weird.func_ptr_struct func_ptr_struct 0 \
- "struct _struct_decl \\(\\*\\)(\\(int, char \\*, long\\))?"}
+ "struct _struct_decl \\(\\*\\)(\\(int, char \\*, long\\))?"}
{weird.func_ptr_ptr func_ptr_ptr 0 \
- "struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long)?\\)"}
+ "struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long)?\\)"}
{weird.u1 u1 4 "union \\{\\.\\.\\.\\}"}
{weird.s2 s2 4 "struct \\{\\.\\.\\.\\}"}
} "get children of weird"
# Desc: children of *(weird->int_ptr_ptr)
mi_list_varobj_children "weird->int_ptr_ptr.*weird->int_ptr_ptr" {
{{weird->int_ptr_ptr.\*weird->int_ptr_ptr.\*\*weird->int_ptr_ptr} \
- {\*\*weird->int_ptr_ptr} 0 int}
+ {\*\*weird->int_ptr_ptr} 0 int}
} "get children of weird->int_ptr_ptr.*weird->int_ptr_ptr"
# Test: c_variable-4.94
# Desc: children of *(psnp->char_ptr)
mi_list_varobj_children "psnp->char_ptr.*psnp->char_ptr" {
{{psnp->char_ptr.\*psnp->char_ptr.\*\*psnp->char_ptr} \
- {\*\*psnp->char_ptr} 1 {char \*\*}}
+ {\*\*psnp->char_ptr} 1 {char \*\*}}
} "get children of psnp->char_ptr.*psnp->char_ptr"
# Test: c_variable-5.14
# Desc: children of *(*(psnp->char_ptr))
mi_list_varobj_children "psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr" {
{{psnp->char_ptr.\*psnp->char_ptr.\*\*psnp->char_ptr.\*\*\*psnp->char_ptr} \
- {\*\*\*psnp->char_ptr} 1 {char \*}}
+ {\*\*\*psnp->char_ptr} 1 {char \*}}
} "get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr"
# Test: c_variable-5.15B
# Desc: children of *(*(*(psnp->char_ptr)))
mi_list_varobj_children "psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr" {
{{psnp->char_ptr.\*psnp->char_ptr.\*\*psnp->char_ptr.\*\*\*psnp->char_ptr.\*\*\*\*psnp->char_ptr} \
- {\*\*\*\*psnp->char_ptr} 0 char}
+ {\*\*\*\*psnp->char_ptr} 0 char}
} "get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr"
# Test: c_variable-5.16
# Desc: children of *(*(*(psnp->char_ptr)))
mi_list_varobj_children "psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr" {
{{psnp->char_ptr.\*psnp->char_ptr.\*\*psnp->char_ptr.\*\*\*psnp->char_ptr.\*\*\*\*psnp->char_ptr} \
- {\*\*\*\*psnp->char_ptr} 0 char}
+ {\*\*\*\*psnp->char_ptr} 0 char}
} "get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr after counting children"
# Test: c_variable-5.18
# Desc: children of *(*(psnp->long_ptr))
mi_list_varobj_children "psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr" {
{{psnp->long_ptr.\*psnp->long_ptr.\*\*psnp->long_ptr.\*\*\*psnp->long_ptr} \
- {\*\*\*psnp->long_ptr} 1 {long \*}}
+ {\*\*\*psnp->long_ptr} 1 {long \*}}
} "get children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr"
# Test: c_variable-5.25
# Desc: children of *(*(*(psnp->long_ptr)))
mi_list_varobj_children "psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr" {
{{psnp->long_ptr.\*psnp->long_ptr.\*\*psnp->long_ptr.\*\*\*psnp->long_ptr.\*\*\*\*psnp->long_ptr}
- {\*\*\*\*psnp->long_ptr} 0 {long}}
+ {\*\*\*\*psnp->long_ptr} 0 {long}}
} "get children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr"
# Test: c_variable-5.27
# Desc: children of **psnp->ptrs[0]->next->char_ptr
mi_list_varobj_children "psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr" {
{{psnp->ptrs.0.next.char_ptr.\*char_ptr.\*\*char_ptr.\*\*\*char_ptr} \
- {\*\*\*char_ptr} 1 {char \*}}
+ {\*\*\*char_ptr} 1 {char \*}}
} "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr"
# Test: c_variable-5.41B
# Desc: children of ***psnp->ptrs[0]->next->char_ptr
mi_list_varobj_children "psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" {
{{psnp->ptrs.0.next.char_ptr.\*char_ptr.\*\*char_ptr.\*\*\*char_ptr.\*\*\*\*char_ptr} \
- {\*\*\*\*char_ptr} 0 char}
+ {\*\*\*\*char_ptr} 0 char}
} "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr"
# Test: c_variable-5.42
# Desc: children of ***psnp->ptrs[0]->next->char_ptr
mi_list_varobj_children "psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" {
{{psnp->ptrs.0.next.char_ptr.\*char_ptr.\*\*char_ptr.\*\*\*char_ptr.\*\*\*\*char_ptr} \
- {\*\*\*\*char_ptr} 0 char}
+ {\*\*\*\*char_ptr} 0 char}
} "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr after counting children"
# Test: c_variable-5.44
}
{union u_ab} u1 {
{struct s_a} a {
- int a {}
+ int a {}
}
{struct s_b} b {
- int b {}
+ int b {}
}
}
anonymous union {
{struct s_a} a2 {
- int a {}
+ int a {}
}
{struct s_b} b2 {
- int b {}
+ int b {}
}
}
{union {...}} u2 {
{struct s_a} a3 {
- int a {}
+ int a {}
}
{struct s_b} b3 {
- int b {}
+ int b {}
}
}
}
{
args[i] = 1;
res = pthread_create(&threads[i - 1],
- NULL,
+ NULL,
thread_function,
(void *) i);
}
printf ("hello\n");
return 0;
}
-
foreach_with_prefix ui_to_run {first second} {
do_test $ui_to_run
}
-
# details.
proc make_cli_in_mi_re { command cli_in_mi_mode mode event inf cli_thread
- mi_thread frame } {
+ mi_thread frame } {
global srcfile
global thread_loop_line
global main_break_line
struct {
union {
struct {
- int d;
- char e[10];
- int *(*func) (void);
- efoo foo;
+ int d;
+ char e[10];
+ int *(*func) (void);
+ efoo foo;
} u1s1;
long f;
struct {
- char array_ptr[2];
- int (*func) (int, char *);
+ char array_ptr[2];
+ int (*func) (int, char *);
} u1s2;
} u2;
int foo2;
foo2 = 123;
{
- int foo;
- foo = 321;
+ int foo;
+ foo = 321;
}
foo2 = 0;
}
/* Accessing a value of a bitfield whose type is a typed used to
result in division by zero. See:
- http://sourceware.org/bugzilla/show_bug.cgi?id=10884
+ http://sourceware.org/bugzilla/show_bug.cgi?id=10884
This tests for this bug. */
/*:
mi_create_varobj V d "create varobj for Data"
mi_list_varobj_children "V" {
- {"V.alloc" "alloc" "0" "int"}
- {"V.sharable" "sharable" "0" "uint_for_mi_testing"}
+ {"V.alloc" "alloc" "0" "int"}
+ {"V.sharable" "sharable" "0" "uint_for_mi_testing"}
} "list children of Data"
mi_check_varobj_value V.sharable 3 "access bitfield"
:*/
do_nested_struct_union_tests ();
exit (0);
}
-
-
printf ("foll-exec is about to execl(crashme)...\n");
execl (prog,
- prog,
- (char *)0);
+ prog,
+ (char *)0);
}
pthread_barrier_wait (&barrier);
execl (prog,
- prog,
- (char *) NULL);
+ prog,
+ (char *) NULL);
perror ("execl failed");
exit (1);
}
}
proc do_test { first_arch mode selected_thread } {
- global bkptno_numopt_re
+ global bkptno_numopt_re
set from_exec "$first_arch-multi-arch-exec"
clean_restart ${from_exec}
gdb_test "po self" \
"BasicClass gdb test object" \
"use of the po (print-object) command"
-
-
-re "Breakpoint \[0-9\]+ at 0x\[0-9a-f\]+.*$gdb_prompt $" { pass $name }
-re ".*$gdb_prompt $" { kfail "gdb/1236" $name }
}
-
-re "\\\$$decimal = <optimized out>\r\n$gdb_prompt $" { pass "print operand1"}
-re "$hex\r\n$gdb_prompt $" { gdb_test "print *operand1" "14" "print operand1" }
}
-
standard_testfile
if { [prepare_for_testing "failed to prepare" $testfile $srcfile \
- {debug additional_flags=-Winline}] } {
+ {debug additional_flags=-Winline}] } {
return -1
}
else
writeln('check OK');
end.
-
gdb_test "print char_array" " = '2345X789'"
}
gdb_exit
-
Writeln('integer array, index 5 is ',integer_array[5]);
Writeln('char array, index 5 is ',char_array[5]);
end.
-
}
gdb_test "cont" \
- "Breakpoint .*:${bp_location1}.*" \
- "Going to first breakpoint"
+ "Breakpoint .*:${bp_location1}.*" \
+ "Going to first breakpoint"
gdb_test "print st" \
".* = ''.*" \
"empty string check"
procedure print_hello;
begin
Writeln('Before assignment'); { set breakpoint 1 here }
- st:='Hello, world!';
+ st:='Hello, world!';
writeln(st); {set breakpoint 2 here }
end;
begin
print_hello;
-end.
+end.
void *addr;
int pgsize = sysconf(_SC_PAGE_SIZE);
addr = mmap (NULL, pgsize, PROT_EXEC | PROT_READ | PROT_WRITE,
- MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+ MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (addr == MAP_FAILED)
perror ("mmap");
}
gdb_test "python print (block.end)" "${decimal}" "check end not None"
gdb_test "python print (block\['f'\].name == 'f')" "True" "check variable access"
gdb_test "python print (block\['nonexistent'\])" ".*KeyError.*: 'nonexistent'.*" \
- "check nonexistent variable"
+ "check nonexistent variable"
gdb_test "python print (block\[42\])" ".*TypeError.*: Expected a string.*" \
- "check non-string key"
+ "check non-string key"
# Test global/static blocks
gdb_py_test_silent_cmd "python frame = gdb.selected_frame()" "Get Frame" 0
gdb_test "python print (block.function)" "None" "second anonymous block"
gdb_test_no_output "python block = block.superblock" "get superblock 2"
gdb_test "python print (block.function)" "block_func" \
- "Print superblock 2 function"
+ "Print superblock 2 function"
# Switch frames, then test block for no_locals_func.
gdb_test "continue" ".*" "continue to no_locals_func breakpoint"
gdb_py_test_silent_cmd "python frame = gdb.selected_frame()" "Get Frame 2" 0
gdb_py_test_silent_cmd "python block = frame.block()" "Get Frame 2's block" 0
gdb_test "python print (repr (block))" "<gdb.Block main \{.*\}>" \
- "Check Frame 2's block not None"
+ "Check Frame 2's block not None"
gdb_test "python print (block.function)" "main" "main block"
# Test Block is_valid. This must always be the last test in this
gdb_py_test_silent_cmd "python block = frame.block()" "Get Frame block" 0
gdb_py_test_silent_cmd "python block_iter = iter (block)" "Get Frame block" 0
gdb_test "python print (block.is_valid())" "True" \
- "Check block validity"
+ "Check block validity"
gdb_test "python print (block_iter.is_valid())" "True" \
- "Check block_iter validity"
+ "Check block_iter validity"
gdb_test_no_output "python x = hash(block)" "block is hashable"
gdb_test "python print (type (x))" "<class 'int'>" "block hash is integer"
gdb_unload
gdb_test "python print (block.is_valid())" "False" \
- "Check block validity after unload"
+ "Check block validity after unload"
gdb_test "python print (block_iter.is_valid())" "False" \
- "Check block_iter validity after unload"
+ "Check block_iter validity after unload"
gdb_test "python print (hash (block) == x)" "True" \
"block hash did not change"
set test "continuing to foo"
gdb_test_multiple "continue" "$test" {
-re "MyBP\.stop was invoked\!.*$gdb_prompt $" {
- fail "$test"
+ fail "$test"
}
-re "Continuing.*Breakpoint 2, foo.*$gdb_prompt $" {
- pass "$test"
+ pass "$test"
}
}
set pyfile [gdb_remote_download host ${srcdir}/${subdir}/py-disasm.py]
gdb_test "source ${pyfile}" "Python script imported" \
- "import python scripts"
+ "import python scripts"
set line [gdb_get_line_number "Break here."]
void do_nothing (void) {}
-
gdb_run_cmd
gdb_test_multiple "" "signal Thread 3" {
-re "event type: stop\r\nstop reason: signal\r\nstop signal: SIGUSR1\r\nthread num: 3\r\nevent type: stop\r\n.*$gdb_prompt $" {
- pass "thread 3 was signaled"
+ pass "thread 3 was signaled"
}
-re "The target does not support running in non-stop mode" {
- unsupported "non-stop mode is unsupported"
+ unsupported "non-stop mode is unsupported"
}
}
set test "run to breakpoint 1"
gdb_test_multiple "" $test {
-re "event type: stop\r\nstop reason: breakpoint\r\nfirst breakpoint number: 1\r\nbreakpoint number: 1\r\nthread num: 1\r\n.*$gdb_prompt $" {
- pass $test
+ pass $test
}
-re "The target does not support running in non-stop mode" {
- unsupported "non-stop mode is unsupported"
- return
+ unsupported "non-stop mode is unsupported"
+ return
}
}
gdb_test_multiple "continue&" $test {
-re "event type: continue\r\nthread num: 3\r\n$gdb_prompt " {
# This expect string must not expect the end-of-buffer '$'.
- pass $test
+ pass $test
}
}
set test "thread 3 was signaled"
gdb_test_multiple "" $test {
-re "event type: stop\r\nstop reason: signal\r\nstop signal: SIGUSR1\r\nthread num: 3\r\nevent type: stop\r\n" {
- pass $test
+ pass $test
}
}
gdb_test_multiple "explore int_ptr_ref" "" {
-re "$int_ptr_ref_desc.*Continue exploring it as a pointer to a single value \\\[y/n\\\]:.*" {
- pass "explore int_ptr_ref"
- gdb_test_multiple "y" "explore_int_ptr_ref_as_single_value_pointer" {
- -re "'\[*\]int_ptr_ref' is a scalar value of type 'int'.*\[*\]int_ptr_ref = 10.*$gdb_prompt" {
- pass "explore_int_ptr_ref_as_single_value_pointer"
- }
- }
+ pass "explore int_ptr_ref"
+ gdb_test_multiple "y" "explore_int_ptr_ref_as_single_value_pointer" {
+ -re "'\[*\]int_ptr_ref' is a scalar value of type 'int'.*\[*\]int_ptr_ref = 10.*$gdb_prompt" {
+ pass "explore_int_ptr_ref_as_single_value_pointer"
+ }
+ }
}
}
gdb_test_multiple "explore b" "" {
-re "$b_desc.*Enter the field number of choice:.*" {
- pass "explore b"
- gdb_test_multiple "0" "explore_base_class_A" {
- -re "The value of 'b\.A' is a struct/class of type 'A' with no fields\." {
- pass "explore_base_class_A, exploring b"
- gdb_test_multiple "\0" "return_to_b_from_A" {
- -re ".*$b_desc.*Enter the field number of choice:.*" {
- pass "return_to_b_from_A"
- gdb_test_multiple "1" "explore_field_i_of_b" {
- -re "'b\.i' is a scalar value of type 'int'.*b\.i = 10.*" {
- pass "explore_field_i_of_b"
- gdb_test_multiple "\0" "return_to_b_from_i" {
- -re "$b_desc.*Enter the field number of choice:.*" {
- pass "return_to_b_from_i"
- }
- }
- }
- }
- gdb_test_multiple "2" "explore_field_c_of_b" {
- -re "'b\.c' is a scalar value of type 'char'.*b\.c = .*'a'.*" {
- pass "explore_field_c_of_b"
- gdb_test_multiple "\0" "return_to_b_from_c" {
- -re "$b_desc.*Enter the field number of choice:.*" {
- pass "return_to_b_from_c"
- }
- }
- }
- }
- gdb_test_multiple "\0" "return_to_gdb_prompt" {
- -re "$gdb_prompt" {
- pass "return_to_gdb_prompt_from_b"
- }
- }
- }
- }
- }
- }
+ pass "explore b"
+ gdb_test_multiple "0" "explore_base_class_A" {
+ -re "The value of 'b\.A' is a struct/class of type 'A' with no fields\." {
+ pass "explore_base_class_A, exploring b"
+ gdb_test_multiple "\0" "return_to_b_from_A" {
+ -re ".*$b_desc.*Enter the field number of choice:.*" {
+ pass "return_to_b_from_A"
+ gdb_test_multiple "1" "explore_field_i_of_b" {
+ -re "'b\.i' is a scalar value of type 'int'.*b\.i = 10.*" {
+ pass "explore_field_i_of_b"
+ gdb_test_multiple "\0" "return_to_b_from_i" {
+ -re "$b_desc.*Enter the field number of choice:.*" {
+ pass "return_to_b_from_i"
+ }
+ }
+ }
+ }
+ gdb_test_multiple "2" "explore_field_c_of_b" {
+ -re "'b\.c' is a scalar value of type 'char'.*b\.c = .*'a'.*" {
+ pass "explore_field_c_of_b"
+ gdb_test_multiple "\0" "return_to_b_from_c" {
+ -re "$b_desc.*Enter the field number of choice:.*" {
+ pass "return_to_b_from_c"
+ }
+ }
+ }
+ }
+ gdb_test_multiple "\0" "return_to_gdb_prompt" {
+ -re "$gdb_prompt" {
+ pass "return_to_gdb_prompt_from_b"
+ }
+ }
+ }
+ }
+ }
+ }
}
}
gdb_test_multiple "explore B" "" {
-re "$B_desc.*Enter the field number of choice:.*" {
- pass "explore B"
- gdb_test_multiple "0" "explore_base_class_A" {
- -re "base class 'A' of 'B' is a struct/class of type 'A' with no fields\." {
- pass "explore_base_class_A, exploring B"
- gdb_test_multiple "\0" "return_to_B" {
- -re "$B_desc.*Enter the field number of choice:.*" {
- pass "return_to_B"
- gdb_test_multiple "1" "explore_field_i_of_B" {
- -re "field 'i' of 'B' is of a scalar type 'int'.*" {
- pass "explore_field_i_of_B"
- gdb_test_multiple "\0" "return_to_B_from_i" {
- -re "$B_desc.*Enter the field number of choice:.*" {
- pass "return_to_B_from_i, exploring B"
- }
- }
- }
- }
- gdb_test_multiple "2" "explore_field_c_of_B" {
- -re "field 'c' of 'B' is of a scalar type 'char'.*" {
- pass "explore_field_c_of_B"
- gdb_test_multiple "\0" "return_to_B_from_c" {
- -re "$B_desc.*Enter the field number of choice:.*" {
- pass "return_to_B_from_c"
- }
- }
- }
- }
- gdb_test_multiple "\0" "return_to_gdb_prompt" {
- -re "$gdb_prompt" {
- pass "return_to_gdb_prompt_from_B"
- }
- }
- }
- }
- }
- }
+ pass "explore B"
+ gdb_test_multiple "0" "explore_base_class_A" {
+ -re "base class 'A' of 'B' is a struct/class of type 'A' with no fields\." {
+ pass "explore_base_class_A, exploring B"
+ gdb_test_multiple "\0" "return_to_B" {
+ -re "$B_desc.*Enter the field number of choice:.*" {
+ pass "return_to_B"
+ gdb_test_multiple "1" "explore_field_i_of_B" {
+ -re "field 'i' of 'B' is of a scalar type 'int'.*" {
+ pass "explore_field_i_of_B"
+ gdb_test_multiple "\0" "return_to_B_from_i" {
+ -re "$B_desc.*Enter the field number of choice:.*" {
+ pass "return_to_B_from_i, exploring B"
+ }
+ }
+ }
+ }
+ gdb_test_multiple "2" "explore_field_c_of_B" {
+ -re "field 'c' of 'B' is of a scalar type 'char'.*" {
+ pass "explore_field_c_of_B"
+ gdb_test_multiple "\0" "return_to_B_from_c" {
+ -re "$B_desc.*Enter the field number of choice:.*" {
+ pass "return_to_B_from_c"
+ }
+ }
+ }
+ }
+ gdb_test_multiple "\0" "return_to_gdb_prompt" {
+ -re "$gdb_prompt" {
+ pass "return_to_gdb_prompt_from_B"
+ }
+ }
+ }
+ }
+ }
+ }
}
}
proc field_values { args } {
set result ""
foreach field $args {
- set result "$result\[ \]*$field \[\.\]\[\.\] \[\(\]Value of type .*\[\)\]\[\r\n\]+"
+ set result "$result\[ \]*$field \[\.\]\[\.\] \[\(\]Value of type .*\[\)\]\[\r\n\]+"
}
return $result
}
set result ""
set field_num 0
foreach field $args {
- set result "$result$field\[ \]+=\[ \]+<Enter $field_num to explore this field of type .*"
- incr field_num
+ set result "$result$field\[ \]+=\[ \]+<Enter $field_num to explore this field of type .*"
+ incr field_num
}
return $result
}
gdb_test_multiple "explore ss_ptr" "" {
-re "[pointer_description {ss_ptr} $SS].*" {
- pass "explore ss_ptr"
- gdb_test_multiple "y" "explore_as_single_value_pointer" {
- -re "$SS_fields.*$gdb_prompt" {
- pass "explore ss_ptr as single value pointer"
- }
- }
+ pass "explore ss_ptr"
+ gdb_test_multiple "y" "explore_as_single_value_pointer" {
+ -re "$SS_fields.*$gdb_prompt" {
+ pass "explore ss_ptr as single value pointer"
+ }
+ }
}
}
gdb_test_multiple "explore darray_ref" "" {
-re "[pointer_description {darray_ref} {double}].*" {
- pass "explore darray_ref"
- gdb_test_multiple "n" "no_to_explore_as_pointer" {
- -re "Continue exploring it as a pointer to an array \[\[\]y/n\[\]\]: " {
- pass "no_to_explore_as_pointer"
- gdb_test_multiple "y" "explore_as_array" {
- -re ".*Enter the index of the element you want to explore in 'darray_ref':.*" {
- pass "explore_as_array"
- gdb_test_multiple "2" "explore_as_array_index_2" {
- -re ".*'darray_ref\\\[2\\\]' is a scalar value of type 'double'\..*darray_ref\\\[2\\\] = 0.*" {
- pass "explore_as_array_index_2"
- gdb_test_multiple "\0" "end explore_as_array_index_2" {
- -re ".*Returning to parent value.*Enter the index of the element you want to explore in 'darray_ref':.*" {
- pass "end explore_as_array_index_2"
- gdb_test_multiple "\0" "end explore_as_array" {
- -re "\[\n\r\]+$gdb_prompt" {
- pass "end explore_as_array"
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
+ pass "explore darray_ref"
+ gdb_test_multiple "n" "no_to_explore_as_pointer" {
+ -re "Continue exploring it as a pointer to an array \[\[\]y/n\[\]\]: " {
+ pass "no_to_explore_as_pointer"
+ gdb_test_multiple "y" "explore_as_array" {
+ -re ".*Enter the index of the element you want to explore in 'darray_ref':.*" {
+ pass "explore_as_array"
+ gdb_test_multiple "2" "explore_as_array_index_2" {
+ -re ".*'darray_ref\\\[2\\\]' is a scalar value of type 'double'\..*darray_ref\\\[2\\\] = 0.*" {
+ pass "explore_as_array_index_2"
+ gdb_test_multiple "\0" "end explore_as_array_index_2" {
+ -re ".*Returning to parent value.*Enter the index of the element you want to explore in 'darray_ref':.*" {
+ pass "end explore_as_array_index_2"
+ gdb_test_multiple "\0" "end explore_as_array" {
+ -re "\[\n\r\]+$gdb_prompt" {
+ pass "end explore_as_array"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
}
}
gdb_test_multiple "explore su" "" {
-re "[compound_description {su} {union} {union SimpleUnion}].*[field_choices {i} {c} {f} {d}].*$enter_field_number_prompt" {
- pass "explore su"
- gdb_test_multiple "3" "explore su.d" {
- -re "[scalar_description {su.d} {double}].*[scalar_value {su.d} {100[.].*}].*$return_to_parent_prompt" {
- pass "explore su.d"
- gdb_test_multiple " " "end su.d exploration" {
- -re ".*[compound_description {su} {union} {union SimpleUnion}].*[field_choices {i} {c} {f} {d}].*$enter_field_number_prompt" {
- pass "end su.d exploration"
- gdb_test_multiple "\0" "end su exploration" {
- -re "$gdb_prompt" {
- pass "end su exploration"
- }
- }
- }
- }
- }
- }
+ pass "explore su"
+ gdb_test_multiple "3" "explore su.d" {
+ -re "[scalar_description {su.d} {double}].*[scalar_value {su.d} {100[.].*}].*$return_to_parent_prompt" {
+ pass "explore su.d"
+ gdb_test_multiple " " "end su.d exploration" {
+ -re ".*[compound_description {su} {union} {union SimpleUnion}].*[field_choices {i} {c} {f} {d}].*$enter_field_number_prompt" {
+ pass "end su.d exploration"
+ gdb_test_multiple "\0" "end su exploration" {
+ -re "$gdb_prompt" {
+ pass "end su exploration"
+ }
+ }
+ }
+ }
+ }
+ }
}
}
gdb_test_multiple "explore cs" "" {
-re "[compound_description {cs} {struct/class} {struct ComplexStruct}].*[field_choices {s} {u} {sa}].*$enter_field_number_prompt" {
- pass "explore cs"
- gdb_test_multiple "0" "explore cs.s" {
- -re "[compound_description {cs.s} {struct/class} {struct SimpleStruct}].*[field_values {a = 10} {d = 100[.].*}].*$return_to_parent_prompt" {
- pass "explore cs.s"
- gdb_test_multiple " " "end cs.s exploration" {
- -re ".*$enter_field_number_prompt" {
- pass "end cs.s exploration"
- }
- }
- }
- }
- gdb_test_multiple "1" "explore cs.u" {
- -re "[compound_description {cs.u} {union} {union SimpleUnion}].*.*[field_choices {i} {c} {f} {d}].*$enter_field_number_prompt" {
- pass "explore cs.u"
- gdb_test_multiple " " "end cs.u exploration" {
- -re ".*$enter_field_number_prompt" {
- pass "end cs.u exploration"
- }
- }
- }
- }
- gdb_test_multiple "\0" "explore cs.u" {
- -re "$gdb_prompt" {
- pass "end cs exploration"
- }
- }
+ pass "explore cs"
+ gdb_test_multiple "0" "explore cs.s" {
+ -re "[compound_description {cs.s} {struct/class} {struct SimpleStruct}].*[field_values {a = 10} {d = 100[.].*}].*$return_to_parent_prompt" {
+ pass "explore cs.s"
+ gdb_test_multiple " " "end cs.s exploration" {
+ -re ".*$enter_field_number_prompt" {
+ pass "end cs.s exploration"
+ }
+ }
+ }
+ }
+ gdb_test_multiple "1" "explore cs.u" {
+ -re "[compound_description {cs.u} {union} {union SimpleUnion}].*.*[field_choices {i} {c} {f} {d}].*$enter_field_number_prompt" {
+ pass "explore cs.u"
+ gdb_test_multiple " " "end cs.u exploration" {
+ -re ".*$enter_field_number_prompt" {
+ pass "end cs.u exploration"
+ }
+ }
+ }
+ }
+ gdb_test_multiple "\0" "explore cs.u" {
+ -re "$gdb_prompt" {
+ pass "end cs exploration"
+ }
+ }
}
}
gdb_test_multiple "explore cu" "" {
-re "[compound_description {cu} {union} {union ComplexUnion}].*[field_choices {s} {sa}].*$enter_field_number_prompt" {
- pass "explore cu"
- gdb_test_multiple "1" "explore cu.sa" {
- -re ".*[array_description {cu.sa} $SS].*$array_index_prompt" {
- pass "explore cu.sa"
- gdb_test_multiple "0" "explore cu.sa\[0\]" {
- -re "[compound_description {\(cu.sa\)\[0\]} {struct/class} {struct SimpleStruct}].*[field_values {a = 0} {d = 100[.].*}].*$return_to_parent_prompt" {
- pass "explore cu.sa\[0\]"
- gdb_test_multiple "\0" "end cu.sa\[0\] exploration" {
- -re "[array_description {cu.sa} $SS]$array_index_prompt" {
- pass "end cu.sa\[0\] exploration"
- }
- }
- }
- }
- gdb_test_multiple "\0" "end cu.sa exploration" {
- -re ".*$enter_field_number_prompt" {
- pass "end cu.sa exploration"
- gdb_test_multiple "\0" "end cu exploration" {
- -re "$gdb_prompt" {
- pass "end cu exploration"
- }
- }
- }
- }
- }
- }
+ pass "explore cu"
+ gdb_test_multiple "1" "explore cu.sa" {
+ -re ".*[array_description {cu.sa} $SS].*$array_index_prompt" {
+ pass "explore cu.sa"
+ gdb_test_multiple "0" "explore cu.sa\[0\]" {
+ -re "[compound_description {\(cu.sa\)\[0\]} {struct/class} {struct SimpleStruct}].*[field_values {a = 0} {d = 100[.].*}].*$return_to_parent_prompt" {
+ pass "explore cu.sa\[0\]"
+ gdb_test_multiple "\0" "end cu.sa\[0\] exploration" {
+ -re "[array_description {cu.sa} $SS]$array_index_prompt" {
+ pass "end cu.sa\[0\] exploration"
+ }
+ }
+ }
+ }
+ gdb_test_multiple "\0" "end cu.sa exploration" {
+ -re ".*$enter_field_number_prompt" {
+ pass "end cu.sa exploration"
+ gdb_test_multiple "\0" "end cu exploration" {
+ -re "$gdb_prompt" {
+ pass "end cu exploration"
+ }
+ }
+ }
+ }
+ }
+ }
}
}
gdb_test_multiple "explore struct SimpleStruct" "" {
-re ".*[compound_type_description $SS {struct/class}].*$SS_fields_types.*" {
- pass "explore struct SimpleStruct"
- gdb_test_multiple "0" "explore type struct SimpleStruct feild 0" {
- -re ".*[child_scalar_type_description {field 'a' of 'struct SimpleStruct'} {int}].*" {
- pass "explore type struct SimpleStruct feild 0"
- gdb_test_multiple "\0" "return to struct SimpleStruct from field 0" {
- -re ".*[compound_type_description $SS {struct/class}].*$SS_fields_types.*" {
- pass "return to struct SimpleStruct from field 0"
- }
- }
- }
- }
- gdb_test_multiple "1" "explore type struct SimpleStruct feild 1" {
- -re ".*[child_scalar_type_description {field 'd' of 'struct SimpleStruct'} {double}].*" {
- pass "explore type struct SimpleStruct feild 1"
- gdb_test_multiple "\0" "return to struct SimpleStruct from field 1" {
- -re ".*[compound_type_description $SS {struct/class}].*$SS_fields_types.*" {
- pass "return to struct SimpleStruct from field 1"
- }
- }
- }
- }
- gdb_test_multiple "\0" "return to GDB prompt from struct SimpleStruct" {
- -re "$gdb_prompt" {
- pass "return to GDB prompt from struct SimpleStruct"
- }
- }
+ pass "explore struct SimpleStruct"
+ gdb_test_multiple "0" "explore type struct SimpleStruct feild 0" {
+ -re ".*[child_scalar_type_description {field 'a' of 'struct SimpleStruct'} {int}].*" {
+ pass "explore type struct SimpleStruct feild 0"
+ gdb_test_multiple "\0" "return to struct SimpleStruct from field 0" {
+ -re ".*[compound_type_description $SS {struct/class}].*$SS_fields_types.*" {
+ pass "return to struct SimpleStruct from field 0"
+ }
+ }
+ }
+ }
+ gdb_test_multiple "1" "explore type struct SimpleStruct feild 1" {
+ -re ".*[child_scalar_type_description {field 'd' of 'struct SimpleStruct'} {double}].*" {
+ pass "explore type struct SimpleStruct feild 1"
+ gdb_test_multiple "\0" "return to struct SimpleStruct from field 1" {
+ -re ".*[compound_type_description $SS {struct/class}].*$SS_fields_types.*" {
+ pass "return to struct SimpleStruct from field 1"
+ }
+ }
+ }
+ }
+ gdb_test_multiple "\0" "return to GDB prompt from struct SimpleStruct" {
+ -re "$gdb_prompt" {
+ pass "return to GDB prompt from struct SimpleStruct"
+ }
+ }
}
}
gdb_test_multiple "explore union SimpleUnion" "" {
-re ".*[compound_type_description $SU {union}].*$SU_fields_types.*" {
pass "explore union SimpleUnion"
- gdb_test_multiple "0" "explore type union SimpleUnion feild 0" {
- -re ".*[child_scalar_type_description {field 'i' of 'union SimpleUnion'} {int}].*" {
- pass "explore type union SimpleUnion feild 0"
- gdb_test_multiple "\0" "return to union SimpleUnion from field 0" {
- -re ".*[compound_type_description $SU {union}].*$SU_fields_types.*" {
- pass "return to union SimpleUnion from field 0"
- }
- }
- }
- }
- gdb_test_multiple "1" "explore type union SimpleUnion feild 1" {
- -re ".*[child_scalar_type_description {field 'c' of 'union SimpleUnion'} {char}].*" {
- pass "explore type union SimpleUnion feild 1"
- gdb_test_multiple "\0" "return to union SimpleUnion from field 1" {
- -re ".*[compound_type_description $SU {union}].*$SU_fields_types.*" {
- pass "return to union SimpleUnion from field 1"
- }
- }
- }
- }
- gdb_test_multiple "2" "explore type union SimpleUnion feild 2" {
- -re ".*[child_scalar_type_description {field 'f' of 'union SimpleUnion'} {float}].*" {
- pass "explore type union SimpleUnion feild 2"
- gdb_test_multiple "\0" "return to union SimpleUnion from field 2" {
- -re ".*[compound_type_description $SU {union}].*$SU_fields_types.*" {
- pass "return to union SimpleUnion from field 2"
- }
- }
- }
- }
- gdb_test_multiple "3" "explore type union SimpleUnion feild 3" {
- -re ".*[child_scalar_type_description {field 'd' of 'union SimpleUnion'} {double}].*" {
- pass "explore type union SimpleUnion feild 3"
- gdb_test_multiple "\0" "return to union SimpleUnion from field 3" {
- -re ".*[compound_type_description $SU {union}].*$SU_fields_types.*" {
- pass "return to union SimpleUnion from field 3"
- }
- }
- }
- }
- gdb_test_multiple "\0" "return to GDB prompt from union SimpleUnion" {
- -re "$gdb_prompt" {
- pass "return to GDB prompt from union SimpleUnion"
- }
- }
+ gdb_test_multiple "0" "explore type union SimpleUnion feild 0" {
+ -re ".*[child_scalar_type_description {field 'i' of 'union SimpleUnion'} {int}].*" {
+ pass "explore type union SimpleUnion feild 0"
+ gdb_test_multiple "\0" "return to union SimpleUnion from field 0" {
+ -re ".*[compound_type_description $SU {union}].*$SU_fields_types.*" {
+ pass "return to union SimpleUnion from field 0"
+ }
+ }
+ }
+ }
+ gdb_test_multiple "1" "explore type union SimpleUnion feild 1" {
+ -re ".*[child_scalar_type_description {field 'c' of 'union SimpleUnion'} {char}].*" {
+ pass "explore type union SimpleUnion feild 1"
+ gdb_test_multiple "\0" "return to union SimpleUnion from field 1" {
+ -re ".*[compound_type_description $SU {union}].*$SU_fields_types.*" {
+ pass "return to union SimpleUnion from field 1"
+ }
+ }
+ }
+ }
+ gdb_test_multiple "2" "explore type union SimpleUnion feild 2" {
+ -re ".*[child_scalar_type_description {field 'f' of 'union SimpleUnion'} {float}].*" {
+ pass "explore type union SimpleUnion feild 2"
+ gdb_test_multiple "\0" "return to union SimpleUnion from field 2" {
+ -re ".*[compound_type_description $SU {union}].*$SU_fields_types.*" {
+ pass "return to union SimpleUnion from field 2"
+ }
+ }
+ }
+ }
+ gdb_test_multiple "3" "explore type union SimpleUnion feild 3" {
+ -re ".*[child_scalar_type_description {field 'd' of 'union SimpleUnion'} {double}].*" {
+ pass "explore type union SimpleUnion feild 3"
+ gdb_test_multiple "\0" "return to union SimpleUnion from field 3" {
+ -re ".*[compound_type_description $SU {union}].*$SU_fields_types.*" {
+ pass "return to union SimpleUnion from field 3"
+ }
+ }
+ }
+ }
+ gdb_test_multiple "\0" "return to GDB prompt from union SimpleUnion" {
+ -re "$gdb_prompt" {
+ pass "return to GDB prompt from union SimpleUnion"
+ }
+ }
}
}
gdb_test_multiple "explore SS" "" {
-re ".*[typedef_type_description {SS} $SS].*[compound_type_description {SS} {struct/class}].*$SS_fields_types.*" {
- pass "explore SS"
- gdb_test_multiple "0" "explore type SS feild 0" {
- -re ".*[child_scalar_type_description {field 'a' of 'SS'} {int}].*" {
- pass "explore type SS feild 0"
- gdb_test_multiple "\0" "return to SS from field 0" {
- -re ".*[compound_type_description {SS} {struct/class}].*$SS_fields_types.*" {
- pass "return to SS from field 0"
- }
- }
- }
- }
- gdb_test_multiple "1" "explore type SS feild 1" {
- -re ".*[child_scalar_type_description {field 'd' of 'SS'} {double}].*" {
- pass "explore type SS feild 1"
- gdb_test_multiple "\0" "return to struct SimpleStruct from field 1" {
- -re ".*[compound_type_description {SS} {struct/class}].*$SS_fields_types.*" {
- pass "return to SS field 1"
- }
- }
- }
- }
- gdb_test_multiple "\0" "return to GDB prompt from SS" {
- -re "$gdb_prompt" {
- pass "return to GDB prompt from SS"
- }
- }
+ pass "explore SS"
+ gdb_test_multiple "0" "explore type SS feild 0" {
+ -re ".*[child_scalar_type_description {field 'a' of 'SS'} {int}].*" {
+ pass "explore type SS feild 0"
+ gdb_test_multiple "\0" "return to SS from field 0" {
+ -re ".*[compound_type_description {SS} {struct/class}].*$SS_fields_types.*" {
+ pass "return to SS from field 0"
+ }
+ }
+ }
+ }
+ gdb_test_multiple "1" "explore type SS feild 1" {
+ -re ".*[child_scalar_type_description {field 'd' of 'SS'} {double}].*" {
+ pass "explore type SS feild 1"
+ gdb_test_multiple "\0" "return to struct SimpleStruct from field 1" {
+ -re ".*[compound_type_description {SS} {struct/class}].*$SS_fields_types.*" {
+ pass "return to SS field 1"
+ }
+ }
+ }
+ }
+ gdb_test_multiple "\0" "return to GDB prompt from SS" {
+ -re "$gdb_prompt" {
+ pass "return to GDB prompt from SS"
+ }
+ }
}
}
gdb_test_multiple "explore type struct ComplexStruct" "" {
-re ".*[compound_type_description $CS {struct/class}].*$CS_fields_types.*" {
- pass "explore type struct ComplexStruct"
- gdb_test_multiple "0" "explore type struct ComplexStruct field 0" {
- -re ".*[child_compound_type_description $CS_field_0 $SS {struct/class}].*$SS_fields_types.*" {
- pass "explore type struct ComplexStruct field 0"
- gdb_test_multiple "\0" "return to ComplexStruct from field 0" {
- -re ".*[compound_type_description $CS {struct/class}].*$CS_fields_types.*" {
- pass "return to ComplexStruct from field 0"
- }
- }
- }
- }
- gdb_test_multiple "1" "explore type struct ComplexStruct field 1" {
- -re ".*[child_compound_type_description $CS_field_1 $SU {union}].*$SU_fields_types.*" {
- pass "explore type struct ComplexStruct field 1"
- gdb_test_multiple "\0" "return to ComplexStruct from field 1" {
- -re ".*[compound_type_description $CS {struct/class}].*$CS_fields_types.*" {
- pass "return to ComplexStruct from field 1"
- }
- }
- }
- }
- gdb_test_multiple "2" "explore type struct ComplexStruct field 2" {
- -re ".*[child_array_type_description $CS_field_2 {SS}].*" {
- pass "explore type struct ComplexStruct field 2"
- gdb_test_multiple "\0" "return to ComplexStruct from field 2" {
- -re ".*[compound_type_description $CS {struct/class}].*$CS_fields_types.*" {
- pass "return to ComplexStruct from field 2"
- }
- }
- }
- }
- gdb_test_multiple "\0" "return to GDB prompt from ComplexStruct type exploration" {
- -re "$gdb_prompt" {
- pass "return to GDB prompt from ComplexStruct type exploration"
- }
- }
+ pass "explore type struct ComplexStruct"
+ gdb_test_multiple "0" "explore type struct ComplexStruct field 0" {
+ -re ".*[child_compound_type_description $CS_field_0 $SS {struct/class}].*$SS_fields_types.*" {
+ pass "explore type struct ComplexStruct field 0"
+ gdb_test_multiple "\0" "return to ComplexStruct from field 0" {
+ -re ".*[compound_type_description $CS {struct/class}].*$CS_fields_types.*" {
+ pass "return to ComplexStruct from field 0"
+ }
+ }
+ }
+ }
+ gdb_test_multiple "1" "explore type struct ComplexStruct field 1" {
+ -re ".*[child_compound_type_description $CS_field_1 $SU {union}].*$SU_fields_types.*" {
+ pass "explore type struct ComplexStruct field 1"
+ gdb_test_multiple "\0" "return to ComplexStruct from field 1" {
+ -re ".*[compound_type_description $CS {struct/class}].*$CS_fields_types.*" {
+ pass "return to ComplexStruct from field 1"
+ }
+ }
+ }
+ }
+ gdb_test_multiple "2" "explore type struct ComplexStruct field 2" {
+ -re ".*[child_array_type_description $CS_field_2 {SS}].*" {
+ pass "explore type struct ComplexStruct field 2"
+ gdb_test_multiple "\0" "return to ComplexStruct from field 2" {
+ -re ".*[compound_type_description $CS {struct/class}].*$CS_fields_types.*" {
+ pass "return to ComplexStruct from field 2"
+ }
+ }
+ }
+ }
+ gdb_test_multiple "\0" "return to GDB prompt from ComplexStruct type exploration" {
+ -re "$gdb_prompt" {
+ pass "return to GDB prompt from ComplexStruct type exploration"
+ }
+ }
}
}
gdb_test_multiple "explore type union ComplexUnion" "" {
-re ".*[compound_type_description $CU {union}].*$CU_fields_types.*" {
- pass "explore type union ComplexUnion"
- gdb_test_multiple "0" "explore type union ComplexStruct field 0" {
- -re ".*[child_compound_type_description $CU_field_0 $SS {struct/class}].*$SS_fields_types.*" {
- pass "explore type union ComplexUnion field 0"
- gdb_test_multiple "\0" "return to ComplexUnion from field 0" {
- -re ".*[compound_type_description $CU {union}].*$CU_fields_types.*" {
- pass "return to ComplexUnion from field 0"
- }
- }
- }
- }
- gdb_test_multiple "1" "explore type union ComplexUnion field 1" {
- -re ".*[child_array_type_description $CU_field_1 $SS].*" {
- pass "explore type union ComplexUnion field 1"
- gdb_test_multiple "\0" "return to ComplexUnion array" {
- -re ".*[compound_type_description $CU {union}].*$CU_fields_types.*" {
- pass "return to ComplexUnion from field 1"
- }
- }
- }
- }
- gdb_test_multiple "\0" "return to GDB prompt from ComplexUnion type exploration" {
- -re "$gdb_prompt" {
- pass "return to GDB prompt from ComplexUnion type exploration"
- }
- }
+ pass "explore type union ComplexUnion"
+ gdb_test_multiple "0" "explore type union ComplexStruct field 0" {
+ -re ".*[child_compound_type_description $CU_field_0 $SS {struct/class}].*$SS_fields_types.*" {
+ pass "explore type union ComplexUnion field 0"
+ gdb_test_multiple "\0" "return to ComplexUnion from field 0" {
+ -re ".*[compound_type_description $CU {union}].*$CU_fields_types.*" {
+ pass "return to ComplexUnion from field 0"
+ }
+ }
+ }
+ }
+ gdb_test_multiple "1" "explore type union ComplexUnion field 1" {
+ -re ".*[child_array_type_description $CU_field_1 $SS].*" {
+ pass "explore type union ComplexUnion field 1"
+ gdb_test_multiple "\0" "return to ComplexUnion array" {
+ -re ".*[compound_type_description $CU {union}].*$CU_fields_types.*" {
+ pass "return to ComplexUnion from field 1"
+ }
+ }
+ }
+ }
+ gdb_test_multiple "\0" "return to GDB prompt from ComplexUnion type exploration" {
+ -re "$gdb_prompt" {
+ pass "return to GDB prompt from ComplexUnion type exploration"
+ }
+ }
}
}
}
catch (const int *e)
{
- std::cerr << "Exception #" << *e << std::endl;
+ std::cerr << "Exception #" << *e << std::endl;
}
i += 1; /* Break after exception 1. */
}
catch (const int *e)
{
- std::cerr << "Exception #" << *e << std::endl;
+ std::cerr << "Exception #" << *e << std::endl;
}
i += 1; /* Break after exception 2. */
gdb_breakpoint [gdb_get_line_number "Break after exception 2"]
gdb_test "source $pyfile" ".*Python script imported.*" \
- "import python scripts"
+ "import python scripts"
gdb_breakpoint "throw_exception_1"
check_format_string "a_binary_string" $opts
check_format_string "a_binary_string_array" $opts
check_format_string "a_big_string" $opts \
- [get_cut_big_string 1000]
+ [get_cut_big_string 1000]
if { $setting == "elements"} {
check_format_string "an_array" $opts
check_format_string "an_array_with_repetition" $opts
check_format_string "a_symbol_pointer" $opts
if { $current_lang == "c++" } {
- check_format_string "a_point_t_ref" $opts
- check_format_string "a_base_ref" $opts
+ check_format_string "a_point_t_ref" $opts
+ check_format_string "a_base_ref" $opts
}
}
}
check_format_string "a_big_string" $opts
check_format_string "an_array" $opts
check_format_string "an_array_with_repetition" $opts \
- "\\{1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 5, 5\\}"
+ "\\{1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 5, 5\\}"
check_format_string "a_symbol_pointer" $opts
if { $current_lang == "c++" } {
- check_format_string "a_point_t_ref" $opts
- check_format_string "a_base_ref" $opts
+ check_format_string "a_point_t_ref" $opts
+ check_format_string "a_base_ref" $opts
}
}
}
gdb_test_no_output "set frame-filter priority global Elider 1000" \
"set frame-filter priotiy global Elider 1000"
gdb_test "show frame-filter priority global Elider" \
- "Priority of filter 'Elider' in list 'global' is: 1000" \
- "show frame-filter priority global Elider after setting"
+ "Priority of filter 'Elider' in list 'global' is: 1000" \
+ "show frame-filter priority global Elider after setting"
gdb_test "info frame-filter" \
".*1000.*Yes.*Elider.*100.*Yes.*Reverse.*10.*.*No.*Object.*1.*" \
"info frame filter after setting priority"
proc test_lookup_type { lang type_name } {
gdb_test_no_output "set language ${lang}"
gdb_test "python print(gdb.lookup_type('${type_name}').name)" \
- "${type_name}" \
- "lookup type ${type_name} using language ${lang}"
+ "${type_name}" \
+ "lookup type ${type_name} using language ${lang}"
}
test_lookup_type "ada" "character"
remote_exec host \
"mkdir -p $debugdir_no_lib/[file dirname $build_id_filename]"
gdb_test_no_output "python handler_obj.set_mode(Mode.RETURN_TRUE, \
- \"$hidden_libfile\", \"$debugdir_no_lib/$build_id_filename\")" \
+ \"$hidden_libfile\", \"$debugdir_no_lib/$build_id_filename\")" \
"configure handler"
load_core_file
gdb_test "with print raw-values off -- print /r ss" " = {a = {a = 1, b = $hex}, b = {a = 2, b = $hex}}"
gdb_test "print -raw-values off -- /r ss" " = {a = {a = 1, b = $hex}, b = {a = 2, b = $hex}}"
-
-
set pyfile [gdb_remote_download host ${srcdir}/${subdir}/${testfile}.py]
gdb_test "source ${pyfile}" "Python script imported" \
- "import python scripts"
+ "import python scripts"
# The following tests require execution.
global testfile srcdir subdir srcfile
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${exefile}" \
executable \
- [list debug c++ additional_flags="-DTYPE=$type"]] != "" } {
+ [list debug c++ additional_flags="-DTYPE=$type"]] != "" } {
untested $type
return -1
}
gdb_test "break after_mc_barrier" \
"Breakpoint 2 at .*: file .*${srcfile}, line .*" \
- "breakpoint on after_mc_barrier"
+ "breakpoint on after_mc_barrier"
gdb_test "break do_something" \
"Breakpoint 3 at .*: file .*${srcfile}, line .*" \
- "breakpoint on do_something"
+ "breakpoint on do_something"
gdb_test "continue" \
"Breakpoint 2, after_mc_barrier .*" \
# We should see an exception when passing an object of the wrong type.
gdb_test "python print(gdb.selected_inferior().thread_from_handle(gdb.lookup_symbol('main')))" \
- ".*TypeError.*: Argument 'handle' must be a thread handle object.*" \
+ ".*TypeError.*: Argument 'handle' must be a thread handle object.*" \
"TypeError when passing a symbol object to thread_from_handle"
# We should see an exception when passing too large of an object.
gdb_test "python print(gdb.selected_inferior().thread_from_handle(gdb.parse_and_eval('thrs')))" \
- ".*Thread handle size mismatch.*" \
+ ".*Thread handle size mismatch.*" \
"Pass overly large object to thread_from_handle"
# We should see an exception when passing too small of an object.
gdb_test "python print(gdb.selected_inferior().thread_from_handle(gdb.parse_and_eval('\"S\"')))" \
- ".*Thread handle size mismatch.*" \
+ ".*Thread handle size mismatch.*" \
"Pass too small of an object to thread_from_handle"
# Test the thread_handle method
# object into a gdb.value by calling the two argument form of
# its constructor.
- gdb_test "python print(gdb.Value(hand_bytes, tp) == hand)" \
- "True" \
- "verify that handles are the same"
+ gdb_test "python print(gdb.Value(hand_bytes, tp) == hand)" \
+ "True" \
+ "verify that handles are the same"
}
}
# .fields() of a typedef should still return the underlying field list
gdb_test "python print (len(gdb.parse_and_eval('ts').type.fields()))" "2" \
- "$lang typedef field list"
+ "$lang typedef field list"
if {$lang == "c++"} {
# Test usage with a class
# Test gdb.Type.array.
gdb_test "python print (ar\[0\].cast(ar\[0\].type.array(1)))" \
- ".1, 2." "cast to array with one argument"
+ ".1, 2." "cast to array with one argument"
gdb_test "python print (ar\[0\].cast(ar\[0\].type.array(0, 1)))" \
- ".1, 2." "cast to array with two arguments"
+ ".1, 2." "cast to array with two arguments"
gdb_test "python print (ar\[0\].type == ar\[0\].type)" "True"
gdb_breakpoint "foo"
gdb_test "source ${pyfile}" "Python script imported" \
- "import python scripts"
+ "import python scripts"
gdb_continue_to_breakpoint "foo"
bad_layout(void **variable_ptr, void *fp)
{
fprintf (stderr, "First variable should be allocated one word below "
- "the frame. Got variable's address %p, frame at %p instead.\n",
- variable_ptr, fp);
+ "the frame. Got variable's address %p, frame at %p instead.\n",
+ variable_ptr, fp);
abort();
}
proc prepare_type_and_buffer {} {
gdb_py_test_silent_cmd "python tp=gdb.lookup_type('int')" "look up int type" 0
gdb_py_test_silent_cmd "python size_a=gdb.parse_and_eval('sizeof(a)')" \
- "find size of a" 0
+ "find size of a" 0
gdb_py_test_silent_cmd "python size_a0=gdb.parse_and_eval('sizeof(a\[0\])')" \
- "find size of element of a" 0
+ "find size of element of a" 0
gdb_py_test_silent_cmd "python addr=gdb.parse_and_eval('&a')" \
- "find address of a" 0
+ "find address of a" 0
gdb_py_test_silent_cmd "python b=gdb.selected_inferior().read_memory(addr,size_a)" \
- "read buffer from memory" 0
+ "read buffer from memory" 0
}
proc test_value_from_buffer {} {
prepare_type_and_buffer
gdb_test "python v=gdb.Value(b,tp); print(v)" "1" \
- "construct value from buffer"
+ "construct value from buffer"
gdb_test_no_output { python compare_value_bytes_to_mem(v, addr, size_a0) }
gdb_test "python v=gdb.Value(b\[size_a0:\],tp); print(v)" "2" \
- "convert 2nd elem of buffer to value"
+ "convert 2nd elem of buffer to value"
gdb_test_no_output \
{ python compare_value_bytes_to_mem(v, (int(addr) + size_a0), size_a0) }
gdb_test "python v=gdb.Value(b\[2*size_a0:\],tp); print(v)" "3" \
- "convert 3rd elem of buffer to value"
+ "convert 3rd elem of buffer to value"
gdb_test_no_output \
{ python compare_value_bytes_to_mem(v, (int(addr) + (2 * size_a0)), size_a0) }
gdb_test "python v=gdb.Value(b\[2*size_a0+1:\],tp); print(v)" \
- "ValueError.*: Size of type is larger than that of buffer object\..*" \
+ "ValueError.*: Size of type is larger than that of buffer object\..*" \
"attempt to convert smaller buffer than size of type"
gdb_py_test_silent_cmd "python atp=tp.array(2) ; print(atp)" \
- "make array type" 0
+ "make array type" 0
gdb_py_test_silent_cmd "python va=gdb.Value(b,atp)" \
- "construct array value from buffer" 0
+ "construct array value from buffer" 0
gdb_test_no_output \
{ python compare_value_bytes_to_mem(va, addr, size_a0 * 3) }
gdb_test "python print(va)" "\\{1, 2, 3\\}" "print array value"
gdb_test "python print(va\[1\])" "2" "print second array element"
gdb_test "python print(va\[2\])" "3" "print third array element"
gdb_test "python print(va\[3\])" "gdb\.error.*: no such vector element.*" \
- "print out of bounds array element"
+ "print out of bounds array element"
gdb_py_test_silent_cmd "python atpbig=tp.array(3)" "make bigger array type" 0
gdb_test "python vabig=gdb.Value(b,atpbig)" \
- "ValueError.*: Size of type is larger than that of buffer object\..*" \
+ "ValueError.*: Size of type is larger than that of buffer object\..*" \
"attempt to construct large value with small buffer"
gdb_test "python v=gdb.Value(2048,tp)" \
- "TypeError.*: Object must support the python buffer protocol\..*" \
- "attempt to construct value from buffer with non-buffer object"
+ "TypeError.*: Object must support the python buffer protocol\..*" \
+ "attempt to construct value from buffer with non-buffer object"
gdb_test "python v=gdb.Value(b,'int'); print(v)" \
- "TypeError.*: type argument must be a gdb\.Type\..*" \
+ "TypeError.*: type argument must be a gdb\.Type\..*" \
"attempt to construct value with string as type"
}
set stop_addr [get_valueof "/x" "\$pc" "" "value of pc"]
set stop_addr_is_stmt [hex_in_list $stop_addr $is_stmt]
if { ! $stop_addr_is_stmt } {
- fail "stopped at bp, 2nd instr (missing hex prefix)"
+ fail "stopped at bp, 2nd instr (missing hex prefix)"
} elseif {$foo2_addr == $stop_addr} {
- pass "stopped at bp, 2nd instr"
+ pass "stopped at bp, 2nd instr"
} else {
- fail "stopped at bp, 2nd instr (wrong address)"
+ fail "stopped at bp, 2nd instr (wrong address)"
}
}
}
{
foo ();
} /* end of main */
-
set stop_addr [get_valueof "/x" "\$pc" "" "value of pc"]
set stop_addr_is_stmt [hex_in_list $stop_addr $is_stmt]
if { ! $stop_addr_is_stmt } {
- fail "stopped at bp, 2nd instr (missing hex prefix)"
+ fail "stopped at bp, 2nd instr (missing hex prefix)"
} elseif {$foo2_addr == $stop_addr} {
- pass "stopped at bp, 2nd instr"
+ pass "stopped at bp, 2nd instr"
} else {
- fail "stopped at bp, 2nd instr (wrong address)"
+ fail "stopped at bp, 2nd instr (wrong address)"
}
}
}
main_test = 1; /* double_checkpoint */
return 0; /* end of main */
}
-
gdb_test "info reg eax" "eax *$predec_eax\[ \t\]+.*" "eax before reverse-inc"
gdb_test "reverse-step" "inc .eax.*" "reverse-step to inc eax"
gdb_test "info reg eax" "eax *$preinc_eax\[ \t\]+.*" "eax after reverse-inc"
-
-
gdb_test "info reg eax" "eax *$predec_eax\[ \t\]+.*" "eax before reverse-inc"
gdb_test "reverse-step" "inc .eax.*" "reverse-step to inc eax"
gdb_test "info reg eax" "eax *$preinc_eax\[ \t\]+.*" "eax after reverse-inc"
-
-
sse_test (void)
{
char buf0[] = {0, 1, 2, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 12, 13, 14, 15};
+ 9, 10, 11, 12, 13, 14, 15};
char buf1[] = {16, 17, 18, 19, 20, 21, 22, 23,
- 24, 25, 26, 27, 28, 29, 30, 31};
+ 24, 25, 26, 27, 28, 29, 30, 31};
char buf2[] = {32, 33, 34, 35, 36, 37, 38, 39,
- 40, 41, 42, 43, 44, 45, 46, 47};
+ 40, 41, 42, 43, 44, 45, 46, 47};
asm ("movupd %0, %%xmm0":"=m"(buf0));
asm ("movupd %0, %%xmm1":"=m"(buf1));
ssse3_test (void)
{
char buf0[] = {0, 1, 2, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 12, 13, 14, 15};
+ 9, 10, 11, 12, 13, 14, 15};
char buf1[] = {16, 17, 18, 19, 20, 21, 22, 23,
- 24, 25, 26, 27, 28, 29, 30, 31};
+ 24, 25, 26, 27, 28, 29, 30, 31};
char buf2[] = {32, 33, 34, 35, 36, 37, 38, 39,
- 40, 41, 42, 43, 44, 45, 46, 47};
+ 40, 41, 42, 43, 44, 45, 46, 47};
asm ("movupd %0, %%xmm0":"=m"(buf0));
asm ("movupd %0, %%xmm1":"=m"(buf1));
sse4_test (void)
{
char buf0[] = {0, 1, 2, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 12, 13, 14, 15};
+ 9, 10, 11, 12, 13, 14, 15};
char buf1[] = {16, 17, 18, 19, 20, 21, 22, 23,
- 24, 25, 26, 27, 28, 29, 30, 31};
+ 24, 25, 26, 27, 28, 29, 30, 31};
char buf2[] = {32, 33, 34, 35, 36, 37, 38, 39,
- 40, 41, 42, 43, 44, 45, 46, 47};
+ 40, 41, 42, 43, 44, 45, 46, 47};
asm ("movupd %0, %%xmm0":"=m"(buf0));
asm ("movupd %0, %%xmm1":"=m"(buf1));
}
-re " Illegal instruction.*\r\n$gdb_prompt $" {
untested i386-sse4-reverse
- return -1
+ return -1
}
}
gdb_test "step" " module global post-change .*" "step, 2"
gdb_test "print aglobal" " = 1" "module global step post-change"
}
-
__asm__ __volatile__ ("xvsqrtsp 0, 1");
ra = 0; /* stop 2 */
}
-
# Check initial and final are the same.
gdb_assert ![string compare $vs1_initial $vs1_final] \
"check vs1 initial versus vs1 final"
-
"wa" (vec_xb) );
/* Use the older instruction name for backward compatibility */
__asm__ __volatile__ ("pmxvi8ger4spp 6, %x0, %x1, 11, 13, 5"
- :: "wa" (vec_xa), "wa" (vec_xb) );
+ :: "wa" (vec_xa), "wa" (vec_xb) );
__asm__ __volatile__ ("pmxvf32gerpp 7, %x0, %x1, 11, 13"
- :: "wa" (vec_xa), "wa" (vec_xb) );
+ :: "wa" (vec_xa), "wa" (vec_xb) );
ra = 0; /* stop 4 */
}
gdb_assert ![string compare $fpscr_initial $fpscr_final] \
"check fpscr initial versus final"
-
-
register size_t nsrc asm("r5") = sizeof src;
asm volatile ("0: mvcle 2, 4, 0x69\n"
"jo 0b\n"
- : "=r" (pdst), "=r" (ndst), "=r" (psrc), "=r" (nsrc)
- : "0" (pdst), "1" (ndst), "2" (psrc), "3" (nsrc)
- : "cc", "memory");
+ : "=r" (pdst), "=r" (ndst), "=r" (psrc), "=r" (nsrc)
+ : "0" (pdst), "1" (ndst), "2" (psrc), "3" (nsrc)
+ : "cc", "memory");
}
int
gdb_test "print (int)dst\[0]" ".* = 0" "check MVCLE record 1"
gdb_test "print (int)dst\[0x100000]" ".* = 0" "check MVCLE record 2"
gdb_test "print (int)dst\[0xffffff]" ".* = 0" "check MVCLE record 3"
-
if { $thissig == "URG" } {
setup_xfail "i*86-pc-linuxoldld-gnu" "i*86-pc-linuxaout-gnu"
}
- # Either Lynx or GDB screws up on SIGPRIO
+ # Either Lynx or GDB screws up on SIGPRIO
if { $thissig == "PRIO" } {
setup_xfail "*-*-*lynx*"
}
if {$missed_handler == "0"} {
set testmsg "advance to $nextsig"
- gdb_test_multiple "signal 0" $testmsg {
+ gdb_test_multiple "signal 0" $testmsg {
-re "Breakpoint.*gen_$nextsig.*kill.*$gdb_prompt $" {
- pass $testmsg
- set sig_supported 1
+ pass $testmsg
+ set sig_supported 1
}
-re "Breakpoint.*gen_$nextsig.*handle.*$gdb_prompt $" {
- pass $testmsg
- set sig_supported 0
+ pass $testmsg
+ set sig_supported 0
}
- }
+ }
}
set thissig $nextsig
}
if { $thissig == "URG" } {
setup_xfail "i*86-pc-linuxoldld-gnu" "i*86-pc-linuxaout-gnu"
}
- # Either Lynx or GDB screws up on SIGPRIO
+ # Either Lynx or GDB screws up on SIGPRIO
if { $thissig == "PRIO" } {
setup_xfail "*-*-*lynx*"
}
if {$missed_handler == "0"} {
set testmsg "advance to $nextsig"
- gdb_test_multiple "signal 0" $testmsg {
+ gdb_test_multiple "signal 0" $testmsg {
-re "Breakpoint.*gen_$nextsig.*kill.*$gdb_prompt $" {
- pass $testmsg
- set sig_supported 1
+ pass $testmsg
+ set sig_supported 1
}
-re "Breakpoint.*gen_$nextsig.*handle.*$gdb_prompt $" {
- pass $testmsg
- set sig_supported 0
+ pass $testmsg
+ set sig_supported 0
}
- }
+ }
}
set thissig $nextsig
}
b[0] = 0; /* end part one */
return 0; /* end of main */
}
-
# FIXME return to this later...
# gdb_test_no_output "set exec-dir forward" "set forward execution"
# gdb_continue_to_end "step-reverse.exp"
-
exit (0); /* end of main */
}
-
# FIXME return to this later...
# gdb_test_no_output "set exec-dir forward" "set forward execution"
# gdb_continue_to_end "step-reverse.exp"
-
gdb_test "continue" \
".*\[Ww\]atchpoint.*ival3.*Old value = 0.*New value = -1.*ival3 = count; ival4 = count;.*" \
"watchpoint hit in reverse, HW, fifth time"
-
return 0; /* end of main */
}
-
gdb_test "continue" \
".*\[Ww\]atchpoint.*ival3.*Old value = 0.*New value = -1.*ival3 = count; ival4 = count;.*" \
"watchpoint hit in reverse, HW, fifth time"
-
gdb_continue_to_end "" continue 1
}
-
kern<<<1, 1>>> ();
return hipDeviceSynchronize () != hipSuccess;
}
-
gdb_load $::binfile
gdb_test "monitor help" "The following monitor commands.*" \
- "load new file without any gdbserver inferior"
+ "load new file without any gdbserver inferior"
gdb_test_no_output "monitor exit"
}
runto_main
gdb_test "break noreturn" \
- "Breakpoint 2 at .*: file .*${srcfile}, line .*" \
- "breakpoint on noreturn"
+ "Breakpoint 2 at .*: file .*${srcfile}, line .*" \
+ "breakpoint on noreturn"
# Run the program and make sure GDB reports that we stopped after
# hitting breakpoint 1 in noreturn().
gdb_test "continue" \
- ".*Breakpoint 2, noreturn ().*" \
- "run to noreturn"
-
+ ".*Breakpoint 2, noreturn ().*" \
+ "run to noreturn"
runto_main
gdb_test "b [gdb_get_line_number "breakpoint here"]" \
- ".*Breakpoint .*execl.*" "set breakpoint at execl"
+ ".*Breakpoint .*execl.*" "set breakpoint at execl"
gdb_test "continue" ".*breakpoint here.*" "continue to exec"
set ok 0
with_timeout_factor 10 {
- set test "inferior 1 exited"
- gdb_test_multiple "" $test {
+ set test "inferior 1 exited"
+ gdb_test_multiple "" $test {
-re "Inferior 1 \(\[^\r\n\]+\) exited normally" {
- set ok 1
- pass $test
+ set ok 1
+ pass $test
}
-re "Inferior $decimal \(\[^\r\n\]+\) exited normally" {
- incr fork_count
- if {$fork_count <= 100} {
+ incr fork_count
+ if {$fork_count <= 100} {
exp_continue
- } else {
+ } else {
fail "$test (too many forks)"
- }
+ }
}
}
}
# Do not run "info threads" before "gcore" as it could workaround the bug
# by discarding non-current exited threads.
gdb_test "info threads" \
- {The current thread <Thread ID 1> has terminated\. See `help thread'\.} \
+ {The current thread <Thread ID 1> has terminated\. See `help thread'\.} \
"exited thread is current due to non-stop"
set opts [list debug]
if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${objfile}" object $opts] != ""
|| ([gdb_compile_pthreads "${objfile}" "${binfile}" executable [concat $opts {ldflags=-Wl,-z,norelro}] ] != ""
- && [gdb_compile_pthreads "${objfile}" "${binfile}" executable $opts] != "") } {
+ && [gdb_compile_pthreads "${objfile}" "${binfile}" executable $opts] != "") } {
return -1
}
}
gdb_test "break all_threads_running" \
- "Breakpoint 2 at .*: file .*${srcfile}, line .*" \
- "breakpoint on all_threads_running"
+ "Breakpoint 2 at .*: file .*${srcfile}, line .*" \
+ "breakpoint on all_threads_running"
gdb_test "break hand_call" \
- "Breakpoint 3 at .*: file .*${srcfile}, line .*" \
- "breakpoint on hand_call"
+ "Breakpoint 3 at .*: file .*${srcfile}, line .*" \
+ "breakpoint on hand_call"
# Run the program and make sure GDB reports that we stopped after
# hitting breakpoint 2 in all_threads_running().
gdb_test "continue" \
- ".*Breakpoint 2, all_threads_running ().*" \
- "run to all_threads_running"
+ ".*Breakpoint 2, all_threads_running ().*" \
+ "run to all_threads_running"
# Before we start making hand function calls, turn on scheduler locking.
}
gdb_test "break all_threads_running" \
- "Breakpoint 2 at .*: file .*${srcfile}, line .*" \
- "breakpoint on all_threads_running"
+ "Breakpoint 2 at .*: file .*${srcfile}, line .*" \
+ "breakpoint on all_threads_running"
# Run the program and make sure GDB reports that we stopped after
# hitting breakpoint 2 in all_threads_running().
gdb_test "continue" \
- ".*Breakpoint 2, all_threads_running ().*" \
- "run to all_threads_running"
+ ".*Breakpoint 2, all_threads_running ().*" \
+ "run to all_threads_running"
# NOTE: Don't turn on scheduler-locking here.
# We want the main thread (hand_call_with_signal) and
send_gdb "quit\n"
gdb_expect {
-re "Quit anyway\\? \\(y or n\\) $" {
- send_gdb "y\n"
- exp_continue
+ send_gdb "y\n"
+ exp_continue
}
eof {
- pass "GDB exits after multi-threaded program exits messily"
+ pass "GDB exits after multi-threaded program exits messily"
}
-re "Cannot find thread ${decimal}: generic error\[\r\n\]*$gdb_prompt $" {
- kfail "gdb/568" "GDB exits after multi-threaded program exits messily"
+ kfail "gdb/568" "GDB exits after multi-threaded program exits messily"
}
timeout {
- fail "GDB exits after multi-threaded program exits messily (timeout)"
+ fail "GDB exits after multi-threaded program exits messily (timeout)"
}
}
exp_continue
}
eof {
- pass "GDB exits after stopping multithreaded program"
+ pass "GDB exits after stopping multithreaded program"
}
timeout {
- fail "GDB exits after stopping multithreaded program (timeout)"
+ fail "GDB exits after stopping multithreaded program (timeout)"
}
}
-
-re ".*= ($decimal).*\r\n$gdb_prompt $" {
set value $expect_out(1,string)
pass "$test"
- }
+ }
}
return ${value}
}
{
args[i] = 1;
res = pthread_create(&threads[i - 1],
- NULL,
+ NULL,
thread_function,
(void *) i);
}
printf("Bye from %d\n", my_number);
pthread_exit(NULL);
}
-
gdb_test "break break_me" \
"Breakpoint 2 at .*: file .*${srcfile}, line .*" \
- "breakpoint on break_me"
+ "breakpoint on break_me"
gdb_test "continue" \
- ".*Breakpoint 2, break_me ().*" \
- "run to break_me"
+ ".*Breakpoint 2, break_me ().*" \
+ "run to break_me"
#
# Backtrace all threads, find the one running noreturn, and
gdb_test "thread apply all backtrace" \
"pthread_cond_wait${btb}cond_wait${btb}noreturn${btb}forever_pthread.*" \
"backtrace in blocked thread"
-
{
args[i] = 1;
res = pthread_create(&threads[i - 1],
- NULL,
+ NULL,
thread_function,
(void *) i);
}
pthread_exit(NULL);
}
-
-re ".*= ($decimal).*\r\n$gdb_prompt $" {
set value $expect_out(1,string)
pass "$test"
- }
+ }
}
return ${value}
}
exp_continue
}
eof {
- pass "$test"
+ pass "$test"
}
}
clean_restart ${::testfile}
gdb_breakpoint thread_func
gdb_continue_to_breakpoint "continue to thread_func"
gdb_test "next" ".*foo \\(\\);"
-
}
gdb_test "break all_threads_running" \
- "Breakpoint 2 at .*: file .*${srcfile}, line .*" \
- "breakpoint on all_threads_running"
+ "Breakpoint 2 at .*: file .*${srcfile}, line .*" \
+ "breakpoint on all_threads_running"
# Run the program and make sure GDB reports that we stopped after
# hitting breakpoint 2 in all_threads_running().
gdb_test "continue" \
- ".*Breakpoint 2, all_threads_running ().*" \
- "run to all_threads_running"
+ ".*Breakpoint 2, all_threads_running ().*" \
+ "run to all_threads_running"
# NOTE: Don't turn on scheduler-locking here.
# We want the main thread (hand_call_with_signal) and
puts (number);
while (unslept > 0)
- unslept = sleep(unslept);
+ unslept = sleep(unslept);
sprintf(number, "tf(%ld): end", (long)arg);
puts (number);
for (n = 0; n < N; ++n)
if (pthread_create (&th[n], NULL, tf, (void *) (long int) n) != 0)
{
- while (unslept > 0)
- unslept = sleep(2);
- puts ("create failed");
- exit (1);
+ while (unslept > 0)
+ unslept = sleep(2);
+ puts ("create failed");
+ exit (1);
}
puts("after create");
for (n = 0; n < N; ++n)
if (pthread_join (th[n], NULL) != 0)
{
- puts ("join failed");
- exit (1);
+ puts ("join failed");
+ exit (1);
}
puts("after join");
}
-re "\[\r\n\]*($pattern)\[\r\n\]+$gdb_prompt $" {
if { $events_seen != $events_expected } {
- fail "$message (saw $events_seen, expected $events_expected)"
+ fail "$message (saw $events_seen, expected $events_expected)"
} else {
- pass "$message"
+ pass "$message"
}
}
}]
}
-re "\[\r\n\]*($pattern)\[\r\n\]+$gdb_prompt $" {
if { $events_seen != $events_expected } {
- fail "$message (saw $events_seen, expected $events_expected)"
+ fail "$message (saw $events_seen, expected $events_expected)"
} else {
- pass "$message"
+ pass "$message"
}
}
}]
{
args[i] = 1; /* Init value. */
res = pthread_create(&threads[i],
- NULL,
+ NULL,
thread_function,
(void *) i);
}
while (!all_started)
{
all_started = 1;
- for (i = 0; i < NUM; i++)
- {
- if (args[i] == 1)
+ for (i = 0; i < NUM; i++)
+ {
+ if (args[i] == 1)
{
- all_started = 0;
- break;
+ all_started = 0;
+ break;
}
- }
+ }
}
args[i] = 1;
(*myp) ++; /* Increment so parent knows child started. */
pthread_barrier_wait(&mybarrier);
}
-
-re "Type commands for definition of \"backthread\".\r\nEnd with a line saying just \"end\".\r\n>$" {
gdb_test_multiple "bt\np/x 20\nend" "macro details" {
-re "$gdb_prompt $" {
- pass "macro details"
+ pass "macro details"
}
}
pass "defining macro"
result ++;
return 0; /* break here to check result */
}
-
pthread_testcancel();
return i_tls;
}
-
"break at and of main"
gdb_test "continue" \
"main .* at .*:.*return 0.*break here to check result.*" \
- "continue to break"
+ "continue to break"
# This is more of a gcc/glibc test, really.
#
gdb_test "print result" "3"
"break in thread function"
gdb_test "continue" \
"tls_ptr .* at .*:.*break here to check result.*" \
- "continue to break in tls_ptr called by main"
+ "continue to break in tls_ptr called by main"
gdb_test "print so_extern == &so_extern" \
- " = 1" \
- "check so_extern address in main"
+ " = 1" \
+ "check so_extern address in main"
gdb_test "continue" \
"tls_ptr .* at .*:.*break here to check result.*" \
- "continue to break in a thread"
+ "continue to break in a thread"
gdb_test "print so_extern == &so_extern" \
- " = 1" \
- "check so_extern address"
+ " = 1" \
+ "check so_extern address"
gdb_test "continue" \
"tls_ptr .* at .*:.*break here to check result.*" \
- "continue to break in the other thread"
+ "continue to break in the other thread"
gdb_test "print so_extern == &so_extern" \
- " = 1" \
- "check so_extern address in other thread"
+ " = 1" \
+ "check so_extern address in other thread"
gdb_test "continue" \
"tls_ptr .* at .*:.*break here to check result.*" \
- "continue to break in tls_ptr called at end of main"
+ "continue to break in tls_ptr called at end of main"
gdb_test "print so_extern == &so_extern" \
- " = 1" \
- "check so_extern address at end of main"
+ " = 1" \
+ "check so_extern address at end of main"
a_thread_local = 0;
K::another_thread_local = me;
for( i = 0; i <= me; i++ ) {
- a_thread_local += i;
+ a_thread_local += i;
}
another_thread_local_val[me] = K::another_thread_local;
if (sem_post (&tell_main) == -1)
{
- fprintf (stderr, "th %d post on sem tell_main failed\n", me);
- print_error ();
- return NULL;
+ fprintf (stderr, "th %d post on sem tell_main failed\n", me);
+ print_error ();
+ return NULL;
}
#ifdef START_DEBUG
fprintf (stderr, "th %d post on tell main\n", me);
while (1)
{
#ifdef START_DEBUG
- fprintf (stderr, "th %d start wait on tell_thread\n", me);
+ fprintf (stderr, "th %d start wait on tell_thread\n", me);
#endif
- if (sem_wait (&tell_thread) == 0)
- break;
+ if (sem_wait (&tell_thread) == 0)
+ break;
- if (errno == EINTR)
- {
+ if (errno == EINTR)
+ {
#ifdef START_DEBUG
- fprintf (stderr, "th %d wait tell_thread got EINTR, rewaiting\n", me);
+ fprintf (stderr, "th %d wait tell_thread got EINTR, rewaiting\n", me);
#endif
- continue;
- }
- else
- {
- fprintf (stderr, "th %d wait on sem tell_thread failed\n", me);
- print_error ();
- return NULL;
- }
+ continue;
+ }
+ else
+ {
+ fprintf (stderr, "th %d wait on sem tell_thread failed\n", me);
+ print_error ();
+ return NULL;
+ }
}
#ifdef START_DEBUG
for( i = 0; i < N_THREADS; i++)
{
- thread_local_val[i] = 0;
- another_thread_local_val[i] = 0;
+ thread_local_val[i] = 0;
+ another_thread_local_val[i] = 0;
}
if (sem_init (&tell_main, 0, 0) == -1)
/* Start N_THREADS threads, then join them so that they are terminated. */
for( i = 0; i < N_THREADS; i++ )
{
- err = pthread_create( &t[i], NULL, spin, (void *) (long) i );
- if( err != 0 ) {
- fprintf(stderr, "Error in thread %d create\n", i );
- }
+ err = pthread_create( &t[i], NULL, spin, (void *) (long) i );
+ if( err != 0 ) {
+ fprintf(stderr, "Error in thread %d create\n", i );
+ }
}
for( i = 0; i < N_THREADS; i++ )
{
- while (1)
- {
+ while (1)
+ {
#ifdef START_DEBUG
- fprintf (stderr, "main %d start wait on tell_main\n", i);
+ fprintf (stderr, "main %d start wait on tell_main\n", i);
#endif
- if (sem_wait (&tell_main) == 0)
- break;
+ if (sem_wait (&tell_main) == 0)
+ break;
- if (errno == EINTR)
- {
+ if (errno == EINTR)
+ {
#ifdef START_DEBUG
- fprintf (stderr, "main %d wait tell_main got EINTR, rewaiting\n", i);
+ fprintf (stderr, "main %d wait tell_main got EINTR, rewaiting\n", i);
#endif
- continue;
- }
- else
- {
- fprintf (stderr, "main %d wait on sem tell_main failed\n", i);
- print_error ();
- return;
- }
- }
+ continue;
+ }
+ else
+ {
+ fprintf (stderr, "main %d wait on sem tell_main failed\n", i);
+ print_error ();
+ return;
+ }
+ }
}
#ifdef START_DEBUG
for( i = 0; i < N_THREADS; i++ )
{
if (sem_post (&tell_thread) == -1)
- {
- fprintf (stderr, "main %d post on sem tell_thread failed\n", i);
- print_error ();
- return;
- }
+ {
+ fprintf (stderr, "main %d post on sem tell_thread failed\n", i);
+ print_error ();
+ return;
+ }
#ifdef START_DEBUG
fprintf (stderr, "main %d post on tell_thread\n", i);
#endif
for( i = 0; i < N_THREADS; i++ )
{
- err = pthread_join(t[i], NULL );
- if( err != 0 )
- {
- fprintf (stderr, "error in thread %d join\n", i );
- }
+ err = pthread_join(t[i], NULL );
+ if( err != 0 )
+ {
+ fprintf (stderr, "error in thread %d join\n", i );
+ }
}
i = 10; /* Null line for setting bpts on. */
set expected_value 0
set i 0
while { $i <= $value} {
- incr expected_value $i
- incr i
+ incr expected_value $i
+ incr i
}
return $expected_value
}
-re ".*= ($decimal).*\r\n$gdb_prompt $" {
set value_of_me $expect_out(1,string)
pass "$tnum thread print me"
- }
+ }
-re "$gdb_prompt $" {
fail "$tnum thread print me"
}
"${number} info address a_thread_local"
gdb_test "info address K::another_thread_local" \
- ".*another_thread_local.*a thread-local variable at offset.*" \
+ ".*another_thread_local.*a thread-local variable at offset.*" \
"${number} info address another_thread_local"
}
fail "backtrace of thread number $number in spin"
} else {
pass "backtrace of thread number $number in spin"
- set level $expect_out(1,string)
+ set level $expect_out(1,string)
set tarrl($number) $level
set tarr($number) 1
}
# test the thread local's value.
#
gdb_test "b [gdb_get_line_number "here we know tls value"]" \
- ".*Breakpoint 2.*tls.*" "set breakpoint at all threads"
+ ".*Breakpoint 2.*tls.*" "set breakpoint at all threads"
# Set a bp at a point where we know all threads are alive.
#
gdb_test "b [gdb_get_line_number "still alive"]" \
- ".*Breakpoint 3.*tls.*" "set breakpoint at synch point"
+ ".*Breakpoint 3.*tls.*" "set breakpoint at synch point"
# Set a bp at the end to see if all threads are finished.
#
gdb_test "b [gdb_get_line_number "before exit"]" \
- ".*Breakpoint 4.*tls.*" "set breakpoint at exit"
+ ".*Breakpoint 4.*tls.*" "set breakpoint at exit"
send_gdb "continue\n"
gdb_expect {
-re ".* received signal SIGSEGV.*a_thread_local = 0;.*$gdb_prompt $" {
- # This is the first symptom if the gcc and binutils versions
- # in use support TLS, but the system glibc does not.
- unsupported "continue to first thread: system does not support TLS"
- return -1
+ # This is the first symptom if the gcc and binutils versions
+ # in use support TLS, but the system glibc does not.
+ unsupported "continue to first thread: system does not support TLS"
+ return -1
}
-re ".*$inferior_exited_re normally.*$gdb_prompt $" {
- fail "continue to first thread: program runaway"
+ fail "continue to first thread: program runaway"
}
-re ".*Pass 0 done.*Pass 1 done.*$gdb_prompt $" {
- fail "continue to first thread: program runaway 2"
+ fail "continue to first thread: program runaway 2"
}
-re ".*Breakpoint 2.*tls value.*$gdb_prompt $" {
- pass "continue to first thread: get to thread"
+ pass "continue to first thread: get to thread"
}
-re ".*$gdb_prompt $" {
- fail "continue to first thread: no progress?"
+ fail "continue to first thread: no progress?"
}
timeout { fail "continue to first thread (timeout)" }
}
-re "^info thread\[ \t\r\n\]+ *Id .*Frame\[ \t\r\n\]+.*(\[0-9\]+) *${tdlabel_re}\[^\r\n\]+\r\n$gdb_prompt $" {
set no_of_threads $expect_out(1,string)
pass "get number of threads"
- }
+ }
-re "$gdb_prompt $" {
fail "get number of threads"
}
send_gdb "info thread\n"
gdb_expect {
-re ".* 1 *${tdlabel_re}.*2 *${tdlabel_re}.*$gdb_prompt $" {
- fail "too many threads left at end"
+ fail "too many threads left at end"
}
-re ".*\\\* 1 *${tdlabel_re}.*main.*$gdb_prompt $" {
- pass "expect only base thread at end"
+ pass "expect only base thread at end"
}
-re ".*No stack.*$gdb_prompt $" {
- fail "runaway at end"
+ fail "runaway at end"
}
-re ".*$gdb_prompt $" {
- fail "mess at end"
+ fail "mess at end"
}
timeout { fail "at end (timeout)" }
}
set prompt "$gdb_prompt \\\[infrun\\\] fetch_inferior_event: exit\r\n$"
gdb_test_multiple "continue" "continue to breakpoint: break-at-exit" -prompt $prompt {
- -re ".*break-at-exit.*$prompt$" {
+ -re ".*break-at-exit.*$prompt$" {
pass $gdb_test_name
}
}
}
gdb_test "break thread_started" \
- "Breakpoint 2 at .*: file .*${srcfile}, line .*" \
- "breakpoint on thread_started"
+ "Breakpoint 2 at .*: file .*${srcfile}, line .*" \
+ "breakpoint on thread_started"
# Run the program until all threads have hit thread_started.
# We use this as the vehicle to determine when gdb is aware
{
/* For debugging. */
printf ("Thread %ld changing watch_thread[%d] data"
- " from %d -> %d\n", thread_number, j,
- watched_data[j], watched_data[j] + 1);
+ " from %d -> %d\n", thread_number, j,
+ watched_data[j], watched_data[j] + 1);
/* Increment the watched data field. */
watched_data[j]++;
}
gdb_test "maint agent-eval &gdb_long_test == &gdb_short_test" ".*equal.*end.*"
gdb_test "maint agent-eval &gdb_long_test < &gdb_short_test" ""
-
*/
signed char c0, c1, c2, c3, c4, c5, c6, c7,
- c8, c9, c10, c11, c12, c13, c14, c15, cminus;
+ c8, c9, c10, c11, c12, c13, c14, c15, cminus;
signed short s0, s1, s2, s3, s4, s5, s6, s7,
- s8, s9, s10, s11, s12, s13, s14, s15, sminus;
+ s8, s9, s10, s11, s12, s13, s14, s15, sminus;
signed long l0, l1, l2, l3, l4, l5, l6, l7,
- l8, l9, l10, l11, l12, l13, l14, l15, lminus;
+ l8, l9, l10, l11, l12, l13, l14, l15, lminus;
/*
test_struct argstruct;
{
return (int) argstruct.memberc + argstruct.memberi +
- argstruct.memberf + argstruct.memberd;
+ argstruct.memberf + argstruct.memberd;
}
/* Test collecting array args. */
gdb_test "print gdb_agent_gdb_trampoline_buffer_error" ".*" ""
gdb_test "ftrace set_point" "Fast tracepoint .*" \
- "fast tracepoint at a long insn"
+ "fast tracepoint at a long insn"
gdb_trace_setactions "collect at set_point: define actions" \
- "" \
- "collect globvar, anarg" "^$"
+ "" \
+ "collect globvar, anarg" "^$"
# Make a test of shorter fast tracepoints, 32-bit x86 only
if { [istarget "i?86-*-*"] } {
- # A Linux target needs to be able to allocate trampolines in the
- # 16-bit range, check mmap_min_addr so we can warn testers.
- if { [istarget "i?86-*-linux*"] } {
-
- set minaddr [exec sh -c "cat /proc/sys/vm/mmap_min_addr"]
-
- if {$minaddr > 64512} {
- warning "mmap_min_addr > 64512, fast tracepoint will fail"
- warning "do \"sudo sysctl -w vm.mmap_min_addr=32768\" to adjust"
- }
- }
-
- gdb_test_multiple "ftrace four_byter" "set 4-byte fast tracepoint" {
- -re "May not have a fast tracepoint at .*\r\n$gdb_prompt $" {
- pass "4-byte fast tracepoint could not be set"
- }
- -re "Fast tracepoint .*\r\n$gdb_prompt $" {
- pass "4-byte fast tracepoint is set"
- set fourgood 1
- }
- }
-
- if { $fourgood } {
-
- gdb_trace_setactions "collect at four_byter: define actions" \
- "" \
- "collect globvar, anarg" "^$"
- }
+ # A Linux target needs to be able to allocate trampolines in the
+ # 16-bit range, check mmap_min_addr so we can warn testers.
+ if { [istarget "i?86-*-linux*"] } {
+
+ set minaddr [exec sh -c "cat /proc/sys/vm/mmap_min_addr"]
+
+ if {$minaddr > 64512} {
+ warning "mmap_min_addr > 64512, fast tracepoint will fail"
+ warning "do \"sudo sysctl -w vm.mmap_min_addr=32768\" to adjust"
+ }
+ }
+
+ gdb_test_multiple "ftrace four_byter" "set 4-byte fast tracepoint" {
+ -re "May not have a fast tracepoint at .*\r\n$gdb_prompt $" {
+ pass "4-byte fast tracepoint could not be set"
+ }
+ -re "Fast tracepoint .*\r\n$gdb_prompt $" {
+ pass "4-byte fast tracepoint is set"
+ set fourgood 1
+ }
+ }
+
+ if { $fourgood } {
+
+ gdb_trace_setactions "collect at four_byter: define actions" \
+ "" \
+ "collect globvar, anarg" "^$"
+ }
}
run_trace_experiment
gdb_test "tfind pc *set_point" "Found trace frame .*" \
- "tfind set_point frame, first time"
+ "tfind set_point frame, first time"
gdb_test "print globvar" " = 1"
gdb_test "tfind pc *set_point" "Found trace frame .*" \
- "tfind set_point frame, second time"
+ "tfind set_point frame, second time"
setup_kfail "gdb/13808" "x86_64-*-linux*"
gdb_test "print anarg" " = 200"
gdb_test "tfind start" "Found trace frame .*" \
- "reset tfinding"
+ "reset tfinding"
if { $fourgood } {
- gdb_test "tfind pc *four_byter" "Found trace frame .*" \
- "tfind four_byter frame, first time"
+ gdb_test "tfind pc *four_byter" "Found trace frame .*" \
+ "tfind four_byter frame, first time"
- gdb_test "print anarg" " = 101" \
- "look at collected local, first time"
+ gdb_test "print anarg" " = 101" \
+ "look at collected local, first time"
- gdb_test "tfind pc *four_byter" "Found trace frame .*" \
- "tfind four_byter frame, second time"
+ gdb_test "tfind pc *four_byter" "Found trace frame .*" \
+ "tfind four_byter frame, second time"
- gdb_test "print anarg" " = 201" \
- "look at collected local, second time"
+ gdb_test "print anarg" " = 201" \
+ "look at collected local, second time"
}
# can no longer be downloaded.
set test "fast tracepoint could not be downloaded with the feature disabled"
if {[gdb_protocol_is_remote]} {
- gdb_test "set remote fast-tracepoints-packet off"
+ gdb_test "set remote fast-tracepoints-packet off"
- gdb_test_multiple "tstart" $test {
- -re "warning: Target does not support fast tracepoints, downloading .* as regular tracepoint.*\r\n$gdb_prompt $" {
- pass $test
- }
- }
+ gdb_test_multiple "tstart" $test {
+ -re "warning: Target does not support fast tracepoints, downloading .* as regular tracepoint.*\r\n$gdb_prompt $" {
+ pass $test
+ }
+ }
} else {
- unsupported $test
+ unsupported $test
}
}
"run trace experiment"
gdb_test_no_output "tstop" "confirm: survived the long packet send"
-
# Finished!
gdb_test "tfind none" ".*"
-
}
}
-re "Continuing.\r\n(Reading .* from remote target...\r\n)?\r\n(Thread .* hit )?Breakpoint.*marker.*at.*$srcfile.*$gdb_prompt $" {
- pass $test
+ pass $test
}
}
set test "disconnect with pending tracepoint"
gdb_test_multiple "disconnect" $test {
-re "warning: Pending tracepoints will not be resolved while GDB is disconnected.*Trace is running but will stop on detach; detach anyway\\? \\(y or n\\) $" {
- pass $test
+ pass $test
- set test "disconnected"
- gdb_test_multiple "y" $test {
+ set test "disconnected"
+ gdb_test_multiple "y" $test {
-re "$gdb_prompt $" {
pass "$test"
}
set test "continue to marker 2"
gdb_test_multiple "continue" $test {
-re "Target returns error code .* too far .*$gdb_prompt $" {
- if {[string equal $trace_type "ftrace"]} {
+ if {[string equal $trace_type "ftrace"]} {
# Expected if the target was unable to install the
# fast tracepoint (e.g., jump pad too far from
# tracepoint).
pass "$test (too far)"
# Skip the rest of the tests.
return
- } else {
+ } else {
fail $test
- }
+ }
}
-re "Continuing.\r\n(Reading .* from remote target...\r\n)?\r\n(Thread .* hit )?Breakpoint.*marker.*at.*$srcfile.*$gdb_prompt $" {
pass "continue to marker 2"
gdb_trace_setactions "set action for tracepoint 1" "" \
"collect \$$pcreg" "^$"
gdb_test "${trace2} set_point" "\(Fast t|T\)racepoint \[0-9\] at $hex: file.*" \
- "${trace2} set_point 2"
+ "${trace2} set_point 2"
gdb_trace_setactions "set action for tracepoint 2" "" \
"collect \$$spreg" "^$"
# Save default trace buffer size in 'default_size'.
gdb_test_multiple "tstatus" $test {
-re ".*Trace buffer has ($decimal) bytes of ($decimal) bytes free.*$gdb_prompt $" {
- set default_size $expect_out(2,string)
- pass $test
+ set default_size $expect_out(2,string)
+ pass $test
}
}
gdb_test "tfind 0" "Found trace frame 0, tracepoint .*"
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}"
+ 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 "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.*"
<reg name="bad_reg2" bitsize="64" type="bitfield"/>
</feature>
</target>
-
}
"arm*-*-*" {
set regdir "arm/"
- set core-regs {arm-core.xml}
+ set core-regs {arm-core.xml}
}
"*m68k-*-*" {
- set core-regs {m68k-core.xml}
+ set core-regs {m68k-core.xml}
}
"mips*-*-*" {
set core-regs {mips-cpu.xml mips-cp0.xml mips-fpu.xml mips-dsp.xml}
}
"sparc-*-*" {
set regdir "sparc/"
- set core-regs {sparc32-cpu.xml sparc32-fpu.xml sparc32-cp0.xml}
+ set core-regs {sparc32-cpu.xml sparc32-fpu.xml sparc32-cp0.xml}
}
"sparc64-*-*" {
set architecture "sparc:v9"
set regdir "sparc/"
- set core-regs {sparc64-cpu.xml sparc64-fpu.xml sparc64-cp0.xml}
+ set core-regs {sparc64-cpu.xml sparc64-fpu.xml sparc64-cp0.xml}
}
"tic6x-*-*" {
set core-regs {tic6x-core.xml}
"i?86-*-*" {
set architecture "i386"
set regdir "i386/"
- set core-regs {32bit-core.xml 32bit-sse.xml}
+ set core-regs {32bit-core.xml 32bit-sse.xml}
}
"x86_64-*-*" {
set architecture "i386:x86-64"
set regdir "i386/"
- set core-regs {64bit-core.xml 64bit-sse.xml}
+ set core-regs {64bit-core.xml 64bit-sse.xml}
}
"riscv64*-*-*" {
set architecture "riscv:rv64"
append options " additional_flags=-I$srcdir"
set result [target_compile_ada_from_dir \
- $objdir [file tail $source] $dest $type $options]
+ $objdir [file tail $source] $dest $type $options]
# The Ada build always produces some output, even when the build
# succeeds. Thus, we can not use the output the same way we do in
set result ""
if {![is_remote host]} {
- set result [lookfor_file $root $tool]
+ set result [lookfor_file $root $tool]
if { $result != "" && $tool == "gnatlink" } {
set result "$result --GCC=$root/xgcc -B$root"
}
}
if {$result == ""} {
- set result [transform $tool]
+ set result [transform $tool]
}
return $result
set result [remote_exec host "$dtrace -h -s $dscript_file -o $out_header_file"]
verbose -log [lindex $result 1]
if {[lindex $result 0] != 0} {
- return -1
+ return -1
}
# 2. Compile testprogram.c.
set options [list debug quiet \
additional_flags=-I[file dirname $out_header_file]]
if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}.o" object ${options}] != ""} {
- return -1
+ return -1
}
# 3. Generate an object file containing a DOF program using dtrace -G.
set result [remote_exec host "$dtrace -G -s $dscript_file -o ${binfile}-p.o ${binfile}.o"]
verbose -log [lindex $result 1]
if {[lindex $result 0] != 0} {
- return -1
+ return -1
}
# 4. Link everything together to get the test program.
if {[gdb_compile "${binfile}.o ${binfile}-p.o" ${binfile} executable \
{debug quiet}] != ""} {
- return -1
+ return -1
}
}
set ret [$func $objects "${binfile}" executable $options]
if { $ret != "" } {
- untested $testname
- return -1
+ untested $testname
+ return -1
}
return 0
set GM ""
if {![is_remote host]} {
- set file [lookfor_file $root gnatmake]
- if { $file != "" } {
- set GM "$file -I$root/ada/rts --GCC=$root/xgcc --GNATBIND=$root/gnatbind --GNATLINK=$root/gnatlink -cargs -B$root -largs --GCC=$root/xgcc -margs";
- }
+ set file [lookfor_file $root gnatmake]
+ if { $file != "" } {
+ set GM "$file -I$root/ada/rts --GCC=$root/xgcc --GNATBIND=$root/gnatbind --GNATLINK=$root/gnatlink -cargs -B$root -largs --GCC=$root/xgcc -margs";
+ }
}
if {$GM == ""} {
- set GM [transform gnatmake]
+ set GM [transform gnatmake]
}
return $GM
foreach varname [info globals] {
if { ![info exists known_globals($varname)] } {
- gdb_persistent_global_no_decl $varname
+ gdb_persistent_global_no_decl $varname
}
}
if {$line_by_line} {
append code {
- -re "\r\n\[^\r\n\]*(?=\r\n)" {
- exp_continue
- }
+ -re "\r\n\[^\r\n\]*(?=\r\n)" {
+ exp_continue
+ }
}
}
pass "reject $sendthis"
return 1
}
- -re "Unmatched single quote.*$gdb_prompt $" {
- pass "reject $sendthis"
- return 1
- }
- -re "A character constant must contain at least one character.*$gdb_prompt $" {
- pass "reject $sendthis"
- return 1
- }
+ -re "Unmatched single quote.*$gdb_prompt $" {
+ pass "reject $sendthis"
+ return 1
+ }
+ -re "A character constant must contain at least one character.*$gdb_prompt $" {
+ pass "reject $sendthis"
+ return 1
+ }
-re "$expectthis.*$gdb_prompt $" {
pass "reject $sendthis"
return 1
set gdb_file_cmd_debug_info "nodebug"
return 0
}
- -re "(Reading symbols from.*$gdb_prompt $)" {
- verbose "\t\tLoaded $arg into $GDB"
+ -re "(Reading symbols from.*$gdb_prompt $)" {
+ verbose "\t\tLoaded $arg into $GDB"
set gdb_file_cmd_msg $expect_out(1,string)
set gdb_file_cmd_debug_info "debug"
return 0
- }
- -re "Load new symbol table from \".*\".*y or n. $" {
+ }
+ -re "Load new symbol table from \".*\".*y or n. $" {
if { $new_symbol_table > 0 } {
perror [join [list "Couldn't load $basename,"
"interactive prompt loop detected."]]
return -1
}
- send_gdb "y\n" answer
+ send_gdb "y\n" answer
incr new_symbol_table
set suffix "-- with new symbol table"
set arg "$arg $suffix"
set basename "$basename $suffix"
exp_continue
}
- -re "No such file or directory.*$gdb_prompt $" {
- perror "($basename) No such file or directory"
+ -re "No such file or directory.*$gdb_prompt $" {
+ perror "($basename) No such file or directory"
return -1
- }
+ }
-re "A problem internal to GDB has been detected" {
perror "Couldn't load $basename into GDB (GDB internal error)."
gdb_internal_error_resync
return -1
}
- -re "$gdb_prompt $" {
- perror "Couldn't load $basename into GDB."
+ -re "$gdb_prompt $" {
+ perror "Couldn't load $basename into GDB."
return -1
- }
- timeout {
- perror "Couldn't load $basename into GDB (timeout)."
+ }
+ timeout {
+ perror "Couldn't load $basename into GDB (timeout)."
return -1
- }
- eof {
- # This is an attempt to detect a core dump, but seems not to
- # work. Perhaps we need to match .* followed by eof, in which
- # gdb_expect does not seem to have a way to do that.
- perror "Couldn't load $basename into GDB (eof)."
+ }
+ eof {
+ # This is an attempt to detect a core dump, but seems not to
+ # work. Perhaps we need to match .* followed by eof, in which
+ # gdb_expect does not seem to have a way to do that.
+ perror "Couldn't load $basename into GDB (eof)."
return -1
- }
+ }
}
}
r_debug = 0;
/* Taken from /usr/include/link.h. */
for (dyn = _DYNAMIC; dyn->d_tag != DT_NULL; ++dyn)
- if (dyn->d_tag == DT_DEBUG)
- r_debug = (struct r_debug *) dyn->d_un.d_ptr;
+ if (dyn->d_tag == DT_DEBUG)
+ r_debug = (struct r_debug *) dyn->d_un.d_ptr;
if (!r_debug) {
- printf ("r_debug not found.\n");
+ printf ("r_debug not found.\n");
return 1;
}
if (r_debug->r_version < 2) {
- printf ("dlmopen debug not supported.\n");
+ printf ("dlmopen debug not supported.\n");
return 1;
}
printf ("dlmopen debug supported.\n");
return 0
}
gdb_expect {
- -re "$inferior_exited_re normally.*${gdb_prompt} $" {
+ -re "$inferior_exited_re normally.*${gdb_prompt} $" {
set allow_dlmopen_tests 1
- }
- -re "$inferior_exited_re with code.*${gdb_prompt} $" {
+ }
+ -re "$inferior_exited_re with code.*${gdb_prompt} $" {
set allow_dlmopen_tests 0
- }
- default {
+ }
+ default {
warning "\n$me: default case taken"
set allow_dlmopen_tests 0
- }
+ }
}
gdb_exit
}
if { [istarget "arm*-*-linux*"] || [istarget "x86_64-*-linux*"]
- || [istarget "i\[34567\]86-*-linux*"]
- || [istarget "aarch64*-*-linux*"]
+ || [istarget "i\[34567\]86-*-linux*"]
+ || [istarget "aarch64*-*-linux*"]
|| [istarget "loongarch*-*-linux*"]
- || [istarget "powerpc*-*-linux*"]
+ || [istarget "powerpc*-*-linux*"]
|| [istarget "s390*-*-linux*"]
|| [istarget "riscv*-*-*"] } {
return 1
}
if { [istarget "arm*-*-linux*"] || [istarget "x86_64-*-linux*"]
- || [istarget "i\[34567\]86-*-linux*"]
- || [istarget "aarch64*-*-linux*"]
+ || [istarget "i\[34567\]86-*-linux*"]
+ || [istarget "aarch64*-*-linux*"]
|| [istarget "loongarch*-*-linux*"]
- || [istarget "powerpc*-*-linux*"]
+ || [istarget "powerpc*-*-linux*"]
|| [istarget "s390*-*-linux*"]
|| [istarget "riscv*-*-*"] } {
return 1
set src { int foo () {return 0;} }
if {![gdb_simple_compile elf_target $src]} {
- return 0
+ return 0
}
set fp_obj [open $obj "r"]
# Make sure we have a compiler that understands altivec.
if {[test_compiler_info gcc*]} {
- set compile_flags "additional_flags=-maltivec"
+ set compile_flags "additional_flags=-maltivec"
} elseif {[test_compiler_info xlc*]} {
- set compile_flags "additional_flags=-qaltivec"
+ set compile_flags "additional_flags=-qaltivec"
} else {
verbose "Could not compile with altivec support, returning 0" 2
return 0
gdb_load "$obj"
gdb_run_cmd
gdb_expect {
- -re ".*Illegal instruction.*${gdb_prompt} $" {
- verbose -log "\n$me altivec hardware not detected"
+ -re ".*Illegal instruction.*${gdb_prompt} $" {
+ verbose -log "\n$me altivec hardware not detected"
set allow_vmx_tests 0
- }
- -re ".*$inferior_exited_re normally.*${gdb_prompt} $" {
- verbose -log "\n$me: altivec hardware detected"
+ }
+ -re ".*$inferior_exited_re normally.*${gdb_prompt} $" {
+ verbose -log "\n$me: altivec hardware detected"
set allow_vmx_tests 1
- }
- default {
- warning "\n$me: default case taken"
+ }
+ default {
+ warning "\n$me: default case taken"
set allow_vmx_tests 0
- }
+ }
}
gdb_exit
remote_file build delete $obj
gdb_load "$obj"
gdb_run_cmd
gdb_expect {
- -re ".*Illegal instruction.*${gdb_prompt} $" {
- verbose -log "\n$me Power ISA 3.1 hardware not detected"
+ -re ".*Illegal instruction.*${gdb_prompt} $" {
+ verbose -log "\n$me Power ISA 3.1 hardware not detected"
set allow_power_isa_3_1_tests 0
- }
- -re ".*$inferior_exited_re normally.*${gdb_prompt} $" {
- verbose -log "\n$me: Power ISA 3.1 hardware detected"
+ }
+ -re ".*$inferior_exited_re normally.*${gdb_prompt} $" {
+ verbose -log "\n$me: Power ISA 3.1 hardware detected"
set allow_power_isa_3_1_tests 1
- }
- default {
+ }
+ default {
warning "\n$me: default case taken"
set allow_power_isa_3_1_tests 0
- }
+ }
}
gdb_exit
remote_file build delete $obj
# Make sure we have a compiler that understands altivec.
if {[test_compiler_info gcc*]} {
- set compile_flags "additional_flags=-mvsx"
+ set compile_flags "additional_flags=-mvsx"
} elseif {[test_compiler_info xlc*]} {
- set compile_flags "additional_flags=-qasm=gcc"
+ set compile_flags "additional_flags=-qasm=gcc"
} else {
verbose "Could not compile with vsx support, returning 0" 2
return 0
gdb_load "$obj"
gdb_run_cmd
gdb_expect {
- -re ".*Illegal instruction.*${gdb_prompt} $" {
- verbose -log "\n$me VSX hardware not detected"
+ -re ".*Illegal instruction.*${gdb_prompt} $" {
+ verbose -log "\n$me VSX hardware not detected"
set allow_vsx_tests 0
- }
- -re ".*$inferior_exited_re normally.*${gdb_prompt} $" {
- verbose -log "\n$me: VSX hardware detected"
+ }
+ -re ".*$inferior_exited_re normally.*${gdb_prompt} $" {
+ verbose -log "\n$me: VSX hardware detected"
set allow_vsx_tests 1
- }
- default {
- warning "\n$me: default case taken"
+ }
+ default {
+ warning "\n$me: default case taken"
set allow_vsx_tests 0
- }
+ }
}
gdb_exit
remote_file build delete $obj
# Compile a test program.
set src {
- int main() {
- asm volatile ("xbegin .L0");
- asm volatile ("xend");
- asm volatile (".L0: nop");
- return 0;
- }
+ int main() {
+ asm volatile ("xbegin .L0");
+ asm volatile ("xend");
+ asm volatile (".L0: nop");
+ return 0;
+ }
}
if {![gdb_simple_compile $me $src executable]} {
return 0
gdb_load "$obj"
gdb_run_cmd
gdb_expect {
- -re ".*Illegal instruction.*${gdb_prompt} $" {
- verbose -log "$me: TSX hardware not detected."
+ -re ".*Illegal instruction.*${gdb_prompt} $" {
+ verbose -log "$me: TSX hardware not detected."
set allow_tsx_tests 0
- }
- -re ".*$inferior_exited_re normally.*${gdb_prompt} $" {
- verbose -log "$me: TSX hardware detected."
+ }
+ -re ".*$inferior_exited_re normally.*${gdb_prompt} $" {
+ verbose -log "$me: TSX hardware detected."
set allow_tsx_tests 1
- }
- default {
- warning "\n$me: default case taken."
+ }
+ default {
+ warning "\n$me: default case taken."
set allow_tsx_tests 0
- }
+ }
}
gdb_exit
remote_file build delete $obj
# Compile a test program.
set src {
- int main() {
- asm volatile ("vcvtne2ps2bf16 %xmm0, %xmm1, %xmm0");
- return 0;
- }
+ int main() {
+ asm volatile ("vcvtne2ps2bf16 %xmm0, %xmm1, %xmm0");
+ return 0;
+ }
}
if {![gdb_simple_compile $me $src executable]} {
return 0
gdb_load "$obj"
gdb_run_cmd
gdb_expect {
- -re ".*Illegal instruction.*${gdb_prompt} $" {
- verbose -log "$me: avx512bf16 hardware not detected."
+ -re ".*Illegal instruction.*${gdb_prompt} $" {
+ verbose -log "$me: avx512bf16 hardware not detected."
set allow_avx512bf16_tests 0
- }
- -re ".*$inferior_exited_re normally.*${gdb_prompt} $" {
- verbose -log "$me: avx512bf16 hardware detected."
+ }
+ -re ".*$inferior_exited_re normally.*${gdb_prompt} $" {
+ verbose -log "$me: avx512bf16 hardware detected."
set allow_avx512bf16_tests 1
- }
- default {
- warning "\n$me: default case taken."
+ }
+ default {
+ warning "\n$me: default case taken."
set allow_avx512bf16_tests 0
- }
+ }
}
gdb_exit
remote_file build delete $obj
# Compile a test program.
set src {
- int main() {
- asm volatile ("vcvtps2phx %xmm1, %xmm0");
- return 0;
- }
+ int main() {
+ asm volatile ("vcvtps2phx %xmm1, %xmm0");
+ return 0;
+ }
}
if {![gdb_simple_compile $me $src executable]} {
return 0
gdb_load "$obj"
gdb_run_cmd
gdb_expect {
- -re ".*Illegal instruction.*${gdb_prompt} $" {
- verbose -log "$me: avx512fp16 hardware not detected."
+ -re ".*Illegal instruction.*${gdb_prompt} $" {
+ verbose -log "$me: avx512fp16 hardware not detected."
set allow_avx512fp16_tests 0
- }
- -re ".*$inferior_exited_re normally.*${gdb_prompt} $" {
- verbose -log "$me: avx512fp16 hardware detected."
+ }
+ -re ".*$inferior_exited_re normally.*${gdb_prompt} $" {
+ verbose -log "$me: avx512fp16 hardware detected."
set allow_avx512fp16_tests 1
- }
- default {
- warning "\n$me: default case taken."
+ }
+ default {
+ warning "\n$me: default case taken."
set allow_avx512fp16_tests 0
- }
+ }
}
gdb_exit
remote_file build delete $obj
# In case of an unexpected output, we return 2 as a fail value.
set allow_btrace_tests 2
gdb_test_multiple "record btrace" "check btrace support" {
- -re "You can't do that when your target is.*\r\n$gdb_prompt $" {
+ -re "You can't do that when your target is.*\r\n$gdb_prompt $" {
set allow_btrace_tests 0
- }
- -re "Target does not support branch tracing.*\r\n$gdb_prompt $" {
+ }
+ -re "Target does not support branch tracing.*\r\n$gdb_prompt $" {
set allow_btrace_tests 0
- }
- -re "Could not enable branch tracing.*\r\n$gdb_prompt $" {
+ }
+ -re "Could not enable branch tracing.*\r\n$gdb_prompt $" {
set allow_btrace_tests 0
- }
- -re "^record btrace\r\n$gdb_prompt $" {
+ }
+ -re "^record btrace\r\n$gdb_prompt $" {
set allow_btrace_tests 1
- }
+ }
}
gdb_exit
remote_file build delete $obj
# In case of an unexpected output, we return 2 as a fail value.
set allow_btrace_pt_tests 2
gdb_test_multiple "record btrace pt" "check btrace pt support" {
- -re "You can't do that when your target is.*\r\n$gdb_prompt $" {
+ -re "You can't do that when your target is.*\r\n$gdb_prompt $" {
set allow_btrace_pt_tests 0
- }
- -re "Target does not support branch tracing.*\r\n$gdb_prompt $" {
+ }
+ -re "Target does not support branch tracing.*\r\n$gdb_prompt $" {
set allow_btrace_pt_tests 0
- }
- -re "Could not enable branch tracing.*\r\n$gdb_prompt $" {
+ }
+ -re "Could not enable branch tracing.*\r\n$gdb_prompt $" {
set allow_btrace_pt_tests 0
- }
- -re "support was disabled at compile time.*\r\n$gdb_prompt $" {
+ }
+ -re "support was disabled at compile time.*\r\n$gdb_prompt $" {
set allow_btrace_pt_tests 0
- }
- -re "^record btrace pt\r\n$gdb_prompt $" {
+ }
+ -re "^record btrace pt\r\n$gdb_prompt $" {
set allow_btrace_pt_tests 1
- }
+ }
}
gdb_exit
remote_file build delete $obj
}
}
if {![gdb_simple_compile $me $src executable $compile_flags]} {
- return 0
+ return 0
}
# Compilation succeeded so now run it via gdb.
gdb_load $obj
gdb_run_cmd
gdb_expect {
- -re ".*Illegal instruction.*${gdb_prompt} $" {
- verbose -log "\n$me sve hardware not detected"
- set allow_sve_tests 0
- }
- -re ".*$inferior_exited_re normally.*${gdb_prompt} $" {
- verbose -log "\n$me: sve hardware detected"
- set allow_sve_tests 1
- }
- default {
- warning "\n$me: default case taken"
- set allow_sve_tests 0
- }
+ -re ".*Illegal instruction.*${gdb_prompt} $" {
+ verbose -log "\n$me sve hardware not detected"
+ set allow_sve_tests 0
+ }
+ -re ".*$inferior_exited_re normally.*${gdb_prompt} $" {
+ verbose -log "\n$me: sve hardware detected"
+ set allow_sve_tests 1
+ }
+ default {
+ warning "\n$me: default case taken"
+ set allow_sve_tests 0
+ }
}
gdb_exit
remote_file build delete $obj
proc current_target_name { } {
global target_info
if {[info exists target_info(target,name)]} {
- set answer $target_info(target,name)
+ set answer $target_info(target,name)
} else {
- set answer ""
+ set answer ""
}
return $answer
}
upvar $object obj
switch -regexp -- $type {
- "executable" {
- set postfix "x"
- }
- "object" {
- set postfix "o"
- }
- "preprocess" {
- set postfix "i"
- }
- "assembly" {
- set postfix "s"
- }
+ "executable" {
+ set postfix "x"
+ }
+ "object" {
+ set postfix "o"
+ }
+ "preprocess" {
+ set postfix "i"
+ }
+ "assembly" {
+ set postfix "s"
+ }
}
set ext "c"
foreach flag $compile_flags {
file delete $src
if {![string match "" $lines]} {
- verbose "$name: compilation failed, returning 0" 2
- return 0
+ verbose "$name: compilation failed, returning 0" 2
+ return 0
}
return 1
}
set shlib_found 0
set shlib_load 0
foreach opt $options {
- if {[regexp {^shlib=(.*)} $opt dummy_var shlib_name]
+ if {[regexp {^shlib=(.*)} $opt dummy_var shlib_name]
&& $type == "executable"} {
- if {[test_compiler_info "xlc-*"]} {
+ if {[test_compiler_info "xlc-*"]} {
# IBM xlc compiler doesn't accept shared library named other
# than .so: use "-Wl," to bypass this
lappend source "-Wl,$shlib_name"
|| [istarget *-*-cygwin*]
|| [istarget *-*-pe*])} {
lappend source "${shlib_name}.a"
- } else {
- lappend source $shlib_name
- }
- if { $shlib_found == 0 } {
- set shlib_found 1
+ } else {
+ lappend source $shlib_name
+ }
+ if { $shlib_found == 0 } {
+ set shlib_found 1
if { ([istarget "*-*-mingw*"]
|| [istarget *-*-cygwin*]) } {
lappend new_options "ldflags=-Wl,--enable-auto-import"
# shlibs!
lappend new_options "early_flags=-Wl,--no-as-needed"
}
- }
+ }
} elseif { $opt == "shlib_load" && $type == "executable" } {
set shlib_load 1
} elseif { $opt == "getting_compiler_info" } {
# Ignore this setting here as it has been handled earlier in this
# procedure. Do not append it to new_options as this will cause
# recursion.
- } elseif {[regexp "^text_segment=(.*)" $opt dummy_var addr]} {
- if { [linker_supports_Ttext_segment_flag] } {
- # For GNU ld.
- lappend new_options "ldflags=-Wl,-Ttext-segment=$addr"
- } elseif { [linker_supports_image_base_flag] } {
- # For LLVM's lld.
- lappend new_options "ldflags=-Wl,--image-base=$addr"
- } elseif { [linker_supports_Ttext_flag] } {
- # For old GNU gold versions.
- lappend new_options "ldflags=-Wl,-Ttext=$addr"
- } else {
- error "Don't know how to handle text_segment option."
- }
+ } elseif {[regexp "^text_segment=(.*)" $opt dummy_var addr]} {
+ if { [linker_supports_Ttext_segment_flag] } {
+ # For GNU ld.
+ lappend new_options "ldflags=-Wl,-Ttext-segment=$addr"
+ } elseif { [linker_supports_image_base_flag] } {
+ # For LLVM's lld.
+ lappend new_options "ldflags=-Wl,--image-base=$addr"
+ } elseif { [linker_supports_Ttext_flag] } {
+ # For old GNU gold versions.
+ lappend new_options "ldflags=-Wl,-Ttext=$addr"
+ } else {
+ error "Don't know how to handle text_segment option."
+ }
} elseif { $opt == "column-info" } {
# If GCC or clang does not support column-info, compilation
# will fail and the usupported column-info option will be
} else {
error "No idea how to force DWARF-5 in this compiler"
}
- } else {
- lappend new_options $opt
- }
+ } else {
+ lappend new_options $opt
+ }
}
# Ensure stack protector is disabled for GCC, as this causes problems with
&& !([test_compiler_info {gcc-[0-3]-*}]
|| [test_compiler_info {gcc-4-0-*}])
&& [lsearch -exact $options rust] == -1} {
- # Put it at the front to not override any user-provided value.
- lappend new_options "early_flags=-fno-stack-protector"
+ # Put it at the front to not override any user-provided value.
+ lappend new_options "early_flags=-fno-stack-protector"
}
# hipcc defaults to -O2, so add -O0 to early flags for the hip language.
set built_binfile 0
set why_msg "unrecognized error"
foreach lib {-lpthreads -lpthread -lthread ""} {
- # This kind of wipes out whatever libs the caller may have
- # set. Or maybe theirs will override ours. How infelicitous.
- set options_with_lib [concat $options [list libs=$lib quiet]]
- set ccout [gdb_compile $source $dest $type $options_with_lib]
- switch -regexp -- $ccout {
- ".*no posix threads support.*" {
- set why_msg "missing threads include file"
- break
- }
- ".*cannot open -lpthread.*" {
- set why_msg "missing runtime threads library"
- }
- ".*Can't find library for -lpthread.*" {
- set why_msg "missing runtime threads library"
- }
- {^$} {
- pass "successfully compiled posix threads test case"
- set built_binfile 1
- break
- }
- }
+ # This kind of wipes out whatever libs the caller may have
+ # set. Or maybe theirs will override ours. How infelicitous.
+ set options_with_lib [concat $options [list libs=$lib quiet]]
+ set ccout [gdb_compile $source $dest $type $options_with_lib]
+ switch -regexp -- $ccout {
+ ".*no posix threads support.*" {
+ set why_msg "missing threads include file"
+ break
+ }
+ ".*cannot open -lpthread.*" {
+ set why_msg "missing runtime threads library"
+ }
+ ".*Can't find library for -lpthread.*" {
+ set why_msg "missing runtime threads library"
+ }
+ {^$} {
+ pass "successfully compiled posix threads test case"
+ set built_binfile 1
+ break
+ }
+ }
}
if {!$built_binfile} {
unsupported "couldn't compile [file tail $source]: ${why_msg}"
- return -1
+ return -1
}
}
}
switch -glob [test_compiler_info "" ${info_options}] {
- "xlc-*" {
- lappend obj_options "additional_flags=-qpic"
- }
+ "xlc-*" {
+ lappend obj_options "additional_flags=-qpic"
+ }
"clang-*" {
if { [istarget "*-*-cygwin*"]
|| [istarget "*-*-mingw*"] } {
lappend obj_options "additional_flags=-fpic"
}
}
- "gcc-*" {
- if { [istarget "powerpc*-*-aix*"]
- || [istarget "rs6000*-*-aix*"]
- || [istarget "*-*-cygwin*"]
- || [istarget "*-*-mingw*"]
- || [istarget "*-*-pe*"] } {
- lappend obj_options "additional_flags=-fPIC"
+ "gcc-*" {
+ if { [istarget "powerpc*-*-aix*"]
+ || [istarget "rs6000*-*-aix*"]
+ || [istarget "*-*-cygwin*"]
+ || [istarget "*-*-mingw*"]
+ || [istarget "*-*-pe*"] } {
+ lappend obj_options "additional_flags=-fPIC"
} else {
- lappend obj_options "additional_flags=-fpic"
- }
- }
- "icc-*" {
- lappend obj_options "additional_flags=-fpic"
- }
- default {
+ lappend obj_options "additional_flags=-fpic"
+ }
+ }
+ "icc-*" {
+ lappend obj_options "additional_flags=-fpic"
+ }
+ default {
# don't know what the compiler is...
lappend obj_options "additional_flags=-fPIC"
- }
+ }
}
set outdir [file dirname $dest]
set built_binfile 0
set why_msg "unrecognized error"
foreach lib {-lpthreads -lpthread -lthread ""} {
- # This kind of wipes out whatever libs the caller may have
- # set. Or maybe theirs will override ours. How infelicitous.
- set options_with_lib [concat $options [list libs=$lib quiet]]
- set ccout [gdb_compile_shlib $sources $dest $options_with_lib]
- switch -regexp -- $ccout {
- ".*no posix threads support.*" {
- set why_msg "missing threads include file"
- break
- }
- ".*cannot open -lpthread.*" {
- set why_msg "missing runtime threads library"
- }
- ".*Can't find library for -lpthread.*" {
- set why_msg "missing runtime threads library"
- }
- {^$} {
- pass "successfully compiled posix threads shlib test case"
- set built_binfile 1
- break
- }
- }
+ # This kind of wipes out whatever libs the caller may have
+ # set. Or maybe theirs will override ours. How infelicitous.
+ set options_with_lib [concat $options [list libs=$lib quiet]]
+ set ccout [gdb_compile_shlib $sources $dest $options_with_lib]
+ switch -regexp -- $ccout {
+ ".*no posix threads support.*" {
+ set why_msg "missing threads include file"
+ break
+ }
+ ".*cannot open -lpthread.*" {
+ set why_msg "missing runtime threads library"
+ }
+ ".*Can't find library for -lpthread.*" {
+ set why_msg "missing runtime threads library"
+ }
+ {^$} {
+ pass "successfully compiled posix threads shlib test case"
+ set built_binfile 1
+ break
+ }
+ }
}
if {!$built_binfile} {
- unsupported "couldn't compile $sources: ${why_msg}"
- return -1
+ unsupported "couldn't compile $sources: ${why_msg}"
+ return -1
}
}
set built_binfile 0
set why_msg "unrecognized error"
foreach lib {-lobjc -lpthreads -lpthread -lthread solaris} {
- # This kind of wipes out whatever libs the caller may have
- # set. Or maybe theirs will override ours. How infelicitous.
- if { $lib == "solaris" } {
- set lib "-lpthread -lposix4"
+ # This kind of wipes out whatever libs the caller may have
+ # set. Or maybe theirs will override ours. How infelicitous.
+ if { $lib == "solaris" } {
+ set lib "-lpthread -lposix4"
}
- if { $lib != "-lobjc" } {
+ if { $lib != "-lobjc" } {
set lib "-lobjc $lib"
}
- set options_with_lib [concat $options [list libs=$lib quiet]]
- set ccout [gdb_compile $source $dest $type $options_with_lib]
- switch -regexp -- $ccout {
- ".*no posix threads support.*" {
- set why_msg "missing threads include file"
- break
- }
- ".*cannot open -lpthread.*" {
- set why_msg "missing runtime threads library"
- }
- ".*Can't find library for -lpthread.*" {
- set why_msg "missing runtime threads library"
- }
- {^$} {
- pass "successfully compiled objc with posix threads test case"
- set built_binfile 1
- break
- }
- }
+ set options_with_lib [concat $options [list libs=$lib quiet]]
+ set ccout [gdb_compile $source $dest $type $options_with_lib]
+ switch -regexp -- $ccout {
+ ".*no posix threads support.*" {
+ set why_msg "missing threads include file"
+ break
+ }
+ ".*cannot open -lpthread.*" {
+ set why_msg "missing runtime threads library"
+ }
+ ".*Can't find library for -lpthread.*" {
+ set why_msg "missing runtime threads library"
+ }
+ {^$} {
+ pass "successfully compiled objc with posix threads test case"
+ set built_binfile 1
+ break
+ }
+ }
}
if {!$built_binfile} {
- unsupported "couldn't compile [file tail $source]: ${why_msg}"
- return -1
+ unsupported "couldn't compile [file tail $source]: ${why_msg}"
+ return -1
}
}
{uplevel remote_expect host $tmt $expcode} string]
if {$code == 1} {
- global errorInfo errorCode
+ global errorInfo errorCode
return -code error -errorinfo $errorInfo -errorcode $errorCode $string
} else {
while { ${index} < [llength ${list}] } {
set pattern [lindex ${list} ${index}]
- incr index
+ incr index
verbose -log "gdb_expect_list pattern: /$pattern/" 2
if { ${index} == [llength ${list}] } {
if { ${ok} } {
global banned_traced
if {!$banned_traced} {
foreach banned_var $banned_variables {
- global "$banned_var"
- trace add variable "$banned_var" write error
+ global "$banned_var"
+ trace add variable "$banned_var" write error
}
foreach banned_proc $banned_procedures {
global "$banned_proc"
global banned_procedures
global banned_traced
if {$banned_traced} {
- foreach banned_var $banned_variables {
- global "$banned_var"
- trace remove variable "$banned_var" write error
+ foreach banned_var $banned_variables {
+ global "$banned_var"
+ trace remove variable "$banned_var" write error
}
foreach banned_proc $banned_procedures {
global "$banned_proc"
}
if {$found == -1} {
- error "undefined tag \"$text\""
+ error "undefined tag \"$text\""
}
return $found
global help_list_trailer
if {[llength $list_of_commands]>0} {
set l_list_of_commands {"List of commands:[\r\n]+[\r\n]+"}
- set l_list_of_commands [concat $l_list_of_commands $list_of_commands]
+ set l_list_of_commands [concat $l_list_of_commands $list_of_commands]
set l_list_of_commands [concat $l_list_of_commands {"[\r\n]+[\r\n]+"}]
} else {
- set l_list_of_commands {"List of commands\:.*[\r\n]+"}
+ set l_list_of_commands {"List of commands\:.*[\r\n]+"}
}
set l_stock_body {
- "Type \"help\" followed by command name for full documentation\.[\r\n]+"
+ "Type \"help\" followed by command name for full documentation\.[\r\n]+"
}
set l_entire_body [concat $expected_initial_lines $l_list_of_commands \
$l_stock_body $help_list_trailer]
global help_list_trailer
set command [lindex $command_list 0]
if {[llength $command_list]>1} {
- set full_command [lindex $command_list 1]
+ set full_command [lindex $command_list 1]
} else {
- set full_command $command
+ set full_command $command
}
# Use 'list' and not just {} because we want variables to
# be expanded in this list.
set l_stock_body [list\
- "List of \"$full_command\" subcommands\:.*\[\r\n\]+"\
- "Type \"help $full_command\" followed by subcommand name for full documentation\.\[\r\n\]+"]
+ "List of \"$full_command\" subcommands\:.*\[\r\n\]+"\
+ "Type \"help $full_command\" followed by subcommand name for full documentation\.\[\r\n\]+"]
set l_entire_body [concat $expected_initial_lines $l_stock_body $help_list_trailer]
if {[llength $args]>0} {
- help_test_raw "help ${command}" $l_entire_body [lindex $args 0]
+ help_test_raw "help ${command}" $l_entire_body [lindex $args 0]
} else {
- help_test_raw "help ${command}" $l_entire_body
+ help_test_raw "help ${command}" $l_entire_body
}
}
set ret [$func $objects "${binfile}" executable $options]
}
if { $ret != "" } {
- untested $testname
- return -1
+ untested $testname
+ return -1
}
return 0
# to gdb_compile directly.
proc build_executable { testname executable {sources ""} {options {debug}} } {
if {[llength $sources]==0} {
- set sources ${executable}.c
+ set sources ${executable}.c
}
set arglist [list $testname $executable $options]
proc prepare_for_testing { testname executable {sources ""} {options {debug}}} {
if {[build_executable $testname $executable $sources $options] == -1} {
- return -1
+ return -1
}
clean_restart $executable
set src { int main() { return 0; } }
if {![gdb_simple_compile $me $src executable]} {
- return 0
+ return 0
}
clean_restart
gdb_load $obj
if {![runto_main]} {
- return 0
+ return 0
}
set res [get_endianness]
# Compile a simple test program...
set src { int main() { return 0; } }
if {![gdb_simple_compile target_symbol_prefix $src executable]} {
- return 0
+ return 0
}
set prefix ""
set src { int main() { return 0; } }
if {![gdb_simple_compile $me $src executable]} {
- return 0
+ return 0
}
clean_restart
gdb_load $obj
if {![runto_main]} {
- return 0
+ return 0
}
set supports_schedule_locking -1
return [gdb_can_simple_compile nested_func {
int main () {
int foo () {
- return 0;
+ return 0;
}
return foo ();
}
set status [lindex $result 0]
set output [lindex $result 1]
if {$status == 0} {
- pass $test
- return 0
+ pass $test
+ return 0
} else {
verbose -log "run_on_host failed: $output"
if { $output == "spawn failed" } {
# Check message types.
switch -regexp -- $type {
- "answer" {
- return
- }
- "optional" {
- return
- }
+ "answer" {
+ return
+ }
+ "optional" {
+ return
+ }
}
# Write to the log and make sure the output is there, even in case
# Return as appropriate.
if { $code == 1 } {
- global errorInfo errorCode
- return -code error -errorinfo $errorInfo -errorcode $errorCode $result
+ global errorInfo errorCode
+ return -code error -errorinfo $errorInfo -errorcode $errorCode $result
} elseif { $code > 1 } {
- return -code $code $result
+ return -code $code $result
}
return $result
set me "have_avx"
if { ![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"] } {
- verbose "$me: target does not support avx, returning 0" 2
- return 0
+ verbose "$me: target does not support avx, returning 0" 2
+ return 0
}
# Compile a test program.
}
set compile_flags "incdir=${srcdir}/.."
if {![gdb_simple_compile $me $src executable $compile_flags]} {
- return 0
+ return 0
}
set target_obj [gdb_remote_download target $obj]
}
if {![gdb_simple_compile $me $src executable $compile_flags]} {
- return 0
+ return 0
}
gdb_start
-re ".*Hardware watchpoint.*" {
# HW watchpoint supported by platform
verbose -log "\n$me: Hardware watchpoint detected"
- set has_hw_wp_support 1
+ set has_hw_wp_support 1
}
-re ".*$gdb_prompt $" {
set has_hw_wp_support 0
# reason. Return that we are not root, so problems are easier to
# spot.
if { $ret_val != 0 } {
- return 0
+ return 0
}
regexp -all ".*uid=(\[0-9\]+).*" $output dummy uid
exp_continue
}
-re "unknown host.*$gdb_prompt" {
- verbose "Couldn't look up $serialport"
+ verbose "Couldn't look up $serialport"
}
-re "Couldn't establish connection to remote.*$gdb_prompt $" {
verbose "Connection failed"
exp_continue
}
}
- timeout {
- warning "Timed out waiting for EOF in server after $monitor_exit"
- }
+ timeout {
+ warning "Timed out waiting for EOF in server after $monitor_exit"
+ }
}
}
}
foreach entry [split $gdbserverdebug ,] {
if { $entry == "replay" || $entry == "all"} {
set replayfile [standard_output_file_with_gdb_instance gdbserver.replay]
- send_gdb "set remotelogfile $replayfile\n" optional
+ send_gdb "set remotelogfile $replayfile\n" optional
gdb_expect 10 {
-re "$gdb_prompt $" {}
}
}
verbose -log "_gen_sha1sum_for_inputs: summing $source_files $header_paths $inputs"
set catch_result [catch {exec $CAT_PROGRAM $source_files $header_paths $inputs | $SHA1SUM_PROGRAM} output]
- return [list $catch_result $output]
+ return [list $catch_result $output]
}
# Return the contents of TEXT_FILE.
gdb_test_multiple "delete mem" "delete mem" {
-re "Delete all memory regions.*y or n.*$" {
- send_gdb "y\n"
- exp_continue
+ send_gdb "y\n"
+ exp_continue
}
-re "$gdb_prompt $" { }
}
foreach var $modes {
with_test_prefix "$var_name=$var" {
- set code [catch {uplevel 1 $body} result]
+ set code [catch {uplevel 1 $body} result]
}
if {$code == 1} {
- global errorInfo errorCode
- return -code $code -errorinfo $errorInfo -errorcode $errorCode $result
+ global errorInfo errorCode
+ return -code $code -errorinfo $errorInfo -errorcode $errorCode $result
} elseif {$code == 3} {
- break
+ break
} elseif {$code == 2} {
- return -code $code $result
+ return -code $code $result
}
}
}
clean_restart "$executable"
gdb_run_cmd
gdb_expect 30 {
- -re ".*$inferior_exited_re normally.*${gdb_prompt} $" {
- verbose -log "\n$me: OpenCL support detected"
+ -re ".*$inferior_exited_re normally.*${gdb_prompt} $" {
+ verbose -log "\n$me: OpenCL support detected"
set result 1
- }
- -re ".*$inferior_exited_re with code.*${gdb_prompt} $" {
- verbose -log "\n$me: OpenCL support not detected"
+ }
+ -re ".*$inferior_exited_re with code.*${gdb_prompt} $" {
+ verbose -log "\n$me: OpenCL support not detected"
set result 0
- }
- default {
- verbose -log "\n$me OpenCL support not detected (default case)"
+ }
+ default {
+ verbose -log "\n$me OpenCL support not detected (default case)"
set result 0
- }
+ }
}
gdb_exit
remote_file build delete $executable
CHK (clGetProgramBuildInfo (program, device, CL_PROGRAM_BUILD_LOG,
len, clbuild_log, NULL));
fprintf (stderr, "clBuildProgram failed with:\n%s\n", clbuild_log);
- free (clbuild_log);
- }
+ free (clbuild_log);
+ }
exit (EXIT_FAILURE);
}
} elseif { [which $gpc_compiler] != 0 } {
set pascal_compiler_is_gpc 1
verbose -log "GNU Pascal compiler found"
- } elseif { [which $fpc_compiler] != 0 } {
+ } elseif { [which $fpc_compiler] != 0 } {
set pascal_compiler_is_fpc 1
verbose -log "Free Pascal compiler found"
}
file delete $destfile
if { $pascal_compiler_is_fpc == 1 } {
- set result [fpc_compile $source $destfile $type $options]
+ set result [fpc_compile $source $destfile $type $options]
} elseif { $pascal_compiler_is_gpc == 1 } {
- set result [gpc_compile $source $destfile $type $options]
+ set result [gpc_compile $source $destfile $type $options]
} else {
unsupported "no pascal compiler found"
return "No pascal compiler. Compilation failed."
}
if {![file exists $destfile]} {
- unsupported "Pascal compilation failed: $result"
- return "Pascal compilation failed."
+ unsupported "Pascal compilation failed: $result"
+ return "Pascal compilation failed."
}
}
offset=$((offset + 3))
fi
fi
-
+
# Determine the base address of the probe and its
# corresponding function name.
funcs=$($NM -td $objfile | $EGREP "^[0-9]+ T " \
# described in the d-script file and they don't receive any
# argument.
test "$type" = "p" || continue
-
+
# Names are mangled in d-script files to make it possible to
# have underscore characters as part of the provider name and
# probe name.
m_provider=$(printf %s $provider | $SED -e 's/_/__/g')
m_name=$(printf %s $name | $SED -e 's/_/__/g')
-
+
# Ignore this probe if the d-script file does not describe its
# provider.
$EGREP -q "provider +$m_provider" $dscript || continue
-
+
# Look for the line containing the description of the probe.
# If we can't find it then ignore this probe.
line=$($EGREP "^ *probe +$m_name *\(.*\);" $dscript)
test -n "$line" || continue
-
+
# Ok, extract the argument types from the probe prototype.
# This is fragile as hell as it requires the prototype to be
# in a single line.
# probes, base_probes, providers, probes_args, BCOUNT
f_gen_dof_program()
-{
+{
###### Variables used to cache information needed later.
-
+
# Number of section headers in the generated DOF program.
dof_secnum=0
# Offset of section headers in the generated DOF program, in bytes.
strtab_size=0
offtab_size=0
eofftab_size=0
-
+
# Offsets of the STRTAB, OFFTAB EOFFTAB and PROBES sections in the
# generated DOF program. In bytes.
strtab_offset=0
eofftab_offset=0
argtab_offset=0
probes_offset=0
-
+
# Indexes of the section headers of the STRTAB, OFFTAB, EOFFTAB and
# PROBES sections in the sections array.
strtab_sect_index=0
# Lines: PROVIDER(S) NAME(S) BASE(D) (DOF_OFFSET(D)|DOF_EOFFSET(D))
probes_dof_offsets=
probes_dof_eoffsets=
-
+
# Offsets in the STRTAB section for the first type of base probes.
# Record per line: PROVIDER(S) NAME(S) BASE(D) OFFSET(D)
probes_dof_types=
# Offsets of the base-probe names in the provider's STRTAB section.
# Lines: PROVIDER(S) NAME(S) BASE(D) OFFSET(D)
probes_dof_names=
-
+
# Offsets of the provider sections in the DOF program.
# Lines: PROVIDER(S) OFFSET(D)
providers_offsets=
###### Generation phase.
-
+
# The header of the DOF program contains a `struct
# dtrace_dof_hdr'. Record its size, but it is written at the end
# of the function.
arg=$(printf %s "$args" | $CUT -d: -f$(($n + 3)))
f_gen_asm ".asciz \"${arg}\""
off=$(($off + ${#arg} + 1))
- done
+ done
done <<EOF
$probes_args
EOF
# base address.
probes_sect_index=$dof_secnum
dof_secnum=$((dof_secnum + 1))
- probes_offset=$BCOUNT
+ probes_offset=$BCOUNT
num_base_probes=$(printf %s\\n "$base_probes" | $WC -l)
while read provider name base base_sym; do
name_offset=$(printf %s\\n "$probes_dof_names" \
num_offsets=$(printf %s\\n "$probes_dof_offsets" \
| $EGREP "^$provider $name [0-9]+ " | $WC -l)
-
+
first_offset=0
test "$num_offsets" -gt 0 && \
first_offset=$(printf %s\\n "$probes_dof_offsets" \
num_args=$(printf %s "$probes_args" \
| $EGREP "^$provider:$name:" | $CUT -d: -f3 | $HEAD -1)
-
+
first_type=$(printf %s "$probes_dof_types" \
| $EGREP "^$provider $name $base " | $CUT -d' ' -f4 | $HEAD -1)
reloctype=R_X86_64_GLOB_DAT
test "$objbits" = "32" && reloctype=R_386_32
-
+
f_gen_asm ""
f_gen_asm "/* dtrace_dof_probe for ${provider}:${name} at ${base_sym} */"
f_gen_asm ".balign 8"
$dof_sect_type_prargs \
4 1 $argtab_offset 0
f_incr_bcount $dof_secsize; f_align_bcount 8
-
+
while read provider; do
provider_offset=$(printf %s "$providers_offsets" \
| $EGREP "^$provider " | $CUT -d' ' -f2)
f_patch_objfile()
{
objfile=$1
-
+
# Several x86_64 instruction opcodes, in octal.
x86_op_nop=$(printf \\220)
x86_op_ret=$(printf \\303)
x86_op_rex_rax=$(printf \\110)
x86_op_xor_eax_0=$(printf \\063)
x86_op_xor_eax_1=$(printf \\300)
-
+
# Figure out the file offset of the text section in the object
# file.
text_off=0x$(objdump -j .text -h $objfile \
done <<EOF
$probes
EOF
-
+
# Finally, we have to remove the __dtrace_* and __dtraceenabled_*
# symbols from the object file, along with their respective
# relocations.
test -z "$provider" \
&& f_panic "unable to parse the provider name from $dfile."
u_provider=$(printf %s "$provider" | $TR a-z A-Z | $TR -s _)
-
+
cat $dfile | $EGREP "^ *probe +[a-zA-Z_]+ *\(.*\);" | \
while read line; do
# Extract the probe name.
echo "#if _DTRACE_VERSION"
echo ""
-
+
# Emit the macros for the probe.
echo "#define ${u_provider}_${u_name}($args) \\"
echo " __dtrace_${provider}___${name}($args)"
# Collect probe information from the input object file and the
# d-script.
- f_collect_probes $objfile
+ f_collect_probes $objfile
f_collect_probes_args $dfile
# Generate the assembly code and assemble the DOF program in
if test "$genheader" -gt 0; then
test -n "$ofile" || { echo "Please specify an output file with -o."; exit 2; }
-
+
# In this mode no extra arguments shall be present.
test "$#" -ne "0" && f_usage
fail $test
return 0
} else {
- pass $test
+ pass $test
return 1
}
}
proc prompt_gdb_start { } {
default_prompt_gdb_start
}
-
set command "set range-stepping on"
set message "probe range-stepping support"
gdb_test_multiple $command $message {
- -re "Range stepping is not supported.*\r\n$gdb_prompt $" {
+ -re "Range stepping is not supported.*\r\n$gdb_prompt $" {
pass $message
return 0
}
- -re "^$command\r\n$gdb_prompt $" {
+ -re "^$command\r\n$gdb_prompt $" {
pass $message
return 1
}
if (read2 == NULL)
{
/* Use setenv (v, "", 1) rather than unsetenv (v) to work around
- https://core.tcl-lang.org/tcl/tktview?name=67fd4f973a "incorrect
+ https://core.tcl-lang.org/tcl/tktview?name=67fd4f973a "incorrect
results of 'info exists' when unset env var in one interp and check
for existence from another interp". */
setenv ("LD_PRELOAD", "", 1);
set i [trr $json $i]
if {!$i} {
- error "json string invalid:0: exhausted while parsing object."
+ error "json string invalid:0: exhausted while parsing object."
}
if {[string index $json $i-1] eq "\{"} {
return [list [incr i -1] o]