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] Add proper error message instead of gdb_assert


> Date: Mon, 03 Mar 2008 20:36:18 +0100
> From: "Markus Deuling" <deuling@de.ibm.com>
> 
> Hi,
> 
> when trying to put > 1 values into an array (fortran subrange) which
> comes from a register, register_size is called with regnum =3D=3D -1.
> 
> The following example comes from SPU architecture. Currently GDB exits 
> with a gdb_assert going wrong:
> 
> (gdb) set $r0%v2_int64(0:1)=3D(1,2)
> .../../../gdb-6.7/gdb/regcache.c:177: internal-error: register_size: =
> Assertion `regnum >=3D 0 && regnum < (gdbarch_num_regs (gdbarch) + =
> gdbarch_num_pseudo_regs (gdbarch))' failed.
> A problem internal to GDB has been detected,
> further debugging may prove unreliable.
> Quit this debugging session? (y or n) y
> 
> This patch replaces that gdb_assert by a proper error message before
> exiting:
> 
> (gdb) set $r2%v2_int64(0:1)=3D(1,1)
> .../../../gdb-6.7/gdb/regcache.c:185: internal-error: invalid register -1
> A problem internal to GDB has been detected,
> further debugging may prove unreliable.
> Quit this debugging session? (y or n) 
> 
> If this patch is ok it would be great to have it in gdb 6.8. Ok?

Sorry, but I don't see why your error message is "proper".  The
gdb_assert() should never fail; the fact that it does means that you
have a bug elsewhere in gdb.


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