From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id TpV4EYFlrGgICQwAWB0awg (envelope-from ) for ; Mon, 25 Aug 2025 09:30:41 -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=GguLQCjt; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 352041E023; Mon, 25 Aug 2025 09:30:41 -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 602701E023 for ; Mon, 25 Aug 2025 09:30:40 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B67CD3858012 for ; Mon, 25 Aug 2025 13:30:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B67CD3858012 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1756128639; bh=BLjmUbipzXYzaENpq2jpvYl3t0HAl3V2n37SJm7pQ64=; 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=GguLQCjtMZXQuBoF0bw0YarTV801NwxztO0g/7ZjxSNTl5kcC4Fn6mTwt386H8SAy KxwEdhfd8YHW+r2knON0L2AIa3IMrJa1LNN2F6748vxyZ+SfyjoH9JFX7qcp3YvnC7 Yjl5M4ngpcHOEYQbYCiz2gXcZC8vV7xmaTM2hQC4= Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by sourceware.org (Postfix) with ESMTPS id 605EE3858D29 for ; Mon, 25 Aug 2025 13:29:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 605EE3858D29 ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 605EE3858D29 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1756128590; cv=none; b=lo4BoY5K/33uTlyxYxVDYb5BRcPePMr6l+l4jL+uDZ05lpoJtbP3Xe6NG80pESMzStVQKspJLsTQEppE5iyeSCjzOTsx1ArrhuEe8qlPzaJgUT3epWWr9VyE7Wg/S2ZWzSklNJGsWdwiKkDIIHR8l2Y04Md7tA6Yroh71KxaT5U= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1756128590; c=relaxed/simple; bh=ITUe8S2fdeZC/7yyVEStOGfmaUO03Z21y5/x+yDvg+k=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=YH7GqdEdhj+dLWCWRr0DL6Ntob1uEYEG2BjwncYT5B+LldfEsn0WaIJacGR1JUkEagfwS8rf95peH3z+TjFJTVv1k4kBXhZLZM2/rKYm0wh1lmfv7eAjP2wTChcdbPQ7UBZ06tF+KENC3L1+RxYwEf9tZlXbOTlL04XLiJatXBQ= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 605EE3858D29 Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 57P8W7EZ025970 for ; Mon, 25 Aug 2025 13:29:50 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 48q5unn4aa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Mon, 25 Aug 2025 13:29:49 +0000 (GMT) Received: by mail-yw1-f197.google.com with SMTP id 00721157ae682-71d600f9467so53970187b3.0 for ; Mon, 25 Aug 2025 06:29:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756128589; x=1756733389; 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=btu/9I+qx79CGIdOXLUedXOUjZrP7zmnM55hWn/emRM=; b=n2KKxM/CTjiVSn+pokkaCGSA5A/z1nJ70F+b2Wzs87qFAiXtWGHxc9StE0CINO7wSB 2UbwnrK6FpjlKMXsNWk7gEj42KkPhnlFwTXhMtZf/rNMgkj/jzRXx7+BIAz1thdsnAG7 BsrHmfBiAPCiCQibqwwgiDuwzgJkK+die60pXEjGV8l7KdMZa6oqNYvYa0ZU2chNmgP2 xxNaKIPL8q5L8NymvicrFIe72SG4gB9ioW+ECbsoKmy0a5P3a/c+qHMiLnK1EAG8Nx+R yLVc9R6HqSwGPCaBqbvurV7wqX6NkRDmJDeh+Z9z+3kKYNsU0ENRC0TXTuVo4kDtgTAq x7FA== X-Gm-Message-State: AOJu0YwkvkSIcRpRuU7CbQ2xUfZo3Mg2DtFK9Um1L5U3coDVRnEoa47K lCyltyoWKrsKmVCDEZ8+ccIiHqwPbU7iRB3xMGjYqhvboA3+LNyBYpdcO2P74ccPsUGXg2IQ4J1 EpHZPyAjhuIrVJQT7ftOY+HNYu33rkyoM8vBZrAGVkwOroBLPULkaubdXvVB2PRAa0AIJyxUrSP jX7s0FJI2XgWsN+phipH3/2MBqadQ/ X-Gm-Gg: ASbGncsEShgiWawY2Vx0VLmHgcHxWXWdjx3PsEdzEuzLZvC+NA9XEAREFsF7pcurvI0 kanPaM4zrtLu3ViXi+tqGNdNuzwzCppWIdtYhXonaHVh5E557oX8tuqPj3RVLk6WgRIBYDPinQY MCU5s209lQL08bLXjGV8PJ3Q0= X-Received: by 2002:a05:690c:7007:b0:71f:9a36:d5c1 with SMTP id 00721157ae682-71fdc54d3e4mr135066987b3.47.1756128588914; Mon, 25 Aug 2025 06:29:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEkHN2Cg0W0yUPTigcU+XAGPjsTaaxWZ/ocIilF71C4Oj9YcZUAbHlAl0KkTb+i2WXN4oONjUSdn+xXrMSKamM= X-Received: by 2002:a05:690c:7007:b0:71f:9a36:d5c1 with SMTP id 00721157ae682-71fdc54d3e4mr135065917b3.47.1756128587569; Mon, 25 Aug 2025 06:29:47 -0700 (PDT) MIME-Version: 1.0 References: <5e06c858-a390-4960-8aa0-dd8343708716@gmail.com> In-Reply-To: Date: Mon, 25 Aug 2025 09:29:35 -0400 X-Gm-Features: Ac12FXzES226uV9AsO3tqTNzHIeBQoqFgvgRZwpcW6LjvMTO2j0g5jszUV7JoZ4 Message-ID: Subject: Re: Question Regarding Int Cast Error in GDB Python To: Luis Cc: gdb@sourceware.org X-Proofpoint-GUID: ZYRJFHN_FGcqmI-mKmsdXCxSgaRn1lwg X-Proofpoint-ORIG-GUID: ZYRJFHN_FGcqmI-mKmsdXCxSgaRn1lwg X-Authority-Analysis: v=2.4 cv=JJo7s9Kb c=1 sm=1 tr=0 ts=68ac654d cx=c_pps a=0mLRTIufkjop4KoA/9S1MA==:117 a=2OwXVqhp2XgA:10 a=mDV3o1hIAAAA:8 a=EUspDBNiAAAA:8 a=pGLkceISAAAA:8 a=wNr_PCrtcKMAaYGqjGYA:9 a=QEXdDO2ut3YA:10 a=ZfI3aMGenwcA:10 a=byHxjvpL1JoRDUSXcMAA:9 a=LE_i5VvmKJ1mOuBR:21 a=lqcHg5cX4UMA:10 a=WgItmB6HBUc_1uVUp3mg:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwODIzMDAzMSBTYWx0ZWRfXwTCt7LKnJS/t x8CipmhK6ZC/miT5zH2SlaRkvpdXwbIYo8+p8k5RqF5hCPGYiQplRvbocsdYp7Su+1IGq9oamZh 1OMxdfzaMz7uJHiYrPgGo35odOtHtkFNsSnVO4ipESaUw3OgPRTLNqfQLz7WK09nyoxZM7I3zGo 5SlRRpH8Ri6nog9g666PAsXUq+EWK26qo7gGQfP3pc4DabAZ0vh3v2ajinuxOIqhKp+6MA3UyZD bvaLqNHGqnqCyk9ZTgh9gUzKVdKXBC6ol/H44gZU+Rfr/oDyD5b8j3lJ/r0UBM12Xd+RT/b0YLO kaxbmnlssV+TNcmH9WYAy5cVXFrNIhH7cLMTNb7WUU1n9CGQE0+77GMZHSwSWOEERD8/qxkuyN9 XZ/Z/gb0 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 phishscore=0 adultscore=0 bulkscore=0 spamscore=0 impostorscore=0 malwarescore=0 clxscore=1015 priorityscore=1501 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2507300000 definitions=main-2508230031 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, Apologies, it seems I pasted the wrong snippet in the original email. The code in my reply just prior to this is the correct code. The snippet that should have been included in the first email, which causes the error, is the one below: 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)) Sorry for the confusion! On Mon, Aug 25, 2025 at 9:23=E2=80=AFAM Vacha Bhavsar < vacha.bhavsar@oss.qualcomm.com> wrote: > 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 guidanc= e >> > 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 stat= us >> > 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 >> >>