From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id kEq5FvIEsGQFWyAAWB0awg (envelope-from ) for ; Thu, 13 Jul 2023 10:06:42 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=hwWXg/yQ; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 571621E0BD; Thu, 13 Jul 2023 10:06:42 -0400 (EDT) Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 3DBFB1E0B9 for ; Thu, 13 Jul 2023 10:06:40 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0A4DA384C6A7 for ; Thu, 13 Jul 2023 14:06:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0A4DA384C6A7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1689257190; bh=fuzOD0S+gc2J0wbl8rnoIaPBlfhPGq445lXV4XZcONc=; 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=hwWXg/yQfEA2AbXaVKvNYNYdSKSvGbZk4JV1GURe/9JouITu/f0Voua60wgsgFkXS 1kZf2jj0IlrDMDpn9rLXySwSCt6OlJg3zWQ7Q8W2MyR1W6fAtBNeU83EZFZ+d8QwuU J+f9gPVjSW491gmOUKg3SiekWpFTtUJCxr83V9qE= Received: from mail-io1-xd35.google.com (mail-io1-xd35.google.com [IPv6:2607:f8b0:4864:20::d35]) by sourceware.org (Postfix) with ESMTPS id 3F17C3858C62 for ; Thu, 13 Jul 2023 14:05:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3F17C3858C62 Received: by mail-io1-xd35.google.com with SMTP id ca18e2360f4ac-78372b896d0so25866739f.2 for ; Thu, 13 Jul 2023 07:05:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689257132; x=1691849132; 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=fuzOD0S+gc2J0wbl8rnoIaPBlfhPGq445lXV4XZcONc=; b=LgamJ1i0IkDd6KJU4kB7jRxvg3yWtjF59leFVwMUUV+mFeRM+5hrNE40qALjUoJiAs T+FGCXn4nsNzDxNGFZjTnjOXFp6mu0x2A428Y/zFrS3m+jYtVtIe3D3GyD0pCQ5YQL6k 74Xixtpg/4DGZRY9voT5ZMCG/XtZMUPrVv2FVRIPsc9KRacKg65dQMcxB2zDkTXFMJeW 4eCFEfocwbGNIyqGYHUZnfbwglnkN4H1JXfZgy4ph+Od2gTZvoO3xchG4RclZQwTSzDl Dnx8lGyrBcYe6prSaYtiRBYNfdcHwBOymdUyd9n/sbrOE/1n8/FX8QrOW8FbUTEyMHZK jKPA== X-Gm-Message-State: ABy/qLYtze5MvZsG1o2qqfCm+JJ1HDIuc9NJwaBlLZ04wAZaaFtViRxb XNh1ldchooXI7GzC+p6M3RqVmlNqnxHu24NLXlksnw== X-Google-Smtp-Source: APBJJlGIdbqBOhvgayxna7Tcf0A1Yq/gx1AeTyYh5pnazaQmZO81H0d+jtP42+EY1sXOn1s53iJ6Nw== X-Received: by 2002:a6b:4102:0:b0:787:8fc:307d with SMTP id n2-20020a6b4102000000b0078708fc307dmr1773933ioa.5.1689257132229; Thu, 13 Jul 2023 07:05:32 -0700 (PDT) Received: from localhost.localdomain (75-166-135-140.hlrn.qwest.net. [75.166.135.140]) by smtp.gmail.com with ESMTPSA id n13-20020a02a90d000000b0042b7b76b29fsm1841336jam.174.2023.07.13.07.05.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jul 2023 07:05:31 -0700 (PDT) Date: Thu, 13 Jul 2023 08:05:28 -0600 Subject: [PATCH v3 3/6] Rename Python variable in py-inferior.exp MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230713-py-inf-fixes-30615-v3-3-26a024f30553@adacore.com> References: <20230713-py-inf-fixes-30615-v3-0-26a024f30553@adacore.com> In-Reply-To: <20230713-py-inf-fixes-30615-v3-0-26a024f30553@adacore.com> To: gdb-patches@sourceware.org X-Mailer: b4 0.12.3 X-Spam-Status: No, score=-11.5 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: , From: Tom Tromey via Gdb-patches Reply-To: Tom Tromey Errors-To: gdb-patches-bounces+public-inbox=simark.ca@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 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/gdb/testsuite/gdb.python/py-inferior.exp b/gdb/testsuite/gdb.python/py-inferior.exp index 723f212ecc3..8762b6992ca 100644 --- a/gdb/testsuite/gdb.python/py-inferior.exp +++ b/gdb/testsuite/gdb.python/py-inferior.exp @@ -88,13 +88,14 @@ 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)" \ - "read str contents" 1 +gdb_test "python astr = gdb.inferiors()\[0\].read_memory (addr, 5); print(astr)" \ + "" \ + "read str contents" 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. -- 2.40.1