From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id Xf66Mz+RCGCIZAAAWB0awg (envelope-from ) for ; Wed, 20 Jan 2021 15:23:27 -0500 Received: by simark.ca (Postfix, from userid 112) id C5C2D1EF80; Wed, 20 Jan 2021 15:23:27 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED, MAILING_LIST_MULTI,T_DKIM_INVALID,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id A527B1E590 for ; Wed, 20 Jan 2021 15:23:26 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 783B5385482A; Wed, 20 Jan 2021 20:23:25 +0000 (GMT) Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by sourceware.org (Postfix) with ESMTPS id 50224385780A for ; Wed, 20 Jan 2021 20:23:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 50224385780A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=andrew.burgess@embecosm.com Received: by mail-wr1-x42c.google.com with SMTP id 7so17062468wrz.0 for ; Wed, 20 Jan 2021 12:23:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=w2nJsbkKU2rQVSNDX6KF1+ZfYl8Kxm385j71e7GjqQM=; b=QAUC/F6047Ifmru11Ef2fAjdfOXv3mOXSxNFh/YXZ34XBoi+ZKdEAF2S2O9Rb6ViZi ieuL0hBQDvrcG5IsqWJZN/j9ejmwe5cctGTepLDR29NDmb6aBAzAJjTOCJCkYdvEd9CQ x+eke/06Rroczy2UB/E4+oPsMgaHm2uD7kelJusCMJ393cSMeVkr7aapcju2Z2PPI7C0 oc8Bhe86PungqEIBVZB8mjNDEKZGboD3Cu1bWaHoLLLr2GXgkF6bV+i5GCC24JcGS/7T BJ38eEzgdCbEHEiJCljTYNur/KLMk+dBiBasvhTWzkxLbYQxND9nh++AQxgxhjlhu5K5 DVaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=w2nJsbkKU2rQVSNDX6KF1+ZfYl8Kxm385j71e7GjqQM=; b=HermfvfgSnuHv8LjlVfIcrrzcGjbiVX9oXOOVg+LtGSc6mHtioYxxERp7OusO6Ft2K VLhdRbn9gKAfZG9O64vR7ZpVak0rBehfMyn2zC3vZZdIesnup8El8XNdlUdV8oVWfU0j ba9FPiSMqlWYr8/wJGATvn28m1sBJotaQ9oBdx7ju9yhhzMzLU7eF5TXlvSwFHfPgVDo 8Vr48HHnw5E4evOf2aeiuk0JqVIXzXhi96KEsBf/UufcDcvYbVZ1KbUz7W3tUWB/gjDc qa3leZ8CKbeHXJ0vd3f4+njG510yE8fNLNHMRd1u3Cvc+BFTObM+SP0jJ25LDYvtDsEu DUBA== X-Gm-Message-State: AOAM530TLIlTVxkesTPvB4zrYJYOqHhhtKe2U6QO9pX0zWqn3QYARXtB Q/R5ucb/d9GU5Sz4KQ9OwYi8v68U5lxOkQ== X-Google-Smtp-Source: ABdhPJxCsOl84KJ0H9sWZ0d+VbWsDLV6ZaS0peCs7y/cj6Ml8N/HnhImU2domuNmUsR2J8LK28qHLQ== X-Received: by 2002:adf:fbd2:: with SMTP id d18mr11156422wrs.222.1611174199752; Wed, 20 Jan 2021 12:23:19 -0800 (PST) Received: from localhost (host86-180-62-229.range86-180.btcentralplus.com. [86.180.62.229]) by smtp.gmail.com with ESMTPSA id w1sm5546970wrr.84.2021.01.20.12.23.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jan 2021 12:23:19 -0800 (PST) From: Andrew Burgess To: gdb-patches@sourceware.org, binutils@sourceware.org Subject: [PATCHv2 0/9] Bare-metal core dumps for RISC-V Date: Wed, 20 Jan 2021 20:23:06 +0000 Message-Id: X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: , Cc: Fredrik Hederstierna Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" This is an update of this patch series: https://sourceware.org/pipermail/gdb-patches/2020-December/173697.html But also includes an update of this patch: https://sourceware.org/pipermail/gdb-patches/2020-October/172845.html Here is a summary of what's changed: Patch #1 - This is new. Unify some of the core dump logic between Linux and OpenBSD. This unified code will then be reused again for the bare metal core dumping. Patch #2 - The constant NT_GDB_TDESC has received a new value, along with an extended comment at its definition site. Patch #3 - Force null byte at the end of the description string, and add an extra null pointer check into the code. Patch #4 - Minor updates to wording as suggested by Jim. Patch #5 - The bare metal core dump support is now split between a common file and a riscv specific file. The common file also reuses some of the code factored out in patch 1. Finally, the commit message for this commit includes a much fuller description of the core dump format. Please see the patch email for more details. Patch #6 - New number suggested for NT_RISCV_CSR constant, see the patch email for more details on why. Patch #7 - No change. Patch #8 - No change. Patch #9 - This is new (in this series). This is a rebase of Fredrik's patch adding bare metal core dump support for ARM. I don't know if I would actually merge this patch as part of this series, I guess it depends on the feedback (my interest is RISC-V), but I wanted to include this to show how the patch would look when integrated with my work. As with patch 5 I have included a description of the core file format in the commit message. Please see the patch email for more details. All feedback welcome. Thanks, Andrew --- Andrew Burgess (9): gdb: unify parts of the Linux and FreeBSD core dumping code bfd/binutils: support for gdb target descriptions in the core file gdb: write target description into core file bfd/riscv: prepare to handle bare metal core dump creation gdb/riscv: introduce bare metal core dump support bfd/binutils: add support for RISC-V CSRs in core files gdb/riscv: make riscv target description names global gdb/riscv: write CSRs into baremetal core dumps gdb/arm: add support for bare-metal core dumps bfd/ChangeLog | 24 +++++ bfd/elf-bfd.h | 4 + bfd/elf.c | 46 ++++++++++ bfd/elfnn-riscv.c | 72 +++++++++++++++ binutils/ChangeLog | 10 ++ binutils/readelf.c | 4 + gdb/ChangeLog | 76 +++++++++++++++ gdb/Makefile.in | 6 ++ gdb/arm-none-tdep.c | 208 ++++++++++++++++++++++++++++++++++++++++++ gdb/configure.tgt | 5 +- gdb/corelow.c | 24 +++++ gdb/fbsd-tdep.c | 135 ++------------------------- gdb/gcore.c | 157 +++++++++++++++++++++++++++++++ gdb/gcore.h | 20 ++++ gdb/linux-tdep.c | 141 ++-------------------------- gdb/none-tdep.c | 119 ++++++++++++++++++++++++ gdb/none-tdep.h | 30 ++++++ gdb/riscv-none-tdep.c | 168 ++++++++++++++++++++++++++++++++++ gdb/riscv-tdep.c | 14 ++- gdb/riscv-tdep.h | 3 + include/ChangeLog | 10 ++ include/elf/common.h | 6 ++ 22 files changed, 1014 insertions(+), 268 deletions(-) create mode 100644 gdb/arm-none-tdep.c create mode 100644 gdb/none-tdep.c create mode 100644 gdb/none-tdep.h create mode 100644 gdb/riscv-none-tdep.c -- 2.25.4