From patchwork Thu Mar 3 19:21:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Evans X-Patchwork-Id: 11177 Received: (qmail 110123 invoked by alias); 3 Mar 2016 19:21:57 -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 110113 invoked by uid 89); 3 Mar 2016 19:21:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=comma, H*M:sk:047d7b1, H*MI:sk:047d7b1, 2514 X-HELO: mail-pa0-f74.google.com Received: from mail-pa0-f74.google.com (HELO mail-pa0-f74.google.com) (209.85.220.74) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 03 Mar 2016 19:21:54 +0000 Received: by mail-pa0-f74.google.com with SMTP id zv9so1670796pab.1 for ; Thu, 03 Mar 2016 11:21:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:message-id:date:subject:from:to:cc; bh=ctfSjBWteoPLGOjusRCDnDb4Yd7GLg5H7dSDsxpea10=; b=gleTBtoMNH3S+10cxotM2BPl+ugBnur7U+wj7HnqmwHqDNvmRmcNrcYFyy7qkPTSRS 5zeBIE008EwQT+3dssWL5mUsxeQy6WiXYP2ueIsuYYja6fNGrdI6xQ+yUDmmkMJuHVCN N9fDZjV5MDVRLvK3A/NPlvam2NmJFdbJT2Tq3TF6AFCn7InuG/hk4nP4XfyTBvrPDcdO OaArexGjgHDSdbZMhEpHXJQVaIMGofgBwuWezao9DYnxeeFk3YnD3NEonMZdjQqd6u/+ g3tIU/A4GJQbk1SW9L9jUpa3R4o4St4QSN90K1bk4k053e00DmXLs83EY+cws9uLgXZj IXmg== X-Gm-Message-State: AD7BkJIdnS+3A2cahGlVPNgwfTNH+6JvcqZM+CmVatFvOZ/sUiUcCENIbHNgtl5J0OgamxJSwA== MIME-Version: 1.0 X-Received: by 10.67.10.209 with SMTP id ec17mr1458406pad.43.1457032912490; Thu, 03 Mar 2016 11:21:52 -0800 (PST) Message-ID: <047d7b15faa92d0dac052d29e927@google.com> Date: Thu, 03 Mar 2016 19:21:52 +0000 Subject: Re: [PATCH, doc RFA] Add "skip regexp" From: Doug Evans To: Simon Marchi Cc: Pedro Alves , , X-IsSubscribed: yes Doug Evans writes: > Simon Marchi writes: > > On 16-02-16 08:07 PM, Doug Evans wrote: > > > +# Test -fi + -fu. > > > + > > > +if ![runto_main] { > > > + fail "Can't run to main" > > > + return > > > +} > > > + > > > +set test "step using -fi + -fu" > > > +gdb_test_no_output "skip delete" > > > +gdb_test "skip -fi skip1.c -fu test_skip" \ > > > + "Function test_skip in file skip1.c will be skipped when > stepping\." > > > +gdb_breakpoint "test_skip_file_and_function" > > > +gdb_breakpoint "end_test_skip_file_and_function" > > > +gdb_test "call test_skip_file_and_function ()" "silently stop." > > > > Hi Doug, > > > > I just saw a failure of this test on a target that doesn't have inferior > calls. It > > seems to me like the function call isn't fundamental to the test and it > could be > > avoided by organizing things differently. What do you think? > > > > Otherwise, we would need to add a > > > > if [target_info exists gdb,cannot_call_functions] { > > Bleah, righto. > > Fix forthcoming. > I need to cleanup skip.exp first. 2016-03-03 Doug Evans * gdb.base/skip.c (main): Call test_skip_file_and_function. * gdb.base/skip.exp: Remove hand calling test_skip_file_and_function. Return from test_skip() diff --git a/gdb/testsuite/gdb.base/skip.c b/gdb/testsuite/gdb.base/skip.c index b9db2a7..e43da1e 100644 --- a/gdb/testsuite/gdb.base/skip.c +++ b/gdb/testsuite/gdb.base/skip.c @@ -25,8 +25,14 @@ void skip1_test_skip_file_and_function (void); int main () { + int x; + /* Use comma operator to sequence evaluation of bar and foo. */ - return baz ((bar (), foo ())); + x = baz ((bar (), foo ())); + + test_skip_file_and_function (); + + return 0; } int diff --git a/gdb/testsuite/gdb.base/skip.exp b/gdb/testsuite/gdb.base/skip.exp index 67ae9d9..ce55dd2 100644 --- a/gdb/testsuite/gdb.base/skip.exp +++ b/gdb/testsuite/gdb.base/skip.exp @@ -281,17 +281,15 @@ with_test_prefix "step using -rfu for baz" { # Test -fi + -fu. with_test_prefix "step using -fi + -fu" { - if ![runto_main] { - fail "Can't run to main" + gdb_test_no_output "skip delete" + + if ![runto test_skip_file_and_function no-message] { + fail "Can't run to test_skip_file_and_function" return } - gdb_test_no_output "skip delete" gdb_test "skip -fi skip1.c -fu test_skip" \ "Function test_skip in file skip1.c will be skipped when stepping\." - gdb_breakpoint "test_skip_file_and_function" - gdb_breakpoint "end_test_skip_file_and_function" - gdb_test "call test_skip_file_and_function ()" "silently stop." # Verify we can step into skip.c:test_skip but not skip1.c:test_skip. gdb_test "step" "test_skip \\(\\) at.*" "step 1" gdb_test "step" "test_skip_file_and_function \\(\\) at.*" "step 2"; #