set name "Step into shared lib function"
gdb_test_multiple "s" $name \
{
- -re "hithere2 \\(\\) at.*${libfile}.c:25\r\n25.*a = 21;.*$gdb_prompt $" {
+ -re "hithere2 \\(\\) at.*${libfile}.c:\[0-9\]+\r\n\[0-9\]+.*a = 21;.*$gdb_prompt $" {
pass $name
}
-re "0x\[0-9a-f\]+ in .* \\(\\) from /lib/ld.so.1.*$gdb_prompt $" {
set name "Next while in a shared lib function"
gdb_test_multiple "n" $name \
{
- -re "26.*return a;.*$gdb_prompt $" {
+ -re "\[0-9\]+.*return a;.*$gdb_prompt $" {
pass $name
}
-re "Single stepping until exit from function .*, \r\nwhich has no line number information.\r\n\r\nProgram exited normally.*$gdb_prompt $" {
# Try a pending break for a line in a source file with a condition
#
-gdb_test_multiple "break pendshr.c:26 if x > 3" "Set pending breakpoint 2" {
+set bp2_loc [gdb_get_line_number "y = x + 4" ${libfile}.c]
+gdb_test_multiple "break pendshr.c:$bp2_loc if x > 3" "Set pending breakpoint 2" {
-re ".*Make breakpoint pending.*y or \\\[n\\\]. $" {
- gdb_test "y" "Breakpoint.*pendshr.c:26.*pending." \
+ gdb_test "y" "Breakpoint.*pendshr.c:$bp2_loc.*pending." \
"Set pending breakpoint 2"
}
}
\[\t \]+stop only if k == 1.*
\[\t \]+print k.*
\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:$mainline.*
-\[0-9\]+\[\t \]+breakpoint keep y.*PENDING.*pendshr.c:26 if x > 3.*" \
+\[0-9\]+\[\t \]+breakpoint keep y.*PENDING.*pendshr.c:$bp2_loc if x > 3.*" \
"multiple pending breakpoints"
# Try a pending break for a line in a source file with ignore count:
#
-gdb_test_multiple "break pendshr.c:27" "Set pending breakpoint 3" {
+set bp3_loc [gdb_get_line_number "printf" ${libfile}.c]
+gdb_test_multiple "break pendshr.c:$bp3_loc" "Set pending breakpoint 3" {
-re ".*Make breakpoint pending.*y or \\\[n\\\]. $" {
- gdb_test "y" "Breakpoint.*pendshr.c:27.*pending." \
+ gdb_test "y" "Breakpoint.*pendshr.c:$bp3_loc.*pending." \
"Set pending breakpoint 3"
}
}
\[\t \]+stop only if k == 1.*
\[\t \]+print k.*
\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:$mainline.*
-\[0-9\]+\[\t \]+breakpoint keep y.*PENDING.*pendshr.c:26 if x > 3.*
-\[0-9\]+\[\t \]+breakpoint keep y.*PENDING.*pendshr.c:27.*ignore next 2 hits.*" \
+\[0-9\]+\[\t \]+breakpoint keep y.*PENDING.*pendshr.c:$bp2_loc if x > 3.*
+\[0-9\]+\[\t \]+breakpoint keep y.*PENDING.*pendshr.c:$bp3_loc.*ignore next 2 hits.*" \
"multiple pending breakpoints 2"
#
gdb_run_cmd
gdb_test "" \
"Breakpoint.*at.*
-Pending breakpoint \"pendshr.c:26 if x > 3\" resolved.*
+Pending breakpoint \"pendshr.c:$bp2_loc if x > 3\" resolved.*
Breakpoint.*, main.*$mainline.*" \
"running to main"
#
gdb_test "continue" \
-".*Breakpoint.*pendfunc1.*at.*pendshr.c:26.*4;" \
+".*Breakpoint.*pendfunc1.*at.*pendshr.c:$bp2_loc.*4;" \
"continue to resolved breakpoint 2"
gdb_test "continue" \
-".*Breakpoint.*pendfunc1.*at.*pendshr.c:26.*
+".*Breakpoint.*pendfunc1.*at.*pendshr.c:$bp2_loc.*
\[$\]1 = 1." \
"continue to resolved breakpoint 1"
gdb_test "disable 5" "" "Disable other breakpoints"
gdb_test "continue" \
- {.*Breakpoint.*pendfunc1.*\(x=3\) at.*pendshr.c:27.*printf.*;} \
+ ".*Breakpoint.*pendfunc1.*\\\(x=3\\\) at.*pendshr.c:$bp3_loc.*printf.*;" \
"continue to resolved breakpoint 3"
delete_breakpoints