Message ID | cover.1730205615.git.aburgess@redhat.com |
---|---|
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 B26073857C7F for <patchwork@sourceware.org>; Tue, 29 Oct 2024 14:09:28 +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 ESMTP id 937663858C42 for <gdb-patches@sourceware.org>; Tue, 29 Oct 2024 14:08:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 937663858C42 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 937663858C42 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=1730210926; cv=none; b=DB1ETOxvvJ8lFNUfXpSERdkk/0Qd/+dL4mPn1UGK0thtcDGxpdugOsAwG4qego5IMw/e4Uk6kb+jzdZ2cYPSC91Ofl2d9mzxTXWTaJ9dNf/jMG/4/1IpFaW7CjQ0z1ulhHpXqnX+lqgHcCzcWttkrHDBSb81IVaQ0vyBAXUWWpk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730210926; c=relaxed/simple; bh=dluDbL2nDjAxyAXv9VqCpYBvt2D+D5jqK6vQO/vg2Us=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=dn2zyhOIUrD41sHumlx93utHMwR4yNtyHeSHJGRqCBAXaSdFNNUX1NW7IrKQSS80dxuyxEBUyXukEvIDXzy+2IWYScjbFc8Ydf6xNloGMDdsq8Jxh2hmVDClFfDlamQP51IR8DRot7ESMykVCqwAN5vj7KRD52WoXjuk6R80YzY= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1730210915; 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=NbLrcKWF7hmSAiM/xLNq7EKV4cOo2/luZhvX8lbye4U=; b=UyjcGmBmmTiXOm3sBn4vCil3MjeA/kZOaKgbTXli/VQF7qdDeDv4gzQvNb2D0pIvqRk0Vr H2ix7y41t2wfOhz8S9cvpsJt+DIKfkrG65+0S18i1PhFGgxjt6FqJFd8e34D1+lItcLj33 phG9HgOMOCGlR8Q+h4HaBv3GvDlIHeE= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-81-k0--tgk7MVGnczwKn8k9Zw-1; Tue, 29 Oct 2024 10:08:34 -0400 X-MC-Unique: k0--tgk7MVGnczwKn8k9Zw-1 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-4315d98a75fso41980225e9.2 for <gdb-patches@sourceware.org>; Tue, 29 Oct 2024 07:08:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730210912; x=1730815712; 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=NbLrcKWF7hmSAiM/xLNq7EKV4cOo2/luZhvX8lbye4U=; b=esdEEq3qjwV71cn/Gk48qFtJgEyZfKxz31C6cEJWumqTZWf0XGtOEJDyrw4RTaDnXT TkSeW38MpPmZcvtyP+ouxOxurK/FRqz52lwNNKqKY1/yYmVZnQPN+P3kLPxb/ewU7z2/ Ps9rdUswpParWTmBLd8U6UQPZnlV5j5xwJCW22ubMLpTraqKhPCh5XEYKaTvcusF/0Hg pkFQN81eNM6H6/jQ8gp0RK/vY4ewVkAKdtydBjzVmO5XBmOggTJDg0n/JFjzKTmsz/4B VRcqPTLHZLgtI2yAJTVqZ5P8l3G2izTG8RatfX2cOD8y7U9iioxjiV/BjBgN1quqsDrQ jRYA== X-Gm-Message-State: AOJu0Yw1ZxXm3zTPZIP1HFU9NqDp2lSTr9ut/mTcZf0YZT6zqegCJGh1 ZsPm5fsTg3NYCTP0l0yShfbJ1weIlMAUgexYag2xEI1St1CRKoNzXvSLeZz7bd+937IK7yX0Vz9 5KCnlxiwb1XQOXr6DOySMKa+AK0NoWIeYXNXLgAFXamnChd3XHPybtYAsNOCMzA8xVhhcmqm9ca aEwvyISATpxf0nA1myQcMfDqLO+XoUjJ+gdRQcatf673c= X-Received: by 2002:a05:600c:1d1c:b0:431:55bf:fe4 with SMTP id 5b1f17b1804b1-431b17365ffmr39962225e9.24.1730210912083; Tue, 29 Oct 2024 07:08:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHc47mxpUHhZe9uYrcQOxlDa+t4GlLiGT7wHpXofdlXYIIViGde7JDvAvSMJmKXjhCUTKOQKw== X-Received: by 2002:a05:600c:1d1c:b0:431:55bf:fe4 with SMTP id 5b1f17b1804b1-431b17365ffmr39962035e9.24.1730210911679; Tue, 29 Oct 2024 07:08:31 -0700 (PDT) Received: from localhost (197.209.200.146.dyn.plus.net. [146.200.209.197]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4318b56facasm174877185e9.33.2024.10.29.07.08.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Oct 2024 07:08:31 -0700 (PDT) From: Andrew Burgess <aburgess@redhat.com> To: gdb-patches@sourceware.org Cc: Andrew Burgess <aburgess@redhat.com> Subject: [PATCHv3 0/5] Better executable auto-loading when opening a core file Date: Tue, 29 Oct 2024 14:08:24 +0000 Message-Id: <cover.1730205615.git.aburgess@redhat.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <cover.1730141493.git.aburgess@redhat.com> References: <cover.1730141493.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=-5.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, 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 |
Better executable auto-loading when opening a core file
|
|
Message
Andrew Burgess
Oct. 29, 2024, 2:08 p.m. UTC
In v3: - Linaro CI highlighted some failures on ARM. Turns out ARM's stack setup is different than the other architectures I've tested on. I've added some additional logic which should mean ARM is now handled OK. In v2: - Fixed an incorrect use of gdb::function_view in patch #1 which was causing undefined behaviour, and crashes when GDB was built with optimisation. - Rebased and retested. --- There's actually a couple of core file related improvements in this series. Patches #1 and #2 improve what information GDB can extract about the execution context (executable name, inferior arguments, and environment) when opening a core file. Then patch #4 improves GDB's ability to auto-load the executable that matches a core file (on GNU/Linux). Patch #3 is a testsuite refactor to allow for patch #4. And patch #5 replicates patch #4, but for FreeBSD. Thanks, Andrew --- Andrew Burgess (5): gdb: add gdbarch method to get execution context from core file gdb: parse and set the inferior environment from core files gdb/testsuite: make some of the core file / build-id tests harder gdb: improve GDB's ability to auto-load the exec for a core file gdb/freebsd: port core file context parsing to FreeBSD gdb/arch-utils.c | 26 ++ gdb/arch-utils.h | 89 +++++ gdb/corefile.c | 10 + gdb/corelow.c | 172 +++++++++- gdb/fbsd-tdep.c | 134 ++++++++ gdb/gdbarch-gen.c | 22 ++ gdb/gdbarch-gen.h | 15 + gdb/gdbarch.h | 1 + gdb/gdbarch_components.py | 20 ++ gdb/linux-tdep.c | 315 ++++++++++++++++++ gdb/testsuite/gdb.base/coredump-filter.exp | 17 +- gdb/testsuite/gdb.base/corefile-buildid.exp | 252 ++++++-------- .../gdb.base/corefile-exec-context.c | 25 ++ .../gdb.base/corefile-exec-context.exp | 165 +++++++++ gdb/testsuite/gdb.base/corefile-find-exec.c | 25 ++ gdb/testsuite/gdb.base/corefile-find-exec.exp | 252 ++++++++++++++ gdb/testsuite/gdb.base/corefile.exp | 9 + 17 files changed, 1386 insertions(+), 163 deletions(-) create mode 100644 gdb/testsuite/gdb.base/corefile-exec-context.c create mode 100644 gdb/testsuite/gdb.base/corefile-exec-context.exp create mode 100644 gdb/testsuite/gdb.base/corefile-find-exec.c create mode 100644 gdb/testsuite/gdb.base/corefile-find-exec.exp base-commit: a723c56efb07c4f8b3f6a3ed4b878a2f8f5572cc