+2006-08-29 Darin Adler <darin@apple.com>
+
+ Reviewed by Tim Hatcher.
+
+ * Scripts/gdb-safari: Set DYLD_FRAMEWORK_PATH inside gdb instead of setting it in gdb's environment
+ to work around what seems to be a bug in some versions of gdb.
+
2006-08-16 Tim Omernick <timo@apple.com>
Reviewed by John Sullivan.
use FindBin;
use lib $FindBin::Bin;
use webkitdirs;
+use File::Temp qw/:mktemp/;
setConfiguration();
my $productDir = productDir();
# Check to see that all the frameworks are built.
checkFrameworks();
-# Set up DYLD_FRAMEWORK_PATH to point to the product directory.
-$ENV{DYLD_FRAMEWORK_PATH} = $productDir;
+# Put a command to set DYLD_FRAMEWORK_PATH in a temp file.
+my ($fh, $path) = mkstemp("/tmp/gdb-safari-XXXX");
+print $fh "set env DYLD_FRAMEWORK_PATH $productDir\n";
+# Start up Safari.
print "Start Safari under gdb with DYLD_FRAMEWORK_PATH set to point to built WebKit in $productDir.\n";
-exec $gdbPath, $safariPath or die;
+exec $gdbPath, "-x", $path, $safariPath or die;
+
+# Delete the temporary file.
+unlink0($fh, $path) or die "Error unlinking file $path safely";