From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) by sourceware.org (Postfix) with ESMTPS id A6E24385735C for ; Fri, 27 May 2022 18:51:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A6E24385735C 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-f51.google.com with SMTP id c9-20020a7bc009000000b0039750ec5774so3184949wmb.5 for ; Fri, 27 May 2022 11:51:01 -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:from:to:cc:references:in-reply-to :content-transfer-encoding; bh=p19fdvBdHUQkU6ZjCy4UPW0P/ocFi54wYBIPVnDJYiA=; b=EUm19sHhliYTUbjNbhTBCu02ufO3FA7+vus4ot8MXAwE18yHHMQ3JVAxJDoRbBFT+u 7cIAPY0PeDEsPWScId7TB0CMLqUGUvAOiskBjCgKUJUlygMKajCEab1OEuWXe+GoO6A+ WSy3b5BvA1bo3yNwbTns69+qyWGjUKG4H1U+CEAl6tIfVXB5K8wzXlG3xRlkl+yFeRTX a9tTn49zZJaGiYE7mM2V1he+e6RxdarQmImNkyD116krd1AI2YQlIBBNbZxl3goYYpjc sjX8ENVYIAFgDl0lHESY/WmbwaCkWhy0ifZ2lL+Gr9NXKwizzAp/BvFaVGLvjUDFbREy JmCA== X-Gm-Message-State: AOAM533LBRoTYy5ecoMhgRD8kiTAjhFv15/nFB6ZikHCiFRQgDOAVEJy krdDy/u9SyGsS8JTv/TFZVqK8UkHjnA= X-Google-Smtp-Source: ABdhPJy12LZAUwSux7Zdo/4EdXxOVsqYw/ihVrECazlRXPVwomfYF1p3Skv2PWF3Ousnhvex4SvoCQ== X-Received: by 2002:a05:600c:35c1:b0:394:8621:a1d5 with SMTP id r1-20020a05600c35c100b003948621a1d5mr8298824wmq.196.1653677460519; Fri, 27 May 2022 11:51:00 -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 h6-20020a5d5046000000b00210227c4a6esm400660wrt.44.2022.05.27.11.50.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 27 May 2022 11:50:59 -0700 (PDT) Message-ID: Date: Fri, 27 May 2022 19:50:58 +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 From: Pedro Alves 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> In-Reply-To: <113bd07c-3bfe-0780-50a9-4c41c84942e9@palves.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, 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 18:51:03 -0000 On 2022-05-27 19:42, Pedro Alves wrote: > On 2022-05-27 19:23, Eli Zaretskii wrote: >>> Date: Fri, 27 May 2022 18:51:14 +0100 >>> Cc: gdb-patches@sourceware.org >>> From: Pedro Alves >>> >>>>> Yes. Well, except "absolute" in the file name. The file names in the >>>>> debug info aren't always absolute, they can be something like ../a/b/c/foo.c, >>>>> and we may not be able to find the source file in the filesystem, so the >>>>> path the debug info tells us is all we get. >>>> >>>> Then the directory should also be part of the attributes, no? >>> >>> I thought that in GNU terminology, "file name" already included the directory? >>> ISTR you saying that we shouldn't use "path" to describe directories sometime ago, >>> for example. Maybe I'm misremembering it. >> >> A file name includes the directory, but the directory doesn't have to >> be in the absolute form, as you pointed out. So the directory >> relative to which the file name is specified is part of the code >> location, I think, because there could be file names in a program >> which have the same name, but live in different subdirectories of a >> source tree. > > Yes. BTW, my text says this: +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, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ and this example too: +@item +The location spec specifies a file name, and multiple files in the +program share the same name. IMO, from this it should be obvious that the code location has directory components that you can match. The explicit locations section already says for example: @table @code @item -source @var{filename} The value specifies the source file name. To differentiate between files with the same base name, prepend as many directories as is necessary to uniquely identify the desired file, e.g., @file{foo/bar/baz.c}. Otherwise @value{GDBN} will use the first file it finds with the given base name. This option requires the use of either @code{-function} or @code{-line}. I'm not sure we want to go into details like that in the intro section. Users won't be able to use any location spec format without reading the corresponding section, so they'll see this.