llvm-project/lldb/source/API
Pavel Labath 004a264f8c [lldb] Fix shared library directory computation on windows
Our code for locating the shared library directory works via dladdr (or
the windows equivalent) to locate the path of an address known to reside
in liblldb. This works great for C++ programs, but there's a catch.

When (lib)lldb is used from python (like in our test suite), this dladdr
call will return a path to the _lldb.so (or such) file in the python
directory. To compensate for this, we have code which attempts to
resolve this symlink, to ensure we get the canonical location. However,
here's the second catch.

On windows, this file is not a symlink (but a copy), so this logic
fails. Since most of our other paths are derived from the liblldb
location, all of these paths will be wrong, when running the test suite.
One effect of this was the failure to find lldb-server in D96202.

To fix this issue, I add some windows-specific code to locate the
liblldb directory. Since it cannot rely on symlinks, it works by
manually walking the directory tree -- essentially doing the opposite of
what we do when computing the python directory.

To avoid python leaking back into the host code, I implement this with
the help of a callback which can be passed to HostInfo::Initialize in
order to assist with the directory location. The callback lives inside
the python plugin.

I also strenghten the existing path test to ensure the returned path is
the right one.

Differential Revision: https://reviews.llvm.org/D96779
2021-02-18 15:37:52 +01:00
..
CMakeLists.txt [lldb] Symlink the Clang resource directory to the LLDB build directory in standalone builds 2020-10-06 09:28:39 +02:00
SBAddress.cpp [lldb] Pass reference instead of pointer in protected SBAddress methods. 2020-09-25 11:47:05 -07:00
SBAttachInfo.cpp [lldb] Replace empty ctor en dtor bodies with =default (NFC) 2020-02-17 22:58:26 -08:00
SBBlock.cpp [lldb][NFCI] Remove unused LanguageType parameters 2020-01-30 21:57:23 -08:00
SBBreakpoint.cpp Add an SB API to get the SBTarget from an SBBreakpoint 2020-10-15 14:28:44 -07:00
SBBreakpointLocation.cpp [lldb] Pass reference instead of pointer in protected SBAddress methods. 2020-09-25 11:47:05 -07:00
SBBreakpointName.cpp [lldb/API] Use std::make_unique<> (NFC) 2020-06-24 16:29:30 -07:00
SBBreakpointOptionCommon.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
SBBreakpointOptionCommon.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
SBBroadcaster.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
SBCommandInterpreter.cpp Reland "[lldb] Make CommandInterpreter's execution context the same as debugger's one" 2021-02-08 15:09:09 +03:00
SBCommandInterpreterRunOptions.cpp [lldb] Add copy ctor/assignment operator to SBCommandInterpreterRunOptions 2020-07-30 10:39:30 -07:00
SBCommandReturnObject.cpp [lldb/Interpreter] Support color in CommandReturnObject 2020-06-09 10:45:45 -07:00
SBCommunication.cpp [lldb] Change Communication::SetConnection to take a unique_ptr 2020-04-02 14:42:25 +02:00
SBCompileUnit.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
SBData.cpp [lldb] Replace empty ctor en dtor bodies with =default (NFC) 2020-02-17 22:58:26 -08:00
SBDebugger.cpp Revert "[lldb] Use current execution context in SBDebugger" 2021-02-02 14:41:48 +01:00
SBDeclaration.cpp [lldb/API] Use std::make_unique<> (NFC) 2020-06-24 16:29:30 -07:00
SBEnvironment.cpp [lldb/Reproducers] Add instrumentation to SBEnvironment 2020-05-20 13:02:20 -07:00
SBError.cpp Fix SBError::SetErrorToGenericError 2020-10-26 15:44:38 +01:00
SBEvent.cpp [lldb] Replace empty ctor en dtor bodies with =default (NFC) 2020-02-17 22:58:26 -08:00
SBExecutionContext.cpp [lldb] Replace empty ctor en dtor bodies with =default (NFC) 2020-02-17 22:58:26 -08:00
SBExpressionOptions.cpp [lldb/API] Add missing LLDB_REGISTER_METHOD macros 2020-04-06 16:09:40 -07:00
SBFile.cpp [lldb] Replace empty ctor en dtor bodies with =default (NFC) 2020-02-17 22:58:26 -08:00
SBFileSpec.cpp [lldb/Reproducers] Fix passive replay for (char*, size_t) functions. 2020-04-20 13:26:11 -07:00
SBFileSpecList.cpp [lldb] Replace empty ctor en dtor bodies with =default (NFC) 2020-02-17 22:58:26 -08:00
SBFrame.cpp [lldb] Pass reference instead of pointer in protected SBAddress methods. 2020-09-25 11:47:05 -07:00
SBFunction.cpp [lldb] Pass reference instead of pointer in protected SBAddress methods. 2020-09-25 11:47:05 -07:00
SBHostOS.cpp [lldb] Provide GetHomeDirectory wrapper in Host::FileSystem (NFC) 2020-08-20 14:07:05 -07:00
SBInstruction.cpp [lldb] Pass reference instead of pointer in protected SBAddress methods. 2020-09-25 11:47:05 -07:00
SBInstructionList.cpp [lldb] Replace empty ctor en dtor bodies with =default (NFC) 2020-02-17 22:58:26 -08:00
SBLanguageRuntime.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
SBLaunchInfo.cpp Recommit "[lldb/API] Overwrite variables with SBLaunchInfo::SetEnvironment(append=true)" 2020-07-23 14:17:57 +02:00
SBLineEntry.cpp [lldb] Pass reference instead of pointer in protected SBAddress methods. 2020-09-25 11:47:05 -07:00
SBListener.cpp [lldb] Replace empty ctor en dtor bodies with =default (NFC) 2020-02-17 22:58:26 -08:00
SBMemoryRegionInfo.cpp [lldb] Replace empty ctor en dtor bodies with =default (NFC) 2020-02-17 22:58:26 -08:00
SBMemoryRegionInfoList.cpp [lldb] Replace empty ctor en dtor bodies with =default (NFC) 2020-02-17 22:58:26 -08:00
SBModule.cpp [lldb] Add missing LLDB_REGISTER for GarbageCollectAllocatedModules 2020-08-17 10:14:41 -07:00
SBModuleSpec.cpp [lldb] Replace empty ctor en dtor bodies with =default (NFC) 2020-02-17 22:58:26 -08:00
SBPlatform.cpp [lldb] Add missing LLDB_REGISTER_CONSTRUCTOR in SBPlatform 2020-09-10 18:50:02 -07:00
SBProcess.cpp [lldb/Reproducers] Fix passive replay for (char*, size_t) functions. 2020-04-20 13:26:11 -07:00
SBProcessInfo.cpp [lldb/API] Use std::make_unique<> (NFC) 2020-06-24 16:29:30 -07:00
SBQueue.cpp [lldb] Replace empty ctor en dtor bodies with =default (NFC) 2020-02-17 22:58:26 -08:00
SBQueueItem.cpp [lldb] Pass reference instead of pointer in protected SBAddress methods. 2020-09-25 11:47:05 -07:00
SBReproducer.cpp [lldb] Move copying of files into reproducer out of process 2020-10-23 12:33:54 -07:00
SBReproducerPrivate.h [lldb] Extract reproducer providers & co into their own header. 2020-08-22 10:04:27 -07:00
SBSection.cpp [lldb] Switch Section-dumping code to raw_ostream 2020-05-14 11:59:18 +02:00
SBSourceManager.cpp [lldb/API] Use std::make_unique<> (NFC) 2020-06-24 16:29:30 -07:00
SBStream.cpp [lldb/API] Use std::make_unique<> (NFC) 2020-06-24 16:29:30 -07:00
SBStringList.cpp [lldb/API] Use std::make_unique<> (NFC) 2020-06-24 16:29:30 -07:00
SBStructuredData.cpp [lldb/Reproducers] Fix passive replay for (char*, size_t) functions. 2020-04-20 13:26:11 -07:00
SBSymbol.cpp [lldb] Pass reference instead of pointer in protected SBAddress methods. 2020-09-25 11:47:05 -07:00
SBSymbolContext.cpp [lldb/API] Use std::make_unique<> (NFC) 2020-06-24 16:29:30 -07:00
SBSymbolContextList.cpp [lldb] Replace empty ctor en dtor bodies with =default (NFC) 2020-02-17 22:58:26 -08:00
SBTarget.cpp [lldb/test] Stop recording fundamental return types (NFC) 2021-02-03 02:57:26 +01:00
SBThread.cpp [lldb/Reproducers] Fix passive replay for (char*, size_t) functions. 2020-04-20 13:26:11 -07:00
SBThreadCollection.cpp [lldb] Replace empty ctor en dtor bodies with =default (NFC) 2020-02-17 22:58:26 -08:00
SBThreadPlan.cpp Add a setting to force stepping to always run all threads. 2020-08-07 14:47:31 -07:00
SBTrace.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
SBTraceOptions.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
SBType.cpp [lldb] Add SBType::GetEnumerationIntegerType method 2020-12-22 10:08:22 -08:00
SBTypeCategory.cpp [lldb] Replace empty ctor en dtor bodies with =default (NFC) 2020-02-17 22:58:26 -08:00
SBTypeEnumMember.cpp [lldb/API] Use std::make_unique<> (NFC) 2020-06-24 16:29:30 -07:00
SBTypeFilter.cpp [lldb] Replace empty ctor en dtor bodies with =default (NFC) 2020-02-17 22:58:26 -08:00
SBTypeFormat.cpp [lldb] Replace empty ctor en dtor bodies with =default (NFC) 2020-02-17 22:58:26 -08:00
SBTypeNameSpecifier.cpp [lldb] Replace empty ctor en dtor bodies with =default (NFC) 2020-02-17 22:58:26 -08:00
SBTypeSummary.cpp [lldb/API] Use std::make_unique<> (NFC) 2020-06-24 16:29:30 -07:00
SBTypeSynthetic.cpp [lldb] Replace empty ctor en dtor bodies with =default (NFC) 2020-02-17 22:58:26 -08:00
SBUnixSignals.cpp [lldb] Replace empty ctor en dtor bodies with =default (NFC) 2020-02-17 22:58:26 -08:00
SBValue.cpp [lldb] Remove redundant ctor call (NFC) 2020-09-29 10:05:12 -07:00
SBValueList.cpp [lldb/API] Use std::make_unique<> (NFC) 2020-06-24 16:29:30 -07:00
SBVariablesOptions.cpp [lldb/API] Use std::make_unique<> (NFC) 2020-06-24 16:29:30 -07:00
SBWatchpoint.cpp [lldb] Replace empty ctor en dtor bodies with =default (NFC) 2020-02-17 22:58:26 -08:00
SystemInitializerFull.cpp [lldb] Fix shared library directory computation on windows 2021-02-18 15:37:52 +01:00
SystemInitializerFull.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
Utils.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
liblldb-private.exports
liblldb.exports
liblldb.xcode.exports