diff options
author | 2024-01-12 20:24:30 +0100 | |
---|---|---|
committer | 2024-01-13 10:42:33 +0100 | |
commit | 1eb06b860d83a59fce6466517e5c9d1b2ab20033 (patch) | |
tree | 7f0a9b9954bf1da5c185473cdf496ad70bb9b198 /dev-debug/gdb-apple/files | |
parent | Move {sys-devel → dev-debug}/gdb (diff) | |
download | gentoo-1eb06b860d83a59fce6466517e5c9d1b2ab20033.tar.gz gentoo-1eb06b860d83a59fce6466517e5c9d1b2ab20033.tar.bz2 gentoo-1eb06b860d83a59fce6466517e5c9d1b2ab20033.zip |
Move {sys-devel → dev-debug}/gdb-apple
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-debug/gdb-apple/files')
5 files changed, 259 insertions, 0 deletions
diff --git a/dev-debug/gdb-apple/files/gdb-apple-1518-darwin8-9.patch b/dev-debug/gdb-apple/files/gdb-apple-1518-darwin8-9.patch new file mode 100644 index 000000000000..a05169cec25d --- /dev/null +++ b/dev-debug/gdb-apple/files/gdb-apple-1518-darwin8-9.patch @@ -0,0 +1,87 @@ +--- src/gdb/macosx/macosx-nat-dyld.c ++++ src/gdb/macosx/macosx-nat-dyld.c +@@ -2083,7 +2083,9 @@ + case MH_DYLIB: + case MH_DYLINKER: + case MH_BUNDLE: ++#ifdef MH_KEXT_BUNDLE + case MH_KEXT_BUNDLE: ++#endif + break; + case MH_FVMLIB: + case MH_PRELOAD: +@@ -2412,7 +2414,9 @@ + break; + case MH_DYLINKER: + case MH_BUNDLE: ++#ifdef MH_KEXT_BUNDLE + case MH_KEXT_BUNDLE: ++#endif + entry->reason = dyld_reason_dyld; + break; + default: +--- src/gdb/macosx/macosx-nat-dyld-process.c ++++ src/gdb/macosx/macosx-nat-dyld-process.c +@@ -407,7 +407,9 @@ + case MH_DYLIB: + break; + case MH_BUNDLE: ++#ifdef MH_KEXT_BUNDLE + case MH_KEXT_BUNDLE: ++#endif + break; + default: + return; + return; +--- src/gdb/macosx/macosx-nat-inferior.c ++++ src/gdb/macosx/macosx-nat-inferior.c +@@ -2692,6 +2692,7 @@ + if (tp->private == NULL || tp->private->app_thread_port == 0) + return NULL; + ++#ifdef THREAD_IDENTIFIER_INFO_COUNT + thread_identifier_info_data_t tident; + unsigned int info_count; + kern_return_t kret; +@@ -2719,6 +2720,7 @@ + } + } + } ++#endif + return buf; + } + +--- src/gdb/macosx/macosx-nat-infthread.c ++++ src/gdb/macosx/macosx-nat-infthread.c +@@ -809,6 +809,7 @@ + print_stack_frame (get_selected_frame (NULL), 0, LOCATION); + switch_to_thread (current_ptid); + ++#ifdef THREAD_IDENTIFIER_INFO_COUNT + thread_identifier_info_data_t tident; + info_count = THREAD_IDENTIFIER_INFO_COUNT; + kret = thread_info (tid, THREAD_IDENTIFIER_INFO, (thread_info_t) &tident, +@@ -878,6 +879,7 @@ + printf_filtered ("\tcurrent priority: %d\n", pth.pth_priority); + printf_filtered ("\tmax priority: %d\n", pth.pth_maxpriority); + } ++#endif + + printf_filtered ("\tsuspend count: %d", info.suspend_count); + +@@ -1175,6 +1177,7 @@ + ui_out_field_fmt (uiout, "mach-port-number", "0x%s", + paddr_nz (app_thread_name)); + ++#ifdef THREAD_IDENTIFIER_INFO_COUNT + thread_identifier_info_data_t tident; + info_count = THREAD_IDENTIFIER_INFO_COUNT; + kret = thread_info (tid, THREAD_IDENTIFIER_INFO, (thread_info_t) &tident, +@@ -1207,6 +1210,7 @@ + paddr_nz (struct_addr)); + } + } ++#endif + } + + diff --git a/dev-debug/gdb-apple/files/gdb-apple-1518-darwin8.patch b/dev-debug/gdb-apple/files/gdb-apple-1518-darwin8.patch new file mode 100644 index 000000000000..f8ecc30be7f6 --- /dev/null +++ b/dev-debug/gdb-apple/files/gdb-apple-1518-darwin8.patch @@ -0,0 +1,128 @@ +--- src/gdb/macosx/macosx-nat-inferior.c ++++ src/gdb/macosx/macosx-nat-inferior.c +@@ -60,13 +60,17 @@ + #include <sys/sysctl.h> + #include <sys/proc.h> + #include <mach/mach_error.h> ++#if defined(TARGET_ARM) + #include <spawn.h> ++#endif + + #include <semaphore.h> + + #include <dlfcn.h> ++#if 0 + #include <libproc.h> + #include <sys/proc_info.h> ++#endif + + #include "macosx-nat-dyld.h" + #include "macosx-nat-inferior.h" +--- src/gdb/macosx/macosx-nat-info.c ++++ src/gdb/macosx/macosx-nat-info.c +@@ -45,6 +45,22 @@ + #include "macosx-nat-inferior.h" + #include "macosx-nat-inferior-debug.h" + ++#ifdef __ppc__ ++#ifndef __darwin_ppc_thread_state ++#define __darwin_ppc_thread_state ppc_thread_state ++#define __r0 r0 ++#define __srr0 srr0 ++#define __srr1 srr1 ++#define __cr cr ++#define __xer xer ++#define __lr lr ++#define __ctr ctr ++#endif ++#ifndef __darwin_ppc_exception_state ++#define __darwin_ppc_exception_state ppc_exception_state ++#endif ++#endif ++ + extern macosx_inferior_status *macosx_status; + + #define CHECK_ARGS(what, args) \ +--- src/gdb/macosx/macosx-nat-infthread.c ++++ src/gdb/macosx/macosx-nat-infthread.c +@@ -36,8 +36,10 @@ + #include <sys/dir.h> + #include <inttypes.h> + ++#if 0 + #include <libproc.h> + #include <sys/proc_info.h> ++#endif + + #include "macosx-nat-inferior.h" + #include "macosx-nat-inferior-util.h" +--- src/gdb/macosx/macosx-tdep.c ++++ src/gdb/macosx/macosx-tdep.c +@@ -64,7 +64,6 @@ + #include "gdbcore.h" + + #include <dirent.h> +-#include <libgen.h> + #include <sys/types.h> + #include <sys/stat.h> + #include <sys/param.h> +--- src/gdb/remote.c ++++ src/gdb/remote.c +@@ -63,7 +63,6 @@ + #include "macosx-nat-dyld.h" + #include "macosx-nat-dyld-process.h" + #endif +-#include <execinfo.h> + + /* Prototypes for local functions. */ + static void cleanup_sigint_signal_handler (void *dummy); +@@ -475,11 +474,13 @@ + static void + remote_backtrace_self (const char *message) + { ++#if 0 + void *bt_buffer[100]; + int count = backtrace (bt_buffer, 100); + if (message && message[0]) + fprintf_filtered (gdb_stderr, "%s", message); + backtrace_symbols_fd (bt_buffer, count, STDERR_FILENO); ++#endif + } + + static void +--- src/gdb/symfile.c ++++ src/gdb/symfile.c +@@ -67,7 +67,6 @@ + #include <ctype.h> + #include <time.h> + #include <sys/time.h> +-#include <libgen.h> + + #include <sys/mman.h> + +--- src/gdb/utils.c ++++ src/gdb/utils.c +@@ -28,7 +28,6 @@ + #include "event-top.h" + #include "exceptions.h" + #include "bfd.h" +-#include <execinfo.h> + #include <sys/resource.h> + #include <uuid/uuid.h> + +@@ -879,6 +878,7 @@ + target_terminal_ours (); + begin_line (); + ++#if 0 + /* APPLE LOCAL: Do a stack crawl of how we got here so we're more likely + to get useful bug reports. */ + { +@@ -887,6 +887,7 @@ + fprintf (stderr, "gdb stack crawl at point of internal error:\n"); + backtrace_symbols_fd (bt_buffer, count, STDERR_FILENO); + } ++#endif + + /* Create a string containing the full error/warning message. Need + to call query with this full string, as otherwize the reason diff --git a/dev-debug/gdb-apple/files/gdb-apple-1705-darwin8-10.patch b/dev-debug/gdb-apple/files/gdb-apple-1705-darwin8-10.patch new file mode 100644 index 000000000000..32247431fe89 --- /dev/null +++ b/dev-debug/gdb-apple/files/gdb-apple-1705-darwin8-10.patch @@ -0,0 +1,11 @@ +--- src/gdb/macosx/macosx-nat-dyld.c ++++ src/gdb/macosx/macosx-nat-dyld.c +@@ -788,7 +788,7 @@ + } + else + { +-#if defined (NM_NEXTSTEP) ++#if defined (NM_NEXTSTEP) && defined(TASK_DYLD_INFO_COUNT) + if (macosx_status->task == TASK_NULL) + return 0; + diff --git a/dev-debug/gdb-apple/files/gdb-apple-768-texinfo.patch b/dev-debug/gdb-apple/files/gdb-apple-768-texinfo.patch new file mode 100644 index 000000000000..41153d8436de --- /dev/null +++ b/dev-debug/gdb-apple/files/gdb-apple-768-texinfo.patch @@ -0,0 +1,10 @@ +--- src/Makefile.in ++++ src/Makefile.in +@@ -280,6 +280,6 @@ + then echo $$r/$(BUILD_SUBDIR)/texinfo/makeinfo/makeinfo ; \ + else if (${CONFIGURED_MAKEINFO} --version \ +- | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[2-9]|[5-9])') >/dev/null 2>&1; \ ++ | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[2-9]|4\.[1-9][0-9]|[5-9])') >/dev/null 2>&1; \ + then echo ${CONFIGURED_MAKEINFO}; else echo $$s/missing makeinfo; fi; fi` + + # This just becomes part of the MAKEINFO definition passed down to diff --git a/dev-debug/gdb-apple/files/gdb-apple-no-global-gdbinit.patch b/dev-debug/gdb-apple/files/gdb-apple-no-global-gdbinit.patch new file mode 100644 index 000000000000..0c132ec5b384 --- /dev/null +++ b/dev-debug/gdb-apple/files/gdb-apple-no-global-gdbinit.patch @@ -0,0 +1,23 @@ +Sourcing /etc/gdb.conf is annoying mainly because Apple put + set history save on +in there, which means everywhere you run it, you end up with a +.gdb_history file. + +--- src/gdb/main.c ++++ src/gdb/main.c +@@ -675,6 +675,7 @@ + memset (&cwdbuf, 0, sizeof (struct stat)); + /* APPLE LOCAL end move inits up */ + /* APPLE LOCAL begin global gdbinit */ ++#ifdef WANT_GLOBAL_GDBINIT + memset (&globalbuf, 0, sizeof (struct stat)); + stat (gdbinit_global, &globalbuf); + if (!inhibit_gdbinit) +@@ -683,6 +684,7 @@ + source_file (gdbinit_global, 0); + } + do_cleanups (ALL_CLEANUPS); ++#endif + /* APPLE LOCAL end global gdbinit */ + + /* APPLE LOCAL: Set the $_Xcode convenience variable at '0' before sourcing |