From patchwork Mon Jun 24 10:18:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 807007 Delivered-To: patch@linaro.org Received: by 2002:a5d:508d:0:b0:362:4979:7f74 with SMTP id a13csp1810805wrt; Mon, 24 Jun 2024 03:19:35 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXVm6QwzEpxBsxO2ddgSLfQzV76xM46gGli6/3eWabGfG4FLoREHYxW+ciOBS+8TvjTy+oR0UWdihgAGgltpJT9 X-Google-Smtp-Source: AGHT+IHtvKaxu3uojyv+vSYdiCEIsv5sCXShnodA/SH8CCwmTVkhsaEsatzEkRsWpsY/LBapSGA+ X-Received: by 2002:a0d:eb84:0:b0:618:8f69:df36 with SMTP id 00721157ae682-64299f714e0mr45812877b3.23.1719224375232; Mon, 24 Jun 2024 03:19:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719224375; cv=none; d=google.com; s=arc-20160816; b=pWtS3igb1b+6n0kNTZHPl+J0TVVIAZgzPpyaHhz4KskCo6y53iDSjRkBOe54EepW7o uyYMeVND0L8KMfgXdvM1F0uDxL8FvVP/daSu4kfautF1XHX2rXHA6t23yWtYFWAfBNvU 1G1jb0n0QYQhDa+VBH3p0TKVTmbB0BV1La43B+poBizQFeuYxZEc3TG4g8lCE8FG1okg THfzmnJ6XRMd0QW04ZZ8zdU4D5kpWEAEdCqia2ZRdTQH59HtGQE0nZoDyqSue5VvtVeQ DIO/u+rejIuoFqsPm0K6Yp6p7AZDcTdoOdBHwXdb6cIR/DEkO2IgJa2YlT2Aq++Pen4r HOpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=YNgw6jE6+Mh361eYuvFy3mgdndxGrJV55+5IHn+HTVw=; fh=SY2DQx+xSnqXtCjByakJQh5tsaz59bAYZ7lIdggTpAo=; b=MQtrz1/HER1dvIoeMSsAeB9BI7f3r7UeHplhtomensEfFSoZu8H4VlL2n+5fAF3yo5 3f2eWsT8qOXYZ6V77ktkXGL+hKFAQOqbiLfy+cqy4db8nmt04VLdd5JbGS9vBB3PLrsa fF8PLgYELPNtkazdKqz2SRdqrjYDVf7NovzzghlgGUM3McgW2apXkAAbZZDpCs8za+hn zotTEIXqA5Y7X6LUZVF8ZIdErplZDQ2DlIk/yeu6Ft70mOylmHG0eV/LZNTLkJJrKeb/ CYO4sP/3BUpgZc6FSj8AxNnlhKifHUEa5+FslfX/91EJmTA+mx6Qk3Ai6hY4rMsPD9OH osJA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hX2+LeUY; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-79bce94151esi800989585a.562.2024.06.24.03.19.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Jun 2024 03:19:35 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hX2+LeUY; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sLgme-0006nB-PR; Mon, 24 Jun 2024 06:18:48 -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 1sLgmc-0006l9-E6 for qemu-devel@nongnu.org; Mon, 24 Jun 2024 06:18:46 -0400 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sLgmW-0007eU-FS for qemu-devel@nongnu.org; Mon, 24 Jun 2024 06:18:46 -0400 Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-57d044aa5beso4565754a12.2 for ; Mon, 24 Jun 2024 03:18:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719224319; x=1719829119; 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=YNgw6jE6+Mh361eYuvFy3mgdndxGrJV55+5IHn+HTVw=; b=hX2+LeUYjg4qRFPw1UC35uPuwEYTppX+E3r8KNJ8nhfH+e6jTApl8tM93VMeRo74it /Dhf+nrxQYeQk+o+i2IuUTcbLFSIijwyKrwE6pko/dlqOihkVtZixXGuVys0uvZ8Ac4z hsst67OEEtSky6gxSG6JaHvDlxEboa5JOFT8HJ7hydPWfSmxcsmsi0M3w0W4u/lfAXx7 iLa8KnbtCSgbUV1RahDzbBBYJq4K0RQVUBWIY7Bj2za4ONEZG+CrMwqI5KS96Dtjnec9 +JtdjS5OBNAEjA1ielc4kS9rvFEBRg/gdrbJzt+Gk91Ppy8Yj/z/wcULMgPjhJ6OC/FA fn4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719224319; x=1719829119; 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=YNgw6jE6+Mh361eYuvFy3mgdndxGrJV55+5IHn+HTVw=; b=hcD3TEBtTeOawtfziJU0Ffb9VK7cclXIwnj+Sfuv3LzZzkEV3NVjcnV/cifkJeYAfq qxcBHoGGDaNpyEVwqv5djUWT6MvZzGJKBxqk+JsQmuszfO9HgsnipfSccdr80xaDh/1j TxrPQfvhFYs195ZaN5iT0Ie+7oLjTUTB8lP16mmMNhMlBKBA/vPhaPP3jKtBWve6T5C7 iR06AFwzpxa40QTmT0EwjCeTTgjrIO8AxKvZHN5Bs7Vkf1+MI+HTF7MSmvVkjoglMBk8 sk4OA+G8GaVvkNxFB76ABWWvCII6+ufBJNiHfdw1pQbnOYVZF3Jy+0ajPM8Pkd8EHhi8 Stzw== X-Gm-Message-State: AOJu0Yy1lOTCfz9SvfNeCcB6ij3echHqFicQgOa6kYaer3h/0ThQwvjX x8hssZ9+CZ5/37jz0mUKRKjyMGZLreeYIL5Ow8KPEPYUSc8cTVyom5xwJuMXuKI= X-Received: by 2002:a50:d79b:0:b0:57c:dbf6:931f with SMTP id 4fb4d7f45d1cf-57d4bd56bc0mr2499112a12.5.1719224318334; Mon, 24 Jun 2024 03:18:38 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-57d30563440sm4509938a12.84.2024.06.24.03.18.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jun 2024 03:18:37 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 840DD5FA0D; Mon, 24 Jun 2024 11:18:36 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Pierrick Bouvier , Richard Henderson , Cameron Esfahani , Roman Bolshakov , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Dr. David Alan Gilbert" , Alexander Graf , Peter Maydell , Marcelo Tosatti , Nicholas Piggin , Daniel Henrique Barboza , Halil Pasic , Christian Borntraeger , Thomas Huth , David Hildenbrand , Ilya Leoshkevich , kvm@vger.kernel.org (open list:Overall KVM CPUs), qemu-arm@nongnu.org (open list:ARM TCG CPUs), qemu-ppc@nongnu.org (open list:PowerPC TCG CPUs), qemu-s390x@nongnu.org (open list:S390 KVM CPUs) Subject: [PULL 02/12] gdbstub: move enums into separate header Date: Mon, 24 Jun 2024 11:18:26 +0100 Message-Id: <20240624101836.193761-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240624101836.193761-1-alex.bennee@linaro.org> References: <20240624101836.193761-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::534; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x534.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org This is an experiment to further reduce the amount we throw into the exec headers. It might not be as useful as I initially thought because just under half of the users also need gdbserver_start(). Reviewed-by: Pierrick Bouvier Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson Message-Id: <20240620152220.2192768-3-alex.bennee@linaro.org> diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h index 008a92198a..1bd2c4ec2a 100644 --- a/include/exec/gdbstub.h +++ b/include/exec/gdbstub.h @@ -1,15 +1,6 @@ #ifndef GDBSTUB_H #define GDBSTUB_H -#define DEFAULT_GDBSTUB_PORT "1234" - -/* GDB breakpoint/watchpoint types */ -#define GDB_BREAKPOINT_SW 0 -#define GDB_BREAKPOINT_HW 1 -#define GDB_WATCHPOINT_WRITE 2 -#define GDB_WATCHPOINT_READ 3 -#define GDB_WATCHPOINT_ACCESS 4 - typedef struct GDBFeature { const char *xmlname; const char *xml; diff --git a/include/gdbstub/enums.h b/include/gdbstub/enums.h new file mode 100644 index 0000000000..c4d54a1d08 --- /dev/null +++ b/include/gdbstub/enums.h @@ -0,0 +1,21 @@ +/* + * gdbstub enums + * + * Copyright (c) 2024 Linaro Ltd + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef GDBSTUB_ENUMS_H +#define GDBSTUB_ENUMS_H + +#define DEFAULT_GDBSTUB_PORT "1234" + +/* GDB breakpoint/watchpoint types */ +#define GDB_BREAKPOINT_SW 0 +#define GDB_BREAKPOINT_HW 1 +#define GDB_WATCHPOINT_WRITE 2 +#define GDB_WATCHPOINT_READ 3 +#define GDB_WATCHPOINT_ACCESS 4 + +#endif /* GDBSTUB_ENUMS_H */ diff --git a/accel/hvf/hvf-accel-ops.c b/accel/hvf/hvf-accel-ops.c index b2a37a2229..ac08cfb9f3 100644 --- a/accel/hvf/hvf-accel-ops.c +++ b/accel/hvf/hvf-accel-ops.c @@ -52,7 +52,7 @@ #include "qemu/main-loop.h" #include "exec/address-spaces.h" #include "exec/exec-all.h" -#include "exec/gdbstub.h" +#include "gdbstub/enums.h" #include "sysemu/cpus.h" #include "sysemu/hvf.h" #include "sysemu/hvf_int.h" diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 854cb86b22..2b4ab89679 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -27,7 +27,7 @@ #include "hw/pci/msi.h" #include "hw/pci/msix.h" #include "hw/s390x/adapter.h" -#include "exec/gdbstub.h" +#include "gdbstub/enums.h" #include "sysemu/kvm_int.h" #include "sysemu/runstate.h" #include "sysemu/cpus.h" diff --git a/accel/tcg/tcg-accel-ops.c b/accel/tcg/tcg-accel-ops.c index 1433e38f40..3c19e68a79 100644 --- a/accel/tcg/tcg-accel-ops.c +++ b/accel/tcg/tcg-accel-ops.c @@ -35,7 +35,7 @@ #include "exec/exec-all.h" #include "exec/hwaddr.h" #include "exec/tb-flush.h" -#include "exec/gdbstub.h" +#include "gdbstub/enums.h" #include "hw/core/cpu.h" diff --git a/gdbstub/user.c b/gdbstub/user.c index edeb72efeb..e34b58b407 100644 --- a/gdbstub/user.c +++ b/gdbstub/user.c @@ -18,6 +18,7 @@ #include "exec/gdbstub.h" #include "gdbstub/syscalls.h" #include "gdbstub/user.h" +#include "gdbstub/enums.h" #include "hw/core/cpu.h" #include "trace.h" #include "internals.h" diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c index 45ee3a9e1f..f601d06ab8 100644 --- a/monitor/hmp-cmds.c +++ b/monitor/hmp-cmds.c @@ -15,8 +15,9 @@ #include "qemu/osdep.h" #include "exec/address-spaces.h" -#include "exec/gdbstub.h" #include "exec/ioport.h" +#include "exec/gdbstub.h" +#include "gdbstub/enums.h" #include "monitor/hmp.h" #include "qemu/help_option.h" #include "monitor/monitor-internal.h" diff --git a/system/vl.c b/system/vl.c index a3eede5fa5..cfcb674425 100644 --- a/system/vl.c +++ b/system/vl.c @@ -68,6 +68,7 @@ #include "sysemu/numa.h" #include "sysemu/hostmem.h" #include "exec/gdbstub.h" +#include "gdbstub/enums.h" #include "qemu/timer.h" #include "chardev/char.h" #include "qemu/bitmap.h" diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c index 45e2218be5..ef9bc42738 100644 --- a/target/arm/hvf/hvf.c +++ b/target/arm/hvf/hvf.c @@ -33,7 +33,7 @@ #include "trace/trace-target_arm_hvf.h" #include "migration/vmstate.h" -#include "exec/gdbstub.h" +#include "gdbstub/enums.h" #define MDSCR_EL1_SS_SHIFT 0 #define MDSCR_EL1_MDE_SHIFT 15 diff --git a/target/arm/hyp_gdbstub.c b/target/arm/hyp_gdbstub.c index ebde2899cd..f120d55caa 100644 --- a/target/arm/hyp_gdbstub.c +++ b/target/arm/hyp_gdbstub.c @@ -12,7 +12,7 @@ #include "qemu/osdep.h" #include "cpu.h" #include "internals.h" -#include "exec/gdbstub.h" +#include "gdbstub/enums.h" /* Maximum and current break/watch point counts */ int max_hw_bps, max_hw_wps; diff --git a/target/arm/kvm.c b/target/arm/kvm.c index 7cf5cf31de..70f79eda33 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -31,7 +31,7 @@ #include "hw/pci/pci.h" #include "exec/memattrs.h" #include "exec/address-spaces.h" -#include "exec/gdbstub.h" +#include "gdbstub/enums.h" #include "hw/boards.h" #include "hw/irq.h" #include "qapi/visitor.h" diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index 7ad8072748..dd8b0f3313 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -38,7 +38,7 @@ #include "hyperv.h" #include "hyperv-proto.h" -#include "exec/gdbstub.h" +#include "gdbstub/enums.h" #include "qemu/host-utils.h" #include "qemu/main-loop.h" #include "qemu/ratelimit.h" diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c index 005f2239f3..2c3932200b 100644 --- a/target/ppc/kvm.c +++ b/target/ppc/kvm.c @@ -39,7 +39,7 @@ #include "migration/qemu-file-types.h" #include "sysemu/watchdog.h" #include "trace.h" -#include "exec/gdbstub.h" +#include "gdbstub/enums.h" #include "exec/memattrs.h" #include "exec/ram_addr.h" #include "sysemu/hostmem.h" diff --git a/target/s390x/kvm/kvm.c b/target/s390x/kvm/kvm.c index 1b494ecc20..94181d9281 100644 --- a/target/s390x/kvm/kvm.c +++ b/target/s390x/kvm/kvm.c @@ -40,7 +40,7 @@ #include "sysemu/hw_accel.h" #include "sysemu/runstate.h" #include "sysemu/device_tree.h" -#include "exec/gdbstub.h" +#include "gdbstub/enums.h" #include "exec/ram_addr.h" #include "trace.h" #include "hw/s390x/s390-pci-inst.h"