From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7952 invoked by alias); 22 Aug 2006 19:45:26 -0000 Received: (qmail 7896 invoked by uid 22791); 22 Aug 2006 19:45:26 -0000 X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO sibelius.xs4all.nl) (82.92.89.47) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 22 Aug 2006 19:45:22 +0000 Received: from elgar.sibelius.xs4all.nl (root@elgar.sibelius.xs4all.nl [192.168.0.2]) by sibelius.xs4all.nl (8.13.4/8.13.4) with ESMTP id k7MJjJYl026274 for ; Tue, 22 Aug 2006 21:45:19 +0200 (CEST) Received: from elgar.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by elgar.sibelius.xs4all.nl (8.13.6/8.13.6) with ESMTP id k7MJjJRE025323 for ; Tue, 22 Aug 2006 21:45:19 +0200 (CEST) Received: (from kettenis@localhost) by elgar.sibelius.xs4all.nl (8.13.6/8.13.6/Submit) id k7MJjJCr013229; Tue, 22 Aug 2006 21:45:19 +0200 (CEST) Date: Tue, 22 Aug 2006 20:24:00 -0000 Message-Id: <200608221945.k7MJjJCr013229@elgar.sibelius.xs4all.nl> From: Mark Kettenis To: gdb-patches@sourceware.org Subject: [commit] Fix flags type initialization bug Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-08/txt/msg00161.txt.bz2 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? Mark Index: ChangeLog from Mark Kettenis * 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; }