This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Diagnose invalid pointer arithmetic on gdb.Value
- From: Pedro Alves <palves at redhat dot com>
- To: Jonathan Wakely <jwakely at redhat dot com>, gdb-patches at sourceware dot org
- Date: Tue, 20 Sep 2016 16:41:12 +0100
- Subject: Re: [PATCH] Diagnose invalid pointer arithmetic on gdb.Value
- Authentication-results: sourceware.org; auth=none
- References: <20160920144601.GA3459@redhat.com>
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