libTriton  version 0.9 build 1502
exceptions.hpp
Go to the documentation of this file.
1 /*
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>
15 #include <triton/tritonTypes.hpp>
16 
17 
18 
20 namespace 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 SolverEngine(const char* message) : triton::exceptions::Engines(message) {};
165 
167  TRITON_EXPORT SolverEngine(const std::string& message) : triton::exceptions::Engines(message) {};
168  };
169 
170 
174  public:
176  TRITON_EXPORT SolverModel(const char* message) : triton::exceptions::SolverEngine(message) {};
177 
179  TRITON_EXPORT SolverModel(const std::string& message) : triton::exceptions::SolverEngine(message) {};
180  };
181 
182 
186  public:
188  TRITON_EXPORT API(const char* message) : triton::exceptions::Exception(message) {};
189 
191  TRITON_EXPORT API(const std::string& message) : triton::exceptions::Exception(message) {};
192  };
193 
194 
198  public:
200  TRITON_EXPORT Architecture(const char* message) : triton::exceptions::Exception(message) {};
201 
203  TRITON_EXPORT Architecture(const std::string& message) : triton::exceptions::Exception(message) {};
204  };
205 
206 
210  public:
212  TRITON_EXPORT BitsVector(const char* message) : triton::exceptions::Architecture(message) {};
213 
215  TRITON_EXPORT BitsVector(const std::string& message) : triton::exceptions::Architecture(message) {};
216  };
217 
218 
222  public:
224  TRITON_EXPORT Immediate(const char* message) : triton::exceptions::Architecture(message) {};
225 
227  TRITON_EXPORT Immediate(const std::string& message) : triton::exceptions::Architecture(message) {};
228  };
229 
230 
234  public:
236  TRITON_EXPORT Register(const char* message) : triton::exceptions::Architecture(message) {};
237 
239  TRITON_EXPORT Register(const std::string& message) : triton::exceptions::Architecture(message) {};
240  };
241 
242 
246  public:
248  TRITON_EXPORT MemoryAccess(const char* message) : triton::exceptions::Architecture(message) {};
249 
251  TRITON_EXPORT MemoryAccess(const std::string& message) : triton::exceptions::Architecture(message) {};
252  };
253 
254 
258  public:
260  TRITON_EXPORT OperandWrapper(const char* message) : triton::exceptions::Architecture(message) {};
261 
263  TRITON_EXPORT OperandWrapper(const std::string& message) : triton::exceptions::Architecture(message) {};
264  };
265 
266 
270  public:
272  TRITON_EXPORT Instruction(const char* message) : triton::exceptions::Architecture(message) {};
273 
275  TRITON_EXPORT Instruction(const std::string& message) : triton::exceptions::Architecture(message) {};
276  };
277 
278 
282  public:
284  TRITON_EXPORT Cpu(const char* message) : triton::exceptions::Architecture(message) {};
285 
287  TRITON_EXPORT Cpu(const std::string& message) : triton::exceptions::Architecture(message) {};
288  };
289 
290 
294  public:
296  TRITON_EXPORT ArmOperandProperties(const char* message) : triton::exceptions::Architecture(message) {};
297 
299  TRITON_EXPORT ArmOperandProperties(const std::string& message) : triton::exceptions::Architecture(message) {};
300  };
301 
302 
306  public:
308  TRITON_EXPORT AArch64OperandProperties(const char* message) : triton::exceptions::Architecture(message) {};
309 
311  TRITON_EXPORT AArch64OperandProperties(const std::string& message) : triton::exceptions::Architecture(message) {};
312  };
313 
314 
318  public:
320  TRITON_EXPORT IrBuilder(const char* message) : triton::exceptions::Architecture(message) {};
321 
323  TRITON_EXPORT IrBuilder(const std::string& message) : triton::exceptions::Architecture(message) {};
324  };
325 
326 
330  public:
332  TRITON_EXPORT Disassembly(const char* message) : triton::exceptions::Cpu(message) {};
333 
335  TRITON_EXPORT Disassembly(const std::string& message) : triton::exceptions::Cpu(message) {};
336  };
337 
338 
342  public:
344  TRITON_EXPORT Semantics(const char* message) : triton::exceptions::Cpu(message) {};
345 
347  TRITON_EXPORT Semantics(const std::string& message) : triton::exceptions::Cpu(message) {};
348  };
349 
350 
354  public:
356  TRITON_EXPORT Ast(const char* message) : triton::exceptions::Exception(message) {};
357 
359  TRITON_EXPORT Ast(const std::string& message) : triton::exceptions::Exception(message) {};
360  };
361 
362 
366  public:
368  TRITON_EXPORT AstRepresentation(const char* message) : triton::exceptions::Ast(message) {};
369 
371  TRITON_EXPORT AstRepresentation(const std::string& message) : triton::exceptions::Ast(message) {};
372  };
373 
374 
378  public:
380  TRITON_EXPORT AstTranslations(const char* message) : triton::exceptions::Ast(message) {};
381 
383  TRITON_EXPORT AstTranslations(const std::string& message) : triton::exceptions::Ast(message) {};
384  };
385 
386 
390  public:
392  TRITON_EXPORT Bindings(const char* message) : triton::exceptions::Exception(message) {};
393 
395  TRITON_EXPORT Bindings(const std::string& message) : triton::exceptions::Exception(message) {};
396  };
397 
398 
402  public:
404  TRITON_EXPORT Callbacks(const char* message) : triton::exceptions::Exception(message) {};
405 
407  TRITON_EXPORT Callbacks(const std::string& message) : triton::exceptions::Exception(message) {};
408  };
409 
413  public:
415  TRITON_EXPORT PyCallbacks() : triton::exceptions::Exception("exception info is stored in python state") {};
416  };
417 
419  };
421 };
422 
423 #endif /* TRITON_EXCEPTIONS_HPP */
The exception class used by shift mode.
Definition: exceptions.hpp:305
TRITON_EXPORT AArch64OperandProperties(const char *message)
Constructor.
Definition: exceptions.hpp:308
The exception class used by the Triton's API.
Definition: exceptions.hpp:185
TRITON_EXPORT API(const char *message)
Constructor.
Definition: exceptions.hpp:188
The exception class used by architectures.
Definition: exceptions.hpp:197
TRITON_EXPORT Architecture(const char *message)
Constructor.
Definition: exceptions.hpp:200
The exception class used by shift mode.
Definition: exceptions.hpp:293
TRITON_EXPORT ArmOperandProperties(const char *message)
Constructor.
Definition: exceptions.hpp:296
The exception class used by all AST node representations.
Definition: exceptions.hpp:365
TRITON_EXPORT AstRepresentation(const char *message)
Constructor.
Definition: exceptions.hpp:368
The exception class used by all AST translations (z3 <-> triton).
Definition: exceptions.hpp:377
TRITON_EXPORT AstTranslations(const char *message)
Constructor.
Definition: exceptions.hpp:380
The exception class used by all AST nodes.
Definition: exceptions.hpp:353
TRITON_EXPORT Ast(const char *message)
Constructor.
Definition: exceptions.hpp:356
The exception class used by bindings.
Definition: exceptions.hpp:389
TRITON_EXPORT Bindings(const char *message)
Constructor.
Definition: exceptions.hpp:392
The exception class used by bitvectors.
Definition: exceptions.hpp:209
TRITON_EXPORT BitsVector(const char *message)
Constructor.
Definition: exceptions.hpp:212
The exception class used by callbacks.
Definition: exceptions.hpp:401
TRITON_EXPORT Callbacks(const char *message)
Constructor.
Definition: exceptions.hpp:404
The exception class used by all CPUs.
Definition: exceptions.hpp:281
TRITON_EXPORT Cpu(const char *message)
Constructor.
Definition: exceptions.hpp:284
The exception class used by the disassembler.
Definition: exceptions.hpp:329
TRITON_EXPORT Disassembly(const char *message)
Constructor.
Definition: exceptions.hpp:332
The exception class used by all engines.
Definition: exceptions.hpp:65
TRITON_EXPORT Engines(const char *message)
Constructor.
Definition: exceptions.hpp:68
The root class of all exceptions.
Definition: exceptions.hpp:36
virtual TRITON_EXPORT ~Exception()
Destructor.
Definition: exceptions.hpp:53
TRITON_EXPORT Exception(const char *message)
Constructor.
Definition: exceptions.hpp:43
TRITON_EXPORT const char * what() const
Returns the exception message.
Definition: exceptions.hpp:57
std::string message
Defines the exception message.
Definition: exceptions.hpp:39
The exception class used by immediates.
Definition: exceptions.hpp:221
TRITON_EXPORT Immediate(const char *message)
Constructor.
Definition: exceptions.hpp:224
The exception class used by an instruction.
Definition: exceptions.hpp:269
TRITON_EXPORT Instruction(const char *message)
Constructor.
Definition: exceptions.hpp:272
The exception class used by the IR builder.
Definition: exceptions.hpp:317
TRITON_EXPORT IrBuilder(const char *message)
Constructor.
Definition: exceptions.hpp:320
The exception class used by memory access.
Definition: exceptions.hpp:245
TRITON_EXPORT MemoryAccess(const char *message)
Constructor.
Definition: exceptions.hpp:248
The exception class used by operand wrappers.
Definition: exceptions.hpp:257
TRITON_EXPORT OperandWrapper(const char *message)
Constructor.
Definition: exceptions.hpp:260
The exception class used by path constraints.
Definition: exceptions.hpp:125
TRITON_EXPORT PathConstraint(const char *message)
Constructor.
Definition: exceptions.hpp:128
The exception class used by the path manager.
Definition: exceptions.hpp:137
TRITON_EXPORT PathManager(const char *message)
Constructor.
Definition: exceptions.hpp:140
TRITON_EXPORT PyCallbacks()
Constructor.
Definition: exceptions.hpp:415
The exception class used by register operands.
Definition: exceptions.hpp:233
TRITON_EXPORT Register(const char *message)
Constructor.
Definition: exceptions.hpp:236
The exception class used by all semantics.
Definition: exceptions.hpp:341
TRITON_EXPORT Semantics(const char *message)
Constructor.
Definition: exceptions.hpp:344
The exception class used by the solver engine.
Definition: exceptions.hpp:161
TRITON_EXPORT SolverEngine(const char *message)
Constructor.
Definition: exceptions.hpp:164
The exception class used by solver models.
Definition: exceptions.hpp:173
TRITON_EXPORT SolverModel(const char *message)
Constructor.
Definition: exceptions.hpp:176
The exception class used by the symbolic engine.
Definition: exceptions.hpp:77
TRITON_EXPORT SymbolicEngine(const char *message)
Constructor.
Definition: exceptions.hpp:80
The exception class used by symbolic expressions.
Definition: exceptions.hpp:89
TRITON_EXPORT SymbolicExpression(const char *message)
Constructor.
Definition: exceptions.hpp:92
The exception class used by symbolic simplifications.
Definition: exceptions.hpp:101
TRITON_EXPORT SymbolicSimplification(const char *message)
Constructor.
Definition: exceptions.hpp:104
The exception class used by symbolic variables.
Definition: exceptions.hpp:113
TRITON_EXPORT SymbolicVariable(const char *message)
Constructor.
Definition: exceptions.hpp:116
The exception class used by the taint engine.
Definition: exceptions.hpp:149
TRITON_EXPORT TaintEngine(const char *message)
Constructor.
Definition: exceptions.hpp:152
The Triton namespace.
Definition: api.cpp:227