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

Unified Diff: src/debug/debug.h

Issue 2702343003: [Debugger] Add a ReturnValueScope to correctly handle return values in nested debug breaks. (Closed)
Patch Set: Moves handle scope to Runtime_DebugBreak. Created 3 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 | « no previous file | src/debug/debug.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug/debug.h
diff --git a/src/debug/debug.h b/src/debug/debug.h
index 315c1723dcd90c510c40a3ee033f3e88fe4dc621..43338d7f0a0778def2a6da61aa006aa3db8dbd61 100644
--- a/src/debug/debug.h
+++ b/src/debug/debug.h
@@ -393,6 +393,9 @@ class Debug {
StackFrame::Id break_frame_id() { return thread_local_.break_frame_id_; }
int break_id() { return thread_local_.break_id_; }
+ Handle<Object> return_value_handle() {
+ return handle(thread_local_.return_value_, isolate_);
+ }
Object* return_value() { return thread_local_.return_value_; }
void set_return_value(Object* value) { thread_local_.return_value_ = value; }
@@ -692,12 +695,24 @@ class DebugScope BASE_EMBEDDED {
DebugScope* prev_; // Previous scope if entered recursively.
StackFrame::Id break_frame_id_; // Previous break frame id.
int break_id_; // Previous break id.
- Handle<Object> return_value_; // Previous result.
bool failed_; // Did the debug context fail to load?
SaveContext save_; // Saves previous context.
PostponeInterruptsScope no_termination_exceptons_;
};
+// This scope is used to handle return values in nested debug break points.
+// When there are nested debug breaks, we use this to restore the return
+// value to the previous state. This is not merged with DebugScope because
+// return_value_ will not be cleared when we use DebugScope.
+class ReturnValueScope {
+ public:
+ explicit ReturnValueScope(Debug* debug);
+ ~ReturnValueScope();
+
+ private:
+ Debug* debug_;
+ Handle<Object> return_value_; // Previous result.
+};
// Stack allocated class for disabling break.
class DisableBreak BASE_EMBEDDED {
« no previous file with comments | « no previous file | src/debug/debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698