llvm-project/lldb/bindings/interface
Levon Ter-Grigoryan f23b829a26 Fixed use of -o and -k in LLDB under Windows when statically compiled with vcruntime.
Right now if the LLDB is compiled under the windows with static vcruntime library, the -o and -k commands will not work.

The problem is that the LLDB create FILE* in lldb.exe and pass it to liblldb.dll which is an object from CRT.
Since the CRT is statically linked each of these module has its own copy of the CRT with it's own global state and the LLDB should not share CRT objects between them.

In this change I moved the logic of creating FILE* out of commands stream from Driver class to SBDebugger.
To do this I added new method: SBError SBDebugger::SetInputStream(SBStream &stream)

Command to build the LLDB:
cmake -G Ninja -DLLVM_ENABLE_PROJECTS="clang;lldb;libcxx"  -DLLVM_USE_CRT_RELEASE="MT" -DLLVM_USE_CRT_MINSIZEREL="MT" -DLLVM_USE_CRT_RELWITHDEBINFO="MT" -DP
YTHON_HOME:FILEPATH=C:/Python38 -DCMAKE_C_COMPILER:STRING=cl.exe -DCMAKE_CXX_COMPILER:STRING=cl.exe ../llvm

Command which will fail:
lldb.exe -o help

See discord discussion for more details: https://discord.com/channels/636084430946959380/636732809708306432/854629125398724628
This revision is for the further discussion.

Reviewed By: teemperor

Differential Revision: https://reviews.llvm.org/D104413
2021-11-24 16:17:08 +00:00
..
SBAddress.i [lldb][docs] Resolve the remaining sphinx formatter warnings in the SB API docs 2021-01-18 10:47:19 +01:00
SBAttachInfo.i [lldb][docs] Cleanup the Python doc strings for SB API classes 2021-01-17 16:51:07 +01:00
SBBlock.i [lldb] Clarify docstring for SBBlock::IsInlined, NFC 2020-09-17 16:54:58 -07:00
SBBreakpoint.i [lldb] Use internal_dict name over dict in python examples 2021-02-10 15:11:00 -08:00
SBBreakpointLocation.i [lldb] Use internal_dict name over dict in python examples 2021-02-10 15:11:00 -08:00
SBBreakpointName.i [lldb][docs] Translate ASCII art to restructured text formatting 2021-01-15 14:43:27 +01:00
SBBroadcaster.i [lldb][docs] Resolve the remaining sphinx formatter warnings in the SB API docs 2021-01-18 10:47:19 +01:00
SBCommandInterpreter.i [lldb][docs] Translate ASCII art to restructured text formatting 2021-01-15 14:43:27 +01:00
SBCommandInterpreterRunOptions.i [lldb/API] Add CommandInterpreter::{Get,Set}PrintErrors to SBAPI (NFC) 2021-03-05 19:33:33 +01:00
SBCommandReturnObject.i [lldb][docs] Translate ASCII art to restructured text formatting 2021-01-15 14:43:27 +01:00
SBCommunication.i [lldb][docs] Cleanup the Python doc strings for SB API classes 2021-01-17 16:51:07 +01:00
SBCompileUnit.i [lldb][docs] Translate ASCII art to restructured text formatting 2021-01-15 14:43:27 +01:00
SBData.i [lldb][docs] Cleanup the Python doc strings for SB API classes 2021-01-17 16:51:07 +01:00
SBDebugger.i Fixed use of -o and -k in LLDB under Windows when statically compiled with vcruntime. 2021-11-24 16:17:08 +00:00
SBDeclaration.i
SBEnvironment.i [lldb][docs] Translate ASCII art to restructured text formatting 2021-01-15 14:43:27 +01:00
SBError.i [lldb][docs] Translate ASCII art to restructured text formatting 2021-01-15 14:43:27 +01:00
SBEvent.i [lldb][docs] Translate ASCII art to restructured text formatting 2021-01-15 14:43:27 +01:00
SBExecutionContext.i [lldb][docs] Cleanup the Python doc strings for SB API classes 2021-01-17 16:51:07 +01:00
SBExpressionOptions.i
SBFile.i [lldb][docs] Use inline literals for code/paths instead of rendering it with the default role 2021-01-18 11:10:19 +01:00
SBFileSpec.i [lldb][docs] Translate ASCII art to restructured text formatting 2021-01-15 14:43:27 +01:00
SBFileSpecList.i [lldb][docs] Cleanup the Python doc strings for SB API classes 2021-01-17 16:51:07 +01:00
SBFrame.i [lldb][docs] Use inline literals for code/paths instead of rendering it with the default role 2021-01-18 11:10:19 +01:00
SBFunction.i [lldb][docs] Translate ASCII art to restructured text formatting 2021-01-15 14:43:27 +01:00
SBHostOS.i [lldb][docs] Cleanup the Python doc strings for SB API classes 2021-01-17 16:51:07 +01:00
SBInstruction.i [lldb][docs] Cleanup the Python doc strings for SB API classes 2021-01-17 16:51:07 +01:00
SBInstructionList.i [lldb][docs] Translate ASCII art to restructured text formatting 2021-01-15 14:43:27 +01:00
SBLanguageRuntime.i [lldb][docs] Add a doc page for enums and constants 2021-01-19 18:54:05 +01:00
SBLaunchInfo.i [lldb/Commands] Add command options for ScriptedProcess to ProcessLaunch 2021-03-23 18:24:47 +01:00
SBLineEntry.i [lldb][docs] Cleanup the Python doc strings for SB API classes 2021-01-17 16:51:07 +01:00
SBListener.i [lldb] Fix two documentation typos 2021-01-19 15:25:15 +01:00
SBMemoryRegionInfo.i [lldb/Plugins] Add memory region support in ScriptedProcess 2021-10-08 14:54:07 +02:00
SBMemoryRegionInfoList.i [lldb/Plugins] Add memory region support in ScriptedProcess 2021-10-08 14:54:07 +02:00
SBModule.i [lldb][docs] Resolve the remaining sphinx formatter warnings in the SB API docs 2021-01-18 10:47:19 +01:00
SBModuleSpec.i [lldb][docs] Cleanup the Python doc strings for SB API classes 2021-01-17 16:51:07 +01:00
SBPlatform.i [lldb][docs] Cleanup the Python doc strings for SB API classes 2021-01-17 16:51:07 +01:00
SBProcess.i [lldb] Add AllocateMemory/DeallocateMemory to the SBProcess API 2021-07-16 00:45:22 +02:00
SBProcessInfo.i Revert "[LLDB/API] Expose args and env from SBProcessInfo." 2021-06-05 15:50:49 +07:00
SBQueue.i [lldb][docs] Cleanup the Python doc strings for SB API classes 2021-01-17 16:51:07 +01:00
SBQueueItem.i [lldb][docs] Cleanup the Python doc strings for SB API classes 2021-01-17 16:51:07 +01:00
SBReproducer.i [lldb][docs] Cleanup the Python doc strings for SB API classes 2021-01-17 16:51:07 +01:00
SBSection.i [lldb][docs] Translate ASCII art to restructured text formatting 2021-01-15 14:43:27 +01:00
SBSourceManager.i [lldb][docs] Translate ASCII art to restructured text formatting 2021-01-15 14:43:27 +01:00
SBStream.i [lldb][docs] Translate ASCII art to restructured text formatting 2021-01-15 14:43:27 +01:00
SBStringList.i [lldb][docs] Cleanup the Python doc strings for SB API classes 2021-01-17 16:51:07 +01:00
SBStructuredData.i [trace][intel-pt] Create basic SB API 2021-06-17 15:14:47 -07:00
SBSymbol.i [lldb][docs] Translate ASCII art to restructured text formatting 2021-01-15 14:43:27 +01:00
SBSymbolContext.i [lldb][docs] Translate ASCII art to restructured text formatting 2021-01-15 14:43:27 +01:00
SBSymbolContextList.i [NFC] fix a typo 2021-10-15 14:51:49 +08:00
SBTarget.i [formatters] List and forward_list capping_size determination and application 2021-11-23 14:18:51 -08:00
SBThread.i [lldb] [gdb-remote server] Introduce new stop reasons for fork and vfork 2021-04-24 11:08:33 +02:00
SBThreadCollection.i
SBThreadPlan.i [lldb] [gdb-remote server] Introduce new stop reasons for fork and vfork 2021-04-24 11:08:33 +02:00
SBTrace.i [trace][intel-pt] Create basic SB API 2021-06-17 15:14:47 -07:00
SBType.i [lldb] Make SBType::IsTypeComplete more consistent by forcing the loading of definitions 2021-10-30 13:28:27 +02:00
SBTypeCategory.i
SBTypeEnumMember.i [lldb][docs] Cleanup the Python doc strings for SB API classes 2021-01-17 16:51:07 +01:00
SBTypeFilter.i
SBTypeFormat.i
SBTypeNameSpecifier.i
SBTypeSummary.i
SBTypeSynthetic.i
SBUnixSignals.i
SBValue.i [formatters] Add a formatter for libstdc++ optional 2021-11-22 15:36:46 -08:00
SBValueList.i [lldb][docs] Translate ASCII art to restructured text formatting 2021-01-15 14:43:27 +01:00
SBVariablesOptions.i [lldb][docs] Cleanup the Python doc strings for SB API classes 2021-01-17 16:51:07 +01:00
SBWatchpoint.i [lldb][docs] Translate ASCII art to restructured text formatting 2021-01-15 14:43:27 +01:00