This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug python/20622] Misleading error for pointer arithmetic with float operand from Python3


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]