Changeset 63913 in webkit


Ignore:
Timestamp:
Jul 22, 2010 2:25:32 PM (14 years ago)
Author:
Adam Roben
Message:

Use ::MessageBox instead of ::DebugBreak to make the web process wait for a debugger

While ::DebugBreak can make it easier to attach a debugger (because it
brings up the Just-in-Time debugger window), using ::MessageBox has
two advantages:

1) It explains to the user what's going on, so it's harder to

mistake this debugging aid for a bug.

2) It allows you to debug the UI process and the web process using

the same debugger, if desired.

Special thanks to John Sullivan for help with the text that's shown in
the alert.

Fixes <http://webkit.org/b/42848> WebKit2's wait-for-debugger
debugging aid should explain to the user what's happening

Reviewed by John Sullivan and Anders Carlsson.

  • WebProcess/WebKitMain.cpp:

(WebKitMain): Use a ::MessageBox instead of a ::DebugBreak to wait for
the debugger. The alert explains to the user what's going on.

Location:
trunk/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit2/ChangeLog

    r63912 r63913  
     12010-07-22  Adam Roben  <aroben@apple.com>
     2
     3        Use ::MessageBox instead of ::DebugBreak to make the web process wait
     4        for a debugger
     5
     6        While ::DebugBreak can make it easier to attach a debugger (because it
     7        brings up the Just-in-Time debugger window), using ::MessageBox has
     8        two advantages:
     9          1) It explains to the user what's going on, so it's harder to
     10             mistake this debugging aid for a bug.
     11          2) It allows you to debug the UI process and the web process using
     12             the same debugger, if desired.
     13
     14        Special thanks to John Sullivan for help with the text that's shown in
     15        the alert.
     16
     17        Fixes <http://webkit.org/b/42848> WebKit2's wait-for-debugger
     18        debugging aid should explain to the user what's happening
     19
     20        Reviewed by John Sullivan and Anders Carlsson.
     21
     22        * WebProcess/WebKitMain.cpp:
     23        (WebKitMain): Use a ::MessageBox instead of a ::DebugBreak to wait for
     24        the debugger. The alert explains to the user what's going on.
     25
    1262010-07-22  Adam Roben  <aroben@apple.com>
    227
  • trunk/WebKit2/WebProcess/WebKitMain.cpp

    r63777 r63913  
    5656#elif PLATFORM(WIN)
    5757
     58#ifndef DEBUG_ALL
     59#define PROCESS_NAME L"WebKit2WebKitProcess.exe"
     60#else
     61#define PROCESS_NAME L"WebKit2WebProcess_debug.exe"
     62#endif
     63
    5864static void enableTerminationOnHeapCorruption()
    5965{
     
    7985{
    8086#ifndef NDEBUG
    81     // Break into the debugger when Ctrl-Alt-Shift is held down during launch. This makes it easier
    82     // to debug problems that happen early in the web process's liftime.
     87    // Show an alert when Ctrl-Alt-Shift is held down during launch to give the user time to attach a
     88    // debugger. This is useful for debugging problems that happen early in the web process's lifetime.
    8389    const unsigned short highBitMaskShort = 0x8000;
    8490    if ((::GetKeyState(VK_CONTROL) & highBitMaskShort) && (::GetKeyState(VK_MENU) & highBitMaskShort) && (::GetKeyState(VK_SHIFT) & highBitMaskShort))
    85         ::DebugBreak();
     91        ::MessageBoxW(0, L"You can now attach a debugger to " PROCESS_NAME L". You can use\nthe same debugger for WebKit2WebProcessand the UI process, if desired.\nClick OK when you are ready for WebKit2WebProcess to continue.", L"WebKit2WebProcess has launched", MB_OK | MB_ICONINFORMATION);
    8692#endif
    8793
Note: See TracChangeset for help on using the changeset viewer.