Skip to content

Commit

Permalink
Add lldb-server, and update other lldb build glue to provide any
Browse files Browse the repository at this point in the history
additionally required objects.
  • Loading branch information
DimitryAndric committed Jun 7, 2021
1 parent e60d7a0 commit f93b529
Show file tree
Hide file tree
Showing 4 changed files with 332 additions and 5 deletions.
21 changes: 16 additions & 5 deletions lib/clang/liblldb/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ SRCS+= Commands/CommandObjectSettings.cpp
SRCS+= Commands/CommandObjectSource.cpp
SRCS+= Commands/CommandObjectStats.cpp
SRCS+= Commands/CommandObjectTarget.cpp
SRCS+= Commands/CommandObjectTrace.cpp
SRCS+= Commands/CommandObjectThread.cpp
SRCS+= Commands/CommandObjectThreadUtil.cpp
SRCS+= Commands/CommandObjectTrace.cpp
SRCS+= Commands/CommandObjectType.cpp
SRCS+= Commands/CommandObjectVersion.cpp
SRCS+= Commands/CommandObjectWatchpoint.cpp
Expand Down Expand Up @@ -233,6 +233,9 @@ SRCS+= Host/common/LZMA.cpp
SRCS+= Host/common/LockFileBase.cpp
SRCS+= Host/common/MainLoop.cpp
SRCS+= Host/common/MonitoringProcessLauncher.cpp
SRCS+= Host/common/NativeProcessProtocol.cpp
SRCS+= Host/common/NativeRegisterContext.cpp
SRCS+= Host/common/NativeThreadProtocol.cpp
SRCS+= Host/common/NativeWatchpointList.cpp
SRCS+= Host/common/OptionParser.cpp
SRCS+= Host/common/PipeBase.cpp
Expand Down Expand Up @@ -304,6 +307,7 @@ SRCS+= Interpreter/OptionValueUUID.cpp
SRCS+= Interpreter/Options.cpp
SRCS+= Interpreter/Property.cpp
SRCS+= Interpreter/ScriptInterpreter.cpp
SRCS+= LLDBWrapLua.cpp
SRCS+= Plugins/ABI/AArch64/ABIAArch64.cpp
SRCS+= Plugins/ABI/AArch64/ABISysV_arm64.cpp
SRCS+= Plugins/ABI/ARM/ABIARM.cpp
Expand Down Expand Up @@ -390,14 +394,14 @@ SRCS+= Plugins/Language/ObjC/NSIndexPath.cpp
SRCS+= Plugins/Language/ObjC/NSSet.cpp
SRCS+= Plugins/Language/ObjC/NSString.cpp
SRCS+= Plugins/Language/ObjC/ObjCLanguage.cpp
SRCS+= Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
SRCS+= Plugins/LanguageRuntime/CPlusPlus/CPPLanguageRuntime.cpp
SRCS+= Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
SRCS+= Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
SRCS+= Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp
SRCS+= Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp
SRCS+= Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.cpp
SRCS+= Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
SRCS+= Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.cpp
SRCS+= Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
SRCS+= Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp
SRCS+= Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
SRCS+= Plugins/ObjectFile/Breakpad/BreakpadRecords.cpp
Expand All @@ -417,7 +421,12 @@ SRCS+= Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm64.cpp
SRCS+= Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_mips64.cpp
SRCS+= Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_powerpc.cpp
SRCS+= Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_x86.cpp
SRCS+= Plugins/Process/FreeBSDRemote/NativeProcessFreeBSD.cpp
SRCS+= Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD.cpp
SRCS+= Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp
SRCS+= Plugins/Process/FreeBSDRemote/NativeThreadFreeBSD.cpp
SRCS+= Plugins/Process/POSIX/CrashReason.cpp
SRCS+= Plugins/Process/POSIX/NativeProcessELF.cpp
SRCS+= Plugins/Process/POSIX/ProcessMessage.cpp
SRCS+= Plugins/Process/POSIX/ProcessPOSIXLog.cpp
SRCS+= Plugins/Process/Utility/AuxVector.cpp
Expand All @@ -429,6 +438,8 @@ SRCS+= Plugins/Process/Utility/HistoryUnwind.cpp
SRCS+= Plugins/Process/Utility/InferiorCallPOSIX.cpp
SRCS+= Plugins/Process/Utility/LinuxSignals.cpp
SRCS+= Plugins/Process/Utility/MipsLinuxSignals.cpp
SRCS+= Plugins/Process/Utility/NativeRegisterContextRegisterInfo.cpp
SRCS+= Plugins/Process/Utility/NativeRegisterContextWatchpoint_x86.cpp
SRCS+= Plugins/Process/Utility/NetBSDSignals.cpp
SRCS+= Plugins/Process/Utility/RegisterContextDarwin_i386.cpp
SRCS+= Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp
Expand All @@ -454,6 +465,7 @@ SRCS+= Plugins/Process/Utility/RegisterContextPOSIX_powerpc.cpp
SRCS+= Plugins/Process/Utility/RegisterContextPOSIX_ppc64le.cpp
SRCS+= Plugins/Process/Utility/RegisterContextPOSIX_x86.cpp
SRCS+= Plugins/Process/Utility/RegisterContextThreadMemory.cpp
SRCS+= Plugins/Process/Utility/RegisterContext_x86.cpp
SRCS+= Plugins/Process/Utility/RegisterInfoPOSIX_arm.cpp
SRCS+= Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp
SRCS+= Plugins/Process/Utility/RegisterInfoPOSIX_ppc64le.cpp
Expand Down Expand Up @@ -486,7 +498,6 @@ SRCS+= Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.cpp
SRCS+= Plugins/ScriptInterpreter/None/ScriptInterpreterNone.cpp
SRCS+= Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp
SRCS+= Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp
SRCS+= Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp
SRCS+= Plugins/SymbolFile/DWARF/DIERef.cpp
SRCS+= Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
SRCS+= Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.cpp
Expand All @@ -509,6 +520,7 @@ SRCS+= Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
SRCS+= Plugins/SymbolFile/DWARF/DWARFIndex.cpp
SRCS+= Plugins/SymbolFile/DWARF/DWARFTypeUnit.cpp
SRCS+= Plugins/SymbolFile/DWARF/DWARFUnit.cpp
SRCS+= Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp
SRCS+= Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp
SRCS+= Plugins/SymbolFile/DWARF/LogChannelDWARF.cpp
SRCS+= Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp
Expand Down Expand Up @@ -664,7 +676,6 @@ SRCS+= Utility/UserID.cpp
SRCS+= Utility/UserIDResolver.cpp
SRCS+= Utility/VASprintf.cpp
SRCS+= Utility/VMRange.cpp
SRCS+= LLDBWrapLua.cpp
SRCS+= lldb.cpp

LLDB_TBLGEN?= lldb-tblgen
Expand Down
1 change: 1 addition & 0 deletions usr.bin/clang/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ SUBDIR+= lld
.endif
.if ${MK_LLDB} != "no"
SUBDIR+= lldb
SUBDIR+= lldb-server
.endif
.if ${MK_LLVM_COV} != "no"
SUBDIR+= llvm-cov
Expand Down
53 changes: 53 additions & 0 deletions usr.bin/clang/lldb-server/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# $FreeBSD$

.include "${SRCTOP}/lib/clang/lldb.pre.mk"

PACKAGE= lldb
PROG_CXX= lldb-server

CFLAGS+= -I${LLDB_SRCS}/include
CFLAGS+= -I${LLDB_SRCS}/source
CFLAGS+= -I${.OBJDIR}

SRCDIR= lldb/tools/lldb-server

SRCS+= Acceptor.cpp
SRCS+= LLDBServerUtilities.cpp
SRCS+= SystemInitializerLLGS.cpp
SRCS+= lldb-gdbserver.cpp
SRCS+= lldb-platform.cpp
SRCS+= lldb-server.cpp

.include "${SRCTOP}/lib/clang/clang.build.mk"

LIBDEPS+= lldb
LIBDEPS+= clang
LIBDEPS+= llvm

.for lib in ${LIBDEPS}
DPADD+= ${OBJTOP}/lib/clang/lib${lib}/lib${lib}.a
LDADD+= ${OBJTOP}/lib/clang/lib${lib}/lib${lib}.a
.endfor

LLVM_TBLGEN?= llvm-tblgen
INCFILE= LLGSOptions.inc
TDFILE= ${LLDB_SRCS}/tools/lldb-server/LLGSOptions.td
GENOPT= -gen-opt-parser-defs
${INCFILE}: ${TDFILE}
${LLVM_TBLGEN} ${GENOPT} -I ${LLVM_SRCS}/include -d ${.TARGET:C/$/.d/} \
-o ${.TARGET} ${TDFILE}
TGHDRS+= ${INCFILE}

DPSRCS+= ${TGHDRS}
CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/}

LIBADD+= edit
LIBADD+= execinfo
LIBADD+= lua
LIBADD+= lzma
LIBADD+= ncursesw
LIBADD+= panel
LIBADD+= pthread
LIBADD+= z

.include <bsd.prog.mk>
Loading

0 comments on commit f93b529

Please sign in to comment.