From patchwork Mon Oct 9 18:36:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Baldwin X-Patchwork-Id: 77310 Return-Path: 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 5DC1C3831E27 for ; Mon, 9 Oct 2023 18:37:59 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail.baldwin.cx (bigwig.baldwin.cx [66.216.25.90]) by sourceware.org (Postfix) with ESMTPS id 70546385843A for ; Mon, 9 Oct 2023 18:36:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 70546385843A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=FreeBSD.org Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=FreeBSD.org Received: from ralph.baldwin.net (unknown [98.47.15.113]) by mail.baldwin.cx (Postfix) with ESMTPSA id 658761A84E4D; Mon, 9 Oct 2023 14:36:50 -0400 (EDT) From: John Baldwin To: gdb-patches@sourceware.org Cc: Willgerodt@sourceware.org, Felix , George@sourceware.org, Jini Susan , Simon Marchi Subject: [RFC 12/13] linux-tdep: Export linux_make_corefile_notes Date: Mon, 9 Oct 2023 11:36:14 -0700 Message-ID: <20231009183617.24862-13-jhb@FreeBSD.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231009183617.24862-1-jhb@FreeBSD.org> References: <20231009183617.24862-1-jhb@FreeBSD.org> MIME-Version: 1.0 X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.4 (mail.baldwin.cx [0.0.0.0]); Mon, 09 Oct 2023 14:36:51 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.103.1 at mail.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_STATUS, KHOP_HELO_FCRDNS, SPF_HELO_PASS, SPF_SOFTFAIL, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org This permits Linux architectures to override the gdbarch make_corefile_notes method to add architecture-specific notes. --- gdb/linux-tdep.c | 5 ++--- gdb/linux-tdep.h | 7 +++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c index f03a5b95332..1c9c09dbd71 100644 --- a/gdb/linux-tdep.c +++ b/gdb/linux-tdep.c @@ -2033,10 +2033,9 @@ linux_fill_prpsinfo (struct elf_internal_linux_prpsinfo *p) return 1; } -/* Build the note section for a corefile, and return it in a malloc - buffer. */ +/* See linux-tdep.h. */ -static gdb::unique_xmalloc_ptr +gdb::unique_xmalloc_ptr linux_make_corefile_notes (struct gdbarch *gdbarch, bfd *obfd, int *note_size) { struct elf_internal_linux_prpsinfo prpsinfo; diff --git a/gdb/linux-tdep.h b/gdb/linux-tdep.h index e09a6ef32b1..20807031e44 100644 --- a/gdb/linux-tdep.h +++ b/gdb/linux-tdep.h @@ -52,6 +52,13 @@ typedef char *(*linux_collect_thread_registers_ftype) (const struct regcache *, bfd *, char *, int *, enum gdb_signal); +/* Build the note section for a corefile, and return it in a malloc + buffer. */ + +gdb::unique_xmalloc_ptr linux_make_corefile_notes (struct gdbarch *gdbarch, + bfd *obfd, + int *note_size); + extern enum gdb_signal linux_gdb_signal_from_target (struct gdbarch *gdbarch, int signal);