diff options
| -rw-r--r-- | lldb/lib/Makefile | 3 | ||||
| -rwxr-xr-x | lldb/scripts/generate-vers.pl | 6 | ||||
| -rw-r--r-- | lldb/source/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | lldb/source/Host/common/Host.cpp | 24 | ||||
| -rw-r--r-- | lldb/source/Makefile | 2 | ||||
| -rw-r--r-- | lldb/source/Plugins/Makefile | 1 | ||||
| -rw-r--r-- | lldb/source/Plugins/SystemRuntime/MacOSX/Makefile | 14 | ||||
| -rw-r--r-- | lldb/tools/Makefile | 4 | ||||
| -rw-r--r-- | lldb/tools/debugserver/Makefile | 13 | ||||
| -rw-r--r-- | lldb/tools/debugserver/scripts/Makefile | 21 | ||||
| -rw-r--r-- | lldb/tools/debugserver/scripts/dbgnub-config.pl | 2 | ||||
| -rw-r--r-- | lldb/tools/debugserver/source/MacOSX/Makefile | 54 | ||||
| -rw-r--r-- | lldb/tools/debugserver/source/MacOSX/i386/Makefile | 19 | ||||
| -rw-r--r-- | lldb/tools/debugserver/source/MacOSX/x86_64/Makefile | 19 | ||||
| -rw-r--r-- | lldb/tools/debugserver/source/Makefile | 46 |
15 files changed, 213 insertions, 17 deletions
diff --git a/lldb/lib/Makefile b/lldb/lib/Makefile index 217707834b0..d63bcbe62df 100644 --- a/lldb/lib/Makefile +++ b/lldb/lib/Makefile @@ -96,7 +96,8 @@ ifeq ($(HOST_OS),Darwin) lldbPluginObjectFileMachO.a \ lldbPluginSymbolVendorMacOSX.a \ lldbPluginProcessDarwin.a \ - lldbPluginProcessMachCore.a + lldbPluginProcessMachCore.a \ + lldbPluginSystemRuntimeMacOSX.a endif ifeq ($(HOST_OS),Linux) diff --git a/lldb/scripts/generate-vers.pl b/lldb/scripts/generate-vers.pl index d126ef5334f..63374981e01 100755 --- a/lldb/scripts/generate-vers.pl +++ b/lldb/scripts/generate-vers.pl @@ -2,11 +2,11 @@ sub usage() { - print "Usage: generate-vers.pl /path/toproject.pbxproj"; + print "Usage: generate-vers.pl /path/toproject.pbxproj program_name"; exit(0); } -(scalar @ARGV == 1) or usage(); +(scalar @ARGV == 2) or usage(); open $pbxproj, $ARGV[0] or die "Couldn't open ".$ARGV[0]; @@ -51,6 +51,6 @@ $lowercase_name = lc $product_name; close $pbxproj; -$file_string = " const unsigned char liblldb_coreVersionString[] __attribute__ ((used)) = \"@(#)PROGRAM:".$uppercase_name." PROJECT:".$lowercase_name."-".$lldb_version_string."\" \"\\n\"; const double liblldb_coreVersionNumber __attribute__ ((used)) = (double)".$lldb_version.".".$lldb_train.";\n"; +$file_string = " const unsigned char ".$ARGV[1]."VersionString[] __attribute__ ((used)) = \"@(#)PROGRAM:".$uppercase_name." PROJECT:".$lowercase_name."-".$lldb_version_string."\" \"\\n\"; const double ".$ARGV[1]."VersionNumber __attribute__ ((used)) = (double)".$lldb_version.".".$lldb_train.";\n"; print $file_string; diff --git a/lldb/source/CMakeLists.txt b/lldb/source/CMakeLists.txt index 6388613dcff..11e2a355af0 100644 --- a/lldb/source/CMakeLists.txt +++ b/lldb/source/CMakeLists.txt @@ -110,7 +110,7 @@ if ( CMAKE_SYSTEM_NAME MATCHES "Darwin" ) set(LLDB_VERS_GENERATED_FILE ${LLDB_BINARY_DIR}/source/LLDB_vers.c) add_custom_command(OUTPUT ${LLDB_VERS_GENERATED_FILE} COMMAND ${LLDB_SOURCE_DIR}/scripts/generate-vers.pl - ${LLDB_SOURCE_DIR}/lldb.xcodeproj/project.pbxproj + ${LLDB_SOURCE_DIR}/lldb.xcodeproj/project.pbxproj liblldb_core > ${LLDB_VERS_GENERATED_FILE}) set_source_files_properties(${LLDB_VERS_GENERATED_FILE} PROPERTIES GENERATED 1) diff --git a/lldb/source/Host/common/Host.cpp b/lldb/source/Host/common/Host.cpp index 7cefd41731c..a2d8e9cfa10 100644 --- a/lldb/source/Host/common/Host.cpp +++ b/lldb/source/Host/common/Host.cpp @@ -1118,19 +1118,23 @@ Host::GetLLDBPath (PathType path_type, FileSpec &file_spec) { framework_pos += strlen("LLDB.framework"); ::strncpy (framework_pos, "/Resources/Python", PATH_MAX - (framework_pos - raw_path)); - } -#else - llvm::SmallString<256> python_version_dir; - llvm::raw_svector_ostream os(python_version_dir); - os << "/python" << PY_MAJOR_VERSION << '.' << PY_MINOR_VERSION << "/site-packages"; - os.flush(); + } + else + { +#endif + llvm::SmallString<256> python_version_dir; + llvm::raw_svector_ostream os(python_version_dir); + os << "/python" << PY_MAJOR_VERSION << '.' << PY_MINOR_VERSION << "/site-packages"; + os.flush(); - // We may get our string truncated. Should we protect - // this with an assert? + // We may get our string truncated. Should we protect + // this with an assert? - ::strncat(raw_path, python_version_dir.c_str(), - sizeof(raw_path) - strlen(raw_path) - 1); + ::strncat(raw_path, python_version_dir.c_str(), + sizeof(raw_path) - strlen(raw_path) - 1); +#if defined (__APPLE__) + } #endif FileSpec::Resolve (raw_path, resolved_path, sizeof(resolved_path)); g_lldb_python_dir.SetCString(resolved_path); diff --git a/lldb/source/Makefile b/lldb/source/Makefile index 9668cf5aba3..c716c480876 100644 --- a/lldb/source/Makefile +++ b/lldb/source/Makefile @@ -25,7 +25,7 @@ include $(LLDB_LEVEL)/Makefile ifeq ($(HOST_OS),Darwin) LLDB_vers.c: $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/generate-vers.pl $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/lldb.xcodeproj/project.pbxproj - "$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/generate-vers.pl" "$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/lldb.xcodeproj/project.pbxproj" > LLDB_vers.c + "$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/generate-vers.pl" "$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/lldb.xcodeproj/project.pbxproj" liblldb_core > LLDB_vers.c else LLDB_REVISION := $(strip \ $(shell $(LLVM_SRC_ROOT)/utils/GetSourceVersion $(LLVM_SRC_ROOT)/tools/lldb)) diff --git a/lldb/source/Plugins/Makefile b/lldb/source/Plugins/Makefile index d639ea1ea0b..0ca6a69ad0f 100644 --- a/lldb/source/Plugins/Makefile +++ b/lldb/source/Plugins/Makefile @@ -30,6 +30,7 @@ DIRS += ObjectContainer/Universal-Mach-O ObjectFile/Mach-O DIRS += SymbolVendor/MacOSX #DIRS += Process/MacOSX-User DIRS += Process/mach-core +DIRS += SystemRuntime/MacOSX endif ifeq ($(HOST_OS),Linux) diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/Makefile b/lldb/source/Plugins/SystemRuntime/MacOSX/Makefile new file mode 100644 index 00000000000..eebfb52073d --- /dev/null +++ b/lldb/source/Plugins/SystemRuntime/MacOSX/Makefile @@ -0,0 +1,14 @@ +##===- source/Plugins/SystemRuntime/MacOSX ----*- Makefile -*-===## +# +# The LLVM Compiler Infrastructure +# +# This file is distributed under the University of Illinois Open Source +# License. See LICENSE.TXT for details. +# +##===----------------------------------------------------------------------===## + +LLDB_LEVEL := ../../../.. +LIBRARYNAME := lldbPluginSystemRuntimeMacOSX +BUILD_ARCHIVE = 1 + +include $(LLDB_LEVEL)/Makefile diff --git a/lldb/tools/Makefile b/lldb/tools/Makefile index 46e62e968ae..5a18a914d58 100644 --- a/lldb/tools/Makefile +++ b/lldb/tools/Makefile @@ -24,4 +24,8 @@ ifneq ($(HOST_OS),MingW) DIRS += driver lldb-platform endif +ifeq ($(HOST_OS),Darwin) +DIRS += debugserver +endif + include $(LLDB_LEVEL)/Makefile diff --git a/lldb/tools/debugserver/Makefile b/lldb/tools/debugserver/Makefile new file mode 100644 index 00000000000..a1c4e28b18a --- /dev/null +++ b/lldb/tools/debugserver/Makefile @@ -0,0 +1,13 @@ +##===- tools/debugserver/Makefile --------------------------*- Makefile -*-===## +# +# The LLVM Compiler Infrastructure +# +# This file is distributed under the University of Illinois Open Source +# License. See LICENSE.TXT for details. +# +##===----------------------------------------------------------------------===## +LLDB_LEVEL := ../.. + +DIRS := scripts source + +include $(LLDB_LEVEL)/Makefile
\ No newline at end of file diff --git a/lldb/tools/debugserver/scripts/Makefile b/lldb/tools/debugserver/scripts/Makefile new file mode 100644 index 00000000000..7eb1a18bb89 --- /dev/null +++ b/lldb/tools/debugserver/scripts/Makefile @@ -0,0 +1,21 @@ +##===- tools/debugserver/scripts/Makefile ------------------*- Makefile -*-===## +# +# The LLVM Compiler Infrastructure +# +# This file is distributed under the University of Illinois Open Source +# License. See LICENSE.TXT for details. +# +##===----------------------------------------------------------------------===## + +LLDB_LEVEL := ../../.. + +include $(LLDB_LEVEL)/Makefile + +DBCONFIG_FILE = "$(PROJ_OBJ_DIR)/../DNBConfig.h" + +$(DBCONFIG_FILE): + SCRIPT_OUTPUT_FILE_0=$(DBCONFIG_FILE) perl $(PROJ_SRC_DIR)/dbgnub-config.pl + +all:: $(DBCONFIG_FILE) + +.PHONY: all
\ No newline at end of file diff --git a/lldb/tools/debugserver/scripts/dbgnub-config.pl b/lldb/tools/debugserver/scripts/dbgnub-config.pl index 910c5810d64..83e12b072d0 100644 --- a/lldb/tools/debugserver/scripts/dbgnub-config.pl +++ b/lldb/tools/debugserver/scripts/dbgnub-config.pl @@ -33,7 +33,7 @@ my $key; my $val; while (($key, $val) = each %ENV) { - $val =~ s/\n/\n\/\/ /; + $val =~ s/\n/\n\/\/ /g; printf CONFIG "// %s = %s\n", $key, $val; } print CONFIG "//" . "-" x 72 . "\n"; diff --git a/lldb/tools/debugserver/source/MacOSX/Makefile b/lldb/tools/debugserver/source/MacOSX/Makefile new file mode 100644 index 00000000000..d047444a9c8 --- /dev/null +++ b/lldb/tools/debugserver/source/MacOSX/Makefile @@ -0,0 +1,54 @@ +##===- tools/debugserver/source/MacOSX/Makefile ------------*- Makefile -*-===## +# +# The LLVM Compiler Infrastructure +# +# This file is distributed under the University of Illinois Open Source +# License. See LICENSE.TXT for details. +# +##===----------------------------------------------------------------------===## +LLDB_LEVEL := ../../../.. + +DIRS := i386 x86_64 + +TOOLNAME = debugserver + +CODESIGN_TOOLS := 1 + +TOOL_CODESIGN_IDENTITY := lldb_codesign + +LLVMLibsOptions += -llldbDebugserverCommon -llldbUtility -llldbDebugserverMacOSX_I386 -llldbDebugserverMacOSX_X86_64 \ + -framework Foundation -framework CoreFoundation + +GENERATED_MACH_SOURCES = $(PROJ_OBJ_DIR)/mach_excServer.c $(PROJ_OBJ_DIR)/mach_excUser.c + +SOURCES := CFBundle.cpp \ + CFData.cpp \ + CFString.cpp \ + MachException.cpp \ + MachProcess.cpp \ + MachTask.cpp \ + MachThread.cpp \ + MachThreadList.cpp \ + MachVMMemory.cpp \ + MachVMRegion.cpp + +BUILT_SOURCES = $(GENERATED_MACH_SOURCES) $(PROJ_OBJ_DIR)/HasAVX.o + +CPP.Flags += -I$(PROJ_OBJ_DIR)/../.. -I$(PROJ_SRC_DIR)/.. + +LD.Flags += -Wl,-sectcreate,__TEXT,__info_plist,$(PROJ_SRC_DIR)/../../resources/lldb-debugserver-Info.plist + +include $(LLDB_LEVEL)/Makefile + +ObjectsO += $(PROJ_OBJ_DIR)/HasAVX.o + +$(PROJ_OBJ_DIR)/HasAVX.o: $(PROJ_SRC_DIR)/HasAVX.s + $(Echo) "Compiling HasAVX.s for $(BuildMode) build" $(PIC_FLAG) + $(CC) $(TargetCommonOpts) $(CompileCommonOpts) -c $< -o $@ + +ifeq ($(HOST_OS),Darwin) +LLVMLibsOptions += -Wl,-rpath,@loader_path/../lib/ +endif + +$(GENERATED_MACH_SOURCES): + mig -I$(PROJ_OBJ_DIR)/../.. $(PROJ_SRC_DIR)/dbgnub-mig.defs
\ No newline at end of file diff --git a/lldb/tools/debugserver/source/MacOSX/i386/Makefile b/lldb/tools/debugserver/source/MacOSX/i386/Makefile new file mode 100644 index 00000000000..f770b19834b --- /dev/null +++ b/lldb/tools/debugserver/source/MacOSX/i386/Makefile @@ -0,0 +1,19 @@ +##===- tools/debugserver/source/MacOSX/i386/Makefile -------*- Makefile -*-===## +# +# The LLVM Compiler Infrastructure +# +# This file is distributed under the University of Illinois Open Source +# License. See LICENSE.TXT for details. +# +##===----------------------------------------------------------------------===## + +LLDB_LEVEL := ../../../../.. + +LIBRARYNAME := lldbDebugserverMacOSX_I386 +BUILD_ARCHIVE = 1 + +SOURCES := DNBArchImplI386.cpp + +include $(LLDB_LEVEL)/Makefile + +CPP.Flags += -I$(PROJ_SRC_DIR)/.. -I$(PROJ_SRC_DIR)/../.. -I$(PROJ_OBJ_DIR)/../../..
\ No newline at end of file diff --git a/lldb/tools/debugserver/source/MacOSX/x86_64/Makefile b/lldb/tools/debugserver/source/MacOSX/x86_64/Makefile new file mode 100644 index 00000000000..bf488c85924 --- /dev/null +++ b/lldb/tools/debugserver/source/MacOSX/x86_64/Makefile @@ -0,0 +1,19 @@ +##===- tools/debugserver/source/MacOSX/i386/Makefile -------*- Makefile -*-===## +# +# The LLVM Compiler Infrastructure +# +# This file is distributed under the University of Illinois Open Source +# License. See LICENSE.TXT for details. +# +##===----------------------------------------------------------------------===## + +LLDB_LEVEL := ../../../../.. + +LIBRARYNAME := lldbDebugserverMacOSX_X86_64 +BUILD_ARCHIVE = 1 + +SOURCES := DNBArchImplX86_64.cpp + +include $(LLDB_LEVEL)/Makefile + +CPP.Flags += -I$(PROJ_SRC_DIR)/.. -I$(PROJ_SRC_DIR)/../.. -I$(PROJ_OBJ_DIR)/../../..
\ No newline at end of file diff --git a/lldb/tools/debugserver/source/Makefile b/lldb/tools/debugserver/source/Makefile new file mode 100644 index 00000000000..9eaeab4d382 --- /dev/null +++ b/lldb/tools/debugserver/source/Makefile @@ -0,0 +1,46 @@ +##===- tools/debugserver/source/Makefile -------------------*- Makefile -*-===## +# +# The LLVM Compiler Infrastructure +# +# This file is distributed under the University of Illinois Open Source +# License. See LICENSE.TXT for details. +# +##===----------------------------------------------------------------------===## +LLDB_LEVEL := ../../.. + +LIBRARYNAME := lldbDebugserverCommon +BUILD_ARCHIVE = 1 + +SOURCES := debugserver.cpp \ + DNBArch.cpp \ + DNBBreakpoint.cpp \ + DNB.cpp \ + DNBDataRef.cpp \ + DNBError.cpp \ + DNBLog.cpp \ + DNBRegisterInfo.cpp \ + DNBThreadResumeActions.cpp \ + libdebugserver.cpp \ + PseudoTerminal.cpp \ + PThreadEvent.cpp \ + PThreadMutex.cpp \ + RNBContext.cpp \ + RNBRemote.cpp \ + RNBServices.cpp \ + RNBSocket.cpp \ + SysSignal.cpp \ + TTYState.cpp + +include $(LLDB_LEVEL)/Makefile + +ifeq ($(HOST_OS),Darwin) +DIRS := MacOSX/i386 MacOSX/x86_64 MacOSX +CPP.Flags += -I$(PROJ_SRC_DIR)/MacOSX +CPP.Flags += -I$(PROJ_OBJ_DIR)/.. +BUILT_SOURCES = debugserver_vers.c +endif + +ifeq ($(HOST_OS),Darwin) +debugserver_vers.c: $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/generate-vers.pl $(PROJ_SRC_DIR)/../debugserver.xcodeproj/project.pbxproj + "$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/generate-vers.pl" "$(PROJ_SRC_DIR)/../debugserver.xcodeproj/project.pbxproj" debugserver > debugserver_vers.c +endif |

