From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) by sourceware.org (Postfix) with ESMTPS id 6B1BB395B411 for ; Thu, 2 Jun 2022 11:10:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6B1BB395B411 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f54.google.com with SMTP id p10so5994482wrg.12 for ; Thu, 02 Jun 2022 04:10:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=1PkXABhZAE+UopBiFhdw4xFjGEB5yQqNaTROt0HaEFU=; b=5jPf4bxORRoc/5kkO/PH/D1K+xSJbPvsD+SiSVX90d1pqFVahaUveNdO/DWcU9X2z5 q/cV2ykr6BvoIK2PsWvLaGBQDBGPZyxtI9fW/2GqaPTwQILpll/snsLmzjgGs5BGJ2yZ Yz8h4E8Z1Ly0NGC7Wn4COcErvL8IVATqjDH9YK7xSK5vGtaob0UhALQwdCE4C4Qlu6X7 d/CtWe4mMjFYiK1fraGrl0eJWcUgbKNXdUIvL7Gznf5CPs39yo2zet+O+KD94C7J69B+ Sz0VzIpsfTkovE8i6dzBG47a5T8FDykaHOvlW+jEmuLVpNufU89G4Rkfv5jN0uSaNZFk xrlw== X-Gm-Message-State: AOAM530vpfmJdjtQotcVTSXV1t3i6veS27a+cPsq4UoPMmlTp7wLDvd4 XkoD87qbm9XjGLNnuaw/NDu9LoxQydI= X-Google-Smtp-Source: ABdhPJyedMpwcTfcWhkauxe3uPJPPlAAT8NeWHTmGVv5+O+v17a8FFr+D5Rd+Aepw5RbEyVrIxLVZQ== X-Received: by 2002:adf:bc04:0:b0:211:800a:7788 with SMTP id s4-20020adfbc04000000b00211800a7788mr3260352wrg.46.1654168257234; Thu, 02 Jun 2022 04:10:57 -0700 (PDT) Received: from ?IPV6:2001:8a0:f924:2600:209d:85e2:409e:8726? ([2001:8a0:f924:2600:209d:85e2:409e:8726]) by smtp.gmail.com with ESMTPSA id c6-20020adffb46000000b0020c5253d90asm4113105wrs.86.2022.06.02.04.10.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 02 Jun 2022 04:10:56 -0700 (PDT) Message-ID: Date: Thu, 2 Jun 2022 12:10:54 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: RTe: Location Specs (Was: [pushed v5] gdb/manual: Introduce location specs) Content-Language: en-US To: Eli Zaretskii Cc: gdb-patches@sourceware.org References: <20220526194250.2310460-1-pedro@palves.net> <838rqmm7gb.fsf@gnu.org> <6914f754-4e33-5aa1-4ea6-dca9504e8bfe@palves.net> <83wne0fgmd.fsf@gnu.org> From: Pedro Alves In-Reply-To: <83wne0fgmd.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_ASCII_DIVIDERS, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, 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-List-Received-Date: Thu, 02 Jun 2022 11:11:00 -0000 On 2022-06-01 18:17, Eli Zaretskii wrote: > ---------------------------------------------------------------------- > @node Location Specifications > @section Location Specifications > @cindex specifying location > @cindex locspec > @cindex source location > @cindex code location > > @cindex location spec > Several @value{GDBN} commands accept arguments that specify a location > or locations of your program's code. Since @value{GDBN} is a > source-level debugger, a location specification usually indicates some > line in some source file, but it can also do that indirectly, by > specifying a function name, an address, a label, etc. The different > forms of specifying a location that @value{GDBN} recognizes are > collectively known as forms of @dfn{location specification}, or > @dfn{location spec}. This section documents the forms of specifying > locations that @value{GDBN} recognizes. > > @cindex location resolution > @cindex resolution of location spec > When you specify a location, @value{GDBN} needs to find the place in > your program, known as @dfn{code location}, that corresponds to the > given location spec. We call this process of finding actual code > locations corresponding to a location spec @dfn{location resolution}. > > A concrete code location in your program is uniquely identifiable by a > set of several attributes: its source line number, the name of its > source file, the fully-qualified and prototyped function in which it > is defined, and an instruction address. Because each inferior has its > own address space, the inferior number is also a necessary part of > these attributes. By contrast, location specs you type will many I built the manual here with the patch, to read in the html form in the browser, and found this paragraph very long and dense. I find it much more readable if we have a paragraph break here (line break + empty line), before "By contract". Above we talk about actual code locations. And below we talk about location specs. If you look for "By contrast" in the manual, you will see that the only two other instances also start a new text block. > times omit some of these attributes. For example, it is customary to > specify just the source line number to mean a line in the current > source file, or specify just the basename of the file, omitting its > directories. In other words, a location spec is usually incomplete, a > kind of blueprint, and @value{GDBN} needs to complete the missing > attributes by using the implied defaults, and by considering the > source code and the debug information available to it. This is what > location resolution is about. > > ---------------------------------------------------------------------- > > diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo > index 5f09f3a..3395735 100644 > --- a/gdb/doc/gdb.texinfo > +++ b/gdb/doc/gdb.texinfo > @@ -9056,73 +9056,67 @@ > @node Location Specifications > @section Location Specifications > @cindex specifying location > -@cindex location spec > @cindex locspec > @cindex source location > @cindex code location > > +@cindex location spec > Several @value{GDBN} commands accept arguments that specify a location > or locations of your program's code. Since @value{GDBN} is a > source-level debugger, a location specification usually indicates some > -line in the source code, but it can also indicate a function name, an > -address, a label, and more. > +line in some source file, but it can also do that indirectly, by > +specifying a function name, an address, a label, etc. This is changing the meaning of what was said. It is now reading as if the line number is what are are after, and that function, address, etc. are merely means to get to the line number. While before, we were saying that usually you specify the line number, but you can also specify some function, or even a precise address. The new text gives a lot more emphasis to the resolved line number. I think it's a difference in the interpretation of "indicate". The original text uses it to mean the arguments the user can specify (otherwise it wouldn't be talking about "a label" or function _name_), while in your version you seem to be using "indicate" to mean the line number you want the spec to resolve to. There are commands that accept location specs and want to resolve them to addresses, others to lines, etc., and you can specify a line to find the address, and conversely you can also specify an address to find a line. Maybe we should say _that_ somehow, instead of the "Since @value{GDBN} is a source-level debugger, a location specification usually indicates some line" sentence, which I find kind of an unnecessary assertion. Specifying function names to break at the function's entry is very usual too, for example. Or we can just keep the same wording as before. > > @item > For a C@t{++} constructor, the @value{NGCC} compiler generates several > -instances of the function body, used in different cases. > +instances of the function body, used in different cases, but their > +source-level names are identical, unless you qualify them. What do you mean by "qualify" here? Otherwise this looks great!