-
Notifications
You must be signed in to change notification settings - Fork 37
[wip] Implementing debugger in xeus-cpp #354
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
There were too many comments to post at once. Showing the first 10 out of 122. Check the log or trigger a new build to see more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
There were too many comments to post at once. Showing the first 10 out of 103. Check the log or trigger a new build to see more.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #354 +/- ##
==========================================
- Coverage 81.78% 77.15% -4.64%
==========================================
Files 20 20
Lines 950 1011 +61
Branches 87 94 +7
==========================================
+ Hits 777 780 +3
- Misses 173 231 +58
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
There were too many comments to post at once. Showing the first 10 out of 93. Check the log or trigger a new build to see more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have put some comments. We can discuss this in detail during the meeting today.
CMakeLists.txt
Outdated
if(XEUS_CPP_USE_DEBUGGER) | ||
add_definitions( | ||
-DXEUS_CPP_USE_DEBUGGER | ||
) | ||
endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is a good idea. I need to know the purpose.
include/xeus-cpp/xdebugger.hpp
Outdated
std::string m_lldb_port; | ||
std::string m_lldbdap_port; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the difference between m_lldb_port
& m_lldbdap_port
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like m_lldbdap_port
is unused?
src/main.cpp
Outdated
#ifdef XEUS_CPP_USE_DEBUGGER | ||
nl::json debugger_config; | ||
debugger_config["lldb"]["initCommands"] = { | ||
"settings set plugin.jit-loader.gdb.enable on" | ||
}; | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not look correct. The use of ifdef
. Let's discuss it in the meeting.
We need to do this based on the metadata of the kernel.json
.
int fd = open(log_file.c_str(), O_WRONLY | O_CREAT | O_TRUNC, 0644); | ||
if (fd != -1) | ||
{ | ||
dup2(fd, STDOUT_FILENO); | ||
dup2(fd, STDERR_FILENO); | ||
close(fd); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need some explanation here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code is used to run lldb-dap and redirect its output to a file. might be useful for debugging
src/xdebugger.cpp
Outdated
<< std::endl; | ||
nl::json reply = { | ||
{"type", "response"}, | ||
{"request_seq", message["seq"]}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is request_seq
and message["seq"]
?
src/xdebugger.cpp
Outdated
{{"variables", | ||
{{{"name", "a"}, {"value", "100"}, {"type", "int"}, {"evaluateName", "a"}, {"variablesReference", 0}}, | ||
{{"name", "b"}, | ||
{"value", "1000"}, | ||
{"type", "int"}, | ||
{"evaluateName", "b"}, | ||
{"variablesReference", 0}}}}}} | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that this is not yet implemented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, its the major feature to discuss and work upon
src/xdebugger.cpp
Outdated
std::string debugger::get_cell_temporary_file(const std::string& code) const | ||
{ | ||
// Placeholder: Return a dummy temporary file path | ||
std::string tmp_file = get_tmp_prefix() + "/cell_tmp.cpp"; | ||
std::ofstream out(tmp_file); | ||
out << code; | ||
out.close(); | ||
return tmp_file; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hopefully, we don't need this.
src/xinternal_utils.cpp
Outdated
std::string highlight(const std::string& code) | ||
{ | ||
// Placeholder: No syntax highlighting implemented | ||
// In a real implementation, use a C++ library (e.g., libclang or a custom highlighter) | ||
return code; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How and where do you plan to use this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
highlighting lines when breakpoint hit, step ins and outs
src/xinterpreter.cpp
Outdated
@@ -330,6 +359,112 @@ __get_cxx_version () | |||
restore_output(); | |||
} | |||
|
|||
nl::json interpreter::internal_request_impl(const nl::json& content) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we have this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, i forgot to remove it. i was using previously. no need of this now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
There were too many comments to post at once. Showing the first 10 out of 99. Check the log or trigger a new build to see more.
#include "nlohmann/json.hpp" | ||
#include "xeus-zmq/xdebugger_base.hpp" | ||
#include "xeus_cpp_config.hpp" | ||
#include "xeus-cpp/xinterpreter.hpp" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: #includes are not sorted properly [llvm-include-order]
#include "xeus-cpp/xinterpreter.hpp" | |
#include "xeus-cpp/xinterpreter.hpp" | |
#include "xeus-zmq/xdebugger_base.hpp" | |
#include "xeus_cpp_config.hpp" |
bool start() override; | ||
void stop() override; | ||
xeus::xdebugger_info get_debugger_info() const override; | ||
virtual std::string get_cell_temporary_file(const std::string& code) const override; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 'virtual' is redundant since the function is already declared 'override' [cppcoreguidelines-explicit-virtual-functions]
virtual std::string get_cell_temporary_file(const std::string& code) const override; | |
std::string get_cell_temporary_file(const std::string& code) const override; |
bool m_tcp_connected; | ||
pid_t jit_process_pid; | ||
|
||
using breakpoint_list_t = std::map<std::string, std::vector<nl::json>>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: no header providing "std::vector" is directly included [misc-include-cleaner]
include/xeus-cpp/xdebugger.hpp:12:
- #ifdef __GNUC__
+ #include <vector>
+ #ifdef __GNUC__
|
||
xcpp::interpreter* m_interpreter; | ||
|
||
std::unordered_map<std::string, std::vector<std::string>> m_hash_to_sequential; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: no header providing "std::unordered_map" is directly included [misc-include-cleaner]
include/xeus-cpp/xdebugger.hpp:12:
- #ifdef __GNUC__
+ #include <unordered_map>
+ #ifdef __GNUC__
const std::string& user_name, | ||
const std::string& session_id, | ||
const nl::json& debugger_config); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: namespace 'xcpp' not terminated with a closing comment [llvm-namespace-comment]
} | |
} // namespace xcpp |
Additional context
include/xeus-cpp/xdebugger.hpp:27: namespace 'xcpp' starts here
namespace xcpp
^
@@ -40,6 +40,18 @@ namespace xcpp | |||
void publish_stdout(const std::string&); | |||
void publish_stderr(const std::string&); | |||
|
|||
static pid_t get_current_pid(); | |||
|
|||
std::vector<int> get_execution_count(const std::string& code) const |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: function 'get_execution_count' should be marked [[nodiscard]] [modernize-use-nodiscard]
std::vector<int> get_execution_count(const std::string& code) const | |
[[nodiscard]] std::vector<int> get_execution_count(const std::string& code) const |
@@ -85,6 +97,8 @@ | |||
|
|||
xoutput_buffer m_cout_buffer; | |||
xoutput_buffer m_cerr_buffer; | |||
|
|||
std::map<std::string, std::vector<int>> m_code_to_execution_count_map; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: no header providing "std::map" is directly included [misc-include-cleaner]
include/xeus-cpp/xinterpreter.hpp:13:
- #include <memory>
+ #include <map>
+ #include <memory>
#include "xeus-cpp/xeus_cpp_config.hpp" | ||
#include "xeus-cpp/xinterpreter.hpp" | ||
#include "xeus-cpp/xutils.hpp" | ||
#include "xeus-cpp/xdebugger.hpp" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: #includes are not sorted properly [llvm-include-order]
#include "xeus-cpp/xdebugger.hpp" | |
#include "xeus-cpp/xdebugger.hpp" | |
#include "xeus-cpp/xeus_cpp_config.hpp" | |
#include "xeus-cpp/xinterpreter.hpp" | |
#include "xeus-cpp/xutils.hpp" | |
#include "xeus-zmq/xzmq_context.hpp" | |
#include <xeus-zmq/xserver_zmq.hpp> | |
#include <xeus/xhelper.hpp> | |
#include <xeus/xkernel.hpp> | |
#include <xeus/xkernel_configuration.hpp> |
@@ -62,6 +64,12 @@ | |||
auto interpreter = std::make_unique<xcpp::interpreter>(argc, argv); | |||
std::unique_ptr<xeus::xcontext> context = xeus::make_zmq_context(); | |||
|
|||
nl::json debugger_config; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: no header providing "nlohmann::json" is directly included [misc-include-cleaner]
src/main.cpp:9:
- #include <string>
+ #include <nlohmann/json_fwd.hpp>
+ #include <string>
debugger_config["lldb"]["initCommands"] = { | ||
"settings set plugin.jit-loader.gdb.enable on" | ||
}; | ||
debugger_config["interpreter_ptr"] = reinterpret_cast<std::uintptr_t>(interpreter.get()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast]
debugger_config["interpreter_ptr"] = reinterpret_cast<std::uintptr_t>(interpreter.get());
^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
There were too many comments to post at once. Showing the first 10 out of 103. Check the log or trigger a new build to see more.
debugger_config["lldb"]["initCommands"] = { | ||
"settings set plugin.jit-loader.gdb.enable on" | ||
}; | ||
debugger_config["interpreter_ptr"] = reinterpret_cast<std::uintptr_t>(interpreter.get()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: no header providing "std::uintptr_t" is directly included [misc-include-cleaner]
src/main.cpp:8:
- #include <memory>
+ #include <cstdint>
+ #include <memory>
using namespace std::placeholders; | ||
|
||
// ***** ONLY FOR DEBUGGING PURPOSES. NOT TO BE COMMITTED ***** | ||
static std::ofstream log_stream("/Users/abhinavkumar/Desktop/Coding/CERN_HSF_COMPILER_RESEARCH/xeus-cpp/build/xeus-cpp-logs.log", std::ios::app); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: initializing non-local variable with non-const expression depending on uninitialized non-local variable 'app' [cppcoreguidelines-interfaces-global-init]
static std::ofstream log_stream("/Users/abhinavkumar/Desktop/Coding/CERN_HSF_COMPILER_RESEARCH/xeus-cpp/build/xeus-cpp-logs.log", std::ios::app);
^
using namespace std::placeholders; | ||
|
||
// ***** ONLY FOR DEBUGGING PURPOSES. NOT TO BE COMMITTED ***** | ||
static std::ofstream log_stream("/Users/abhinavkumar/Desktop/Coding/CERN_HSF_COMPILER_RESEARCH/xeus-cpp/build/xeus-cpp-logs.log", std::ios::app); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'log_stream' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
static std::ofstream log_stream("/Users/abhinavkumar/Desktop/Coding/CERN_HSF_COMPILER_RESEARCH/xeus-cpp/build/xeus-cpp-logs.log", std::ios::app);
^
// ***** ONLY FOR DEBUGGING PURPOSES. NOT TO BE COMMITTED ***** | ||
static std::ofstream log_stream("/Users/abhinavkumar/Desktop/Coding/CERN_HSF_COMPILER_RESEARCH/xeus-cpp/build/xeus-cpp-logs.log", std::ios::app); | ||
|
||
void log_debug(const std::string& msg) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: function 'log_debug' can be made static or moved into an anonymous namespace to enforce internal linkage [misc-use-internal-linkage]
void log_debug(const std::string& msg) { | |
static void log_debug(const std::string& msg) { |
// ***** ONLY FOR DEBUGGING PURPOSES. NOT TO BE COMMITTED ***** | ||
static std::ofstream log_stream("/Users/abhinavkumar/Desktop/Coding/CERN_HSF_COMPILER_RESEARCH/xeus-cpp/build/xeus-cpp-logs.log", std::ios::app); | ||
|
||
void log_debug(const std::string& msg) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: no header providing "std::string" is directly included [misc-include-cleaner]
src/xdebugger.cpp:9:
- #include <sys/socket.h>
+ #include <string>
+ #include <sys/socket.h>
static std::ofstream log_stream("/Users/abhinavkumar/Desktop/Coding/CERN_HSF_COMPILER_RESEARCH/xeus-cpp/build/xeus-cpp-logs.log", std::ios::app); | ||
|
||
void log_debug(const std::string& msg) { | ||
log_stream << "[xeus-cpp] " << msg << std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: do not use 'std::endl' with streams; use '\n' instead [performance-avoid-endl]
log_stream << "[xeus-cpp] " << msg << std::endl; | |
log_stream << "[xeus-cpp] " << msg << '\n'; |
|
||
namespace xcpp | ||
{ | ||
debugger::debugger( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: constructor does not initialize these fields: m_is_running, m_tcp_socket, m_tcp_connected, jit_process_pid, m_copy_to_globals_available [cppcoreguidelines-pro-type-member-init]
include/xeus-cpp/xdebugger.hpp:72:
- bool m_is_running;
- int m_tcp_socket;
- bool m_tcp_connected;
- pid_t jit_process_pid;
+ bool m_is_running{};
+ int m_tcp_socket{};
+ bool m_tcp_connected{};
+ pid_t jit_process_pid{};
include/xeus-cpp/xdebugger.hpp:85:
- bool m_copy_to_globals_available;
+ bool m_copy_to_globals_available{};
namespace xcpp | ||
{ | ||
debugger::debugger( | ||
xeus::xcontext& context, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: no header providing "xeus::xcontext" is directly included [misc-include-cleaner]
src/xdebugger.cpp:14:
+ #include <xeus/xeus_context.hpp>
{ | ||
debugger::debugger( | ||
xeus::xcontext& context, | ||
const xeus::xconfiguration& config, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: no header providing "xeus::xconfiguration" is directly included [misc-include-cleaner]
src/xdebugger.cpp:14:
+ #include <xeus/xkernel_configuration.hpp>
const xeus::xconfiguration& config, | ||
const std::string& user_name, | ||
const std::string& session_id, | ||
const nl::json& debugger_config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: no header providing "nlohmann::json" is directly included [misc-include-cleaner]
src/xdebugger.cpp:9:
- #include <sys/socket.h>
+ #include <nlohmann/json_fwd.hpp>
+ #include <sys/socket.h>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
There were too many comments to post at once. Showing the first 10 out of 93. Check the log or trigger a new build to see more.
const std::string& session_id, | ||
const nl::json& debugger_config | ||
) | ||
: xdebugger_base(context) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: no header providing "xeus::xdebugger_base" is directly included [misc-include-cleaner]
src/xdebugger.cpp:14:
+ #include <xeus-zmq/xdebugger_base.hpp>
context, | ||
config, | ||
xeus::get_socket_linger(), | ||
xdap_tcp_configuration(xeus::dap_tcp_type::client, xeus::dap_init_type::parallel, user_name, session_id), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: no header providing "xeus::dap_init_type" is directly included [misc-include-cleaner]
xdap_tcp_configuration(xeus::dap_tcp_type::client, xeus::dap_init_type::parallel, user_name, session_id),
^
context, | ||
config, | ||
xeus::get_socket_linger(), | ||
xdap_tcp_configuration(xeus::dap_tcp_type::client, xeus::dap_init_type::parallel, user_name, session_id), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: no header providing "xeus::dap_tcp_type" is directly included [misc-include-cleaner]
src/xdebugger.cpp:14:
+ #include <xeus-zmq/xdap_tcp_client.hpp>
get_event_callback() | ||
)) | ||
, m_lldb_host("127.0.0.1") | ||
, m_lldb_port("") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: redundant string initialization [readability-redundant-string-init]
, m_lldb_port("") | |
, |
// Register request handlers | ||
register_request_handler( | ||
"inspectVariables", | ||
std::bind(&debugger::inspect_variables_request, this, _1), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: no header providing "std::bind" is directly included [misc-include-cleaner]
src/xdebugger.cpp:7:
- #include <iostream>
+ #include <functional>
+ #include <iostream>
// Register request handlers | ||
register_request_handler( | ||
"inspectVariables", | ||
std::bind(&debugger::inspect_variables_request, this, _1), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: no header providing "std::placeholders::_1" is directly included [misc-include-cleaner]
std::bind(&debugger::inspect_variables_request, this, _1),
^
// Register request handlers | ||
register_request_handler( | ||
"inspectVariables", | ||
std::bind(&debugger::inspect_variables_request, this, _1), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: prefer a lambda to std::bind [modernize-avoid-bind]
std::bind(&debugger::inspect_variables_request, this, _1), | |
[this](auto && PH1) { return inspect_variables_request(std::forward<decltype(PH1)>(PH1)); }, |
std::bind(&debugger::inspect_variables_request, this, _1), | ||
false | ||
); | ||
register_request_handler("attach", std::bind(&debugger::attach_request, this, _1), true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: prefer a lambda to std::bind [modernize-avoid-bind]
register_request_handler("attach", std::bind(&debugger::attach_request, this, _1), true); | |
register_request_handler("attach", [this](auto && PH1) { return attach_request(std::forward<decltype(PH1)>(PH1)); }, true); |
register_request_handler("attach", std::bind(&debugger::attach_request, this, _1), true); | ||
register_request_handler( | ||
"configurationDone", | ||
std::bind(&debugger::configuration_done_request, this, _1), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: prefer a lambda to std::bind [modernize-avoid-bind]
std::bind(&debugger::configuration_done_request, this, _1), | |
[this](auto && PH1) { return configuration_done_request(std::forward<decltype(PH1)>(PH1)); }, |
std::bind(&debugger::configuration_done_request, this, _1), | ||
true | ||
); | ||
register_request_handler("richInspectVariables", std::bind(&debugger::rich_inspect_variables_request, this, _1), true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: prefer a lambda to std::bind [modernize-avoid-bind]
register_request_handler("richInspectVariables", std::bind(&debugger::rich_inspect_variables_request, this, _1), true); | |
register_request_handler("richInspectVariables", [this](auto && PH1) { return rich_inspect_variables_request(std::forward<decltype(PH1)>(PH1)); }, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
There were too many comments to post at once. Showing the first 10 out of 102. Check the log or trigger a new build to see more.
@@ -25,6 +25,8 @@ | |||
#include "xbuffer.hpp" | |||
#include "xeus_cpp_config.hpp" | |||
#include "xmanager.hpp" | |||
#include <thread> | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: included header thread is not used directly [misc-include-cleaner]
return {}; | ||
} | ||
|
||
std::string get_code_from_execution_count(int execution_count) const |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: function 'get_code_from_execution_count' should be marked [[nodiscard]] [modernize-use-nodiscard]
std::string get_code_from_execution_count(int execution_count) const | |
[[nodiscard]] std::string get_code_from_execution_count(int execution_count) const |
#include "xeus-cpp/xeus_cpp_config.hpp" | ||
#include "xeus-cpp/xinterpreter.hpp" | ||
#include "xeus-cpp/xutils.hpp" | ||
#include "xeus-cpp/xdebugger.hpp" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: #includes are not sorted properly [llvm-include-order]
#include "xeus-cpp/xdebugger.hpp" | |
#include "xeus-cpp/xdebugger.hpp" | |
#include "xeus-cpp/xeus_cpp_config.hpp" | |
#include "xeus-cpp/xinterpreter.hpp" | |
#include "xeus-cpp/xutils.hpp" | |
#include "xeus-zmq/xserver_zmq_split.hpp" | |
#include "xeus-zmq/xzmq_context.hpp" | |
#include <xeus-zmq/xserver_zmq.hpp> | |
#include <xeus/xhelper.hpp> | |
#include <xeus/xkernel.hpp> | |
#include <xeus/xkernel_configuration.hpp> |
|
||
namespace xcpp | ||
{ | ||
debugger::debugger( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: constructor does not initialize these fields: m_is_running, m_tcp_socket, m_tcp_connected, jit_process_pid, m_copy_to_globals_available [cppcoreguidelines-pro-type-member-init]
include/xeus-cpp/xdebugger.hpp:76:
- bool m_is_running;
- int m_tcp_socket;
- bool m_tcp_connected;
- pid_t jit_process_pid;
+ bool m_is_running{};
+ int m_tcp_socket{};
+ bool m_tcp_connected{};
+ pid_t jit_process_pid{};
include/xeus-cpp/xdebugger.hpp:89:
- bool m_copy_to_globals_available;
+ bool m_copy_to_globals_available{};
true | ||
); | ||
register_request_handler("richInspectVariables", std::bind(&debugger::rich_inspect_variables_request, this, _1), true); | ||
register_request_handler("setBreakpoints", std::bind(&debugger::set_breakpoints_request, this, _1), true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: prefer a lambda to std::bind [modernize-avoid-bind]
register_request_handler("setBreakpoints", std::bind(&debugger::set_breakpoints_request, this, _1), true); | |
register_request_handler("setBreakpoints", [this](auto && PH1) { return set_breakpoints_request(std::forward<decltype(PH1)>(PH1)); }, true); |
); | ||
register_request_handler("richInspectVariables", std::bind(&debugger::rich_inspect_variables_request, this, _1), true); | ||
register_request_handler("setBreakpoints", std::bind(&debugger::set_breakpoints_request, this, _1), true); | ||
register_request_handler("dumpCell", std::bind(&debugger::dump_cell_request, this, _1), true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: prefer a lambda to std::bind [modernize-avoid-bind]
register_request_handler("dumpCell", std::bind(&debugger::dump_cell_request, this, _1), true); | |
register_request_handler("dumpCell", [this](auto && PH1) { return dump_cell_request(std::forward<decltype(PH1)>(PH1)); }, true); |
register_request_handler("richInspectVariables", std::bind(&debugger::rich_inspect_variables_request, this, _1), true); | ||
register_request_handler("setBreakpoints", std::bind(&debugger::set_breakpoints_request, this, _1), true); | ||
register_request_handler("dumpCell", std::bind(&debugger::dump_cell_request, this, _1), true); | ||
register_request_handler("copyToGlobals", std::bind(&debugger::copy_to_globals_request, this, _1), true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: prefer a lambda to std::bind [modernize-avoid-bind]
register_request_handler("copyToGlobals", std::bind(&debugger::copy_to_globals_request, this, _1), true); | |
register_request_handler("copyToGlobals", [this](auto && PH1) { return copy_to_globals_request(std::forward<decltype(PH1)>(PH1)); }, true); |
register_request_handler("setBreakpoints", std::bind(&debugger::set_breakpoints_request, this, _1), true); | ||
register_request_handler("dumpCell", std::bind(&debugger::dump_cell_request, this, _1), true); | ||
register_request_handler("copyToGlobals", std::bind(&debugger::copy_to_globals_request, this, _1), true); | ||
register_request_handler("stackTrace", std::bind(&debugger::stack_trace_request, this, _1), true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: prefer a lambda to std::bind [modernize-avoid-bind]
register_request_handler("stackTrace", std::bind(&debugger::stack_trace_request, this, _1), true); | |
register_request_handler("stackTrace", [this](auto && PH1) { return stack_trace_request(std::forward<decltype(PH1)>(PH1)); }, true); |
register_request_handler("dumpCell", std::bind(&debugger::dump_cell_request, this, _1), true); | ||
register_request_handler("copyToGlobals", std::bind(&debugger::copy_to_globals_request, this, _1), true); | ||
register_request_handler("stackTrace", std::bind(&debugger::stack_trace_request, this, _1), true); | ||
register_request_handler("source", std::bind(&debugger::source_request, this, _1), true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: prefer a lambda to std::bind [modernize-avoid-bind]
register_request_handler("source", std::bind(&debugger::source_request, this, _1), true); | |
register_request_handler("source", [this](auto && PH1) { return source_request(std::forward<decltype(PH1)>(PH1)); }, true); |
register_request_handler("stackTrace", std::bind(&debugger::stack_trace_request, this, _1), true); | ||
register_request_handler("source", std::bind(&debugger::source_request, this, _1), true); | ||
|
||
m_interpreter = reinterpret_cast<xcpp::interpreter*>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast]
m_interpreter = reinterpret_cast<xcpp::interpreter*>(
^
Description
Please include a summary of changes, motivation and context for this PR.
Fixes # (issue)
Type of change
Please tick all options which are relevant.