From f46f1d2836a8ed96eb60c4d232ec7c91bf2a33b9 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Mon, 27 Jan 2020 16:52:44 +0000 Subject: [PATCH] Update build glue for lldb (MK_LLDB=yes). Also update lldb's generated Config.h, disable a few more parts in the code we don't use, and add a pre-generated man page. --- .../lldb/source/API/SystemInitializerFull.cpp | 16 + .../Plugins/JITLoader/GDB/JITLoaderGDB.cpp | 7 +- lib/clang/include/lldb/Host/Config.h | 6 +- lib/clang/liblldb/Makefile | 54 ++- lib/clang/libllvm/Makefile | 1 + usr.bin/clang/lldb/Makefile | 5 +- usr.bin/clang/lldb/lldb.1 | 409 ++++++++++++++++++ 7 files changed, 474 insertions(+), 24 deletions(-) create mode 100644 usr.bin/clang/lldb/lldb.1 diff --git a/contrib/llvm-project/lldb/source/API/SystemInitializerFull.cpp b/contrib/llvm-project/lldb/source/API/SystemInitializerFull.cpp index 3de018906115..d185650a860c 100644 --- a/contrib/llvm-project/lldb/source/API/SystemInitializerFull.cpp +++ b/contrib/llvm-project/lldb/source/API/SystemInitializerFull.cpp @@ -168,12 +168,22 @@ SystemInitializerFull::SystemInitializerFull() {} SystemInitializerFull::~SystemInitializerFull() {} +#ifdef LLDB_ENABLE_ALL #define LLDB_PROCESS_AArch64(op) \ ABIMacOSX_arm64::op(); \ ABISysV_arm64::op(); +#else // LLDB_ENABLE_ALL +#define LLDB_PROCESS_AArch64(op) \ + ABISysV_arm64::op(); +#endif // LLDB_ENABLE_ALL +#ifdef LLDB_ENABLE_ALL #define LLDB_PROCESS_ARM(op) \ ABIMacOSX_arm::op(); \ ABISysV_arm::op(); +#else // LLDB_ENABLE_ALL +#define LLDB_PROCESS_ARM(op) \ + ABISysV_arm::op(); +#endif // LLDB_ENABLE_ALL #define LLDB_PROCESS_ARC(op) \ ABISysV_arc::op(); #define LLDB_PROCESS_Hexagon(op) ABISysV_hexagon::op(); @@ -184,11 +194,17 @@ SystemInitializerFull::~SystemInitializerFull() {} ABISysV_ppc::op(); \ ABISysV_ppc64::op(); #define LLDB_PROCESS_SystemZ(op) ABISysV_s390x::op(); +#ifdef LLDB_ENABLE_ALL #define LLDB_PROCESS_X86(op) \ ABIMacOSX_i386::op(); \ ABISysV_i386::op(); \ ABISysV_x86_64::op(); \ ABIWindows_x86_64::op(); +#else // LLDB_ENABLE_ALL +#define LLDB_PROCESS_X86(op) \ + ABISysV_i386::op(); \ + ABISysV_x86_64::op(); +#endif // LLDB_ENABLE_ALL #define LLDB_PROCESS_AMDGPU(op) #define LLDB_PROCESS_AVR(op) diff --git a/contrib/llvm-project/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp b/contrib/llvm-project/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp index fff44123539f..a5e90cac8734 100644 --- a/contrib/llvm-project/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp +++ b/contrib/llvm-project/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp @@ -7,7 +7,9 @@ //===----------------------------------------------------------------------===// #include "JITLoaderGDB.h" +#ifdef LLDB_ENABLE_ALL #include "Plugins/ObjectFile/Mach-O/ObjectFileMachO.h" +#endif #include "lldb/Breakpoint/Breakpoint.h" #include "lldb/Core/Module.h" #include "lldb/Core/ModuleSpec.h" @@ -336,6 +338,7 @@ bool JITLoaderGDB::ReadJITDescriptorImpl(bool all_entries) { module_sp->GetObjectFile()->GetSymtab(); m_jit_objects.insert(std::make_pair(symbolfile_addr, module_sp)); +#ifdef LLDB_ENABLE_ALL if (auto image_object_file = llvm::dyn_cast(module_sp->GetObjectFile())) { const SectionList *section_list = image_object_file->GetSectionList(); @@ -347,7 +350,9 @@ bool JITLoaderGDB::ReadJITDescriptorImpl(bool all_entries) { symbolfile_size, vmaddrheuristic, lower, upper); } - } else { + } else +#endif + { bool changed = false; module_sp->SetLoadAddress(target, 0, true, changed); } diff --git a/lib/clang/include/lldb/Host/Config.h b/lib/clang/include/lldb/Host/Config.h index add7397eb2b8..13e2242ff104 100644 --- a/lib/clang/include/lldb/Host/Config.h +++ b/lib/clang/include/lldb/Host/Config.h @@ -41,11 +41,11 @@ #define LLDB_ENABLE_LIBEDIT 1 -#define LLDB_ENABLE_LIBXML2 1 +#define LLDB_ENABLE_LIBXML2 0 -#define LLDB_ENABLE_LUA 1 +#define LLDB_ENABLE_LUA 0 -#define LLDB_ENABLE_PYTHON 1 +#define LLDB_ENABLE_PYTHON 0 /* #undef LLDB_PYTHON_HOME */ diff --git a/lib/clang/liblldb/Makefile b/lib/clang/liblldb/Makefile index 98e15cf8d793..19605f7e5b9f 100644 --- a/lib/clang/liblldb/Makefile +++ b/lib/clang/liblldb/Makefile @@ -13,7 +13,6 @@ CFLAGS+= -I${LLDB_SRCS}/source/Plugins/Process/Utility CFLAGS+= -I${OBJTOP}/lib/clang/libllvm CFLAGS+= -I${OBJTOP}/lib/clang/libclang CFLAGS+= -I${OBJTOP}/lib/clang/liblldb -CFLAGS+= -DLLDB_DISABLE_PYTHON SRCS+= API/SBAddress.cpp SRCS+= API/SBAttachInfo.cpp @@ -34,6 +33,7 @@ SRCS+= API/SBError.cpp SRCS+= API/SBEvent.cpp SRCS+= API/SBExecutionContext.cpp SRCS+= API/SBExpressionOptions.cpp +SRCS+= API/SBFile.cpp SRCS+= API/SBFileSpec.cpp SRCS+= API/SBFileSpecList.cpp SRCS+= API/SBFrame.cpp @@ -110,7 +110,6 @@ SRCS+= Commands/CommandCompletions.cpp SRCS+= Commands/CommandObjectApropos.cpp SRCS+= Commands/CommandObjectBreakpoint.cpp SRCS+= Commands/CommandObjectBreakpointCommand.cpp -SRCS+= Commands/CommandObjectBugreport.cpp SRCS+= Commands/CommandObjectCommands.cpp SRCS+= Commands/CommandObjectDisassemble.cpp SRCS+= Commands/CommandObjectExpression.cpp @@ -153,6 +152,7 @@ SRCS+= Core/FileSpecList.cpp SRCS+= Core/FormatEntity.cpp SRCS+= Core/Highlighter.cpp SRCS+= Core/IOHandler.cpp +SRCS+= Core/IOHandlerCursesGUI.cpp SRCS+= Core/Mangled.cpp SRCS+= Core/Module.cpp SRCS+= Core/ModuleChild.cpp @@ -219,6 +219,7 @@ SRCS+= Host/common/HostInfoBase.cpp SRCS+= Host/common/HostNativeThreadBase.cpp SRCS+= Host/common/HostProcess.cpp SRCS+= Host/common/HostThread.cpp +SRCS+= Host/common/LZMA.cpp SRCS+= Host/common/LockFileBase.cpp SRCS+= Host/common/MainLoop.cpp SRCS+= Host/common/MonitoringProcessLauncher.cpp @@ -241,7 +242,7 @@ SRCS+= Host/freebsd/Host.cpp SRCS+= Host/freebsd/HostInfoFreeBSD.cpp SRCS+= Host/posix/ConnectionFileDescriptorPosix.cpp SRCS+= Host/posix/DomainSocket.cpp -SRCS+= Host/posix/FileSystem.cpp +SRCS+= Host/posix/FileSystemPosix.cpp SRCS+= Host/posix/HostInfoPosix.cpp SRCS+= Host/posix/HostProcessPosix.cpp SRCS+= Host/posix/HostThreadPosix.cpp @@ -266,6 +267,7 @@ SRCS+= Interpreter/OptionGroupFile.cpp SRCS+= Interpreter/OptionGroupFormat.cpp SRCS+= Interpreter/OptionGroupOutputFile.cpp SRCS+= Interpreter/OptionGroupPlatform.cpp +SRCS+= Interpreter/OptionGroupPythonClassWithDict.cpp SRCS+= Interpreter/OptionGroupString.cpp SRCS+= Interpreter/OptionGroupUInt64.cpp SRCS+= Interpreter/OptionGroupUUID.cpp @@ -280,7 +282,7 @@ SRCS+= Interpreter/OptionValueChar.cpp SRCS+= Interpreter/OptionValueDictionary.cpp SRCS+= Interpreter/OptionValueEnumeration.cpp SRCS+= Interpreter/OptionValueFileSpec.cpp -SRCS+= Interpreter/OptionValueFileSpecLIst.cpp +SRCS+= Interpreter/OptionValueFileSpecList.cpp SRCS+= Interpreter/OptionValueFormat.cpp SRCS+= Interpreter/OptionValueFormatEntity.cpp SRCS+= Interpreter/OptionValueLanguage.cpp @@ -309,11 +311,11 @@ SRCS+= Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp SRCS+= Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp SRCS+= Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp SRCS+= Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp -SRCS+= Plugins/ExpressionParser/Clang/ASTDumper.cpp SRCS+= Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp SRCS+= Plugins/ExpressionParser/Clang/ASTStructExtractor.cpp SRCS+= Plugins/ExpressionParser/Clang/ASTUtils.cpp SRCS+= Plugins/ExpressionParser/Clang/ClangASTSource.cpp +SRCS+= Plugins/ExpressionParser/Clang/ClangDeclVendor.cpp SRCS+= Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp SRCS+= Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp SRCS+= Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp @@ -324,6 +326,7 @@ SRCS+= Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp SRCS+= Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp SRCS+= Plugins/ExpressionParser/Clang/ClangUserExpression.cpp SRCS+= Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp +SRCS+= Plugins/ExpressionParser/Clang/CppModuleConfiguration.cpp SRCS+= Plugins/ExpressionParser/Clang/IRDynamicChecks.cpp SRCS+= Plugins/ExpressionParser/Clang/IRForTarget.cpp SRCS+= Plugins/Instruction/ARM/EmulateInstructionARM.cpp @@ -477,7 +480,6 @@ SRCS+= Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp SRCS+= Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp SRCS+= Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp SRCS+= Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp -SRCS+= Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp SRCS+= Plugins/SymbolFile/DWARF/DWARFDebugMacro.cpp SRCS+= Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp SRCS+= Plugins/SymbolFile/DWARF/DWARFDeclContext.cpp @@ -505,8 +507,8 @@ SRCS+= Symbol/ArmUnwindInfo.cpp SRCS+= Symbol/Block.cpp SRCS+= Symbol/ClangASTContext.cpp SRCS+= Symbol/ClangASTImporter.cpp +SRCS+= Symbol/ClangASTMetadata.cpp SRCS+= Symbol/ClangExternalASTSourceCallbacks.cpp -SRCS+= Symbol/ClangExternalASTSourceCommon.cpp SRCS+= Symbol/ClangUtil.cpp SRCS+= Symbol/CompactUnwindInfo.cpp SRCS+= Symbol/CompileUnit.cpp @@ -548,6 +550,7 @@ SRCS+= Target/Language.cpp SRCS+= Target/LanguageRuntime.cpp SRCS+= Target/Memory.cpp SRCS+= Target/MemoryHistory.cpp +SRCS+= Target/MemoryRegionInfo.cpp SRCS+= Target/ModuleCache.cpp SRCS+= Target/OperatingSystem.cpp SRCS+= Target/PathMappingList.cpp @@ -605,10 +608,9 @@ SRCS+= Utility/DataEncoder.cpp SRCS+= Utility/DataExtractor.cpp SRCS+= Utility/Environment.cpp SRCS+= Utility/Event.cpp -SRCS+= Utility/FileCollector.cpp SRCS+= Utility/FileSpec.cpp +SRCS+= Utility/GDBRemote.cpp SRCS+= Utility/IOObject.cpp -SRCS+= Utility/JSON.cpp SRCS+= Utility/LLDBAssert.cpp SRCS+= Utility/Listener.cpp SRCS+= Utility/Log.cpp @@ -626,7 +628,6 @@ SRCS+= Utility/State.cpp SRCS+= Utility/Status.cpp SRCS+= Utility/Stream.cpp SRCS+= Utility/StreamCallback.cpp -SRCS+= Utility/StreamGDBRemote.cpp SRCS+= Utility/StreamString.cpp SRCS+= Utility/StringExtractor.cpp SRCS+= Utility/StringExtractorGDBRemote.cpp @@ -644,13 +645,32 @@ SRCS+= Utility/VMRange.cpp SRCS+= lldb.cpp LLDB_TBLGEN?= lldb-tblgen -INCFILE= CommandOptions.inc -TDFILE= ${LLDB_SRCS}/source/Commands/Options.td -GENOPT= -gen-lldb-option-defs -${INCFILE}: ${TDFILE} - ${LLDB_TBLGEN} ${GENOPT} -I ${LLDB_SRCS}/source/Commands \ - -d ${.TARGET:C/$/.d/} -o ${.TARGET} ${TDFILE} -TGHDRS+= ${INCFILE} + +CommandOptions.inc: ${LLDB_SRCS}/source/Commands/Options.td + ${LLDB_TBLGEN} -gen-lldb-option-defs \ + -I ${LLDB_SRCS}/source/Commands -d ${.TARGET:C/$/.d/} \ + -o ${.TARGET} ${LLDB_SRCS}/source/Commands/Options.td +TGHDRS+= CommandOptions.inc + +.for path in \ + Core/Core \ + Interpreter/Interpreter \ + Plugins/JITLoader/GDB/JITLoaderGDB \ + Plugins/Process/gdb-remote/ProcessGDBRemote \ + Plugins/SymbolFile/DWARF/SymbolFileDWARF \ + Target/Target +${path:T}Properties.inc: ${LLDB_SRCS}/source/${path}Properties.td + ${LLDB_TBLGEN} -gen-lldb-property-defs \ + -I ${LLDB_SRCS}/source/${path:H} -d ${.TARGET:C/$/.d/} \ + -o ${.TARGET} ${LLDB_SRCS}/source/${path}Properties.td +TGHDRS+= ${path:T}Properties.inc + +${path:T}PropertiesEnum.inc: ${LLDB_SRCS}/source/${path}Properties.td + ${LLDB_TBLGEN} -gen-lldb-property-enum-defs \ + -I ${LLDB_SRCS}/source/${path:H} -d ${.TARGET:C/$/.d/} \ + -o ${.TARGET} ${LLDB_SRCS}/source/${path}Properties.td +TGHDRS+= ${path:T}PropertiesEnum.inc +.endfor DPSRCS+= ${TGHDRS} CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/} diff --git a/lib/clang/libllvm/Makefile b/lib/clang/libllvm/Makefile index c64123bb8d97..3b34694b312f 100644 --- a/lib/clang/libllvm/Makefile +++ b/lib/clang/libllvm/Makefile @@ -859,6 +859,7 @@ SRCS_MIN+= Support/DynamicLibrary.cpp SRCS_MIN+= Support/Errno.cpp SRCS_MIN+= Support/Error.cpp SRCS_MIN+= Support/ErrorHandling.cpp +SRCS_XDB+= Support/FileCollector.cpp SRCS_EXL+= Support/FileOutputBuffer.cpp SRCS_MIN+= Support/FileUtilities.cpp SRCS_MIN+= Support/FoldingSet.cpp diff --git a/usr.bin/clang/lldb/Makefile b/usr.bin/clang/lldb/Makefile index cadf68293560..4572e731eb6f 100644 --- a/usr.bin/clang/lldb/Makefile +++ b/usr.bin/clang/lldb/Makefile @@ -4,8 +4,6 @@ PACKAGE= lldb PROG_CXX= lldb -# Man page directory -.PATH: ${LLDB_SRCS}/docs CFLAGS+= -I${LLDB_SRCS}/include CFLAGS+= -I${.OBJDIR} @@ -38,8 +36,9 @@ CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/} LIBADD+= edit LIBADD+= execinfo -LIBADD+= panel +LIBADD+= lzma LIBADD+= ncursesw +LIBADD+= panel LIBADD+= pthread LIBADD+= z diff --git a/usr.bin/clang/lldb/lldb.1 b/usr.bin/clang/lldb/lldb.1 new file mode 100644 index 000000000000..0d800d4a71e6 --- /dev/null +++ b/usr.bin/clang/lldb/lldb.1 @@ -0,0 +1,409 @@ +.\" $FreeBSD$ +.\" Man page generated from reStructuredText. +. +.TH "LLDB" "1" "Jan 27, 2020" "8" "LLDB" +.SH NAME +lldb \- LLDB Documentation +. +.nr rst2man-indent-level 0 +. +.de1 rstReportMargin +\\$1 \\n[an-margin] +level \\n[rst2man-indent-level] +level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] +- +\\n[rst2man-indent0] +\\n[rst2man-indent1] +\\n[rst2man-indent2] +.. +.de1 INDENT +.\" .rstReportMargin pre: +. RS \\$1 +. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] +. nr rst2man-indent-level +1 +.\" .rstReportMargin post: +.. +.de UNINDENT +. RE +.\" indent \\n[an-margin] +.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] +.nr rst2man-indent-level -1 +.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] +.in \\n[rst2man-indent\\n[rst2man-indent-level]]u +.. +.SH SYNOPSIS +.nf +\fBlldb\fP [\fIoptions\fP] \fIexecutable\fP +.fi +.sp +.SH DESCRIPTION +.sp +\fBlldb\fP is a next generation, high\-performance debugger. It is built as +a set of reusable components which highly leverage existing libraries in the +larger LLVM Project, such as the Clang expression parser and LLVM disassembler. +.sp +\fBlldb\fP is the default debugger in Xcode on macOS and supports +debugging C, Objective\-C and C++ on the desktop and iOS devices and simulator. +.sp +All of the code in the LLDB project is available under the Apache 2.0 License +with LLVM exceptions. +.SH ATTACHING +.INDENT 0.0 +.TP +.B \-\-attach\-name +Tells the debugger to attach to a process with the given name. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-attach\-pid +Tells the debugger to attach to a process with the given pid. +.UNINDENT +.INDENT 0.0 +.TP +.B \-n +Alias for –attach\-name +.UNINDENT +.INDENT 0.0 +.TP +.B \-p +Alias for –attach\-pid +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-wait\-for +Tells the debugger to wait for a process with the given pid or name to launch before attaching. +.UNINDENT +.INDENT 0.0 +.TP +.B \-w +Alias for –wait\-for +.UNINDENT +.SH COMMANDS +.INDENT 0.0 +.TP +.B \-\-batch +Tells the debugger to run the commands from \-s, \-S, \-o & \-O, and then quit. +.UNINDENT +.INDENT 0.0 +.TP +.B \-b +Alias for –batch +.UNINDENT +.INDENT 0.0 +.TP +.B \-K +Alias for –source\-on\-crash +.UNINDENT +.INDENT 0.0 +.TP +.B \-k +Alias for –one\-line\-on\-crash +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-local\-lldbinit +Allow the debugger to parse the .lldbinit files in the current working directory, unless –no\-lldbinit is passed. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-no\-lldbinit +Do not automatically parse any ‘.lldbinit’ files. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-one\-line\-before\-file +Tells the debugger to execute this one\-line lldb command before any file provided on the command line has been loaded. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-one\-line\-on\-crash +When in batch mode, tells the debugger to run this one\-line lldb command if the target crashes. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-one\-line +Tells the debugger to execute this one\-line lldb command after any file provided on the command line has been loaded. +.UNINDENT +.INDENT 0.0 +.TP +.B \-O +Alias for –one\-line\-before\-file +.UNINDENT +.INDENT 0.0 +.TP +.B \-o +Alias for –one\-line +.UNINDENT +.INDENT 0.0 +.TP +.B \-Q +Alias for –source\-quietly +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-source\-before\-file +Tells the debugger to read in and execute the lldb commands in the given file, before any file has been loaded. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-source\-on\-crash +When in batch mode, tells the debugger to source this file of lldb commands if the target crashes. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-source\-quietly +Tells the debugger to execute this one\-line lldb command before any file has been loaded. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-source +Tells the debugger to read in and execute the lldb commands in the given file, after any file has been loaded. +.UNINDENT +.INDENT 0.0 +.TP +.B \-S +Alias for –source\-before\-file +.UNINDENT +.INDENT 0.0 +.TP +.B \-s +Alias for –source +.UNINDENT +.INDENT 0.0 +.TP +.B \-x +Alias for –no\-lldbinit +.UNINDENT +.SH OPTIONS +.INDENT 0.0 +.TP +.B \-\-arch +Tells the debugger to use the specified architecture when starting and running the program. +.UNINDENT +.INDENT 0.0 +.TP +.B \-a +Alias for –arch +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-capture\-path +Tells the debugger to use the given filename for the reproducer. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-capture +Tells the debugger to capture a reproducer. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-core +Tells the debugger to use the full path to as the core file. +.UNINDENT +.INDENT 0.0 +.TP +.B \-c +Alias for –core +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-debug +Tells the debugger to print out extra information for debugging itself. +.UNINDENT +.INDENT 0.0 +.TP +.B \-d +Alias for –debug +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-editor +Tells the debugger to open source files using the host’s “external editor” mechanism. +.UNINDENT +.INDENT 0.0 +.TP +.B \-e +Alias for –editor +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-file +Tells the debugger to use the file as the program to be debugged. +.UNINDENT +.INDENT 0.0 +.TP +.B \-f +Alias for –file +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-help +Prints out the usage information for the LLDB debugger. +.UNINDENT +.INDENT 0.0 +.TP +.B \-h +Alias for –help +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-no\-use\-colors +Do not use colors. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-replay +Tells the debugger to replay a reproducer from . +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-version +Prints out the current version number of the LLDB debugger. +.UNINDENT +.INDENT 0.0 +.TP +.B \-v +Alias for –version +.UNINDENT +.INDENT 0.0 +.TP +.B \-X +Alias for –no\-use\-color +.UNINDENT +.SH REPL +.INDENT 0.0 +.TP +.B \-r= +Alias for –repl= +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-repl\-language +Chooses the language for the REPL. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-repl= +Runs lldb in REPL mode with a stub process with the given flags. +.UNINDENT +.INDENT 0.0 +.TP +.B \-R +Alias for –repl\-language +.UNINDENT +.SH SCRIPTING +.INDENT 0.0 +.TP +.B \-l +Alias for –script\-language +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-python\-path +Prints out the path to the lldb.py file for this version of lldb. +.UNINDENT +.INDENT 0.0 +.TP +.B \-P +Alias for –python\-path +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-script\-language +Tells the debugger to use the specified scripting language for user\-defined scripts. +.UNINDENT +.SH EXAMPLES +.sp +The debugger can be started in several modes. +.sp +Passing an executable as a positional argument prepares \fBlldb\fP to +debug the given executable. Arguments passed after – are considered arguments +to the debugged executable. +.INDENT 0.0 +.INDENT 3.5 +lldb –arch x86_64 /path/to/program – –arch arvm7 +.UNINDENT +.UNINDENT +.sp +Passing one of the attach options causes \fBlldb\fP to immediately attach +to the given process. +.INDENT 0.0 +.INDENT 3.5 +lldb \-p +lldb \-n +.UNINDENT +.UNINDENT +.sp +Passing –repl starts \fBlldb\fP in REPL mode. +.INDENT 0.0 +.INDENT 3.5 +lldb \-r +.UNINDENT +.UNINDENT +.sp +Passing –core causes \fBlldb\fP to debug the core file. +.INDENT 0.0 +.INDENT 3.5 +lldb \-c /path/to/core +.UNINDENT +.UNINDENT +.sp +Command options can be combined with these modes and cause \fBlldb\fP to +run the specified commands before or after events, like loading the file or +crashing, in the order provided on the command line. +.INDENT 0.0 +.INDENT 3.5 +lldb \-O ‘settings set stop\-disassembly\-count 20’ \-o ‘run’ \-o ‘bt’ +lldb \-S /source/before/file \-s /source/after/file +lldb \-K /source/before/crash \-k /source/after/crash +.UNINDENT +.UNINDENT +.sp +Note: In REPL mode no file is loaded, so commands specified to run after +loading the file (via \-o or \-s) will be ignored. +.SH USING LLDB +.sp +In \fBlldb\fP there is a help command which can be used to find +descriptions and examples of all \fBlldb\fP commands. To get help on +“breakpoint set” you would type “help breakpoint set”. +.sp +There is also an apropos command which will search the help text of all +commands for a given term ‐‐ this is useful for locating a command by topic. +For instance, “apropos breakpoint” will list any command that has the word +“breakpoint” in its help text. +.SH CONFIGURATION FILES +.sp +\fBlldb\fP reads things like settings, aliases and commands from the +.lldbinit file. It will first look for ~/.lldbinit and load that first. +Secondly, it will look for an .lldbinit file in the current working directory. +For security reasons, \fBlldb\fP will print a warning and not source this +file by default. This behavior can be changed by changing the +target.load\-cwd\-lldbinit setting. +.sp +To always load the .lldbinit file in the current working directory, add the +following command to ~/.lldbinit: +.INDENT 0.0 +.INDENT 3.5 +settings set target.load\-cwd\-lldbinit true +.UNINDENT +.UNINDENT +.sp +To never load the .lldbinit file in the current working directory and silence +the warning, add the following command to ~/.lldbinit: +.INDENT 0.0 +.INDENT 3.5 +settings set target.load\-cwd\-lldbinit false +.UNINDENT +.UNINDENT +.SH SEE ALSO +.sp +The LLDB project page \fI\%https://lldb.llvm.org\fP has many different resources +for \fBlldb\fP users ‐‐ the gdb/lldb command equivalence page +\fI\%https://lldb.llvm.org/use/map.html\fP can be especially helpful for users +coming from gdb. +.SH AUTHOR +LLVM project +.SH COPYRIGHT +2007-2020, The LLDB Team +.\" Generated by docutils manpage writer. +.