Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb-patches@sourceware.org, Kevin Pouget <kevin.pouget@gmail.com>,
	       Tom Tromey <tromey@redhat.com>
Subject: [commit test fixes] [patch] Forbid "run" etc. for use_gdb_stub targets  [Re: [patch] gdb.python/py-events.exp: Disable multi-inferior for gdbserver]
Date: Fri, 28 Oct 2011 17:40:00 -0000	[thread overview]
Message-ID: <20111028173556.GA18885@host1.jankratochvil.net> (raw)
In-Reply-To: <201110271909.37066.pedro@codesourcery.com>

On Thu, 27 Oct 2011 20:09:36 +0200, Pedro Alves wrote:
> > I am not sure what is the correct way to handle gdbserver_start_extended.
> > gdb.server/ext-*.exp run gdbserver even in the default native run.  They
> > either should not run in the default native or they should not run in the
> > non-extended gdbserver mode.  Currently they run in both modes the same way.
> 
> These tests were written to smoke test gdbserver on native test runs.

Therefore shouldn't be the gdb.server/ext-*.exp testfiles skipped if the
target board defined use_gdb_stub?  (ext-attach.exp already is skipped, for
the [is_remote target] reason)

I have left it as is as the same duplicate run with different boards does not
harm anything.


> > --- a/gdb/testsuite/gdb.base/async-shell.exp
> > +++ b/gdb/testsuite/gdb.base/async-shell.exp
> > @@ -20,6 +20,10 @@ if { ![support_displaced_stepping] } {
> >      return -1
> >  }
> >  
> > +if [is_remote target] { 
> > +    return -1
> > +}
> 
> Shouldn't this be a check for use_gdb_stub instead?  (I know
> the bug was originally linux native.)  Doesn't matter much though.

Used now:
# The testfile uses "run".  The real bug happened only for ![is_remote target].

You are right the test can run everywhere !use_gdb_stub.  But with remote.c in
use the bug being tested cannot happen (there are no two child processes
conflicting for wait(PID) result), so it just gives PASS not testing much.


> The test fixes look right to me.  IMO, you should put them
> in upfront and separately from the new smart detection.

Checked in those.


Thanks,
Jan



http://sourceware.org/ml/gdb-cvs/2011-10/msg00208.html

--- src/gdb/testsuite/ChangeLog	2011/10/28 14:49:18	1.2913
+++ src/gdb/testsuite/ChangeLog	2011/10/28 17:32:28	1.2914
@@ -1,15 +1,27 @@
+2011-10-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+	* gdb.base/async-shell.exp: Skip the testfile for use_gdb_stub.
+	* gdb.base/attach-pie-misread.exp: Likewise.
+	* gdb.base/break-interp.exp: Likewise.
+	* gdb.base/default.exp (attach, run "r" abbreviation, run): Skip these
+	testcases for use_gdb_stub.
+	* gdb.dwarf2/dw2-restore.exp: Fix the run for use_gdb_stub.
+	(continue): New testcase.
+	* gdb.python/py-events.exp: Skip the testfile for use_gdb_stub.
+	* gdb.threads/attach-into-signal.exp: Likewise.
+	* gdb.threads/attach-stopped.exp: Likewise.
+	* gdb.threads/attachstop-mt.exp: Likewise.
+
 2011-10-28  Paul Koning  <paul_koning@dell.com>
 
 	* gdb.python/lib-types.exp (deep_items): Rename from deepitems.
 
-
 2011-10-27  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
 	* lib/mi-support.exp (breakpoint_re): Suppress match reporting.
 	(mi_gdb_test): Import globals thread_selected_re
 	and breakpoint_re.  Expect them optionally at the regex start.
 
-
 2011-10-27  Doug Evans  <dje@google.com>
 
 	* gdb.python/python.exp: Test source -s.
--- src/gdb/testsuite/gdb.base/async-shell.exp	2011/07/18 04:14:21	1.2
+++ src/gdb/testsuite/gdb.base/async-shell.exp	2011/10/28 17:32:29	1.3
@@ -20,6 +20,11 @@
     return -1
 }
 
+# The testfile uses "run".  The real bug happened only for ![is_remote target].
+if [target_info exists use_gdb_stub] {
+    return 0
+}
+
 if { [prepare_for_testing ${testfile}.exp ${testfile}] } {
     return -1
 }
--- src/gdb/testsuite/gdb.base/attach-pie-misread.exp	2011/01/01 15:33:40	1.3
+++ src/gdb/testsuite/gdb.base/attach-pie-misread.exp	2011/10/28 17:32:30	1.4
@@ -14,7 +14,8 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # This test only works on GNU/Linux.
-if { ![isnative] || [is_remote host] || ![istarget *-linux*] || [skip_shlib_tests]} {
+if { ![isnative] || [is_remote host] || [target_info exists use_gdb_stub]
+     || ![istarget *-linux*] || [skip_shlib_tests]} {
     continue
 }
 
--- src/gdb/testsuite/gdb.base/break-interp.exp	2011/07/01 19:12:12	1.30
+++ src/gdb/testsuite/gdb.base/break-interp.exp	2011/10/28 17:32:30	1.31
@@ -14,7 +14,8 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # This test only works on GNU/Linux.
-if { ![isnative] || [is_remote host] || ![istarget *-linux*] || [skip_shlib_tests]} {
+if { ![isnative] || [is_remote host] || [target_info exists use_gdb_stub]
+     || ![istarget *-linux*] || [skip_shlib_tests]} {
     continue
 }
 
--- src/gdb/testsuite/gdb.base/default.exp	2011/05/20 14:37:20	1.49
+++ src/gdb/testsuite/gdb.base/default.exp	2011/10/28 17:32:30	1.50
@@ -39,23 +39,23 @@
 gdb_test "append binary memory" "Missing filename\." 
 gdb_test "append binary value"  "Missing filename\." 
 
-setup_xfail "mips-idt-*"
-gdb_test_multiple "attach" "attach" {
-    -re "Argument required .(process-id|program) to attach.*$gdb_prompt $"\
-	{ pass "attach" }
-    -re "You can't do that when your target is `None'.*$gdb_prompt $"\
-	{ pass "attach" }
-    -re "You can't do that without a process to debug.*$gdb_prompt $"\
-	{ pass "attach" }
-    -re "Don't know how to attach.  Try \"help target\"..*$gdb_prompt $"\
-	{ pass "attach" }
-    -re "Kill it. .y or n." {
-	send_gdb "y\n"
-	exp_continue
+if ![target_info exists use_gdb_stub] {
+    setup_xfail "mips-idt-*"
+    gdb_test_multiple "attach" "attach" {
+	-re "Argument required .(process-id|program) to attach.*$gdb_prompt $"\
+	    { pass "attach" }
+	-re "You can't do that when your target is `None'.*$gdb_prompt $"\
+	    { pass "attach" }
+	-re "You can't do that without a process to debug.*$gdb_prompt $"\
+	    { pass "attach" }
+	-re "Don't know how to attach.  Try \"help target\"..*$gdb_prompt $"\
+	    { pass "attach" }
+	-re "Kill it. .y or n." {
+	    send_gdb "y\n"
+	    exp_continue
+	}
     }
-}
 
-if ![target_info exists use_gdb_stub] {
     gdb_test "break" "No default breakpoint address now." "break"
     foreach i "b br bre brea" {
 	gdb_test $i "No default breakpoint address now." "break \"$i\" abbreviation"
@@ -420,7 +420,9 @@
 gdb_test "pwd" "Working directory .*" "pwd"
 
 #test run "r" abbreviation
-if [istarget "*-*-vxworks*"] then {
+if [target_info exists use_gdb_stub] {
+    # Only extended-remote supports "run".
+} elseif [istarget "*-*-vxworks*"] then {
     gdb_test "set args" ".*" "" 
 
     gdb_test "r" "Starting program: .*
@@ -446,7 +448,9 @@
 }
 
 #test run
-if [istarget "*-*-vxworks*"] then {
+if [target_info exists use_gdb_stub] {
+    # Only extended-remote supports "run".
+} elseif [istarget "*-*-vxworks*"] then {
     gdb_test "set args" ".*" "" 
 
     gdb_test "run" "Starting program: .*
--- src/gdb/testsuite/gdb.dwarf2/dw2-restore.exp	2011/05/13 17:17:22	1.5
+++ src/gdb/testsuite/gdb.dwarf2/dw2-restore.exp	2011/10/28 17:32:30	1.6
@@ -33,5 +33,8 @@
 gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
 
-gdb_test "run" ".*"
-gdb_test "where" ".*$hex in foo ().+$hex in _start ().*"
+if ![runto foo] {
+    return 0
+}
+gdb_test "continue" "$hex in foo \\(\\)"
+gdb_test "where" "#0 +$hex in foo \\(\\)\r\n#1 +$hex in _start \\(\\)"
--- src/gdb/testsuite/gdb.python/py-events.exp	2011/10/07 07:38:30	1.5
+++ src/gdb/testsuite/gdb.python/py-events.exp	2011/10/28 17:32:30	1.6
@@ -13,6 +13,10 @@
 # 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 [target_info exists use_gdb_stub] {
+    return 0
+}
+
 if $tracelevel then {
     strace $tracelevel
 }
--- src/gdb/testsuite/gdb.threads/attach-into-signal.exp	2011/01/01 15:33:50	1.6
+++ src/gdb/testsuite/gdb.threads/attach-into-signal.exp	2011/10/28 17:32:30	1.7
@@ -17,7 +17,8 @@
 # This file was created by Jan Kratochvil <jan.kratochvil@redhat.com>.
 
 # This test only works on Linux
-if { ![isnative] || [is_remote host] || ![istarget *-linux*] } {
+if { ![isnative] || [is_remote host] || [target_info exists use_gdb_stub]
+     || ![istarget *-linux*] } {
     continue
 }
 
--- src/gdb/testsuite/gdb.threads/attach-stopped.exp	2011/10/14 16:05:05	1.7
+++ src/gdb/testsuite/gdb.threads/attach-stopped.exp	2011/10/28 17:32:30	1.8
@@ -18,7 +18,8 @@
 # This file was updated by Jan Kratochvil <jan.kratochvil@redhat.com>.
 
 # This test only works on Linux
-if { ![isnative] || [is_remote host] || ![istarget *-linux*] } {
+if { ![isnative] || [is_remote host] || [target_info exists use_gdb_stub]
+     || ![istarget *-linux*] } {
     continue
 }
 
--- src/gdb/testsuite/gdb.threads/attachstop-mt.exp	2011/10/14 16:05:05	1.8
+++ src/gdb/testsuite/gdb.threads/attachstop-mt.exp	2011/10/28 17:32:30	1.9
@@ -17,7 +17,8 @@
 # <jjohnstn@redhat.com> and Jan Kratochvil <jan.kratochvil@redhat.com>.
 
 # This test only works on Linux
-if { ![isnative] || [is_remote host] || ![istarget *-linux*] } {
+if { ![isnative] || [is_remote host] || [target_info exists use_gdb_stub]
+     || ![istarget *-linux*] } {
     continue
 }
 


  reply	other threads:[~2011-10-28 17:36 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-21  9:19 [PATCH] PR/12691 Add the inferior to Python exited event Kevin Pouget
2011-04-21 10:01 ` Eli Zaretskii
2011-04-25 18:19 ` Tom Tromey
2011-04-26  8:24   ` Kevin Pouget
2011-08-31 14:34     ` Kevin Pouget
2011-08-31 14:46       ` Eli Zaretskii
2011-08-31 14:58         ` Kevin Pouget
2011-08-31 17:27           ` Eli Zaretskii
2011-08-31 17:53             ` Tom Tromey
2011-08-31 17:59               ` Eli Zaretskii
2011-09-01  9:18                 ` Kevin Pouget
2011-09-01  8:45                   ` Kevin Pouget
2011-09-01 10:12                   ` Eli Zaretskii
2011-09-01 11:29                     ` Kevin Pouget
2011-09-15 12:49                       ` Kevin Pouget
2011-09-15 13:58                         ` Eli Zaretskii
2011-09-15 14:19                         ` Paul_Koning
2011-09-15 15:27                           ` Kevin Pouget
2011-09-15 15:42                           ` Eli Zaretskii
2011-08-31 15:50       ` Tom Tromey
2011-09-19 10:37         ` Kevin Pouget
2011-09-19 10:41           ` Eli Zaretskii
2011-10-03 16:38           ` Tom Tromey
2011-10-04  8:05             ` Kevin Pouget
2011-10-05 12:15               ` Regression (or a new FAIL?): gdb.python/py-events.exp [Re: [PATCH] PR/12691 Add the inferior to Python exited event] Jan Kratochvil
2011-10-05 12:37                 ` Kevin Pouget
2011-10-05 14:16                   ` Jan Kratochvil
2011-10-05 14:56                     ` Kevin Pouget
2011-10-09 18:17                       ` [patch] gdb.python/py-events.exp: Disable multi-inferior for gdbserver [Re: Regression (or a new FAIL?): gdb.python/py-events.exp] Jan Kratochvil
2011-10-26 15:07                         ` Pedro Alves
2011-10-27 10:31                           ` [patch] Forbid "run" etc. for use_gdb_stub targets [Re: [patch] gdb.python/py-events.exp: Disable multi-inferior for gdbserver] Jan Kratochvil
2011-10-27 18:26                             ` Pedro Alves
2011-10-28 17:40                               ` Jan Kratochvil [this message]
2011-10-28 17:42                               ` Jan Kratochvil
2011-10-28 18:32                                 ` Pedro Alves
2011-10-29 19:55                                   ` Jan Kratochvil
2011-12-03 18:37                                     ` ping: Re: [patch] Forbid "run" etc. for use_gdb_stub targets Jan Kratochvil
2011-12-03 19:15                                       ` Pedro Alves
2011-12-03 20:22                                         ` [commit] " Jan Kratochvil
2011-12-04  1:02                                       ` ping: " Doug Evans
2011-12-04  1:30                                         ` Jan Kratochvil
2011-12-04  2:55                                           ` Doug Evans
2011-12-05 20:25                                             ` Jan Kratochvil
2011-12-05 21:44                                               ` Doug Evans
2011-12-05 23:36                                                 ` Doug Evans

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111028173556.GA18885@host1.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=kevin.pouget@gmail.com \
    --cc=pedro@codesourcery.com \
    --cc=tromey@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox