From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15028 invoked by alias); 7 Jan 2010 15:54:45 -0000 Received: (qmail 15007 invoked by uid 22791); 7 Jan 2010 15:54:44 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 07 Jan 2010 15:54:39 +0000 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o07Fo7GQ013001 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 7 Jan 2010 10:50:07 -0500 Received: from [10.36.7.204] (vpn1-7-204.ams2.redhat.com [10.36.7.204]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o07Fn5pl025590; Thu, 7 Jan 2010 10:50:05 -0500 Message-ID: <4B460270.5060808@redhat.com> Date: Thu, 07 Jan 2010 15:54:00 -0000 From: Nick Clifton User-Agent: Thunderbird 2.0.0.23 (X11/20090825) MIME-Version: 1.0 To: Masaki Muranaka CC: Daniel Jacobowitz , gdb-patches@sourceware.org, binutils@sourceware.org Subject: Re: Can't set architecture to m32c on m32c-elf-gdb. 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> In-Reply-To: <271DFD02-74A7-4296-8253-AF4E24A38ADA@monami-software.com> Content-Type: multipart/mixed; boundary="------------030804000307040509090703" 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/msg00140.txt.bz2 This is a multi-part message in MIME format. --------------030804000307040509090703 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 676 Hi Masaki, > 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. Thank you - that was the extra information that I needed in order to be able to diagnose this problem. Please try out the attached patch and let me know if it works for you. By the way, this has exposed a problem with GDB's set architecture command - 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... Cheers Nick --------------030804000307040509090703 Content-Type: text/x-diff; name="cpu-m32c.c.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="cpu-m32c.c.patch" Content-length: 1940 Index: bfd/cpu-m32c.c =================================================================== 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" + /* Like bfd_default_scan but if the string is just "m32c" then + skip the m16c architecture. */ + + static bfd_boolean + m32c_scan (const bfd_arch_info_type * info, const char * string) + { + if (strcmp (string, "m32c") == 0 + && info->mach == bfd_mach_m16c) + return FALSE; + + return bfd_default_scan (info, string); + } + static const bfd_arch_info_type arch_info_struct[] = { { *************** 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 = *** 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. */ }; --------------030804000307040509090703--