From nobody Mon Feb 9 14:02:12 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1770401147; cv=none; d=zohomail.com; s=zohoarc; b=fa1d9J6f969OLYEVb7bvEZiFEHzFIkd1MktdsJmlgjieSJ5ZmKAZyeXRhTzHy7kHHgi4fcfCee6YWdsthgGVxYXSyaQWihr9/HaYaX5UnWYNYaRoEh75KTLCmgktSCMOwKC/uDBeanfSPrj40TEGzdSaBado2KLuMbyZ090EGnQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770401147; 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=7rLTMaLaNyA13QPnQ+is080Z8HIDPH5vwzyyQGnqkxA=; b=UrRtf04o9C1ZK0+LWySIT4Mu6lh27wRa6LkLJTVmMUXlNWwg9gA2FvqvRW1KPXeHM6SydVVzxp86lWqQ56X1BzYraepq1fUsGkUq/awXKpLLVNlcESr/sZiEsLEgE56oRP8UvVW3E/6TBIeu2QkWZpxPz6WFy5RsrJz/S41qQM0= 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 177040114696594.10581279787164; Fri, 6 Feb 2026 10:05:46 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1voQCu-0007zl-AN; Fri, 06 Feb 2026 13:05:29 -0500 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 1voQCq-0007wd-Bf for qemu-devel@nongnu.org; Fri, 06 Feb 2026 13:05:24 -0500 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1voQCo-0001R0-Ek for qemu-devel@nongnu.org; Fri, 06 Feb 2026 13:05:24 -0500 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-b8838339fc6so46280866b.0 for ; Fri, 06 Feb 2026 10:05:22 -0800 (PST) Received: from draig.lan ([185.124.0.126]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8edacaffeesm99446066b.38.2026.02.06.10.05.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Feb 2026 10:05:18 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id D3FD05FA07; Fri, 06 Feb 2026 18:05:17 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1770401120; x=1771005920; 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=7rLTMaLaNyA13QPnQ+is080Z8HIDPH5vwzyyQGnqkxA=; b=BUOrC4FEgbIxw1hSeJBP6kObMJ4siT5te0f/eAAmNNCkuZ3unwgZveNPg6U66IF7MC lTU4W3Ak7o3E/ZX1qKWUcFUtJ2/I3CUxLP5G4dzY5KYQLQkh8TXgu+PjP6hDGsBYVKwr jJMe7spq8HnLkTJiIN0OZ2CYrdpH8StmpiCVGyBFMzV/rcERQB3eXUgmtXSxAdNAffGC umYZe1qWgaoVi4Lo3MKZYhl71QQasBi+cTR+NG5BR9zBBgv64YI+WMU8z7amJ6ZAY7yo yJuz3qlj9I5rqfpSPkQNhjeHhiPu8BrXNOllPfggjzuDDIC8Pi9Z/qnavKKFJZXnfK7F 14EQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770401120; x=1771005920; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=7rLTMaLaNyA13QPnQ+is080Z8HIDPH5vwzyyQGnqkxA=; b=XelgmjJ/LhrFTDqZWsF4OSD1HvT+Y/LJUquMdQ1fKMsxFcTPlQ6FqYUoyxivuHeMZn qxthxal55H6BxpbGi6H+Hzf0zCSzYKTItjTi1tkjlklEXydcnF2MuheA9EXIImmbQ0PY 2EGdyG66VLcKVhsCkV/15kEmKJ+sh4BCIl2wu8+C/hjomOXngmtxHU+Uk64+pJhlJUfL dInS/zRA41r1oSrlgt/vVZkoRNJ6ukReqiQxjVgzDAU3FiG+0qoneajR7CKcOG0B+CTc imrQU61xnTGlds10KFiUqE/lOlOcGZsCnhrEw7qx9OzEHIFyvr6Ur5IWGPSgyCd5e1Gz XjYg== X-Gm-Message-State: AOJu0YyNd1cAzDSO5zYp6DeyplbHfO4zZT3P83D2yXb2XGJv7HWnvy/+ 1/NmYyxt7OwF+ZBC+7CGykYQOsl1Q4dFz9lrdCONLylKSMcSG5cyrYD/uc1PuO46kzQtGdNqUzj VkZe7fAw= X-Gm-Gg: AZuq6aJwXv/J5Lwc9DxFPj5AWzyzDrAIHI10kQCdEZ6xWzxg3e1VciRwHMFetpBdSSW g1ASPACLwVIORG7iyL1ZQ3ADvwylJZYaxI37JCEAYjNvUDq8GjcadoI8ysp7aldzr/k41uztdCP AAHnvFW+Qzt3ZhKL4Sgezb0WhN3sYIYpbIFxNVXKbS5fkn+iNcx3WvuN5HIx3/nbCUgJwuGiR8k Ga0ePP98Dx8hu3pg3hAa4b5gVE+vUbxs3HFY94n/gEXvr3tmsTOqir8tsE3M+613hq2h5AKZEll 1HjomN8ftYoJfFMV6gCPcRSoePK3qwTDL+ks2R8Z7tJbo5gxGDC//v3sFTTGrBfv1DTFNqshYnu wAyOCIcYYUjC1jkzGUNeYRgm16Gjd3Bm6Iofj4BlwyvJVsOKXEgBUG/j+E32kpSu0KXE1XcxUAa VKVSBRRhidaz8= X-Received: by 2002:a17:907:c2a:b0:b87:763b:3da6 with SMTP id a640c23a62f3a-b8edbbcf011mr252917366b.23.1770401119983; Fri, 06 Feb 2026 10:05:19 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Paolo Bonzini , Gustavo Romero , Thomas Huth , John Snow , Cleber Rosa Subject: [PULL 01/10] meson-buildoptions: Remove duplicated entry of --gdb in the help text Date: Fri, 6 Feb 2026 18:05:08 +0000 Message-ID: <20260206180517.1335861-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260206180517.1335861-1-alex.bennee@linaro.org> References: <20260206180517.1335861-1-alex.bennee@linaro.org> 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=2a00:1450:4864:20::636; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x636.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, 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: qemu development 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 @linaro.org) X-ZM-MESSAGEID: 1770401148864158500 Since --gdb has recently been added to meson_options.txt, the help text shows up twice in the output of "./configure --help": $ ./configure --help | grep gdb --gdb=3DGDB-path gdb to use for gdbstub tests [/usr/bin/gdb] --gdb=3DVALUE Path to GDB As the probed value is of interest we want to keep the configure text so make meson-buildoptions able to handle deferring to configure. Fixes: b46b3818cf8 ("tests/functional: Provide GDB to the functional tests") Acked-by: Paolo Bonzini Reviewed-by: Gustavo Romero Reviewed-by: Thomas Huth Tested-by: Thomas Huth Message-ID: <20260203115201.2387721-2-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e diff --git a/scripts/meson-buildoptions.py b/scripts/meson-buildoptions.py index e636d258e8a..9e3a75c8b11 100644 --- a/scripts/meson-buildoptions.py +++ b/scripts/meson-buildoptions.py @@ -53,6 +53,11 @@ "werror", } =20 +# Options that configure prints help for, so we can skip +CONFIGURE_HELP =3D { + "gdb", +} + # Builtin options that should be definable via configure. Some of the oth= ers # we really do not want (e.g. c_args is defined via the native file, not # via -D, because it's a mix of CFLAGS and --extra-cflags); for specific @@ -189,7 +194,9 @@ def print_help(options): key =3D cli_help_key(opt) # The first section includes options that have an arguments, # and booleans (i.e., only one of enable/disable makes sense) - if require_arg(opt): + if opt["name"] in CONFIGURE_HELP: + pass + elif require_arg(opt): metavar =3D cli_metavar(opt) left =3D f"--{key}=3D{metavar}" help_line(left, opt, 27, True) diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh index 3d0d1323446..e8edc5252a3 100644 --- a/scripts/meson-buildoptions.sh +++ b/scripts/meson-buildoptions.sh @@ -58,7 +58,6 @@ meson_options_help() { printf "%s\n" ' --enable-ubsan enable undefined behaviour san= itizer' printf "%s\n" ' --firmwarepath=3DVALUES search PATH for firmware fil= es [share/qemu-' printf "%s\n" ' firmware]' - printf "%s\n" ' --gdb=3DVALUE Path to GDB' printf "%s\n" ' --iasl=3DVALUE Path to ACPI disassembler' printf "%s\n" ' --includedir=3DVALUE Header file directory [inclu= de]' printf "%s\n" ' --interp-prefix=3DVALUE where to find shared librari= es etc., use %M for' --=20 2.47.3 From nobody Mon Feb 9 14:02:12 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1770401206; cv=none; d=zohomail.com; s=zohoarc; b=TsXjKRiHmggOgtKRwq36FdjjlebvIuP8ekcaXv9lgkJsGpa5XChyX+TFQ3Wu9IWbkgyHX07QzQHlOaFO8WEPoMws3tbL8M3WmVRYF9EbLpjxym8Dh8H/yhvzYQ/nxn11E0M2tx9l7FyFH83JsYSDpu9Ub1I0/LDrUHMnH5V0FiY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770401206; 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=/u2G7YhxydUQhovvt9K1SlozqbVhhSVq7MznkHBatLo=; b=gcgQLnbrSZ2jY5oPLuaZY09fbnAJZDloPdx/9/wfFOJc0+rQRNhZJofyRTJFTzzWYAOzUT4fTyQSoe/3DSENboH1O8UIjJggu2runzbyno6mc8HJX/cYomtV3vwabSxIpyeLSs2ojxKmN3jt1uE2eaNeC1o34vyJN3RQ0N4TCM8= 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 1770401206123897.5646408839912; Fri, 6 Feb 2026 10:06:46 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1voQCq-0007wr-Oo; Fri, 06 Feb 2026 13:05:24 -0500 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 1voQCp-0007wA-GB for qemu-devel@nongnu.org; Fri, 06 Feb 2026 13:05:23 -0500 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1voQCn-0001Qc-Ld for qemu-devel@nongnu.org; Fri, 06 Feb 2026 13:05:23 -0500 Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-b883c8dfb00so406095766b.1 for ; Fri, 06 Feb 2026 10:05:21 -0800 (PST) Received: from draig.lan ([185.124.0.126]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8edacb18aesm100055166b.41.2026.02.06.10.05.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Feb 2026 10:05:18 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id EBA2D6077D; Fri, 06 Feb 2026 18:05:17 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1770401120; x=1771005920; 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=/u2G7YhxydUQhovvt9K1SlozqbVhhSVq7MznkHBatLo=; b=FYu3+p46WflAUVJS0yv7ME2wuUt/hTvUlq3TDFOltq/GyA/G1tbXRt7RAInseHsWIZ BpiIIfq3Wf5NKo8MAtUekEkGVLdlb23LgNT3gNsvGK/2aG8CJPeBBzBAwAxDv7QlxOdO oyL0wWzGnwJLONC9P9Rg8j9IAmueMCp6k3+Jll0IutMtgEZ75uQfpc/UACDYBlHXbCTo yYBAVLSuefmx1pTjW8LPcp5rejfGd71Jhyllc1UhGtxQh6pjVqVwZZqeUw5ymfbd3yst 7db4FvRIZYlvU12gJ1nIdLpXT8TZS3x2JYHrVxJJ8ysWKpGhfsBQiJSF5x+dkx1iEdEv aqww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770401120; x=1771005920; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=/u2G7YhxydUQhovvt9K1SlozqbVhhSVq7MznkHBatLo=; b=Aj6BV3jTcBiF0cwXvNzLguijySlZbfhXXPYKkLoppbvSQXGjKbxiOyHCpwQtX5FQbO NphZao+85vZ4g5qTkkg40j3yd45R5M38gMY1fuHFp9jMF0iZkGfkedLqtXYu/jpO1SZH H/gmiB7qBUz1oQomwRs74cuJwc/ypDvn4QRUaYxxy2ZA1a7OT/ynOUsqpnJjVsUfWyPC cdpY2ZHf7KLSphKIADr7SCFlSGI9MHM/LszW1c4tn4U8hjvIBxYh1S7ghODFvBxNaErk kkoXZZrhLVvI6w26cFKP7S3/Uu6FQttlVxUqJ7N5Vx1yT3zJ8isTHqsH9qVQcMxpVbin lElw== X-Gm-Message-State: AOJu0Yz//xzanCR4iWHThyLNNaZkZrdxnxliZyHpfA4R6hSVdWBXkgH/ uLNhlkoYhijeozxqGQQS8ynJDFlmA8EZwdzcgSe9LU2Gh7j54if/jHiPNIBaRTPVMY0= X-Gm-Gg: AZuq6aKVnz/bmRrLSvvq8wMcEmSERDYTO+tL4C0OGJ3ciYoea6XIDqir5rRtpJ66fuj Dt2Is26fSzagOdHzoFaZIKgYcx1CQGK198HjZZOhp5vxuKd2vIbTsroOMYd5B8jDs2+TlKA+Nrx wNFRromuv1ddKvTChm8lhK/4cp6ckZNJHPUY31X/KLOpV+nFq2/k8tk8e33J4CyclPmWCFQgssJ eezTezRFouQ9JXTapZ/NHm/GK2znnLlBeo8psmADGZjXoNdhWbuRiT2mo/9aj6ZXfnZLAVsxv4m uZEH+Q3M+fR5un4fL6ik/jUSIQqZE3GaKVfsWzhKyyEeOzMptwxaFmUnd/j8NimGTMOVcWNhSRX KKHWI+HmcKU3/KReYf4FSkTx5SWxJFR+3E+jnb5WL81e/kS32zaKbKQFthBC+nFZ1BnMCymjmWT VOut5djjKwPxs= X-Received: by 2002:a17:907:980f:b0:b8e:12fa:ff2b with SMTP id a640c23a62f3a-b8edf37871dmr224047466b.37.1770401119589; Fri, 06 Feb 2026 10:05:19 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Paolo Bonzini , Thomas Huth Subject: [PULL 02/10] Makefile: add python script dependency for meson-buildoptions.sh Date: Fri, 6 Feb 2026 18:05:09 +0000 Message-ID: <20260206180517.1335861-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260206180517.1335861-1-alex.bennee@linaro.org> References: <20260206180517.1335861-1-alex.bennee@linaro.org> 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=2a00:1450:4864:20::62c; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62c.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, 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: qemu development 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 @linaro.org) X-ZM-MESSAGEID: 1770401207192154101 If we update the script we should also make sure we regenerate the help text. Reviewed-by: Paolo Bonzini Message-ID: <20260203115201.2387721-3-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e diff --git a/Makefile b/Makefile index 9fb55dcf330..54547a37b1a 100644 --- a/Makefile +++ b/Makefile @@ -130,7 +130,7 @@ Makefile.mtest: build.ninja scripts/mtest2make.py =20 .PHONY: update-buildoptions all update-buildoptions: $(SRC_PATH)/scripts/meson-buildoptions.sh -$(SRC_PATH)/scripts/meson-buildoptions.sh: $(SRC_PATH)/meson_options.txt +$(SRC_PATH)/scripts/meson-buildoptions.sh: $(SRC_PATH)/meson_options.txt $= (SRC_PATH)/scripts/meson-buildoptions.py $(MESON) introspect --buildoptions $(SRC_PATH)/meson.build | $(PYTHON) \ scripts/meson-buildoptions.py > $@.tmp && mv $@.tmp $@ endif --=20 2.47.3 From nobody Mon Feb 9 14:02:12 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1770401188; cv=none; d=zohomail.com; s=zohoarc; b=QVEhMdFe5hKdRsaGQv4ZdaPLX2esMMTOmmk+rh4F50OBUdjnQGR1cyomrWb2bww/Te6N40nM3vf/GzS+WHBaurOhAuNVZjoPomdQ3jnQVfwMDF+tf+LG1abYcnQS5mHfLyHNnwDY3IltbP7Zi2u+AV02xenhH3PBSU5SIgOWWc0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770401188; 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=YLNn3Uva6SjJeQYlOxn8DYVVkX41Y1BiZ46SMJcyHmw=; b=ITPJqpdh38dOv/dPc0aAsCJ7mb7lQPNrxp7MrRbL/GNdPDz2H0U0wbPLoyslLH6PusLZ+1++dQGkSd3/dPXt6RlyK4Dot0qoIYkdIkW+eUSeKvQK/R5wPUl2goExL3gUigT35LFFTw2Z5WCyC4VOeKKkdC3a3T09bYMALZtOuSU= 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 1770401188853946.5404775455138; Fri, 6 Feb 2026 10:06:28 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1voQCs-0007zJ-WD; Fri, 06 Feb 2026 13:05:27 -0500 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 1voQCq-0007wu-Qx for qemu-devel@nongnu.org; Fri, 06 Feb 2026 13:05:24 -0500 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1voQCp-0001RC-3C for qemu-devel@nongnu.org; Fri, 06 Feb 2026 13:05:24 -0500 Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-b8838339fc6so46286066b.0 for ; Fri, 06 Feb 2026 10:05:22 -0800 (PST) Received: from draig.lan ([185.124.0.126]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8edacaffeesm99446266b.38.2026.02.06.10.05.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Feb 2026 10:05:18 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 0D355607B5; Fri, 06 Feb 2026 18:05:18 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1770401121; x=1771005921; 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=YLNn3Uva6SjJeQYlOxn8DYVVkX41Y1BiZ46SMJcyHmw=; b=p8/bmDXAoVj0j/XVOYGDxYn7yuEQdz0MMZUWFdZN1ze3NAYlfXsjYpNjqNVnGDmdMp UPmGPTMygEQCO4ddB5XL6ee8ldiFhlrxGEoQB6bhFTbcE3+TKAS2blzeUyC/+k8erlyI oBq+wvoCNEsffdgifWljxlfzGbI7bkcYOMz43/vmXAQ108t5e+KD23ia7of9kZf56Gl/ tvL0V6euyhW4RlsnROMsOAv/JyFDRLuMB8lV8o6D2J+3VRS+o7YSyj/rsL1sKb8DGWbE DQL8Q0oZXD/o17k61TEV0+UH6ERJMOFT23P7kDJwdwRLxMEMEHr9UXlvCwl/x4RHpf7V 8V+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770401121; x=1771005921; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=YLNn3Uva6SjJeQYlOxn8DYVVkX41Y1BiZ46SMJcyHmw=; b=VNYEOuKgGrQlDsBSI2QnfwQ+U7OqQmZS5sqPutIuQZ6q6Yuol5id8ud2MMQ7pXeu0B RWZUOr/zVb3AcSjhJ8SLlsUFaf+sCC8j7loMnryUU3CWAGNaRT/2vVrRGFI+MSC7z3+M v3wYrCkKUdQ9hcdYjTs0vbCc1bgtdo4brrU8rwwlu0upVusMXg0ICAqREzpbA79qIZCo uOkAG4BMVPo9JbN3PcQV9L+3+OCmWFZPngTTfRYqMgUqc+6o+heb7saEXZdWLvsO9qW6 lrXTi92DuDxSct0RR7+Dp68U4M6FGfscgnP7uw+f8L+2cjONJIaBuaraOtsxD5WyrEfR LOWw== X-Gm-Message-State: AOJu0YxYQXPf9fkKui90iirxJqu30/C1hSqfaDcwYAcrdKarkrF+NuG+ occPAoxCLUWUxwRLYdpID841EEEnFDk+TAQmN9cX9WnRUA6ewIIoE0/mzZbGgpI8g14= X-Gm-Gg: AZuq6aLYeEmApx58b+uF+E+EnTjk3+faSX8KpVTKkX6bhqT6Ma2Omvo1Nx9xWgaq8IE +IDQpNZiJQiy9KJkp6AdGc0TUwDc76u9Y4DC6XD2u2abiXZxasuLhnohWxiUDu7x6yRz3Ih3zhz cnUuU8QXJEOG9F8REoRYDiF+VvFWsLYUy8eXx27IHcQqIaPLBBFKOkJA106wtL8ev+ByMBjnEc6 y0zfDPcfkClodI7eFcQsIFTSLD9VQKdGknRPyVA3NbXau6zZ1PacFmWG25iNSxy8kypVr83s65L Gf6jKfBTD4E4Y4oYp0Sd4din+4Ubla7LLnHZpit8ok/deohtLFHBqqgaoeJWDp5AWDVCoUoYtyS drLo9oXrZ5R6Lk5K8wkH1NpeRhh82wvNwnQx2NMua6Z5/pfkxj06qRVzkByi2FyqoR2bYKhrQ8a Qx9pzwyNWDtSU= X-Received: by 2002:a17:906:f598:b0:b79:eba9:83b4 with SMTP id a640c23a62f3a-b8edb7e3aa3mr269242366b.6.1770401121360; Fri, 06 Feb 2026 10:05:21 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 03/10] gdbstub: remove the need for goto cleanup Date: Fri, 6 Feb 2026 18:05:10 +0000 Message-ID: <20260206180517.1335861-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260206180517.1335861-1-alex.bennee@linaro.org> References: <20260206180517.1335861-1-alex.bennee@linaro.org> 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=2a00:1450:4864:20::62f; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62f.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, 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: qemu development 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 @linaro.org) X-ZM-MESSAGEID: 1770401191293158500 We already set a default error reply which we can only overwrite if we successfully follow the chain of checks. Initialise the variables as NULL and use that to gate the construction of the filled out stop/reply packet. Message-ID: <20260203115201.2387721-4-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index 1f8cd118924..aeff467fdd6 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -1413,36 +1413,33 @@ static void handle_v_cont(GArray *params, void *use= r_ctx) =20 static void handle_v_attach(GArray *params, void *user_ctx) { - GDBProcess *process; - CPUState *cpu; + GDBProcess *process =3D NULL; + CPUState *cpu =3D NULL; =20 + /* Default error reply */ g_string_assign(gdbserver_state.str_buf, "E22"); - if (!params->len) { - goto cleanup; - } - - process =3D gdb_get_process(gdb_get_cmd_param(params, 0)->val_ul); - if (!process) { - goto cleanup; + if (params->len) { + process =3D gdb_get_process(gdb_get_cmd_param(params, 0)->val_ul); } =20 - cpu =3D gdb_get_first_cpu_in_process(process); - if (!cpu) { - goto cleanup; + if (process) { + cpu =3D gdb_get_first_cpu_in_process(process); } =20 - process->attached =3D true; - gdbserver_state.g_cpu =3D cpu; - gdbserver_state.c_cpu =3D cpu; + if (cpu) { + process->attached =3D true; + gdbserver_state.g_cpu =3D cpu; + gdbserver_state.c_cpu =3D cpu; =20 - if (gdbserver_state.allow_stop_reply) { - g_string_printf(gdbserver_state.str_buf, "T%02xthread:", GDB_SIGNA= L_TRAP); - gdb_append_thread_id(cpu, gdbserver_state.str_buf); - g_string_append_c(gdbserver_state.str_buf, ';'); - gdbserver_state.allow_stop_reply =3D false; -cleanup: - gdb_put_strbuf(); + if (gdbserver_state.allow_stop_reply) { + g_string_printf(gdbserver_state.str_buf, "T%02xthread:", GDB_S= IGNAL_TRAP); + gdb_append_thread_id(cpu, gdbserver_state.str_buf); + g_string_append_c(gdbserver_state.str_buf, ';'); + gdbserver_state.allow_stop_reply =3D false; + } } + + gdb_put_strbuf(); } =20 static void handle_v_kill(GArray *params, void *user_ctx) --=20 2.47.3 From nobody Mon Feb 9 14:02:12 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1770401144; cv=none; d=zohomail.com; s=zohoarc; b=NR5RHG0mwfK7n5jFFFl9C8qPVDtFMLAuo2ZglOdQsfIcGjE2ZJQc6xo+oV+J46MynRH8sL6OSg/DoHFPHLQKIjVBYxmUUspPPHnPCCg5YdvXLOAaE+E4BKMoh+1Fde5zUZA5lWHzpmlrdQsSh4XlofYn3gm+gLmv0s6fImZKxlQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770401144; 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=ejrh02Mk/KLMeodWKeL7ZGQn7Gm+puDkYZVo16Fx7oo=; b=dwPMjZg3Wzrq4UxLpAZ7JiN6gpyMMe12ewjdk5Y8QbWHCNfNGRRrN9t2Qs3/sny+fa1uVCeCcj/TH1tQ/I9SMkMXdCWK5ZlEt8kwvZBJ6pK0+iLmKHyvOhJVn1220rRqKerp9uT4t8JxOsOh+FQkoiZ+wnjiIruj7uZ/l4sq6yQ= 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 1770401144547452.6600843144323; Fri, 6 Feb 2026 10:05:44 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1voQCs-0007yu-Jo; Fri, 06 Feb 2026 13:05:26 -0500 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 1voQCr-0007x1-7r for qemu-devel@nongnu.org; Fri, 06 Feb 2026 13:05:25 -0500 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1voQCp-0001RJ-Bq for qemu-devel@nongnu.org; Fri, 06 Feb 2026 13:05:24 -0500 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-b8e9c8ada38so375540366b.0 for ; Fri, 06 Feb 2026 10:05:23 -0800 (PST) Received: from draig.lan ([185.124.0.126]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8eda7a3372sm102786666b.20.2026.02.06.10.05.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Feb 2026 10:05:19 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 24D25607BE; Fri, 06 Feb 2026 18:05:18 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1770401122; x=1771005922; 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=ejrh02Mk/KLMeodWKeL7ZGQn7Gm+puDkYZVo16Fx7oo=; b=SOX9IzE+yTj+7znl1NrnYkF6IYH1OweLl1DzqCfaLHIo1KVXv9nomjBA/jM53mdoL2 yPwMDSAoeNbs6ZohoIPlMC1OftrgZ5FCWEwd5d14A8RMpSAQ3Qazy/rG2r5iO9o0c/2/ ik4/ELs5cevQFGrPNPVkXphzVMWR5jQ5dCJ8+5jqhjNlU3ndoU0IdRgipLF2LsfLvz9e 9W7SeUR1qIidzJpNREDxValrCKGcFOWO266M5tZJgcPyjkoTj2Ib1DUQIwYcTDYwP8Cj BUJpkHM96UBiLKE4PasYf8qPvF6cFnc0ddjut6NZspJ/dRT0sNIQM3Ci2TuLhwUsSB2X n1vA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770401122; x=1771005922; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=ejrh02Mk/KLMeodWKeL7ZGQn7Gm+puDkYZVo16Fx7oo=; b=SfECP+AKShiStdRu2CvqKonjHIzVxqDxmI3WUex2s8z5fDSuBE70o6O+HwY2/vr5xy tIbs6rka4pYxsc01Guom64ZbnyrdZGNEvPUl6kFwMuRGkrtT5968ackhjrFsdQzGv3W2 cOCHVd9k4RD3XJ1M1txnI6mRP8sr+UO3qR4XY1YtEi4FDLrd2/LOnvrr6hkQ8Ry/jOnU ThTY7UotiQEYMPdnEKeoeLDqgkLZtC8zkbhJ2VWf1TjOlKFKh/pm4/YPmpG1c3pEFI/A EzY9fLl9srs4HY84Kcv0V7YZ7TYypXXB6I/SQtEsau11votdZQxv7VoF/+/c9tOAsR1A MT6A== X-Gm-Message-State: AOJu0YzDdbZSzc6a7JldSNihq561GegVQi+arOlYc8Yjag5YLpgfkzB7 gQ5D/5AB8rBHIBCJ55zVP1ZgVw8OMUB5tbXYwqat1yBUwmAGaHqh7x2vnLkW9GhFQ0s= X-Gm-Gg: AZuq6aJ/xUVpJy2rrxiFhp131/VGuo6JnMokdN/ZIKAWXW3QXlBo/3KHcUcSXI7u/uR muVIvNUN/D9YqyQ3Oh7G/KWA2V540QIwgSr9V0ts9LlUj6zDVwFGWFOYnvKmDTzSxhZo8ly6WJ/ EhEVtjeimx5NX7EGoBQeEN95HxFFZJ1bP7+dtWJHQghhm5QyjS6y3h+z4aAyQjzrZL0YbuvMlxt HvHgBLmpvkVko+NOABkQdHH6OEoESsGRod6g6v68Xo27Z0DEz8lUPRgh40497R5sTAV84lbUlVj S1THcG9Jeo+Fv+bOd9jy3CpbebbwlFE+F5WnQQ22sIp74JjEBlNx5UJyrQAjtbA7z/a1NqhRkAM kDiMPBJngVCFdAj6Uf8BBkqPK8NI6U5K2BlcdgCONIa6pFEf3lQo9wX0ulN+IjHUjYBYL7yl+kb uM8fxqi5yv4Pw= X-Received: by 2002:a17:907:1c9e:b0:b87:bb45:bd5c with SMTP id a640c23a62f3a-b8edf42c682mr234686366b.58.1770401121727; Fri, 06 Feb 2026 10:05:21 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 04/10] gdbstub: extract stop reply message construction Date: Fri, 6 Feb 2026 18:05:11 +0000 Message-ID: <20260206180517.1335861-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260206180517.1335861-1-alex.bennee@linaro.org> References: <20260206180517.1335861-1-alex.bennee@linaro.org> 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=2a00:1450:4864:20::636; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x636.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, 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: qemu development 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 @linaro.org) X-ZM-MESSAGEID: 1770401147555158500 The stop reply message we send can include a lot of extra information and a bunch is mode dependant. Extract the construction into a helper and add specialised versions for system and user mode. The correct response for system mode should be of the form: T05core:N; Where N is the core ID. We pass GString to gdb_build_stop_packet as other functions we are going to clean-up work variously with their own dynamically allocated GStrings or with the common shared buffer. Reviewed-by: Richard Henderson Message-ID: <20260203115201.2387721-5-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e diff --git a/gdbstub/internals.h b/gdbstub/internals.h index 92466b28c18..9b25bf58b8e 100644 --- a/gdbstub/internals.h +++ b/gdbstub/internals.h @@ -237,4 +237,14 @@ void gdb_breakpoint_remove_all(CPUState *cs); int gdb_target_memory_rw_debug(CPUState *cs, hwaddr addr, uint8_t *buf, int len, bool is_write); =20 +/** + * gdb_build_stop_packet() - craft the stop packet + * @buf: GString buffer for building the packet + * @cs: CPUState + * + * Craft the Stop/Reply packet when we halt. + */ + +void gdb_build_stop_packet(GString *buf, CPUState *cs); + #endif /* GDBSTUB_INTERNALS_H */ diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index aeff467fdd6..b45eb7c7b2b 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -1432,9 +1432,7 @@ static void handle_v_attach(GArray *params, void *use= r_ctx) gdbserver_state.c_cpu =3D cpu; =20 if (gdbserver_state.allow_stop_reply) { - g_string_printf(gdbserver_state.str_buf, "T%02xthread:", GDB_S= IGNAL_TRAP); - gdb_append_thread_id(cpu, gdbserver_state.str_buf); - g_string_append_c(gdbserver_state.str_buf, ';'); + gdb_build_stop_packet(gdbserver_state.str_buf, cpu); gdbserver_state.allow_stop_reply =3D false; } } @@ -2038,11 +2036,9 @@ static void handle_gen_set(GArray *params, void *use= r_ctx) static void handle_target_halt(GArray *params, void *user_ctx) { if (gdbserver_state.allow_stop_reply) { - g_string_printf(gdbserver_state.str_buf, "T%02xthread:", GDB_SIGNA= L_TRAP); - gdb_append_thread_id(gdbserver_state.c_cpu, gdbserver_state.str_bu= f); - g_string_append_c(gdbserver_state.str_buf, ';'); - gdb_put_strbuf(); + gdb_build_stop_packet(gdbserver_state.str_buf, gdbserver_state.c_c= pu); gdbserver_state.allow_stop_reply =3D false; + gdb_put_strbuf(); } /* * Remove all the breakpoints when this query is issued, diff --git a/gdbstub/system.c b/gdbstub/system.c index 79f80256e3a..8ec8b7ea336 100644 --- a/gdbstub/system.c +++ b/gdbstub/system.c @@ -662,3 +662,14 @@ void gdb_breakpoint_remove_all(CPUState *cs) ops->remove_all_breakpoints(cs); } } + +/* + * The minimal system-mode stop reply packet is: + * T05core:{id}; + */ + +void gdb_build_stop_packet(GString *buf, CPUState *cs) +{ + g_string_printf(buf, + "T%02xcore:%02x;", GDB_SIGNAL_TRAP, gdb_get_cpu_index(= cs)); +} diff --git a/gdbstub/user.c b/gdbstub/user.c index a2327c61352..14369b9ce5e 100644 --- a/gdbstub/user.c +++ b/gdbstub/user.c @@ -974,3 +974,15 @@ void gdb_handle_query_xfer_siginfo(GArray *params, voi= d *user_ctx) gdb_put_packet_binary(gdbserver_state.str_buf->str, gdbserver_state.str_buf->len, true); } + +/* + * The minimal user-mode stop reply packet is: + * T05thread:{id}; + */ + +void gdb_build_stop_packet(GString *buf, CPUState *cs) +{ + g_string_printf(buf, "T%02xthread:", GDB_SIGNAL_TRAP); + gdb_append_thread_id(cs, buf); + g_string_append_c(buf, ';'); +} --=20 2.47.3 From nobody Mon Feb 9 14:02:12 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1770401208; cv=none; d=zohomail.com; s=zohoarc; b=VPUT+OoodqpDfYj4njJA/4fLDrn5vO1v0IwMEFctx/f5/ovGdmgCAh56f9kYq5y/BHLJ78zdhubI+3dWtf+SD6vctEWbIOl+xiteME5gdZP8IJ3OKJPhbVkyll8D9NcJ4izV3OrYZGGjr9R7ATRHHWx3/JFIzOwOgmGm7v3QhUI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770401208; 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=8GQHCXcw7F2TcL9IvvM3htlqgvvrWvp6j+kXPyYlQag=; b=oG6uD+RyZJ0cOnmbPx5sHxB/QSjOv0qs+BmtdOS2pA2tJs1Ml68DAGG4Zt1H2kDlc+IAhNshEFLv7oPRukU39G+zX29/FnWleAKARG1o1eZWggytPPbfLa8HWp86q4rc1svtEcouvJ2Pe6JlHAZnCBZrCAd4TKlW876F++T97qI= 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 1770401208082352.6747194923689; Fri, 6 Feb 2026 10:06:48 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1voQDC-0008En-Ua; Fri, 06 Feb 2026 13:05:47 -0500 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 1voQCu-0007zq-Cz for qemu-devel@nongnu.org; Fri, 06 Feb 2026 13:05:29 -0500 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1voQCs-0001SZ-Ux for qemu-devel@nongnu.org; Fri, 06 Feb 2026 13:05:28 -0500 Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-6505cac9879so3093217a12.1 for ; Fri, 06 Feb 2026 10:05:26 -0800 (PST) Received: from draig.lan ([185.124.0.126]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-65983ec70fdsm678004a12.15.2026.02.06.10.05.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Feb 2026 10:05:21 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 390C3607C3; Fri, 06 Feb 2026 18:05:18 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1770401125; x=1771005925; 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=8GQHCXcw7F2TcL9IvvM3htlqgvvrWvp6j+kXPyYlQag=; b=FtIi1ZakrIirSbQps3CpnZN5Vx7zZRmdCXRnKmNfX5hHOye6bt48R746aq5+M7igjd dhgW4737kg6w6P5RXhg2GUFSarJCvdYrae+aghOj6aqu0JM2FVOf3HSuKgC0Ip5ONS79 5SCFl1d+I5Z5Ng2b1FJvkv88Zq+sTdOcWc8MpRmT75Oj07kl1YsosOQDoW5stUQ1oc+/ u2R83XrtsyWGCAJk0LYVMyXcrL2Uzl0dSZaoIEjq8z8kb6htvFPN88j99/4uWMg2uyRs qV/0jEsj3nT7kFGLDY8yrZmSBHuZiXLgLGikqUqu3KBPVL1M+eo60vbldOMFS27mj9x1 lO0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770401125; x=1771005925; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=8GQHCXcw7F2TcL9IvvM3htlqgvvrWvp6j+kXPyYlQag=; b=m6iDUk3rOhl7npoQOUCjXSwvk1BOCmKytjbERj4GDibnvOrlBCtYvYczkfDXIsN3bP UnKjISbSkmPR4GPfKKUaFnIEah0COFnSRrq/BlB9eJrnJf2aIM5uV21hmyP+BJvXHASC nwzvX11JsASf4KPRzMBAz4NCggqtWH2Bb4ZO0ufzdEX9+aeVBTgKtz1hhc3gy2b0YcX7 79/ujkgjw9+F53ioACNTpkOF00xhB9+wSq9FL+v+T7Cpy4Ylf7YsWb1sVkKwy985ixIS vFwXHibOBUIanIXIJo2FcSqpK2PzX5787bnRWMu5snmlzImf4ve+Nfg5hkqAiKouMx03 0LmA== X-Gm-Message-State: AOJu0YxnfHV0j26OUrazmDuSW9Htq0MtxVNOu33W+/iwDkYV6aETFISo ml7DzERrUohH2VaZA4f+qPjCZxmaTeda82bnHUoIgiP65eyQDwybn2zXRB9pyUt/JetopjCDY/r nWybp6Ao= X-Gm-Gg: AZuq6aL7TIhdHNmjxriVqQwX1DXrOjt3T/rIXabfdoAqnhokBaa7xIHSIiMGwz0A5Uc W+wWITFw0eUIoM1bFv84rnV7+fk2JkhrAJleeL4C2/Qxz7TFrGlN8/x0NbCwKtB8ellWpmo4UlG Qlfz9g79ZiMgDSgioEG6d3Lh6js/GbIfVONLkDCGfjEer+dyMOEU8l1BF/rwbvkQ7cK5YvySqwm EWDp8GivoPv893dh6+TULFWvE1Dx6VJ+PcAmE96oApyxu01i+SF7Hbeg9lnstteobOoE9ZPskgs m0Mzl9xlOa8MI1yX2KZ3xoh9hZ7pPSyaPuWRAY/Yyv4oe71vCx/Z2oUfRLSjtgjP4jPOTenkA6Y kl9tIt0Th5SJpEUBt12W/u6wAuoj/9fU2jiklfBLvulzvYCKDaT67VhtUZoZtgBi2roaBC1wV0X 1CeiTPoreCJaM= X-Received: by 2002:a05:6402:5201:b0:659:38ea:c4e3 with SMTP id 4fb4d7f45d1cf-65984184879mr1798226a12.25.1770401125321; Fri, 06 Feb 2026 10:05:25 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 05/10] gdbstub/user: localise variables for reading gdb socket Date: Fri, 6 Feb 2026 18:05:12 +0000 Message-ID: <20260206180517.1335861-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260206180517.1335861-1-alex.bennee@linaro.org> References: <20260206180517.1335861-1-alex.bennee@linaro.org> 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=2a00:1450:4864:20::52d; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x52d.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, 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: qemu development 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 @linaro.org) X-ZM-MESSAGEID: 1770401209215158500 Keep things tidy by moving the declarations to the block where they are used. Reviewed-by: Richard Henderson Message-ID: <20260203115201.2387721-6-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e diff --git a/gdbstub/user.c b/gdbstub/user.c index 14369b9ce5e..a16f37616b1 100644 --- a/gdbstub/user.c +++ b/gdbstub/user.c @@ -198,9 +198,6 @@ void gdb_qemu_exit(int code) int gdb_handlesig(CPUState *cpu, int sig, const char *reason, void *siginf= o, int siginfo_len) { - char buf[256]; - int n; - if (!gdbserver_state.init || gdbserver_user_state.fd < 0) { return sig; } @@ -246,11 +243,10 @@ int gdb_handlesig(CPUState *cpu, int sig, const char = *reason, void *siginfo, gdbserver_state.state =3D RS_IDLE; gdbserver_user_state.running_state =3D 0; while (gdbserver_user_state.running_state =3D=3D 0) { - n =3D read(gdbserver_user_state.fd, buf, 256); + char buf[256]; + int n =3D read(gdbserver_user_state.fd, buf, 256); if (n > 0) { - int i; - - for (i =3D 0; i < n; i++) { + for (int i =3D 0; i < n; i++) { gdb_read_byte(buf[i]); } } else { --=20 2.47.3 From nobody Mon Feb 9 14:02:12 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1770401147; cv=none; d=zohomail.com; s=zohoarc; b=RnJEAP/hD713QRy2XrgV6VqQ4k73eXmC3lf4t/xgnOjxSeOzdIT2fdl6eowDuDHz3D2Mrv8TVksENpHw1SqactsUC0WG/CB0kFBwC9nMAI3cK3JYBrCQ45bkdouNlwlIdcxawE6whWp7IPC0TKjzOvVMjZrvTv36ixt9gflzGtc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770401147; 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=LDj3W3VJSOsTqOq/DOAQGw7i1dIQG9XZJxz/RTmuEbU=; b=KnS3es3tdbKiXhncdCTkKDe9XGeKaRxAXzp0VOFUe1OQoxunVq3Byk9wVLpKQhjUkziBFSQF5aQam8rAe2f8670qNnl0JlNd9E/11CsfzM0Zi5rsoPm1FuVlVMftkL7fDAmbeO5JO0xfnrhiFZleGEBWjo+jW6WUQZFjbz+seRY= 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 1770401147087915.6568194255966; Fri, 6 Feb 2026 10:05:47 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1voQD8-00085O-40; Fri, 06 Feb 2026 13:05:42 -0500 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 1voQCs-0007yy-Kt for qemu-devel@nongnu.org; Fri, 06 Feb 2026 13:05:26 -0500 Received: from mail-ej1-x62a.google.com ([2a00:1450:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1voQCr-0001Ri-1Y for qemu-devel@nongnu.org; Fri, 06 Feb 2026 13:05:26 -0500 Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-b8869cd7bb1so178883666b.1 for ; Fri, 06 Feb 2026 10:05:24 -0800 (PST) Received: from draig.lan ([185.124.0.126]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8ef25388dcsm38965266b.54.2026.02.06.10.05.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Feb 2026 10:05:21 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 52615607CF; Fri, 06 Feb 2026 18:05:18 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1770401123; x=1771005923; 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=LDj3W3VJSOsTqOq/DOAQGw7i1dIQG9XZJxz/RTmuEbU=; b=WB78Y9ODdOaEc+wSxLvg6wbRfz9RPMCX5gXrk8xIlXeCRLg1/u/AsNa3LkqwLrC2h7 l4xzgLqTsxpNSvM79cPprNK/31S3NgIarYPhcueJw4nKCbP/feh/pGjGtBFpbnsJ4KBF IDfSUm4QBhAV2jB1RWzcS929ldGTPwL3N53lPnXNLit8SbTh0RdUUNCbB6Hv2mG4ZF7f Uz5DCUMHZeTYuDc9uihmWDXkvIZR5u7Vd1P+yNLBJQ4fcR5f3wLUpkkebpAWsVZ1AEMt AZLk+TEnqNhxawX3C2ya9BVjOlapnVUwoXPne1q1G3oSpzt9u3hZw6/3kXUTVKlAZrx5 a2JA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770401123; x=1771005923; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=LDj3W3VJSOsTqOq/DOAQGw7i1dIQG9XZJxz/RTmuEbU=; b=Gg9dRWHMFacplGGjgygNkJmk/vr0sckALgYtjyYPhYWpQCUUGByzhWg+KlD6Ed8ez6 Insdj7G4hcEZRA710Mt18fKmNGGxCIrbNpUSTnmkKcSvosQxV2FpLthCt7B3ApQH+pJO WDfH4suJ1up0OlDRlfbgTgY3XHKmXiVKVgAwUfB/3nU78LG0Yhk5AozYI9u+N1eeUZZn q3hjq75tOHBdkty4E1k6SRvhJviXZwayRMgFAIJUGmpci/ZDEZu+uibhwE3G4urWhqqm +0dXXmKf3cOKj/7JdPbjkVrB5x2x2GBdLhb4WsTSZLv3M83hwoFg8bZRDgdGGkHm6WZL MVUA== X-Gm-Message-State: AOJu0YwPaIzcquPqNWelUUPiDLy/QUz40kb7BjqjtxkGwhXf1PCVoYNV LL7Q1eULY4ESvSGIokj6eHIsTsUqOLOW0bDeIH6z3TYLXc0jvz2mVTEBJvQQne/ZqJY= X-Gm-Gg: AZuq6aJTPH0ATMSlBa7NyQcdr8X/K4UlE+SRzyEDTzas7OQpKCc+SoSgZ+YITqUc5Bt LynCAfQXeMvJmdZ47DtfemvfcWvCQpaernzhJmYi2IX/HYwfsaaKQwNfIYw337RB95f0abG6nd/ X753poytVsbVLSO+365wQXmKnzcPcEw3l2DrGTAsIXQ71z2g/I7m01A8P09oIcf1PKlMG5RARub u6jluk0pX8eQvff2VebyAkfxgPJNOh00ASFYbGJT36vBJYcrTg5JlZQ2UbQ3AYv8SNTKQFyDm5E FCMkYf/gZy0bCXwREj6SJ1zkCtYjnBeSCfIVA5hfcMIWUNuPTJz+GVIHaHpLC8wW5ByR4d5vbE/ DwOHkfGnuBBiiPdPOSMaL1/WpLyzdJ22dqE2K/mMb5ZFzKhYG+vrJE2uwlEoZdlAMNcX6PPgiCU 39F1Ic1TLcDVY= X-Received: by 2002:a17:907:2da2:b0:b87:711f:97b9 with SMTP id a640c23a62f3a-b8edf2fb575mr209458266b.31.1770401123424; Fri, 06 Feb 2026 10:05:23 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Yodel Eldar , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PULL 06/10] include/gdbstub/syscalls: Add EIO and ENOSYS GDB File-I/O errno values Date: Fri, 6 Feb 2026 18:05:13 +0000 Message-ID: <20260206180517.1335861-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260206180517.1335861-1-alex.bennee@linaro.org> References: <20260206180517.1335861-1-alex.bennee@linaro.org> 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=2a00:1450:4864:20::62a; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62a.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, 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: qemu development 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 @linaro.org) X-ZM-MESSAGEID: 1770401148928158500 From: Yodel Eldar This patch adds the EIO and ENOSYS errno values that were missing from the GDB Manual [1] when the other errno values were defined. [1] https://sourceware.org/gdb/current/onlinedocs/gdb.html/Errno-Values.html Reviewed-by: Richard Henderson Signed-off-by: Yodel Eldar Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20260116014612.226183-2-yodel.eldar@yodel.dev> Message-ID: <20260203115201.2387721-8-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e diff --git a/include/gdbstub/syscalls.h b/include/gdbstub/syscalls.h index d63228e96b4..6200416f77a 100644 --- a/include/gdbstub/syscalls.h +++ b/include/gdbstub/syscalls.h @@ -22,6 +22,7 @@ #define GDB_EPERM 1 #define GDB_ENOENT 2 #define GDB_EINTR 4 +#define GDB_EIO 5 #define GDB_EBADF 9 #define GDB_EACCES 13 #define GDB_EFAULT 14 @@ -37,6 +38,7 @@ #define GDB_ENOSPC 28 #define GDB_ESPIPE 29 #define GDB_EROFS 30 +#define GDB_ENOSYS 88 #define GDB_ENAMETOOLONG 91 #define GDB_EUNKNOWN 9999 =20 --=20 2.47.3 From nobody Mon Feb 9 14:02:12 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1770401220; cv=none; d=zohomail.com; s=zohoarc; b=Zdf+thhIO66npVdGdm0wmKu23a5awFoann1nrNmcM7oWW3KooGWyvH9uwJ5tlb1s06hPfEannwJkyLxJkKUhAFCD1L1Xq35PoVS/j1/u2QlJp2lX66bLj0EExK9aOvaNMq0d4//fXLEsGrfNjdvn21/Al9qqoCH/xwhUq25RgLI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770401220; 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=z414qbu3KY7qWY009bsyWelCEU/9PsgauzjNkRD3FqE=; b=LcPJtMyhovy4pMZJfa46MNGc1AAE9/yV46q5uMYrGXftS/P7Tw369LZa7H9JPjhdGIPpskkPHzjsDyTDiaNDwsGgBwT4Ml5JDVbT6xVGNtYS6ysZZXtuLbBVx96AFrO1Jy6s5QzkqD9zB3bOwZVOrfzkIlO7V9GAyRKcZUiXvPs= 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 1770401220916588.3764092438115; Fri, 6 Feb 2026 10:07:00 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1voQDD-0008Hn-NO; Fri, 06 Feb 2026 13:05:47 -0500 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 1voQCv-00080S-Gp for qemu-devel@nongnu.org; Fri, 06 Feb 2026 13:05:29 -0500 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1voQCt-0001UD-L7 for qemu-devel@nongnu.org; Fri, 06 Feb 2026 13:05:29 -0500 Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-b8860d6251bso319551366b.3 for ; Fri, 06 Feb 2026 10:05:27 -0800 (PST) Received: from draig.lan ([185.124.0.126]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8edacb18c5sm103615366b.43.2026.02.06.10.05.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Feb 2026 10:05:24 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 6DF26607D4; Fri, 06 Feb 2026 18:05:18 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1770401126; x=1771005926; 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=z414qbu3KY7qWY009bsyWelCEU/9PsgauzjNkRD3FqE=; b=nTdQpZ17Y3FKejvmCiqxC3N7WLDg9uEi8tVT0qBc4h0JsDY3+UZNQ823zaXwY3RXCT 8W2MNTQbmP6ZoOexAYnQsOF3x236yJ9jgzJeBjx5qgbFGfJP5vlbqRw5L0l16/pY01hS kvVOT+I6wFJ+os7iokZNLN1Ivz9ZH3PYuAVm2yMyLNzynDCymAD3ye/dzUCQWz7+Dk9Z RDbf8x/Nk9h1crCQ8+X2daGQkI24rM64beVRYg7oQXxc6bQ4YtqpDwYBw3TMXcvlUx5q hb2zGXciz+ZX0DNYL3arwbLBBZZNTv5Pw33H8lG7pD5K009FZyNOmHTAJ/bFd1yqrgU5 aSwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770401126; x=1771005926; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=z414qbu3KY7qWY009bsyWelCEU/9PsgauzjNkRD3FqE=; b=wuxO8qc/SG7L2xX0HG0tf/LtO7gL5dxjZkkwrzFcddtNKce9pVDxNVgTO577uchG/j LKRSkXmbhddwqkKJEU1SQyekv1w5o6TtbF6ndqqbN5ZH/n1AeefxIX9FYbADr8vrzBU8 AzSZxH+0UOECVgMu3OZfgsErKK+c60tF/xf7fr620mrPu+DpXFTWS/E13X7rTUA/nq2N vB5qZ/35W5dS0EnXmwU01BI5pGUk2bdMQANKCzXHN444wpIizjH8CYGL5vikg11ohmvb dFWZnVXFCUidNTsdOb/QzuZSJxeq299SsChvonhv5t11145lxIHKb1svPs/06j9IO4cf wflg== X-Gm-Message-State: AOJu0YwA5OS3IDvx6Abjnllb1Hy9FRVDAF6UHwhYc0tgMxqOqh36njWx KohoQgnDL/lKsocDfEJ3Hep8W7Uo3To+FpaxnKgrMEI04wARUJqoCpnhjNqHJ64zzvkcMzvxHZY EKFfh+g0= X-Gm-Gg: AZuq6aK+yT87khJvxfcRz13g8z+T/V6GwSg98BxhUbMSedWks6YrcTHvlyLIpInvrMo jQ36g9PgSo4G9poy5wKua89ySWO/b43tBZaPmU9YWDHpaVKfpEYyu6FptUOlmHikutr1Eb3avWT 8atoAdSxsbkaZpupgmHc/SsgGaTZUZt7VL+Ea8b3tg/ef+I6qwen3PqcIAr3ERYsatiUWzTF4dS 9mGzqGywCGYVPyWCq53qLPbnFA+MSD1Udpk+RWLhike6hDSPjlS6d6NW+wfB5bXLGwnyc1xoG7o 1lX3XB6ntEFOX6Iw5Pa3IcLB94y9uLF8v0MY0fxg2XzB0eas8LbKkWPfHuuFWnjDHI5w+xvhyWw a66f24rYO4XIU+fHShZtb3ZzIuoic1TgYk//D+6UCg7ggKjV9OfsZqUdobdHucALYm3DxadwWeo A9HwSoW3EINr4= X-Received: by 2002:a17:906:478b:b0:b80:149b:badd with SMTP id a640c23a62f3a-b8edf34b329mr196658966b.37.1770401125979; Fri, 06 Feb 2026 10:05:25 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Yodel Eldar , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Laurent Vivier Subject: [PULL 07/10] gdbstub: Export host_to_gdb_errno File-I/O helper function Date: Fri, 6 Feb 2026 18:05:14 +0000 Message-ID: <20260206180517.1335861-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260206180517.1335861-1-alex.bennee@linaro.org> References: <20260206180517.1335861-1-alex.bennee@linaro.org> 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=2a00:1450:4864:20::62e; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62e.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, 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: qemu development 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 @linaro.org) X-ZM-MESSAGEID: 1770401223360158500 From: Yodel Eldar Move host_to_gdb_errno from target/m68k/m68k-semi.c to gdbstub/syscalls.c. Declare it in include/gdbstub/syscalls.h. Add both newly added GDB File-I/O supported errno values, EIO and ENOSYS, to the mapping. Reviewed-by: Richard Henderson Signed-off-by: Yodel Eldar Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20260116014612.226183-3-yodel.eldar@yodel.dev> Message-ID: <20260203115201.2387721-9-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e diff --git a/include/gdbstub/syscalls.h b/include/gdbstub/syscalls.h index 6200416f77a..a09559128b1 100644 --- a/include/gdbstub/syscalls.h +++ b/include/gdbstub/syscalls.h @@ -102,6 +102,15 @@ void gdb_do_syscall(gdb_syscall_complete_cb cb, const = char *fmt, ...); */ int use_gdb_syscalls(void); =20 +/** + * host_to_gdb_errno: convert host errno to GDB errno value + * @err: errno from host + * + * Given an error number from the host, this helper function returns + * its GDB File-I/O specified representation. + */ +int host_to_gdb_errno(int err); + /** * gdb_exit: exit gdb session, reporting inferior status * @code: exit code reported diff --git a/gdbstub/syscalls.c b/gdbstub/syscalls.c index d8bb90cc1c7..15050984a04 100644 --- a/gdbstub/syscalls.c +++ b/gdbstub/syscalls.c @@ -145,6 +145,42 @@ void gdb_do_syscall(gdb_syscall_complete_cb cb, const = char *fmt, ...) gdb_syscall_handling(gdbserver_syscall_state.syscall_buf); } =20 +/* + * Map host error numbers to their GDB protocol counterparts. + * For the list of GDB File-I/O supported error numbers, please consult: + * https://sourceware.org/gdb/current/onlinedocs/gdb.html/Errno-Values.html + */ +int host_to_gdb_errno(int err) +{ +#define E(X) case E##X: return GDB_E##X + switch (err) { + E(PERM); + E(NOENT); + E(INTR); + E(IO); + E(BADF); + E(ACCES); + E(FAULT); + E(BUSY); + E(EXIST); + E(NODEV); + E(NOTDIR); + E(ISDIR); + E(INVAL); + E(NFILE); + E(MFILE); + E(FBIG); + E(NOSPC); + E(SPIPE); + E(ROFS); + E(NOSYS); + E(NAMETOOLONG); + default: + return GDB_EUNKNOWN; + } +#undef E +} + /* * GDB Command Handlers */ diff --git a/target/m68k/m68k-semi.c b/target/m68k/m68k-semi.c index 578a08dfee8..bdc798a28cb 100644 --- a/target/m68k/m68k-semi.c +++ b/target/m68k/m68k-semi.c @@ -46,35 +46,6 @@ #define HOSTED_ISATTY 12 #define HOSTED_SYSTEM 13 =20 -static int host_to_gdb_errno(int err) -{ -#define E(X) case E##X: return GDB_E##X - switch (err) { - E(PERM); - E(NOENT); - E(INTR); - E(BADF); - E(ACCES); - E(FAULT); - E(BUSY); - E(EXIST); - E(NODEV); - E(NOTDIR); - E(ISDIR); - E(INVAL); - E(NFILE); - E(MFILE); - E(FBIG); - E(NOSPC); - E(SPIPE); - E(ROFS); - E(NAMETOOLONG); - default: - return GDB_EUNKNOWN; - } -#undef E -} - static void m68k_semi_u32_cb(CPUState *cs, uint64_t ret, int err) { CPUM68KState *env =3D cpu_env(cs); --=20 2.47.3 From nobody Mon Feb 9 14:02:12 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1770401175; cv=none; d=zohomail.com; s=zohoarc; b=Kwc7FHQGTnMElc4H4yQuxG1mbqy5txnDiI26fN+94rTqT2kUeqpZCcRuqe3JQY1RUuLqIsiA/zaeBmxPPe6kdcEbQQVksqadVVOQiCT3DOTrp6ZOPFjFgloKvmhPyDnIm/r+AQckgJdhKqBB69sQJYUZgsJ8QYPBwtY0zrn7+H4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770401175; 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=NuV/X2y2s0J4/FJ/QeduaBNSaM5K7IHFrxAFMtHcJQo=; b=AGu1w5Nii2t58zNI/AwAi4efmJ1ei1hcUlmIeU6DOM5ihByY4Qe6Ddv0dGnusa/3BXK6zsAUkwku48DI6jwy7940JSeXGa9P9JzL9dr7g+prI5QjjF8y9cKjMllR32d6gJGJmjCtwke829md+uGEL0Rjauhn9pLBQ3sW4ObTYXA= 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 1770401175342190.37793054736926; Fri, 6 Feb 2026 10:06:15 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1voQCy-0007zt-Qq; Fri, 06 Feb 2026 13:05:33 -0500 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 1voQCs-0007yK-4Q for qemu-devel@nongnu.org; Fri, 06 Feb 2026 13:05:26 -0500 Received: from mail-ed1-x52c.google.com ([2a00:1450:4864:20::52c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1voQCq-0001RW-FP for qemu-devel@nongnu.org; Fri, 06 Feb 2026 13:05:25 -0500 Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-6594382a264so1808334a12.1 for ; Fri, 06 Feb 2026 10:05:24 -0800 (PST) Received: from draig.lan ([185.124.0.126]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-65983eaa458sm799179a12.6.2026.02.06.10.05.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Feb 2026 10:05:21 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 81CB5607EC; Fri, 06 Feb 2026 18:05:18 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1770401123; x=1771005923; 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=NuV/X2y2s0J4/FJ/QeduaBNSaM5K7IHFrxAFMtHcJQo=; b=XHEDjN6AVvQql75bUXCZOK6X641sgZWwdEArmI/M3pNZmM+UDZ9eaGJIH6qHu9herr hIzusw5jI4l/e2YYR9kcT8dYDTC3HTKxmXO015IHyrsAzO6N4PUp9kTEXXeWhEAgL8Mx 07Xxs6hAUpUc/0V18lIsjooRuiZU/+QvSf+y+UhRitSh4B0dIR6tMO7fvOUwIAYS7q3Q vf24nYutBlNJpbNOWk3iRAoJ/wNEp4U1AYogwEB+8LJH6c85iev8n/wBBr5DQvF+sJAY ec3zUWVPkHLt7auq9wLODif84mhQAc5Jcc+2OX6S19Wvfxb4E7lmRenXtoqsrls3Iq5k jvjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770401123; x=1771005923; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=NuV/X2y2s0J4/FJ/QeduaBNSaM5K7IHFrxAFMtHcJQo=; b=c/G3J5V3VsM+12ACspeGdNXoCo9gm0+LDkLiJhCgrL8dp+9ERKFZ461LLAY231253z 2TyPikF8VDQsgwjGNQhG0x9ku/Pq/G0nSGY4vS8OHnqNbf3d+oGaCwf1NoBb9U/4sORF avifFXH01H+wT3uJzGw3EMreWTum4VmeLy6MN7FMbZAT3Rcla4+IiOsYqE9SW/gHT7Lb SwtA9PG/1RCemhMhxfOW2B1Ra2GHxnZA3zmodkBxk5z1qE+093w3zY6IVqPOr090b9R0 OLqW7jmKNKYm4gFCQ3QoRfIErXl5Sf74NLuEnVRBEd0T6R4p6p3cYOSos2Uai5PVUpyk yxZg== X-Gm-Message-State: AOJu0Yx/iyHigEtTu6yPj0ShubRjEWTMn2R8tGInJxWCePWFywbQIB+9 egp2M+ILYwA6MQZyvRJN6JxUo9NHh/22UH4nOZsfd1XXrozjPl5IgpPkxSnntw9fzPM= X-Gm-Gg: AZuq6aL1HG2PV5O2z5D6aL0Fgx0UPZS+cTmcTvMv76FzBGi7PHlUrLlJGRvsO62nrJN Zvh5tGq6n7epI1VFs7ekCURPwANEY2cm8v0O5Q6CTWzq+Xq6axt6JpM1gHRrCqqVHWTvOeecBFP ILWPZuq4TNFVDVyxorE8A4qwnveAL7bsDhBgAktUMdv1iPDIn/inaOuk6UwwkloE4qK9Jbi0fjr VrS+rd822EEebveY/oL1aqHhBwsLhF7Y9VqRSkluvBJDG2TwePGOfAyI/8l2EVB66tj+/8RmlLF 9iwGCrxJ0I3V3l8ICNO7Gk9LrnyOj3LUM0Wff71eZxiWwvrrKHdxhSy3uKyaeVwkSQmzCh5Whd3 WZFdb4oqeqXesQpEhSrejZfWV7Q3myBtmfnDhvzxxR7M4oBi8kRNCsin5c8iFc2vpch1pKrxvA0 ZWIgI5V4ySgbc= X-Received: by 2002:a05:6402:1e8e:b0:658:316c:c71a with SMTP id 4fb4d7f45d1cf-65984191cd5mr1911284a12.30.1770401122770; Fri, 06 Feb 2026 10:05:22 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Yodel Eldar , Dominik 'Disconnect3d' Czarnota , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PULL 08/10] gdbstub/user-target: Convert host errno to GDB File-I/O errno Date: Fri, 6 Feb 2026 18:05:15 +0000 Message-ID: <20260206180517.1335861-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260206180517.1335861-1-alex.bennee@linaro.org> References: <20260206180517.1335861-1-alex.bennee@linaro.org> 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=2a00:1450:4864:20::52c; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x52c.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, 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: qemu development 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 @linaro.org) X-ZM-MESSAGEID: 1770401176992158500 From: Yodel Eldar Use host_to_gdb_errno to convert host-supplied errnos to their GDB File-I/O remote protocol values, and use them in F reply packets. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2751 Reported-by: Dominik 'Disconnect3d' Czarnota Signed-off-by: Yodel Eldar Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20260116014612.226183-4-yodel.eldar@yodel.dev> Message-ID: <20260203115201.2387721-10-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e diff --git a/gdbstub/user-target.c b/gdbstub/user-target.c index 43231e695e8..7ef0282f70e 100644 --- a/gdbstub/user-target.c +++ b/gdbstub/user-target.c @@ -10,6 +10,7 @@ #include "qemu/osdep.h" #include "exec/gdbstub.h" #include "gdbstub/commands.h" +#include "gdbstub/syscalls.h" #include "qemu.h" #include "internals.h" #ifdef CONFIG_LINUX @@ -315,7 +316,8 @@ void gdb_handle_v_file_open(GArray *params, void *user_= ctx) int fd =3D open(filename, flags, mode); #endif if (fd < 0) { - g_string_printf(gdbserver_state.str_buf, "F-1,%x", errno); + int gdb_errno =3D host_to_gdb_errno(errno); + g_string_printf(gdbserver_state.str_buf, "F-1,%x", gdb_errno); } else { g_string_printf(gdbserver_state.str_buf, "F%x", fd); } @@ -327,7 +329,8 @@ void gdb_handle_v_file_close(GArray *params, void *user= _ctx) int fd =3D gdb_get_cmd_param(params, 0)->val_ul; =20 if (close(fd) =3D=3D -1) { - g_string_printf(gdbserver_state.str_buf, "F-1,%x", errno); + int gdb_errno =3D host_to_gdb_errno(errno); + g_string_printf(gdbserver_state.str_buf, "F-1,%x", gdb_errno); gdb_put_strbuf(); return; } @@ -350,7 +353,8 @@ void gdb_handle_v_file_pread(GArray *params, void *user= _ctx) =20 ssize_t n =3D pread(fd, buf, bufsiz, offset); if (n < 0) { - g_string_printf(gdbserver_state.str_buf, "F-1,%x", errno); + int gdb_errno =3D host_to_gdb_errno(errno); + g_string_printf(gdbserver_state.str_buf, "F-1,%x", gdb_errno); gdb_put_strbuf(); return; } @@ -373,7 +377,8 @@ void gdb_handle_v_file_readlink(GArray *params, void *u= ser_ctx) ssize_t n =3D readlink(filename, buf, BUFSIZ); #endif if (n < 0) { - g_string_printf(gdbserver_state.str_buf, "F-1,%x", errno); + int gdb_errno =3D host_to_gdb_errno(errno); + g_string_printf(gdbserver_state.str_buf, "F-1,%x", gdb_errno); gdb_put_strbuf(); return; } --=20 2.47.3 From nobody Mon Feb 9 14:02:12 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1770401193; cv=none; d=zohomail.com; s=zohoarc; b=A4ZyGkDjrWRjksjCZIArpdsd2VTa1JWsT+PL6ziio9aYDmBKQ+IoPEqijDjxSFfymrq6/uce0Eu8cW/F86d4EJU0RWXN7YHG0CB89deFTJsytEPS1ygPhHMQ7JYy42WtSbhA/0UyoI7OtmI2wbm/VdsOZruq+dNWQSSSsIUe5nA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770401193; 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=wSmPsPtEqgdwdOtebkrXfxyaMmCrLsU35/EBxykfB3U=; b=dmm7IHIWtxsZOuAyEt6GaIozo5JSnpecSQ7ybjy5gKhn5LEiscMBPtPKf4OAL6H+UEhrwVs5nkoGFMWdrmKirN5porM9a3xsOk+SaEnvaHKqyf1aLvupw6Udc65ri0FrQobySYyDK2GObzgot3rZCM6NNYYca771jz9lkmfTGZw= 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 1770401192982513.6738386537766; Fri, 6 Feb 2026 10:06:32 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1voQD0-00082Z-1K; Fri, 06 Feb 2026 13:05:39 -0500 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 1voQCt-0007za-5h for qemu-devel@nongnu.org; Fri, 06 Feb 2026 13:05:27 -0500 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1voQCr-0001Ry-Fd for qemu-devel@nongnu.org; Fri, 06 Feb 2026 13:05:26 -0500 Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-64d1ef53cf3so2670945a12.0 for ; Fri, 06 Feb 2026 10:05:25 -0800 (PST) Received: from draig.lan ([185.124.0.126]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8eda7a3004sm101816266b.15.2026.02.06.10.05.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Feb 2026 10:05:21 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 96908607F0; Fri, 06 Feb 2026 18:05:18 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1770401124; x=1771005924; 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=wSmPsPtEqgdwdOtebkrXfxyaMmCrLsU35/EBxykfB3U=; b=nfD2bQSU4nWHxUOj//2PEQX9q2RAK9u2eRvMv77A1h+jCe0YrF757FbJTtD9HcDrzX 9uCIXEMwmXasma6VkZ/J7d+I/yoFrUyBj4jsXphqTtSH5mZ/ZlRy/7xPoYlcZV8YFpCm pySRmh+BblheHUl/rJtdKum3m7PqqguA5ACyDlXJSdxzjVg65cdR5fshkuQEwb0ECiIQ dfPyQYm/xRJNF3hm/15u/Ti/T9YAhv0wm/ycfcGW1McREIRKQNJcapqKjX0/Q4IeCAHC 0L7psZQ0R7gRqO5u/2vD7+6uoQ12chXsjon6fkweUykd3zXdpDiJICTG3gaG4RQfZp60 OUKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770401124; x=1771005924; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=wSmPsPtEqgdwdOtebkrXfxyaMmCrLsU35/EBxykfB3U=; b=MTMI/VqXKUYmQtWxzYtCjdXTTFRc0eVHKfY1Cq2GgJtJEqaCduggHAEYmN1D13vZdp SQTWWCLpRHwmBEsdAUvRHpG5pkYEUZ7QDgKNLU9RCw1lLEErsOoaX/qTpIeCbO9gJRJP UqPump2fE0j3QYz3WYo1R4+RjEaxXUczabd8K4tIowK9uDq/3hhsV3HqRh+DuRrcInF3 EmWSmUb9rGi3Ye127uMs6zFQ3Ve/u22KU3irGPe3lR5ZTd3Nk3FfNAdUMlhGd/7k7eNB F5cWdImrLMd7GLL2rCHcLodGhcJssA2UsBPdYJzDtkH0ZU9dOI8/4nVq5gqgoZD7C/tW Yumw== X-Gm-Message-State: AOJu0YwI3X5TCstWVlEY7amJ6Mo4+WeSJ/9Oldn1c1gWb2KlLpHyT9IV cW21uDHLxL9Y8wdJA7qd87J3GKWp36qRmRYMD8gwyDRrfBa4wukq7Hf9FWcQn5TV+eRztfeh7Nd zpuG4PMQ= X-Gm-Gg: AZuq6aJS7s6/pB5AJKUMCbYwgGqhobGgddTXXvIloEsTNu1T3Wp+/pNDHfTfm7wgZ1p 3CtBSs54/Z0XNj/YOxxSW0xxUx7n0FWZd82tdHfev4XTen7D3mEXGGBRdrNqe+J5Dl8xfvbKgkI mHAwd7rB1VbdQ9V7tmwdcF5vmt1gxifXyOdfHDsT12Pjpyc+hk7vQYbba5QlANb9ODNfDdlIYIR PF9FZ9Lv1v1yDUThDw5KOoYxbyC+o24xB0kKzupSEhyS7hNxq1iNyL286gwIZGptiYvt76pqXs8 Z/2RimibIdRfRj/X4JfJJIi6Y3yGBCrWgycZUCLLTqT7NS5sUAm4pGqj/Ucb7clmoF4VhajYsE9 xkWKp6isZPlFHLdakS545FdtS3eFffnIb2KoEo4aAzZVrd9Rn0ntguLrdSNFGD7nJOnIr5jFYvC X3RNi5R9QkoIbVc3zrdkSiuA== X-Received: by 2002:a17:907:3dac:b0:b8d:bf38:7025 with SMTP id a640c23a62f3a-b8edf1a6518mr188090866b.16.1770401124032; Fri, 06 Feb 2026 10:05:24 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 09/10] include/gdbstub: tweak language Date: Fri, 6 Feb 2026 18:05:16 +0000 Message-ID: <20260206180517.1335861-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260206180517.1335861-1-alex.bennee@linaro.org> References: <20260206180517.1335861-1-alex.bennee@linaro.org> 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=2a00:1450:4864:20::531; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x531.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, 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: qemu development 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 @linaro.org) X-ZM-MESSAGEID: 1770401195375154100 While "iff" means "if and only if" it might look like a typo to those not familiar with this mathematical abbreviation. A plain "if" is clear enough. Message-ID: <20260203115201.2387721-11-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e diff --git a/include/gdbstub/commands.h b/include/gdbstub/commands.h index bff3674872e..989a95c33f9 100644 --- a/include/gdbstub/commands.h +++ b/include/gdbstub/commands.h @@ -50,7 +50,7 @@ typedef union GdbCmdVariant { * '.' -> Skip 1 char unless reached "\0" * Any other value is treated as the delimiter value itself * - * @allow_stop_reply: True iff the gdbstub can respond to this command wit= h a + * @allow_stop_reply: True if the gdbstub can respond to this command with= a * "stop reply" packet. The list of commands that accept such response is * defined at the GDB Remote Serial Protocol documentation. See: * https://sourceware.org/gdb/onlinedocs/gdb/Stop-Reply-Packets.html#Stop-= Reply-Packets. --=20 2.47.3 From nobody Mon Feb 9 14:02:12 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1770401174; cv=none; d=zohomail.com; s=zohoarc; b=ft7t3QnoLlxYOVC4feJ6C3laaIi2Ufi7rgXsyaode6iz5w/waGxGHFd+fRbLkNFwkChnky9CA82KCIBxjuYtK1V62aczNJPR4SZ3vbAgL4rRUPSkDpx6pbpnuX86PuVrg6m4sKxrCfpDlTlRieoaWhVdck4mZHvGiJCZ4KGCfOA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770401174; 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=qwXkUMwHAuqjDWUozerEk2bUCL3Vv3f1bbvZHeOQq6U=; b=YfXCsZzZkp//n+h7eIIXN5JezB/OG3MV2VjBYbbQ62SpoBkPC8280HdGsU4a+wTpCGK/OXWQsj+kOtxQEVlLKC2zwMAMVe4lycQehNvaC5z45cztLcXstHO8E1AoMCduUPx5vd6n9T4A4cfVcatAY8i9Y75W1O99CE7OQpE/mkI= 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 1770401174151367.72110379180936; Fri, 6 Feb 2026 10:06:14 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1voQDF-0008RL-H8; Fri, 06 Feb 2026 13:05:49 -0500 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 1voQCu-0007zk-1U for qemu-devel@nongnu.org; Fri, 06 Feb 2026 13:05:28 -0500 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1voQCs-0001SH-Ga for qemu-devel@nongnu.org; Fri, 06 Feb 2026 13:05:27 -0500 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-b883787268fso149155266b.3 for ; Fri, 06 Feb 2026 10:05:26 -0800 (PST) Received: from draig.lan ([185.124.0.126]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8edae3ae99sm102879666b.60.2026.02.06.10.05.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Feb 2026 10:05:21 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id AC8EE60804; Fri, 06 Feb 2026 18:05:18 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1770401125; x=1771005925; 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=qwXkUMwHAuqjDWUozerEk2bUCL3Vv3f1bbvZHeOQq6U=; b=yK+V51caqeXUIUNLtbLMK2xdnCj/LWZ0D3miERSZ7oItp9glqLZ1Dqc1+tuHh+6gQs nG9g4iK/rEA9DwSamxQl+QpCK80EnNkvSWuLpzgRkCx7y/20/UgVQBZFkjda9Co9hGY6 xgioqjznVMEM2SFA4Jeqg0C+Q0uZpFTWkL/zIaEe1DcXcIGxXIjDTM8ScRwgE4Q2zjuM MTrb+fYALzzz+T/IhnvFzRhh3rAgjca2rSRPA4LIntiV/97koCl4DJqqc6KeG6G0LsyG 6aMVCwjcOOkIGsu3eaiEHXnMiq76mDXXtdDIANIo1A8wvSlefH5D4VlRw9rmYa/hTyk9 Nl6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770401125; x=1771005925; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=qwXkUMwHAuqjDWUozerEk2bUCL3Vv3f1bbvZHeOQq6U=; b=CWG2BY0eghJIM7FdJH4NXEuf6LcIAqOQ0oNvXt3eeQg5mSmfk9i5Ukx0JwhcN2Bky2 zqln03lI+1FhTSY6d+b3vDwuwc38V8+QbB3PB1bF+znPon8jmiWxQ9HKpioQtTYq9NOy Z37ohvEhh4NtMUScaL9vkpKK+EPoTO3qkO/4d39avZQ2C56y8aFs4xeXLN27rjNounib D/tAyZ4prhdKQfjSIkdhCPcjATxqUbj5JRLiF2aWjEVRNGsjrw549qUuAjv1cNAuVpUW tTJrpTi7hOrjjg100yyqHzJZJy7D7sTdnayKn8IbFSDo3xP68/5UjAHHtCwq9oCiw4vu uJiA== X-Gm-Message-State: AOJu0YwV58d2ic41qYRScd0szVxboSvcTZhq7KH2sqoTibNC/eW2pied rMZ3V3QefpwB8krxa62Hc3C/eSGjddYfc3uC/a7WfctpnK+F+Zyk8/urZWf/resmnP6FBUGf9tK 1I4jfmW4= X-Gm-Gg: AZuq6aJoEJnJB6WNaIIwGH49aE+xlk1W5uZCML/+Z6kpXBZMozv/oGzRQmksYyKCvqi haPbXldJKPrgu3IUMEJ5rnBD5BOSNIm963ubhLdkBOgKxGayNevnAdA5p/o5tnXWS+phHNkXVia x/sZAWZNHP2ZauUilGlMPTOyCndpSNY1wnvyy7cgrS9WG7hYFf1Cf2RYwXlapDRrGHuM4tl8P/R FB45WOr+BDE7eBxoZQ+sGzEc7jw1n1iCksIDvKihm5kZtBy4Qz25OE2hjTN9siSFxFlWdWdsHtG fwtzCQz8i0hHNVQJFJesQFXmvpBTS7RbaGV0DZx7B0jvv/JSjMo+PHebEDz1lUaRgXPL1fb+RS/ qAMoHKIku50KCAJ9YX19JcMnnEEeDtaIDqqT1bzQbXnOoYC6nmUh9ZvhlXcYd5i3Y2Wbma6G2FG T8/MhV0kPJigs= X-Received: by 2002:a17:907:e110:b0:b88:48ba:cdd with SMTP id a640c23a62f3a-b8edf33e446mr147145966b.43.1770401124674; Fri, 06 Feb 2026 10:05:24 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 10/10] gdbstub/user: rename and use bool for running_state Date: Fri, 6 Feb 2026 18:05:17 +0000 Message-ID: <20260206180517.1335861-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260206180517.1335861-1-alex.bennee@linaro.org> References: <20260206180517.1335861-1-alex.bennee@linaro.org> 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=2a00:1450:4864:20::633; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x633.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, 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: qemu development 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 @linaro.org) X-ZM-MESSAGEID: 1770401176961154100 This is just a clean-up to document what we using the running variable for in user-mode. Reviewed-by: Richard Henderson Message-ID: <20260203115201.2387721-12-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e diff --git a/gdbstub/user.c b/gdbstub/user.c index a16f37616b1..97eb13e796a 100644 --- a/gdbstub/user.c +++ b/gdbstub/user.c @@ -87,7 +87,11 @@ enum GDBForkMessage { typedef struct { int fd; char *socket_path; - int running_state; + /* + * running state of the guest, when we process a packet that restarts + * the guest we set this to true. + */ + bool running; /* * Store syscalls mask without memory allocation in order to avoid * implementing synchronization. @@ -241,8 +245,8 @@ int gdb_handlesig(CPUState *cpu, int sig, const char *r= eason, void *siginfo, =20 sig =3D 0; gdbserver_state.state =3D RS_IDLE; - gdbserver_user_state.running_state =3D 0; - while (gdbserver_user_state.running_state =3D=3D 0) { + gdbserver_user_state.running =3D false; + while (!gdbserver_user_state.running) { char buf[256]; int n =3D read(gdbserver_user_state.fd, buf, 256); if (n > 0) { @@ -611,11 +615,11 @@ void gdbserver_fork_end(CPUState *cpu, pid_t pid) =20 gdbserver_state.state =3D RS_IDLE; gdbserver_state.allow_stop_reply =3D false; - gdbserver_user_state.running_state =3D 0; + gdbserver_user_state.running =3D false; for (;;) { switch (gdbserver_user_state.fork_state) { case GDB_FORK_ENABLED: - if (gdbserver_user_state.running_state) { + if (gdbserver_user_state.running) { close(fd); return; } @@ -728,7 +732,7 @@ void gdb_handle_query_attached(GArray *params, void *us= er_ctx) =20 void gdb_continue(void) { - gdbserver_user_state.running_state =3D 1; + gdbserver_user_state.running =3D true; trace_gdbstub_op_continue(); } =20 @@ -750,7 +754,7 @@ int gdb_continue_partial(char *newstates) cpu_single_step(cpu, gdbserver_state.sstep_flags); } } - gdbserver_user_state.running_state =3D 1; + gdbserver_user_state.running =3D true; return res; } =20 --=20 2.47.3