Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(240)

Unified Diff: gdb/testsuite/gdb.base/disp-step-syscall.exp

Issue 124383005: GDB 7.6.50 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@upstream
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gdb/testsuite/gdb.base/disp-step-fork.c ('k') | gdb/testsuite/gdb.base/disp-step-vfork.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gdb/testsuite/gdb.base/disp-step-syscall.exp
diff --git a/gdb/testsuite/gdb.base/disp-step-syscall.exp b/gdb/testsuite/gdb.base/disp-step-syscall.exp
index 915cb97476bfc507037a9cf2406fec8269c3efe9..654a2c6393eacdd25ccad230605e2f169041f393 100644
--- a/gdb/testsuite/gdb.base/disp-step-syscall.exp
+++ b/gdb/testsuite/gdb.base/disp-step-syscall.exp
@@ -1,6 +1,6 @@
# This testcase is part of GDB, the GNU debugger.
-# Copyright 2011-2012 Free Software Foundation, Inc.
+# Copyright 2011-2013 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -26,132 +26,136 @@ set syscall_insn ""
if { [istarget "i\[34567\]86-*-linux*"] || [istarget "x86_64-*-linux*"] } {
set syscall_insn "\[ \t\](int|syscall|sysenter)\[ \t\]"
+} elseif [istarget "arm*-*-linux*"] {
+ set syscall_insn "\[ \t\](swi|svc)\[ \t\]"
} else {
return -1
}
-proc disp_step_cross_syscall { syscall } { with_test_prefix "$syscall" {
- global syscall_insn
- global gdb_prompt
+proc disp_step_cross_syscall { syscall } {
+ with_test_prefix "$syscall" {
+ global syscall_insn
+ global gdb_prompt
- set testfile "disp-step-$syscall"
+ set testfile "disp-step-$syscall"
- if [prepare_for_testing ${testfile}.exp ${testfile} ${testfile}.c {debug}] {
- untested ${testfile}.exp
- return -1
- }
+ if [prepare_for_testing ${testfile}.exp ${testfile} ${testfile}.c {debug}] {
+ untested ${testfile}.exp
+ return -1
+ }
- if { ![runto main] } then {
- fail "run to main ($syscall)"
- return
- }
+ if { ![runto main] } then {
+ fail "run to main ($syscall)"
+ return
+ }
- # Delete the breakpoint on main.
- gdb_test_no_output "delete break 1"
+ # Delete the breakpoint on main.
+ gdb_test_no_output "delete break 1"
- gdb_test "break marker" "Breakpoint.*at.* file .*${testfile}.c, line.*"
- gdb_test_no_output "set displaced-stepping off"
+ gdb_test "break marker" "Breakpoint.*at.* file .*${testfile}.c, line.*"
+ gdb_test_no_output "set displaced-stepping off"
- set syscall_bp 0
- gdb_test_multiple "break $syscall" "break $syscall" {
- -re "Breakpoint (\[0-9\]*) at .*$gdb_prompt $" {
- set syscall_bp $expect_out(1,string)
- pass "break $syscall"
+ set syscall_bp 0
+ gdb_test_multiple "break $syscall" "break $syscall" {
+ -re "Breakpoint (\[0-9\]*) at .*$gdb_prompt $" {
+ set syscall_bp $expect_out(1,string)
+ pass "break $syscall"
+ }
}
- }
- gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, (.* in |__libc_|)$syscall \\(\\).*" \
- "continue to $syscall (1st time)"
- # Hit the breakpoint on $syscall for the first time. In this time, we will let PLT
- # resolution done, and the number single steps we will do later will be
- # reduced.
+ gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, (.* in |__libc_|)$syscall \\(\\).*" \
+ "continue to $syscall (1st time)"
+ # Hit the breakpoint on $syscall for the first time. In this time, we will let PLT
+ # resolution done, and the number single steps we will do later will be
+ # reduced.
- gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, (.* in |__libc_|)$syscall \\(\\).*" \
- "continue to $syscall (2nd time)"
- # Hit the breakpoint on $syscall for the second time. In this time, the address
- # of syscall insn and next insn of syscall are recorded.
+ gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, (.* in |__libc_|)$syscall \\(\\).*" \
+ "continue to $syscall (2nd time)"
+ # Hit the breakpoint on $syscall for the second time. In this time, the address
+ # of syscall insn and next insn of syscall are recorded.
- gdb_test "display/i \$pc" ".*"
+ gdb_test "display/i \$pc" ".*"
- # Single step until we see sysall insn or we reach the upper bound of loop
- # iterations.
- set see_syscall_insn 0
+ # Single step until we see sysall insn or we reach the upper bound of loop
+ # iterations.
+ set see_syscall_insn 0
- for {set i 0} {$i < 1000 && $see_syscall_insn == 0} {incr i} {
- send_gdb "stepi\n"
- gdb_expect {
- -re ".*$syscall_insn.*$gdb_prompt $" {
- set see_syscall_insn 1
+ for {set i 0} {$i < 1000 && $see_syscall_insn == 0} {incr i} {
+ send_gdb "stepi\n"
+ gdb_expect {
+ -re ".*$syscall_insn.*$gdb_prompt $" {
+ set see_syscall_insn 1
+ }
+ -re ".*$gdb_prompt $" {}
}
- -re ".*$gdb_prompt $" {}
}
- }
- if {$see_syscall_insn == 0} then {
- fail "find syscall insn in $syscall"
- return -1
- }
+ if {$see_syscall_insn == 0} then {
+ fail "find syscall insn in $syscall"
+ return -1
+ }
- set syscall_insn_addr [get_hexadecimal_valueof "\$pc" "0"]
- gdb_test "stepi" ".*" "stepi $syscall insn"
- set syscall_insn_next_addr [get_hexadecimal_valueof "\$pc" "0"]
+ set syscall_insn_addr [get_hexadecimal_valueof "\$pc" "0"]
+ gdb_test "stepi" ".*" "stepi $syscall insn"
+ set syscall_insn_next_addr [get_hexadecimal_valueof "\$pc" "0"]
- gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, (.* in |__libc_|)$syscall \\(\\).*" \
- "continue to $syscall (3rd time)"
+ gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, (.* in |__libc_|)$syscall \\(\\).*" \
+ "continue to $syscall (3rd time)"
- # Hit the breakpoint on $syscall for the third time. In this time, we'll set
- # breakpoint on the syscall insn we recorded previously, and single step over it.
+ # Hit the breakpoint on $syscall for the third time. In this time, we'll set
+ # breakpoint on the syscall insn we recorded previously, and single step over it.
- set syscall_insn_bp 0
- gdb_test_multiple "break \*$syscall_insn_addr" "break on syscall insn" {
- -re "Breakpoint (\[0-9\]*) at .*$gdb_prompt $" {
- set syscall_insn_bp $expect_out(1,string)
- pass "break on syscall insns"
+ set syscall_insn_bp 0
+ gdb_test_multiple "break \*$syscall_insn_addr" "break on syscall insn" {
+ -re "Breakpoint (\[0-9\]*) at .*$gdb_prompt $" {
+ set syscall_insn_bp $expect_out(1,string)
+ pass "break on syscall insns"
+ }
}
- }
- gdb_test_no_output "delete $syscall_bp" "delete break $syscall"
+ gdb_test_no_output "delete $syscall_bp" "delete break $syscall"
- gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, .*" \
- "continue to syscall insn $syscall"
+ gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, .*" \
+ "continue to syscall insn $syscall"
- gdb_test_no_output "set displaced-stepping on"
+ gdb_test_no_output "set displaced-stepping on"
- # Check the address of next instruction of syscall.
- if {$syscall == "vfork" && [is_remote target]} {
- setup_kfail server/13796 "*-*-*"
- }
- set test "single step over $syscall"
- gdb_test_multiple "stepi" $test {
- -re "Program terminated with signal SIGILL,.*\r\n$gdb_prompt $" {
- fail $test
- return
+ # Check the address of next instruction of syscall.
+ if {$syscall == "vfork" && [is_remote target]} {
+ setup_kfail server/13796 "*-*-*"
}
- -re "\\\[Inferior .* exited normally\\\].*\r\n$gdb_prompt $" {
- fail $test
- return
+ set test "single step over $syscall"
+ gdb_test_multiple "stepi" $test {
+ -re "Program terminated with signal SIGILL,.*\r\n$gdb_prompt $" {
+ fail $test
+ return
+ }
+ -re "\\\[Inferior .* exited normally\\\].*\r\n$gdb_prompt $" {
+ fail $test
+ return
+ }
+ -re "\r\n$gdb_prompt $" {
+ pass $test
+ }
}
- -re "\r\n$gdb_prompt $" {
+
+ set syscall_insn_next_addr_found [get_hexadecimal_valueof "\$pc" "0"]
+
+ set test "single step over $syscall final pc"
+ if {$syscall_insn_next_addr != 0
+ && $syscall_insn_next_addr == $syscall_insn_next_addr_found} {
pass $test
+ } else {
+ fail $test
}
- }
- set syscall_insn_next_addr_found [get_hexadecimal_valueof "\$pc" "0"]
+ # Delete breakpoint syscall insns to avoid interference to other syscalls.
+ gdb_test_no_output "delete $syscall_insn_bp" "delete break $syscall insn"
- set test "single step over $syscall final pc"
- if {$syscall_insn_next_addr != 0
- && $syscall_insn_next_addr == $syscall_insn_next_addr_found} {
- pass $test
- } else {
- fail $test
+ gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, marker \\(\\) at.*" \
+ "continue to marker ($syscall)"
}
-
- # Delete breakpoint syscall insns to avoid interference to other syscalls.
- gdb_test_no_output "delete $syscall_insn_bp" "delete break $syscall insn"
-
- gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, marker \\(\\) at.*" \
- "continue to marker ($syscall)"
-}}
+}
disp_step_cross_syscall "fork"
disp_step_cross_syscall "vfork"
« no previous file with comments | « gdb/testsuite/gdb.base/disp-step-fork.c ('k') | gdb/testsuite/gdb.base/disp-step-vfork.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698