From patchwork Thu Jul 13 14:05:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 72653 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 8FDE03848BB4 for ; Thu, 13 Jul 2023 14:06:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8FDE03848BB4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1689257193; 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=PAgtaECJpSjOTes1sua5Nz2g/TYuGk1Av0zxzNhbdmLqAiCjum3GAVyQk8KKl3Heu 4a7Pu72SN7Y1w+ySN3Se/mO/XMhu4XzVluyP4rGTmGGQ9mKEVYTG7i2AFz0DviHX4Q yDZV+5QJvwseNHi+Z9uH5/pFAa9UckaBscL/bR2Y= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org 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 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: , 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 | 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.