From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4632 invoked by alias); 25 Sep 2005 23:23:43 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 4621 invoked by uid 22791); 25 Sep 2005 23:23:38 -0000 Received: from mta09-winn.ispmail.ntl.com (HELO mta09-winn.ispmail.ntl.com) (81.103.221.49) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Sun, 25 Sep 2005 23:23:38 +0000 Received: from aamta12-winn.ispmail.ntl.com ([81.103.221.35]) by mta09-winn.ispmail.ntl.com with ESMTP id <20050925232331.YTWX9239.mta09-winn.ispmail.ntl.com@aamta12-winn.ispmail.ntl.com> for ; Mon, 26 Sep 2005 00:23:31 +0100 Received: from [127.0.0.1] (really [81.108.244.65]) by aamta12-winn.ispmail.ntl.com with ESMTP id <20050925232331.LQJL3160.aamta12-winn.ispmail.ntl.com@[127.0.0.1]> for ; Mon, 26 Sep 2005 00:23:31 +0100 Message-ID: <4337317B.3050300@ntlworld.com> Date: Sun, 25 Sep 2005 23:23:00 -0000 From: Dave Murphy User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) MIME-Version: 1.0 To: gdb-patches@sources.redhat.com Subject: [patch] Build arm-elf-gdb on mingw host Content-Type: multipart/mixed; boundary="------------000009030109070807050203" X-Antivirus: avast! (VPS 0538-7, 23/09/2005), Outbound message X-Antivirus-Status: Clean X-SW-Source: 2005-09/txt/msg00205.txt.bz2 This is a multi-part message in MIME format. --------------000009030109070807050203 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 1131 When building the bfd/doc directory under mingw/msys chew.c converts line endings to crlf. I've patched so the files are read as binary, preventing this conversion. Currently the rdi-share directory can't be built for a windows native host http://sourceware.org/ml/gdb/2005-08/msg00058.html. I've copied the embed.mt file, renamed to mingw_embed.mt and removed the parts which don't build then patched configure.tgt so that the new .mt file is used when building for a mingw host. SIGTRAP isn't defined in the MinGW headers, I patched remote-sim.c to define this if it's not defined. There are some other problems to deal with to get the debugger working with thumb code, my arm-elf toolchain is binutils 2.16.1, gcc 4.0.1 and newlib 1.13.0. With this combination gdb doesn't recognise thumb symbols in the generated elf, at least when setting breakpoints. Debugging ARM only code seems to work well. The attached patch is against current CVS HEAD. To whomever is responsible for getting the gdb sources to a point where such minimal patching is required on MinGW, great work, it's very much appreciated. Dave. --------------000009030109070807050203 Content-Type: text/plain; name="mingw-gdb.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="mingw-gdb.patch" Content-length: 2380 2005-09-25 Dave Murphy * chew.c: Prevent conversion of line endings on mingw. * configure.tgt: Use mingw_embed.mt on mingw. * remote-sim.c: Define SIMTRAP on mingw. * mingw_embed.mt: Add. Index: bfd/doc/chew.c =================================================================== RCS file: /cvs/src/src/bfd/doc/chew.c,v retrieving revision 1.19 diff -u -r1.19 chew.c --- bfd/doc/chew.c 24 Jul 2005 16:57:42 -0000 1.19 +++ bfd/doc/chew.c 25 Sep 2005 21:47:59 -0000 @@ -92,6 +92,12 @@ #define DEF_SIZE 5000 #define STACK 50 +#ifdef __MINGW32__ +/* Prevent \r\n\ line endings */ +#include +unsigned int _CRT_fmode = _O_BINARY; +#endif + int internal_wanted; int internal_mode; Index: gdb/configure.tgt =================================================================== RCS file: /cvs/src/src/gdb/configure.tgt,v retrieving revision 1.169 diff -u -r1.169 configure.tgt --- gdb/configure.tgt 15 Aug 2005 21:46:38 -0000 1.169 +++ gdb/configure.tgt 25 Sep 2005 21:48:03 -0000 @@ -61,9 +61,14 @@ arm-*-nto*) gdb_target=nto ;; arm*-*-openbsd*) gdb_target=nbsd ;; arm*-*-* | thumb*-*-* | strongarm*-*-*) - gdb_target=embed - build_rdi_share=yes - ;; + case "${host}" in + *mingw*) gdb_target=mingw_embed + ;; + * ) gdb_target=embed + build_rdi_share=yes + ;; + esac + ;; xscale-*-*) gdb_target=embed build_rdi_share=yes ;; Index: gdb/remote-sim.c =================================================================== RCS file: /cvs/src/src/gdb/remote-sim.c,v retrieving revision 1.49 diff -u -r1.49 remote-sim.c --- gdb/remote-sim.c 19 Jun 2005 20:08:37 -0000 1.49 +++ gdb/remote-sim.c 25 Sep 2005 21:48:07 -0000 @@ -44,6 +44,10 @@ #include "sim-regno.h" #include "arch-utils.h" +#ifndef SIGTRAP +#define SIGTRAP 5 +#endif + /* Prototypes */ extern void _initialize_remote_sim (void); Index: gdb/config/arm/mingw_embed.mt =================================================================== RCS file: gdb/config/arm/mingw_embed.mt diff -N gdb/config/arm/mingw_embed.mt --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ gdb/config/arm/mingw_embed.mt 25 Sep 2005 21:48:09 -0000 @@ -0,0 +1,7 @@ +# Target: ARM embedded system +TDEPFILES= arm-tdep.o remote-rdp.o +TDEPLIBS= +DEPRECATED_TM_FILE= tm-embed.h + +SIM_OBS = remote-sim.o +SIM = ../sim/arm/libsim.a --------------000009030109070807050203--