Skip to content

Commit db189dd

Browse files
committed
Fix attach request handling
1 parent 79a88ef commit db189dd

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

lldb/test/API/tools/lldb-dap/gpu/amd/TestDAP_gpu_reverse_request.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,6 @@ def test_gpu_breakpoint_hit(self):
100100
self.do_continue_on(GPU_PROCESS_UNIQUE_ID)
101101
# Continue main session
102102
self.do_continue()
103-
self.dap_server.wait_for_stopped()
104-
self.do_continue()
105103
# Verify that the GPU breakpoint is hit in the child session
106104
self.verify_breakpoint_hit_on(GPU_PROCESS_UNIQUE_ID, gpu_breakpoint_ids, timeout=self.DEFAULT_TIMEOUT * 3)
107105

lldb/tools/lldb-dap/DAP.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1491,7 +1491,6 @@ void DAP::EventThread() {
14911491
// target ID of the created target. The DAP instance will attach to
14921492
// this existing target and the debug session will be ready to go.
14931493
llvm::json::Object attach_config;
1494-
llvm::json::Array attach_commands;
14951494

14961495
// If we have a process name, add command to attach to the same
14971496
// process name

lldb/tools/lldb-dap/Handler/AttachRequestHandler.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ Error AttachRequestHandler::Run(const AttachRequestArguments &args) const {
8686
if (error.Fail())
8787
return ToError(error);
8888
dap.SetTarget(target);
89-
9089
// Run any pre run LLDB commands the user specified in the launch.json
91-
if (Error err = dap.RunPreRunCommands())
90+
if (Error err = dap.RunPreRunCommands()) {
9291
return err;
92+
}
9393

9494
if ((args.pid == LLDB_INVALID_PROCESS_ID ||
9595
args.gdbRemotePort == LLDB_DAP_INVALID_PORT) &&
@@ -131,7 +131,7 @@ Error AttachRequestHandler::Run(const AttachRequestArguments &args) const {
131131
connect_url += std::to_string(args.gdbRemotePort);
132132
dap.target.ConnectRemote(listener, connect_url.c_str(), "gdb-remote",
133133
error);
134-
} else {
134+
} else if (!target_id.has_value()) {
135135
// Attach by pid or process name.
136136
lldb::SBAttachInfo attach_info;
137137
if (args.pid != LLDB_INVALID_PROCESS_ID)

0 commit comments

Comments
 (0)