From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id D4FE33858D37 for ; Mon, 10 Oct 2022 16:06:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D4FE33858D37 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-496-BIfGBKB1OHi9MOnWHuhLcA-1; Mon, 10 Oct 2022 12:06:44 -0400 X-MC-Unique: BIfGBKB1OHi9MOnWHuhLcA-1 Received: by mail-wm1-f72.google.com with SMTP id h129-20020a1c2187000000b003bf635eac31so4152628wmh.4 for ; Mon, 10 Oct 2022 09:06:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=XyyLngsk0N0KUNYpz6KkJnYAdH05L7RG46GcWAZTyc8=; b=sYiaYTLdrdf6oiM4xRzZkuqhJYRkC6TTxVlV0IOGsx/b9pgEqOAiwGNpz2Pw+uQScE aWYbhIkQxzWqLspo95NqWwWSYo1mbVrQ2qNOhIvVTVovCV7OqSGG6ZcejHrMT2Bu/vI5 DFT+tEn/wl/95ElW/cdH9GoUEHZsjpXAMzaMg0lsa8yfHFRIeoZtPRqR+oYRrpAZs875 CqtnE1pVji+9kZ4/ksdzEL2Ip2dqpLWNWTVyB5btBPci7hf+IYpzt07NxTXocKqNpelk bdkmgKnUQJ2RmW7ob0rDl6QU6BaqZlSc0NrUkWsR9lOv1Uc0KolJIixH46FaoGstzWmi /4CQ== X-Gm-Message-State: ACrzQf1OJSghbP8u5yNHgjokUGgOQ2oJtCRBs3ydolOVtrhS9g50+Vn3 +I6O3XT7FLgSXBh+0vhPUkwcZG/NBKfs5losg8yCt1fAq2xUToBjKnyZsgqFUV3dqQ83IVAqqVz 84IU941V4q1gUZ1vVt7ZLArox6tFRUrqU6GK6LFxbZmIhQdbm+C7cr9qC2GvDAbtOnfkcIAL8 X-Received: by 2002:a5d:6c6b:0:b0:225:dde:ab40 with SMTP id r11-20020a5d6c6b000000b002250ddeab40mr12189188wrz.690.1665418002663; Mon, 10 Oct 2022 09:06:42 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4S7FBHnX1nQ9WeVWlx3M68JfR6kPH0hQzJaIXIukmdiutWu+TM/zHdbdkp7I2vXDGDzWJq8Q== X-Received: by 2002:a5d:6c6b:0:b0:225:dde:ab40 with SMTP id r11-20020a5d6c6b000000b002250ddeab40mr12189173wrz.690.1665418002434; Mon, 10 Oct 2022 09:06:42 -0700 (PDT) Received: from [10.43.2.105] (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id m21-20020a05600c4f5500b003b48dac344esm17046312wmq.43.2022.10.10.09.06.41 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 10 Oct 2022 09:06:41 -0700 (PDT) Message-ID: Date: Mon, 10 Oct 2022 18:06:40 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Subject: Re: [PATCH] gdb/linespec.c: Fix missing source file during breakpoint re-set To: gdb-patches@sourceware.org References: <20221007234428.12845-1-amerey@redhat.com> From: Bruno Larsen In-Reply-To: <20221007234428.12845-1-amerey@redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP 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: Mon, 10 Oct 2022 16:06:47 -0000 On 08/10/2022 01:44, Aaron Merey via Gdb-patches wrote: > During breakpoint re-setting, the source_filename of an > explicit_location_spec is used to lookup the symtabs associated with > the breakpoint being re-set. This source_filename is compared with each > known symtab filename in order to retrieve the breakpoint's symtabs. > > However the source_filename may have been originally copied from a > symtab's fullname (the path where GDB found the source file) when the > breakpoint was first created. If a breakpoint symtab's filename and > fullname differ, this will cause a NOT_FOUND_ERROR to be thrown during > re-setting. > > Fix this by using a symtab's filename to set the explicit_location_spec > source_filename instead of the symtab's fullname. This seems like a good change, and introduces no regressions. Reviewed-By: Bruno Larsen Cheers, Bruno > --- > gdb/linespec.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/gdb/linespec.c b/gdb/linespec.c > index 3db35998f7e..805c98ca201 100644 > --- a/gdb/linespec.c > +++ b/gdb/linespec.c > @@ -2281,13 +2281,13 @@ convert_linespec_to_sals (struct linespec_state *state, linespec *ls) > /* Make sure we have a filename for canonicalization. */ > if (ls->explicit_loc.source_filename == NULL) > { > - const char *fullname = symtab_to_fullname (state->default_symtab); > + const char *filename = state->default_symtab->filename; > > /* It may be more appropriate to keep DEFAULT_SYMTAB in its symtab > form so that displaying SOURCE_FILENAME can follow the current > FILENAME_DISPLAY_STRING setting. But as it is used only rarely > it has been kept for code simplicity only in absolute form. */ > - ls->explicit_loc.source_filename = xstrdup (fullname); > + ls->explicit_loc.source_filename = xstrdup (filename); > } > } > else