[Lldb-commits] [PATCH] gdb remote fixes
Greg Clayton
gclayton at apple.com
Fri Mar 25 10:24:16 PDT 2011
Looks fine!
On Mar 25, 2011, at 8:22 AM, Stephen Wilson wrote:
>
> 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;
> }
>
>
> _______________________________________________
> lldb-commits mailing list
> lldb-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
More information about the lldb-commits
mailing list