Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] reverse debugging tests
@ 2009-09-11 20:49 Michael Snyder
  2009-09-11 22:29 ` Tom Tromey
  2009-09-15  0:23 ` Hui Zhu
  0 siblings, 2 replies; 3+ messages in thread
From: Michael Snyder @ 2009-09-11 20:49 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 1634 bytes --]

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
+       }
+    }
  }


[-- Attachment #2: reversetests.txt --]
[-- Type: text/plain, Size: 1614 bytes --]

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)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFA] reverse debugging tests
  2009-09-11 20:49 [RFA] reverse debugging tests Michael Snyder
@ 2009-09-11 22:29 ` Tom Tromey
  2009-09-15  0:23 ` Hui Zhu
  1 sibling, 0 replies; 3+ messages in thread
From: Tom Tromey @ 2009-09-11 22:29 UTC (permalink / raw)
  To: Michael Snyder; +Cc: gdb-patches

>>>>> "Michael" == Michael Snyder <msnyder@vmware.com> writes:

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

Thanks for doing this.

Michael> So I've made two changes:
Michael> 1) In place of "if ![target_info exists gdb,can_reverse]"
Michael> substitute
Michael> +if [istarget "*linux*"] then {
Michael> +    if { ![istarget "i?86-*linux*"] && ![istarget "amd64-*linux*"] } then {
Michael> +       # test process record on i?86 and amd64 linux
Michael> +       return;
Michael> +    }
Michael> +}

I assume the old gdb,can_reverse and gdb,use_precord target settings no
longer make sense.

I would recommend putting each of these snippets into a function in
lib/gdb.exp.  That way it is simpler to update them in the future.

Michael> +       gdb_test "record" "" "Turn on process record"
Michael> +       # FIXME: command ought to acknowledge, so we can test if it
Michael> succeeded.

This seems like a good idea.

Otherwise this looks fine to me.

Tom


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFA] reverse debugging tests
  2009-09-11 20:49 [RFA] reverse debugging tests Michael Snyder
  2009-09-11 22:29 ` Tom Tromey
@ 2009-09-15  0:23 ` Hui Zhu
  1 sibling, 0 replies; 3+ messages in thread
From: Hui Zhu @ 2009-09-15  0:23 UTC (permalink / raw)
  To: Michael Snyder; +Cc: gdb-patches

It works OK with me.

Thanks,
Hui

On Sat, Sep 12, 2009 at 04:47, Michael Snyder <msnyder@vmware.com> wrote:
> 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)
>
>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-09-15  0:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-11 20:49 [RFA] reverse debugging tests Michael Snyder
2009-09-11 22:29 ` Tom Tromey
2009-09-15  0:23 ` Hui Zhu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox