This is the mail archive of the gdb-patches@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]

Re: [PATCH] Diagnose invalid pointer arithmetic on gdb.Value


On 09/20/2016 03:46 PM, Jonathan Wakely wrote:
> Instead of passing invalid arguments to value_binop and getting a
> misleading error, raise a TypeError directly in valpy_binop_throw.

Did you try changing value_binop instead?  The error string seems
misleading even in C:

(gdb) p ptr
$1 = 0x601040 <buf> ""
(gdb) p ptr + 1
$2 = 0x601041 <buf+1> ""
(gdb) p ptr + 1.0
Argument to arithmetic operation not a number or boolean.
(gdb)

Thanks,
Pedro Alves


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