From patchwork Wed Jun 4 19:57:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siva Chandra Reddy X-Patchwork-Id: 1317 Received: (qmail 30727 invoked by alias); 4 Jun 2014 19:57:58 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 30716 invoked by uid 89); 4 Jun 2014 19:57:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wi0-f180.google.com Received: from mail-wi0-f180.google.com (HELO mail-wi0-f180.google.com) (209.85.212.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 04 Jun 2014 19:57:56 +0000 Received: by mail-wi0-f180.google.com with SMTP id hi2so2181795wib.7 for ; Wed, 04 Jun 2014 12:57:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to:cc :content-type; bh=jkYVaXXFKdzn3bvVog31aJTAYlwy5H9kw1vv5EJgvd4=; b=QVkRmvWFdM7kncqIX7IFW/VC2r4xQI2v1Fm3Ae/4M9LCBk9NcIGAq9WhNTztaQyAjn unswj9IHbWByZIjqrOrkF4VOdWsn619PTcCYQ53KhKjcf0WSjwATV9PxKs2Bbf/Dz50N 2YIcuNONlo5L4Z2XsHGQqFdoxb4G3mhR198PcYxxegNskYHIm+eEyZ86wXnCnc5ylip/ 6dyItImNz3Mse3nVBLQYVoGhKNy9qJHmdHkwqyQNIgvmx2Tb/mPyaz4opubhALoPJZyY q7k6MTzVH28FTZg83PTUeom4ALcC1wyRkOOa2ZiFa8ACkzNwjrwtksgE2XV49UeH279d hpWw== X-Gm-Message-State: ALoCoQmwBI8rveyozn3S3dMGj+dMlPDkrTUEsPFd05EwdAKjsekyZ1LF3xJoJBTIGwa/3wZ8/M78 MIME-Version: 1.0 X-Received: by 10.180.7.137 with SMTP id j9mr8551267wia.7.1401911873555; Wed, 04 Jun 2014 12:57:53 -0700 (PDT) Received: by 10.217.51.7 with HTTP; Wed, 4 Jun 2014 12:57:53 -0700 (PDT) Date: Wed, 4 Jun 2014 12:57:53 -0700 Message-ID: Subject: [PATCH] Fix for PR gdb/17017 From: Siva Chandra To: gdb-patches Cc: Pedro Alves X-IsSubscribed: yes The attached patch should fix PR 17017. ChangeLog 2014-06-04 Siva Chandra Reddy testsuite/ PR gdb/17017 * gdb.python/py-xmethods.exp (gdb_test_if_inferiorio): New function. Update few gdb_test invocations to gdb_test_if_inferiorio. diff --git a/gdb/testsuite/gdb.python/py-xmethods.exp b/gdb/testsuite/gdb.python/py-xmethods.exp index 97b6ffa..7f51cb1 100644 --- a/gdb/testsuite/gdb.python/py-xmethods.exp +++ b/gdb/testsuite/gdb.python/py-xmethods.exp @@ -36,28 +36,35 @@ if ![runto_main] { set xmethods_script [gdb_remote_download host \ ${srcdir}/${subdir}/${testfile}.py] +proc gdb_test_if_inferiorio {gdb_cmd pattern name} { + if ![target_info exists gdb,noinferiorio] { + gdb_test $gdb_cmd $pattern $name + } +} + gdb_breakpoint [gdb_get_line_number "Break here."] gdb_continue_to_breakpoint "Break here" ".*Break here.*" # Tests before loading the debug methods. -gdb_test "p a1 + a2" "From CC .*15" "Before: a1 + a2" -gdb_test "p a2 - a1" "From CC .*5" "Before: a1 - a2" -gdb_test "p b1 - a1" "From CC .*25" "Before: b1 - a1" -gdb_test "p a1.geta()" "From CC A::geta.*5" "Before: a1.geta()" +gdb_test_if_inferiorio "p a1 + a2" "From CC .*15" "Before: a1 + a2" +gdb_test_if_inferiorio "p a2 - a1" "From CC .*5" "Before: a1 - a2" +gdb_test_if_inferiorio "p b1 - a1" "From CC .*25" "Before: b1 - a1" +gdb_test_if_inferiorio "p a1.geta()" "From CC A::geta.*5" "Before: a1.geta()" gdb_test "p ++a1" "No symbol.*" "Before: ++a1" gdb_test "p a1.getarrayind(5)" "Couldn't find method.*" \ "Before: a1.getarrayind(5)" -gdb_test "p a_ptr->geta()" "From CC B::geta.*60" "Before: a_ptr->geta()" -gdb_test "p e.geta()" "From CC A::geta.*100" "Before: e.geta()" -gdb_test "p g.size_diff()" "From CC G<>::size_diff.*" \ +gdb_test_if_inferiorio "p a_ptr->geta()" "From CC B::geta.*60" \ + "Before: a_ptr->geta()" +gdb_test_if_inferiorio "p e.geta()" "From CC A::geta.*100" "Before: e.geta()" +gdb_test_if_inferiorio "p g.size_diff()" "From CC G<>::size_diff.*" \ "Before: g.size_diff()" gdb_test "p g.size_diff()" "Couldn't find method.*" \ "Before: g.size_diff()" -gdb_test "p g.size_mul<2>()" "From CC G<>::size_mul.*" \ +gdb_test_if_inferiorio "p g.size_mul<2>()" "From CC G<>::size_mul.*" \ "Before: g.size_mul<2>()" gdb_test "p g.size_mul<5>()" "Couldn't find method.*" \ "Before: g.size_mul<5>()" -gdb_test "p g.mul(2.0)" "From CC G<>::mul.*" \ +gdb_test_if_inferiorio "p g.mul(2.0)" "From CC G<>::mul.*" \ "Before: g.mul(2.0)" gdb_test "p g.mul('a')" "Couldn't find method.*" \ "Before: g.mul('a')" @@ -67,9 +74,9 @@ gdb_test_no_output "source ${xmethods_script}" "load the script file" # Tests after loading debug methods. gdb_test "p a1 + a2" "From Python .*15" "After: a1 + a2" -gdb_test "p a2 - a1" "From CC .*5" "After: a1 - a2" +gdb_test_if_inferiorio "p a2 - a1" "From CC .*5" "After: a1 - a2" gdb_test "p b1 + a1" "From Python .*35" "After: b1 + a1" -gdb_test "p b1 - a1" "From CC .*25" "After: b1 - a1" +gdb_test_if_inferiorio "p b1 - a1" "From CC .*25" "After: b1 - a1" gdb_test "p a1.geta()" "From Python .*5" "After: a1.geta()" gdb_test "p ++a1" "From Python .*6" "After: ++a1" gdb_test "p a1.getarrayind(5)" "From Python .*5" \