Changeset 116417 in webkit
- Timestamp:
- May 8, 2012 7:00:31 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r116371 r116417 1 2012-05-07 Alexis Menard <alexis.menard@openbossa.org> 2 3 [Qt] Unbreak debugging of WebKit2. 4 https://bugs.webkit.org/show_bug.cgi?id=85839 5 6 Reviewed by Simon Hausmann. 7 8 When you attach GDB to a running process, it stops it. 9 http://trac.webkit.org/changeset/115958 introduced a pause() 10 call to wait the debugger to be attached to then continue 11 the execution of the WebProcess. Unfortunately the pause() 12 function does not return unless a signal handler is called. 13 This patch introduce an event handler to exit from the paused 14 state when the debugger send the signal SIGCONT. The old code 15 works with older version of GDB (<7.0) but not with newer 16 versions where the behavior of pause() is correct. 17 18 * qt/MainQt.cpp: 19 (sigcontHandler): 20 (main): 21 1 22 2012-05-07 Julien Chaffraix <jchaffraix@webkit.org> 2 23 -
trunk/Source/WebKit2/qt/MainQt.cpp
r116352 r116417 29 29 #include <stdio.h> 30 30 #if !defined(NDEBUG) && defined(Q_OS_UNIX) 31 #include <signal.h> 31 32 #include <unistd.h> 32 33 #endif … … 36 37 Q_DECL_IMPORT void initializeWebKit2Theme(); 37 38 } 39 40 #if !defined(NDEBUG) && defined(Q_OS_UNIX) 41 static void sigcontHandler(int) 42 { 43 } 44 #endif 38 45 39 46 static void messageHandler(QtMsgType type, const char* message) … … 54 61 #if !defined(NDEBUG) && defined(Q_OS_UNIX) 55 62 if (qgetenv("QT_WEBKIT_PAUSE_WEB_PROCESS") == "1" || qgetenv("QT_WEBKIT2_DEBUG") == "1") { 56 fprintf(stderr, "Pausing web process, please attach to PID %d and continue... ", getpid()); 63 struct sigaction newAction, oldAction; 64 newAction.sa_handler = sigcontHandler; 65 sigemptyset(&newAction.sa_mask); 66 newAction.sa_flags = 0; 67 sigaction(SIGCONT, &newAction, &oldAction); 68 fprintf(stderr, "Pausing UI process, please attach to PID %d and send signal SIGCONT... ", getpid()); 57 69 pause(); 70 sigaction(SIGCONT, &oldAction, 0); 58 71 fprintf(stderr, " OK\n"); 59 72 } -
trunk/Tools/ChangeLog
r116416 r116417 1 2012-05-07 Alexis Menard <alexis.menard@openbossa.org> 2 3 [Qt] Unbreak debugging of WebKit2. 4 https://bugs.webkit.org/show_bug.cgi?id=85839 5 6 Reviewed by Simon Hausmann. 7 8 When you attach GDB to a running process, it stops it. 9 http://trac.webkit.org/changeset/115958 introduced a pause() 10 call to wait the debugger to be attached to then continue 11 the execution of the WebProcess. Unfortunately the pause() 12 function does not return unless a signal handler is called. 13 This patch introduce an event handler to exit from the paused 14 state when the debugger send the signal SIGCONT. The old code 15 works with older version of GDB (<7.0) but not with newer 16 versions where the behavior of pause() is correct. 17 18 * WebKitTestRunner/qt/main.cpp: 19 (sigcontHandler): 20 (main): 21 1 22 2012-05-08 Christophe Dumez <christophe.dumez@intel.com> 2 23 -
trunk/Tools/WebKitTestRunner/qt/main.cpp
r116352 r116417 32 32 #include <stdio.h> 33 33 #if !defined(NDEBUG) && defined(Q_OS_UNIX) 34 #include <signal.h> 34 35 #include <unistd.h> 35 36 #endif … … 67 68 }; 68 69 70 #if !defined(NDEBUG) && defined(Q_OS_UNIX) 71 static void sigcontHandler(int) 72 { 73 } 74 #endif 75 69 76 void messageHandler(QtMsgType type, const char* message) 70 77 { … … 81 88 #if !defined(NDEBUG) && defined(Q_OS_UNIX) 82 89 if (qgetenv("QT_WEBKIT_PAUSE_UI_PROCESS") == "1") { 83 fprintf(stderr, "Pausing UI process, please attach to PID %d and continue... ", getpid()); 90 struct sigaction newAction, oldAction; 91 newAction.sa_handler = sigcontHandler; 92 sigemptyset(&newAction.sa_mask); 93 newAction.sa_flags = 0; 94 sigaction(SIGCONT, &newAction, &oldAction); 95 fprintf(stderr, "Pausing UI process, please attach to PID %d and send signal SIGCONT... ", getpid()); 84 96 pause(); 97 sigaction(SIGCONT, &oldAction, 0); 85 98 fprintf(stderr, " OK\n"); 86 99 }
Note: See TracChangeset
for help on using the changeset viewer.