2025-05-27 12:16:03 -08:00
|
|
|
import lldb
|
|
|
|
|
from lldbsuite.test.decorators import *
|
|
|
|
|
from lldbsuite.test.lldbtest import *
|
|
|
|
|
from lldbsuite.test import lldbutil
|
|
|
|
|
|
|
|
|
|
|
2026-04-29 08:57:55 -08:00
|
|
|
@skipIfTargetDoesNotSupportSharedLibraries()
|
2025-05-27 12:16:03 -08:00
|
|
|
class MissingDllTestCase(TestBase):
|
2026-08-01 08:03:29 -08:00
|
|
|
@requireWindows
|
2025-05-27 12:16:03 -08:00
|
|
|
def test(self):
|
|
|
|
|
"""
|
|
|
|
|
Test that lldb reports the application's exit code (STATUS_DLL_NOT_FOUND),
|
|
|
|
|
rather than trying to treat it as a Win32 error number.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
self.build()
|
|
|
|
|
exe = self.getBuildArtifact("a.out")
|
|
|
|
|
dll = self.getBuildArtifact("dummy_dll.dll")
|
|
|
|
|
self.assertTrue(remove_file(dll))
|
|
|
|
|
target = self.dbg.CreateTarget(exe)
|
|
|
|
|
self.assertTrue(target, VALID_TARGET)
|
|
|
|
|
|
|
|
|
|
launch_info = lldb.SBLaunchInfo(None)
|
|
|
|
|
launch_info.SetWorkingDirectory(self.get_process_working_directory())
|
|
|
|
|
|
|
|
|
|
error = lldb.SBError()
|
|
|
|
|
target.Launch(launch_info, error)
|
2026-05-21 07:24:37 -08:00
|
|
|
self.assertFalse(error.Success(), "expected launch to fail")
|
|
|
|
|
self.assertIn("Process prematurely exited with 0xc0000135", error.GetCString())
|