MCPcopy Create free account
hub / github.com/SpartanJ/eepp / makeResponse

Method makeResponse

src/tools/ecode/plugins/debugger/dap/debuggerclientdap.cpp:77–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77void DebuggerClientDap::makeResponse( int reqSeq, bool success, const std::string& command,
78 const nlohmann::json& body, const std::string& sessionId ) {
79 auto& session = mSessions[sessionId];
80 session.idx.fetch_add( 1, std::memory_order_relaxed );
81
82 nlohmann::json jsonCmd = { { "type", "response" },
83 { "request_seq", reqSeq },
84 { "seq", session.idx.load() },
85 { "success", success },
86 { "command", command } };
87
88 if ( !body.empty() )
89 jsonCmd["body"] = body;
90
91 std::string cmd = jsonCmd.dump();
92 std::string msg( String::format( "Content-Length: %zu\r\n\r\n%s", cmd.size(), cmd ) );
93
94 if ( mDebug ) {
95 Log::debug( "DebuggerClientDap::makeResponse:" );
96 Log::debug( msg );
97 }
98
99 if ( !mSessions[sessionId].bus )
100 return;
101
102 mSessions[sessionId].bus->write( msg.data(), msg.size() );
103}
104
105bool DebuggerClientDap::isServerConnected() const {
106 if ( !mSessions.empty() ) {

Callers

nothing calls this directly

Calls 7

formatFunction · 0.85
debugFunction · 0.85
loadMethod · 0.45
emptyMethod · 0.45
sizeMethod · 0.45
writeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected