OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2017 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_OBJECTS_DEBUG_INFO_H_ | |
6 #define V8_OBJECTS_DEBUG_INFO_H_ | |
7 | |
8 #include "src/objects.h" | |
9 | |
10 // Has to be the last include (doesn't have include guards): | |
11 #include "src/objects/object-macros.h" | |
12 | |
13 namespace v8 { | |
14 namespace internal { | |
15 | |
16 // The DebugInfo class holds additional information for a function being | |
17 // debugged. | |
18 class DebugInfo : public Struct { | |
19 public: | |
20 // The shared function info for the source being debugged. | |
21 DECL_ACCESSORS(shared, SharedFunctionInfo) | |
22 | |
23 // Bit field containing various information collected for debugging. | |
24 DECL_INT_ACCESSORS(debugger_hints) | |
25 | |
26 DECL_ACCESSORS(debug_bytecode_array, Object) | |
27 // Fixed array holding status information for each active break point. | |
28 DECL_ACCESSORS(break_points, FixedArray) | |
29 | |
30 // Check if there is a break point at a source position. | |
31 bool HasBreakPoint(int source_position); | |
32 // Attempt to clear a break point. Return true if successful. | |
33 static bool ClearBreakPoint(Handle<DebugInfo> debug_info, | |
34 Handle<Object> break_point_object); | |
35 // Set a break point. | |
36 static void SetBreakPoint(Handle<DebugInfo> debug_info, int source_position, | |
37 Handle<Object> break_point_object); | |
38 // Get the break point objects for a source position. | |
39 Handle<Object> GetBreakPointObjects(int source_position); | |
40 // Find the break point info holding this break point object. | |
41 static Handle<Object> FindBreakPointInfo(Handle<DebugInfo> debug_info, | |
42 Handle<Object> break_point_object); | |
43 // Get the number of break points for this function. | |
44 int GetBreakPointCount(); | |
45 | |
46 inline bool HasDebugBytecodeArray(); | |
47 inline bool HasDebugCode(); | |
48 | |
49 inline BytecodeArray* OriginalBytecodeArray(); | |
50 inline BytecodeArray* DebugBytecodeArray(); | |
51 inline Code* DebugCode(); | |
52 | |
53 DECLARE_CAST(DebugInfo) | |
54 | |
55 // Dispatched behavior. | |
56 DECLARE_PRINTER(DebugInfo) | |
57 DECLARE_VERIFIER(DebugInfo) | |
58 | |
59 static const int kSharedFunctionInfoIndex = Struct::kHeaderSize; | |
60 static const int kDebuggerHintsIndex = | |
61 kSharedFunctionInfoIndex + kPointerSize; | |
62 static const int kDebugBytecodeArrayIndex = | |
63 kDebuggerHintsIndex + kPointerSize; | |
64 static const int kBreakPointsStateIndex = | |
65 kDebugBytecodeArrayIndex + kPointerSize; | |
66 static const int kSize = kBreakPointsStateIndex + kPointerSize; | |
67 | |
68 static const int kEstimatedNofBreakPointsInFunction = 4; | |
69 | |
70 private: | |
71 // Get the break point info object for a source position. | |
72 Object* GetBreakPointInfo(int source_position); | |
73 | |
74 DISALLOW_IMPLICIT_CONSTRUCTORS(DebugInfo); | |
75 }; | |
76 | |
77 #include "src/objects/object-macros-undef.h" | |
marja
2017/05/22 13:37:39
This should be after closing the namespace
jgruber
2017/05/22 13:48:26
Will do.
| |
78 | |
79 } // namespace internal | |
80 } // namespace v8 | |
81 | |
82 #endif // V8_OBJECTS_DEBUG_INFO_H_ | |
OLD | NEW |