[Lldb-commits] [lldb] r128133 - in /lldb/trunk: lib/Makefile source/Host/Makefile source/Host/linux/ source/Host/linux/Host.cpp source/Host/linux/Makefile
Stephen Wilson
wilsons at start.ca
Tue Mar 22 18:58:26 PDT 2011
Author: wilsons
Date: Tue Mar 22 20:58:26 2011
New Revision: 128133
URL: http://llvm.org/viewvc/llvm-project?rev=128133&view=rev
Log:
linux: add Host/linux subdirectory
Start putting linux specific host code in its own directory. For now, just
implement Host::GetOSVersion.
Added:
lldb/trunk/source/Host/linux/
lldb/trunk/source/Host/linux/Host.cpp
lldb/trunk/source/Host/linux/Makefile
Modified:
lldb/trunk/lib/Makefile
lldb/trunk/source/Host/Makefile
Modified: lldb/trunk/lib/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lib/Makefile?rev=128133&r1=128132&r2=128133&view=diff
==============================================================================
--- lldb/trunk/lib/Makefile (original)
+++ lldb/trunk/lib/Makefile Tue Mar 22 20:58:26 2011
@@ -72,7 +72,8 @@
ifeq ($(HOST_OS),Linux)
USEDLIBS += lldbPluginProcessLinux.a \
lldbPluginDynamicLoaderLinux.a \
- lldbPluginPlatformLinux.a
+ lldbPluginPlatformLinux.a \
+ lldbHostLinux.a
endif
include $(LEVEL)/Makefile.common
Modified: lldb/trunk/source/Host/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/Makefile?rev=128133&r1=128132&r2=128133&view=diff
==============================================================================
--- lldb/trunk/source/Host/Makefile (original)
+++ lldb/trunk/source/Host/Makefile Tue Mar 22 20:58:26 2011
@@ -17,4 +17,8 @@
DIRS += macosx
endif
+ifeq ($(HOST_OS),Linux)
+DIRS += linux
+endif
+
include $(LLDB_LEVEL)/Makefile
Added: lldb/trunk/source/Host/linux/Host.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/linux/Host.cpp?rev=128133&view=auto
==============================================================================
--- lldb/trunk/source/Host/linux/Host.cpp (added)
+++ lldb/trunk/source/Host/linux/Host.cpp Tue Mar 22 20:58:26 2011
@@ -0,0 +1,35 @@
+//===-- source/Host/linux/Host.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 <stdio.h>
+#include <sys/utsname.h>
+
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+#include "lldb/Host/Host.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+bool
+Host::GetOSVersion(uint32_t &major,
+ uint32_t &minor,
+ uint32_t &update)
+{
+ struct utsname un;
+ int status;
+
+ if (uname(&un))
+ return false;
+
+ status = sscanf(un.release, "%u.%u.%u", &major, &minor, &update);
+ return status == 3;
+}
Added: lldb/trunk/source/Host/linux/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/linux/Makefile?rev=128133&view=auto
==============================================================================
--- lldb/trunk/source/Host/linux/Makefile (added)
+++ lldb/trunk/source/Host/linux/Makefile Tue Mar 22 20:58:26 2011
@@ -0,0 +1,14 @@
+##===- source/Host/linux/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 := lldbHostLinux
+BUILD_ARCHIVE = 1
+
+include $(LLDB_LEVEL)/Makefile
More information about the lldb-commits
mailing list