Skip to content

Commit 290becd

Browse files
author
kr-2003
committed
added variable inspection
1 parent eda00f8 commit 290becd

File tree

5 files changed

+392
-135
lines changed

5 files changed

+392
-135
lines changed

include/xeus-cpp/xdebugger.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,12 @@ namespace xcpp
5353
nl::json dump_cell_request(const nl::json& message);
5454
nl::json rich_inspect_variables_request(const nl::json& message);
5555
nl::json copy_to_globals_request(const nl::json& message);
56+
nl::json source_request(const nl::json& message);
5657

57-
nl::json variables_request_impl(const nl::json& message) override;
58+
bool get_variable_info_from_lldb(const std::string& var_name, int frame_id, nl::json& data, nl::json& metadata, int sequence);
59+
void get_container_info(const std::string& var_name, int frame_id,
60+
const std::string& var_type, nl::json& data, nl::json& metadata, int sequence, int size);
61+
bool is_container_type(const std::string& type) const;
5862

5963
bool start_lldb();
6064
bool start() override;

include/xeus-cpp/xinterpreter.hpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
#include "xbuffer.hpp"
2626
#include "xeus_cpp_config.hpp"
2727
#include "xmanager.hpp"
28+
#include <thread>
29+
2830

2931
namespace nl = nlohmann;
3032

@@ -52,6 +54,16 @@ namespace xcpp
5254
return {};
5355
}
5456

57+
std::string get_code_from_execution_count(int execution_count) const
58+
{
59+
auto it = m_execution_count_to_code_map.find(execution_count);
60+
if(it != m_execution_count_to_code_map.end())
61+
{
62+
return it->second;
63+
}
64+
return "";
65+
}
66+
5567
private:
5668

5769
void configure_impl() override;
@@ -99,6 +111,7 @@ namespace xcpp
99111
xoutput_buffer m_cerr_buffer;
100112

101113
std::map<std::string, std::vector<int>> m_code_to_execution_count_map;
114+
std::map<int, std::string> m_execution_count_to_code_map;
102115
};
103116
}
104117

src/main.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include <xeus/xkernel_configuration.hpp>
2626
#include "xeus-zmq/xzmq_context.hpp"
2727
#include <xeus-zmq/xserver_zmq.hpp>
28+
#include "xeus-zmq/xserver_zmq_split.hpp"
2829
#include "xeus-cpp/xeus_cpp_config.hpp"
2930
#include "xeus-cpp/xinterpreter.hpp"
3031
#include "xeus-cpp/xutils.hpp"
@@ -80,7 +81,7 @@ int main(int argc, char* argv[])
8081
xeus::get_user_name(),
8182
std::move(context),
8283
std::move(interpreter),
83-
xeus::make_xserver_default,
84+
xeus::make_xserver_control_main,
8485
xeus::make_in_memory_history_manager(),
8586
xeus::make_console_logger(
8687
xeus::xlogger::msg_type,
@@ -103,7 +104,7 @@ int main(int argc, char* argv[])
103104
xeus::get_user_name(),
104105
std::move(context),
105106
std::move(interpreter),
106-
xeus::make_xserver_default,
107+
xeus::make_xserver_control_main,
107108
xeus::make_in_memory_history_manager(),
108109
xeus::make_console_logger(
109110
xeus::xlogger::msg_type,

0 commit comments

Comments
 (0)