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.133.124]) by sourceware.org (Postfix) with ESMTPS id 5BB2C385773C for ; Tue, 18 Jul 2023 13:40:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5BB2C385773C 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=1689687631; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+Z+ezOKnwYExBe0vy4h6KezOvCNUqJve8X4f3doO2A8=; b=X64o2YCec56qx6Wyb5/vqOwM+h6GGTxgnC16y2RUYW28Wlr2+aNs4BISNfpqc5k1NEAzRh EuE6SqCbI7rwghYZREjJAd3PPz8VHYkb/1GUbLOgRZNkpyKBSfYm9hlbVAc0FLaUmA5DXZ e8Qo5+g1Bw2+QUTmG1mjBnwOGCdVJzU= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-632-_hlwAk3FO4WqC911p_vqCg-1; Tue, 18 Jul 2023 09:40:29 -0400 X-MC-Unique: _hlwAk3FO4WqC911p_vqCg-1 Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-7679e5ebad2so835836385a.3 for ; Tue, 18 Jul 2023 06:40:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689687626; x=1692279626; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+Z+ezOKnwYExBe0vy4h6KezOvCNUqJve8X4f3doO2A8=; b=HZ/9qEUdrJ2yzdQoAlz6MSJblZHfAFhAZdwob8AiR2gI41oHXmGNrlcjMLifGMkze0 UXkjMgCEmLdLZyyklaAipHwd76qB90Nq7VDkvxY9Y7nriFkMMoLm1hbC+KGUJtp8Ce0q El9CTcIWbotcf6Y6+VqiB5KTB5LD0KU5YUMnlgzYonpXeE//2czEXFA61CePMV71Jt5D UUW7glEwrBLpEwHFJ89ZxbnkcgO09lKA/bxr4F2n/04S6KeaMnmlju6P2RgIjZhz4Pyc nyyxMVfWGm2EzNM3vEB8Hf1cfrYXpIMAlr9J4TpAZPmasQk0wfz2Gzva+PCY1zcmrsZG IkOw== X-Gm-Message-State: ABy/qLaK060or4UWRW/wudq04HtUHOnC8zhiGiQiG3Hlf7ip8R933X7I yVEwL1EnHvfxtXLH6eVnAsaPcmJYbzi3YdDTV1j8+YPb2ohEpTVKkWadE8JR0zAbMCA/ZXb9EGz t31orOHbJXC430StvD/U5iZ9EGQlZLw== X-Received: by 2002:a05:620a:172b:b0:763:9e42:6bf7 with SMTP id az43-20020a05620a172b00b007639e426bf7mr21707642qkb.66.1689687626098; Tue, 18 Jul 2023 06:40:26 -0700 (PDT) X-Google-Smtp-Source: APBJJlE+HtLbb5miMcnqfw5ufba+h06z37F4q6Ywb1RtSuMzYVU4RGbZI3bHur2K+imZaqMbd8ZIaw== X-Received: by 2002:a05:620a:172b:b0:763:9e42:6bf7 with SMTP id az43-20020a05620a172b00b007639e426bf7mr21707628qkb.66.1689687625927; Tue, 18 Jul 2023 06:40:25 -0700 (PDT) Received: from [192.168.0.129] (ip-94-112-225-44.bb.vodafone.cz. [94.112.225.44]) by smtp.gmail.com with ESMTPSA id pj47-20020a05620a1daf00b007675c4b530fsm598291qkn.28.2023.07.18.06.40.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 18 Jul 2023 06:40:25 -0700 (PDT) Message-ID: <79b8558a-6dba-7773-7ab6-d24814e5207d@redhat.com> Date: Tue, 18 Jul 2023 15:40:24 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH] gdb/cli: fixes to newly added "list ." command To: Eli Zaretskii Cc: gdb-patches@sourceware.org References: <835af40f-edae-ba48-f121-a1cdd1f1147e@palves.net> <20230718112140.1911522-2-blarsen@redhat.com> <83a5vt752j.fsf@gnu.org> From: Bruno Larsen In-Reply-To: <83a5vt752j.fsf@gnu.org> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,RCVD_IN_BARRACUDACENTRAL,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: On 18/07/2023 14:54, Eli Zaretskii wrote: >> Cc: Bruno Larsen >> Date: Tue, 18 Jul 2023 13:21:41 +0200 >> From: Bruno Larsen via Gdb-patches >> >> diff --git a/gdb/NEWS b/gdb/NEWS >> index ac5dc424d3f..dd2fc0103bc 100644 >> --- a/gdb/NEWS >> +++ b/gdb/NEWS >> @@ -87,8 +87,9 @@ >> * The Ada 2022 Enum_Rep and Enum_Val attributes are now supported. >> >> * 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. >> + print the location around the last solitary line printed as part of >> + displaying a stack frame. If the inferior hasn't started yet, the >> + command will print around the main function. > "Last solitary line" is not necessarily clear (why "solitary"?). I picked "solitary line" from the description of list with no argments:     however, if the last line printed was a solitary line printed     as part of displaying a stack frame (@pxref{Stack, ,Examining the     Stack}), this prints lines centered around that line. when examined in context, I think it makes sense, but I can revisit this if you want. > How > about > > * The 'list' command now accepts '.' as an argument, which tells GDB > to print source code around the default location. The default > location is where the inferior stopped; The problem with "where the inferior is stopped", as mentioned by pedro in an earlier email, that there are a few different interpretations, and only one is correct. 1. list around the PC that triggered a breakpoint. So if Thread 1 hit a breakpoint, but a user switched to thread 2, they could expect that "list ." would list around thread 1, but that's not what would happen 2. list the lowermost frame of a given thread. This was Pedro's initial interpretation of the command, so if the inferior stopped and the user went up a few frames, technically the place where it is stopped is still the same PC, but we're not listing around those lines 3. List around the frame that is being examined. This is what I meant with the command, so if you go up some frames in a different thread, "list ." will list the same thing as the first call to "list". Its effectively an alias for "(gdb) frame; (gdb) list", as pedro put it. I'm not exactly happy with the final wording I went with, though, so I'm happy for other suggestions :) -- Cheers, Bruno > if the inferior didn't > start yet, the command will print around the beginning of the > 'main' function. > >> --- a/gdb/doc/gdb.texinfo >> +++ b/gdb/doc/gdb.texinfo >> @@ -9155,9 +9155,9 @@ Same as using with no arguments. >> Print lines just before the lines last printed. >> >> @item list . >> -Print the lines surrounding the location that is where the inferior >> -is stopped. If the inferior is not running, print around the main >> -function instead. >> +Print the lines surrounding the last solitary line printed as part >> +of displaying a fram. If the inferior is not running, print around >> +the main function instead. >> @end table > Same here. > > Thanks. > > Reviewed-By: Eli Zaretskii >