summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman <saurik@saurik.com>2008-07-27 11:55:09 +0000
committerJay Freeman <saurik@saurik.com>2008-07-27 11:55:09 +0000
commit93b04703444b0434644584a9d18c483baafb21a1 (patch)
tree9538fd7660119bb119e80d0571825dd3f22e21a1
parent36766b4cc392785a1f89c10bcf2fc0a0e30c5b6a (diff)
Finally got GDB entirely working.
git-svn-id: http://svn.telesphoreo.org/trunk@399 514c082c-b64e-11dc-b46d-3d985efe055d
-rw-r--r--data/gdb/_metadata/description2
-rw-r--r--data/gdb/_metadata/homepage1
l---------data/gdb/_metadata/license1
l---------data/gdb/_metadata/maintainer1
-rw-r--r--data/gdb/_metadata/name1
l---------data/gdb/_metadata/ncurses.dep1
-rwxr-xr-xdata/gdb/_metadata/preinst3
-rw-r--r--data/gdb/_metadata/priority1
l---------data/gdb/_metadata/readline.dep1
-rw-r--r--data/gdb/_metadata/section1
l---------data/gdb/_metadata/sqlite3.dep1
-rw-r--r--data/gdb/_metadata/tags1
-rw-r--r--data/gdb/_metadata/version1
-rw-r--r--data/gdb/_unix03.diff12
-rw-r--r--data/gdb/catch.diff59
-rw-r--r--data/gdb/gdb-961.tar.gzbin0 -> 17890024 bytes
-rw-r--r--data/gdb/gdb.xml12
-rw-r--r--data/gdb/make.sh17
-rw-r--r--data/gdb/mig.diff39
-rw-r--r--data/gdb/nolongdouble.diff12
-rw-r--r--data/gdb/setpgrp.diff12
-rw-r--r--data/gdb/strip.diff64
22 files changed, 243 insertions, 0 deletions
diff --git a/data/gdb/_metadata/description b/data/gdb/_metadata/description
new file mode 100644
index 000000000..357a1efbd
--- /dev/null
+++ b/data/gdb/_metadata/description
@@ -0,0 +1,2 @@
+debugger for native software
+A debugger for native software from GNU. This is Apple's Open Source GDB that targets ARM. It still has some limitations, but they are being worked on.
diff --git a/data/gdb/_metadata/homepage b/data/gdb/_metadata/homepage
new file mode 100644
index 000000000..c15abbd4d
--- /dev/null
+++ b/data/gdb/_metadata/homepage
@@ -0,0 +1 @@
+http://www.246tnt.com/iPhone/#gdb
diff --git a/data/gdb/_metadata/license b/data/gdb/_metadata/license
new file mode 120000
index 000000000..9c13a9a0f
--- /dev/null
+++ b/data/gdb/_metadata/license
@@ -0,0 +1 @@
+../../../licenses/gpl-2 \ No newline at end of file
diff --git a/data/gdb/_metadata/maintainer b/data/gdb/_metadata/maintainer
new file mode 120000
index 000000000..0fa66e077
--- /dev/null
+++ b/data/gdb/_metadata/maintainer
@@ -0,0 +1 @@
+../../../people/saurik \ No newline at end of file
diff --git a/data/gdb/_metadata/name b/data/gdb/_metadata/name
new file mode 100644
index 000000000..d1e020fa6
--- /dev/null
+++ b/data/gdb/_metadata/name
@@ -0,0 +1 @@
+GNU Debugger
diff --git a/data/gdb/_metadata/ncurses.dep b/data/gdb/_metadata/ncurses.dep
new file mode 120000
index 000000000..a395fad08
--- /dev/null
+++ b/data/gdb/_metadata/ncurses.dep
@@ -0,0 +1 @@
+../../ncurses \ No newline at end of file
diff --git a/data/gdb/_metadata/preinst b/data/gdb/_metadata/preinst
new file mode 100755
index 000000000..a80d96724
--- /dev/null
+++ b/data/gdb/_metadata/preinst
@@ -0,0 +1,3 @@
+#!/bin/bash
+/usr/libexec/cydia/move.sh /usr/arm-apple-darwin9
+exit 0
diff --git a/data/gdb/_metadata/priority b/data/gdb/_metadata/priority
new file mode 100644
index 000000000..134d9bc32
--- /dev/null
+++ b/data/gdb/_metadata/priority
@@ -0,0 +1 @@
+optional
diff --git a/data/gdb/_metadata/readline.dep b/data/gdb/_metadata/readline.dep
new file mode 120000
index 000000000..f35c9185b
--- /dev/null
+++ b/data/gdb/_metadata/readline.dep
@@ -0,0 +1 @@
+../../readline \ No newline at end of file
diff --git a/data/gdb/_metadata/section b/data/gdb/_metadata/section
new file mode 100644
index 000000000..e0eb96881
--- /dev/null
+++ b/data/gdb/_metadata/section
@@ -0,0 +1 @@
+Development
diff --git a/data/gdb/_metadata/sqlite3.dep b/data/gdb/_metadata/sqlite3.dep
new file mode 120000
index 000000000..071b20780
--- /dev/null
+++ b/data/gdb/_metadata/sqlite3.dep
@@ -0,0 +1 @@
+../../sqlite3 \ No newline at end of file
diff --git a/data/gdb/_metadata/tags b/data/gdb/_metadata/tags
new file mode 100644
index 000000000..ad5d50831
--- /dev/null
+++ b/data/gdb/_metadata/tags
@@ -0,0 +1 @@
+purpose::console
diff --git a/data/gdb/_metadata/version b/data/gdb/_metadata/version
new file mode 100644
index 000000000..612eb51c3
--- /dev/null
+++ b/data/gdb/_metadata/version
@@ -0,0 +1 @@
+961
diff --git a/data/gdb/_unix03.diff b/data/gdb/_unix03.diff
new file mode 100644
index 000000000..24930a24d
--- /dev/null
+++ b/data/gdb/_unix03.diff
@@ -0,0 +1,12 @@
+diff -ru gdb-961/src/gdb/configure.ac gdb-961+iPhone/src/gdb/configure.ac
+--- gdb-961/src/gdb/configure.ac 2008-03-05 23:09:41.000000000 +0000
++++ gdb-961+iPhone/src/gdb/configure.ac 2008-07-04 10:20:50.000000000 +0000
+@@ -897,7 +897,7 @@
+
+ # APPLE LOCAL: Use the pre-conformant headers/functions so we stand a
+ # better chance of running on older systems.
+-UNIX03_UGH_CFLAGS=-D__DARWIN_UNIX03=0
++UNIX03_UGH_CFLAGS=-D__DARWIN_UNIX03=1
+ AC_SUBST(UNIX03_UGH_CFLAGS)
+
+ # APPLE LOCAL: Enable MIG checking for macosx/macosx.defs.
diff --git a/data/gdb/catch.diff b/data/gdb/catch.diff
new file mode 100644
index 000000000..4bc867bbf
--- /dev/null
+++ b/data/gdb/catch.diff
@@ -0,0 +1,59 @@
+diff -ru gdb-961/src/gdb/macosx/macosx-nat-excthread.c gdb-961+iPhone/src/gdb/macosx/macosx-nat-excthread.c
+--- gdb-961/src/gdb/macosx/macosx-nat-excthread.c 2008-05-12 02:05:04.000000000 +0000
++++ gdb-961+iPhone/src/gdb/macosx/macosx-nat-excthread.c 2008-07-04 11:01:25.000000000 +0000
+@@ -240,11 +240,17 @@
+ #else
+ catch_exception_raise_state
+ #endif
+- (mach_port_t port,
+- exception_type_t exception_type, mach_exception_data_t exception_data,
+- mach_msg_type_number_t data_count, thread_state_flavor_t * state_flavor,
+- thread_state_t in_state, mach_msg_type_number_t in_state_count,
+- thread_state_t out_state, mach_msg_type_number_t out_state_count)
++(
++ mach_port_t exception_port,
++ exception_type_t exception,
++ const exception_data_t code,
++ mach_msg_type_number_t codeCnt,
++ int *flavor,
++ const thread_state_t old_state,
++ mach_msg_type_number_t old_stateCnt,
++ thread_state_t new_state,
++ mach_msg_type_number_t *new_stateCnt
++)
+ {
+ return KERN_FAILURE;
+ }
+@@ -255,17 +261,25 @@
+ #else
+ catch_exception_raise_state_identity
+ #endif
+- (mach_port_t port, mach_port_t thread_port, mach_port_t task_port,
+- exception_type_t exception_type, mach_exception_data_t exception_data,
+- mach_msg_type_number_t data_count, thread_state_flavor_t * state_flavor,
+- thread_state_t in_state, mach_msg_type_number_t in_state_count,
+- thread_state_t out_state, mach_msg_type_number_t out_state_count)
++(
++ mach_port_t exception_port,
++ mach_port_t thread,
++ mach_port_t task,
++ exception_type_t exception,
++ exception_data_t code,
++ mach_msg_type_number_t codeCnt,
++ int *flavor,
++ thread_state_t old_state,
++ mach_msg_type_number_t old_stateCnt,
++ thread_state_t new_state,
++ mach_msg_type_number_t *new_stateCnt
++)
+ {
+ kern_return_t kret;
+
+- kret = mach_port_deallocate (mach_task_self (), task_port);
++ kret = mach_port_deallocate (mach_task_self (), task);
+ MACH_CHECK_ERROR (kret);
+- kret = mach_port_deallocate (mach_task_self (), thread_port);
++ kret = mach_port_deallocate (mach_task_self (), thread);
+ MACH_CHECK_ERROR (kret);
+
+ return KERN_FAILURE;
diff --git a/data/gdb/gdb-961.tar.gz b/data/gdb/gdb-961.tar.gz
new file mode 100644
index 000000000..a2619dbce
--- /dev/null
+++ b/data/gdb/gdb-961.tar.gz
Binary files differ
diff --git a/data/gdb/gdb.xml b/data/gdb/gdb.xml
new file mode 100644
index 000000000..bf3c3a5b5
--- /dev/null
+++ b/data/gdb/gdb.xml
@@ -0,0 +1,12 @@
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>com.apple.springboard.debugapplications</key>
+ <true/>
+ <key>get-task-allow</key>
+ <true/>
+ <key>task_for_pid-allow</key>
+ <true/>
+</dict>
+</plist>
+
diff --git a/data/gdb/make.sh b/data/gdb/make.sh
new file mode 100644
index 000000000..86a29857b
--- /dev/null
+++ b/data/gdb/make.sh
@@ -0,0 +1,17 @@
+shopt -s extglob
+pkg:setup
+#cd src/gdb
+#autoconf
+#cd ../..
+cd ..
+mkdir build
+cd build
+PKG_CONF=$(echo ../!(build)/src/configure) pkg:configure
+make
+# XXX: do I really need DSTROOT?
+pkg:install DSTROOT="${PKG_DEST}"
+for bin in ar nm ranlib size strings strip; do
+ pkg: rm -f "/usr/bin/${bin}"
+done
+pkg: rm -f /usr/lib/libiberty.a
+ldid -S"${PKG_DATA}/gdb.xml" "${PKG_DEST}/usr/bin/gdb"
diff --git a/data/gdb/mig.diff b/data/gdb/mig.diff
new file mode 100644
index 000000000..2d91566b1
--- /dev/null
+++ b/data/gdb/mig.diff
@@ -0,0 +1,39 @@
+diff -ru gdb-952/src/gdb/config/arm/macosx.mh gdb-952+iPhone/src/gdb/config/arm/macosx.mh
+--- gdb-952/src/gdb/config/arm/macosx.mh 2008-03-01 01:24:09.000000000 +0000
++++ gdb-952+iPhone/src/gdb/config/arm/macosx.mh 2008-04-11 08:41:15.000000000 +0000
+@@ -47,10 +47,10 @@
+
+ CFM_CFLAGS = -DWITH_CFM=0
+
+ _all: all
+
+ excServer.c excUser.c: macosx.defs
+- $(NEXT_ROOT)/usr/bin/mig -I. $<
++ mig -I. $<
+
+ clean::
+ rm -f excServer.c excUser.c exc.h
+diff -ru gdb-952/src/gdb/config/i386/macosx.mh gdb-952+iPhone/src/gdb/config/i386/macosx.mh
+--- gdb-952/src/gdb/config/i386/macosx.mh 2008-03-01 01:24:10.000000000 +0000
++++ gdb-952+iPhone/src/gdb/config/i386/macosx.mh 2008-04-11 08:40:40.000000000 +0000
+@@ -56,7 +56,7 @@
+ _all: all
+
+ $(MACH_EXC_SERVER_PREFACE)excServer.c $(MACH_EXC_SERVER_PREFACE)excUser.c: macosx.defs
+- $(SDKROOT)/usr/bin/mig -I. $<
++ mig -I. $<
+
+ clean::
+ rm -f $(MACH_EXC_SERVER_PREFACE)excServer.c $(MACH_EXC_SERVER_PREFACE)excUser.c $(MACH_EXC_SERVER_PREFACE)exc.h
+diff -ru gdb-952/src/gdb/config/powerpc/macosx.mh gdb-952+iPhone/src/gdb/config/powerpc/macosx.mh
+--- gdb-952/src/gdb/config/powerpc/macosx.mh 2008-03-01 01:24:10.000000000 +0000
++++ gdb-952+iPhone/src/gdb/config/powerpc/macosx.mh 2008-04-11 08:41:32.000000000 +0000
+@@ -60,7 +60,7 @@
+ _all: all
+
+ $(MACH_EXC_SERVER_PREFACE)excServer.c $(MACH_EXC_SERVER_PREFACE)excUser.c: macosx.defs
+- $(SDKROOT)/usr/bin/mig -I. $<
++ mig -I. $<
+
+ clean::
+ rm -f $(MACH_EXC_SERVER_PREFACE)excServer.c $(MACH_EXC_SERVER_PREFACE)excUser.c $(MACH_EXC_SERVER_PREFACE)exc.h
diff --git a/data/gdb/nolongdouble.diff b/data/gdb/nolongdouble.diff
new file mode 100644
index 000000000..23e91cb6f
--- /dev/null
+++ b/data/gdb/nolongdouble.diff
@@ -0,0 +1,12 @@
+diff -ru gdb-952/src/gdb/config/arm/macosx.mh gdb-952+iPhone/src/gdb/config/arm/macosx.mh
+--- gdb-952/src/gdb/config/arm/macosx.mh 2008-03-01 01:24:09.000000000 +0000
++++ gdb-952+iPhone/src/gdb/config/arm/macosx.mh 2008-04-11 07:38:06.000000000 +0000
+@@ -43,7 +43,7 @@
+
+ MH_CFLAGS = -I$(srcdir)/macosx
+
+-MH_CFLAGS += -DUSE_PTHREADS=1 -Wall -Wimplicit -Wno-long-double
++MH_CFLAGS += -DUSE_PTHREADS=1 -Wall -Wimplicit
+
+ CFM_CFLAGS = -DWITH_CFM=0
+
diff --git a/data/gdb/setpgrp.diff b/data/gdb/setpgrp.diff
new file mode 100644
index 000000000..126274e6e
--- /dev/null
+++ b/data/gdb/setpgrp.diff
@@ -0,0 +1,12 @@
+diff -ru gdb-961/src/gdb/macosx/macosx-nat-inferior.c gdb-961+iPhone/src/gdb/macosx/macosx-nat-inferior.c
+--- gdb-961/src/gdb/macosx/macosx-nat-inferior.c 2008-05-29 23:05:46.000000000 +0000
++++ gdb-961+iPhone/src/gdb/macosx/macosx-nat-inferior.c 2008-07-04 11:11:37.000000000 +0000
+@@ -2189,7 +2189,7 @@
+ error ("Couldn't set the binary preferences, error: %d", retval);
+ }
+ retval = posix_spawnattr_setpgroup (&attr, debug_setpgrp);
+- if (retval != 0 || copied != 1)
++ if (retval != 0)
+ error ("Couldn't set the process group, error: %d", retval);
+
+ retval = posix_spawnp (&new_pid, fileptr, NULL, &attr, argv, env);
diff --git a/data/gdb/strip.diff b/data/gdb/strip.diff
new file mode 100644
index 000000000..31395be11
--- /dev/null
+++ b/data/gdb/strip.diff
@@ -0,0 +1,64 @@
+diff -ru gdb-961/Makefile gdb-961+iPhone/Makefile
+--- gdb-961/Makefile 2008-05-29 23:58:29.000000000 +0000
++++ gdb-961+iPhone/Makefile 2008-07-04 10:47:06.000000000 +0000
+@@ -287,8 +287,8 @@
+ fi;\
+ done;
+ (cd $(SYMROOT)/$(LIBEXEC_GDB_DIR)/ ; dsymutil gdb-arm-apple-darwin)
+- strip -S -o $(DSTROOT)/$(LIBEXEC_GDB_DIR)/gdb-arm-apple-darwin \
+- $(SYMROOT)/$(LIBEXEC_GDB_DIR)/gdb-arm-apple-darwin
++ cp $(SYMROOT)/$(LIBEXEC_GDB_DIR)/gdb-arm-apple-darwin \
++ $(DSTROOT)/$(LIBEXEC_GDB_DIR)/gdb-arm-apple-darwin
+ chown root:wheel $(DSTROOT)/$(LIBEXEC_GDB_DIR)/gdb-arm-apple-darwin
+ chmod 755 $(DSTROOT)/$(LIBEXEC_GDB_DIR)/gdb-arm-apple-darwin
+ mkdir -p ${DSTROOT}/usr/bin
+@@ -339,8 +339,8 @@
+ fi; \
+ done; \
+ (cd $(SYMROOT)/$(LIBEXEC_GDB_DIR)/ ; dsymutil gdb-$${cross_arch}-apple-darwin); \
+- strip -S -o $(DSTROOT)/$(LIBEXEC_GDB_DIR)/gdb-$${cross_arch}-apple-darwin \
+- $(SYMROOT)/$(LIBEXEC_GDB_DIR)/gdb-$${cross_arch}-apple-darwin; \
++ cp $(SYMROOT)/$(LIBEXEC_GDB_DIR)/gdb-$${cross_arch}-apple-darwin \
++ $(DSTROOT)/$(LIBEXEC_GDB_DIR)/gdb-$${cross_arch}-apple-darwin; \
+ done; \
+ mkdir -p ${DSTROOT}/usr/bin; \
+ sed -e 's/version=.*/version=$(GDB_VERSION)-$(GDB_RC_VERSION)/' \
+@@ -552,8 +552,8 @@
+ -output $(SYMROOT)/$(LIBEXEC_GDB_DIR)/gdb-$${target}; \
+ dsymutil -o $(SYMROOT)/$(LIBEXEC_GDB_DIR)/gdb-$${target}.dSYM \
+ $(SYMROOT)/$(LIBEXEC_GDB_DIR)/gdb-$${target}; \
+- strip -S -o $(DSTROOT)/$(LIBEXEC_GDB_DIR)/gdb-$${target} \
+- $(SYMROOT)/$(LIBEXEC_GDB_DIR)/gdb-$${target}; \
++ cp $(SYMROOT)/$(LIBEXEC_GDB_DIR)/gdb-$${target} \
++ $(DSTROOT)/$(LIBEXEC_GDB_DIR)/gdb-$${target}; \
+ cp $(DSTROOT)/$(LIBEXEC_GDB_DIR)/gdb-$${target} $(SYMROOT)/$(LIBEXEC_GDB_DIR)/gdb-$${target}; \
+ done
+
+@@ -567,8 +567,8 @@
+ set -e; for target in $(CANONICAL_ARCHS); do \
+ dsymutil -o $(SYMROOT)/$(LIBEXEC_GDB_DIR)/gdb-$${target}.dSYM \
+ $(SYMROOT)/$(LIBEXEC_GDB_DIR)/gdb-$${target}; \
+- strip -S -o $(DSTROOT)/$(LIBEXEC_GDB_DIR)/gdb-$${target} \
+- $(SYMROOT)/$(LIBEXEC_GDB_DIR)/gdb-$${target}; \
++ cp $(SYMROOT)/$(LIBEXEC_GDB_DIR)/gdb-$${target} \
++ $(DSTROOT)/$(LIBEXEC_GDB_DIR)/gdb-$${target}; \
+ cp $(DSTROOT)/$(LIBEXEC_GDB_DIR)/gdb-$${target} \
+ $(SYMROOT)/$(LIBEXEC_GDB_DIR)/gdb-$${target}; \
+ if echo $${target} | egrep '^[^-]*-apple-darwin' > /dev/null; then \
+@@ -584,7 +584,6 @@
+ set -e; for dstroot in $(SYMROOT) $(DSTROOT); do \
+ $(INSTALL) -c -m 755 $(OBJROOT)/$(ARM_TARGET)--$(ARM_TARGET)/gdb/gdbserver/gdbserver $${dstroot}/usr/bin/gdbserver; \
+ done
+- strip -S $(DSTROOT)/usr/bin/gdbserver
+
+ install-binutils-macosx:
+
+@@ -592,7 +591,7 @@
+ instname=`echo $${i} | sed -e 's/\\-new//'`; \
+ lipo -create $(patsubst %,$(OBJROOT)/%/binutils/$${i},$(NATIVE_TARGETS)) \
+ -output $(SYMROOT)/$(LIBEXEC_BINUTILS_DIR)/$${instname}; \
+- strip -S -o $(DSTROOT)/$(LIBEXEC_BINUTILS_DIR)/$${instname} $(SYMROOT)/$(LIBEXEC_BINUTILS_DIR)/$${instname}; \
++ cp $(SYMROOT)/$(LIBEXEC_BINUTILS_DIR)/$${instname} $(DSTROOT)/$(LIBEXEC_BINUTILS_DIR)/$${instname}; \
+ done
+
+ install-chmod-macosx: