From patchwork Fri Apr 7 05:28:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 67491 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BA1C1385842D for ; Fri, 7 Apr 2023 05:29:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BA1C1385842D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1680845354; bh=yhVE1pQXt780kjzXvbqfTKMnFR+WTnel6H7ssuC/VTY=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=i0B4WP5mMZFoKgaxLlKZ3vtfLvFXfVHEa4N/GSOnjIeF33PZ2QcMnObQDubD13OuZ tvO5sMD2dOIU9Xri8k5IU94KccaX+v4wHTw2acx5LxEz9SVqCbIM6MqyY3TmhyPylK 83KZBwY1plpGYiGMs2Kc58vkdvO+rKWIet15C5Tc= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 8A7743858D28 for ; Fri, 7 Apr 2023 05:28:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8A7743858D28 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-96-aslJHnuSPd-G1CXkHLFb-g-1; Fri, 07 Apr 2023 01:28:48 -0400 X-MC-Unique: aslJHnuSPd-G1CXkHLFb-g-1 Received: by mail-wm1-f72.google.com with SMTP id r20-20020a05600c35d400b003edd2023418so368558wmq.4 for ; Thu, 06 Apr 2023 22:28:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680845327; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=yhVE1pQXt780kjzXvbqfTKMnFR+WTnel6H7ssuC/VTY=; b=7+ky9LxFaM7WburCNDmQAmVLaB5YAR/IvNyn2hbN8qi96hW5G5iohzKp5AKWa775yI iqC6kxkqrOZ3iVdm0tQZCEsHE+F6fOImqz4jRr/NMoDE9IdAaPxEgPPQjpVS+Vzzytt7 zvGOr/SmzTe7A7ndjfbR888YTTdymHCI61JgvgrTepw3Mna2jtkiH9/WzvwQnQAs7kqK SZ6L1mrzVX0zpLujbZTcULYKqSghpdvIEnoCyL9mwmGnlJq2XgUaCo4oVJc3ApIor05v GNX49DErxq6n2kMiNxwA89M7Pi72t1XB42ks881oxSvEYcmkyRlSNhpCbTPpCjd8Sy2D EQpQ== X-Gm-Message-State: AAQBX9d2gcECoidonV3y+bjioKrUfj/95lAl7N1hbrpam56QYFyfB7kr KONT05AQGFjFkpXMthyaVqxyynJxAavRTfsvM5OeEVKZZFibjcAm8RgAlVAOzlhmbyoN5N2w2q0 ydt1K0xbQDFyR//Df68sm+fMJXvtO+WPFtI+k0f9s/8SS8fD9fZrOwRRKAsGQVxTB7ibIzRzkIn bnwFbAKQ== X-Received: by 2002:a5d:4746:0:b0:2d8:1aff:813 with SMTP id o6-20020a5d4746000000b002d81aff0813mr463750wrs.43.1680845327452; Thu, 06 Apr 2023 22:28:47 -0700 (PDT) X-Google-Smtp-Source: AKy350aXcaeqS6ZUrI8g52l5gY/gEmog7CMZgXsZRE8XWRTtk9Cv5Itb8i17P59VpcbDWFFkdT9KoA== X-Received: by 2002:a5d:4746:0:b0:2d8:1aff:813 with SMTP id o6-20020a5d4746000000b002d81aff0813mr463734wrs.43.1680845327032; Thu, 06 Apr 2023 22:28:47 -0700 (PDT) Received: from localhost (95.72.115.87.dyn.plus.net. [87.115.72.95]) by smtp.gmail.com with ESMTPSA id o18-20020a5d6712000000b002ef349e73cbsm2862441wru.19.2023.04.06.22.28.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Apr 2023 22:28:46 -0700 (PDT) To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PUSHED] gdb/testsuite: updates for gdb.arch/{amd64, i386}-disp-step-self-call.exp Date: Fri, 7 Apr 2023 06:28:44 +0100 Message-Id: <9340f361097963011369c3339f7d28239d2f851b.1680845304.git.aburgess@redhat.com> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Andrew Burgess via Gdb-patches From: Andrew Burgess Reply-To: Andrew Burgess Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" This commit: commit cf141dd8ccd36efe833aae3ccdb060b517cc1112 Date: Wed Feb 22 12:15:34 2023 +0000 gdb: fix reg corruption from displaced stepping on amd64 Added two test scripts gdb.arch/amd64-disp-step-self-call.exp and gdb.arch/i386-disp-step-self-call.exp. These scripts contained a test that included a stack address in the test name, this makes it harder to compare results between runs. This commit gives the tests proper names that doesn't include an address. Also in gdb.arch/i386-disp-step-self-call.exp I noticed that we were writing 8-bytes rather than 4 in order to clear the return address entry on the stack. This is also fixed in this commit. --- gdb/testsuite/gdb.arch/amd64-disp-step-self-call.exp | 3 ++- gdb/testsuite/gdb.arch/i386-disp-step-self-call.exp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) base-commit: a67a3bbd35c3d8f028cad5cb9e3122e56071baee diff --git a/gdb/testsuite/gdb.arch/amd64-disp-step-self-call.exp b/gdb/testsuite/gdb.arch/amd64-disp-step-self-call.exp index db44a319a47..ecac3cdc1cf 100644 --- a/gdb/testsuite/gdb.arch/amd64-disp-step-self-call.exp +++ b/gdb/testsuite/gdb.arch/amd64-disp-step-self-call.exp @@ -60,7 +60,8 @@ gdb_test_multiple "x/2i \$pc" "get address of next insn" { # Clear the slot on the stack and confirm it was set to zero. set sp [expr $sp - 0x8] -gdb_test_no_output "set {unsigned long long} $sp = 0" +gdb_test_no_output "set {unsigned long long} $sp = 0" \ + "clear stack slot" set zero_val 0x[format %016x 0] gdb_test "x/1gx 0x[format %x $sp]" "$hex:\\s+${zero_val}" \ "check return address slot was set to zero" diff --git a/gdb/testsuite/gdb.arch/i386-disp-step-self-call.exp b/gdb/testsuite/gdb.arch/i386-disp-step-self-call.exp index 7ea036fe3e6..034ef4800b4 100644 --- a/gdb/testsuite/gdb.arch/i386-disp-step-self-call.exp +++ b/gdb/testsuite/gdb.arch/i386-disp-step-self-call.exp @@ -60,7 +60,8 @@ gdb_test_multiple "x/2i \$pc" "get address of next insn" { # Clear the slot on the stack and confirm it was set to zero. set sp [expr $sp - 0x4] -gdb_test_no_output "set {unsigned long long} $sp = 0" +gdb_test_no_output "set {unsigned int} $sp = 0" \ + "clear stack slot" set zero_val 0x[format %08x 0] gdb_test "x/1wx 0x[format %x $sp]" "$hex:\\s+${zero_val}" \ "check return address slot was set to zero"