forked from chakra-core/ChakraCore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDebuggingFlags.cpp
More file actions
79 lines (67 loc) · 2.4 KB
/
DebuggingFlags.cpp
File metadata and controls
79 lines (67 loc) · 2.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
#include "RuntimeDebugPch.h"
#ifdef ENABLE_SCRIPT_DEBUGGING
//static
DebuggingFlags::DebuggingFlags() :
m_forceInterpreter(false),
m_isIgnoringException(false),
m_byteCodeOffsetAfterIgnoreException(InvalidByteCodeOffset),
m_funcNumberAfterIgnoreException(InvalidFuncNumber),
m_isBuiltInWrapperPresent(false)
{
// In Lowerer::LowerBailForDebugger we rely on the following:
CompileAssert(offsetof(DebuggingFlags, m_isIgnoringException) == offsetof(DebuggingFlags, m_forceInterpreter) + 1);
}
bool DebuggingFlags::GetForceInterpreter() const
{
return this->m_forceInterpreter;
}
void DebuggingFlags::SetForceInterpreter(bool value)
{
this->m_forceInterpreter = value;
}
//static
size_t DebuggingFlags::GetForceInterpreterOffset()
{
return offsetof(DebuggingFlags, m_forceInterpreter);
}
int DebuggingFlags::GetByteCodeOffsetAfterIgnoreException() const
{
return this->m_byteCodeOffsetAfterIgnoreException;
}
uint DebuggingFlags::GetFuncNumberAfterIgnoreException() const
{
return this->m_funcNumberAfterIgnoreException;
}
void DebuggingFlags::SetByteCodeOffsetAfterIgnoreException(int offset)
{
this->m_byteCodeOffsetAfterIgnoreException = offset;
this->m_isIgnoringException = offset != InvalidByteCodeOffset;
}
void DebuggingFlags::SetByteCodeOffsetAndFuncAfterIgnoreException(int offset, uint functionNumber)
{
this->SetByteCodeOffsetAfterIgnoreException(offset);
this->m_funcNumberAfterIgnoreException = functionNumber;
}
void DebuggingFlags::ResetByteCodeOffsetAndFuncAfterIgnoreException()
{
this->SetByteCodeOffsetAfterIgnoreException(InvalidByteCodeOffset);
this->m_funcNumberAfterIgnoreException = InvalidFuncNumber;
}
/* static */
size_t DebuggingFlags::GetByteCodeOffsetAfterIgnoreExceptionOffset()
{
return offsetof(DebuggingFlags, m_byteCodeOffsetAfterIgnoreException);
}
bool DebuggingFlags::IsBuiltInWrapperPresent() const
{
return m_isBuiltInWrapperPresent;
}
void DebuggingFlags::SetIsBuiltInWrapperPresent(bool value /* = true */)
{
m_isBuiltInWrapperPresent = value;
}
#endif