Changeset 159110 in webkit for trunk/Source/JavaScriptCore/debugger/Debugger.cpp
- Timestamp:
- Nov 12, 2013, 7:41:55 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/debugger/Debugger.cpp
r158937 r159110 116 116 }; 117 117 118 // This is very similar to TemporaryChange<bool>, but that cannot be used 119 // as the m_isPaused field uses only one bit. 120 class TemporaryPausedState { 121 public: 122 TemporaryPausedState(Debugger& debugger) 123 : m_debugger(debugger) 124 { 125 ASSERT(!m_debugger.m_isPaused); 126 m_debugger.m_isPaused = true; 127 } 128 129 ~TemporaryPausedState() 130 { 131 m_debugger.m_isPaused = false; 132 } 133 134 private: 135 Debugger& m_debugger; 136 }; 118 137 119 138 Debugger::Debugger(bool isInWorkerThread) … … 265 284 } 266 285 267 bool Debugger::hasBreakpoint(SourceID sourceID, const TextPosition& position, Breakpoint *hitBreakpoint) const286 bool Debugger::hasBreakpoint(SourceID sourceID, const TextPosition& position, Breakpoint *hitBreakpoint) 268 287 { 269 288 if (!m_breakpointsActivated) … … 304 323 return true; 305 324 325 // We cannot stop in the debugger while executing condition code, 326 // so make it looks like the debugger is already paused. 327 TemporaryPausedState pausedState(*this); 328 306 329 JSValue exception; 307 330 JSValue result = DebuggerCallFrame::evaluateWithCallFrame(m_currentCallFrame, breakpoints[i].condition, exception); 331 332 // We can lose the debugger while executing JavaScript. 333 if (!m_currentCallFrame) 334 return false; 335 308 336 if (exception) { 309 337 // An erroneous condition counts as "false". … … 311 339 return false; 312 340 } 341 313 342 return result.toBoolean(m_currentCallFrame); 314 343 } … … 428 457 DebuggerCallFrameScope debuggerCallFrameScope(*this); 429 458 459 // Make sure we are not going to pause again on breakpoint actions by 460 // reseting the pause state before executing any breakpoint actions. 461 TemporaryPausedState pausedState(*this); 462 m_pauseOnCallFrame = 0; 463 m_pauseOnNextStatement = false; 464 430 465 if (didHitBreakpoint) { 431 466 handleBreakpointHit(breakpoint); 432 if (breakpoint.autoContinue) 467 // Note that the actions can potentially stop the debugger, so we need to check that 468 // we still have a current call frame when we get back. 469 if (breakpoint.autoContinue || !m_currentCallFrame) 433 470 return; 434 471 } 435 436 m_pauseOnCallFrame = 0;437 m_pauseOnNextStatement = false;438 m_isPaused = true;439 472 440 473 handlePause(m_reasonForPause, dynamicGlobalObject); … … 445 478 m_currentCallFrame = 0; 446 479 } 447 448 m_isPaused = false;449 480 } 450 481
Note:
See TracChangeset
for help on using the changeset viewer.