========== gdb.config: ========== #!/bin/sh CFLAGS="-g3 -O0" \ CXXFLAGS="-g3 -O0" \ CFLAGS_FOR_TARGET="-g3 -O0 --sysroot=$HOME/midipix/nt64/debug/native" \ CXX_FOR_TARGET="-g3 -O0 --sysroot=$HOME/midipix/nt64/debug/native" \ LDFLAGS_FOR_TARGET="--sysroot=$HOME/midipix/nt64/debug/native" \ ../gdb-7.12/configure \ --with-system-zlib \ --with-system-libiberty \ --with-system-readline \ --host=x86_64-nt64-midipix \ --target=x86_64-nt64-midipix \ --build=$(cc -dumpmachine) ======== gdb.make: ======== #!/bin/sh make LIBTOOL=rdlibtool MAKE="make LIBTOOL=rdlibtool" -j8 \ SYSROOT_FLAGS=--sysroot=$HOME/midipix/nt64/debug/native =========== gdb.install: =========== #!/bin/sh make LIBTOOL=rdlibtool MAKE="make LIBTOOL=rdlibtool" -j8 \ SYSROOT_FLAGS=--sysroot=$HOME/midipix/nt64/debug/native \ DESTDIR=destdir install diff -ru --new-file a/bfd/config.bfd b/bfd/config.bfd --- a/bfd/config.bfd 2016-08-01 15:50:20.000000000 +0000 +++ b/bfd/config.bfd 2019-06-03 23:32:57.633401252 +0000 @@ -729,7 +729,7 @@ targ_archs="$targ_archs bfd_arm_arch" want64=true ;; - x86_64-*-mingw* | x86_64-*-pe | x86_64-*-pep | x86_64-*-cygwin) + x86_64-*-mingw* | x86_64-*-pe | x86_64-*-pep | x86_64-*-cygwin | x86_64-*-midipix) targ_defvec=x86_64_pe_vec targ_selvecs="x86_64_pe_vec x86_64_pei_vec x86_64_pe_be_vec x86_64_elf64_vec l1om_elf64_vec k1om_elf64_vec i386_pe_vec i386_pei_vec i386_elf32_vec iamcu_elf32_vec" want64=true @@ -782,7 +782,7 @@ targ_defvec=i386_elf32_vec targ_selvecs="iamcu_elf32_vec i386_coff_vec" ;; - i[3-7]86-*-mingw32* | i[3-7]86-*-cygwin* | i[3-7]86-*-winnt | i[3-7]86-*-pe) + i[3-7]86-*-mingw32* | i[3-7]86-*-cygwin* | i[3-7]86-*-winnt | i[3-7]86-*-pe | i[3-7]86-*-midipix) targ_defvec=i386_pe_vec targ_selvecs="i386_pe_vec i386_pei_vec i386_elf32_vec iamcu_elf32_vec" targ_underscore=yes diff -ru --new-file a/bfd/Makefile.in b/bfd/Makefile.in --- a/bfd/Makefile.in 2016-10-07 17:09:21.000000000 +0000 +++ b/bfd/Makefile.in 2019-06-03 23:32:57.637401253 +0000 @@ -385,8 +385,8 @@ # This is where we get zlib from. zlibdir is -L../zlib and zlibinc is # -I../zlib, unless we were configured with --with-system-zlib, in which # case both are empty. -ZLIB = @zlibdir@ -lz -ZLIBINC = @zlibinc@ +ZLIB = @zlibdir@ -lz $(SYSROOT_FLAGS) +ZLIBINC = @zlibinc@ $(SYSROOT_FLAGS) AM_CFLAGS = $(WARN_CFLAGS) $(ZLIBINC) AM_CPPFLAGS = -DBINDIR='"$(bindir)"' @PLUGINS_TRUE@LIBDL = @lt_cv_dlopen_libs@ diff -ru --new-file a/config.guess b/config.guess --- a/config.guess 2016-08-01 15:50:20.000000000 +0000 +++ b/config.guess 2019-06-03 23:32:57.637401253 +0000 @@ -4,6 +4,9 @@ timestamp='2016-05-27' +echo x86_64-nt64-midipix +exit + # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or diff -ru --new-file a/config.sub b/config.sub --- a/config.sub 2016-08-01 15:50:20.000000000 +0000 +++ b/config.sub 2019-06-03 23:32:57.637401253 +0000 @@ -1389,7 +1389,7 @@ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ + | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ diff -ru --new-file a/gdb/config/i386/midipix64.mh b/gdb/config/i386/midipix64.mh --- a/gdb/config/i386/midipix64.mh 1970-01-01 00:00:00.000000000 +0000 +++ b/gdb/config/i386/midipix64.mh 2019-06-03 23:33:23.657405443 +0000 @@ -0,0 +1 @@ + diff -ru --new-file a/gdb/config/i386/midipix.mh b/gdb/config/i386/midipix.mh --- a/gdb/config/i386/midipix.mh 1970-01-01 00:00:00.000000000 +0000 +++ b/gdb/config/i386/midipix.mh 2019-06-03 23:33:15.317404098 +0000 @@ -0,0 +1 @@ + diff -ru --new-file a/gdb/configure.host b/gdb/configure.host --- a/gdb/configure.host 2016-08-01 15:50:20.000000000 +0000 +++ b/gdb/configure.host 2019-06-03 23:32:57.637401253 +0000 @@ -109,6 +109,7 @@ ;; i[34567]86-*-msdosdjgpp*) gdb_host=go32 ;; i[34567]86-*-linux*) gdb_host=linux ;; +i[34567]86-*-midipix*) gdb_host=midipix ;; i[34567]86-*-gnu*) gdb_host=i386gnu ;; i[3456]86-*-nto*) gdb_host=nto ;; i[34567]86-*-openbsd*) gdb_host=obsd ;; @@ -174,6 +175,7 @@ vax-*-openbsd*) gdb_host=obsd ;; x86_64-*-linux*) gdb_host=linux64 ;; +x86_64-*-midipix*) gdb_host=midipix64 ;; x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu) gdb_host=fbsd64 ;; x86_64-*-netbsd* | x86_64-*-knetbsd*-gnu) diff -ru --new-file a/gdb/configure.tgt b/gdb/configure.tgt --- a/gdb/configure.tgt 2016-10-07 17:09:21.000000000 +0000 +++ b/gdb/configure.tgt 2019-06-04 14:11:22.091870500 +0000 @@ -229,6 +229,12 @@ fi build_gdbserver=yes ;; +i[34567]86-*-midipix*) + # Target: Intel 386 running win32 + gdb_target_obs="i386-tdep.o i387-tdep.o \ + i386-winnt-tdep.o windows-tdep.o" + build_gdbserver=no + ;; i[34567]86-*-gnu*) # Target: Intel 386 running the GNU Hurd gdb_target_obs="i386-tdep.o i387-tdep.o i386gnu-tdep.o solib-svr4.o" @@ -678,6 +684,13 @@ windows-tdep.o" build_gdbserver=yes ;; +x86_64-*-midipix) + # Target: Midipix + gdb_target_obs="amd64-tdep.o amd64-winnt-tdep.o \ + i386-tdep.o i387-tdep.o \ + windows-tdep.o i386-winnt-tdep.o" + build_gdbserver=no + ;; x86_64-*-netbsd* | x86_64-*-knetbsd*-gnu) # Target: NetBSD/amd64 gdb_target_obs="amd64-tdep.o amd64nbsd-tdep.o i386-tdep.o i387-tdep.o \ @@ -718,6 +731,7 @@ *-*-mingw32ce*) gdb_osabi=GDB_OSABI_WINCE ;; *-*-mingw* | *-*-cygwin*) gdb_osabi=GDB_OSABI_CYGWIN ;; +*-*-midipix*) gdb_osabi=GDB_OSABI_WINNT ;; *-*-dicos*) gdb_osabi=GDB_OSABI_DICOS ;; *-*-symbianelf*) gdb_osabi=GDB_OSABI_SYMBIAN ;; diff -ru --new-file a/gdb/defs.h b/gdb/defs.h --- a/gdb/defs.h 2016-10-07 17:09:21.000000000 +0000 +++ b/gdb/defs.h 2019-06-03 23:32:57.637401253 +0000 @@ -602,6 +602,7 @@ GDB_OSABI_NETBSD_ELF, GDB_OSABI_OPENBSD_ELF, GDB_OSABI_WINCE, + GDB_OSABI_WINNT, GDB_OSABI_GO32, GDB_OSABI_IRIX, GDB_OSABI_HPUX_ELF, diff -ru --new-file a/gdb/doc/Makefile.in b/gdb/doc/Makefile.in --- a/gdb/doc/Makefile.in 2016-08-01 15:50:20.000000000 +0000 +++ b/gdb/doc/Makefile.in 2019-06-03 23:32:57.637401253 +0000 @@ -74,8 +74,8 @@ # Where is the source dir for the READLINE library doc? # Traditionally readline is in .. or . -READLINE_DIR = ${gdbdir}/../readline/doc -READLINE_TEXI_INCFLAG = @READLINE_TEXI_INCFLAG@ +READLINE_DIR = # ${gdbdir}/../readline/doc +READLINE_TEXI_INCFLAG = # @READLINE_TEXI_INCFLAG@ # The GDB/MI docs come from a sibling directory ../mi GDBMI_DIR = ${gdbdir}/mi @@ -673,6 +673,10 @@ maintainer-clean realclean: distclean rm -f GDBvn.texi *.info* *.dvi *.ps *.html *.pdf $(MANS) +ifeq (0,0) +install: +else install: install-info install-man +endif uninstall: uninstall-info uninstall-man diff -ru --new-file a/gdb/Makefile.in b/gdb/Makefile.in --- a/gdb/Makefile.in 2016-10-07 17:09:21.000000000 +0000 +++ b/gdb/Makefile.in 2019-06-03 23:32:57.637401253 +0000 @@ -150,7 +150,7 @@ # This is where we get zlib from. zlibdir is -L../zlib and zlibinc is # -I../zlib, unless we were configured with --with-system-zlib, in which # case both are empty. -ZLIB = @zlibdir@ -lz +ZLIB = @zlibdir@ -lz $(SYSROOT_FLAGS) ZLIBINC = @zlibinc@ # Where is the decnumber library? Typically in ../libdecnumber. @@ -162,9 +162,9 @@ # Where is the READLINE library? Typically in ../readline. READLINE_DIR = ../readline READLINE_SRC = $(srcdir)/$(READLINE_DIR) -READLINE = @READLINE@ -READLINE_DEPS = @READLINE_DEPS@ -READLINE_CFLAGS = @READLINE_CFLAGS@ +READLINE = -lreadline +READLINE_DEPS = +READLINE_CFLAGS = $(SYSROOT_FLAGS) # Where is expat? This will be empty if expat was not available. LIBEXPAT = @LIBEXPAT@ @@ -468,12 +468,12 @@ # disassemblers? OPCODES_DIR = ../opcodes OPCODES_SRC = $(srcdir)/$(OPCODES_DIR) -OPCODES = $(OPCODES_DIR)/libopcodes.a +OPCODES = -lopcodes # Where are the other opcode tables which only have header file # versions? OP_INCLUDE = $(INCLUDE_DIR)/opcode # Some source files like to use #include "opcodes/file.h" -OPCODES_CFLAGS = -I$(OP_INCLUDE) -I$(OPCODES_SRC)/.. +OPCODES_CFLAGS = -I$(OP_INCLUDE) -I$(OPCODES_SRC)/.. $(SYSROOT_FLAGS) # The simulator is usually nonexistent; targets that include one # should set this to list all the .o or .a files to be linked in. @@ -599,7 +599,7 @@ $(LIBEXPAT) $(LIBLZMA) $(LIBBABELTRACE) $(LIBIPT) \ $(LIBIBERTY) $(WIN32LIBS) $(LIBGNU) $(LIBICONV) CDEPS = $(XM_CDEPS) $(NAT_CDEPS) $(SIM) $(BFD) $(READLINE_DEPS) \ - $(OPCODES) $(INTL_DEPS) $(LIBIBERTY) $(CONFIG_DEPS) $(LIBGNU) + $(INTL_DEPS) $(LIBIBERTY) $(CONFIG_DEPS) $(LIBGNU) ADD_FILES = $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES) ADD_DEPS = $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES) diff -ru --new-file a/gdb/amd64-winnt-tdep.c b/gdb/amd64-winnt-tdep.c --- a/gdb/amd64-winnt-tdep.c 1970-01-01 00:00:00.000000000 +0000 +++ b/gdb/amd64-winnt-tdep.c 2019-06-04 16:22:12.929814200 +0000 @@ -0,0 +1,47 @@ +#include "defs.h" +#include "osabi.h" +#include "frame-unwind.h" +#include "windows-tdep.h" +#include "amd64-windows-tdep.c" + +#define amd64_winnt_push_dummy_call amd64_windows_push_dummy_call +#define amd64_winnt_return_value amd64_windows_return_value +#define amd64_winnt_skip_trampoline_code amd64_windows_skip_trampoline_code + +#define amd64_winnt_skip_prologue amd64_windows_skip_prologue +#define amd64_winnt_skip_main_prologue amd64_skip_main_prologue + +static void +amd64_winnt_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) +{ + /* abi */ + amd64_init_abi (info, gdbarch); + windows_init_abi (info, gdbarch); + + /* out-of-band function calls */ + set_gdbarch_push_dummy_call (gdbarch, amd64_winnt_push_dummy_call); + set_gdbarch_return_value (gdbarch, amd64_winnt_return_value); + set_gdbarch_skip_trampoline_code (gdbarch, amd64_winnt_skip_trampoline_code); + + /* skip prologue methods */ + set_gdbarch_skip_prologue (gdbarch, amd64_windows_skip_prologue); + set_gdbarch_skip_main_prologue (gdbarch, amd64_skip_main_prologue); + + /* todo: SEH unwinder */ + frame_unwind_append_unwinder (gdbarch, 0); + + /* todo: inferior-specific, dynamically detected size of long */ + set_gdbarch_long_bit (gdbarch, 64); +} + +extern initialize_file_ftype _initialize_amd64_winnt_tdep; + +void +_initialize_amd64_winnt_tdep (void) +{ + gdbarch_register_osabi( + bfd_arch_i386, + bfd_mach_x86_64, + GDB_OSABI_WINNT, + amd64_winnt_init_abi); +} diff -ru --new-file a/gdb/i386-winnt-tdep.c b/gdb/i386-winnt-tdep.c --- a/gdb/i386-winnt-tdep.c 1970-01-01 00:00:00.000000000 +0000 +++ b/gdb/i386-winnt-tdep.c 2019-06-04 14:43:15.890632100 +0000 @@ -0,0 +1,37 @@ +#include "defs.h" +#include "osabi.h" +#include "frame-unwind.h" +#include "windows-tdep.h" + +static void +i386_winnt_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) +{ + /* abi */ + windows_init_abi (info, gdbarch); + + /* out-of-band function calls */ + set_gdbarch_push_dummy_call (gdbarch, 0); + set_gdbarch_return_value (gdbarch, 0); + + /* progloue/trampoline methods */ + set_gdbarch_skip_main_prologue (gdbarch, 0); + set_gdbarch_skip_trampoline_code (gdbarch, 0); + + /* auto wide charset hack */ + set_gdbarch_auto_wide_charset (gdbarch, 0); + + /* unwainder */ + frame_unwind_append_unwinder (gdbarch, 0); +} + +extern initialize_file_ftype _initialize_i386_winnt_tdep; + +void +_initialize_i386_winnt_tdep (void) +{ + gdbarch_register_osabi( + bfd_arch_i386, + 0, + GDB_OSABI_WINNT, + i386_winnt_init_abi); +} diff -ru --new-file a/gdb/osabi.c b/gdb/osabi.c --- a/gdb/osabi.c 2016-08-01 15:50:20.000000000 +0000 +++ b/gdb/osabi.c 2019-06-04 00:54:53.410635600 +0000 @@ -70,6 +70,7 @@ { "NetBSD/ELF", NULL }, { "OpenBSD/ELF", NULL }, { "WindowsCE", NULL }, + { "WINNT", "(midipix)" }, { "DJGPP", NULL }, { "Irix", NULL }, { "HP-UX/ELF", NULL }, diff -ru --new-file a/gdb/stub-termcap.c b/gdb/stub-termcap.c --- a/gdb/stub-termcap.c 2016-10-07 17:09:21.000000000 +0000 +++ b/gdb/stub-termcap.c 2019-06-03 23:32:57.637401253 +0000 @@ -50,11 +50,13 @@ weak (later versions, e.g., 4.8, do support it). Given this stub file originally was Windows only, and we only needed this when we made it work on other hosts, it should be OK. */ +#if 0 #ifndef __MINGW32__ char PC __attribute__((weak)); char *BC __attribute__((weak)); char *UP __attribute__((weak)); #endif +#endif /* Each of the files below is a minimal implementation of the standard termcap function with the same name, suitable for use in a Windows