From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 6D9BF382A6ED for ; Fri, 27 May 2022 18:24:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6D9BF382A6ED Received: from fencepost.gnu.org ([2001:470:142:3::e]:36596) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nuecy-0004jT-OC; Fri, 27 May 2022 14:24:00 -0400 Received: from [87.69.77.57] (port=2089 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nuecy-0000al-5l; Fri, 27 May 2022 14:24:00 -0400 Date: Fri, 27 May 2022 21:23:55 +0300 Message-Id: <83pmjyn8as.fsf@gnu.org> From: Eli Zaretskii To: Pedro Alves Cc: gdb-patches@sourceware.org In-Reply-To: <02a46873-35dc-0d9c-1890-292b807d9484@palves.net> (message from Pedro Alves on Fri, 27 May 2022 18:51:14 +0100) Subject: Re: [PATCH v4] gdb/manual: Introduce location specs 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> X-Spam-Status: No, score=1.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_BARRACUDACENTRAL, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * 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:24:02 -0000 > 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. > The text I wrote in v4 purposely says "the source file the line belongs to" > which avoids going into that detail. Something to ponder, I guess. > >> When you specify a function name, you can't specify an address > >> at the same time, for example. There's no format that allows that. > >> So if you specify a function, you end up with code location that has > >> an address, but you didn't specify the address. Conversely, when you > >> specify an address, gdb finds the source/line for the address if available, > >> as well as the function. > > > > That's understood, and it not important for what I have in mind. The > > important point is that the user can potentially specify every > > attribute of a code location, even if some combinations cannot be > > used. > > I guess I don't know how that fits your idea of "100% identical" then. I think it's important for describing what exactly happens during the "resolution" of a location specification into code locations. > I don't really understand what you're after, so I don't know what to comment > further. I sounds like you are trying to say that a location spec can be > exactly the same as a code location sometimes. While in my view, the found code > locations will always have the attributes that match what the user specified, > otherwise the locations wouldn't have been found. And I thought that that > was already clear in, or obvious from, the text I wrote, and from the specific > location spec format sections. Yes, but note that the last revision of your patch says "resolves into", not "matches". Which I think is a change for the better; I'm trying to have a more accurate idea of what that "resolution" entails.