[Lldb-commits] [PATCH] gdb remote fixes
Stephen Wilson
wilsons at start.ca
Fri Mar 25 08:22:23 PDT 2011
This is a compile-tested fix for the gdb remote process plugin on
Linux. It simply adds some missing includes and replaces arc4random
with a call to rand().
diff --git a/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp b/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
index 15ab589..7a96946 100644
--- a/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
+++ b/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
@@ -11,6 +11,8 @@
#include "GDBRemoteCommunication.h"
// C Includes
+#include <string.h>
+
// C++ Includes
// Other libraries and framework includes
#include "lldb/Core/Log.h"
diff --git a/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index e5a1d7c..49f9aa6 100644
--- a/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -10,6 +10,7 @@
// C Includes
#include <errno.h>
#include <spawn.h>
+#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -56,7 +57,7 @@ using namespace lldb_private;
static inline uint16_t
get_random_port ()
{
- return (arc4random() % (UINT16_MAX - 1000u)) + 1000u;
+ return (rand() % (UINT16_MAX - 1000u)) + 1000u;
}
More information about the lldb-commits
mailing list