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.129.124]) by sourceware.org (Postfix) with ESMTPS id 45D9B3858CDA for ; Tue, 24 Oct 2023 12:00:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 45D9B3858CDA Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 45D9B3858CDA Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698148801; cv=none; b=J9SFMgh4LByS8zDnzh1xvexBxOlGI2jlwSOl8Ux+b29dqSggxRvIfpX3dus/ljE70F+MTYi9OoUN/GMUppsoDN66Sn7YHTQ96vKBZrdxyMSP0bahGExD/1AwMOJq0b9XAq+go85QoC9HSlEftUOmM9lGHPo/Rw2f3pzICrIPrBM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698148801; c=relaxed/simple; bh=vCEe02N9el6mCYAHWHN7bgxFo2KipAwpTtJPCu2QdBc=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=jFOKaHuGh7OcvIonced4V6JS6wyG3zvGOTcI5+bNX5V89Jqn3FRnvh6AMPskRN4PzZ58tkw/ZbOo1Z1+DE9o0LYoTmsQ54LFujaTv3WVIaHA877hz7IIjeuzQdGC9qlOz2mK24qdIkEU7uzvmDoPjzMcGXyQmc+PxMC3IB8ZApQ= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698148799; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=FBYiQhpp6RzhhuBorpK/S8rk0hO4Fzb5migycH+ET9U=; b=jPHWW81Hvm4RGMs1TXCjJmzKTuzM1nWUuiwooC9cHudPAsMrQuNPSyQTrql2mFtH0z/NsM M49GE34wnzOkHS+CC85gffTFtJp4dXUz9pqqDisGSlU9R7DhI5QhoLCYhmA4XVSEOFwIb7 mmErgEhRXl5ZzDVKDO63+NFT0bvENOI= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-509-XLi5xr9EMi6EUvZJLyg5bg-1; Tue, 24 Oct 2023 07:59:58 -0400 X-MC-Unique: XLi5xr9EMi6EUvZJLyg5bg-1 Received: by mail-ed1-f71.google.com with SMTP id 4fb4d7f45d1cf-53e08e439c8so4875998a12.1 for ; Tue, 24 Oct 2023 04:59:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698148797; x=1698753597; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=FBYiQhpp6RzhhuBorpK/S8rk0hO4Fzb5migycH+ET9U=; b=Eud/7idtt439ytfgOEknuz0baT7NQG9ZC2/dgQH+86llk8XhwbuslbUUSUZbRgTKHQ TPbIy3Z69M2kytScUCHTSVdw85cNDXCy/womTpZiEEIpWPb7AhSSvBdpjd7iTG7rNCVg a8nDJtHVFNErW6qTfPmKVKNwwC13mnBcq6RmlQrWpCEaH3OA1VFQviNb5ht8m2JLASad owINOYHVGbppUVqxxfPvlWqlevYeTZ1164OtYo6/CFg7tFFJyy4Ql2xGZennbqSgWXBv oxHDaEevP1bhMv1KzBbV2VT46L77WU989ycbrW1hWd3FIXH0OfgVKyXuDOftrL2YpaNz hMsA== X-Gm-Message-State: AOJu0Ywr2dTyNDue2l+AS3h9bnM9A/bXi/2GQtCK9ZottAbWmqWDAyE9 79nBM9jMX7TNUOfZnI0Wz81TRXu7OU+Q9lAiHnBcAlUij0Tto6yORVFGLc4a/3BmASIG0QGZouI AOLLWoZbq3S8TFAuNmo3xxw== X-Received: by 2002:aa7:ca49:0:b0:533:5d3d:7efe with SMTP id j9-20020aa7ca49000000b005335d3d7efemr14043184edt.6.1698148797435; Tue, 24 Oct 2023 04:59:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH/38ix7JE4jtEARAqhRj+b+jLtFKD6069xTgIcX1OIDoQ8R9N9cJbFDDvXeW4Uh8uQBnxSFQ== X-Received: by 2002:aa7:ca49:0:b0:533:5d3d:7efe with SMTP id j9-20020aa7ca49000000b005335d3d7efemr14043164edt.6.1698148797100; Tue, 24 Oct 2023 04:59:57 -0700 (PDT) Received: from localhost ([31.111.84.209]) by smtp.gmail.com with ESMTPSA id cn10-20020a0564020caa00b0053e8f1f79afsm7829678edb.30.2023.10.24.04.59.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 04:59:56 -0700 (PDT) From: Andrew Burgess To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 1/5] gdb/coffread: bring separate debug file logic into line with elfread.c In-Reply-To: <87bkctp58a.fsf@tromey.com> References: <87bkctp58a.fsf@tromey.com> Date: Tue, 24 Oct 2023 12:59:55 +0100 Message-ID: <87msw82ptw.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,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 List-Id: Tom Tromey writes: >>>>>> "Andrew" == Andrew Burgess writes: > > Andrew> I haven't tested this, I don't have a coff target to hand. > > I suspect you can do a smoke test by building a "hello world" with the > the mingw toolchain shipped in Fedora. IIRC this goes through > coff_symfile_read. Yes it does. I've given this a try and I still see the debug information being loaded so I've updated the commit message to indicate that minimal testing has been done. > The suspected-to-be-dead part of coffread is coffstab_build_psymtabs. I didn't understand this part. Thanks, Andrew --- commit 3ea19ccbd59c20d5534c9331c10766eb707ce81d Author: Andrew Burgess Date: Thu Oct 12 19:42:19 2023 +0100 gdb/coffread: bring separate debug file logic into line with elfread.c In this commit: commit 8a92335bfca80cc9b4cd217505ea0dcbfdefbf07 Date: Fri Feb 1 19:39:04 2013 +0000 the logic for when we try to load a separate debug file in elfread.c was extended. The new code checks that the objfile doesn't already have a separate debug objfile linked to it, and that the objfile isn't itself a separate debug objfile for some other objfile. The coffread code wasn't extended at the same time. I don't know if it's possible for the coffread code to get into the same state where these checks are needed, but I don't see why having these checks would be a problem. In a later commit I plan to merge this part of the elfread and coffread code, so bringing these two pieces of code into line first makes that job easier. I've tested this with a simple test binary compiled with the mingw toolchain on a Linux host. After compiling the binary and splitting out the debug info GDB still finds and loads the separate debug info. diff --git a/gdb/coffread.c b/gdb/coffread.c index 4a6a83b15ad..e1415d6b258 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -725,7 +725,9 @@ coff_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags) } /* Try to add separate debug file if no symbols table found. */ - if (!objfile->has_partial_symbols ()) + else if (!objfile->has_partial_symbols () + && objfile->separate_debug_objfile == NULL + && objfile->separate_debug_objfile_backlink == NULL) { deferred_warnings warnings; std::string debugfile