From patchwork Tue Mar 7 21:21:35 2023 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: 659864 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2608294wrb; Tue, 7 Mar 2023 13:30:40 -0800 (PST) X-Google-Smtp-Source: AK7set+PcDLuEB99sAavjQWcrdLHfpCRahzG0eAwwecW2sEUwuj1qkBjQtZWAd9g1XtPzxketk9z X-Received: by 2002:ad4:4ee9:0:b0:56e:c1da:f68f with SMTP id dv9-20020ad44ee9000000b0056ec1daf68fmr29069538qvb.26.1678224639379; Tue, 07 Mar 2023 13:30:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678224639; cv=none; d=google.com; s=arc-20160816; b=mRxMRziK+zjwAVHsivnZTlWOLB+AngxbwAFkERM8OL++Tc7ktF9KZ6DuoVsHZArtvw vgvckbb3XvIIoiO3ZXLpoIz62PkWI0gIbFO4PQtDPx9kf2Pan5MVe1QK7oEO2oa3BsIn pAEzTDgAxnrb71q4GaBmIAFoBIxj6qZK8WsSUPFqmyQdpIeqmFjQyK4MWconLO8eyemJ WNdR4o4TrTN5MFQID9Lrn8g6THYG/31M1wytcMpizVsDWVQN9n0L5O9yg8FAC50tIIo2 BUVUa+DaQU1KA/SosPtgXkGlmGgVbs4Vnx/ZljuAkJQvqKEWUA67+xl+gceCyUyVuGQU JiCg== 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=/UJFR9YSQYJuT5oOotPCg6xiwzMZMMvlKZkAiVaMoUI=; b=I2exV2XYMYBRWhPGfCuXtxp2sovD7I5Qd25IPSla+9P1e98NpQpASA/ZGEGnkKwNd/ BNxV1zTpQnU9gAMjGs9k5FwFIE4hHX5lK5/GLBiUib+SfYQy1e0JsQ9amltSUkk+Zjie oXPjGv6nWNIzv4rgLrygSqjHZ36KDI6g9AM1dPkHC7aOHgLxHVkVnmVoJY6QwpXsZyai H9hW2PXROElt3xn3CMSM9Et/nzAZEIBo3MDkVrCjECQF294os+oKyH+Hrf7Yax0Hhpdj fJTabYwtE2apdE0I/OoS5uHr1inMs4TFUOWojXmwHsFQn50Ma4Y/ueiNEAsi0Xv30dDi cgaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GumiT++m; 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 r9-20020a0ccc09000000b00571bb8ce322si9998393qvk.58.2023.03.07.13.30.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Mar 2023 13:30:39 -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=GumiT++m; 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 1pZesB-0004i5-JS; Tue, 07 Mar 2023 16:29: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 1pZes9-0004gV-Lm for qemu-devel@nongnu.org; Tue, 07 Mar 2023 16:29:25 -0500 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pZes6-0000v7-LV for qemu-devel@nongnu.org; Tue, 07 Mar 2023 16:29:25 -0500 Received: by mail-wr1-x434.google.com with SMTP id l25so13544872wrb.3 for ; Tue, 07 Mar 2023 13:29:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678224561; 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=/UJFR9YSQYJuT5oOotPCg6xiwzMZMMvlKZkAiVaMoUI=; b=GumiT++mtfmGD6OGjDXH5QhxOjZS83IeSqkHu+ZIa0g7HVkdzab22NUPY86fy4BL8k 6qamsdnow2kwHNp7OOaZaFK9SIpaJ+YGSXVsChxU1w5uEW/ePMUkNy68jYY+3v5JSm5x za6xxV5tqULgBRFMo8OYjBrOCjx52P4UVe5N8yH24BJtk3XrWc1Oakfey/TyIIcc7TLS frVsDE431uTRCdUQZUo91Bnlai1vzTsTtLJRCPnY2Wel7Ot7e5bSUbzX2EFynJNKhpwu x8EBheXseyG8xy9+rziQQnyct4/OoyRDpnYUGXZaKL9FkUjz14UwdPWb5pM91kX0Jzm0 GzJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678224561; 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=/UJFR9YSQYJuT5oOotPCg6xiwzMZMMvlKZkAiVaMoUI=; b=bQ0uS/TMX5AXqiX4OedwG8O40EsOBF0hatUzfu1m2j/ElhjEWo+1iNFKcUI5kz12J7 3CnhEr1RgFOmpCuk8XLx2VHzkFgDQkeZv/J/P8ILoVU69b+cQern80iIItJW8IjHEA1P EzkUB8RCFaohU3i1YpN6FA+g3n11jxrRBtVJLjMccFHhpEq6uru4o2j57LgnKRDBaS+L W7NHWT/ovv+oKDu/KZSJzFLTfX0WXYB4/yDhVsQIsVzUsoxYVF54GYSUCPv8haMWvG9P lYidPZH4YaN89DvV3NV6SJI9JAYn6KehFZF7s8qazew186V8NYYiMaARCNN6XkDvFXJo ThlA== X-Gm-Message-State: AO0yUKVVkeUDvavgq9xAofMkGnverfleTX3cqmW+Evg66koNy6dWB13i 2oQaOLeVkLC9egITBRThcLmLQw== X-Received: by 2002:a5d:5544:0:b0:242:1809:7e17 with SMTP id g4-20020a5d5544000000b0024218097e17mr10701170wrw.6.1678224560730; Tue, 07 Mar 2023 13:29:20 -0800 (PST) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id o16-20020a056000011000b002c703d59fa7sm13477322wrx.12.2023.03.07.13.29.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 13:29:20 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 0E83A1FFD2; Tue, 7 Mar 2023 21:21:43 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PULL 26/30] gdbstub: Remove gdb_do_syscallv Date: Tue, 7 Mar 2023 21:21:35 +0000 Message-Id: <20230307212139.883112-27-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230307212139.883112-1-alex.bennee@linaro.org> References: <20230307212139.883112-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x434.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: 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: Richard Henderson This function is unused, except to implement gdb_do_syscall. Fold the implementations together. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Message-Id: <20230303025805.625589-27-richard.henderson@linaro.org> diff --git a/include/gdbstub/syscalls.h b/include/gdbstub/syscalls.h index 5851a2c706..243eaf8ce4 100644 --- a/include/gdbstub/syscalls.h +++ b/include/gdbstub/syscalls.h @@ -91,17 +91,6 @@ typedef void (*gdb_syscall_complete_cb)(CPUState *cpu, uint64_t ret, int err); */ void gdb_do_syscall(gdb_syscall_complete_cb cb, const char *fmt, ...); -/** - * gdb_do_syscallv: - * @cb: function to call when the system call has completed - * @fmt: gdb syscall format string - * @va: arguments to interpolate into @fmt - * - * As gdb_do_syscall, but taking a va_list rather than a variable - * argument list. - */ -void gdb_do_syscallv(gdb_syscall_complete_cb cb, const char *fmt, va_list va); - /** * use_gdb_syscalls() - report if GDB should be used for syscalls * diff --git a/gdbstub/syscalls.c b/gdbstub/syscalls.c index 6189940005..fdc68e452a 100644 --- a/gdbstub/syscalls.c +++ b/gdbstub/syscalls.c @@ -93,24 +93,26 @@ bool gdb_handled_syscall(void) * %lx - 64-bit argument printed in hex. * %s - string pointer (target_ulong) and length (int) pair. */ -void gdb_do_syscallv(gdb_syscall_complete_cb cb, const char *fmt, va_list va) +void gdb_do_syscall(gdb_syscall_complete_cb cb, const char *fmt, ...) { - char *p; - char *p_end; - target_ulong addr; - uint64_t i64; + char *p, *p_end; + va_list va; if (!gdb_attached()) { return; } gdbserver_syscall_state.current_syscall_cb = cb; + va_start(va, fmt); - p = &gdbserver_syscall_state.syscall_buf[0]; - p_end = &gdbserver_syscall_state.syscall_buf[sizeof(gdbserver_syscall_state.syscall_buf)]; + p = gdbserver_syscall_state.syscall_buf; + p_end = p + sizeof(gdbserver_syscall_state.syscall_buf); *(p++) = 'F'; while (*fmt) { if (*fmt == '%') { + target_ulong addr; + uint64_t i64; + fmt++; switch (*fmt++) { case 'x': @@ -141,16 +143,8 @@ void gdb_do_syscallv(gdb_syscall_complete_cb cb, const char *fmt, va_list va) } *p = 0; - gdb_syscall_handling(gdbserver_syscall_state.syscall_buf); -} - -void gdb_do_syscall(gdb_syscall_complete_cb cb, const char *fmt, ...) -{ - va_list va; - - va_start(va, fmt); - gdb_do_syscallv(cb, fmt, va); va_end(va); + gdb_syscall_handling(gdbserver_syscall_state.syscall_buf); } /*