blob: 48dc4be6ec5e2dd800b9d91f144a45420f6bd839 [file] [log] [blame]
Ben Murdoch61f157c2016-09-16 13:49:30 +01001// 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
3// found in the LICENSE file.
4
5#ifndef V8_WASM_DEBUG_H_
6#define V8_WASM_DEBUG_H_
7
8#include "src/handles.h"
9#include "src/objects.h"
10
11namespace v8 {
12namespace internal {
13namespace wasm {
14
15class WasmDebugInfo : public FixedArray {
16 public:
17 static Handle<WasmDebugInfo> New(Handle<JSObject> wasm);
18
19 static bool IsDebugInfo(Object* object);
20 static WasmDebugInfo* cast(Object* object);
21
22 JSObject* wasm_object();
23
24 bool SetBreakPoint(int byte_offset);
25
26 // Disassemble the specified function from this module.
27 static Handle<String> DisassembleFunction(Handle<WasmDebugInfo> debug_info,
28 int func_index);
29
30 // Get the offset table for the specified function.
31 // Returns an array with three entries per instruction: byte offset, line and
32 // column.
33 static Handle<FixedArray> GetFunctionOffsetTable(
34 Handle<WasmDebugInfo> debug_info, int func_index);
35};
36
37} // namespace wasm
38} // namespace internal
39} // namespace v8
40
41#endif // V8_WASM_DEBUG_H_