libTriton version 1.0 build 1590
Loading...
Searching...
No Matches
exceptions.hpp
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#ifndef TRITON_EXCEPTIONS_H
9#define TRITON_EXCEPTIONS_H
10
11#include <exception>
12#include <string>
13
14#include <triton/dllexport.hpp>
16
17
18
20namespace triton {
27 namespace exceptions {
36 class Exception : public std::exception {
37 protected:
39 std::string message;
40
41 public:
43 TRITON_EXPORT Exception(const char* message) {
44 this->message = std::string(message);
45 };
46
48 TRITON_EXPORT Exception(const std::string& message) {
49 this->message = message;
50 };
51
53 TRITON_EXPORT virtual ~Exception() throw() {
54 };
55
57 TRITON_EXPORT const char* what() const throw () {
58 return this->message.c_str();
59 };
60 };
61
62
66 public:
68 TRITON_EXPORT Engines(const char* message) : triton::exceptions::Exception(message) {};
69
71 TRITON_EXPORT Engines(const std::string& message) : triton::exceptions::Exception(message) {};
72 };
73
74
78 public:
80 TRITON_EXPORT SymbolicEngine(const char* message) : triton::exceptions::Engines(message) {};
81
83 TRITON_EXPORT SymbolicEngine(const std::string& message) : triton::exceptions::Engines(message) {};
84 };
85
86
90 public:
92 TRITON_EXPORT SymbolicExpression(const char* message) : triton::exceptions::SymbolicEngine(message) {};
93
95 TRITON_EXPORT SymbolicExpression(const std::string& message) : triton::exceptions::SymbolicEngine(message) {};
96 };
97
98
102 public:
104 TRITON_EXPORT SymbolicSimplification(const char* message) : triton::exceptions::SymbolicEngine(message) {};
105
107 TRITON_EXPORT SymbolicSimplification(const std::string& message) : triton::exceptions::SymbolicEngine(message) {};
108 };
109
110
114 public:
116 TRITON_EXPORT SymbolicVariable(const char* message) : triton::exceptions::SymbolicEngine(message) {};
117
119 TRITON_EXPORT SymbolicVariable(const std::string& message) : triton::exceptions::SymbolicEngine(message) {};
120 };
121
122
126 public:
128 TRITON_EXPORT PathConstraint(const char* message) : triton::exceptions::SymbolicEngine(message) {};
129
131 TRITON_EXPORT PathConstraint(const std::string& message) : triton::exceptions::SymbolicEngine(message) {};
132 };
133
134
138 public:
140 TRITON_EXPORT PathManager(const char* message) : triton::exceptions::SymbolicEngine(message) {};
141
143 TRITON_EXPORT PathManager(const std::string& message) : triton::exceptions::SymbolicEngine(message) {};
144 };
145
146
150 public:
152 TRITON_EXPORT TaintEngine(const char* message) : triton::exceptions::Engines(message) {};
153
155 TRITON_EXPORT TaintEngine(const std::string& message) : triton::exceptions::Engines(message) {};
156 };
157
158
162 public:
164 TRITON_EXPORT SynthesizerEngine(const char* message) : triton::exceptions::Engines(message) {};
165
167 TRITON_EXPORT SynthesizerEngine(const std::string& message) : triton::exceptions::Engines(message) {};
168 };
169
170
174 public:
176 TRITON_EXPORT LiftingEngine(const char* message) : triton::exceptions::Engines(message) {};
177
179 TRITON_EXPORT LiftingEngine(const std::string& message) : triton::exceptions::Engines(message) {};
180 };
181
182
186 public:
188 TRITON_EXPORT SolverEngine(const char* message) : triton::exceptions::Engines(message) {};
189
191 TRITON_EXPORT SolverEngine(const std::string& message) : triton::exceptions::Engines(message) {};
192 };
193
194
198 public:
200 TRITON_EXPORT SolverModel(const char* message) : triton::exceptions::SolverEngine(message) {};
201
203 TRITON_EXPORT SolverModel(const std::string& message) : triton::exceptions::SolverEngine(message) {};
204 };
205
206
210 public:
212 TRITON_EXPORT Context(const char* message) : triton::exceptions::Exception(message) {};
213
215 TRITON_EXPORT Context(const std::string& message) : triton::exceptions::Exception(message) {};
216 };
217
218
222 public:
224 TRITON_EXPORT Architecture(const char* message) : triton::exceptions::Exception(message) {};
225
227 TRITON_EXPORT Architecture(const std::string& message) : triton::exceptions::Exception(message) {};
228 };
229
230
234 public:
236 TRITON_EXPORT BitsVector(const char* message) : triton::exceptions::Architecture(message) {};
237
239 TRITON_EXPORT BitsVector(const std::string& message) : triton::exceptions::Architecture(message) {};
240 };
241
242
246 public:
248 TRITON_EXPORT Immediate(const char* message) : triton::exceptions::Architecture(message) {};
249
251 TRITON_EXPORT Immediate(const std::string& message) : triton::exceptions::Architecture(message) {};
252 };
253
254
258 public:
260 TRITON_EXPORT Register(const char* message) : triton::exceptions::Architecture(message) {};
261
263 TRITON_EXPORT Register(const std::string& message) : triton::exceptions::Architecture(message) {};
264 };
265
266
270 public:
272 TRITON_EXPORT MemoryAccess(const char* message) : triton::exceptions::Architecture(message) {};
273
275 TRITON_EXPORT MemoryAccess(const std::string& message) : triton::exceptions::Architecture(message) {};
276 };
277
278
282 public:
284 TRITON_EXPORT OperandWrapper(const char* message) : triton::exceptions::Architecture(message) {};
285
287 TRITON_EXPORT OperandWrapper(const std::string& message) : triton::exceptions::Architecture(message) {};
288 };
289
290
294 public:
296 TRITON_EXPORT Instruction(const char* message) : triton::exceptions::Architecture(message) {};
297
299 TRITON_EXPORT Instruction(const std::string& message) : triton::exceptions::Architecture(message) {};
300 };
301
302
306 public:
308 TRITON_EXPORT BasicBlock(const char* message) : triton::exceptions::Architecture(message) {};
309
311 TRITON_EXPORT BasicBlock(const std::string& message) : triton::exceptions::Architecture(message) {};
312 };
313
314
318 public:
320 TRITON_EXPORT Cpu(const char* message) : triton::exceptions::Architecture(message) {};
321
323 TRITON_EXPORT Cpu(const std::string& message) : triton::exceptions::Architecture(message) {};
324 };
325
326
330 public:
332 TRITON_EXPORT ArmOperandProperties(const char* message) : triton::exceptions::Architecture(message) {};
333
335 TRITON_EXPORT ArmOperandProperties(const std::string& message) : triton::exceptions::Architecture(message) {};
336 };
337
338
342 public:
344 TRITON_EXPORT AArch64OperandProperties(const char* message) : triton::exceptions::Architecture(message) {};
345
347 TRITON_EXPORT AArch64OperandProperties(const std::string& message) : triton::exceptions::Architecture(message) {};
348 };
349
350
354 public:
356 TRITON_EXPORT IrBuilder(const char* message) : triton::exceptions::Architecture(message) {};
357
359 TRITON_EXPORT IrBuilder(const std::string& message) : triton::exceptions::Architecture(message) {};
360 };
361
362
366 public:
368 TRITON_EXPORT Disassembly(const char* message) : triton::exceptions::Cpu(message) {};
369
371 TRITON_EXPORT Disassembly(const std::string& message) : triton::exceptions::Cpu(message) {};
372 };
373
374
378 public:
380 TRITON_EXPORT Semantics(const char* message) : triton::exceptions::Cpu(message) {};
381
383 TRITON_EXPORT Semantics(const std::string& message) : triton::exceptions::Cpu(message) {};
384 };
385
386
390 public:
392 TRITON_EXPORT Ast(const char* message) : triton::exceptions::Exception(message) {};
393
395 TRITON_EXPORT Ast(const std::string& message) : triton::exceptions::Exception(message) {};
396 };
397
398
402 public:
404 TRITON_EXPORT AstRepresentation(const char* message) : triton::exceptions::Ast(message) {};
405
407 TRITON_EXPORT AstRepresentation(const std::string& message) : triton::exceptions::Ast(message) {};
408 };
409
410
414 public:
416 TRITON_EXPORT AstLifting(const char* message) : triton::exceptions::Ast(message) {};
417
419 TRITON_EXPORT AstLifting(const std::string& message) : triton::exceptions::Ast(message) {};
420 };
421
422
426 public:
428 TRITON_EXPORT Bindings(const char* message) : triton::exceptions::Exception(message) {};
429
431 TRITON_EXPORT Bindings(const std::string& message) : triton::exceptions::Exception(message) {};
432 };
433
434
438 public:
440 TRITON_EXPORT Callbacks(const char* message) : triton::exceptions::Exception(message) {};
441
443 TRITON_EXPORT Callbacks(const std::string& message) : triton::exceptions::Exception(message) {};
444 };
445
449 public:
451 TRITON_EXPORT PyCallbacks() : triton::exceptions::Exception("exception info is stored in python state") {};
452 };
453
455 };
457};
458
459#endif /* TRITON_EXCEPTIONS_HPP */
The exception class used by shift mode.
TRITON_EXPORT AArch64OperandProperties(const char *message)
Constructor.
TRITON_EXPORT AArch64OperandProperties(const std::string &message)
Constructor.
The exception class used by architectures.
TRITON_EXPORT Architecture(const char *message)
Constructor.
TRITON_EXPORT Architecture(const std::string &message)
Constructor.
The exception class used by shift mode.
TRITON_EXPORT ArmOperandProperties(const char *message)
Constructor.
TRITON_EXPORT ArmOperandProperties(const std::string &message)
Constructor.
The exception class used by all AST lifting (e.g z3 <-> triton).
TRITON_EXPORT AstLifting(const std::string &message)
Constructor.
TRITON_EXPORT AstLifting(const char *message)
Constructor.
The exception class used by all AST node representations.
TRITON_EXPORT AstRepresentation(const std::string &message)
Constructor.
TRITON_EXPORT AstRepresentation(const char *message)
Constructor.
The exception class used by all AST nodes.
TRITON_EXPORT Ast(const std::string &message)
Constructor.
TRITON_EXPORT Ast(const char *message)
Constructor.
The exception class used by a basic block.
TRITON_EXPORT BasicBlock(const std::string &message)
Constructor.
TRITON_EXPORT BasicBlock(const char *message)
Constructor.
The exception class used by bindings.
TRITON_EXPORT Bindings(const char *message)
Constructor.
TRITON_EXPORT Bindings(const std::string &message)
Constructor.
The exception class used by bitvectors.
TRITON_EXPORT BitsVector(const std::string &message)
Constructor.
TRITON_EXPORT BitsVector(const char *message)
Constructor.
The exception class used by callbacks.
TRITON_EXPORT Callbacks(const char *message)
Constructor.
TRITON_EXPORT Callbacks(const std::string &message)
Constructor.
The exception class used by the Triton's Context.
TRITON_EXPORT Context(const char *message)
Constructor.
TRITON_EXPORT Context(const std::string &message)
Constructor.
The exception class used by all CPUs.
TRITON_EXPORT Cpu(const std::string &message)
Constructor.
TRITON_EXPORT Cpu(const char *message)
Constructor.
The exception class used by the disassembler.
TRITON_EXPORT Disassembly(const std::string &message)
Constructor.
TRITON_EXPORT Disassembly(const char *message)
Constructor.
The exception class used by all engines.
TRITON_EXPORT Engines(const char *message)
Constructor.
TRITON_EXPORT Engines(const std::string &message)
Constructor.
The root class of all exceptions.
virtual TRITON_EXPORT ~Exception()
Destructor.
TRITON_EXPORT Exception(const std::string &message)
Constructor.
TRITON_EXPORT const char * what() const
Returns the exception message.
TRITON_EXPORT Exception(const char *message)
Constructor.
std::string message
Defines the exception message.
The exception class used by immediates.
TRITON_EXPORT Immediate(const std::string &message)
Constructor.
TRITON_EXPORT Immediate(const char *message)
Constructor.
The exception class used by an instruction.
TRITON_EXPORT Instruction(const char *message)
Constructor.
TRITON_EXPORT Instruction(const std::string &message)
Constructor.
The exception class used by the IR builder.
TRITON_EXPORT IrBuilder(const char *message)
Constructor.
TRITON_EXPORT IrBuilder(const std::string &message)
Constructor.
The exception class used by the lifting engine.
TRITON_EXPORT LiftingEngine(const char *message)
Constructor.
TRITON_EXPORT LiftingEngine(const std::string &message)
Constructor.
The exception class used by memory access.
TRITON_EXPORT MemoryAccess(const std::string &message)
Constructor.
TRITON_EXPORT MemoryAccess(const char *message)
Constructor.
The exception class used by operand wrappers.
TRITON_EXPORT OperandWrapper(const char *message)
Constructor.
TRITON_EXPORT OperandWrapper(const std::string &message)
Constructor.
The exception class used by path constraints.
TRITON_EXPORT PathConstraint(const std::string &message)
Constructor.
TRITON_EXPORT PathConstraint(const char *message)
Constructor.
The exception class used by the path manager.
TRITON_EXPORT PathManager(const char *message)
Constructor.
TRITON_EXPORT PathManager(const std::string &message)
Constructor.
TRITON_EXPORT PyCallbacks()
Constructor.
The exception class used by register operands.
TRITON_EXPORT Register(const std::string &message)
Constructor.
TRITON_EXPORT Register(const char *message)
Constructor.
The exception class used by all semantics.
TRITON_EXPORT Semantics(const char *message)
Constructor.
TRITON_EXPORT Semantics(const std::string &message)
Constructor.
The exception class used by the solver engine.
TRITON_EXPORT SolverEngine(const std::string &message)
Constructor.
TRITON_EXPORT SolverEngine(const char *message)
Constructor.
The exception class used by solver models.
TRITON_EXPORT SolverModel(const char *message)
Constructor.
TRITON_EXPORT SolverModel(const std::string &message)
Constructor.
The exception class used by the symbolic engine.
TRITON_EXPORT SymbolicEngine(const char *message)
Constructor.
TRITON_EXPORT SymbolicEngine(const std::string &message)
Constructor.
The exception class used by symbolic expressions.
TRITON_EXPORT SymbolicExpression(const std::string &message)
Constructor.
TRITON_EXPORT SymbolicExpression(const char *message)
Constructor.
The exception class used by symbolic simplifications.
TRITON_EXPORT SymbolicSimplification(const char *message)
Constructor.
TRITON_EXPORT SymbolicSimplification(const std::string &message)
Constructor.
The exception class used by symbolic variables.
TRITON_EXPORT SymbolicVariable(const char *message)
Constructor.
TRITON_EXPORT SymbolicVariable(const std::string &message)
Constructor.
The exception class used by the synthesizer engine.
TRITON_EXPORT SynthesizerEngine(const char *message)
Constructor.
TRITON_EXPORT SynthesizerEngine(const std::string &message)
Constructor.
The exception class used by the taint engine.
TRITON_EXPORT TaintEngine(const char *message)
Constructor.
TRITON_EXPORT TaintEngine(const std::string &message)
Constructor.
The Triton namespace.