[Lldb-commits] [lldb] r250801 - [LLDB] Insert names with same signo as alias instead of a new entry

2015-10-20 Thread Mohit K. Bhakkad via lldb-commits
Author: mohit.bhakkad
Date: Tue Oct 20 02:05:46 2015
New Revision: 250801

URL: http://llvm.org/viewvc/llvm-project?rev=250801&view=rev
Log:
[LLDB] Insert names with same signo as alias instead of a new entry

Reviewers: clayborg, labath.
Subscribers: jaydeep, dsanders, bhushan, sagar, nitesh.jain, 
emaste,lldb-commits.
Differential Revision: http://reviews.llvm.org/D13646

Modified:
lldb/trunk/include/lldb/Target/UnixSignals.h
lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
lldb/trunk/source/Plugins/Process/Utility/FreeBSDSignals.cpp
lldb/trunk/source/Plugins/Process/Utility/LinuxSignals.cpp
lldb/trunk/source/Plugins/Process/Utility/MipsLinuxSignals.cpp
lldb/trunk/source/Target/UnixSignals.cpp

Modified: lldb/trunk/include/lldb/Target/UnixSignals.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/UnixSignals.h?rev=250801&r1=250800&r2=250801&view=diff
==
--- lldb/trunk/include/lldb/Target/UnixSignals.h (original)
+++ lldb/trunk/include/lldb/Target/UnixSignals.h Tue Oct 20 02:05:46 2015
@@ -98,6 +98,9 @@ public:
 int32_t
 GetSignalAtIndex(int32_t index) const;
 
+ConstString
+GetShortName(ConstString name) const;
+
 // We assume that the elements of this object are constant once it is 
constructed,
 // since a process should never need to add or remove symbols as it runs.  
So don't
 // call these functions anywhere but the constructor of your subclass of 
UnixSignals or in
@@ -106,11 +109,11 @@ public:
 void
 AddSignal (int signo,
const char *name,
-   const char *short_name,
bool default_suppress,
bool default_stop,
bool default_notify,
-   const char *description);
+   const char *description,
+   const char *alias = nullptr);
 
 void
 RemoveSignal (int signo);
@@ -123,18 +126,18 @@ protected:
 struct Signal
 {
 ConstString m_name;
-ConstString m_short_name;
+ConstString m_alias;
 std::string m_description;
 bool m_suppress:1,
  m_stop:1,
  m_notify:1;
 
 Signal (const char *name,
-const char *short_name,
 bool default_suppress,
 bool default_stop,
 bool default_notify,
-const char *description);
+const char *description,
+const char *alias);
 
 ~Signal () {}
 };

Modified: 
lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp?rev=250801&r1=250800&r2=250801&view=diff
==
--- lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp 
(original)
+++ lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp 
Tue Oct 20 02:05:46 2015
@@ -914,13 +914,8 @@ PlatformRemoteGDBServer::GetRemoteUnixSi
 return false;
 
 // We can live without short_name, description, etc.
-std::string short_name{""};
-auto object_sp = dict->GetValueForKey("short_name");
-if (object_sp && object_sp->IsValid())
-short_name = object_sp->GetStringValue();
-
 bool suppress{false};
-object_sp = dict->GetValueForKey("suppress");
+auto object_sp = dict->GetValueForKey("suppress");
 if (object_sp && object_sp->IsValid())
 suppress = object_sp->GetBooleanValue();
 
@@ -941,7 +936,6 @@ PlatformRemoteGDBServer::GetRemoteUnixSi
 
 remote_signals_sp->AddSignal(signo,
  name.c_str(),
- short_name.c_str(),
  suppress, stop, notify,
  description.c_str());
 return true;

Modified: lldb/trunk/source/Plugins/Process/Utility/FreeBSDSignals.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/FreeBSDSignals.cpp?rev=250801&r1=250800&r2=250801&view=diff
==
--- lldb/trunk/source/Plugins/Process/Utility/FreeBSDSignals.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/FreeBSDSignals.cpp Tue Oct 20 
02:05:46 2015
@@ -26,70 +26,70 @@ FreeBSDSignals::Reset()
 {
 UnixSignals::Reset();
 
-//SIGNO   NAME   SHORT NAME  SUPPRESS STOP   NOTIFY 
DESCRIPTION 
-//==     ==   == == 
===
-AddSignal (32,"SIGTHR",  "THR",  false,   false, false, 
"thread i

Re: [Lldb-commits] [PATCH] D13646: [LLDB] Don't use signo as key in Signals DenseMap, as signo are not unique

2015-10-20 Thread Mohit Bhakkad via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL250801: [LLDB] Insert names with same signo as alias instead 
of a new entry (authored by mohit.bhakkad).

Changed prior to commit:
  http://reviews.llvm.org/D13646?vs=37469&id=37828#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D13646

Files:
  lldb/trunk/include/lldb/Target/UnixSignals.h
  lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
  lldb/trunk/source/Plugins/Process/Utility/FreeBSDSignals.cpp
  lldb/trunk/source/Plugins/Process/Utility/LinuxSignals.cpp
  lldb/trunk/source/Plugins/Process/Utility/MipsLinuxSignals.cpp
  lldb/trunk/source/Target/UnixSignals.cpp

Index: lldb/trunk/include/lldb/Target/UnixSignals.h
===
--- lldb/trunk/include/lldb/Target/UnixSignals.h
+++ lldb/trunk/include/lldb/Target/UnixSignals.h
@@ -98,19 +98,22 @@
 int32_t
 GetSignalAtIndex(int32_t index) const;
 
+ConstString
+GetShortName(ConstString name) const;
+
 // We assume that the elements of this object are constant once it is constructed,
 // since a process should never need to add or remove symbols as it runs.  So don't
 // call these functions anywhere but the constructor of your subclass of UnixSignals or in
 // your Process Plugin's GetUnixSignals method before you return the UnixSignal object.
 
 void
 AddSignal (int signo,
const char *name,
-   const char *short_name,
bool default_suppress,
bool default_stop,
bool default_notify,
-   const char *description);
+   const char *description,
+   const char *alias = nullptr);
 
 void
 RemoveSignal (int signo);
@@ -123,18 +126,18 @@
 struct Signal
 {
 ConstString m_name;
-ConstString m_short_name;
+ConstString m_alias;
 std::string m_description;
 bool m_suppress:1,
  m_stop:1,
  m_notify:1;
 
 Signal (const char *name,
-const char *short_name,
 bool default_suppress,
 bool default_stop,
 bool default_notify,
-const char *description);
+const char *description,
+const char *alias);
 
 ~Signal () {}
 };
Index: lldb/trunk/source/Target/UnixSignals.cpp
===
--- lldb/trunk/source/Target/UnixSignals.cpp
+++ lldb/trunk/source/Target/UnixSignals.cpp
@@ -25,18 +25,18 @@
 UnixSignals::Signal::Signal
 (
 const char *name,
-const char *short_name,
 bool default_suppress,
 bool default_stop,
 bool default_notify,
-const char *description
+const char *description,
+const char *alias
 ) :
 m_name (name),
-m_short_name (short_name),
 m_description (),
 m_suppress (default_suppress),
 m_stop (default_stop),
-m_notify (default_notify)
+m_notify (default_notify),
+m_alias (alias)
 {
 if (description)
 m_description.assign (description);
@@ -97,54 +97,54 @@
 // order, you can either subclass this class, and use Add & Remove to change them
 // or you can subclass and build them afresh in your constructor;
 m_signals.clear();
-//SIGNO  NAME SHORT NAME SUPPRESS STOP   NOTIFY DESCRIPTION
-//==  ==  == == ===
-AddSignal (1,"SIGHUP","HUP", false,   true , true , "hangup");
-AddSignal (2,"SIGINT","INT", true ,   true , true , "interrupt");
-AddSignal (3,"SIGQUIT",   "QUIT",false,   true , true , "quit");
-AddSignal (4,"SIGILL","ILL", false,   true , true , "illegal instruction");
-AddSignal (5,"SIGTRAP",   "TRAP",true ,   true , true , "trace trap (not reset when caught)");
-AddSignal (6,"SIGABRT",   "ABRT",false,   true , true , "abort()");
-AddSignal (7,"SIGEMT","EMT", false,   true , true , "pollable event");
-AddSignal (8,"SIGFPE","FPE", false,   true , true , "floating point exception");
-AddSignal (9,"SIGKILL",   "KILL",false,   true , true , "kill");
-AddSignal (10,   "SIGBUS","BUS", false,   true , true , "bus error");
-AddSignal (11,   "SIGSEGV",   "SEGV",false,   true , true , "segmentation violation");
-AddSignal (12,   "SIGSYS","SYS", false,   true , true , "bad argument to system call");
-AddSignal (13,   "SIGPIPE",   "PIPE",false,   true , true , "write on a pipe with no one to read it");
-AddSignal (14,   "SIGALRM",   "ALRM",false,   false, false, "alarm clock");
-AddSignal (15,   "SIGTERM",   "TERM",false,   true , true , "software termination signal from kill");
-AddSignal (16,   "SIGURG

Re: [Lldb-commits] [PATCH] D13646: [LLDB] Don't use signo as key in Signals DenseMap, as signo are not unique

2015-10-20 Thread Mohit Bhakkad via lldb-commits
mohit.bhakkad added a comment.

In http://reviews.llvm.org/D13646#267953, @labath wrote:

> This looks much better, I just have a couple of small remarks.


@labath addressed these while committing.


Repository:
  rL LLVM

http://reviews.llvm.org/D13646



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r250810 - Fix build and some warnings after r250798

2015-10-20 Thread Tamas Berghammer via lldb-commits
Author: tberghammer
Date: Tue Oct 20 04:21:04 2015
New Revision: 250810

URL: http://llvm.org/viewvc/llvm-project?rev=250810&view=rev
Log:
Fix build and some warnings after r250798

Modified:
lldb/trunk/include/lldb/DataFormatters/CXXFunctionPointer.h
lldb/trunk/include/lldb/DataFormatters/VectorIterator.h
lldb/trunk/include/lldb/lldb-forward.h
lldb/trunk/source/Target/UnixSignals.cpp

Modified: lldb/trunk/include/lldb/DataFormatters/CXXFunctionPointer.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/CXXFunctionPointer.h?rev=250810&r1=250809&r2=250810&view=diff
==
--- lldb/trunk/include/lldb/DataFormatters/CXXFunctionPointer.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/CXXFunctionPointer.h Tue Oct 20 
04:21:04 2015
@@ -10,7 +10,7 @@
 #ifndef liblldb_CXXFunctionPointer_h_
 #define liblldb_CXXFunctionPointer_h_
 
-#include "lldb-forward.h"
+#include "lldb/lldb-forward.h"
 
 namespace lldb_private {
 namespace formatters

Modified: lldb/trunk/include/lldb/DataFormatters/VectorIterator.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/VectorIterator.h?rev=250810&r1=250809&r2=250810&view=diff
==
--- lldb/trunk/include/lldb/DataFormatters/VectorIterator.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/VectorIterator.h Tue Oct 20 04:21:04 
2015
@@ -10,7 +10,7 @@
 #ifndef liblldb_VectorIterator_h_
 #define liblldb_VectorIterator_h_
 
-#include "lldb-forward.h"
+#include "lldb/lldb-forward.h"
 
 #include "lldb/Core/ConstString.h"
 #include "lldb/Target/ExecutionContext.h"

Modified: lldb/trunk/include/lldb/lldb-forward.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-forward.h?rev=250810&r1=250809&r2=250810&view=diff
==
--- lldb/trunk/include/lldb/lldb-forward.h (original)
+++ lldb/trunk/include/lldb/lldb-forward.h Tue Oct 20 04:21:04 2015
@@ -79,7 +79,7 @@ class   DataExtractor;
 class   Debugger;
 class   Declaration;
 class   Disassembler;
-struct  DumpValueObjectOptions;
+class   DumpValueObjectOptions;
 class   DynamicCheckerFunctions;
 class   DynamicLoader;
 class   Editline;

Modified: lldb/trunk/source/Target/UnixSignals.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/UnixSignals.cpp?rev=250810&r1=250809&r2=250810&view=diff
==
--- lldb/trunk/source/Target/UnixSignals.cpp (original)
+++ lldb/trunk/source/Target/UnixSignals.cpp Tue Oct 20 04:21:04 2015
@@ -32,11 +32,11 @@ UnixSignals::Signal::Signal
 const char *alias
 ) :
 m_name (name),
+m_alias (alias),
 m_description (),
 m_suppress (default_suppress),
 m_stop (default_stop),
-m_notify (default_notify),
-m_alias (alias)
+m_notify (default_notify)
 {
 if (description)
 m_description.assign (description);


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D13881: Add domain socket support to gdb-remote protocol and lldb-server.

2015-10-20 Thread Pavel Labath via lldb-commits
labath added a comment.

I *think* it looks good, but I find it quite hard to review a change of this 
size.
A wise man once said "if your commit description contains bullet points, you 
are doing too much". I think it would be better to split up changes like this 
in the future.

> Make PlatformRemoteGDBServer to support retry-based connect - both for 
> ConnectRemote and debug server connect. Since in case of domain sockets 
> lldb-server doesn't write port into named pipe we cannot use it as a 
> synchronization point - so it's possible that qLaunchGDBServer will be 
> received by host before debug server is up and listens on socket.


I would like to preserve the invariant that by the time a reply to 
qLaunchGDBServer is received, the server is up and ready to serve connections. 
How about we keep this file synchronization protocol even when using domain 
sockets? The server could write nothing (or the socket path, or whatever) to 
the file when it is up and ready. That way, we don't  have to increase the 
number of places that do those silly wait-and-retry loops. What do you think?



Comment at: source/Plugins/Platform/Android/AdbClient.cpp:151
@@ +150,3 @@
+char message[PATH_MAX];
+snprintf (message, sizeof (message), "forward:tcp:%d;localfilesystem:%s", 
local_port, remote_socket_name);
+

Any special quoting needed here? (e.g. if the socket name contains ':')

Although, I wouldn't be surprised if adb just falls over in that case...


Comment at: source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h:228
@@ -227,3 +227,3 @@
 
-// Launch the lldb-gdbserver on the remote host and return the port it is 
listening on or 0 on
-// failure. Subclasses should override this method if they want to do 
extra actions before or
+// Launch the lldb-gdbserver on the remote host and return true it is 
listening on
+// Subclasses should override this method if they want to do extra actions 
before or

This comment makes no sense.

Also, given the new functionality, the function name isn't the best choice. 
Maybe simply `LaunchGDBServer`, with the comment saying that the url it listens 
on is returned through the second argument ?


Comment at: tools/lldb-server/lldb-gdbserver.cpp:266
@@ -265,3 +254,1 @@
 
-static lldb::thread_result_t
-ListenThread (lldb::thread_arg_t /* arg */)

I like that this is finally going away.


http://reviews.llvm.org/D13881



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D13859: [LLDB][LLGS Test] Check length of register, only when its available

2015-10-20 Thread Mohit Bhakkad via lldb-commits
mohit.bhakkad updated this revision to Diff 37843.
mohit.bhakkad added a comment.

This patch makes server send an End  of register(E45) response if a register 
present in reginfo is not available on actual machine.


Repository:
  rL LLVM

http://reviews.llvm.org/D13859

Files:
  source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp

Index: source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
===
--- source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
+++ source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
@@ -1518,6 +1518,12 @@
 if (!reg_info)
 return SendErrorResponse (69);
 
+// Try reading the register, return end of registers response if failed to 
read.
+RegisterValue reg_value;
+Error error = reg_context_sp->ReadRegister (reg_info, reg_value);
+if (error.Fail())
+return SendErrorResponse (69);
+
 // Build the reginfos response.
 StreamGDBRemote response;
 


Index: source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
===
--- source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
+++ source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
@@ -1518,6 +1518,12 @@
 if (!reg_info)
 return SendErrorResponse (69);
 
+// Try reading the register, return end of registers response if failed to read.
+RegisterValue reg_value;
+Error error = reg_context_sp->ReadRegister (reg_info, reg_value);
+if (error.Fail())
+return SendErrorResponse (69);
+
 // Build the reginfos response.
 StreamGDBRemote response;
 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D13812: Increase default memory cache line size for android

2015-10-20 Thread Tamas Berghammer via lldb-commits
tberghammer added a comment.

Looks good with a few minor comments inline

One additional design question:
What is your opinion about specifying the default value for the memory cache 
line size (the 512 byte) in Platform::GetDefaultMemoryCacheLineSize() instead 
of in the property definition? I think it makes the interface a bit cleaner and 
then target.process.memory-cache-line-size can have a default value of 0 (or 
-1) on LLDB startup and we overwrite it by the value returned by the Platform 
if it haven't been set to an actual value by the user.



Comment at: test/android/platform/TestDefaultCacheLineSize.py:15-17
@@ +14,5 @@
+
+def setUp(self):
+# Call super's setUp().
+TestBase.setUp(self)
+

(nit): You don't need this (called automatically because of the inheritance)


Comment at: test/android/platform/TestDefaultCacheLineSize.py:37
@@ +36,3 @@
+
+# We have successfully caught thread creation. Now just run to 
completion
+process.Continue()

(nit): I think it is a leftover from an other test


http://reviews.llvm.org/D13812



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r250814 - Increase default memory cache line size for android

2015-10-20 Thread Pavel Labath via lldb-commits
Author: labath
Date: Tue Oct 20 05:33:17 2015
New Revision: 250814

URL: http://llvm.org/viewvc/llvm-project?rev=250814&view=rev
Log:
Increase default memory cache line size for android

Summary:
ADB packets have a maximum size of 4k. This means the size of memory reads does 
not affect speed
too much (as long as it fits in one packet). Therefore, I am increasing the 
default memory read
size for android to 2k. This value is used only if the user has not modified 
the default
memory-cache-line-size setting.

Reviewers: clayborg, tberghammer

Subscribers: tberghammer, danalbert, srhines, lldb-commits

Differential Revision: http://reviews.llvm.org/D13812

Added:
lldb/trunk/test/android/
lldb/trunk/test/android/platform/
lldb/trunk/test/android/platform/Makefile
lldb/trunk/test/android/platform/TestDefaultCacheLineSize.py
lldb/trunk/test/android/platform/main.cpp
Modified:
lldb/trunk/include/lldb/Target/Platform.h
lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.cpp
lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.h
lldb/trunk/source/Target/Process.cpp

Modified: lldb/trunk/include/lldb/Target/Platform.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Platform.h?rev=250814&r1=250813&r2=250814&view=diff
==
--- lldb/trunk/include/lldb/Target/Platform.h (original)
+++ lldb/trunk/include/lldb/Target/Platform.h Tue Oct 20 05:33:17 2015
@@ -947,7 +947,6 @@ class ModuleCache;
 virtual const std::vector &
 GetTrapHandlerSymbolNames ();
 
-
 //--
 /// Find a support executable that may not live within in the
 /// standard locations related to LLDB.
@@ -970,6 +969,14 @@ class ModuleCache;
 return FileSpec();
 }
 
+//--
+/// Allow the platform to set preferred memory cache line size. If 
non-zero (and the user
+/// has not set cache line size explicitly), this value will be used 
as the cache line
+/// size for memory reads.
+//--
+virtual uint32_t
+GetDefaultMemoryCacheLineSize() { return 0; }
+
 protected:
 bool m_is_host;
 // Set to true when we are able to actually set the OS version while 

Modified: lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.cpp?rev=250814&r1=250813&r2=250814&view=diff
==
--- lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.cpp Tue Oct 20 
05:33:17 2015
@@ -28,6 +28,7 @@ using namespace lldb_private;
 using namespace lldb_private::platform_android;
 
 static uint32_t g_initialize_count = 0;
+static const unsigned int g_android_default_cache_size = 2048; // Fits inside 
4k adb packet.
 
 void
 PlatformAndroid::Initialize ()
@@ -275,6 +276,12 @@ PlatformAndroid::DisconnectRemote()
 }
 
 uint32_t
+PlatformAndroid::GetDefaultMemoryCacheLineSize()
+{
+return g_android_default_cache_size;
+}
+
+uint32_t
 PlatformAndroid::GetSdkVersion()
 {
 if (!IsConnected())

Modified: lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.h?rev=250814&r1=250813&r2=250814&view=diff
==
--- lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.h (original)
+++ lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.h Tue Oct 20 
05:33:17 2015
@@ -83,6 +83,9 @@ namespace platform_android {
 Error
 DisconnectRemote () override;
 
+uint32_t
+GetDefaultMemoryCacheLineSize() override;
+
  protected:
 const char *
 GetCacheHostname () override;

Modified: lldb/trunk/source/Target/Process.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=250814&r1=250813&r2=250814&view=diff
==
--- lldb/trunk/source/Target/Process.cpp (original)
+++ lldb/trunk/source/Target/Process.cpp Tue Oct 20 05:33:17 2015
@@ -813,6 +813,13 @@ Process::Process(lldb::TargetSP target_s
  
eBroadcastInternalStateControlResume);
 // We need something valid here, even if just the default UnixSignalsSP.
 assert (m_unix_signals_sp && "null m_unix_signals_sp after 
initialization");
+
+// Allow the platform to override the default cache line size
+OptionValueSP value_sp =
+m_co

Re: [Lldb-commits] [PATCH] D13812: Increase default memory cache line size for android

2015-10-20 Thread Pavel Labath via lldb-commits
labath added a comment.

Good catch. fixed and committed.


Repository:
  rL LLVM

http://reviews.llvm.org/D13812



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D13812: Increase default memory cache line size for android

2015-10-20 Thread Pavel Labath via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL250814: Increase default memory cache line size for android 
(authored by labath).

Changed prior to commit:
  http://reviews.llvm.org/D13812?vs=37776&id=37845#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D13812

Files:
  lldb/trunk/include/lldb/Target/Platform.h
  lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.cpp
  lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.h
  lldb/trunk/source/Target/Process.cpp
  lldb/trunk/test/android/platform/Makefile
  lldb/trunk/test/android/platform/TestDefaultCacheLineSize.py
  lldb/trunk/test/android/platform/main.cpp

Index: lldb/trunk/test/android/platform/main.cpp
===
--- lldb/trunk/test/android/platform/main.cpp
+++ lldb/trunk/test/android/platform/main.cpp
@@ -0,0 +1,13 @@
+//===-- main.cpp *- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+
+int main ()
+{
+return 0;
+}
Index: lldb/trunk/test/android/platform/TestDefaultCacheLineSize.py
===
--- lldb/trunk/test/android/platform/TestDefaultCacheLineSize.py
+++ lldb/trunk/test/android/platform/TestDefaultCacheLineSize.py
@@ -0,0 +1,41 @@
+"""
+Verify the default cache line size for android targets
+"""
+
+import os
+import unittest2
+import lldb
+from lldbtest import *
+import lldbutil
+
+class DefaultCacheLineSizeTestCase(TestBase):
+
+mydir = TestBase.compute_mydir(__file__)
+
+@skipUnlessPlatform(['android'])
+def test_cache_line_size(self):
+self.build(dictionary=self.getBuildFlags())
+exe = os.path.join(os.getcwd(), "a.out")
+target = self.dbg.CreateTarget(exe)
+self.assertTrue(target and target.IsValid(), "Target is valid")
+
+breakpoint = target.BreakpointCreateByName("main")
+self.assertTrue(breakpoint and breakpoint.IsValid(), "Breakpoint is valid")
+
+# Run the program.
+process = target.LaunchSimple(None, None, self.get_process_working_directory())
+self.assertTrue(process and process.IsValid(), PROCESS_IS_VALID)
+self.assertEqual(process.GetState(), lldb.eStateStopped, PROCESS_STOPPED)
+
+# check the setting value
+self.expect("settings show target.process.memory-cache-line-size", patterns=[" = 2048"])
+
+# Run to completion.
+process.Continue()
+self.assertEqual(process.GetState(), lldb.eStateExited, PROCESS_EXITED)
+
+if __name__ == '__main__':
+import atexit
+lldb.SBDebugger.Initialize()
+atexit.register(lambda: lldb.SBDebugger.Terminate())
+unittest2.main()
Index: lldb/trunk/test/android/platform/Makefile
===
--- lldb/trunk/test/android/platform/Makefile
+++ lldb/trunk/test/android/platform/Makefile
@@ -0,0 +1,4 @@
+LEVEL = ../../make
+
+CXX_SOURCES := main.cpp
+include $(LEVEL)/Makefile.rules
Index: lldb/trunk/source/Target/Process.cpp
===
--- lldb/trunk/source/Target/Process.cpp
+++ lldb/trunk/source/Target/Process.cpp
@@ -813,6 +813,13 @@
  eBroadcastInternalStateControlResume);
 // We need something valid here, even if just the default UnixSignalsSP.
 assert (m_unix_signals_sp && "null m_unix_signals_sp after initialization");
+
+// Allow the platform to override the default cache line size
+OptionValueSP value_sp =
+m_collection_sp->GetPropertyAtIndex(nullptr, true, ePropertyMemCacheLineSize)->GetValue();
+uint32_t platform_cache_line_size = target_sp->GetPlatform()->GetDefaultMemoryCacheLineSize();
+if (! value_sp->OptionWasSet() && platform_cache_line_size != 0)
+value_sp->SetUInt64Value(platform_cache_line_size);
 }
 
 //--
Index: lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.h
===
--- lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.h
+++ lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.h
@@ -83,6 +83,9 @@
 Error
 DisconnectRemote () override;
 
+uint32_t
+GetDefaultMemoryCacheLineSize() override;
+
  protected:
 const char *
 GetCacheHostname () override;
Index: lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.cpp
===
--- lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.cpp
+++ lldb/trunk/source/Plugins/Platform

Re: [Lldb-commits] [PATCH] D13812: Increase default memory cache line size for android

2015-10-20 Thread Pavel Labath via lldb-commits
labath added a comment.

I believe adding this to qHostInfo is over-engineering at the moment. But it's 
a good idea, and we can do it if we have a need for more control of this in the 
future.


Repository:
  rL LLVM

http://reviews.llvm.org/D13812



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D12890: Add plugin.jit-loader.gdb.enable-jit-breakpoint property to make JIT loader breakpoint optional.

2015-10-20 Thread Keno Fischer via lldb-commits
loladiro added a subscriber: loladiro.
loladiro added a comment.

@clayborg Given that this was merged, does it make sense to now allow the 
JITLoader to be created on OS X as well, but set the setting to false by 
default? Does that address the performance concern you had initially?


http://reviews.llvm.org/D12890



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D13859: [LLDB][LLGS Test] Check length of register, only when its available

2015-10-20 Thread Pavel Labath via lldb-commits
labath added a comment.

I think this should go in a little bit deeper, i.e., inside the 
NativeRegisterContextLinux_mips, or whatever is the right class for you. I 
think this is better for several reasons:

- if the register is physically not present, the register context should not 
report it (through GetUserRegisterCount, GetRegisterInfoAtIndex, etc.) - 
someone else may be iterating through the registers in the context and doing 
stuff - he will get errors when encountering your registers
- this can cause us to silently lose some registers if we fail to read them for 
any reason (due to an unrelated bug somewhere)


Repository:
  rL LLVM

http://reviews.llvm.org/D13859



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D13778: [SBValue] Add a method GetNumChildren(uint32_t max)

2015-10-20 Thread Pavel Labath via lldb-commits
labath added a comment.

> When such an error occurs, it is unlikely to be an lldb bug, or 
> data-formatter bug. One can come up with a data structure for which reading a 
> child element would require complete debug info, but reading the # of child 
> elements need not require complete debug info (there could be an instance 
> variable storing the size). Another could be that a child is improperly 
> initialized but the data structure itself is properly initialized.


Ok, that makes sense. No objections from my side.



Comment at: source/API/SBValue.cpp:1273
@@ -1272,3 +1272,3 @@
 {
 uint32_t num_children = 0;
 

You can replace this by `return GetNumChildren(UINT32_MAX);`


http://reviews.llvm.org/D13778



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r250820 - Add a new task pool class to LLDB

2015-10-20 Thread Tamas Berghammer via lldb-commits
Author: tberghammer
Date: Tue Oct 20 07:42:05 2015
New Revision: 250820

URL: http://llvm.org/viewvc/llvm-project?rev=250820&view=rev
Log:
Add a new task pool class to LLDB

The purpose of the class is to make it easy to execute tasks in parallel

Basic design goals:
* Have a very lightweight and easy to use interface where a list of
  lambdas can be executed in parallel
* Use a global thread pool to limit the number of threads used
  (std::async don't do it on Linux) and to eliminate the thread creation
  overhead
* Destroy the thread currently not in use to avoid the confusion caused
  by them during debugging LLDB

Possible future improvements:
* Possibility to cancel already added, but not yet started tasks
* Parallel for_each implementation
* Optimizations in the thread creation destroyation code

Differential revision: http://reviews.llvm.org/D13727

Added:
lldb/trunk/include/lldb/Utility/TaskPool.h
lldb/trunk/source/Utility/TaskPool.cpp
lldb/trunk/unittests/Utility/TaskPoolTest.cpp
Modified:
lldb/trunk/lldb.xcodeproj/project.pbxproj
lldb/trunk/source/Utility/CMakeLists.txt
lldb/trunk/unittests/Utility/CMakeLists.txt

Added: lldb/trunk/include/lldb/Utility/TaskPool.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/TaskPool.h?rev=250820&view=auto
==
--- lldb/trunk/include/lldb/Utility/TaskPool.h (added)
+++ lldb/trunk/include/lldb/Utility/TaskPool.h Tue Oct 20 07:42:05 2015
@@ -0,0 +1,201 @@
+//===- TaskPool.h ---*- C++ 
-*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+
+#ifndef utility_TaskPool_h_
+#define utility_TaskPool_h_
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+// Global TaskPool class for running tasks in parallel on a set of worker 
thread created the first
+// time the task pool is used. The TaskPool provide no gurantee about the 
order the task will be run
+// and about what tasks will run in parrallel. None of the task added to the 
task pool should block
+// on something (mutex, future, condition variable) what will be set only by 
the completion of an
+// other task on the task pool as they may run on the same thread sequentally.
+class TaskPool
+{
+public:
+// Add a new task to the task pool and return a std::future belonging to 
the newly created task.
+// The caller of this function has to wait on the future for this task to 
complete.
+template
+static std::future::type>
+AddTask(F&& f, Args&&... args);
+
+// Run all of the specified tasks on the task pool and wait until all of 
them are finished
+// before returning. This method is intended to be used for small number 
tasks where listing
+// them as function arguments is acceptable. For running large number of 
tasks you should use
+// AddTask for each task and then call wait() on each returned future.
+template
+static void
+RunTasks(T&&... tasks);
+
+private:
+TaskPool() = delete;
+
+template
+struct RunTaskImpl;
+
+static void
+AddTaskImpl(std::function&& task_fn);
+};
+
+// Wrapper class around the global TaskPool implementation to make it possible 
to create a set of
+// tasks and then wait for the tasks to be completed by the 
WaitForNextCompletedTask call. This
+// class should be used when WaitForNextCompletedTask is needed because this 
class add no other
+// extra functionality to the TaskPool class and it have a very minor 
performance overhead.
+template  // The return type of the tasks what will be added to 
this task runner
+class TaskRunner
+{
+public:
+// Add a task to the task runner what will also add the task to the global 
TaskPool. The
+// function doesn't return the std::future for the task because it will be 
supplied by the
+// WaitForNextCompletedTask after the task is completed.
+template
+void
+AddTask(F&& f, Args&&... args);
+
+// Wait for the next task in this task runner to finish and then return 
the std::future what
+// belongs to the finished task. If there is no task in this task runner 
(neither pending nor
+// comleted) then this function will return an invalid future. Usually 
this function should be
+// called in a loop processing the results of the tasks until it returns 
an invalid std::future
+// what means that all task in this task runner is completed.
+std::future
+WaitForNextCompletedTask();
+
+// Convenience method to wait for all task in this TaskRunner to finish. 
Do NOT use this class
+// just because of this method. Use TaskPool instead and wait for each 
std::future returned by
+// AddTask in a loop.
+void
+WaitFor

Re: [Lldb-commits] [PATCH] D13662: Make dwarf parsing multi-threaded

2015-10-20 Thread Tamas Berghammer via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL250821: Make dwarf parsing multi-threaded (authored by 
tberghammer).

Changed prior to commit:
  http://reviews.llvm.org/D13662?vs=37353&id=37866#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D13662

Files:
  lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp
  lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.h
  lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp

Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp
===
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp
@@ -83,3 +83,14 @@
 break;
 }
 }
+
+void
+NameToDIE::Append (const NameToDIE& other)
+{
+const uint32_t size = other.m_map.GetSize();
+for (uint32_t i = 0; i < size; ++i)
+{
+m_map.Append(other.m_map.GetCStringAtIndexUnchecked (i),
+ other.m_map.GetValueAtIndexUnchecked (i));
+}
+}
Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.h
===
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.h
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.h
@@ -38,6 +38,9 @@
 Insert (const lldb_private::ConstString& name, const DIERef& die_ref);
 
 void
+Append (const NameToDIE& other);
+
+void
 Finalize();
 
 size_t
Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -50,6 +50,8 @@
 
 #include "lldb/Target/Language.h"
 
+#include "lldb/Utility/TaskPool.h"
+
 #include "DWARFASTParser.h"
 #include "DWARFCompileUnit.h"
 #include "DWARFDebugAbbrev.h"
@@ -2035,40 +2037,72 @@
 "SymbolFileDWARF::Index (%s)",
 GetObjectFile()->GetFileSpec().GetFilename().AsCString(""));
 
+
+
 DWARFDebugInfo* debug_info = DebugInfo();
 if (debug_info)
 {
-uint32_t cu_idx = 0;
 const uint32_t num_compile_units = GetNumCompileUnits();
-for (cu_idx = 0; cu_idx < num_compile_units; ++cu_idx)
+std::vector function_basename_index(num_compile_units);
+std::vector function_fullname_index(num_compile_units);
+std::vector function_method_index(num_compile_units);
+std::vector function_selector_index(num_compile_units);
+std::vector objc_class_selectors_index(num_compile_units);
+std::vector global_index(num_compile_units);
+std::vector type_index(num_compile_units);
+std::vector namespace_index(num_compile_units);
+
+auto parser_fn = [this,
+  debug_info,
+  &function_basename_index,
+  &function_fullname_index,
+  &function_method_index,
+  &function_selector_index,
+  &objc_class_selectors_index,
+  &global_index,
+  &type_index,
+  &namespace_index](uint32_t cu_idx)
 {
 DWARFCompileUnit* dwarf_cu = debug_info->GetCompileUnitAtIndex(cu_idx);
+bool clear_dies = dwarf_cu->ExtractDIEsIfNeeded(false) > 1;
 
-bool clear_dies = dwarf_cu->ExtractDIEsIfNeeded (false) > 1;
+dwarf_cu->Index(function_basename_index[cu_idx],
+function_fullname_index[cu_idx],
+function_method_index[cu_idx],
+function_selector_index[cu_idx],
+objc_class_selectors_index[cu_idx],
+global_index[cu_idx],
+type_index[cu_idx],
+namespace_index[cu_idx]);
 
-dwarf_cu->Index (m_function_basename_index,
- m_function_fullname_index,
- m_function_method_index,
- m_function_selector_index,
- m_objc_class_selectors_index,
- m_global_index, 
- m_type_index,
- m_namespace_index);
-
 // Keep memory down by clearing DIEs if this generate function
 // caused them to be parsed
 if (clear_dies)
-dwarf_cu->ClearDIEs (true);
-}
-
-m_function_basename_index.Finalize();
-m_function_fullname_index.Finalize();
-m_function_method_index.Finalize();
-m_function_selector_index.Finalize();
-m_objc_class_selectors_index.Finalize();
-m_global_index.Fi

[Lldb-commits] [lldb] r250821 - Make dwarf parsing multi-threaded

2015-10-20 Thread Tamas Berghammer via lldb-commits
Author: tberghammer
Date: Tue Oct 20 07:42:10 2015
New Revision: 250821

URL: http://llvm.org/viewvc/llvm-project?rev=250821&view=rev
Log:
Make dwarf parsing multi-threaded

Loading the debug info from a large application is the slowest task
LLDB do. This CL makes most of the dwarf parsing code multi-threaded.

As a result the speed of "attach; backtrace; exit;" when the inferior
is an LLDB with full debug info increased by a factor of 2 (on my machine).

Differential revision: http://reviews.llvm.org/D13662

Modified:
lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.h
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp?rev=250821&r1=250820&r2=250821&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp Tue Oct 20 
07:42:10 2015
@@ -83,3 +83,14 @@ NameToDIE::ForEach (std::function http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.h?rev=250821&r1=250820&r2=250821&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.h (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.h Tue Oct 20 07:42:10 
2015
@@ -38,6 +38,9 @@ public:
 Insert (const lldb_private::ConstString& name, const DIERef& die_ref);
 
 void
+Append (const NameToDIE& other);
+
+void
 Finalize();
 
 size_t

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=250821&r1=250820&r2=250821&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Tue Oct 20 
07:42:10 2015
@@ -50,6 +50,8 @@
 
 #include "lldb/Target/Language.h"
 
+#include "lldb/Utility/TaskPool.h"
+
 #include "DWARFASTParser.h"
 #include "DWARFCompileUnit.h"
 #include "DWARFDebugAbbrev.h"
@@ -2035,40 +2037,72 @@ SymbolFileDWARF::Index ()
 "SymbolFileDWARF::Index (%s)",
 
GetObjectFile()->GetFileSpec().GetFilename().AsCString(""));
 
+
+
 DWARFDebugInfo* debug_info = DebugInfo();
 if (debug_info)
 {
-uint32_t cu_idx = 0;
 const uint32_t num_compile_units = GetNumCompileUnits();
-for (cu_idx = 0; cu_idx < num_compile_units; ++cu_idx)
+std::vector function_basename_index(num_compile_units);
+std::vector function_fullname_index(num_compile_units);
+std::vector function_method_index(num_compile_units);
+std::vector function_selector_index(num_compile_units);
+std::vector objc_class_selectors_index(num_compile_units);
+std::vector global_index(num_compile_units);
+std::vector type_index(num_compile_units);
+std::vector namespace_index(num_compile_units);
+
+auto parser_fn = [this,
+  debug_info,
+  &function_basename_index,
+  &function_fullname_index,
+  &function_method_index,
+  &function_selector_index,
+  &objc_class_selectors_index,
+  &global_index,
+  &type_index,
+  &namespace_index](uint32_t cu_idx)
 {
 DWARFCompileUnit* dwarf_cu = 
debug_info->GetCompileUnitAtIndex(cu_idx);
+bool clear_dies = dwarf_cu->ExtractDIEsIfNeeded(false) > 1;
 
-bool clear_dies = dwarf_cu->ExtractDIEsIfNeeded (false) > 1;
+dwarf_cu->Index(function_basename_index[cu_idx],
+function_fullname_index[cu_idx],
+function_method_index[cu_idx],
+function_selector_index[cu_idx],
+objc_class_selectors_index[cu_idx],
+global_index[cu_idx],
+type_index[cu_idx],
+namespace_index[cu_idx]);
 
-dwarf_cu->Index (m_function_basename_index,
- m_function_fullname_index,
- m_function_method_index,
- m_function_selector_index,
- m_objc_class_selectors_index,
- m_global_index, 
- m_type_index,
- m_namespace_index);
-  

Re: [Lldb-commits] [PATCH] D13727: Add task pool to LLDB

2015-10-20 Thread Tamas Berghammer via lldb-commits
This revision was automatically updated to reflect the committed changes.
tberghammer marked 4 inline comments as done.
Closed by commit rL250820: Add a new task pool class to LLDB (authored by 
tberghammer).

Changed prior to commit:
  http://reviews.llvm.org/D13727?vs=37566&id=37865#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D13727

Files:
  lldb/trunk/include/lldb/Utility/TaskPool.h
  lldb/trunk/lldb.xcodeproj/project.pbxproj
  lldb/trunk/source/Utility/CMakeLists.txt
  lldb/trunk/source/Utility/TaskPool.cpp
  lldb/trunk/unittests/Utility/CMakeLists.txt
  lldb/trunk/unittests/Utility/TaskPoolTest.cpp

Index: lldb/trunk/lldb.xcodeproj/project.pbxproj
===
--- lldb/trunk/lldb.xcodeproj/project.pbxproj
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj
@@ -719,6 +719,7 @@
 		6D95DC021B9DC057000E318A /* SymbolFileDWARFDwo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D95DBFF1B9DC057000E318A /* SymbolFileDWARFDwo.cpp */; };
 		6D99A3631BBC2F3200979793 /* ArmUnwindInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D99A3621BBC2F3200979793 /* ArmUnwindInfo.cpp */; };
 		6D9AB3DD1BB2B74E003F2289 /* TypeMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D9AB3DC1BB2B74E003F2289 /* TypeMap.cpp */; };
+		6DEC6F391BD66D750091ABA6 /* TaskPool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DEC6F381BD66D750091ABA6 /* TaskPool.cpp */; };
 		8C2D6A53197A1EAF006989C9 /* MemoryHistory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8C2D6A52197A1EAF006989C9 /* MemoryHistory.cpp */; };
 		8C2D6A5E197A250F006989C9 /* MemoryHistoryASan.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8C2D6A5A197A1FDC006989C9 /* MemoryHistoryASan.cpp */; };
 		8CCB017E19BA28A80009FD44 /* ThreadCollection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CCB017A19BA283D0009FD44 /* ThreadCollection.cpp */; };
@@ -2421,6 +2422,8 @@
 		6D99A3621BBC2F3200979793 /* ArmUnwindInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ArmUnwindInfo.cpp; path = source/Symbol/ArmUnwindInfo.cpp; sourceTree = ""; };
 		6D9AB3DC1BB2B74E003F2289 /* TypeMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TypeMap.cpp; path = source/Symbol/TypeMap.cpp; sourceTree = ""; };
 		6D9AB3DE1BB2B76B003F2289 /* TypeMap.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TypeMap.h; path = include/lldb/Symbol/TypeMap.h; sourceTree = ""; };
+		6DEC6F381BD66D750091ABA6 /* TaskPool.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TaskPool.cpp; path = source/Utility/TaskPool.cpp; sourceTree = ""; };
+		6DEC6F3A1BD66D950091ABA6 /* TaskPool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TaskPool.h; path = include/lldb/Utility/TaskPool.h; sourceTree = ""; };
 		8C2D6A52197A1EAF006989C9 /* MemoryHistory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MemoryHistory.cpp; path = source/Target/MemoryHistory.cpp; sourceTree = ""; };
 		8C2D6A54197A1EBE006989C9 /* MemoryHistory.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = MemoryHistory.h; path = include/lldb/Target/MemoryHistory.h; sourceTree = ""; };
 		8C2D6A5A197A1FDC006989C9 /* MemoryHistoryASan.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MemoryHistoryASan.cpp; sourceTree = ""; };
@@ -3625,6 +3628,8 @@
 		2682F168115ED9C800CCFF99 /* Utility */ = {
 			isa = PBXGroup;
 			children = (
+6DEC6F3A1BD66D950091ABA6 /* TaskPool.h */,
+6DEC6F381BD66D750091ABA6 /* TaskPool.cpp */,
 257E47151AA56C2000A62F81 /* ModuleCache.cpp */,
 257E47161AA56C2000A62F81 /* ModuleCache.h */,
 33064C9B1A5C7A490033D415 /* UriParser.h */,
@@ -6687,6 +6692,7 @@
 265205A813D3E3F700132FE2 /* RegisterContextKDP_arm.cpp in Sources */,
 265205AA13D3E3F700132FE2 /* RegisterContextKDP_i386.cpp in Sources */,
 AF77E0A31A033D360096C0EA /* RegisterContextMacOSXFrameBackchain.cpp in Sources */,
+6DEC6F391BD66D750091ABA6 /* TaskPool.cpp in Sources */,
 265205AC13D3E3F700132FE2 /* RegisterContextKDP_x86_64.cpp in Sources */,
 2628A4D513D4977900F5487A /* ThreadKDP.cpp in Sources */,
 26D7E45D13D5E30A007FD12B /* SocketAddress.cpp in Sources */,
Index: lldb/trunk/unittests/Utility/TaskPoolTest.cpp
===
--- lldb/trunk/unittests/Utility/TaskPoolTest.cpp
+++ lldb/trunk/unittests/Utility/TaskPoolTest.cpp
@@ -0,0 +1,62 @@
+#include "gtest/gtest.h"
+
+#include "lldb/Utility/TaskPool.h"
+
+TEST (TaskPoolTest, AddTask)
+{
+auto fn = [](int x) { return x * x + 1; };
+
+auto f1 = TaskPool::AddTask(fn, 1);
+auto f2 = TaskPool::AddTask(fn, 2);
+auto f3 = TaskPool::AddTask(fn, 3);
+auto f4 = TaskPool::AddTask(fn, 4);
+
+

[Lldb-commits] [lldb] r250832 - Revert "Make dwarf parsing multi-threaded"

2015-10-20 Thread Tamas Berghammer via lldb-commits
Author: tberghammer
Date: Tue Oct 20 10:43:40 2015
New Revision: 250832

URL: http://llvm.org/viewvc/llvm-project?rev=250832&view=rev
Log:
Revert "Make dwarf parsing multi-threaded"

Revert it bacuse it introduces several race condition detected by
the build bots.

This reverts commit 5107a5ebdb7c4571a30a7098b40bf8098b678447.

Modified:
lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.h
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp?rev=250832&r1=250831&r2=250832&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp Tue Oct 20 
10:43:40 2015
@@ -83,14 +83,3 @@ NameToDIE::ForEach (std::function http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.h?rev=250832&r1=250831&r2=250832&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.h (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.h Tue Oct 20 10:43:40 
2015
@@ -38,9 +38,6 @@ public:
 Insert (const lldb_private::ConstString& name, const DIERef& die_ref);
 
 void
-Append (const NameToDIE& other);
-
-void
 Finalize();
 
 size_t

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=250832&r1=250831&r2=250832&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Tue Oct 20 
10:43:40 2015
@@ -50,8 +50,6 @@
 
 #include "lldb/Target/Language.h"
 
-#include "lldb/Utility/TaskPool.h"
-
 #include "DWARFASTParser.h"
 #include "DWARFCompileUnit.h"
 #include "DWARFDebugAbbrev.h"
@@ -2037,72 +2035,40 @@ SymbolFileDWARF::Index ()
 "SymbolFileDWARF::Index (%s)",
 
GetObjectFile()->GetFileSpec().GetFilename().AsCString(""));
 
-
-
 DWARFDebugInfo* debug_info = DebugInfo();
 if (debug_info)
 {
+uint32_t cu_idx = 0;
 const uint32_t num_compile_units = GetNumCompileUnits();
-std::vector function_basename_index(num_compile_units);
-std::vector function_fullname_index(num_compile_units);
-std::vector function_method_index(num_compile_units);
-std::vector function_selector_index(num_compile_units);
-std::vector objc_class_selectors_index(num_compile_units);
-std::vector global_index(num_compile_units);
-std::vector type_index(num_compile_units);
-std::vector namespace_index(num_compile_units);
-
-auto parser_fn = [this,
-  debug_info,
-  &function_basename_index,
-  &function_fullname_index,
-  &function_method_index,
-  &function_selector_index,
-  &objc_class_selectors_index,
-  &global_index,
-  &type_index,
-  &namespace_index](uint32_t cu_idx)
+for (cu_idx = 0; cu_idx < num_compile_units; ++cu_idx)
 {
 DWARFCompileUnit* dwarf_cu = 
debug_info->GetCompileUnitAtIndex(cu_idx);
-bool clear_dies = dwarf_cu->ExtractDIEsIfNeeded(false) > 1;
 
-dwarf_cu->Index(function_basename_index[cu_idx],
-function_fullname_index[cu_idx],
-function_method_index[cu_idx],
-function_selector_index[cu_idx],
-objc_class_selectors_index[cu_idx],
-global_index[cu_idx],
-type_index[cu_idx],
-namespace_index[cu_idx]);
+bool clear_dies = dwarf_cu->ExtractDIEsIfNeeded (false) > 1;
 
+dwarf_cu->Index (m_function_basename_index,
+ m_function_fullname_index,
+ m_function_method_index,
+ m_function_selector_index,
+ m_objc_class_selectors_index,
+ m_global_index, 
+ m_type_index,
+ m_namespace_index);
+
 // Keep memory down by clearing DIEs if this generate function
 // caused them to be parsed
 if (clear_dies)
-dwarf_cu->ClearDIEs(

Re: [Lldb-commits] [PATCH] D13836: Fix write-after-close of file descriptor in ScriptInterpreterPython

2015-10-20 Thread Zachary Turner via lldb-commits
zturner added a comment.

Greg, Enrico, anyone have a chance to take a look at this?  I think it's 
probably just a rubber stamp but rather err on the side of caution.


http://reviews.llvm.org/D13836



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r250832 - Revert "Make dwarf parsing multi-threaded"

2015-10-20 Thread Zachary Turner via lldb-commits
This is kind of why I pushed back against this in the first place :-/  It's
hard to get right.

I still wish we could find a way to use standard library facilities for
this, either by splitting the compile units into hardware_concurrency
chunks, or kicking off no more than hardware_concurrency compile units at a
time, and having them all share a mutex around a queue of compilation
units, so that when each one's work is finished, it can queue the next item
(if one still exists).

On Tue, Oct 20, 2015 at 8:45 AM Tamas Berghammer via lldb-commits <
lldb-commits@lists.llvm.org> wrote:

> Author: tberghammer
> Date: Tue Oct 20 10:43:40 2015
> New Revision: 250832
>
> URL: http://llvm.org/viewvc/llvm-project?rev=250832&view=rev
> Log:
> Revert "Make dwarf parsing multi-threaded"
>
> Revert it bacuse it introduces several race condition detected by
> the build bots.
>
> This reverts commit 5107a5ebdb7c4571a30a7098b40bf8098b678447.
>
> Modified:
> lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp
> lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.h
> lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
>
> Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp?rev=250832&r1=250831&r2=250832&view=diff
>
> ==
> --- lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp (original)
> +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp Tue Oct 20
> 10:43:40 2015
> @@ -83,14 +83,3 @@ NameToDIE::ForEach (std::function   break;
>  }
>  }
> -
> -void
> -NameToDIE::Append (const NameToDIE& other)
> -{
> -const uint32_t size = other.m_map.GetSize();
> -for (uint32_t i = 0; i < size; ++i)
> -{
> -m_map.Append(other.m_map.GetCStringAtIndexUnchecked (i),
> - other.m_map.GetValueAtIndexUnchecked (i));
> -}
> -}
>
> Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.h
> URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.h?rev=250832&r1=250831&r2=250832&view=diff
>
> ==
> --- lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.h (original)
> +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.h Tue Oct 20
> 10:43:40 2015
> @@ -38,9 +38,6 @@ public:
>  Insert (const lldb_private::ConstString& name, const DIERef& die_ref);
>
>  void
> -Append (const NameToDIE& other);
> -
> -void
>  Finalize();
>
>  size_t
>
> Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=250832&r1=250831&r2=250832&view=diff
>
> ==
> --- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
> (original)
> +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Tue Oct
> 20 10:43:40 2015
> @@ -50,8 +50,6 @@
>
>  #include "lldb/Target/Language.h"
>
> -#include "lldb/Utility/TaskPool.h"
> -
>  #include "DWARFASTParser.h"
>  #include "DWARFCompileUnit.h"
>  #include "DWARFDebugAbbrev.h"
> @@ -2037,72 +2035,40 @@ SymbolFileDWARF::Index ()
>  "SymbolFileDWARF::Index (%s)",
>
>  GetObjectFile()->GetFileSpec().GetFilename().AsCString(""));
>
> -
> -
>  DWARFDebugInfo* debug_info = DebugInfo();
>  if (debug_info)
>  {
> +uint32_t cu_idx = 0;
>  const uint32_t num_compile_units = GetNumCompileUnits();
> -std::vector function_basename_index(num_compile_units);
> -std::vector function_fullname_index(num_compile_units);
> -std::vector function_method_index(num_compile_units);
> -std::vector function_selector_index(num_compile_units);
> -std::vector
> objc_class_selectors_index(num_compile_units);
> -std::vector global_index(num_compile_units);
> -std::vector type_index(num_compile_units);
> -std::vector namespace_index(num_compile_units);
> -
> -auto parser_fn = [this,
> -  debug_info,
> -  &function_basename_index,
> -  &function_fullname_index,
> -  &function_method_index,
> -  &function_selector_index,
> -  &objc_class_selectors_index,
> -  &global_index,
> -  &type_index,
> -  &namespace_index](uint32_t cu_idx)
> +for (cu_idx = 0; cu_idx < num_compile_units; ++cu_idx)
>  {
>  DWARFCompileUnit* dwarf_cu =
> debug_info->GetCompileUnitAtIndex(cu_idx);
> -bool clear_dies = dwarf_cu->ExtractDIEsIfNeeded(false) > 1;
>
> -

Re: [Lldb-commits] [PATCH] D13799: [lldb-mi] display summary for simple types + refactor (use lldb formatting for all cases)

2015-10-20 Thread Eugene Leviant via lldb-commits
evgeny777 updated this revision to Diff 37888.
evgeny777 added a comment.

Update according to suggestions from granata.enrico


http://reviews.llvm.org/D13799

Files:
  test/tools/lldb-mi/data/TestMiData.py
  test/tools/lldb-mi/symbol/TestMiSymbol.py
  tools/lldb-mi/MICmnLLDBDebugger.cpp
  tools/lldb-mi/MICmnLLDBDebugger.h
  tools/lldb-mi/MICmnLLDBUtilSBValue.cpp
  tools/lldb-mi/MICmnLLDBUtilSBValue.h

Index: tools/lldb-mi/MICmnLLDBUtilSBValue.h
===
--- tools/lldb-mi/MICmnLLDBUtilSBValue.h
+++ tools/lldb-mi/MICmnLLDBUtilSBValue.h
@@ -51,11 +51,8 @@
   private:
 template  CMIUtilString ReadCStringFromHostMemory(lldb::SBValue &vrValue, const MIuint vnMaxLen = UINT32_MAX) const;
 bool GetSimpleValue(const bool vbHandleArrayType, CMIUtilString &vrValue) const;
-CMIUtilString GetSimpleValueChar() const;
-CMIUtilString GetSimpleValueCStringPointer() const;
-CMIUtilString GetSimpleValueCStringArray() const;
 bool GetCompositeValue(const bool vbPrintFieldNames, CMICmnMIValueTuple &vwrMiValueTuple, const MIuint vnDepth = 1) const;
-CMIUtilString GetValueSummary() const;
+CMIUtilString GetValueSummary(bool valueOnly, const CMIUtilString& failVal = CMIUtilString()) const;
 
 // Statics:
   private:
Index: tools/lldb-mi/MICmnLLDBUtilSBValue.cpp
===
--- tools/lldb-mi/MICmnLLDBUtilSBValue.cpp
+++ tools/lldb-mi/MICmnLLDBUtilSBValue.cpp
@@ -123,31 +123,13 @@
 const MIuint nChildren = m_rValue.GetNumChildren();
 if (nChildren == 0)
 {
-if (m_bHandleCharType && IsCharType())
-{
-vwrValue = GetSimpleValueChar();
-return MIstatus::success;
-}
-else
-{
-const char *pValue = m_rValue.GetValue();
-vwrValue = pValue != nullptr ? pValue : m_pUnkwn;
-return MIstatus::success;
-}
+vwrValue = GetValueSummary(!m_bHandleCharType && IsCharType(), m_pUnkwn);
+return MIstatus::success;
 }
 else if (IsPointerType())
 {
-if (m_bHandleCharType && IsPointeeCharType())
-{
-vwrValue = GetSimpleValueCStringPointer();
-return MIstatus::success;
-}
-else
-{
-const char *pValue = m_rValue.GetValue();
-vwrValue = pValue != nullptr ? pValue : m_pUnkwn;
-return MIstatus::success;
-}
+vwrValue = GetValueSummary(!m_bHandleCharType && IsPointeeCharType(), m_pUnkwn);
+return MIstatus::success;
 }
 else if (IsArrayType())
 {
@@ -157,7 +139,7 @@
 bPrintCharArrayAsString) && bPrintCharArrayAsString;
 if (bPrintCharArrayAsString && m_bHandleCharType && IsFirstChildCharType())
 {
-vwrValue = GetSimpleValueCStringArray();
+vwrValue = GetValueSummary(false);
 return MIstatus::success;
 }
 else if (vbHandleArrayType)
@@ -170,152 +152,15 @@
 {
 // Treat composite value which has registered summary
 // (for example with AddCXXSummary) as simple value
-vwrValue = GetValueSummary();
+vwrValue = GetValueSummary(false);
 if (!vwrValue.empty())
 return MIstatus::success;
 }
 
 // Composite variable type i.e. struct
 return MIstatus::failure;
 }
 
-//++ 
-// Details: Retrieve from the LLDB SB Value object the char value of the variable.
-// Type:Method.
-// Args:None.
-// Return:  CMIUtilString   - The char value of the variable.
-// Throws:  None.
-//--
-CMIUtilString
-CMICmnLLDBUtilSBValue::GetSimpleValueChar() const
-{
-const CMIUtilString& summary = GetValueSummary();
-if (!summary.empty())
-return summary;
-
-const uint64_t value = m_rValue.GetValueAsUnsigned();
-if (value == 0)
-{
-const uint64_t nFailValue = 1;
-if (nFailValue == m_rValue.GetValueAsUnsigned(nFailValue))
-return m_pUnkwn;
-}
-
-const lldb::BasicType eType = m_rValue.GetType().GetBasicType();
-switch (eType)
-{
-default:
-assert(0 && "value must be a char type");
-case lldb::eBasicTypeChar:
-case lldb::eBasicTypeSignedChar:
-case lldb::eBasicTypeUnsignedChar:
-{
-const CMIUtilString prefix(CMIUtilString::ConvertToPrintableASCII((char)value));
-return CMIUtilString::Format("%" PRIu8 " '%s'", (uint8_t)value, prefix.c_str());
-}
-case lldb::eBasicTypeChar16:
-{
-const CMIUtilString prefix(CMIUtilString::ConvertToPrintableASCII((char16_t)value));
-return CMIUtilString::Format("U+%04" PRIx16 " u'%s'", (uint16_t)value, prefix.c_str());
-}
-case lldb::eBasicTypeCh

[Lldb-commits] [lldb] r250833 - Fix MSVC build after 250820

2015-10-20 Thread Tamas Berghammer via lldb-commits
Author: tberghammer
Date: Tue Oct 20 11:16:35 2015
New Revision: 250833

URL: http://llvm.org/viewvc/llvm-project?rev=250833&view=rev
Log:
Fix MSVC build after 250820

Work around a bug in MSVC 12 where _HAS_EXCEPTIONS=0 don't eliminate
all usage of __uncaught_exception with including eh.h what declares
that function.

Modified:
lldb/trunk/include/lldb/Utility/TaskPool.h

Modified: lldb/trunk/include/lldb/Utility/TaskPool.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/TaskPool.h?rev=250833&r1=250832&r2=250833&view=diff
==
--- lldb/trunk/include/lldb/Utility/TaskPool.h (original)
+++ lldb/trunk/include/lldb/Utility/TaskPool.h Tue Oct 20 11:16:35 2015
@@ -10,6 +10,14 @@
 #ifndef utility_TaskPool_h_
 #define utility_TaskPool_h_
 
+#if defined(__cplusplus) && defined(_MSC_VER) && (_HAS_EXCEPTIONS == 0)
+// Compiling MSVC libraries with _HAS_EXCEPTIONS=0, eliminates most but not all
+// calls to __uncaught_exception.  Unfortunately, it does seem to eliminate
+// the delcaration of __uncaught_excpeiton.  Including  ensures that it 
is
+// declared.  This may not be necessary after MSVC 12.
+#include 
+#endif
+
 #include 
 #include 
 #include 


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r250832 - Revert "Make dwarf parsing multi-threaded"

2015-10-20 Thread Tamas Berghammer via lldb-commits
The race condition made me to revert this change is inside the dwarf
parsing code (and in some other part of LLDB), not in the thread pool
implementation. I run the unit-tests I wrote under TSAN and they all run
cleanly so I don't really expect any race condition coming from that part
of the code. If you check the implementation it is very simple so I think
it is fairly easy to reason about it (1 mutex guarding all member variable
of ThreadPoolImpl).

Writing code to manage the number of threads we are using for parsing the
compile units is possible in this concrete scenario but I don't think it is
a good idea if we consider that we want to make LLDB multi threaded in
several other places (Greg mentioned lookup inside ModuleList, I want to
make DebugAbbrev and Symtab parsing also multi threaded, etc.). Managing
the number of threads we want to use at each place is more error prone in
my opinion (we have to get it right all the time, not only in 1 utility
class).

If you really want to use some library for it then we should look into
libdispatch
or find something similar, but I don't think we want to add a new
dependency to LLDB.

Tamas

On Tue, Oct 20, 2015 at 5:00 PM Zachary Turner  wrote:

> This is kind of why I pushed back against this in the first place :-/
>  It's hard to get right.
>
> I still wish we could find a way to use standard library facilities for
> this, either by splitting the compile units into hardware_concurrency
> chunks, or kicking off no more than hardware_concurrency compile units at a
> time, and having them all share a mutex around a queue of compilation
> units, so that when each one's work is finished, it can queue the next item
> (if one still exists).
>
> On Tue, Oct 20, 2015 at 8:45 AM Tamas Berghammer via lldb-commits <
> lldb-commits@lists.llvm.org> wrote:
>
>> Author: tberghammer
>> Date: Tue Oct 20 10:43:40 2015
>> New Revision: 250832
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=250832&view=rev
>> Log:
>> Revert "Make dwarf parsing multi-threaded"
>>
>> Revert it bacuse it introduces several race condition detected by
>> the build bots.
>>
>> This reverts commit 5107a5ebdb7c4571a30a7098b40bf8098b678447.
>>
>> Modified:
>> lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp
>> lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.h
>> lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
>>
>> Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp?rev=250832&r1=250831&r2=250832&view=diff
>>
>> ==
>> --- lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp (original)
>> +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp Tue Oct 20
>> 10:43:40 2015
>> @@ -83,14 +83,3 @@ NameToDIE::ForEach (std::function >  break;
>>  }
>>  }
>> -
>> -void
>> -NameToDIE::Append (const NameToDIE& other)
>> -{
>> -const uint32_t size = other.m_map.GetSize();
>> -for (uint32_t i = 0; i < size; ++i)
>> -{
>> -m_map.Append(other.m_map.GetCStringAtIndexUnchecked (i),
>> - other.m_map.GetValueAtIndexUnchecked (i));
>> -}
>> -}
>>
>> Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.h
>> URL:
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.h?rev=250832&r1=250831&r2=250832&view=diff
>>
>> ==
>> --- lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.h (original)
>> +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.h Tue Oct 20
>> 10:43:40 2015
>> @@ -38,9 +38,6 @@ public:
>>  Insert (const lldb_private::ConstString& name, const DIERef&
>> die_ref);
>>
>>  void
>> -Append (const NameToDIE& other);
>> -
>> -void
>>  Finalize();
>>
>>  size_t
>>
>> Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=250832&r1=250831&r2=250832&view=diff
>>
>> ==
>> --- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
>> (original)
>> +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Tue
>> Oct 20 10:43:40 2015
>> @@ -50,8 +50,6 @@
>>
>>  #include "lldb/Target/Language.h"
>>
>> -#include "lldb/Utility/TaskPool.h"
>> -
>>  #include "DWARFASTParser.h"
>>  #include "DWARFCompileUnit.h"
>>  #include "DWARFDebugAbbrev.h"
>> @@ -2037,72 +2035,40 @@ SymbolFileDWARF::Index ()
>>  "SymbolFileDWARF::Index (%s)",
>>
>>  GetObjectFile()->GetFileSpec().GetFilename().AsCString(""));
>>
>> -
>> -
>>  DWARFDebugInfo* debug_info = DebugInfo();
>>  if (debug_info)
>>  {
>> +uint32_t cu_idx = 0;
>>

[Lldb-commits] [PATCH] D13902: [DataFormatters] Make libc++ list loop detection linear

2015-10-20 Thread Pavel Labath via lldb-commits
labath created this revision.
labath added a reviewer: granata.enrico.
labath added subscribers: sivachandra, lldb-commits.

Loop detection code is being called before every element access. Although it 
tries to cache some
of the data by remembering the loop-free initial segment, every time it needs 
to increase this
segment, it will start from scratch. For the typical usage pattern, where one 
accesses the
elements in order, the loop detection will need to be run after every access, 
resulting in
quadratic behavior. This behavior is noticable even for the default 255 element 
limit.

In this commit, I rewrite the algorithm to be truly incremental -- it maintains 
the state of its
loop-detection runners between calls, and reuses them when it needs to check 
another segment.
This way, each part of the list is scanned only once, resulting in linear 
behavior.

Also note that I have changed the operator== of ListEntry to do the comparison 
based on the
value() function (instead of relying on ValueObjectSP equality). In my 
experiments, I kept
getting different ValueObjectSPs when going through the same element twice.

http://reviews.llvm.org/D13902

Files:
  source/Plugins/Language/CPlusPlus/LibCxxList.cpp
  
test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/Makefile
  
test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py
  
test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/main.cpp

Index: test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/main.cpp
===
--- /dev/null
+++ test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/main.cpp
@@ -0,0 +1,28 @@
+// Evil hack: To simulate memory corruption, we want to fiddle with some internals of std::list.
+// Make those accessible to us.
+#define private public
+#define protected public
+
+#ifdef _LIBCPP_INLINE_VISIBILITY
+#undef _LIBCPP_INLINE_VISIBILITY
+#endif
+#define _LIBCPP_INLINE_VISIBILITY
+#include 
+
+#include 
+
+typedef std::list int_list;
+
+int main()
+{
+int_list *numbers_list = new int_list{1,2,3,4,5,6,7,8,9,10};
+
+auto *third_elem = numbers_list->__end_.__next_->__next_->__next_; // Set break point at this line.
+assert(third_elem->__value_ == 3);
+auto *fifth_elem = third_elem->__next_->__next_;
+assert(fifth_elem->__value_ == 5);
+fifth_elem->__next_ = third_elem;
+
+// Any attempt to free the list will probably crash the program. Let's just leak it.
+return 0; // Set second break point at this line.
+}
Index: test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py
===
--- /dev/null
+++ test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py
@@ -0,0 +1,56 @@
+"""
+Test that the debugger handles loops in std::list (which can appear as a result of e.g. memory
+corruption).
+"""
+
+import os, time, re
+import unittest2
+import lldb
+from lldbtest import *
+import lldbutil
+
+class LibcxxListDataFormatterTestCase(TestBase):
+
+mydir = TestBase.compute_mydir(__file__)
+
+@skipIfGcc
+@skipIfWindows # libc++ not ported to Windows yet
+def test_with_run_command(self):
+self.build()
+exe = os.path.join(os.getcwd(), "a.out")
+target = self.dbg.CreateTarget(exe)
+self.assertTrue(target and target.IsValid(), "Target is valid")
+
+file_spec = lldb.SBFileSpec ("main.cpp", False)
+breakpoint1 = target.BreakpointCreateBySourceRegex('// Set break point at this line.', file_spec)
+self.assertTrue(breakpoint1 and breakpoint1.IsValid())
+breakpoint2 = target.BreakpointCreateBySourceRegex('// Set second break point at this line.', file_spec)
+self.assertTrue(breakpoint2 and breakpoint2.IsValid())
+
+# Run the program, it should stop at breakpoint 1.
+process = target.LaunchSimple(None, None, self.get_process_working_directory())
+lldbutil.skip_if_library_missing(self, target, lldbutil.PrintableRegex("libc\+\+"))
+self.assertTrue(process and process.IsValid(), PROCESS_IS_VALID)
+self.assertEquals(len(lldbutil.get_threads_stopped_at_breakpoint(process, breakpoint1)), 1)
+
+# verify our list is displayed correctly
+self.expect("frame variable *numbers_list", substrs=['[0] = 1', '[1] = 2', '[2] = 3', '[3] = 4', '[5] = 6'])
+
+# Continue to breakpoint 2.
+process.Continue()
+self.assertTrue(process and process.IsValid(), PROCESS_IS_VALID)
+self.assertEquals(len(lldbutil.get_threads_stopped_at_breakpoint(process, breakpoint2)), 1)
+
+# The list is now inconsistent. However, we should be able to get the first three
+# elements at least (and most importantly, not crash).
+self.expect("frame

[Lldb-commits] [PATCH] D13903: [RenderScript] New commands to save/load RS allocations to file.

2015-10-20 Thread Ewan Crawford via lldb-commits
EwanCrawford created this revision.
EwanCrawford added reviewers: clayborg, jingham.
EwanCrawford added subscribers: lldb-commits, domipheus.
EwanCrawford set the repository for this revision to rL LLVM.

Patch adds command 'language renderscript allocation save' to store the 
contents of an allocation in a binary file. 
And 'language renderscript allocation load' to restore an allocation with the 
saved data from a binary file.

Binary file format contains a header `FileHeader` with meta information 
preceding the raw data.



Repository:
  rL LLVM

http://reviews.llvm.org/D13903

Files:
  
source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
  
source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h

Index: source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h
===
--- source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h
+++ source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h
@@ -218,6 +218,10 @@
 
 virtual void ModulesDidLoad(const ModuleList &module_list );
 
+bool LoadAllocation(Stream &strm, const uint32_t alloc_id, const char* filename, StackFrame* frame_ptr);
+
+bool SaveAllocation(Stream &strm, const uint32_t alloc_id, const char* filename, StackFrame* frame_ptr);
+
 void Update();
 
 void Initiate();
@@ -264,7 +268,7 @@
 const HookDefn  *defn;
 lldb::BreakpointSP bp_sp;
 };
-
+
 typedef std::shared_ptr RuntimeHookSP;
 
 lldb::ModuleSP m_libRS;
@@ -301,6 +305,8 @@
 void CaptureSetGlobalVar1(RuntimeHook* hook_info, ExecutionContext& context);
 
 AllocationDetails* FindAllocByID(Stream &strm, const uint32_t alloc_id);
+std::shared_ptr GetAllocationData(AllocationDetails* allocation, StackFrame* frame_ptr);
+unsigned int GetElementSize(const AllocationDetails* allocation);
 
 //
 // Helper functions for jitting the runtime
Index: source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
===
--- source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
+++ source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
@@ -179,6 +179,18 @@
 }
 };
 
+// Header for reading and writing allocation contents
+// to a binary file.
+struct FileHeader
+{
+uint8_t ident[4];  // ASCII 'RSAD' identifying the file
+uint16_t hdr_size; // Header size in bytes, for backwards compatability
+uint16_t type; // DataType enum
+uint32_t kind; // DataKind enum
+uint32_t dims[3];  // Dimensions
+uint32_t element_size; // Size of a single element, including padding
+};
+
 // Monotonically increasing from 1
 static unsigned int ID;
 
@@ -1365,10 +1377,287 @@
 if (!JITElementPacked(allocation, frame_ptr))
 return false;
 
+// Use GetOffsetPointer() to infer size of the allocation
+const unsigned int element_size = GetElementSize(allocation);
+if (!JITAllocationSize(allocation, frame_ptr, element_size))
+return false;
+
 return true;
 }
 
+// Returns the size of a single allocation element including padding.
+// Assumes the relevant allocation information has already been jitted.
+unsigned int
+RenderScriptRuntime::GetElementSize(const AllocationDetails* allocation)
+{
+const AllocationDetails::DataType type = *allocation->type.get();
+assert(type >= AllocationDetails::RS_TYPE_NONE && type <= AllocationDetails::RS_TYPE_BOOLEAN
+   && "Invalid allocation type");
+
+const unsigned int vec_size = *allocation->type_vec_size.get();
+const unsigned int data_size = vec_size * AllocationDetails::RSTypeToFormat[type][eElementSize];
+const unsigned int padding = vec_size == 3 ? AllocationDetails::RSTypeToFormat[type][eElementSize] : 0;
+
+return data_size + padding;
+}
+
+// Given an allocation, this function copies the allocation contents from device into a buffer on the heap.
+// Returning a shared pointer to the buffer containing the data.
+std::shared_ptr
+RenderScriptRuntime::GetAllocationData(AllocationDetails* allocation, StackFrame* frame_ptr)
+{
+Log* log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE));
+
+// JIT all the allocation details
+if (!allocation->data_ptr.isValid() || !allocation->type.isValid() || !allocation->type_vec_size.isValid()
+|| !allocation->size.isValid())
+{
+if (log)
+log->Printf("RenderScriptRuntime::GetAllocationData - Allocation details not calculated yet, jitting info");
+
+if (!RefreshAllocation(allocation, frame_ptr))
+{
+if (log)
+log->Printf("RenderS

Re: [Lldb-commits] [PATCH] D13881: Add domain socket support to gdb-remote protocol and lldb-server.

2015-10-20 Thread Greg Clayton via lldb-commits
clayborg accepted this revision.
clayborg added a comment.
This revision is now accepted and ready to land.

Minor nit over ordering of #include, but other than that it looks good.



Comment at: 
source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp:36
@@ -31,1 +35,3 @@
 
+#include "llvm/Support/FileSystem.h"
+

llvm includes should go before lldb includes.


http://reviews.llvm.org/D13881



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D12890: Add plugin.jit-loader.gdb.enable-jit-breakpoint property to make JIT loader breakpoint optional.

2015-10-20 Thread Greg Clayton via lldb-commits
clayborg added a comment.

So you are saying to have a setting that allows this plug-in to be enabled and 
have it set to false by default? That sounds good to me. It probably should be 
false on all platforms and anyone wanting JIT support should enable it?


http://reviews.llvm.org/D12890



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D13859: [LLDB][LLGS Test] Check length of register, only when its available

2015-10-20 Thread Greg Clayton via lldb-commits
clayborg requested changes to this revision.
clayborg added a comment.
This revision now requires changes to proceed.

Is there a list of error codes and what they mean for the GDB remote protocol? 
debugserver returns random errors and doesn't abide by any specific error 
codes. Quote from some GDB remote protocol docs I found:

  The error response returned for some packets includes a two character error 
number. That number is not well defined.

So we can't rely on specific responses unless you verify that the error is 
coming from a specific GDB server. In order to do this, we would need to add a 
qGDBServerInfo packet that could return a name, version info, etc:

  $qGDBServerInfo#00
  $name:debugserver;version:123.2.3;

The real fix is to fix the GDB server to not have it return this register if it 
is not available.


Repository:
  rL LLVM

http://reviews.llvm.org/D13859



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D13662: Make dwarf parsing multi-threaded

2015-10-20 Thread Greg Clayton via lldb-commits
clayborg added inline comments.


Comment at: 
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp:2087-2088
@@ +2086,4 @@
+results.emplace_back(TaskPool::AddTask(parser_fn, cu_idx));
+for (auto& f : results)
+f.wait();
+

So we are still going to serially wait for the each item in the task list to 
complete? Don't we want to use TaskRunner::WaitForNextCompletedTask() here?


Repository:
  rL LLVM

http://reviews.llvm.org/D13662



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D13836: Fix write-after-close of file descriptor in ScriptInterpreterPython

2015-10-20 Thread Greg Clayton via lldb-commits
clayborg accepted this revision.
clayborg added a comment.
This revision is now accepted and ready to land.

Looks good to me. Wait for Enrico to OK as well.


http://reviews.llvm.org/D13836



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D13799: [lldb-mi] display summary for simple types + refactor (use lldb formatting for all cases)

2015-10-20 Thread Hafiz Abid Qadeer via lldb-commits
abidh accepted this revision.
abidh added a comment.
This revision is now accepted and ready to land.

Apart from some inline comments, looks ok to me.



Comment at: tools/lldb-mi/MICmnLLDBDebugger.cpp:839
@@ +838,3 @@
+// Return:  MIstatus::success - Functionality succeeded.
+//  MIstatus::failure - Functionality failed.
+// Throws:  None.

Please change it to 'true' and 'false'.


http://reviews.llvm.org/D13799



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D13903: [RenderScript] New commands to save/load RS allocations to file.

2015-10-20 Thread Greg Clayton via lldb-commits
clayborg accepted this revision.
clayborg added a comment.
This revision is now accepted and ready to land.

Looks good. Going forward there is no real need to review any new commands that 
only exist in the renderscript source files or plug-ins. If you change any code 
outside of the the renderscript we should review, else feel free to commit as 
you need to.


Repository:
  rL LLVM

http://reviews.llvm.org/D13903



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D13902: [DataFormatters] Make libc++ list loop detection linear

2015-10-20 Thread Enrico Granata via lldb-commits
granata.enrico accepted this revision.
granata.enrico added a comment.
This revision is now accepted and ready to land.

That looks reasonable. Of course, I assume you ran the test suite on OS X, 
including your new evil test!


http://reviews.llvm.org/D13902



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D13662: Make dwarf parsing multi-threaded

2015-10-20 Thread Tamas Berghammer via lldb-commits
tberghammer added a comment.

I reverted this change, as it caused some race condition, but see my comment 
inline.



Comment at: 
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp:2087-2088
@@ +2086,4 @@
+results.emplace_back(TaskPool::AddTask(parser_fn, cu_idx));
+for (auto& f : results)
+f.wait();
+

clayborg wrote:
> So we are still going to serially wait for the each item in the task list to 
> complete? Don't we want to use TaskRunner::WaitForNextCompletedTask() here?
I don't see any benefit for using TaskRunner::WaitForNextCompletedTask() here 
because we can't really do anything when only a few task is completed and using 
TaskRunner ads an extra layer of indirection (to implement 
WaitForNextCompletedTask) what have a very minor performance hit.

One possible improvement we can do is to do the merging of the indexes on the 
main thread while we are waiting for the parsing tasks to complete, but I am 
not sure if it will have any performance benefit as it would mean that we do it 
on a single thread instead of 9 threads we are doing it now (with 
TaskPool::RunTasks).


Repository:
  rL LLVM

http://reviews.llvm.org/D13662



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D13836: Fix write-after-close of file descriptor in ScriptInterpreterPython

2015-10-20 Thread Enrico Granata via lldb-commits
granata.enrico accepted this revision.
granata.enrico added a comment.

Looks reasonable


http://reviews.llvm.org/D13836



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D13906: Introduce a mechanism for sharing code across lldb/test and lldb/scripts

2015-10-20 Thread Zachary Turner via lldb-commits
zturner created this revision.
zturner added a reviewer: tfiala.
zturner added a subscriber: lldb-commits.

We have a lot of Python code in test and scripts that in theory could be reused 
amongst the two.  Until now there is no mechanism to support this because 
Python's module / packaging system imposes some limitations on how and where 
your code must be in order to be re-used.

This patch addresses this by creating a new module `lldb_shared` which searches 
up the tree until it finds an `lldb.root` file.  Then, it dynamically imports 
`lldb_shared_base` from that folder.  `lldb_shared_base` is a module that 
exists only as a means to modify `sys.path` to add all of the shared module 
locations ot the path.

In order to make use of this, you need to copy the `lldb_shared.py` file into 
the root of each project that you wish to make use of this shared code.

The end result of this is that if you have a directory structure like this:

lldb
\__ test
\__ scripts
\__ common
  \__ useful_utility.py
\__ third_party
  \__ six
\__ six.py

All you need to do is add `lldb_shared.py` to the root of `lldb/test` and 
`lldb/scripts` and then you can write 

import lldb_shared
import useful_utility
import six

This patch is dependent on D13880

http://reviews.llvm.org/D13906

Files:
  lldb.root
  lldb_shared_base.py
  test/dotest.py
  test/lldb_shared.py

Index: test/lldb_shared.py
===
--- /dev/null
+++ test/lldb_shared.py
@@ -0,0 +1,21 @@
+import os
+import sys
+
+def find_lldb_root():
+lldb_root = os.getcwd()
+while True:
+lldb_root = os.path.dirname(lldb_root)
+if lldb_root is None:
+return None
+
+test_path = os.path.join(lldb_root, "lldb.root")
+if os.path.isfile(test_path):
+return lldb_root
+return None
+
+lldb_root = find_lldb_root()
+if lldb_root is not None:
+import imp
+module = imp.find_module("lldb_shared_base", [lldb_root])
+if module is not None:
+imp.load_module("lldb_shared_base", *module)
\ No newline at end of file
Index: test/dotest.py
===
--- test/dotest.py
+++ test/dotest.py
@@ -22,6 +22,8 @@
 
 from __future__ import print_function
 
+import lldb_shared
+
 import atexit
 import commands
 import importlib
@@ -40,6 +42,8 @@
 import unittest2
 import lldbtest_config
 
+import six
+
 
 def is_exe(fpath):
 """Returns true if fpath is an executable."""
Index: lldb_shared_base.py
===
--- /dev/null
+++ lldb_shared_base.py
@@ -0,0 +1,15 @@
+import inspect
+import os
+import sys
+
+def add_third_party_module_dirs(lldb_root):
+third_party_modules_dir = os.path.join(lldb_root, "third_party", "Python", 
"module")
+if not os.path.isdir(third_party_modules_dir):
+return
+
+module_dirs = os.listdir(third_party_modules_dir)
+for module_dir in module_dirs:
+module_dir = os.path.join(third_party_modules_dir, module_dir)
+sys.path.append(module_dir)
+lldb_root = os.path.dirname(inspect.getfile(inspect.currentframe()))
+add_third_party_module_dirs(lldb_root)


Index: test/lldb_shared.py
===
--- /dev/null
+++ test/lldb_shared.py
@@ -0,0 +1,21 @@
+import os
+import sys
+
+def find_lldb_root():
+lldb_root = os.getcwd()
+while True:
+lldb_root = os.path.dirname(lldb_root)
+if lldb_root is None:
+return None
+
+test_path = os.path.join(lldb_root, "lldb.root")
+if os.path.isfile(test_path):
+return lldb_root
+return None
+
+lldb_root = find_lldb_root()
+if lldb_root is not None:
+import imp
+module = imp.find_module("lldb_shared_base", [lldb_root])
+if module is not None:
+imp.load_module("lldb_shared_base", *module)
\ No newline at end of file
Index: test/dotest.py
===
--- test/dotest.py
+++ test/dotest.py
@@ -22,6 +22,8 @@
 
 from __future__ import print_function
 
+import lldb_shared
+
 import atexit
 import commands
 import importlib
@@ -40,6 +42,8 @@
 import unittest2
 import lldbtest_config
 
+import six
+
 
 def is_exe(fpath):
 """Returns true if fpath is an executable."""
Index: lldb_shared_base.py
===
--- /dev/null
+++ lldb_shared_base.py
@@ -0,0 +1,15 @@
+import inspect
+import os
+import sys
+
+def add_third_party_module_dirs(lldb_root):
+third_party_modules_dir = os.path.join(lldb_root, "third_party", "Python", "module")
+if not os.path.isdir(third_party_modules_dir):
+return
+
+module_dirs = os.listdir(third_party_modules_dir)
+for module_dir in module_dirs:
+module_dir = os.path.join(third_party_modules_dir, module_dir

[Lldb-commits] [lldb] r250838 - Fix potential file i/o problem with python handles.

2015-10-20 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Tue Oct 20 12:38:49 2015
New Revision: 250838

URL: http://llvm.org/viewvc/llvm-project?rev=250838&view=rev
Log:
Fix potential file i/o problem with python handles.

Modified:
lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h

lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h

Modified: 
lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp?rev=250838&r1=250837&r2=250838&view=diff
==
--- lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp 
(original)
+++ lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp 
Tue Oct 20 12:38:49 2015
@@ -605,6 +605,11 @@ PythonDictionary::CreateStructuredDictio
 return result;
 }
 
+PythonFile::PythonFile()
+: PythonObject()
+{
+}
+
 PythonFile::PythonFile(File &file, const char *mode)
 {
 Reset(file, mode);

Modified: lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h?rev=250838&r1=250837&r2=250838&view=diff
==
--- lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h 
(original)
+++ lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h Tue 
Oct 20 12:38:49 2015
@@ -334,6 +334,7 @@ public:
 class PythonFile : public PythonObject
 {
   public:
+PythonFile();
 PythonFile(File &file, const char *mode);
 PythonFile(const char *path, const char *mode);
 PythonFile(PyRefType type, PyObject *o);

Modified: 
lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp?rev=250838&r1=250837&r2=250838&view=diff
==
--- 
lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp 
(original)
+++ 
lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp 
Tue Oct 20 12:38:49 2015
@@ -612,7 +612,7 @@ ScriptInterpreterPython::EnterSession (u
 // Flush the file before giving it to python to avoid 
interleaved output.
 in_file.Flush();
 
-m_saved_stdin = 
sys_module_dict.GetItemForKey(PythonString("stdin"));
+m_saved_stdin = 
sys_module_dict.GetItemForKey(PythonString("stdin")).AsType();
 // This call can deadlock your process if the file is locked
 PythonFile new_file(in_file, "r");
 sys_module_dict.SetItemForKey (PythonString("stdin"), 
new_file);
@@ -626,7 +626,7 @@ ScriptInterpreterPython::EnterSession (u
 // Flush the file before giving it to python to avoid interleaved 
output.
 out_file.Flush();
 
-m_saved_stdout = 
sys_module_dict.GetItemForKey(PythonString("stdout"));
+m_saved_stdout = 
sys_module_dict.GetItemForKey(PythonString("stdout")).AsType();
 
 PythonFile new_file(out_file, "w");
 sys_module_dict.SetItemForKey (PythonString("stdout"), new_file);
@@ -641,7 +641,7 @@ ScriptInterpreterPython::EnterSession (u
 // Flush the file before giving it to python to avoid interleaved 
output.
 err_file.Flush();
 
-m_saved_stderr = 
sys_module_dict.GetItemForKey(PythonString("stderr"));
+m_saved_stderr = 
sys_module_dict.GetItemForKey(PythonString("stderr")).AsType();
 
 PythonFile new_file(err_file, "w");
 sys_module_dict.SetItemForKey (PythonString("stderr"), new_file);
@@ -812,48 +812,55 @@ ScriptInterpreterPython::ExecuteOneLine
 FILE *in_file = input_file_sp->GetFile().GetStream();
 FILE *out_file = output_file_sp->GetFile().GetStream();
 FILE *err_file = error_file_sp->GetFile().GetStream();
-Locker locker(this,
-  ScriptInterpreterPython::Locker::AcquireLock |
-  ScriptInterpreterPython::Locker::InitSession |
-  (options.GetSetLLDBGlobals() ? 
ScriptInterpreterPython::Locker::InitGlobals : 0) |
-  ((result && result->GetInteractive()) ? 0: 
Locker::NoSTDIN),
-  ScriptInterpreterPython::Locker::FreeAcquiredLock |
-  ScriptInterpreterPython::Locker::TearDownSession,
-  in_file,
-  out_file,
-  err_file);
-
 bool s

Re: [Lldb-commits] [lldb] r248028 - Make libc++ tests skip themselves if libc++ is not actually loaded in the target

2015-10-20 Thread Pavel Labath via lldb-commits
Hi Enrico,

Could you explain what was the motivation behind this change?

I am asking because, I have just learned that this commit has caused
all libc++ tests to be skipped on linux*, silently decreasing test
coverage on linux. I would like to replace this with some other
mechanism, which is not prone to accidental silent skips, like a
dotest flag to skip libc++ or something, but I'd like to understand
the original motivation first.

pl

* the problem seems to be that on linux, we do not have the list of
modules until we actually start the process, so this code will not
find the library, as it runs before that. If is considered a bug then
we can look into that separately, but I'd still like to avoid these
kinds of skips.


On 18 September 2015 at 21:12, Enrico Granata via lldb-commits
 wrote:
> Author: enrico
> Date: Fri Sep 18 15:12:52 2015
> New Revision: 248028
>
> URL: http://llvm.org/viewvc/llvm-project?rev=248028&view=rev
> Log:
> Make libc++ tests skip themselves if libc++ is not actually loaded in the 
> target
>
>
> Modified:
> 
> lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py
> 
> lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py
> 
> lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py
> 
> lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py
> 
> lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py
> 
> lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py
> 
> lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py
> 
> lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py
> 
> lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py
> 
> lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py
> 
> lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py
> lldb/trunk/test/lldbutil.py
>
> Modified: 
> lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py?rev=248028&r1=248027&r2=248028&view=diff
> ==
> --- 
> lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py
>  (original)
> +++ 
> lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py
>  Fri Sep 18 15:12:52 2015
> @@ -36,6 +36,8 @@ class InitializerListTestCase(TestBase):
>  """Test that that file and class static variables display 
> correctly."""
>  self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
>
> +lldbutil.skip_if_library_missing(self, self.target(), 
> lldbutil.PrintableRegex("libc\+\+"))
> +
>  bkpt = 
> self.target().FindBreakpointByID(lldbutil.run_break_set_by_source_regexp 
> (self, "Set break point at this line."))
>
>  self.runCmd("run", RUN_SUCCEEDED)
>
> Modified: 
> lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py?rev=248028&r1=248027&r2=248028&view=diff
> ==
> --- 
> lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py
>  (original)
> +++ 
> lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py
>  Fri Sep 18 15:12:52 2015
> @@ -37,6 +37,8 @@ class LibcxxIteratorDataFormatterTestCas
>  """Test that libc++ iterators format properly."""
>  self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
>
> +lldbutil.skip_if_library_missing(self, self.target(), 
> lldbutil.PrintableRegex("libc\+\+"))
> +
>  lldbutil.run_break_set_by_file_and_line (self, "main.cpp", 
> self.line, num_expected_locations=-1)
>
>  self.runCmd("run", RUN_SUCCEEDED)
>
> Modified: 
> lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/dat

Re: [Lldb-commits] [PATCH] D13878: Add data formatters for go strings and slices.

2015-10-20 Thread Ryan Brown via lldb-commits
ribrdb added inline comments.


Comment at: source/Plugins/Language/Go/GoFormatterFunctions.cpp:10
@@ +9,3 @@
+
+#include 
+

Eugene.Zelenko wrote:
> Please add include section comments. Same for other sections.
Which sections? I've seen a couple types of section markers in different files, 
but it's not consistent. Are there documented recommendations for these?


Comment at: source/Plugins/Language/Go/GoLanguage.cpp:79
@@ +78,3 @@
+HardcodedFormatters::HardcodedSummaryFinder
+GoLanguage::GetHardcodedSummaries ()
+{

granata.enrico wrote:
> Any reason why you need to use hardcoded formatters here?
> 
> Do strings and slices not have simple type names to match against in Go?
> 
> If at all possible, I would prefer to see you add formatters by name instead 
> of hardcoded matches. Hardcoded matches are really meant for cases where the 
> predicate you're trying to express is something a type name or regular 
> expression on type names can't capture.
Normal string and slice types can be recognized by name.
But it is easy to create other string or slices with an arbitrary name.
The right thing to do is look at the go kind (for these types and eventually 
also map and chan). Hardcoded formatters seems like the only way to do this.
I also considered trying to represent this as a base type or typedef, but those 
both seemed complicated and confusing since they're not things the language 
itself supports.


Repository:
  rL LLVM

http://reviews.llvm.org/D13878



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D13878: Add data formatters for go strings and slices.

2015-10-20 Thread Eugene Zelenko via lldb-commits
Eugene.Zelenko added inline comments.


Comment at: source/Plugins/Language/Go/GoFormatterFunctions.cpp:10
@@ +9,3 @@
+
+#include 
+

ribrdb wrote:
> Eugene.Zelenko wrote:
> > Please add include section comments. Same for other sections.
> Which sections? I've seen a couple types of section markers in different 
> files, but it's not consistent. Are there documented recommendations for 
> these?
See source/Plugins/Language/Go/GoLanguage.h below. At least this style is 
consistent across LLDB headers.


Repository:
  rL LLVM

http://reviews.llvm.org/D13878



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r248028 - Make libc++ tests skip themselves if libc++ is not actually loaded in the target

2015-10-20 Thread Enrico Granata via lldb-commits

> On Oct 20, 2015, at 10:43 AM, Pavel Labath  wrote:
> 
> Hi Enrico,
> 
> Could you explain what was the motivation behind this change?
> 

As per title of the commit, in a process that is using a standard c++ library 
other than libc++, these tests are noise - of course the libc++ tests aren’t 
gonna pass if you don’t have libc++

> I am asking because, I have just learned that this commit has caused
> all libc++ tests to be skipped on linux*, silently decreasing test
> coverage on linux. I would like to replace this with some other
> mechanism, which is not prone to accidental silent skips, like a
> dotest flag to skip libc++ or something, but I'd like to understand
> the original motivation first.
> 
> pl
> 
> * the problem seems to be that on linux, we do not have the list of
> modules until we actually start the process, so this code will not
> find the library, as it runs before that.

The solution might then be to run the process, and then skip_if_library_missing
I think we avoid trying to compile the test inferior entirely if we can’t find 
libc++ however, so you might first want to check if a.out exists at all, and 
only then proceed all the way to the first breakpoint being hit

> If is considered a bug then
> we can look into that separately, but I'd still like to avoid these
> kinds of skips.
> 

What I am trying to avoid here is getting useless noise in build automation 
where test cases proclaim their failure, which however tells us nothing of 
value as the issue is simply “libc++ not available” vs. “data formatters broken”
That is an ability I would strongly like to preserve

> 
> On 18 September 2015 at 21:12, Enrico Granata via lldb-commits
>  wrote:
>> Author: enrico
>> Date: Fri Sep 18 15:12:52 2015
>> New Revision: 248028
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=248028&view=rev
>> Log:
>> Make libc++ tests skip themselves if libc++ is not actually loaded in the 
>> target
>> 
>> 
>> Modified:
>>
>> lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py
>>
>> lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py
>>
>> lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py
>>
>> lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py
>>
>> lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py
>>
>> lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py
>>
>> lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py
>>
>> lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py
>>
>> lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py
>>
>> lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py
>>
>> lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py
>>lldb/trunk/test/lldbutil.py
>> 
>> Modified: 
>> lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py
>> URL: 
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py?rev=248028&r1=248027&r2=248028&view=diff
>> ==
>> --- 
>> lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py
>>  (original)
>> +++ 
>> lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py
>>  Fri Sep 18 15:12:52 2015
>> @@ -36,6 +36,8 @@ class InitializerListTestCase(TestBase):
>> """Test that that file and class static variables display 
>> correctly."""
>> self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
>> 
>> +lldbutil.skip_if_library_missing(self, self.target(), 
>> lldbutil.PrintableRegex("libc\+\+"))
>> +
>> bkpt = 
>> self.target().FindBreakpointByID(lldbutil.run_break_set_by_source_regexp 
>> (self, "Set break point at this line."))
>> 
>> self.runCmd("run", RUN_SUCCEEDED)
>> 
>> Modified: 
>> lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py
>> URL: 
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py?rev=248028&r1=248027&r2=248028&view=diff
>> ==
>> --- 
>> lldb/tru

Re: [Lldb-commits] [PATCH] D13662: Make dwarf parsing multi-threaded

2015-10-20 Thread Greg Clayton via lldb-commits
clayborg added a comment.

See inlined comments.



Comment at: 
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp:2087-2088
@@ +2086,4 @@
+results.emplace_back(TaskPool::AddTask(parser_fn, cu_idx));
+for (auto& f : results)
+f.wait();
+

tberghammer wrote:
> clayborg wrote:
> > So we are still going to serially wait for the each item in the task list 
> > to complete? Don't we want to use TaskRunner::WaitForNextCompletedTask() 
> > here?
> I don't see any benefit for using TaskRunner::WaitForNextCompletedTask() here 
> because we can't really do anything when only a few task is completed and 
> using TaskRunner ads an extra layer of indirection (to implement 
> WaitForNextCompletedTask) what have a very minor performance hit.
> 
> One possible improvement we can do is to do the merging of the indexes on the 
> main thread while we are waiting for the parsing tasks to complete, but I am 
> not sure if it will have any performance benefit as it would mean that we do 
> it on a single thread instead of 9 threads we are doing it now (with 
> TaskPool::RunTasks).
Seems like you could change the future to just return the cu_idx from parser_fn 
so we can append all items to the member variables in the main thread:

```
while (uint32_t cu_idx : task_runner. WaitForNextCompletedTask())
{
 m_function_basename_index.Append(function_basename_index[cu_idx));
 m_function_fullname_index.Append(function_fullname_index[cu_idx));
 ...
}
```

Otherwise you are serializing the merging + finalize to be at the end. One nice 
thing about doing it the way you are doing is that it will be consistent from 
run to run as the data will always appear in the same order as the debug info 
file. But these maps should be the same regardless and the oder in which the 
data comes in shouldn't affect the final content.


Comment at: 
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp:2090-2095
@@ +2089,8 @@
+
+auto merge_fn = [](NameToDIE& target, const std::vector& 
sources)
+{
+for (const auto& src : sources)
+target.Append(src);
+target.Finalize();
+};
+

If you do the Append() calls inside the while loop above, then all we need to 
do it call Finalize() on each member variable below.


Repository:
  rL LLVM

http://reviews.llvm.org/D13662



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D13878: Add data formatters for go strings and slices.

2015-10-20 Thread Ryan Brown via lldb-commits
ribrdb updated this revision to Diff 37898.

Repository:
  rL LLVM

http://reviews.llvm.org/D13878

Files:
  cmake/LLDBDependencies.cmake
  lldb.xcodeproj/project.pbxproj
  source/API/SystemInitializerFull.cpp
  source/Plugins/Language/CMakeLists.txt
  source/Plugins/Language/Go/CMakeLists.txt
  source/Plugins/Language/Go/GoFormatterFunctions.cpp
  source/Plugins/Language/Go/GoFormatterFunctions.h
  source/Plugins/Language/Go/GoLanguage.cpp
  source/Plugins/Language/Go/GoLanguage.h
  source/Plugins/Language/Go/Makefile
  source/Plugins/Makefile
  test/lang/go/formatters/TestGoFormatters.py
  test/lang/go/formatters/main.go

Index: test/lang/go/formatters/main.go
===
--- /dev/null
+++ test/lang/go/formatters/main.go
@@ -0,0 +1,9 @@
+package main
+
+import "fmt"
+
+func main() {
+a := "my string"
+b := make([]int, 2, 7)
+fmt.Println(a, b)  // stop here
+}
\ No newline at end of file
Index: test/lang/go/formatters/TestGoFormatters.py
===
--- /dev/null
+++ test/lang/go/formatters/TestGoFormatters.py
@@ -0,0 +1,66 @@
+"""Test the Go Data Formatter Plugin."""
+
+import os, time
+import unittest2
+import lldb
+import lldbutil
+from lldbtest import *
+
+class TestGoLanguage(TestBase):
+
+mydir = TestBase.compute_mydir(__file__)
+
+@python_api_test
+@skipIfFreeBSD # llvm.org/pr24895 triggers assertion failure
+@skipIfRemote # Not remote test suite ready
+@no_debug_info_test
+@skipUnlessGoInstalled
+def test_go_formatter_plugin(self):
+"""Test go data formatters."""
+self.buildGo()
+self.launchProcess()
+self.check_formatters()
+
+def setUp(self):
+# Call super's setUp().
+TestBase.setUp(self)
+# Find the line numbers to break inside main().
+self.main_source = "main.go"
+self.break_line = line_number(self.main_source, '// stop here')
+
+def launchProcess(self):
+exe = os.path.join(os.getcwd(), "a.out")
+
+target = self.dbg.CreateTarget(exe)
+self.assertTrue(target, VALID_TARGET)
+
+self.bpt = target.BreakpointCreateByLocation(self.main_source, self.break_line)
+self.assertTrue(self.bpt, VALID_BREAKPOINT)
+
+# Now launch the process, and do not stop at entry point.
+process = target.LaunchSimple (None, None, self.get_process_working_directory())
+
+self.assertTrue(process, PROCESS_IS_VALID)
+
+# The stop reason of the thread should be breakpoint.
+thread_list = lldbutil.get_threads_stopped_at_breakpoint (process, self.bpt)
+
+# Make sure we stopped at the first breakpoint.
+self.assertTrue (len(thread_list) != 0, "No thread stopped at our breakpoint.")
+self.assertTrue (len(thread_list) == 1, "More than one thread stopped at our breakpoint.")
+
+frame = thread_list[0].GetFrameAtIndex(0)
+self.assertTrue (frame, "Got a valid frame 0 frame.")
+
+def check_formatters(self):
+a = self.frame().FindVariable('a')
+self.assertEqual('(string) a = "my string"', str(a))
+b = self.frame().FindVariable('b')
+self.assertEqual("([]int) b = (len 2, cap 7) {\n  [0] = 0\n  [1] = 0\n}", str(b))
+
+
+if __name__ == '__main__':
+import atexit
+lldb.SBDebugger.Initialize()
+atexit.register(lambda: lldb.SBDebugger.Terminate())
+unittest2.main()
Index: source/Plugins/Makefile
===
--- source/Plugins/Makefile
+++ source/Plugins/Makefile
@@ -26,6 +26,7 @@
 	LanguageRuntime/Go/ \
 	LanguageRuntime/RenderScript/RenderScriptRuntime \
 	Language/CPlusPlus \
+	Language/Go \
 	Language/ObjC \
 	Language/ObjCPlusPlus \
 	DynamicLoader/POSIX-DYLD \
Index: source/Plugins/Language/Go/Makefile
===
--- /dev/null
+++ source/Plugins/Language/Go/Makefile
@@ -0,0 +1,14 @@
+##===- source/Plugins/Language/Go ---*- 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 := lldbPluginGoLanguage
+BUILD_ARCHIVE = 1
+
+include $(LLDB_LEVEL)/Makefile
Index: source/Plugins/Language/Go/GoLanguage.h
===
--- /dev/null
+++ source/Plugins/Language/Go/GoLanguage.h
@@ -0,0 +1,74 @@
+//===-- GoLanguage.h *- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===-

Re: [Lldb-commits] [PATCH] D13878: Add data formatters for go strings and slices.

2015-10-20 Thread Eugene Zelenko via lldb-commits
Eugene.Zelenko added a comment.

Did you format code with Clang-format? Spaces/no spaces between function names 
and arguments are inconsistent.



Comment at: source/Plugins/Language/Go/GoFormatterFunctions.h:29
@@ +28,3 @@
+
+#include "clang/AST/ASTContext.h"
+

This header belongs to Other libraries and framework includes.


Comment at: source/Plugins/Language/Go/GoLanguage.cpp:25
@@ +24,3 @@
+
+#include 
+#include 

This and next include belong to C++ Includes.


Repository:
  rL LLVM

http://reviews.llvm.org/D13878



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D13878: Add data formatters for go strings and slices.

2015-10-20 Thread Ryan Brown via lldb-commits
ribrdb removed rL LLVM as the repository for this revision.
ribrdb updated this revision to Diff 37900.
ribrdb added a comment.

Oops, I ran clang-format with the wrong arguments. Ran it again.


http://reviews.llvm.org/D13878

Files:
  cmake/LLDBDependencies.cmake
  lldb.xcodeproj/project.pbxproj
  source/API/SystemInitializerFull.cpp
  source/Plugins/Language/CMakeLists.txt
  source/Plugins/Language/Go/CMakeLists.txt
  source/Plugins/Language/Go/GoFormatterFunctions.cpp
  source/Plugins/Language/Go/GoFormatterFunctions.h
  source/Plugins/Language/Go/GoLanguage.cpp
  source/Plugins/Language/Go/GoLanguage.h
  source/Plugins/Language/Go/Makefile
  source/Plugins/Makefile
  test/lang/go/formatters/TestGoFormatters.py
  test/lang/go/formatters/main.go

Index: test/lang/go/formatters/main.go
===
--- /dev/null
+++ test/lang/go/formatters/main.go
@@ -0,0 +1,9 @@
+package main
+
+import "fmt"
+
+func main() {
+a := "my string"
+b := make([]int, 2, 7)
+fmt.Println(a, b)  // stop here
+}
\ No newline at end of file
Index: test/lang/go/formatters/TestGoFormatters.py
===
--- /dev/null
+++ test/lang/go/formatters/TestGoFormatters.py
@@ -0,0 +1,66 @@
+"""Test the Go Data Formatter Plugin."""
+
+import os, time
+import unittest2
+import lldb
+import lldbutil
+from lldbtest import *
+
+class TestGoLanguage(TestBase):
+
+mydir = TestBase.compute_mydir(__file__)
+
+@python_api_test
+@skipIfFreeBSD # llvm.org/pr24895 triggers assertion failure
+@skipIfRemote # Not remote test suite ready
+@no_debug_info_test
+@skipUnlessGoInstalled
+def test_go_formatter_plugin(self):
+"""Test go data formatters."""
+self.buildGo()
+self.launchProcess()
+self.check_formatters()
+
+def setUp(self):
+# Call super's setUp().
+TestBase.setUp(self)
+# Find the line numbers to break inside main().
+self.main_source = "main.go"
+self.break_line = line_number(self.main_source, '// stop here')
+
+def launchProcess(self):
+exe = os.path.join(os.getcwd(), "a.out")
+
+target = self.dbg.CreateTarget(exe)
+self.assertTrue(target, VALID_TARGET)
+
+self.bpt = target.BreakpointCreateByLocation(self.main_source, self.break_line)
+self.assertTrue(self.bpt, VALID_BREAKPOINT)
+
+# Now launch the process, and do not stop at entry point.
+process = target.LaunchSimple (None, None, self.get_process_working_directory())
+
+self.assertTrue(process, PROCESS_IS_VALID)
+
+# The stop reason of the thread should be breakpoint.
+thread_list = lldbutil.get_threads_stopped_at_breakpoint (process, self.bpt)
+
+# Make sure we stopped at the first breakpoint.
+self.assertTrue (len(thread_list) != 0, "No thread stopped at our breakpoint.")
+self.assertTrue (len(thread_list) == 1, "More than one thread stopped at our breakpoint.")
+
+frame = thread_list[0].GetFrameAtIndex(0)
+self.assertTrue (frame, "Got a valid frame 0 frame.")
+
+def check_formatters(self):
+a = self.frame().FindVariable('a')
+self.assertEqual('(string) a = "my string"', str(a))
+b = self.frame().FindVariable('b')
+self.assertEqual("([]int) b = (len 2, cap 7) {\n  [0] = 0\n  [1] = 0\n}", str(b))
+
+
+if __name__ == '__main__':
+import atexit
+lldb.SBDebugger.Initialize()
+atexit.register(lambda: lldb.SBDebugger.Terminate())
+unittest2.main()
Index: source/Plugins/Makefile
===
--- source/Plugins/Makefile
+++ source/Plugins/Makefile
@@ -26,6 +26,7 @@
 	LanguageRuntime/Go/ \
 	LanguageRuntime/RenderScript/RenderScriptRuntime \
 	Language/CPlusPlus \
+	Language/Go \
 	Language/ObjC \
 	Language/ObjCPlusPlus \
 	DynamicLoader/POSIX-DYLD \
Index: source/Plugins/Language/Go/Makefile
===
--- /dev/null
+++ source/Plugins/Language/Go/Makefile
@@ -0,0 +1,14 @@
+##===- source/Plugins/Language/Go ---*- 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 := lldbPluginGoLanguage
+BUILD_ARCHIVE = 1
+
+include $(LLDB_LEVEL)/Makefile
Index: source/Plugins/Language/Go/GoLanguage.h
===
--- /dev/null
+++ source/Plugins/Language/Go/GoLanguage.h
@@ -0,0 +1,66 @@
+//===-- GoLanguage.h *- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the Universi

Re: [Lldb-commits] New llvm build server account request

2015-10-20 Thread Galina Kistanova via lldb-commits
Hello Kamil,

It looks like you are missing dependencies for the LLDB builder you have
chosen.
http://lab.llvm.org:8014/builders/lldb-amd64-ninja-netbsd7/builds/75/steps/update%20scripts/logs/stdio

The getLLDBScriptCommandsFactory build factory does not document the
assumed dependency, so you may want to contact Ying Chen, who is the author
for the complete list of dependencies.

Another thing you may want to do is to reconsider the builder you want to
use. Maybe LLDBBuilder.getLLDBBuildFactory would work better for you,
though it requires autoconfig and make.

I'm adding the LLDB mail list in case somebody has an idea of what would be
the easiest way to get the NetBSD builder for LLDB up and running.

Hello everyone,

Kamil is on the mission of getting LLDB builder for NetBSDwhich would build
clang+LLVM, then LLDB and run tests.
What is the shortest and less painful route there? Any suggestions?
Just looking at the source code of the current set of the LLDB builders, it
is hard to tell which one is the "main".

Thanks

Galina
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D13880: Create an lldb/third_party folder, and add Python module 'six' to it.

2015-10-20 Thread Zachary Turner via lldb-commits
zturner added a comment.

Greg, do you have any concerns here?


http://reviews.llvm.org/D13880



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D13073: Add an expression parser for Go

2015-10-20 Thread Jim Ingham via lldb-commits
jingham requested changes to this revision.
jingham added a comment.
This revision now requires changes to proceed.

So before getting into the details of the patch, there's a structural bit it 
would be nice to fix.

When I was separating out bits of the Expression machinery, I assumed that even 
though all expression parsers would use different front-ends to llvm, they 
would all use llvm & the llvm JIT to run the expressions.  Your Go expression 
parser doesn't work that way.  However, the correct thing to do, then, is the 
make UserExpression the empty base class, then what used to be in 
UserExpression should go in LLVMUserExpression, then ClangUserExpression 
derives from LLVMUserExpression, but GoUserExpression derives from 
UserExpression directly.  That structure will make it easier to share the LLVM 
back end bits of expression running machinery, which really shouldn't go in 
ClangUserExpression since it isn't Clang specific.

Would you mind reworking it this way?


Repository:
  rL LLVM

http://reviews.llvm.org/D13073



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D13912: Make uses of metaclasses portable across Python versions

2015-10-20 Thread Zachary Turner via lldb-commits
zturner created this revision.
zturner added a reviewer: tfiala.
zturner added a subscriber: lldb-commits.

This uses the `six.add_metaclass()` decorator for portable metaclass 
specification.

http://reviews.llvm.org/D13912

Files:
  test/dotest.py
  test/lldbtest.py

Index: test/lldbtest.py
===
--- test/lldbtest.py
+++ test/lldbtest.py
@@ -33,6 +33,8 @@
 
 from __future__ import print_function
 
+import lldb_shared
+
 import abc
 import gc
 import glob
@@ -48,7 +50,8 @@
 import lldb
 import lldbtest_config
 import lldbutil
-from _pyio import __metaclass__
+
+from six import add_metaclass
 
 if sys.version_info.major < 3:
 import urlparse
@@ -254,8 +257,8 @@
 print(self.getvalue(), file=self.session)
 self.close()
 
+@add_metaclass(abc.ABCMeta)
 class _BaseProcess(object):
-__metaclass__ = abc.ABCMeta
 
 @abc.abstractproperty
 def pid(self):
@@ -2279,6 +2282,8 @@
 newattrs[attrname] = attrvalue
 return super(LLDBTestCaseFactory, cls).__new__(cls, name, bases, 
newattrs)
 
+# Setup the metaclass for this class to change the list of the test methods 
when a new class is loaded
+@add_metaclass(LLDBTestCaseFactory)
 class TestBase(Base):
 """
 This abstract base class is meant to be subclassed.  It provides default
@@ -2339,9 +2344,6 @@
 # Can be overridden by the LLDB_TIME_WAIT_NEXT_LAUNCH environment variable.
 timeWaitNextLaunch = 1.0;
 
-# Setup the metaclass for this class to change the list of the test 
methods when a new class is loaded
-__metaclass__ = LLDBTestCaseFactory
-
 def doDelay(self):
 """See option -w of dotest.py."""
 if ("LLDB_WAIT_BETWEEN_TEST_CASES" in os.environ and
Index: test/dotest.py
===
--- test/dotest.py
+++ test/dotest.py
@@ -44,7 +44,6 @@
 
 import six
 
-
 def is_exe(fpath):
 """Returns true if fpath is an executable."""
 return os.path.isfile(fpath) and os.access(fpath, os.X_OK)


Index: test/lldbtest.py
===
--- test/lldbtest.py
+++ test/lldbtest.py
@@ -33,6 +33,8 @@
 
 from __future__ import print_function
 
+import lldb_shared
+
 import abc
 import gc
 import glob
@@ -48,7 +50,8 @@
 import lldb
 import lldbtest_config
 import lldbutil
-from _pyio import __metaclass__
+
+from six import add_metaclass
 
 if sys.version_info.major < 3:
 import urlparse
@@ -254,8 +257,8 @@
 print(self.getvalue(), file=self.session)
 self.close()
 
+@add_metaclass(abc.ABCMeta)
 class _BaseProcess(object):
-__metaclass__ = abc.ABCMeta
 
 @abc.abstractproperty
 def pid(self):
@@ -2279,6 +2282,8 @@
 newattrs[attrname] = attrvalue
 return super(LLDBTestCaseFactory, cls).__new__(cls, name, bases, newattrs)
 
+# Setup the metaclass for this class to change the list of the test methods when a new class is loaded
+@add_metaclass(LLDBTestCaseFactory)
 class TestBase(Base):
 """
 This abstract base class is meant to be subclassed.  It provides default
@@ -2339,9 +2344,6 @@
 # Can be overridden by the LLDB_TIME_WAIT_NEXT_LAUNCH environment variable.
 timeWaitNextLaunch = 1.0;
 
-# Setup the metaclass for this class to change the list of the test methods when a new class is loaded
-__metaclass__ = LLDBTestCaseFactory
-
 def doDelay(self):
 """See option -w of dotest.py."""
 if ("LLDB_WAIT_BETWEEN_TEST_CASES" in os.environ and
Index: test/dotest.py
===
--- test/dotest.py
+++ test/dotest.py
@@ -44,7 +44,6 @@
 
 import six
 
-
 def is_exe(fpath):
 """Returns true if fpath is an executable."""
 return os.path.isfile(fpath) and os.access(fpath, os.X_OK)
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D13912: Make uses of metaclasses portable across Python versions

2015-10-20 Thread Todd Fiala via lldb-commits
tfiala accepted this revision.
tfiala added a comment.
This revision is now accepted and ready to land.

Looks good.


http://reviews.llvm.org/D13912



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D13912: Make uses of metaclasses portable across Python versions

2015-10-20 Thread Zachary Turner via lldb-commits
zturner added a comment.

Thanks.  This is still blocked on my 2 earlier CLs (one adding six to the repo, 
and the other hooking up six to be recognized by dotest).  If you get a chance 
can you take a look at those?


http://reviews.llvm.org/D13912



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D13880: Create an lldb/third_party folder, and add Python module 'six' to it.

2015-10-20 Thread Todd Fiala via lldb-commits
tfiala added a comment.

In http://reviews.llvm.org/D13880#270742, @zturner wrote:

> Todd, do you have any good ideas on how to organize this and make it play 
> nicely with python's module / package system?  `dotest` is just an arbitrary 
> script under lldb/test and is not part of any installed package or anything.  
> At the same time, third party code needs to be in a centralized place at the 
> top-level in case it needs to be tracked or audited by legal people.  So I 
> don't think we can put six under `test` (nor would it even make sense to, 
> since that wouldn't help people under lldb/scripts who also want to use it).
>
> So somehow `lldb/scripts` and `lldb/test` both need to be able to import from 
> `lldb/third_party/Python/modules`.
>
> I know this isn't really the "pythonic" way, because it expects everything to 
> be nicely organized packages with a nice hierarchy, but dotest is treated as 
> a one-off script.  I don't really want people to have to install `six` via 
> setuptools or anything because it just adds an unnecessary extra step which 
> is a regression from the status quo.
>
> Do absolute imports help us?  
> (https://docs.python.org/2.5/whatsnew/pep-328.html)
>
> I think this question speaks to a more general problem of: "How do we re-use 
> python code across tests and scripts?"  Do you have any suggestions that can 
> make this work cleanly?


Hmm, registering that I see the question.  I need to think about it.

Generally I have an upper level script (such as dotest.py in our case) that 
gets called directly, and adds paths relative to its script directory to set up 
all the other bits it needs to find.  One example of where I do this in lldb is 
a util that probably nobody else uses, utils/sync-source/syncsource.py.  It 
imports os and sys, and from that, bootstraps its sys.path (PYTHONPATH) by 
adding the script-file-relative lib dir to the python path.

So the technique is find an anchor point (in the case above, dotest.py) and 
have it add the script-relative path to the python path.

I do the same thing to adjust the pylint .pylintrc python path, so that pylint 
can find not only the lldbtest path, but also the lldb module executable (via 
lldb[.exe] -P).

Not sure if that helps?


http://reviews.llvm.org/D13880



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] New llvm build server account request

2015-10-20 Thread Kamil Rytarowski via lldb-commits
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Hello Ying,

I'm in trouble with my attempts to connect my NetBSD/amd64 machine to
the LLDB/LLVM build zone.

My host is NetBSD-7.0 (with buildslave ID: lldb-amd64-ninja-netbsd7).
I use pkgsrc (2015Q3) to ship packages. I'm attaching a list of
installed ones to this mail.

I talked with Joerg and it was decided to go for CMake and Ninja, we
don't want to change it for now (at least till single machine will be
plugged in).

Please try to spawn local NetBSD session and connect to the staging
buildbot and debug it locally, to cut the number of iterations between
me and the Galina.

I'm adding here a short tutorial to get to reproduce quickly the setup
of mine. It will take you like 2-5 minutes to get into installed
system (depends of an internet connection).

1. Prepare a disk image.
$ qemu-img create -f qcow2 netbsd7.0_amd64 10G

2. Get an installation media.
$ $FETCH_TOOL
ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-7.0/amd64/installation/cdrom/boot
- -com.iso

3. Spawn installation
$ qemu-system-x86_64 \
-enable-kvm \
-net user \
-m 2G \
-cdrom boot-com.iso \
-nographic \
-smp cores=2 \
-hda netbsd7.0_amd64 \
-boot d

4. Inside the installer push ctrl-c and get the command line.

5. Setup network connection:
# dhcpcd

6. Go to a writable dir, like /tmp
# cd /tmp

7. Fetch the autoinst.sh script of mine
# ftp ftp://ftp.netbsd.org/pub/NetBSD/misc/kamil/autoinst.sh

# sh autoinst.sh -s 128 -r mypass -c com0 -C 9600 -p wd0

(take a coffee break)

8. If everything went OK, just type:
# poweroff

9. Start your newly installed system
qemu-system-x86_64 \
-enable-kvm \
-net user \
-m 2G \
-nographic \
-smp cores=2 \
-hda netbsd7.0_amd64 \
-boot c
(root password is empty)

10. Install dependencies from pkgsrc, like:
# cd /usr/pkgsrc/devel/cmake && make install

Please install packags needed for buildslave, create dedicated user
and try to connect it to the salve.

Thank you in advance,

On 20.10.2015 21:40, Galina Kistanova wrote:
> Hello Kamil,
> 
> It looks like you are missing dependencies for the LLDB builder
> you have chosen. 
> http://lab.llvm.org:8014/builders/lldb-amd64-ninja-netbsd7/builds/75/s
teps/update%20scripts/logs/stdio
>
>
> 
The getLLDBScriptCommandsFactory build factory does not document
> the assumed dependency, so you may want to contact Ying Chen, who 
> is the author for the complete list of dependencies.
> 
> Another thing you may want to do is to reconsider the builder you 
> want to use. Maybe LLDBBuilder.getLLDBBuildFactory would work 
> better for you, though it requires autoconfig and make.
> 
> I'm adding the LLDB mail list in case somebody has an idea of what 
> would be the easiest way to get the NetBSD builder for LLDB up and 
> running.
> 
> Hello everyone,
> 
> Kamil is on the mission of getting LLDB builder for NetBSDwhich 
> would build clang+LLVM, then LLDB and run tests. What is the 
> shortest and less painful route there? Any suggestions? Just 
> looking at the source code of the current set of the LLDB builders,
> it is hard to tell which one is the "main".
> 
> Thanks
> 
> Galina
> 
> 
> 
> 

-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iQIcBAEBCAAGBQJWJqgPAAoJEEuzCOmwLnZsnA8P/1UpAgS4F6iViH1PbNcq6/8K
FhAaLm3spctbiJpYs51OVyqv+cu0pjziwdEU3KRWvHqWq7Rd29smlRj9w7sPGijD
iH5ofH/uTRpShwO/0taIyVtbMehyah2mtqk+M20Tx5V0H6ajRTYI+PKZWYKUs3V8
bhCnD09emc0clqsHSc1dEUyBY+1n7ID5NjZsMKViKj5lT3EsCIk8hYHYcrFq8Zxh
eDBXwCZUJHvItEA6FXED09IlhCdkeJd7rpLHeITb+3zg5ZNP6all1DnAaalSFRDm
ObDRpsqD8DLGhe9MPPDZVXVKVaFH3lOcrpV0U3qx9ccy4ihRHEWWdgD+n8vEslXF
Ai/j8PTgnZ1hQfmVTQPQoo9LCe3IS68Q2omEkZx+0/Thfv97yQ9rZk6RjWwekzfK
okf4JcnxG4jxhE8jRkKKuOWLCo/es53Rc1UQ9Q8BgoyTRRUmicNEM+eiWBIHUWFs
YRGcFbI+S8wJZuxFRizE0XkP4e1z4EGxn6Tu6m9WJYcUdhDn0mzDpjr6YVj+YgvS
xtlGB78uVj5p3e/ljfBUkcwqGS9HNH15VGgA1sV5j5gvpJu37wqXXT6/4i4wLbuP
0vIH6PoCwxiyP0FawQwyY7RZwY89LhnlHQbINMFAi5ZaH7q8ELNNkn7YXBSSlHjy
VmVVg06mkdC3bo7U8lMT
=Lm1Q
-END PGP SIGNATURE-
$ pkg_info  
   
digest-20121220 Message digest wrapper utility
checkperms-1.11 Check and correct file permissions
gmake-4.1nb1GNU version of 'make' utility
libtool-base-2.4.2nb10 Generic shared library support script (the script itself)
libarchive-3.1.2nb1 Library to read/create different archive formats
gsed-4.2.2nb4   GNU implementation of sed, the POSIX stream editor
perl-5.22.0 Practical Extraction and Report Language
pkg-config-0.28 System for managing library compile/link flags
libidn-1.32 Internationalized Domain Names command line tool
curl-7.44.0 Client that groks URLs
cmake-3.3.1 Cross platform make
ncurses-6.0nb1  CRT screen handling and optimization package
mg-20110905nb2  Small, fast, public domain EMACS style edit

Re: [Lldb-commits] [PATCH] D13880: Create an lldb/third_party folder, and add Python module 'six' to it.

2015-10-20 Thread Todd Fiala via lldb-commits
tfiala added a comment.

In http://reviews.llvm.org/D13880#271483, @tfiala wrote:

> In http://reviews.llvm.org/D13880#270742, @zturner wrote:
>
> > Todd, do you have any good ideas on how to organize this and make it play 
> > nicely with python's module / package system?  `dotest` is just an 
> > arbitrary script under lldb/test and is not part of any installed package 
> > or anything.  At the same time, third party code needs to be in a 
> > centralized place at the top-level in case it needs to be tracked or 
> > audited by legal people.  So I don't think we can put six under `test` (nor 
> > would it even make sense to, since that wouldn't help people under 
> > lldb/scripts who also want to use it).
> >
> > So somehow `lldb/scripts` and `lldb/test` both need to be able to import 
> > from `lldb/third_party/Python/modules`.
> >
> > I know this isn't really the "pythonic" way, because it expects everything 
> > to be nicely organized packages with a nice hierarchy, but dotest is 
> > treated as a one-off script.  I don't really want people to have to install 
> > `six` via setuptools or anything because it just adds an unnecessary extra 
> > step which is a regression from the status quo.
> >
> > Do absolute imports help us?  
> > (https://docs.python.org/2.5/whatsnew/pep-328.html)
> >
> > I think this question speaks to a more general problem of: "How do we 
> > re-use python code across tests and scripts?"  Do you have any suggestions 
> > that can make this work cleanly?
>
>
> Hmm, registering that I see the question.  I need to think about it.
>
> Generally I have an upper level script (such as dotest.py in our case) that 
> gets called directly, and adds paths relative to its script directory to set 
> up all the other bits it needs to find.  One example of where I do this in 
> lldb is a util that probably nobody else uses, 
> utils/sync-source/syncsource.py.  It imports os and sys, and from that, 
> bootstraps its sys.path (PYTHONPATH) by adding the script-file-relative lib 
> dir to the python path.
>
> So the technique is find an anchor point (in the case above, dotest.py) and 
> have it add the script-relative path to the python path.
>
> I do the same thing to adjust the pylint .pylintrc python path, so that 
> pylint can find not only the lldbtest path, but also the lldb module 
> executable (via lldb[.exe] -P).


That example would be in test/lldb_pylint_helper.py (which also documents how 
to use it to adjust your global pylintrc to make this all work, which becomes a 
bootstrap process much like what I think you're asking about here, albeit in 
the context of getting the python path setup for pylint rather than for the 
file itself --- but each file could have a little loader that does something 
like that).

> Not sure if that helps?



http://reviews.llvm.org/D13880



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D13880: Create an lldb/third_party folder, and add Python module 'six' to it.

2015-10-20 Thread Todd Fiala via lldb-commits
tfiala accepted this revision.
tfiala added a comment.
This revision is now accepted and ready to land.

All that aside, LGTM.


http://reviews.llvm.org/D13880



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D13880: Create an lldb/third_party folder, and add Python module 'six' to it.

2015-10-20 Thread Zachary Turner via lldb-commits
zturner added a comment.

Yea, I actually did something very similar to that.  Check out 
http://reviews.llvm.org/D13906


http://reviews.llvm.org/D13880



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D13906: Introduce a mechanism for sharing code across lldb/test and lldb/scripts

2015-10-20 Thread Todd Fiala via lldb-commits
tfiala accepted this revision.
tfiala added a comment.
This revision is now accepted and ready to land.

Yep, like it.


http://reviews.llvm.org/D13906



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D13912: Make uses of metaclasses portable across Python versions

2015-10-20 Thread Todd Fiala via lldb-commits
tfiala added a comment.

In http://reviews.llvm.org/D13912#271481, @zturner wrote:

> Thanks.  This is still blocked on my 2 earlier CLs (one adding six to the 
> repo, and the other hooking up six to be recognized by dotest).  If you get a 
> chance can you take a look at those?


Yep, I didn't read them in time order :-)  All 3 looked good.


http://reviews.llvm.org/D13912



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D13912: Make uses of metaclasses portable across Python versions

2015-10-20 Thread Zachary Turner via lldb-commits
zturner added a comment.

Thanks!


http://reviews.llvm.org/D13912



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r250859 - Use six to portably assign metaclasses in Python 2 and 3.

2015-10-20 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Tue Oct 20 16:06:05 2015
New Revision: 250859

URL: http://llvm.org/viewvc/llvm-project?rev=250859&view=rev
Log:
Use six to portably assign metaclasses in Python 2 and 3.

Modified:
lldb/trunk/test/dotest.py
lldb/trunk/test/lldbtest.py

Modified: lldb/trunk/test/dotest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/dotest.py?rev=250859&r1=250858&r2=250859&view=diff
==
--- lldb/trunk/test/dotest.py (original)
+++ lldb/trunk/test/dotest.py Tue Oct 20 16:06:05 2015
@@ -44,7 +44,6 @@ import lldbtest_config
 
 import six
 
-
 def is_exe(fpath):
 """Returns true if fpath is an executable."""
 return os.path.isfile(fpath) and os.access(fpath, os.X_OK)

Modified: lldb/trunk/test/lldbtest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldbtest.py?rev=250859&r1=250858&r2=250859&view=diff
==
--- lldb/trunk/test/lldbtest.py (original)
+++ lldb/trunk/test/lldbtest.py Tue Oct 20 16:06:05 2015
@@ -33,6 +33,8 @@ $
 
 from __future__ import print_function
 
+import lldb_shared
+
 import abc
 import gc
 import glob
@@ -48,7 +50,8 @@ import unittest2
 import lldb
 import lldbtest_config
 import lldbutil
-from _pyio import __metaclass__
+
+from six import add_metaclass
 
 if sys.version_info.major < 3:
 import urlparse
@@ -254,8 +257,8 @@ class recording(StringIO.StringIO):
 print(self.getvalue(), file=self.session)
 self.close()
 
+@add_metaclass(abc.ABCMeta)
 class _BaseProcess(object):
-__metaclass__ = abc.ABCMeta
 
 @abc.abstractproperty
 def pid(self):
@@ -2279,6 +2282,8 @@ class LLDBTestCaseFactory(type):
 newattrs[attrname] = attrvalue
 return super(LLDBTestCaseFactory, cls).__new__(cls, name, bases, 
newattrs)
 
+# Setup the metaclass for this class to change the list of the test methods 
when a new class is loaded
+@add_metaclass(LLDBTestCaseFactory)
 class TestBase(Base):
 """
 This abstract base class is meant to be subclassed.  It provides default
@@ -2339,9 +2344,6 @@ class TestBase(Base):
 # Can be overridden by the LLDB_TIME_WAIT_NEXT_LAUNCH environment variable.
 timeWaitNextLaunch = 1.0;
 
-# Setup the metaclass for this class to change the list of the test 
methods when a new class is loaded
-__metaclass__ = LLDBTestCaseFactory
-
 def doDelay(self):
 """See option -w of dotest.py."""
 if ("LLDB_WAIT_BETWEEN_TEST_CASES" in os.environ and


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r250857 - Add `six` Python module to lldb/third_party.

2015-10-20 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Tue Oct 20 16:05:49 2015
New Revision: 250857

URL: http://llvm.org/viewvc/llvm-project?rev=250857&view=rev
Log:
Add `six` Python module to lldb/third_party.

Six is a python module designed to smooth the process of porting
Python 2 code to Python 3.  Specifically, six provides a consistent
interface to some of the breaking changes between 2 and 3.  For example,
the syntax for assigning a metaclass differs in Python 2 and 3.  Six
addresses this by providing a single class decorator that will do the
right thing depending on which version of Python is being run.

There are other examples too, such as dealing with renamed modules,
unicode literals, etc.

Added:
lldb/trunk/third_party/
lldb/trunk/third_party/Python/
lldb/trunk/third_party/Python/module/
lldb/trunk/third_party/Python/module/six/
lldb/trunk/third_party/Python/module/six/LICENSE
lldb/trunk/third_party/Python/module/six/six.py

Added: lldb/trunk/third_party/Python/module/six/LICENSE
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/third_party/Python/module/six/LICENSE?rev=250857&view=auto
==
--- lldb/trunk/third_party/Python/module/six/LICENSE (added)
+++ lldb/trunk/third_party/Python/module/six/LICENSE Tue Oct 20 16:05:49 2015
@@ -0,0 +1,18 @@
+Copyright (c) 2010-2015 Benjamin Peterson
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 
of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Added: lldb/trunk/third_party/Python/module/six/six.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/third_party/Python/module/six/six.py?rev=250857&view=auto
==
--- lldb/trunk/third_party/Python/module/six/six.py (added)
+++ lldb/trunk/third_party/Python/module/six/six.py Tue Oct 20 16:05:49 2015
@@ -0,0 +1,868 @@
+"""Utilities for writing code that runs on Python 2 and 3"""
+
+# Copyright (c) 2010-2015 Benjamin Peterson
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in 
all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+from __future__ import absolute_import
+
+import functools
+import itertools
+import operator
+import sys
+import types
+
+__author__ = "Benjamin Peterson "
+__version__ = "1.10.0"
+
+
+# Useful for very coarse version differentiation.
+PY2 = sys.version_info[0] == 2
+PY3 = sys.version_info[0] == 3
+PY34 = sys.version_info[0:2] >= (3, 4)
+
+if PY3:
+string_types = str,
+integer_types = int,
+class_types = type,
+text_type = str
+binary_type = bytes
+
+MAXSIZE = sys.maxsize
+else:
+string_types = basestring,
+integer_types = (int, long)
+class_types = (type, types.ClassType)
+text_type = unicode
+binary_type = str
+
+if sys.platform.startswith("java"):
+# Jython always uses 32 bits.
+MAXSIZE = int((1 << 31) - 1)
+else:
+# It's possible to have sizeof(long) != sizeof(Py_ssize_t).
+class X(object):
+
+def __len__(self):
+return 1 << 31
+try:
+   

[Lldb-commits] [lldb] r250858 - Introduce a mechanism for reusing Python modules out of tree.

2015-10-20 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Tue Oct 20 16:05:57 2015
New Revision: 250858

URL: http://llvm.org/viewvc/llvm-project?rev=250858&view=rev
Log:
Introduce a mechanism for reusing Python modules out of tree.

Right now our Python code does not all share a common root.  Tests and
scripts both contain python code that cannot take advantage of reusability
since they are unrelated siblings of each other.

In particular, this presents a problem for wanting to use third party
packages from both sides, since it does not make sense to copy the module
into both places.

This patch solves this by introducing a script lldb_shared.py which is a
very lightweight script that just searches up the tree until it finds a
root, and then imports a module from there.  That module knows how to
find all of the shared code that LLDB uses, and adjusts sys.path
accordingly to make them all visible.

Added:
lldb/trunk/lldb.root
lldb/trunk/lldb_shared_base.py
lldb/trunk/test/lldb_shared.py
Modified:
lldb/trunk/test/dotest.py

Added: lldb/trunk/lldb.root
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.root?rev=250858&view=auto
==
(empty)

Added: lldb/trunk/lldb_shared_base.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb_shared_base.py?rev=250858&view=auto
==
--- lldb/trunk/lldb_shared_base.py (added)
+++ lldb/trunk/lldb_shared_base.py Tue Oct 20 16:05:57 2015
@@ -0,0 +1,15 @@
+import inspect
+import os
+import sys
+
+def add_third_party_module_dirs(lldb_root):
+third_party_modules_dir = os.path.join(lldb_root, "third_party", "Python", 
"module")
+if not os.path.isdir(third_party_modules_dir):
+return
+
+module_dirs = os.listdir(third_party_modules_dir)
+for module_dir in module_dirs:
+module_dir = os.path.join(third_party_modules_dir, module_dir)
+sys.path.append(module_dir)
+lldb_root = os.path.dirname(inspect.getfile(inspect.currentframe()))
+add_third_party_module_dirs(lldb_root)

Modified: lldb/trunk/test/dotest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/dotest.py?rev=250858&r1=250857&r2=250858&view=diff
==
--- lldb/trunk/test/dotest.py (original)
+++ lldb/trunk/test/dotest.py Tue Oct 20 16:05:57 2015
@@ -22,6 +22,8 @@ for available options.
 
 from __future__ import print_function
 
+import lldb_shared
+
 import atexit
 import commands
 import importlib
@@ -40,6 +42,8 @@ import inspect
 import unittest2
 import lldbtest_config
 
+import six
+
 
 def is_exe(fpath):
 """Returns true if fpath is an executable."""

Added: lldb/trunk/test/lldb_shared.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldb_shared.py?rev=250858&view=auto
==
--- lldb/trunk/test/lldb_shared.py (added)
+++ lldb/trunk/test/lldb_shared.py Tue Oct 20 16:05:57 2015
@@ -0,0 +1,22 @@
+import inspect
+import os
+import sys
+
+def find_lldb_root():
+lldb_root = os.path.dirname(inspect.getfile(inspect.currentframe()))
+while True:
+lldb_root = os.path.dirname(lldb_root)
+if lldb_root is None:
+return None
+
+test_path = os.path.join(lldb_root, "lldb.root")
+if os.path.isfile(test_path):
+return lldb_root
+return None
+
+lldb_root = find_lldb_root()
+if lldb_root is not None:
+import imp
+module = imp.find_module("lldb_shared_base", [lldb_root])
+if module is not None:
+imp.load_module("lldb_shared_base", *module)
\ No newline at end of file


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D13916: D13840 [LLDB] Fix Clang-tidy modernize-use-override warnings in some files in source/Plugins; other minor fixes.

2015-10-20 Thread Eugene Zelenko via lldb-commits
Eugene.Zelenko created this revision.
Eugene.Zelenko added reviewers: brucem, labath, clayborg.
Eugene.Zelenko added a subscriber: lldb-commits.
Eugene.Zelenko set the repository for this revision to rL LLVM.

I checked this patch on my own build on RHEL 6.

Repository:
  rL LLVM

http://reviews.llvm.org/D13916

Files:
  source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
  source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h
  source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h
  source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.h
  source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h
  source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h
  source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.h
  source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.h
  source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
  source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.h
  source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp
  source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h
  source/Plugins/ExpressionParser/Clang/ClangUserExpression.h
  source/Plugins/Instruction/ARM64/EmulateInstructionARM64.h
  source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h
  
source/Plugins/InstrumentationRuntime/AddressSanitizer/AddressSanitizerRuntime.h

Index: source/Plugins/InstrumentationRuntime/AddressSanitizer/AddressSanitizerRuntime.h
===
--- source/Plugins/InstrumentationRuntime/AddressSanitizer/AddressSanitizerRuntime.h
+++ source/Plugins/InstrumentationRuntime/AddressSanitizer/AddressSanitizerRuntime.h
@@ -10,6 +10,10 @@
 #ifndef liblldb_AddressSanitizerRuntime_h_
 #define liblldb_AddressSanitizerRuntime_h_
 
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
 #include "lldb/lldb-private.h"
 #include "lldb/Target/ABI.h"
 #include "lldb/Target/InstrumentationRuntime.h"
@@ -21,7 +25,8 @@
 class AddressSanitizerRuntime : public lldb_private::InstrumentationRuntime
 {
 public:
-
+~AddressSanitizerRuntime() override;
+
 static lldb::InstrumentationRuntimeSP
 CreateInstance (const lldb::ProcessSP &process_sp);
 
@@ -36,26 +41,30 @@
 
 static lldb::InstrumentationRuntimeType
 GetTypeStatic();
+
+lldb_private::ConstString
+GetPluginName() override
+{ 
+return GetPluginNameStatic();
+}
 
-virtual
-~AddressSanitizerRuntime();
-
-virtual lldb_private::ConstString
-GetPluginName() { return GetPluginNameStatic(); }
-
 virtual lldb::InstrumentationRuntimeType
 GetType() { return GetTypeStatic(); }
 
-virtual uint32_t
-GetPluginVersion() { return 1; }
+uint32_t
+GetPluginVersion() override
+{
+return 1;
+}
 
-virtual void
-ModulesDidLoad(lldb_private::ModuleList &module_list);
+void
+ModulesDidLoad(lldb_private::ModuleList &module_list) override;
 
-virtual bool
-IsActive();
+bool
+IsActive() override;
 
 private:
+AddressSanitizerRuntime(const lldb::ProcessSP &process_sp);
 
 lldb::ProcessSP
 GetProcessSP ()
@@ -63,8 +72,6 @@
 return m_process_wp.lock();
 }
 
-AddressSanitizerRuntime(const lldb::ProcessSP &process_sp);
-
 void
 Activate();
 
@@ -84,9 +91,8 @@
 lldb::ModuleSP m_runtime_module;
 lldb::ProcessWP m_process_wp;
 lldb::user_id_t m_breakpoint_id;
-
 };
 
 } // namespace lldb_private
 
-#endif  // liblldb_InstrumentationRuntime_h_
+#endif // liblldb_AddressSanitizerRuntime_h_
Index: source/Plugins/Instruction/ARM64/EmulateInstructionARM64.h
===
--- source/Plugins/Instruction/ARM64/EmulateInstructionARM64.h
+++ source/Plugins/Instruction/ARM64/EmulateInstructionARM64.h
@@ -1,4 +1,4 @@
-//===-- EmulateInstructionARM64.h *- C++ -*-===//
+//===-- EmulateInstructionARM64.h ---*- C++ -*-===//
 //
 // The LLVM Compiler Infrastructure
 //
@@ -10,6 +10,10 @@
 #ifndef EmulateInstructionARM64_h_
 #define EmulateInstructionARM64_h_
 
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
 #include "lldb/Core/EmulateInstruction.h"
 #include "lldb/Core/Error.h"
 #include "lldb/Interpreter/OptionValue.h"
@@ -18,6 +22,14 @@
 class EmulateInstructionARM64 : public lldb_private::EmulateInstruction
 {
 public: 
+EmulateInstructionARM64 (const lldb_private::ArchSpec &arch) :
+EmulateInstruction (arch),
+m_opcode_pstate (),
+m_emulated_pstate (),
+m_ignore_conditions (false)
+{
+}
+
 static void
 Initialize ();
 
@@ -50,55 +62,46 @@
 return false;
 }
 
-virtual lldb_private::ConstString
-GetPluginName();
+lldb_private::Const

Re: [Lldb-commits] [PATCH] D13912: Make uses of metaclasses portable across Python versions

2015-10-20 Thread Todd Fiala via lldb-commits
tfiala added a comment.

Sure thing!


http://reviews.llvm.org/D13912



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D13881: Add domain socket support to gdb-remote protocol and lldb-server.

2015-10-20 Thread Oleksiy Vyalov via lldb-commits
ovyalov updated this revision to Diff 37928.
ovyalov added a comment.

- Renamed LaunchGDBserverAndGetPort into LaunchGDBServer within 
PlatformAndroidRemoteGDBServer/PlatformRemoteGDBServer/GDBRemoteCommunicationClient
- Fixed includes' order.
- Added Acceptor::LocalSocketId which returns either TCP port and domain socket 
name - in order to write this value down into named pipe so it can be used by 
platform as a synchronization point.


http://reviews.llvm.org/D13881

Files:
  lldb.xcodeproj/project.pbxproj
  source/Host/posix/ConnectionFileDescriptorPosix.cpp
  source/Plugins/Platform/Android/AdbClient.cpp
  source/Plugins/Platform/Android/AdbClient.h
  source/Plugins/Platform/Android/PlatformAndroid.cpp
  source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp
  source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.h
  source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
  source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h
  source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
  source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
  source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
  source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
  source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp
  source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.h
  source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
  tools/lldb-server/Acceptor.cpp
  tools/lldb-server/Acceptor.h
  tools/lldb-server/CMakeLists.txt
  tools/lldb-server/lldb-gdbserver.cpp
  tools/lldb-server/lldb-platform.cpp

Index: tools/lldb-server/lldb-platform.cpp
===
--- tools/lldb-server/lldb-platform.cpp
+++ tools/lldb-server/lldb-platform.cpp
@@ -23,15 +23,17 @@
 #include 
 
 // Other libraries and framework includes
+#include "llvm/Support/FileSystem.h"
+#include "llvm/Support/FileUtilities.h"
+
 #include "lldb/Core/Error.h"
 #include "lldb/Host/ConnectionFileDescriptor.h"
 #include "lldb/Host/FileSpec.h"
 #include "lldb/Host/FileSystem.h"
 #include "lldb/Host/HostGetOpt.h"
 #include "lldb/Host/OptionParser.h"
 #include "lldb/Host/common/TCPSocket.h"
-#include "llvm/Support/FileSystem.h"
-#include "llvm/Support/FileUtilities.h"
+#include "Acceptor.h"
 #include "LLDBServerUtilities.h"
 #include "Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.h"
 #include "Plugins/Process/gdb-remote/ProcessGDBRemoteLog.h"
@@ -61,7 +63,7 @@
 { "gdbserver-port", required_argument,  NULL,   'P' },
 { "min-gdbserver-port", required_argument,  NULL,   'm' },
 { "max-gdbserver-port", required_argument,  NULL,   'M' },
-{ "port-file",  required_argument,  NULL,   'f' },
+{ "socket-file",required_argument,  NULL,   'f' },
 { "server", no_argument,&g_server,  1   },
 { NULL, 0,  NULL,   0   }
 };
@@ -100,9 +102,9 @@
 }
 
 static Error
-save_port_to_file(const uint16_t port, const FileSpec &port_file_spec)
+save_socket_id_to_file(const std::string &socket_id, const FileSpec &file_spec)
 {
-FileSpec temp_file_spec(port_file_spec.GetDirectory().AsCString(), false);
+FileSpec temp_file_spec(file_spec.GetDirectory().AsCString(), false);
 auto error = FileSystem::MakeDirectory(temp_file_spec, eFilePermissionsDirectoryDefault);
 if (error.Fail())
return Error("Failed to create directory %s: %s", temp_file_spec.GetCString(), error.AsCString());
@@ -119,13 +121,13 @@
 std::ofstream temp_file(temp_file_path.c_str(), std::ios::out);
 if (!temp_file.is_open())
 return Error("Failed to open temp file %s", temp_file_path.c_str());
-temp_file << port;
+temp_file << socket_id;
 }
 
-err_code = llvm::sys::fs::rename(temp_file_path.c_str(), port_file_spec.GetPath().c_str());
+err_code = llvm::sys::fs::rename(temp_file_path.c_str(), file_spec.GetPath().c_str());
 if (err_code)
 return Error("Failed to rename file %s to %s: %s",
- temp_file_path.c_str(), port_file_spec.GetPath().c_str(), err_code.message().c_str());
+ temp_file_path.c_str(), file_spec.GetPath().c_str(), err_code.message().c_str());
 
 tmp_file_remover.releaseFile();
 return Error();
@@ -156,7 +158,7 @@
 int max_gdbserver_port = 0;
 uint16_t port_offset = 0;
 
-FileSpec port_file;
+FileSpec socket_file;
 bool show_usage = false;
 int option_error = 0;
 int socket_error = -1;
@@ -191,9 +193,9 @@
 log_channels = StringRef(optarg);
 break;
 
-case 'f': // Port file
+case 'f': // Socket file
 if (optarg && optarg[0])
-port_file.SetFile(optarg, false);
+socket_file.SetFile(optarg, false);
 

Re: [Lldb-commits] [PATCH] D13778: [SBValue] Add a method GetNumChildren(uint32_t max)

2015-10-20 Thread Siva Chandra via lldb-commits
sivachandra updated this revision to Diff 37937.
sivachandra added a comment.

Add tests.


http://reviews.llvm.org/D13778

Files:
  include/lldb/API/SBValue.h
  include/lldb/Core/ValueObject.h
  include/lldb/Core/ValueObjectCast.h
  include/lldb/Core/ValueObjectChild.h
  include/lldb/Core/ValueObjectConstResult.h
  include/lldb/Core/ValueObjectDynamicValue.h
  include/lldb/Core/ValueObjectMemory.h
  include/lldb/Core/ValueObjectRegister.h
  include/lldb/Core/ValueObjectSyntheticFilter.h
  include/lldb/Core/ValueObjectVariable.h
  include/lldb/DataFormatters/TypeSynthetic.h
  include/lldb/Interpreter/ScriptInterpreter.h
  scripts/Python/python-wrapper.swig
  scripts/interface/SBValue.i
  source/API/SBValue.cpp
  source/API/SystemInitializerFull.cpp
  source/Core/ValueObject.cpp
  source/Core/ValueObjectCast.cpp
  source/Core/ValueObjectChild.cpp
  source/Core/ValueObjectConstResult.cpp
  source/Core/ValueObjectDynamicValue.cpp
  source/Core/ValueObjectMemory.cpp
  source/Core/ValueObjectRegister.cpp
  source/Core/ValueObjectSyntheticFilter.cpp
  source/Core/ValueObjectVariable.cpp
  source/DataFormatters/TypeSynthetic.cpp
  source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
  source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h
  
test/functionalities/data-formatter/data-formatter-synthval/TestDataFormatterSynthVal.py
  test/functionalities/data-formatter/data-formatter-synthval/main.cpp
  
test/functionalities/data-formatter/data-formatter-synthval/myIntSynthProvider.py

Index: test/functionalities/data-formatter/data-formatter-synthval/myIntSynthProvider.py
===
--- test/functionalities/data-formatter/data-formatter-synthval/myIntSynthProvider.py
+++ test/functionalities/data-formatter/data-formatter-synthval/myIntSynthProvider.py
@@ -15,3 +15,22 @@
 	def get_value(self):
 	return self.val
 
+
+class myArraySynthProvider(object):
+def __init__(self, valobj, dict):
+self.valobj = valobj
+self.array = self.valobj.GetChildMemberWithName("array")
+
+def num_children(self, max_count):
+if 16 < max_count:
+return 16
+return max_count
+
+def get_child_at_index(self, index):
+return None # Keep it simple when this is not tested here.
+
+def get_child_index(self, name):
+return None # Keep it simple when this is not tested here.
+
+def has_children(self):
+return True
Index: test/functionalities/data-formatter/data-formatter-synthval/main.cpp
===
--- test/functionalities/data-formatter/data-formatter-synthval/main.cpp
+++ test/functionalities/data-formatter/data-formatter-synthval/main.cpp
@@ -5,6 +5,11 @@
 int val() { return theValue; }
 };
 
+class myArray {
+public:
+int array[16];
+};
+
 class hasAnInt {
 public:
 myInt theInt;
@@ -18,5 +23,7 @@
 myInt y{4};
 myInt z {x+y};
 hasAnInt hi;
+myArray ma;
+
 return z.val(); // break here
 }
Index: test/functionalities/data-formatter/data-formatter-synthval/TestDataFormatterSynthVal.py
===
--- test/functionalities/data-formatter/data-formatter-synthval/TestDataFormatterSynthVal.py
+++ test/functionalities/data-formatter/data-formatter-synthval/TestDataFormatterSynthVal.py
@@ -66,6 +66,7 @@
 # now set up the synth
 self.runCmd("script from myIntSynthProvider import *")
 self.runCmd("type synth add -l myIntSynthProvider myInt")
+self.runCmd("type synth add -l myArraySynthProvider myArray")
 
 if self.TraceOn():
 print "x_val = %s; y_val = %s; z_val = %s" % (x_val(),y_val(),z_val())
@@ -85,6 +86,12 @@
 hi = self.frame().FindVariable("hi")
 self.assertEqual(hi.GetSummary(), "42")
 
+ma = self.frame().FindVariable("ma")
+self.assertTrue(ma.IsValid())
+self.assertEqual(ma.GetNumChildren(15), 15)
+self.assertEqual(ma.GetNumChildren(16), 16)
+self.assertEqual(ma.GetNumChildren(17), 16)
+
 if __name__ == '__main__':
 import atexit
 lldb.SBDebugger.Initialize()
Index: source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h
===
--- source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h
+++ source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h
@@ -73,7 +73,7 @@
const char *session_dictionary_name,
const lldb::ProcessSP& process_sp);
 
-typedef size_t  (*SWIGPythonCalculateNumChildren)   (void *implementor);
+typedef size_t  (*SWIGPythonCalculateNumChildren)   (void *implementor, uint32_t max);
 typedef void*   (*SWIGPythonGetChildAtIndex)   

Re: [Lldb-commits] [PATCH] D13881: Add domain socket support to gdb-remote protocol and lldb-server.

2015-10-20 Thread Oleksiy Vyalov via lldb-commits
ovyalov added a comment.

In http://reviews.llvm.org/D13881#270878, @labath wrote:

> I *think* it looks good, but I find it quite hard to review a change of this 
> size.
>  A wise man once said "if your commit description contains bullet points, you 
> are doing too much". I think it would be better to split up changes like this 
> in the future.
>
> > Make PlatformRemoteGDBServer to support retry-based connect - both for 
> > ConnectRemote and debug server connect. Since in case of domain sockets 
> > lldb-server doesn't write port into named pipe we cannot use it as a 
> > synchronization point - so it's possible that qLaunchGDBServer will be 
> > received by host before debug server is up and listens on socket.
>
>
> I would like to preserve the invariant that by the time a reply to 
> qLaunchGDBServer is received, the server is up and ready to serve 
> connections. How about we keep this file synchronization protocol even when 
> using domain sockets? The server could write nothing (or the socket path, or 
> whatever) to the file when it is up and ready. That way, we don't  have to 
> increase the number of places that do those silly wait-and-retry loops. What 
> do you think?


I was thinking about sending a full connect URL(instead of port) via pipe from 
debug server to platform/lldb host - so, it can be less transport type 
dependent. But there are some problems here - e.g., we cannot compose TCP 
connect URL properly on server side because only client knows a proper server's 
host address (if server is sitting behind proxies/firewalls/...). So, ended up 
with extending Acceptor with GetLocalSocketId method which returns a string 
either with TCP port or socket path so we can wait until debug server is up in 
either case.



Comment at: source/Plugins/Platform/Android/AdbClient.cpp:151
@@ +150,3 @@
+char message[PATH_MAX];
+snprintf (message, sizeof (message), "forward:tcp:%d;localfilesystem:%s", 
local_port, remote_socket_name);
+

I suspect adb fails in such situation.
Let me verify it once lldb-server/Acceptor will support protocol-based URL like 
unix:///tmp/platform.sock. Now it's somewhat problematic because we cannot pass 
colon as a part of
URL - if colon is found it's treated as $host:$port pattern and TCPSocket is 
created.


Comment at: source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h:227-228
@@ -226,7 +226,4 @@
 lldb::UnixSignalsSP m_remote_signals_sp;
 
-// Launch the lldb-gdbserver on the remote host and return the port it is 
listening on or 0 on
-// failure. Subclasses should override this method if they want to do 
extra actions before or
-// after launching the lldb-gdbserver.
-virtual uint16_t
-LaunchGDBserverAndGetPort (lldb::pid_t &pid);
+// Launch the debug server on the remote host - caller connects to launched
+// debug server using connect_url.

Done.


http://reviews.llvm.org/D13881



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] New llvm build server account request

2015-10-20 Thread Ying Chen via lldb-commits
Hello Kamil, Galina,

If you would like to build LLDB with cmake and ninja, I suggest to consider
the following two factory functions.
Depends on what you described, I feel the first one works better for you.

1. getLLDBUbuntuCMakeBuildFactory
If you only run local lldb tests, this is the factory to use.

For example, if you would like to build host lldb with clang and Release
config, and run tests with clang on x86_64 host,
then call the function this way,

getLLDBUbuntuCMakeBuildFactory(build_compiler = "clang",
   build_type = "Release",
   local_test_archs=["x86_64"],
   local_test_compilers=["clang"])
If you would like to run local tests with gcc compiler as well, then pass
local_test_compilers=["clang", "gcc"]

Dependency: You need to have the required packages to build lldb.

Note*: please disable the last step in this function
"archiveLLDBTestTraces", this steps will upload the log files to a cloud
storage that you might not have access to.

2. getLLDBScriptCommandsFactory

If you have multiple targets to run tests against, for example, remote
linux, remote android targets and etc, you should choose this factory.
The advantage of this factory is that it calls a script in each step, so
it's highly configurable and easy to make changes.
You just need to make sure the scripts are in builder machine and have the
correct commands.
For your reference, the ones that we're currently using could be found here.
https://android.googlesource.com/platform/external/lldb-utils/+/lldb-master-dev/buildbotScripts/bashShell/svntotbuild/
updateScript as the first step, is just copy the scripts to local builders.

Please let me know if you have further questions.

Thanks,
Ying


On Tue, Oct 20, 2015 at 1:46 PM, Kamil Rytarowski  wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Hello Ying,
>
> I'm in trouble with my attempts to connect my NetBSD/amd64 machine to
> the LLDB/LLVM build zone.
>
> My host is NetBSD-7.0 (with buildslave ID: lldb-amd64-ninja-netbsd7).
> I use pkgsrc (2015Q3) to ship packages. I'm attaching a list of
> installed ones to this mail.
>
> I talked with Joerg and it was decided to go for CMake and Ninja, we
> don't want to change it for now (at least till single machine will be
> plugged in).
>
> Please try to spawn local NetBSD session and connect to the staging
> buildbot and debug it locally, to cut the number of iterations between
> me and the Galina.
>
> I'm adding here a short tutorial to get to reproduce quickly the setup
> of mine. It will take you like 2-5 minutes to get into installed
> system (depends of an internet connection).
>
> 1. Prepare a disk image.
> $ qemu-img create -f qcow2 netbsd7.0_amd64 10G
>
> 2. Get an installation media.
> $ $FETCH_TOOL
> ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-7.0/amd64/installation/cdrom/boot
> - -com.iso
>
> 3. Spawn installation
> $ qemu-system-x86_64 \
> -enable-kvm \
> -net user \
> -m 2G \
> -cdrom boot-com.iso \
> -nographic \
> -smp cores=2 \
> -hda netbsd7.0_amd64 \
> -boot d
>
> 4. Inside the installer push ctrl-c and get the command line.
>
> 5. Setup network connection:
> # dhcpcd
>
> 6. Go to a writable dir, like /tmp
> # cd /tmp
>
> 7. Fetch the autoinst.sh script of mine
> # ftp ftp://ftp.netbsd.org/pub/NetBSD/misc/kamil/autoinst.sh
>
> # sh autoinst.sh -s 128 -r mypass -c com0 -C 9600 -p wd0
>
> (take a coffee break)
>
> 8. If everything went OK, just type:
> # poweroff
>
> 9. Start your newly installed system
> qemu-system-x86_64 \
> -enable-kvm \
> -net user \
> -m 2G \
> -nographic \
> -smp cores=2 \
> -hda netbsd7.0_amd64 \
> -boot c
> (root password is empty)
>
> 10. Install dependencies from pkgsrc, like:
> # cd /usr/pkgsrc/devel/cmake && make install
>
> Please install packags needed for buildslave, create dedicated user
> and try to connect it to the salve.
>
> Thank you in advance,
>
> On 20.10.2015 21:40, Galina Kistanova wrote:
> > Hello Kamil,
> >
> > It looks like you are missing dependencies for the LLDB builder
> > you have chosen.
> > http://lab.llvm.org:8014/builders/lldb-amd64-ninja-netbsd7/builds/75/s
> teps/update%20scripts/logs/stdio
> >
> >
> >
> The getLLDBScriptCommandsFactory build factory does not document
> > the assumed dependency, so you may want to contact Ying Chen, who
> > is the author for the complete list of dependencies.
> >
> > Another thing you may want to do is to reconsider the builder you
> > want to use. Maybe LLDBBuilder.getLLDBBuildFactory would work
> > better for you, though it requires autoconfig and make.
> >
> > I'm adding the LLDB mail list in case somebody has an idea of what
> > would be the easiest way to get the NetBSD builder for LLDB up and
> > running.
> >
> > Hello everyone,
> >
> > Kamil is on the mission of getting LLDB builder for NetBSDwhich
> > woul

Re: [Lldb-commits] New llvm build server account request

2015-10-20 Thread Kamil Rytarowski via lldb-commits
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Where can I find this updateScripts.sh? It's missing under your link:

https://android.googlesource.com/platform/external/lldb-utils/+/lldb-mas
ter-dev/buildbotScripts/bashShell/svntotbuild/

On 21.10.2015 00:29, Ying Chen wrote:
> Hello Kamil, Galina,
> 
> If you would like to build LLDB with cmake and ninja, I suggest to 
> consider the following two factory functions. Depends on what you
> described, I feel the first one works better for you.
> 
> 1. getLLDBUbuntuCMakeBuildFactory If you only run local lldb tests,
> this is the factory to use.
> 
> For example, if you would like to build host lldb with clang and
> Release config, and run tests with clang on x86_64 host, then call
> the function this way,
> 
> getLLDBUbuntuCMakeBuildFactory(build_compiler = "clang", build_type
> = "Release", local_test_archs=["x86_64"], 
> local_test_compilers=["clang"]) If you would like to run local
> tests with gcc compiler as well, then pass
> local_test_compilers=["clang", "gcc"]
> 
> Dependency: You need to have the required packages to build lldb.
> 
> Note*: please disable the last step in this function 
> "archiveLLDBTestTraces", this steps will upload the log files to a
> cloud storage that you might not have access to.
> 
> 2. getLLDBScriptCommandsFactory
> 
> If you have multiple targets to run tests against, for example,
> remote linux, remote android targets and etc, you should choose
> this factory. The advantage of this factory is that it calls a
> script in each step, so it's highly configurable and easy to make
> changes. You just need to make sure the scripts are in builder
> machine and have the correct commands. For your reference, the ones
> that we're currently using could be found here. 
> https://android.googlesource.com/platform/external/lldb-utils/+/lldb-m
aster-dev/buildbotScripts/bashShell/svntotbuild/
>
> 
updateScript as the first step, is just copy the scripts to local builde
rs.
> 
> Please let me know if you have further questions.
> 
> Thanks, Ying
> 
> 
> On Tue, Oct 20, 2015 at 1:46 PM, Kamil Rytarowski  > wrote:
> 
> Hello Ying,
> 
> I'm in trouble with my attempts to connect my NetBSD/amd64 machine
> to the LLDB/LLVM build zone.
> 
> My host is NetBSD-7.0 (with buildslave ID:
> lldb-amd64-ninja-netbsd7). I use pkgsrc (2015Q3) to ship packages.
> I'm attaching a list of installed ones to this mail.
> 
> I talked with Joerg and it was decided to go for CMake and Ninja,
> we don't want to change it for now (at least till single machine
> will be plugged in).
> 
> Please try to spawn local NetBSD session and connect to the
> staging buildbot and debug it locally, to cut the number of
> iterations between me and the Galina.
> 
> I'm adding here a short tutorial to get to reproduce quickly the
> setup of mine. It will take you like 2-5 minutes to get into
> installed system (depends of an internet connection).
> 
> 1. Prepare a disk image. $ qemu-img create -f qcow2 netbsd7.0_amd64
> 10G
> 
> 2. Get an installation media. $ $FETCH_TOOL 
> ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-7.0/amd64/installation/cdrom/bo
ot
>
> 
- -com.iso
> 
> 3. Spawn installation $ qemu-system-x86_64 \ -enable-kvm \ -net
> user \ -m 2G \ -cdrom boot-com.iso \ -nographic \ -smp cores=2 \ 
> -hda netbsd7.0_amd64 \ -boot d
> 
> 4. Inside the installer push ctrl-c and get the command line.
> 
> 5. Setup network connection: # dhcpcd
> 
> 6. Go to a writable dir, like /tmp # cd /tmp
> 
> 7. Fetch the autoinst.sh script of mine # ftp
> ftp://ftp.netbsd.org/pub/NetBSD/misc/kamil/autoinst.sh
> 
> # sh autoinst.sh -s 128 -r mypass -c com0 -C 9600 -p wd0
> 
> (take a coffee break)
> 
> 8. If everything went OK, just type: # poweroff
> 
> 9. Start your newly installed system qemu-system-x86_64 \ 
> -enable-kvm \ -net user \ -m 2G \ -nographic \ -smp cores=2 \ -hda
> netbsd7.0_amd64 \ -boot c (root password is empty)
> 
> 10. Install dependencies from pkgsrc, like: # cd
> /usr/pkgsrc/devel/cmake && make install
> 
> Please install packags needed for buildslave, create dedicated
> user and try to connect it to the salve.
> 
> Thank you in advance,
> 
> On 20.10.2015 21:40, Galina Kistanova wrote:
>> Hello Kamil,
> 
>> It looks like you are missing dependencies for the LLDB builder 
>> you have chosen. 
>> http://lab.llvm.org:8014/builders/lldb-amd64-ninja-netbsd7/builds/75/
s
>
>> 
teps/update%20scripts/logs/stdio
> 
> 
teps/update%20scripts/logs/stdio>
> 
> 
> 
> The getLLDBScriptCommandsFactory build factory does not document
>> the assumed dependency, so you may want to contact Ying Chen,
>> who is the author for the complete list of dependencies.
> 
>> Another thing you may want to do is to reconsider the builder
>> you want to use. Maybe LLDBBuilder.getLLDBBuildFactory would
>> work better for you, though it requires autoconfig and make.
> 
>> I'm adding the LLDB mail list in case s

Re: [Lldb-commits] New llvm build server account request

2015-10-20 Thread Ying Chen via lldb-commits
Please check again.
Please note that this file needs to be included in your PATH. The rest of
the scripts don't have to.
Sample of test configuration file could be found here.
https://android.googlesource.com/platform/external/lldb-utils/+/lldb-master-dev/buildbotScripts/testCfg/

On Tue, Oct 20, 2015 at 3:50 PM, Kamil Rytarowski  wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Where can I find this updateScripts.sh? It's missing under your link:
>
> https://android.googlesource.com/platform/external/lldb-utils/+/lldb-mas
> ter-dev/buildbotScripts/bashShell/svntotbuild/
>
> On 21.10.2015 00:29, Ying Chen wrote:
> > Hello Kamil, Galina,
> >
> > If you would like to build LLDB with cmake and ninja, I suggest to
> > consider the following two factory functions. Depends on what you
> > described, I feel the first one works better for you.
> >
> > 1. getLLDBUbuntuCMakeBuildFactory If you only run local lldb tests,
> > this is the factory to use.
> >
> > For example, if you would like to build host lldb with clang and
> > Release config, and run tests with clang on x86_64 host, then call
> > the function this way,
> >
> > getLLDBUbuntuCMakeBuildFactory(build_compiler = "clang", build_type
> > = "Release", local_test_archs=["x86_64"],
> > local_test_compilers=["clang"]) If you would like to run local
> > tests with gcc compiler as well, then pass
> > local_test_compilers=["clang", "gcc"]
> >
> > Dependency: You need to have the required packages to build lldb.
> >
> > Note*: please disable the last step in this function
> > "archiveLLDBTestTraces", this steps will upload the log files to a
> > cloud storage that you might not have access to.
> >
> > 2. getLLDBScriptCommandsFactory
> >
> > If you have multiple targets to run tests against, for example,
> > remote linux, remote android targets and etc, you should choose
> > this factory. The advantage of this factory is that it calls a
> > script in each step, so it's highly configurable and easy to make
> > changes. You just need to make sure the scripts are in builder
> > machine and have the correct commands. For your reference, the ones
> > that we're currently using could be found here.
> > https://android.googlesource.com/platform/external/lldb-utils/+/lldb-m
> aster-dev/buildbotScripts/bashShell/svntotbuild/
> >
> >
> updateScript as the first step, is just copy the scripts to local builde
> rs.
> >
> > Please let me know if you have further questions.
> >
> > Thanks, Ying
> >
> >
> > On Tue, Oct 20, 2015 at 1:46 PM, Kamil Rytarowski  > > wrote:
> >
> > Hello Ying,
> >
> > I'm in trouble with my attempts to connect my NetBSD/amd64 machine
> > to the LLDB/LLVM build zone.
> >
> > My host is NetBSD-7.0 (with buildslave ID:
> > lldb-amd64-ninja-netbsd7). I use pkgsrc (2015Q3) to ship packages.
> > I'm attaching a list of installed ones to this mail.
> >
> > I talked with Joerg and it was decided to go for CMake and Ninja,
> > we don't want to change it for now (at least till single machine
> > will be plugged in).
> >
> > Please try to spawn local NetBSD session and connect to the
> > staging buildbot and debug it locally, to cut the number of
> > iterations between me and the Galina.
> >
> > I'm adding here a short tutorial to get to reproduce quickly the
> > setup of mine. It will take you like 2-5 minutes to get into
> > installed system (depends of an internet connection).
> >
> > 1. Prepare a disk image. $ qemu-img create -f qcow2 netbsd7.0_amd64
> > 10G
> >
> > 2. Get an installation media. $ $FETCH_TOOL
> > ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-7.0/amd64/installation/cdrom/bo
> ot
> >
> >
> - -com.iso
> >
> > 3. Spawn installation $ qemu-system-x86_64 \ -enable-kvm \ -net
> > user \ -m 2G \ -cdrom boot-com.iso \ -nographic \ -smp cores=2 \
> > -hda netbsd7.0_amd64 \ -boot d
> >
> > 4. Inside the installer push ctrl-c and get the command line.
> >
> > 5. Setup network connection: # dhcpcd
> >
> > 6. Go to a writable dir, like /tmp # cd /tmp
> >
> > 7. Fetch the autoinst.sh script of mine # ftp
> > ftp://ftp.netbsd.org/pub/NetBSD/misc/kamil/autoinst.sh
> >
> > # sh autoinst.sh -s 128 -r mypass -c com0 -C 9600 -p wd0
> >
> > (take a coffee break)
> >
> > 8. If everything went OK, just type: # poweroff
> >
> > 9. Start your newly installed system qemu-system-x86_64 \
> > -enable-kvm \ -net user \ -m 2G \ -nographic \ -smp cores=2 \ -hda
> > netbsd7.0_amd64 \ -boot c (root password is empty)
> >
> > 10. Install dependencies from pkgsrc, like: # cd
> > /usr/pkgsrc/devel/cmake && make install
> >
> > Please install packags needed for buildslave, create dedicated
> > user and try to connect it to the salve.
> >
> > Thank you in advance,
> >
> > On 20.10.2015 21:40, Galina Kistanova wrote:
> >> Hello Kamil,
> >
> >> It looks like you are missing dependencies for the LLDB builder
> >> you have chosen.
> >> http://lab.llvm.org:8014/builders/lldb-amd64-ninja-netbsd7/builds/75/
> s
> >
> >>
> teps/update%20scripts/logs/stdio
> > 

[Lldb-commits] [PATCH] D13921: Use six to portably handle module renames

2015-10-20 Thread Zachary Turner via lldb-commits
zturner created this revision.
zturner added a reviewer: tfiala.
zturner added a subscriber: lldb-commits.

http://reviews.llvm.org/D13921

Files:
  test/api/check_public_api_headers/TestPublicAPIHeaders.py
  test/api/multiple-debuggers/TestMultipleDebuggers.py
  test/api/multithreaded/TestMultithreaded.py
  test/dosep.py
  test/dotest_channels.py
  test/functionalities/launch_with_shellexpand/TestLaunchWithShellExpand.py
  test/functionalities/paths/TestPaths.py
  test/functionalities/rerun/TestRerun.py
  test/functionalities/stop-hook/TestStopHookCmd.py
  test/lldbtest.py
  test/lldbutil.py
  test/python_api/frame/TestFrames.py
  test/test_results.py
  test/tools/lldb-server/lldbgdbserverutils.py
  test/tools/lldb-server/socket_packet_pump.py
  test/unittest2/result.py

Index: test/unittest2/result.py
===
--- test/unittest2/result.py
+++ test/unittest2/result.py
@@ -1,10 +1,12 @@
 """Test result object"""
 
+import lldb_shared
+
 import sys
 import traceback
 import unittest
 
-from StringIO import StringIO
+from six import StringIO as SixStringIO
 
 from unittest2 import util
 from unittest2.compatibility import wraps
@@ -61,8 +63,8 @@
 self._mirrorOutput = False
 if self.buffer:
 if self._stderr_buffer is None:
-self._stderr_buffer = StringIO()
-self._stdout_buffer = StringIO()
+self._stderr_buffer = SixStringIO()
+self._stdout_buffer = SixStringIO()
 sys.stdout = self._stdout_buffer
 sys.stderr = self._stderr_buffer
 
Index: test/tools/lldb-server/socket_packet_pump.py
===
--- test/tools/lldb-server/socket_packet_pump.py
+++ test/tools/lldb-server/socket_packet_pump.py
@@ -1,10 +1,14 @@
-import Queue
+
+import lldb_shared
+
 import re
 import select
 import threading
 import traceback
 import codecs
 
+from six.moves import queue
+
 def _handle_output_packet_string(packet_contents):
 if (not packet_contents) or (len(packet_contents) < 1):
 return None
@@ -38,8 +42,8 @@
 if not pump_socket:
 raise Exception("pump_socket cannot be None")
 
-self._output_queue = Queue.Queue()
-self._packet_queue = Queue.Queue()
+self._output_queue = queue.Queue()
+self._packet_queue = queue.Queue()
 self._thread = None
 self._stop_thread = False
 self._socket = pump_socket
Index: test/tools/lldb-server/lldbgdbserverutils.py
===
--- test/tools/lldb-server/lldbgdbserverutils.py
+++ test/tools/lldb-server/lldbgdbserverutils.py
@@ -1,16 +1,19 @@
 """Module for supporting unit testing of the lldb-server debug monitor exe.
 """
 
+import lldb_shared
+
 import os
 import os.path
 import platform
-import Queue
 import re
 import socket_packet_pump
 import subprocess
 import time
 from lldbtest import *
 
+from six.moves import queue
+
 def _get_debug_monitor_from_lldb(lldb_exe, debug_monitor_basename):
 """Return the debug monitor exe path given the lldb exe path.
 
@@ -215,14 +218,14 @@
 try:
 # Grab next entry from the output queue.
 content = pump.output_queue().get(True, timeout_seconds)
-except Queue.Empty:
+except queue.Empty:
 if logger:
 logger.warning("timeout waiting for stub output (accumulated output:{})".format(pump.get_accumulated_output()))
 raise Exception("timed out while waiting for output match (accumulated output: {})".format(pump.get_accumulated_output()))
 else:
 try:
 content = pump.packet_queue().get(True, timeout_seconds)
-except Queue.Empty:
+except queue.Empty:
 if logger:
 logger.warning("timeout waiting for packet match (receive buffer: {})".format(pump.get_receive_buffer()))
 raise Exception("timed out while waiting for packet match (receive buffer: {})".format(pump.get_receive_buffer()))
Index: test/test_results.py
===
--- test/test_results.py
+++ test/test_results.py
@@ -8,8 +8,9 @@
 within the LLDB test suite.
 """
 
+import lldb_shared
+
 import argparse
-import cPickle
 import inspect
 import os
 import pprint
@@ -20,6 +21,8 @@
 import traceback
 import xml.sax.saxutils
 
+from six.moves import cPickle
+
 
 class EventBuilder(object):
 """Helper class to build test result event dictionaries."""
Index: test/python_api/frame/TestFrames.py
===
--- test/python_api/frame/TestFrames.py
+++ test/python_api/frame/TestFrames.py

Re: [Lldb-commits] New llvm build server account request

2015-10-20 Thread Kamil Rytarowski via lldb-commits
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

It just appeared there.

I took your updateScripts.sh, moved it to my $PATH. Is it everything?

Will the rest of the scripts from
https://android.googlesource.com/platform/external/lldb-utils/+/lldb-mas
ter-dev/buildbotScripts/bashShell/svntotbuild/
be fetched/used automatically?

Do I need a local copy of it? If so, do I need to fetch the whole
directory
https://android.googlesource.com/platform/external/lldb-utils/+/lldb-mas
ter-dev/buildbotScripts
?

According to builders.py (
https://github.com/llvm-mirror/zorg/commit/c901503848e900fc1af0c43c93c98
daddd2f23fd
)

I use: 'factory':LLDBBuilder.getLLDBScriptCommandsFactory(runTest=False)
}

At the moment I don't want to run tests and leave it for later.

I restarted the build bot with the staging server and this is what I get
:
2015-10-20 23:43:33+ [-] Log opened.
2015-10-20 23:43:33+ [-] twistd 15.4.0 (/usr/pkg/bin/python2.7
2.7.10) starting up.
2015-10-20 23:43:33+ [-] reactor class:
twisted.internet.pollreactor.PollReactor.
2015-10-20 23:43:33+ [-] Starting BuildSlave -- version: 0.8.8
2015-10-20 23:43:33+ [-] recording hostname in twistd.hostname
2015-10-20 23:43:33+ [-] Starting factory

2015-10-20 23:43:33+ [-] Connecting to lab.llvm.org:9994
2015-10-20 23:43:34+ [Broker,client] message from master: attached
2015-10-20 23:43:35+ [Broker,client]
SlaveBuilder.remote_print(lldb-amd64-ninja-netbsd7): message from
master: attached
2015-10-20 23:43:35+ [Broker,client] Connected to
lab.llvm.org:9994; slave is ready
2015-10-20 23:43:35+ [Broker,client] sending application-level
keepalives every 600 seconds


How to enforce it to start a test build now? I want to check quickly
whether it works, not just send keepalives every 10 minutes..

Thank you in advance,


On 21.10.2015 01:17, Ying Chen wrote:
> Please check again. Please note that this file needs to be included
> in your PATH. The rest of the scripts don't have to. Sample of test
> configuration file could be found here. 
> https://android.googlesource.com/platform/external/lldb-utils/+/lldb-m
aster-dev/buildbotScripts/testCfg/
>
>  On Tue, Oct 20, 2015 at 3:50 PM, Kamil Rytarowski  > wrote:
> 
> Where can I find this updateScripts.sh? It's missing under your
> link:
> 
> https://android.googlesource.com/platform/external/lldb-utils/+/lldb-m
as
>
> 
ter-dev/buildbotScripts/bashShell/svntotbuild/
> 
> 
ter-dev/buildbotScripts/bashShell/svntotbuild/>
> 
> On 21.10.2015 00:29, Ying Chen wrote:
>> Hello Kamil, Galina,
> 
>> If you would like to build LLDB with cmake and ninja, I suggest
>> to consider the following two factory functions. Depends on what
>> you described, I feel the first one works better for you.
> 
>> 1. getLLDBUbuntuCMakeBuildFactory If you only run local lldb
>> tests, this is the factory to use.
> 
>> For example, if you would like to build host lldb with clang and 
>> Release config, and run tests with clang on x86_64 host, then
>> call the function this way,
> 
>> getLLDBUbuntuCMakeBuildFactory(build_compiler = "clang",
>> build_type = "Release", local_test_archs=["x86_64"], 
>> local_test_compilers=["clang"]) If you would like to run local 
>> tests with gcc compiler as well, then pass 
>> local_test_compilers=["clang", "gcc"]
> 
>> Dependency: You need to have the required packages to build
>> lldb.
> 
>> Note*: please disable the last step in this function 
>> "archiveLLDBTestTraces", this steps will upload the log files to
>> a cloud storage that you might not have access to.
> 
>> 2. getLLDBScriptCommandsFactory
> 
>> If you have multiple targets to run tests against, for example, 
>> remote linux, remote android targets and etc, you should choose 
>> this factory. The advantage of this factory is that it calls a 
>> script in each step, so it's highly configurable and easy to
>> make changes. You just need to make sure the scripts are in
>> builder machine and have the correct commands. For your
>> reference, the ones that we're currently using could be found
>> here. 
>> https://android.googlesource.com/platform/external/lldb-utils/+/lldb-
m
>
>> 
aster-dev/buildbotScripts/bashShell/svntotbuild/
> 
> 
aster-dev/buildbotScripts/bashShell/svntotbuild/>
> 
> 
> updateScript as the first step, is just copy the scripts to local
> builde rs.
> 
>> Please let me know if you have further questions.
> 
>> Thanks, Ying
> 
> 
>> On Tue, Oct 20, 2015 at 1:46 PM, Kamil Rytarowski  
>> >> wrote:
> 
>> Hello Ying,
> 
>> I'm in trouble with my attempts to connect my NetBSD/amd64
>> machine to the LLDB/LLVM build zone.
> 
>> My host is NetBSD-7.0 (with buildslave ID: 
>> lldb-amd64-ninja-netbsd7). I use pkgsrc (2015Q3) to ship
>> packages. I'm attaching a list of installed

Re: [Lldb-commits] [PATCH] D13778: [SBValue] Add a method GetNumChildren(uint32_t max)

2015-10-20 Thread Greg Clayton via lldb-commits
clayborg accepted this revision.
clayborg added a comment.

Accepted as long as Enrico is OK with this.


http://reviews.llvm.org/D13778



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D13778: [SBValue] Add a method GetNumChildren(uint32_t max)

2015-10-20 Thread Enrico Granata via lldb-commits
granata.enrico accepted this revision.
granata.enrico added a comment.
This revision is now accepted and ready to land.

Looks fine


http://reviews.llvm.org/D13778



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] New llvm build server account request

2015-10-20 Thread Ying Chen via lldb-commits
On Tue, Oct 20, 2015 at 4:46 PM, Kamil Rytarowski  wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> It just appeared there.
>
> I took your updateScripts.sh, moved it to my $PATH. Is it everything?


Please also put the test_cfg.json to this location,
/home/motus/build/build/. A dummy file is ok if you don't want to run any
test.



Will the rest of the scripts from
> https://android.googlesource.com/platform/external/lldb-utils/+/lldb-mas
> ter-dev/buildbotScripts/bashShell/svntotbuild/
> be fetched/used automatically?
>
> Do I need a local copy of it? If so, do I need to fetch the whole
> directory
> https://android.googlesource.com/platform/external/lldb-utils/+/lldb-mas
> ter-dev/buildbotScripts
> ?


You don't need a local copy of any of it. updateScripts.sh will fetch
everything automatically.



According to builders.py (
> https://github.com/llvm-mirror/zorg/commit/c901503848e900fc1af0c43c93c98
> daddd2f23fd
> )
>
> I use: 'factory':LLDBBuilder.getLLDBScriptCommandsFactory(runTest=False)
> }
>
>
Please also add "downloadBinary=False"

At the moment I don't want to run tests and leave it for later.
>
> I restarted the build bot with the staging server and this is what I get
> :
> 2015-10-20 23:43:33+ [-] Log opened.
> 2015-10-20 23:43:33+ [-] twistd 15.4.0 (/usr/pkg/bin/python2.7
> 2.7.10) starting up.
> 2015-10-20 23:43:33+ [-] reactor class:
> twisted.internet.pollreactor.PollReactor.
> 2015-10-20 23:43:33+ [-] Starting BuildSlave -- version: 0.8.8
> 2015-10-20 23:43:33+ [-] recording hostname in twistd.hostname
> 2015-10-20 23:43:33+ [-] Starting factory
> 
> 2015-10-20 23:43:33+ [-] Connecting to lab.llvm.org:9994
> 2015-10-20 23:43:34+ [Broker,client] message from master: attached
> 2015-10-20 23:43:35+ [Broker,client]
> SlaveBuilder.remote_print(lldb-amd64-ninja-netbsd7): message from
> master: attached
> 2015-10-20 23:43:35+ [Broker,client] Connected to
> lab.llvm.org:9994; slave is ready
> 2015-10-20 23:43:35+ [Broker,client] sending application-level
> keepalives every 600 seconds
>
>
> How to enforce it to start a test build now? I want to check quickly
> whether it works, not just send keepalives every 10 minutes..


Click force build button from this page to kick off a build right away.
http://lab.llvm.org:8014/builders/lldb-amd64-ninja-netbsd7


>

Thank you in advance,
>
>
> On 21.10.2015 01:17, Ying Chen wrote:
> > Please check again. Please note that this file needs to be included
> > in your PATH. The rest of the scripts don't have to. Sample of test
> > configuration file could be found here.
> > https://android.googlesource.com/platform/external/lldb-utils/+/lldb-m
> aster-dev/buildbotScripts/testCfg/
> >
> >  On Tue, Oct 20, 2015 at 3:50 PM, Kamil Rytarowski  > > wrote:
> >
> > Where can I find this updateScripts.sh? It's missing under your
> > link:
> >
> > https://android.googlesource.com/platform/external/lldb-utils/+/lldb-m
> as
> >
> >
> ter-dev/buildbotScripts/bashShell/svntotbuild/
> >  mas
> >
> >
> ter-dev/buildbotScripts/bashShell/svntotbuild/>
> >
> > On 21.10.2015 00:29, Ying Chen wrote:
> >> Hello Kamil, Galina,
> >
> >> If you would like to build LLDB with cmake and ninja, I suggest
> >> to consider the following two factory functions. Depends on what
> >> you described, I feel the first one works better for you.
> >
> >> 1. getLLDBUbuntuCMakeBuildFactory If you only run local lldb
> >> tests, this is the factory to use.
> >
> >> For example, if you would like to build host lldb with clang and
> >> Release config, and run tests with clang on x86_64 host, then
> >> call the function this way,
> >
> >> getLLDBUbuntuCMakeBuildFactory(build_compiler = "clang",
> >> build_type = "Release", local_test_archs=["x86_64"],
> >> local_test_compilers=["clang"]) If you would like to run local
> >> tests with gcc compiler as well, then pass
> >> local_test_compilers=["clang", "gcc"]
> >
> >> Dependency: You need to have the required packages to build
> >> lldb.
> >
> >> Note*: please disable the last step in this function
> >> "archiveLLDBTestTraces", this steps will upload the log files to
> >> a cloud storage that you might not have access to.
> >
> >> 2. getLLDBScriptCommandsFactory
> >
> >> If you have multiple targets to run tests against, for example,
> >> remote linux, remote android targets and etc, you should choose
> >> this factory. The advantage of this factory is that it calls a
> >> script in each step, so it's highly configurable and easy to
> >> make changes. You just need to make sure the scripts are in
> >> builder machine and have the correct commands. For your
> >> reference, the ones that we're currently using could be found
> >> here.
> >> https://android.googlesource.com/platform/external/lldb-utils/+/lldb-
> m
> >
> >>
> aster-dev/buildbotScripts/bashShell/svntotbuild/
> > 

Re: [Lldb-commits] New llvm build server account request

2015-10-20 Thread Kamil Rytarowski via lldb-commits
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

On 21.10.2015 02:03, Ying Chen wrote:
> 
> 
> On Tue, Oct 20, 2015 at 4:46 PM, Kamil Rytarowski  > wrote:
> 
> It just appeared there.
> 
> I took your updateScripts.sh, moved it to my $PATH. Is it
> everything?
> 
> 
>> Please also put the test_cfg.json to this location,
>> /home/motus/build/build/. A dummy file is ok if you don't want to
>> run any test.
> 

I added there a dummy literally empty file (of size 0) there.

> 
> 
> Will the rest of the scripts from 
> https://android.googlesource.com/platform/external/lldb-utils/+/lldb-m
as
>
> 
ter-dev/buildbotScripts/bashShell/svntotbuild/
> 
> 
ter-dev/buildbotScripts/bashShell/svntotbuild/>
> be fetched/used automatically?
> 
> Do I need a local copy of it? If so, do I need to fetch the whole 
> directory 
> https://android.googlesource.com/platform/external/lldb-utils/+/lldb-m
as
>
> 
ter-dev/buildbotScripts
> 
> 
ter-dev/buildbotScripts>
> ?
> 
> 
>> You don't need a local copy of any of it. updateScripts.sh will
>> fetch everything automatically.
> 

Thank you!

I also linked /bin/bash to /usr/pkg/bin/bash on my NetBSD host.

If there are some GNU tools used there, gawk please let me know.

> 
> 
> According to builders.py ( 
> https://github.com/llvm-mirror/zorg/commit/c901503848e900fc1af0c43c93c
98
>
> 
daddd2f23fd
> 
> 
daddd2f23fd>
> )
> 
> I use:
> 'factory':LLDBBuilder.getLLDBScriptCommandsFactory(runTest=False) 
> }
> 
> 
>> Please also add "downloadBinary=False"
> 

Please add this change there to the zorg repository and commit (I
don't have a commit bit).

> At the moment I don't want to run tests and leave it for later.
> 
> I restarted the build bot with the staging server and this is what
> I get : 2015-10-20 23:43:33+ [-] Log opened. 2015-10-20
> 23:43:33+ [-] twistd 15.4.0 (/usr/pkg/bin/python2.7 2.7.10)
> starting up. 2015-10-20 23:43:33+ [-] reactor class: 
> twisted.internet.pollreactor.PollReactor. 2015-10-20 23:43:33+
> [-] Starting BuildSlave -- version: 0.8.8 2015-10-20 23:43:33+
> [-] recording hostname in twistd.hostname 2015-10-20 23:43:33+
> [-] Starting factory  0x7f7ff53e0908> 2015-10-20 23:43:33+ [-] Connecting to
> lab.llvm.org:9994  2015-10-20
> 23:43:34+ [Broker,client] message from master: attached 
> 2015-10-20 23:43:35+ [Broker,client] 
> SlaveBuilder.remote_print(lldb-amd64-ninja-netbsd7): message from 
> master: attached 2015-10-20 23:43:35+ [Broker,client] Connected
> to lab.llvm.org:9994 ; slave is ready 
> 2015-10-20 23:43:35+ [Broker,client] sending application-level 
> keepalives every 600 seconds
> 
> 
> How to enforce it to start a test build now? I want to check
> quickly whether it works, not just send keepalives every 10
> minutes..
> 
> 
>> Click force build button from this page to kick off a build right
>> away. http://lab.llvm.org:8014/builders/lldb-amd64-ninja-netbsd7
> 

I will do, thank you!

> 
> 
> 
> Thank you in advance,
> 
> 
> On 21.10.2015 01:17, Ying Chen wrote:
>> Please check again. Please note that this file needs to be
>> included in your PATH. The rest of the scripts don't have to.
>> Sample of test configuration file could be found here. 
>> https://android.googlesource.com/platform/external/lldb-utils/+/lldb-
m
>
>> 
aster-dev/buildbotScripts/testCfg/
> 
> 
aster-dev/buildbotScripts/testCfg/>
> 
>> On Tue, Oct 20, 2015 at 3:50 PM, Kamil Rytarowski >  >>
>> wrote:
> 
>> Where can I find this updateScripts.sh? It's missing under your 
>> link:
> 
>> https://android.googlesource.com/platform/external/lldb-utils/+/lldb-
m
>
>> 
as
> 
> 
> ter-dev/buildbotScripts/bashShell/svntotbuild/
>> 
>> 
mas
> 
> 
> ter-dev/buildbotScripts/bashShell/svntotbuild/>
> 
>> On 21.10.2015 00:29, Ying Chen wrote:
>>> Hello Kamil, Galina,
> 
>>> If you would like to build LLDB with cmake and ninja, I
>>> suggest to consider the following two factory functions.
>>> Depends on what you described, I feel the first one works
>>> better for you.
> 
>>> 1. getLLDBUbuntuCMakeBuildFactory If you only run local lldb 
>>> tests, this is the factory to use.
> 
>>> For example, if you would like to build host lldb with clang
>>> and Release config, and run tests with clang on x86_64 host,
>>> then call the function this way,
> 
>>> getLLDBUbuntuCMakeBuildFactory(build_compiler = "clang", 
>>> build_type = "Release", local_test_archs=["x86_64"], 
>>> local_test_compilers=["clang"]) If you would like to run local 
>>> tests wit

[Lldb-commits] [lldb] r250869 - When target is NULL, provide a debugger so that REPLs can use that to create

2015-10-20 Thread Sean Callanan via lldb-commits
Author: spyffe
Date: Tue Oct 20 19:28:44 2015
New Revision: 250869

URL: http://llvm.org/viewvc/llvm-project?rev=250869&view=rev
Log:
When target is NULL, provide a debugger so that REPLs can use that to create
their own target.

Modified:
lldb/trunk/include/lldb/Expression/REPL.h
lldb/trunk/include/lldb/lldb-private-interfaces.h
lldb/trunk/source/Core/Debugger.cpp
lldb/trunk/source/Expression/REPL.cpp
lldb/trunk/source/Target/Target.cpp

Modified: lldb/trunk/include/lldb/Expression/REPL.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/REPL.h?rev=250869&r1=250868&r2=250869&view=diff
==
--- lldb/trunk/include/lldb/Expression/REPL.h (original)
+++ lldb/trunk/include/lldb/Expression/REPL.h Tue Oct 20 19:28:44 2015
@@ -38,7 +38,7 @@ public:
 virtual ~REPL();
 
 //--
-/// Get a REPL with an (optional) existing target, and (optional) extra 
arguments for the compiler.
+/// Get a REPL with an existing target (or, failing that, a debugger to 
use), and (optional) extra arguments for the compiler.
 ///
 /// @param[out] error
 /// If this language is supported but the REPL couldn't be created, 
this error is populated with the reason.
@@ -46,6 +46,9 @@ public:
 /// @param[in] language
 /// The language to create a REPL for.
 ///
+/// @param[in] debugger
+/// If provided, and target is NULL, the debugger to use when setting 
up a top-level REPL.
+///
 /// @param[in] target
 /// If provided, the target to put the REPL inside.
 ///
@@ -56,7 +59,7 @@ public:
 /// The range of the containing object in the target process.
 //--
 static lldb::REPLSP
-Create (Error &Error, lldb::LanguageType language, Target *target, const 
char *repl_options);
+Create (Error &Error, lldb::LanguageType language, Debugger *debugger, 
Target *target, const char *repl_options);
 
 void
 SetFormatOptions (const OptionGroupFormat &options)

Modified: lldb/trunk/include/lldb/lldb-private-interfaces.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-private-interfaces.h?rev=250869&r1=250868&r2=250869&view=diff
==
--- lldb/trunk/include/lldb/lldb-private-interfaces.h (original)
+++ lldb/trunk/include/lldb/lldb-private-interfaces.h Tue Oct 20 19:28:44 2015
@@ -49,7 +49,7 @@ namespace lldb_private
 typedef lldb::InstrumentationRuntimeType (*InstrumentationRuntimeGetType) 
();
 typedef lldb::InstrumentationRuntimeSP 
(*InstrumentationRuntimeCreateInstance) (const lldb::ProcessSP &process_sp);
 typedef lldb::TypeSystemSP (*TypeSystemCreateInstance) (lldb::LanguageType 
language, Module *module, Target *target);
-typedef lldb::REPLSP (*REPLCreateInstance) (Error &error, 
lldb::LanguageType language, Target *target, const char *repl_options);
+typedef lldb::REPLSP (*REPLCreateInstance) (Error &error, 
lldb::LanguageType language, Debugger *debugger, Target *target, const char 
*repl_options);
 typedef void (*TypeSystemEnumerateSupportedLanguages) 
(std::set &languages_for_types, 
std::set &languages_for_expressions);
 typedef int (*ComparisonFunction)(const void *, const void *);
 typedef void (*DebuggerInitializeCallback)(Debugger &debugger);

Modified: lldb/trunk/source/Core/Debugger.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Debugger.cpp?rev=250869&r1=250868&r2=250869&view=diff
==
--- lldb/trunk/source/Core/Debugger.cpp (original)
+++ lldb/trunk/source/Core/Debugger.cpp Tue Oct 20 19:28:44 2015
@@ -1813,7 +1813,7 @@ Debugger::RunREPL (LanguageType language
 
 Target *const target = nullptr; // passing in an empty target means the 
REPL must create one
 
-REPLSP repl_sp(REPL::Create(err, language, target, repl_options));
+REPLSP repl_sp(REPL::Create(err, language, this, target, repl_options));
 
 if (!err.Success())
 {

Modified: lldb/trunk/source/Expression/REPL.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/REPL.cpp?rev=250869&r1=250868&r2=250869&view=diff
==
--- lldb/trunk/source/Expression/REPL.cpp (original)
+++ lldb/trunk/source/Expression/REPL.cpp Tue Oct 20 19:28:44 2015
@@ -23,14 +23,14 @@
 using namespace lldb_private;
 
 lldb::REPLSP
-REPL::Create(Error &err, lldb::LanguageType language, Target *target, const 
char *repl_options)
+REPL::Create(Error &err, lldb::LanguageType language, Debugger *debugger, 
Target *target, const char *repl_options)
 {
 uint32_t idx = 0;
 lldb::REPLSP ret;
 
 while (REPLCreate

[Lldb-commits] [lldb] r250870 - When a REPL creates a new target for itself, it is that target's REPL.

2015-10-20 Thread Sean Callanan via lldb-commits
Author: spyffe
Date: Tue Oct 20 19:36:34 2015
New Revision: 250870

URL: http://llvm.org/viewvc/llvm-project?rev=250870&view=rev
Log:
When a REPL creates a new target for itself, it is that target's REPL.
To allow that, I've added a SetREPL call to the Target, which allows a REPL
that just created a target to install itself as the go-to REPL for the
corresponding language.

Modified:
lldb/trunk/include/lldb/Target/Target.h
lldb/trunk/source/Target/Target.cpp

Modified: lldb/trunk/include/lldb/Target/Target.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Target.h?rev=250870&r1=250869&r2=250870&view=diff
==
--- lldb/trunk/include/lldb/Target/Target.h (original)
+++ lldb/trunk/include/lldb/Target/Target.h Tue Oct 20 19:36:34 2015
@@ -1569,6 +1569,9 @@ public:
 
 lldb::REPLSP
 GetREPL (Error &err, lldb::LanguageType language, const char 
*repl_options, bool can_create);
+
+void
+SetREPL (lldb::LanguageType language, lldb::REPLSP repl_sp);
 
 protected:
 //--

Modified: lldb/trunk/source/Target/Target.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Target.cpp?rev=250870&r1=250869&r2=250870&view=diff
==
--- lldb/trunk/source/Target/Target.cpp (original)
+++ lldb/trunk/source/Target/Target.cpp Tue Oct 20 19:36:34 2015
@@ -56,6 +56,7 @@
 #include "lldb/Target/SystemRuntime.h"
 #include "lldb/Target/Thread.h"
 #include "lldb/Target/ThreadSpec.h"
+#include "lldb/Utility/LLDBAssert.h"
 
 using namespace lldb;
 using namespace lldb_private;
@@ -251,6 +252,14 @@ Target::GetREPL (Error &err, lldb::Langu
 }
 
 void
+Target::SetREPL (lldb::LanguageType language, lldb::REPLSP repl_sp)
+{
+lldbassert(!m_repl_map.count(language));
+
+m_repl_map[language] = repl_sp;
+}
+
+void
 Target::Destroy()
 {
 Mutex::Locker locker (m_mutex);


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D13923: Skip TestMultithread.py on Windows because it times out (and they'd fail anyway)

2015-10-20 Thread Adrian McCarthy via lldb-commits
amccarth created this revision.
amccarth added a reviewer: zturner.
amccarth added a subscriber: lldb-commits.

I'm not sure why this was timing out when running on my machine, since it took 
only 45 second for the tests to fail and the timeout seem to be set to 240 
seconds.

Simply skipping these cases wasn't enough because the inferior was being built 
12 times (once for each call to setUp).  So I moved the setUp work into the 
tests themselves.  Skipping stops wasting time building and rebuilding the 
inferiors.  It also seems to avoid the last lingering intermittent GNU Make 
crash.

Before going this route, I spent a lot of time trying to get the inferior to 
build on Windows.  I had to fix some POSIX assumptions in common.h and enable 
exceptions (which have been disabled on Windows because clang-cl exception 
support on Windows was lagging).  Enabling exceptions caused four other tests 
to fail, so we have that to look forward to.  And I wasn't able to figure out 
the linking problem where it complained that the -L option was ignored and then 
complained that it couldn't find liblldb.lib (because it ignored the -L option).

I'm open to other ideas, but this is the best way I can see to get unblocked.

http://reviews.llvm.org/D13923

Files:
  test/api/multithreaded/TestMultithreaded.py

Index: test/api/multithreaded/TestMultithreaded.py
===
--- test/api/multithreaded/TestMultithreaded.py
+++ test/api/multithreaded/TestMultithreaded.py
@@ -1,4 +1,4 @@
-"""Test the lldb public C++ api breakpoint callbacks.  """
+"""Test the lldb public C++ api breakpoint callbacks."""
 
 import os, re, StringIO
 import unittest2
@@ -10,41 +10,32 @@
 
 mydir = TestBase.compute_mydir(__file__)
 
-def setUp(self):
-TestBase.setUp(self)
-self.lib_dir = os.environ["LLDB_LIB_DIR"]
-self.implib_dir = os.environ["LLDB_IMPLIB_DIR"]
-self.inferior = 'inferior_program'
-if self.getLldbArchitecture() == self.getArchitecture():
-self.buildProgram('inferior.cpp', self.inferior)
-self.addTearDownHook(lambda: os.remove(self.inferior))
-
 @skipIfRemote
 @skipIfNoSBHeaders
+@skipIfWindows # clang-cl does not support throw or catch 
(llvm.org/pr24538)
 @expectedFailureAll("llvm.org/pr23139", oslist=["linux"], compiler="gcc", 
compiler_version=[">=","4.9"], archs=["x86_64"])
-@expectedFailureWindows("llvm.org/pr24538") # clang-cl does not support 
throw or catch
 def test_breakpoint_callback(self):
 """Test the that SBBreakpoint callback is invoked when a breakpoint is 
hit. """
 self.build_and_test('driver.cpp test_breakpoint_callback.cpp',
 'test_breakpoint_callback')
 
 @skipIfRemote
 @skipIfNoSBHeaders
+@skipIfWindows # clang-cl does not support throw or catch 
(llvm.org/pr24538)
 @expectedFlakeyFreeBSD
 @expectedFailureAll("llvm.org/pr23139", oslist=["linux"], compiler="gcc", 
compiler_version=[">=","4.9"], archs=["x86_64"])
-@expectedFailureWindows("llvm.org/pr24538") # clang-cl does not support 
throw or catch
 def test_sb_api_listener_event_description(self):
 """ Test the description of an SBListener breakpoint event is valid."""
 self.build_and_test('driver.cpp listener_test.cpp 
test_listener_event_description.cpp',
 'test_listener_event_description')
 pass
 
 @skipIfRemote
 @skipIfNoSBHeaders
+@skipIfWindows # clang-cl does not support throw or catch 
(llvm.org/pr24538)
 @expectedFlakeyFreeBSD
 @expectedFlakeyLinux # Driver occasionally returns '1' as exit status
 @expectedFailureAll("llvm.org/pr23139", oslist=["linux"], compiler="gcc", 
compiler_version=[">=","4.9"], archs=["x86_64"])
-@expectedFailureWindows("llvm.org/pr24538") # clang-cl does not support 
throw or catch
 def test_sb_api_listener_event_process_state(self):
 """ Test that a registered SBListener receives events when a process
 changes state.
@@ -56,9 +47,9 @@
 
 @skipIfRemote
 @skipIfNoSBHeaders
+@skipIfWindows # clang-cl does not support throw or catch 
(llvm.org/pr24538)
 @expectedFlakeyFreeBSD
 @expectedFailureAll("llvm.org/pr23139", oslist=["linux"], compiler="gcc", 
compiler_version=[">=","4.8"], archs=["x86_64"])
-@expectedFailureWindows("llvm.org/pr24538") # clang-cl does not support 
throw or catch
 def test_sb_api_listener_resume(self):
 """ Test that a process can be resumed from a non-main thread. """
 self.build_and_test('driver.cpp listener_test.cpp 
test_listener_resume.cpp',
@@ -75,6 +66,12 @@
 if self.getLldbArchitecture() != self.getArchitecture():
 self.skipTest("This test is only run if the target arch is the 
same as the lldb binary arch")
 
+self.lib_dir = os.environ["LLDB_LIB_DIR"]
+self.implib_dir = os.environ["LLDB_IMPLIB_DIR"

Re: [Lldb-commits] New llvm build server account request

2015-10-20 Thread Kamil Rytarowski via lldb-commits
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

http://lab.llvm.org:8014/builders/lldb-amd64-ninja-netbsd7/builds/90

cmake.sh is still wrong:

#!/bin/bash -e
set -x
host=$(uname)
if [[ $host != Linux ]];
then
  echo "Skip cmake step for" $host
else
  source setEnv.sh
  mkdir -p $buildDir
  cd $buildDir
  cmake -GNinja -DCMAKE_BUILD_TYPE=Release $llvmDir
- -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
fi


The uname result on NetBSD is 'NetBSD' and we need to use cmake. The
correct check is:

if [[ $host != Linux ]] && [[ $host != NetBSD ]]


I noticed also a check for ${OS} in
/home/motus/build/build/scripts/lldb-utils/build.sh

case "$(uname -s)" in
Linux)  OS=linux;;
Darwin) OS=darwin;;
*_NT-*) OS=windows;;
esac

There is need for NetBSD) OS=netbsd;; and new file build-netbsd.sh.

This is why, I suggested you to install NetBSD locally and adapt the
scripts for this system. Ping-pong overmails can take another 2 weeks.

On 21.10.2015 02:05, Kamil Rytarowski via lldb-commits wrote:
> On 21.10.2015 02:03, Ying Chen wrote:
> 
> 
>> On Tue, Oct 20, 2015 at 4:46 PM, Kamil Rytarowski > > wrote:
> 
>> It just appeared there.
> 
>> I took your updateScripts.sh, moved it to my $PATH. Is it 
>> everything?
> 
> 
>>> Please also put the test_cfg.json to this location, 
>>> /home/motus/build/build/. A dummy file is ok if you don't want
>>> to run any test.
> 
> 
> I added there a dummy literally empty file (of size 0) there.
> 
> 
> 
>> Will the rest of the scripts from 
>> https://android.googlesource.com/platform/external/lldb-utils/+/lldb-
m
>
>> 
as
> 
> 
> ter-dev/buildbotScripts/bashShell/svntotbuild/
>> 
>> 
mas
> 
> 
> ter-dev/buildbotScripts/bashShell/svntotbuild/>
>> be fetched/used automatically?
> 
>> Do I need a local copy of it? If so, do I need to fetch the whole
>>  directory 
>> https://android.googlesource.com/platform/external/lldb-utils/+/lldb-
m
>
>> 
as
> 
> 
> ter-dev/buildbotScripts
>> 
>> 
mas
> 
> 
> ter-dev/buildbotScripts>
>> ?
> 
> 
>>> You don't need a local copy of any of it. updateScripts.sh
>>> will fetch everything automatically.
> 
> 
> Thank you!
> 
> I also linked /bin/bash to /usr/pkg/bin/bash on my NetBSD host.
> 
> If there are some GNU tools used there, gawk please let me know.
> 
> 
> 
>> According to builders.py ( 
>> https://github.com/llvm-mirror/zorg/commit/c901503848e900fc1af0c43c93
c
>
>> 
98
> 
> 
> daddd2f23fd
>> 
>> 
c98
> 
> 
> daddd2f23fd>
>> )
> 
>> I use: 
>> 'factory':LLDBBuilder.getLLDBScriptCommandsFactory(runTest=False)
>>  }
> 
> 
>>> Please also add "downloadBinary=False"
> 
> 
> Please add this change there to the zorg repository and commit (I 
> don't have a commit bit).
> 
>> At the moment I don't want to run tests and leave it for later.
> 
>> I restarted the build bot with the staging server and this is
>> what I get : 2015-10-20 23:43:33+ [-] Log opened. 2015-10-20 
>> 23:43:33+ [-] twistd 15.4.0 (/usr/pkg/bin/python2.7 2.7.10) 
>> starting up. 2015-10-20 23:43:33+ [-] reactor class: 
>> twisted.internet.pollreactor.PollReactor. 2015-10-20
>> 23:43:33+ [-] Starting BuildSlave -- version: 0.8.8
>> 2015-10-20 23:43:33+ [-] recording hostname in
>> twistd.hostname 2015-10-20 23:43:33+ [-] Starting factory
>>  2015-10-20
>> 23:43:33+ [-] Connecting to lab.llvm.org:9994
>>  2015-10-20 23:43:34+
>> [Broker,client] message from master: attached 2015-10-20
>> 23:43:35+ [Broker,client] 
>> SlaveBuilder.remote_print(lldb-amd64-ninja-netbsd7): message from
>>  master: attached 2015-10-20 23:43:35+ [Broker,client]
>> Connected to lab.llvm.org:9994 ; slave
>> is ready 2015-10-20 23:43:35+ [Broker,client] sending
>> application-level keepalives every 600 seconds
> 
> 
>> How to enforce it to start a test build now? I want to check 
>> quickly whether it works, not just send keepalives every 10 
>> minutes..
> 
> 
>>> Click force build button from this page to kick off a build
>>> right away.
>>> http://lab.llvm.org:8014/builders/lldb-amd64-ninja-netbsd7
> 
> 
> I will do, thank you!
> 
> 
> 
> 
>> Thank you in advance,
> 
> 
>> On 21.10.2015 01:17, Ying Chen wrote:
>>> Please check again. Please note that this file needs to be 
>>> included in your PATH. The rest of the scripts don't have to. 
>>> Sample of test configuration file could be found here. 
>>> https://android.googlesource.com/platform/external/lldb-utils/+/lldb
- -
>
>>> 
m
> 
>>> 
> aster-dev/buildbotScripts/testCfg/
>> 
>> 
m
> 
> 
> aster-dev/buildbotScripts/testCfg/>
> 
>>> On Tue, Oct 20, 2015 at 3:50 PM, Kamil Rytarowski >>  

[Lldb-commits] [lldb] r250872 - Fix Clang-tidy modernize-use-override warnings in some files in source/Plugins; other minor fixes.

2015-10-20 Thread Eugene Zelenko via lldb-commits
Author: eugenezelenko
Date: Tue Oct 20 20:03:30 2015
New Revision: 250872

URL: http://llvm.org/viewvc/llvm-project?rev=250872&view=rev
Log:
Fix Clang-tidy modernize-use-override warnings in some files in source/Plugins; 
other minor fixes.

Differential Revision: http://reviews.llvm.org/D13916

Modified:
lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h

lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h

lldb/trunk/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.h

lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h
lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h
lldb/trunk/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.h

lldb/trunk/source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.h
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.h
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h
lldb/trunk/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.h
lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h

lldb/trunk/source/Plugins/InstrumentationRuntime/AddressSanitizer/AddressSanitizerRuntime.h

Modified: lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp?rev=250872&r1=250871&r2=250872&view=diff
==
--- lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp (original)
+++ lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp Tue Oct 
20 20:03:30 2015
@@ -7,8 +7,9 @@
 //
 
//===--===//
 
-#include "DisassemblerLLVMC.h"
-
+// C Includes
+// C++ Includes
+// Project includes
 #include "llvm-c/Disassembler.h"
 #include "llvm/MC/MCAsmInfo.h"
 #include "llvm/MC/MCContext.h"
@@ -25,6 +26,8 @@
 #include "llvm/Support/TargetSelect.h"
 #include "llvm/ADT/SmallString.h"
 
+// Other libraries and framework includes
+#include "DisassemblerLLVMC.h"
 
 #include "lldb/Core/Address.h"
 #include "lldb/Core/DataExtractor.h"
@@ -58,13 +61,10 @@ public:
 {
 }
 
-virtual
-~InstructionLLVMC ()
-{
-}
+~InstructionLLVMC() override = default;
 
-virtual bool
-DoesBranch ()
+bool
+DoesBranch() override
 {
 if (m_does_branch == eLazyBoolCalculate)
 {
@@ -100,8 +100,8 @@ public:
 return m_does_branch == eLazyBoolYes;
 }
 
-virtual bool
-HasDelaySlot ()
+bool
+HasDelaySlot() override
 {
 if (m_has_delay_slot == eLazyBoolCalculate)
 {
@@ -155,10 +155,10 @@ public:
 return llvm_disasm.m_disasm_ap.get();
 }
 
-virtual size_t
-Decode (const lldb_private::Disassembler &disassembler,
-const lldb_private::DataExtractor &data,
-lldb::offset_t data_offset)
+size_t
+Decode(const lldb_private::Disassembler &disassembler,
+   const lldb_private::DataExtractor &data,
+   lldb::offset_t data_offset) override
 {
 // All we have to do is read the opcode which can be easy for some
 // architectures
@@ -272,8 +272,8 @@ public:
 }
 }
 
-virtual void
-CalculateMnemonicOperandsAndComment (const lldb_private::ExecutionContext 
*exe_ctx)
+void
+CalculateMnemonicOperandsAndComment(const lldb_private::ExecutionContext 
*exe_ctx) override
 {
 DataExtractor data;
 const AddressClass address_class = GetAddressClass ();
@@ -452,8 +452,6 @@ protected:
 boolm_using_file_addr;
 };
 
-
-
 DisassemblerLLVMC::LLVMCDisassembler::LLVMCDisassembler (const char *triple, 
const char *cpu, const char *features_str, unsigned flavor, DisassemblerLLVMC 
&owner):
 m_is_valid(true)
 {
@@ -521,10 +519,6 @@ DisassemblerLLVMC::LLVMCDisassembler::LL
 m_is_valid = false;
 }
 
-DisassemblerLLVMC::LLVMCDisassembler::~LLVMCDisassembler()
-{
-}
-
 uint64_t
 DisassemblerLLVMC::LLVMCDisassembler::GetMCInst (const uint8_t *opcode_data,
  size_t opcode_data_len,
@@ -605,7 +599,6 @@ DisassemblerLLVMC::FlavorValidForArchSpe
 return false;
 }
 
-
 Disassembler *
 DisassemblerLLVMC::CreateInstance (const ArchSpec &arch, const char *flavor)
 {
@@ -782,10 +775,6 @@ DisassemblerLLVMC::DisassemblerLLVMC (co
 }
 }
 
-DisassemblerLLVMC::~DisassemblerLLVMC()
-{
-}
-
 size_t
 DisassemblerLLVMC::DecodeInstructions (const Address &ba

Re: [Lldb-commits] [PATCH] D13916: [LLDB] Fix Clang-tidy modernize-use-override warnings in some files in source/Plugins; other minor fixes.

2015-10-20 Thread Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL250872: Fix Clang-tidy modernize-use-override warnings in 
some files in… (authored by eugenezelenko).

Changed prior to commit:
  http://reviews.llvm.org/D13916?vs=37922&id=37956#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D13916

Files:
  lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
  lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h
  
lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h
  
lldb/trunk/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.h
  lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h
  lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h
  lldb/trunk/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.h
  
lldb/trunk/source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.h
  lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
  lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.h
  lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp
  lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h
  lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h
  lldb/trunk/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.h
  lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h
  
lldb/trunk/source/Plugins/InstrumentationRuntime/AddressSanitizer/AddressSanitizerRuntime.h

Index: lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h
===
--- lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h
+++ lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h
@@ -1,4 +1,4 @@
-//===-- EmulateInstructionMIPS64.h *- C++ -*-===//
+//===-- EmulateInstructionMIPS64.h --*- C++ -*-===//
 //
 // The LLVM Compiler Infrastructure
 //
@@ -10,6 +10,14 @@
 #ifndef EmulateInstructionMIPS64_h_
 #define EmulateInstructionMIPS64_h_
 
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+#include "lldb/Core/EmulateInstruction.h"
+#include "lldb/Core/Error.h"
+#include "lldb/Interpreter/OptionValue.h"
+
 namespace llvm
 {
 class MCDisassembler;
@@ -19,15 +27,13 @@
 class MCContext;
 class MCInstrInfo;
 class MCInst;
-}
-
-#include "lldb/Core/EmulateInstruction.h"
-#include "lldb/Core/Error.h"
-#include "lldb/Interpreter/OptionValue.h"
+} // namespace llvm
 
 class EmulateInstructionMIPS64 : public lldb_private::EmulateInstruction
 {
 public: 
+EmulateInstructionMIPS64(const lldb_private::ArchSpec &arch);
+
 static void
 Initialize ();
 
@@ -60,51 +66,47 @@
 return false;
 }
 
-virtual lldb_private::ConstString
-GetPluginName();
+lldb_private::ConstString
+GetPluginName() override;
 
-virtual uint32_t
-GetPluginVersion()
+uint32_t
+GetPluginVersion() override
 {
 return 1;
 }
 
 bool
-SetTargetTriple (const lldb_private::ArchSpec &arch);
+SetTargetTriple(const lldb_private::ArchSpec &arch) override;
 
-EmulateInstructionMIPS64 (const lldb_private::ArchSpec &arch);
-
-virtual bool
-SupportsEmulatingInstructionsOfType (lldb_private::InstructionType inst_type)
+bool
+SupportsEmulatingInstructionsOfType(lldb_private::InstructionType inst_type) override
 {
 return SupportsEmulatingInstructionsOfTypeStatic (inst_type);
 }
 
-virtual bool 
-ReadInstruction ();
+bool
+ReadInstruction() override;
 
-virtual bool
-EvaluateInstruction (uint32_t evaluate_options);
+bool
+EvaluateInstruction(uint32_t evaluate_options) override;
 
-virtual bool
-TestEmulation (lldb_private::Stream *out_stream, 
-   lldb_private::ArchSpec &arch, 
-   lldb_private::OptionValueDictionary *test_data)
+bool
+TestEmulation(lldb_private::Stream *out_stream,
+  lldb_private::ArchSpec &arch,
+  lldb_private::OptionValueDictionary *test_data) override
 {
 return false;
 }
 
-virtual bool
-GetRegisterInfo (lldb::RegisterKind reg_kind,
- uint32_t reg_num, 
- lldb_private::RegisterInfo ®_info);
-
-virtual bool
-CreateFunctionEntryUnwind (lldb_private::UnwindPlan &unwind_plan);
+bool
+GetRegisterInfo(lldb::RegisterKind reg_kind,
+uint32_t reg_num,
+lldb_private::RegisterInfo ®_info) override;
 
+bool
+CreateFunctionEntryUnwind(lldb_private::UnwindPlan &unwind_plan) override;
 
 protected:
-
 typedef struct
 {
 const char *op_name;
@@ -346,4 +348,4 @@
 std::unique_

Re: [Lldb-commits] New llvm build server account request

2015-10-20 Thread Ying Chen via lldb-commits
Submitted the change,
http://reviews.llvm.org/rL250871

The problem you mentioned has been resolved.
But clang is missing from your system. You need to make sure the system is
able to build and test lldb. Follow this
http://lldb.llvm.org/build.html#BuildingLldbOnLinux.


On Tue, Oct 20, 2015 at 5:47 PM, Kamil Rytarowski  wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> http://lab.llvm.org:8014/builders/lldb-amd64-ninja-netbsd7/builds/90
>
> cmake.sh is still wrong:
>
> #!/bin/bash -e
> set -x
> host=$(uname)
> if [[ $host != Linux ]];
> then
>   echo "Skip cmake step for" $host
> else
>   source setEnv.sh
>   mkdir -p $buildDir
>   cd $buildDir
>   cmake -GNinja -DCMAKE_BUILD_TYPE=Release $llvmDir
> - -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
> fi
>
>
> The uname result on NetBSD is 'NetBSD' and we need to use cmake. The
> correct check is:
>
> if [[ $host != Linux ]] && [[ $host != NetBSD ]]
>
>
> I noticed also a check for ${OS} in
> /home/motus/build/build/scripts/lldb-utils/build.sh
>
> case "$(uname -s)" in
> Linux)  OS=linux;;
> Darwin) OS=darwin;;
> *_NT-*) OS=windows;;
> esac
>
> There is need for NetBSD) OS=netbsd;; and new file build-netbsd.sh.
>
> This is why, I suggested you to install NetBSD locally and adapt the
> scripts for this system. Ping-pong overmails can take another 2 weeks.
>
> On 21.10.2015 02:05, Kamil Rytarowski via lldb-commits wrote:
> > On 21.10.2015 02:03, Ying Chen wrote:
> >
> >
> >> On Tue, Oct 20, 2015 at 4:46 PM, Kamil Rytarowski  >> > wrote:
> >
> >> It just appeared there.
> >
> >> I took your updateScripts.sh, moved it to my $PATH. Is it
> >> everything?
> >
> >
> >>> Please also put the test_cfg.json to this location,
> >>> /home/motus/build/build/. A dummy file is ok if you don't want
> >>> to run any test.
> >
> >
> > I added there a dummy literally empty file (of size 0) there.
> >
> >
> >
> >> Will the rest of the scripts from
> >> https://android.googlesource.com/platform/external/lldb-utils/+/lldb-
> m
> >
> >>
> as
> >
> >
> > ter-dev/buildbotScripts/bashShell/svntotbuild/
> >>  - -
> >
> >>
> mas
> >
> >
> > ter-dev/buildbotScripts/bashShell/svntotbuild/>
> >> be fetched/used automatically?
> >
> >> Do I need a local copy of it? If so, do I need to fetch the whole
> >>  directory
> >> https://android.googlesource.com/platform/external/lldb-utils/+/lldb-
> m
> >
> >>
> as
> >
> >
> > ter-dev/buildbotScripts
> >>  - -
> >
> >>
> mas
> >
> >
> > ter-dev/buildbotScripts>
> >> ?
> >
> >
> >>> You don't need a local copy of any of it. updateScripts.sh
> >>> will fetch everything automatically.
> >
> >
> > Thank you!
> >
> > I also linked /bin/bash to /usr/pkg/bin/bash on my NetBSD host.
> >
> > If there are some GNU tools used there, gawk please let me know.
> >
> >
> >
> >> According to builders.py (
> >> https://github.com/llvm-mirror/zorg/commit/c901503848e900fc1af0c43c93
> c
> >
> >>
> 98
> >
> >
> > daddd2f23fd
> >>  3
> >
> >>
> c98
> >
> >
> > daddd2f23fd>
> >> )
> >
> >> I use:
> >> 'factory':LLDBBuilder.getLLDBScriptCommandsFactory(runTest=False)
> >>  }
> >
> >
> >>> Please also add "downloadBinary=False"
> >
> >
> > Please add this change there to the zorg repository and commit (I
> > don't have a commit bit).
> >
> >> At the moment I don't want to run tests and leave it for later.
> >
> >> I restarted the build bot with the staging server and this is
> >> what I get : 2015-10-20 23:43:33+ [-] Log opened. 2015-10-20
> >> 23:43:33+ [-] twistd 15.4.0 (/usr/pkg/bin/python2.7 2.7.10)
> >> starting up. 2015-10-20 23:43:33+ [-] reactor class:
> >> twisted.internet.pollreactor.PollReactor. 2015-10-20
> >> 23:43:33+ [-] Starting BuildSlave -- version: 0.8.8
> >> 2015-10-20 23:43:33+ [-] recording hostname in
> >> twistd.hostname 2015-10-20 23:43:33+ [-] Starting factory
> >>  2015-10-20
> >> 23:43:33+ [-] Connecting to lab.llvm.org:9994
> >>  2015-10-20 23:43:34+
> >> [Broker,client] message from master: attached 2015-10-20
> >> 23:43:35+ [Broker,client]
> >> SlaveBuilder.remote_print(lldb-amd64-ninja-netbsd7): message from
> >>  master: attached 2015-10-20 23:43:35+ [Broker,client]
> >> Connected to lab.llvm.org:9994 ; slave
> >> is ready 2015-10-20 23:43:35+ [Broker,client] sending
> >> application-level keepalives every 600 seconds
> >
> >
> >> How to enforce it to start a test build now? I want to check
> >> quickly whether it works, not just send keepalives every 10
> >> minutes..
> >
> >
> >>> Click force build button from this page to kick off a build
> >>> right away.
> >>> http://lab.llvm.org:8014/builders/lldb-amd64-ninja-netbsd7
> >
> >
> > I will do, thank you!
> >
> >
> >
> >

Re: [Lldb-commits] [PATCH] D13921: Use six to portably handle module renames

2015-10-20 Thread Todd Fiala via lldb-commits
tfiala accepted this revision.
tfiala added a comment.
This revision is now accepted and ready to land.

Looks good.


http://reviews.llvm.org/D13921



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] New llvm build server account request

2015-10-20 Thread Kamil Rytarowski via lldb-commits
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

My $CC/$CXX is GCC 4.8.5.

I have good reason for it - to not intermix system-wide and fetched
headers for llvm. In the past this was causing problems for me during
my lldb porting.

Please update my builder.py for using gcc.

On 21.10.2015 03:11, Ying Chen wrote:
> Submitted the change, http://reviews.llvm.org/rL250871
> 
> The problem you mentioned has been resolved. But clang is missing
> from your system. You need to make sure the system is able to build
> and test lldb. Follow this
> http://lldb.llvm.org/build.html#BuildingLldbOnLinux.
> 
> 
> On Tue, Oct 20, 2015 at 5:47 PM, Kamil Rytarowski  > wrote:
> 
> http://lab.llvm.org:8014/builders/lldb-amd64-ninja-netbsd7/builds/90
>
>  cmake.sh is still wrong:
> 
> #!/bin/bash -e set -x host=$(uname) if [[ $host != Linux ]]; then 
> echo "Skip cmake step for" $host else source setEnv.sh mkdir -p
> $buildDir cd $buildDir cmake -GNinja -DCMAKE_BUILD_TYPE=Release
> $llvmDir -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ fi
> 
> 
> The uname result on NetBSD is 'NetBSD' and we need to use cmake.
> The correct check is:
> 
> if [[ $host != Linux ]] && [[ $host != NetBSD ]]
> 
> 
> I noticed also a check for ${OS} in 
> /home/motus/build/build/scripts/lldb-utils/build.sh
> 
> case "$(uname -s)" in Linux)  OS=linux;; Darwin) OS=darwin;; 
> *_NT-*) OS=windows;; esac
> 
> There is need for NetBSD) OS=netbsd;; and new file
> build-netbsd.sh.
> 
> This is why, I suggested you to install NetBSD locally and adapt
> the scripts for this system. Ping-pong overmails can take another 2
> weeks.
> 
> On 21.10.2015 02:05, Kamil Rytarowski via lldb-commits wrote:
>> On 21.10.2015 02:03, Ying Chen wrote:
> 
> 
>>> On Tue, Oct 20, 2015 at 4:46 PM, Kamil Rytarowski >>  >>
>>> wrote:
> 
>>> It just appeared there.
> 
>>> I took your updateScripts.sh, moved it to my $PATH. Is it 
>>> everything?
> 
> 
 Please also put the test_cfg.json to this location, 
 /home/motus/build/build/. A dummy file is ok if you don't
 want to run any test.
> 
> 
>> I added there a dummy literally empty file (of size 0) there.
> 
> 
> 
>>> Will the rest of the scripts from 
>>> https://android.googlesource.com/platform/external/lldb-utils/+/lldb
- -
>
>>> 
m
> 
>>> 
> as
> 
> 
>> ter-dev/buildbotScripts/bashShell/svntotbuild/
>>> 
>>> 
- -
> 
>>> 
> mas
> 
> 
>> ter-dev/buildbotScripts/bashShell/svntotbuild/>
>>> be fetched/used automatically?
> 
>>> Do I need a local copy of it? If so, do I need to fetch the
>>> whole directory 
>>> https://android.googlesource.com/platform/external/lldb-utils/+/lldb
- -
>
>>> 
m
> 
>>> 
> as
> 
> 
>> ter-dev/buildbotScripts
>>> 
>>> 
- -
> 
>>> 
> mas
> 
> 
>> ter-dev/buildbotScripts>
>>> ?
> 
> 
 You don't need a local copy of any of it. updateScripts.sh 
 will fetch everything automatically.
> 
> 
>> Thank you!
> 
>> I also linked /bin/bash to /usr/pkg/bin/bash on my NetBSD host.
> 
>> If there are some GNU tools used there, gawk please let me know.
> 
> 
> 
>>> According to builders.py ( 
>>> https://github.com/llvm-mirror/zorg/commit/c901503848e900fc1af0c43c9
3
>
>>> 
c
> 
>>> 
> 98
> 
> 
>> daddd2f23fd
>>> 
>>> 
3
> 
>>> 
> c98
> 
> 
>> daddd2f23fd>
>>> )
> 
>>> I use: 
>>> 'factory':LLDBBuilder.getLLDBScriptCommandsFactory(runTest=False)
>>>
>>> 
}
> 
> 
 Please also add "downloadBinary=False"
> 
> 
>> Please add this change there to the zorg repository and commit
>> (I don't have a commit bit).
> 
>>> At the moment I don't want to run tests and leave it for
>>> later.
> 
>>> I restarted the build bot with the staging server and this is 
>>> what I get : 2015-10-20 23:43:33+ [-] Log opened.
>>> 2015-10-20 23:43:33+ [-] twistd 15.4.0
>>> (/usr/pkg/bin/python2.7 2.7.10) starting up. 2015-10-20
>>> 23:43:33+ [-] reactor class: 
>>> twisted.internet.pollreactor.PollReactor. 2015-10-20 
>>> 23:43:33+ [-] Starting BuildSlave -- version: 0.8.8 
>>> 2015-10-20 23:43:33+ [-] recording hostname in 
>>> twistd.hostname 2015-10-20 23:43:33+ [-] Starting factory 
>>> 
>>> 2015-10-20 23:43:33+ [-] Connecting to lab.llvm.org:9994
> 
>>>  2015-10-20 23:43:34+ 
>>> [Broker,client] message from master: attached 2015-10-20 
>>> 23:43:35+ [Broker,client] 
>>> SlaveBuilder.remote_print(lldb-amd64-ninja-netbsd7): message
>>> from master: attached 2015-10-20 23:43:35+ [Broker,client] 
>>> Connected to lab.llvm.org:9994 
> ; slave
>>> is ready 2015-10-20 23:43:35+ [Broker,client] sending 
>>> application-level keepalives every 600 seconds
> 
> 
>>> How to enforce it to

[Lldb-commits] [lldb] r250874 - Revert r250872 in source/Plugins/Disassembler to fix MSVC builds failures.

2015-10-20 Thread Eugene Zelenko via lldb-commits
Author: eugenezelenko
Date: Tue Oct 20 20:42:15 2015
New Revision: 250874

URL: http://llvm.org/viewvc/llvm-project?rev=250874&view=rev
Log:
Revert r250872 in source/Plugins/Disassembler to fix MSVC builds failures.

Modified:
lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h

Modified: lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp?rev=250874&r1=250873&r2=250874&view=diff
==
--- lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp (original)
+++ lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp Tue Oct 
20 20:42:15 2015
@@ -7,9 +7,8 @@
 //
 
//===--===//
 
-// C Includes
-// C++ Includes
-// Project includes
+#include "DisassemblerLLVMC.h"
+
 #include "llvm-c/Disassembler.h"
 #include "llvm/MC/MCAsmInfo.h"
 #include "llvm/MC/MCContext.h"
@@ -26,8 +25,6 @@
 #include "llvm/Support/TargetSelect.h"
 #include "llvm/ADT/SmallString.h"
 
-// Other libraries and framework includes
-#include "DisassemblerLLVMC.h"
 
 #include "lldb/Core/Address.h"
 #include "lldb/Core/DataExtractor.h"
@@ -61,10 +58,13 @@ public:
 {
 }
 
-~InstructionLLVMC() override = default;
+virtual
+~InstructionLLVMC ()
+{
+}
 
-bool
-DoesBranch() override
+virtual bool
+DoesBranch ()
 {
 if (m_does_branch == eLazyBoolCalculate)
 {
@@ -100,8 +100,8 @@ public:
 return m_does_branch == eLazyBoolYes;
 }
 
-bool
-HasDelaySlot() override
+virtual bool
+HasDelaySlot ()
 {
 if (m_has_delay_slot == eLazyBoolCalculate)
 {
@@ -155,10 +155,10 @@ public:
 return llvm_disasm.m_disasm_ap.get();
 }
 
-size_t
-Decode(const lldb_private::Disassembler &disassembler,
-   const lldb_private::DataExtractor &data,
-   lldb::offset_t data_offset) override
+virtual size_t
+Decode (const lldb_private::Disassembler &disassembler,
+const lldb_private::DataExtractor &data,
+lldb::offset_t data_offset)
 {
 // All we have to do is read the opcode which can be easy for some
 // architectures
@@ -272,8 +272,8 @@ public:
 }
 }
 
-void
-CalculateMnemonicOperandsAndComment(const lldb_private::ExecutionContext 
*exe_ctx) override
+virtual void
+CalculateMnemonicOperandsAndComment (const lldb_private::ExecutionContext 
*exe_ctx)
 {
 DataExtractor data;
 const AddressClass address_class = GetAddressClass ();
@@ -452,6 +452,8 @@ protected:
 boolm_using_file_addr;
 };
 
+
+
 DisassemblerLLVMC::LLVMCDisassembler::LLVMCDisassembler (const char *triple, 
const char *cpu, const char *features_str, unsigned flavor, DisassemblerLLVMC 
&owner):
 m_is_valid(true)
 {
@@ -519,6 +521,10 @@ DisassemblerLLVMC::LLVMCDisassembler::LL
 m_is_valid = false;
 }
 
+DisassemblerLLVMC::LLVMCDisassembler::~LLVMCDisassembler()
+{
+}
+
 uint64_t
 DisassemblerLLVMC::LLVMCDisassembler::GetMCInst (const uint8_t *opcode_data,
  size_t opcode_data_len,
@@ -599,6 +605,7 @@ DisassemblerLLVMC::FlavorValidForArchSpe
 return false;
 }
 
+
 Disassembler *
 DisassemblerLLVMC::CreateInstance (const ArchSpec &arch, const char *flavor)
 {
@@ -775,6 +782,10 @@ DisassemblerLLVMC::DisassemblerLLVMC (co
 }
 }
 
+DisassemblerLLVMC::~DisassemblerLLVMC()
+{
+}
+
 size_t
 DisassemblerLLVMC::DecodeInstructions (const Address &base_addr,
const DataExtractor& data,

Modified: lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h?rev=250874&r1=250873&r2=250874&view=diff
==
--- lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h (original)
+++ lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h Tue Oct 20 
20:42:15 2015
@@ -10,19 +10,10 @@
 #ifndef liblldb_DisassemblerLLVMC_h_
 #define liblldb_DisassemblerLLVMC_h_
 
-// C Includes
-// C++ Includes
 #include 
 
-// Other libraries and framework includes
 #include "llvm-c/Disassembler.h"
 
-// Project includes
-#include "lldb/Core/Address.h"
-#include "lldb/Core/Disassembler.h"
-#include "lldb/Core/PluginManager.h"
-#include "lldb/Host/Mutex.h"
-
 // Opaque references to C++ Objects in LLVM's MC.
 namespace llvm
 {
@@ -34,7 +25,12 @@ namespace llvm
 class MCInstPrinter;
 class MCAsmInfo;
 class MCSubtargetInfo;
-} // namespace llvm
+}
+
+#include "lldb/Core/Address.h"
+#include "lldb/Core/Disassembler.h"
+#

Re: [Lldb-commits] New llvm build server account request

2015-10-20 Thread Kamil Rytarowski via lldb-commits
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Please update the documentation from
http://lldb.llvm.org/build.html#BuildingLldbOnLinux. and add an entry
for NetBSD:

On NetBSD one might run:
> pkgin install swig python27

Regarding the cmake issue, I suggest to add this change to cmake.sh:

if [[ $host == NetBSD ]]; then
  cmake -GNinja -DCMAKE_BUILD_TYPE=Release $llvmDir
- -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++
else
  cmake -GNinja -DCMAKE_BUILD_TYPE=Release $llvmDir
- -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
endif


Additionally please replace all shebangs '/bin/bash' to /usr/bin/env
bash' it will be more portable and I will drop my /bin/bash linkage.

Thank you in advance,

On 21.10.2015 03:23, Kamil Rytarowski via lldb-commits wrote:
> My $CC/$CXX is GCC 4.8.5.
> 
> I have good reason for it - to not intermix system-wide and
> fetched headers for llvm. In the past this was causing problems for
> me during my lldb porting.
> 
> Please update my builder.py for using gcc.
> 
> On 21.10.2015 03:11, Ying Chen wrote:
>> Submitted the change, http://reviews.llvm.org/rL250871
> 
>> The problem you mentioned has been resolved. But clang is
>> missing from your system. You need to make sure the system is
>> able to build and test lldb. Follow this 
>> http://lldb.llvm.org/build.html#BuildingLldbOnLinux.
> 
> 
>> On Tue, Oct 20, 2015 at 5:47 PM, Kamil Rytarowski > > wrote:
> 
>> http://lab.llvm.org:8014/builders/lldb-amd64-ninja-netbsd7/builds/90
>
>>  cmake.sh is still wrong:
> 
>> #!/bin/bash -e set -x host=$(uname) if [[ $host != Linux ]]; then
>>  echo "Skip cmake step for" $host else source setEnv.sh mkdir -p 
>> $buildDir cd $buildDir cmake -GNinja -DCMAKE_BUILD_TYPE=Release 
>> $llvmDir -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
>> fi
> 
> 
>> The uname result on NetBSD is 'NetBSD' and we need to use cmake. 
>> The correct check is:
> 
>> if [[ $host != Linux ]] && [[ $host != NetBSD ]]
> 
> 
>> I noticed also a check for ${OS} in 
>> /home/motus/build/build/scripts/lldb-utils/build.sh
> 
>> case "$(uname -s)" in Linux)  OS=linux;; Darwin) OS=darwin;; 
>> *_NT-*) OS=windows;; esac
> 
>> There is need for NetBSD) OS=netbsd;; and new file 
>> build-netbsd.sh.
> 
>> This is why, I suggested you to install NetBSD locally and adapt 
>> the scripts for this system. Ping-pong overmails can take another
>> 2 weeks.
> 
>> On 21.10.2015 02:05, Kamil Rytarowski via lldb-commits wrote:
>>> On 21.10.2015 02:03, Ying Chen wrote:
> 
> 
 On Tue, Oct 20, 2015 at 4:46 PM, Kamil Rytarowski
 mailto:n...@gmx.com> >> wrote:
> 
 It just appeared there.
> 
 I took your updateScripts.sh, moved it to my $PATH. Is it 
 everything?
> 
> 
> Please also put the test_cfg.json to this location, 
> /home/motus/build/build/. A dummy file is ok if you don't 
> want to run any test.
> 
> 
>>> I added there a dummy literally empty file (of size 0) there.
> 
> 
> 
 Will the rest of the scripts from 
 https://android.googlesource.com/platform/external/lldb-utils/+/lld
b
>
 
- -
> 
 
> m
> 
 
>> as
> 
> 
>>> ter-dev/buildbotScripts/bashShell/svntotbuild/
 
 
b
> 
 
> -
> 
 
>> mas
> 
> 
>>> ter-dev/buildbotScripts/bashShell/svntotbuild/>
 be fetched/used automatically?
> 
 Do I need a local copy of it? If so, do I need to fetch the 
 whole directory 
 https://android.googlesource.com/platform/external/lldb-utils/+/lld
b
>
 
- -
> 
 
> m
> 
 
>> as
> 
> 
>>> ter-dev/buildbotScripts
 
 
b
> 
 
> -
> 
 
>> mas
> 
> 
>>> ter-dev/buildbotScripts>
 ?
> 
> 
> You don't need a local copy of any of it. updateScripts.sh
>  will fetch everything automatically.
> 
> 
>>> Thank you!
> 
>>> I also linked /bin/bash to /usr/pkg/bin/bash on my NetBSD
>>> host.
> 
>>> If there are some GNU tools used there, gawk please let me
>>> know.
> 
> 
> 
 According to builders.py ( 
 https://github.com/llvm-mirror/zorg/commit/c901503848e900fc1af0c43c
9
>
 
3
> 
 
> c
> 
 
>> 98
> 
> 
>>> daddd2f23fd
 
 
9
> 
 
> 3
> 
 
>> c98
> 
> 
>>> daddd2f23fd>
 )
> 
 I use: 
 'factory':LLDBBuilder.getLLDBScriptCommandsFactory(runTest=False)


>
 
}
> 
> 
> Please also add "downloadBinary=False"
> 
> 
>>> Please add this change there to the zorg repository and commit 
>>> (I don't have a commit bit).
> 
 At the moment I don't want to run tests and leave it for 
 later.
> 
 I restarted the build bot with the staging server and this is
  what I get : 2015-10-20 23:43:33+ [-] Log opened. 
 2015-10-20 23:43:33+ [-] twistd 15.4.0 
 (/usr/pkg/bin/python2.7 2.7.10) 

Re: [Lldb-commits] [PATCH] D13715: Add initial gmake glue for the NetBSD platform

2015-10-20 Thread Bruce Mitchener via lldb-commits
brucem added a subscriber: brucem.
brucem requested changes to this revision.
brucem added a reviewer: brucem.
This revision now requires changes to proceed.


Comment at: lib/Makefile:146
@@ -144,1 +145,3 @@
 
+ifneq ($(HOST_OS),NetBSD)
+  USEDLIBS += lldbPluginProcessPOSIX.a

This should be `ifeq`?


Comment at: source/Host/Makefile:46
@@ -45,1 +45,3 @@
 
+ifneq ($(HOST_OS),NetBSD)
+$(eval $(call DIR_SOURCES,posix))

This should be `ifeq` too, no?


Repository:
  rL LLVM

http://reviews.llvm.org/D13715



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D13715: Add initial gmake glue for the NetBSD platform

2015-10-20 Thread Kamil Rytarowski via lldb-commits
krytarowski updated this revision to Diff 37957.
krytarowski added a comment.

Typos.


Repository:
  rL LLVM

http://reviews.llvm.org/D13715

Files:
  lib/Makefile
  source/Host/Makefile
  source/Host/netbsd/Makefile
  source/Plugins/Makefile
  source/Plugins/Platform/Makefile
  source/Plugins/Platform/NetBSD/Makefile

Index: source/Plugins/Platform/NetBSD/Makefile
===
--- /dev/null
+++ source/Plugins/Platform/NetBSD/Makefile
@@ -0,0 +1,14 @@
+##===- source/Plugins/Platform/NetBSD/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 := lldbPluginPlatformNetBSD
+BUILD_ARCHIVE = 1
+
+include $(LLDB_LEVEL)/Makefile
Index: source/Plugins/Platform/Makefile
===
--- source/Plugins/Platform/Makefile
+++ source/Plugins/Platform/Makefile
@@ -11,7 +11,7 @@
 
 include $(LLDB_LEVEL)/../../Makefile.config
 
-PARALLEL_DIRS := gdb-server MacOSX Linux FreeBSD POSIX Windows Kalimba Android
+PARALLEL_DIRS := gdb-server MacOSX Linux FreeBSD NetBSD POSIX Windows Kalimba Android
 
 # ifeq ($(HOST_OS),Darwin)
 #   DIRS += MacOSX
@@ -24,9 +24,13 @@
 # ifeq ($(HOST_OS),FreeBSD)
 #   DIRS += FreeBSD
 # endif
-# 
+#
 # ifeq ($(HOST_OS),GNU/kFreeBSD)
 #   DIRS += FreeBSD
 # endif
+#
+# ifeq ($(HOST_OS),NetBSD)
+#   DIRS += NetBSD
+# endif
 
 include $(LLDB_LEVEL)/Makefile
Index: source/Plugins/Makefile
===
--- source/Plugins/Makefile
+++ source/Plugins/Makefile
@@ -58,4 +58,8 @@
 PARALLEL_DIRS += Process/FreeBSD Process/POSIX
 endif
 
+ifeq ($(HOST_OS),NetBSD)
+PARALLEL_DIRS += Process/POSIX
+endif
+
 include $(LLDB_LEVEL)/Makefile
Index: source/Host/netbsd/Makefile
===
--- /dev/null
+++ source/Host/netbsd/Makefile
@@ -0,0 +1,14 @@
+##===- source/Host/netbsd/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 := lldbHostNetBSD
+BUILD_ARCHIVE = 1
+
+include $(LLDB_LEVEL)/Makefile
Index: source/Host/Makefile
===
--- source/Host/Makefile
+++ source/Host/Makefile
@@ -43,6 +43,11 @@
 $(eval $(call DIR_SOURCES,freebsd))
 endif
 
+ifeq ($(HOST_OS),NetBSD)
+$(eval $(call DIR_SOURCES,posix))
+$(eval $(call DIR_SOURCES,netbsd))
+endif
+
 ifeq ($(HOST_OS),MingW)
 $(eval $(call DIR_SOURCES,windows))
 endif
Index: lib/Makefile
===
--- lib/Makefile
+++ lib/Makefile
@@ -103,6 +103,7 @@
 	lldbPluginPlatformLinux.a \
 	lldbPluginPlatformWindows.a \
 	lldbPluginPlatformFreeBSD.a \
+	lldbPluginPlatformNetBSD.a \
 	lldbPluginPlatformPOSIX.a \
 	lldbPluginPlatformKalimba.a \
 	lldbPluginPlatformAndroid.a \
@@ -142,6 +143,10 @@
   lldbPluginProcessFreeBSD.a
 endif
 
+ifeq ($(HOST_OS),NetBSD)
+  USEDLIBS += lldbPluginProcessPOSIX.a
+endif
+
 include $(LEVEL)/Makefile.common
 
 ifeq ($(HOST_OS),MingW)
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D13073: Add an expression parser for Go

2015-10-20 Thread Jim Ingham via lldb-commits
jingham added a comment.

The generic parts of this change look fine to me, with a few inlined style 
comments.

I didn't read the Go specific parts of this in detail, I assume you're going to 
get those right.  I mentioned a couple of style things inline, though I didn't 
mark everywhere that they occurred.  Particularly, the construct:

Foo::Foo () :

  m_ivar1
  , m_ivar2

etc. looks very odd, and is not the way we do it anywhere else in lldb.  Please 
don't write it that way.

Also, we try to always call shared pointers foo_sp and unique pointers foo_up.  
The life cycle of these guys is enough different from pointers that it is good 
to be able to see what they are in code without having to trace them back to 
the definition.

With those style changes this is okay by me.



Comment at: source/Expression/LLVMUserExpression.cpp:43-60
@@ +42,20 @@
+
+LLVMUserExpression::LLVMUserExpression(ExecutionContextScope &exe_scope, const 
char *expr, const char *expr_prefix,
+   lldb::LanguageType language, ResultType 
desired_type)
+: UserExpression(exe_scope, expr, expr_prefix, language, desired_type)
+, m_stack_frame_bottom(LLDB_INVALID_ADDRESS)
+, m_stack_frame_top(LLDB_INVALID_ADDRESS)
+, m_transformed_text()
+, m_execution_unit_sp()
+, m_materializer_ap()
+, m_jit_module_wp()
+, m_enforce_valid_object(true)
+, m_in_cplusplus_method(false)
+, m_in_objectivec_method(false)
+, m_in_static_method(false)
+, m_needs_object_ptr(false)
+, m_const_object(false)
+, m_target(NULL)
+, m_can_interpret(false)
+, m_materialized_address(LLDB_INVALID_ADDRESS)
+{

Don't write initializers with the commas in front like this.  We don't do it 
this way anywhere else in lldb, and it looks really weird...


Comment at: source/Expression/UserExpression.cpp:48-54
@@ -47,27 +47,9 @@
 
-UserExpression::UserExpression (ExecutionContextScope &exe_scope,
-const char *expr,
-const char *expr_prefix,
-lldb::LanguageType language,
-ResultType desired_type) :
-Expression (exe_scope),
-m_stack_frame_bottom (LLDB_INVALID_ADDRESS),
-m_stack_frame_top (LLDB_INVALID_ADDRESS),
-m_expr_text (expr),
-m_expr_prefix (expr_prefix ? expr_prefix : ""),
-m_language (language),
-m_transformed_text (),
-m_desired_type (desired_type),
-m_execution_unit_sp(),
-m_materializer_ap(),
-m_jit_module_wp(),
-m_enforce_valid_object (true),
-m_in_cplusplus_method (false),
-m_in_objectivec_method (false),
-m_in_static_method(false),
-m_needs_object_ptr (false),
-m_const_object (false),
-m_target (NULL),
-m_can_interpret (false),
-m_materialized_address (LLDB_INVALID_ADDRESS)
+UserExpression::UserExpression(ExecutionContextScope &exe_scope, const char 
*expr, const char *expr_prefix,
+   lldb::LanguageType language, ResultType 
desired_type)
+: Expression(exe_scope)
+, m_expr_text(expr)
+, m_expr_prefix(expr_prefix ? expr_prefix : "")
+, m_language(language)
+, m_desired_type(desired_type)
 {

Ditto, we don't write initializers this way.  Move the commas to the end of the 
line.


Comment at: source/Plugins/ExpressionParser/Go/GoAST.h:208-209
@@ +207,4 @@
+: GoASTExpr(eArrayType)
+, m_len(len)
+, m_elt(elt)
+{

Same comment about formatting...


Comment at: source/Plugins/ExpressionParser/Go/GoAST.h:250-251
@@ +249,4 @@
+friend class GoASTNode;
+std::unique_ptr m_len;
+std::unique_ptr m_elt;
+

We usually postpend with _sp or _up variables that are shared or unique 
pointers.  They have sufficiently interesting lifecycle that it is helpful to 
know at a glance what kind of thing they are.


Comment at: source/Plugins/ExpressionParser/Go/GoAST.h:262-263
@@ +261,4 @@
+: GoASTStmt(eAssignStmt)
+, m_define(define)
+{
+}

Here too...


Comment at: source/Plugins/ExpressionParser/Go/GoAST.h:324-325
@@ +323,4 @@
+friend class GoASTNode;
+std::vector> m_lhs;
+std::vector> m_rhs;
+bool m_define;

Maybe m_lhs_up, etc.


Repository:
  rL LLVM

http://reviews.llvm.org/D13073



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r250874 - Revert r250872 in source/Plugins/Disassembler to fix MSVC builds failures.

2015-10-20 Thread Zachary Turner via lldb-commits
You can probably put this CL back in, just make sure you #include the
appropriate file from LLVM in the header file.

On Tue, Oct 20, 2015 at 6:44 PM Eugene Zelenko via lldb-commits <
lldb-commits@lists.llvm.org> wrote:

> Author: eugenezelenko
> Date: Tue Oct 20 20:42:15 2015
> New Revision: 250874
>
> URL: http://llvm.org/viewvc/llvm-project?rev=250874&view=rev
> Log:
> Revert r250872 in source/Plugins/Disassembler to fix MSVC builds failures.
>
> Modified:
> lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
> lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h
>
> Modified: lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp?rev=250874&r1=250873&r2=250874&view=diff
>
> ==
> --- lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
> (original)
> +++ lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp Tue
> Oct 20 20:42:15 2015
> @@ -7,9 +7,8 @@
>  //
>
>  
> //===--===//
>
> -// C Includes
> -// C++ Includes
> -// Project includes
> +#include "DisassemblerLLVMC.h"
> +
>  #include "llvm-c/Disassembler.h"
>  #include "llvm/MC/MCAsmInfo.h"
>  #include "llvm/MC/MCContext.h"
> @@ -26,8 +25,6 @@
>  #include "llvm/Support/TargetSelect.h"
>  #include "llvm/ADT/SmallString.h"
>
> -// Other libraries and framework includes
> -#include "DisassemblerLLVMC.h"
>
>  #include "lldb/Core/Address.h"
>  #include "lldb/Core/DataExtractor.h"
> @@ -61,10 +58,13 @@ public:
>  {
>  }
>
> -~InstructionLLVMC() override = default;
> +virtual
> +~InstructionLLVMC ()
> +{
> +}
>
> -bool
> -DoesBranch() override
> +virtual bool
> +DoesBranch ()
>  {
>  if (m_does_branch == eLazyBoolCalculate)
>  {
> @@ -100,8 +100,8 @@ public:
>  return m_does_branch == eLazyBoolYes;
>  }
>
> -bool
> -HasDelaySlot() override
> +virtual bool
> +HasDelaySlot ()
>  {
>  if (m_has_delay_slot == eLazyBoolCalculate)
>  {
> @@ -155,10 +155,10 @@ public:
>  return llvm_disasm.m_disasm_ap.get();
>  }
>
> -size_t
> -Decode(const lldb_private::Disassembler &disassembler,
> -   const lldb_private::DataExtractor &data,
> -   lldb::offset_t data_offset) override
> +virtual size_t
> +Decode (const lldb_private::Disassembler &disassembler,
> +const lldb_private::DataExtractor &data,
> +lldb::offset_t data_offset)
>  {
>  // All we have to do is read the opcode which can be easy for some
>  // architectures
> @@ -272,8 +272,8 @@ public:
>  }
>  }
>
> -void
> -CalculateMnemonicOperandsAndComment(const
> lldb_private::ExecutionContext *exe_ctx) override
> +virtual void
> +CalculateMnemonicOperandsAndComment (const
> lldb_private::ExecutionContext *exe_ctx)
>  {
>  DataExtractor data;
>  const AddressClass address_class = GetAddressClass ();
> @@ -452,6 +452,8 @@ protected:
>  boolm_using_file_addr;
>  };
>
> +
> +
>  DisassemblerLLVMC::LLVMCDisassembler::LLVMCDisassembler (const char
> *triple, const char *cpu, const char *features_str, unsigned flavor,
> DisassemblerLLVMC &owner):
>  m_is_valid(true)
>  {
> @@ -519,6 +521,10 @@ DisassemblerLLVMC::LLVMCDisassembler::LL
>  m_is_valid = false;
>  }
>
> +DisassemblerLLVMC::LLVMCDisassembler::~LLVMCDisassembler()
> +{
> +}
> +
>  uint64_t
>  DisassemblerLLVMC::LLVMCDisassembler::GetMCInst (const uint8_t
> *opcode_data,
>   size_t opcode_data_len,
> @@ -599,6 +605,7 @@ DisassemblerLLVMC::FlavorValidForArchSpe
>  return false;
>  }
>
> +
>  Disassembler *
>  DisassemblerLLVMC::CreateInstance (const ArchSpec &arch, const char
> *flavor)
>  {
> @@ -775,6 +782,10 @@ DisassemblerLLVMC::DisassemblerLLVMC (co
>  }
>  }
>
> +DisassemblerLLVMC::~DisassemblerLLVMC()
> +{
> +}
> +
>  size_t
>  DisassemblerLLVMC::DecodeInstructions (const Address &base_addr,
> const DataExtractor& data,
>
> Modified: lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h
> URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h?rev=250874&r1=250873&r2=250874&view=diff
>
> ==
> --- lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h
> (original)
> +++ lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h Tue
> Oct 20 20:42:15 2015
> @@ -10,19 +10,10 @@
>  #ifndef liblldb_DisassemblerLLVMC_h_
>  #define liblldb_DisassemblerLLVMC_h_
>
> -// C Includes
> -// C++ Includes
>  #include 
>
> -// Other l

Re: [Lldb-commits] [lldb] r250870 - When a REPL creates a new target for itself, it is that target's REPL.

2015-10-20 Thread Zachary Turner via lldb-commits
This is a good example of where a "null repl" would be great for testing.
You don't need a language to verify, for example, that when a repl creates
a new target for itself, it is correcly set as the repl for that target.
And even if you had a language specific repl, that wouldn't really be the
right place to test that, because it makes the person reading the test
think that this is some property of a language instead of some property of
all repls.  So having a null repl is a great place to test all these
behaviors of the system that have nothing to do with what language you're
dealing with.

On Tue, Oct 20, 2015 at 5:38 PM Sean Callanan via lldb-commits <
lldb-commits@lists.llvm.org> wrote:

> Author: spyffe
> Date: Tue Oct 20 19:36:34 2015
> New Revision: 250870
>
> URL: http://llvm.org/viewvc/llvm-project?rev=250870&view=rev
> Log:
> When a REPL creates a new target for itself, it is that target's REPL.
> To allow that, I've added a SetREPL call to the Target, which allows a REPL
> that just created a target to install itself as the go-to REPL for the
> corresponding language.
>
> Modified:
> lldb/trunk/include/lldb/Target/Target.h
> lldb/trunk/source/Target/Target.cpp
>
> Modified: lldb/trunk/include/lldb/Target/Target.h
> URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Target.h?rev=250870&r1=250869&r2=250870&view=diff
>
> ==
> --- lldb/trunk/include/lldb/Target/Target.h (original)
> +++ lldb/trunk/include/lldb/Target/Target.h Tue Oct 20 19:36:34 2015
> @@ -1569,6 +1569,9 @@ public:
>
>  lldb::REPLSP
>  GetREPL (Error &err, lldb::LanguageType language, const char
> *repl_options, bool can_create);
> +
> +void
> +SetREPL (lldb::LanguageType language, lldb::REPLSP repl_sp);
>
>  protected:
>  //--
>
> Modified: lldb/trunk/source/Target/Target.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Target.cpp?rev=250870&r1=250869&r2=250870&view=diff
>
> ==
> --- lldb/trunk/source/Target/Target.cpp (original)
> +++ lldb/trunk/source/Target/Target.cpp Tue Oct 20 19:36:34 2015
> @@ -56,6 +56,7 @@
>  #include "lldb/Target/SystemRuntime.h"
>  #include "lldb/Target/Thread.h"
>  #include "lldb/Target/ThreadSpec.h"
> +#include "lldb/Utility/LLDBAssert.h"
>
>  using namespace lldb;
>  using namespace lldb_private;
> @@ -251,6 +252,14 @@ Target::GetREPL (Error &err, lldb::Langu
>  }
>
>  void
> +Target::SetREPL (lldb::LanguageType language, lldb::REPLSP repl_sp)
> +{
> +lldbassert(!m_repl_map.count(language));
> +
> +m_repl_map[language] = repl_sp;
> +}
> +
> +void
>  Target::Destroy()
>  {
>  Mutex::Locker locker (m_mutex);
>
>
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D13880: Create an lldb/third_party folder, and add Python module 'six' to it.

2015-10-20 Thread Daniel Berlin via lldb-commits
dberlin added a comment.

LGTM from a license perspective. It doesn't impose any interesting obligations.


http://reviews.llvm.org/D13880



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits