From patchwork Fri Jul 7 15:07:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 72303 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 078C6385267E for ; Fri, 7 Jul 2023 15:08:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 078C6385267E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1688742511; bh=xjrw29j/gj/5i56bbsGTxFOpw1trHuYsiKk/E8lP2f0=; h=Date:Subject:References:In-Reply-To:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=Hicex4u96BLp2eJdLv5J9wu0SclTPn5/Cn4xTuahczEBmEasQnoKBU90BGjYyFrN3 NLh7YXYC0r5q31PIh1tbg6BlBL++F+iXomeIAuBOjyHNHejPOjO8OPmO4FnMD9aA9A B5KjJ8LR680zD143GWQ2uorqTld1otNLRKWYwl0k= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-io1-xd36.google.com (mail-io1-xd36.google.com [IPv6:2607:f8b0:4864:20::d36]) by sourceware.org (Postfix) with ESMTPS id 3E046385480C for ; Fri, 7 Jul 2023 15:08:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3E046385480C Received: by mail-io1-xd36.google.com with SMTP id ca18e2360f4ac-78360b822abso71096939f.2 for ; Fri, 07 Jul 2023 08:08:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688742481; x=1691334481; h=to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xjrw29j/gj/5i56bbsGTxFOpw1trHuYsiKk/E8lP2f0=; b=YOxCiTPlDUVZYgHl/yINth2FIKKOVpMmrHpK4/wF5C5W+FqueWeSvAwR74pMAMyKuX bdlUyOLFYcJmVlIAkABoAC3MikF8PidQldFJDK+w4m7HXjMwyh5236V1u3BH/wo4cVAU PMozitQXJAY1danqQzqLUP+4v2+aU1Wkr4+I89R7znrm6u+kHRYFxw/L9fdf8FlWiJ+8 CZegLpKU48cS8BxFX+2+5gYsQHVzB8JTa+HRBq3evp3IqRcVT1v6sNC2FAQd+O8bAr2q eKLepSq/4Pti1HIg6j3HlJH4893JD1ZCm4xdWnIQhT46J8qbMrd0A8rSQdDPrJnyFBkR +yug== X-Gm-Message-State: ABy/qLZFPfCD2m5lAN4W3wfZD7KPvx2sziGT9x/C01/rMJ95PSbg3ycj P+AkVW32/HSJyOV367ovmwCEQ8s8trNI+t7194EXTQ== X-Google-Smtp-Source: APBJJlGC4k67+bn7OeotMDxUHkCxgaFBi7GjGVydgwkRRuA6U3ly3Tb3IB2Prnh+498Rt6M0EcmRZw== X-Received: by 2002:a6b:7e4c:0:b0:783:5452:e343 with SMTP id k12-20020a6b7e4c000000b007835452e343mr5236323ioq.14.1688742481399; Fri, 07 Jul 2023 08:08:01 -0700 (PDT) Received: from localhost.localdomain (75-166-135-140.hlrn.qwest.net. [75.166.135.140]) by smtp.gmail.com with ESMTPSA id b16-20020a5ea710000000b0076ffebfc9fasm1340650iod.47.2023.07.07.08.08.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jul 2023 08:08:01 -0700 (PDT) Date: Fri, 07 Jul 2023 09:07:59 -0600 Subject: [PATCH 3/5] Rename Python variable in py-inferior.exp MIME-Version: 1.0 Message-Id: <20230707-py-inf-fixes-30615-v1-3-7792ab559530@adacore.com> References: <20230707-py-inf-fixes-30615-v1-0-7792ab559530@adacore.com> In-Reply-To: <20230707-py-inf-fixes-30615-v1-0-7792ab559530@adacore.com> To: gdb-patches@sourceware.org X-Mailer: b4 0.12.3 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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: Tom Tromey via Gdb-patches From: Tom Tromey Reply-To: Tom Tromey Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" py-inferior.exp creates a Python variable named 'str'. This clashes with the built-in type of the same name and can be confusing when trying to evaluate Python code when debugging the test case. This patch renames it. --- gdb/testsuite/gdb.python/py-inferior.exp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gdb/testsuite/gdb.python/py-inferior.exp b/gdb/testsuite/gdb.python/py-inferior.exp index a29624f4fd5..41e26878031 100644 --- a/gdb/testsuite/gdb.python/py-inferior.exp +++ b/gdb/testsuite/gdb.python/py-inferior.exp @@ -88,13 +88,13 @@ gdb_continue_to_breakpoint "cont to Break here." ".*Break here\..*" gdb_py_test_silent_cmd "python addr = gdb.selected_frame ().read_var ('str')" \ "read str address" 0 -gdb_py_test_silent_cmd "python str = gdb.inferiors()\[0\].read_memory (addr, 5); print(str)" \ +gdb_py_test_silent_cmd "python astr = gdb.inferiors()\[0\].read_memory (addr, 5); print(str)" \ "read str contents" 1 gdb_py_test_silent_cmd "python a = bytes('a', 'ascii')" "" 0 -gdb_py_test_silent_cmd "python str\[1\] = a" "change str" 0 -gdb_py_test_silent_cmd "python gdb.inferiors()\[0\].write_memory (addr, str)" \ +gdb_py_test_silent_cmd "python astr\[1\] = a" "change str" 0 +gdb_py_test_silent_cmd "python gdb.inferiors()\[0\].write_memory (addr, astr)" \ "write str" 1 -gdb_test "print (str)" " = \"hallo, testsuite\"" \ +gdb_test "print str" " = \"hallo, testsuite\"" \ "ensure str was changed in the inferior" # Test memory search.