From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26742 invoked by alias); 29 Dec 2006 21:17:14 -0000 Received: (qmail 26733 invoked by uid 22791); 29 Dec 2006 21:17:13 -0000 X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO brahms.sibelius.xs4all.nl) (82.92.89.47) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 29 Dec 2006 21:17:10 +0000 Received: from brahms.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by brahms.sibelius.xs4all.nl (8.13.8/8.13.8) with ESMTP id kBTL0rBt026637 for ; Fri, 29 Dec 2006 22:00:53 +0100 (CET) Received: (from kettenis@localhost) by brahms.sibelius.xs4all.nl (8.13.8/8.13.8/Submit) id kBTL0rja030186; Fri, 29 Dec 2006 22:00:53 +0100 (CET) Date: Fri, 29 Dec 2006 21:17:00 -0000 Message-Id: <200612292100.kBTL0rja030186@brahms.sibelius.xs4all.nl> From: Mark Kettenis To: gdb-patches@sourceware.org Subject: [commit] SPARC flag register support Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-12/txt/msg00352.txt.bz2 Committed, Mark Index: ChangeLog from Mark Kettenis * sparc-tdep.c (sparc_psr_type, sparc_fsr_type): New variables. (sparc_init_types): New function. (sparc32_register_type): Use appropriate flag types for %fsr and %prs. (_initialize_sparc_tdep): Call sparc_init_types. Index: sparc-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/sparc-tdep.c,v retrieving revision 1.174 diff -u -p -r1.174 sparc-tdep.c --- sparc-tdep.c 9 Nov 2006 16:36:58 -0000 1.174 +++ sparc-tdep.c 29 Dec 2006 20:41:44 -0000 @@ -294,6 +294,48 @@ sparc32_register_name (int regnum) return NULL; } + + +/* Type for %psr. */ +struct type *sparc_psr_type; + +/* Type for %fsr. */ +struct type *sparc_fsr_type; + +/* Construct types for ISA-specific registers. */ + +static void +sparc_init_types (void) +{ + struct type *type; + + type = init_flags_type ("builtin_type_sparc_psr", 4); + append_flags_type_flag (type, 5, "ET"); + append_flags_type_flag (type, 6, "PS"); + append_flags_type_flag (type, 7, "S"); + append_flags_type_flag (type, 12, "EF"); + append_flags_type_flag (type, 13, "EC"); + sparc_psr_type = type; + + type = init_flags_type ("builtin_type_sparc_fsr", 4); + append_flags_type_flag (type, 0, "NXA"); + append_flags_type_flag (type, 1, "DZA"); + append_flags_type_flag (type, 2, "UFA"); + append_flags_type_flag (type, 3, "OFA"); + append_flags_type_flag (type, 4, "NVA"); + append_flags_type_flag (type, 5, "NXC"); + append_flags_type_flag (type, 6, "DZC"); + append_flags_type_flag (type, 7, "UFC"); + append_flags_type_flag (type, 8, "OFC"); + append_flags_type_flag (type, 9, "NVC"); + append_flags_type_flag (type, 22, "NS"); + append_flags_type_flag (type, 23, "NXM"); + append_flags_type_flag (type, 24, "DZM"); + append_flags_type_flag (type, 25, "UFM"); + append_flags_type_flag (type, 26, "OFM"); + append_flags_type_flag (type, 27, "NVM"); + sparc_fsr_type = type; +} /* Return the GDB type object for the "standard" data type of data in register REGNUM. */ @@ -313,6 +355,12 @@ sparc32_register_type (struct gdbarch *g if (regnum == SPARC32_PC_REGNUM || regnum == SPARC32_NPC_REGNUM) return builtin_type_void_func_ptr; + if (regnum == SPARC32_PSR_REGNUM) + return sparc_psr_type; + + if (regnum == SPARC32_FSR_REGNUM) + return sparc_fsr_type; + return builtin_type_int32; } @@ -1621,4 +1669,7 @@ void _initialize_sparc_tdep (void) { register_gdbarch_init (bfd_arch_sparc, sparc32_gdbarch_init); + + /* Initialize the SPARC-specific register types. */ + sparc_init_types(); }