Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Arsen Arsenović" <arsen@aarsen.me>
To: Guinevere Larsen <guinevere@redhat.com>
Cc: Eli Zaretskii <eliz@gnu.org>,  gdb-patches@sourceware.org
Subject: Re: [PATCH v2] gdb: add tutorial command
Date: Fri, 23 Jan 2026 15:23:50 +0100	[thread overview]
Message-ID: <86jyx8pfux.fsf@aarsen.me> (raw)
In-Reply-To: <19c407af-d5a8-49a0-9413-1d41d23c7fbf@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1568 bytes --]

Guinevere Larsen <guinevere@redhat.com> writes:

> Thanks for the review, I have made all the other changes you suggested!
>
> On 1/23/26 4:11 AM, Eli Zaretskii wrote:
>>> +This means you can use it to prototype a solution without
>>> +needing to recompile the inferior.  Try it by setting 'vec'
>>> +to a sorted array, like by using:
>>> +    print vec = {0, 1, 2, 3, 4, 5}
>>> +and see how the program would end, with the "continue"
>>> +command again.
>> Isn't it strange to teach newbies that to assign a value to a
>> variable, one must use the 'print' command?  Why not "set variable"?
>
> It is a bit strange, I suppose, but "set" (like "call") are not things I use
> personally, when print can do the same and is one fewer command to remember
>
> And this doubles as a warning that if the user calls a function that has
> side-effects, those will also happen, and they aren't necessarily always
> desired by the user...
>
> I can change it if you feel strongly that we should use "set" instead, but I
> find the side-effect explanation to be worth the unintuitiveness

FWIW, I use both set and call to avoid printing the result values as
appropriate (less screen real-estate, and fewer $n variables are my
reasons).  I think the text is fine as-is, but would personally mention
it.

I do think mentioning that 'print' computes an arbitrary expression
including side effects is quite important, and if I was to mention call
and set, I'd define them in terms of print for that reason (as the
manual does).
-- 
Arsen Arsenović

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 418 bytes --]

  reply	other threads:[~2026-01-23 14:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-22 20:28 Guinevere Larsen
2026-01-23  7:11 ` Eli Zaretskii
2026-01-23 14:14   ` Guinevere Larsen
2026-01-23 14:23     ` Arsen Arsenović [this message]
2026-01-23 14:28     ` Eli Zaretskii
2026-01-26 14:54       ` Andrew Burgess
2026-01-26 18:50         ` Guinevere Larsen
2026-01-24 11:41 ` Hannes Domani
2026-01-26 18:08   ` Guinevere Larsen
2026-01-26 16:13 ` Andrew Burgess
2026-01-27 19:39   ` Guinevere Larsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86jyx8pfux.fsf@aarsen.me \
    --to=arsen@aarsen.me \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=guinevere@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox