Message ID | c5b247d77d16563fc28d3db07a5cd2843bf29d50.1697626088.git.aburgess@redhat.com |
---|---|
State | New |
Headers |
Return-Path: <gdb-patches-bounces+patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CBD023875DC0 for <patchwork@sourceware.org>; Wed, 18 Oct 2023 10:53:59 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org 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 96A6D386180D for <gdb-patches@sourceware.org>; Wed, 18 Oct 2023 10:53:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 96A6D386180D 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 96A6D386180D 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=1697626413; cv=none; b=pVTfdNXYVnpcZqaDjEurRfEHikZpZP7MhSjSw1XSz2f/tUWXSiCG/uciFrEOg7G0tluExe11n53ADPOwbuN9pjAXGTakJ1UbI15zPt8h+ojSz2ZbuBdW7/GrCfL679ZjLC+G6/avpeYCQpNA8yT+bDpqaYJSvqMYpRK5UojqB34= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697626413; c=relaxed/simple; bh=7POUHQMn6LCt8iRQ6wnHGq5V4K1dVWhR8fy8LBBQ+Kg=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=x3Arob3uGhjQlzxhqWkB8VlqPM+mfiDO/6FrI3mP+dtfkMQNm4A+ccEnhzSmZdJ9p1TcUcDS3ODqASKO9Ux8TCSeL7hwbHSHpZTHfQFzg8yjkPy0DuunMXiVqFM6ZceyJ+432XqfX2kOSUmeofYPsDlNTLgqx4W0z3tOMl66tLc= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697626412; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oMGRMu0+4zG2p6Xk98LrIZCj7iNkPX0RUcdH9DOXMzM=; b=d+gnCCIb73Wbk3vShczZQovPp/jYtErhOzMZPiXXqBf162tH+hD8HIOgpvZyDX5kBHE77h ldLWDy9fId3RsOWMUg4x8Ce4Umkh79kGr2rzGNELGGnTq7RCetrJuFQaJbJ9BEYVtxmSen 14avwryQSrMDvsLOl9023Q9aQP3rAzQ= Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-441-tNgcRaDAMzKCMWrj3rEtmg-1; Wed, 18 Oct 2023 06:53:31 -0400 X-MC-Unique: tNgcRaDAMzKCMWrj3rEtmg-1 Received: by mail-qv1-f70.google.com with SMTP id 6a1803df08f44-66d75988385so13422256d6.2 for <gdb-patches@sourceware.org>; Wed, 18 Oct 2023 03:53:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697626410; x=1698231210; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oMGRMu0+4zG2p6Xk98LrIZCj7iNkPX0RUcdH9DOXMzM=; b=GGJvZjmsfTlWIUZLtoAyhtl2rlWIgxN1cEqilnr0bT3iuCT0BVK6x282JnyxkAHZAp WvyCPITYIMa1KWUl5Y0pnSNTqWHbyJSv8qCK6B9kmHhIMSmxWqKvNJSBWfHrdWDo6INF 21R3XRVgu6zil9/yyDt4igmx46ZrhBQ/7ZQoTSE2ef4lpnuDjSCuXGdbSDk2QGFoHSCr TWvQ5Nj7Q0LtYMTRClJ1BJaP1oPFwHzV75lGdIIyadhj6zgBbm4vXjrNfM+4J3VX/bPU K4ryJXscFTuWtw6RuOD5tCg9lW7KG9N4R7YBJNiVy3sDw+YZFK5xEX+3lae147vXPaub V42Q== X-Gm-Message-State: AOJu0Yy0C0LneH4SMVz3CE3lXS3lLSdAlMVragYkRmMxAhFF3RMco0Lw dXCUFB6N+HGm5xf2szR4N5BBkePuTqt5UpRWcLP0gn+/upW++fZcsXCnkNLmPd2StEbh3+8cD26 kj8Tk34je0Fvyudj/tZJY41pOkGcf/f/UguLHEHXTfdZBSt2H1Vdtfiy9fSGYZgL0PCxUNquC0m Hy6UBlow== X-Received: by 2002:a05:6214:e4f:b0:668:e6f7:3d48 with SMTP id o15-20020a0562140e4f00b00668e6f73d48mr5577266qvc.19.1697626410504; Wed, 18 Oct 2023 03:53:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH2FTLzs2PPeHp4BOrgOp1jw36IoxBof2Klr/iHNcmWFMQdoU9Oce2suM5UgWcgRn7sW//04w== X-Received: by 2002:a05:6214:e4f:b0:668:e6f7:3d48 with SMTP id o15-20020a0562140e4f00b00668e6f73d48mr5577245qvc.19.1697626410140; Wed, 18 Oct 2023 03:53:30 -0700 (PDT) Received: from localhost ([31.111.84.209]) by smtp.gmail.com with ESMTPSA id o11-20020a056214108b00b0066d15e2b73fsm1243719qvr.145.2023.10.18.03.53.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 03:53:29 -0700 (PDT) From: Andrew Burgess <aburgess@redhat.com> To: gdb-patches@sourceware.org Cc: Andrew Burgess <aburgess@redhat.com> Subject: [PATCH 1/5] gdb/coffread: bring separate debug file logic into line with elfread.c Date: Wed, 18 Oct 2023 11:53:19 +0100 Message-Id: <c5b247d77d16563fc28d3db07a5cd2843bf29d50.1697626088.git.aburgess@redhat.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <cover.1697626088.git.aburgess@redhat.com> References: <cover.1697626088.git.aburgess@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-11.6 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 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list <gdb-patches.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=subscribe> Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org |
Series |
New Python hook for missing debug information
|
|
Checks
Context | Check | Description |
---|---|---|
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 | success | Testing passed |
linaro-tcwg-bot/tcwg_gdb_build--master-arm | success | Testing passed |
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 | success | Testing passed |
linaro-tcwg-bot/tcwg_gdb_check--master-arm | fail | Testing failed |
Commit Message
Andrew Burgess
Oct. 18, 2023, 10:53 a.m. UTC
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 haven't tested this, I don't have a coff target to hand. --- gdb/coffread.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Comments
>>>>> "Andrew" == Andrew Burgess <aburgess@redhat.com> 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.
The suspected-to-be-dead part of coffread is coffstab_build_psymtabs.
Tom
Tom Tromey <tom@tromey.com> writes: >>>>>> "Andrew" == Andrew Burgess <aburgess@redhat.com> 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 <aburgess@redhat.com> 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
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