Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Question Regarding Int Cast Error in GDB Python
@ 2025-08-22 18:21 Vacha Bhavsar via Gdb
  2025-08-25  8:35 ` Luis via Gdb
  2025-08-29 17:46 ` Tom Tromey
  0 siblings, 2 replies; 8+ messages in thread
From: Vacha Bhavsar via Gdb @ 2025-08-22 18:21 UTC (permalink / raw)
  To: gdb

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-09-03 19:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-08-22 18:21 Question Regarding Int Cast Error in GDB Python Vacha Bhavsar via Gdb
2025-08-25  8:35 ` Luis via Gdb
2025-08-25 13:23   ` Vacha Bhavsar via Gdb
2025-08-25 13:29     ` Vacha Bhavsar via Gdb
2025-08-26 20:49       ` Luis via Gdb
2025-08-27 19:16         ` Vacha Bhavsar via Gdb
2025-08-29 17:46 ` Tom Tromey
2025-09-03 18:59   ` Vacha Bhavsar via Gdb

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox