From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28515 invoked by alias); 30 Jun 2007 17:15:32 -0000 Received: (qmail 28507 invoked by uid 22791); 30 Jun 2007 17:15:31 -0000 X-Spam-Check-By: sourceware.org Received: from mail.gmx.net (HELO mail.gmx.net) (213.165.64.20) by sourceware.org (qpsmtpd/0.31) with SMTP; Sat, 30 Jun 2007 17:15:28 +0000 Received: (qmail invoked by alias); 30 Jun 2007 17:15:25 -0000 Received: from p57AF0D2B.dip0.t-ipconnect.de (EHLO igel.home) [87.175.13.43] by mail.gmx.net (mp045) with SMTP; 30 Jun 2007 19:15:25 +0200 X-Authenticated: #17701509 Received: by igel.home (Postfix, from userid 500) id D9CB010C234; Sat, 30 Jun 2007 19:15:24 +0200 (CEST) From: Andreas Schwab To: gdb-patches@sourceware.org Subject: Pretty printing for m68k status register X-Yow: Everybody is going somewhere!! It's probably a garage sale or a disaster Movie!! Date: Sat, 30 Jun 2007 18:22:00 -0000 Message-ID: User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Y-GMX-Trusted: 0 X-IsSubscribed: yes 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: 2007-06/txt/msg00544.txt.bz2 This implements pretty printing of the bits in the m68k status register. Andreas. 2007-06-30 Andreas Schwab * m68k-tdep.c (m68k_ps_type): New. (m68k_init_types): New. (m68k_register_type): Use m68k_ps_type for PS register. (_initialize_m68k_tdep): Call m68k_init_types. Index: gdb/m68k-tdep.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/gdb/m68k-tdep.c,v retrieving revision 1.121 diff -u -a -p -a -u -p -r1.121 gdb/m68k-tdep.c --- gdb/m68k-tdep.c 30 Jun 2007 15:35:19 -0000 1.121 +++ gdb/m68k-tdep.c 30 Jun 2007 17:11:32 -0000 @@ -69,6 +69,32 @@ m68k_local_breakpoint_from_pc (CORE_ADDR *lenptr =3D sizeof (break_insn); return break_insn; } +=0C + +/* Type for %ps. */ +struct type *m68k_ps_type; + +/* Construct types for ISA-specific registers. */ +static void +m68k_init_types (void) +{ + struct type *type; + + type =3D init_flags_type ("builtin_type_m68k_ps", 4); + append_flags_type_flag (type, 0, "C"); + append_flags_type_flag (type, 1, "V"); + append_flags_type_flag (type, 2, "Z"); + append_flags_type_flag (type, 3, "N"); + append_flags_type_flag (type, 4, "X"); + append_flags_type_flag (type, 8, "I0"); + append_flags_type_flag (type, 9, "I1"); + append_flags_type_flag (type, 10, "I2"); + append_flags_type_flag (type, 12, "M"); + append_flags_type_flag (type, 13, "S"); + append_flags_type_flag (type, 14, "T0"); + append_flags_type_flag (type, 15, "T1"); + m68k_ps_type =3D type; +} =20 /* Return the GDB type object for the "standard" data type of data in register N. This should be int for D0-D7, SR, FPCONTROL and @@ -112,6 +138,9 @@ m68k_register_type (struct gdbarch *gdba if (regnum >=3D M68K_A0_REGNUM && regnum <=3D M68K_A0_REGNUM + 7) return builtin_type_void_data_ptr; =20 + if (regnum =3D=3D M68K_PS_REGNUM) + return m68k_ps_type; + return builtin_type_int32; } =20 @@ -1249,4 +1278,7 @@ void _initialize_m68k_tdep (void) { gdbarch_register (bfd_arch_m68k, m68k_gdbarch_init, m68k_dump_tdep); + + /* Initialize the m68k-specific register types. */ + m68k_init_types (); } --=20 Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux Products GmbH, Maxfeldstra=DFe 5, 90409 N=FCrnberg, Germany Key fingerprint =3D 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."