Question Regarding Int Cast Error in GDB Python

Vacha Bhavsar via Gdb <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <CAEWVDmtoZet3B28Vm+c=-wZOQamAvnVnpxV0pQ-8xhH-TGoS1w@mail.gmail.com>
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 = gdb.parse_and_eval(reg)
report(str(v.type) == "uint8_t", "size of %s" % (reg))
report(int(v) == 0x1, "%s is 0x%x" % (reg, 0x1))

This results in the following error:

Python Exception <class 'gdb.error'>: 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    status
version support              version  architecture
16.3 --enable-targets=all 3.11.13   x86        yes        pass
16.3 --enable-targets=all 3.11.13   x86         no        pass
16.3 --enable-targets=all 3.10.18   x86        yes        pass
16.3 --enable-targets=all 3.10.18   x86         no        pass
16.3 --enable-targets=all 3.8.10    x86        yes        pass
16.3 --enable-targets=all 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.