From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) by sourceware.org (Postfix) with ESMTPS id B6BF8383B7B4 for ; Fri, 27 May 2022 19:30:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B6BF8383B7B4 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-wm1-f53.google.com with SMTP id d5-20020a05600c34c500b0039776acee62so2626088wmq.1 for ; Fri, 27 May 2022 12:30:09 -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=FzGIUG3JDrIpHyo5qG5+hxN7glsFp29rLCfCYllkKH4=; b=SrBTuz5f2FfMWYEKzy40NAYugqobD3BtnzkVhhwZuCt3bqf/lHqTjP/qe8H44JrBdJ R90RQh3jAHYZOjutsSCtFk7inrAJSnvZqc0Drr3h1SeL1ONJARmqQgj9+2GlxFqRnDRN TfR0nVWHplbc+DNrLLDK1CmSDU7M3izsSorQNlpi6tkUfuR5dUnFByon4qDaLiGLkHJd mV2t51gSvY9W4WijKlywmfIblSAi/dJMCzjGbuSQLBATbYEQvTV9Ft1VQJPeRflP0IdI 33pTgKvi7zsLFmZUPcylJiKiTMnIfcmMr0QYvNf0AKUQDCQi6dqcshqdn3iBWeL0Tsxd 7t4g== X-Gm-Message-State: AOAM532B0PorQoL0BLahAuttiV+beE/oCB3j/GgvY9T/bmenGTwyRgbQ i8Ak0h3POJdJBLIaQcNkx8c= X-Google-Smtp-Source: ABdhPJxBWbaT8GI5w/95gh3T39CM4TujFjfdX1Txt/kpehv2KR8rqrJXHYnHFCy1lrxiDKV7eBPVfA== X-Received: by 2002:a05:600c:21d0:b0:397:33e6:fd42 with SMTP id x16-20020a05600c21d000b0039733e6fd42mr8417145wmj.179.1653679808514; Fri, 27 May 2022 12:30:08 -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 p5-20020a1c5445000000b0039744bd664esm2883311wmi.13.2022.05.27.12.30.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 27 May 2022 12:30:07 -0700 (PDT) Message-ID: <266eba78-e6c7-c72a-4820-bbbabe37ac04@palves.net> Date: Fri, 27 May 2022 20:30:06 +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: [PATCH v4] gdb/manual: Introduce location specs Content-Language: en-US To: Eli Zaretskii Cc: gdb-patches@sourceware.org References: <20220526194250.2310460-1-pedro@palves.net> <8335gvnjrw.fsf@gnu.org> <956e1fbd-5f03-c021-c390-82e1cf3493b5@palves.net> <83wne7m0ri.fsf@gnu.org> <2bc9b5c9-879a-2848-16f4-6cfd796563a8@palves.net> <83sfounaqw.fsf@gnu.org> <02a46873-35dc-0d9c-1890-292b807d9484@palves.net> <83pmjyn8as.fsf@gnu.org> <113bd07c-3bfe-0780-50a9-4c41c84942e9@palves.net> <83mtf2n6lw.fsf@gnu.org> From: Pedro Alves In-Reply-To: <83mtf2n6lw.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_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: Fri, 27 May 2022 19:30:12 -0000 On 2022-05-27 20:00, Eli Zaretskii wrote: > What I was talking about was not about using the location specs, it > was about explaining what it is and how it differs from the code > location. I think we have to explain the terminology before we use > it, since it is not entirely trivial. OK, here's what I added on top of v4, locally. WDYT? >From 97024e5cd68a1608287c28ea06693a3c18804474 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Fri, 27 May 2022 20:22:49 +0100 Subject: [PATCH] foo Change-Id: I18ab66ae278767e2636aa76712e2d5c44ca6ee83 --- gdb/doc/gdb.texinfo | 37 +++++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 6deaad88d31..8f25f899263 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -9053,10 +9053,13 @@ line in the source code, but it can also indicate a function name, an address, a label, and more. A concrete code location in your program is uniquely identifiable by a -set of logical attributes. Typically, a line number, the source file -the line belongs to, the fully-qualified and prototyped function it is -defined in, and an instruction address. Because each inferior has its -own address space, also an inferior number. +set of logical attributes. A line number, the source file the line +belongs to, the fully-qualified and prototyped function it is defined +in, and an instruction address. Because each inferior has its own +address space, also an inferior number. The source file attribute has +as many directory components as possible, retrieved from the debug +information, and in absolute form if possible, but it may also be in +relative form. On the other hand, a @dfn{location specification} (a.k.a.@: location spec) is a way to find or refer to the concrete code locations in the @@ -9065,12 +9068,22 @@ resolves the spec to actual code locations in your program by using the source and debug information. The location spec may be incomplete, and @value{GDBN} will do its best -to find all the locations in the program that match it. For example, -a location spec may just indicate a line number and a source filename -with no directory components, or even not specify a filename at all, -just a line number. Or, the spec may indicate a simple function name -instead of a fully-qualified and prototyped function name (e.g., -@code{func} instead of @code{A::func(int)}). +to find all the locations in the program that match it. + +For example, a location spec may just indicate a line number and a +source filename with no directory components, or even not specify a +filename at all, just a line number. To differentiate between files +with the same base name, the spec may prepend as many directories as +is necessary to uniquely identify the desired file. + +Or, the spec may indicate a simple function name instead of a +fully-qualified and prototyped function name (e.g., @code{func} +instead of @code{A::func(int)}). To differentiate between functions +with the same name, the spec may prepend as many class and namespace +names as is necessary to uniquely identify the desired funnction, +and/or it may specify the function parameters as well. In addition, +the spec may indicate that the function name should be interpreted as +a fully qualified name. You may not have debug info for some of the instructions in the program, so a resolved location that itself points to such code will @@ -9105,6 +9118,10 @@ For an inlined function, a given source line can correspond to several places where that function is inlined. @end itemize +The act of finding all the actual code location that match the user +input is called @dfn{resolving the location spec}. The code locations +that @value{GDBN} finds are the @dfn{resolved code locations}. + Locations may be specified using three different formats: linespec locations, explicit locations, or address locations. -- 2.36.0