Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(189)

Unified Diff: src/debug.cc

Issue 39124: Handle thread preemption in debugger (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/debug.h ('k') | src/execution.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug.cc
===================================================================
--- src/debug.cc (revision 1435)
+++ src/debug.cc (working copy)
@@ -400,12 +400,17 @@
// Threading support.
void Debug::ThreadInit() {
+ thread_local_.break_count_ = 0;
+ thread_local_.break_id_ = 0;
+ thread_local_.break_frame_id_ = StackFrame::NO_ID;
thread_local_.last_step_action_ = StepNone;
thread_local_.last_statement_position_ = RelocInfo::kNoPosition;
thread_local_.step_count_ = 0;
thread_local_.last_fp_ = 0;
thread_local_.step_into_fp_ = 0;
thread_local_.after_break_target_ = 0;
+ thread_local_.debugger_entry_ = NULL;
+ thread_local_.preemption_pending_ = false;
}
@@ -611,6 +616,13 @@
}
+// Set the flag indicating that preemption happened during debugging.
+void Debug::PreemptionWhileInDebugger() {
+ ASSERT(InDebugger());
+ Debug::set_preemption_pending(true);
+}
+
+
void Debug::Iterate(ObjectVisitor* v) {
v->VisitPointer(bit_cast<Object**, Code**>(&(debug_break_return_entry_)));
v->VisitPointer(bit_cast<Object**, Code**>(&(debug_break_return_)));
@@ -743,7 +755,7 @@
*Factory::LookupAsciiSymbol("IsBreakPointTriggered"))));
// Get the break id as an object.
- Handle<Object> break_id = Factory::NewNumberFromInt(Top::break_id());
+ Handle<Object> break_id = Factory::NewNumberFromInt(Debug::break_id());
// Call HandleBreakPointx.
bool caught_exception = false;
@@ -873,7 +885,7 @@
void Debug::FloodHandlerWithOneShot() {
// Iterate through the JavaScript stack looking for handlers.
- StackFrame::Id id = Top::break_frame_id();
+ StackFrame::Id id = break_frame_id();
if (id == StackFrame::NO_ID) {
// If there is no JavaScript stack don't do anything.
return;
@@ -913,7 +925,7 @@
// any. The debug frame will only be present if execution was stopped due to
// hitting a break point. In other situations (e.g. unhandled exception) the
// debug frame is not present.
- StackFrame::Id id = Top::break_frame_id();
+ StackFrame::Id id = break_frame_id();
if (id == StackFrame::NO_ID) {
// If there is no JavaScript stack don't do anything.
return;
@@ -1118,6 +1130,18 @@
}
+void Debug::NewBreak(StackFrame::Id break_frame_id) {
+ thread_local_.break_frame_id_ = break_frame_id;
+ thread_local_.break_id_ = ++thread_local_.break_count_;
+}
+
+
+void Debug::SetBreak(StackFrame::Id break_frame_id, int break_id) {
+ thread_local_.break_frame_id_ = break_frame_id;
+ thread_local_.break_id_ = break_id;
+}
+
+
// Handle stepping into a function.
void Debug::HandleStepIn(Handle<JSFunction> function,
Address fp,
@@ -1381,7 +1405,7 @@
Handle<Object> Debugger::MakeExecutionState(bool* caught_exception) {
// Create the execution state object.
- Handle<Object> break_id = Factory::NewNumberFromInt(Top::break_id());
+ Handle<Object> break_id = Factory::NewNumberFromInt(Debug::break_id());
const int argc = 1;
Object** argv[argc] = { break_id.location() };
return MakeJSObject(CStrVector("MakeExecutionState"),
« no previous file with comments | « src/debug.h ('k') | src/execution.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698