[Lldb-commits] [PATCH] D13695: lldb-server: add support for binary memory reads

2015-10-13 Thread Pavel Labath via lldb-commits
labath created this revision.
labath added reviewers: tberghammer, jasonmolenda.
labath added subscribers: lldb-commits, iancottrell.

This commit adds support for binary memory reads ($x) to lldb-server. It also 
removes the "0x"
prefix from the $x client packet, to make it more compatible with the old $m 
packet. This allows
us to use almost the same code for handling both packet types. I have verified 
that debugserver
correctly handles $x packets even without the leading "0x".

http://reviews.llvm.org/D13695

Files:
  source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
  source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h
  source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
  source/Utility/StringExtractorGDBRemote.cpp
  source/Utility/StringExtractorGDBRemote.h

Index: source/Utility/StringExtractorGDBRemote.h
===
--- source/Utility/StringExtractorGDBRemote.h
+++ source/Utility/StringExtractorGDBRemote.h
@@ -145,6 +145,8 @@
 eServerPacketType_s,
 eServerPacketType_S,
 eServerPacketType_T,
+eServerPacketType_x,
+eServerPacketType_X,
 eServerPacketType_Z,
 eServerPacketType_z,
 
Index: source/Utility/StringExtractorGDBRemote.cpp
===
--- source/Utility/StringExtractorGDBRemote.cpp
+++ source/Utility/StringExtractorGDBRemote.cpp
@@ -310,6 +310,12 @@
   case 'S':
 return eServerPacketType_S;
 
+  case 'x':
+return eServerPacketType_x;
+
+  case 'X':
+return eServerPacketType_X;
+
   case 'T':
 return eServerPacketType_T;
 
Index: source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===
--- source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -3043,14 +3043,8 @@
 char packet[64];
 int packet_len;
 bool binary_memory_read = m_gdb_comm.GetxPacketSupported();
-if (binary_memory_read)
-{
-packet_len = ::snprintf (packet, sizeof(packet), "x0x%" PRIx64 ",0x%" PRIx64, (uint64_t)addr, (uint64_t)size);
-}
-else
-{
-packet_len = ::snprintf (packet, sizeof(packet), "m%" PRIx64 ",%" PRIx64, (uint64_t)addr, (uint64_t)size);
-}
+packet_len = ::snprintf(packet, sizeof(packet), "%c%" PRIx64 ",%" PRIx64,
+binary_memory_read ? 'x' : 'm', (uint64_t)addr, (uint64_t)size);
 assert (packet_len + 1 < (int)sizeof(packet));
 StringExtractorGDBRemote response;
 if (m_gdb_comm.SendPacketAndWaitForResponse(packet, packet_len, response, true) == GDBRemoteCommunication::PacketResult::Success)
Index: source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h
===
--- source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h
+++ source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h
@@ -202,8 +202,9 @@
 PacketResult
 Handle_interrupt (StringExtractorGDBRemote &packet);
 
+// Handles $m and $x packets.
 PacketResult
-Handle_m (StringExtractorGDBRemote &packet);
+Handle_memory_read (StringExtractorGDBRemote &packet);
 
 PacketResult
 Handle_M (StringExtractorGDBRemote &packet);
Index: source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
===
--- source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
+++ source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
@@ -113,7 +113,7 @@
 RegisterMemberFunctionHandler(StringExtractorGDBRemote::eServerPacketType_interrupt,
   &GDBRemoteCommunicationServerLLGS::Handle_interrupt);
 RegisterMemberFunctionHandler(StringExtractorGDBRemote::eServerPacketType_m,
-  &GDBRemoteCommunicationServerLLGS::Handle_m);
+  &GDBRemoteCommunicationServerLLGS::Handle_memory_read);
 RegisterMemberFunctionHandler(StringExtractorGDBRemote::eServerPacketType_M,
   &GDBRemoteCommunicationServerLLGS::Handle_M);
 RegisterMemberFunctionHandler(StringExtractorGDBRemote::eServerPacketType_p,
@@ -164,6 +164,8 @@
   &GDBRemoteCommunicationServerLLGS::Handle_vCont);
 RegisterMemberFunctionHandler(StringExtractorGDBRemote::eServerPacketType_vCont_actions,
   &GDBRemoteCommunicationServerLLGS::Handle_vCont_actions);
+RegisterMemberFunctionHandler(StringExtractorGDBRemote::eServerPacketType_x,
+  &GDBRemoteCommunicationServerLLGS::Handle_memory_read);
 RegisterMemberFunctionHandler(StringExtractorGDBRemote::eServerPacketType_Z,
   &

Re: [Lldb-commits] [PATCH] D13657: [lldb] char summary provider

2015-10-13 Thread Eugene Leviant via lldb-commits
evgeny777 added a comment.

I thought this would be a nice feature, as I'm long term gdb user and gdb also 
evaluates chars as code and value.
MI private category sounds good, but I have concerns on implementing it 
properly. For instance SBTypeSummary can create string, function and script 
summaries only. Although string summary **${var%d} ${var}** can be used for 
this case, it's much better to be able to use something like AddCXXSummary(), 
so that my own C++ formatter function is called. Do you know if this is 
possible?


http://reviews.llvm.org/D13657



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


Re: [Lldb-commits] [PATCH] D13695: lldb-server: add support for binary memory reads

2015-10-13 Thread Tamas Berghammer via lldb-commits
tberghammer accepted this revision.
tberghammer added a comment.
This revision is now accepted and ready to land.

Look good


http://reviews.llvm.org/D13695



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


[Lldb-commits] [PATCH] D13699: RenderScript command for printing allocation contents.

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

This patch adds the command 'language renderscript allocation dump ' for 
printing the contents of a RS allocation.
Displaying the coordinate of each element as well as its formatted value

e.g  (lldb) language renderscript allocation dump 1
Data (X, Y, Z):
(0, 0, 0) = {0 1}
(1, 0, 0) = {2 3}
(2, 0, 0) = {4 5}

A --file  option is also included, since for large allocations it may 
be more helpful to view this text as a file.


Repository:
  rL LLVM

http://reviews.llvm.org/D13699

Files:
  include/lldb/lldb-enumerations.h
  source/Core/DataExtractor.cpp
  
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
@@ -202,6 +202,8 @@
 
 void DumpKernels(Stream &strm) const;
 
+bool DumpAllocation(Stream &strm, StackFrame* frame_ptr, const uint32_t id);
+
 void ListAllocations(Stream &strm, StackFrame* frame_ptr, bool recompute);
 
 void AttemptBreakpointAtKernelName(Stream &strm, const char *name, Error &error, lldb::TargetSP target);
@@ -298,6 +300,8 @@
 void CaptureAllocationInit1(RuntimeHook* hook_info, ExecutionContext& context);
 void CaptureSetGlobalVar1(RuntimeHook* hook_info, ExecutionContext& context);
 
+AllocationDetails* FindAllocByID(Stream &strm, const uint32_t alloc_id);
+
 //
 // Helper functions for jitting the runtime
 //
@@ -310,6 +314,10 @@
 
 bool JITElementPacked(AllocationDetails* allocation, StackFrame* frame_ptr);
 
+bool JITAllocationSize(AllocationDetails* allocation, StackFrame* frame_ptr, const uint32_t elem_size);
+
+bool JITAllocationStride(AllocationDetails* allocation, StackFrame* frame_ptr);
+
 // Search for a script detail object using a target address.
 // If a script does not currently exist this function will return nullptr.
 // If 'create' is true and there is no previous script with this address,
Index: source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
===
--- source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
+++ source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
@@ -14,6 +14,7 @@
 #include "lldb/Core/Error.h"
 #include "lldb/Core/Log.h"
 #include "lldb/Core/PluginManager.h"
+#include "lldb/Host/StringConvert.h"
 #include "lldb/Symbol/Symbol.h"
 #include "lldb/Symbol/Type.h"
 #include "lldb/Target/Process.h"
@@ -188,6 +189,9 @@
 // Maps Allocation DataKind enum to printable strings
 static const char* RsDataKindToString[];
 
+// Maps allocation types to format sizes for printing.
+static const unsigned int RSTypeToFormat[][3];
+
 // Give each allocation an ID as a way
 // for commands to reference it.
 const unsigned int id;
@@ -201,6 +205,8 @@
 empirical_type type_ptr;// Pointer to the RS Type of the Allocation
 empirical_type element_ptr; // Pointer to the RS Element of the Type
 empirical_type context; // Pointer to the RS Context of the Allocation
+empirical_type size;// Size of the allocation
+empirical_type stride;  // Stride between rows of the allocation
 
 // Give each allocation an id, so we can reference it in user commands.
 AllocationDetails(): id(ID++)
@@ -242,6 +248,31 @@
 {"bool", "bool2", "bool3", "bool4"}
 };
 
+// Used as an index into the RSTypeToFormat array elements
+enum TypeToFormatIndex {
+   eFormatSingle = 0,
+   eFormatVector,
+   eElementSize
+};
+
+// { format enum of single element, format enum of element vector, size of element}
+const unsigned int RenderScriptRuntime::AllocationDetails::RSTypeToFormat[][3] =
+{
+{eFormatHex, eFormatHex, 1}, // RS_TYPE_NONE
+{eFormatFloat, eFormatVectorOfFloat16, 2}, // RS_TYPE_FLOAT_16
+{eFormatFloat, eFormatVectorOfFloat32, sizeof(float)}, // RS_TYPE_FLOAT_32
+{eFormatFloat, eFormatVectorOfFloat64, sizeof(double)}, // RS_TYPE_FLOAT_64
+{eFormatDecimal, eFormatVectorOfSInt8, sizeof(int8_t)}, // RS_TYPE_SIGNED_8
+{eFormatDecimal, eFormatVectorOfSInt16, sizeof(int16_t)}, // RS_TYPE_SIGNED_16
+{eFormatDecimal, eFormatVectorOfSInt32, sizeof(int32_t)}, // RS_TYPE_SIGNED_32
+{eFormatDecimal, eFormatVectorOfSInt64, sizeof(int64_t)}, // RS_TYPE_SIGNED_64
+{eFo

Re: [Lldb-commits] [PATCH] D13699: RenderScript command for printing allocation contents.

2015-10-13 Thread Bruce Mitchener via lldb-commits
brucem added a subscriber: brucem.
brucem added a comment.

I don't know much about this, but would it make sense for this to be using any 
of the Value / SBValue and data formatter infrastructure?


Repository:
  rL LLVM

http://reviews.llvm.org/D13699



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


Re: [Lldb-commits] [PATCH] D13699: RenderScript command for printing allocation contents.

2015-10-13 Thread Ewan Crawford via lldb-commits
EwanCrawford added a comment.

Hi Bruce,

I'm mapping rs types to data formatters in the struct 
`RenderScriptRuntime::AllocationDetails::RSTypeToFormat` on line 
RenderScriptRuntime.cpp:259.

Then using a `DataExtractor` to print using those formats on 
RenderScriptRuntime.cpp:1830

Is there another way you would suggest?


Repository:
  rL LLVM

http://reviews.llvm.org/D13699



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


Re: [Lldb-commits] [PATCH] D13652: Change ConstString to support massive multi-threaded access

2015-10-13 Thread Tamas Berghammer via lldb-commits
tberghammer updated this revision to Diff 37258.
tberghammer added a comment.

Use llvm::sys::RWMutex

Using it have a minor performance hit for debug info parsing because of the 
intensive write operations, but should have a positive impact on all reads 
(most access after debug info parsing). If the performance hit for writes isn't 
acceptable we can add a flag to the ConstString constructor hinting that we are 
creating a new string so we don't have to make a check in this case, but I 
prefer to don't do it until we can prove it is necessary.


http://reviews.llvm.org/D13652

Files:
  source/Core/ConstString.cpp

Index: source/Core/ConstString.cpp
===
--- source/Core/ConstString.cpp
+++ source/Core/ConstString.cpp
@@ -10,37 +10,20 @@
 #include "lldb/Core/Stream.h"
 #include "lldb/Host/Mutex.h"
 #include "llvm/ADT/StringMap.h"
+#include "llvm/ADT/StringExtras.h"
+#include "llvm/Support/RWMutex.h"
 
-#include  // std::once
+#include 
+#include 
 
 using namespace lldb_private;
 
-
 class Pool
 {
 public:
 typedef const char * StringPoolValueType;
 typedef llvm::StringMap StringPool;
 typedef llvm::StringMapEntry StringPoolEntryType;
-
-//--
-// Default constructor
-//
-// Initialize the member variables and create the empty string.
-//--
-Pool () :
-m_mutex (Mutex::eMutexTypeRecursive),
-m_string_map ()
-{
-}
-
-//--
-// Destructor
-//--
-~Pool ()
-{
-}
-
 
 static StringPoolEntryType &
 GetStringMapEntryFromKeyData (const char *keyData)
@@ -85,42 +68,49 @@
 {
 if (cstr)
 return GetConstCStringWithLength (cstr, strlen (cstr));
-return NULL;
+return nullptr;
 }
 
 const char *
 GetConstCStringWithLength (const char *cstr, size_t cstr_len)
 {
 if (cstr)
-{
-Mutex::Locker locker (m_mutex);
-llvm::StringRef string_ref (cstr, cstr_len);
-StringPoolEntryType& entry = *m_string_map.insert (std::make_pair (string_ref, (StringPoolValueType)NULL)).first;
-return entry.getKeyData();
-}
-return NULL;
+return GetConstCStringWithStringRef(llvm::StringRef(cstr, cstr_len));
+return nullptr;
 }
 
 const char *
 GetConstCStringWithStringRef (const llvm::StringRef &string_ref)
 {
 if (string_ref.data())
 {
-Mutex::Locker locker (m_mutex);
-StringPoolEntryType& entry = *m_string_map.insert (std::make_pair (string_ref, (StringPoolValueType)NULL)).first;
+uint8_t h = hash (string_ref);
+
+{
+llvm::sys::SmartScopedReader rlock(m_string_pools[h].m_mutex);
+auto it = m_string_pools[h].m_string_map.find (string_ref);
+if (it != m_string_pools[h].m_string_map.end())
+return it->getKeyData();
+}
+
+llvm::sys::SmartScopedWriter wlock(m_string_pools[h].m_mutex);
+StringPoolEntryType& entry = *m_string_pools[h].m_string_map.insert (std::make_pair (string_ref, nullptr)).first;
 return entry.getKeyData();
 }
-return NULL;
+return nullptr;
 }
 
 const char *
 GetConstCStringAndSetMangledCounterPart (const char *demangled_cstr, const char *mangled_ccstr)
 {
 if (demangled_cstr)
 {
-Mutex::Locker locker (m_mutex);
+llvm::StringRef string_ref (demangled_cstr);
+uint8_t h = hash (string_ref);
+llvm::sys::SmartScopedWriter wlock(m_string_pools[h].m_mutex);
+
 // Make string pool entry with the mangled counterpart already set
-StringPoolEntryType& entry = *m_string_map.insert (std::make_pair (llvm::StringRef (demangled_cstr), mangled_ccstr)).first;
+StringPoolEntryType& entry = *m_string_pools[h].m_string_map.insert (std::make_pair (string_ref, mangled_ccstr)).first;
 
 // Extract the const version of the demangled_cstr
 const char *demangled_ccstr = entry.getKeyData();
@@ -130,7 +120,7 @@
 // Return the constant demangled C string
 return demangled_ccstr;
 }
-return NULL;
+return nullptr;
 }
 
 const char *
@@ -141,7 +131,7 @@
 const size_t trimmed_len = std::min (strlen (cstr), cstr_len);
 return GetConstCStringWithLength (cstr, trimmed_len);
 }
-return NULL;
+return nullptr;
 }
 
 //--
@@ -152,28 +142,31 @@
 size_t
 MemorySize() const
 {
-

Re: [Lldb-commits] [PATCH] D13657: [lldb] char summary provider

2015-10-13 Thread Enrico Granata via lldb-commits
granata.enrico added a comment.

Currently I don't think SBTypeSummary allows for defining formatters backed by 
a CXXFunctionSummaryFormat
It would, however, be a great addition to our API. Is it a change you're 
interested in working on?

If so, the easy part is going to be introducing LLVM-style RTTI for 
TypeSummaryImpl such that one can replace the ->IsScripted() calls with a 
proper switch over all kinds of summaries (there's three, you're gonna want to 
introduce a fourth - read below).
The slightly more interesting part is that currently CXXFunctionSummaryFormat 
expects to transact in ValueObjects and std::strings. These are things we 
cannot expose at the SB layer. So we might need to add yet another kind of 
summary that instead takes an SBValue, an SBSummaryOptions and fills in an 
SBStream. Once we have that, the MI could actually use the functionality to 
register its own summaries (and if we find SBValue to be lackluster in any way 
as a result, we should fill in those gaps).


http://reviews.llvm.org/D13657



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


[Lldb-commits] [lldb] r250175 - Symbols::LocateExecutableSymbolFile() shouldn't try to look for files in /usr/lib/debug on Windows

2015-10-13 Thread Vadim Macagon via lldb-commits
Author: enlight
Date: Tue Oct 13 11:30:28 2015
New Revision: 250175

URL: http://llvm.org/viewvc/llvm-project?rev=250175&view=rev
Log:
Symbols::LocateExecutableSymbolFile() shouldn't try to look for files in 
/usr/lib/debug on Windows

Summary:
/usr/lib/debug doesn't exist on Windows so there's no point even
attempting to look for symbol files in there.

Reviewers: zturner, clayborg

Subscribers: lldb-commits

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

Modified:
lldb/trunk/source/Host/common/Symbols.cpp

Modified: lldb/trunk/source/Host/common/Symbols.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Symbols.cpp?rev=250175&r1=250174&r2=250175&view=diff
==
--- lldb/trunk/source/Host/common/Symbols.cpp (original)
+++ lldb/trunk/source/Host/common/Symbols.cpp Tue Oct 13 11:30:28 2015
@@ -238,8 +238,10 @@ Symbols::LocateExecutableSymbolFile (con
 // Add current working directory.
 debug_file_search_paths.AppendIfUnique (FileSpec(".", true));
 
+#ifndef LLVM_ON_WIN32
 // Add /usr/lib/debug directory.
 debug_file_search_paths.AppendIfUnique (FileSpec("/usr/lib/debug", 
true));
+#endif // LLVM_ON_WIN32
 
 std::string uuid_str;
 const UUID &module_uuid = module_spec.GetUUID();


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


Re: [Lldb-commits] [PATCH] D13636: Symbols::LocateExecutableSymbolFile() shouldn't try to look for files in /usr/lib/debug on Windows

2015-10-13 Thread Vadim Macagon via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL250175: Symbols::LocateExecutableSymbolFile() shouldn't try 
to look for files in… (authored by enlight).

Changed prior to commit:
  http://reviews.llvm.org/D13636?vs=37056&id=37261#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D13636

Files:
  lldb/trunk/source/Host/common/Symbols.cpp

Index: lldb/trunk/source/Host/common/Symbols.cpp
===
--- lldb/trunk/source/Host/common/Symbols.cpp
+++ lldb/trunk/source/Host/common/Symbols.cpp
@@ -238,8 +238,10 @@
 // Add current working directory.
 debug_file_search_paths.AppendIfUnique (FileSpec(".", true));
 
+#ifndef LLVM_ON_WIN32
 // Add /usr/lib/debug directory.
 debug_file_search_paths.AppendIfUnique (FileSpec("/usr/lib/debug", 
true));
+#endif // LLVM_ON_WIN32
 
 std::string uuid_str;
 const UUID &module_uuid = module_spec.GetUUID();


Index: lldb/trunk/source/Host/common/Symbols.cpp
===
--- lldb/trunk/source/Host/common/Symbols.cpp
+++ lldb/trunk/source/Host/common/Symbols.cpp
@@ -238,8 +238,10 @@
 // Add current working directory.
 debug_file_search_paths.AppendIfUnique (FileSpec(".", true));
 
+#ifndef LLVM_ON_WIN32
 // Add /usr/lib/debug directory.
 debug_file_search_paths.AppendIfUnique (FileSpec("/usr/lib/debug", true));
+#endif // LLVM_ON_WIN32
 
 std::string uuid_str;
 const UUID &module_uuid = module_spec.GetUUID();
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D13657: [lldb] char summary provider

2015-10-13 Thread Eugene Leviant via lldb-commits
evgeny777 added a comment.

Yes, I'm interested.

Imagine I have:

  SBTypeSummary::CreateCxxFunctionSummary( ... )

How am I supposed to pass the callback there? Or this should be done by means 
of introducing some base class, like SBTypeSummaryFormatter and deriving custom 
formatters from this class?


http://reviews.llvm.org/D13657



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


Re: [Lldb-commits] [PATCH] D13657: [lldb] char summary provider

2015-10-13 Thread Enrico Granata via lldb-commits
granata.enrico added a comment.

We are not supposed to be inheriting from SB classes, much less introduce 
virtual-ness to them (Greg can go in detail about the reasons, the tl;dr is 
that it has the potential to be ABI-breaking)

The way one would do that is to have a typedef akin to (and after fixing up any 
syntax errors and choosing a nice name)

typedef bool (*SBSummaryFormatterCallback)(SBValue, SBTypeSummaryOptions, 
SBStream&)

Unfortunately it has to be a C-style function pointer, and not an 
std::function, again because the SB API can't use the STL

Then you would have a creating function of the sort of:

SBTypeSummary::CreateCxxFunctionSummary(const char* name, const char* 
description, SBSummaryFormatterCallback callback)
(CxxFunctionSummary is definitely not great as a name, but I have no better 
suggestion right now - let's worry about that once we have some code up and 
running)

You might need to make yourself a subclass of TypeSummaryImpl in the .cpp file 
to store these formatters. It will essentially be very similar to 
CXXFunctionSummaryFormat except it would end up using the 
SBSummaryFormatterCallback typedef - and also it has to live in the 
SBTypeSummary.cpp because we can't put things that reference the SB API in 
lldb_private. Notice that, if you're so inclined, your helper class *can* 
actually use an std::function, and have virtual functions, and all such 
niceties, because it is an implementation-only detail not exposed to API clients


http://reviews.llvm.org/D13657



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


Re: [Lldb-commits] [PATCH] D13652: Change ConstString to support massive multi-threaded access

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

Sounds reasonable


http://reviews.llvm.org/D13652



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


Re: [Lldb-commits] [PATCH] D13695: lldb-server: add support for binary memory reads

2015-10-13 Thread Zachary Turner via lldb-commits
Any tests for this?

On Tue, Oct 13, 2015 at 7:49 AM Tamas Berghammer via lldb-commits <
lldb-commits@lists.llvm.org> wrote:

> tberghammer accepted this revision.
> tberghammer added a comment.
> This revision is now accepted and ready to land.
>
> Look good
>
>
> http://reviews.llvm.org/D13695
>
>
>
> ___
> 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] D13695: lldb-server: add support for binary memory reads

2015-10-13 Thread Zachary Turner via lldb-commits
zturner added a subscriber: zturner.
zturner added a comment.

Any tests for this?


http://reviews.llvm.org/D13695



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


[Lldb-commits] [lldb] r250180 - Fix cast in arm watchpoint handling code

2015-10-13 Thread Tamas Berghammer via lldb-commits
Author: tberghammer
Date: Tue Oct 13 11:48:04 2015
New Revision: 250180

URL: http://llvm.org/viewvc/llvm-project?rev=250180&view=rev
Log:
Fix cast in arm watchpoint handling code

We had an incorrect sign extension when castion from a pointer to an
lldb::addr_t what broke the watchpoint hit detection on arm.

Modified:
lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp

Modified: lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp?rev=250180&r1=250179&r2=250180&view=diff
==
--- lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp Tue Oct 13 
11:48:04 2015
@@ -1282,7 +1282,7 @@ NativeProcessLinux::MonitorSIGTRAP(const
 {
 // If a watchpoint was hit, report it
 uint32_t wp_index;
-Error error = 
thread.GetRegisterContext()->GetWatchpointHitIndex(wp_index, 
(lldb::addr_t)info.si_addr);
+Error error = 
thread.GetRegisterContext()->GetWatchpointHitIndex(wp_index, 
(uintptr_t)info.si_addr);
 if (error.Fail() && log)
 log->Printf("NativeProcessLinux::%s() "
 "received error while checking for watchpoint hits, "


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


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

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

If you are going to keep on contributing, please get SVN commit access.


Repository:
  rL LLVM

http://reviews.llvm.org/D13684



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


Re: [Lldb-commits] [PATCH] D13578: Allow generic arm ArchSpec to merge with specific arm ArchSpec; allow Cortex M0-7's to always force thumb mode

2015-10-13 Thread Tamas Berghammer via lldb-commits
tberghammer added inline comments.


Comment at: source/Core/ArchSpec.cpp:859-870
@@ -853,1 +858,14 @@
+
+// If this and other are both arm ArchSpecs and this ArchSpec is a generic 
"some kind of arm"
+// spec but the other ArchSpec is a specific arm core, adopt the specific 
arm core.
+if (GetTriple().getArch() == llvm::Triple::arm
+&& other.GetTriple().getArch() == llvm::Triple::arm
+&& IsCompatibleMatch (other)
+&& GetCore() == ArchSpec::eCore_arm_generic
+&& other.GetCore() != ArchSpec::eCore_arm_generic)
+{
+m_core = other.GetCore();
+CoreUpdated (true);
+}
+
 if (GetTriple().getEnvironment() == llvm::Triple::UnknownEnvironment)

I would like to see this part of the code to be replaced with something like 
this so we store the sub-architecture inside the triple and we don't have to 
special case arm (it is already done in llvm::Triple):

```
if (GetTriple().getSubArch() == llvm::Triple::NoSubArch)
GetTriple().setSubArch(other.GetTriple().getSubArch());
```


Repository:
  rL LLVM

http://reviews.llvm.org/D13578



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


[Lldb-commits] [lldb] r250188 - Fix TestTargetAPI.py test for users who use Swig 3.0.5 or greater.

2015-10-13 Thread Adrian McCarthy via lldb-commits
Author: amccarth
Date: Tue Oct 13 12:54:15 2015
New Revision: 250188

URL: http://llvm.org/viewvc/llvm-project?rev=250188&view=rev
Log:
Fix TestTargetAPI.py test for users who use Swig 3.0.5 or greater.

DifferentialRevision: http://reviews.llvm.org/D13679

Modified:
lldb/trunk/scripts/interface/SBError.i
lldb/trunk/test/python_api/default-constructor/sb_error.py

Modified: lldb/trunk/scripts/interface/SBError.i
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/interface/SBError.i?rev=250188&r1=250187&r2=250188&view=diff
==
--- lldb/trunk/scripts/interface/SBError.i (original)
+++ lldb/trunk/scripts/interface/SBError.i Tue Oct 13 12:54:15 2015
@@ -56,6 +56,7 @@ And (from test/python_api/event/TestEven
 checks that after calling the target.Launch() method there's no error
 condition and we get back a void process object.
 ") SBError;
+
 class SBError {
 public:
 SBError ();
@@ -94,6 +95,7 @@ public:
 void
 SetErrorString (const char *err_str);
 
+%varargs(3, char *str = NULL) SetErrorStringWithFormat;
 int
 SetErrorStringWithFormat (const char *format, ...);
 

Modified: lldb/trunk/test/python_api/default-constructor/sb_error.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/default-constructor/sb_error.py?rev=250188&r1=250187&r2=250188&view=diff
==
--- lldb/trunk/test/python_api/default-constructor/sb_error.py (original)
+++ lldb/trunk/test/python_api/default-constructor/sb_error.py Tue Oct 13 
12:54:15 2015
@@ -18,5 +18,8 @@ def fuzz_obj(obj):
 obj.SetErrorString(None)
 obj.SetErrorStringWithFormat("%s!", "error")
 obj.SetErrorStringWithFormat(None)
+obj.SetErrorStringWithFormat("error")
+obj.SetErrorStringWithFormat("%s %s", "warning", "danger")
+obj.SetErrorStringWithFormat("%s %s %s", "danger", "will", "robinson")
 obj.GetDescription(lldb.SBStream())
 obj.Clear()


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


[Lldb-commits] [lldb] r250189 - Xfail a watchpoint test on Windows, until Windows implements watchpoints.

2015-10-13 Thread Adrian McCarthy via lldb-commits
Author: amccarth
Date: Tue Oct 13 12:55:58 2015
New Revision: 250189

URL: http://llvm.org/viewvc/llvm-project?rev=250189&view=rev
Log:
Xfail a watchpoint test on Windows, until Windows implements watchpoints.

Modified:

lldb/trunk/test/functionalities/watchpoint/watchpoint_on_vectors/TestValueOfVectorVariable.py

Modified: 
lldb/trunk/test/functionalities/watchpoint/watchpoint_on_vectors/TestValueOfVectorVariable.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/watchpoint/watchpoint_on_vectors/TestValueOfVectorVariable.py?rev=250189&r1=250188&r2=250189&view=diff
==
--- 
lldb/trunk/test/functionalities/watchpoint/watchpoint_on_vectors/TestValueOfVectorVariable.py
 (original)
+++ 
lldb/trunk/test/functionalities/watchpoint/watchpoint_on_vectors/TestValueOfVectorVariable.py
 Tue Oct 13 12:55:58 2015
@@ -13,6 +13,7 @@ class TestValueOfVectorVariableTestCase(
 mydir = TestBase.compute_mydir(__file__)
 
 @expectedFailureAndroid(archs=['arm', 'aarch64']) # Watchpoints not 
supported
+@expectedFailureWindows("llvm.org/pr24446") # WINDOWS XFAIL TRIAGE - 
Watchpoints not supported on Windows
 def test_value_of_vector_variable_using_watchpoint_set(self):
 """Test verify displayed value of vector variable."""
 self.build(dictionary=self.d)


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


[Lldb-commits] [lldb] r250195 - Fix ref counting of Python objects.

2015-10-13 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Tue Oct 13 13:16:15 2015
New Revision: 250195

URL: http://llvm.org/viewvc/llvm-project?rev=250195&view=rev
Log:
Fix ref counting of Python objects.

PythonObjects were being incorrectly ref-counted. This problem was
pervasive throughout the codebase, leading to an unknown number of memory
leaks and potentially use-after-free.

The issue stems from the fact that Python native methods can either return
"borrowed" references or "owned" references. For the former category, you
*must* incref it prior to decrefing it. And for the latter category, you
should not incref it before decrefing it. This is mostly an issue when a
Python C API method returns a `PyObject` to you, but it can also happen with
a method accepts a `PyObject`. Notably, this happens in `PyList_SetItem`,
which is documented to "steal" the reference that you give it. So if you
pass something to `PyList_SetItem`, you cannot hold onto it unless you
incref it first. But since this is one of only two exceptions in the
entire API, it's confusing and difficult to remember.

Our `PythonObject` class was indiscriminantely increfing every object it
received, which means that if you passed it an owned reference, you now
have a dangling reference since owned references should not be increfed.
We were doing this in quite a few places.

There was also a fair amount of manual increfing and decrefing prevalent
throughout the codebase, which is easy to get wrong.

This patch solves the problem by making any construction of a
`PythonObject` from a `PyObject` take a flag which indicates whether it is
an owned reference or a borrowed reference. There is no way to construct a
`PythonObject` without this flag, and it does not offer a default value,
forcing the user to make an explicit decision every time.

All manual uses of `PyObject` have been cleaned up throughout the codebase
and replaced with `PythonObject` in order to make RAII the predominant
pattern when dealing with native Python objects.

Differential Revision: http://reviews.llvm.org/D13617
Reviewed By: Greg Clayton

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
lldb/trunk/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp

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=250195&r1=250194&r2=250195&view=diff
==
--- lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp 
(original)
+++ lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp 
Tue Oct 13 13:16:15 2015
@@ -37,7 +37,7 @@ StructuredPythonObject::Dump(Stream &s)
 //--
 
 void
-PythonObject::Dump (Stream &strm) const
+PythonObject::Dump(Stream &strm) const
 {
 if (m_py_obj)
 {
@@ -64,7 +64,7 @@ PythonObject::Dump (Stream &strm) const
 PyObjectType
 PythonObject::GetObjectType() const
 {
-if (IsNULLOrNone())
+if (!IsAllocated())
 return PyObjectType::None;
 
 if (PyList_Check(m_py_obj))
@@ -87,31 +87,43 @@ PythonObject::GetObjectType() const
 }
 
 PythonString
-PythonObject::Repr ()
+PythonObject::Repr()
 {
 if (!m_py_obj)
-return PythonString ();
+return PythonString();
 PyObject *repr = PyObject_Repr(m_py_obj);
 if (!repr)
-return PythonString ();
-return PythonString(repr);
+return PythonString();
+return PythonString(PyRefType::Owned, repr);
 }
 
 PythonString
-PythonObject::Str ()
+PythonObject::Str()
 {
 if (!m_py_obj)
-return PythonString ();
+return PythonString();
 PyObject *str = PyObject_Str(m_py_obj);
 if (!str)
-return PythonString ();
-return PythonString(str);
+return PythonString();
+return PythonString(PyRefType::Owned, str);
 }
 
 bool
-PythonObject::IsNULLOrNone () const
+PythonObject::IsNone() const
 {
-return ((m_py_obj == nullptr) || (m_py_obj == Py_None));
+return m_py_obj == Py_None;
+}
+
+bool
+PythonObject::IsValid() const
+{
+return m_py_obj != nullptr;
+}
+
+bool
+PythonObject::IsAllocated() const
+{
+return IsValid() && !IsNone();
 }
 
 StructuredData::ObjectSP
@@ -120,13 +132,13 @@ PythonObject::CreateStructuredObject() c
 switch (GetObjectType())
 {
 case PyObjectType::Dictionary:
-return PythonDictionary(m_py_obj).CreateStructuredDictionary();
+return PythonDictionary(PyRefType::Borrowed, 
m_py_obj).CreateStructuredDictionary();
 case PyObjectType::Integer:
-return PythonInt

[Lldb-commits] [lldb] r250213 - Change PyFile_FromFile to use PyFile_FromFd when using Py3.

2015-10-13 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Tue Oct 13 14:32:53 2015
New Revision: 250213

URL: http://llvm.org/viewvc/llvm-project?rev=250213&view=rev
Log:
Change PyFile_FromFile to use PyFile_FromFd when using Py3.

Modified:

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

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=250213&r1=250212&r2=250213&view=diff
==
--- 
lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp 
(original)
+++ 
lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp 
Tue Oct 13 14:32:53 2015
@@ -468,11 +468,23 @@ ScriptInterpreterPython::LeaveSession ()
 }
 
 static PythonObject
-PyFile_FromFile_Const(FILE *fp, const char *name, const char *mode, int 
(*close)(FILE *))
+PyFile_FromFile_Const(FILE *fp, char *mode)
 {
+char *cmode = const_cast(mode);
+#if PY_MAJOR_VERSION >= 3
+#if defined(LLVM_ON_WIN32)
+int fd = _fileno(fp);
+#else
+int fd = fileno(fp);
+#endif
+
+return PyRef(PyRefType::Owned,
+PyFile_FromFd(fd, nullptr, cmode, -1, nullptr, "ignore", nullptr, 0));
+#else
 // Read through the Python source, doesn't seem to modify these strings
 return PythonObject(PyRefType::Owned, 
-PyFile_FromFile(fp, const_cast(name), const_cast(mode), 
close));
+PyFile_FromFile(fp, const_cast(""), cmode, nullptr));
+#endif
 }
 
 bool
@@ -540,7 +552,7 @@ ScriptInterpreterPython::EnterSession (u
 {
 m_saved_stdin = 
sys_module_dict.GetItemForKey(PythonString("stdin"));
 // This call can deadlock your process if the file is locked
-PythonObject new_file = PyFile_FromFile_Const(in, "", "r", 
nullptr);
+PythonObject new_file = PyFile_FromFile_Const(in, "r");
 sys_module_dict.SetItemForKey (PythonString("stdin"), 
new_file);
 }
 }
@@ -551,7 +563,7 @@ ScriptInterpreterPython::EnterSession (u
 {
 m_saved_stdout = 
sys_module_dict.GetItemForKey(PythonString("stdout"));
 
-PythonObject new_file = PyFile_FromFile_Const(out, "", "w", 
nullptr);
+PythonObject new_file = PyFile_FromFile_Const(out, "w");
 sys_module_dict.SetItemForKey (PythonString("stdout"), new_file);
 }
 else
@@ -563,7 +575,7 @@ ScriptInterpreterPython::EnterSession (u
 {
 m_saved_stderr = 
sys_module_dict.GetItemForKey(PythonString("stderr"));
 
-PythonObject new_file = PyFile_FromFile_Const(err, "", "w", 
nullptr);
+PythonObject new_file = PyFile_FromFile_Const(err, "w");
 sys_module_dict.SetItemForKey (PythonString("stderr"), new_file);
 }
 else


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


Re: [Lldb-commits] [PATCH] D13699: RenderScript command for printing allocation contents.

2015-10-13 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.


Repository:
  rL LLVM

http://reviews.llvm.org/D13699



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


Re: [Lldb-commits] [PATCH] D13652: Change ConstString to support massive multi-threaded access

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

I would still like to get down to hashing the string once at some point, but we 
can start with this and iterate on it.


http://reviews.llvm.org/D13652



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


[Lldb-commits] [PATCH] D13706: Update swig typemaps and interfaces to not call PyString_FromStringAndSize

2015-10-13 Thread Zachary Turner via lldb-commits
zturner created this revision.
zturner added reviewers: clayborg, granata.enrico.
zturner added a subscriber: lldb-commits.

Python 3's native API has a number of incompatibilities with Python 2's.  Most 
of these incompatibilities are hidden inside of the various `PythonObject` 
classes, but our swig typemaps and interfaces use Python native APIs directly.

This patch addresses the first of these incompatibilities, the use of 
`PyString_FromStringAndSize`.  It is fixed by changing these to use 
`PythonString.  It's possible more work may need to be done here in the future 
because there are still numerous calls to native Python APIs from the swig 
typemaps, but for now this is the minimum amount of work necessary to get a 
successful compilation under Python 3.

The second of these incompatibilities, the use of various `PyFile_xxx` 
functions, will be addressed in a followup patch.

http://reviews.llvm.org/D13706

Files:
  scripts/Python/python-extensions.swig
  scripts/Python/python-typemaps.swig
  scripts/lldb.swig
  source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
  source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp

Index: source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
===
--- source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
+++ source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
@@ -478,7 +478,7 @@
 int fd = fileno(fp);
 #endif
 
-return PyRef(PyRefType::Owned,
+return PythonObject(PyRefType::Owned,
 PyFile_FromFd(fd, nullptr, cmode, -1, nullptr, "ignore", nullptr, 0));
 #else
 // Read through the Python source, doesn't seem to modify these strings
Index: source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
===
--- source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
+++ source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
@@ -122,7 +122,7 @@
 {
 // Avoid calling the virtual method if it's not necessary
 // to actually validate the type of the PyObject.
-if (!rhs.get())
+if (!rhs.IsValid())
 Reset();
 else
 Reset(PyRefType::Borrowed, rhs.m_py_obj);
@@ -167,12 +167,21 @@
 Dump (Stream &strm) const;
 
 PyObject*
-get () const
+get() const
 {
 return m_py_obj;
 }
 
-PyObjectType GetObjectType() const;
+PyObject*
+release()
+{
+PyObject *result = m_py_obj;
+m_py_obj = nullptr;
+return result;
+}
+
+PyObjectType
+GetObjectType() const;
 
 PythonString
 Repr ();
Index: scripts/lldb.swig
===
--- scripts/lldb.swig
+++ scripts/lldb.swig
@@ -111,8 +111,9 @@
 #include "lldb/API/SBWatchpoint.h"
 #include "lldb/API/SBUnixSignals.h"
 
-#include "../scripts/Python/python-swigsafecast.swig"
+#include "../source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h"
 
+#include "../scripts/Python/python-swigsafecast.swig"
 %}
 
 /* Various liblldb typedefs that SWIG needs to know about.  */
@@ -121,6 +122,7 @@
as INT32_MAX should only be defined if __STDC_LIMIT_MACROS is. */
 #define __STDC_LIMIT_MACROS
 %include "stdint.i"
+
 %include "lldb/lldb-defines.h"
 %include "lldb/lldb-enumerations.h"
 %include "lldb/lldb-forward.h"
Index: scripts/Python/python-typemaps.swig
===
--- scripts/Python/python-typemaps.swig
+++ scripts/Python/python-typemaps.swig
@@ -63,10 +63,10 @@
   int i;
   len = 0;
   while ($1[len]) len++;
-  $result = PyList_New(len);
-  for (i = 0; i < len; i++) {
-PyList_SetItem($result, i, PyString_FromString($1[i]));
-  }
+  lldb_private::PythonList list(len);
+  for (i = 0; i < len; i++)
+list.SetItemAtIndex(i, lldb_private::PythonString($1[i]));
+  $result = list.release();
 }
 
 %typemap(in) char const ** {
@@ -147,7 +147,8 @@
 // See also SBThread::GetStopDescription.
 %typemap(argout) (char *dst, size_t dst_len) {
Py_XDECREF($result);   /* Blow away any previous result */
-   $result = PyString_FromStringAndSize(($1),result);
+   lldb_private::PythonString str($1);
+   $result = str.release();
free($1);
 }
 
@@ -237,7 +238,9 @@
 // See also SBProcess::ReadMemory.
 %typemap(argout) (void *buf, size_t size) {
Py_XDECREF($result);   /* Blow away any previous result */
-   $result = PyString_FromStringAndSize(static_cast($1),result);
+   llvm::StringRef ref(static_cast($1), result);
+   lldb_private::PythonString string(ref);
+   $result = string.release();
free($1);
 }
 
Index: scripts/Python/python-extensions.swig
===
--- scripts/Python/python-extensions.swig
+++ scripts/Python/python-extensions.swig
@@ -8,9 +8,9 @@
 if (desc_len > 0 && (desc[desc_len-1] == '\

[Lldb-commits] [PATCH] D13707: Remove definition of ~PlatformNetBSD(), since its declaration is marked as '= default'

2015-10-13 Thread Kamil Rytarowski via lldb-commits
krytarowski created this revision.
krytarowski added a reviewer: joerg.
krytarowski added a subscriber: lldb-commits.
krytarowski set the repository for this revision to rL LLVM.

Local definition of ~PlatformNetBSD() results with a compiler error.

Repository:
  rL LLVM

http://reviews.llvm.org/D13707

Files:
  source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp

Index: source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp
===
--- source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp
+++ source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp
@@ -290,19 +290,6 @@
 {
 }
 
-//--
-/// Destructor.
-///
-/// The destructor is virtual since this class is designed to be
-/// inherited from by the plug-in instance.
-//--
-PlatformNetBSD::~PlatformNetBSD()
-{
-}
-
-//TODO:VK: inherit PlatformPOSIX
-
-
 bool
 PlatformNetBSD::GetRemoteOSVersion ()
 {


Index: source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp
===
--- source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp
+++ source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp
@@ -290,19 +290,6 @@
 {
 }
 
-//--
-/// Destructor.
-///
-/// The destructor is virtual since this class is designed to be
-/// inherited from by the plug-in instance.
-//--
-PlatformNetBSD::~PlatformNetBSD()
-{
-}
-
-//TODO:VK: inherit PlatformPOSIX
-
-
 bool
 PlatformNetBSD::GetRemoteOSVersion ()
 {
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D12809: Better scheme to lookup alternate mangled name when looking up function address.

2015-10-13 Thread Siva Chandra via lldb-commits
sivachandra added a comment.

Ping. I have few follow up changes over whatever goes in here. Would greatly 
appreciate if someone can make a decision on this, or advice on how to take 
this forward.


http://reviews.llvm.org/D12809



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


[Lldb-commits] [lldb] r250248 - Added tree panels.

2015-10-13 Thread Greg Clayton via lldb-commits
Author: gclayton
Date: Tue Oct 13 18:16:29 2015
New Revision: 250248

URL: http://llvm.org/viewvc/llvm-project?rev=250248&view=rev
Log:
Added tree panels.


Modified:
lldb/trunk/test/lldbcurses.py

Modified: lldb/trunk/test/lldbcurses.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldbcurses.py?rev=250248&r1=250247&r2=250248&view=diff
==
--- lldb/trunk/test/lldbcurses.py (original)
+++ lldb/trunk/test/lldbcurses.py Tue Oct 13 18:16:29 2015
@@ -89,7 +89,17 @@ class Window(object):
 self.key_actions[key_integer] = key_action_dict
 else:
 raise ValueError
-   
+
+def draw_title_box(self, title):
+is_in_first_responder_chain = self.is_in_first_responder_chain()
+if is_in_first_responder_chain:
+self.attron (curses.A_REVERSE)
+self.box()
+if is_in_first_responder_chain:
+self.attroff (curses.A_REVERSE)
+if title:
+self.addstr(Point(x=2, y=0), ' ' + title + ' ')
+
 def remove_child(self, window):
 self.children.remove(window)
 
@@ -187,7 +197,13 @@ class Window(object):
 size = self.get_size()
 return pt.x >= 0 and pt.x < size.w and pt.y >= 0 and pt.y < size.h
 
-def addch(self, pt, c):
+def addch(self, c):
+try:
+self.window.addch(c)
+except:
+pass
+
+def addch_at_point(self, pt, c):
 try:
 self.window.addch(pt.y, pt.x, c)
 except:
@@ -199,11 +215,16 @@ class Window(object):
 except:
 pass
 
-def addnstr(self, pt, str, n):
+def addnstr_at_point(self, pt, str, n):
 try:
 self.window.addnstr(pt.y, pt.x, str, n)
 except:
 pass
+def addnstr(self, str, n):
+try:
+self.window.addnstr(str, n)
+except:
+pass
 
 def attron(self, attr):
 return self.window.attron (attr)
@@ -235,6 +256,10 @@ class Window(object):
 
 def erase(self):
 self.window.erase()
+
+def get_cursor(self):
+(y, x) = self.window.getyx()
+return Point(x=x, y=y)
 
 def get_frame(self):
 position = self.get_position()
@@ -249,9 +274,13 @@ class Window(object):
 (y, x) = self.window.getmaxyx()
 return Size(w=x, h=y)
 
+def move(self, pt):
+self.window.move(pt.y, pt.x)
+
 def refresh(self):
 self.update()
 curses.panel.update_panels()
+self.move(Point(x=0, y=0))
 return self.window.refresh()
 
 def resize(self, size):
@@ -475,15 +504,8 @@ class BoxedPanel(Panel):
 self.update()
 
 def update(self):
-self.erase()
-is_in_first_responder_chain = self.is_in_first_responder_chain()
-if is_in_first_responder_chain:
-self.attron (curses.A_REVERSE)
-self.box()
-if is_in_first_responder_chain:
-self.attroff (curses.A_REVERSE)
-if self.title:
-self.addstr(Point(x=2, y=0), ' ' + self.title + ' ')
+self.erase()
+self.draw_title_box(self.title)
 max_width = self.get_usable_width()
 for line_idx in range(self.first_visible_idx, len(self.lines)):
 pt = self.get_point_for_line(line_idx)
@@ -491,7 +513,7 @@ class BoxedPanel(Panel):
 is_selected = line_idx == self.selected_idx
 if is_selected:
 self.attron (curses.A_REVERSE)
-self.addnstr(pt, self.lines[line_idx], max_width)
+self.addnstr_at_point(pt, self.lines[line_idx], max_width)
 if is_selected:
 self.attroff (curses.A_REVERSE)
 else:
@@ -501,7 +523,251 @@ class Item(object):
 def __init__(self, title, action):
 self.title = title
 self.action = action
+
+class TreeItem(object):
+def __init__(self, delegate, parent = None, title = None, action = None, 
is_expanded = False):
+self.parent = parent
+self.title = title
+self.action = action
+self.delegate = delegate
+self.is_expanded = not parent or is_expanded == True
+self.might_have_children_value = None
+self.children = None
+   
+def get_children(self):
+if self.is_expanded and self.might_have_children():
+if self.children is None:
+self.children = self.update_children()
+else:
+self.children = None
+return self.children
+
+def append_visible_items(self, items):
+items.append(self)
+children = self.get_children()
+if children:
+for child in children:
+child.append_visible_items(items)
+
+def might

Re: [Lldb-commits] [PATCH] D13707: Remove definition of ~PlatformNetBSD(), since its declaration is marked as '= default'

2015-10-13 Thread Bruce Mitchener via lldb-commits
brucem added a subscriber: brucem.
brucem accepted this revision.
brucem added a reviewer: brucem.
brucem added a comment.
This revision is now accepted and ready to land.

lgtm.

will land shortly for you.


Repository:
  rL LLVM

http://reviews.llvm.org/D13707



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


[Lldb-commits] [lldb] r250249 - Remove definition of ~PlatformNetBSD(), since its declaration is marked as '= default'

2015-10-13 Thread Bruce Mitchener via lldb-commits
Author: brucem
Date: Tue Oct 13 18:22:40 2015
New Revision: 250249

URL: http://llvm.org/viewvc/llvm-project?rev=250249&view=rev
Log:
Remove definition of ~PlatformNetBSD(), since its declaration is marked as '= 
default'

Summary: Local definition of ~PlatformNetBSD() results with a compiler error.

Patch by Kamil Rytarowski. Thanks!

Reviewers: joerg, brucem

Subscribers: brucem, lldb-commits

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

Modified:
lldb/trunk/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp

Modified: lldb/trunk/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp?rev=250249&r1=250248&r2=250249&view=diff
==
--- lldb/trunk/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp Tue Oct 13 
18:22:40 2015
@@ -290,19 +290,6 @@ PlatformNetBSD::PlatformNetBSD (bool is_
 {
 }
 
-//--
-/// Destructor.
-///
-/// The destructor is virtual since this class is designed to be
-/// inherited from by the plug-in instance.
-//--
-PlatformNetBSD::~PlatformNetBSD()
-{
-}
-
-//TODO:VK: inherit PlatformPOSIX
-
-
 bool
 PlatformNetBSD::GetRemoteOSVersion ()
 {


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


Re: [Lldb-commits] [PATCH] D12809: Better scheme to lookup alternate mangled name when looking up function address.

2015-10-13 Thread Greg Clayton via lldb-commits
clayborg resigned from this revision.
clayborg edited reviewers, added: jingham; removed: clayborg.
clayborg added a comment.

I will get Sean to take a look.


http://reviews.llvm.org/D12809



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


Re: [Lldb-commits] [PATCH] D13707: Remove definition of ~PlatformNetBSD(), since its declaration is marked as '= default'

2015-10-13 Thread Bruce Mitchener via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL250249: Remove definition of ~PlatformNetBSD(), since its 
declaration is marked as '=… (authored by brucem).

Changed prior to commit:
  http://reviews.llvm.org/D13707?vs=37284&id=37298#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D13707

Files:
  lldb/trunk/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp

Index: lldb/trunk/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp
===
--- lldb/trunk/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp
+++ lldb/trunk/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp
@@ -290,19 +290,6 @@
 {
 }
 
-//--
-/// Destructor.
-///
-/// The destructor is virtual since this class is designed to be
-/// inherited from by the plug-in instance.
-//--
-PlatformNetBSD::~PlatformNetBSD()
-{
-}
-
-//TODO:VK: inherit PlatformPOSIX
-
-
 bool
 PlatformNetBSD::GetRemoteOSVersion ()
 {


Index: lldb/trunk/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp
===
--- lldb/trunk/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp
+++ lldb/trunk/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp
@@ -290,19 +290,6 @@
 {
 }
 
-//--
-/// Destructor.
-///
-/// The destructor is virtual since this class is designed to be
-/// inherited from by the plug-in instance.
-//--
-PlatformNetBSD::~PlatformNetBSD()
-{
-}
-
-//TODO:VK: inherit PlatformPOSIX
-
-
 bool
 PlatformNetBSD::GetRemoteOSVersion ()
 {
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D13707: Remove definition of ~PlatformNetBSD(), since its declaration is marked as '= default'

2015-10-13 Thread Kamil Rytarowski via lldb-commits
krytarowski added a comment.

Thank you!


Repository:
  rL LLVM

http://reviews.llvm.org/D13707



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


[Lldb-commits] [lldb] r250253 - ArchSpec: fix unintentional promotion of unspecified unknowns to specified unknowns

2015-10-13 Thread Todd Fiala via lldb-commits
Author: tfiala
Date: Tue Oct 13 18:41:19 2015
New Revision: 250253

URL: http://llvm.org/viewvc/llvm-project?rev=250253&view=rev
Log:
ArchSpec: fix unintentional promotion of unspecified unknowns to specified 
unknowns

* ArchSpec::MergeFrom() would erroneously promote an unspecified
  unknown to a specified unknown when both the ArchSpec and the merged
  in ArchSpec were both unspecified unknowns. This no longer happens,
  which fixes issues with global module cache lookup in some
  situations.

* Added ArchSpec::DumpTriple(Stream&) that now properly prints
  unspecified unknowns as '*' and specified unknows as 'unknown'.
  This makes it trivial to tell the difference between the two.
  Converted printing code over ot using DumpTriple() rather than
  building from scratch.

* Fixed up a couple places that were not guaranteeing that an
  unspecified unknown was recorded as such.

Modified:
lldb/trunk/include/lldb/Core/ArchSpec.h
lldb/trunk/include/lldb/Core/ModuleSpec.h
lldb/trunk/source/Commands/CommandObjectTarget.cpp
lldb/trunk/source/Core/ArchSpec.cpp
lldb/trunk/source/Host/linux/HostInfoLinux.cpp
lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
lldb/trunk/source/Target/Platform.cpp
lldb/trunk/source/Target/Process.cpp
lldb/trunk/source/Target/TargetList.cpp

lldb/trunk/test/functionalities/object-file/TestImageListMultiArchitecture.py

Modified: lldb/trunk/include/lldb/Core/ArchSpec.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ArchSpec.h?rev=250253&r1=250252&r2=250253&view=diff
==
--- lldb/trunk/include/lldb/Core/ArchSpec.h (original)
+++ lldb/trunk/include/lldb/Core/ArchSpec.h Tue Oct 13 18:41:19 2015
@@ -341,11 +341,23 @@ public:
 }
 
 bool
+TripleVendorIsUnspecifiedUnknown() const
+{
+return m_triple.getVendor() == llvm::Triple::UnknownVendor && 
m_triple.getVendorName().empty();
+}
+
+bool
 TripleOSWasSpecified() const
 {
 return !m_triple.getOSName().empty();
 }
 
+bool
+TripleOSIsUnspecifiedUnknown() const
+{
+return m_triple.getOS() == llvm::Triple::UnknownOS && 
m_triple.getOSName().empty();
+}
+
 //--
 /// Merges fields from another ArchSpec into this ArchSpec.
 ///
@@ -484,6 +496,9 @@ public:
 return m_triple;
 }
 
+void
+DumpTriple(Stream &s) const;
+
 //--
 /// Architecture tripple setter.
 ///

Modified: lldb/trunk/include/lldb/Core/ModuleSpec.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ModuleSpec.h?rev=250253&r1=250252&r2=250253&view=diff
==
--- lldb/trunk/include/lldb/Core/ModuleSpec.h (original)
+++ lldb/trunk/include/lldb/Core/ModuleSpec.h Tue Oct 13 18:41:19 2015
@@ -329,7 +329,7 @@ public:
 }
 
 void
-Dump (Stream &strm)
+Dump (Stream &strm) const
 {
 bool dumped_something = false;
 if (m_file)
@@ -361,7 +361,8 @@ public:
 {
 if (dumped_something)
 strm.PutCString(", ");
-strm.Printf("arch = %s", m_arch.GetTriple().str().c_str());
+strm.Printf("arch = ");
+m_arch.DumpTriple(strm);
 dumped_something = true;
 }
 if (m_uuid.IsValid())

Modified: lldb/trunk/source/Commands/CommandObjectTarget.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectTarget.cpp?rev=250253&r1=250252&r2=250253&view=diff
==
--- lldb/trunk/source/Commands/CommandObjectTarget.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectTarget.cpp Tue Oct 13 18:41:19 2015
@@ -79,7 +79,8 @@ DumpTargetInfo (uint32_t target_idx, Tar
 uint32_t properties = 0;
 if (target_arch.IsValid())
 {
-strm.Printf ("%sarch=%s", properties++ > 0 ? ", " : " ( ", 
target_arch.GetTriple().str().c_str());
+strm.Printf ("%sarch=", properties++ > 0 ? ", " : " ( ");
+target_arch.DumpTriple (strm);
 properties++;
 }
 PlatformSP platform_sp (target->GetPlatform());
@@ -1459,15 +1460,18 @@ DumpModuleArchitecture (Stream &strm, Mo
 {
 if (module)
 {
-const char *arch_cstr;
+StreamString arch_strm;
+
 if (full_triple)
-arch_cstr = module->GetArchitecture().GetTriple().str().c_str();
+module->GetArchitecture().DumpTriple(arch_strm);
 else
-arch_cstr = module->GetArchitecture().GetArchitectureName();
+
arch_strm.PutCString(module->GetArchitecture().GetArchitectureName());
+std::string arch_str = arch_strm.GetString();
+
 if (width)
-strm.Printf(

[Lldb-commits] [PATCH] D13711: Add initial CMake glue for the NetBSD platform

2015-10-13 Thread Kamil Rytarowski via lldb-commits
krytarowski created this revision.
krytarowski added a reviewer: joerg.
krytarowski added a subscriber: lldb-commits.
krytarowski set the repository for this revision to rL LLVM.

These changes aren't everything what is needed for the CMake target, but it's 
significantly approaching it.

These changes shouldn't effect the build process on other platforms.

Repository:
  rL LLVM

http://reviews.llvm.org/D13711

Files:
  source/CMakeLists.txt
  source/Host/CMakeLists.txt
  source/Plugins/Platform/CMakeLists.txt
  source/Plugins/Platform/NetBSD/CMakeLists.txt
  source/Plugins/Process/CMakeLists.txt
  tools/lldb-server/CMakeLists.txt

Index: tools/lldb-server/CMakeLists.txt
===
--- tools/lldb-server/CMakeLists.txt
+++ tools/lldb-server/CMakeLists.txt
@@ -14,6 +14,13 @@
   )
 endif ()
 
+if ( CMAKE_SYSTEM_NAME MATCHES "NetBSD" )
+include_directories(
+  ../../../../llvm/include
+  ../../source/Plugins/Process/POSIX
+  )
+endif ()
+
 include_directories(../../source)
 
 include(../../cmake/LLDBDependencies.cmake)
Index: source/Plugins/Process/CMakeLists.txt
===
--- source/Plugins/Process/CMakeLists.txt
+++ source/Plugins/Process/CMakeLists.txt
@@ -4,6 +4,8 @@
 elseif (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
   add_subdirectory(FreeBSD)
   add_subdirectory(POSIX)
+elseif (CMAKE_SYSTEM_NAME MATCHES "NetBSD")
+  add_subdirectory(POSIX)
 elseif (CMAKE_SYSTEM_NAME MATCHES "Windows")
   add_subdirectory(Windows/Live)
   add_subdirectory(Windows/MiniDump)
Index: source/Plugins/Platform/NetBSD/CMakeLists.txt
===
--- /dev/null
+++ source/Plugins/Platform/NetBSD/CMakeLists.txt
@@ -0,0 +1,3 @@
+add_lldb_library(lldbPluginPlatformNetBSD
+  PlatformNetBSD.cpp
+  )
Index: source/Plugins/Platform/CMakeLists.txt
===
--- source/Plugins/Platform/CMakeLists.txt
+++ source/Plugins/Platform/CMakeLists.txt
@@ -2,6 +2,8 @@
   add_subdirectory(Linux)
 #elseif (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
   add_subdirectory(FreeBSD)
+#elseif (CMAKE_SYSTEM_NAME MATCHES "NetBSD")
+  add_subdirectory(NetBSD)
 #elseif (CMAKE_SYSTEM_NAME MATCHES "Darwin")
   add_subdirectory(MacOSX)
 #elseif (CMAKE_SYSTEM_NAME MATCHES "Windows")
Index: source/Host/CMakeLists.txt
===
--- source/Host/CMakeLists.txt
+++ source/Host/CMakeLists.txt
@@ -133,13 +133,22 @@
 linux/ThisThread.cpp
 )
 endif()
+
   elseif (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
 add_host_subdirectory(freebsd
   freebsd/Host.cpp
   freebsd/HostInfoFreeBSD.cpp
   freebsd/HostThreadFreeBSD.cpp
   freebsd/ThisThread.cpp
   )
+
+  elseif (CMAKE_SYSTEM_NAME MATCHES "NetBSD")
+add_host_subdirectory(netbsd
+  netbsd/Host.cpp
+  netbsd/HostInfoNetBSD.cpp
+  netbsd/HostThreadNetBSD.cpp
+  netbsd/ThisThread.cpp
+  )
   endif()
 endif()
 
@@ -157,3 +166,7 @@
 endif()
 
 add_lldb_library(lldbHost ${HOST_SOURCES})
+
+if (CMAKE_SYSTEM_NAME MATCHES "NetBSD")
+target_link_libraries(lldbHost kvm)
+endif ()
Index: source/CMakeLists.txt
===
--- source/CMakeLists.txt
+++ source/CMakeLists.txt
@@ -14,6 +14,13 @@
   )
 endif ()
 
+if ( CMAKE_SYSTEM_NAME MATCHES "NetBSD" )
+include_directories(
+  Plugins/Process/POSIX
+  )
+endif ()
+
+
 set(lldbBase_SOURCES
 lldb.cpp
   )
@@ -83,4 +90,3 @@
 endif ()
 # FIXME: implement svn/git revision and repository parsing solution on Windows. There is an SVN-only
 #revision parsing solution in tools/clang/lib/Basic/CMakelists.txt.
-
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


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

2015-10-13 Thread Kamil Rytarowski via lldb-commits
krytarowski created this revision.
krytarowski added a reviewer: joerg.
krytarowski added a subscriber: lldb-commits.
krytarowski set the repository for this revision to rL LLVM.
Herald added subscribers: srhines, danalbert, tberghammer.

These changes aren't everything what is needed for the autotools target, but 
it's significantly approaching it.

These changes shouldn't effect the build process on other platforms.

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
 
+ifneq ($(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
 
+ifneq ($(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-13 Thread Bruce Mitchener via lldb-commits
brucem added a subscriber: brucem.
brucem added a comment.

Hopefully some helpful comments that will help keep this code in line with 
changes that we're making to other parts of the codebase in bulk ...



Comment at: include/lldb/Symbol/GoASTContext.h:394
@@ +393,3 @@
+}
+virtual UserExpression *GetUserExpression(const char *expr, const char 
*expr_prefix, lldb::LanguageType language,
+  Expression::ResultType 
desired_type) override;

Don't need `virtual` here since it already has `override` (most of the code 
that has `override` doesn't have `virtual` as well).


Comment at: source/Plugins/ExpressionParser/Go/GoAST.h:181
@@ +180,3 @@
+GoASTArrayType(GoASTExpr* len, GoASTExpr* elt) : GoASTExpr(eArrayType), 
m_len(len), m_elt(elt) {}
+virtual ~GoASTArrayType() { }
+

I think a lot of these destructors could be `~GoASTArrayType override = 
default;` ? (for this and other classes here)


Comment at: source/Plugins/ExpressionParser/Go/GoAST.h:183
@@ +182,3 @@
+
+const char* GetKindName() const { return "ArrayType"; }
+

This should have `override` on it.


Comment at: source/Plugins/ExpressionParser/Go/GoAST.h:209
@@ +208,3 @@
+
+const char* GetKindName() const { return "AssignStmt"; }
+

This should have `override` as well.


Comment at: source/Plugins/ExpressionParser/Go/GoAST.h:241
@@ +240,3 @@
+
+const char* GetKindName() const { return "BadDecl"; }
+

`override` here too and the rest of the `GetKindName` overrides.


Comment at: source/Plugins/ExpressionParser/Go/GoAST.h:2004
@@ +2003,3 @@
+
+default:
+break;

Could this default go away if all of the possible values for that enumeration 
are covered here? If so, we'd get a compile time warning here when someone adds 
something to the enumeration.


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] [lldb] r250267 - [LLDB][MIPS64] Adding mips64 reaturn address register for unwind plan

2015-10-13 Thread Mohit K. Bhakkad via lldb-commits
Author: mohit.bhakkad
Date: Wed Oct 14 00:20:03 2015
New Revision: 250267

URL: http://llvm.org/viewvc/llvm-project?rev=250267&view=rev
Log:
[LLDB][MIPS64] Adding mips64 reaturn address register for unwind plan

Modified:
lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp

Modified: 
lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp?rev=250267&r1=250266&r2=250267&view=diff
==
--- lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp 
(original)
+++ lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp 
Wed Oct 14 00:20:03 2015
@@ -738,6 +738,7 @@ EmulateInstructionMIPS64::CreateFunction
 unwind_plan.SetSourceName ("EmulateInstructionMIPS64");
 unwind_plan.SetSourcedFromCompiler (eLazyBoolNo);
 unwind_plan.SetUnwindPlanValidAtAllInstructions (eLazyBoolYes);
+unwind_plan.SetReturnAddressRegister (dwarf_ra_mips64);
 
 return true;
 }


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


[Lldb-commits] [lldb] r250272 - [LLDB] Adding mips32 in the list of archs with watchpoint_exceptions_received=before

2015-10-13 Thread Mohit K. Bhakkad via lldb-commits
Author: mohit.bhakkad
Date: Wed Oct 14 00:42:11 2015
New Revision: 250272

URL: http://llvm.org/viewvc/llvm-project?rev=250272&view=rev
Log:
[LLDB] Adding mips32 in the list of archs with 
watchpoint_exceptions_received=before

Modified:

lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp

Modified: 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp?rev=250272&r1=250271&r2=250272&view=diff
==
--- 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
 (original)
+++ 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
 Wed Oct 14 00:42:11 2015
@@ -186,7 +186,9 @@ GDBRemoteCommunicationServerCommon::Hand
 host_arch.GetMachine() == llvm::Triple::arm ||
 host_arch.GetMachine() == llvm::Triple::armeb ||
 host_arch.GetMachine() == llvm::Triple::mips64 ||
-host_arch.GetMachine() == llvm::Triple::mips64el)
+host_arch.GetMachine() == llvm::Triple::mips64el ||
+host_arch.GetMachine() == llvm::Triple::mips ||
+host_arch.GetMachine() == llvm::Triple::mipsel)
 response.Printf("watchpoint_exceptions_received:before;");
 else
 response.Printf("watchpoint_exceptions_received:after;");


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


Re: [Lldb-commits] [PATCH] D13667: cmake: provide flag that enables 'log enable --stack' to provide useful file/line info on POSIX systems

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

I've been using this now for a couple days and it seems to work fine on both OS 
X and Linux.  The Linux side enables the 'log enable --stack' to work.

Any concerns with this?


http://reviews.llvm.org/D13667



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


Re: [Lldb-commits] [PATCH] D13667: cmake: provide flag that enables 'log enable --stack' to provide useful file/line info on POSIX systems

2015-10-13 Thread Bruce Mitchener via lldb-commits
brucem added a subscriber: brucem.
brucem accepted this revision.
brucem added a reviewer: brucem.
brucem added a comment.
This revision is now accepted and ready to land.

lgtm


http://reviews.llvm.org/D13667



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