gdb_test "step" "inc\.3.*" "step inside inc"
gdb_test "step" "thrice\.4.*" "step through return thunk back into thrice"
+set alphanum_re "\[a-zA-Z0-9\]"
+set pic_thunk_re "__$alphanum_re*\\.get_pc_thunk\\.$alphanum_re* \\(\\)"
+
# We can use instruction stepping to step into thunks.
stepi_until "thrice" "indirect_thunk" "stepi into call thunk"
stepi_until "indirect_thunk" "inc." "stepi out of call thunk into inc"
-stepi_until "inc" "return_thunk" "stepi into return thunk"
+stepi_until "(inc|$pic_thunk_re)" "return_thunk" "stepi into return thunk"
stepi_until "return_thunk" "thrice" \
"stepi out of return thunk back into thrice"
# Continue to step until we reach the function's body. This makes it
# more likely that we've actually completed the prologue, so "finish"
# will work.
+set alphanum_re "\[a-zA-Z0-9\]"
+set pic_thunk_re "__$alphanum_re*\\.get_pc_thunk\\.$alphanum_re* \\(\\)"
test_i "stepi into function's first source line" "stepi" \
- ".*${decimal}.*int callee" \
+ "(${decimal}.*int callee|$pic_thunk_re)" \
".*${decimal}.*myglob.*; return 0;"
# Have to be careful here, if the finish does not work,
step_until "stepi" "apply\.2" "indirect_thunk" "stepi into call thunk"
step_until "stepi" "indirect_thunk" "inc" \
"stepi out of call thunk into inc"
-step_until "stepi" "inc" "return_thunk" "stepi into return thunk"
+set alphanum_re "\[a-zA-Z0-9\]"
+set pic_thunk_re "__$alphanum_re*\\.get_pc_thunk\\.$alphanum_re* \\(\\)"
+step_until "stepi" "(inc|$pic_thunk_re)" "return_thunk" "stepi into return thunk"
step_until "stepi" "return_thunk" "apply" \
"stepi out of return thunk back into apply"
"reverse-stepi into return thunk"
step_until "reverse-stepi" "return_thunk" "inc" \
"reverse-stepi out of return thunk into inc"
-step_until "reverse-stepi" "inc" "indirect_thunk" \
+step_until "reverse-stepi" "(inc|$pic_thunk_re)" "indirect_thunk" \
"reverse-stepi into call thunk"
step_until "reverse-stepi" "indirect_thunk" "apply" \
"reverse-stepi out of call thunk into apply"
# stepi into a function call
+set alphanum_re "\[a-zA-Z0-9\]"
+set pic_thunk_re "__$alphanum_re*\\.get_pc_thunk\\.$alphanum_re* \\(\\)"
set test_message "stepi into function call"
gdb_test_multiple "stepi" "$test_message" {
-re "ARRIVED IN CALLEE.*$gdb_prompt $" {
send_gdb "stepi\n"
exp_continue
}
+ -re "$pic_thunk_re.*$gdb_prompt $" {
+ send_gdb "stepi\n"
+ exp_continue
+ }
}
# stepi thru return of a function call
send_gdb "stepi\n"
exp_continue
}
+ -re "$pic_thunk_re.*$gdb_prompt $" {
+ send_gdb "stepi\n"
+ exp_continue
+ }
-re "${hex} in main .*:$stepi_location.*STEPI TEST.*$gdb_prompt $" {
send_gdb "stepi\n"
exp_continue
# stepi into a function call
+set alphanum_re "\[a-zA-Z0-9\]"
+set pic_thunk_re "__$alphanum_re*\\.get_pc_thunk\\.$alphanum_re* \\(\\)"
set test_message "stepi into function call"
gdb_test_multiple "stepi" "$test_message" {
-re "ARRIVED IN CALLEE.*$gdb_prompt $" {
send_gdb "stepi\n"
exp_continue
}
+ -re "$pic_thunk_re.*$gdb_prompt $" {
+ send_gdb "stepi\n"
+ exp_continue
+ }
}
# stepi thru return of a function call
send_gdb "stepi\n"
exp_continue
}
+ -re "$pic_thunk_re.*$gdb_prompt $" {
+ send_gdb "stepi\n"
+ exp_continue
+ }
-re "${hex} in main .*:$stepi_location.*STEPI TEST.*$gdb_prompt $" {
send_gdb "stepi\n"
exp_continue