From patchwork Wed Feb 7 16:38:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 770644 Delivered-To: patch@linaro.org Received: by 2002:a5d:40c1:0:b0:33b:4db1:f5b3 with SMTP id b1csp400814wrq; Wed, 7 Feb 2024 08:39:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IGXcgrMKsd3fECI04eW0WepVgFv6E5vKZLTmM3+hRHKofh2lrRnjasRiNOVin2S7GEUtE+t X-Received: by 2002:a05:620a:21db:b0:785:4129:8c4b with SMTP id h27-20020a05620a21db00b0078541298c4bmr5975678qka.77.1707323989311; Wed, 07 Feb 2024 08:39:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707323989; cv=none; d=google.com; s=arc-20160816; b=pHtrJu3sPXOOpdwd91+N770T9H4rT0T+v+w9Z5TanoQTEJ2Y9J4kZenJ/OGesFqEQg NMjsNQ0xw3RILZhQ5F7um7nX1Hq2Q6sGjE/EyOhBd4mIQtOUIsxp1QoduTYcW0dp2Y9E 4DSE4FKQfJQ5+p02xtDDqTkvXXczY3BYz+pDCuypJNaVWHiNF8nOZ2JT12Zn3ysM/HRz Jf+vky428U5ity9y9t7NEdEsPIlBMagQsi0n4OJY4mJgEnr+FJI63UmhDyTnQJE68uZv cl/gAv6Yc3rj8j1BDdjKZraKzbTRgZZaD8sDHslhKROVC8iYCXX1kSrzhL8JSZcsf0eL W17w== 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=oWoGzkk5jlTntsP9Fp0ezGwzMskb1JgO0OTcfpG0rf4=; fh=HUlDND/9JLWYpf1VUzgg7d3FAR+8jEbcAUFMbcJydLk=; b=BppYpOTgU3qTIg0NLaAO1NCAGvlR2LZ1BeoPkPSKwC5DoQ9xYgXciPm+RdR1CVm6SF AD/bpO5yAfZq/Vyol9R7e8clIUTWYsRv9OIb+5BWL+eLah2/syiCTnkmjdWMIcEvR343 LWvvvk3vG5ygkxjVfIQdhHa4CMphK5M/7SDgqyye9f8VJW2ZIkEZbwoytrhAPzfXEMFT 4QdPVIHCRB1jPEv82BIi70FFPF6Vz7JeMMFaqPGD7JrpoarIZFztI5fKqJ23l9ybgNGd fMy/3a1Xauqax2uynx4TINzMi8zD8STN9Bd/3vmO7YSCT+S4+h0g/PUtFxk9HOzYOFud YmlA==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mCvzwygq; 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 X-Forwarded-Encrypted: i=1; AJvYcCWDznuzbK/a6i3XG9IlbpnH5YfrwoOaQXRSe0h8+NuqjBUEwa62bqC+HXeW9Z/Q7iDmTkwpltMd6tvvpQRadXMx Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id t9-20020a05620a004900b0078562086535si1414126qkt.620.2024.02.07.08.39.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 07 Feb 2024 08:39:49 -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=mCvzwygq; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rXkwP-0002wu-Sf; Wed, 07 Feb 2024 11:38: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 1rXkwM-0002ty-EC for qemu-devel@nongnu.org; Wed, 07 Feb 2024 11:38:26 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rXkwK-00068e-Br for qemu-devel@nongnu.org; Wed, 07 Feb 2024 11:38:26 -0500 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-40fdc63f4feso7868025e9.3 for ; Wed, 07 Feb 2024 08:38:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707323902; x=1707928702; 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=oWoGzkk5jlTntsP9Fp0ezGwzMskb1JgO0OTcfpG0rf4=; b=mCvzwygqxhve/FdYw7vM+UBP6w6qu/Tz7WK/foIeEyrQVW6k/i4Ydkb9gF9Qt+WT4W ZY+OwC1/9TBVMyJzGILuzy3eG6GdfU2obtNtfUgM3kJwqmCqO3QL+8Zi6G+Bt10t4MxO uhKQxhRJZZ+42XRpdAVF3IN43nBvmecRovbPNOlnS0yszWLs0PRHwsdndJLWfQK0Ol6E 24x9UiLhmUgPe2vTpvwHQaXuBMbpzTcB37XU3qhkjF/Jg4k6xkFg4Fbh1RFFZGl1uqnG Bu/xlEid0XNNnp0iZAqf/10Il2gEJll+T6o1DKJrWjTGrKEV4IyVJHKuA7WW53cr25xq qZvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707323902; x=1707928702; 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=oWoGzkk5jlTntsP9Fp0ezGwzMskb1JgO0OTcfpG0rf4=; b=jFHwJqxov0MJTJ4i+/gXSMN15RNEWYUxOPJhcAkSbSybJ7BTKUygBwlJ7NBvjAWpWR mSaOvfvbIebxm278bBaJrJbJCNvUah+gHUcf+KbOH8GfnYbKAaitEFy3dOQEjF2YlIVn p3jRwv45AuXx55UDatYtIYpJGESsBckU4XgntcUZRzdVbva/XfbODJPoI2qkwd1+BQ2w I0L5GgM5TTvPpiJvD1U1Ofyd8JcR9cYZdhhiqDe/sFqt6bLpY+cPEEt0JFY28+ah6G/P 4gGcfbOEc9Z3LISj8aK0JidzLmVrdN47XeUEr4uof6n1ZUmrXOnhpQI/jNOyFTA49r9u pM8Q== X-Gm-Message-State: AOJu0YyubnYky8f/2AgyzTJDyFO/VDH7HpLXauQMdSjoyZlkZm3YmQXu Q5nXVmrs/Ao/mkFqNc6LTdMiRjcfYmz3kZ3qjOf9XQb7IFoigIgB/YVPuZCw628= X-Received: by 2002:a05:600c:4691:b0:40e:f154:752 with SMTP id p17-20020a05600c469100b0040ef1540752mr5391678wmo.20.1707323902442; Wed, 07 Feb 2024 08:38:22 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCWOTJ4esVaJckcJFrE2pkVh9RazJTeGt3av8oiPaGyDUIvMc4VJ5oqaZ5tCa3BM8uZeFYMPxrQ1xyVLHqFEn6qa5SARefa9pJ5qL555GzP5dh9DKCE1zeJQ47UzXpPEYVLaFCDA/smQoWpD+GHLMZguXFhoZSXuPMsBW3j4JCQ3n8J0SbbSVTktdMHmWTRj9cyAtm/QpON5VaD7RYqy4AC8n0RrRqrxS4ux4is6eApPuPkuCIy3ucmZ1k6bHnLFbYoPFIIrp24fNRF4XjExn/s7eZRZAdiNl8fwLbV3VI34ry3MosOI5SmU8V14cGJaS2sL1voYPm8z4BQiod08YKblO37LwlInE+j+DIhiFInFmHe+cjT79vgauLX3H6DKPlkicMxuXIy6nvgOIl99r9I5kWsib7cLX7XXhm0itfdcnwmu4aNBh+YqVb0EvyAbsuzzw61/YN9POghP1NBE5l34ClIzTyoi5lZJ00p+Hf3xCk9CSjIIs5LOxmkrPD7gGZGYlF49qJRTL6XnBqoMvUbSaMlg8mn5OlcQK+Q1aUUKD9v81sfmcGM0tr69WnUKVkLHsYDTCfU373ZIsWDxVtcZf+0jP30FWAbHfHyH0bP/cLJsUqgjLjw1r8Wb1xPuTgHwi1LgbOHm8O4DOGxP1hvaNaTHGM6dG2EfOLgySUQo5vYtBXQvbNLNvN7TGqnvsLsH22U/WLGATVK7jNwQ4GQHQiCJ/4Wmbr3FK9dbwciDQL3bW+yVZa6GlmQeeYv8C2P0LDavkCzuNoGq/eq0hYwXk3c1uUExTvH5UNUAlUjbM5jlQSu+2hLinU/D75agOpn+Iy5geOmZJgCsqovJUhKt+juyNPkjOzKL922q Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id fl16-20020a05600c0b9000b004101f27737asm1077895wmb.29.2024.02.07.08.38.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 08:38:17 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 13B8A5F949; Wed, 7 Feb 2024 16:38:13 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: devel@lists.libvirt.org, Jiaxun Yang , Daniel Henrique Barboza , Chris Wulff , Weiwei Li , Bin Meng , Thomas Huth , qemu-riscv@nongnu.org, Marek Vasut , Liu Zhiwei , Aleksandar Rikalo , =?utf-8?q?Marc-Andr=C3=A9?= =?utf-8?q?_Lureau?= , =?utf-8?q?Philippe_Mathi?= =?utf-8?q?eu-Daud=C3=A9?= , Alistair Francis , Warner Losh , Paolo Bonzini , Aurelien Jarno , Beraldo Leal , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Max Filippov , =?utf-8?q?Alex_Benn=C3=A9e?= , Ed Maste , Palmer Dabbelt , Li-Wen Hsu , Laurent Vivier , Kyle Evans , Wainer dos Santos Moschetta , Riku Voipio , Ilya Leoshkevich Subject: [PATCH v2 10/14] gdbstub: Expose TARGET_SIGTRAP in a target-agnostic way Date: Wed, 7 Feb 2024 16:38:08 +0000 Message-Id: <20240207163812.3231697-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240207163812.3231697-1-alex.bennee@linaro.org> References: <20240207163812.3231697-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x330.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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Ilya Leoshkevich The upcoming syscall catchpoint support needs to send SIGTRAP stop packets to GDB. Being able to compile this support only once for all targets is a good thing, and it requires hiding TARGET_SIGTRAP behind a function call. Signed-off-by: Ilya Leoshkevich Message-Id: <20240202152506.279476-2-iii@linux.ibm.com> Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé --- gdbstub/internals.h | 1 + gdbstub/user-target.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/gdbstub/internals.h b/gdbstub/internals.h index 5c0c725e54c..aeb0d9b5377 100644 --- a/gdbstub/internals.h +++ b/gdbstub/internals.h @@ -136,6 +136,7 @@ void gdb_append_thread_id(CPUState *cpu, GString *buf); int gdb_get_cpu_index(CPUState *cpu); unsigned int gdb_get_max_cpus(void); /* both */ bool gdb_can_reverse(void); /* softmmu, stub for user */ +int gdb_target_sigtrap(void); /* user */ void gdb_create_default_process(GDBState *s); diff --git a/gdbstub/user-target.c b/gdbstub/user-target.c index c4bba4c72c7..b7d4c37cd81 100644 --- a/gdbstub/user-target.c +++ b/gdbstub/user-target.c @@ -418,3 +418,8 @@ void gdb_handle_query_xfer_exec_file(GArray *params, void *user_ctx) ts->bprm->filename + offset); gdb_put_strbuf(); } + +int gdb_target_sigtrap(void) +{ + return TARGET_SIGTRAP; +}