From patchwork Sat May 11 18:56:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philippe Waroquiers X-Patchwork-Id: 32648 Received: (qmail 58629 invoked by alias); 11 May 2019 18:56:17 -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 58579 invoked by uid 89); 11 May 2019 18:56:17 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=sk:changel, sk:ChangeL, philippe, preserved X-HELO: mailsec109.isp.belgacom.be Received: from mailsec109.isp.belgacom.be (HELO mailsec109.isp.belgacom.be) (195.238.20.105) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 11 May 2019 18:56:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=skynet.be; i=@skynet.be; q=dns/txt; s=securemail; t=1557600975; x=1589136975; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=CBKARMj92PNJ5uSjO+xKXtLZnY41yGT6Lh8PwWBxcFY=; b=XkWmjgWn9ObgxkKa41SawubXE/9FlIr2Vc+VlJ5TmJ8zxPTy5An7bZtR DGhzf7ixbqpADHejXSVCOqE4cJyZgA==; Received: from 59.151-129-109.adsl-dyn.isp.belgacom.be (HELO md.home) ([109.129.151.59]) by relay.skynet.be with ESMTP/TLS/DHE-RSA-AES128-GCM-SHA256; 11 May 2019 20:56:09 +0200 From: Philippe Waroquiers To: gdb-patches@sourceware.org Cc: Philippe Waroquiers Subject: [RFAv2 2/3] Test 'set print frame-info|frame-arguments presence'. Date: Sat, 11 May 2019 20:56:02 +0200 Message-Id: <20190511185603.17231-3-philippe.waroquiers@skynet.be> In-Reply-To: <20190511185603.17231-1-philippe.waroquiers@skynet.be> References: <20190511185603.17231-1-philippe.waroquiers@skynet.be> MIME-Version: 1.0 X-IsSubscribed: yes --- gdb/testsuite/ChangeLog | 5 ++ gdb/testsuite/gdb.base/frame-args.exp | 56 ++++++++++++++++++++ gdb/testsuite/gdb.python/py-framefilter.exp | 57 +++++++++++++++++++-- 3 files changed, 114 insertions(+), 4 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 252a183d97..94d15d593d 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -15933,3 +15933,8 @@ For older changes see ChangeLog-1993-2013. Copyright 2014-2019 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted provided the copyright notice and this notice are preserved. +2019-05-04 Philippe Waroquiers + + * gdb.base/frame-args.exp: Test new 'frame-arguments presence'. + Test new 'set print frame-info'. + * gdb.python/py-framefilter.exp: Likewise. diff --git a/gdb/testsuite/gdb.base/frame-args.exp b/gdb/testsuite/gdb.base/frame-args.exp index 77f136c064..9e632c6433 100644 --- a/gdb/testsuite/gdb.base/frame-args.exp +++ b/gdb/testsuite/gdb.base/frame-args.exp @@ -50,4 +50,60 @@ gdb_test "frame 1" \ ".*in call_me \\(i=\\.\\.\\., f=\\.\\.\\., s=\\.\\.\\., ss=\\.\\.\\., u=\\.\\.\\., e=\\.\\.\\.\\) at .*frame-args\\.c:.*" \ "frame 1 with print frame-arguments set to none" +# Test with "print frame-arguments" set to "presence" + +gdb_test_no_output "set print frame-arguments presence" \ + "set print frame-arguments presence" +gdb_test "frame 1" \ + ".*in call_me \\(\\.\\.\\.\\) at .*frame-args\\.c:.*" \ + "frame 1 with print frame-arguments set to presence" +gdb_test "frame 2" \ + ".*in main \\(\\) at .*frame-args\\.c:.*" \ + "frame 2 (no args) with print frame-arguments set to presence" + + +# Test with "print frame-info" set to "location-and-address" +gdb_test_no_output "set print frame-info location-and-address" \ + "set print frame-info location-and-address" +gdb_test "frame 1" \ + ".*0x.* in call_me \\(\\.\\.\\.\\) at .*frame-args\\.c:.*" \ + "frame 1 with print frame-info set to location-and-address" + +# Test with "print address" set to "off" ... +gdb_test_no_output "set print address off" \ + "set print address off" + +# ... and "location-and-address" (previously set) +gdb_test "frame 1" \ + "#1 call_me \\(\\.\\.\\.\\) at .*frame-args\\.c:.*" \ + "frame 1 with print frame-info set to location-and-address and address off" + +# ... and "location" +gdb_test_no_output "set print frame-info location" \ + "set print frame-info location" +gdb_test "frame 1" \ + "#1 call_me \\(\\.\\.\\.\\) at .*frame-args\\.c:.*" \ + "frame 1 with print frame-info set to location and address off" + +# ... and "short-location" +gdb_test_no_output "set print frame-info short-location" \ + "set print frame-info short-location" +gdb_test "frame 1" \ + "#1 call_me \\(\\.\\.\\.\\)" \ + "frame 1 with print frame-info set to short-location and address off" + +# ... and "source-and-location" +gdb_test_no_output "set print frame-info source-and-location" \ + "set print frame-info source-and-location" +gdb_test "frame 1" \ + "#1 call_me \\(\\.\\.\\.\\) at .*frame-args\\.c:.*\r\n\[1-9\]\[0-9\]*\[ \t\]*break_me \\(\\);" \ + "frame 1 with print frame-info set to source-and-location and address off" + +# ... and "source-line". +gdb_test_no_output "set print frame-info source-line" \ + "set print frame-info source-line" +gdb_test "frame 1" \ + "\[1-9\]\[0-9\]*\[ \t\]*break_me \\(\\);" \ + "frame 1 with print frame-info set to source-line and address off" + diff --git a/gdb/testsuite/gdb.python/py-framefilter.exp b/gdb/testsuite/gdb.python/py-framefilter.exp index a88e37f8c2..400c9b0941 100644 --- a/gdb/testsuite/gdb.python/py-framefilter.exp +++ b/gdb/testsuite/gdb.python/py-framefilter.exp @@ -161,6 +161,10 @@ gdb_test "bt full hide" \ ".*#0.*end_func.*str = $hex \"The End\".*st2 = $hex \"Is Near\".*b = 12.*c = 5.*#1.*in funca \\(\\).*#2.*in funcb \\(j=10\\).*bar = \{a = 42, b = 84\}.*#22.*in func1 \\(\\)\[^#\]*#24.*in func3 \\(i=3\\).*" \ "bt full hide with Reverse disabled" +# Re-enable Reverse +gdb_test_no_output "enable frame-filter global Reverse" \ + "re-enable frame-filter global Reverse" + # Test set print frame-arguments # none gdb_test_no_output "set print frame-arguments none" \ @@ -169,7 +173,7 @@ gdb_test "bt no-filter 1" \ "#0.*end_func \\(foo=\.\.\., bar=\.\.\., fb=\.\.\., bf=\.\.\.\\) at .*py-framefilter.c.*" \ "bt no-filter 1 no args" gdb_test "bt 1" \ - "#0.*end_func \\(foo=\.\.\., bar=\.\.\., fb=\.\.\., bf=\.\.\.\\) at .*py-framefilter.c.*" \ + "#0.*cnuf_dneThe End \\(foo=\.\.\., bar=\.\.\., fb=\.\.\., bf=\.\.\.\\) at .*py-framefilter.c.*" \ "bt 1 no args" # scalars @@ -179,9 +183,54 @@ gdb_test "bt no-filter 1" \ "#0.*end_func \\(foo=21, bar=$hex \"Param\", fb=$hex, bf=\.\.\.\\) at .*py-framefilter.c.*" \ "bt no-filter 1 scalars" gdb_test "bt 1" \ - "#0.*end_func \\(foo=21, bar=$hex \"Param\", fb=$hex, bf=\.\.\.\\) at .*py-framefilter.c.*" \ + "#0.*cnuf_dneThe End \\(foo=21, bar=$hex \"Param\", fb=$hex, bf=\.\.\.\\) at .*py-framefilter.c.*" \ "bt 1 scalars" +# presence +gdb_test_no_output "set print frame-arguments presence" \ + "turn frame arguments to presence only" +gdb_test "bt no-filter 1" \ + "#0.*end_func \\(\.\.\.\\) at .*py-framefilter.c.*" \ + "bt no-filter 1 presence" +gdb_test "bt 1" \ + "#0.*cnuf_dneThe End \\(\.\.\.\\) at .*py-framefilter.c.*" \ + "bt 1 presence" + +# Test set print frame-info, with only presence for args. +# short-location +gdb_test_no_output "set print frame-info short-location" \ + "frame-info short-location" +gdb_test "bt no-filter 1" \ + "#0.*end_func \\(\.\.\.\\)\r\n.*" \ + "bt no-filter 1 short-location" +gdb_test "bt 1" \ + "#0.*cnuf_dneThe End \\(\.\.\.\\)\r\n.*" \ + "bt 1 short-location" + +# source-and-location +gdb_test_no_output "set print frame-info source-and-location" \ + "frame-info source-and-location" +gdb_test "bt no-filter 1" \ + "#0.*end_func \\(\.\.\.\\) at .*py-framefilter.c.*\r\n.*\[1-9\]\[0-9\]*.*" \ + "bt no-filter 1 source-and-location" +gdb_test "bt 1" \ + "#0.*cnuf_dneThe End \\(\.\.\.\\) at .*py-framefilter.c.*\r\n.*\[1-9\]\[0-9\]*.*" \ + "bt 1 source-and-location" + +# source-line +gdb_test_no_output "set print frame-info source-line" \ + "frame-info source-line" +gdb_test "bt no-filter 1" \ + "\[1-9\]\[0-9\]*\[ \t\]*return; /\\* Backtrace end breakpoint \\*/.*" \ + "bt no-filter 1 source-line" +gdb_test "bt 1" \ + "\[1-9\]\[0-9\]*\[ \t\]*return; /\\* Backtrace end breakpoint \\*/.*" \ + "bt 1 source-line" + +# set print frame-info back to auto. +gdb_test_no_output "set print frame-info auto" \ + "frame-info auto" + # all gdb_test_no_output "set print frame-arguments all" \ "turn on frame arguments" @@ -189,7 +238,7 @@ gdb_test "bt no-filter 1" \ "#0.*end_func \\(foo=21, bar=$hex \"Param\", fb=$hex, bf=\{nothing = $hex \"Foo Bar\", f = 42, s = 19\}\\) at .*py-framefilter.c.*" \ "bt no-filter 1 all args" gdb_test "bt 1" \ - "#0.*end_func \\(foo=21, bar=$hex \"Param\", fb=$hex, bf=\{nothing = $hex \"Foo Bar\", f = 42, s = 19\}\\) at .*py-framefilter.c.*" \ + "#0.*cnuf_dneThe End \\(foo=21, bar=$hex \"Param\", fb=$hex, bf=\{nothing = $hex \"Foo Bar\", f = 42, s = 19\}\\) at .*py-framefilter.c.*" \ "bt 1 all args" # set print address off @@ -199,7 +248,7 @@ gdb_test "bt no-filter 1" \ "#0 end_func \\(foo=21, bar=\"Param\", fb=, bf=\{nothing = \"Foo Bar\", f = 42, s = 19\}\\) at .*py-framefilter.c.*" \ "bt no-filter 1 no address" gdb_test "bt 1" \ - "#0 end_func \\(foo=21, bar=\"Param\", fb=, bf=\{nothing = \"Foo Bar\", f = 42, s = 19\}\\) at .*py-framefilter.c.*" \ + "#0 cnuf_dneThe End \\(foo=21, bar=\"Param\", fb=, bf=\{nothing = \"Foo Bar\", f = 42, s = 19\}\\) at .*py-framefilter.c.*" \ "bt 1 no addresss" gdb_test_no_output "set python print-stack message" \