Skip to content

Commit 10c8c06

Browse files
author
kr-2003
committed
trying to attach
1 parent 777fa06 commit 10c8c06

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

src/xdebugger.cpp

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -371,19 +371,20 @@ namespace xcpp
371371
nl::json debugger::attach_request(const nl::json& message)
372372
{
373373
// Placeholder DAP response
374-
std::cout << "debugger::attach_request (sending launch instead)" << std::endl;
375-
nl::json launch_request = {
374+
std::cout << "debugger::attach_request" << std::endl;
375+
nl::json attach_request = {
376376
{"seq", 2},
377377
{"type", "request"},
378-
{"command", "launch"},
379-
{"arguments",
380-
{{"program", "/Users/abhinavkumar/Desktop/Coding/Testing/test"},
381-
{"args", {"arg1", "arg2"}},
382-
{"cwd", "/Users/abhinavkumar/Desktop/Coding/Testing"},
383-
{"initCommands", {"settings set plugin.jit-loader.gdb.enable on"}}}}
378+
{"command", "attach"},
379+
{"arguments", {
380+
{"pid", message["arguments"].value("pid", 0)},
381+
{"program", message["arguments"].value("program", "")},
382+
{"stopOnEntry", message["arguments"].value("stopOnEntry", false)},
383+
{"initCommands", message["arguments"].value("initCommands", nl::json::array())}
384+
}}
384385
};
385-
nl::json reply = forward_message(launch_request);
386-
std::cout << "Launch request sent instead of attach: " << reply.dump() << std::endl;
386+
nl::json reply = forward_message(attach_request);
387+
std::cout << "Attach request sent: " << reply.dump() << std::endl;
387388
return reply;
388389
}
389390

0 commit comments

Comments
 (0)