From nobody Tue Feb 10 04:08:10 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1586947605; cv=none; d=zohomail.com; s=zohoarc; b=NLNHvrAHoSM7uZuDklAmtpwKzvHyzqk2+qnhqWTaCHAVWAtKhGkJZ7lt4BAlSNUF7rPVfXj3EngxOH1nhmlxRyNKKSRN+PzQkXi5foY6DMXgwrDfNOkhqiZc1c8EIZwJtwxY5CCMoNXTOjIBfBLIZ38PjiLTf8JXMZoeaTPuEGk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586947605; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=GnU4V1ssA1vvrZAqgpc7l1Tr/eH57b7BySlJY/PvGWg=; b=akhPB9ZwOjR3E2/gR7IOsGli2tECodHSv/OJItmHxtFADoXe4F6ULLhIAhsSeWDjsO0r7Rzupo058CiMWX8eSEJjH3Bk/6ioOWDzRDuf10cNfTPOoZsv636s93JWLgyao84i9p1y7iYKKvwM91se/QqRY4lTEtWG6xyuCXxJtwA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1586947605112367.1246553795215; Wed, 15 Apr 2020 03:46:45 -0700 (PDT) Received: from localhost ([::1]:47762 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jOfZ4-0002xy-VD for importer@patchew.org; Wed, 15 Apr 2020 06:46:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45582) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jOfUv-0002O9-Pl for qemu-devel@nongnu.org; Wed, 15 Apr 2020 06:42:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jOfUu-0003Ai-Gz for qemu-devel@nongnu.org; Wed, 15 Apr 2020 06:42:25 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:43673) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jOfUu-0003A4-AO for qemu-devel@nongnu.org; Wed, 15 Apr 2020 06:42:24 -0400 Received: by mail-wr1-x42c.google.com with SMTP id i10so18515803wrv.10 for ; Wed, 15 Apr 2020 03:42:24 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id h137sm17314440wme.0.2020.04.15.03.42.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Apr 2020 03:42:17 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id B2FA71FF96; Wed, 15 Apr 2020 11:42:12 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GnU4V1ssA1vvrZAqgpc7l1Tr/eH57b7BySlJY/PvGWg=; b=pOxIZEg9XzXXexDMvObLCzOlHhXv+fua1xazJDYfVWTIFR3twymeWGfi5rc6T/sGNu lE0c5mgI4HAGfpxJnE3bcsIuv+w+n91LNqPY1dijXi86esrtYRqkyOxfR4WSPlPBywke 8ycQR7iZAaFHfnxri+IUqy+D4/u4tSw/Nz4hUiNxLRENEp63jNAFQOaY65OicB+jcswi xCp/6GZsCq/PHRbWrdifaJqIlLyHfgGu8NRigS5QLDY0l+XwMBsZBKve8LkDvm3jckt1 Eq2a6iaip5q4ue5sajKeUz5eecIaBszg+14YqYlDkc5yVAc47KJbvf7NsyxD+ZL/o7nb +fUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GnU4V1ssA1vvrZAqgpc7l1Tr/eH57b7BySlJY/PvGWg=; b=Qc5EnylTagAKyy4c5Q/1uEdtQWaz84+NLR6N5BaG6QxpSSMtSSzDD3zpsBh11mQUQd 9KUOCOq/Bz1yK/gHB2HmkF/4PEcShoZ9J1kWNhlVgjF57XJKFTvLK/FJG6AvvHLMMzq5 9ciMFU5cfuQo1DSwlbFzIzJneqaXCITl3cDQ5Bc0v1hXo+aAQqpAOPSTEr+sNRiKLgY5 TAWN/oDQNzyI+k2g1u8smibXxHoGx7rNMM0xUUK3L4Lme/4AHncOjWEZmePGPO3OC/Oz AseHKpCG2rP3lNUsLw1n1llZInhWNy+2fZwe5pbvJZQbKgribAhP/ontOe9ZCgzrwfgV HCow== X-Gm-Message-State: AGi0PuaHlWXMwMAHbMsCu3Kfrav4/0jynlhi7TEx+BX4eQUKxz4dCOcO JZ/1Wpc2IxXRKex2uFH367ytH1J43Tk= X-Google-Smtp-Source: APiQypJl48ouiU1VkrUrqvMGKDSloOtdgVKfSYlBFyeJ/sEE0hyPzarLJ1ziW/RMeCjOs/npr1v6jw== X-Received: by 2002:adf:dfc2:: with SMTP id q2mr16409449wrn.390.1586947343281; Wed, 15 Apr 2020 03:42:23 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 8/8] gdbstub: Introduce gdb_get_float32() to get 32-bit float registers Date: Wed, 15 Apr 2020 11:42:11 +0100 Message-Id: <20200415104211.9388-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200415104211.9388-1-alex.bennee@linaro.org> References: <20200415104211.9388-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42c X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Philippe Mathieu-Daud=C3=A9 Since we now use a GByteArray, we can not use stfl_p() directly. Introduce the gdb_get_float32() helper to load a float32 register. Fixes: a010bdbe719 ("extend GByteArray to read register helpers") Signed-off-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Richard Henderson Message-Id: <20200414163853.12164-2-philmd@redhat.com> Message-Id: <20200414200631.12799-14-alex.bennee@linaro.org> diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h index 3c452fc50c0..20e10726929 100644 --- a/include/exec/gdbstub.h +++ b/include/exec/gdbstub.h @@ -125,6 +125,15 @@ static inline int gdb_get_reg128(GByteArray *buf, uint= 64_t val_hi, return 16; } =20 +static inline int gdb_get_float32(GByteArray *array, float32 val) +{ + uint8_t buf[sizeof(CPU_FloatU)]; + + stfl_p(buf, val); + g_byte_array_append(array, buf, sizeof(buf)); + + return sizeof(buf); +} static inline int gdb_get_zeroes(GByteArray *array, size_t len) { guint oldlen =3D array->len; diff --git a/target/sh4/gdbstub.c b/target/sh4/gdbstub.c index 49fc4a0cc69..34ad3ca0508 100644 --- a/target/sh4/gdbstub.c +++ b/target/sh4/gdbstub.c @@ -58,11 +58,9 @@ int superh_cpu_gdb_read_register(CPUState *cs, GByteArra= y *mem_buf, int n) return gdb_get_regl(mem_buf, env->fpscr); case 25 ... 40: if (env->fpscr & FPSCR_FR) { - stfl_p(mem_buf, env->fregs[n - 9]); - } else { - stfl_p(mem_buf, env->fregs[n - 25]); + return gdb_get_float32(mem_buf, env->fregs[n - 9]); } - return 4; + return gdb_get_float32(mem_buf, env->fregs[n - 25]); case 41: return gdb_get_regl(mem_buf, env->ssr); case 42: --=20 2.20.1