Re: Question Regarding Int Cast Error in GDB Python
Vacha Bhavsar via Gdb <[email protected]>
| Newsgroups | gmane.comp.gdb.devel |
|---|---|
| Message-ID | <CAEWVDmvAvH8WEAzBq7Bemh15aU5e_B2KUkdwVBNZ4D9coCF+Fw@mail.gmail.com> |
Hi, We chose this particular cast just to stay aligned with the existing method of testing in QEMU which also uses this cast but for 64bit integers. qemu/tests/tcg/aarch64/gdbstub/test-sve.py at b86307ecef9222c335ebd0ed4da2b243e86f779e · qemu/qemu <https://github.com/qemu/qemu/blob/b86307ecef9222c335ebd0ed4da2b243e86f779e/tests/tcg/aarch64/gdbstub/test-sve.py> https://lists.gnu.org/archive/html/qemu-devel/2025-08/msg01815.html However, since we have seen that this issue only occurs with the specific indiciated version of gdb, and does not fail for example with gdb16.3, we have implemented a workaround to avoid the casting in the case of gdb-multiarch 15.0.50.20240403-0ubuntu1. Thank you for confirming this is a known issue! Thanks, Vacha On Tue, Aug 26, 2025 at 4:49 PM Luis <[email protected]> wrote: > Hi, > > On 8/25/25 14:29, Vacha Bhavsar wrote: > > 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 = gdb.parse_and_eval(reg) > > report(str(v.type) == "uint128_t", "size of %s" % (reg)) > > Right, so gdb doesn't like casting integers to/from 8+ bytes. That's a > limitation currently. But why are you considering this particular cast? > To optimize the checks instead of using the byte vectors? >