From patchwork Fri Feb 21 21:06:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Machado X-Patchwork-Id: 183736 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp2350763ile; Fri, 21 Feb 2020 13:06:57 -0800 (PST) X-Google-Smtp-Source: APXvYqwXp7Xp3Hbgix3CrmmNvcrcnSD6RXHTtZ+V7Rsm+dDTytgFjpUmlyM/33qcS7MO6ZUaM8xn X-Received: by 2002:a9d:20a:: with SMTP id 10mr28988393otb.319.1582319216906; Fri, 21 Feb 2020 13:06:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582319216; cv=none; d=google.com; s=arc-20160816; b=WiwvjCiAi3VUX3aOfDWjG+lZb71MBtUOAh2WNeasiNs+tSF325fbaOBT0wNjPXTVDS iC1VTMoDiFUQObCdwgs67qnTSj3oIz9VVJ/QIAGYyHzo/BknastzcIKd5N9pV5lkZY8O 4SUMl+Pvei46mp4dBTeLiJRh6d7atODzm/zJtO5j+qzAE8Bs+WtAZ8vAu1UUXUdzfdxI QwbF5PzVEcGtRp0hDkcVLi8iw5P4sOb67/UU/tINhLo/W2hYqmsQms2Ed7IlHy3wcnKR IjzQ3FbWyClLSPQX4mqXPQ28tv8lJIFoH0aMEpvaVBe/E/Y51i5GylQaHoQ/D9bz6Z69 HHBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:dkim-signature:delivered-to :sender:list-help:list-post:list-archive:list-subscribe :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature; bh=suCnXj3kfgMv6Fogje6N6H1pf3wJesyXZ3jzz496rOE=; b=NJonUpG4Li/kOV9VFb7KWCjlkwYgG7QN5vB4iVC722coLIbtEKhAHbQ65uA3ritPaF jH7Pjpytuu0gQsIeLOeNRQZj/4iZtYqAirrkzOd6maD7fmqZ0UX+TTxbmOusWpkikQ+8 +g7N+JK1422flV9U9X9anyNz/VcaPXNCbnphU43tLZ/Q78zoQpDjT25ODxwsDxlR2cIB 09WVPIgbeGfoAmaSJzvsq1M4+H39NoTprT8nEkIh9z9GlgIhsxsQXytHBkgrq7ehA1iz 5wAR5DFkGNozmwvg4RssM2SaklraiDlvyy6+RNCEsSXh+TX+rbD45Q/UyMD/n9g+EEC2 NQPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b="agaLS/Ou"; dkim=pass header.i=@linaro.org header.s=google header.b=ke1i0iDT; spf=pass (google.com: domain of gdb-patches-return-164562-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gdb-patches-return-164562-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id w17si1991922oti.75.2020.02.21.13.06.56 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 21 Feb 2020 13:06:56 -0800 (PST) Received-SPF: pass (google.com: domain of gdb-patches-return-164562-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b="agaLS/Ou"; dkim=pass header.i=@linaro.org header.s=google header.b=ke1i0iDT; spf=pass (google.com: domain of gdb-patches-return-164562-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gdb-patches-return-164562-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id; q=dns; s= default; b=fciF/koWybgCYAFKtJ8dDYzJSgJi0UR40t1ZzU/Ek/k4A/xl3Q6RM C2DMKDmlmQ0/NApo8IurQM0D8OGRGV4qxw/VmrqmjRhXHkvWHY/5g4JA8+eaEEJH 6AWsHRA49s8iK54kmmzYjl3R16Uu6ZkyYn8aBYbKLri/KS9P1EExF4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id; s=default; bh=nKNPHXA1Q4gkAcPfDx6GwEI4dd4=; b=agaLS/OuYrcYkr+xe+lrvv0UX4TE SlyYWJWp4mHohwjswoRxcKUSexOUu4Di/b3PWnEgeibAUZHTor46+ULReKTTnWo2 GXXFr5zXYRUEUetH8v2f2Vl6qWw9o/k9xUY7rW+ccSBEo82X5N0Gk3Dbqj7m6rsm N32/lSBliVuA8Uc= Received: (qmail 106510 invoked by alias); 21 Feb 2020 21:06:49 -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 106500 invoked by uid 89); 21 Feb 2020 21:06:48 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mail-qk1-f195.google.com Received: from mail-qk1-f195.google.com (HELO mail-qk1-f195.google.com) (209.85.222.195) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 21 Feb 2020 21:06:47 +0000 Received: by mail-qk1-f195.google.com with SMTP id z19so3179523qkj.5 for ; Fri, 21 Feb 2020 13:06:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=suCnXj3kfgMv6Fogje6N6H1pf3wJesyXZ3jzz496rOE=; b=ke1i0iDTHUGEi0HBwH7kuQgABspzWvFquqnnDgLpkft0UWEX/0Ft05kP/C0So81kEk z5RGF2NIiI4kDg+7RAgxia4jM2T+v6Eem04z6+DHsWW9AorReNh0OjMOZAYgFYlunhDZ bDjmFl/K3+4NLG+OYpK2cqaeQzzg1xUB5yt3a/YCcSbafieAAiIq/QycbL2Z5pEqFtdz uWj6ahKImzQqZ5VHNxiEuoNatfqfuiZJ6rE2u0xcChqDgw/3t92P1x/B63Tw/VSlvA0j HZgqHou51JXUJAZMpgfA5bgI9B4VpJztzMqDAwsDSpQITVeNbDghatVlBVpjEZ5DF1/4 GFuA== Return-Path: Received: from localhost.localdomain ([191.249.236.248]) by smtp.gmail.com with ESMTPSA id l16sm2057173qkk.118.2020.02.21.13.06.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Feb 2020 13:06:44 -0800 (PST) From: Luis Machado To: gdb-patches@sourceware.org Cc: Alan.Hayward@arm.com Subject: [PATCH] Harden gdb.arch/aarch64-pauth.exp and fix a failure Date: Fri, 21 Feb 2020 18:06:28 -0300 Message-Id: <20200221210628.24922-1-luis.machado@linaro.org> X-IsSubscribed: yes When running this testcase against a QEMU with PAC support, i noticed we were failing to recognize the additional [PAC] that is emitted in the backtrace, resulting in this failure: FAIL: gdb.arch/aarch64-pauth.exp: backtrace I've made the test use multi_line to make the pattern more clear. Tested against aarch64-linux-gnu with and without PAC support. gdb/testsuite/ChangeLog: 2020-02-21 Luis Machado * gdb.arch/aarch64-pauth.exp: Recognize optional PAC output. Signed-off-by: Luis Machado --- gdb/testsuite/gdb.arch/aarch64-pauth.exp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/gdb/testsuite/gdb.arch/aarch64-pauth.exp b/gdb/testsuite/gdb.arch/aarch64-pauth.exp index 816e58be44..e6d25c5d97 100644 --- a/gdb/testsuite/gdb.arch/aarch64-pauth.exp +++ b/gdb/testsuite/gdb.arch/aarch64-pauth.exp @@ -40,4 +40,9 @@ gdb_breakpoint [ gdb_get_line_number "break here" ] gdb_continue_to_breakpoint "break here" ".*break here.*" # Ensure we can get a full backtrace, despite the address signing. -gdb_test "bt" "^bt\r\n#0 +bar *\\(b=9\\) +at.*\r\n#1 +0x\[0-9a-f\]* +in +foo \\(a=5\\).*\r\n#2 +0x\[0-9a-f\]* +in +main \\(\\).*" "backtrace" +gdb_test "bt" \ + [multi_line \ + "#0\[ \t\]*bar \\(b=9\\) at \[^\r\n\]+" \ + "#1\[ \t\]*$hex (\\\[PAC\\\] )?in foo \\(a=5\\) at \[^\r\n\]+" \ + "#2\[ \t\]*$hex (\\\[PAC\\\] )?in main \\(\\) at \[^\r\n\]+" ] \ + "backtrace"