From patchwork Sat Mar 9 03:08:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gustavo Romero X-Patchwork-Id: 779149 Delivered-To: patch@linaro.org Received: by 2002:a5d:604e:0:b0:33e:7753:30bd with SMTP id j14csp581706wrt; Fri, 8 Mar 2024 19:11:27 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU2hY0bPu2XhZM4YH6uX79NY3q5AF4EaY5dkhEa83vc2Et7srb0JSNIxw2ZsEMcpPMrc8GKnedVV6gZ1dbeoyaG X-Google-Smtp-Source: AGHT+IFuTv/Ro2HtinLGI39XcXxbpSyOepoRescbRDdVhQ6jhAU/44f66uupafPtj2CT04fAov+k X-Received: by 2002:a05:6214:2cc8:b0:690:af2e:5c2c with SMTP id lf8-20020a0562142cc800b00690af2e5c2cmr798529qvb.16.1709953886721; Fri, 08 Mar 2024 19:11:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709953886; cv=none; d=google.com; s=arc-20160816; b=ceaH/FBy2FBnpkTzQwWTdEjapoKaAx1+dhW9b0nM9coB4QeB2YsX6IuNODBMFa98zB OKCocvDhFO+8rJ+pQBkE0zDwjLxM1oDbj4MYPgFMZ4tkaxwdiUW6d1J/SZSqSs1ovVsa 8Snsle2GX4Ld7mxtAta/vTC7nVdygttzHcHJ8xa8KrT98cfbnWI6fHTFr1MaG5n87Egd RgXCkW0okyK1LfSa4cap4TkpU6jLmR5tI6QrS/o9TK+3jRDPkTZGaFTmDVKdKnPnNVCt 0Sq88stNg25i7glR+fKDDr36xenh/T77ODEw1guFbtFnvRjrIDH9Ov0nOK/rDHhE4gey ON2Q== 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=8tpJAfxQcRF8joD00NGmo1iAef1vo78TLl0CoONZU1s=; fh=+Jn5QrUSs46cFc7pLBHSJR4rdczRsVh7RhZKgXapQ8c=; b=BR58ycCKsaqEuZkxtcH/e/4QVXbFhW/YrOrYGmNsi4kO7W15ZBbz0NWdy8JFUzfv8Y 733I1LVMKC0agFFAYdCeN08gVK7aW+QFG5Ee+aCJ3Ty/YwYyRVyr1zulyB7YQWNI3uaR Kt5FOC7vXbg2xA2Kh10VLMGwHxBoXqlq28eTcaAXNxnSkuOLpCDif8nOY0U6FI1cvJwq YKpitCiyh6+dv2ewTl/HdTiYimJFeUZYpryGmwvCiLdSq6L8IydfZgsNBhVMJ4vskMGV jPeBS+2JE2+iaCBw3894sm7ke/YX+xmJo6Bak+ZrAB+wbiprpf66wkO2nfoQL2M35Tk4 XHqQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="E9zdb/F5"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 5-20020ad45ba5000000b0068cd964819asi822009qvq.392.2024.03.08.19.11.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Mar 2024 19:11:26 -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="E9zdb/F5"; 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 1rin6f-0000tv-4Y; Fri, 08 Mar 2024 22:10:41 -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 1rin6V-0000tE-VO for qemu-devel@nongnu.org; Fri, 08 Mar 2024 22:10:32 -0500 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rin6T-00046q-9l for qemu-devel@nongnu.org; Fri, 08 Mar 2024 22:10:30 -0500 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1dca3951ad9so21694695ad.3 for ; Fri, 08 Mar 2024 19:10:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709953825; x=1710558625; 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=8tpJAfxQcRF8joD00NGmo1iAef1vo78TLl0CoONZU1s=; b=E9zdb/F5RetjM7U0NsLcedWnsTjdgUyqUgzVQenfdFymRscTerk46t8argR1XzRHuK MZNxkRSiNeSyqArjGZv+GdDrWz2QLoSv8XG48gLRgckuFyOWdUptGS1nOi/N2TAhNYml DUEqk4KzXH6LONL00cZPw8Cy0G6wy9daui6xcxE6ZZlD5eDlAuVa+s2GS3y6/hNk7CKo OLI6n6kfxf92M07y7obgt587/OXCWILmskDz+wAEMrmc049LVwWW7jhNxqvaOL5dt2cR prQG9f4FS6oZEWIp513GY2FpXoD9/6GBdUQHJKdYfQvr+R8Y4sIH75SDvt1MU0+BUlNf w2IA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709953825; x=1710558625; 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=8tpJAfxQcRF8joD00NGmo1iAef1vo78TLl0CoONZU1s=; b=eTtYLYjqV1W6cPvk0jcyKU/tra0Sexm7Pj5W6oWR1aq/eOgjUgRHQk4qhrkZCsd7YB StsS6tFcafq957H27arZZGtpIU5xZIEQeGa+QN30qLv78DwDl52BH0ypaqpqs0NMQjzH lTumzpC/YlY5f/NwB72amUm7OGuuR01AVvFG0DIlwv6cGo9oClWK2HD5CrWW7RBykaIE y9Ot+o3cGf11Y9kyPxy1Yhv40FyWvQSK1ikTai4Ly8RLVPm3AVVsavm/M89SP4x+eScm 8yv3myJ+36XDXH1Fn9+ilMXUI678QlMJDCH8Dndq4Ayo8ySSIRvswKzU5B9Wl6uj7mC1 Qt6A== X-Gm-Message-State: AOJu0YyWCqRgF8yWvNLrh4fGm/RAYa77SDUHgbEXY3lRzHAiBREd/9S1 /vIyFHyqwfKsI+4SfvHpVFUNdow0+ekpEgs9AxWS0XZclw25vb2ladb8PBrlScSdseaLIW/JA+S 0cKc= X-Received: by 2002:a17:903:244b:b0:1dd:4cf3:5771 with SMTP id l11-20020a170903244b00b001dd4cf35771mr541487pls.60.1709953825429; Fri, 08 Mar 2024 19:10:25 -0800 (PST) Received: from amd.. ([2804:7f0:b401:7e8e:3e7c:3fff:fe7a:e83b]) by smtp.gmail.com with ESMTPSA id w13-20020a170902d3cd00b001dd707d5fe6sm349566plb.158.2024.03.08.19.10.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Mar 2024 19:10:24 -0800 (PST) From: Gustavo Romero To: qemu-devel@nongnu.org, richard.henderson@linaro.org Cc: alex.bennee@linaro.org, peter.maydell@linaro.org, laurent@vivier.eu, philmd@linaro.org, gustavo.romero@linaro.org Subject: [PATCH v3 1/5] gdbstub: Rename back gdb_handlesig Date: Sat, 9 Mar 2024 03:08:57 +0000 Message-Id: <20240309030901.1726211-2-gustavo.romero@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240309030901.1726211-1-gustavo.romero@linaro.org> References: <20240309030901.1726211-1-gustavo.romero@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=gustavo.romero@linaro.org; helo=mail-pl1-x632.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=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: 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 Rename gdb_handlesig_reason back to gdb_handlesig. There is no need to add a wrapper for gdb_handlesig and rename it when a new parameter is added. Signed-off-by: Gustavo Romero Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson --- gdbstub/user.c | 8 ++++---- include/gdbstub/user.h | 15 ++------------- linux-user/main.c | 2 +- linux-user/signal.c | 2 +- 4 files changed, 8 insertions(+), 19 deletions(-) diff --git a/gdbstub/user.c b/gdbstub/user.c index 14918d1a21..a157e67f95 100644 --- a/gdbstub/user.c +++ b/gdbstub/user.c @@ -131,7 +131,7 @@ void gdb_qemu_exit(int code) exit(code); } -int gdb_handlesig_reason(CPUState *cpu, int sig, const char *reason) +int gdb_handlesig(CPUState *cpu, int sig, const char *reason) { char buf[256]; int n; @@ -510,7 +510,7 @@ void gdb_breakpoint_remove_all(CPUState *cs) void gdb_syscall_handling(const char *syscall_packet) { gdb_put_packet(syscall_packet); - gdb_handlesig(gdbserver_state.c_cpu, 0); + gdb_handlesig(gdbserver_state.c_cpu, 0, NULL); } static bool should_catch_syscall(int num) @@ -528,7 +528,7 @@ void gdb_syscall_entry(CPUState *cs, int num) { if (should_catch_syscall(num)) { g_autofree char *reason = g_strdup_printf("syscall_entry:%x;", num); - gdb_handlesig_reason(cs, gdb_target_sigtrap(), reason); + gdb_handlesig(cs, gdb_target_sigtrap(), reason); } } @@ -536,7 +536,7 @@ void gdb_syscall_return(CPUState *cs, int num) { if (should_catch_syscall(num)) { g_autofree char *reason = g_strdup_printf("syscall_return:%x;", num); - gdb_handlesig_reason(cs, gdb_target_sigtrap(), reason); + gdb_handlesig(cs, gdb_target_sigtrap(), reason); } } diff --git a/include/gdbstub/user.h b/include/gdbstub/user.h index 68b6534130..6647af2123 100644 --- a/include/gdbstub/user.h +++ b/include/gdbstub/user.h @@ -10,7 +10,7 @@ #define GDBSTUB_USER_H /** - * gdb_handlesig_reason() - yield control to gdb + * gdb_handlesig() - yield control to gdb * @cpu: CPU * @sig: if non-zero, the signal number which caused us to stop * @reason: stop reason for stop reply packet or NULL @@ -25,18 +25,7 @@ * or 0 if no signal should be delivered, ie the signal that caused * us to stop should be ignored. */ -int gdb_handlesig_reason(CPUState *, int, const char *); - -/** - * gdb_handlesig() - yield control to gdb - * @cpu CPU - * @sig: if non-zero, the signal number which caused us to stop - * @see gdb_handlesig_reason() - */ -static inline int gdb_handlesig(CPUState *cpu, int sig) -{ - return gdb_handlesig_reason(cpu, sig, NULL); -} +int gdb_handlesig(CPUState *, int, const char *); /** * gdb_signalled() - inform remote gdb of sig exit diff --git a/linux-user/main.c b/linux-user/main.c index 551acf1661..049fd85a2a 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -1014,7 +1014,7 @@ int main(int argc, char **argv, char **envp) gdbstub); exit(EXIT_FAILURE); } - gdb_handlesig(cpu, 0); + gdb_handlesig(cpu, 0, NULL); } #ifdef CONFIG_SEMIHOSTING diff --git a/linux-user/signal.c b/linux-user/signal.c index d3e62ab030..a57c45de35 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -1180,7 +1180,7 @@ static void handle_pending_signal(CPUArchState *cpu_env, int sig, /* dequeue signal */ k->pending = 0; - sig = gdb_handlesig(cpu, sig); + sig = gdb_handlesig(cpu, sig, NULL); if (!sig) { sa = NULL; handler = TARGET_SIG_IGN;