This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Step over syscalll insn with disp-step on and off


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=e197ad3c87723a2bdf383d38fcfa3eaa4fa1ba12

commit e197ad3c87723a2bdf383d38fcfa3eaa4fa1ba12
Author: Yao Qi <yao.qi@linaro.org>
Date:   Thu Mar 3 09:17:44 2016 +0000

    Step over syscalll insn with disp-step on and off
    
    disp-step-syscall.exp was added to test displaced stepping over syscall
    instructions, in which we set breakpoint on syscall instruction, and
    step over it.  In fact, we can extend the test to non-displaced-stepping
    case.  This patch wraps the test with displaced stepping on and off.
    Note that the indentation and format isn't adjusted here to make this
    patch easy to read.  The following patch will fix the format separately.
    
    gdb/testsuite:
    
    2016-03-03  Yao Qi  <yao.qi@linaro.org>
    
    	* gdb.base/disp-step-syscall.exp: Don't invoke
    	support_displaced_stepping.
    	(disp_step_cross_syscall): Test with displaced stepping off and
    	on if supported.

Diff:
---
 gdb/testsuite/ChangeLog                      |  7 +++++++
 gdb/testsuite/gdb.base/disp-step-syscall.exp | 13 +++++++------
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index a8b958f..244efcc 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,12 @@
 2016-03-03  Yao Qi  <yao.qi@linaro.org>
 
+	* gdb.base/disp-step-syscall.exp: Don't invoke
+	support_displaced_stepping.
+	(disp_step_cross_syscall): Test with displaced stepping off and
+	on if supported.
+
+2016-03-03  Yao Qi  <yao.qi@linaro.org>
+
 	* gdb.base/disp-step-syscall.exp (check_pc_after_cross_syscall): New
 	proc.
 	(setup): New proc.
diff --git a/gdb/testsuite/gdb.base/disp-step-syscall.exp b/gdb/testsuite/gdb.base/disp-step-syscall.exp
index a1af3b4..3cf436d 100644
--- a/gdb/testsuite/gdb.base/disp-step-syscall.exp
+++ b/gdb/testsuite/gdb.base/disp-step-syscall.exp
@@ -15,11 +15,6 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { ![support_displaced_stepping] } {
-    unsupported "displaced stepping"
-    return -1
-}
-
 set syscall_insn ""
 
 # Define the syscall instruction for each target.
@@ -124,6 +119,11 @@ proc disp_step_cross_syscall { syscall } {
 	    return -1
 	}
 
+	foreach_with_prefix displaced {"off" "on"} {
+	    if {$displaced == "on" && ![support_displaced_stepping]} {
+		continue
+	    }
+
 	set ret [setup $syscall]
 
 	set syscall_insn_addr [lindex $ret 0]
@@ -149,7 +149,7 @@ proc disp_step_cross_syscall { 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 $displaced"
 
 	# Check the address of next instruction of syscall.
 	if {[gdb_test "stepi" "x/i .*=>.*" "single step over $syscall"] != 0} {
@@ -164,6 +164,7 @@ proc disp_step_cross_syscall { syscall } {
 	gdb_test "break marker" "Breakpoint.*at.* file .*${testfile}.c, line.*"
 	gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, marker \\(\\) at.*" \
 	    "continue to marker ($syscall)"
+	}
     }
 }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]