From patchwork Mon Jan 6 10:21:20 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hui Li X-Patchwork-Id: 104155 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 835F6385840E for ; Mon, 6 Jan 2025 10:23:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 835F6385840E X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by sourceware.org (Postfix) with ESMTP id A49EE3858D21 for ; Mon, 6 Jan 2025 10:21:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A49EE3858D21 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=loongson.cn ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A49EE3858D21 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=114.242.206.163 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736158895; cv=none; b=TwKltvCyG4oAYNMnMsZRbWqBhCYhmo5y89kf1nlQYHkL8Ak3nuFBnFN4QEoM0uu7GTIXlPzxFi0mLQTo5XHKVmZB3F/6ipG9McB65j/L2Q/+R9YgFlS9hiCVx98/6rVsSVkxlSIIYZc3RZkRsyNnLMbtQuSRoAt4iZ6OqyqpGD8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736158895; c=relaxed/simple; bh=nVkMq3WwVvO1CIHixiFcbvYZ4i9LwSYxZn6rRZZCdcM=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=iOQAavkyROp+PTRWZ4AkhQ8ZEtPV8smxR6dOw8+6oGmiipNCH2l36EBHRpQjj30qXsYfhDx37t3OOgm0gudAnuSF1Hbuuec94pUXQ+1xKoxI0cdKUC3WMQR19b6fg3SuPBJ2SS+fQZyRNqUnMWi5IQqaTEgtJ2za+IWrzegjZA8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A49EE3858D21 Received: from loongson.cn (unknown [113.200.148.30]) by gateway (Coremail) with SMTP id _____8BxeeCsrntnSJpeAA--.54693S3; Mon, 06 Jan 2025 18:21:32 +0800 (CST) Received: from localhost.localdomain (unknown [113.200.148.30]) by front1 (Coremail) with SMTP id qMiowMCxYMarrntnU18WAA--.32016S3; Mon, 06 Jan 2025 18:21:32 +0800 (CST) From: Hui Li To: gdb-patches@sourceware.org Cc: Tiezhu Yang Subject: [PATCH 1/4] gdb: LoongArch: Remove loongarch_lookup_debug_reg_state() Date: Mon, 6 Jan 2025 18:21:20 +0800 Message-Id: <20250106102123.5694-2-lihui@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20250106102123.5694-1-lihui@loongson.cn> References: <20250106102123.5694-1-lihui@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: qMiowMCxYMarrntnU18WAA--.32016S3 X-CM-SenderInfo: 5olk3xo6or00hjvr0hdfq/ X-Coremail-Antispam: 1Uk129KBj93XoW7tr17tF43Ar1fJFWxGF1ktFc_yoW8Cry7pa srur1rGr48trs0yrZ7Aw4rXr9FgFy7ur42vFW7tFyIkFZ8Ar1Fgwn5KryDXFnrWa409w4j qr4UKayY9ay7A3cCm3ZEXasCq-sJn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUUkFb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r106r15M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Jr0_JF4l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Jr0_Gr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AK xVW8Jr0_Cr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6xACxx 1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv 67AKxVW8JVWxJwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41l42xK82IYc2 Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s02 6x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r1Y6r17MIIYrxkI7VAKI48JMIIF0x vE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r1j6r4UMIIF0xvE 42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6x kF7I0E14v26r1j6r4UYxBIdaVFxhVjvjDU0xZFpf9x07jOF4_UUUUU= X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, 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 loongarch_lookup_debug_reg_state() is a unused function, so we can remove it. Signed-off-by: Hui Li --- gdb/nat/loongarch-linux-hw-point.c | 13 ------------- gdb/nat/loongarch-linux-hw-point.h | 5 ----- 2 files changed, 18 deletions(-) diff --git a/gdb/nat/loongarch-linux-hw-point.c b/gdb/nat/loongarch-linux-hw-point.c index 002553a5b51..9c39cceb336 100644 --- a/gdb/nat/loongarch-linux-hw-point.c +++ b/gdb/nat/loongarch-linux-hw-point.c @@ -220,19 +220,6 @@ loongarch_linux_get_debug_reg_capacity (int tid) } } -/* Return the debug register state for process PID. If no existing - state is found for this process, return nullptr. */ - -struct loongarch_debug_reg_state * -loongarch_lookup_debug_reg_state (pid_t pid) -{ - auto it = loongarch_debug_process_state.find (pid); - if (it != loongarch_debug_process_state.end ()) - return &it->second; - - return nullptr; -} - /* Return the debug register state for process PID. If no existing state is found for this process, create new state. */ diff --git a/gdb/nat/loongarch-linux-hw-point.h b/gdb/nat/loongarch-linux-hw-point.h index fb722aab50c..161db9270ff 100644 --- a/gdb/nat/loongarch-linux-hw-point.h +++ b/gdb/nat/loongarch-linux-hw-point.h @@ -108,11 +108,6 @@ void loongarch_linux_set_debug_regs (struct loongarch_debug_reg_state *state, void loongarch_linux_get_debug_reg_capacity (int tid); -/* Return the debug register state for process PID. If no existing - state is found for this process, return nullptr. */ - -struct loongarch_debug_reg_state *loongarch_lookup_debug_reg_state (pid_t pid); - /* Return the debug register state for process PID. If no existing state is found for this process, create new state. */ From patchwork Mon Jan 6 10:21:21 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hui Li X-Patchwork-Id: 104152 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 24C4D385840F for ; Mon, 6 Jan 2025 10:22:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 24C4D385840F X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by sourceware.org (Postfix) with ESMTP id BEFF43858D35 for ; Mon, 6 Jan 2025 10:21:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BEFF43858D35 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=loongson.cn ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BEFF43858D35 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=114.242.206.163 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736158895; cv=none; b=jzATYlbKbTdrY6ffRHFzc8XtQ6SEMtl5URmgKeVnUm42mOJa2gzWoMaxGn3fBOUhBtmZhnKz8MKscrBl9FMPunjAAnspioJrY3VTBfxrtz6a/7HugYvC9qRRqOymZweHQqvefhw/pIxMm4jF8LFNQxhGaZ1krxkkDepbuaGQ2O8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736158895; c=relaxed/simple; bh=1m9aaWt58co/IulkjKUhN0sOg3kmU2RFCALs0ja6icw=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=cWloi3d6RIhAux01glRo5jqDA4MCo2tsdqzoZJW6p2Qnj1SvkRv7PRpWLN1oa0LUK3wMZwJ3jrqych7F/UCTtfbOhv59NtDjZFXeUIc9dkzt1mhDntpCy6Dn+VRUR7v7v1ajDGoCjnsU9b7GrZktLGTtjfxuVK0OQirYhRNzuMI= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BEFF43858D35 Received: from loongson.cn (unknown [113.200.148.30]) by gateway (Coremail) with SMTP id _____8BxeeCtrntnSZpeAA--.54694S3; Mon, 06 Jan 2025 18:21:33 +0800 (CST) Received: from localhost.localdomain (unknown [113.200.148.30]) by front1 (Coremail) with SMTP id qMiowMCxYMarrntnU18WAA--.32016S4; Mon, 06 Jan 2025 18:21:32 +0800 (CST) From: Hui Li To: gdb-patches@sourceware.org Cc: Tiezhu Yang Subject: [PATCH 2/4] gdb: LoongArch: Adjust loongarch_{get, remove}_debug_reg_state() Date: Mon, 6 Jan 2025 18:21:21 +0800 Message-Id: <20250106102123.5694-3-lihui@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20250106102123.5694-1-lihui@loongson.cn> References: <20250106102123.5694-1-lihui@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: qMiowMCxYMarrntnU18WAA--.32016S4 X-CM-SenderInfo: 5olk3xo6or00hjvr0hdfq/ X-Coremail-Antispam: 1Uk129KBj93XoWxXw4xuFyDJrWrKw1xWFWDWrX_yoW5KrW5pa 9xur1rGr4rJrs8t3s7A3yrXr9rGFZrWr42vFy3KryxCFWUAr1rXFn5KryDXFnxG34j9a1j qr17J3s09ayUA3cCm3ZEXasCq-sJn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUUkFb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r106r15M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Jr0_JF4l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Jr0_Gr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AK xVW8Jr0_Cr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6xACxx 1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1Y6r17McIj6I8E87Iv 67AKxVW8JVWxJwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41l42xK82IYc2 Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s02 6x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r1Y6r17MIIYrxkI7VAKI48JMIIF0x vE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r1j6r4UMIIF0xvE 42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6x kF7I0E14v26r1j6r4UYxBIdaVFxhVjvjDU0xZFpf9x07j5WrAUUUUU= X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, 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 loongarch_{get,remove}_debug_reg_state() are used as helper functions by loongarch_linux_nat_target. We should move their definitions from gdb/nat/loongarch-linux-hw-point.c to gdb/loongarch-linux-nat.c. Signed-off-by: Hui Li --- gdb/loongarch-linux-nat.c | 24 ++++++++++++++++++++++++ gdb/nat/loongarch-linux-hw-point.c | 25 ------------------------- gdb/nat/loongarch-linux-hw-point.h | 5 ----- 3 files changed, 24 insertions(+), 30 deletions(-) diff --git a/gdb/loongarch-linux-nat.c b/gdb/loongarch-linux-nat.c index fd3581bbd30..07359924b0e 100644 --- a/gdb/loongarch-linux-nat.c +++ b/gdb/loongarch-linux-nat.c @@ -32,6 +32,30 @@ #include +/* Hash table storing per-process data. We don't bind this to a + per-inferior registry because of targets like x86 GNU/Linux that + need to keep track of processes that aren't bound to any inferior + (e.g., fork children, checkpoints). */ + +static std::unordered_map +loongarch_debug_process_state; + +/* See nat/loongarch-linux-hw-point.h. */ + +struct loongarch_debug_reg_state * +loongarch_get_debug_reg_state (pid_t pid) +{ + return &loongarch_debug_process_state[pid]; +} + +/* Remove any existing per-process debug state for process PID. */ + +static void +loongarch_remove_debug_reg_state (pid_t pid) +{ + loongarch_debug_process_state.erase (pid); +} + /* LoongArch Linux native additions to the default Linux support. */ class loongarch_linux_nat_target final : public linux_nat_trad_target diff --git a/gdb/nat/loongarch-linux-hw-point.c b/gdb/nat/loongarch-linux-hw-point.c index 9c39cceb336..26a88ee56d5 100644 --- a/gdb/nat/loongarch-linux-hw-point.c +++ b/gdb/nat/loongarch-linux-hw-point.c @@ -36,14 +36,6 @@ #include "elf/common.h" -/* Hash table storing per-process data. We don't bind this to a - per-inferior registry because of targets like x86 GNU/Linux that - need to keep track of processes that aren't bound to any inferior - (e.g., fork children, checkpoints). */ - -static std::unordered_map -loongarch_debug_process_state; - /* See loongarch-linux-hw-point.h */ /* Helper for loongarch_notify_debug_reg_change. Records the @@ -219,20 +211,3 @@ loongarch_linux_get_debug_reg_capacity (int tid) loongarch_num_bp_regs = 0; } } - -/* Return the debug register state for process PID. If no existing - state is found for this process, create new state. */ - -struct loongarch_debug_reg_state * -loongarch_get_debug_reg_state (pid_t pid) -{ - return &loongarch_debug_process_state[pid]; -} - -/* Remove any existing per-process debug state for process PID. */ - -void -loongarch_remove_debug_reg_state (pid_t pid) -{ - loongarch_debug_process_state.erase (pid); -} diff --git a/gdb/nat/loongarch-linux-hw-point.h b/gdb/nat/loongarch-linux-hw-point.h index 161db9270ff..3efc9a7381f 100644 --- a/gdb/nat/loongarch-linux-hw-point.h +++ b/gdb/nat/loongarch-linux-hw-point.h @@ -113,9 +113,4 @@ void loongarch_linux_get_debug_reg_capacity (int tid); struct loongarch_debug_reg_state *loongarch_get_debug_reg_state (pid_t pid); -/* Remove any existing per-process debug state for process PID. */ - -void loongarch_remove_debug_reg_state (pid_t pid); - - #endif /* GDB_NAT_LOONGARCH_LINUX_HW_POINT_H */ From patchwork Mon Jan 6 10:21:22 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hui Li X-Patchwork-Id: 104154 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 A594A3858C32 for ; Mon, 6 Jan 2025 10:23:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A594A3858C32 X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by sourceware.org (Postfix) with ESMTP id 3EA273858D39 for ; Mon, 6 Jan 2025 10:21:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3EA273858D39 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=loongson.cn ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 3EA273858D39 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=114.242.206.163 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736158895; cv=none; b=JoTbEBpdcMOhVlrQzufbvMHYzJow0T8+mlVzQ15TgMjJTTl5QS3idTEc7zz3yc3wuS9K+2vdcHQ0fLHDF5fbq2TkWG+qQHu48YFoOp2zMQkk0z7abJ03vKL796fXIP1U7jVIkEuoAImKZ6oWT/KSgb5n+x0dc1KASBgffdra+5s= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736158895; c=relaxed/simple; bh=QcJx3QCTHe8ZyO2wlvY3gAE/wf8gFKhyblPjirHs1A4=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=R5AHqlz9VyGPNNykmdJwJFtu/hSsRiqAloqmGUwzmOG4yPvSkvcm4IwHXU9K867RernxRi3qKXzhkzLQBwDrKLLganJhmCA4r5cfrQ7sRHxKS8RrtzysmOvuRiV9iA45UKnHCclQCeVIKNKKUGlHOzLsUqynjxNE6oxUW2KZa74= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from loongson.cn (unknown [113.200.148.30]) by gateway (Coremail) with SMTP id _____8BxjaytrntnSppeAA--.654S3; Mon, 06 Jan 2025 18:21:33 +0800 (CST) Received: from localhost.localdomain (unknown [113.200.148.30]) by front1 (Coremail) with SMTP id qMiowMCxYMarrntnU18WAA--.32016S5; Mon, 06 Jan 2025 18:21:33 +0800 (CST) From: Hui Li To: gdb-patches@sourceware.org Cc: Tiezhu Yang Subject: [PATCH 3/4] gdb: LoongArch: Adjust loongarch_stopped_data_address() Date: Mon, 6 Jan 2025 18:21:22 +0800 Message-Id: <20250106102123.5694-4-lihui@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20250106102123.5694-1-lihui@loongson.cn> References: <20250106102123.5694-1-lihui@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: qMiowMCxYMarrntnU18WAA--.32016S5 X-CM-SenderInfo: 5olk3xo6or00hjvr0hdfq/ X-Coremail-Antispam: 1Uk129KBj93XoWxAryxAF4xJw13Zry3tFyUCFX_yoW5tr1rp3 9FvFyftrW8JrsrXr9rt398Wwnxuwn7ur12gFZxKrySkF4DXr15Zr4rK34Yq3WUu3s3XFy2 qr10ka4F9FW7ArbCm3ZEXasCq-sJn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUUkFb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_JFI_Gr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Jr0_Gr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AK xVW8Jr0_Cr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6xACxx 1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1Y6r17McIj6I8E87Iv 67AKxVW8JVWxJwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41l42xK82IYc2 Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s02 6x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r1Y6r17MIIYrxkI7VAKI48JMIIF0x vE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r1j6r4UMIIF0xvE 42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6x kF7I0E14v26r1j6r4UYxBIdaVFxhVjvjDU0xZFpf9x07jb_-PUUUUU= X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, 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 loongarch_stopped_data_address() is a common function and will be used by gdb and gdbserver, so move its definition from gdb/loongarch-linux-nat.c to gdb/nat/loongarch-hw-point.c. This is preparation for later gdbserver patch on LoongArch and is no effect for the current code. Signed-off-by: Hui Li --- gdb/loongarch-linux-nat.c | 27 --------------------------- gdb/nat/loongarch-hw-point.c | 24 ++++++++++++++++++++++++ gdb/nat/loongarch-hw-point.h | 8 ++++++++ 3 files changed, 32 insertions(+), 27 deletions(-) diff --git a/gdb/loongarch-linux-nat.c b/gdb/loongarch-linux-nat.c index 07359924b0e..bef88ca0632 100644 --- a/gdb/loongarch-linux-nat.c +++ b/gdb/loongarch-linux-nat.c @@ -470,33 +470,6 @@ fill_fpregset (const struct regcache *regcache, gdb_fpregset_t *fpregset, sizeof (gdb_fpregset_t)); } -/* Helper for the "stopped_data_address" target method. Returns TRUE - if a hardware watchpoint trap at ADDR_TRAP matches a set watchpoint. - The address of the matched watchpoint is returned in *ADDR_P. */ - -static bool -loongarch_stopped_data_address (const struct loongarch_debug_reg_state *state, - CORE_ADDR addr_trap, CORE_ADDR *addr_p) -{ - - int i; - - for (i = loongarch_num_wp_regs - 1; i >= 0; --i) - { - const CORE_ADDR addr_watch = state->dr_addr_wp[i]; - - if (state->dr_ref_count_wp[i] - && DR_CONTROL_ENABLED (state->dr_ctrl_wp[i]) - && addr_trap == addr_watch) - { - *addr_p = addr_watch; - return true; - } - } - return false; -} - - /* Returns the number of hardware watchpoints of type TYPE that we can set. Value is positive if we can set CNT watchpoints, zero if setting watchpoints of type TYPE is not supported, and negative if diff --git a/gdb/nat/loongarch-hw-point.c b/gdb/nat/loongarch-hw-point.c index cf5ddb68d78..7306d4c71c1 100644 --- a/gdb/nat/loongarch-hw-point.c +++ b/gdb/nat/loongarch-hw-point.c @@ -317,3 +317,27 @@ loongarch_region_ok_for_watchpoint (CORE_ADDR addr, int len) return 1; } + +/* See nat/loongarch-hw-point.h*/ + +bool +loongarch_stopped_data_address (const struct loongarch_debug_reg_state *state, + CORE_ADDR addr_trap, CORE_ADDR *addr_p) +{ + int i; + + for (i = loongarch_num_wp_regs - 1; i >= 0; --i) + { + const CORE_ADDR addr_watch = state->dr_addr_wp[i]; + + if (state->dr_ref_count_wp[i] + && DR_CONTROL_ENABLED (state->dr_ctrl_wp[i]) + && addr_trap == addr_watch) + { + *addr_p = addr_watch; + return true; + } + } + + return false; +} diff --git a/gdb/nat/loongarch-hw-point.h b/gdb/nat/loongarch-hw-point.h index 799df89b428..3098752043a 100644 --- a/gdb/nat/loongarch-hw-point.h +++ b/gdb/nat/loongarch-hw-point.h @@ -100,4 +100,12 @@ void loongarch_show_debug_reg_state (struct loongarch_debug_reg_state *state, int loongarch_region_ok_for_watchpoint (CORE_ADDR addr, int len); +/* Helper for the "stopped_data_address/low_stopped_data_address" target + method. Returns TRUE if a hardware watchpoint trap at ADDR_TRAP matches + a set watchpoint. The address of the matched watchpoint is returned in + *ADDR_P. */ + +bool loongarch_stopped_data_address (const struct loongarch_debug_reg_state *state, + CORE_ADDR addr_trap, CORE_ADDR *addr_p); + #endif /* GDB_NAT_LOONGARCH_HW_POINT_H */ From patchwork Mon Jan 6 10:21:23 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hui Li X-Patchwork-Id: 104153 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 29E153858402 for ; Mon, 6 Jan 2025 10:22:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 29E153858402 X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by sourceware.org (Postfix) with ESMTP id 82B4E3858CD1 for ; Mon, 6 Jan 2025 10:21:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 82B4E3858CD1 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=loongson.cn ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 82B4E3858CD1 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=114.242.206.163 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736158898; cv=none; b=x7nC66uQtps015GdNzLkFPb+9UrFefqydOapjADJVSed6Og90agUJK/MMxJAsrXNloouInNqHXsaZHIbjfNGIRxKqQSRnDHYaAMpFw7ZQIyRKGcOFK0su2zsmqQ6Ir9+VTtmj4ylJcy2gHHlmcoATUyvxSeULPwWHIkfRQnCTJI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736158898; c=relaxed/simple; bh=ZYb61j/dt6GjNOkxzJfXGhsJdJMNxRu9BjsrU577chE=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=jr0mKqgPyd8dGGPDa2S5xPoV+YAmjvVS3jn5eXCAymtrQ7wknv7j7kKUEz5E0Fd+H67jb3TXvS5vrKiHe5Q2WrY9PM3z3mGrPZoCcpm3XlQZcUirt655KYkzQEfhSBd9FSWvbkpETIl9IViBQoxCOQXOPuwy3eNawdi0SAQ4oOY= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from loongson.cn (unknown [113.200.148.30]) by gateway (Coremail) with SMTP id _____8BxuuCvrntnTZpeAA--.56525S3; Mon, 06 Jan 2025 18:21:35 +0800 (CST) Received: from localhost.localdomain (unknown [113.200.148.30]) by front1 (Coremail) with SMTP id qMiowMCxYMarrntnU18WAA--.32016S6; Mon, 06 Jan 2025 18:21:33 +0800 (CST) From: Hui Li To: gdb-patches@sourceware.org Cc: Tiezhu Yang Subject: [PATCH 4/4] gdbserver: LoongArch: Add hardware watchpoint/breakpoint support Date: Mon, 6 Jan 2025 18:21:23 +0800 Message-Id: <20250106102123.5694-5-lihui@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20250106102123.5694-1-lihui@loongson.cn> References: <20250106102123.5694-1-lihui@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: qMiowMCxYMarrntnU18WAA--.32016S6 X-CM-SenderInfo: 5olk3xo6or00hjvr0hdfq/ X-Coremail-Antispam: 1Uk129KBj93XoW3uFWkCryUGw45JFyrJw45XFc_yoWkGw4rpa 13uryrtr48J3ykGrZ3Jan8Ar98X39rurW7Ja43tFyfCa13JryrXrn5KryqvF45Ca4rGryY qFs0ya4j9a1UAFgCm3ZEXasCq-sJn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUUkFb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_JFI_Gr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Jr0_Gr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AK xVW8Jr0_Cr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6xACxx 1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r126r1DMcIj6I8E87Iv 67AKxVW8JVWxJwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41l42xK82IYc2 Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s02 6x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r1Y6r17MIIYrxkI7VAKI48JMIIF0x vE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r1j6r4UMIIF0xvE 42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6x kF7I0E14v26r1j6r4UYxBIdaVFxhVjvjDU0xZFpf9x07j1q2_UUUUU= X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_SHORT, SPF_HELO_NONE, SPF_PASS, 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 LoongArch defines hardware watchpoint functions for fetch and load/store operations, the related support for gdb was added in the following two commit c1cdee0e2c17 ("gdb: LoongArch: Add support for hardware watchpoint") commit 6ced1278fc00 ("gdb: LoongArch: Add support for hardware breakpoint") Now, add hardware watchpoint and breakpoint support for gdbserver on LoongArch. Here is a simple example $ cat test.c #include int a = 0; int b = 0; int main() { printf("start test\n"); a = 1; printf("a = %d\n", a); a = 2; printf("a = %d\n", a); b = 2; printf("b = %d\n", b); return 0; } $ gcc -g test.c -o test Execute on the target machine: $ gdbserver 192.168.1.100:1234 ./test Execute on the host machine: $ gdb ./test ... (gdb) target remote 192.168.1.100:1234 ... (gdb) b main Breakpoint 1 at 0x1200006b8: file test.c, line 6. (gdb) c Continuing. ... Breakpoint 1, main () at test.c:6 6 printf("start test\n"); (gdb) watch a Hardware watchpoint 2: a (gdb) hbreak 11 Hardware assisted breakpoint 3 at 0x120000700: file test.c, line 11. (gdb) c Continuing. Hardware watchpoint 2: a Old value = 0 New value = 1 main () at test.c:8 8 printf("a = %d\n", a); (gdb) c Continuing. Hardware watchpoint 2: a Old value = 1 New value = 2 main () at test.c:10 10 printf("a = %d\n", a); (gdb) c Continuing. Breakpoint 3, main () at test.c:11 11 b = 2; (gdb) c Continuing. [Inferior 1 (process 696656) exited normally] Output on the target machine: Process ./test created; pid = 696708 Listening on port 1234 Remote debugging from host 192.168.1.200, port 60742 start test a = 1 a = 2 b = 2 Child exited with status 0 Signed-off-by: Hui Li --- gdbserver/configure.srv | 3 + gdbserver/linux-loongarch-low.cc | 264 +++++++++++++++++++++++++++++++ 2 files changed, 267 insertions(+) diff --git a/gdbserver/configure.srv b/gdbserver/configure.srv index ffc84948317..e8dc8ef2dd2 100644 --- a/gdbserver/configure.srv +++ b/gdbserver/configure.srv @@ -142,6 +142,9 @@ case "${gdbserver_host}" in ;; loongarch*-*-linux*) srv_tgtobj="arch/loongarch.o linux-loongarch-low.o" srv_tgtobj="${srv_tgtobj} ${srv_linux_obj}" + srv_tgtobj="$srv_tgtobj nat/loongarch-hw-point.o" + srv_tgtobj="$srv_tgtobj nat/loongarch-linux.o" + srv_tgtobj="$srv_tgtobj nat/loongarch-linux-hw-point.o" srv_linux_regsets=yes srv_linux_usrregs=yes srv_linux_thread_db=yes diff --git a/gdbserver/linux-loongarch-low.cc b/gdbserver/linux-loongarch-low.cc index cf7d6c0743c..795b6f5b1c0 100644 --- a/gdbserver/linux-loongarch-low.cc +++ b/gdbserver/linux-loongarch-low.cc @@ -18,6 +18,9 @@ along with this program. If not, see . */ #include "linux-low.h" +#include "nat/loongarch-hw-point.h" +#include "nat/loongarch-linux.h" +#include "nat/loongarch-linux-hw-point.h" #include "tdesc.h" #include "elf/common.h" #include "arch/loongarch.h" @@ -34,6 +37,8 @@ public: const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override; + bool supports_z_point_type (char z_type) override; + protected: void low_arch_setup () override; @@ -51,6 +56,28 @@ protected: void low_set_pc (regcache *regcache, CORE_ADDR newpc) override; bool low_breakpoint_at (CORE_ADDR pc) override; + + int low_insert_point (raw_bkpt_type type, CORE_ADDR addr, + int size, raw_breakpoint *bp) override; + + int low_remove_point (raw_bkpt_type type, CORE_ADDR addr, + int size, raw_breakpoint *bp) override; + + bool low_stopped_by_watchpoint () override; + + CORE_ADDR low_stopped_data_address () override; + + arch_process_info *low_new_process () override; + + void low_delete_process (arch_process_info *info) override; + + void low_new_thread (lwp_info *) override; + + void low_delete_thread (arch_lwp_info *) override; + + void low_new_fork (process_info *parent, process_info *child) override; + + void low_prepare_to_resume (lwp_info *lwp) override; }; /* The singleton target ops object. */ @@ -71,6 +98,19 @@ loongarch_target::low_cannot_store_register (int regno) "is not implemented by the target"); } +void +loongarch_target::low_prepare_to_resume (lwp_info *lwp) +{ + loongarch_linux_prepare_to_resume (lwp); +} + +/* Per-process arch-specific data we want to keep. */ + +struct arch_process_info +{ + struct loongarch_debug_reg_state debug_reg_state; +}; + /* Implementation of linux target ops method "low_arch_setup". */ void @@ -89,6 +129,7 @@ loongarch_target::low_arch_setup () gdb_assert (!tdesc->expedite_regs.empty ()); } current_process ()->tdesc = tdesc.release (); + loongarch_linux_get_debug_reg_capacity (current_thread->id.lwp ()); } /* Collect GPRs from REGCACHE into BUF. */ @@ -381,6 +422,229 @@ loongarch_target::low_breakpoint_at (CORE_ADDR pc) return false; } +static void +loongarch_init_debug_reg_state (struct loongarch_debug_reg_state *state) +{ + int i; + + for (i = 0; i < LOONGARCH_HBP_MAX_NUM; ++i) + { + state->dr_addr_bp[i] = 0; + state->dr_ctrl_bp[i] = 0; + state->dr_ref_count_bp[i] = 0; + } + + for (i = 0; i < LOONGARCH_HWP_MAX_NUM; ++i) + { + state->dr_addr_wp[i] = 0; + state->dr_ctrl_wp[i] = 0; + state->dr_ref_count_wp[i] = 0; + } +} + +/* See nat/loongarch-linux-hw-point.h. */ + +struct loongarch_debug_reg_state * +loongarch_get_debug_reg_state (pid_t pid) +{ + struct process_info *proc = find_process_pid (pid); + + return &proc->priv->arch_private->debug_reg_state; +} + +/* Implementation of target ops method "supports_z_point_type". */ + +bool +loongarch_target::supports_z_point_type (char z_type) +{ + switch (z_type) + { + case Z_PACKET_SW_BP: + case Z_PACKET_HW_BP: + case Z_PACKET_WRITE_WP: + case Z_PACKET_READ_WP: + case Z_PACKET_ACCESS_WP: + return true; + default: + return false; + } +} + +/* Implementation of linux target ops method "low_insert_point". + + It actually only records the info of the to-be-inserted bp/wp; + the actual insertion will happen when threads are resumed. */ + +int +loongarch_target::low_insert_point (raw_bkpt_type type, CORE_ADDR addr, + int len, raw_breakpoint *bp) +{ + int ret; + enum target_hw_bp_type targ_type; + struct loongarch_debug_reg_state *state + = loongarch_get_debug_reg_state (current_thread->id.pid ()); + + if (show_debug_regs) + fprintf (stderr, "insert_point on entry (addr=0x%08lx, len=%d)\n", + (unsigned long) addr, len); + + /* Determine the type from the raw breakpoint type. */ + targ_type = raw_bkpt_type_to_target_hw_bp_type (type); + + if (targ_type != hw_execute) + { + if (loongarch_region_ok_for_watchpoint (addr, len)) + ret = loongarch_handle_watchpoint (targ_type, addr, len, + 1 /* is_insert */, + current_lwp_ptid (), state); + else + ret = -1; + } + else + { + ret = loongarch_handle_breakpoint (targ_type, addr, len, + 1 /* is_insert */, current_lwp_ptid (), + state); + } + + if (show_debug_regs) + loongarch_show_debug_reg_state (state, "insert_point", addr, len, + targ_type); + + return ret; +} + +/* Implementation of linux target ops method "low_remove_point". + + It actually only records the info of the to-be-removed bp/wp, + the actual removal will be done when threads are resumed. */ + +int +loongarch_target::low_remove_point (raw_bkpt_type type, CORE_ADDR addr, + int len, raw_breakpoint *bp) +{ + int ret; + enum target_hw_bp_type targ_type; + struct loongarch_debug_reg_state *state + = loongarch_get_debug_reg_state (current_thread->id.pid ()); + + if (show_debug_regs) + fprintf (stderr, "remove_point on entry (addr=0x%08lx, len=%d)\n", + (unsigned long) addr, len); + + /* Determine the type from the raw breakpoint type. */ + targ_type = raw_bkpt_type_to_target_hw_bp_type (type); + + /* Set up state pointers. */ + if (targ_type != hw_execute) + ret = + loongarch_handle_watchpoint (targ_type, addr, len, 0 /* is_insert */, + current_lwp_ptid (), state); + else + { + ret = loongarch_handle_breakpoint (targ_type, addr, len, + 0 /* is_insert */, current_lwp_ptid (), + state); + } + + if (show_debug_regs) + loongarch_show_debug_reg_state (state, "remove_point", addr, len, + targ_type); + + return ret; +} + + +/* Implementation of linux target ops method "low_stopped_data_address". */ + +CORE_ADDR +loongarch_target::low_stopped_data_address () +{ + siginfo_t siginfo; + struct loongarch_debug_reg_state *state; + int pid = current_thread->id.lwp (); + + /* Get the siginfo. */ + if (ptrace (PTRACE_GETSIGINFO, pid, NULL, &siginfo) != 0) + return (CORE_ADDR) 0; + + /* Need to be a hardware breakpoint/watchpoint trap. */ + if (siginfo.si_signo != SIGTRAP + || (siginfo.si_code & 0xffff) != 0x0004 /* TRAP_HWBKPT */) + return (CORE_ADDR) 0; + + /* Check if the address matches any watched address. */ + state = loongarch_get_debug_reg_state (current_thread->id.pid ()); + CORE_ADDR result; + if (loongarch_stopped_data_address (state, (CORE_ADDR) siginfo.si_addr, &result)) + return result; + + return (CORE_ADDR) 0; +} + +/* Implementation of linux target ops method "low_stopped_by_watchpoint". */ + +bool +loongarch_target::low_stopped_by_watchpoint () +{ + return (low_stopped_data_address () != 0); +} + +/* Implementation of linux target ops method "low_new_process". */ + +arch_process_info * +loongarch_target::low_new_process () +{ + struct arch_process_info *info = XCNEW (struct arch_process_info); + + loongarch_init_debug_reg_state (&info->debug_reg_state); + + return info; +} + +/* Implementation of linux target ops method "low_delete_process". */ + +void +loongarch_target::low_delete_process (arch_process_info *info) +{ + xfree (info); +} + +void +loongarch_target::low_new_thread (lwp_info *lwp) +{ + loongarch_linux_new_thread (lwp); +} + +void +loongarch_target::low_delete_thread (arch_lwp_info *arch_lwp) +{ + loongarch_linux_delete_thread (arch_lwp); +} + +/* Implementation of linux target ops method "low_new_fork". */ + +void +loongarch_target::low_new_fork (process_info *parent, + process_info *child) +{ + /* These are allocated by linux_add_process. */ + gdb_assert (parent->priv != NULL + && parent->priv->arch_private != NULL); + gdb_assert (child->priv != NULL + && child->priv->arch_private != NULL); + + /* GDB core assumes the child inherits the watchpoints/hw + breakpoints of the parent, and will remove them all from the + forked off process. Copy the debug registers mirrors into the + new process so that all breakpoints and watchpoints can be + removed together. The debug registers mirror will become zeroed + in the end before detaching the forked off process, thus making + this compatible with older Linux kernels too. */ + + *child->priv->arch_private = *parent->priv->arch_private; +} + /* The linux target ops object. */ linux_process_target *the_linux_target = &the_loongarch_target;