llvm-project/lldb
Alvin Wong 87a2dba14e [lldb] Fix loading DLL from some ramdisk on Windows
The WinAPI `GetFinalPathNameByHandle` is used to retrieve the DLL file
name from the HANDLE provided to `LOAD_DLL_DEBUG_EVENT` in the debug
loop. When this API fails, lldb will simply ignore that module.

Certain ramdisk (e.g. ImDisk) does not work with this API, which means
it is impossible to use lldb to debug a process which loads DLLs located
on this type of ramdisk. In order to make this work, we need to use a
fallback routine which involves creating a file mapping, using
`GetMappedFileName` to get a device path, then substitutes the device
path with its drive letter.

References:
* https://developercommunity.visualstudio.com/t/cannot-debug-program-when-compiled-to-ram-drive/43004#T-N109926
* https://github.com/jrfonseca/drmingw/issues/65
* https://docs.microsoft.com/en-us/windows/win32/memory/obtaining-a-file-name-from-a-file-handle

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D126657
2022-06-15 17:02:33 +03:00
..
bindings [lldb] Add missing UTF-8 char basic type entries 2022-06-13 17:33:46 +00:00
cmake [lldb] Disable modules in Apple-lldb-base 2022-05-24 17:17:14 -07:00
docs [lldb] Add missing UTF-8 char basic type entries 2022-06-13 17:33:46 +00:00
examples [lldb/crashlog] Show help when the command is called without any argument 2022-06-10 13:44:43 -07:00
include/lldb [lldb] Fix TestDyldExecLinux with xml enabled 2022-06-14 11:44:59 +02:00
packages/Python/lldbsuite [lldb] [test] Implement getting thread ID on FreeBSD 2022-06-10 10:26:58 +02:00
resources [lldb] Remove stale LLDB-Info.plist 2021-01-08 10:12:16 -08:00
scripts Prefer /usr/bin/env xxx over /usr/bin/xxx where xxx = perl, python, awk 2021-02-25 11:32:27 +01:00
source [lldb] Fix loading DLL from some ramdisk on Windows 2022-06-15 17:02:33 +03:00
test [lldb] Fix TestDyldExecLinux with xml enabled 2022-06-14 11:44:59 +02:00
third_party/Python/module [lldb][NFC] Inclusive language: replace master/slave names for ptys 2021-11-12 10:54:18 -06:00
tools [lldb/fuzzer] Moving target fuzzer into separate subdirectory 2022-05-26 17:05:14 -07:00
unittests Store a by name list of signals with their actions in the Target 2022-05-26 14:50:33 -07:00
utils [lldb] Match test dependencies name to other LLVM projects. 2021-05-21 00:10:27 -07:00
.clang-format
.clang-tidy [LLDB] Applying clang-tidy modernize-use-override over LLDB 2022-04-22 13:29:47 -07:00
.gitignore
CMakeLists.txt [cmake] Make include(GNUInstallDirs) always below project(..) 2022-01-20 18:59:17 +00:00
CODE_OWNERS.txt [CODE OWNERS] Add wallace as code owner 2022-01-12 12:36:30 -08:00
LICENSE.TXT
use_lldb_suite_root.py