mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-05-29 17:46:29 +03:00
WIP
This commit is contained in:
@@ -8,6 +8,8 @@ class Bus {
|
||||
public:
|
||||
typedef std::function<void( const char* bytes, size_t n )> ReadFn;
|
||||
|
||||
virtual bool start() = 0;
|
||||
|
||||
virtual void startAsyncRead( ReadFn readFn ) = 0;
|
||||
|
||||
virtual size_t write( const char* buffer, const size_t& size ) = 0;
|
||||
|
||||
@@ -2,11 +2,14 @@
|
||||
|
||||
namespace ecode {
|
||||
|
||||
BusProcess::BusProcess( const Command& command ) :
|
||||
mProcess( command.command, command.arguments,
|
||||
Process::getDefaultOptions() | Process::Options::EnableAsync |
|
||||
Process::Options::CombinedStdoutStderr,
|
||||
command.environment ) {}
|
||||
BusProcess::BusProcess( const Command& command ) : mCommand( command ), mProcess() {}
|
||||
|
||||
bool BusProcess::start() {
|
||||
return mProcess.create( mCommand.command, mCommand.arguments,
|
||||
Process::getDefaultOptions() | Process::Options::EnableAsync |
|
||||
Process::Options::CombinedStdoutStderr,
|
||||
mCommand.environment );
|
||||
}
|
||||
|
||||
void BusProcess::startAsyncRead( ReadFn readFn ) {
|
||||
mProcess.startAsyncRead( readFn, readFn );
|
||||
|
||||
@@ -9,11 +9,14 @@ class BusProcess : public Bus {
|
||||
public:
|
||||
BusProcess( const Command& command );
|
||||
|
||||
virtual void startAsyncRead( ReadFn readFn );
|
||||
bool start() override;
|
||||
|
||||
virtual size_t write( const char* buffer, const size_t& size );
|
||||
void startAsyncRead( ReadFn readFn ) override;
|
||||
|
||||
size_t write( const char* buffer, const size_t& size ) override;
|
||||
|
||||
protected:
|
||||
Command mCommand;
|
||||
Process mProcess;
|
||||
};
|
||||
|
||||
|
||||
@@ -3,8 +3,11 @@
|
||||
|
||||
namespace ecode {
|
||||
|
||||
BusSocket::BusSocket( const Connection& connection ) {
|
||||
mSocket.connect( IpAddress( connection.host ), connection.port );
|
||||
BusSocket::BusSocket( const Connection& connection ) : mConnection( connection ) {}
|
||||
|
||||
bool BusSocket::start() {
|
||||
return mSocket.connect( IpAddress( mConnection.host ), mConnection.port ) ==
|
||||
Socket::Status::Done;
|
||||
}
|
||||
|
||||
void BusSocket::startAsyncRead( ReadFn readFn ) {
|
||||
|
||||
@@ -9,11 +9,14 @@ class BusSocket : public Bus {
|
||||
public:
|
||||
BusSocket( const Connection& connection );
|
||||
|
||||
void startAsyncRead( ReadFn readFn );
|
||||
bool start() override;
|
||||
|
||||
size_t write( const char* buffer, const size_t& size );
|
||||
void startAsyncRead( ReadFn readFn ) override;
|
||||
|
||||
size_t write( const char* buffer, const size_t& size ) override;
|
||||
|
||||
protected:
|
||||
Connection mConnection;
|
||||
TcpSocket mSocket;
|
||||
};
|
||||
|
||||
|
||||
63
src/tools/ecode/plugins/debugger/dap/debuggerclientdap.cpp
Normal file
63
src/tools/ecode/plugins/debugger/dap/debuggerclientdap.cpp
Normal file
@@ -0,0 +1,63 @@
|
||||
#include "debuggerclientdap.hpp"
|
||||
|
||||
namespace ecode {
|
||||
|
||||
DebuggerClientDap::DebuggerClientDap( std::unique_ptr<Bus>&& bus ) : mBus( std::move( bus ) ) {}
|
||||
|
||||
bool DebuggerClientDap::hasBreakpoint( const std::string& path, size_t line ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool DebuggerClientDap::addBreakpoint( const std::string& path, size_t line ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool DebuggerClientDap::removeBreakpoint( const std::string& path, size_t line ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool DebuggerClientDap::start() {
|
||||
return mBus->start();
|
||||
}
|
||||
|
||||
bool DebuggerClientDap::attach() {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool DebuggerClientDap::started() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool DebuggerClientDap::cont() {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool DebuggerClientDap::stepInto() {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool DebuggerClientDap::stepOver() {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool DebuggerClientDap::stepOut() {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool DebuggerClientDap::halt() {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool DebuggerClientDap::terminate() {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool DebuggerClientDap::stopped() {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool DebuggerClientDap::completed() {
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace ecode
|
||||
44
src/tools/ecode/plugins/debugger/dap/debuggerclientdap.hpp
Normal file
44
src/tools/ecode/plugins/debugger/dap/debuggerclientdap.hpp
Normal file
@@ -0,0 +1,44 @@
|
||||
#pragma once
|
||||
|
||||
#include "../bus.hpp"
|
||||
#include "../debuggerclient.hpp"
|
||||
|
||||
namespace ecode {
|
||||
|
||||
class DebuggerClientDap : public DebuggerClient {
|
||||
public:
|
||||
DebuggerClientDap( std::unique_ptr<Bus>&& bus );
|
||||
|
||||
bool hasBreakpoint( const std::string& path, size_t line );
|
||||
|
||||
bool addBreakpoint( const std::string& path, size_t line );
|
||||
|
||||
bool removeBreakpoint( const std::string& path, size_t line );
|
||||
|
||||
bool start();
|
||||
|
||||
bool attach();
|
||||
|
||||
bool started() const;
|
||||
|
||||
bool cont();
|
||||
|
||||
bool stepInto();
|
||||
|
||||
bool stepOver();
|
||||
|
||||
bool stepOut();
|
||||
|
||||
bool halt();
|
||||
|
||||
bool terminate();
|
||||
|
||||
bool stopped();
|
||||
|
||||
bool completed();
|
||||
|
||||
protected:
|
||||
std::unique_ptr<Bus> mBus;
|
||||
};
|
||||
|
||||
} // namespace ecode
|
||||
Reference in New Issue
Block a user