View backtraces for core dumps generated under OS X 10.4.8 on intel macs

Paul Litvak paullitvak@gmail.com
Thu Nov 2 19:19:00 GMT 2006


The bug:

Can't view backtraces for core dumps generated under OS X 10.4.8 on  
intel macs.
GDB reports "Core file contained no thread-specific data" after  
loading the core file.
I can reproduce the bug with gdb in Xcode 2.4 and 2.4.1

The patch to Apple's gdb-563 sources:

--- src/gdb/macosx/core-macho.c	2005-08-04 15:41:17.000000000 -0500
+++ /Users/plitvak/src/darwin/gdb/src/gdb/macosx/core-macho.c	 
2006-10-19 04:57:49.000000000 -0500
@@ -77,7 +77,7 @@ check_thread (bfd *abfd, asection *asect
#if defined (TARGET_POWERPC)
    const char *expected = "LC_THREAD.PPC_THREAD_STATE.";
#elif defined (TARGET_I386)
-  const char *expected = "LC_THREAD.i386_THREAD_STATE.";
+  const char *expected = "LC_THREAD.x86_THREAD_STATE.";
#else
#error "unsupported architecture"
#endif
@@ -280,7 +280,7 @@ core_fetch_section_registers (asection *
#if defined (TARGET_POWERPC)
    ppc_macosx_fetch_gp_registers ((gdb_ppc_thread_state_t *) regs);
#elif defined (TARGET_I386)
-  i386_macosx_fetch_gp_registers ((gdb_i386_thread_state_t *) regs);
+  i386_macosx_fetch_gp_registers ( (gdb_i386_thread_state_t*)& 
((gdb_x86_thread_state_t *) regs)->uts.ts32 );
#else
#error "unsupported architecture"
#endif

-- Paul Litvak



More information about the Gdb-patches mailing list