[commit] Fix flags type initialization bug
Joel Brobecker
brobecker@adacore.com
Tue Aug 22 20:57:00 GMT 2006
> I'm working on printing proper flags for some registers on SPARC when
> I hit this. It makes gdb crash, so perhaps I should put this on the
> release branch too?
Is there a way to cause GDB 6.5 to crash, or is only after you
applied your changes?
Right now, I don't have any plan in making a minor release from
the 6.5 branch, but I don't mind making one if the fixes of this
kind keep piling up.
> Index: ChangeLog
> from Mark Kettenis <kettenis@gnu.org>
>
> * gdbtypes.c (init_flags_type): Set all fields to zero instead of
> just the first one.
>
> Index: gdbtypes.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/gdbtypes.c,v
> retrieving revision 1.105
> diff -u -p -r1.105 gdbtypes.c
> --- gdbtypes.c 1 Mar 2006 19:34:46 -0000 1.105
> +++ gdbtypes.c 22 Aug 2006 19:41:50 -0000
> @@ -878,7 +878,7 @@ init_flags_type (char *name, int length)
> type = init_type (TYPE_CODE_FLAGS, length, TYPE_FLAG_UNSIGNED, name, NULL);
> TYPE_NFIELDS (type) = nfields;
> TYPE_FIELDS (type) = TYPE_ALLOC (type, nfields * sizeof (struct field));
> - memset (TYPE_FIELDS (type), 0, sizeof (struct field));
> + memset (TYPE_FIELDS (type), 0, nfields * sizeof (struct field));
>
> return type;
> }
--
Joel
More information about the Gdb-patches
mailing list