libTriton version 1.0 build 1592
Loading...
Searching...
No Matches
modes.cpp
Go to the documentation of this file.
1
2/*
3** Copyright (C) - Triton
4**
5** This program is under the terms of the Apache License 2.0.
6*/
7
8#include <iostream>
9#include <triton/modes.hpp>
10
11
12
13namespace triton {
14 namespace modes {
15
17 this->setMode(triton::modes::PC_TRACKING_SYMBOLIC, true); /* This mode is enabled by default */
18 }
19
20
21 Modes::Modes(const Modes& other) {
22 this->copy(other);
23 }
24
25
26 Modes& Modes::operator=(const Modes& other) {
27 this->copy(other);
28 return *this;
29 }
30
31
32 void Modes::copy(const Modes& other) {
33 this->enabledModes = other.enabledModes;
34 }
35
36
38 if (this->enabledModes.find(mode) != this->enabledModes.end())
39 return true;
40 return false;
41 }
42
43
44 void Modes::setMode(triton::modes::mode_e mode, bool flag) {
45 if (flag == true)
46 this->enabledModes.insert(mode);
47 else
48 this->enabledModes.erase(mode);
49 }
50
51
52 void Modes::clearModes(void) {
53 this->enabledModes.clear();
54 }
55
56 }; /* modes namespace */
57}; /*triton namespace */
The modes class.
Definition modes.hpp:36
std::unordered_set< triton::modes::mode_e > enabledModes
The set of enabled modes.
Definition modes.hpp:43
TRITON_EXPORT void clearModes(void)
Clears recorded modes.
Definition modes.cpp:52
TRITON_EXPORT Modes()
Constructor.
Definition modes.cpp:16
TRITON_EXPORT void setMode(triton::modes::mode_e mode, bool flag)
Enables or disables a specific mode.
Definition modes.cpp:44
TRITON_EXPORT bool isModeEnabled(triton::modes::mode_e mode) const
Returns true if the mode is enabled.
Definition modes.cpp:37
TRITON_EXPORT Modes & operator=(const Modes &other)
Copies a Modes.
Definition modes.cpp:26
mode_e
Enumerates all kinds of mode.
@ PC_TRACKING_SYMBOLIC
[symbolic] Track path constraints only if they are symbolized.
The Triton namespace.