Changeset 121122 in webkit
- Timestamp:
- Jun 24, 2012, 4:07:31 PM (14 years ago)
- Location:
- trunk/Tools
- Files:
-
- 5 edited
-
ChangeLog (modified) (1 diff)
-
Scripts/debug-minibrowser (modified) (1 diff)
-
Scripts/debug-safari (modified) (1 diff)
-
Scripts/debug-test-runner (modified) (1 diff)
-
Scripts/webkitdirs.pm (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r121118 r121122 1 2012-06-24 Dan Bernstein <mitz@apple.com> 2 3 Made debug-{minibrowser,safari,test-runner} work with LLDB. 4 5 Reviewed by Sam Weinig. 6 7 * Scripts/debug-minibrowser: Pass INCLUDE_OPTIONS_FOR_DEBUGGING to 8 printHelpAndExitForRunAndDebugWebKitAppIfNeeded(). 9 * Scripts/debug-safari: Ditto. 10 * Scripts/debug-test-runner: Ditto. 11 * Scripts/webkitdirs.pm: 12 (debugger): Added. Calls determineDebugger() if needed and returns the chosen debugger. 13 (determineDebugger): Added. Sets the debugger to "lldb" if the --use-lldb switch is present, 14 and to "gdb" otherwise. 15 (printHelpAndExitForRunAndDebugWebKitAppIfNeeded): Changed to print help for the 16 --target-web-process and --use-lldb switches if passed INCLUDE_OPTIONS_FOR_DEBUGGING. 17 (execMacWebKitAppForDebugging): Changed to use the chosen debugger. 18 1 19 2012-06-24 Adam Barth <abarth@webkit.org> 2 20 -
trunk/Tools/Scripts/debug-minibrowser
r103640 r121122 34 34 use webkitdirs; 35 35 36 printHelpAndExitForRunAndDebugWebKitAppIfNeeded( );36 printHelpAndExitForRunAndDebugWebKitAppIfNeeded(INCLUDE_OPTIONS_FOR_DEBUGGING); 37 37 38 38 setConfiguration(); -
trunk/Tools/Scripts/debug-safari
r103640 r121122 34 34 use webkitdirs; 35 35 36 printHelpAndExitForRunAndDebugWebKitAppIfNeeded( );36 printHelpAndExitForRunAndDebugWebKitAppIfNeeded(INCLUDE_OPTIONS_FOR_DEBUGGING); 37 37 38 38 setConfiguration(); -
trunk/Tools/Scripts/debug-test-runner
r103640 r121122 31 31 use webkitdirs; 32 32 33 printHelpAndExitForRunAndDebugWebKitAppIfNeeded( );33 printHelpAndExitForRunAndDebugWebKitAppIfNeeded(INCLUDE_OPTIONS_FOR_DEBUGGING); 34 34 35 35 setConfiguration(); -
trunk/Tools/Scripts/webkitdirs.pm
r121104 r121122 72 72 73 73 use constant USE_OPEN_COMMAND => 1; # Used in runMacWebKitApp(). 74 use constant INCLUDE_OPTIONS_FOR_DEBUGGING => 1; 74 75 75 76 our @EXPORT_OK; … … 84 85 my $sourceDir; 85 86 my $currentSVNRevision; 87 my $debugger; 86 88 my $nmPath; 87 89 my $osXVersion; … … 1403 1405 } 1404 1406 1407 sub debugger 1408 { 1409 determineDebugger(); 1410 return $debugger; 1411 } 1412 1413 sub determineDebugger 1414 { 1415 return if defined($debugger); 1416 if (checkForArgumentAndRemoveFromARGV("--use-lldb")) { 1417 $debugger = "lldb"; 1418 } else { 1419 $debugger = "gdb"; 1420 } 1421 } 1422 1405 1423 sub appendToEnvironmentVariableList 1406 1424 { … … 2598 2616 } 2599 2617 2600 sub printHelpAndExitForRunAndDebugWebKitAppIfNeeded ()2618 sub printHelpAndExitForRunAndDebugWebKitAppIfNeeded 2601 2619 { 2602 2620 return unless checkForArgumentAndRemoveFromARGV("--help"); 2621 2622 my ($includeOptionsForDebugging) = @_; 2623 2603 2624 print STDERR <<EOF; 2604 2625 Usage: @{[basename($0)]} [options] [args ...] … … 2607 2628 --guard-malloc Enable Guard Malloc (Mac OS X only) 2608 2629 EOF 2630 2631 if ($includeOptionsForDebugging) { 2632 print STDERR <<EOF; 2633 --target-web-process Debug the web process 2634 --use-lldb Use LLDB 2635 EOF 2636 } 2637 2609 2638 exit(1); 2610 2639 } … … 2639 2668 { 2640 2669 my ($appPath) = @_; 2641 2642 my $gdbPath = `xcrun -find gdb`; 2643 chomp $gdbPath; 2644 die "Can't find gdb executable. Is gdb installed?\n" unless -x $gdbPath; 2670 my $architectureSwitch; 2671 my $argumentsSeparator; 2672 2673 if (debugger() eq "lldb") { 2674 $architectureSwitch = "--arch"; 2675 $argumentsSeparator = "--"; 2676 } elsif (debugger() eq "gdb") { 2677 $architectureSwitch = "-arch"; 2678 $argumentsSeparator = "--args"; 2679 } else { 2680 die "Unknown debugger $debugger.\n"; 2681 } 2682 2683 my $debuggerPath = `xcrun -find $debugger`; 2684 chomp $debuggerPath; 2685 die "Can't find the $debugger executable.\n" unless -x $debuggerPath; 2645 2686 2646 2687 my $productDir = productDir(); … … 2650 2691 setUpGuardMallocIfNeeded(); 2651 2692 2652 my @architectureFlags = ( "-arch", architecture());2693 my @architectureFlags = ($architectureSwitch, architecture()); 2653 2694 if (!shouldTargetWebProcess()) { 2654 print "Starting @{[basename($appPath)]} under gdbwith DYLD_FRAMEWORK_PATH set to point to built WebKit in $productDir.\n";2655 exec { $ gdbPath } $gdbPath, @architectureFlags, "--args", $appPath, argumentsForRunAndDebugMacWebKitApp() or die;2695 print "Starting @{[basename($appPath)]} under $debugger with DYLD_FRAMEWORK_PATH set to point to built WebKit in $productDir.\n"; 2696 exec { $debuggerPath } $debuggerPath, @architectureFlags, $argumentsSeparator, $appPath, argumentsForRunAndDebugMacWebKitApp() or die; 2656 2697 } else { 2657 2698 my $webProcessShimPath = File::Spec->catfile($productDir, "WebProcessShim.dylib"); … … 2661 2702 appendToEnvironmentVariableList("DYLD_INSERT_LIBRARIES", $webProcessShimPath); 2662 2703 2663 print "Starting WebProcess under gdbwith DYLD_FRAMEWORK_PATH set to point to built WebKit in $productDir.\n";2664 exec { $ gdbPath } $gdbPath, @architectureFlags, "--args", $webProcessPath, $webKit2ExecutablePath, "-type", "webprocess", "-client-executable", $appPath or die;2704 print "Starting WebProcess under $debugger with DYLD_FRAMEWORK_PATH set to point to built WebKit in $productDir.\n"; 2705 exec { $debuggerPath } $debuggerPath, @architectureFlags, $argumentsSeparator, $webProcessPath, $webKit2ExecutablePath, "-type", "webprocess", "-client-executable", $appPath or die; 2665 2706 } 2666 2707 }
Note:
See TracChangeset
for help on using the changeset viewer.