From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id vdukFR1krGhDCAwAWB0awg (envelope-from ) for ; Mon, 25 Aug 2025 09:24:45 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=VJfDJexi; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 440E91E048; Mon, 25 Aug 2025 09:24:45 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_LOW,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=no autolearn_force=no version=4.0.1 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 50A5B1E023 for ; Mon, 25 Aug 2025 09:24:44 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CBA8C385771D for ; Mon, 25 Aug 2025 13:24:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CBA8C385771D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1756128283; bh=TMF46KeJWrSg01o3CvHwcHp6yKo2jxBt4Kf9lqtVq10=; h=References:In-Reply-To:Date:Subject:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=VJfDJexiMBXfrGJM+gaSRna8oqiyHGT1LzWHwnhPDcTjzDTVspu5bp9GWZyRRRQgW JoIgHf3DKx5eVVqr0apDF8sqKnZsqih5HkW4U6Bz6Inj+05IOPQel/6cLJhjA9KXuz v8mAN5A72482GOBnRNPw55/XRoJZnI2g7/NEBydc= Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by sourceware.org (Postfix) with ESMTPS id 69057385770D for ; Mon, 25 Aug 2025 13:23:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 69057385770D ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 69057385770D ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1756128239; cv=none; b=RFDKN6ku5CZegt/Igjz0ZcJFCsqSsF4h7PcUBfrFOVOAPoBV+ncZc+/bK0t+x98ixrUe1MU7ZbjiZJDG86ZzIVmFLQX6kIfA8HmPz2P//hJu1bv6XAGWWJ0GWZ9/QuuVOsowK29R8zRetI8n4PCfxV2nS933QB4qWGqQKg9QQ70= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1756128239; c=relaxed/simple; bh=Juhy+ktFW0m3p//HW4YzedXPQn/BwMw087H9eQyRVHk=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=LzToJd90JXkobINKfH1jw7U/vqrrE9FNRfG5BKMKJGMqNGcfMCsq3sGszHz8c8pdTAi+psHiAYvFCgHgSBfNMXaKTM+pdPwjenm6Oz/BSHZnawiX61FNdiNkEu6RiYC39D/K7gQgQWTl9LDsRj0UpJgkIt4vdclMwdH+85awu10= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 69057385770D Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 57P8F3Im004377 for ; Mon, 25 Aug 2025 13:23:53 GMT Received: from mail-yw1-f197.google.com (mail-yw1-f197.google.com [209.85.128.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 48q5xpn94n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Mon, 25 Aug 2025 13:23:53 +0000 (GMT) Received: by mail-yw1-f197.google.com with SMTP id 00721157ae682-71ff6edcfe9so26942107b3.0 for ; Mon, 25 Aug 2025 06:23:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756128232; x=1756733032; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=0GZIyxU3QKxABp0QW1lykyefWVz3ds39VuaUJ02DfNk=; b=EwKDh0L0IPKRBOliAuZqDdzjVogS6w5TTUXOmPevDt7wArv8P1AxnbYLIJ2JmxIHAc RuS5JsWx+1uc/+73ou6VQqwbUXG7b2OEX4qxLgYgKHAAIOD/n4RdddPvOwXZeQhrIL5l zFyrdVqLCM5xI9cBXYDwNO74wRc7gdThuCWsndDz0nIT5JPM1h/yK5pcR5RgZg59fpwU yL9XdSVeAjgtm3SLtKjGmyTkb/8DlXWFmsyBAXClENJEwHWF1OZKsH+F3VcsEipB4TLi 0eo9owwj4Je+Uyb7ZxuIaH2KmeJBXVuuw1peFsYdhrldryIGVLsJSx+8u1ifTfNPseMu A6Kg== X-Gm-Message-State: AOJu0YyWwvyAznm4f4ed6p15Zi39U7oocOCBL+nnvxsB0wS1Qlx87z3j oInkV+5Cqyd/qmibyoXUrWZskFb3tdeAH2MoSp6+o7lBaFaeFG2ke5FEj7VSwCsbhk1Lu3v6ng8 PvJIivy8HK15WB8QlSCo3nywvsCq/c5tQ2Kt4GZLVgonuHoH7ydDoRcS4TJUcSoGcXTDaMjGR89 M8bNJPkAIP3klULliGbvIUGPAOYCcWXbwojZ4ntqg= X-Gm-Gg: ASbGncs7GpZZpg/hbjtYkydnLAt9x89OUnL94JJoanIFpmSMqnP/sicAHJNzLgdFYbX ZF3oaL6xD48zOz+WonRFA6DalCauWrmcA8WVPqiJAQrA1W7BS7OqDhGNM1zZW+r6P0ZvCtj1Jvi ITOTtC/N/2qZMcX7lGxl+Pqj8= X-Received: by 2002:a05:690c:3507:b0:71b:6709:2129 with SMTP id 00721157ae682-71fdc2d0fffmr112978077b3.7.1756128231816; Mon, 25 Aug 2025 06:23:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFpeatZRrnL9bjKuUjw98T9T03aQdnjZMhBfFIZa/gGX6IpIIDKKCZURjop9cMqdCqb/+ZUyuKYK2r3uPQP72A= X-Received: by 2002:a05:690c:3507:b0:71b:6709:2129 with SMTP id 00721157ae682-71fdc2d0fffmr112977707b3.7.1756128231157; Mon, 25 Aug 2025 06:23:51 -0700 (PDT) MIME-Version: 1.0 References: <5e06c858-a390-4960-8aa0-dd8343708716@gmail.com> In-Reply-To: <5e06c858-a390-4960-8aa0-dd8343708716@gmail.com> Date: Mon, 25 Aug 2025 09:23:40 -0400 X-Gm-Features: Ac12FXxg1WNZqJeX4Vt5jaSqWJzic0CTGynqgFcXlthMeRR9Ade0bG5vg1Uq0W0 Message-ID: Subject: Re: Question Regarding Int Cast Error in GDB Python To: Luis Cc: gdb@sourceware.org X-Authority-Analysis: v=2.4 cv=KOlaDEFo c=1 sm=1 tr=0 ts=68ac63e9 cx=c_pps a=0mLRTIufkjop4KoA/9S1MA==:117 a=2OwXVqhp2XgA:10 a=mDV3o1hIAAAA:8 a=pGLkceISAAAA:8 a=WYHv9OUOyhifNerDP0oA:9 a=QEXdDO2ut3YA:10 a=ZfI3aMGenwcA:10 a=byHxjvpL1JoRDUSXcMAA:9 a=FrkFAtYl8b-N1a9k:21 a=lqcHg5cX4UMA:10 a=WgItmB6HBUc_1uVUp3mg:22 X-Proofpoint-GUID: -XNbrKK6O6ZslJwHvYSj19R2NRwpiMAS X-Proofpoint-ORIG-GUID: -XNbrKK6O6ZslJwHvYSj19R2NRwpiMAS X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwODIzMDAzMyBTYWx0ZWRfX9upTW29SpOv7 f0y7wCyxri2aQfJc7FZ9kXE2hUjyQexGbpnanUS6P1ra4FUP05xGg33A11oU0feanDVBII/oEse eyoSsUQkz37wFoAkNSIFxbEArj2oSXv75ffXWXDXWuzYh0+F1ig+Vig7juD+gzog2R4I4oEwlyM 6qe56mY6KhMPAbrqj45Mhd/kYr6bwg4PVlK+VEyxwSwauINxYDY480h4WMkHET4gq8aen7+fVGX D8uODta6OtbFnJo4IZlg+nJxQda28fr8MBOi8FMruLnGPXWCQvxOGXfsq1d003JC99lAwmiCFmZ 7dSj5uUJj0fVw/DsQEPcsOiwrbEDLoUYnaUmH667gukAc2XNLE+SV9JiHQ0D+n8XMUPfpbsVfzh Mecy8N00 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-08-25_06,2025-08-20_03,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 clxscore=1015 bulkscore=0 adultscore=0 phishscore=0 impostorscore=0 spamscore=0 suspectscore=0 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2507300000 definitions=main-2508230033 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.30 X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Vacha Bhavsar via Gdb Reply-To: Vacha Bhavsar Errors-To: gdb-bounces~public-inbox=simark.ca@sourceware.org Sender: "Gdb" Hi, We are testing the ZA by tiles and tile slices. I've included a larger snippet of the code below: for i in range(0, 4): for j in range(0, 4): for k in range(0, 4): cmd =3D "set $za%dhq%d[%d] =3D 0x%x" % (i, j, k, MAGIC) gdb.execute(cmd) report(True, "%s" % cmd) for j in range(0, 4): for k in range(0, 4): reg =3D "$za%dhq%d[%d]" % (i, j, k) v =3D gdb.parse_and_eval(reg) report(str(v.type) =3D=3D "uint128_t", "size of %s" % (reg)) report(int(v) =3D=3D MAGIC, "%s is 0x%x" % (reg, MAGIC)) So in this case we see the error when we try to test za0hq0[0] when v is cast to an int. On Mon, Aug 25, 2025 at 4:35=E2=80=AFAM Luis = wrote: > On 8/22/25 19:21, Vacha Bhavsar via Gdb wrote: > > Hi, > > > > I am developing a patch for QEMU which would allow QEMU to expose > > SME registers, such as the ZA storage, via gdbstub to a remote > > gdb client session. I am working to write a simple test case for > > this change which simply sets the value of the za register, then > > reads it and ensures what is read is equivalent to what was set. > > > > The full test case can be found here: > > > > https://lists.gnu.org/archive/html/qemu-devel/2025-08/msg01815.html > > > > However, it seems there is an issue in the int cast in the following > > code: > > > > v =3D gdb.parse_and_eval(reg) > > report(str(v.type) =3D=3D "uint8_t", "size of %s" % (reg)) > > report(int(v) =3D=3D 0x1, "%s is 0x%x" % (reg, 0x1)) > > If reg is ZA, I=C2=B4d expect gdb to have difficulties casting the whole > array to an int, hence the message about not managing to operate on > integers larger than 8 bytes. > > How are you testing ZA? Byte by byte? > > > > > This results in the following error: > > > > Python Exception : That operation is not available > > on integers of more than 8 bytes. > > Error occurred in Python: That operation is not available on integers > > of more than 8 bytes. > > > > After running various tests with different host architectures, gdb > > versions, python version and int casting included and excluded, we > > are seeing that this issue only seems to arise when the int cast is > > included and the gdb used is GNU gdb (Ubuntu 15.0.50.20240403-0ubuntu1) > > 15.0.50.20240403-git (regardless of python version and host > architecture). > > > > The test results are presented below. I was hoping to get some guidance > > regarding this error and what may be the cause if it indeed stems from > > this specific version of gdb? > > > > Thanks, > > Vacha > > > > > > gdb gdb target python host int cast statu= s > > version support version architecture > > 16.3 --enable-targets=3Dall 3.11.13 x86 yes pass > > 16.3 --enable-targets=3Dall 3.11.13 x86 no pass > > 16.3 --enable-targets=3Dall 3.10.18 x86 yes pass > > 16.3 --enable-targets=3Dall 3.10.18 x86 no pass > > 16.3 --enable-targets=3Dall 3.8.10 x86 yes pass > > 16.3 --enable-targets=3Dall 3.8.10 x86 no pass > > > > 16.3 aarch64 3.11.0rc1 aarch64 yes pass > > 16.3 aarch64 3.11.0rc1 aarch64 no pass > > 16.3 aarch64 3.10.12 aarch64 yes pass > > 16.3 aarch64 3.10.12 aarch64 no pass > > > > 15.0 multiarch 3.10.12 aarch64 yes fail > > 15.0 multiarch 3.10.12 aarch64 no pass > > 15.0 multiarch 3.11.0rc1 aarch64 yes fail > > 15.0 multiarch 3.11.0rc1 aarch64 no pass > > > > 15.0 multiarch 3.8.10 x86 yes fail > > 15.0 multiarch 3.8.10 x86 no pass > > 15.0 multiarch 3.11.13 x86 yes fail > > 15.0 multiarch 3.11.13 x86 no pass > > 15.0 multiarch 3.10.18 x86 yes fail > > 15.0 multiarch 3.10.18 x86 no pass > >