From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 32Z5KtpcJ2EKJQAAWB0awg (envelope-from ) for ; Thu, 26 Aug 2021 05:20:26 -0400 Received: by simark.ca (Postfix, from userid 112) id 9F1281EE1B; Thu, 26 Aug 2021 05:20:26 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from 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 ADE7E1ECEB for ; Thu, 26 Aug 2021 05:20:25 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BF4CF385781A for ; Thu, 26 Aug 2021 09:20:24 +0000 (GMT) Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by sourceware.org (Postfix) with ESMTPS id 4A1303858C27 for ; Thu, 26 Aug 2021 09:20:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4A1303858C27 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com Received: by mail-wm1-x32c.google.com with SMTP id j14-20020a1c230e000000b002e748b9a48bso5190919wmj.0 for ; Thu, 26 Aug 2021 02:20:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=+wfrGGddhQwxSbfOyaoSnNkTLyvKYNzYmW5xBcWVnrs=; b=ZacuzbTY2TQbQr+Um2/Q3b62lYvy0e1mAt0a8zOTZDlTk93+D7zd3oc478eG+KxWlV qn3fna9FKbRiiWUWqEngMXp6PVkra8ApD97Mr9/p2d6X+l2jGNqEQ8pWOrZ5RgOOH+se q7poHy1bHWMn1ZCXhw5Kf4v1y3/qL25DKwdEACyaG/lA3gwqCzBQ+ZExTNhV3oQh6AtY GTKq91Iy2F7lSZ327kTRNk1ybUQEQyw+FK1Mekw0YyeG0aXp7oV5RMwncjcR9Ktr0I9B bmqID3iW0osQHsJ2gS+nkWj8YirvAeCiywZNZ6P3OszJg27MvXAfo5fLnqZ5MOH20HvB lMHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=+wfrGGddhQwxSbfOyaoSnNkTLyvKYNzYmW5xBcWVnrs=; b=jH51UXnrdg/VTV0f74poJuKMS5SuL02JXxZfA9AHqOoxxbIuNxbT9kPwFJmftCO+0c no6+SfAgUSw1GcoNcC1WJnI+63jn5KX+JUbWKRR2Aajbyod0e9BBvQEWYyw7T3IDj6Oa CFXJUfmwMLdzmfrygC1u9AJzhnlbkza7igQUb+DfFvwEEIliNxpsASehKZe7964CYl9A 8RU8zkDaqtWYpcEvEHfF74NhYfDeUNlYaer42uRujqbU+yIkeIA3C98on9ENHSZy6cr4 nI8hbrez9jsPDXw6+ftFRA1J7A2/cC8eVQRi3r7lF3+MAVN3/Y3DlEy4p+6q70UH0hhA g/oQ== X-Gm-Message-State: AOAM530QQKgkIKovyVjtXcI4Bxh1O8crVRdDYBiJvNBFpka1eFHvve/X rQNbPUH5jCUEQ1KWFko1stkP17DDOV+PAw== X-Google-Smtp-Source: ABdhPJx7zEl4V9yeUMo+13NxjhngXq3P1zrbLN/FOuQSVecMusmCnXGKoOIIz81m5cmeKqdTN3UFMQ== X-Received: by 2002:a7b:c927:: with SMTP id h7mr2631093wml.154.1629969603389; Thu, 26 Aug 2021 02:20:03 -0700 (PDT) Received: from localhost (host86-188-49-44.range86-188.btcentralplus.com. [86.188.49.44]) by smtp.gmail.com with ESMTPSA id c2sm2491062wrs.60.2021.08.26.02.20.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Aug 2021 02:20:03 -0700 (PDT) Date: Thu, 26 Aug 2021 10:20:02 +0100 From: Andrew Burgess To: Eli Zaretskii Subject: Re: [PATCHv2] gdb/python: add facility to add values into the history Message-ID: <20210826092002.GI2581@embecosm.com> References: <874kbfaon0.fsf@tromey.com> <20210825172719.3814152-1-andrew.burgess@embecosm.com> <83y28ptnch.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <83y28ptnch.fsf@gnu.org> X-Operating-System: Linux/5.8.18-100.fc31.x86_64 (x86_64) X-Uptime: 10:14:01 up 8 days, 22:10, X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] 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: , Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" * Eli Zaretskii [2021-08-25 21:01:50 +0300]: > > From: Andrew Burgess > > Date: Wed, 25 Aug 2021 18:27:19 +0100 > > > > +* Python API > > + > > + ** New function gdb.add_history(), which takes a gdb.Value object > > + and adds the value to GDB's history list. An integer, the index > ^^^^^^^^^ > "its value", right? I don't know, that doesn't sound right to me. 'its value' seems to imply a value that belongs to someone/something, but I don't think that's the case here. Maybe, '...takes a gdb.Value object and adds it to GDB's history list.' ? How about that? > > > +@findex gdb.add_history > > You don''t need @findex here, since @defun produces that > automatically. OK, thanks. > > > +Append @var{value}, an instance of @code{gdb.Value} (@pxref{Values > > +From Inferior}), to @value{GDBN}'s value history (@pxref{Value > > This sounds like it appends the Python object to the history, but in > reality it appends its value, right? You're absolutely correct, but does the user care? If the user tries to get the value back from the history list in Python then they will always get a gdb.Value object returned, though not the same object, it will represent the same value. I guess I'm just wondering if the extra complexity of explaining how this works actually helps the user at all? Anyway, here's my attempt to explain all this: Takes @var{value}, an instance of @code{gdb.Value} (@pxref{Values From Inferior}), and appends the value this object represents to @value{GDBN}'s value history (@pxref{Value History}) and return an integer, its history number. If @var{value} is not a @code{gdb.Value}, it is is converted using the @code{gdb.Value} constructor. If @var{value} can't be converted to a @code{gdb.Value} then a @code{TypeError} is raised. Thoughts? > > > +History}) and return an integer, its history number. If @var{value} > ^ > Comma missing there. OK, thanks. Thanks, Andrew