This is the mail archive of the gdb-patches@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]

[RFA] reverse debugging tests


Note, I've only done one of the several tests here --
if this change is approved, I'll change the others the same way.

This patch is to make the reverse debugging tests auto-detect
the targets that they can run on, to eliminate the need for
using a board description file to run them.

It's tricky, because we have to detect several different kinds
of targets:
1) Native Linux, which can be detected early, and
2) Remote targets that answer the qSupported probe appropriately,
which can't be tested until after gdb connects to the target.

So I've made two changes:

1) In place of "if ![target_info exists gdb,can_reverse]"
substitute
+if [istarget "*linux*"] then {
+    if { ![istarget "i?86-*linux*"] && ![istarget "amd64-*linux*"] } then {
+       # test process record on i?86 and amd64 linux
+       return;
+    }
+}


and 2) After "runto main", this substitution:

-if [target_info exists gdb,use_precord] {
- # Activate process record/replay
- gdb_test "record" "" "Turn on process record"
- # FIXME: command ought to acknowledge, so we can test if it succeeded.
+if ![target_info exists use_gdb_stub] then {
+ if { [istarget "i?86-*linux*"] || [istarget "amd64-*linux*"] } then {
+ # Activate process record/replay
+ gdb_test "record" "" "Turn on process record"
+ # FIXME: command ought to acknowledge, so we can test if it succeeded.
+ }
+}
+
+if [target_info exists use_gdb_stub] then {
+ send_gdb "show remote reverse-continue\n"
+ gdb_expect {
+ -re ".* currently enabled.*$gdb_prompt " {
+ }
+ -re ".*$gdb_prompt " {
+ return
+ }
+ }
}


2009-09-11  Michael Snyder  <msnyder@vmware.com>

	* gdb.reverse/step-reverse.exp: Explicitly check for targets
	that can support reverse debuggnig.

Index: step-reverse.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.reverse/step-reverse.exp,v
retrieving revision 1.2
diff -u -p -r1.2 step-reverse.exp
--- step-reverse.exp	14 Jul 2009 20:17:26 -0000	1.2
+++ step-reverse.exp	11 Sep 2009 19:14:19 -0000
@@ -20,8 +20,11 @@
 # Test step and next in reverse
 #
 
-if ![target_info exists gdb,can_reverse] {
-    return
+if [istarget "*linux*"] then {
+    if { ![istarget "i?86-*linux*"] && ![istarget "amd64-*linux*"] } then {
+	# test process record on i?86 and amd64 linux
+	return;
+    }
 }
 
 set testfile "step-reverse"
@@ -33,10 +36,23 @@ if { [prepare_for_testing $testfile.exp 
 
 runto main
 
-if [target_info exists gdb,use_precord] {
-    # Activate process record/replay
-    gdb_test "record" "" "Turn on process record"
-    # FIXME: command ought to acknowledge, so we can test if it succeeded.
+if ![target_info exists use_gdb_stub] then {
+    if { [istarget "i?86-*linux*"] || [istarget "amd64-*linux*"] } then {
+	# Activate process record/replay
+	gdb_test "record" "" "Turn on process record"
+	# FIXME: command ought to acknowledge, so we can test if it succeeded.
+    }
+}
+
+if [target_info exists use_gdb_stub] then {
+    send_gdb "show remote reverse-continue\n"
+    gdb_expect {
+	-re ".* currently enabled.*$gdb_prompt " {
+	}
+	-re ".*$gdb_prompt " {
+	    return
+	}
+    }
 }
 
 # plain vanilla step/next (no count)

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