From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) by sourceware.org (Postfix) with ESMTPS id 3F08238387C2 for ; Fri, 27 May 2022 19:17:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3F08238387C2 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-f53.google.com with SMTP id j25so7046460wrb.6 for ; Fri, 27 May 2022 12:17:25 -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=PG8g7CI/yFPhHMXbEJBIRTqcyDPv2pAZriBkO5Xw8vM=; b=sSKe9FpFHQU54cL1PQFjD6BlJ3CzDHqJpKDx+IMQkPPVRbHKdBbTcZMtC1zZPpeXsD pXtKf+1WdLwseMgswgk/cl4ZpXQOwqYUXlZTmnCZbPoW7kMfV7jkJ7kbGQ+kMH+Mj1T6 /wP3QQTl3ThmjmjWqaJmiCw6VkHnFI6RC9uR/p7E8GGOagO2TCvisENZvyreDzCJceXt RlzrKAScokoe1U0td5oIBfamYcrsEscJkT1RvDskdN8TqFFBow0RTxyTamV5FbJgttof F1jnZE7HW9STS2yRSbKlzipvre/03Q0aglQTPMN3PvhC4b8Q9O6vJ105gk/Rwto11Ib8 bPrw== X-Gm-Message-State: AOAM530X80LOwJW9FSYRtTmbwr56SBxhaAkydD1LLA9cH314sYTsoe8u lz909y79al6umBC1IF4iQGNAELCyfFg= X-Google-Smtp-Source: ABdhPJyWj4MEbHvGSLqW/Ppa4/o+LmfYFBNDBYdhvmuWSEOY9njQWB0nTRDDBQnb23As/jD3y1+PlQ== X-Received: by 2002:adf:f902:0:b0:20e:66db:b9d2 with SMTP id b2-20020adff902000000b0020e66dbb9d2mr36535358wrr.682.1653679044195; Fri, 27 May 2022 12:17:24 -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 l5-20020a5d6d85000000b0020e62feca05sm2397089wrs.32.2022.05.27.12.17.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 27 May 2022 12:17:23 -0700 (PDT) Message-ID: Date: Fri, 27 May 2022 20:17:21 +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> <83o7zin6ua.fsf@gnu.org> <977cfe4d-d9d8-98e8-fffb-40c3f9920897@palves.net> <83leumn5yw.fsf@gnu.org> From: Pedro Alves In-Reply-To: <83leumn5yw.fsf@gnu.org> 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 19:17:27 -0000 On 2022-05-27 20:14, Eli Zaretskii wrote: >> Date: Fri, 27 May 2022 20:05:25 +0100 >> Cc: gdb-patches@sourceware.org >> From: Pedro Alves >> >>> I understand (I think). But all this does is fill in the attributes >>> that were missing from the input location spec. This is done either >>> by using the (implied) defaults, like the name of the current file, or >>> bhy using the debug info. And if it turns out that some attribute can >>> be filled in more than one way, we have a breakpoint with multiple >>> code locations. Right? >>> >> >> 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?