From: Derrick Brashear Date: Thu, 17 Mar 2011 05:25:35 +0000 (-0400) Subject: osx: decode-panic should work in add-kext only land X-Git-Tag: openafs-devel-1_7_1~795 X-Git-Url: https://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=c4744cc699be19fffb49f39f469e91ef6aac6585 osx: decode-panic should work in add-kext only land in 64 bit 10.6, you need add-kext (not add-symbol-file) to decode a panic. deal accordingly Change-Id: I40f3c40150b98be2d80881ee56f8f8e33c92bc0f Reviewed-on: http://gerrit.openafs.org/4255 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- diff --git a/src/packaging/MacOS/decode-panic b/src/packaging/MacOS/decode-panic index 41c9447..8a02330 100755 --- a/src/packaging/MacOS/decode-panic +++ b/src/packaging/MacOS/decode-panic @@ -31,7 +31,7 @@ my $temp_dir = tempdir( "afsdebugXXXXXX", DIR => File::Spec->tmpdir, TMPDIR => 1, CLEANUP => 1 ); my $dump_file = "/var/db/openafs/logs/crash.dump"; my $kernel = "/mach_kernel"; -my $kextpath = "/Library/OpenAFS/Tools/root.client/usr/vice/etc/afs.kext/"; +my $kextpath = "/Library/OpenAFS/Tools/root.client/usr/vice/etc/afs.kext"; my $option_quiet; my $option_verbose; @@ -120,8 +120,20 @@ generate_symbol_files( $crash_info{"afs_kernel_address"}, $temp_dir, $kextarch , write_gdb_input_file( $temp_dir, $gdb_file, $crash_info{ "backtrace" } ); +# needed so we can put the sym file where the kext is. ick. +if ($kextprog eq $kextutil) { + `cp -R $kextpath $temp_dir`; +} + if ($option_verbose) { print "$gdb $gdbarch $kernel -batch -x $temp_dir/$gdb_file\n"; + my $gdbi_fh = IO::File->new( $temp_dir . "/" . $gdb_file, '<' ) + or croak "Can't open backtrace file $gdb_file: $OS_ERROR\n"; + while (my $line = <$gdbi_fh> ) { + print $line; + } + $gdbi_fh->close() + or croak "Can't close file $gdb_file: $OS_ERROR\n"; } my $gdb_output = `$gdb $gdbarch $kernel -batch -x $temp_dir/$gdb_file`; croak "gdb failed!\n" if $CHILD_ERROR; @@ -394,8 +406,12 @@ sub write_gdb_input_file { my $fh = IO::File->new( $write_dir . "/" . $filename, '>' ) or croak "Can't open gdb file $filename for writing: $OS_ERROR\n"; - for my $symbol ( @symbol_files ) { - print $fh "add-symbol-file $symbol\n"; + if ($kextprog eq $kextutil) { + print $fh "add-kext " . $write_dir . "/afs.kext\n"; + } else { + for my $symbol ( @symbol_files ) { + print $fh "add-symbol-file $symbol\n"; + } } print $fh "set print asm-demangle on\n";