[Lldb-commits] [lldb] r180879 - Build fixes for FreeBSD 9.1.

Ashok Thirumurthi ashok.thirumurthi at intel.com
Wed May 1 13:38:19 PDT 2013


Author: athirumu
Date: Wed May  1 15:38:19 2013
New Revision: 180879

URL: http://llvm.org/viewvc/llvm-project?rev=180879&view=rev
Log:
Build fixes for FreeBSD 9.1.
- TODO: Support extended register sets on FreeBSD.

Patch by Samuel Jacob.

Modified:
    lldb/trunk/source/Host/common/Host.cpp
    lldb/trunk/source/Host/freebsd/Host.cpp
    lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp
    lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.h

Modified: lldb/trunk/source/Host/common/Host.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Host.cpp?rev=180879&r1=180878&r2=180879&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/Host.cpp (original)
+++ lldb/trunk/source/Host/common/Host.cpp Wed May  1 15:38:19 2013
@@ -150,6 +150,9 @@ MonitorChildProcessThreadFunction (void
     delete info;
 
     int status = -1;
+#if defined (__FreeBSD__)
+    #define __WALL 0
+#endif
     const int options = __WALL;
 
     while (1)
@@ -1392,7 +1395,7 @@ Host::GetNumberCPUS ()
     static uint32_t g_num_cores = UINT32_MAX;
     if (g_num_cores == UINT32_MAX)
     {
-#if defined(__APPLE__) or defined (__linux__)
+#if defined(__APPLE__) or defined (__linux__) or defined (__FreeBSD__)
 
         g_num_cores = ::sysconf(_SC_NPROCESSORS_ONLN);
         

Modified: lldb/trunk/source/Host/freebsd/Host.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/freebsd/Host.cpp?rev=180879&r1=180878&r2=180879&view=diff
==============================================================================
--- lldb/trunk/source/Host/freebsd/Host.cpp (original)
+++ lldb/trunk/source/Host/freebsd/Host.cpp Wed May  1 15:38:19 2013
@@ -185,7 +185,7 @@ GetFreeBSDProcessArgs (const ProcessInst
         if (::sysctl (mib, 4, arg_data, &arg_data_size , NULL, 0) == 0)
         {
             DataExtractor data (arg_data, arg_data_size, lldb::endian::InlHostByteOrder(), sizeof(void *));
-            uint32_t offset = 0;
+            lldb::offset_t offset = 0;
             const char *cstr;
 
             cstr = data.GetCStr (&offset);

Modified: lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp?rev=180879&r1=180878&r2=180879&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp (original)
+++ lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp Wed May  1 15:38:19 2013
@@ -117,11 +117,11 @@ PtraceWrapper(int req, lldb::pid_t pid,
 // Wrapper for ptrace when logging is not required.
 // Sets errno to 0 prior to calling ptrace.
 extern long
-PtraceWrapper(__ptrace_request req, lldb::pid_t pid, void *addr, int data)
+PtraceWrapper(int req, lldb::pid_t pid, void *addr, int data)
 {
     long result = 0;
     errno = 0;
-    result = ptrace(req, pid, addr, data);
+    result = ptrace(req, pid, (caddr_t)addr, data);
     return result;
 }
 
@@ -980,7 +980,7 @@ ProcessMonitor::Launch(LaunchArgs *args)
         goto FINISH;
 
     // Update the process thread list with this new thread.
-    inferior.reset(new POSIXThread(processSP, pid));
+    inferior.reset(new POSIXThread(*processSP, pid));
     process.GetThreadList().AddThread(inferior);
 
     // Let our process instance know the thread has stopped.
@@ -1066,7 +1066,7 @@ ProcessMonitor::Attach(AttachArgs *args)
     }
 
     // Update the process thread list with the attached thread.
-    inferior.reset(new POSIXThread(processSP, pid));
+    inferior.reset(new POSIXThread(*processSP, pid));
     tl.AddThread(inferior);
 
     // Let our process instance know the thread has stopped.
@@ -1457,6 +1457,19 @@ ProcessMonitor::WriteRegisterValue(lldb:
 }
 
 bool
+ProcessMonitor::ReadRegisterSet(lldb::tid_t tid, void *buf, size_t buf_size, unsigned int regset)
+{
+    return false;
+}
+
+bool
+ProcessMonitor::WriteRegisterSet(lldb::tid_t tid, void *buf, size_t buf_size, unsigned int regset)
+{
+    return false;
+}
+
+
+bool
 ProcessMonitor::ReadGPR(lldb::tid_t tid, void *buf, size_t buf_size)
 {
     bool result;

Modified: lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.h?rev=180879&r1=180878&r2=180879&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.h (original)
+++ lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.h Wed May  1 15:38:19 2013
@@ -132,6 +132,14 @@ public:
     bool
     ReadFPR(lldb::tid_t tid, void *buf, size_t buf_size);
 
+    /// Reads the specified register set into the specified buffer.
+    ///
+    /// This method is provided for use by RegisterContextFreeBSD derivatives.
+    /// FIXME: The FreeBSD implementation of this function should use tid in order
+    ///        to enable support for debugging threaded programs.
+    bool
+    ReadRegisterSet(lldb::tid_t tid, void *buf, size_t buf_size, unsigned int regset);
+
     /// Writes all general purpose registers into the specified buffer.
     /// FIXME: The FreeBSD implementation of this function should use tid in order
     ///        to enable support for debugging threaded programs.
@@ -142,12 +150,20 @@ public:
     /// FIXME: The FreeBSD implementation of this function should use tid in order
     ///        to enable support for debugging threaded programs.
     bool
-    WriteFPR(lldb::tid_t tid, void *buf);
+    WriteFPR(lldb::tid_t tid, void *buf, size_t buf_size);
+
+    /// Writes the specified register set into the specified buffer.
+    ///
+    /// This method is provided for use by RegisterContextFreeBSD derivatives.
+    /// FIXME: The FreeBSD implementation of this function should use tid in order
+    ///        to enable support for debugging threaded programs.
+    bool
+    WriteRegisterSet(lldb::tid_t tid, void *buf, size_t buf_size, unsigned int regset);
 
     /// Writes a siginfo_t structure corresponding to the given thread ID to the
     /// memory region pointed to by @p siginfo.
     bool
-    GetSignalInfo(lldb::tid_t tid, void *siginfo, int &errno);
+    GetSignalInfo(lldb::tid_t tid, void *siginfo, int &error_no);
 
     /// Writes the raw event message code (vis-a-vis PTRACE_GETEVENTMSG)
     /// corresponding to the given thread IDto the memory pointed to by @p





More information about the lldb-commits mailing list