Message ID | 20220610160738.2230762-28-peter.maydell@linaro.org |
---|---|
State | Accepted |
Commit | ebf1b4cbb8ec357f5280dc8895548519b65a2d71 |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:a05:7000:5806:0:0:0:0 with SMTP id j6csp1915699max; Fri, 10 Jun 2022 09:49:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzg4moE8L3QokqsQIxlfUXX0IlI64jTSM2fUd09ASr/BZp2t0U5ISymywiiUxoVr5vTQFOq X-Received: by 2002:a05:622a:1347:b0:305:9ae:4bca with SMTP id w7-20020a05622a134700b0030509ae4bcamr9845439qtk.421.1654879745629; Fri, 10 Jun 2022 09:49:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654879745; cv=none; d=google.com; s=arc-20160816; b=LHVVnSkNjn7Red8zABOocFzN5aVF9yQBwz7zoyZJHa/xayDAu/m+l0E3w4kjjWHNzA 6H7nkB8LZHEap02ZMauA16DBhNd8fCQsCiK7p+IBjOgGYjNL5a0gW9RAveyPqfDfVWH6 2n5BHnhhuRfmFBldd3t3J6d1YAjDS0Q8CC6NnYmkCVd/S/ISuVYTDBZZapTGal+vRMHZ TO527ZdvwwWBGDjWDH562nLMUFIhRDsd0md4PbhDA5/KdIs/iVdYOhrIzZJVqPyOImo9 k8ph1zv/vgHIICffRe+4qy5Qu8Oy6TGCm0HGDr3/OpMe6RUWXavu6AoUt/cd1Hg48GBW hrWg== 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:to:from :dkim-signature; bh=7uLUkIKv9rA0htRASzFEYEP1w+WXslMGtSO7U8RJ4TM=; b=PUY2x+l0+FvdZplvzzj+o2+089UUzbwOSm/9XMF9/JCnUCq9kPVKpa6oLcLta6rOIG wITB6KUcj3ehauJVNeNNB5PF8jZUG+MBF+aeVCKzyR2yFbx+bQ652hw89BWNoyYrFWtG Umzc07Uh8aBUfbrPk1inQikZn6raoPwRkB9eND0zoIwpOgb5VAiZ0QuHOiowFqVyuORz m74Bu9hSsQIwQVGmyNZhXZgTyZ/f+MsUMU352rbdC1F55i0b5p5Eq75ZwmHa/TEYaPGI /h/5GaRUnePyONxy6qhO6SvOyI3mrO4cpwFYQe0oc0c41Q9cNP4snJVTa91TYbV2PjEl c3Pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IiZUgmkX; 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 w15-20020a05620a424f00b006a5f2768a84si16345097qko.538.2022.06.10.09.49.05 for <patch@linaro.org> (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 10 Jun 2022 09:49:05 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IiZUgmkX; 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]:45518 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces+patch=linaro.org@nongnu.org>) id 1nzhon-0004rN-6x for patch@linaro.org; Fri, 10 Jun 2022 12:49:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37620) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <peter.maydell@linaro.org>) id 1nzhBN-0008Uw-Q2 for qemu-devel@nongnu.org; Fri, 10 Jun 2022 12:08:22 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]:55028) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <peter.maydell@linaro.org>) id 1nzhB7-0007Ih-3h for qemu-devel@nongnu.org; Fri, 10 Jun 2022 12:08:21 -0400 Received: by mail-wm1-x333.google.com with SMTP id n185so14102505wmn.4 for <qemu-devel@nongnu.org>; Fri, 10 Jun 2022 09:08:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=7uLUkIKv9rA0htRASzFEYEP1w+WXslMGtSO7U8RJ4TM=; b=IiZUgmkXSjwTDFhf30NPvv+rvdwtj/QGiQwAWlvcgXTNeS3xDKHf+SvwxQ19DLfdnG /lvskCCpUy/P87Ou51cl0hpYvG/0GHhBRvv9OABvQM+q1YCgWupT/64Hz2847m9tuCGJ Lk4LrZucWbqxGaeUpAWEEPPHMZwHDZwCd1VpSHANczM4UmZchXk6NdMEEgSJOYvNF7y1 1sBUxbXdPP6MxAFTs8CIinEfvL9zO/l4nUT0eFbTlnyAG14DeVpQsEZG1whsHm/GUt4y AWSzm7kMSsNRsdAzXMuB1E+ZG0bXbeuxb5P1aSDje87HXH4rOlVU4zDPTD1YwAXFxkon 6vxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7uLUkIKv9rA0htRASzFEYEP1w+WXslMGtSO7U8RJ4TM=; b=Qas3+L2OIt5haX8yotLnQAVO15QL7JM5hhmb0uBs5HZgfZFWmok9mnlSO+Uq9SkhIK +iGAQzI+84ZqA1K6UDgZiio3tHEGejIVRAKDf4CYpGFzwbIbnSKnTnQQp1e9IWhqjt8t Yr82kiOMoJxJFfdMi6taODWm6QYTre15WQS1zndr5o1eiEeNo2P2cxPBYOn+jsKm0x7u 9Q8DzlBeCsMFJZpw7CdsrsWYvqyrHaMKmffqNKKW3W+rdVPikzx3TbpzNmJK+W+ZGNcu xR7wM8S+px0iYS3m2dfKBCx/p8P4qIjdzGk7SyVAeRU5JWglkv6GQAw19I/eeb/3l4Qb Oyeg== X-Gm-Message-State: AOAM533pxoQzY0ra2ECBKZXO6Q/XxezpTc2NjExzLmywntzQBz7jKIWd 3FywDNX7wrdaiHEEzrl28DvWAIWzFShuzw== X-Received: by 2002:a7b:c392:0:b0:39c:4d27:e698 with SMTP id s18-20020a7bc392000000b0039c4d27e698mr468566wmj.57.1654877283669; Fri, 10 Jun 2022 09:08:03 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id bp11-20020a5d5a8b000000b0020c5253d926sm14276053wrb.114.2022.06.10.09.08.03 for <qemu-devel@nongnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 09:08:03 -0700 (PDT) From: Peter Maydell <peter.maydell@linaro.org> To: qemu-devel@nongnu.org Subject: [PULL 27/28] gdbstub: Don't use GDB syscalls if no GDB is attached Date: Fri, 10 Jun 2022 17:07:37 +0100 Message-Id: <20220610160738.2230762-28-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220610160738.2230762-1-peter.maydell@linaro.org> References: <20220610160738.2230762-1-peter.maydell@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::333; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x333.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: <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" <qemu-devel-bounces+patch=linaro.org@nongnu.org> |
Series |
[PULL,01/28] target/arm: Mark exception helpers as noreturn
|
expand
|
diff --git a/gdbstub.c b/gdbstub.c index a3ff8702cef..88a34c8f522 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -443,6 +443,15 @@ static int get_char(void) } #endif +/* + * Return true if there is a GDB currently connected to the stub + * and attached to a CPU + */ +static bool gdb_attached(void) +{ + return gdbserver_state.init && gdbserver_state.c_cpu; +} + static enum { GDB_SYS_UNKNOWN, GDB_SYS_ENABLED, @@ -464,8 +473,7 @@ int use_gdb_syscalls(void) /* -semihosting-config target=auto */ /* On the first call check if gdb is connected and remember. */ if (gdb_syscall_mode == GDB_SYS_UNKNOWN) { - gdb_syscall_mode = gdbserver_state.init ? - GDB_SYS_ENABLED : GDB_SYS_DISABLED; + gdb_syscall_mode = gdb_attached() ? GDB_SYS_ENABLED : GDB_SYS_DISABLED; } return gdb_syscall_mode == GDB_SYS_ENABLED; } @@ -2886,7 +2894,7 @@ void gdb_do_syscallv(gdb_syscall_complete_cb cb, const char *fmt, va_list va) target_ulong addr; uint64_t i64; - if (!gdbserver_state.init) { + if (!gdb_attached()) { return; }