set have_xfail 0
if {[is_aarch64_target]} {
if { [gnat_version_compare < 9] } {
- set have_xfail 1
+ set have_xfail 1
}
}
set re \
"#0.*callee\\.increment \\(val(=val@entry)?=99\\.0, msg=\\.\\.\\.\\).*"
set re_different_entry_val \
- "#0\\s+callee\\.increment \\(val=99.0, val@entry=.*, msg=\\.\\.\\.\\).*"
+ "#0\\s+callee\\.increment \\(val=99.0, val@entry=.*, msg=\\.\\.\\.\\).*"
gdb_test_multiple "frame" "" {
- -re -wrap $re {
- pass $gdb_test_name
- }
- -re -wrap $re_different_entry_val {
- if { $have_xfail } {
- # GCC PR98148
- xfail $gdb_test_name
- } else {
- fail $gdb_test_name
- }
- }
+ -re -wrap $re {
+ pass $gdb_test_name
+ }
+ -re -wrap $re_different_entry_val {
+ if { $have_xfail } {
+ # GCC PR98148
+ xfail $gdb_test_name
+ } else {
+ fail $gdb_test_name
+ }
+ }
}
}
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } {
- return
+ return
}
clean_restart ${testfile}
if {![runto "foo"]} {
- return
+ return
}
gdb_breakpoint "pck.adb:19"
# 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 .*"
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } {
- return
+ return
}
clean_restart ${testfile}
standard_ada_testfile foo_na07_019
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
set bp_location [gdb_get_line_number "START" ${testdir}/foo_na07_019.adb]
if {![runto "foo_na07_019.adb:$bp_location"]} {
- return
+ return
}
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.*"
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
set bp_location [gdb_get_line_number "START" ${testdir}/foo.adb]
if {![runto "foo.adb:$bp_location"]} {
- return
+ return
}
# Accept "foo." prefix for older versions of GNAT.
standard_ada_testfile bar
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
set bp_location [gdb_get_line_number "START" ${testdir}/bar.adb]
if {![runto "bar.adb:$bp_location"]} {
- return
+ return
}
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"
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"
# Start the inferior
if {![runto_main]} {
- return
+ return
}
# Create a breakpoint in each function from which we want to test
# 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
# unfortunately cannot find the address of the result. The following
# test is therefore expected to fail for all hppa targets except hppa64.
if {![istarget "hppa*64*-*-*"]} {
- setup_xfail "hppa*-*-*"
+ setup_xfail "hppa*-*-*"
}
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"
standard_ada_testfile p
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } {
- return
+ return
}
clean_restart ${testfile}
# 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\]+"
gdb_compile "${csrcfile}" "${cobject}" object [list debug]
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug additional_flags=-largs additional_flags=${cobject} additional_flags=-margs]] != "" } {
- return
+ return
}
clean_restart ${testfile}
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"
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" \
- "= \\(\\)"
+ "= \\(\\)"
# 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 + @" \
standard_ada_testfile main_p324_051
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } {
- return
+ return
}
clean_restart ${testfile}
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
standard_ada_testfile main
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable debug] != ""} {
- return
+ return
}
clean_restart ${testfile}
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug additional_flags=-gnat05 ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
gdb_test_multiple "$test" $test {
-re "type = \\(one, two, three\\).*$gdb_prompt $" {
pass $test
- }
+ }
-re "type = \\(\\).*$gdb_prompt $" {
# This is a known compiler problem with Stabs.
xfail $test
- }
+ }
}
standard_ada_testfile "foo"
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } {
- return
+ return
}
clean_restart ${testfile}
}
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"
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
# 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
- }
+ }
-re "Garbage 'TaSK 2' at end of command\[\r\n\]+$gdb_prompt $" {
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_xfail "= \\(0 => 0 <repeats 25 times>\\)"
set re_xfail2 "= \\(0 => 0 <repeats 24 times>, ($decimal)\\)"
gdb_test_multiple "print bad" "" {
- -re -wrap $re {
- pass $gdb_test_name
- }
- -re -wrap $re_xfail {
- if { $have_xfail } {
- # gcc/101643
- setup_xfail *-*-*
- }
- fail $gdb_test_name
- }
- -re -wrap $re_xfail2 {
- set last $expect_out(1,string)
- if { $endian == "little" } {
- set mask 0x0f
- } else {
- set mask 0xf0
- }
- if { $have_xfail && [string is integer $last] \
- && [expr ($last & $mask) == 0] } {
- # gcc/101643
- setup_xfail *-*-*
- }
- fail $gdb_test_name
- }
+ -re -wrap $re {
+ pass $gdb_test_name
+ }
+ -re -wrap $re_xfail {
+ if { $have_xfail } {
+ # gcc/101643
+ setup_xfail *-*-*
+ }
+ fail $gdb_test_name
+ }
+ -re -wrap $re_xfail2 {
+ set last $expect_out(1,string)
+ if { $endian == "little" } {
+ set mask 0x0f
+ } else {
+ set mask 0xf0
+ }
+ if { $have_xfail && [string is integer $last] \
+ && [expr ($last & $mask) == 0] } {
+ # 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"
additional_flags=${cobject2} \
additional_flags=-margs]
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable $options] != "" } {
- return
+ return
}
clean_restart ${testfile}
if {![runto "foo_h731_021"]} {
- return
+ return
}
# 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 {
- -re "Function \"<MixedCaseFunc>\" not defined\\..*Make breakpoint pending on future shared library load.*y or .n.. $" {
- gdb_test_no_output "n" $test
- }
+ -re "Function \"<MixedCaseFunc>\" not defined\\..*Make breakpoint pending on future shared library load.*y or .n.. $" {
+ gdb_test_no_output "n" $test
+ }
}
set test "break <NoDebugMixedCaseFunc>, in C"
gdb_test_multiple "break <NoDebugMixedCaseFunc>" $test {
- -re "Function \"<NoDebugMixedCaseFunc>\" not defined\\..*Make breakpoint pending on future shared library load.*y or .n.. $" {
- gdb_test_no_output "n" $test
- }
+ -re "Function \"<NoDebugMixedCaseFunc>\" not defined\\..*Make breakpoint pending on future shared library load.*y or .n.. $" {
+ gdb_test_no_output "n" $test
+ }
}
standard_ada_testfile p
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
# 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"
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"
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
if {![runto_main]} {
- return
+ return
}
# Check that inserting breakpoint on read_small inlined function inserts
# 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"
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return
+ return
}
# Test inserting breakpoint on pck.my_global_variable.
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\\."
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
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"
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return
+ return
}
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.
standard_ada_testfile proc
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable debug] != ""} {
- return
+ return
}
# Ada is case-insensitive, so both of these should work.
runto "reprod.adb:$bp_location"
gdb_test "print broken" \
- " = \\(len => 1, data => \\(\\(i => 1\\)\\)\\)"
+ " = \\(len => 1, data => \\(\\(i => 1\\)\\)\\)"
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
set bp_location [gdb_get_line_number "STOP" ${testdir}/foo.adb]
if {![runto "foo.adb:$bp_location"]} {
- return
+ return
}
# The xfail mentioned below triggers for the "after" print, but may not
standard_ada_testfile bla
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug additional_flags=-gnata ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
# - continue, the program exits.
if {![runto_main]} {
- return
+ return
}
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.
set bp_location [gdb_get_line_number "STOP" ${testdir}/bla.adb]
set catchpoint_msg \
- "Catchpoint $decimal, failed assertion at $hex in bla \\\(\\\).*at .*bla.adb:$bp_location"
+ "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\\.$eol$eol$catchpoint_msg$eol.*STOP" \
+ "continuing to expected failed assertion"
gdb_test "continue" \
- "Continuing\\..*$inferior_exited_re.*" \
- "continuing to program completion"
+ "Continuing\\..*$inferior_exited_re.*" \
+ "continuing to program completion"
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug additional_flags=-gnata ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
set info_break_header "Num${sp}Type${sp}Disp${sp}Enb${sp}Address${sp}What"
set catch_exception_info \
- "$any_nb${sp}catchpoint${sp}keep${sp}y${sp}all Ada exceptions"
+ "$any_nb${sp}catchpoint${sp}keep${sp}y${sp}all Ada exceptions"
####################################
# 1. Try catching all exceptions. #
####################################
if {![runto_main]} {
- return
+ return
}
gdb_test "catch exception" \
"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"
+ "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\\.$eol$eol$catchpoint_msg$eol.*SPOT1" \
+ "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"
+ "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\\.$eol$eol$catchpoint_msg$eol.*SPOT2" \
+ "continuing to second exception"
################################################
# 2. Try catching only some of the exceptions. #
# - continue, the program exits.
if {![runto_main]} {
- return
+ return
}
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}\`Program_Error' Ada exception"
set catch_assert_entry \
- "$any_nb${sp}catchpoint${sp}keep${sp}y${sp}failed Ada assertions"
+ "$any_nb${sp}catchpoint${sp}keep${sp}y${sp}failed Ada assertions"
set catch_unhandled_entry \
- "$any_nb${sp}catchpoint${sp}keep${sp}y${sp}unhandled Ada exceptions"
+ "$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"
+ "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\\.$eol$eol$catchpoint_msg$eol.*SPOT2" \
+ "continuing to Program_Error exception"
set catchpoint_msg \
- "Catchpoint $any_nb, failed assertion at $any_addr in foo \\\(\\\).*at .*foo.adb:$any_nb"
+ "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\\.$eol$eol$catchpoint_msg$eol.*SPOT3" \
+ "continuing to failed assertion"
set catchpoint_msg \
- "Catchpoint $any_nb, unhandled CONSTRAINT_ERROR at $any_addr in foo \\\(\\\).*at .*foo.adb:$any_nb"
+ "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\\.$eol$eol$catchpoint_msg$eol.*SPOT4" \
+ "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. #
# the program.
if {![runto_main]} {
- return
+ return
}
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"
+ "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\\.$eol$eol$temp_catchpoint_msg$eol.*SPOT1" \
+ "continuing to temporary catchpoint"
with_test_prefix "temporary catchpoint" {
gdb_test "continue" \
gdb_load_shlib $sofile
if {![runto_main]} {
- return
+ return
}
gdb_test "catch exception some_kind_of_error" \
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
set flags [list debug additional_flags=-gnatW8]
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable $flags] != "" } {
- return
+ return
}
clean_restart ${testfile}
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } {
- return
+ return
}
clean_restart ${testfile}
# 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"
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
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
gdb_compile "${csrcfile}" "${cobject}" object [list debug]
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } {
- return
+ return
}
clean_restart ${testfile}
# 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 .*"
standard_ada_testfile pb16_063
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
set bp_location [gdb_get_line_number "BREAK" "$testdir/pck.adb"]
if {![runto pck.adb:$bp_location]} {
- return
+ return
}
set val ""
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable \
{debug additional_flags=-gnatDG}] != "" } {
- return
+ return
}
clean_restart ${testfile}
standard_ada_testfile foo_n612_026
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
set bp_location [gdb_get_line_number "STOP" ${testdir}/foo_n612_026.adb]
if {![runto "foo_n612_026.adb:$bp_location"]} {
- return
+ return
}
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\\)"
set bp_location [gdb_get_line_number "STOP" ${testdir}/main.adb]
if {![runto "main.adb:$bp_location"]} {
- return
+ return
}
gdb_test_no_output "set print array-indexes on"
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
set bp_location [gdb_get_line_number "STOP" ${testdir}/foo.adb]
if {![runto "foo.adb:$bp_location"]} {
- return
+ return
}
gdb_test "print addr.all" " = 123"
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" \
standard_ada_testfile p
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
set bp_location [gdb_get_line_number "BREAK" ${testdir}/pack.adb]
if {![runto "pack.adb:$bp_location"]} {
- return
+ return
}
set eol "\r\n"
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
set bp_location [gdb_get_line_number "STOP" ${testdir}/foo.adb]
if {![runto "foo.adb:$bp_location"]} {
- return
+ return
}
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 => .*\\)\\)"
standard_ada_testfile main
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable {debug additional_flags=-gnat05}] != "" } {
- return
+ return
}
clean_restart ${testfile}
standard_ada_testfile enums_overload_main
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } {
- return
+ return
}
clean_restart ${testfile}
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug additional_flags=-gnata ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
set when "when"
set catchpoint_constraint_error_msg \
- "Catchpoint $decimal, exception at $hex in foo \\\(\\\).*at .*foo.adb:$decimal$eol$decimal$sp$when Constraint_Error =>"
+ "Catchpoint $decimal, exception at $hex in foo \\\(\\\).*at .*foo.adb:$decimal$eol$decimal$sp$when Constraint_Error =>"
set catchpoint_program_error_msg \
- "Catchpoint $decimal, exception at $hex in foo \\\(\\\).*at .*foo.adb:$decimal$eol$decimal$sp$when Program_Error =>"
+ "Catchpoint $decimal, exception at $hex in foo \\\(\\\).*at .*foo.adb:$decimal$eol$decimal$sp$when Program_Error =>"
set catchpoint_storage_error_msg \
- "Catchpoint $decimal, exception at $hex in foo \\\(\\\).*at .*foo.adb:$decimal$eol$decimal$sp$when Storage_Error =>"
+ "Catchpoint $decimal, exception at $hex in foo \\\(\\\).*at .*foo.adb:$decimal$eol$decimal$sp$when Storage_Error =>"
if {![runto_main]} {
- return
+ return
}
############################################
"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.
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
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."
standard_ada_testfile expr_r821_013
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
standard_ada_testfile p
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
# For riscv64-linux, we need to run to main, or the_array.p_array will still
# be nullptr.
if {![runto "main"]} {
- return
+ return
}
# The test case is written in C, because it was easy to make the
standard_ada_testfile foo_o525_013
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
# 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"
set flags {debug}
if {[ada_fvar_tracking]} {
- lappend flags "additional_flags=-fvar-tracking"
+ lappend flags "additional_flags=-fvar-tracking"
}
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable $flags] != ""} {
- return
+ return
}
clean_restart ${testfile}
}
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable $opts] != ""} {
- return
+ return
}
clean_restart ${testfile}
# 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
lappend flags debug
if {[gdb_compile_ada "${srcfile}" "${binfile}-${gnat_encodings}" executable $flags] != "" } {
- return
+ return
}
clean_restart ${testfile}-${gnat_encodings}
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"
}
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"
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
set sp "\[ \t\]*"
if {![runto break_me]} {
- return
+ return
}
# 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"
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return
+ return
}
# Note: We restart the debugger before setting each breakpoint, because
# 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\]+."
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
# the inferior is *not* running (no frame).
gdb_test "print foo'address" \
- "= .* 0x\[0-9a-zA-Z\]+ <foo>"
+ "= .* 0x\[0-9a-zA-Z\]+ <foo>"
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
if {![runto_main]} {
- return
+ return
}
# Some variables used to simplify the maintenance of some of
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"
standard_ada_testfile foo
if {[gdb_compile_ada "$srcfile" "$binfile" executable [list debug]] != "" } {
- return
+ return
}
clean_restart ${testfile}
standard_ada_testfile fun_renaming
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } {
- return
+ return
}
clean_restart ${testfile}
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } {
- return
+ return
}
clean_restart ${testfile}
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } {
- return
+ return
}
clean_restart ${testfile}
# 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"
standard_ada_testfile foo
if {[gdb_compile_ada "$srcfile" "$binfile" executable [list debug]] != "" } {
- return
+ return
}
clean_restart ${testfile}
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"
set flags [list debug additional_flags=-gnata]
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable $flags] != "" } {
- return
+ return
}
clean_restart ${testfile}
set bp_location [gdb_get_line_number "START" ${testdir}/main.adb]
if {![runto "main.adb:$bp_location"]} {
- return
+ return
}
gdb_test "print pck.value" " = 64 '@'"
standard_ada_testfile homonym_main
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } {
- return
+ return
}
clean_restart ${testfile}
# 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"
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
set bp_location [gdb_get_line_number "START" ${testdir}/foo.adb]
if {![runto "foo.adb:$bp_location"]} {
- return
+ return
}
# The following test exercises the situation when uppercase letters
set type_in_c(c_syntax) "${decimal}: typedef struct {\\.\\.\\.} some_type_in_c;"
set type_in_c(ada_syntax) [multi_line \
- "${decimal}: record" \
- " some_component_in_c: int;" \
- "end record" ]
+ "${decimal}: record" \
+ " some_component_in_c: int;" \
+ "end record" ]
set type_in_ada(c_syntax) "${decimal}: struct global_pack__some_type_in_ada"
set type_in_ada(ada_syntax) "${decimal}: global_pack.some_type_in_ada"
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } {
- return
+ return
}
clean_restart ${testfile}
if {![runto_main]} {
- return
+ return
}
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" \
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"
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } {
- return
+ return
}
clean_restart ${testfile}
# 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"
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug additional_flags=-gnat05 ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
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\]*"
standard_ada_testfile p
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug additional_flags=-gnat05 ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
}
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\\)"
gdb_compile "${csrcfile}" "${cobject}" object [list debug]
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } {
- return
+ return
}
clean_restart ${testfile}
# 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"
standard_ada_testfile length_cond
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable debug] != "" } {
- return
+ return
}
clean_restart ${testfile}
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable \
- [list debug ]] != "" } {
- return
+ [list debug ]] != "" } {
+ return
}
clean_restart ${testfile}
standard_ada_testfile local
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable debug] != ""} {
- return
+ return
}
clean_restart ${testfile}
set bp_location [gdb_get_line_number "STOP" ${testdir}/local.adb]
if {![runto "local.adb:$bp_location"]} {
- return
+ return
}
# The test has two constants named 'three', with different values.
standard_ada_testfile var_arr_typedef
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
standard_ada_testfile bla
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug additional_flags=-gnata ]] != "" } {
- return
+ return
}
load_lib mi-support.exp
# - continue, the program exits.
if {[mi_runto_main] < 0} {
- return
+ return
}
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"
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug additional_flags=-gnata ]] != "" } {
- return
+ return
}
# A global variable used to simplify the maintenance of some of
}
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"
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug additional_flags=-gnata ]] != "" } {
- return
+ return
}
load_lib mi-support.exp
}
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.
}
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"
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } {
- return
+ return
}
load_lib mi-support.exp
mi_clean_restart $::testfile
if {[mi_runto_main] < 0} {
- return
+ return
}
set bp_location [gdb_get_line_number "STOP" ${testdir}/foo.adb]
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug additional_flags=-bargs additional_flags=-static additional_flags=-margs ]] != "" } {
- return
+ return
}
# A global variable used to simplify the maintenance of some of
# 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
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } {
- return
+ return
}
load_lib mi-support.exp
mi_clean_restart $::testfile
if {[mi_runto_main] < 0} {
- return
+ return
}
mi_delete_breakpoints
mi_gdb_load ${binfile}
mi_gdb_test "-info-ada-exceptions" \
- "\\^done,ada-exceptions={nr_rows=\"$decimal\",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=\"program_error\",address=\"$hex\"},{name=\"storage_error\",address=\"$hex\"},{name=\"tasking_error\",address=\"$hex\"},.*{name=\"const.aint_global_gdb_e\",address=\"$hex\"}.*\\\]}" \
- "-info-ada-exceptions"
+ "\\^done,ada-exceptions={nr_rows=\"$decimal\",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=\"program_error\",address=\"$hex\"},{name=\"storage_error\",address=\"$hex\"},{name=\"tasking_error\",address=\"$hex\"},.*{name=\"const.aint_global_gdb_e\",address=\"$hex\"}.*\\\]}" \
+ "-info-ada-exceptions"
mi_gdb_test "-info-ada-exceptions task" \
- "\\^done,ada-exceptions={nr_rows=\"1\",nr_cols=\"2\",hdr=\\\[{width=\"1\",alignment=\"-1\",col_name=\"name\",colhdr=\"Name\"},{width=\"1\",alignment=\"-1\",col_name=\"address\",colhdr=\"Address\"}\\\],body=\\\[{name=\"tasking_error\",address=\"$hex\"}\\\]}" \
- "-info-ada-exceptions task"
+ "\\^done,ada-exceptions={nr_rows=\"1\",nr_cols=\"2\",hdr=\\\[{width=\"1\",alignment=\"-1\",col_name=\"name\",colhdr=\"Name\"},{width=\"1\",alignment=\"-1\",col_name=\"address\",colhdr=\"Address\"}\\\],body=\\\[{name=\"tasking_error\",address=\"$hex\"}\\\]}" \
+ "-info-ada-exceptions task"
mi_gdb_test "-info-ada-exceptions global_gdb" \
- "\\^done,ada-exceptions={nr_rows=\"1\",nr_cols=\"2\",hdr=\\\[{width=\"1\",alignment=\"-1\",col_name=\"name\",colhdr=\"Name\"},{width=\"1\",alignment=\"-1\",col_name=\"address\",colhdr=\"Address\"}\\\],body=\\\[{name=\"const.aint_global_gdb_e\",address=\"$hex\"}\\\]}" \
- "-info-ada-exceptions global_gdb"
+ "\\^done,ada-exceptions={nr_rows=\"1\",nr_cols=\"2\",hdr=\\\[{width=\"1\",alignment=\"-1\",col_name=\"name\",colhdr=\"Name\"},{width=\"1\",alignment=\"-1\",col_name=\"address\",colhdr=\"Address\"}\\\],body=\\\[{name=\"const.aint_global_gdb_e\",address=\"$hex\"}\\\]}" \
+ "-info-ada-exceptions global_gdb"
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"
+ "\\^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"
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug additional_flags=-gnat12 ]] != "" } {
- return
+ return
}
load_lib mi-support.exp
mi_clean_restart $::testfile
if {[mi_runto_main] < 0} {
- return
+ return
}
set bp_location [gdb_get_line_number "BREAK" ${testdir}/foo.adb]
mi_clean_restart $::testfile
if {[mi_runto_main] < 0} {
- return
+ return
}
mi_delete_breakpoints
standard_ada_testfile foo_rb20_056
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } {
- return
+ return
}
load_lib mi-support.exp
mi_clean_restart $::testfile
if {[mi_runto_main] < 0} {
- return
+ return
}
# Continue until STOP_1, and create a varobj for variables "A" and "B".
standard_ada_testfile task_switch
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug additional_flags=-gnata ]] != "" } {
- return
+ return
}
load_lib mi-support.exp
mi_gdb_test "-gdb-set debug-file-directory \"\"" ".*"
if {![mi_runto "task_switch.break_me"]} {
- return
+ return
}
# Verify that "-stack-list-arguments" does not cause the debugger to
standard_ada_testfile task_switch
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug additional_flags=-gnata ]] != "" } {
- return
+ return
}
load_lib mi-support.exp
####################################
if {![mi_runto "task_switch.break_me"]} {
- return
+ return
}
set ada_task_info_hdr \
- "hdr=\\\[{width=\"1\",alignment=\"-1\",col_name=\"current\",colhdr=\"\"},{width=\"3\",alignment=\"1\",col_name=\"id\",colhdr=\"ID\"},{width=\"9\",alignment=\"1\",col_name=\"task-id\",colhdr=\"TID\"},{width=\"4\",alignment=\"1\",col_name=\"thread-id\",colhdr=\"\"},{width=\"4\",alignment=\"1\",col_name=\"parent-id\",colhdr=\"P-ID\"},{width=\"3\",alignment=\"1\",col_name=\"priority\",colhdr=\"Pri\"},{width=\"22\",alignment=\"-1\",col_name=\"state\",colhdr=\"State\"},{width=\"1\",alignment=\"2\",col_name=\"name\",colhdr=\"Name\"}\\\]"
+ "hdr=\\\[{width=\"1\",alignment=\"-1\",col_name=\"current\",colhdr=\"\"},{width=\"3\",alignment=\"1\",col_name=\"id\",colhdr=\"ID\"},{width=\"9\",alignment=\"1\",col_name=\"task-id\",colhdr=\"TID\"},{width=\"4\",alignment=\"1\",col_name=\"thread-id\",colhdr=\"\"},{width=\"4\",alignment=\"1\",col_name=\"parent-id\",colhdr=\"P-ID\"},{width=\"3\",alignment=\"1\",col_name=\"priority\",colhdr=\"Pri\"},{width=\"22\",alignment=\"-1\",col_name=\"state\",colhdr=\"State\"},{width=\"1\",alignment=\"2\",col_name=\"name\",colhdr=\"Name\"}\\\]"
set task_1 \
- "{id=\"1\",task-id=\" *(0x)?\[0-9a-fA-F\]+\",thread-id=\"\[0-9\]+\",priority=\"\[0-9\]+\",state=\"(Child (Activation|Termination) Wait|Runnable)\",name=\"main_task\"}"
+ "{id=\"1\",task-id=\" *(0x)?\[0-9a-fA-F\]+\",thread-id=\"\[0-9\]+\",priority=\"\[0-9\]+\",state=\"(Child (Activation|Termination) Wait|Runnable)\",name=\"main_task\"}"
set task_2 \
- "{id=\"2\",task-id=\" *(0x)?\[0-9a-fA-F\]+\",thread-id=\"\[0-9\]+\",parent-id=\"1\",priority=\"\[0-9\]+\",state=\"(Accept or Select Term|Runnable)\",name=\"my_callee\"}"
+ "{id=\"2\",task-id=\" *(0x)?\[0-9a-fA-F\]+\",thread-id=\"\[0-9\]+\",parent-id=\"1\",priority=\"\[0-9\]+\",state=\"(Accept or Select Term|Runnable)\",name=\"my_callee\"}"
set task_3 \
- "{current=\"\\*\",id=\"3\",task-id=\" *(0x)?\[0-9a-fA-F\]+\",thread-id=\"\[0-9\]+\",parent-id=\"1\",priority=\"\[0-9\]+\",state=\"Runnable\",name=\"my_caller\"}"
+ "{current=\"\\*\",id=\"3\",task-id=\" *(0x)?\[0-9a-fA-F\]+\",thread-id=\"\[0-9\]+\",parent-id=\"1\",priority=\"\[0-9\]+\",state=\"Runnable\",name=\"my_caller\"}"
# Get the full list of tasks...
mi_gdb_test "-ada-task-info" \
- ".*\\^done,tasks={nr_rows=\"3\",nr_cols=\"8\",$ada_task_info_hdr,body=\\\[$task_1,$task_2,$task_3\\\]}" \
- "-ada-task-info with no argument"
+ ".*\\^done,tasks={nr_rows=\"3\",nr_cols=\"8\",$ada_task_info_hdr,body=\\\[$task_1,$task_2,$task_3\\\]}" \
+ "-ada-task-info with no argument"
# Now, only get the info about task 3.
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"
+ "\\^done,tasks={nr_rows=\"1\",nr_cols=\"8\",$ada_task_info_hdr,body=\\\[$task_3\\\]}" \
+ "-ada-task-info 3"
standard_ada_testfile foo_qb07_057
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable ""] != "" } {
- return
+ return
}
clean_restart ${testfile}
if {![runto "_ada_foo_qb07_057"]} {
- return
+ return
}
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"
runto "foo.adb:$bp_location"
gdb_test "ptype var" \
- "= array \\(0 .. -1\\) of integer"
+ "= array \\(0 .. -1\\) of integer"
standard_ada_testfile hello
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
# 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#\\);"]
+ "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#\\);"]
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"
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } {
- return
+ return
}
clean_restart ${testfile}
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"
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\""
}
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
if {![runto "foo"]} {
- return
+ return
}
gdb_test "print z" \
- "= (\\(a => .*, b => .*, c => .*\\)|<optimized out>)"
+ "= (\\(a => .*, b => .*, c => .*\\)|<optimized out>)"
standard_ada_testfile tester
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } {
- return
+ return
}
clean_restart ${testfile}
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"
# of the components. Accept both known orders.
set test "print test"
gdb_test_multiple "$test" $test {
- -re "= \\(size => 100, length => 1, str => \\(33 'A', nul <repeats 99 times>\\)\\).*$gdb_prompt $" {
- pass $test
+ -re "= \\(size => 100, length => 1, str => \\(33 'A', nul <repeats 99 times>\\)\\).*$gdb_prompt $" {
+ pass $test
}
- -re "= \\(size => 100, str => \\(33 'A', nul <repeats 99 times>\\), length => 1\\).*$gdb_prompt $" {
- pass $test
+ -re "= \\(size => 100, str => \\(33 'A', nul <repeats 99 times>\\), length => 1\\).*$gdb_prompt $" {
+ pass $test
}
}
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'"
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } {
- return
+ return
}
clean_restart ${testfile}
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\\)"
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug additional_flags=-gnat05 ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
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'"
standard_ada_testfile dummy start
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
runto "dummy.adb:$bp_location"
gdb_test "p /x \$pc" \
- "= 0x\[0-9a-zA-Z\]+"
+ "= 0x\[0-9a-zA-Z\]+"
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
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>"
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug additional_flags=-gnat05 ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug additional_flags=-gnat05 ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
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"
# We can't query the members of a package yet, and this yields a bit
# too much output, so comment out for now instead of kfailing.
# gdb_test "complete ptype pck." \
-# [multi_line \
-# "ptype pck\\.circle" \
-# "ptype pck\\.position"]
+ # [multi_line \
+ # "ptype pck\\.circle" \
+ # "ptype pck\\.position"]
gdb_test "complete ptype circle.pos." \
[multi_line \
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return
+ return
}
set has_runtime_debug_info [gnat_runtime_has_debug_info]
clean_restart ${testfile}
if {![runto "pck.adb:20"]} {
- return
+ return
}
# With some versions of the compiler, identifying the runtime type of
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } {
- return
+ return
}
clean_restart ${testfile}
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)" \
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
# 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.*"
standard_ada_testfile bar_o203_012
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
set bp_location [gdb_get_line_number "STOP" ${testdir}/bar_o203_012.adb]
if {![runto "bar_o203_012.adb:$bp_location"]} {
- return
+ return
}
# Accept "bar_o203_012." prefix for older versions of GNAT.
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
set bp_location [gdb_get_line_number "STOP" ${testdir}/foo.adb]
if {![runto "foo.adb:$bp_location"]} {
- return
+ return
}
gdb_test "print bar" \
- "= \\(x => 42, s => \"ABCDEFGH\"\\)"
+ "= \\(x => 42, s => \"ABCDEFGH\"\\)"
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
if {![runto pck.adb:20]} {
- return
+ return
}
gdb_test_no_output "set print frame-arguments all"
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"
standard_ada_testfile p
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } {
- return
+ return
}
clean_restart ${testfile}
# the size of d1.
gdb_test "print d1'size = d2'size" \
- "= true"
+ "= true"
standard_ada_testfile pb30_012
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } {
- return
+ return
}
clean_restart ${testfile}
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"
standard_ada_testfile foo_oc22_002
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } {
- return
+ return
}
clean_restart ${testfile}
runto "foo_oc22_002.adb:$bp_location"
gdb_test "print a1(1)@3" \
- " = \\(3, 5, 8\\)"
+ " = \\(3, 5, 8\\)"
}
if { [gdb_compile_ada $srcfile $binfile executable $opts] != "" } {
- return
+ return
}
clean_restart $testfile
standard_ada_testfile a
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
set bp_location [gdb_get_line_number "START" ${testdir}/storage.adb]
if {![runto "storage.adb:$bp_location"]} {
- return
+ return
}
set re "value => 126, another_value => 12, color => green"
# 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"
standard_ada_testfile a
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
set bp_location [gdb_get_line_number "STOP" ${testdir}/a.adb]
if {![runto "a.adb:$bp_location"]} {
- return
+ return
}
# 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.
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug optimize=-O1]] != "" } {
- return
+ return
}
clean_restart ${testfile}
if {![runto_main]} {
- return
+ return
}
gdb_breakpoint "call_me"
}
gdb_test "" \
- "dummy \\(\\) at .*dummy.adb.*" \
- "start"
+ "dummy \\(\\) at .*dummy.adb.*" \
+ "start"
set bp_location [gdb_get_line_number "STOP" ${testdir}/prog.adb]
if {![runto "prog.adb:$bp_location"]} {
- return
+ return
}
gdb_test "ptype value" [string_to_regexp "type = array (1 .. 3) of integer"]
standard_ada_testfile foo_p211_061
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } {
- return
+ return
}
clean_restart ${testfile}
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"
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } {
- return
+ return
}
clean_restart ${testfile}
# 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"
standard_ada_testfile parse
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
set bp_location [gdb_get_line_number "START" ${testdir}/parse.adb]
if {![runto "parse.adb:$bp_location"]} {
- return
+ return
}
# Print MY_STR. Since the string has not been initialized, including
standard_ada_testfile subv
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } {
- return
+ return
}
clean_restart ${testfile}
set test_name "multiple matches for symbol integervar"
gdb_test_multiple "print integervar" "$test_name" \
-{
- -re "$menu" {
- pass "$test_name"
- }
-
- default {
- fail "$test_name"
- }
-}
+ {
+ -re "$menu" {
+ pass "$test_name"
+ }
+
+ default {
+ 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"
standard_ada_testfile p
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
set bp_location [gdb_get_line_number "START" ${testdir}/p.adb]
if {![runto "p.adb:$bp_location"]} {
- return
+ return
}
gdb_test "print w.e.all" \
- "= \\(month => 8, year => 1974\\)"
+ "= \\(month => 8, year => 1974\\)"
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable {debug}] != ""} {
- return
+ return
}
clean_restart ${testfile}
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } {
- return
+ return
}
clean_restart ${testfile}
# 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\\)"
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } {
- return
+ return
}
# Insert a breakpoint at LOC, and run the program expecting us to
# order to test one given linespec under multiple conditions.
proc test_bp { loc msg } {
- gdb_test "break $loc" \
- "Breakpoint \[0-9\]+ at 0x\[0-9a-fA-F\]+: file .*pck.adb, line \[0-9\]+\\." \
- "break $loc - $msg"
+ gdb_test "break $loc" \
+ "Breakpoint \[0-9\]+ at 0x\[0-9a-fA-F\]+: file .*pck.adb, line \[0-9\]+\\." \
+ "break $loc - $msg"
- gdb_run_cmd
- gdb_test "" \
- "Breakpoint \[0-9\]+, pck\\.dummy_task (.*)" \
- "run to $loc - $msg"
+ gdb_run_cmd
+ gdb_test "" \
+ "Breakpoint \[0-9\]+, pck\\.dummy_task (.*)" \
+ "run to $loc - $msg"
}
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.
standard_ada_testfile crash
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } {
- return
+ return
}
clean_restart ${testfile}
set corefile [standard_output_file crash.gcore]
set core_supported [gdb_gcore_cmd "$corefile" "save a corefile"]
if {!$core_supported} {
- return
+ return
}
# Now that the core file has been created, we can start the real
# 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"
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable {debug}] != ""} {
- return
+ return
}
clean_restart ${testfile}
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
# 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
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
# 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"
standard_ada_testfile foo_n207_004
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
standard_ada_testfile assign
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } {
- return
+ return
}
clean_restart ${testfile}
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"
standard_ada_testfile parse
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable {debug}] != "" } {
- return
+ return
}
clean_restart ${testfile}
standard_ada_testfile parse
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } {
- return
+ return
}
clean_restart ${testfile}
# Check that printing uninitialized variables does not crash the debugger.
gdb_test "info locals" \
- ".*"
+ ".*"
standard_ada_testfile main
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable {debug}] != ""} {
- return
+ return
}
clean_restart ${testfile}
standard_ada_testfile foo_o115_002
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } {
- return
+ return
}
clean_restart ${testfile}
standard_ada_testfile var_arr_typedef
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } {
- return
+ return
}
clean_restart ${testfile}
set a "\\($va, $va, $vb, $vb\\)"
gdb_test "print va" \
- " = $va"
+ " = $va"
gdb_test "print vb" \
- " = $vb"
+ " = $vb"
gdb_test "print a" \
- " = $a"
+ " = $a"
standard_ada_testfile proc
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable debug] != ""} {
- return
+ return
}
clean_restart ${testfile}
# making guarantees beyond -Og though, so test that.
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug optimize=-Og]] != ""} {
- return
+ return
}
clean_restart ${testfile}
standard_ada_testfile vsizelim
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
set bp_location [gdb_get_line_number "STOP" ${testdir}/vsizelim.adb]
if {![runto "vsizelim.adb:$bp_location"]} {
- return
+ return
}
gdb_test "set varsize-limit 16" \
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\\)"
standard_ada_testfile voidctx
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
# 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"
# 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
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
set bp_location [gdb_get_line_number "STOP" ${testdir}/foo.adb]
if {![runto "foo.adb:$bp_location"]} {
- return
+ return
}
# 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"
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return
+ return
}
clean_restart ${testfile}
set bp_location [gdb_get_line_number "START" ${testdir}/foo.adb]
if {![runto "foo.adb:$bp_location"]} {
- return
+ return
}
gdb_test "print some_easy" "= 74 'J'"
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug additional_flags=-bargs additional_flags=-shared additional_flags=-margs]] != "" } {
- return
+ return
}
clean_restart ${testfile}
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"