Message ID | 20230706172337.39099-1-jhb@FreeBSD.org |
---|---|
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 9BC563853D21 for <patchwork@sourceware.org>; Thu, 6 Jul 2023 17:26:56 +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 372F038582B7 for <gdb-patches@sourceware.org>; Thu, 6 Jul 2023 17:26:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 372F038582B7 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 (c-98-35-126-114.hsd1.ca.comcast.net [98.35.126.114]) by mail.baldwin.cx (Postfix) with ESMTPSA id 68EC81A84AD4 for <gdb-patches@sourceware.org>; Thu, 6 Jul 2023 13:26:29 -0400 (EDT) From: John Baldwin <jhb@FreeBSD.org> To: gdb-patches@sourceware.org Subject: [PATCH v2 0/4] Handle null inferiors in target::read_description Date: Thu, 6 Jul 2023 10:23:33 -0700 Message-Id: <20230706172337.39099-1-jhb@FreeBSD.org> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.4 (mail.baldwin.cx [0.0.0.0]); Thu, 06 Jul 2023 13:26:29 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.103.1 at mail.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00, FORGED_SPF_HELO, KAM_DMARC_STATUS, KHOP_HELO_FCRDNS, SPF_HELO_PASS, SPF_SOFTFAIL, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no 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.29 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 Sender: "Gdb-patches" <gdb-patches-bounces+patchwork=sourceware.org@sourceware.org> |
Series |
Handle null inferiors in target::read_description
|
|
Message
John Baldwin
July 6, 2023, 5:23 p.m. UTC
Change since V1: - Call the beneath target's read_description method instead of returning nullptr. - ppc-linux-nat now calls the beneath method instead of calling ppc_linux_match_description with ppc_linux_no_features. ppc_linux_no_features has a wordsize of 0, so ppc_linux_match_description would have hit an assertion failure. - mips-linux-nat is slightly smarter in that it only falls back to assuming no DSP if have_dsp < 0. If have_dsp has previously been read and the result cached, then there's no ptrace call to avoid. - Simplifications to the have_native_target helper function suggested by Simon. John Baldwin (4): *-fbsd-nat: Handle null inferior in read_description. *-linux-nat: Handle null inferior in read_description. Add a have_native_target helper function for use with require. Test that native targets can read a tdesc without a process attached. gdb/aarch64-fbsd-nat.c | 3 +++ gdb/aarch64-linux-nat.c | 3 +++ gdb/amd64-fbsd-nat.c | 3 +++ gdb/arm-fbsd-nat.c | 3 +++ gdb/arm-linux-nat.c | 3 +++ gdb/i386-fbsd-nat.c | 3 +++ gdb/mips-linux-nat.c | 4 +++ gdb/ppc-linux-nat.c | 3 +++ gdb/riscv-linux-nat.c | 3 +++ gdb/s390-linux-nat.c | 3 +++ .../gdb.base/auto-connect-native-target.exp | 18 +------------ .../gdb.base/native-target-noproc-tdesc.exp | 27 +++++++++++++++++++ gdb/testsuite/lib/gdb.exp | 14 ++++++++++ gdb/x86-linux-nat.c | 3 +++ 14 files changed, 76 insertions(+), 17 deletions(-) create mode 100644 gdb/testsuite/gdb.base/native-target-noproc-tdesc.exp
Comments
>>>>> "John" == John Baldwin <jhb@FreeBSD.org> writes:
John> Change since V1:
John> - Call the beneath target's read_description method instead of
John> returning nullptr.
FWIW, I read through these. I didn't see any red flags, but then again,
I'm not sure I really understand the underlying scenario very well.
I didn't want this to go un-answered, though. IMO it is ok.
Tom