File tree Expand file tree Collapse file tree 5 files changed +41
-1
lines changed
source/Plugins/Process/Windows/Common
test/API/windows/launch/missing-dll Expand file tree Collapse file tree 5 files changed +41
-1
lines changed Original file line number Diff line number Diff line change @@ -483,7 +483,8 @@ void ProcessDebugger::OnExitProcess(uint32_t exit_code) {
483
483
// of the error otherwise WaitForDebuggerConnection() will be blocked.
484
484
// An example of this issue is when a process fails to load a dependent DLL.
485
485
if (m_session_data && !m_session_data->m_initial_stop_received ) {
486
- Status error (exit_code, eErrorTypeWin32);
486
+ Status error = Status::FromErrorStringWithFormatv (
487
+ " Process prematurely exited with {0:x}" , exit_code);
487
488
OnDebuggerError (error, 0 );
488
489
}
489
490
}
Original file line number Diff line number Diff line change
1
+ C_SOURCES := main.c
2
+ DYLIB_C_SOURCES := dummy_dll.c
3
+ DYLIB_NAME := dummy_dll
4
+
5
+ include Makefile.rules
Original file line number Diff line number Diff line change
1
+ import lldb
2
+ from lldbsuite .test .decorators import *
3
+ from lldbsuite .test .lldbtest import *
4
+ from lldbsuite .test import lldbutil
5
+
6
+
7
+ class MissingDllTestCase (TestBase ):
8
+ @skipUnlessWindows
9
+ def test (self ):
10
+ """
11
+ Test that lldb reports the application's exit code (STATUS_DLL_NOT_FOUND),
12
+ rather than trying to treat it as a Win32 error number.
13
+ """
14
+
15
+ self .build ()
16
+ exe = self .getBuildArtifact ("a.out" )
17
+ dll = self .getBuildArtifact ("dummy_dll.dll" )
18
+ self .assertTrue (remove_file (dll ))
19
+ target = self .dbg .CreateTarget (exe )
20
+ self .assertTrue (target , VALID_TARGET )
21
+
22
+ launch_info = lldb .SBLaunchInfo (None )
23
+ launch_info .SetWorkingDirectory (self .get_process_working_directory ())
24
+
25
+ error = lldb .SBError ()
26
+ target .Launch (launch_info , error )
27
+ self .assertFailure (error , "Process prematurely exited with 0xc0000135" )
Original file line number Diff line number Diff line change
1
+ __declspec(dllexport ) void SomeFunction (void ) {}
Original file line number Diff line number Diff line change
1
+ __declspec(dllimport ) void SomeFunction (void );
2
+
3
+ int main (void ) {
4
+ SomeFunction ();
5
+ return 0 ;
6
+ }
You can’t perform that action at this time.
0 commit comments