Browse Source

gdb: decouple toolchain and package, add special package for microblaze, looks cleaner to me

Waldemar Brodkorb 9 years ago
parent
commit
d0ac419702

+ 50 - 0
package/gdb-microblaze/Makefile

@@ -0,0 +1,50 @@
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${ADK_TOPDIR}/rules.mk
+
+PKG_NAME:=		gdb
+PKG_VERSION:=		7.8.2
+PKG_RELEASE:=		1
+PKG_DESCR:=		programm debugger
+PKG_SECTION:=		app/debug
+PKG_HASH:=		605954d5747d5f08ea4b7f48e958d1ebbf39265e18f7f36738deeabb83744485
+PKG_DEPENDS:=		libncurses zlib libexpat libthread-db
+PKG_BUILDDEP:=		ncurses readline expat zlib
+PKG_SITES:=		${MASTER_SITE_GNU:=gdb/}
+PKG_NOPARALLEL:=	1
+
+PKG_ARCH_DEPENDS:=	microblaze
+
+include ${ADK_TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,GDB,gdb,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
+
+TARGET_CFLAGS+=		${TARGET_CPPFLAGS} -fPIC
+CONFIGURE_ARGS+=	--without-uiout \
+			--disable-tui \
+			--disable-gdbtk \
+			--disable-gdbserver \
+			--without-x \
+			--disable-sim \
+			--disable-werror \
+			--without-python \
+			--without-included-gettext \
+			--without-auto-load-safe-path \
+			--disable-install-libiberty \
+			--disable-install-libbfd \
+			--with-curses \
+			--enable-gdbmi
+
+XAKE_FLAGS+=		LDFLAGS='${TARGET_LDFLAGS}'
+# disable honour cflags stuff
+XAKE_FLAGS+=		GCC_HONOUR_COPTS:=s
+
+gdb-install:
+	${INSTALL_DIR} ${IDIR_GDB}/usr/bin
+	${INSTALL_BIN} ${WRKINST}/usr/bin/gdb \
+		${IDIR_GDB}/usr/bin/
+	# shipped libbfd conflicts with system wide one
+	rm -f ${WRKINST}/usr/lib/libbfd*
+
+include ${ADK_TOPDIR}/mk/pkg-bottom.mk

+ 0 - 0
package/gdb/patches/7.8.2/microblaze.patch → package/gdb-microblaze/patches/microblaze.patch


+ 0 - 0
package/gdb/patches/7.8.2/patch-gdb_common_linux-ptrace_h → package/gdb-microblaze/patches/patch-gdb_common_linux-ptrace_h


+ 0 - 0
package/gdb/patches/7.8.2/patch-gdb_common_signals_c → package/gdb-microblaze/patches/patch-gdb_common_signals_c


+ 0 - 0
package/gdb/patches/7.8.2/patch-gdb_gdbserver_configure → package/gdb-microblaze/patches/patch-gdb_gdbserver_configure


+ 0 - 0
package/gdb/patches/7.8.2/patch-gdb_linux-nat_c → package/gdb-microblaze/patches/patch-gdb_linux-nat_c


+ 48 - 0
package/gdb-microblaze/src/gdb/debugreg.h

@@ -0,0 +1,48 @@
+#ifndef SYS_DEBUGREG_H
+#define SYS_DEBUGREG_H
+
+#include <stdint.h>
+
+#define DR_FIRSTADDR 0
+#define DR_LASTADDR 3
+
+#define DR_STATUS 6
+#define DR_CONTROL 7
+
+#define DR_TRAP0        (0x1)
+#define DR_TRAP1        (0x2)
+#define DR_TRAP2        (0x4)
+#define DR_TRAP3        (0x8)
+
+#define DR_STEP         (0x4000)
+#define DR_SWITCH       (0x8000)
+
+#define DR_CONTROL_SHIFT 16
+#define DR_CONTROL_SIZE  4
+
+#define DR_RW_EXECUTE   (0x0)
+#define DR_RW_WRITE     (0x1)
+#define DR_RW_READ      (0x3)
+
+#define DR_LEN_1 (0x0)
+#define DR_LEN_2 (0x4)
+#define DR_LEN_4 (0xC)
+#define DR_LEN_8 (0x8)
+
+#define DR_LOCAL_ENABLE_SHIFT  0
+#define DR_GLOBAL_ENABLE_SHIFT 1
+#define DR_ENABLE_SIZE         2
+
+#define DR_LOCAL_ENABLE_MASK  (0x55)
+#define DR_GLOBAL_ENABLE_MASK (0xAA)
+
+
+#if SIZE_MAX > 4294967295
+# define DR_CONTROL_RESERVED (0xFFFFFFFF0000FC00UL)
+#else
+# define DR_CONTROL_RESERVED (0x00FC00U)
+#endif
+#define DR_LOCAL_SLOWDOWN   (0x100)
+#define DR_GLOBAL_SLOWDOWN  (0x200)
+
+#endif

+ 30 - 0
package/gdb-microblaze/src/gdb/sgidefs.h

@@ -0,0 +1,30 @@
+#ifndef _SGIDEFS_H
+#define _SGIDEFS_H
+
+/* MIPS ABI crap that GLIBC puts into /include
+by default, and GDB depends on it happily. */
+
+#define _MIPS_ISA_MIPS1 1
+#define _MIPS_ISA_MIPS2 2
+#define _MIPS_ISA_MIPS3 3
+#define _MIPS_ISA_MIPS4 4
+#define _MIPS_ISA_MIPS5 5
+#define _MIPS_ISA_MIPS32 6
+#define _MIPS_ISA_MIPS64 7
+
+#ifndef _ABIO32
+#define _ABIO32 1
+#endif
+#define _MIPS_SIM_ABI32 _ABIO32
+
+#ifndef _ABIN32
+#define _ABIN32 2
+#endif
+#define _MIPS_SIM_NABI32 _ABIN32
+
+#ifndef _ABI64
+#define _ABI64 3
+#endif
+#define _MIPS_SIM_ABI64 _ABI64
+
+#endif

+ 5 - 2
package/gdb/Makefile

@@ -2,16 +2,19 @@
 # material, please see the LICENCE file in the top-level directory.
 
 include ${ADK_TOPDIR}/rules.mk
-include ${ADK_TOPDIR}/toolchain/gdb/Makefile.inc
 
 PKG_NAME:=		gdb
+PKG_VERSION:=		7.11.1
+PKG_RELEASE:=		1
+PKG_HASH:=		e9216da4e3755e9f414c1aa0026b626251dfc57ffe572a266e98da4f6988fc70
 PKG_DESCR:=		programm debugger
 PKG_SECTION:=		app/debug
+PKG_SITES:=		${MASTER_SITE_GNU:=gdb/}
 PKG_DEPENDS:=		libncurses zlib libexpat libthread-db
 PKG_BUILDDEP:=		ncurses readline expat zlib
 PKG_NOPARALLEL:=	1
 
-PKG_ARCH_DEPENDS:=	!m68k !avr32 !nios2
+PKG_ARCH_DEPENDS:=	!m68k !avr32 !nios2 !microblaze
 
 include ${ADK_TOPDIR}/mk/package.mk
 

+ 0 - 11
package/gdb/patches/7.8.2/patch-ltmain_sh

@@ -1,11 +0,0 @@
---- gdb-7.1.orig/ltmain.sh	2010-01-09 22:11:32.000000000 +0100
-+++ gdb-7.1/ltmain.sh	2011-01-15 18:15:38.000000000 +0100
-@@ -4980,7 +4980,7 @@ func_mode_link ()
-       # @file GCC response files
-       # -tp=* Portland pgcc target processor selection
-       -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
--      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*)
-+      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|-fstack-protector*|-flto)
-         func_quote_for_eval "$arg"
- 	arg="$func_quote_for_eval_result"
-         func_append compile_command " $arg"

+ 0 - 0
package/gdb/patches/7.11.1/patch-gdb_nat_ppc-linux_h → package/gdb/patches/patch-gdb_nat_ppc-linux_h


+ 6 - 1
package/gdbserver/Makefile

@@ -2,13 +2,18 @@
 # material, please see the LICENCE file in the top-level directory.
 
 include ${ADK_TOPDIR}/rules.mk
-include ${ADK_TOPDIR}/toolchain/gdb/Makefile.inc
 
 PKG_NAME:=		gdbserver
+PKG_VERSION:=		7.11.1
+PKG_RELEASE:=		1
+PKG_HASH:=		e9216da4e3755e9f414c1aa0026b626251dfc57ffe572a266e98da4f6988fc70
 PKG_DESCR:=		remote programm debugger utility
 PKG_SECTION:=		app/debug
+PKG_SITES:=		${MASTER_SITE_GNU:=gdb/}
 PKG_DEPENDS:=		libthread-db
+
 PKG_LIBC_DEPENDS:=	!musl
+PKG_ARCH_DEPENDS:=	!microblaze
 
 ifeq ($(ADK_TOOLCHAIN_GDB_6_7_1),y)
 DISTFILES:=		gdb-6.7.1-avr32-2.1.5.tar.bz2

+ 0 - 10
package/gdbserver/patches/7.8.2/patch-gdb_common_linux-ptrace_c

@@ -1,10 +0,0 @@
---- gdb-7.8.orig/gdb/common/linux-ptrace.c	2014-07-29 14:37:42.000000000 +0200
-+++ gdb-7.8/gdb/common/linux-ptrace.c	2014-09-05 00:52:41.353409084 +0200
-@@ -23,6 +23,7 @@
- #include <string.h>
- #endif
- 
-+#include <sched.h>
- #include "linux-ptrace.h"
- #include "linux-procfs.h"
- #include "nat/linux-waitpid.h"

+ 0 - 11
package/gdbserver/patches/7.8.2/patch-gdb_common_linux-ptrace_h

@@ -1,11 +0,0 @@
---- gdb-7.8.orig/gdb/common/linux-ptrace.h	2014-07-29 14:37:42.000000000 +0200
-+++ gdb-7.8/gdb/common/linux-ptrace.h	2014-10-04 08:25:08.000000000 +0200
-@@ -23,7 +23,7 @@ struct buffer;
- #include <sys/ptrace.h>
- 
- #ifdef __UCLIBC__
--#if !(defined(__UCLIBC_HAS_MMU__) || defined(__ARCH_HAS_MMU__))
-+#if !defined(__UCLIBC_HAS_MMU__)
- /* PTRACE_TEXT_ADDR and friends.  */
- #include <asm/ptrace.h>
- #define HAS_NOMMU

+ 0 - 22
package/gdbserver/patches/7.8.2/patch-gdb_gdbserver_linux-low_c

@@ -1,22 +0,0 @@
---- gdb-7.8.orig/gdb/gdbserver/linux-low.c	2014-07-29 14:37:42.000000000 +0200
-+++ gdb-7.8/gdb/gdbserver/linux-low.c	2014-09-05 00:47:25.427321525 +0200
-@@ -4933,15 +4933,15 @@ static int
- linux_read_offsets (CORE_ADDR *text_p, CORE_ADDR *data_p)
- {
-   unsigned long text, text_end, data;
--  int pid = lwpid_of (get_thread_lwp (current_inferior));
-+  int pid = lwpid_of (current_inferior);
- 
-   errno = 0;
- 
--  text = ptrace (PTRACE_PEEKUSER, pid, (PTRACE_TYPE_ARG3) PT_TEXT_ADDR,
-+  text = ptrace (PTRACE_PEEKUSER, pid, (PTRACE_TYPE_ARG3) (PT_TEXT_ADDR),
- 		 (PTRACE_TYPE_ARG4) 0);
--  text_end = ptrace (PTRACE_PEEKUSER, pid, (PTRACE_TYPE_ARG3) PT_TEXT_END_ADDR,
-+  text_end = ptrace (PTRACE_PEEKUSER, pid, (PTRACE_TYPE_ARG3) (PT_TEXT_END_ADDR),
- 		     (PTRACE_TYPE_ARG4) 0);
--  data = ptrace (PTRACE_PEEKUSER, pid, (PTRACE_TYPE_ARG3) PT_DATA_ADDR,
-+  data = ptrace (PTRACE_PEEKUSER, pid, (PTRACE_TYPE_ARG3) (PT_DATA_ADDR),
- 		 (PTRACE_TYPE_ARG4) 0);
- 
-   if (errno == 0)

+ 0 - 0
package/gdbserver/patches/7.11.1/nommu.patch → package/gdbserver/patches/nommu.patch


+ 1 - 4
target/config/Config.in.gdb

@@ -19,6 +19,7 @@ endchoice
 
 choice
 prompt "GNU debugger version"
+depends on ADK_TOOLCHAIN_WITH_GDB
 default ADK_TOOLCHAIN_GDB_H8300_GIT if ADK_TARGET_ARCH_H8300
 default ADK_TOOLCHAIN_GDB_NDS32 if ADK_TARGET_ARCH_NDS32
 default ADK_TOOLCHAIN_GDB_7_11_1
@@ -51,10 +52,6 @@ config ADK_TOOLCHAIN_GDB_7_9_1
 	depends on !ADK_TARGET_ARCH_H8300
 	depends on !ADK_TARGET_ARCH_NDS32
 
-config ADK_TOOLCHAIN_GDB_7_8_2
-	bool "7.8.2"
-	depends on ADK_TARGET_ARCH_MICROBLAZE
-
 config ADK_TOOLCHAIN_GDB_6_7_1
 	bool "6.7.1"
 	depends on ADK_TARGET_ARCH_AVR32

+ 0 - 7
toolchain/gdb/Makefile.inc

@@ -23,13 +23,6 @@ PKG_HASH:=		cd9c543a411a05b2b647dd38936034b68c2b5d6f10e0d51dc168c166c973ba40
 PKG_SITES:=		${MASTER_SITE_GNU:=gdb/}
 DISTFILES:=		${PKG_NAME}-${PKG_VERSION}.tar.xz
 endif
-ifeq ($(ADK_TOOLCHAIN_GDB_7_8_2),y)
-PKG_VERSION:=		7.8.2
-PKG_RELEASE:=		1
-PKG_HASH:=		605954d5747d5f08ea4b7f48e958d1ebbf39265e18f7f36738deeabb83744485
-PKG_SITES:=		${MASTER_SITE_GNU:=gdb/}
-DISTFILES:=		${PKG_NAME}-${PKG_VERSION}.tar.xz
-endif
 ifeq ($(ADK_TOOLCHAIN_GDB_6_7_1),y)
 PKG_VERSION:=		6.7.1
 PKG_RELEASE:=		1