File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
test/API/tools/lldb-dap/coreFile Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,21 @@ def test_core_file(self):
6161 self .dap_server .request_next (threadId = 32259 )
6262 self .assertEqual (self .get_stackFrames (), expected_frames )
6363
64+ def test_wrong_core_file (self ):
65+ exe_file = self .getSourcePath ("linux-x86_64.out" )
66+ wrong_core_file = self .getSourcePath ("main.c" )
67+
68+ self .create_debug_adapter ()
69+ resp = self .attach (
70+ program = exe_file , coreFile = wrong_core_file , expectFailure = True
71+ )
72+ self .assertIsNotNone (resp )
73+ self .assertFalse (resp ["success" ], "Expected failure in response {resp!r}" )
74+ error_msg = resp ["body" ]["error" ]["format" ]
75+
76+ # attach may fail for mutilple reasons.
77+ self .assertEqual (error_msg , "Failed to create the process" )
78+
6479 @skipIfLLVMTargetMissing ("X86" )
6580 def test_core_file_source_mapping_array (self ):
6681 """Test that sourceMap property is correctly applied when loading a core"""
Original file line number Diff line number Diff line change @@ -124,6 +124,8 @@ Error AttachRequestHandler::Run(const AttachRequestArguments &args) const {
124124 attach_info.SetWaitForLaunch (args.waitFor , /* async=*/ false );
125125 dap.target .Attach (attach_info, error);
126126 }
127+ if (error.Fail ())
128+ return ToError (error);
127129 }
128130
129131 // Make sure the process is attached and stopped.
You can’t perform that action at this time.
0 commit comments