Message ID | 20240305121005.3528075-3-alex.bennee@linaro.org |
---|---|
State | Superseded |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:a5d:48c8:0:b0:33e:474f:8c56 with SMTP id p8csp397090wrs; Tue, 5 Mar 2024 04:11:58 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXXPj9kNfFqOMKZSii0dXIRZ2p5408hALhomB/Uhm3Mf6oEg536lXlZ4jhS0SAvLS1d+QflaHWt0e1u2428sAEg X-Google-Smtp-Source: AGHT+IGcWwSXkFZmBMeAYjgrMqUvqdMMwUVEoWvosUAED23BQ7K4X6Iom1UQfsn4jJFP8+bVzWpK X-Received: by 2002:ac8:5f8c:0:b0:42e:f69d:7115 with SMTP id j12-20020ac85f8c000000b0042ef69d7115mr1664031qta.9.1709640717824; Tue, 05 Mar 2024 04:11:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709640717; cv=none; d=google.com; s=arc-20160816; b=aGnF617GLVWqpZHeLohnFCQy+Tq5iGypwgabreYmyWEo1IkUYTp4YKJcDTJmo/Xp9Y Tlok8vM6c67s4vqTC7J9luLTD4C5UmlLYAKcOhvdFppnDYsQn8DtqPxZ799aP6ff+mTz 4/TmvqE8LFpA5QB0rvGBe6HdynmVCEk5UXBO3jmyIKGFyt2GH8PcWdXWYTRdUfbq6xWa 4aSRcknTsMCAe/5aGsGxvTPG7zB7OeFOH5d7CLAQo/aQ/JnERdHQoVIgHjDSJDEj2ZMV h9WctaZDO5DqbQsAMfJIuh0v0aNnm3lMlfNQxa+ku8BbveQ5SEf72ObsRuJ3t4nGoG1b g9Zg== 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=1AT7cxGTPpcWYG5sWFRMol9k8JFzimRlPNRIRTYHRNg=; fh=f6avZL29XgA8xpJjruaeiY/t2FUw83MgiNvVXs1rDYg=; b=xkI6K15GjVmn/9rIEPudMevA5lfj0OT0og7MdYQxJlidrU6xfwKpVukxpBGxvMmdZW r8LY37y4Jsk1Oka77AAffOfag5o7sioZlluxpbpW84Gd+j0t+o5aQYqp3cyr6wmQaBTK Ygx3F9QZHrPXH0QPBGOAUlrnxHybJKAvr6Yz7rmbVyWKzS6SLSeJp1TYqGTQut5NcHlO BKgsl4gCnRknzdbCi79vUevuQbvrf4tBOGTSrTajA9y1jN0KJmXTnV9K7cVUgF6ce1L6 zEnFXgtCfF1bmCd1oaOUvDpTFuLtxX45WEBj+6Vv7DtS7ZHFopBJqLG9U2kwAEGqhwhl gGYg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PSXDaX0H; 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: <qemu-devel-bounces+patch=linaro.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id l12-20020a05622a174c00b0042ef8964b8esi2974428qtk.104.2024.03.05.04.11.57 for <patch@linaro.org> (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Mar 2024 04:11:57 -0800 (PST) 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=PSXDaX0H; 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 <qemu-devel-bounces@nongnu.org>) id 1rhTdd-0002Me-9U; Tue, 05 Mar 2024 07:11:17 -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 <alex.bennee@linaro.org>) id 1rhTci-0001Yn-Qi for qemu-devel@nongnu.org; Tue, 05 Mar 2024 07:10:22 -0500 Received: from mail-lj1-x236.google.com ([2a00:1450:4864:20::236]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <alex.bennee@linaro.org>) id 1rhTcZ-0001C8-2S for qemu-devel@nongnu.org; Tue, 05 Mar 2024 07:10:20 -0500 Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-2d24a727f78so68310941fa.0 for <qemu-devel@nongnu.org>; Tue, 05 Mar 2024 04:10:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709640608; x=1710245408; 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=1AT7cxGTPpcWYG5sWFRMol9k8JFzimRlPNRIRTYHRNg=; b=PSXDaX0HveSCBlvqTy56KKU4A+Ckn5NB8GfSmvbBC3+r/M31oRox+YCZRozqzORLb2 ix037KNkIUeJfhvWiPoeuVqmLnxttjxtjhsxuihPFk6cAFIN+Cc02D8qV6g43gNTAAyg u34Vd9LoLOPzzjci2LXlqu4U59U4FmPgvzRH/wXIS9hgXgMPD5iK8lKF5KBPHpzBirDe yU9iSSgCmuUA1ncu6hEBVdauHt5I2+Z0IwWP+p/6vZDqC7DhW/zuzSCh5Mjbvn1HR+sb osX2TFWfPS39K6Z33yot2zLg0jm2O4FuAJDhAigAi2+ev4JWDoIXTWl/v9IZ92kF5PrJ zYqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709640608; x=1710245408; 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=1AT7cxGTPpcWYG5sWFRMol9k8JFzimRlPNRIRTYHRNg=; b=CRYELGmZB0Zn3ap+O9t9bNd6EuAvayLhoXkIoD2EzBkkwLd0jlFjyTT1Su/MmF2ABs Yqxu+p90wFU11zekswxGYReW6QdQUdv3DDGwXZYTZnAgVaquHg0U3TRijCHlO6uo55z3 E7VIzBnlZ/OVKBbX4OXANetF6G/yF1JZpVqVFarnrMknrOL1Yggq981h4IoAwHDxFy6/ 6iYyLKjEGNaNKVYWCUxlgkcW+dr6Ves3n8O0C/5+/1RSw1S6PW97bE1m9TrBaHCtoasx LljsGNC7CuEXwptoKZ8U+G9UaBcQQZWzUDP+rb0LQ7K0AN6cP7xvWVZ2xczD2FadyGGC QSPg== X-Gm-Message-State: AOJu0YxLybRb9DYqg8obgJx8fFIBNAxiPlmtUPRC2+oOxm3sJWUbVcOZ /mE9a2LCcw/SnChOVVKJOzaKR2fpQSE+8N4z20FCWUsCy1YXoH70zdZq+YfAEFxiQGUp2hy1WWW M X-Received: by 2002:a05:651c:150:b0:2d3:56df:ea4b with SMTP id c16-20020a05651c015000b002d356dfea4bmr1388334ljd.41.1709640608205; Tue, 05 Mar 2024 04:10:08 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id n37-20020a05600c3ba500b00412e58be350sm5058056wms.1.2024.03.05.04.10.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Mar 2024 04:10:05 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 92CA65F94F; Tue, 5 Mar 2024 12:10:05 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= <alex.bennee@linaro.org> To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta <wainersm@redhat.com>, Alistair Francis <Alistair.Francis@wdc.com>, Nicholas Piggin <npiggin@gmail.com>, Liu Zhiwei <zhiwei_liu@linux.alibaba.com>, Richard Henderson <richard.henderson@linaro.org>, Yanan Wang <wangyanan55@huawei.com>, qemu-s390x@nongnu.org, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, Eduardo Habkost <eduardo@habkost.net>, Daniel Henrique Barboza <dbarboza@ventanamicro.com>, Michael Rolnik <mrolnik@gmail.com>, Daniel Henrique Barboza <danielhb413@gmail.com>, =?utf-8?q?Alex_Benn=C3=A9e?= <alex.bennee@linaro.org>, Laurent Vivier <lvivier@redhat.com>, Yoshinori Sato <ysato@users.sourceforge.jp>, Laurent Vivier <laurent@vivier.eu>, Thomas Huth <thuth@redhat.com>, Peter Maydell <peter.maydell@linaro.org>, Mahmoud Mandour <ma.mandourr@gmail.com>, Brad Smith <brad@comstyle.com>, Alistair Francis <alistair.francis@wdc.com>, Brian Cain <bcain@quicinc.com>, Cleber Rosa <crosa@redhat.com>, John Snow <jsnow@redhat.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Pierrick Bouvier <pierrick.bouvier@linaro.org>, Palmer Dabbelt <palmer@dabbelt.com>, Riku Voipio <riku.voipio@iki.fi>, qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Weiwei Li <liwei1518@gmail.com>, Bin Meng <bin.meng@windriver.com>, =?utf-8?q?C=C3=A9dric_Le_Goater?= <clg@kaod.org>, Beraldo Leal <bleal@redhat.com>, Kyle Evans <kevans@freebsd.org>, David Hildenbrand <david@redhat.com>, Song Gao <gaosong@loongson.cn>, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <philmd@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>, Alexandre Iooss <erdnaxe@crans.org>, Warner Losh <imp@bsdimp.com>, qemu-riscv@nongnu.org, Ilya Leoshkevich <iii@linux.ibm.com> Subject: [PATCH 02/29] gdbstub: Support disablement in a multi-threaded process Date: Tue, 5 Mar 2024 12:09:38 +0000 Message-Id: <20240305121005.3528075-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240305121005.3528075-1-alex.bennee@linaro.org> References: <20240305121005.3528075-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::236; envelope-from=alex.bennee@linaro.org; helo=mail-lj1-x236.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org |
Series |
maintainer/next for 9.0 (testing, gdbstub, plugins, disas)
|
expand
|
diff --git a/gdbstub/user.c b/gdbstub/user.c index 14918d1a217..3ce20b7bbfc 100644 --- a/gdbstub/user.c +++ b/gdbstub/user.c @@ -356,16 +356,27 @@ int gdbserver_start(const char *port_or_path) return -1; } +static void disable_gdbstub(CPUState *thread_cpu) +{ + CPUState *cpu; + + close(gdbserver_user_state.fd); + gdbserver_user_state.fd = -1; + CPU_FOREACH(cpu) { + cpu_breakpoint_remove_all(cpu, BP_GDB); + /* no cpu_watchpoint_remove_all for user-mode */ + cpu_single_step(cpu, 0); + } + tb_flush(thread_cpu); +} + /* Disable gdb stub for child processes. */ void gdbserver_fork(CPUState *cpu) { if (!gdbserver_state.init || gdbserver_user_state.fd < 0) { return; } - close(gdbserver_user_state.fd); - gdbserver_user_state.fd = -1; - cpu_breakpoint_remove_all(cpu, BP_GDB); - /* no cpu_watchpoint_remove_all for user-mode */ + disable_gdbstub(cpu); } /*