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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 195 v8::Local<v8::Object> script); | 195 v8::Local<v8::Object> script); |
| 196 | 196 |
| 197 private: | 197 private: |
| 198 int GetSourcePosition(const Location& location) const; | 198 int GetSourcePosition(const Location& location) const; |
| 199 }; | 199 }; |
| 200 | 200 |
| 201 static void GetLoadedScripts(Isolate* isolate, | 201 static void GetLoadedScripts(Isolate* isolate, |
| 202 PersistentValueVector<Script>& scripts); | 202 PersistentValueVector<Script>& scripts); |
| 203 | 203 |
| 204 /** | 204 /** |
| 205 * The result of disassembling a wasm function. | |
| 206 * Consists of the disassembly string and an offset table mapping wasm byte | |
| 207 * offsets to line and column in the disassembly. | |
| 208 * The offset table consists of entries <byte_offset, line, column> and is | |
| 209 * guaranteed to be ordered by the byte_offset. | |
| 210 */ | |
| 211 struct WasmDisassembly { | |
| 212 using offset_table_entry = std::tuple<uint32_t, int, int>; | |
|
kozy
2016/11/29 23:52:44
Could we replace this tuple with struct as well?
| |
| 213 std::string disassembly; | |
| 214 std::vector<offset_table_entry> offset_table; | |
| 215 }; | |
| 216 | |
| 217 /** | |
| 205 * Compute the disassembly of a wasm function. | 218 * Compute the disassembly of a wasm function. |
| 206 * Returns the disassembly string and a list of <byte_offset, line, column> | |
| 207 * entries, mapping wasm byte offsets to line and column in the disassembly. | |
| 208 * The list is guaranteed to be ordered by the byte_offset. | |
| 209 */ | 219 */ |
| 210 static std::pair<std::string, std::vector<std::tuple<uint32_t, int, int>>> | 220 static WasmDisassembly DisassembleWasmFunction(Isolate* isolate, |
| 211 DisassembleWasmFunction(Isolate* isolate, v8::Local<v8::Object> script, | 221 v8::Local<v8::Object> script, |
| 212 int function_index); | 222 int function_index); |
| 223 | |
| 213 static MaybeLocal<UnboundScript> CompileInspectorScript(Isolate* isolate, | 224 static MaybeLocal<UnboundScript> CompileInspectorScript(Isolate* isolate, |
| 214 Local<String> source); | 225 Local<String> source); |
| 215 }; | 226 }; |
| 216 | 227 |
| 217 } // namespace v8 | 228 } // namespace v8 |
| 218 | 229 |
| 219 #endif // V8_DEBUG_DEBUG_INTERFACE_H_ | 230 #endif // V8_DEBUG_DEBUG_INTERFACE_H_ |
| OLD | NEW |