[Lldb-commits] [lldb] r229683 - Merge lldb-platform and lldb-gdbserver into a single binary
Tamas Berghammer
tberghammer at google.com
Wed Feb 18 07:39:42 PST 2015
Author: tberghammer
Date: Wed Feb 18 09:39:41 2015
New Revision: 229683
URL: http://llvm.org/viewvc/llvm-project?rev=229683&view=rev
Log:
Merge lldb-platform and lldb-gdbserver into a single binary
This commit merges lldb-platform and lldb-gdbserver into a single binary
of the same size as each of the previous individual binaries. Execution
mode is controlled by the first argument being either platform or
gdbserver.
Patch from: flackr <flackr at google.com>
Differential revision: http://reviews.llvm.org/D7545
Added:
lldb/trunk/tools/lldb-server/
lldb/trunk/tools/lldb-server/CMakeLists.txt
- copied, changed from r229682, lldb/trunk/tools/lldb-gdbserver/CMakeLists.txt
lldb/trunk/tools/lldb-server/Makefile
- copied, changed from r229682, lldb/trunk/tools/lldb-platform/Makefile
lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp
- copied, changed from r229682, lldb/trunk/tools/lldb-gdbserver/lldb-gdbserver.cpp
lldb/trunk/tools/lldb-server/lldb-platform.cpp
- copied, changed from r229682, lldb/trunk/tools/lldb-platform/lldb-platform.cpp
lldb/trunk/tools/lldb-server/lldb-server.cpp
Removed:
lldb/trunk/tools/lldb-gdbserver/CMakeLists.txt
lldb/trunk/tools/lldb-gdbserver/Makefile
lldb/trunk/tools/lldb-gdbserver/lldb-gdbserver.cpp
lldb/trunk/tools/lldb-platform/CMakeLists.txt
lldb/trunk/tools/lldb-platform/Makefile
lldb/trunk/tools/lldb-platform/lldb-platform.cpp
Modified:
lldb/trunk/lldb.xcodeproj/project.pbxproj
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
lldb/trunk/test/tools/lldb-gdbserver/gdbremote_testcase.py
lldb/trunk/test/tools/lldb-gdbserver/lldbgdbserverutils.py
lldb/trunk/tools/CMakeLists.txt
lldb/trunk/tools/Makefile
Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=229683&r1=229682&r2=229683&view=diff
==============================================================================
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Wed Feb 18 09:39:41 2015
@@ -97,9 +97,7 @@
254FBBA31A9166F100BD6378 /* SBAttachInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 254FBBA21A9166F100BD6378 /* SBAttachInfo.h */; settings = {ATTRIBUTES = (Public, ); }; };
254FBBA51A91670E00BD6378 /* SBAttachInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 254FBBA41A91670E00BD6378 /* SBAttachInfo.cpp */; };
260157C61885F51C00F875CF /* libpanel.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 260157C41885F4FF00F875CF /* libpanel.dylib */; };
- 260157C71885F52500F875CF /* libpanel.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 260157C41885F4FF00F875CF /* libpanel.dylib */; };
260157C81885F53100F875CF /* libpanel.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 260157C41885F4FF00F875CF /* libpanel.dylib */; };
- 2606EDDE184E68940034641B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 260C876910F538E700BB2B04 /* Foundation.framework */; };
2606EDDF184E68A10034641B /* liblldb-core.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2689FFCA13353D7A00698AC0 /* liblldb-core.a */; };
260A248E15D06C50009981B0 /* OptionValues.h in Headers */ = {isa = PBXBuildFile; fileRef = 260A248D15D06C4F009981B0 /* OptionValues.h */; };
260A39A619647A3A004B4130 /* Pipe.h in Headers */ = {isa = PBXBuildFile; fileRef = 260A39A519647A3A004B4130 /* Pipe.h */; };
@@ -322,7 +320,6 @@
26744EF11338317700EF765A /* GDBRemoteCommunicationClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26744EED1338317700EF765A /* GDBRemoteCommunicationClient.cpp */; };
26744EF31338317700EF765A /* GDBRemoteCommunicationServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26744EEF1338317700EF765A /* GDBRemoteCommunicationServer.cpp */; };
26780C611867C33D00234593 /* libncurses.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 2670F8111862B44A006B332C /* libncurses.dylib */; };
- 26780C651867C34500234593 /* libncurses.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 2670F8111862B44A006B332C /* libncurses.dylib */; };
267C012B136880DF006E963E /* OptionGroupValueObjectDisplay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 267C012A136880DF006E963E /* OptionGroupValueObjectDisplay.cpp */; };
267C01371368C49C006E963E /* OptionGroupOutputFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BCFC531368B3E4006DC050 /* OptionGroupOutputFile.cpp */; };
268648C416531BF800F04704 /* com.apple.debugserver.posix.plist in CopyFiles */ = {isa = PBXBuildFile; fileRef = 268648C116531BF800F04704 /* com.apple.debugserver.posix.plist */; };
@@ -630,7 +627,6 @@
26CEB5F318762056008F575A /* CommandObjectGUI.h in Headers */ = {isa = PBXBuildFile; fileRef = 26CEB5F118762056008F575A /* CommandObjectGUI.h */; };
26CFDCA11861638D000E63E5 /* Editline.h in Headers */ = {isa = PBXBuildFile; fileRef = 26CFDCA01861638D000E63E5 /* Editline.h */; };
26CFDCA3186163A4000E63E5 /* Editline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26CFDCA2186163A4000E63E5 /* Editline.cpp */; };
- 26CFDCA71861646C000E63E5 /* libedit.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 26F5C32A10F3DFDD009D5894 /* libedit.dylib */; };
26CFDCA818616473000E63E5 /* libedit.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 26F5C32A10F3DFDD009D5894 /* libedit.dylib */; };
26D1803E16CEBFD300EDFB5B /* KQueue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26D1803C16CEBFD300EDFB5B /* KQueue.cpp */; };
26D1804216CEDF0700EDFB5B /* TimeSpecTimeout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26D1804016CEDF0700EDFB5B /* TimeSpecTimeout.cpp */; };
@@ -641,8 +637,6 @@
26D55235159A7DB100708D8D /* libxml2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 26D55234159A7DB100708D8D /* libxml2.dylib */; };
26D5E15F135BAEA2006EA0A7 /* OptionGroupArchitecture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26D5E15E135BAEA2006EA0A7 /* OptionGroupArchitecture.cpp */; };
26D5E163135BB054006EA0A7 /* OptionGroupPlatform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26D5E162135BB054006EA0A7 /* OptionGroupPlatform.cpp */; };
- 26D6F3F6183E7F9300194858 /* lldb-gdbserver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26D6F3F4183E7F9300194858 /* lldb-gdbserver.cpp */; };
- 26D6F3FA183E888800194858 /* liblldb-core.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2689FFCA13353D7A00698AC0 /* liblldb-core.a */; };
26D7E45D13D5E30A007FD12B /* SocketAddress.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26D7E45C13D5E30A007FD12B /* SocketAddress.cpp */; };
26DAED6015D327A200E15819 /* OptionValuePathMappings.h in Headers */ = {isa = PBXBuildFile; fileRef = 26DAED5F15D327A200E15819 /* OptionValuePathMappings.h */; };
26DAED6315D327C200E15819 /* OptionValuePathMappings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26DAED6215D327C200E15819 /* OptionValuePathMappings.cpp */; };
@@ -822,7 +816,7 @@
94D6A0AA16CEB55F00833B6E /* NSArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94D6A0A716CEB55F00833B6E /* NSArray.cpp */; };
94D6A0AB16CEB55F00833B6E /* NSDictionary.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94D6A0A816CEB55F00833B6E /* NSDictionary.cpp */; };
94D6A0AC16CEB55F00833B6E /* NSSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94D6A0A916CEB55F00833B6E /* NSSet.cpp */; };
- 94E829CA152D33C1006F96A3 /* lldb-platform in Resources */ = {isa = PBXBuildFile; fileRef = 26DC6A101337FE6900FF7998 /* lldb-platform */; };
+ 94E829CA152D33C1006F96A3 /* lldb-server in Resources */ = {isa = PBXBuildFile; fileRef = 26DC6A101337FE6900FF7998 /* lldb-server */; };
94EA1D5C15E6C9B400D4171A /* PythonDataObjects.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94EA1D5B15E6C9B400D4171A /* PythonDataObjects.cpp */; };
94EA27CE17DE91750070F505 /* LibCxxUnorderedMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94EA27CD17DE91750070F505 /* LibCxxUnorderedMap.cpp */; };
94F48F251A01C687005C0EC6 /* StringPrinter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94F48F241A01C687005C0EC6 /* StringPrinter.cpp */; };
@@ -831,7 +825,6 @@
964463EE1A330C1B00154ED8 /* CompactUnwindInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 964463ED1A330C1B00154ED8 /* CompactUnwindInfo.h */; };
966C6B7918E6A56A0093F5EC /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 966C6B7818E6A56A0093F5EC /* libz.dylib */; };
966C6B7A18E6A56A0093F5EC /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 966C6B7818E6A56A0093F5EC /* libz.dylib */; };
- 966C6B7B18E6A56A0093F5EC /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 966C6B7818E6A56A0093F5EC /* libz.dylib */; };
966C6B7C18E6A56A0093F5EC /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 966C6B7818E6A56A0093F5EC /* libz.dylib */; };
9A19A6AF1163BBB200E0D453 /* SBValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A19A6A51163BB7E00E0D453 /* SBValue.h */; settings = {ATTRIBUTES = (Public, ); }; };
9A19A6B01163BBB300E0D453 /* SBValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A19A6AD1163BB9800E0D453 /* SBValue.cpp */; };
@@ -917,6 +910,8 @@
B2A58724143119D50092BFBA /* SBWatchpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2A58723143119D50092BFBA /* SBWatchpoint.cpp */; };
B2B7CCEB15D1BD6700EEFB57 /* CommandObjectWatchpointCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2B7CCEA15D1BD6600EEFB57 /* CommandObjectWatchpointCommand.cpp */; };
B2B7CCF015D1C20F00EEFB57 /* WatchpointOptions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2B7CCEF15D1C20F00EEFB57 /* WatchpointOptions.cpp */; };
+ E769331C1A94D15400C73337 /* lldb-gdbserver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26D6F3F4183E7F9300194858 /* lldb-gdbserver.cpp */; };
+ E769331E1A94D18100C73337 /* lldb-server.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E769331D1A94D18100C73337 /* lldb-server.cpp */; };
ED4AFF45199C2218004FFDC6 /* com.apple.lldb.launcherRootXPCService.xpc in CopyFiles */ = {isa = PBXBuildFile; fileRef = EDE274EC14EDCE1F005B0F75 /* com.apple.lldb.launcherRootXPCService.xpc */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
ED4AFF46199C2224004FFDC6 /* com.apple.lldb.launcherXPCService.xpc in CopyFiles */ = {isa = PBXBuildFile; fileRef = EDC6D49914E5C19B001B75F8 /* com.apple.lldb.launcherXPCService.xpc */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
ED88244E15114A9200BC98B9 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EDB919B414F6F10D008FF64B /* Security.framework */; };
@@ -1046,13 +1041,6 @@
remoteGlobalIDString = 26F5C26910F3D9A4009D5894;
remoteInfo = "lldb-tool";
};
- 26D6F3F8183E80BD00194858 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = 2689FFC913353D7A00698AC0;
- remoteInfo = "lldb-core";
- };
26DC6A151337FE7300FF7998 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
@@ -1086,20 +1074,11 @@
containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 26DC6A0F1337FE6900FF7998;
- remoteInfo = "lldb-platform";
+ remoteInfo = "lldb-server";
};
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
- 26D6F3E5183E7F4E00194858 /* CopyFiles */ = {
- isa = PBXCopyFilesBuildPhase;
- buildActionMask = 2147483647;
- dstPath = /usr/share/man/man1/;
- dstSubfolderSpec = 0;
- files = (
- );
- runOnlyForDeploymentPostprocessing = 1;
- };
940B04E31A89875C0045D5F7 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
@@ -2091,8 +2070,7 @@
26D5E160135BAEB0006EA0A7 /* OptionGroupArchitecture.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionGroupArchitecture.h; path = include/lldb/Interpreter/OptionGroupArchitecture.h; sourceTree = "<group>"; };
26D5E161135BB040006EA0A7 /* OptionGroupPlatform.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionGroupPlatform.h; path = include/lldb/Interpreter/OptionGroupPlatform.h; sourceTree = "<group>"; };
26D5E162135BB054006EA0A7 /* OptionGroupPlatform.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionGroupPlatform.cpp; path = source/Interpreter/OptionGroupPlatform.cpp; sourceTree = "<group>"; };
- 26D6F3E7183E7F4E00194858 /* lldb-gdbserver */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "lldb-gdbserver"; sourceTree = BUILT_PRODUCTS_DIR; };
- 26D6F3F4183E7F9300194858 /* lldb-gdbserver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "lldb-gdbserver.cpp"; sourceTree = "<group>"; };
+ 26D6F3F4183E7F9300194858 /* lldb-gdbserver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "lldb-gdbserver.cpp"; path = "tools/lldb-server/lldb-gdbserver.cpp"; sourceTree = "<group>"; };
26D7E45B13D5E2F9007FD12B /* SocketAddress.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SocketAddress.h; path = include/lldb/Host/SocketAddress.h; sourceTree = "<group>"; };
26D7E45C13D5E30A007FD12B /* SocketAddress.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SocketAddress.cpp; path = source/Host/common/SocketAddress.cpp; sourceTree = "<group>"; };
26D9FDC612F784E60003F2EE /* EmulateInstruction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EmulateInstruction.h; path = include/lldb/Core/EmulateInstruction.h; sourceTree = "<group>"; };
@@ -2108,8 +2086,8 @@
26DB3E101379E7AD0080DC73 /* ABIMacOSX_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ABIMacOSX_i386.h; sourceTree = "<group>"; };
26DB3E131379E7AD0080DC73 /* ABISysV_x86_64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ABISysV_x86_64.cpp; sourceTree = "<group>"; };
26DB3E141379E7AD0080DC73 /* ABISysV_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ABISysV_x86_64.h; sourceTree = "<group>"; };
- 26DC6A101337FE6900FF7998 /* lldb-platform */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "lldb-platform"; sourceTree = BUILT_PRODUCTS_DIR; };
- 26DC6A1C1337FECA00FF7998 /* lldb-platform.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "lldb-platform.cpp"; path = "tools/lldb-platform/lldb-platform.cpp"; sourceTree = "<group>"; };
+ 26DC6A101337FE6900FF7998 /* lldb-server */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "lldb-server"; sourceTree = BUILT_PRODUCTS_DIR; };
+ 26DC6A1C1337FECA00FF7998 /* lldb-platform.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "lldb-platform.cpp"; path = "tools/lldb-server/lldb-platform.cpp"; sourceTree = "<group>"; };
26DE1E6A11616C2E00A093E2 /* lldb-forward.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; name = "lldb-forward.h"; path = "include/lldb/lldb-forward.h"; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
26DE204011618AB900A093E2 /* SBSymbolContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBSymbolContext.h; path = include/lldb/API/SBSymbolContext.h; sourceTree = "<group>"; };
26DE204211618ACA00A093E2 /* SBAddress.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBAddress.h; path = include/lldb/API/SBAddress.h; sourceTree = "<group>"; };
@@ -2671,6 +2649,7 @@
B2B7CCED15D1BFB700EEFB57 /* WatchpointOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WatchpointOptions.h; path = include/lldb/Breakpoint/WatchpointOptions.h; sourceTree = "<group>"; };
B2B7CCEF15D1C20F00EEFB57 /* WatchpointOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WatchpointOptions.cpp; path = source/Breakpoint/WatchpointOptions.cpp; sourceTree = "<group>"; };
B2D3033612EFA5C500F84EB3 /* InstructionUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InstructionUtils.h; path = Utility/InstructionUtils.h; sourceTree = "<group>"; };
+ E769331D1A94D18100C73337 /* lldb-server.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "lldb-server.cpp"; path = "tools/lldb-server/lldb-server.cpp"; sourceTree = "<group>"; };
ED88244F15114CA200BC98B9 /* main.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = main.mm; sourceTree = "<group>"; };
ED88245215114CFC00BC98B9 /* LauncherRootXPCService.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LauncherRootXPCService.mm; sourceTree = "<group>"; };
EDB919B214F6EC85008FF64B /* LauncherXPCService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LauncherXPCService.h; sourceTree = "<group>"; };
@@ -2722,19 +2701,6 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
- 26D6F3E4183E7F4E00194858 /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 260157C71885F52500F875CF /* libpanel.dylib in Frameworks */,
- 26780C651867C34500234593 /* libncurses.dylib in Frameworks */,
- 26CFDCA71861646C000E63E5 /* libedit.dylib in Frameworks */,
- 26D6F3FA183E888800194858 /* liblldb-core.a in Frameworks */,
- 2606EDDE184E68940034641B /* Foundation.framework in Frameworks */,
- 966C6B7B18E6A56A0093F5EC /* libz.dylib in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
26DC6A0E1337FE6900FF7998 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
@@ -2839,10 +2805,9 @@
26F5C26A10F3D9A4009D5894 /* lldb */,
26680207115FD0ED008E1FE4 /* LLDB.framework */,
26579F68126A25920007C5CB /* darwin-debug */,
- 26DC6A101337FE6900FF7998 /* lldb-platform */,
+ 26DC6A101337FE6900FF7998 /* lldb-server */,
EDC6D49914E5C19B001B75F8 /* com.apple.lldb.launcherXPCService.xpc */,
EDE274EC14EDCE1F005B0F75 /* com.apple.lldb.launcherRootXPCService.xpc */,
- 26D6F3E7183E7F4E00194858 /* lldb-gdbserver */,
2690CD171A6DC0D000E717C8 /* lldb-mi */,
942829C01A89835300521B30 /* argdumper */,
);
@@ -4623,15 +4588,6 @@
path = MacOSX;
sourceTree = "<group>";
};
- 26D6F3F2183E7F9300194858 /* lldb-gdbserver */ = {
- isa = PBXGroup;
- children = (
- 26D6F3F4183E7F9300194858 /* lldb-gdbserver.cpp */,
- );
- name = "lldb-gdbserver";
- path = "tools/lldb-gdbserver";
- sourceTree = "<group>";
- };
26D9FDCA12F785120003F2EE /* Instruction */ = {
isa = PBXGroup;
children = (
@@ -4701,14 +4657,6 @@
path = "SysV-x86_64";
sourceTree = "<group>";
};
- 26DC6A1B1337FEA400FF7998 /* lldb-platform */ = {
- isa = PBXGroup;
- children = (
- 26DC6A1C1337FECA00FF7998 /* lldb-platform.cpp */,
- );
- name = "lldb-platform";
- sourceTree = "<group>";
- };
26E152221419CACA007967D0 /* PECOFF */ = {
isa = PBXGroup;
children = (
@@ -4730,13 +4678,12 @@
26F5C22410F3D950009D5894 /* Tools */ = {
isa = PBXGroup;
children = (
+ E769331B1A94D10E00C73337 /* lldb-server */,
942829BA1A89830900521B30 /* argdumper */,
26579F55126A255E0007C5CB /* darwin-debug */,
265E9BE0115C2B8500D0DCCB /* debugserver */,
26F5C22510F3D956009D5894 /* Driver */,
2665CD0915080846002C8FAE /* install-headers */,
- 26D6F3F2183E7F9300194858 /* lldb-gdbserver */,
- 26DC6A1B1337FEA400FF7998 /* lldb-platform */,
);
name = Tools;
sourceTree = "<group>";
@@ -5145,6 +5092,16 @@
name = "SysV-ppc64";
sourceTree = "<group>";
};
+ E769331B1A94D10E00C73337 /* lldb-server */ = {
+ isa = PBXGroup;
+ children = (
+ E769331D1A94D18100C73337 /* lldb-server.cpp */,
+ 26DC6A1C1337FECA00FF7998 /* lldb-platform.cpp */,
+ 26D6F3F4183E7F9300194858 /* lldb-gdbserver.cpp */,
+ );
+ name = "lldb-server";
+ sourceTree = "<group>";
+ };
EDC6D49114E5C15C001B75F8 /* launcherXPCService */ = {
isa = PBXGroup;
children = (
@@ -5458,27 +5415,9 @@
productReference = 2690CD171A6DC0D000E717C8 /* lldb-mi */;
productType = "com.apple.product-type.tool";
};
- 26D6F3E6183E7F4E00194858 /* lldb-gdbserver */ = {
+ 26DC6A0F1337FE6900FF7998 /* lldb-server */ = {
isa = PBXNativeTarget;
- buildConfigurationList = 26D6F3F1183E7F4F00194858 /* Build configuration list for PBXNativeTarget "lldb-gdbserver" */;
- buildPhases = (
- 26D6F3E3183E7F4E00194858 /* Sources */,
- 26D6F3E4183E7F4E00194858 /* Frameworks */,
- 26D6F3E5183E7F4E00194858 /* CopyFiles */,
- );
- buildRules = (
- );
- dependencies = (
- 26D6F3F9183E80BD00194858 /* PBXTargetDependency */,
- );
- name = "lldb-gdbserver";
- productName = "lldb-gdbserver";
- productReference = 26D6F3E7183E7F4E00194858 /* lldb-gdbserver */;
- productType = "com.apple.product-type.tool";
- };
- 26DC6A0F1337FE6900FF7998 /* lldb-platform */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = 26DC6A1A1337FE8B00FF7998 /* Build configuration list for PBXNativeTarget "lldb-platform" */;
+ buildConfigurationList = 26DC6A1A1337FE8B00FF7998 /* Build configuration list for PBXNativeTarget "lldb-server" */;
buildPhases = (
26DC6A0D1337FE6900FF7998 /* Sources */,
26DC6A0E1337FE6900FF7998 /* Frameworks */,
@@ -5489,9 +5428,9 @@
dependencies = (
26DC6A161337FE7300FF7998 /* PBXTargetDependency */,
);
- name = "lldb-platform";
- productName = "lldb-platform";
- productReference = 26DC6A101337FE6900FF7998 /* lldb-platform */;
+ name = "lldb-server";
+ productName = "lldb-server";
+ productReference = 26DC6A101337FE6900FF7998 /* lldb-server */;
productType = "com.apple.product-type.tool";
};
26F5C26910F3D9A4009D5894 /* lldb-tool */ = {
@@ -5605,8 +5544,7 @@
26680206115FD0ED008E1FE4 /* LLDB */,
26579F67126A25920007C5CB /* darwin-debug */,
2689FFC913353D7A00698AC0 /* lldb-core */,
- 26D6F3E6183E7F4E00194858 /* lldb-gdbserver */,
- 26DC6A0F1337FE6900FF7998 /* lldb-platform */,
+ 26DC6A0F1337FE6900FF7998 /* lldb-server */,
EDC6D49814E5C19B001B75F8 /* launcherXPCService */,
EDE274E214EDCE1F005B0F75 /* launcherRootXPCService */,
2687EAC51508110B00DD8C2E /* install-headers */,
@@ -5633,7 +5571,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
- 94E829CA152D33C1006F96A3 /* lldb-platform in Resources */,
+ 94E829CA152D33C1006F96A3 /* lldb-server in Resources */,
262CFC7711A4510000946C6C /* debugserver in Resources */,
26368AF7126B960500E8659F /* darwin-debug in Resources */,
);
@@ -6443,19 +6381,13 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
- 26D6F3E3183E7F4E00194858 /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 26D6F3F6183E7F9300194858 /* lldb-gdbserver.cpp in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
26DC6A0D1337FE6900FF7998 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
+ E769331C1A94D15400C73337 /* lldb-gdbserver.cpp in Sources */,
26DC6A1D1337FECA00FF7998 /* lldb-platform.cpp in Sources */,
+ E769331E1A94D18100C73337 /* lldb-server.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -6577,11 +6509,6 @@
target = 26F5C26910F3D9A4009D5894 /* lldb-tool */;
targetProxy = 26CEF3C114FD5973007286B2 /* PBXContainerItemProxy */;
};
- 26D6F3F9183E80BD00194858 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = 2689FFC913353D7A00698AC0 /* lldb-core */;
- targetProxy = 26D6F3F8183E80BD00194858 /* PBXContainerItemProxy */;
- };
26DC6A161337FE7300FF7998 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 2689FFC913353D7A00698AC0 /* lldb-core */;
@@ -6604,7 +6531,7 @@
};
94E829C9152D33B4006F96A3 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
- target = 26DC6A0F1337FE6900FF7998 /* lldb-platform */;
+ target = 26DC6A0F1337FE6900FF7998 /* lldb-server */;
targetProxy = 94E829C8152D33B4006F96A3 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
@@ -7654,295 +7581,13 @@
};
name = BuildAndIntegration;
};
- 26D6F3ED183E7F4F00194858 /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- CLANG_ENABLE_OBJC_ARC = YES;
- CLANG_WARN_BOOL_CONVERSION = YES;
- CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
- CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
- "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "-";
- "CODE_SIGN_IDENTITY[sdk=macosx*]" = lldb_codesign;
- DEAD_CODE_STRIPPING = YES;
- EXPORTED_SYMBOLS_FILE = "tools/lldb-gdbserver/exports";
- FRAMEWORK_SEARCH_PATHS = (
- "$(inherited)",
- "\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"",
- );
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_DYNAMIC_NO_PIC = NO;
- GCC_ENABLE_CPP_RTTI = NO;
- GCC_ENABLE_OBJC_EXCEPTIONS = YES;
- GCC_INLINES_ARE_PRIVATE_EXTERN = NO;
- GCC_PREPROCESSOR_DEFINITIONS = (
- "DEBUG=1",
- "$(inherited)",
- );
- GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
- GCC_WARN_UNDECLARED_SELECTOR = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
- INFOPLIST_PREPROCESSOR_DEFINITIONS = (
- "-lobjc",
- "-lpython",
- "-framework",
- DebugSymbols,
- "-framework",
- Carbon,
- "-framework",
- Foundation,
- "-framework",
- AppKit,
- "-v",
- "-Wl,-v",
- );
- LIBRARY_SEARCH_PATHS = (
- "$(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)",
- "$(inherited)",
- );
- OTHER_LDFLAGS = (
- "-lllvmclang",
- "-lpython",
- "-lxml2",
- "-framework",
- DebugSymbols,
- "-framework",
- Carbon,
- "-framework",
- Foundation,
- "-framework",
- Security,
- );
- "OTHER_LDFLAGS[sdk=iphoneos*][arch=*]" = (
- "-lllvmclang",
- "-lxml2",
- "-framework",
- Foundation,
- "-framework",
- UIKit,
- );
- PRODUCT_NAME = "$(TARGET_NAME)";
- SKIP_INSTALL = YES;
- USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source $(LLVM_SOURCE_DIR)/include $(LLVM_SOURCE_DIR)/tools/clang/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include";
- };
- name = Debug;
- };
- 26D6F3EE183E7F4F00194858 /* DebugClang */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- CLANG_ENABLE_OBJC_ARC = YES;
- CLANG_WARN_BOOL_CONVERSION = YES;
- CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
- CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
- "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "-";
- "CODE_SIGN_IDENTITY[sdk=macosx*]" = lldb_codesign;
- DEAD_CODE_STRIPPING = YES;
- EXPORTED_SYMBOLS_FILE = "tools/lldb-gdbserver/exports";
- FRAMEWORK_SEARCH_PATHS = (
- "$(inherited)",
- "\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"",
- );
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_DYNAMIC_NO_PIC = NO;
- GCC_ENABLE_CPP_RTTI = NO;
- GCC_ENABLE_OBJC_EXCEPTIONS = YES;
- GCC_INLINES_ARE_PRIVATE_EXTERN = NO;
- GCC_PREPROCESSOR_DEFINITIONS = (
- "DEBUG=1",
- "$(inherited)",
- );
- GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
- GCC_WARN_UNDECLARED_SELECTOR = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
- INFOPLIST_PREPROCESSOR_DEFINITIONS = (
- "-lobjc",
- "-lpython",
- "-framework",
- DebugSymbols,
- "-framework",
- Carbon,
- "-framework",
- Foundation,
- "-framework",
- AppKit,
- "-v",
- "-Wl,-v",
- );
- LIBRARY_SEARCH_PATHS = (
- "$(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)",
- "$(inherited)",
- );
- OTHER_LDFLAGS = (
- "-lllvmclang",
- "-lpython",
- "-lxml2",
- "-framework",
- DebugSymbols,
- "-framework",
- Carbon,
- "-framework",
- Foundation,
- "-framework",
- Security,
- );
- "OTHER_LDFLAGS[sdk=iphoneos*][arch=*]" = (
- "-lllvmclang",
- "-lxml2",
- "-framework",
- Foundation,
- "-framework",
- UIKit,
- );
- PRODUCT_NAME = "$(TARGET_NAME)";
- SKIP_INSTALL = YES;
- USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source $(LLVM_SOURCE_DIR)/include $(LLVM_SOURCE_DIR)/tools/clang/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include";
- };
- name = DebugClang;
- };
- 26D6F3EF183E7F4F00194858 /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- CLANG_ENABLE_OBJC_ARC = YES;
- CLANG_WARN_BOOL_CONVERSION = YES;
- CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
- CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
- "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "-";
- "CODE_SIGN_IDENTITY[sdk=macosx*]" = lldb_codesign;
- COPY_PHASE_STRIP = NO;
- DEAD_CODE_STRIPPING = YES;
- ENABLE_NS_ASSERTIONS = NO;
- EXPORTED_SYMBOLS_FILE = "tools/lldb-gdbserver/exports";
- FRAMEWORK_SEARCH_PATHS = (
- "$(inherited)",
- "\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"",
- );
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_ENABLE_CPP_RTTI = NO;
- GCC_ENABLE_OBJC_EXCEPTIONS = YES;
- GCC_INLINES_ARE_PRIVATE_EXTERN = NO;
- GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
- GCC_WARN_UNDECLARED_SELECTOR = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
- INFOPLIST_PREPROCESSOR_DEFINITIONS = (
- "-lobjc",
- "-lpython",
- "-framework",
- DebugSymbols,
- "-framework",
- Carbon,
- "-framework",
- Foundation,
- "-framework",
- AppKit,
- "-v",
- "-Wl,-v",
- );
- LIBRARY_SEARCH_PATHS = (
- "$(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)",
- "$(inherited)",
- );
- OTHER_LDFLAGS = (
- "-lllvmclang",
- "-lpython",
- "-lxml2",
- "-framework",
- DebugSymbols,
- "-framework",
- Carbon,
- "-framework",
- Foundation,
- "-framework",
- Security,
- );
- "OTHER_LDFLAGS[sdk=iphoneos*][arch=*]" = (
- "-lllvmclang",
- "-lxml2",
- "-framework",
- Foundation,
- "-framework",
- UIKit,
- );
- PRODUCT_NAME = "$(TARGET_NAME)";
- SKIP_INSTALL = YES;
- USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source $(LLVM_SOURCE_DIR)/include $(LLVM_SOURCE_DIR)/tools/clang/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include";
- };
- name = Release;
- };
- 26D6F3F0183E7F4F00194858 /* BuildAndIntegration */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- CLANG_ENABLE_OBJC_ARC = YES;
- CLANG_WARN_BOOL_CONVERSION = YES;
- CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
- CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
- COPY_PHASE_STRIP = YES;
- DEAD_CODE_STRIPPING = YES;
- ENABLE_NS_ASSERTIONS = NO;
- EXPORTED_SYMBOLS_FILE = "tools/lldb-gdbserver/exports";
- FRAMEWORK_SEARCH_PATHS = (
- "$(inherited)",
- "\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"",
- );
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_ENABLE_CPP_RTTI = NO;
- GCC_ENABLE_OBJC_EXCEPTIONS = YES;
- GCC_INLINES_ARE_PRIVATE_EXTERN = NO;
- GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
- GCC_WARN_UNDECLARED_SELECTOR = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
- INFOPLIST_PREPROCESSOR_DEFINITIONS = (
- "-lobjc",
- "-lpython",
- "-framework",
- DebugSymbols,
- "-framework",
- Carbon,
- "-framework",
- Foundation,
- "-framework",
- AppKit,
- "-v",
- "-Wl,-v",
- );
- INSTALL_PATH = "$(LLDB_FRAMEWORK_INSTALL_DIR)/LLDB.framework/Resources";
- LIBRARY_SEARCH_PATHS = (
- "$(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)",
- "$(inherited)",
- );
- OTHER_LDFLAGS = (
- "-lllvmclang",
- "-lpython",
- "-lxml2",
- "-framework",
- DebugSymbols,
- "-framework",
- Carbon,
- "-framework",
- Foundation,
- "-framework",
- Security,
- );
- "OTHER_LDFLAGS[sdk=iphoneos*][arch=*]" = (
- "-lllvmclang",
- "-lxml2",
- "-framework",
- Foundation,
- "-framework",
- UIKit,
- );
- PRODUCT_NAME = "$(TARGET_NAME)";
- SKIP_INSTALL = YES;
- STRIP_INSTALLED_PRODUCT = YES;
- USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source $(LLVM_SOURCE_DIR)/include $(LLVM_SOURCE_DIR)/tools/clang/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include";
- };
- name = BuildAndIntegration;
- };
26DC6A121337FE6A00FF7998 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "-";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "";
DEAD_CODE_STRIPPING = YES;
- EXPORTED_SYMBOLS_FILE = "tools/lldb-platform/exports";
+ EXPORTED_SYMBOLS_FILE = "tools/lldb-server/exports";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"",
@@ -8003,7 +7648,7 @@
"-framework",
Foundation,
);
- PRODUCT_NAME = "lldb-platform";
+ PRODUCT_NAME = "lldb-server";
SKIP_INSTALL = YES;
USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source $(LLVM_SOURCE_DIR)/include $(LLVM_SOURCE_DIR)/tools/clang/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include";
};
@@ -8015,7 +7660,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "-";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "";
DEAD_CODE_STRIPPING = YES;
- EXPORTED_SYMBOLS_FILE = "tools/lldb-platform/exports";
+ EXPORTED_SYMBOLS_FILE = "tools/lldb-server/exports";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"",
@@ -8074,7 +7719,7 @@
"-framework",
Foundation,
);
- PRODUCT_NAME = "lldb-platform";
+ PRODUCT_NAME = "lldb-server";
SKIP_INSTALL = YES;
USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source $(LLVM_SOURCE_DIR)/include $(LLVM_SOURCE_DIR)/tools/clang/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include";
};
@@ -8085,7 +7730,7 @@
buildSettings = {
COPY_PHASE_STRIP = YES;
DEAD_CODE_STRIPPING = YES;
- EXPORTED_SYMBOLS_FILE = "tools/lldb-platform/exports";
+ EXPORTED_SYMBOLS_FILE = "tools/lldb-server/exports";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"",
@@ -8145,7 +7790,7 @@
"-framework",
Foundation,
);
- PRODUCT_NAME = "lldb-platform";
+ PRODUCT_NAME = "lldb-server";
SKIP_INSTALL = YES;
STRIP_INSTALLED_PRODUCT = YES;
USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source $(LLVM_SOURCE_DIR)/include $(LLVM_SOURCE_DIR)/tools/clang/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include";
@@ -8465,7 +8110,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "-";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "";
DEAD_CODE_STRIPPING = YES;
- EXPORTED_SYMBOLS_FILE = "tools/lldb-platform/exports";
+ EXPORTED_SYMBOLS_FILE = "tools/lldb-server/exports";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"",
@@ -8526,7 +8171,7 @@
"-framework",
Foundation,
);
- PRODUCT_NAME = "lldb-platform";
+ PRODUCT_NAME = "lldb-server";
SKIP_INSTALL = YES;
USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source $(LLVM_SOURCE_DIR)/include $(LLVM_SOURCE_DIR)/tools/clang/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include";
};
@@ -9183,18 +8828,7 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = BuildAndIntegration;
};
- 26D6F3F1183E7F4F00194858 /* Build configuration list for PBXNativeTarget "lldb-gdbserver" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 26D6F3ED183E7F4F00194858 /* Debug */,
- 26D6F3EE183E7F4F00194858 /* DebugClang */,
- 26D6F3EF183E7F4F00194858 /* Release */,
- 26D6F3F0183E7F4F00194858 /* BuildAndIntegration */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = BuildAndIntegration;
- };
- 26DC6A1A1337FE8B00FF7998 /* Build configuration list for PBXNativeTarget "lldb-platform" */ = {
+ 26DC6A1A1337FE8B00FF7998 /* Build configuration list for PBXNativeTarget "lldb-server" */ = {
isa = XCConfigurationList;
buildConfigurations = (
26DC6A121337FE6A00FF7998 /* Debug */,
Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp?rev=229683&r1=229682&r2=229683&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp Wed Feb 18 09:39:41 2015
@@ -38,7 +38,7 @@
#if defined(__APPLE__)
# define DEBUGSERVER_BASENAME "debugserver"
#else
-# define DEBUGSERVER_BASENAME "lldb-gdbserver"
+# define DEBUGSERVER_BASENAME "lldb-server"
#endif
using namespace lldb;
@@ -739,10 +739,15 @@ GDBRemoteCommunication::StartDebugserver
Args &debugserver_args = launch_info.GetArguments();
debugserver_args.Clear();
char arg_cstr[PATH_MAX];
-
+
// Start args with "debugserver /file/path -r --"
debugserver_args.AppendArgument(debugserver_path);
+#if !defined(__APPLE__)
+ // First argument to lldb-server must be mode in which to run.
+ debugserver_args.AppendArgument("gdbserver");
+#endif
+
// If a host and port is supplied then use it
char host_and_port[128];
if (hostname)
Modified: lldb/trunk/test/tools/lldb-gdbserver/gdbremote_testcase.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-gdbserver/gdbremote_testcase.py?rev=229683&r1=229682&r2=229683&view=diff
==============================================================================
--- lldb/trunk/test/tools/lldb-gdbserver/gdbremote_testcase.py (original)
+++ lldb/trunk/test/tools/lldb-gdbserver/gdbremote_testcase.py Wed Feb 18 09:39:41 2015
@@ -139,7 +139,7 @@ class GdbRemoteTestCaseBase(TestBase):
self.skipTest("lldb_gdbserver exe not found")
dname = os.path.join(os.environ["LLDB_TEST"],
os.environ["LLDB_SESSION_DIRNAME"])
- self.debug_monitor_extra_args = " -c 'log enable -T -f {}/process-{}.log lldb break process thread' -c 'log enable -T -f {}/packets-{}.log gdb-remote packets'".format(dname, self.id(), dname, self.id())
+ self.debug_monitor_extra_args = " gdbserver -c 'log enable -T -f {}/process-{}.log lldb break process thread' -c 'log enable -T -f {}/packets-{}.log gdb-remote packets'".format(dname, self.id(), dname, self.id())
if use_named_pipe:
(self.named_pipe_path, self.named_pipe, self.named_pipe_fd) = self.create_named_pipe()
Modified: lldb/trunk/test/tools/lldb-gdbserver/lldbgdbserverutils.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-gdbserver/lldbgdbserverutils.py?rev=229683&r1=229682&r2=229683&view=diff
==============================================================================
--- lldb/trunk/test/tools/lldb-gdbserver/lldbgdbserverutils.py (original)
+++ lldb/trunk/test/tools/lldb-gdbserver/lldbgdbserverutils.py Wed Feb 18 09:39:41 2015
@@ -63,7 +63,7 @@ def get_lldb_gdbserver_exe():
if not lldb_exe:
return None
else:
- return _get_debug_monitor_from_lldb(lldb_exe, "lldb-gdbserver")
+ return _get_debug_monitor_from_lldb(lldb_exe, "lldb-server")
else:
return None
Modified: lldb/trunk/tools/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/CMakeLists.txt?rev=229683&r1=229682&r2=229683&view=diff
==============================================================================
--- lldb/trunk/tools/CMakeLists.txt (original)
+++ lldb/trunk/tools/CMakeLists.txt Wed Feb 18 09:39:41 2015
@@ -8,8 +8,5 @@ if (NOT __ANDROID_NDK__)
add_subdirectory(lldb-mi)
endif()
if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR CMAKE_SYSTEM_NAME MATCHES "Linux")
- add_subdirectory(lldb-gdbserver)
-endif()
-if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
- add_subdirectory(lldb-platform)
+ add_subdirectory(lldb-server)
endif()
Modified: lldb/trunk/tools/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/Makefile?rev=229683&r1=229682&r2=229683&view=diff
==============================================================================
--- lldb/trunk/tools/Makefile (original)
+++ lldb/trunk/tools/Makefile Wed Feb 18 09:39:41 2015
@@ -14,11 +14,7 @@ DIRS :=
# enable lldb-gdbserver for supported platforms
ifneq (,$(strip $(filter $(HOST_OS), FreeBSD Linux GNU/kFreeBSD)))
-DIRS += lldb-gdbserver
-endif
-
-ifneq ($(HOST_OS),MingW)
-DIRS += lldb-platform
+DIRS += lldb-server
endif
ifeq ($(HOST_OS),Darwin)
Removed: lldb/trunk/tools/lldb-gdbserver/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-gdbserver/CMakeLists.txt?rev=229682&view=auto
==============================================================================
--- lldb/trunk/tools/lldb-gdbserver/CMakeLists.txt (original)
+++ lldb/trunk/tools/lldb-gdbserver/CMakeLists.txt (removed)
@@ -1,49 +0,0 @@
-set(LLVM_NO_RTTI 1)
-
-if ( CMAKE_SYSTEM_NAME MATCHES "Linux" )
-include_directories(
- ../../source/Plugins/Process/Linux
- ../../source/Plugins/Process/POSIX
- )
-endif ()
-
-if ( CMAKE_SYSTEM_NAME MATCHES "FreeBSD" )
-include_directories(
- ../../source/Plugins/Process/FreeBSD
- ../../source/Plugins/Process/POSIX
- )
-endif ()
-include_directories(../../source)
-
-include(../../cmake/LLDBDependencies.cmake)
-
-if ( BUILD_SHARED_LIBS )
- add_lldb_executable(lldb-gdbserver
- lldb-gdbserver.cpp
- )
-
- target_link_libraries(lldb-gdbserver liblldb)
-else()
- # have to include lldb and lldb-log files since those are not libraries and llgs depends on them
- add_lldb_executable(lldb-gdbserver
- lldb-gdbserver.cpp
- ../../source/lldb-log.cpp
- ../../source/lldb.cpp
- )
-
- # The Darwin linker doesn't understand --start-group/--end-group.
- if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND NOT "${CMAKE_SYSTEM_NAME}" MATCHES "Darwin")
- target_link_libraries(lldb-gdbserver
- -Wl,--start-group ${LLDB_USED_LIBS} -Wl,--end-group)
- else()
- target_link_libraries(lldb-gdbserver ${LLDB_USED_LIBS})
- endif()
- target_link_libraries(lldb-gdbserver ${CLANG_USED_LIBS})
- llvm_config(lldb-gdbserver ${LLVM_LINK_COMPONENTS})
-
- target_link_libraries(lldb-gdbserver ${LLDB_SYSTEM_LIBS})
-endif()
-
-set_target_properties(lldb-gdbserver PROPERTIES VERSION ${LLDB_VERSION})
-install(TARGETS lldb-gdbserver
- RUNTIME DESTINATION bin)
Removed: lldb/trunk/tools/lldb-gdbserver/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-gdbserver/Makefile?rev=229682&view=auto
==============================================================================
--- lldb/trunk/tools/lldb-gdbserver/Makefile (original)
+++ lldb/trunk/tools/lldb-gdbserver/Makefile (removed)
@@ -1,23 +0,0 @@
-##===- tools/lldb-platform/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 := ../..
-
-TOOLNAME = lldb-gdbserver
-
-LLVMLibsOptions += -llldb -llldbUtility
-
-include $(LLDB_LEVEL)/Makefile
-
-ifeq ($(HOST_OS),Darwin)
- LLVMLibsOptions += -Wl,-rpath, at loader_path/../lib/
-endif
-
-ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux FreeBSD GNU/kFreeBSD))
- LLVMLibsOptions += -Wl,-rpath,$(LibDir)
-endif
Removed: lldb/trunk/tools/lldb-gdbserver/lldb-gdbserver.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-gdbserver/lldb-gdbserver.cpp?rev=229682&view=auto
==============================================================================
--- lldb/trunk/tools/lldb-gdbserver/lldb-gdbserver.cpp (original)
+++ lldb/trunk/tools/lldb-gdbserver/lldb-gdbserver.cpp (removed)
@@ -1,694 +0,0 @@
-//===-- lldb-gdbserver.cpp --------------------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// C Includes
-#include <errno.h>
-#include <getopt.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#ifndef _WIN32
-#include <signal.h>
-#include <unistd.h>
-#endif
-
-// C++ Includes
-
-// Other libraries and framework includes
-#include "lldb/lldb-private-log.h"
-#include "lldb/Core/Error.h"
-#include "lldb/Core/ConnectionMachPort.h"
-#include "lldb/Core/Debugger.h"
-#include "lldb/Core/PluginManager.h"
-#include "lldb/Core/StreamFile.h"
-#include "lldb/Host/ConnectionFileDescriptor.h"
-#include "lldb/Host/HostThread.h"
-#include "lldb/Host/Pipe.h"
-#include "lldb/Host/OptionParser.h"
-#include "lldb/Host/Socket.h"
-#include "lldb/Host/StringConvert.h"
-#include "lldb/Host/ThreadLauncher.h"
-#include "lldb/Interpreter/CommandInterpreter.h"
-#include "lldb/Interpreter/CommandReturnObject.h"
-#include "Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h"
-#include "Plugins/Process/gdb-remote/ProcessGDBRemoteLog.h"
-
-#ifndef LLGS_PROGRAM_NAME
-#define LLGS_PROGRAM_NAME "lldb-gdbserver"
-#endif
-
-#ifndef LLGS_VERSION_STR
-#define LLGS_VERSION_STR "local_build"
-#endif
-
-using namespace lldb;
-using namespace lldb_private;
-
-// lldb-gdbserver state
-
-namespace
-{
-HostThread s_listen_thread;
- std::unique_ptr<ConnectionFileDescriptor> s_listen_connection_up;
- std::string s_listen_url;
-}
-
-//----------------------------------------------------------------------
-// option descriptors for getopt_long_only()
-//----------------------------------------------------------------------
-
-int g_debug = 0;
-int g_verbose = 0;
-
-static struct option g_long_options[] =
-{
- { "debug", no_argument, &g_debug, 1 },
- { "platform", required_argument, NULL, 'p' },
- { "verbose", no_argument, &g_verbose, 1 },
- { "lldb-command", required_argument, NULL, 'c' },
- { "log-file", required_argument, NULL, 'l' },
- { "log-flags", required_argument, NULL, 'f' },
- { "attach", required_argument, NULL, 'a' },
- { "named-pipe", required_argument, NULL, 'P' },
- { "native-regs", no_argument, NULL, 'r' }, // Specify to use the native registers instead of the gdb defaults for the architecture. NOTE: this is a do-nothing arg as it's behavior is default now. FIXME remove call from lldb-platform.
- { "reverse-connect", no_argument, NULL, 'R' }, // Specifies that llgs attaches to the client address:port rather than llgs listening for a connection from address on port.
- { "setsid", no_argument, NULL, 'S' }, // Call setsid() to make llgs run in its own session.
- { NULL, 0, NULL, 0 }
-};
-
-
-//----------------------------------------------------------------------
-// Watch for signals
-//----------------------------------------------------------------------
-static int g_sigpipe_received = 0;
-static int g_sighup_received_count = 0;
-
-#ifndef _WIN32
-
-void
-signal_handler(int signo)
-{
- Log *log (GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PROCESS));
-
- fprintf (stderr, "lldb-gdbserver:%s received signal %d\n", __FUNCTION__, signo);
- if (log)
- log->Printf ("lldb-gdbserver:%s received signal %d", __FUNCTION__, signo);
-
- switch (signo)
- {
- case SIGPIPE:
- g_sigpipe_received = 1;
- break;
- case SIGHUP:
- ++g_sighup_received_count;
-
- // For now, swallow SIGHUP.
- if (log)
- log->Printf ("lldb-gdbserver:%s swallowing SIGHUP (receive count=%d)", __FUNCTION__, g_sighup_received_count);
- signal (SIGHUP, signal_handler);
- break;
- }
-}
-#endif // #ifndef _WIN32
-
-static void
-display_usage (const char *progname)
-{
- fprintf(stderr, "Usage:\n %s [--log-file log-file-path] [--log-flags flags] [--lldb-command command]* [--platform platform_name] [--setsid] [--named-pipe named-pipe-path] [--native-regs] [--attach pid] [[HOST]:PORT] "
- "[-- PROGRAM ARG1 ARG2 ...]\n", progname);
- exit(0);
-}
-
-static void
-dump_available_platforms (FILE *output_file)
-{
- fprintf (output_file, "Available platform plugins:\n");
- for (int i = 0; ; ++i)
- {
- const char *plugin_name = PluginManager::GetPlatformPluginNameAtIndex (i);
- const char *plugin_desc = PluginManager::GetPlatformPluginDescriptionAtIndex (i);
-
- if (!plugin_name || !plugin_desc)
- break;
-
- fprintf (output_file, "%s\t%s\n", plugin_name, plugin_desc);
- }
-
- if ( Platform::GetHostPlatform () )
- {
- // add this since the default platform doesn't necessarily get registered by
- // the plugin name (e.g. 'host' doesn't show up as a
- // registered platform plugin even though it's the default).
- fprintf (output_file, "%s\tDefault platform for this host.\n", Platform::GetHostPlatform ()->GetPluginName ().AsCString ());
- }
-}
-
-static void
-run_lldb_commands (const lldb::DebuggerSP &debugger_sp, const std::vector<std::string> &lldb_commands)
-{
- for (const auto &lldb_command : lldb_commands)
- {
- printf("(lldb) %s\n", lldb_command.c_str ());
-
- lldb_private::CommandReturnObject result;
- debugger_sp->GetCommandInterpreter ().HandleCommand (lldb_command.c_str (), eLazyBoolNo, result);
- const char *output = result.GetOutputData ();
- if (output && output[0])
- puts (output);
- }
-}
-
-static lldb::PlatformSP
-setup_platform (const std::string &platform_name)
-{
- lldb::PlatformSP platform_sp;
-
- if (platform_name.empty())
- {
- printf ("using the default platform: ");
- platform_sp = Platform::GetHostPlatform ();
- printf ("%s\n", platform_sp->GetPluginName ().AsCString ());
- return platform_sp;
- }
-
- Error error;
- platform_sp = Platform::Create (lldb_private::ConstString(platform_name), error);
- if (error.Fail ())
- {
- // the host platform isn't registered with that name (at
- // least, not always. Check if the given name matches
- // the default platform name. If so, use it.
- if ( Platform::GetHostPlatform () && ( Platform::GetHostPlatform ()->GetPluginName () == ConstString (platform_name.c_str()) ) )
- {
- platform_sp = Platform::GetHostPlatform ();
- }
- else
- {
- fprintf (stderr, "error: failed to create platform with name '%s'\n", platform_name.c_str());
- dump_available_platforms (stderr);
- exit (1);
- }
- }
- printf ("using platform: %s\n", platform_name.c_str ());
-
- return platform_sp;
-}
-
-void
-handle_attach_to_pid (GDBRemoteCommunicationServerLLGS &gdb_server, lldb::pid_t pid)
-{
- Error error = gdb_server.AttachToProcess (pid);
- if (error.Fail ())
- {
- fprintf (stderr, "error: failed to attach to pid %" PRIu64 ": %s\n", pid, error.AsCString());
- exit(1);
- }
-}
-
-void
-handle_attach_to_process_name (GDBRemoteCommunicationServerLLGS &gdb_server, const std::string &process_name)
-{
- // FIXME implement.
-}
-
-void
-handle_attach (GDBRemoteCommunicationServerLLGS &gdb_server, const std::string &attach_target)
-{
- assert (!attach_target.empty () && "attach_target cannot be empty");
-
- // First check if the attach_target is convertable to a long. If so, we'll use it as a pid.
- char *end_p = nullptr;
- const long int pid = strtol (attach_target.c_str (), &end_p, 10);
-
- // We'll call it a match if the entire argument is consumed.
- if (end_p && static_cast<size_t> (end_p - attach_target.c_str ()) == attach_target.size ())
- handle_attach_to_pid (gdb_server, static_cast<lldb::pid_t> (pid));
- else
- handle_attach_to_process_name (gdb_server, attach_target);
-}
-
-void
-handle_launch (GDBRemoteCommunicationServerLLGS &gdb_server, int argc, const char *const argv[])
-{
- Error error;
- error = gdb_server.SetLaunchArguments (argv, argc);
- if (error.Fail ())
- {
- fprintf (stderr, "error: failed to set launch args for '%s': %s\n", argv[0], error.AsCString());
- exit(1);
- }
-
- unsigned int launch_flags = eLaunchFlagStopAtEntry | eLaunchFlagDebug;
-
- error = gdb_server.SetLaunchFlags (launch_flags);
- if (error.Fail ())
- {
- fprintf (stderr, "error: failed to set launch flags for '%s': %s\n", argv[0], error.AsCString());
- exit(1);
- }
-
- error = gdb_server.LaunchProcess ();
- if (error.Fail ())
- {
- fprintf (stderr, "error: failed to launch '%s': %s\n", argv[0], error.AsCString());
- exit(1);
- }
-}
-
-static lldb::thread_result_t
-ListenThread (lldb::thread_arg_t /* arg */)
-{
- Error error;
-
- if (s_listen_connection_up)
- {
- // Do the listen on another thread so we can continue on...
- if (s_listen_connection_up->Connect(s_listen_url.c_str(), &error) != eConnectionStatusSuccess)
- s_listen_connection_up.reset();
- }
- return nullptr;
-}
-
-static Error
-StartListenThread (const char *hostname, uint16_t port)
-{
- Error error;
- if (s_listen_thread.IsJoinable())
- {
- error.SetErrorString("listen thread already running");
- }
- else
- {
- char listen_url[512];
- if (hostname && hostname[0])
- snprintf(listen_url, sizeof(listen_url), "listen://%s:%i", hostname, port);
- else
- snprintf(listen_url, sizeof(listen_url), "listen://%i", port);
-
- s_listen_url = listen_url;
- s_listen_connection_up.reset (new ConnectionFileDescriptor ());
- s_listen_thread = ThreadLauncher::LaunchThread(listen_url, ListenThread, nullptr, &error);
- }
- return error;
-}
-
-static bool
-JoinListenThread ()
-{
- if (s_listen_thread.IsJoinable())
- s_listen_thread.Join(nullptr);
- return true;
-}
-
-Error
-writePortToPipe (const char *const named_pipe_path, const uint16_t port)
-{
- Pipe port_name_pipe;
- // Wait for 10 seconds for pipe to be opened.
- auto error = port_name_pipe.OpenAsWriterWithTimeout (named_pipe_path, false, std::chrono::microseconds (10 * 1000000));
- if (error.Fail ())
- return error;
-
- char port_str[64];
- const auto port_str_len = ::snprintf (port_str, sizeof (port_str), "%u", port);
-
- size_t bytes_written = 0;
- // Write the port number as a C string with the NULL terminator.
- return port_name_pipe.Write (port_str, port_str_len + 1, bytes_written);
-}
-
-void
-ConnectToRemote (GDBRemoteCommunicationServerLLGS &gdb_server, bool reverse_connect, const char *const host_and_port, const char *const progname, const char *const named_pipe_path)
-{
- Error error;
-
- if (host_and_port && host_and_port[0])
- {
- // Parse out host and port.
- std::string final_host_and_port;
- std::string connection_host;
- std::string connection_port;
- uint32_t connection_portno = 0;
-
- // If host_and_port starts with ':', default the host to be "localhost" and expect the remainder to be the port.
- if (host_and_port[0] == ':')
- final_host_and_port.append ("localhost");
- final_host_and_port.append (host_and_port);
-
- const std::string::size_type colon_pos = final_host_and_port.find (':');
- if (colon_pos != std::string::npos)
- {
- connection_host = final_host_and_port.substr (0, colon_pos);
- connection_port = final_host_and_port.substr (colon_pos + 1);
- connection_portno = StringConvert::ToUInt32 (connection_port.c_str (), 0);
- }
- else
- {
- fprintf (stderr, "failed to parse host and port from connection string '%s'\n", final_host_and_port.c_str ());
- display_usage (progname);
- exit (1);
- }
-
- if (reverse_connect)
- {
- // llgs will connect to the gdb-remote client.
-
- // Ensure we have a port number for the connection.
- if (connection_portno == 0)
- {
- fprintf (stderr, "error: port number must be specified on when using reverse connect");
- exit (1);
- }
-
- // Build the connection string.
- char connection_url[512];
- snprintf(connection_url, sizeof(connection_url), "connect://%s", final_host_and_port.c_str ());
-
- // Create the connection.
- std::unique_ptr<ConnectionFileDescriptor> connection_up (new ConnectionFileDescriptor ());
- connection_up.reset (new ConnectionFileDescriptor ());
- auto connection_result = connection_up->Connect (connection_url, &error);
- if (connection_result != eConnectionStatusSuccess)
- {
- fprintf (stderr, "error: failed to connect to client at '%s' (connection status: %d)", connection_url, static_cast<int> (connection_result));
- exit (-1);
- }
- if (error.Fail ())
- {
- fprintf (stderr, "error: failed to connect to client at '%s': %s", connection_url, error.AsCString ());
- exit (-1);
- }
-
- // We're connected.
- printf ("Connection established.\n");
- gdb_server.SetConnection (connection_up.release());
- }
- else
- {
- // llgs will listen for connections on the given port from the given address.
- // Start the listener on a new thread. We need to do this so we can resolve the
- // bound listener port.
- StartListenThread(connection_host.c_str (), static_cast<uint16_t> (connection_portno));
- printf ("Listening to port %s for a connection from %s...\n", connection_port.c_str (), connection_host.c_str ());
-
- // If we have a named pipe to write the port number back to, do that now.
- if (named_pipe_path && named_pipe_path[0] && connection_portno == 0)
- {
- const uint16_t bound_port = s_listen_connection_up->GetListeningPort (10);
- if (bound_port > 0)
- {
- error = writePortToPipe (named_pipe_path, bound_port);
- if (error.Fail ())
- {
- fprintf (stderr, "failed to write to the named pipe \'%s\': %s", named_pipe_path, error.AsCString());
- }
- }
- else
- {
- fprintf (stderr, "unable to get the bound port for the listening connection\n");
- }
- }
-
- // Join the listener thread.
- if (!JoinListenThread ())
- {
- fprintf (stderr, "failed to join the listener thread\n");
- display_usage (progname);
- exit (1);
- }
-
- // Ensure we connected.
- if (s_listen_connection_up)
- {
- printf ("Connection established '%s'\n", s_listen_connection_up->GetURI().c_str());
- gdb_server.SetConnection (s_listen_connection_up.release());
- }
- else
- {
- fprintf (stderr, "failed to connect to '%s': %s\n", final_host_and_port.c_str (), error.AsCString ());
- display_usage (progname);
- exit (1);
- }
- }
- }
-
- if (gdb_server.IsConnected())
- {
- // After we connected, we need to get an initial ack from...
- if (gdb_server.HandshakeWithClient(&error))
- {
- // We'll use a half a second timeout interval so that an exit conditions can
- // be checked that often.
- const uint32_t TIMEOUT_USEC = 500000;
-
- bool interrupt = false;
- bool done = false;
- while (!interrupt && !done && (g_sighup_received_count < 2))
- {
- const GDBRemoteCommunication::PacketResult result = gdb_server.GetPacketAndSendResponse (TIMEOUT_USEC, error, interrupt, done);
- if ((result != GDBRemoteCommunication::PacketResult::Success) &&
- (result != GDBRemoteCommunication::PacketResult::ErrorReplyTimeout))
- {
- // We're bailing out - we only support successful handling and timeouts.
- fprintf(stderr, "leaving packet loop due to PacketResult %d\n", result);
- break;
- }
- }
-
- if (error.Fail())
- {
- fprintf(stderr, "error: %s\n", error.AsCString());
- }
- }
- else
- {
- fprintf(stderr, "error: handshake with client failed\n");
- }
- }
- else
- {
- fprintf (stderr, "no connection information provided, unable to run\n");
- display_usage (progname);
- exit (1);
- }
-}
-
-//----------------------------------------------------------------------
-// main
-//----------------------------------------------------------------------
-int
-main (int argc, char *argv[])
-{
-#ifndef _WIN32
- // Setup signal handlers first thing.
- signal (SIGPIPE, signal_handler);
- signal (SIGHUP, signal_handler);
-#endif
-
- const char *progname = argv[0];
- int long_option_index = 0;
- StreamSP log_stream_sp;
- Args log_args;
- Error error;
- int ch;
- std::string platform_name;
- std::string attach_target;
- std::string named_pipe_path;
- bool reverse_connect = false;
-
- Debugger::Initialize (NULL);
-
- lldb::DebuggerSP debugger_sp = Debugger::CreateInstance ();
-
- debugger_sp->SetInputFileHandle(stdin, false);
- debugger_sp->SetOutputFileHandle(stdout, false);
- debugger_sp->SetErrorFileHandle(stderr, false);
-
- // ProcessLaunchInfo launch_info;
- ProcessAttachInfo attach_info;
-
- bool show_usage = false;
- int option_error = 0;
-#if __GLIBC__
- optind = 0;
-#else
- optreset = 1;
- optind = 1;
-#endif
-
- std::string short_options(OptionParser::GetShortOptionString(g_long_options));
-
- std::vector<std::string> lldb_commands;
-
- while ((ch = getopt_long_only(argc, argv, short_options.c_str(), g_long_options, &long_option_index)) != -1)
- {
- switch (ch)
- {
- case 0: // Any optional that auto set themselves will return 0
- break;
-
- case 'l': // Set Log File
- if (optarg && optarg[0])
- {
- if ((strcasecmp(optarg, "stdout") == 0) || (strcmp(optarg, "/dev/stdout") == 0))
- {
- log_stream_sp.reset (new StreamFile (stdout, false));
- }
- else if ((strcasecmp(optarg, "stderr") == 0) || (strcmp(optarg, "/dev/stderr") == 0))
- {
- log_stream_sp.reset (new StreamFile (stderr, false));
- }
- else
- {
- FILE *log_file = fopen(optarg, "w");
- if (log_file)
- {
- setlinebuf(log_file);
- log_stream_sp.reset (new StreamFile (log_file, true));
- }
- else
- {
- const char *errno_str = strerror(errno);
- fprintf (stderr, "Failed to open log file '%s' for writing: errno = %i (%s)", optarg, errno, errno_str ? errno_str : "unknown error");
- }
-
- }
- }
- break;
-
- case 'f': // Log Flags
- if (optarg && optarg[0])
- log_args.AppendArgument(optarg);
- break;
-
- case 'c': // lldb commands
- if (optarg && optarg[0])
- lldb_commands.push_back(optarg);
- break;
-
- case 'p': // platform name
- if (optarg && optarg[0])
- platform_name = optarg;
- break;
-
- case 'P': // named pipe
- if (optarg && optarg[0])
- named_pipe_path = optarg;
- break;
-
- case 'r':
- // Do nothing, native regs is the default these days
- break;
-
- case 'R':
- reverse_connect = true;
- break;
-
-#ifndef _WIN32
- case 'S':
- // Put llgs into a new session. Terminals group processes
- // into sessions and when a special terminal key sequences
- // (like control+c) are typed they can cause signals to go out to
- // all processes in a session. Using this --setsid (-S) option
- // will cause debugserver to run in its own sessions and be free
- // from such issues.
- //
- // This is useful when llgs is spawned from a command
- // line application that uses llgs to do the debugging,
- // yet that application doesn't want llgs receiving the
- // signals sent to the session (i.e. dying when anyone hits ^C).
- {
- const ::pid_t new_sid = setsid();
- if (new_sid == -1)
- {
- const char *errno_str = strerror(errno);
- fprintf (stderr, "failed to set new session id for %s (%s)\n", LLGS_PROGRAM_NAME, errno_str ? errno_str : "<no error string>");
- }
- }
- break;
-#endif
-
- case 'a': // attach {pid|process_name}
- if (optarg && optarg[0])
- attach_target = optarg;
- break;
-
- case 'h': /* fall-through is intentional */
- case '?':
- show_usage = true;
- break;
- }
- }
-
- if (show_usage || option_error)
- {
- display_usage(progname);
- exit(option_error);
- }
-
- if (log_stream_sp)
- {
- if (log_args.GetArgumentCount() == 0)
- log_args.AppendArgument("default");
- ProcessGDBRemoteLog::EnableLog (log_stream_sp, 0,log_args.GetConstArgumentVector(), log_stream_sp.get());
- }
- Log *log(lldb_private::GetLogIfAnyCategoriesSet (GDBR_LOG_VERBOSE));
- if (log)
- {
- log->Printf ("lldb-gdbserver launch");
- for (int i = 0; i < argc; i++)
- {
- log->Printf ("argv[%i] = '%s'", i, argv[i]);
- }
- }
-
- // Skip any options we consumed with getopt_long_only.
- argc -= optind;
- argv += optind;
-
- if (argc == 0)
- {
- display_usage(progname);
- exit(255);
- }
-
- // Run any commands requested.
- run_lldb_commands (debugger_sp, lldb_commands);
-
- // Setup the platform that GDBRemoteCommunicationServerLLGS will use.
- lldb::PlatformSP platform_sp = setup_platform (platform_name);
-
- GDBRemoteCommunicationServerLLGS gdb_server (platform_sp, debugger_sp);
-
- const char *const host_and_port = argv[0];
- argc -= 1;
- argv += 1;
-
- // Any arguments left over are for the the program that we need to launch. If there
- // are no arguments, then the GDB server will start up and wait for an 'A' packet
- // to launch a program, or a vAttach packet to attach to an existing process, unless
- // explicitly asked to attach with the --attach={pid|program_name} form.
- if (!attach_target.empty ())
- handle_attach (gdb_server, attach_target);
- else if (argc > 0)
- handle_launch (gdb_server, argc, argv);
-
- // Print version info.
- printf("%s-%s", LLGS_PROGRAM_NAME, LLGS_VERSION_STR);
-
- ConnectToRemote (gdb_server, reverse_connect, host_and_port, progname, named_pipe_path.c_str ());
-
- Debugger::Terminate ();
-
- fprintf(stderr, "lldb-gdbserver exiting...\n");
-
- return 0;
-}
Removed: lldb/trunk/tools/lldb-platform/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-platform/CMakeLists.txt?rev=229682&view=auto
==============================================================================
--- lldb/trunk/tools/lldb-platform/CMakeLists.txt (original)
+++ lldb/trunk/tools/lldb-platform/CMakeLists.txt (removed)
@@ -1,48 +0,0 @@
-set(LLVM_NO_RTTI 1)
-
-if ( CMAKE_SYSTEM_NAME MATCHES "Linux" )
-include_directories(
- ../../source/Plugins/Process/Linux
- ../../source/Plugins/Process/POSIX
- )
-endif ()
-
-if ( CMAKE_SYSTEM_NAME MATCHES "FreeBSD" )
-include_directories(
- ../../source/Plugins/Process/FreeBSD
- ../../source/Plugins/Process/POSIX
- )
-endif ()
-
-include_directories(../../source)
-
-include(../../cmake/LLDBDependencies.cmake)
-
-add_lldb_executable(lldb-platform
- lldb-platform.cpp
- ../../source/lldb-log.cpp
- ../../source/lldb.cpp
- ${LLDB_WRAP_PYTHON}
- ${LLDB_VERS_GENERATED_FILE}
- )
-
-if (LLDB_WRAP_PYTHON OR LLDB_VERS_GENERATED_FILE)
- add_dependencies(lldb-platform swig_wrapper)
-endif()
-
-# The Darwin linker doesn't understand --start-group/--end-group.
-if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND NOT "${CMAKE_SYSTEM_NAME}" MATCHES "Darwin")
- target_link_libraries(lldb-platform
- -Wl,--start-group ${LLDB_USED_LIBS} -Wl,--end-group)
-else()
- target_link_libraries(lldb-platform ${LLDB_USED_LIBS})
-endif()
-target_link_libraries(lldb-platform ${CLANG_USED_LIBS})
-llvm_config(lldb-platform ${LLVM_LINK_COMPONENTS})
-
-target_link_libraries(lldb-platform ${LLDB_SYSTEM_LIBS})
-
-set_target_properties(lldb-platform PROPERTIES VERSION ${LLDB_VERSION})
-
-install(TARGETS lldb-platform
- RUNTIME DESTINATION bin)
Removed: lldb/trunk/tools/lldb-platform/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-platform/Makefile?rev=229682&view=auto
==============================================================================
--- lldb/trunk/tools/lldb-platform/Makefile (original)
+++ lldb/trunk/tools/lldb-platform/Makefile (removed)
@@ -1,23 +0,0 @@
-##===- tools/lldb-platform/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 := ../..
-
-TOOLNAME = lldb-platform
-
-LLVMLibsOptions += -llldb -llldbUtility
-
-include $(LLDB_LEVEL)/Makefile
-
-ifeq ($(HOST_OS),Darwin)
- LLVMLibsOptions += -Wl,-rpath, at loader_path/../lib/
-endif
-
-ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux FreeBSD GNU/kFreeBSD))
- LLVMLibsOptions += -Wl,-rpath,$(LibDir)
-endif
Removed: lldb/trunk/tools/lldb-platform/lldb-platform.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-platform/lldb-platform.cpp?rev=229682&view=auto
==============================================================================
--- lldb/trunk/tools/lldb-platform/lldb-platform.cpp (original)
+++ lldb/trunk/tools/lldb-platform/lldb-platform.cpp (removed)
@@ -1,311 +0,0 @@
-//===-- lldb-platform.cpp ---------------------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include "lldb/lldb-python.h"
-
-// C Includes
-#include <errno.h>
-#if defined(__APPLE__)
-#include <netinet/in.h>
-#endif
-#include <signal.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-// C++ Includes
-
-// Other libraries and framework includes
-#include "lldb/lldb-private-log.h"
-#include "lldb/Core/Error.h"
-#include "lldb/Core/ConnectionMachPort.h"
-#include "lldb/Core/Debugger.h"
-#include "lldb/Core/StreamFile.h"
-#include "lldb/Host/ConnectionFileDescriptor.h"
-#include "lldb/Host/HostGetOpt.h"
-#include "lldb/Host/OptionParser.h"
-#include "lldb/Interpreter/CommandInterpreter.h"
-#include "lldb/Interpreter/CommandReturnObject.h"
-#include "Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.h"
-#include "Plugins/Process/gdb-remote/ProcessGDBRemoteLog.h"
-
-using namespace lldb;
-using namespace lldb_private;
-
-//----------------------------------------------------------------------
-// option descriptors for getopt_long_only()
-//----------------------------------------------------------------------
-
-int g_debug = 0;
-int g_verbose = 0;
-int g_stay_alive = 0;
-
-static struct option g_long_options[] =
-{
- { "debug", no_argument, &g_debug, 1 },
- { "verbose", no_argument, &g_verbose, 1 },
- { "stay-alive", no_argument, &g_stay_alive, 1 },
- { "listen", required_argument, NULL, 'L' },
- { "port-offset", required_argument, NULL, 'p' },
- { "gdbserver-port", required_argument, NULL, 'P' },
- { "min-gdbserver-port", required_argument, NULL, 'm' },
- { "max-gdbserver-port", required_argument, NULL, 'M' },
- { "lldb-command", required_argument, NULL, 'c' },
- { NULL, 0, NULL, 0 }
-};
-
-#if defined (__APPLE__)
-#define LOW_PORT (IPPORT_RESERVED)
-#define HIGH_PORT (IPPORT_HIFIRSTAUTO)
-#else
-#define LOW_PORT (1024u)
-#define HIGH_PORT (49151u)
-#endif
-
-
-//----------------------------------------------------------------------
-// Watch for signals
-//----------------------------------------------------------------------
-void
-signal_handler(int signo)
-{
- switch (signo)
- {
- case SIGHUP:
- // Use SIGINT first, if that does not work, use SIGHUP as a last resort.
- // And we should not call exit() here because it results in the global destructors
- // to be invoked and wreaking havoc on the threads still running.
- Host::SystemLog(Host::eSystemLogWarning, "SIGHUP received, exiting lldb-platform...\n");
- abort();
- break;
- }
-}
-
-static void
-display_usage (const char *progname)
-{
- fprintf(stderr, "Usage:\n %s [--log-file log-file-path] [--log-flags flags] --listen port\n", progname);
- exit(0);
-}
-
-//----------------------------------------------------------------------
-// main
-//----------------------------------------------------------------------
-int
-main (int argc, char *argv[])
-{
- const char *progname = argv[0];
- signal (SIGPIPE, SIG_IGN);
- signal (SIGHUP, signal_handler);
- int long_option_index = 0;
- Error error;
- std::string listen_host_port;
- int ch;
- Debugger::Initialize(NULL);
-
- lldb::DebuggerSP debugger_sp = Debugger::CreateInstance ();
-
- debugger_sp->SetInputFileHandle(stdin, false);
- debugger_sp->SetOutputFileHandle(stdout, false);
- debugger_sp->SetErrorFileHandle(stderr, false);
-
- GDBRemoteCommunicationServerPlatform::PortMap gdbserver_portmap;
- int min_gdbserver_port = 0;
- int max_gdbserver_port = 0;
- uint16_t port_offset = 0;
-
- std::vector<std::string> lldb_commands;
- bool show_usage = false;
- int option_error = 0;
-
- std::string short_options(OptionParser::GetShortOptionString(g_long_options));
-
-#if __GLIBC__
- optind = 0;
-#else
- optreset = 1;
- optind = 1;
-#endif
-
- while ((ch = getopt_long_only(argc, argv, short_options.c_str(), g_long_options, &long_option_index)) != -1)
- {
- switch (ch)
- {
- case 0: // Any optional that auto set themselves will return 0
- break;
-
- case 'L':
- listen_host_port.append (optarg);
- break;
-
- case 'p':
- {
- char *end = NULL;
- long tmp_port_offset = strtoul(optarg, &end, 0);
- if (end && *end == '\0')
- {
- if (LOW_PORT <= tmp_port_offset && tmp_port_offset <= HIGH_PORT)
- {
- port_offset = (uint16_t)tmp_port_offset;
- }
- else
- {
- fprintf (stderr, "error: port offset %li is not in the valid user port range of %u - %u\n", tmp_port_offset, LOW_PORT, HIGH_PORT);
- option_error = 5;
- }
- }
- else
- {
- fprintf (stderr, "error: invalid port offset string %s\n", optarg);
- option_error = 4;
- }
- }
- break;
-
- case 'P':
- case 'm':
- case 'M':
- {
- char *end = NULL;
- long portnum = strtoul(optarg, &end, 0);
- if (end && *end == '\0')
- {
- if (LOW_PORT <= portnum && portnum <= HIGH_PORT)
- {
- if (ch == 'P')
- gdbserver_portmap[(uint16_t)portnum] = LLDB_INVALID_PROCESS_ID;
- else if (ch == 'm')
- min_gdbserver_port = portnum;
- else
- max_gdbserver_port = portnum;
- }
- else
- {
- fprintf (stderr, "error: port number %li is not in the valid user port range of %u - %u\n", portnum, LOW_PORT, HIGH_PORT);
- option_error = 1;
- }
- }
- else
- {
- fprintf (stderr, "error: invalid port number string %s\n", optarg);
- option_error = 2;
- }
- }
- break;
-
- case 'c':
- lldb_commands.push_back(optarg);
- break;
-
- case 'h': /* fall-through is intentional */
- case '?':
- show_usage = true;
- break;
- }
- }
-
- // Make a port map for a port range that was specified.
- if (min_gdbserver_port < max_gdbserver_port)
- {
- for (uint16_t port = min_gdbserver_port; port < max_gdbserver_port; ++port)
- gdbserver_portmap[port] = LLDB_INVALID_PROCESS_ID;
- }
- else if (min_gdbserver_port != max_gdbserver_port)
- {
- fprintf (stderr, "error: --min-gdbserver-port (%u) is greater than --max-gdbserver-port (%u)\n", min_gdbserver_port, max_gdbserver_port);
- option_error = 3;
-
- }
-
- // Print usage and exit if no listening port is specified.
- if (listen_host_port.empty())
- show_usage = true;
-
- if (show_usage || option_error)
- {
- display_usage(progname);
- exit(option_error);
- }
-
- // Execute any LLDB commands that we were asked to evaluate.
- for (const auto &lldb_command : lldb_commands)
- {
- lldb_private::CommandReturnObject result;
- printf("(lldb) %s\n", lldb_command.c_str());
- debugger_sp->GetCommandInterpreter().HandleCommand(lldb_command.c_str(), eLazyBoolNo, result);
- const char *output = result.GetOutputData();
- if (output && output[0])
- puts(output);
- }
-
-
- do {
- GDBRemoteCommunicationServerPlatform platform;
-
- if (port_offset > 0)
- platform.SetPortOffset(port_offset);
-
- if (!gdbserver_portmap.empty())
- {
- platform.SetPortMap(std::move(gdbserver_portmap));
- }
-
- if (!listen_host_port.empty())
- {
- std::unique_ptr<ConnectionFileDescriptor> conn_ap(new ConnectionFileDescriptor());
- if (conn_ap.get())
- {
- std::string connect_url ("listen://");
- connect_url.append(listen_host_port.c_str());
-
- printf ("Listening for a connection from %s...\n", listen_host_port.c_str());
- if (conn_ap->Connect(connect_url.c_str(), &error) == eConnectionStatusSuccess)
- {
- printf ("Connection established.\n");
- platform.SetConnection (conn_ap.release());
- }
- else
- {
- printf ("error: %s\n", error.AsCString());
- }
- }
-
- if (platform.IsConnected())
- {
- // After we connected, we need to get an initial ack from...
- if (platform.HandshakeWithClient(&error))
- {
- bool interrupt = false;
- bool done = false;
- while (!interrupt && !done)
- {
- if (platform.GetPacketAndSendResponse (UINT32_MAX, error, interrupt, done) != GDBRemoteCommunication::PacketResult::Success)
- break;
- }
-
- if (error.Fail())
- {
- fprintf(stderr, "error: %s\n", error.AsCString());
- }
- }
- else
- {
- fprintf(stderr, "error: handshake with client failed\n");
- }
- }
- }
- } while (g_stay_alive);
-
- Debugger::Terminate();
-
- fprintf(stderr, "lldb-platform exiting...\n");
-
- return 0;
-}
Copied: lldb/trunk/tools/lldb-server/CMakeLists.txt (from r229682, lldb/trunk/tools/lldb-gdbserver/CMakeLists.txt)
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-server/CMakeLists.txt?p2=lldb/trunk/tools/lldb-server/CMakeLists.txt&p1=lldb/trunk/tools/lldb-gdbserver/CMakeLists.txt&r1=229682&r2=229683&rev=229683&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-gdbserver/CMakeLists.txt (original)
+++ lldb/trunk/tools/lldb-server/CMakeLists.txt Wed Feb 18 09:39:41 2015
@@ -13,37 +13,42 @@ include_directories(
../../source/Plugins/Process/POSIX
)
endif ()
+
include_directories(../../source)
include(../../cmake/LLDBDependencies.cmake)
-if ( BUILD_SHARED_LIBS )
- add_lldb_executable(lldb-gdbserver
+if (BUILD_SHARED_LIBS )
+ add_lldb_executable(lldb-server
+ lldb-server.cpp
lldb-gdbserver.cpp
+ lldb-platform.cpp
)
- target_link_libraries(lldb-gdbserver liblldb)
+ target_link_libraries(lldb-server liblldb)
else()
- # have to include lldb and lldb-log files since those are not libraries and llgs depends on them
- add_lldb_executable(lldb-gdbserver
+ add_lldb_executable(lldb-server
+ lldb-server.cpp
lldb-gdbserver.cpp
+ lldb-platform.cpp
../../source/lldb-log.cpp
../../source/lldb.cpp
)
# The Darwin linker doesn't understand --start-group/--end-group.
if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND NOT "${CMAKE_SYSTEM_NAME}" MATCHES "Darwin")
- target_link_libraries(lldb-gdbserver
+ target_link_libraries(lldb-server
-Wl,--start-group ${LLDB_USED_LIBS} -Wl,--end-group)
else()
- target_link_libraries(lldb-gdbserver ${LLDB_USED_LIBS})
+ target_link_libraries(lldb-server ${LLDB_USED_LIBS})
endif()
- target_link_libraries(lldb-gdbserver ${CLANG_USED_LIBS})
- llvm_config(lldb-gdbserver ${LLVM_LINK_COMPONENTS})
+ target_link_libraries(lldb-server ${CLANG_USED_LIBS})
+ llvm_config(lldb-server ${LLVM_LINK_COMPONENTS})
- target_link_libraries(lldb-gdbserver ${LLDB_SYSTEM_LIBS})
+ target_link_libraries(lldb-server ${LLDB_SYSTEM_LIBS})
endif()
-set_target_properties(lldb-gdbserver PROPERTIES VERSION ${LLDB_VERSION})
-install(TARGETS lldb-gdbserver
+set_target_properties(lldb-server PROPERTIES VERSION ${LLDB_VERSION})
+
+install(TARGETS lldb-server
RUNTIME DESTINATION bin)
Copied: lldb/trunk/tools/lldb-server/Makefile (from r229682, lldb/trunk/tools/lldb-platform/Makefile)
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-server/Makefile?p2=lldb/trunk/tools/lldb-server/Makefile&p1=lldb/trunk/tools/lldb-platform/Makefile&r1=229682&r2=229683&rev=229683&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-platform/Makefile (original)
+++ lldb/trunk/tools/lldb-server/Makefile Wed Feb 18 09:39:41 2015
@@ -1,4 +1,4 @@
-##===- tools/lldb-platform/Makefile ------------------------*- Makefile -*-===##
+##===- tools/lldb-server/Makefile ------------------------*- Makefile -*-===##
#
# The LLVM Compiler Infrastructure
#
@@ -8,7 +8,7 @@
##===----------------------------------------------------------------------===##
LLDB_LEVEL := ../..
-TOOLNAME = lldb-platform
+TOOLNAME = lldb-server
LLVMLibsOptions += -llldb -llldbUtility
Copied: lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp (from r229682, lldb/trunk/tools/lldb-gdbserver/lldb-gdbserver.cpp)
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp?p2=lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp&p1=lldb/trunk/tools/lldb-gdbserver/lldb-gdbserver.cpp&r1=229682&r2=229683&rev=229683&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-gdbserver/lldb-gdbserver.cpp (original)
+++ lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp Wed Feb 18 09:39:41 2015
@@ -65,8 +65,8 @@ HostThread s_listen_thread;
// option descriptors for getopt_long_only()
//----------------------------------------------------------------------
-int g_debug = 0;
-int g_verbose = 0;
+static int g_debug = 0;
+static int g_verbose = 0;
static struct option g_long_options[] =
{
@@ -93,7 +93,7 @@ static int g_sighup_received_count = 0;
#ifndef _WIN32
-void
+static void
signal_handler(int signo)
{
Log *log (GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PROCESS));
@@ -120,10 +120,10 @@ signal_handler(int signo)
#endif // #ifndef _WIN32
static void
-display_usage (const char *progname)
+display_usage (const char *progname, const char* subcommand)
{
- fprintf(stderr, "Usage:\n %s [--log-file log-file-path] [--log-flags flags] [--lldb-command command]* [--platform platform_name] [--setsid] [--named-pipe named-pipe-path] [--native-regs] [--attach pid] [[HOST]:PORT] "
- "[-- PROGRAM ARG1 ARG2 ...]\n", progname);
+ fprintf(stderr, "Usage:\n %s %s [--log-file log-file-path] [--log-flags flags] [--lldb-command command]* [--platform platform_name] [--setsid] [--named-pipe named-pipe-path] [--native-regs] [--attach pid] [[HOST]:PORT] "
+ "[-- PROGRAM ARG1 ARG2 ...]\n", progname, subcommand);
exit(0);
}
@@ -326,7 +326,7 @@ writePortToPipe (const char *const named
}
void
-ConnectToRemote (GDBRemoteCommunicationServerLLGS &gdb_server, bool reverse_connect, const char *const host_and_port, const char *const progname, const char *const named_pipe_path)
+ConnectToRemote (GDBRemoteCommunicationServerLLGS &gdb_server, bool reverse_connect, const char *const host_and_port, const char *const progname, const char *const subcommand, const char *const named_pipe_path)
{
Error error;
@@ -353,7 +353,7 @@ ConnectToRemote (GDBRemoteCommunicationS
else
{
fprintf (stderr, "failed to parse host and port from connection string '%s'\n", final_host_and_port.c_str ());
- display_usage (progname);
+ display_usage (progname, subcommand);
exit (1);
}
@@ -421,7 +421,7 @@ ConnectToRemote (GDBRemoteCommunicationS
if (!JoinListenThread ())
{
fprintf (stderr, "failed to join the listener thread\n");
- display_usage (progname);
+ display_usage (progname, subcommand);
exit (1);
}
@@ -434,7 +434,7 @@ ConnectToRemote (GDBRemoteCommunicationS
else
{
fprintf (stderr, "failed to connect to '%s': %s\n", final_host_and_port.c_str (), error.AsCString ());
- display_usage (progname);
+ display_usage (progname, subcommand);
exit (1);
}
}
@@ -476,7 +476,7 @@ ConnectToRemote (GDBRemoteCommunicationS
else
{
fprintf (stderr, "no connection information provided, unable to run\n");
- display_usage (progname);
+ display_usage (progname, subcommand);
exit (1);
}
}
@@ -485,7 +485,7 @@ ConnectToRemote (GDBRemoteCommunicationS
// main
//----------------------------------------------------------------------
int
-main (int argc, char *argv[])
+main_gdbserver (int argc, char *argv[])
{
#ifndef _WIN32
// Setup signal handlers first thing.
@@ -494,6 +494,9 @@ main (int argc, char *argv[])
#endif
const char *progname = argv[0];
+ const char *subcommand = argv[1];
+ argc--;
+ argv++;
int long_option_index = 0;
StreamSP log_stream_sp;
Args log_args;
@@ -630,7 +633,7 @@ main (int argc, char *argv[])
if (show_usage || option_error)
{
- display_usage(progname);
+ display_usage(progname, subcommand);
exit(option_error);
}
@@ -656,7 +659,7 @@ main (int argc, char *argv[])
if (argc == 0)
{
- display_usage(progname);
+ display_usage(progname, subcommand);
exit(255);
}
@@ -684,7 +687,7 @@ main (int argc, char *argv[])
// Print version info.
printf("%s-%s", LLGS_PROGRAM_NAME, LLGS_VERSION_STR);
- ConnectToRemote (gdb_server, reverse_connect, host_and_port, progname, named_pipe_path.c_str ());
+ ConnectToRemote (gdb_server, reverse_connect, host_and_port, progname, subcommand, named_pipe_path.c_str ());
Debugger::Terminate ();
Copied: lldb/trunk/tools/lldb-server/lldb-platform.cpp (from r229682, lldb/trunk/tools/lldb-platform/lldb-platform.cpp)
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-server/lldb-platform.cpp?p2=lldb/trunk/tools/lldb-server/lldb-platform.cpp&p1=lldb/trunk/tools/lldb-platform/lldb-platform.cpp&r1=229682&r2=229683&rev=229683&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-platform/lldb-platform.cpp (original)
+++ lldb/trunk/tools/lldb-server/lldb-platform.cpp Wed Feb 18 09:39:41 2015
@@ -43,9 +43,9 @@ using namespace lldb_private;
// option descriptors for getopt_long_only()
//----------------------------------------------------------------------
-int g_debug = 0;
-int g_verbose = 0;
-int g_stay_alive = 0;
+static int g_debug = 0;
+static int g_verbose = 0;
+static int g_stay_alive = 0;
static struct option g_long_options[] =
{
@@ -73,7 +73,7 @@ static struct option g_long_options[] =
//----------------------------------------------------------------------
// Watch for signals
//----------------------------------------------------------------------
-void
+static void
signal_handler(int signo)
{
switch (signo)
@@ -89,9 +89,9 @@ signal_handler(int signo)
}
static void
-display_usage (const char *progname)
+display_usage (const char *progname, const char *subcommand)
{
- fprintf(stderr, "Usage:\n %s [--log-file log-file-path] [--log-flags flags] --listen port\n", progname);
+ fprintf(stderr, "Usage:\n %s %s [--log-file log-file-path] [--log-flags flags] --listen port\n", progname, subcommand);
exit(0);
}
@@ -99,9 +99,12 @@ display_usage (const char *progname)
// main
//----------------------------------------------------------------------
int
-main (int argc, char *argv[])
+main_platform (int argc, char *argv[])
{
const char *progname = argv[0];
+ const char *subcommand = argv[1];
+ argc--;
+ argv++;
signal (SIGPIPE, SIG_IGN);
signal (SIGHUP, signal_handler);
int long_option_index = 0;
@@ -230,7 +233,7 @@ main (int argc, char *argv[])
if (show_usage || option_error)
{
- display_usage(progname);
+ display_usage(progname, subcommand);
exit(option_error);
}
Added: lldb/trunk/tools/lldb-server/lldb-server.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-server/lldb-server.cpp?rev=229683&view=auto
==============================================================================
--- lldb/trunk/tools/lldb-server/lldb-server.cpp (added)
+++ lldb/trunk/tools/lldb-server/lldb-server.cpp Wed Feb 18 09:39:41 2015
@@ -0,0 +1,52 @@
+//===-- lldb-server.cpp -----------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include <stdio.h>
+#include <stdlib.h>
+
+ static void
+display_usage (const char *progname)
+{
+ fprintf(stderr, "Usage:\n"
+ " %s g[dbserver] [options]\n"
+ " %s p[latform] [options]\n"
+ "Invoke subcommand for additional help", progname, progname);
+ exit(0);
+}
+
+// Forward declarations of subcommand main methods.
+int main_gdbserver (int argc, char *argv[]);
+int main_platform (int argc, char *argv[]);
+
+//----------------------------------------------------------------------
+// main
+//----------------------------------------------------------------------
+int
+main (int argc, char *argv[])
+{
+ int option_error = 0;
+ const char *progname = argv[0];
+ if (argc < 2)
+ {
+ display_usage(progname);
+ exit(option_error);
+ }
+ else if (argv[1][0] == 'g')
+ {
+ main_gdbserver(argc, argv);
+ }
+ else if (argv[1][0] == 'p')
+ {
+ main_platform(argc, argv);
+ }
+ else {
+ display_usage(progname);
+ exit(option_error);
+ }
+}
More information about the lldb-commits
mailing list