Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion include/xeus-python/xdebugger.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@
#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;
Expand Down Expand Up @@ -62,11 +64,12 @@ namespace xpyt
xeus::xdebugger_info get_debugger_info() const override;
std::string get_cell_temporary_file(const std::string& code) const override;

xdebugpy_client* p_debugpy_client;
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;
};

Expand Down
7 changes: 2 additions & 5 deletions src/xdebugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ namespace xpyt

debugger::~debugger()
{
delete p_debugpy_client;
p_debugpy_client = nullptr;
}

nl::json debugger::inspect_variables_request(const nl::json& message)
Expand Down Expand Up @@ -325,13 +323,12 @@ namespace xpyt
bind_sockets(controller_header_end_point, controller_end_point);

std::string debugpy_end_point = "tcp://" + m_debugpy_host + ':' + m_debugpy_port;
std::thread client(&xdap_tcp_client::start_debugger,
p_debugpy_client,
m_client_runner = xeus::xthread(&xdap_tcp_client::start_debugger,
p_debugpy_client.get(),
debugpy_end_point,
publisher_end_point,
controller_end_point,
controller_header_end_point);
client.detach();

send_recv_request("REQ");

Expand Down
Loading