From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32550 invoked by alias); 7 Jan 2010 22:38:43 -0000 Received: (qmail 32536 invoked by uid 22791); 7 Jan 2010 22:38:42 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from p12018-ipbffx02marunouchi.tokyo.ocn.ne.jp (HELO mail.pizzafactory.jp) (222.147.75.18) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 07 Jan 2010 22:38:37 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.pizzafactory.jp (Postfix) with ESMTP id CDD67590E4DF; Fri, 8 Jan 2010 07:38:24 +0900 (JST) Received: from mail.pizzafactory.jp ([127.0.0.1]) by localhost (ldap.monami-software.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SuPINd-5V2g3; Fri, 8 Jan 2010 07:38:24 +0900 (JST) Received: from [172.16.80.18] (s209.GtokyoFL1.vectant.ne.jp [202.215.14.209]) by mail.pizzafactory.jp (Postfix) with ESMTP id 2A06E590E4D8; Fri, 8 Jan 2010 07:38:24 +0900 (JST) Subject: Re: Can't set architecture to m32c on m32c-elf-gdb. Mime-Version: 1.0 (Apple Message framework v1077) Content-Type: text/plain; charset=us-ascii From: Masaki Muranaka In-Reply-To: <4B460270.5060808@redhat.com> Date: Thu, 07 Jan 2010 22:38:00 -0000 Cc: Daniel Jacobowitz , gdb-patches@sourceware.org, binutils@sourceware.org Content-Transfer-Encoding: quoted-printable Message-Id: <440A363D-401D-45C2-ADCB-B80AF3B3048D@monami-software.com> References: <20081203140802.GA6965@caradoc.them.org> <50B2818F-7217-4D63-ABE8-19E444FE9A40@monami-software.com> <4B3C9784.1040309@redhat.com> <21F11493-3DE3-41FA-97D5-B539B54259A2@monami-software.com> <4B44A991.4010101@redhat.com> <271DFD02-74A7-4296-8253-AF4E24A38ADA@monami-software.com> <4B460270.5060808@redhat.com> To: Nick Clifton 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: 2010-01/txt/msg00146.txt.bz2 Hello Nick, Though I've not tried your patch yet, it also will works fine. But I feel my patch is better. Renesas is planning to ship R32C series. They have a lot of extensions but = basically based on M32C. R32C aims automovice areas, so it's possible they have some custom variatio= ns. I think it's better to specify architecture by printable name like cpu-arm.c > By the way, this has exposed a problem with GDB's set architecture comman= d - it is not set up to allow the "ARCH:MACH" notation that is accepted by = the BFD library. Maybe someone will want to fix this one day... Indeed, I'm mistaken about that. Thanks, On 2010/01/08, at 0:49, Nick Clifton wrote: > Hi Masaki, >=20 >> Please try 'print $dma0' on GDB (w/o my patch). >> dma0 is a register supported by m32c only. >> So the result of 'print $dma0' is ... >> In case m32c, it should be 'No registers.' >> In case m16c, it should be ''void' since it doesn't have dma0 register. >=20 > Thank you - that was the extra information that I needed in order to be a= ble to diagnose this problem. >=20 > Please try out the attached patch and let me know if it works for you. >=20 > By the way, this has exposed a problem with GDB's set architecture comman= d - it is not set up to allow the "ARCH:MACH" notation that is accepted by = the BFD library. Maybe someone will want to fix this one day... >=20 > Cheers > Nick >=20 > Index: bfd/cpu-m32c.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/bfd/cpu-m32c.c,v > retrieving revision 1.4 > diff -c -3 -p -r1.4 cpu-m32c.c > *** bfd/cpu-m32c.c 2 Sep 2009 07:18:36 -0000 1.4 > --- bfd/cpu-m32c.c 7 Jan 2010 15:44:35 -0000 > *************** > *** 22,27 **** > --- 22,40 ---- > #include "bfd.h" > #include "libbfd.h" >=20 > + /* Like bfd_default_scan but if the string is just "m32c" then > + skip the m16c architecture. */ > +=20 > + static bfd_boolean > + m32c_scan (const bfd_arch_info_type * info, const char * string) > + { > + if (strcmp (string, "m32c") =3D=3D 0 > + && info->mach =3D=3D bfd_mach_m16c) > + return FALSE; > +=20 > + return bfd_default_scan (info, string); > + } > +=20 > static const bfd_arch_info_type arch_info_struct[] =3D > { > { > *************** static const bfd_arch_info_type arch_inf > *** 35,41 **** > 3, /* section align power */ > FALSE, /* the default ? */ > bfd_default_compatible, /* architecture comparison fn */ > ! bfd_default_scan, /* string to architecture convert fn */ > NULL /* next in list */ > }, > }; > --- 48,54 ---- > 3, /* section align power */ > FALSE, /* the default ? */ > bfd_default_compatible, /* architecture comparison fn */ > ! m32c_scan, /* string to architecture convert fn */ > NULL /* next in list */ > }, > }; > *************** const bfd_arch_info_type bfd_m32c_arch =3D > *** 52,57 **** > 4, /* Section align power. */ > TRUE, /* The default ? */ > bfd_default_compatible, /* Architecture comparison fn. */ > ! bfd_default_scan, /* String to architecture convert fn. */ > &arch_info_struct[0], /* Next in list. */ > }; > --- 65,70 ---- > 4, /* Section align power. */ > TRUE, /* The default ? */ > bfd_default_compatible, /* Architecture comparison fn. */ > ! m32c_scan, /* String to architecture convert fn. */ > &arch_info_struct[0], /* Next in list. */ > };