Skip to content
Open
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
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ set(XEUS_CPP_HEADERS
include/xeus-cpp/xmagics.hpp
include/xeus-cpp/xoptions.hpp
include/xeus-cpp/xpreamble.hpp
include/xeus-cpp/xdebugger.hpp
#src/xinspect.hpp
#src/xsystem.hpp
#src/xparser.hpp
Expand All @@ -215,6 +216,7 @@ set(XEUS_CPP_SRC
src/xparser.cpp
src/xutils.cpp
src/xmagics/os.cpp
src/xdebugger.cpp
)

if(NOT EMSCRIPTEN)
Expand Down
52 changes: 52 additions & 0 deletions include/xeus-cpp/xdebugger.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/************************************************************************************
* Copyright (c) 2023, xeus-cpp contributors *
* Copyright (c) 2023, Johan Mabille, Loic Gouarin, Sylvain Corlay, Wolf Vollprecht *
* *
* Distributed under the terms of the BSD 3-Clause License. *
* *
* The full license is in the file LICENSE, distributed with this software. *
************************************************************************************/


#ifndef XEUS_CPP_DEBUGGER_HPP
#define XEUS_CPP_DEBUGGER_HPP

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: header guard does not follow preferred style [llvm-header-guard]

Suggested change
#define XEUS_CPP_DEBUGGER_HPP
#ifndef XEUS_CPP_XDEBUGGER_HPP
#define XEUS_CPP_XDEBUGGER_HPP


#include <map>
#include <mutex>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: included header map is not used directly [misc-include-cleaner]

Suggested change
#include <mutex>
#include <mutex>

#include <set>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: included header mutex is not used directly [misc-include-cleaner]

Suggested change
#include <set>
#include <set>


Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: included header set is not used directly [misc-include-cleaner]

Suggested change

#include "xeus_cpp_config.hpp"
#include <nlohmann/json.hpp>

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 <nlohmann/json.hpp>
^

this fix will not be applied because it overlaps with another fix

#include "xeus-zmq/xdebugger_base.hpp"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: included header json.hpp is not used directly [misc-include-cleaner]

Suggested change
#include "xeus-zmq/xdebugger_base.hpp"
#include "xeus-zmq/xdebugger_base.hpp"


namespace nl = nlohmann;

namespace xcpp
{
class xllDB_dap_client;

class XEUS_CPP_API debugger : public xeus::xdebugger_base

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: class 'debugger' defines a destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator [cppcoreguidelines-special-member-functions]

    class XEUS_CPP_API debugger : public xeus::xdebugger_base 
                       ^

{
public:
debugger(xeus::xcontext& context, const xeus::xconfiguration& config,

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]

include/xeus-cpp/xdebugger.hpp:19:

- #include "xeus-zmq/xdebugger_base.hpp"
+ #include <xeus/xkernel_configuration.hpp>
+ #include "xeus-zmq/xdebugger_base.hpp"

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]

include/xeus-cpp/xdebugger.hpp:19:

- #include "xeus-zmq/xdebugger_base.hpp"
+ #include <xeus/xeus_context.hpp>
+ #include "xeus-zmq/xdebugger_base.hpp"

const std::string& user_name, const std::string& session_id,

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]

include/xeus-cpp/xdebugger.hpp:19:

- #include "xeus-zmq/xdebugger_base.hpp"
+ #include <string>
+ #include "xeus-zmq/xdebugger_base.hpp"

const nl::json& lldb_config);

virtual ~debugger();

private:
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;

private:
xllDB_dap_client* p_lldb_dap_client;
std::string m_lldb_host{"localhost"};
std::string m_lldb_port{"12345"};
nl::json m_lldb_config;
};
std::unique_ptr<xeus::xdebugger> make_cpp_debugger(...);
}

#endif
70 changes: 70 additions & 0 deletions src/xdebugger.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/************************************************************************************
* Copyright (c) 2023, xeus-cpp contributors *
* Copyright (c) 2023, Johan Mabille, Loic Gouarin, Sylvain Corlay, Wolf Vollprecht *
* *
* Distributed under the terms of the BSD 3-Clause License. *
* *
* The full license is in the file LICENSE, distributed with this software. *
************************************************************************************/


#include "xeus-cpp/xdebugger.hpp"
#include "xeus-zmq/xmiddleware.hpp"
#include "xeus/xinterpreter.hpp"
#include "xeus/xsystem.hpp"
#include "xeus-zmq/xmiddleware.hpp"

namespace xcpp
{
debugger::debugger(xeus::xcontext& context, const xeus::xconfiguration& config,
const std::string& user_name, const std::string& session_id,
const nl::json& lldb_config)
: xdebugger_base(context)
, p_lldb_dap_client(nullptr)
, m_lldb_host("localhost")
, m_lldb_port("12345")
, m_lldb_config(lldb_config)
{
}

debugger::~debugger()
{
// delete p_lldb_dap_client;
// p_lldb_dap_client = nullptr;
}

bool debugger::start()
{
return true;
}

void debugger::stop()
{
return;
}

xeus::xdebugger_info debugger::get_debugger_info() const
{
// return temporary values
return xeus::xdebugger_info(1,
"temp_prefix",
"temp_suffix",
true,
{"Temporary Exceptions"},
true);
}

std::string debugger::get_cell_temporary_file(const std::string& code) const
{
return "";
}

std::unique_ptr<xeus::xdebugger> make_cpp_debugger(xeus::xcontext& context,
const xeus::xconfiguration& config,
const std::string& user_name,
const std::string& session_id,
const nl::json& lldb_config)
{
return std::unique_ptr<xeus::xdebugger>(new debugger(context, config, user_name, session_id, lldb_config));
}
}
Loading