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 51D8F382799A for ; Fri, 27 May 2022 19:34:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 51D8F382799A Received: from fencepost.gnu.org ([2001:470:142:3::e]:37838) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nufjX-0007UK-Ol; Fri, 27 May 2022 15:34:55 -0400 Received: from [87.69.77.57] (port=2433 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 1nufix-0002dH-W2; Fri, 27 May 2022 15:34:24 -0400 Date: Fri, 27 May 2022 22:34:09 +0300 Message-Id: <83k0a6n51q.fsf@gnu.org> From: Eli Zaretskii To: Pedro Alves Cc: gdb-patches@sourceware.org In-Reply-To: (message from Pedro Alves on Fri, 27 May 2022 20:17:21 +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> <83pmjyn8as.fsf@gnu.org> <113bd07c-3bfe-0780-50a9-4c41c84942e9@palves.net> <83o7zin6ua.fsf@gnu.org> <977cfe4d-d9d8-98e8-fffb-40c3f9920897@palves.net> <83leumn5yw.fsf@gnu.org> 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 19:34:57 -0000 > Date: Fri, 27 May 2022 20:17:21 +0100 > Cc: gdb-patches@sourceware.org > From: Pedro Alves > > >> You start with e.g., just one attribute, like "-function func". This > >> makes GDB iterate over all the functions is knows about, finding the > >> ones that are called "func". This matches "func(int)", "A::func()", > >> "func(long)", etc. GDB collects the PC and source file and line number of > >> those functions too along the wa. If you did "break -function func", then > >> you end up with a breakpoint with multiple code locations, one > >> for each function matched. > >> > >> Or you start with "a/file.c:100". This makes GDB iterate over all source > >> files it knows about, and then for each that has a file name that ends > >> with "a/file.c", like e.g., "src/program/a/file.c" and "somelib/a/file.c" > >> it searches for line 100, collecting the PC and function name of the > >> location. If you did "break a/file.c:100", you end up with a breakpoint with > >> multiple locations, one per resolved location. If you did > >> "list a/file.c:100", GDB lists the source for around each of the locations. > >> Etc. > >> > >> Or you start with "*0x1000". Conceptually it's the same. GDB finds the code > >> locations that match that, resolves that to a location with > >> PC/function/source/line, and then the command does what it wants with it. > > > > Is this supposed to confirm my understanding, or to refute it? I > > think it confirms it. > > I didn't understand what you meant by "attribute can be filled in > more than one way", so I explained how it works. If you start with my example > for "-function func" example from above, what does "attribute is filled in more > than one way" mean in that example? It means that each of the following attributes of code location can have more than one value that satisfies the location spec: . function prototype . possibly file name . line number . code address