From nobody Mon Feb 9 09:16:33 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1749498003; cv=none; d=zohomail.com; s=zohoarc; b=jwTBc3A8MQDTaKZxEGxWdssu1jbMxwyYmtbPlPq9GL/2W44a06lzMzBft8Oc7HJPc9qFWbyiwc/a219H9QJ6lbVDRkI3Ra4wnffe2wFa05k699Uwv78QJR7x8apIeuYFL1tq41AUGYQjoR915jbDZsg8sbrD/IFdlDbW0jA9o3c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1749498003; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=1ysiNB3jN3pm4xSzw9lWbP2QG1HmR4QbzZmy+B07iUo=; b=JrEvSqhO/0Ufspqk+pLT3eVmCN3/miRx1Bv4hk1msja33blCEI+m0AvzOCG0M04LIpLqhYoXS0BmBd53uJvciYWCiW8KVD7WhokKPZjZ18/6EZ6fMFATbR+7bawK1suFORSkt7UsMLTJN9PnZw/X/F8+C8kJA3kG2szpDFA7TVM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1749498003306337.540681327524; Mon, 9 Jun 2025 12:40:03 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uOiKZ-0007Do-81; Mon, 09 Jun 2025 15:38:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uOiKU-0007CA-RE for qemu-devel@nongnu.org; Mon, 09 Jun 2025 15:38:46 -0400 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uOiKT-0004Cx-6y for qemu-devel@nongnu.org; Mon, 09 Jun 2025 15:38:46 -0400 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-742caef5896so3874608b3a.3 for ; Mon, 09 Jun 2025 12:38:44 -0700 (PDT) Received: from shemhazi.lan ([50.46.174.34]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7482b083b03sm6095725b3a.83.2025.06.09.12.38.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Jun 2025 12:38:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1749497923; x=1750102723; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=1ysiNB3jN3pm4xSzw9lWbP2QG1HmR4QbzZmy+B07iUo=; b=dnOI/VgJHQsi/iDeTvZlhtR8ZUE7ry/+2W+tHaqDHk4aDYVWwbT+wDajqJoWt7MkQe 7f3ZVWVsSRr7cT75Fnig0krIfHR6RriiClBgWsmpxBsStZnfV8VsBYH2MjQOD/15Qwpw KYTeHgMZVo7UEci64iSMpE9/JLXRgn0ztqmiM/ru+6fu/T7cXoiAOLgKyt0X1wfhMkVL VbKmNrSRcWIhmxs3uHBER5OFO8Yh9AjZMgDqna1S/3aUk2k1mGz+oydtNf3rTMUL9tvW lzn0tyEyJrJyufPlXq6xJFxpJvDUckSb7akJAXwppruypmwGluADkqgDQAdMQPFKYWnJ VVbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749497923; x=1750102723; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1ysiNB3jN3pm4xSzw9lWbP2QG1HmR4QbzZmy+B07iUo=; b=Ea1nQgMbQaert4cvgj1BLEa0IlVv08Ox8SKOZ4RfqEa8fnvk5ogT0BKHMjBOtH+QW9 zfepQQaZscMrizgDTYhEwaMEMZ0TKecA7SFRFPgEBnOJNUaYF6+5lmix6xoi9ka3d15y cni4yJpVQByeWAgEuhIBZulFwYDAA3Lw5jZ4HhLB3AR4SJt1+26IuAg3p025kF5z8cRZ 3otxZHM7aW+nojyymJ9C+CIMjBp7vVbJnI2n0eq3gf88h8vDxikXkN3OaXLU6v9+Z/eJ CnUaDvdJJlSV3YB6c80H7jAQ56lg4r0a7oZkmQhyGpY6kxSpNTlfXTTwpcD5v8NR7EqK 1TbQ== X-Gm-Message-State: AOJu0YxNwSbawRRU8DfDCsjJKgUykG6tePaklC97jxz8hpWcAJTOX4VL b0nkHkGBQ4HORntQqVjb1sBIz566S/aOwz9icDreythA1VVI5Y81/77CEtS4URNJ X-Gm-Gg: ASbGncuPZLooh7eE1DGndCL4MN4P6mUaEIZago+1N6xqKzAkqa1LqzPddf0mqiHPSQD 4naeytFCBbKllNN6hny7rne/WfYUIaZoi2JMEnFQySRNfInR+ag1By1T7p0FI3MUD/+C+43xZuQ hqUYgKbreC8W3oTV4BpeG57G0vgnS6S3oIfe0V3UdNrIxKqmi8BnbysCctvsV4pzUjiK7K34384 lO0LEJ5Vz1YiLGDEIhG7g5sBfYyKt+78XSMdEhzXmmWpzdNbKvYYDumCedSTgAfUeKjI0GxhoH7 DDFyaHa9KgZHkXIr3ULwMR6ZhYQNmeA9Ej4LgyUEQA8oDbTbn1k= X-Google-Smtp-Source: AGHT+IEu2vviCFSVWJZumGKQPmcucedY4J0g/Tj0dxm9S+iDdYQnSQEyZDo9yg4l/GXVT4Pz4nmshg== X-Received: by 2002:a05:6a00:1991:b0:748:31ed:ba8a with SMTP id d2e1a72fcca58-74831edbda7mr14787060b3a.15.1749497923096; Mon, 09 Jun 2025 12:38:43 -0700 (PDT) From: Rowan Hart To: qemu-devel@nongnu.org Cc: Zhao Liu , Eduardo Habkost , Pierrick Bouvier , Richard Henderson , Mahmoud Mandour , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Marcel Apfelbaum , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yanan Wang , Alexandre Iooss , novafacing , Julian Ganz Subject: [PATCH v11 1/8] gdbstub: Expose gdb_write_register function to consumers of gdbstub Date: Mon, 9 Jun 2025 12:38:34 -0700 Message-ID: <20250609193841.348076-2-rowanbhart@gmail.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250609193841.348076-1-rowanbhart@gmail.com> References: <20250609193841.348076-1-rowanbhart@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=2607:f8b0:4864:20::432; envelope-from=rowanbhart@gmail.com; helo=mail-pf1-x432.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1749498005747116600 From: novafacing This patch exposes the gdb_write_register function from gdbstub/gdbstub.c via the exec/gdbstub.h header file to support use in plugins to write register contents. Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Julian Ganz Reviewed-by: Pierrick Bouvier Signed-off-by: Rowan Hart --- gdbstub/gdbstub.c | 2 +- include/exec/gdbstub.h | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index 565f6b33a9..5846e481be 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -534,7 +534,7 @@ int gdb_read_register(CPUState *cpu, GByteArray *buf, i= nt reg) return 0; } =20 -static int gdb_write_register(CPUState *cpu, uint8_t *mem_buf, int reg) +int gdb_write_register(CPUState *cpu, uint8_t *mem_buf, int reg) { GDBRegisterState *r; =20 diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h index 0675b0b646..a16c0051ce 100644 --- a/include/exec/gdbstub.h +++ b/include/exec/gdbstub.h @@ -124,6 +124,20 @@ const GDBFeature *gdb_find_static_feature(const char *= xmlname); */ int gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); =20 +/** + * gdb_write_register() - Write a register associated with a CPU. + * @cpu: The CPU associated with the register. + * @buf: The buffer that the register contents will be set to. + * @reg: The register's number returned by gdb_find_feature_register(). + * + * The size of @buf must be at least the size of the register being + * written. + * + * Return: The number of written bytes, or 0 if an error occurred (for + * example, an unknown register was provided). + */ +int gdb_write_register(CPUState *cpu, uint8_t *mem_buf, int reg); + /** * typedef GDBRegDesc - a register description from gdbstub */ --=20 2.49.0