From nobody Thu Nov 13 22:04:22 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail header.i=@quicinc.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=quicinc.com ARC-Seal: i=1; a=rsa-sha256; t=1582910176; cv=none; d=zohomail.com; s=zohoarc; b=epDeGr/YvrVAV1PN5EuW3Bq/tq3yW6Vah3Oynlu1Sw88vv8AUkPu0RxZusSufI6pDLnyb4N38UUQiVtVvdgpjhhI3ZSs+vkUvdYroXVZlFOc5ur7vI11IfWOz54IA72v5nYT7cl7iuIt0xgl5zPF4UzFWa865n2pyLtkK/ugkAY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582910176; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=f1wurEAOGurKqRzrZ3zioPMbTJWRw9gHRkOaVFN0r5c=; b=XQSrZPNBU1f1z3ASDw2tlcw6fQWDJm5FZiqxl+n3KSaHnRF+XChapB7WfRXn9C/YskEZ5Sphr65dkNsQihoMG1Klr7X2OmhQdeO9fSrvqKxfCXJdaghMrkEVh28igVoyWhZqdTv6HlGlHQrEhxskKTsWdKUQBS4DuJev7pB0Fzg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail header.i=@quicinc.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1582910176847289.8201251319788; Fri, 28 Feb 2020 09:16:16 -0800 (PST) Received: from localhost ([::1]:51114 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7jFH-0002mK-He for importer@patchew.org; Fri, 28 Feb 2020 12:16:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57640) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7ikb-0002mK-Ek for qemu-devel@nongnu.org; Fri, 28 Feb 2020 11:44:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j7ikZ-0005W3-Ms for qemu-devel@nongnu.org; Fri, 28 Feb 2020 11:44:33 -0500 Received: from alexa-out-sd-02.qualcomm.com ([199.106.114.39]:27049) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j7ikZ-0005V5-Dt for qemu-devel@nongnu.org; Fri, 28 Feb 2020 11:44:31 -0500 Received: from unknown (HELO ironmsg04-sd.qualcomm.com) ([10.53.140.144]) by alexa-out-sd-02.qualcomm.com with ESMTP; 28 Feb 2020 08:44:28 -0800 Received: from vu-tsimpson-aus.qualcomm.com (HELO vu-tsimpson1-aus.qualcomm.com) ([10.222.150.1]) by ironmsg04-sd.qualcomm.com with ESMTP; 28 Feb 2020 08:44:27 -0800 Received: by vu-tsimpson1-aus.qualcomm.com (Postfix, from userid 47164) id 9C8A7F0B; Fri, 28 Feb 2020 10:44:27 -0600 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1582908271; x=1614444271; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=f1wurEAOGurKqRzrZ3zioPMbTJWRw9gHRkOaVFN0r5c=; b=yQOZ5i5UQTSstF5VRaSQtTEUbfZaLCTJuvAJD9WqrvfC2qk+AnedlG7M S1nZNTu0PSk+tM8btxoE4iaB6G6+f8J1eR0pIHeXScI2QexE4bjN9atFp Pxrd1LCkD4FUbeUaKCxdtiOlI6LUV4kncSkc5NdWN/MuX8WVEKyeT5FRo s=; From: Taylor Simpson To: qemu-devel@nongnu.org Subject: [RFC PATCH v2 08/67] Hexagon GDB Stub Date: Fri, 28 Feb 2020 10:43:04 -0600 Message-Id: <1582908244-304-9-git-send-email-tsimpson@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1582908244-304-1-git-send-email-tsimpson@quicinc.com> References: <1582908244-304-1-git-send-email-tsimpson@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 199.106.114.39 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: riku.voipio@iki.fi, richard.henderson@linaro.org, laurent@vivier.eu, Taylor Simpson , philmd@redhat.com, aleksandar.m.mail@gmail.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) GDB register read and write routines Signed-off-by: Taylor Simpson --- target/hexagon/cpu.c | 3 +++ target/hexagon/gdbstub.c | 49 ++++++++++++++++++++++++++++++++++++++++++++= ++++ 2 files changed, 52 insertions(+) create mode 100644 target/hexagon/gdbstub.c diff --git a/target/hexagon/cpu.c b/target/hexagon/cpu.c index 98d6bdc..576c566 100644 --- a/target/hexagon/cpu.c +++ b/target/hexagon/cpu.c @@ -288,6 +288,9 @@ static void hexagon_cpu_class_init(ObjectClass *c, void= *data) cc->dump_state =3D hexagon_dump_state; cc->set_pc =3D hexagon_cpu_set_pc; cc->synchronize_from_tb =3D hexagon_cpu_synchronize_from_tb; + cc->gdb_core_xml_file =3D "hexagon-core.xml"; + cc->gdb_read_register =3D hexagon_gdb_read_register; + cc->gdb_write_register =3D hexagon_gdb_write_register; cc->gdb_num_core_regs =3D TOTAL_PER_THREAD_REGS; cc->gdb_stop_before_watchpoint =3D true; cc->disas_set_info =3D hexagon_cpu_disas_set_info; diff --git a/target/hexagon/gdbstub.c b/target/hexagon/gdbstub.c new file mode 100644 index 0000000..e678aea --- /dev/null +++ b/target/hexagon/gdbstub.c @@ -0,0 +1,49 @@ +/* + * Copyright(c) 2019-2020 Qualcomm Innovation Center, Inc. All Rights Res= erved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ + +#include "qemu/osdep.h" +#include "qemu-common.h" +#include "exec/gdbstub.h" +#include "cpu.h" +#include "internal.h" + +int hexagon_gdb_read_register(CPUState *cs, uint8_t *mem_buf, int n) +{ + HexagonCPU *cpu =3D HEXAGON_CPU(cs); + CPUHexagonState *env =3D &cpu->env; + + if (n < TOTAL_PER_THREAD_REGS) { + return gdb_get_regl(mem_buf, env->gpr[n]); + } + + g_assert_not_reached(); + return 0; +} + +int hexagon_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n) +{ + HexagonCPU *cpu =3D HEXAGON_CPU(cs); + CPUHexagonState *env =3D &cpu->env; + + if (n < TOTAL_PER_THREAD_REGS) { + env->gpr[n] =3D ldtul_p(mem_buf); + return sizeof(target_ulong); + } + + g_assert_not_reached(); + return 0; +} --=20 2.7.4