Skip to content

Commit 3274ac5

Browse files
committed
gdb/testsuite/gdb.base/break.exp: split test_tbreak
Leave setting bp_location11 in the global scope, so that it's accessible to other procs. Change-Id: I8928f01640d3a1e993649b2168b9eda0724ee1d9 Approved-By: Kevin Buettner <[email protected]>
1 parent 46c3b22 commit 3274ac5

File tree

1 file changed

+36
-46
lines changed

1 file changed

+36
-46
lines changed

gdb/testsuite/gdb.base/break.exp

Lines changed: 36 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -423,55 +423,45 @@ gdb_test "continue" \
423423
".*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.*, envp=.*\\) at .*$srcfile:$bp_location10a.*$bp_location10a\[\t \]+}.*breakpoint 10a here.*" \
424424
"continue to breakpoint at }"
425425

426-
#
427-
# delete all breakpoints so we can start over, course this can be a test too
428-
#
429-
delete_breakpoints
430-
431-
#
432-
# test temporary breakpoint at function
433-
#
434-
435-
gdb_test "tbreak -q main" "Temporary breakpoint.*at.* file .*$srcfile, line.*" "temporary breakpoint function"
436-
437-
#
438-
# test break at function in file
439-
#
440-
441-
gdb_test "tbreak $srcfile:factorial" "Temporary breakpoint.*at.* file .*$srcfile, line.*" \
442-
"Temporary breakpoint function in file"
443-
444-
#
445-
# test break at line number
446-
#
447-
gdb_test "tbreak $bp_location1" \
448-
"Temporary breakpoint.*at.* file .*$srcfile, line $bp_location1.*" \
449-
"temporary breakpoint line number #1"
450-
451-
gdb_test "tbreak $bp_location6" "Temporary breakpoint.*at.* file .*$srcfile, line $bp_location6.*" "temporary breakpoint line number #2"
452-
453-
#
454-
# test break at line number in file
455-
#
456-
gdb_test "tbreak $srcfile:$bp_location2" \
457-
"Temporary breakpoint.*at.* file .*$srcfile, line $bp_location2.*" \
458-
"temporary breakpoint line number in file #1"
459-
460426
set bp_location11 [gdb_get_line_number "set breakpoint 11 here"]
461-
gdb_test "tbreak $srcfile:$bp_location11" "Temporary breakpoint.*at.* file .*$srcfile, line $bp_location11.*" "Temporary breakpoint line number in file #2"
462427

463-
#
464-
# check to see what breakpoints are set (temporary this time)
465-
#
466-
gdb_test "info break" "Num Type.*Disp Enb Address.*What.*\[\r\n\]
467-
\[0-9\]+\[\t \]+breakpoint del.*y.*in [func main] at .*$srcfile:$main_line.*\[\r\n\]
468-
\[0-9\]+\[\t \]+breakpoint del.*y.*in [func factorial] at .*$srcfile:$bp_location7.*\[\r\n\]
469-
\[0-9\]+\[\t \]+breakpoint del.*y.*in [func main] at .*$srcfile:$bp_location1.*\[\r\n\]
470-
\[0-9\]+\[\t \]+breakpoint del.*y.*in [func main] at .*$srcfile:$bp_location6.*\[\r\n\]
471-
\[0-9\]+\[\t \]+breakpoint del.*y.*in [func main] at .*$srcfile:$bp_location2.*\[\r\n\]
472-
\[0-9\]+\[\t \]+breakpoint del.*y.*in [func main] at .*$srcfile:$bp_location11.*" \
473-
"Temporary breakpoint info"
428+
proc_with_prefix test_tbreak {} {
429+
clean_restart break
430+
431+
# test temporary breakpoint at function
432+
gdb_test "tbreak -q main" "Temporary breakpoint.*at.* file .*$::srcfile, line.*" "temporary breakpoint function"
433+
434+
# test break at function in file
435+
gdb_test "tbreak $::srcfile:factorial" "Temporary breakpoint.*at.* file .*$::srcfile, line.*" \
436+
"Temporary breakpoint function in file"
437+
438+
# test break at line number
439+
gdb_test "tbreak $::bp_location1" \
440+
"Temporary breakpoint.*at.* file .*$::srcfile, line $::bp_location1.*" \
441+
"temporary breakpoint line number #1"
442+
443+
gdb_test "tbreak $::bp_location6" "Temporary breakpoint.*at.* file .*$::srcfile, line $::bp_location6.*" "temporary breakpoint line number #2"
444+
445+
# test break at line number in file
446+
gdb_test "tbreak $::srcfile:$::bp_location2" \
447+
"Temporary breakpoint.*at.* file .*$::srcfile, line $::bp_location2.*" \
448+
"temporary breakpoint line number in file #1"
449+
450+
gdb_test "tbreak $::srcfile:$::bp_location11" "Temporary breakpoint.*at.* file .*$::srcfile, line $::bp_location11.*" "Temporary breakpoint line number in file #2"
451+
452+
# check to see what breakpoints are set (temporary this time)
453+
gdb_test "info break" \
454+
[multi_line "Num Type.*Disp Enb Address.*What.*" \
455+
"$::decimal\[\t \]+breakpoint del.*y.*in [func main] at .*$::srcfile:$::main_line.*" \
456+
"$::decimal\[\t \]+breakpoint del.*y.*in [func factorial] at .*$::srcfile:$::bp_location7.*" \
457+
"$::decimal\[\t \]+breakpoint del.*y.*in [func main] at .*$::srcfile:$::bp_location1.*" \
458+
"$::decimal\[\t \]+breakpoint del.*y.*in [func main] at .*$::srcfile:$::bp_location6.*" \
459+
"$::decimal\[\t \]+breakpoint del.*y.*in [func main] at .*$::srcfile:$::bp_location2.*" \
460+
"$::decimal\[\t \]+breakpoint del.*y.*in [func main] at .*$::srcfile:$::bp_location11.*"] \
461+
"Temporary breakpoint info"
462+
}
474463

464+
test_tbreak
475465

476466
#***********
477467

0 commit comments

Comments
 (0)