Merged Eli Friedman's linux build changes where he added Makefile files that
enabled LLVM make style building and made this compile LLDB on Mac OS X. We
can now iterate on this to make the build work on both linux and macosx.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@108009 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Plugins/Process/Utility/LibUnwindRegisterContext.cpp b/source/Plugins/Process/Utility/LibUnwindRegisterContext.cpp
index bf6b6c2..96bba7e 100644
--- a/source/Plugins/Process/Utility/LibUnwindRegisterContext.cpp
+++ b/source/Plugins/Process/Utility/LibUnwindRegisterContext.cpp
@@ -166,6 +166,9 @@
             break;
         }
         break;
+
+    default:
+        break;
     }
     return false;
 }
@@ -197,9 +200,12 @@
     const RegisterInfo *reg_info = GetRegisterInfoAtIndex (reg);
     if (reg_info == NULL)
         return false;
-    unw_word_t reg_value;
+    unw_word_t reg_value = 0;
     switch (value.GetType())
     {
+    case Scalar::e_void:
+        return false;
+
     case Scalar::e_sint:        reg_value = value.SInt(); break;
     case Scalar::e_uint:        reg_value = value.UInt(); break;
     case Scalar::e_slong:       reg_value = value.SLong(); break;
@@ -294,6 +300,9 @@
         default:
             return false;
         }
+
+    default:
+        return false;
     }        
     return WriteRegisterValue (reg, value);
 }
diff --git a/source/Plugins/Process/Utility/LibUnwindRegisterContext.h b/source/Plugins/Process/Utility/LibUnwindRegisterContext.h
index 4e89b27..bd7d8bd 100644
--- a/source/Plugins/Process/Utility/LibUnwindRegisterContext.h
+++ b/source/Plugins/Process/Utility/LibUnwindRegisterContext.h
@@ -17,7 +17,7 @@
 #include "lldb/lldb-private.h"
 #include "lldb/Target/RegisterContext.h"
 
-#include "libunwind.h"
+#include "libunwind/include/libunwind.h"
 
 class LibUnwindRegisterContext : public lldb_private::RegisterContext
 {
diff --git a/source/Plugins/Process/Utility/MacOSXLibunwindCallbacks.cpp b/source/Plugins/Process/Utility/MacOSXLibunwindCallbacks.cpp
index e6c7b35..902e22c 100644
--- a/source/Plugins/Process/Utility/MacOSXLibunwindCallbacks.cpp
+++ b/source/Plugins/Process/Utility/MacOSXLibunwindCallbacks.cpp
@@ -21,10 +21,11 @@
 #include "lldb/Target/Target.h"
 #include "lldb/Target/Thread.h"
 
-#include "lldb-enumerations.h"
-#include "libunwind.h"
+#include "lldb/lldb-enumerations.h"
 #include "llvm-c/EnhancedDisassembly.h"
 
+#include "libunwind/include/libunwind.h"
+
 using namespace lldb;
 
 namespace lldb_private {
@@ -191,7 +192,15 @@
 
 
 static int 
-reg_info (lldb_private::unw_addr_space_t as, lldb_private::unw_regnum_t regnum, lldb_private::unw_regtype_t *type, char *buf, size_t buflen, void *arg)
+reg_info 
+(
+    lldb_private::unw_addr_space_t as, 
+    lldb_private::unw_regnum_t regnum, 
+    lldb_private::unw_regtype_t *type, 
+    char *buf, 
+    size_t buflen, 
+    void *arg
+)
 {
     if (arg == 0)
         return -1;
diff --git a/source/Plugins/Process/Utility/Makefile b/source/Plugins/Process/Utility/Makefile
new file mode 100644
index 0000000..f82fa88
--- /dev/null
+++ b/source/Plugins/Process/Utility/Makefile
@@ -0,0 +1,14 @@
+##===- source/Plugins/Utility/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 := lldbPluginUtility
+BUILD_ARCHIVE = 1
+
+include $(LLDB_LEVEL)/Makefile
diff --git a/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp b/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp
index df2f7c0..937ae84 100644
--- a/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp
+++ b/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp
@@ -18,7 +18,7 @@
 #include "lldb/Core/StreamString.h"
 #include "lldb/Target/Thread.h"
 // Project includes
-#include "StringExtractorGDBRemote.h"
+#include "Utility/StringExtractorGDBRemote.h"
 
 using namespace lldb;
 using namespace lldb_private;
diff --git a/source/Plugins/Process/Utility/UnwindLibUnwind.h b/source/Plugins/Process/Utility/UnwindLibUnwind.h
index d91f164..8b3489b 100644
--- a/source/Plugins/Process/Utility/UnwindLibUnwind.h
+++ b/source/Plugins/Process/Utility/UnwindLibUnwind.h
@@ -15,7 +15,7 @@
 #include <vector>
 
 // Other libraries and framework includes
-#include "libunwind.h"
+#include "libunwind/include/libunwind.h"
 
 // Project includes
 #include "lldb/lldb-private.h"
diff --git a/source/Plugins/Process/Utility/libunwind/include/libunwind.h b/source/Plugins/Process/Utility/libunwind/include/libunwind.h
index 63cc8ba..df70256 100644
--- a/source/Plugins/Process/Utility/libunwind/include/libunwind.h
+++ b/source/Plugins/Process/Utility/libunwind/include/libunwind.h
@@ -56,7 +56,7 @@
 struct unw_addr_space
 { 
 	enum unw_as_type type; 
-	uint8_t data[]; 
+	uint8_t data[1]; 
 };
 typedef struct unw_addr_space* unw_addr_space_t;
 
@@ -345,7 +345,7 @@
 // architecture independent register numbers 
 enum {
     UNW_REG_IP = -1,        // instruction pointer
-    UNW_REG_SP = -2,        // stack pointer
+    UNW_REG_SP = -2         // stack pointer
 };
 
 
@@ -502,7 +502,7 @@
 };
 
 
-}; // namespace lldb_private
+} // namespace lldb_private
 
 
 #endif