From patchwork Fri Jul 14 17:06:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 72719 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 BE66C385AF91 for ; Fri, 14 Jul 2023 17:07:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BE66C385AF91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1689354454; bh=0dFUpulqc63Pl758nK5WPbvPOg4hphPwDZoo3/oEF6E=; h=Date:Subject:References:In-Reply-To:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=jP9X/BdD13H7N2lFF8KJCPBDfFgkV8T+4GZZ4cMnweu4MqXmtMCvc9puxIoARlw1/ 58HxAGf49V9JlNjHoewBxYiCTNSjoXlIHGDg8vfudsdmF6ZzuEpnl2kel/JEA6Ig/l X4r97GFVNQTBSVhPGGDR4n+91oQDBUYcup4Od/1E= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) by sourceware.org (Postfix) with ESMTPS id 8604A3858C54 for ; Fri, 14 Jul 2023 17:06:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8604A3858C54 Received: by mail-io1-xd31.google.com with SMTP id ca18e2360f4ac-7872d448c5aso88066239f.0 for ; Fri, 14 Jul 2023 10:06:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689354397; x=1691946397; h=cc: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=0dFUpulqc63Pl758nK5WPbvPOg4hphPwDZoo3/oEF6E=; b=KOOOO3ShZaWvakbQmCKeXGWcR4aRoatbgkgNTUVFh3lGfSkexQSE+Dxrhj4ucrBNMo DIq6vtrhpPao8EDMNSa/TVwo7LiZcWllN1qTo7iN2QIDpmZtatt3kjbo/v2JE/817JMZ Y4IZjRnPvuJXFX9PZg3c8Xx/9Omm3TGxikn9J4nHUxGjC9wosIWvPNezeaYqb2PAHe// n0MJyzWU+C0y48XdOlcegC9oXw5B1OzGu5sxy1QNrLDH+iwDQG3rZPgeNuyTCBBoULWU vypnTlj8MQqtsXjxA60xJ784vz3dXYVpmL7lWNpd90g/GR2PXZ49Fdc/CLZ6+F2o2gop q6Xg== X-Gm-Message-State: ABy/qLYKEqVmxCUgdehCHV3lKW1qds7YGLocQT/mZmPgu35UCt5+9hgI BqnJNRp1oXMNpEkbXLN6uN22sbCYIfXzjWjVKKxn/A== X-Google-Smtp-Source: APBJJlG8rN0xWfuzgOj6oM+ZQ5ttLesV4RBOuvgoj2VWPdKUCJDQYfnDHK5CQhVn6FzLjbfQy2bj3w== X-Received: by 2002:a5d:9c57:0:b0:786:463b:2ceb with SMTP id 23-20020a5d9c57000000b00786463b2cebmr5643803iof.11.1689354396788; Fri, 14 Jul 2023 10:06:36 -0700 (PDT) Received: from localhost.localdomain (75-166-135-140.hlrn.qwest.net. [75.166.135.140]) by smtp.gmail.com with ESMTPSA id cz8-20020a0566384a0800b0042bb09e9345sm2667476jab.90.2023.07.14.10.06.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jul 2023 10:06:36 -0700 (PDT) Date: Fri, 14 Jul 2023 11:06:27 -0600 Subject: [PATCH v4 3/6] Rename Python variable in py-inferior.exp MIME-Version: 1.0 Message-Id: <20230714-py-inf-fixes-30615-v4-3-9189744d8547@adacore.com> References: <20230714-py-inf-fixes-30615-v4-0-9189744d8547@adacore.com> In-Reply-To: <20230714-py-inf-fixes-30615-v4-0-9189744d8547@adacore.com> To: gdb-patches@sourceware.org Cc: Pedro Alves 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. Approved-By: Pedro Alves --- 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.