From patchwork Tue Jul 11 16:14:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 72501 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 053B4385700B for ; Tue, 11 Jul 2023 16:14:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 053B4385700B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1689092082; 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=wmEnKXAGsjuT01v48cqEfiKvtT0YVtp63ztGy3iApo+aEeim8n8qnpPg7gIdt69GT RcUDMcgj0R252027vDPWLiVlseehqbGAq0AbXyrLmTq6LQYMTZ3Y3YGRYmkzqcpok+ KRK+NvLw7B5CIeVNWP0O5czQHIhgN4pf3/UxEIVE= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-io1-xd32.google.com (mail-io1-xd32.google.com [IPv6:2607:f8b0:4864:20::d32]) by sourceware.org (Postfix) with ESMTPS id 37D383858C62 for ; Tue, 11 Jul 2023 16:14:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 37D383858C62 Received: by mail-io1-xd32.google.com with SMTP id ca18e2360f4ac-78372625badso271146539f.3 for ; Tue, 11 Jul 2023 09:14:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689092049; x=1691684049; 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=k16iUn0Ibu6K92veFkBe/06wFN/dJyirAsA7A5zwENt8VMtzM3aip4xgLq0iRUPTIR molsPvlW3/v7o6s4vTPRvxFVKH0pwmW+/THqXw8DeRPxTDt6mlBZ0T6JogfCy3WGH9nK b4Rjm0vT1JdJGFqwQ1tbLP2d9SoejHcB1O7uJSCcxorw9mVL70ApVE9qu3052ck8b91K 7S0A7fCv28a4jS51IYN5GyoLqws3EoY2Wew6kdjraMxwpHAR2/lqCeFG6kzqDo4wuCQO VaHwUeT/rjcW7JyRpBv1+2HrkuFYY1CCJ8xy6j1nCbtV0qc5Gw7B47y7+PUtD132aqeQ tC4A== X-Gm-Message-State: ABy/qLbJSFoUD3d8rBEbpoSxIErCENLSiz1tEzN3T+bftRCS7roMPLkk 23NyxO/3htOi9c4HbU0zgYHtBG785l/l7FTznwWHkw== X-Google-Smtp-Source: APBJJlHTyRapkwVPIq8WdeEC7IKWosHjAgGrlWFaHI1PbJBq8Goh+SC5y1i/apHQxT1bau+DyMJoXQ== X-Received: by 2002:a6b:5916:0:b0:787:169a:927 with SMTP id n22-20020a6b5916000000b00787169a0927mr5466034iob.20.1689092049486; Tue, 11 Jul 2023 09:14:09 -0700 (PDT) Received: from localhost.localdomain (75-166-135-140.hlrn.qwest.net. [75.166.135.140]) by smtp.gmail.com with ESMTPSA id x3-20020a6bfe03000000b0077e40979b41sm702370ioh.45.2023.07.11.09.14.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jul 2023 09:14:09 -0700 (PDT) Date: Tue, 11 Jul 2023 10:14:03 -0600 Subject: [PATCH v2 3/6] Rename Python variable in py-inferior.exp MIME-Version: 1.0 Message-Id: <20230711-py-inf-fixes-30615-v2-3-64a2540864e6@adacore.com> References: <20230711-py-inf-fixes-30615-v2-0-64a2540864e6@adacore.com> In-Reply-To: <20230711-py-inf-fixes-30615-v2-0-64a2540864e6@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.