Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Dave Murphy <wintermute2k4@ntlworld.com>
To: gdb-patches@sources.redhat.com
Subject: [patch] Build arm-elf-gdb on mingw host
Date: Sun, 25 Sep 2005 23:23:00 -0000	[thread overview]
Message-ID: <4337317B.3050300@ntlworld.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1131 bytes --]

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.

[-- Attachment #2: mingw-gdb.patch --]
[-- Type: text/plain, Size: 2380 bytes --]

2005-09-25  Dave Murphy  <davem@devkitpro.org>

	* 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 <fcntl.h>
+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

             reply	other threads:[~2005-09-25 23:23 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-25 23:23 Dave Murphy [this message]
2005-09-26  3:46 ` Eli Zaretskii
2005-09-26  3:59   ` Daniel Jacobowitz
2005-09-26  4:46     ` Dave Murphy
2005-09-26 13:23       ` Daniel Jacobowitz
2005-09-26 14:09         ` Christopher Faylor
2005-09-26 14:14           ` Daniel Jacobowitz
2005-09-26 14:26             ` Christopher Faylor
2005-09-26 14:31               ` Daniel Jacobowitz
2005-09-26 15:41                 ` Christopher Faylor
2005-09-26 19:18                 ` Eli Zaretskii
2006-04-08 20:21               ` Daniel Jacobowitz
2006-04-10 16:51                 ` Christopher Faylor
2006-04-10 16:58                   ` Daniel Jacobowitz
2005-09-26 19:16             ` Eli Zaretskii
2005-09-27  2:02               ` Christopher Faylor
2005-09-26 19:13           ` Eli Zaretskii
2005-09-26 19:08       ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4337317B.3050300@ntlworld.com \
    --to=wintermute2k4@ntlworld.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox