1 //===-- PythonExceptionState.h ----------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_PYTHONEXCEPTIONSTATE_H
11 #define LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_PYTHONEXCEPTIONSTATE_H
13 #ifndef LLDB_DISABLE_PYTHON
15 #include "PythonDataObjects.h"
17 namespace lldb_private {
19 class PythonExceptionState {
21 explicit PythonExceptionState(bool restore_on_exit);
22 ~PythonExceptionState();
24 void Acquire(bool restore_on_exit);
32 static bool HasErrorOccurred();
36 PythonObject GetType() const;
38 PythonObject GetValue() const;
40 PythonObject GetTraceback() const;
42 std::string Format() const;
45 std::string ReadBacktrace() const;
47 bool m_restore_on_exit;
51 PythonObject m_traceback;