Changeset 226152 in webkit


Ignore:
Timestamp:
Dec 19, 2017 3:50:04 PM (6 years ago)
Author:
BJ Burg
Message:

SLEEP_THREAD_FOR_DEBUGGER() macro should try to print out the PID of the affected process
https://bugs.webkit.org/show_bug.cgi?id=180947

Reviewed by Joseph Pecoraro.

  • wtf/DebugUtilities.h:
  • Use sleep() from CurrentTime.h as it is more cross-platform.
  • Print a message with the process PID to simplify attaching to sleeping thread.
  • Include source location in case multiple such macros are being used.
Location:
trunk/Source/WTF
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r226073 r226152  
     12017-12-19  Brian Burg  <bburg@apple.com>
     2
     3        SLEEP_THREAD_FOR_DEBUGGER() macro should try to print out the PID of the affected process
     4        https://bugs.webkit.org/show_bug.cgi?id=180947
     5
     6        Reviewed by Joseph Pecoraro.
     7
     8        * wtf/DebugUtilities.h:
     9        - Use sleep() from CurrentTime.h as it is more cross-platform.
     10        - Print a message with the process PID to simplify attaching to sleeping thread.
     11        - Include source location in case multiple such macros are being used.
     12
    1132017-12-18  Daniel Bates  <dabates@apple.com>
    214
  • trunk/Source/WTF/wtf/DebugUtilities.h

    r217233 r226152  
    2828
    2929#include <wtf/Assertions.h>
     30#include <wtf/CurrentTime.h>
     31#include <wtf/ProcessID.h>
    3032
    3133#define SLEEP_THREAD_FOR_DEBUGGER() \
    3234do { \
    3335    do { \
    34         sleep(1); \
     36        sleep(1.0); \
    3537        if (WTFIsDebuggerAttached()) \
    3638            break; \
    3739    } while (1); \
     40    WTFReportError(__FILE__, __LINE__, WTF_PRETTY_FUNCTION, "Sleeping thread for debugger; attach to process (PID: %d) to unsleep the thread.", getCurrentProcessID()); \
    3841    WTFBreakpointTrap(); \
    3942} while (0)
Note: See TracChangeset for help on using the changeset viewer.