Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tools/gdb Save the mknative-gdb for 8.3 and prepare the mkna...



details:   https://anonhg.NetBSD.org/src/rev/0bd900dfeabb
branches:  trunk
changeset: 944069:0bd900dfeabb
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Sep 17 02:14:48 2020 +0000

description:
Save the mknative-gdb for 8.3 and prepare the mknative-gdb for 10.x

diffstat:

 tools/gdb/mknative-gdb     |   38 +++++++--
 tools/gdb/mknative-gdb.old |  174 +++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 203 insertions(+), 9 deletions(-)

diffs (270 lines):

diff -r 7fc94fe1a65b -r 0bd900dfeabb tools/gdb/mknative-gdb
--- a/tools/gdb/mknative-gdb    Thu Sep 17 02:12:31 2020 +0000
+++ b/tools/gdb/mknative-gdb    Thu Sep 17 02:14:48 2020 +0000
@@ -1,5 +1,5 @@
 #!/bin/sh
-#      $NetBSD: mknative-gdb,v 1.8 2019/05/29 01:56:06 christos Exp $
+#      $NetBSD: mknative-gdb,v 1.9 2020/09/17 02:14:48 christos Exp $
 #
 # Shell script for generating all the constants needed for a native
 # platform build of src/external/gpl3/gdb
@@ -71,12 +71,12 @@
        mkdir -p $_TOP/$_READLINE/arch/$_MACHINE_SUBDIR
 
        {
-               getvars readline/Makefile \
+               getvars readline/readline/Makefile \
                        CCFLAGS OBJECTS
        } | write_mk $_READLINE/arch/$_MACHINE_SUBDIR/defs.mk
 
        write_c $_READLINE/arch/$_MACHINE_SUBDIR/config.h \
-               <$_TMPDIR/readline/config.h
+               <$_TMPDIR/readline/readline/config.h
 }
 
 ##### gdb/lib/libdecnumber #####
@@ -91,7 +91,7 @@
        write_mk $_DECNUMBER/arch/$_MACHINE_SUBDIR/defs.mk
 
        write_c $_DECNUMBER/arch/$_MACHINE_SUBDIR/config.h \
-               <$_TMPDIR/readline/config.h
+               <$_TMPDIR/readline/readline/config.h
 
        write_c $_DECNUMBER/arch/$_MACHINE_SUBDIR/gstdint.h \
                < $_TMPDIR/libdecnumber/gstdint.h
@@ -101,7 +101,8 @@
 
 get_gdb_libgdb () {
        local _GDBP=$_GDB/lib/libgdb
-       mkdir -p $_TOP/$_GDBP/arch/$_MACHINE_SUBDIR/build-gnulib
+       mkdir -p $_TOP/$_GDBP/arch/$_MACHINE_SUBDIR/gnulib/import
+       mkdir -p $_TOP/$_GDBP/arch/$_MACHINE_SUBDIR/gdbsupport/import
 
        {
                getvars gdb/Makefile \
@@ -109,6 +110,7 @@
        } | sed -e s@arch/@@g -e s@cli/@@g -e s@common/agent@common-agent@ \
                -e s@common/@@g -e s@compile/@@g -e s@guile/@@g -e s@mi/@@g \
                -e s@nat/@@g -e s@python/@@g -e s@target/@@g \
+               -e s@dwarf2/@@g -e s@unittests/@@g \
                -e s@tui/@@g | write_mk $_GDBP/arch/$_MACHINE_SUBDIR/defs.mk
 
 #      getvars gdb/gdbserver/Makefile \
@@ -116,17 +118,35 @@
 #              | write_mk $_GDB/bin/gdb/arch/$_MACHINE_SUBDIR/gdbserver.mk
 
        for i in config.h version.c init.c \
-           xml-builtin.c build-gnulib/config.h jit-reader.h
+           xml-builtin.c jit-reader.h
        do
            write_c $_GDBP/arch/$_MACHINE_SUBDIR/$i \
                < $_TMPDIR/gdb/$i
        done
+       
+       for i in gnulib/config.h gdbsupport/config.h \
+           gnulib/import/alloca.h gnulib/import/ctype.h \
+           gnulib/import/dirent.h gnulib/import/fcntl.h \
+           gnulib/import/fnmatch.h gnulib/import/glob.h \
+           gnulib/import/inttypes.h gnulib/import/limits.h \
+           gnulib/import/locale.h gnulib/import/math.h \
+           gnulib/import/signal.h gnulib/import/stdint.h \
+           gnulib/import/stdio.h gnulib/import/stdlib.h \
+           gnulib/import/string.h gnulib/import/time.h \
+           gnulib/import/unistd.h gnulib/import/wchar.h \
+           gnulib/import/wctype.h
+       do
+           write_c $_GDBP/arch/$_MACHINE_SUBDIR/$i \
+               < $_TMPDIR/$i
+       done
 
        for f in nm tm xm; do
-               if [ -f $_TMPDIR/gdb/$f.h ]; then 
-                       ls -l $_TMPDIR/gdb/$f.h | sed 's,^.*->.*/gdb/,,;s,^,#include <,;s,$,>,' \
-                               | write_c $_GDBP/arch/$_MACHINE_SUBDIR/$f.h
+               if [ ! -f $_TMPDIR/gdb/$f.h ]; then 
+                       continue
                fi
+               ls -l $_TMPDIR/gdb/$f.h | \
+                       sed 's,^.*->.*/gdb/,,;s,^,#include <,;s,$,>,' | \
+                       write_c $_GDBP/arch/$_MACHINE_SUBDIR/$f.h
        done
 
        local _LIBSIM=$_GDB/lib/libsim
diff -r 7fc94fe1a65b -r 0bd900dfeabb tools/gdb/mknative-gdb.old
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/gdb/mknative-gdb.old        Thu Sep 17 02:14:48 2020 +0000
@@ -0,0 +1,174 @@
+#!/bin/sh
+#      $NetBSD: mknative-gdb.old,v 1.1 2020/09/17 02:14:48 christos Exp $
+#
+# Shell script for generating all the constants needed for a native
+# platform build of src/external/gpl3/gdb
+#
+
+# initialise
+
+_TMPDIR=$2
+_TOP=$3
+_PLATFORM=$4
+_MACHINE_SUBDIR=$5
+_VPATH=`grep VPATH ${_TMPDIR}/Makefile | sed 's,^.*=[  ]*,,'`
+_GDB=external/gpl3/gdb
+
+. $_TOP/tools/gcc/mknative.common
+
+##### gdb/lib/libbfd #####
+
+get_gdb_libbfd () {
+       local _BFD=$_GDB/lib/libbfd
+       mkdir -p $_TOP/$_BFD/arch/$_MACHINE_SUBDIR
+
+       {
+               getvars bfd/Makefile \
+                       libbfd_la_DEPENDENCIES libbfd_la_OBJECTS DEFS \
+                       INCLUDES TDEFAULTS
+       } | write_mk $_BFD/arch/$_MACHINE_SUBDIR/defs.mk
+
+       for i in bfd-in3.h bfd_stdint.h config.h bfd.h bfdver.h targmatch.h 
+       do
+           write_c $_BFD/arch/$_MACHINE_SUBDIR/$i <$_TMPDIR/bfd/$i
+       done
+}
+
+##### gdb/lib/libopcodes #####
+
+get_gdb_libopcodes () {
+       local _OPCODES=$_GDB/lib/libopcodes
+       mkdir -p $_TOP/$_OPCODES/arch/$_MACHINE_SUBDIR
+
+       {
+               getvars opcodes/Makefile \
+                       archdefs BFD_MACHINES libopcodes_la_SOURCES
+       } | write_mk $_GDB/lib/libopcodes//arch/$_MACHINE_SUBDIR/defs.mk
+
+       {
+               cat $_TMPDIR/opcodes/config.h
+       } | write_c $_OPCODES/arch/$_MACHINE_SUBDIR/config.h
+}
+
+##### gdb/lib/libiberty #####
+
+get_gdb_libiberty () {
+       local _IBERTY=$_GDB/lib/libiberty
+       mkdir -p $_TOP/$_IBERTY/arch/$_MACHINE_SUBDIR
+
+       getvars libiberty/Makefile \
+               ALLOCA EXTRA_OFILES LIBOBJS REQUIRED_OFILES \
+               | write_mk $_IBERTY/arch/$_MACHINE_SUBDIR/defs.mk
+
+       write_c $_IBERTY/arch/$_MACHINE_SUBDIR/config.h \
+               <$_TMPDIR/libiberty/config.h
+}
+
+##### gdb/lib/libreadline #####
+
+get_gdb_libreadline () {
+       local _READLINE=$_GDB/lib/libreadline
+       mkdir -p $_TOP/$_READLINE/arch/$_MACHINE_SUBDIR
+
+       {
+               getvars readline/Makefile \
+                       CCFLAGS OBJECTS
+       } | write_mk $_READLINE/arch/$_MACHINE_SUBDIR/defs.mk
+
+       write_c $_READLINE/arch/$_MACHINE_SUBDIR/config.h \
+               <$_TMPDIR/readline/config.h
+}
+
+##### gdb/lib/libdecnumber #####
+
+get_gdb_libdecnumber () {
+       local _DECNUMBER=$_GDB/lib/libdecnumber
+       mkdir -p $_TOP/$_DECNUMBER/arch/$_MACHINE_SUBDIR
+
+       getvars libdecnumber/Makefile \
+               libdecnumber_a_OBJS |
+       sed -e s/libdecnumber_a_// |
+       write_mk $_DECNUMBER/arch/$_MACHINE_SUBDIR/defs.mk
+
+       write_c $_DECNUMBER/arch/$_MACHINE_SUBDIR/config.h \
+               <$_TMPDIR/readline/config.h
+
+       write_c $_DECNUMBER/arch/$_MACHINE_SUBDIR/gstdint.h \
+               < $_TMPDIR/libdecnumber/gstdint.h
+}
+
+##### gdb/lib/libgdb #####
+
+get_gdb_libgdb () {
+       local _GDBP=$_GDB/lib/libgdb
+       mkdir -p $_TOP/$_GDBP/arch/$_MACHINE_SUBDIR/build-gnulib
+
+       {
+               getvars gdb/Makefile \
+                       INTERNAL_CFLAGS LIBGDB_OBS SIM_OBS
+       } | sed -e s@arch/@@g -e s@cli/@@g -e s@common/agent@common-agent@ \
+               -e s@common/@@g -e s@compile/@@g -e s@guile/@@g -e s@mi/@@g \
+               -e s@nat/@@g -e s@python/@@g -e s@target/@@g \
+               -e s@tui/@@g | write_mk $_GDBP/arch/$_MACHINE_SUBDIR/defs.mk
+
+#      getvars gdb/gdbserver/Makefile \
+#              INTERNAL_CFLAGS OBS \
+#              | write_mk $_GDB/bin/gdb/arch/$_MACHINE_SUBDIR/gdbserver.mk
+
+       for i in config.h version.c init.c \
+           xml-builtin.c build-gnulib/config.h jit-reader.h
+       do
+           write_c $_GDBP/arch/$_MACHINE_SUBDIR/$i \
+               < $_TMPDIR/gdb/$i
+       done
+
+       for f in nm tm xm; do
+               if [ -f $_TMPDIR/gdb/$f.h ]; then 
+                       ls -l $_TMPDIR/gdb/$f.h | sed 's,^.*->.*/gdb/,,;s,^,#include <,;s,$,>,' \
+                               | write_c $_GDBP/arch/$_MACHINE_SUBDIR/$f.h
+               fi
+       done
+
+       local _LIBSIM=$_GDB/lib/libsim
+       case $_MACHINE_SUBDIR in
+       powerpc*)
+               mkdir -p $_TOP/$_LIBSIM/arch/$_MACHINE_SUBDIR
+               write_c $_LIBSIM/arch/$_MACHINE_SUBDIR/config.h \
+                       <$_TMPDIR/sim/ppc/config.h
+               write_c $_LIBSIM/arch/$_MACHINE_SUBDIR/build-config.h \
+                       <$_TMPDIR/sim/ppc/build-config.h
+               #write_c $_LIBSIM/arch/$_MACHINE_SUBDIR/cconfig.h \
+               #       <$_TMPDIR/sim/common/cconfig.h
+               ;;
+       xxmips*)        # Disabled for now
+               mkdir -p $_TOP/$_LIBSIM/arch/$_MACHINE_SUBDIR
+               write_c $_LIBSIM/arch/$_MACHINE_SUBDIR/config.h \
+                       <$_TMPDIR/sim/mips/config.h
+               #write_c $_LIBSIM/arch/$_MACHINE_SUBDIR/cconfig.h \
+               #       <$_TMPDIR/sim/common/cconfig.h
+               {
+                       getvars sim/mips/Makefile \
+                               LIB_OBJS CONFIG_CFLAGS \
+                               BUILT_SRC_FROM_IGEN IGEN_OBJS
+               } | write_mk $_LIBSIM/arch/$_MACHINE_SUBDIR/defs.mk
+               ;;
+       *)
+               ;;
+       esac
+}
+
+##### main #####
+
+case $1 in
+all|gdb)       # everything (uses "canadian cross" temp environment)
+       get_gdb_libgdb
+       get_gdb_libbfd
+       get_gdb_libopcodes
+       get_gdb_libiberty
+       get_gdb_libreadline
+       get_gdb_libdecnumber
+       exit 0
+       ;;
+
+*)     echo invalid arguments; exit 1;;
+esac



Home | Main Index | Thread Index | Old Index