forked from jupyter-xeus/xeus-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxdebugger.hpp
More file actions
89 lines (70 loc) · 3.03 KB
/
Copy pathxdebugger.hpp
File metadata and controls
89 lines (70 loc) · 3.03 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
80
81
82
83
84
85
86
87
88
89
/***************************************************************************
* Copyright (c) 2018, Martin Renou, Johan Mabille, Sylvain Corlay, and *
* Wolf Vollprecht *
* Copyright (c) 2018, QuantStack *
* *
* Distributed under the terms of the BSD 3-Clause License. *
* *
* The full license is in the file LICENSE, distributed with this software. *
****************************************************************************/
#ifndef XPYT_DEBUGGER_HPP
#define XPYT_DEBUGGER_HPP
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wattributes"
#endif
#include <map>
#include <memory>
#include <mutex>
#include <set>
#include "nlohmann/json.hpp"
#include "pybind11/pybind11.h"
#include "xeus-zmq/xdebugger_base.hpp"
#include "xeus-zmq/xthread.hpp"
#include "xeus_python_config.hpp"
namespace py = pybind11;
namespace xpyt
{
class xdebugpy_client;
class XEUS_PYTHON_API debugger : public xeus::xdebugger_base
{
public:
using base_type = xeus::xdebugger_base;
debugger(xeus::xcontext& context,
const xeus::xconfiguration& config,
const std::string& user_name,
const std::string& session_id,
const nl::json& debugger_config);
virtual ~debugger();
private:
nl::json inspect_variables_request(const nl::json& message);
nl::json rich_inspect_variables_request(const nl::json& message);
nl::json attach_request(const nl::json& message);
nl::json configuration_done_request(const nl::json& message);
nl::json copy_to_globals_request(const nl::json& message);
nl::json modules(const nl::json& message);
nl::json variables_request_impl(const nl::json& message) override;
bool start_debugpy();
bool start() override;
void stop() override;
xeus::xdebugger_info get_debugger_info() const override;
std::string get_cell_temporary_file(const std::string& code) const override;
std::unique_ptr<xdebugpy_client> p_debugpy_client;
std::string m_debugpy_host;
std::string m_debugpy_port;
nl::json m_debugger_config;
py::object m_pydebugger;
xeus::xthread m_client_runner;
bool m_copy_to_globals_available;
};
XEUS_PYTHON_API
std::unique_ptr<xeus::xdebugger> make_python_debugger(xeus::xcontext& context,
const xeus::xconfiguration& config,
const std::string& user_name,
const std::string& session_id,
const nl::json& debugger_config);
}
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
#endif