From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 4850D3858D28 for ; Mon, 17 Jul 2023 08:44:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4850D3858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689583454; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=jyKAk5mkWsZsI+NnJO5ZAzrVSChnGrr2477GrzDWXB4=; b=as0Ilx7gqH9f2MuV1ZMnHIuiRHD4JrYdlIsqnA1DJnoUMUVCuOdiEVagYQylwaucDVIxDc 2O1vhnV9Ctk6e7M8FIKwcDE4z7AQJyaYz44fY+QWWkSIROvuXgdIJOd//P8z0yRiHxfikY bE/olWWRhqunN4ksNf5Mb0qxRILBk1A= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-195-u5duy12aPwqmFxBJBGFBRQ-1; Mon, 17 Jul 2023 04:44:13 -0400 X-MC-Unique: u5duy12aPwqmFxBJBGFBRQ-1 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-3fbb0c01e71so23227125e9.0 for ; Mon, 17 Jul 2023 01:44:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689583452; x=1692175452; h=mime-version:message-id:date:references:in-reply-to:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=jyKAk5mkWsZsI+NnJO5ZAzrVSChnGrr2477GrzDWXB4=; b=Qx9kQ3uhv2wAWX5I+qcnJwH5/3Q8gScL0qaTVZu1twekS0RorUYVs4bLYCXsUUY2Zi KcaBpKcVON0qq2/fbM2FlJcxFfumAG+ummiuI7Doh45kjSED5n5HcypA0wx+Yf6feMzk TE50ol0HrXDT7hAMdZK+HljmG6/ogKV1syoCykrYD9LN9Brzk7Ihc6N0p3W4k5i8AVIw NgfvA5HmGwXhWAVJeS8ToJIaVJSIc2z1JZ6tH1uwhm357gHihBLTCKVN9s2glmCZK+cL O+32Ohz4JQeEDJy1nUZ4cTkfdI3SGkCFWlzLKxQmPpQ7/APk5udia8cvuPlcDYlJmtLr CvhA== X-Gm-Message-State: ABy/qLZk8QPtaR2+LkPhWZBv0cRZI+QlgsSuLOVkSM9GlBNb7L3Tj+Nu QZ9Xn8SWsKdbKp9xqHxnKGighdaeV8ai9TFuxpseDN0LsG4yFhCMHX0QD5RVo8qanl3dnlQd5CO ZaFZi8GdBZY2/tSg1bzTiKBOg9hf1VA== X-Received: by 2002:a7b:c5c5:0:b0:3fa:99d6:47a4 with SMTP id n5-20020a7bc5c5000000b003fa99d647a4mr9141121wmk.22.1689583452357; Mon, 17 Jul 2023 01:44:12 -0700 (PDT) X-Google-Smtp-Source: APBJJlFOVcyqikXC9exWJBEZoLSdNkzRgAU0IWADa5wHAfqRohSoya0Oqj+MdqqADwup/0mqN2mtHQ== X-Received: by 2002:a7b:c5c5:0:b0:3fa:99d6:47a4 with SMTP id n5-20020a7bc5c5000000b003fa99d647a4mr9141112wmk.22.1689583451996; Mon, 17 Jul 2023 01:44:11 -0700 (PDT) Received: from localhost (2.72.115.87.dyn.plus.net. [87.115.72.2]) by smtp.gmail.com with ESMTPSA id u13-20020a5d514d000000b00316eb7770b8sm10935549wrt.5.2023.07.17.01.44.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jul 2023 01:44:11 -0700 (PDT) From: Andrew Burgess To: Bruno Larsen , Pedro Alves , gdb-patches@sourceware.org Subject: Re: [PATCH v4 2/4] gdb/cli: add '.' as an argument for 'list' command In-Reply-To: <430fb2d9-ae07-6551-3426-adb5334c127d@redhat.com> References: <20230713102411.2279542-1-blarsen@redhat.com> <20230713102411.2279542-3-blarsen@redhat.com> <835af40f-edae-ba48-f121-a1cdd1f1147e@palves.net> <430fb2d9-ae07-6551-3426-adb5334c127d@redhat.com> Date: Mon, 17 Jul 2023 09:44:10 +0100 Message-ID: <87351nhqqt.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,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 List-Id: Bruno Larsen via Gdb-patches writes: > On 14/07/2023 19:50, Pedro Alves wrote: >> Hi, >> >> Sorry for coming late to the party here, but while trying to catch up on the >> list I spotted a few things that I think should be fixed. See below. > I forgot to send the email, but I've already pushed this patch... I'll > fix up the things you pointed in a moment and send a new patch, I just > have a few questions. >> >> BTW, I think the feature is cool! >> >> On 2023-07-13 11:24, Bruno Larsen via Gdb-patches wrote: >>> Currently, after the user has used the list command once, there is no >>> self-contained way to ask GDB to print the location where the inferior is >>> stopped. The current best options require either using a separate >>> command to scope out where the inferior is stopped, or using "list *$pc" >>> requiring knowledge of GDB standard registers. This commit adds a way >>> to do that using '.' as a new argument for the 'list' command. If the >>> inferior isn't running, the command prints around the main function. >>> >>> Because this necessitated having the inferior running and the test was >>> (seemingly unnecessarily) using printf in a non-essential way and it >>> would make the resulting log harder to read for no benefit, it was >>> replaced by a differen t statement. >>> --- >>> gdb/NEWS | 4 ++++ >>> gdb/cli/cli-cmds.c | 31 ++++++++++++++++++++++++-- >>> gdb/doc/gdb.texinfo | 5 +++++ >>> gdb/testsuite/gdb.base/list.exp | 39 +++++++++++++++++++++++++++++++++ >>> gdb/testsuite/gdb.base/list1.c | 2 +- >>> 5 files changed, 78 insertions(+), 3 deletions(-) >>> >>> diff --git a/gdb/NEWS b/gdb/NEWS >>> index b924834d3d7..eef440a5242 100644 >>> --- a/gdb/NEWS >>> +++ b/gdb/NEWS >>> @@ -84,6 +84,10 @@ >>> is 64k. To print longer strings you should increase >>> 'max-value-size'. >>> >>> +* The 'list' command now accepts '.' as an argument, which tells GDB to >>> + print the location where the inferior is stopped. If the inferior hasn't >>> + started yet, the command will print around the main function. >> It would be more accurate to say that it's where the current thread is stopped. >> >> Say you run to breakpoint hit in thread 1, and then switch to thread 2, and then do >> "list .". That will show you the current frame of thread 2, while "where the >> inferior is stopped" could very well be interpreted as "thread 1". > > The wording does need changing, I agree. I think using the wording that > already exists in the documentation is the best way to go: "prints > around the last solitary line printed as part of displaying a stack > frame". The wording I originally used (and the improvement you > suggested) could make it sound like I would always print the lowermost > frame, when that is not the point I wanted. What I wanted was to re-do > what the first usage of "list" does without needing to know the lines. > > My big question: Can I change the NEWS entry, or is that some taboo > that's best avoided? It's fine to change the section of the NEWS file for the next release, that is, the part currently under the 'Changes since GDB 13' heading. We shouldn't change anything under a 'Change in GDB xxx' heading, as that describes content that has already been released. Thanks, Andrew