Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_DEBUG_DEBUG_INTERFACE_H_ | 5 #ifndef V8_DEBUG_DEBUG_INTERFACE_H_ |
| 6 #define V8_DEBUG_DEBUG_INTERFACE_H_ | 6 #define V8_DEBUG_DEBUG_INTERFACE_H_ |
| 7 | 7 |
| 8 #include "include/v8-debug.h" | 8 #include "include/v8-debug.h" |
| 9 #include "include/v8-util.h" | 9 #include "include/v8-util.h" |
| 10 #include "include/v8.h" | 10 #include "include/v8.h" |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 138 }; | 138 }; |
| 139 | 139 |
| 140 static void PrepareStep(Isolate* isolate, StepAction action); | 140 static void PrepareStep(Isolate* isolate, StepAction action); |
| 141 static void ClearStepping(Isolate* isolate); | 141 static void ClearStepping(Isolate* isolate); |
| 142 | 142 |
| 143 /** | 143 /** |
| 144 * Native wrapper around v8::internal::Script object. | 144 * Native wrapper around v8::internal::Script object. |
| 145 */ | 145 */ |
| 146 class Script { | 146 class Script { |
| 147 public: | 147 public: |
| 148 /** | |
| 149 * Defines location inside script. | |
| 150 * Lines and columns are 0-based. | |
| 151 */ | |
| 152 class Location { | |
|
dgozman
2016/11/03 21:13:13
Move this outside of Script. We can also turn this
kozy
2016/11/03 22:17:13
Moved.
| |
| 153 public: | |
| 154 Location(int lineNumber, int columnNumber); | |
| 155 /** | |
| 156 * Create empty location. | |
| 157 */ | |
| 158 Location(); | |
| 159 | |
| 160 int GetLineNumber() const; | |
| 161 int GetColumnNumber() const; | |
| 162 bool IsEmpty() const; | |
| 163 | |
| 164 private: | |
| 165 int lineNumber_; | |
| 166 int columnNumber_; | |
| 167 }; | |
| 168 | |
| 148 v8::Isolate* GetIsolate() const; | 169 v8::Isolate* GetIsolate() const; |
| 149 | 170 |
| 150 ScriptOriginOptions OriginOptions() const; | 171 ScriptOriginOptions OriginOptions() const; |
| 151 bool WasCompiled() const; | 172 bool WasCompiled() const; |
| 152 int Id() const; | 173 int Id() const; |
| 153 int LineOffset() const; | 174 int LineOffset() const; |
| 154 int ColumnOffset() const; | 175 int ColumnOffset() const; |
| 155 std::vector<int> LineEnds() const; | 176 std::vector<int> LineEnds() const; |
| 156 MaybeLocal<String> Name() const; | 177 MaybeLocal<String> Name() const; |
| 157 MaybeLocal<String> SourceURL() const; | 178 MaybeLocal<String> SourceURL() const; |
| 158 MaybeLocal<String> SourceMappingURL() const; | 179 MaybeLocal<String> SourceMappingURL() const; |
| 159 MaybeLocal<String> ContextData() const; | 180 MaybeLocal<String> ContextData() const; |
| 160 MaybeLocal<String> Source() const; | 181 MaybeLocal<String> Source() const; |
| 182 /** | |
| 183 * lines and columns are 0-based. | |
|
dgozman
2016/11/03 21:13:13
This comment should be in Location.
kozy
2016/11/03 22:17:13
Removed.
| |
| 184 */ | |
| 185 bool GetPossibleBreakpoints(const Location& start, const Location& end, | |
| 186 std::vector<Location>* locations) const; | |
| 161 | 187 |
| 162 /** | 188 /** |
| 163 * script parameter is a wrapper v8::internal::JSObject for | 189 * script parameter is a wrapper v8::internal::JSObject for |
| 164 * v8::internal::Script. | 190 * v8::internal::Script. |
| 165 * This function gets v8::internal::Script from v8::internal::JSObject and | 191 * This function gets v8::internal::Script from v8::internal::JSObject and |
| 166 * wraps it with DebugInterface::Script. | 192 * wraps it with DebugInterface::Script. |
| 167 * Returns empty local if not called with a valid wrapper of | 193 * Returns empty local if not called with a valid wrapper of |
| 168 * v8::internal::Script. | 194 * v8::internal::Script. |
| 169 */ | 195 */ |
| 170 static MaybeLocal<Script> Wrap(Isolate* isolate, | 196 static MaybeLocal<Script> Wrap(Isolate* isolate, |
| 171 v8::Local<v8::Object> script); | 197 v8::Local<v8::Object> script); |
| 198 | |
| 199 private: | |
| 200 int GetSourcePosition(const Location& location) const; | |
| 172 }; | 201 }; |
| 173 | 202 |
| 174 /** | 203 /** |
| 175 * Return array of compiled scripts. | 204 * Return array of compiled scripts. |
| 176 */ | 205 */ |
| 177 static void GetLoadedScripts(Isolate* isolate, | 206 static void GetLoadedScripts(Isolate* isolate, |
| 178 PersistentValueVector<Script>& scripts); | 207 PersistentValueVector<Script>& scripts); |
| 179 }; | 208 }; |
| 180 | 209 |
| 181 } // namespace v8 | 210 } // namespace v8 |
| 182 | 211 |
| 183 #endif // V8_DEBUG_DEBUG_INTERFACE_H_ | 212 #endif // V8_DEBUG_DEBUG_INTERFACE_H_ |
| OLD | NEW |