From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22385 invoked by alias); 24 Oct 2008 18:30:35 -0000 Received: (qmail 22373 invoked by uid 22791); 24 Oct 2008 18:30:34 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 24 Oct 2008 18:29:59 +0000 Received: (qmail 18492 invoked from network); 24 Oct 2008 18:29:57 -0000 Received: from unknown (HELO orlando.local) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 24 Oct 2008 18:29:57 -0000 From: Pedro Alves To: gdb-patches@sourceware.org, tromey@redhat.com, Thiago Jung Bauermann Subject: Fix python-value.exp for stubs Date: Fri, 24 Oct 2008 18:30:00 -0000 User-Agent: KMail/1.9.9 MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_pQhAJb6yVYCNoFO" Message-Id: <200810241930.01181.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-10/txt/msg00610.txt.bz2 --Boundary-00=_pQhAJb6yVYCNoFO Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Content-length: 1109 I've noticed these failures when testing against a local gdbserver. Using ../../../src/gdb/testsuite/config/gdbserver.exp as tool-and-target-specific interface file. Running ../../../src/gdb/testsuite/gdb.python/python-value.exp ... FAIL: gdb.python/python-value.exp: continue to breakpoint: break to inspect struct and union FAIL: gdb.python/python-value.exp: print s FAIL: gdb.python/python-value.exp: access element inside struct using 8-bit string name FAIL: gdb.python/python-value.exp: access element inside struct using unicode name FAIL: gdb.python/python-value.exp: print argv FAIL: gdb.python/python-value.exp: dereference value FAIL: gdb.python/python-value.exp: verify dereferenced value The issue here is the usage of gdb_start_cmd, which is a nop against stubs. The attached fixes it here for me, both gdbserver, and native linux. The race mentioned in the test seems to be related to the fact that gdb_start_cmd doesn't wait for "main" to be reached at all. The attached patch should get rid of the need to work around that. Tromey, Bauermann, OK to apply this? -- Pedro Alves --Boundary-00=_pQhAJb6yVYCNoFO Content-Type: text/x-diff; charset="utf-8"; name="python_remote.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="python_remote.diff" Content-length: 1233 2008-10-24 Pedro Alves * gdb.python/python-value.exp (test_value_in_inferior): Don't use gdb_start_cmd. Use runto_main before any test that requires execution. --- gdb/testsuite/gdb.python/python-value.exp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) Index: src/gdb/testsuite/gdb.python/python-value.exp =================================================================== --- src.orig/gdb/testsuite/gdb.python/python-value.exp 2008-10-24 19:22:59.000000000 +0100 +++ src/gdb/testsuite/gdb.python/python-value.exp 2008-10-24 19:24:05.000000000 +0100 @@ -199,11 +199,6 @@ proc test_value_in_inferior {} { global testfile gdb_breakpoint [gdb_get_line_number "break to inspect struct and union"] - gdb_start_cmd - - # Avoid race condition where a continue command in gdb_continue_to_breakpoint - # is issued too early. - gdb_test "" "$gdb_prompt" gdb_continue_to_breakpoint "break to inspect struct and union" @@ -247,4 +242,12 @@ test_value_creation test_value_numeric_ops test_value_boolean test_value_compare + +# The following tests require execution. + +if ![runto_main] then { + fail "Can't run to main" + return 0 +} + test_value_in_inferior --Boundary-00=_pQhAJb6yVYCNoFO--