From patchwork Tue Jul 18 14:39:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 72891 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 DD8593857038 for ; Tue, 18 Jul 2023 14:40:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DD8593857038 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1689691206; bh=J0D2RLLex/dNLs6OUoW4bByBXGodr8ZyRu03+9aVu3k=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=A2yesXhJ4hjHD6twLsGZ+dOn7Yo5PXp2ffZbsOJTK1e1VdULXhnlv37G/B0+jKQ3Q 7KjKXfm5/qBrSpANaYwvdlQds0JGH5L3sbwafz04whNP1M7sSaZmcD/gxDVFtOPDeS +C+pqgiCYKZwUz0dso1LnutidJHlwotn1nOcKUr4= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) by sourceware.org (Postfix) with ESMTPS id 3977A38582B0 for ; Tue, 18 Jul 2023 14:39:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3977A38582B0 Received: by mail-io1-xd29.google.com with SMTP id ca18e2360f4ac-78666994bc2so272140239f.0 for ; Tue, 18 Jul 2023 07:39:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689691183; x=1692283183; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=J0D2RLLex/dNLs6OUoW4bByBXGodr8ZyRu03+9aVu3k=; b=BFFKneAqnUp5N+Uoda2kBwN/yMGv+VdwrIInjXxUVH4A2i6G1yaSLTyO76kvlnjQ5D LTuVy+ZgtCqcbVL2T8Bty60r2ZafApPHPrOAimVTm/NjZceroiiiq7GFb4X3Mp3NzDcG vO8EngX8Caa1UaE9vS8OpND8rRH2i5YlYIISkUSFj1+I4eZJTutslGJ+tw5A6hhQYopE xBsCTH5v6JAzqE2evVfbMdkM2xK/y2Z6MgyH/O8YcXLKqFaAG760Vb7dKoA3DL8L6Y4o EqtbNObulHZcjm0m8Z6CuOctX5rE27kBh0GlwdJjf63mb97tvX4sALljcWEBp3/shL0M tzNQ== X-Gm-Message-State: ABy/qLZFW3bhcsByrjraNLHwG85w0NuhMc8hayTde3Au1V1ZA69qWjtO MBhCkoS0JdSIZFBbKJlmhVOEE5c4iu83j1o2qMoBxA== X-Google-Smtp-Source: APBJJlFlaAwXs7xoOgH208Ck0UUsE5tGbjKHC3+LOo6OMszgLW4fn/mYWcm8tByd3EQL3j4Eh3Ky8Q== X-Received: by 2002:a6b:d013:0:b0:787:34d:f1a4 with SMTP id x19-20020a6bd013000000b00787034df1a4mr2699459ioa.4.1689691183420; Tue, 18 Jul 2023 07:39:43 -0700 (PDT) Received: from localhost.localdomain (75-166-135-140.hlrn.qwest.net. [75.166.135.140]) by smtp.gmail.com with ESMTPSA id q16-20020a6bf210000000b00786dffc04e2sm633628ioh.25.2023.07.18.07.39.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jul 2023 07:39:42 -0700 (PDT) To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH] Document array indexing for Python gdb.Value Date: Tue, 18 Jul 2023 08:39:35 -0600 Message-Id: <20230718143935.4002759-1-tromey@adacore.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 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" I noticed that the documentation for gdb.Value doesn't mention array indexing. --- gdb/doc/python.texi | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi index 9a342f34bf0..aeff483dc0d 100644 --- a/gdb/doc/python.texi +++ b/gdb/doc/python.texi @@ -831,6 +831,13 @@ structure, then @code{bar} can also be accessed as follows: bar = some_val[foo_field] @end smallexample +If a @code{gdb.Value} has array or pointer type, an integer can be +used to access elements. + +@smallexample +result = some_array[23] +@end smallexample + A @code{gdb.Value} that represents a function can be executed via inferior function call. Any arguments provided to the call must match the function's prototype, and must be provided in the order specified