This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug python/20622] Misleading error for pointer arithmetic with float operand from Python3
- From: "jwakely.gcc at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Tue, 20 Sep 2016 13:46:36 +0000
- Subject: [Bug python/20622] Misleading error for pointer arithmetic with float operand from Python3
- Auto-submitted: auto-generated
- References: <bug-20622-4717@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=20622
--- Comment #1 from Jonathan Wakely <jwakely.gcc at gmail dot com> ---
Due to PR 20624 if the offset is calculated using a gdb.Value then the pointer
arithmetic does work (because gdb.Value division is always integer division):
(gdb) python n = 1 ; offset = n / 4; p = p + offset
Traceback (most recent call last):
File "<string>", line 1, in <module>
gdb.error: Argument to arithmetic operation not a number or boolean.
Error while executing Python code.
(gdb) python n = gdb.Value(1) ; offset = n / 4; p = p + offset
(gdb)
I now think the right fix for this bug is not to make the arithmetic work, but
just to change the error message to say "not an integer number or boolean."
--
You are receiving this mail because:
You are on the CC list for the bug.