[Lldb-commits] [PATCH] D12925: [cmake] Build lldb-server on Darwin, set dep on FreeBSD.

2015-09-17 Thread Bruce Mitchener via lldb-commits
brucem created this revision.
brucem added reviewers: labath, emaste, tfiala.
brucem added a subscriber: lldb-commits.

This switches the decision as to whether or not to lldb-server should
be built to check the same flag that was added that controls whether
or not it is added as a dependency to the 'lldb' target.

It also sets that flag on FreeBSD to maintain parity with the existing
build configuration / situation on FreeBSD.

http://reviews.llvm.org/D12925

Files:
  cmake/modules/LLDBConfig.cmake
  tools/CMakeLists.txt

Index: tools/CMakeLists.txt
===
--- tools/CMakeLists.txt
+++ tools/CMakeLists.txt
@@ -7,6 +7,6 @@
 if (NOT __ANDROID_NDK__)
   add_subdirectory(lldb-mi)
 endif()
-if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR CMAKE_SYSTEM_NAME MATCHES "Linux")
+if (LLDB_CAN_USE_LLDB_SERVER)
   add_subdirectory(lldb-server)
 endif()
Index: cmake/modules/LLDBConfig.cmake
===
--- cmake/modules/LLDBConfig.cmake
+++ cmake/modules/LLDBConfig.cmake
@@ -261,8 +261,9 @@
 
 # Figure out if lldb could use lldb-server.  If so, then we'll
 # ensure we build lldb-server when an lldb target is being built.
-if ( ( CMAKE_SYSTEM_NAME MATCHES "Linux" ) OR
- ( CMAKE_SYSTEM_NAME MATCHES "Darwin" ) )
+if ((CMAKE_SYSTEM_NAME MATCHES "Linux") OR
+(CMAKE_SYSTEM_NAME MATCHES "Darwin") OR
+(CMAKE_SYSTEM_NAME MATCHES "FreeBSD"))
 set(LLDB_CAN_USE_LLDB_SERVER 1)
 else()
 set(LLDB_CAN_USE_LLDB_SERVER 0)


Index: tools/CMakeLists.txt
===
--- tools/CMakeLists.txt
+++ tools/CMakeLists.txt
@@ -7,6 +7,6 @@
 if (NOT __ANDROID_NDK__)
   add_subdirectory(lldb-mi)
 endif()
-if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR CMAKE_SYSTEM_NAME MATCHES "Linux")
+if (LLDB_CAN_USE_LLDB_SERVER)
   add_subdirectory(lldb-server)
 endif()
Index: cmake/modules/LLDBConfig.cmake
===
--- cmake/modules/LLDBConfig.cmake
+++ cmake/modules/LLDBConfig.cmake
@@ -261,8 +261,9 @@
 
 # Figure out if lldb could use lldb-server.  If so, then we'll
 # ensure we build lldb-server when an lldb target is being built.
-if ( ( CMAKE_SYSTEM_NAME MATCHES "Linux" ) OR
- ( CMAKE_SYSTEM_NAME MATCHES "Darwin" ) )
+if ((CMAKE_SYSTEM_NAME MATCHES "Linux") OR
+(CMAKE_SYSTEM_NAME MATCHES "Darwin") OR
+(CMAKE_SYSTEM_NAME MATCHES "FreeBSD"))
 set(LLDB_CAN_USE_LLDB_SERVER 1)
 else()
 set(LLDB_CAN_USE_LLDB_SERVER 0)
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D12925: [cmake] Build lldb-server on Darwin, set dep on FreeBSD.

2015-09-17 Thread Bruce Mitchener via lldb-commits
brucem added a comment.

This should also address https://llvm.org/bugs/show_bug.cgi?id=24843 as 
reported by tfiala.


http://reviews.llvm.org/D12925



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


Re: [Lldb-commits] [PATCH] D12115: [LLDB-MI] Fix -data-info-line and -symbol-list-lines when Windows filenames are used.

2015-09-17 Thread Ilia K via lldb-commits
ki.stfu accepted this revision.
ki.stfu added a comment.

lgtm


Repository:
  rL LLVM

http://reviews.llvm.org/D12115



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


Re: [Lldb-commits] [PATCH] D12925: [cmake] Build lldb-server on Darwin, set dep on FreeBSD.

2015-09-17 Thread Pavel Labath via lldb-commits
labath resigned from this revision.
labath removed a reviewer: labath.
labath added a comment.

looks good to me, but i'll let others decide whether they want that


http://reviews.llvm.org/D12925



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


[Lldb-commits] [lldb] r247877 - Remove XTIMEOUT from TestAttachDenied on linux

2015-09-17 Thread Pavel Labath via lldb-commits
Author: labath
Date: Thu Sep 17 04:24:44 2015
New Revision: 247877

URL: http://llvm.org/viewvc/llvm-project?rev=247877&view=rev
Log:
Remove XTIMEOUT from TestAttachDenied on linux

Modified:
lldb/trunk/test/dosep.py

Modified: lldb/trunk/test/dosep.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/dosep.py?rev=247877&r1=247876&r2=247877&view=diff
==
--- lldb/trunk/test/dosep.py (original)
+++ lldb/trunk/test/dosep.py Thu Sep 17 04:24:44 2015
@@ -905,7 +905,6 @@ def getExpectedTimeouts(platform_name):
 
 if target.startswith("linux"):
 expected_timeout |= {
-"TestAttachDenied.py",
 "TestProcessAttach.py",
 "TestConnectRemote.py",
 "TestCreateAfterAttach.py",


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


[Lldb-commits] [lldb] r247879 - XFAIL step after crash tests on android-aarch64 API 21

2015-09-17 Thread Tamas Berghammer via lldb-commits
Author: tberghammer
Date: Thu Sep 17 05:05:21 2015
New Revision: 247879

URL: http://llvm.org/viewvc/llvm-project?rev=247879&view=rev
Log:
XFAIL step after crash tests on android-aarch64 API 21

Android-aarch64 for API21 uses sa_restore to return from a signal handler
what have no eh_frame specified.

Modified:
lldb/trunk/test/functionalities/inferior-crashing/TestInferiorCrashing.py

lldb/trunk/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py

Modified: 
lldb/trunk/test/functionalities/inferior-crashing/TestInferiorCrashing.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/inferior-crashing/TestInferiorCrashing.py?rev=247879&r1=247878&r2=247879&view=diff
==
--- lldb/trunk/test/functionalities/inferior-crashing/TestInferiorCrashing.py 
(original)
+++ lldb/trunk/test/functionalities/inferior-crashing/TestInferiorCrashing.py 
Thu Sep 17 05:05:21 2015
@@ -74,6 +74,7 @@ class CrashingInferiorTestCase(TestBase)
 
 @skipIfFreeBSD # llvm.org/pr16684
 @expectedFailureWindows("llvm.org/pr24778")
+@expectedFailureAndroid(archs=['aarch64'], api_levels=range(21 + 1)) # No 
eh_frame for sa_restorer
 def test_inferior_crashing_step_after_break_dwarf(self):
 """Test that lldb functions correctly after stepping through a 
crash."""
 self.buildDwarf()

Modified: 
lldb/trunk/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py?rev=247879&r1=247878&r2=247879&view=diff
==
--- 
lldb/trunk/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py
 (original)
+++ 
lldb/trunk/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py
 Thu Sep 17 05:05:21 2015
@@ -74,6 +74,7 @@ class CrashingRecursiveInferiorTestCase(
 
 @skipIfFreeBSD # llvm.org/pr16684
 @expectedFailureWindows("llvm.org/pr24778")
+@expectedFailureAndroid(archs=['aarch64'], api_levels=range(21 + 1)) # No 
eh_frame for sa_restorer
 def test_recursive_inferior_crashing_step_after_break_dwarf(self):
 """Test that lldb functions correctly after stepping through a 
crash."""
 self.buildDwarf()


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


[Lldb-commits] [PATCH] D12930: DataFormatters: Rename clang_type to compiler_type.

2015-09-17 Thread Bruce Mitchener via lldb-commits
brucem created this revision.
brucem added a reviewer: granata.enrico.
brucem added a subscriber: lldb-commits.

http://reviews.llvm.org/D12930

Files:
  include/lldb/DataFormatters/FormatManager.h
  include/lldb/DataFormatters/ValueObjectPrinter.h
  source/DataFormatters/FormatManager.cpp
  source/DataFormatters/TypeFormat.cpp
  source/DataFormatters/ValueObjectPrinter.cpp

Index: source/DataFormatters/ValueObjectPrinter.cpp
===
--- source/DataFormatters/ValueObjectPrinter.cpp
+++ source/DataFormatters/ValueObjectPrinter.cpp
@@ -176,8 +176,8 @@
 }
 }
 }
-m_clang_type = m_valobj->GetCompilerType();
-m_type_flags = m_clang_type.GetTypeInfo ();
+m_compiler_type = m_valobj->GetCompilerType();
+m_type_flags = m_compiler_type.GetTypeInfo ();
 return true;
 }
 
Index: source/DataFormatters/TypeFormat.cpp
===
--- source/DataFormatters/TypeFormat.cpp
+++ source/DataFormatters/TypeFormat.cpp
@@ -91,13 +91,13 @@
 }
 else
 {
-CompilerType clang_type = value.GetCompilerType ();
-if (clang_type)
+CompilerType compiler_type = value.GetCompilerType ();
+if (compiler_type)
 {
 // put custom bytes to display in the DataExtractor to override the default value logic
 if (GetFormat() == eFormatCString)
 {
-lldb_private::Flags type_flags(clang_type.GetTypeInfo(NULL)); // disambiguate w.r.t. TypeFormatImpl::Flags
+lldb_private::Flags type_flags(compiler_type.GetTypeInfo(NULL)); // disambiguate w.r.t. TypeFormatImpl::Flags
 if (type_flags.Test(eTypeIsPointer) && !type_flags.Test(eTypeIsObjC))
 {
 // if we are dumping a pointer as a c-string, get the pointee data as a string
@@ -122,7 +122,7 @@
 }
 
 StreamString sstr;
-clang_type.DumpTypeValue (&sstr, // The stream to use for display
+compiler_type.DumpTypeValue (&sstr, // The stream to use for display
   GetFormat(),  // Format to display this type with
   data, // Data to extract from
   0, // Byte offset into "m_data"
Index: source/DataFormatters/FormatManager.cpp
===
--- source/DataFormatters/FormatManager.cpp
+++ source/DataFormatters/FormatManager.cpp
@@ -190,17 +190,17 @@
 
 void
 FormatManager::GetPossibleMatches (ValueObject& valobj,
-   CompilerType clang_type,
+   CompilerType compiler_type,
uint32_t reason,
lldb::DynamicValueType use_dynamic,
FormattersMatchVector& entries,
bool did_strip_ptr,
bool did_strip_ref,
bool did_strip_typedef,
bool root_level)
 {
-clang_type = ClangASTContext::RemoveFastQualifiers(clang_type);
-ConstString type_name(clang_type.GetConstTypeName());
+compiler_type = ClangASTContext::RemoveFastQualifiers(compiler_type);
+ConstString type_name(compiler_type.GetConstTypeName());
 if (valobj.GetBitfieldBitSize() > 0)
 {
 StreamString sstring;
@@ -211,13 +211,13 @@
 }
 entries.push_back({type_name,reason,did_strip_ptr,did_strip_ref,did_strip_typedef});
 
-ConstString display_type_name(clang_type.GetDisplayTypeName());
+ConstString display_type_name(compiler_type.GetDisplayTypeName());
 if (display_type_name != type_name)
 entries.push_back({display_type_name,reason,did_strip_ptr,did_strip_ref,did_strip_typedef});
 
-for (bool is_rvalue_ref = true, j = true; j && clang_type.IsReferenceType(nullptr, &is_rvalue_ref); j = false)
+for (bool is_rvalue_ref = true, j = true; j && compiler_type.IsReferenceType(nullptr, &is_rvalue_ref); j = false)
 {
-CompilerType non_ref_type = clang_type.GetNonReferenceType();
+CompilerType non_ref_type = compiler_type.GetNonReferenceType();
 GetPossibleMatches(valobj,
non_ref_type,
reason | lldb_private::eFormatterChoiceCriterionStrippedPointerReference,
@@ -241,9 +241,9 @@
 }
 }
 
-if (clang_type.IsPointerType())
+if (compiler_type.IsPointerType())
 {
-CompilerType non_ptr_type = clang_type.GetPointeeType();
+CompilerType non_ptr_type = compiler

[Lldb-commits] [PATCH] D12929: Remove unused includes from clang in DataFormatters.

2015-09-17 Thread Bruce Mitchener via lldb-commits
brucem created this revision.
brucem added a reviewer: granata.enrico.
brucem added a subscriber: lldb-commits.

http://reviews.llvm.org/D12929

Files:
  include/lldb/DataFormatters/FormattersContainer.h

Index: include/lldb/DataFormatters/FormattersContainer.h
===
--- include/lldb/DataFormatters/FormattersContainer.h
+++ include/lldb/DataFormatters/FormattersContainer.h
@@ -15,9 +15,6 @@
 #include 
 
 // Other libraries and framework includes
-#include "clang/AST/DeclCXX.h"
-#include "clang/AST/Type.h"
-#include "clang/AST/DeclObjC.h"
 
 // Project includes
 #include "lldb/lldb-public.h"


Index: include/lldb/DataFormatters/FormattersContainer.h
===
--- include/lldb/DataFormatters/FormattersContainer.h
+++ include/lldb/DataFormatters/FormattersContainer.h
@@ -15,9 +15,6 @@
 #include 
 
 // Other libraries and framework includes
-#include "clang/AST/DeclCXX.h"
-#include "clang/AST/Type.h"
-#include "clang/AST/DeclObjC.h"
 
 // Project includes
 #include "lldb/lldb-public.h"
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D12757: Fix prologue end handling when code compiled by gcc

2015-09-17 Thread Tamas Berghammer via lldb-commits
tberghammer added a comment.

I see. Thank you for the clarification


Repository:
  rL LLVM

http://reviews.llvm.org/D12757



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


Re: [Lldb-commits] [Diffusion] rL245905: Final bit of type system cleanup that abstracts declaration contexts into…

2015-09-17 Thread Tamas Berghammer via lldb-commits
tberghammer added subscribers: lldb-commits, sivachandra.
tberghammer added a comment.

Hi Greg,

This change introduced a regression in expression evaluation. When I try to 
evaluate any expression in some specific context then lldb prints out the 
following error:

  error: out-of-line definition of '$__lldb_expr' does not match any 
declaration in 'Foo'
  error: 1 errors parsing expression

I created a test case stub for reproducing the issue what fails on Linux 
x86_64, but passes on OSX. The test is available here: 
http://reviews.llvm.org/D12934 (I plan to make it nicer after we know what we 
actually have to test).

Do you have any idea about what can cause this issue?

Thanks,
Tamas


http://reviews.llvm.org/rL245905



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


[Lldb-commits] [PATCH] D12936: Groundwork for better tracking of renderscript allocations and scripts.

2015-09-17 Thread Aidan Dodds via lldb-commits
ADodds created this revision.
ADodds added reviewers: clayborg, jingham.
ADodds added a subscriber: lldb-commits.
ADodds set the repository for this revision to rL LLVM.

This patch adds some of the groundwork required for tracking the lifetime of 
scripts and allocations and collecting data associated with them during 
execution.


Repository:
  rL LLVM

http://reviews.llvm.org/D12936

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
@@ -252,20 +252,19 @@
 
 typedef std::shared_ptr RuntimeHookSP;
 
-struct ScriptDetails
-{
-std::string resname;
-std::string scriptDyLib;
-std::string cachedir;
-lldb::addr_t context;
-lldb::addr_t script;
-};
+struct ScriptDetails;
+struct AllocationDetails;
+
+typedef std::shared_ptr ScriptDetailsSP;
+typedef std::shared_ptr AllocationDetailsSP;
 
 lldb::ModuleSP m_libRS;
 lldb::ModuleSP m_libRSDriver;
 lldb::ModuleSP m_libRSCpuRef;
 std::vector m_rsmodules;
-std::vector m_scripts;
+
+std::vector m_scripts;
+std::vector m_allocations;
 
 std::map m_scriptMappings;
 std::map m_runtimeHooks;
@@ -292,6 +291,129 @@
 void CaptureAllocationInit1(RuntimeHook* hook_info, ExecutionContext& context);
 void CaptureSetGlobalVar1(RuntimeHook* hook_info, ExecutionContext& context);
 
+// 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,
+// then a new Script detail object will be created for this address and returned.
+ScriptDetailsSP LookUpScript(lldb::addr_t address, bool create);
+
+// Search for a previously saved allocation detail object using a target address.
+// If an allocation does not exist for this address then nullptr will be returned.
+// If 'create' is true and there is no previous allocation then a new allocation
+// detail object will be created for this address and returned.
+AllocationDetailsSP LookUpAllocation (lldb::addr_t address, bool create);
+};
+
+// The empirical_type adds a basic level of validation to arbitrary data
+// allowing us to track if data has been discovered and stored or not.
+// An empirical_type will be marked as valid only if it has been explicitly assigned to.
+template 
+class empirical_type
+{
+  public:
+// Ctor. Contents is invalid when constructed.
+empirical_type()
+: valid(false)
+{}
+
+// Return true and copy contents to out if valid, else return false.
+bool get(type_t& out) const
+{
+if (valid)
+out = data;
+return valid;
+}
+
+// Return a pointer to the contents or nullptr if it was not valid.
+const type_t* get() const
+{
+return valid ? &data : nullptr;
+}
+
+// Assign data explicitly.
+void set(const type_t in)
+{
+data = in;
+valid = true;
+}
+
+// Mark contents as invalid.
+void invalidate()
+{
+valid = false;
+}
+
+// Returns true if this type contains valid data.
+bool isValid() const
+{
+return valid;
+}
+
+// Assignment operator.
+empirical_type& operator = (const type_t in)
+{
+set(in);
+return *this;
+}
+
+// Dereference operator returns contents. 
+// Warning: Will assert if not valid so use only when you know data is valid.
+const type_t& operator * () const
+{
+assert(valid);
+return data;
+}
+
+  protected:
+bool valid;
+type_t data;
+};
+
+// The ScriptDetails class collects data associated with a single script instance.
+struct RenderScriptRuntime::ScriptDetails
+{
+enum ScriptType
+{
+eScript,
+eScriptC
+};
+
+// The derived type of the script.
+empirical_type type;
+// The name of the original source file.
+empirical_type resName;
+// Path to script .so file on the device.
+empirical_type scriptDyLib;
+// Directory where kernel objects are cached on device.
+empirical_type cacheDir;
+// Pointer to the context which owns this script.
+empirical_type context;
+// Pointer to the script object itself.
+empirical_type script;
+};
+
+// This AllocationDetails class collects data associated with a single
+// allocation instance.
+struct RenderScriptRuntime::AllocationDetails
+{
+enum DataType
+{
+eInt,
+

Re: [Lldb-commits] [PATCH] D12925: [cmake] Build lldb-server on Darwin, set dep on FreeBSD.

2015-09-17 Thread Ed Maste via lldb-commits
emaste accepted this revision.
emaste added a comment.
This revision is now accepted and ready to land.

I'm happy with the FreeBSD change. Minor nit, perhaps put in alpha order?


http://reviews.llvm.org/D12925



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


Re: [Lldb-commits] [PATCH] D12925: [cmake] Build lldb-server on Darwin, set dep on FreeBSD.

2015-09-17 Thread Bruce Mitchener via lldb-commits
brucem updated this revision to Diff 35002.
brucem added a comment.

Put in alpha order as emaste suggested.


http://reviews.llvm.org/D12925

Files:
  cmake/modules/LLDBConfig.cmake
  tools/CMakeLists.txt

Index: tools/CMakeLists.txt
===
--- tools/CMakeLists.txt
+++ tools/CMakeLists.txt
@@ -7,6 +7,6 @@
 if (NOT __ANDROID_NDK__)
   add_subdirectory(lldb-mi)
 endif()
-if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR CMAKE_SYSTEM_NAME MATCHES "Linux")
+if (LLDB_CAN_USE_LLDB_SERVER)
   add_subdirectory(lldb-server)
 endif()
Index: cmake/modules/LLDBConfig.cmake
===
--- cmake/modules/LLDBConfig.cmake
+++ cmake/modules/LLDBConfig.cmake
@@ -261,8 +261,9 @@
 
 # Figure out if lldb could use lldb-server.  If so, then we'll
 # ensure we build lldb-server when an lldb target is being built.
-if ( ( CMAKE_SYSTEM_NAME MATCHES "Linux" ) OR
- ( CMAKE_SYSTEM_NAME MATCHES "Darwin" ) )
+if ((CMAKE_SYSTEM_NAME MATCHES "Darwin") OR
+(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") OR
+(CMAKE_SYSTEM_NAME MATCHES "Linux"))
 set(LLDB_CAN_USE_LLDB_SERVER 1)
 else()
 set(LLDB_CAN_USE_LLDB_SERVER 0)


Index: tools/CMakeLists.txt
===
--- tools/CMakeLists.txt
+++ tools/CMakeLists.txt
@@ -7,6 +7,6 @@
 if (NOT __ANDROID_NDK__)
   add_subdirectory(lldb-mi)
 endif()
-if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR CMAKE_SYSTEM_NAME MATCHES "Linux")
+if (LLDB_CAN_USE_LLDB_SERVER)
   add_subdirectory(lldb-server)
 endif()
Index: cmake/modules/LLDBConfig.cmake
===
--- cmake/modules/LLDBConfig.cmake
+++ cmake/modules/LLDBConfig.cmake
@@ -261,8 +261,9 @@
 
 # Figure out if lldb could use lldb-server.  If so, then we'll
 # ensure we build lldb-server when an lldb target is being built.
-if ( ( CMAKE_SYSTEM_NAME MATCHES "Linux" ) OR
- ( CMAKE_SYSTEM_NAME MATCHES "Darwin" ) )
+if ((CMAKE_SYSTEM_NAME MATCHES "Darwin") OR
+(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") OR
+(CMAKE_SYSTEM_NAME MATCHES "Linux"))
 set(LLDB_CAN_USE_LLDB_SERVER 1)
 else()
 set(LLDB_CAN_USE_LLDB_SERVER 0)
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D12925: [cmake] Build lldb-server on Darwin, set dep on FreeBSD.

2015-09-17 Thread Todd Fiala via lldb-commits
tfiala accepted this revision.
tfiala added a comment.

LGTM, thanks Bruce!


http://reviews.llvm.org/D12925



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


[Lldb-commits] [PATCH] D12940: Add sync-source.py utility to support efficient multi-platform lldb development.

2015-09-17 Thread Todd Fiala via lldb-commits
tfiala created this revision.
tfiala added reviewers: clayborg, emaste, spyffe.
tfiala added a subscriber: lldb-commits.

The sync-source.py utility transfers groups of files between
computers. The primary use case is to enable developing LLVM project
software on one machine, transfer it efficiently to other machines ---
possibly of other architectures --- and test it there. sync-source.py
supports configurable, named source-to-destination mappings and has a
transfer agent plug-in architecture. The current distribution provides
an rsync-over-ssh transfer agent.

The primary benefits of using sync-source.py are:

* Provides a simple, reliable way to get a mirror copy of primary-
  machine files onto several different destinations without concern
  of compromising the patch during testing on different machines.

* Handles directory-mapping differences between two machines.  For
  LLDB, this is helpful when going between OS X and any other non-OS X
  target system.

See README.txt for the full details.

http://reviews.llvm.org/D12940

Files:
  utils/sync-source/README.txt
  utils/sync-source/lib/transfer/__init__.py
  utils/sync-source/lib/transfer/protocol.py
  utils/sync-source/lib/transfer/rsync.py
  utils/sync-source/lib/transfer/transfer_spec.py
  utils/sync-source/pylintrc
  utils/sync-source/sync-source.py

Index: utils/sync-source/sync-source.py
===
--- /dev/null
+++ utils/sync-source/sync-source.py
@@ -0,0 +1,261 @@
+#!/usr/bin/env python
+"""
+ The LLVM Compiler Infrastructure
+
+This file is distributed under the University of Illinois Open Source
+License. See LICENSE.TXT for details.
+
+Sync lldb and related source from a local machine to a remote machine.
+
+This facilitates working on the lldb sourcecode on multiple machines
+and multiple OS types, verifying changes across all.
+"""
+
+import argparse
+import cStringIO
+import importlib
+import json
+import os.path
+import re
+import sys
+
+# Add the local lib directory to the python path.
+LOCAL_LIB_PATH = os.path.join(
+os.path.dirname(os.path.realpath(__file__)),
+"lib")
+sys.path.append(LOCAL_LIB_PATH)
+
+import transfer.transfer_spec
+
+
+DOTRC_BASE_FILENAME = ".sync-sourcerc"
+
+
+class Configuration(object):
+"""Provides chaining configuration lookup."""
+def __init__(self, rcdata_configs):
+self.__rcdata_configs = rcdata_configs
+
+def get_value(self, key):
+"""
+Return the first value in the parent chain that has the key.
+
+The traversal starts from the most derived configuration (i.e.
+child) and works all the way up the parent chain.
+
+@return the value of the first key in the parent chain that
+contains a value for the given key.
+"""
+for config in self.__rcdata_configs:
+if key in config:
+return config[key]
+return None
+
+def __getitem__(self, key):
+value = self.get_value(key)
+if value:
+return value
+else:
+raise KeyError(key)
+
+
+def parse_args():
+"""@return options parsed from the command line."""
+parser = argparse.ArgumentParser()
+parser.add_argument(
+"--config-name", "-c", action="store", default="default",
+help="specify configuration name to use")
+parser.add_argument(
+"--default-excludes", action="store", default="*.git,*.svn,*.pyc",
+help=("comma-separated list of default file patterns to exclude "
+  "from each source directory and to protect from deletion "
+  "on each destination directory; if starting with forward "
+  "slash, it only matches at the top of the base directory"))
+parser.add_argument(
+"--dry-run", "-n", action="store_true",
+help="do a dry run of the transfer operation, don't really transfer")
+parser.add_argument(
+"--rc-file", "-r", action="store",
+help="specify the sync-source rc file to use for configurations")
+parser.add_argument(
+"--verbose", "-v", action="store_true", help="turn on verbose output")
+return parser.parse_args()
+
+
+def read_rcfile(filename):
+"""Returns the json-parsed contents of the input file."""
+
+# First parse file contents, removing all comments but
+# preserving the line count.
+regex = re.compile(r"#.*$")
+
+comment_stripped_file = cStringIO.StringIO()
+with open(filename, "r") as json_file:
+for line in json_file:
+comment_stripped_file.write(regex.sub("", line))
+return json.load(cStringIO.StringIO(comment_stripped_file.getvalue()))
+
+
+def find_appropriate_rcfile(options):
+# Use an options-specified rcfile if specified.
+if options.rc_file and len(options.rc_file) > 0:
+if not os.path.isfile(options.rc_file):
+# If it doesn't exist, error out here.
+raise "rcfile '{}' 

[Lldb-commits] [lldb] r247899 - [lldb-mi] Fix the handling of files in -data-info-line and -symbol-list-lines.

2015-09-17 Thread Dawn Perchik via lldb-commits
Author: dperchik
Date: Thu Sep 17 11:22:30 2015
New Revision: 247899

URL: http://llvm.org/viewvc/llvm-project?rev=247899&view=rev
Log:
[lldb-mi] Fix the handling of files in -data-info-line and -symbol-list-lines.

This fixes -data-info-line and -symbol-list-lines to parse the filename
and line correctly when line entries don't have the optional column
number and the filename contains a Windows drive letter. It also fixes
-symbol-list-lines when code from header files is generated.

Reviewed by: abidh, ki.stfu
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D12115

Added:
lldb/trunk/test/tools/lldb-mi/symbol/symbol_list_lines_inline_test.cpp
lldb/trunk/test/tools/lldb-mi/symbol/symbol_list_lines_inline_test.h
lldb/trunk/test/tools/lldb-mi/symbol/symbol_list_lines_inline_test2.cpp
lldb/trunk/tools/lldb-mi/MIUtilParse.cpp
lldb/trunk/tools/lldb-mi/MIUtilParse.h
Modified:
lldb/trunk/test/tools/lldb-mi/symbol/Makefile
lldb/trunk/test/tools/lldb-mi/symbol/TestMiSymbol.py
lldb/trunk/test/tools/lldb-mi/symbol/main.cpp
lldb/trunk/tools/lldb-mi/CMakeLists.txt
lldb/trunk/tools/lldb-mi/MICmdCmdData.cpp
lldb/trunk/tools/lldb-mi/MICmdCmdSymbol.cpp
lldb/trunk/tools/lldb-mi/MIUtilString.cpp
lldb/trunk/tools/lldb-mi/MIUtilString.h

Modified: lldb/trunk/test/tools/lldb-mi/symbol/Makefile
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/symbol/Makefile?rev=247899&r1=247898&r2=247899&view=diff
==
--- lldb/trunk/test/tools/lldb-mi/symbol/Makefile (original)
+++ lldb/trunk/test/tools/lldb-mi/symbol/Makefile Thu Sep 17 11:22:30 2015
@@ -1,5 +1,5 @@
 LEVEL = ../../../make
 
-CXX_SOURCES := main.cpp
+CXX_SOURCES := main.cpp symbol_list_lines_inline_test.cpp 
symbol_list_lines_inline_test2.cpp
 
 include $(LEVEL)/Makefile.rules

Modified: lldb/trunk/test/tools/lldb-mi/symbol/TestMiSymbol.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/symbol/TestMiSymbol.py?rev=247899&r1=247898&r2=247899&view=diff
==
--- lldb/trunk/test/tools/lldb-mi/symbol/TestMiSymbol.py (original)
+++ lldb/trunk/test/tools/lldb-mi/symbol/TestMiSymbol.py Thu Sep 17 11:22:30 
2015
@@ -39,6 +39,19 @@ class MiSymbolTestCase(lldbmi_testcase.M
 self.runCmd("-symbol-list-lines main.cpp")
 
self.expect("\^done,lines=\[\{pc=\"0x0*%x\",line=\"%d\"\}(,\{pc=\"0x[0-9a-f]+\",line=\"\d+\"\})+\]"
 % (addr, line))
 
+# Test that -symbol-list-lines doesn't include lines from other sources
+# by checking the first and last line, and making sure the other lines
+# are between 30 and 39.
+sline = line_number('symbol_list_lines_inline_test2.cpp', '// 
FUNC_gfunc2')
+eline = line_number('symbol_list_lines_inline_test2.cpp', '// 
END_gfunc2')
+self.runCmd("-symbol-list-lines symbol_list_lines_inline_test2.cpp")
+
self.expect("\^done,lines=\[\{pc=\"0x[0-9a-f]+\",line=\"%d\"\}(,\{pc=\"0x[0-9a-f]+\",line=\"3\d\"\})*,\{pc=\"0x[0-9a-f]+\",line=\"%d\"\}\]"
 % (sline, eline))
+##FIXME: This doesn't work for symbol_list_lines_inline_test.cpp due 
to clang bug llvm.org/pr24716
+##sline = line_number('symbol_list_lines_inline_test.cpp', '// 
FUNC_gfunc')
+##eline = line_number('symbol_list_lines_inline_test.cpp', '// 
STRUCT_s')
+##self.runCmd("-symbol-list-lines symbol_list_lines_inline_test.cpp")
+
##self.expect("\^done,lines=\[\{pc=\"0x[0-9a-f]+\",line=\"%d\"\}(,\{pc=\"0x[0-9a-f]+\",line=\"3\d\"\})*,\{pc=\"0x[0-9a-f]+\",line=\"%d\"\}\]"
 % (sline, eline))
+
 # Test that -symbol-list-lines fails when file doesn't exist
 self.runCmd("-symbol-list-lines unknown_file")
 self.expect("\^error,message=\"warning: No source filenames matched 
'unknown_file'\. error: no source filenames matched any command arguments \"")

Modified: lldb/trunk/test/tools/lldb-mi/symbol/main.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/symbol/main.cpp?rev=247899&r1=247898&r2=247899&view=diff
==
--- lldb/trunk/test/tools/lldb-mi/symbol/main.cpp (original)
+++ lldb/trunk/test/tools/lldb-mi/symbol/main.cpp Thu Sep 17 11:22:30 2015
@@ -7,8 +7,12 @@
 //
 
//===--===//
 
+extern int j;
+extern int gfunc(int i);
+extern int gfunc2(int i);
 int
-main(int argc, char const *argv[]) 
+main()
 { // FUNC_main
-return 0;
+int i = gfunc(j) + gfunc2(j);
+return i == 0;
 }

Added: lldb/trunk/test/tools/lldb-mi/symbol/symbol_list_lines_inline_test.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/symbol/symbol_list_lines_inline_test.cpp?rev=247899&view=auto
=

Re: [Lldb-commits] [PATCH] D12115: [LLDB-MI] Fix -data-info-line and -symbol-list-lines when Windows filenames are used.

2015-09-17 Thread Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL247899: [lldb-mi] Fix the handling of files in 
-data-info-line and -symbol-list-lines. (authored by dperchik).

Changed prior to commit:
  http://reviews.llvm.org/D12115?vs=34928&id=35010#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D12115

Files:
  lldb/trunk/test/tools/lldb-mi/symbol/Makefile
  lldb/trunk/test/tools/lldb-mi/symbol/TestMiSymbol.py
  lldb/trunk/test/tools/lldb-mi/symbol/main.cpp
  lldb/trunk/test/tools/lldb-mi/symbol/symbol_list_lines_inline_test.cpp
  lldb/trunk/test/tools/lldb-mi/symbol/symbol_list_lines_inline_test.h
  lldb/trunk/test/tools/lldb-mi/symbol/symbol_list_lines_inline_test2.cpp
  lldb/trunk/tools/lldb-mi/CMakeLists.txt
  lldb/trunk/tools/lldb-mi/MICmdCmdData.cpp
  lldb/trunk/tools/lldb-mi/MICmdCmdSymbol.cpp
  lldb/trunk/tools/lldb-mi/MIUtilParse.cpp
  lldb/trunk/tools/lldb-mi/MIUtilParse.h
  lldb/trunk/tools/lldb-mi/MIUtilString.cpp
  lldb/trunk/tools/lldb-mi/MIUtilString.h

Index: lldb/trunk/tools/lldb-mi/MICmdCmdData.cpp
===
--- lldb/trunk/tools/lldb-mi/MICmdCmdData.cpp
+++ lldb/trunk/tools/lldb-mi/MICmdCmdData.cpp
@@ -42,6 +42,7 @@
 #include "MICmdArgValConsume.h"
 #include "MICmnLLDBDebugSessionInfoVarObj.h"
 #include "MICmnLLDBUtilSBValue.h"
+#include "MIUtilParse.h"
 
 //++ 
 // Details: CMICmdCmdDataEvaluateExpression constructor.
@@ -1642,6 +1643,53 @@
 }
 
 //++ 
+// Details: Helper function for parsing a line entry returned from lldb for the command:
+//  target modules lookup -v 
+//  where the line entry is of the format:
+//  LineEntry: \[0x00010f37-0x00010f45\): /path/file:3[:1]
+//   start  end   file   line column(opt)
+// Args:input - (R) Input string to parse.
+//  start - (W) String representing the start address.
+//  end   - (W) String representing the end address.
+//  file  - (W) String representing the file.
+//  line  - (W) String representing the line.
+// Return:  bool - True = input was parsed successfully, false = input could not be parsed.
+// Throws:  None.
+//--
+static bool
+ParseLLDBLineEntry(const char *input, CMIUtilString &start, CMIUtilString &end,
+   CMIUtilString &file, CMIUtilString &line)
+{
+// Note: Ambiguities arise because the column is optional, and
+// because : can appear in filenames or as a byte in a multibyte
+// UTF8 character.  We keep those cases to a minimum by using regex
+// to work on the string from both the left and right, so that what
+// is remains is assumed to be the filename.
+
+// Match LineEntry using regex.
+static MIUtilParse::CRegexParser g_lineentry_nocol_regex( 
+"^ *LineEntry: \\[(0x[0-9a-fA-F]+)-(0x[0-9a-fA-F]+)\\): (.+):([0-9]+)$");
+static MIUtilParse::CRegexParser g_lineentry_col_regex( 
+"^ *LineEntry: \\[(0x[0-9a-fA-F]+)-(0x[0-9a-fA-F]+)\\): (.+):([0-9]+):[0-9]+$");
+//^1=start ^2=end   ^3=f ^4=line ^5=:col(opt)
+
+MIUtilParse::CRegexParser::Match match(6);
+
+// First try matching the LineEntry with the column,
+// then try without the column.
+const bool ok = g_lineentry_col_regex.Execute(input, match) ||
+g_lineentry_nocol_regex.Execute(input, match);
+if (ok)
+{
+start = match.GetMatchAtIndex(1);
+end   = match.GetMatchAtIndex(2);
+file  = match.GetMatchAtIndex(3);
+line  = match.GetMatchAtIndex(4);
+}
+return ok;
+}
+
+//++ 
 // Details: The invoker requires this function. The command prepares a MI Record Result
 //  for the work carried out in the Execute().
 // Type:Overridden.
@@ -1672,58 +1720,25 @@
 // String looks like:
 // LineEntry: \[0x00010f37-0x00010f45\): /path/to/file:3[:1]
 const CMIUtilString &rLine(vecLines[i]);
+CMIUtilString strStart;
+CMIUtilString strEnd;
+CMIUtilString strFile;
+CMIUtilString strLine;
 
-// LineEntry: \[0x00010f37-0x00010f45\): /path/to/file:3[:1]
-// ^ -- property
-const size_t nPropertyStartPos = rLine.find_first_not_of(' ');
-const size_t nPropertyEndPos = rLine.find(':');
-const size_t nPropertyLen = nPropertyEndPos - nPropertyStartPos;
-const CMIUtilString strProperty(rLine.substr(nPropertyStartPos, nPropertyLen).c_str());
-
-// Skip all except LineEntry
-if (!CMIUtilString::Compare(str

Re: [Lldb-commits] [PATCH] D12936: Groundwork for better tracking of renderscript allocations and scripts.

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

A few suggestions to move things over into RenderScriptRuntime.cpp and to 
possibly use std::unique_ptr, but they are just suggestions.



Comment at: 
source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h:258-259
@@ -263,1 +257,4 @@
+
+typedef std::shared_ptr ScriptDetailsSP;
+typedef std::shared_ptr AllocationDetailsSP;
 

Are you actually handing out shared pointers to anyone? If you are just using 
std::shared_ptr so you can put things into the vector, you can probably just 
use std::unique_ptr.


Comment at: 
source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h:298
@@ +297,3 @@
+// then a new Script detail object will be created for this address and 
returned.
+ScriptDetailsSP LookUpScript(lldb::addr_t address, bool create);
+

If you only need memory management you could say that "m_scripts" owns the 
objects (if they start using std::unique_ptr) and hand out a raw pointer here. 
Not sure on your memory management needs though.


Comment at: 
source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h:304
@@ +303,3 @@
+// detail object will be created for this address and returned.
+AllocationDetailsSP LookUpAllocation (lldb::addr_t address, bool create);
+};

Ditto above comment.


Comment at: 
source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h:307-417
@@ -295,2 +306,113 @@
+
+// The empirical_type adds a basic level of validation to arbitrary data
+// allowing us to track if data has been discovered and stored or not.
+// An empirical_type will be marked as valid only if it has been explicitly 
assigned to.
+template 
+class empirical_type
+{
+  public:
+// Ctor. Contents is invalid when constructed.
+empirical_type()
+: valid(false)
+{}
+
+// Return true and copy contents to out if valid, else return false.
+bool get(type_t& out) const
+{
+if (valid)
+out = data;
+return valid;
+}
+
+// Return a pointer to the contents or nullptr if it was not valid.
+const type_t* get() const
+{
+return valid ? &data : nullptr;
+}
+
+// Assign data explicitly.
+void set(const type_t in)
+{
+data = in;
+valid = true;
+}
+
+// Mark contents as invalid.
+void invalidate()
+{
+valid = false;
+}
+
+// Returns true if this type contains valid data.
+bool isValid() const
+{
+return valid;
+}
+
+// Assignment operator.
+empirical_type& operator = (const type_t in)
+{
+set(in);
+return *this;
+}
+
+// Dereference operator returns contents. 
+// Warning: Will assert if not valid so use only when you know data is 
valid.
+const type_t& operator * () const
+{
+assert(valid);
+return data;
+}
+
+  protected:
+bool valid;
+type_t data;
+};
+
+// The ScriptDetails class collects data associated with a single script 
instance.
+struct RenderScriptRuntime::ScriptDetails
+{
+enum ScriptType
+{
+eScript,
+eScriptC
+};
+
+// The derived type of the script.
+empirical_type type;
+// The name of the original source file.
+empirical_type resName;
+// Path to script .so file on the device.
+empirical_type scriptDyLib;
+// Directory where kernel objects are cached on device.
+empirical_type cacheDir;
+// Pointer to the context which owns this script.
+empirical_type context;
+// Pointer to the script object itself.
+empirical_type script;
+};
+
+// This AllocationDetails class collects data associated with a single
+// allocation instance.
+struct RenderScriptRuntime::AllocationDetails
+{
+enum DataType
+{
+eInt,
+};
+
+enum Dimension
+{
+e1d,
+e2d,
+e3d,
+eCubeMap,
+};
+
+empirical_type type;
+empirical_type dimension;
+empirical_type address;
+empirical_type dataPtr;
+empirical_type context;
 };
 

Does anyone really need to see these objects outside of 
RenderScriptRuntime.cpp? If not, move these into RenderScriptRuntime.cpp.


Repository:
  rL LLVM

http://reviews.llvm.org/D12936



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


[Lldb-commits] [lldb] r247903 - Add sync-source.py utility.

2015-09-17 Thread Todd Fiala via lldb-commits
Author: tfiala
Date: Thu Sep 17 12:14:31 2015
New Revision: 247903

URL: http://llvm.org/viewvc/llvm-project?rev=247903&view=rev
Log:
Add sync-source.py utility.

See:
http://reviews.llvm.org/D12940

for more  details.

See utils/sync-source/README.txt for documentation
and a sample .sync-sourcerc file.

Added:
lldb/trunk/utils/sync-source/
lldb/trunk/utils/sync-source/README.txt
lldb/trunk/utils/sync-source/lib/
lldb/trunk/utils/sync-source/lib/transfer/
lldb/trunk/utils/sync-source/lib/transfer/protocol.py
lldb/trunk/utils/sync-source/lib/transfer/rsync.py
lldb/trunk/utils/sync-source/lib/transfer/transfer_spec.py
lldb/trunk/utils/sync-source/pylintrc
lldb/trunk/utils/sync-source/sync-source.py

Added: lldb/trunk/utils/sync-source/README.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/utils/sync-source/README.txt?rev=247903&view=auto
==
--- lldb/trunk/utils/sync-source/README.txt (added)
+++ lldb/trunk/utils/sync-source/README.txt Thu Sep 17 12:14:31 2015
@@ -0,0 +1,293 @@
+sync-source.py
+
+OVERVIEW
+
+The sync-source.py utility transfers groups of files between
+computers. The primary use case is to enable developing LLVM project
+software on one machine, transfer it efficiently to other machines ---
+possibly of other architectures --- and test it there. sync-source.py
+supports configurable, named source-to-destination mappings and has a
+transfer agent plug-in architecture. The current distribution provides
+an rsync-over-ssh transfer agent.
+
+The primary benefits of using sync-source.py are:
+
+* Provides a simple, reliable way to get a mirror copy of primary-
+  machine files onto several different destinations without concern
+  of compromising the patch during testing on different machines.
+
+* Handles directory-mapping differences between two machines.  For
+  LLDB, this is helpful when going between OS X and any other non-OS X
+  target system.
+
+EXAMPLE WORKFLOW
+
+This utility was developed in the context of working on the LLDB
+project.  Below we show the transfers we'd like to have happen,
+and the configuration that supports it.
+
+Workflow Example:
+
+* Develop on OS X (primary machine)
+* Test candidate changes on OS X.
+* Test candidate changes on a Linux machine (machine-name: lldb-linux).
+* Test candidate changes on a FreeBSD machine (machine-name: lldb-freebsd).
+* Do check-ins from OS X machine.
+
+Requirements:
+
+* OS X machine requires the lldb source layout: lldb, lldb/llvm,
+  lldb/llvm/tools/clang. Note this is different than the canonical
+  llvm, llvm/tools/clang, llvm/tools/lldb layout that we'll want on
+  the Linux and FreeBSD test machines.
+
+* Linux machine requires the llvm, llvm/tools/clang and
+  llvm/tools/lldb layout.
+
+* FreeBSD machine requires the same layout as the llvm machine.
+
+sync-source.py configuration in ~/.sync-sourcerc:
+
+# This is my configuration with a comment.  Configuration
+# files are JSON-based.
+{ "configurations": [
+# Here we have a collection of named configuration blocks.
+# Configuration blocks can chain back to a parent by name.
+{
+# Every block has a name so it can be referenced from
+# the command line or chained back to by a child block
+# for sharing.
+"name": "base_tot_settings",
+
+# This directive lists the "directory ids" that we'll care
+# about.  If your local repository has additional directories
+# for other projects that need to ride along, add them here.
+# For defaulting purposes, it makes sense to name the
+# directory IDs as the most likely name for the directory
+# itself.  For stock LLDB from top of tree, we generally only
+# care about lldb, llvm and clang.
+"dir_names": [ "llvm", "clang", "lldb" ],
+
+# This section describes where the source files live on
+# the primary machine.  There should always be a base_dir
+# entry, which indicates where in the local filesystem the
+# projects are rooted.  For each dir in dir_names, there
+# should be either:
+# 1. an entry named {dir-id}_dir (e.g. llvm_dir), which
+#specifies the source directory for the given dir id
+#relative to the base_dir entry, OR
+# 2. no entry, in which case the directory is assumed to
+#be the same as {dir-id}.  In the example below, the
+#base_dir-relative directory for the "lldb" dir-id is
+#defaulted to being "lldb".  That's exactly what
+#we need in an OS X-style lldb dir layout.
+"source": {
+"base_dir": "~/work/lldb-tot",
+"llvm_dir": "lldb/llvm",
+"clang_dir": "lldb/llvm/tools/clang"
+},
+
+# source_excludes covers any exclusions that:
+# * should be applied when copying files from the source
+# * should be

Re: [Lldb-commits] [PATCH] D12940: Add sync-source.py utility to support efficient multi-platform lldb development.

2015-09-17 Thread Todd Fiala via lldb-commits
tfiala closed this revision.
tfiala added a comment.

Committed here:

  Adding utils/sync-source
  Adding utils/sync-source/README.txt
  Adding utils/sync-source/lib
  Adding utils/sync-source/lib/transfer
  Adding utils/sync-source/lib/transfer/protocol.py
  Adding utils/sync-source/lib/transfer/rsync.py
  Adding utils/sync-source/lib/transfer/transfer_spec.py
  Adding utils/sync-source/pylintrc
  Adding utils/sync-source/sync-source.py
  Transmitting file data ..
  Committed revision 247903.

@emaste and others, feel free to give me feedback and I'll happy to consider.


http://reviews.llvm.org/D12940



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


Re: [Lldb-commits] [PATCH] D12929: Remove unused includes from clang in DataFormatters.

2015-09-17 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.

I am assuming you built this successfully.

If so, then yes please commit, it's a good change!


http://reviews.llvm.org/D12929



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


Re: [Lldb-commits] [PATCH] D12930: DataFormatters: Rename clang_type to compiler_type.

2015-09-17 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.

Fine by me


http://reviews.llvm.org/D12930



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


Re: [Lldb-commits] [PATCH] D12115: [LLDB-MI] Fix -data-info-line and -symbol-list-lines when Windows filenames are used.

2015-09-17 Thread Chaoren Lin via lldb-commits
chaoren added a subscriber: chaoren.
chaoren added a comment.

Could you please take a look at these issues?

TestMiSymbol started to fail on Linux with gcc-4.9:
http://lab.llvm.org:8011/builders/lldb-x86_64-ubuntu-14.04-cmake/builds/6387



Comment at: lldb/trunk/tools/lldb-mi/MIUtilParse.h:13
@@ +12,3 @@
+// Third party headers:
+#include "../lib/Support/regex_impl.h"
+

This caused a build failure on OS X:
http://lab.llvm.org:8011/builders/lldb-x86_64-darwin-13.4/builds/5801


Repository:
  rL LLVM

http://reviews.llvm.org/D12115



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


[Lldb-commits] [PATCH] D12942: Fix caching for clang::Decl in DWARFASTParserClang

2015-09-17 Thread Paul Herman via lldb-commits
paulherman created this revision.
paulherman added reviewers: sivachandra, chaoren, tberghammer, clayborg.
paulherman added a subscriber: lldb-commits.

http://reviews.llvm.org/D12942

Files:
  source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp

Index: source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
===
--- source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -3225,13 +3225,19 @@
 if (!die)
 return nullptr;
 
-if (die.GetReferencedDIE(DW_AT_specification))
-return GetClangDeclForDIE(die.GetReferencedDIE(DW_AT_specification));
+DIEToDeclMap::iterator cache_pos = m_die_to_decl.find(die.GetDIE());
+if (cache_pos != m_die_to_decl.end())
+return cache_pos->second;
 
-clang::Decl *decl = m_die_to_decl[die.GetDIE()];
-if (decl != nullptr)
+if (die.GetReferencedDIE(DW_AT_specification))
+{
+clang::Decl *decl = 
GetClangDeclForDIE(die.GetReferencedDIE(DW_AT_specification));
+m_die_to_decl[die.GetDIE()] = decl;
+m_decl_to_die[decl].insert(die.GetDIE());
 return decl;
+}
 
+clang::Decl *decl = m_die_to_decl[die.GetDIE()];
 switch (die.Tag())
 {
 case DW_TAG_variable:


Index: source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
===
--- source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -3225,13 +3225,19 @@
 if (!die)
 return nullptr;
 
-if (die.GetReferencedDIE(DW_AT_specification))
-return GetClangDeclForDIE(die.GetReferencedDIE(DW_AT_specification));
+DIEToDeclMap::iterator cache_pos = m_die_to_decl.find(die.GetDIE());
+if (cache_pos != m_die_to_decl.end())
+return cache_pos->second;
 
-clang::Decl *decl = m_die_to_decl[die.GetDIE()];
-if (decl != nullptr)
+if (die.GetReferencedDIE(DW_AT_specification))
+{
+clang::Decl *decl = GetClangDeclForDIE(die.GetReferencedDIE(DW_AT_specification));
+m_die_to_decl[die.GetDIE()] = decl;
+m_decl_to_die[decl].insert(die.GetDIE());
 return decl;
+}
 
+clang::Decl *decl = m_die_to_decl[die.GetDIE()];
 switch (die.Tag())
 {
 case DW_TAG_variable:
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r247899 - [lldb-mi] Fix the handling of files in -data-info-line and -symbol-list-lines.

2015-09-17 Thread Sean Callanan via lldb-commits
Dawn,

this breaks the OS X Xcode build because it can’t find 
“../lib/Support/regex_impl.h”.
I only see that header in llvm/lib, but so far lldb-mi hasn’t had any LLVM 
dependencies and it doesn’t even have the right header search paths in Xcode.  
Should we be adding the LLVM headers as search paths?

Sean

> On Sep 17, 2015, at 9:22 AM, Dawn Perchik via lldb-commits 
>  wrote:
> 
> Author: dperchik
> Date: Thu Sep 17 11:22:30 2015
> New Revision: 247899
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=247899&view=rev
> Log:
> [lldb-mi] Fix the handling of files in -data-info-line and -symbol-list-lines.
> 
> This fixes -data-info-line and -symbol-list-lines to parse the filename
> and line correctly when line entries don't have the optional column
> number and the filename contains a Windows drive letter. It also fixes
> -symbol-list-lines when code from header files is generated.
> 
> Reviewed by: abidh, ki.stfu
> Subscribers: lldb-commits
> Differential Revision: http://reviews.llvm.org/D12115
> 
> Added:
>lldb/trunk/test/tools/lldb-mi/symbol/symbol_list_lines_inline_test.cpp
>lldb/trunk/test/tools/lldb-mi/symbol/symbol_list_lines_inline_test.h
>lldb/trunk/test/tools/lldb-mi/symbol/symbol_list_lines_inline_test2.cpp
>lldb/trunk/tools/lldb-mi/MIUtilParse.cpp
>lldb/trunk/tools/lldb-mi/MIUtilParse.h
> Modified:
>lldb/trunk/test/tools/lldb-mi/symbol/Makefile
>lldb/trunk/test/tools/lldb-mi/symbol/TestMiSymbol.py
>lldb/trunk/test/tools/lldb-mi/symbol/main.cpp
>lldb/trunk/tools/lldb-mi/CMakeLists.txt
>lldb/trunk/tools/lldb-mi/MICmdCmdData.cpp
>lldb/trunk/tools/lldb-mi/MICmdCmdSymbol.cpp
>lldb/trunk/tools/lldb-mi/MIUtilString.cpp
>lldb/trunk/tools/lldb-mi/MIUtilString.h
> 
> Modified: lldb/trunk/test/tools/lldb-mi/symbol/Makefile
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/symbol/Makefile?rev=247899&r1=247898&r2=247899&view=diff
> ==
> --- lldb/trunk/test/tools/lldb-mi/symbol/Makefile (original)
> +++ lldb/trunk/test/tools/lldb-mi/symbol/Makefile Thu Sep 17 11:22:30 2015
> @@ -1,5 +1,5 @@
> LEVEL = ../../../make
> 
> -CXX_SOURCES := main.cpp
> +CXX_SOURCES := main.cpp symbol_list_lines_inline_test.cpp 
> symbol_list_lines_inline_test2.cpp
> 
> include $(LEVEL)/Makefile.rules
> 
> Modified: lldb/trunk/test/tools/lldb-mi/symbol/TestMiSymbol.py
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/symbol/TestMiSymbol.py?rev=247899&r1=247898&r2=247899&view=diff
> ==
> --- lldb/trunk/test/tools/lldb-mi/symbol/TestMiSymbol.py (original)
> +++ lldb/trunk/test/tools/lldb-mi/symbol/TestMiSymbol.py Thu Sep 17 11:22:30 
> 2015
> @@ -39,6 +39,19 @@ class MiSymbolTestCase(lldbmi_testcase.M
> self.runCmd("-symbol-list-lines main.cpp")
> 
> self.expect("\^done,lines=\[\{pc=\"0x0*%x\",line=\"%d\"\}(,\{pc=\"0x[0-9a-f]+\",line=\"\d+\"\})+\]"
>  % (addr, line))
> 
> +# Test that -symbol-list-lines doesn't include lines from other 
> sources
> +# by checking the first and last line, and making sure the other 
> lines
> +# are between 30 and 39.
> +sline = line_number('symbol_list_lines_inline_test2.cpp', '// 
> FUNC_gfunc2')
> +eline = line_number('symbol_list_lines_inline_test2.cpp', '// 
> END_gfunc2')
> +self.runCmd("-symbol-list-lines symbol_list_lines_inline_test2.cpp")
> +
> self.expect("\^done,lines=\[\{pc=\"0x[0-9a-f]+\",line=\"%d\"\}(,\{pc=\"0x[0-9a-f]+\",line=\"3\d\"\})*,\{pc=\"0x[0-9a-f]+\",line=\"%d\"\}\]"
>  % (sline, eline))
> +##FIXME: This doesn't work for symbol_list_lines_inline_test.cpp due 
> to clang bug llvm.org/pr24716
> +##sline = line_number('symbol_list_lines_inline_test.cpp', '// 
> FUNC_gfunc')
> +##eline = line_number('symbol_list_lines_inline_test.cpp', '// 
> STRUCT_s')
> +##self.runCmd("-symbol-list-lines symbol_list_lines_inline_test.cpp")
> +
> ##self.expect("\^done,lines=\[\{pc=\"0x[0-9a-f]+\",line=\"%d\"\}(,\{pc=\"0x[0-9a-f]+\",line=\"3\d\"\})*,\{pc=\"0x[0-9a-f]+\",line=\"%d\"\}\]"
>  % (sline, eline))
> +
> # Test that -symbol-list-lines fails when file doesn't exist
> self.runCmd("-symbol-list-lines unknown_file")
> self.expect("\^error,message=\"warning: No source filenames matched 
> 'unknown_file'\. error: no source filenames matched any command arguments \"")
> 
> Modified: lldb/trunk/test/tools/lldb-mi/symbol/main.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/symbol/main.cpp?rev=247899&r1=247898&r2=247899&view=diff
> ==
> --- lldb/trunk/test/tools/lldb-mi/symbol/main.cpp (original)
> +++ lldb/trunk/test/tools/lldb-mi/symbol/main.cpp Thu Sep 17 11:22:30 2015
> @@ -7,8 +7,12 @@
> //
> //===---

Re: [Lldb-commits] [lldb] r247899 - [lldb-mi] Fix the handling of files in -data-info-line and -symbol-list-lines.

2015-09-17 Thread via lldb-commits
On Thu, Sep 17, 2015 at 10:43:53AM -0700, Sean Callanan wrote:
> Dawn,
> 
> this breaks the OS X Xcode build because it can???t find 
> ???../lib/Support/regex_impl.h???.
> I only see that header in llvm/lib, but so far lldb-mi hasn???t had any LLVM 
> dependencies and it doesn???t even have the right header search paths in 
> Xcode.  Should we be adding the LLVM headers as search paths?

Yes.  Can you add them please?
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r247899 - [lldb-mi] Fix the handling of files in -data-info-line and -symbol-list-lines.

2015-09-17 Thread Sean Callanan via lldb-commits
Sure.  What about the LLVM libraries – right now after fixing the header issues 
I’m getting link errors:

Undefined symbols for architecture x86_64:
  "_llvm_regcomp", referenced from:
  MIUtilParse::CRegexParser::CRegexParser(char const*) in MIUtilParse.o
  "_llvm_regexec", referenced from:
  MIUtilParse::CRegexParser::Execute(char const*, 
MIUtilParse::CRegexParser::Match&, unsigned long) in MIUtilParse.o
  "_llvm_regfree", referenced from:
  MIUtilParse::CRegexParser::~CRegexParser() in MIUtilParse.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Sean

> On Sep 17, 2015, at 10:47 AM, d...@burble.org wrote:
> 
> On Thu, Sep 17, 2015 at 10:43:53AM -0700, Sean Callanan wrote:
>> Dawn,
>> 
>> this breaks the OS X Xcode build because it can???t find 
>> ???../lib/Support/regex_impl.h???.
>> I only see that header in llvm/lib, but so far lldb-mi hasn???t had any LLVM 
>> dependencies and it doesn???t even have the right header search paths in 
>> Xcode.  Should we be adding the LLVM headers as search paths?
> 
> Yes.  Can you add them please?

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


Re: [Lldb-commits] [lldb] r247899 - [lldb-mi] Fix the handling of files in -data-info-line and -symbol-list-lines.

2015-09-17 Thread via lldb-commits
On Thu, Sep 17, 2015 at 10:49:22AM -0700, Sean Callanan wrote:
> Sure.  What about the LLVM libraries ??? right now after fixing the header 
> issues I???m getting link errors:
> 
> Undefined symbols for architecture x86_64:
>   "_llvm_regcomp", referenced from:
>   MIUtilParse::CRegexParser::CRegexParser(char const*) in MIUtilParse.o
>   "_llvm_regexec", referenced from:
>   MIUtilParse::CRegexParser::Execute(char const*, 
> MIUtilParse::CRegexParser::Match&, unsigned long) in MIUtilParse.o
>   "_llvm_regfree", referenced from:
>   MIUtilParse::CRegexParser::~CRegexParser() in MIUtilParse.o
> ld: symbol(s) not found for architecture x86_64
> clang: error: linker command failed with exit code 1 (use -v to see 
> invocation)

Please make the libraries and paths the same as for the rest of lldb.

Sorry for the breakage - it builds fine in cmake/ninja.
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D12942: Fix caching for clang::Decl in DWARFASTParserClang

2015-09-17 Thread Paul Herman via lldb-commits
paulherman updated this revision to Diff 35017.
paulherman added a comment.

Fix caching for clang::Decl in DWARFASTParserClang


http://reviews.llvm.org/D12942

Files:
  source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp

Index: source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
===
--- source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -3225,13 +3225,23 @@
 if (!die)
 return nullptr;
 
-if (die.GetReferencedDIE(DW_AT_specification))
-return GetClangDeclForDIE(die.GetReferencedDIE(DW_AT_specification));
+const std::set tags_with_decls { DW_TAG_variable, 
DW_TAG_constant, DW_TAG_formal_parameter, DW_TAG_imported_module, 
DW_TAG_imported_declaration };
+if (tags_with_decls.find(die.Tag()) == tags_with_decls.end())
+return nullptr;
+
+DIEToDeclMap::iterator cache_pos = m_die_to_decl.find(die.GetDIE());
+if (cache_pos != m_die_to_decl.end())
+return cache_pos->second;
 
-clang::Decl *decl = m_die_to_decl[die.GetDIE()];
-if (decl != nullptr)
+if (die.GetReferencedDIE(DW_AT_specification))
+{
+clang::Decl *decl = 
GetClangDeclForDIE(die.GetReferencedDIE(DW_AT_specification));
+m_die_to_decl[die.GetDIE()] = decl;
+m_decl_to_die[decl].insert(die.GetDIE());
 return decl;
+}
 
+clang::Decl *decl = nullptr;
 switch (die.Tag())
 {
 case DW_TAG_variable:


Index: source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
===
--- source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -3225,13 +3225,23 @@
 if (!die)
 return nullptr;
 
-if (die.GetReferencedDIE(DW_AT_specification))
-return GetClangDeclForDIE(die.GetReferencedDIE(DW_AT_specification));
+const std::set tags_with_decls { DW_TAG_variable, DW_TAG_constant, DW_TAG_formal_parameter, DW_TAG_imported_module, DW_TAG_imported_declaration };
+if (tags_with_decls.find(die.Tag()) == tags_with_decls.end())
+return nullptr;
+
+DIEToDeclMap::iterator cache_pos = m_die_to_decl.find(die.GetDIE());
+if (cache_pos != m_die_to_decl.end())
+return cache_pos->second;
 
-clang::Decl *decl = m_die_to_decl[die.GetDIE()];
-if (decl != nullptr)
+if (die.GetReferencedDIE(DW_AT_specification))
+{
+clang::Decl *decl = GetClangDeclForDIE(die.GetReferencedDIE(DW_AT_specification));
+m_die_to_decl[die.GetDIE()] = decl;
+m_decl_to_die[decl].insert(die.GetDIE());
 return decl;
+}
 
+clang::Decl *decl = nullptr;
 switch (die.Tag())
 {
 case DW_TAG_variable:
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r247908 - Fix LLDB RSP client to decode '$O' packets incorrectly

2015-09-17 Thread Dawn Perchik via lldb-commits
Author: dperchik
Date: Thu Sep 17 12:55:32 2015
New Revision: 247908

URL: http://llvm.org/viewvc/llvm-project?rev=247908&view=rev
Log:
Fix LLDB RSP client to decode '$O' packets incorrectly

Character with ASCII code 0 is incorrectly treated by LLDB as the end of
RSP packet. The left of the debugger server output is silently ignored.

Patch from evgeny.levi...@gmail.com
Reviewed by: clayborg
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D12523

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

lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
lldb/trunk/source/Utility/StringExtractor.cpp

Modified: lldb/trunk/include/lldb/Utility/StringExtractor.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/StringExtractor.h?rev=247908&r1=247907&r2=247908&view=diff
==
--- lldb/trunk/include/lldb/Utility/StringExtractor.h (original)
+++ lldb/trunk/include/lldb/Utility/StringExtractor.h Thu Sep 17 12:55:32 2015
@@ -115,6 +115,9 @@ public:
 GetHexU8 (uint8_t fail_value = 0, bool set_eof_on_fail = true);
 
 bool
+GetHexU8Ex (uint8_t& ch, bool set_eof_on_fail = true);
+
+bool
 GetNameColonValue (std::string &name, std::string &value);
 
 int32_t

Modified: 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp?rev=247908&r1=247907&r2=247908&view=diff
==
--- 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp 
(original)
+++ 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp 
Thu Sep 17 12:55:32 2015
@@ -1262,9 +1262,13 @@ GDBRemoteCommunicationClient::SendContin
 got_async_packet = true;
 std::string inferior_stdout;
 inferior_stdout.reserve(response.GetBytesLeft () / 2);
-char ch;
-while ((ch = response.GetHexU8()) != '\0')
-inferior_stdout.append(1, ch);
+
+uint8_t ch;
+while (response.GetHexU8Ex(ch))
+{
+if (ch != 0)
+inferior_stdout.append(1, (char)ch);
+}
 process->AppendSTDOUT (inferior_stdout.c_str(), 
inferior_stdout.size());
 }
 break;

Modified: lldb/trunk/source/Utility/StringExtractor.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/StringExtractor.cpp?rev=247908&r1=247907&r2=247908&view=diff
==
--- lldb/trunk/source/Utility/StringExtractor.cpp (original)
+++ lldb/trunk/source/Utility/StringExtractor.cpp Thu Sep 17 12:55:32 2015
@@ -125,14 +125,23 @@ StringExtractor::DecodeHexU8()
 uint8_t
 StringExtractor::GetHexU8 (uint8_t fail_value, bool set_eof_on_fail)
 {
+GetHexU8Ex(fail_value, set_eof_on_fail);
+return fail_value;
+}
+
+bool
+StringExtractor::GetHexU8Ex (uint8_t& ch, bool set_eof_on_fail)
+{
 int byte = DecodeHexU8();
 if (byte == -1)
 {
 if (set_eof_on_fail || m_index >= m_packet.size())
 m_index = UINT64_MAX;
-return fail_value;
+// ch should not be changed in case of failure
+return false;
 }
-return (uint8_t)byte;
+ch = (uint8_t)byte;
+return true;
 }
 
 uint32_t


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


Re: [Lldb-commits] [PATCH] D12942: Fix caching for clang::Decl in DWARFASTParserClang

2015-09-17 Thread Paul Herman via lldb-commits
paulherman updated this revision to Diff 35019.
paulherman added a comment.

Fix caching for clang::Decl in DWARFASTParserClang

Fixed small mistakes from previous commit.


http://reviews.llvm.org/D12942

Files:
  source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp

Index: source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
===
--- source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -3225,13 +3225,23 @@
 if (!die)
 return nullptr;
 
-if (die.GetReferencedDIE(DW_AT_specification))
-return GetClangDeclForDIE(die.GetReferencedDIE(DW_AT_specification));
+const std::set tags_with_decls { DW_TAG_variable, 
DW_TAG_constant, DW_TAG_formal_parameter, DW_TAG_imported_module, 
DW_TAG_imported_declaration };
+if (tags_with_decls.find(die.Tag()) == tags_with_decls.end())
+return nullptr;
+
+DIEToDeclMap::iterator cache_pos = m_die_to_decl.find(die.GetDIE());
+if (cache_pos != m_die_to_decl.end())
+return cache_pos->second;
 
-clang::Decl *decl = m_die_to_decl[die.GetDIE()];
-if (decl != nullptr)
+if (DWARFDIE spec_die = die.GetReferencedDIE(DW_AT_specification))
+{
+clang::Decl *decl = GetClangDeclForDIE(spec_die);
+m_die_to_decl[die.GetDIE()] = decl;
+m_decl_to_die[decl].insert(die.GetDIE());
 return decl;
+}
 
+clang::Decl *decl = nullptr;
 switch (die.Tag())
 {
 case DW_TAG_variable:


Index: source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
===
--- source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -3225,13 +3225,23 @@
 if (!die)
 return nullptr;
 
-if (die.GetReferencedDIE(DW_AT_specification))
-return GetClangDeclForDIE(die.GetReferencedDIE(DW_AT_specification));
+const std::set tags_with_decls { DW_TAG_variable, DW_TAG_constant, DW_TAG_formal_parameter, DW_TAG_imported_module, DW_TAG_imported_declaration };
+if (tags_with_decls.find(die.Tag()) == tags_with_decls.end())
+return nullptr;
+
+DIEToDeclMap::iterator cache_pos = m_die_to_decl.find(die.GetDIE());
+if (cache_pos != m_die_to_decl.end())
+return cache_pos->second;
 
-clang::Decl *decl = m_die_to_decl[die.GetDIE()];
-if (decl != nullptr)
+if (DWARFDIE spec_die = die.GetReferencedDIE(DW_AT_specification))
+{
+clang::Decl *decl = GetClangDeclForDIE(spec_die);
+m_die_to_decl[die.GetDIE()] = decl;
+m_decl_to_die[decl].insert(die.GetDIE());
 return decl;
+}
 
+clang::Decl *decl = nullptr;
 switch (die.Tag())
 {
 case DW_TAG_variable:
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r247909 - Updated the Xcode build to reflect lldb-mi's dependency on LLVM.

2015-09-17 Thread Sean Callanan via lldb-commits
Author: spyffe
Date: Thu Sep 17 13:03:26 2015
New Revision: 247909

URL: http://llvm.org/viewvc/llvm-project?rev=247909&view=rev
Log:
Updated the Xcode build to reflect lldb-mi's dependency on LLVM.

Modified:
lldb/trunk/lldb.xcodeproj/project.pbxproj

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=247909&r1=247908&r2=247909&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Thu Sep 17 13:03:26 2015
@@ -162,7 +162,7 @@
264A58EE1A7DBCAD00A6B1B0 /* OptionValueFormatEntity.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = 264A58ED1A7DBCAD00A6B1B0 /* 
OptionValueFormatEntity.cpp */; };
264A97BF133918BC0017F0BE /* PlatformRemoteGDBServer.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = 264A97BD133918BC0017F0BE /* 
PlatformRemoteGDBServer.cpp */; };
264D8D5013661BD7003A368F /* UnwindAssembly.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 264D8D4F13661BD7003A368F /* UnwindAssembly.cpp 
*/; };
-   265192C61BA8E905002F08F6 /* CompilerDecl.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 265192C51BA8E905002F08F6 /* CompilerDecl.cpp */; 
settings = {ASSET_TAGS = (); }; };
+   265192C61BA8E905002F08F6 /* CompilerDecl.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 265192C51BA8E905002F08F6 /* CompilerDecl.cpp */; 
};
265205A813D3E3F700132FE2 /* RegisterContextKDP_arm.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = 265205A213D3E3F700132FE2 /* 
RegisterContextKDP_arm.cpp */; };
265205AA13D3E3F700132FE2 /* RegisterContextKDP_i386.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = 265205A413D3E3F700132FE2 /* 
RegisterContextKDP_i386.cpp */; };
265205AC13D3E3F700132FE2 /* RegisterContextKDP_x86_64.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = 265205A613D3E3F700132FE2 /* 
RegisterContextKDP_x86_64.cpp */; };
@@ -668,6 +668,8 @@
494260DA14579144003C1C78 /* VerifyDecl.cpp in Sources */ = {isa 
= PBXBuildFile; fileRef = 494260D914579144003C1C78 /* VerifyDecl.cpp */; };
4959511F1A1BC4BC00F6F8FC /* ClangModulesDeclVendor.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = 4959511E1A1BC4BC00F6F8FC /* 
ClangModulesDeclVendor.cpp */; };
4966DCC4148978A10028481B /* ClangExternalASTSourceCommon.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = 4966DCC3148978A10028481B /* 
ClangExternalASTSourceCommon.cpp */; };
+   49684D7B1BAB37E400E6D5D5 /* MIUtilParse.h in CopyFiles */ = 
{isa = PBXBuildFile; fileRef = 49684D791BAB37E400E6D5D5 /* MIUtilParse.h */; };
+   49684D7C1BAB37F200E6D5D5 /* MIUtilParse.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 49684D781BAB37E400E6D5D5 /* MIUtilParse.cpp */; 
};
49724D991AD6ED390033C538 /* RenderScriptRuntime.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = 49724D971AD6ED390033C538 /* 
RenderScriptRuntime.cpp */; };
4984BA131B978C55008658D4 /* ClangExpressionVariable.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = 4984BA0E1B978C3E008658D4 /* 
ClangExpressionVariable.cpp */; };
4984BA161B979973008658D4 /* ExpressionVariable.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = 4984BA151B979973008658D4 /* 
ExpressionVariable.cpp */; };
@@ -679,15 +681,15 @@
49DA65031485C92A005FF180 /* AppleObjCDeclVendor.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = 49DA65021485C92A005FF180 /* 
AppleObjCDeclVendor.cpp */; };
49DCF6FE170E6B4A0092F75E /* IRMemoryMap.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 49DCF6FD170E6B4A0092F75E /* IRMemoryMap.cpp */; 
};
49DCF702170E70120092F75E /* Materializer.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 49DCF700170E70120092F75E /* Materializer.cpp */; 
};
-   4C0083401B9F9BA900D5CF24 /* UtilityFunction.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 4C00833F1B9F9BA900D5CF24 /* UtilityFunction.cpp 
*/; settings = {ASSET_TAGS = (); }; };
-   4C2479BD1BA39295009C9A7B /* FunctionCaller.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 4C0083321B9A5DE200D5CF24 /* FunctionCaller.cpp 
*/; settings = {ASSET_TAGS = (); }; };
+   4C0083401B9F9BA900D5CF24 /* UtilityFunction.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 4C00833F1B9F9BA900D5CF24 /* UtilityFunction.cpp 
*/; };
+   4C2479BD1BA39295009C9A7B /* FunctionCaller.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 4C0083321B9A5DE200D5CF24 /* FunctionCaller.cpp 
*/; };
4C3ADCD61810D88B00357218 /* BreakpointResolverFileRegex.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = 4CAA56141422D986001FFA01 /* 
BreakpointResolverFileRegex.cpp */; };
4C56543119D1EFAA002E9C44 /* Th

Re: [Lldb-commits] [lldb] r247899 - [lldb-mi] Fix the handling of files in -data-info-line and -symbol-list-lines.

2015-09-17 Thread Sean Callanan via lldb-commits
$ svn commit
Sendinglldb.xcodeproj/project.pbxproj
Transmitting file data .
Committed revision 247909.

> On Sep 17, 2015, at 10:53 AM, d...@burble.org wrote:
> 
> On Thu, Sep 17, 2015 at 10:49:22AM -0700, Sean Callanan wrote:
>> Sure.  What about the LLVM libraries ??? right now after fixing the header 
>> issues I???m getting link errors:
>> 
>> Undefined symbols for architecture x86_64:
>>  "_llvm_regcomp", referenced from:
>>  MIUtilParse::CRegexParser::CRegexParser(char const*) in MIUtilParse.o
>>  "_llvm_regexec", referenced from:
>>  MIUtilParse::CRegexParser::Execute(char const*, 
>> MIUtilParse::CRegexParser::Match&, unsigned long) in MIUtilParse.o
>>  "_llvm_regfree", referenced from:
>>  MIUtilParse::CRegexParser::~CRegexParser() in MIUtilParse.o
>> ld: symbol(s) not found for architecture x86_64
>> clang: error: linker command failed with exit code 1 (use -v to see 
>> invocation)
> 
> Please make the libraries and paths the same as for the rest of lldb.
> 
> Sorry for the breakage - it builds fine in cmake/ninja.

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


[Lldb-commits] [lldb] r247910 - Removed a needless cast to ClangExpressionVariable.

2015-09-17 Thread Sean Callanan via lldb-commits
Author: spyffe
Date: Thu Sep 17 13:19:12 2015
New Revision: 247910

URL: http://llvm.org/viewvc/llvm-project?rev=247910&view=rev
Log:
Removed a needless cast to ClangExpressionVariable.

Modified:
lldb/trunk/source/Expression/Materializer.cpp

Modified: lldb/trunk/source/Expression/Materializer.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/Materializer.cpp?rev=247910&r1=247909&r2=247910&view=diff
==
--- lldb/trunk/source/Expression/Materializer.cpp (original)
+++ lldb/trunk/source/Expression/Materializer.cpp Thu Sep 17 13:19:12 2015
@@ -101,7 +101,7 @@ public:
 // Put the location of the spare memory into the live data of the 
ValueObject.
 
 m_persistent_variable_sp->m_live_sp = ValueObjectConstResult::Create 
(map.GetBestExecutionContextScope(),
-  
llvm::cast(m_persistent_variable_sp.get())->GetTypeFromUser(),
+  
m_persistent_variable_sp->GetCompilerType(),
   
m_persistent_variable_sp->GetName(),
   
mem,
   
eAddressTypeLoad,


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


Re: [Lldb-commits] [PATCH] D12942: Fix caching for clang::Decl in DWARFASTParserClang

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

Looks good with minor comment inline



Comment at: source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp:3228-3230
@@ -3227,3 +3227,5 @@
 
-if (die.GetReferencedDIE(DW_AT_specification))
-return GetClangDeclForDIE(die.GetReferencedDIE(DW_AT_specification));
+const std::set tags_with_decls { DW_TAG_variable, 
DW_TAG_constant, DW_TAG_formal_parameter, DW_TAG_imported_module, 
DW_TAG_imported_declaration };
+if (tags_with_decls.find(die.Tag()) == tags_with_decls.end())
+return nullptr;
+

I think using a switch would be both simpler and faster


http://reviews.llvm.org/D12942



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


[Lldb-commits] [lldb] r247913 - [cmake] Build lldb-server on Darwin, set dep on FreeBSD.

2015-09-17 Thread Bruce Mitchener via lldb-commits
Author: brucem
Date: Thu Sep 17 13:35:33 2015
New Revision: 247913

URL: http://llvm.org/viewvc/llvm-project?rev=247913&view=rev
Log:
[cmake] Build lldb-server on Darwin, set dep on FreeBSD.

Summary:
This switches the decision as to whether or not to lldb-server should
be built to check the same flag that was added that controls whether
or not it is added as a dependency to the 'lldb' target.

It also sets that flag on FreeBSD to maintain parity with the existing
build configuration / situation on FreeBSD.

Reviewers: labath, emaste, tfiala

Subscribers: lldb-commits

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

Modified:
lldb/trunk/cmake/modules/LLDBConfig.cmake
lldb/trunk/tools/CMakeLists.txt

Modified: lldb/trunk/cmake/modules/LLDBConfig.cmake
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/LLDBConfig.cmake?rev=247913&r1=247912&r2=247913&view=diff
==
--- lldb/trunk/cmake/modules/LLDBConfig.cmake (original)
+++ lldb/trunk/cmake/modules/LLDBConfig.cmake Thu Sep 17 13:35:33 2015
@@ -261,8 +261,9 @@ endif()
 
 # Figure out if lldb could use lldb-server.  If so, then we'll
 # ensure we build lldb-server when an lldb target is being built.
-if ( ( CMAKE_SYSTEM_NAME MATCHES "Linux" ) OR
- ( CMAKE_SYSTEM_NAME MATCHES "Darwin" ) )
+if ((CMAKE_SYSTEM_NAME MATCHES "Darwin") OR
+(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") OR
+(CMAKE_SYSTEM_NAME MATCHES "Linux"))
 set(LLDB_CAN_USE_LLDB_SERVER 1)
 else()
 set(LLDB_CAN_USE_LLDB_SERVER 0)

Modified: lldb/trunk/tools/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/CMakeLists.txt?rev=247913&r1=247912&r2=247913&view=diff
==
--- lldb/trunk/tools/CMakeLists.txt (original)
+++ lldb/trunk/tools/CMakeLists.txt Thu Sep 17 13:35:33 2015
@@ -7,6 +7,6 @@ endif()
 if (NOT __ANDROID_NDK__)
   add_subdirectory(lldb-mi)
 endif()
-if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR CMAKE_SYSTEM_NAME MATCHES "Linux")
+if (LLDB_CAN_USE_LLDB_SERVER)
   add_subdirectory(lldb-server)
 endif()


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


Re: [Lldb-commits] [PATCH] D12925: [cmake] Build lldb-server on Darwin, set dep on FreeBSD.

2015-09-17 Thread Bruce Mitchener via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL247913: [cmake] Build lldb-server on Darwin, set dep on 
FreeBSD. (authored by brucem).

Changed prior to commit:
  http://reviews.llvm.org/D12925?vs=35002&id=35021#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D12925

Files:
  lldb/trunk/cmake/modules/LLDBConfig.cmake
  lldb/trunk/tools/CMakeLists.txt

Index: lldb/trunk/tools/CMakeLists.txt
===
--- lldb/trunk/tools/CMakeLists.txt
+++ lldb/trunk/tools/CMakeLists.txt
@@ -7,6 +7,6 @@
 if (NOT __ANDROID_NDK__)
   add_subdirectory(lldb-mi)
 endif()
-if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR CMAKE_SYSTEM_NAME MATCHES "Linux")
+if (LLDB_CAN_USE_LLDB_SERVER)
   add_subdirectory(lldb-server)
 endif()
Index: lldb/trunk/cmake/modules/LLDBConfig.cmake
===
--- lldb/trunk/cmake/modules/LLDBConfig.cmake
+++ lldb/trunk/cmake/modules/LLDBConfig.cmake
@@ -261,8 +261,9 @@
 
 # Figure out if lldb could use lldb-server.  If so, then we'll
 # ensure we build lldb-server when an lldb target is being built.
-if ( ( CMAKE_SYSTEM_NAME MATCHES "Linux" ) OR
- ( CMAKE_SYSTEM_NAME MATCHES "Darwin" ) )
+if ((CMAKE_SYSTEM_NAME MATCHES "Darwin") OR
+(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") OR
+(CMAKE_SYSTEM_NAME MATCHES "Linux"))
 set(LLDB_CAN_USE_LLDB_SERVER 1)
 else()
 set(LLDB_CAN_USE_LLDB_SERVER 0)


Index: lldb/trunk/tools/CMakeLists.txt
===
--- lldb/trunk/tools/CMakeLists.txt
+++ lldb/trunk/tools/CMakeLists.txt
@@ -7,6 +7,6 @@
 if (NOT __ANDROID_NDK__)
   add_subdirectory(lldb-mi)
 endif()
-if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR CMAKE_SYSTEM_NAME MATCHES "Linux")
+if (LLDB_CAN_USE_LLDB_SERVER)
   add_subdirectory(lldb-server)
 endif()
Index: lldb/trunk/cmake/modules/LLDBConfig.cmake
===
--- lldb/trunk/cmake/modules/LLDBConfig.cmake
+++ lldb/trunk/cmake/modules/LLDBConfig.cmake
@@ -261,8 +261,9 @@
 
 # Figure out if lldb could use lldb-server.  If so, then we'll
 # ensure we build lldb-server when an lldb target is being built.
-if ( ( CMAKE_SYSTEM_NAME MATCHES "Linux" ) OR
- ( CMAKE_SYSTEM_NAME MATCHES "Darwin" ) )
+if ((CMAKE_SYSTEM_NAME MATCHES "Darwin") OR
+(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") OR
+(CMAKE_SYSTEM_NAME MATCHES "Linux"))
 set(LLDB_CAN_USE_LLDB_SERVER 1)
 else()
 set(LLDB_CAN_USE_LLDB_SERVER 0)
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r247914 - Fix TestMiSymbol for gcc-4.9 test.

2015-09-17 Thread Chaoren Lin via lldb-commits
Author: chaoren
Date: Thu Sep 17 13:38:55 2015
New Revision: 247914

URL: http://llvm.org/viewvc/llvm-project?rev=247914&view=rev
Log:
Fix TestMiSymbol for gcc-4.9 test.

Modified:
lldb/trunk/test/tools/lldb-mi/symbol/TestMiSymbol.py

Modified: lldb/trunk/test/tools/lldb-mi/symbol/TestMiSymbol.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/symbol/TestMiSymbol.py?rev=247914&r1=247913&r2=247914&view=diff
==
--- lldb/trunk/test/tools/lldb-mi/symbol/TestMiSymbol.py (original)
+++ lldb/trunk/test/tools/lldb-mi/symbol/TestMiSymbol.py Thu Sep 17 13:38:55 
2015
@@ -45,7 +45,7 @@ class MiSymbolTestCase(lldbmi_testcase.M
 sline = line_number('symbol_list_lines_inline_test2.cpp', '// 
FUNC_gfunc2')
 eline = line_number('symbol_list_lines_inline_test2.cpp', '// 
END_gfunc2')
 self.runCmd("-symbol-list-lines symbol_list_lines_inline_test2.cpp")
-
self.expect("\^done,lines=\[\{pc=\"0x[0-9a-f]+\",line=\"%d\"\}(,\{pc=\"0x[0-9a-f]+\",line=\"3\d\"\})*,\{pc=\"0x[0-9a-f]+\",line=\"%d\"\}\]"
 % (sline, eline))
+
self.expect("\^done,lines=\[\{pc=\"0x[0-9a-f]+\",line=\"%d\"\}(,\{pc=\"0x[0-9a-f]+\",line=\"3\d\"\})*,\{pc=\"0x[0-9a-f]+\",line=\"%d\"\}(,\{pc=\"0x[0-9a-f]+\",line=\"3\d\"\})*\]"
 % (sline, eline))
 ##FIXME: This doesn't work for symbol_list_lines_inline_test.cpp due 
to clang bug llvm.org/pr24716
 ##sline = line_number('symbol_list_lines_inline_test.cpp', '// 
FUNC_gfunc')
 ##eline = line_number('symbol_list_lines_inline_test.cpp', '// 
STRUCT_s')


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


[Lldb-commits] [lldb] r247915 - DataFormatters: Rename clang_type to compiler_type.

2015-09-17 Thread Bruce Mitchener via lldb-commits
Author: brucem
Date: Thu Sep 17 13:43:40 2015
New Revision: 247915

URL: http://llvm.org/viewvc/llvm-project?rev=247915&view=rev
Log:
DataFormatters: Rename clang_type to compiler_type.

Reviewers: granata.enrico

Subscribers: lldb-commits

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

Modified:
lldb/trunk/include/lldb/DataFormatters/FormatManager.h
lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h
lldb/trunk/source/DataFormatters/FormatManager.cpp
lldb/trunk/source/DataFormatters/TypeFormat.cpp
lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp

Modified: lldb/trunk/include/lldb/DataFormatters/FormatManager.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/FormatManager.h?rev=247915&r1=247914&r2=247915&view=diff
==
--- lldb/trunk/include/lldb/DataFormatters/FormatManager.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/FormatManager.h Thu Sep 17 13:43:40 
2015
@@ -290,7 +290,7 @@ private:
 
 static void
 GetPossibleMatches (ValueObject& valobj,
-CompilerType clang_type,
+CompilerType compiler_type,
 uint32_t reason,
 lldb::DynamicValueType use_dynamic,
 FormattersMatchVector& entries,

Modified: lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h?rev=247915&r1=247914&r2=247915&view=diff
==
--- lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h Thu Sep 17 
13:43:40 2015
@@ -413,7 +413,7 @@ private:
 Stream *m_stream;
 DumpValueObjectOptions options;
 Flags m_type_flags;
-CompilerType m_clang_type;
+CompilerType m_compiler_type;
 DumpValueObjectOptions::PointerDepth m_ptr_depth;
 uint32_t m_curr_depth;
 LazyBool m_should_print;

Modified: lldb/trunk/source/DataFormatters/FormatManager.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/FormatManager.cpp?rev=247915&r1=247914&r2=247915&view=diff
==
--- lldb/trunk/source/DataFormatters/FormatManager.cpp (original)
+++ lldb/trunk/source/DataFormatters/FormatManager.cpp Thu Sep 17 13:43:40 2015
@@ -190,7 +190,7 @@ FormatManager::DisableAllCategories ()
 
 void
 FormatManager::GetPossibleMatches (ValueObject& valobj,
-   CompilerType clang_type,
+   CompilerType compiler_type,
uint32_t reason,
lldb::DynamicValueType use_dynamic,
FormattersMatchVector& entries,
@@ -199,8 +199,8 @@ FormatManager::GetPossibleMatches (Value
bool did_strip_typedef,
bool root_level)
 {
-clang_type = ClangASTContext::RemoveFastQualifiers(clang_type);
-ConstString type_name(clang_type.GetConstTypeName());
+compiler_type = ClangASTContext::RemoveFastQualifiers(compiler_type);
+ConstString type_name(compiler_type.GetConstTypeName());
 if (valobj.GetBitfieldBitSize() > 0)
 {
 StreamString sstring;
@@ -211,13 +211,13 @@ FormatManager::GetPossibleMatches (Value
 }
 
entries.push_back({type_name,reason,did_strip_ptr,did_strip_ref,did_strip_typedef});
 
-ConstString display_type_name(clang_type.GetDisplayTypeName());
+ConstString display_type_name(compiler_type.GetDisplayTypeName());
 if (display_type_name != type_name)
 
entries.push_back({display_type_name,reason,did_strip_ptr,did_strip_ref,did_strip_typedef});
 
-for (bool is_rvalue_ref = true, j = true; j && 
clang_type.IsReferenceType(nullptr, &is_rvalue_ref); j = false)
+for (bool is_rvalue_ref = true, j = true; j && 
compiler_type.IsReferenceType(nullptr, &is_rvalue_ref); j = false)
 {
-CompilerType non_ref_type = clang_type.GetNonReferenceType();
+CompilerType non_ref_type = compiler_type.GetNonReferenceType();
 GetPossibleMatches(valobj,
non_ref_type,
reason | 
lldb_private::eFormatterChoiceCriterionStrippedPointerReference,
@@ -241,9 +241,9 @@ FormatManager::GetPossibleMatches (Value
 }
 }
 
-if (clang_type.IsPointerType())
+if (compiler_type.IsPointerType())
 {
-CompilerType non_ptr_type = clang_type.GetPointeeType();
+CompilerType non_ptr_type = compiler_type.GetPointeeType();
 GetPossibleMatches(valobj,
non_ptr_type,
reason | 
lldb_private::eFormatterCho

Re: [Lldb-commits] [PATCH] D12930: DataFormatters: Rename clang_type to compiler_type.

2015-09-17 Thread Bruce Mitchener via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL247915: DataFormatters: Rename clang_type to compiler_type. 
(authored by brucem).

Changed prior to commit:
  http://reviews.llvm.org/D12930?vs=34975&id=35023#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D12930

Files:
  lldb/trunk/include/lldb/DataFormatters/FormatManager.h
  lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h
  lldb/trunk/source/DataFormatters/FormatManager.cpp
  lldb/trunk/source/DataFormatters/TypeFormat.cpp
  lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp

Index: lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h
===
--- lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h
+++ lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h
@@ -413,7 +413,7 @@
 Stream *m_stream;
 DumpValueObjectOptions options;
 Flags m_type_flags;
-CompilerType m_clang_type;
+CompilerType m_compiler_type;
 DumpValueObjectOptions::PointerDepth m_ptr_depth;
 uint32_t m_curr_depth;
 LazyBool m_should_print;
Index: lldb/trunk/include/lldb/DataFormatters/FormatManager.h
===
--- lldb/trunk/include/lldb/DataFormatters/FormatManager.h
+++ lldb/trunk/include/lldb/DataFormatters/FormatManager.h
@@ -290,7 +290,7 @@
 
 static void
 GetPossibleMatches (ValueObject& valobj,
-CompilerType clang_type,
+CompilerType compiler_type,
 uint32_t reason,
 lldb::DynamicValueType use_dynamic,
 FormattersMatchVector& entries,
Index: lldb/trunk/source/DataFormatters/TypeFormat.cpp
===
--- lldb/trunk/source/DataFormatters/TypeFormat.cpp
+++ lldb/trunk/source/DataFormatters/TypeFormat.cpp
@@ -91,13 +91,13 @@
 }
 else
 {
-CompilerType clang_type = value.GetCompilerType ();
-if (clang_type)
+CompilerType compiler_type = value.GetCompilerType ();
+if (compiler_type)
 {
 // put custom bytes to display in the DataExtractor to override the default value logic
 if (GetFormat() == eFormatCString)
 {
-lldb_private::Flags type_flags(clang_type.GetTypeInfo(NULL)); // disambiguate w.r.t. TypeFormatImpl::Flags
+lldb_private::Flags type_flags(compiler_type.GetTypeInfo(NULL)); // disambiguate w.r.t. TypeFormatImpl::Flags
 if (type_flags.Test(eTypeIsPointer) && !type_flags.Test(eTypeIsObjC))
 {
 // if we are dumping a pointer as a c-string, get the pointee data as a string
@@ -122,7 +122,7 @@
 }
 
 StreamString sstr;
-clang_type.DumpTypeValue (&sstr, // The stream to use for display
+compiler_type.DumpTypeValue (&sstr, // The stream to use for display
   GetFormat(),  // Format to display this type with
   data, // Data to extract from
   0, // Byte offset into "m_data"
Index: lldb/trunk/source/DataFormatters/FormatManager.cpp
===
--- lldb/trunk/source/DataFormatters/FormatManager.cpp
+++ lldb/trunk/source/DataFormatters/FormatManager.cpp
@@ -190,17 +190,17 @@
 
 void
 FormatManager::GetPossibleMatches (ValueObject& valobj,
-   CompilerType clang_type,
+   CompilerType compiler_type,
uint32_t reason,
lldb::DynamicValueType use_dynamic,
FormattersMatchVector& entries,
bool did_strip_ptr,
bool did_strip_ref,
bool did_strip_typedef,
bool root_level)
 {
-clang_type = ClangASTContext::RemoveFastQualifiers(clang_type);
-ConstString type_name(clang_type.GetConstTypeName());
+compiler_type = ClangASTContext::RemoveFastQualifiers(compiler_type);
+ConstString type_name(compiler_type.GetConstTypeName());
 if (valobj.GetBitfieldBitSize() > 0)
 {
 StreamString sstring;
@@ -211,13 +211,13 @@
 }
 entries.push_back({type_name,reason,did_strip_ptr,did_strip_ref,did_strip_typedef});
 
-ConstString display_type_name(clang_type.GetDisplayTypeName());
+ConstString display_type_name(compiler_type.GetDisplayTypeName());
 if (d

[Lldb-commits] [lldb] r247916 - Remove unused includes from clang in DataFormatters.

2015-09-17 Thread Bruce Mitchener via lldb-commits
Author: brucem
Date: Thu Sep 17 13:46:22 2015
New Revision: 247916

URL: http://llvm.org/viewvc/llvm-project?rev=247916&view=rev
Log:
Remove unused includes from clang in DataFormatters.

Reviewers: granata.enrico

Subscribers: lldb-commits

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

Modified:
lldb/trunk/include/lldb/DataFormatters/FormattersContainer.h

Modified: lldb/trunk/include/lldb/DataFormatters/FormattersContainer.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/FormattersContainer.h?rev=247916&r1=247915&r2=247916&view=diff
==
--- lldb/trunk/include/lldb/DataFormatters/FormattersContainer.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/FormattersContainer.h Thu Sep 17 
13:46:22 2015
@@ -15,9 +15,6 @@
 #include 
 
 // Other libraries and framework includes
-#include "clang/AST/DeclCXX.h"
-#include "clang/AST/Type.h"
-#include "clang/AST/DeclObjC.h"
 
 // Project includes
 #include "lldb/lldb-public.h"


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


Re: [Lldb-commits] [PATCH] D12929: Remove unused includes from clang in DataFormatters.

2015-09-17 Thread Bruce Mitchener via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL247916: Remove unused includes from clang in DataFormatters. 
(authored by brucem).

Changed prior to commit:
  http://reviews.llvm.org/D12929?vs=34974&id=35024#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D12929

Files:
  lldb/trunk/include/lldb/DataFormatters/FormattersContainer.h

Index: lldb/trunk/include/lldb/DataFormatters/FormattersContainer.h
===
--- lldb/trunk/include/lldb/DataFormatters/FormattersContainer.h
+++ lldb/trunk/include/lldb/DataFormatters/FormattersContainer.h
@@ -15,9 +15,6 @@
 #include 
 
 // Other libraries and framework includes
-#include "clang/AST/DeclCXX.h"
-#include "clang/AST/Type.h"
-#include "clang/AST/DeclObjC.h"
 
 // Project includes
 #include "lldb/lldb-public.h"


Index: lldb/trunk/include/lldb/DataFormatters/FormattersContainer.h
===
--- lldb/trunk/include/lldb/DataFormatters/FormattersContainer.h
+++ lldb/trunk/include/lldb/DataFormatters/FormattersContainer.h
@@ -15,9 +15,6 @@
 #include 
 
 // Other libraries and framework includes
-#include "clang/AST/DeclCXX.h"
-#include "clang/AST/Type.h"
-#include "clang/AST/DeclObjC.h"
 
 // Project includes
 #include "lldb/lldb-public.h"
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r247922 - Adjustments to syncsource.py.

2015-09-17 Thread Todd Fiala via lldb-commits
Author: tfiala
Date: Thu Sep 17 14:23:50 2015
New Revision: 247922

URL: http://llvm.org/viewvc/llvm-project?rev=247922&view=rev
Log:
Adjustments to syncsource.py.

- renamed sync-source.py to syncsource.py to appease pylint.
- added missing lib/transfer/__init__.py file.  Fumble from
  git to svn.
- adjusted README to call sync-source.py syncsource.py, and
  call .sync-sourcerc .syncsourcerc.
- marked syncsource.py as executable by all.

Added:
lldb/trunk/utils/sync-source/lib/transfer/__init__.py
lldb/trunk/utils/sync-source/syncsource.py
  - copied, changed from r247920, 
lldb/trunk/utils/sync-source/sync-source.py
Removed:
lldb/trunk/utils/sync-source/sync-source.py
Modified:
lldb/trunk/utils/sync-source/README.txt

Modified: lldb/trunk/utils/sync-source/README.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/utils/sync-source/README.txt?rev=247922&r1=247921&r2=247922&view=diff
==
--- lldb/trunk/utils/sync-source/README.txt (original)
+++ lldb/trunk/utils/sync-source/README.txt Thu Sep 17 14:23:50 2015
@@ -1,16 +1,16 @@
-sync-source.py
+syncsource.py
 
 OVERVIEW
 
-The sync-source.py utility transfers groups of files between
+The syncsource.py utility transfers groups of files between
 computers. The primary use case is to enable developing LLVM project
 software on one machine, transfer it efficiently to other machines ---
-possibly of other architectures --- and test it there. sync-source.py
+possibly of other architectures --- and test it there. syncsource.py
 supports configurable, named source-to-destination mappings and has a
 transfer agent plug-in architecture. The current distribution provides
 an rsync-over-ssh transfer agent.
 
-The primary benefits of using sync-source.py are:
+The primary benefits of using syncsource.py are:
 
 * Provides a simple, reliable way to get a mirror copy of primary-
   machine files onto several different destinations without concern
@@ -46,7 +46,7 @@ Requirements:
 
 * FreeBSD machine requires the same layout as the llvm machine.
 
-sync-source.py configuration in ~/.sync-sourcerc:
+syncsource.py configuration in ~/.syncsourcerc:
 
 # This is my configuration with a comment.  Configuration
 # files are JSON-based.
@@ -93,7 +93,7 @@ sync-source.py configuration in ~/.sync-
 #
 # By default, ".git", ".svn" and ".pyc" are added to
 # all dir-id exclusions.  The default excludes can be
-# controlled by the sync-source.py --default-excludes
+# controlled by the syncsource.py --default-excludes
 # option.
 #
 # Below, I have transfer of the lldb dir skip everything
@@ -210,7 +210,7 @@ sync-source.py configuration in ~/.sync-
 # 1. having a parent "default" blockthat points to this one,
 #which then gets used by default, or
 # 2. using the --configuration/-c CONFIG option to
-#specify using this name on the sync-source.py command line.
+#specify using this name on the syncsource.py command line.
 {
 "name": "lldb-linux"
 "parent": "common_tot",
@@ -266,20 +266,20 @@ sync-source.py configuration in ~/.sync-
 
 Using it
 
-Now that we have a .sync-sourcerc file set up, we can do a transfer.
-The .sync-sourcerc file will be searched for as follows, using the
+Now that we have a .syncsourcerc file set up, we can do a transfer.
+The .syncsourcerc file will be searched for as follows, using the
 first one that is found:
 
 * First check the --rc-file RCFILE option.  If this is specified
   and doesn't exist, it will raise an error and quit.
 
-* Check if the current directory has a .sync-sourcerc file.  If so,
+* Check if the current directory has a .syncsourcerc file.  If so,
   use that.
 
-* Use the .sync-sourcerc file from the user's home directory.
+* Use the .syncsourcerc file from the user's home directory.
 
 Run the command:
-python /path/to/sync-source.rc -c {configuration-name}
+python /path/to/syncsource.rc -c {configuration-name}
 
 The -c {configuration-name} can be left off, in which case a
 configuration with the name 'default' will be used.

Added: lldb/trunk/utils/sync-source/lib/transfer/__init__.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/utils/sync-source/lib/transfer/__init__.py?rev=247922&view=auto
==
(empty)

Removed: lldb/trunk/utils/sync-source/sync-source.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/utils/sync-source/sync-source.py?rev=247921&view=auto
==
--- lldb/trunk/utils/sync-source/sync-source.py (original)
+++ lldb/trunk/utils/sync-source/sync-source.py (removed)
@@ -1,261 +0,0 @@
-#!/usr/bin/env python
-"""
- The LLVM Compiler Infrastructure
-
-This file is distributed under the University of Illinois Open Source
-License. See L

Re: [Lldb-commits] [PATCH] D12942: Fix caching for clang::Decl in DWARFASTParserClang

2015-09-17 Thread Paul Herman via lldb-commits
paulherman updated this revision to Diff 35026.
paulherman added a comment.

Fix caching for clang::Decl in DWARFASTParserClang

Changed from std::set to switch. Rebased the patch.


http://reviews.llvm.org/D12942

Files:
  source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp

Index: source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
===
--- source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -3225,13 +3225,31 @@
 if (!die)
 return nullptr;
 
-if (die.GetReferencedDIE(DW_AT_specification))
-return GetClangDeclForDIE(die.GetReferencedDIE(DW_AT_specification));
+switch (die.Tag())
+{
+case DW_TAG_variable:
+case DW_TAG_constant:
+case DW_TAG_formal_parameter:
+case DW_TAG_imported_declaration:
+case DW_TAG_imported_module:
+break;
+default:
+return nullptr;
+}
 
-clang::Decl *decl = m_die_to_decl[die.GetDIE()];
-if (decl != nullptr)
+DIEToDeclMap::iterator cache_pos = m_die_to_decl.find(die.GetDIE());
+if (cache_pos != m_die_to_decl.end())
+return cache_pos->second;
+
+if (DWARFDIE spec_die = die.GetReferencedDIE(DW_AT_specification))
+{
+clang::Decl *decl = GetClangDeclForDIE(spec_die);
+m_die_to_decl[die.GetDIE()] = decl;
+m_decl_to_die[decl].insert(die.GetDIE());
 return decl;
+}
 
+clang::Decl *decl = nullptr;
 switch (die.Tag())
 {
 case DW_TAG_variable:


Index: source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
===
--- source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -3225,13 +3225,31 @@
 if (!die)
 return nullptr;
 
-if (die.GetReferencedDIE(DW_AT_specification))
-return GetClangDeclForDIE(die.GetReferencedDIE(DW_AT_specification));
+switch (die.Tag())
+{
+case DW_TAG_variable:
+case DW_TAG_constant:
+case DW_TAG_formal_parameter:
+case DW_TAG_imported_declaration:
+case DW_TAG_imported_module:
+break;
+default:
+return nullptr;
+}
 
-clang::Decl *decl = m_die_to_decl[die.GetDIE()];
-if (decl != nullptr)
+DIEToDeclMap::iterator cache_pos = m_die_to_decl.find(die.GetDIE());
+if (cache_pos != m_die_to_decl.end())
+return cache_pos->second;
+
+if (DWARFDIE spec_die = die.GetReferencedDIE(DW_AT_specification))
+{
+clang::Decl *decl = GetClangDeclForDIE(spec_die);
+m_die_to_decl[die.GetDIE()] = decl;
+m_decl_to_die[decl].insert(die.GetDIE());
 return decl;
+}
 
+clang::Decl *decl = nullptr;
 switch (die.Tag())
 {
 case DW_TAG_variable:
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r247923 - Fix caching for clang::Decl in DWARFASTParserClang

2015-09-17 Thread Paul Herman via lldb-commits
Author: paulherman
Date: Thu Sep 17 14:32:02 2015
New Revision: 247923

URL: http://llvm.org/viewvc/llvm-project?rev=247923&view=rev
Log:
Fix caching for clang::Decl in DWARFASTParserClang

Reviewers: sivachandra, chaoren, clayborg, tberghammer

Subscribers: lldb-commits

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

Modified:
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp?rev=247923&r1=247922&r2=247923&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp 
(original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp Thu Sep 
17 14:32:02 2015
@@ -3225,13 +3225,31 @@ DWARFASTParserClang::GetClangDeclForDIE
 if (!die)
 return nullptr;
 
-if (die.GetReferencedDIE(DW_AT_specification))
-return GetClangDeclForDIE(die.GetReferencedDIE(DW_AT_specification));
+switch (die.Tag())
+{
+case DW_TAG_variable:
+case DW_TAG_constant:
+case DW_TAG_formal_parameter:
+case DW_TAG_imported_declaration:
+case DW_TAG_imported_module:
+break;
+default:
+return nullptr;
+}
 
-clang::Decl *decl = m_die_to_decl[die.GetDIE()];
-if (decl != nullptr)
+DIEToDeclMap::iterator cache_pos = m_die_to_decl.find(die.GetDIE());
+if (cache_pos != m_die_to_decl.end())
+return cache_pos->second;
+
+if (DWARFDIE spec_die = die.GetReferencedDIE(DW_AT_specification))
+{
+clang::Decl *decl = GetClangDeclForDIE(spec_die);
+m_die_to_decl[die.GetDIE()] = decl;
+m_decl_to_die[decl].insert(die.GetDIE());
 return decl;
+}
 
+clang::Decl *decl = nullptr;
 switch (die.Tag())
 {
 case DW_TAG_variable:


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


[Lldb-commits] [lldb] r247929 - Fix a race condition when terminating inferiors on Windows.

2015-09-17 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Thu Sep 17 15:18:50 2015
New Revision: 247929

URL: http://llvm.org/viewvc/llvm-project?rev=247929&view=rev
Log:
Fix a race condition when terminating inferiors on Windows.

If a breakpoint was hit in the inferior after shutdown had
started but before it was complete, it would cause an unclean
terminate of the inferior, leading to various problems the most
visible of which is that handles to the inferior executable would
remain locked, and the test suite would fail to run subsequent
tests because it could not recompile the inferior.

This fixes a major source of flakiness in the test suite.

Modified:
lldb/trunk/source/Plugins/Process/Windows/Live/DebuggerThread.cpp
lldb/trunk/source/Plugins/Process/Windows/Live/DebuggerThread.h

Modified: lldb/trunk/source/Plugins/Process/Windows/Live/DebuggerThread.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Windows/Live/DebuggerThread.cpp?rev=247929&r1=247928&r2=247929&view=diff
==
--- lldb/trunk/source/Plugins/Process/Windows/Live/DebuggerThread.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Windows/Live/DebuggerThread.cpp Thu Sep 
17 15:18:50 2015
@@ -63,6 +63,7 @@ DebuggerThread::DebuggerThread(DebugDele
 : m_debug_delegate(debug_delegate)
 , m_image_file(nullptr)
 , m_debugging_ended_event(nullptr)
+, m_is_shutting_down(false)
 , m_pid_to_detach(0)
 , m_detached(false)
 {
@@ -194,6 +195,11 @@ DebuggerThread::StopDebugging(bool termi
 "StopDebugging('%s') called (inferior=%I64u).",
 (terminate ? "true" : "false"), pid);
 
+// Set m_is_shutting_down to true if it was false.  Return if it was 
already true.
+bool expected = false;
+if (!m_is_shutting_down.compare_exchange_strong(expected, true))
+return error;
+
 // Make a copy of the process, since the termination sequence will reset
 // DebuggerThread's internal copy and it needs to remain open for the Wait 
operation.
 HostProcess process_copy = m_process;
@@ -298,6 +304,14 @@ DebuggerThread::DebugLoop()
 {
 case EXCEPTION_DEBUG_EVENT:
 {
+if (m_is_shutting_down)
+{
+// Don't perform any blocking operations while we're 
shutting down.  That will
+// cause TerminateProcess -> WaitForSingleObject to 
time out.
+continue_status = DBG_EXCEPTION_NOT_HANDLED;
+break;
+}
+
 ExceptionResult status = 
HandleExceptionEvent(dbe.u.Exception, dbe.dwThreadId);
 
 if (status == ExceptionResult::MaskException)

Modified: lldb/trunk/source/Plugins/Process/Windows/Live/DebuggerThread.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Windows/Live/DebuggerThread.h?rev=247929&r1=247928&r2=247929&view=diff
==
--- lldb/trunk/source/Plugins/Process/Windows/Live/DebuggerThread.h (original)
+++ lldb/trunk/source/Plugins/Process/Windows/Live/DebuggerThread.h Thu Sep 17 
15:18:50 2015
@@ -86,6 +86,8 @@ class DebuggerThread : public std::enabl
 // exits the debugger loop and is detached 
from the inferior.
 
 std::atomic m_pid_to_detach;  // Signals the loop to detach from 
the process (specified by pid).
+std::atomic m_is_shutting_down;   // Signals the debug loop to stop 
processing certain types of
+// events that block shutdown.
 bool m_detached;  // Indicates we've detached from the inferior process 
and the debug loop can exit.
 
 static lldb::thread_result_t DebuggerThreadLaunchRoutine(void *data);


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


[Lldb-commits] [lldb] r247939 - Get the process ID from a minidump.

2015-09-17 Thread Adrian McCarthy via lldb-commits
Author: amccarth
Date: Thu Sep 17 15:52:29 2015
New Revision: 247939

URL: http://llvm.org/viewvc/llvm-project?rev=247939&view=rev
Log:
Get the process ID from a minidump.

Modified:
lldb/trunk/source/Plugins/Process/Windows/MiniDump/ProcessWinMiniDump.cpp
lldb/trunk/source/Plugins/Process/Windows/MiniDump/ProcessWinMiniDump.h
lldb/trunk/test/functionalities/postmortem/minidump/TestMiniDump.py

Modified: 
lldb/trunk/source/Plugins/Process/Windows/MiniDump/ProcessWinMiniDump.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Windows/MiniDump/ProcessWinMiniDump.cpp?rev=247939&r1=247938&r2=247939&view=diff
==
--- lldb/trunk/source/Plugins/Process/Windows/MiniDump/ProcessWinMiniDump.cpp 
(original)
+++ lldb/trunk/source/Plugins/Process/Windows/MiniDump/ProcessWinMiniDump.cpp 
Thu Sep 17 15:52:29 2015
@@ -164,6 +164,7 @@ ProcessWinMiniDump::DoLoadCore()
 }
 
 GetTarget().SetArchitecture(DetermineArchitecture());
+ReadMiscInfo();  // notably for process ID
 ReadModuleList();
 ReadExceptionRecord();
 
@@ -433,7 +434,8 @@ ProcessWinMiniDump::DetermineArchitectur
 }
 
 void
-ProcessWinMiniDump::ReadExceptionRecord() {
+ProcessWinMiniDump::ReadExceptionRecord()
+{
 size_t size = 0;
 auto exception_stream_ptr = 
static_cast(FindDumpStream(ExceptionStream, &size));
 if (exception_stream_ptr)
@@ -443,7 +445,23 @@ ProcessWinMiniDump::ReadExceptionRecord(
 }
 
 void
-ProcessWinMiniDump::ReadModuleList() {
+ProcessWinMiniDump::ReadMiscInfo()
+{
+size_t size = 0;
+const auto misc_info_ptr = 
static_cast(FindDumpStream(MiscInfoStream, &size));
+if (!misc_info_ptr || size < sizeof(MINIDUMP_MISC_INFO)) {
+return;
+}
+
+if ((misc_info_ptr->Flags1 & MINIDUMP_MISC1_PROCESS_ID) != 0) {
+// This misc info record has the process ID.
+SetID(misc_info_ptr->ProcessId);
+}
+}
+
+void
+ProcessWinMiniDump::ReadModuleList()
+{
 size_t size = 0;
 auto module_list_ptr = 
static_cast(FindDumpStream(ModuleListStream, &size));
 if (!module_list_ptr || module_list_ptr->NumberOfModules == 0)

Modified: 
lldb/trunk/source/Plugins/Process/Windows/MiniDump/ProcessWinMiniDump.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Windows/MiniDump/ProcessWinMiniDump.h?rev=247939&r1=247938&r2=247939&view=diff
==
--- lldb/trunk/source/Plugins/Process/Windows/MiniDump/ProcessWinMiniDump.h 
(original)
+++ lldb/trunk/source/Plugins/Process/Windows/MiniDump/ProcessWinMiniDump.h Thu 
Sep 17 15:52:29 2015
@@ -117,6 +117,9 @@ private:
 ReadExceptionRecord();
 
 void
+ReadMiscInfo();
+
+void
 ReadModuleList();
 
 // A thin wrapper around WinAPI's MiniDumpReadDumpStream to avoid redundant

Modified: lldb/trunk/test/functionalities/postmortem/minidump/TestMiniDump.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/postmortem/minidump/TestMiniDump.py?rev=247939&r1=247938&r2=247939&view=diff
==
--- lldb/trunk/test/functionalities/postmortem/minidump/TestMiniDump.py 
(original)
+++ lldb/trunk/test/functionalities/postmortem/minidump/TestMiniDump.py Thu Sep 
17 15:52:29 2015
@@ -16,7 +16,7 @@ class MiniDumpTestCase(TestBase):
 """Test that lldb can read the process information from the 
minidump."""
 self.assertTrue(self.process, PROCESS_IS_VALID)
 self.assertEqual(self.process.GetNumThreads(), 1)
-# TODO(amccarth):  Check the process ID.
+self.assertEqual(self.process.GetProcessID(), 4440)
 
 def test_thread_info_in_mini_dump(self):
 """Test that lldb can read the thread information from the minidump."""


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


[Lldb-commits] LLVM buildmaster will be restarted tonight

2015-09-17 Thread Galina Kistanova via lldb-commits
Hello everyone,

LLVM buildmaster will be restarted after 6 PM Pacific time today.

Thanks

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


[Lldb-commits] [lldb] r247953 - TypeSystem is now a plugin interface and removed any "ClangASTContext &Class::GetClangASTContext()" functions.

2015-09-17 Thread Greg Clayton via lldb-commits
Author: gclayton
Date: Thu Sep 17 17:23:34 2015
New Revision: 247953

URL: http://llvm.org/viewvc/llvm-project?rev=247953&view=rev
Log:
TypeSystem is now a plugin interface and removed any "ClangASTContext 
&Class::GetClangASTContext()" functions.

This cleans up type systems to be more pluggable. Prior to this we had issues:
- Module, SymbolFile, and many others has "ClangASTContext 
&GetClangASTContext()" functions. All have been switched over to use 
"TypeSystem *GetTypeSystemForLanguage()"
- Cleaned up any places that were using the GetClangASTContext() functions to 
use TypeSystem
- Cleaned up Module so that it no longer has dedicated type system member 
variables:
lldb::ClangASTContextUP m_ast;  ///< The Clang AST context for 
this module.
lldb::GoASTContextUPm_go_ast;   ///< The Go AST context for 
this module.

Now we have a type system map:

typedef std::map TypeSystemMap;
TypeSystemMap   m_type_system_map;///< A map of any type 
systems associated with this module
- Many places in code were using ClangASTContext static functions to place with 
CompilerType objects and add modifiers (const, volatile, restrict) and to make 
typedefs, L and R value references and more. These have been made into 
CompilerType functions that are abstract:

class CompilerType
{
...

//--
// Return a new CompilerType that is a L value reference to this type if
// this type is valid and the type system supports L value references,
// else return an invalid type.
//--
CompilerType
GetLValueReferenceType () const;

//--
// Return a new CompilerType that is a R value reference to this type if
// this type is valid and the type system supports R value references,
// else return an invalid type.
//--
CompilerType
GetRValueReferenceType () const;

//--
// Return a new CompilerType adds a const modifier to this type if
// this type is valid and the type system supports const modifiers,
// else return an invalid type.
//--
CompilerType
AddConstModifier () const;

//--
// Return a new CompilerType adds a volatile modifier to this type if
// this type is valid and the type system supports volatile modifiers,
// else return an invalid type.
//--
CompilerType
AddVolatileModifier () const;

//--
// Return a new CompilerType adds a restrict modifier to this type if
// this type is valid and the type system supports restrict modifiers,
// else return an invalid type.
//--
CompilerType
AddRestrictModifier () const;

//--
// Create a typedef to this type using "name" as the name of the typedef
// this type is valid and the type system supports typedefs, else return
// an invalid type.
//--
CompilerType
CreateTypedef (const char *name, const CompilerDeclContext &decl_ctx) const;

};

Other changes include:
- Removed "CompilerType TypeSystem::GetIntTypeFromBitSize(...)" and 
CompilerType TypeSystem::GetFloatTypeFromBitSize(...) and replaced it with 
"CompilerType TypeSystem::GetBuiltinTypeForEncodingAndBitSize(lldb::Encoding 
encoding, size_t bit_size);"
- Fixed code in Type.h to not request the full type for a type for no good 
reason, just request the forward type and let the type expand as needed



Modified:
lldb/trunk/include/lldb/Core/Module.h
lldb/trunk/include/lldb/Core/PluginManager.h
lldb/trunk/include/lldb/Symbol/ClangASTContext.h
lldb/trunk/include/lldb/Symbol/CompilerType.h
lldb/trunk/include/lldb/Symbol/GoASTContext.h
lldb/trunk/include/lldb/Symbol/SymbolFile.h
lldb/trunk/include/lldb/Symbol/Type.h
lldb/trunk/include/lldb/Symbol/TypeSystem.h
lldb/trunk/include/lldb/lldb-forward.h
lldb/trunk/include/lldb/lldb-private-interfaces.h
lldb/trunk/source/API/SBModule.cpp
lldb/trunk/source/API/SBType.cpp
lldb/trunk/source/API/SystemInitializerFull.cpp
lldb/trunk/source/Commands/CommandObjectArgs.cpp
lldb/trunk/source/Core/Module.cpp
lldb/trunk/source/Core/PluginManager.cpp
lldb/trunk/source/Core/ValueObjectDy

[Lldb-commits] [lldb] r247957 - Make LanguageRuntime::GetDynamicTypeAndAddress return a ValueType

2015-09-17 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Thu Sep 17 17:56:38 2015
New Revision: 247957

URL: http://llvm.org/viewvc/llvm-project?rev=247957&view=rev
Log:
Make LanguageRuntime::GetDynamicTypeAndAddress return a ValueType

For C++ and ObjC, dynamic values are always (at least somewhat) pointer-like in 
nature, so a ValueType of scalar is actually good enough that it could 
originally be hardcoded as the right choice
Other languages, might have broader notions of things that are dynamic (e.g. a 
language where a value type can be dynamic). In those cases, it might actually 
be the case that a dynamic value is a pointer-to the data, or even a host 
address if dynamic expression results entirely in host space are being talked 
about

This patch enables the language runtime to make that decision, and makes 
ValueObjectDynamicValue comply with it


Modified:
lldb/trunk/include/lldb/Target/LanguageRuntime.h
lldb/trunk/source/Core/ValueObjectDynamicValue.cpp

lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp

lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h

lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp

lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h

lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp

lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h

lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp

lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h

lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp

lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h

Modified: lldb/trunk/include/lldb/Target/LanguageRuntime.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/LanguageRuntime.h?rev=247957&r1=247956&r2=247957&view=diff
==
--- lldb/trunk/include/lldb/Target/LanguageRuntime.h (original)
+++ lldb/trunk/include/lldb/Target/LanguageRuntime.h Thu Sep 17 17:56:38 2015
@@ -52,7 +52,8 @@ public:
 GetDynamicTypeAndAddress (ValueObject &in_value, 
   lldb::DynamicValueType use_dynamic, 
   TypeAndOrName &class_type_or_name, 
-  Address &address) = 0;
+  Address &address,
+  Value::ValueType &value_type) = 0;
 
 // This should be a fast test to determine whether it is likely that this 
value would
 // have a dynamic type.

Modified: lldb/trunk/source/Core/ValueObjectDynamicValue.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectDynamicValue.cpp?rev=247957&r1=247956&r2=247957&view=diff
==
--- lldb/trunk/source/Core/ValueObjectDynamicValue.cpp (original)
+++ lldb/trunk/source/Core/ValueObjectDynamicValue.cpp Thu Sep 17 17:56:38 2015
@@ -210,25 +210,26 @@ ValueObjectDynamicValue::UpdateValue ()
 TypeAndOrName class_type_or_name;
 Address dynamic_address;
 bool found_dynamic_type = false;
+Value::ValueType value_type;
 
 lldb::LanguageType known_type = m_parent->GetObjectRuntimeLanguage();
 if (known_type != lldb::eLanguageTypeUnknown && known_type != 
lldb::eLanguageTypeC)
 {
 LanguageRuntime *runtime = process->GetLanguageRuntime (known_type);
 if (runtime)
-found_dynamic_type = runtime->GetDynamicTypeAndAddress (*m_parent, 
m_use_dynamic, class_type_or_name, dynamic_address);
+found_dynamic_type = runtime->GetDynamicTypeAndAddress (*m_parent, 
m_use_dynamic, class_type_or_name, dynamic_address, value_type);
 }
 else
 {
 LanguageRuntime *cpp_runtime = process->GetLanguageRuntime 
(lldb::eLanguageTypeC_plus_plus);
 if (cpp_runtime)
-found_dynamic_type = cpp_runtime->GetDynamicTypeAndAddress 
(*m_parent, m_use_dynamic, class_type_or_name, dynamic_address);
+found_dynamic_type = cpp_runtime->GetDynamicTypeAndAddress 
(*m_parent, m_use_dynamic, class_type_or_name, dynamic_address, value_type);
 
 if (!found_dynamic_type)
 {
 LanguageRuntime *objc_runtime = process->GetLanguageRuntime 
(lldb::eLanguageTypeObjC);
 if (objc_runtime)
-found_dynamic_type = objc_runtime->GetDynamicTypeAndAddress 
(*m_parent, m_use_dynamic, class_type_or_name, dynamic_address);
+found_dynamic_type = objc_runtime->GetDynamicTypeAndAddress 
(*m_parent, m_use_dynamic, class_type_or_name, dynamic_address, value_type);
 }
 }
 
@@ -305,9 +306,7 @@ ValueObjectDynamicValue::UpdateValue ()

Re: [Lldb-commits] [PATCH] D12750: Link NetBSD with execinfo (CMAKE build)

2015-09-17 Thread Stephane Sezer via lldb-commits
sas accepted this revision.
sas added a comment.

I'm fine with this patch the way it is. Unless @brucem refuses, I'll submit it. 
Improving cmake checks can be dealt with later on.


Repository:
  rL LLVM

http://reviews.llvm.org/D12750



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


Re: [Lldb-commits] [PATCH] D12750: Link NetBSD with execinfo (CMAKE build)

2015-09-17 Thread Kamil Rytarowski via lldb-commits
krytarowski added a comment.

In http://reviews.llvm.org/D12750#244435, @sas wrote:

> @brucem, not sure exactly what way forward you are suggesting. LLDB build 
> system supports cmake 2.8.12 and up, so we can't use FindBacktrace unless we 
> bump that to 3.0. Are we recommending we do that?


Can we do this later, after merging this change at it is? For now I won't be 
able to test the new approach.

In http://reviews.llvm.org/D12750#248348, @sas wrote:

> I'm fine with this patch the way it is. Unless @brucem refuses, I'll submit 
> it. Improving cmake checks can be dealt with later on.


We have got CMake 2.8 set as the minimal requirement.

  cmake_minimum_required(VERSION 2.8)

I'm willing to push NetBSD bits first and then refactor for all platforms.

Are you OK with it @brucem?


Repository:
  rL LLVM

http://reviews.llvm.org/D12750



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


Re: [Lldb-commits] [PATCH] D12750: Link NetBSD with execinfo (CMAKE build)

2015-09-17 Thread Bruce Mitchener via lldb-commits
brucem accepted this revision.
brucem added a comment.
This revision is now accepted and ready to land.

We can do that other part later ... we don't have to require newer cmake to do 
it, just provide our own file that does something similar until we update to 
newer cmake.


Repository:
  rL LLVM

http://reviews.llvm.org/D12750



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


[Lldb-commits] [lldb] r247962 - Fixed test runner output for Jenkins xUnit publish

2015-09-17 Thread Todd Fiala via lldb-commits
Author: tfiala
Date: Thu Sep 17 20:43:08 2015
New Revision: 247962

URL: http://llvm.org/viewvc/llvm-project?rev=247962&view=rev
Log:
Fixed test runner output for Jenkins xUnit publish

The Jenkins JUnit publisher handled our output, but
the Jenkins xUnit plugin's JUnit support did not like
that we didn't have a  element wrapping
everything.  They both work with this fix.

Modified:
lldb/trunk/test/test_results.py

Modified: lldb/trunk/test/test_results.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/test_results.py?rev=247962&r1=247961&r2=247962&view=diff
==
--- lldb/trunk/test/test_results.py (original)
+++ lldb/trunk/test/test_results.py Thu Sep 17 20:43:08 2015
@@ -708,6 +708,7 @@ class XunitFormatter(ResultsFormatter):
 # Output the header.
 self.out_file.write(
 '\n'
+''
 '\n'.format(
 self.text_encoding,
@@ -723,7 +724,7 @@ class XunitFormatter(ResultsFormatter):
 self.out_file.write(result + '\n')
 
 # Close off the test suite.
-self.out_file.write('\n')
+self.out_file.write('\n')
 
 super(XunitFormatter, self).end_session()
 


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


[Lldb-commits] [PATCH] D12953: Remove some clang references from API.

2015-09-17 Thread Bruce Mitchener via lldb-commits
brucem created this revision.
brucem added a reviewer: clayborg.
brucem added a subscriber: lldb-commits.

Remove an unused include and 'using namespace clang' declarations.

Also, rename a CompilerType variable to not have 'clang' in the name.

http://reviews.llvm.org/D12953

Files:
  source/API/SBType.cpp
  source/API/SBTypeEnumMember.cpp

Index: source/API/SBTypeEnumMember.cpp
===
--- source/API/SBTypeEnumMember.cpp
+++ source/API/SBTypeEnumMember.cpp
@@ -17,7 +17,6 @@
 
 using namespace lldb;
 using namespace lldb_private;
-using namespace clang;
 
 SBTypeEnumMember::SBTypeEnumMember() :
 m_opaque_sp()
Index: source/API/SBType.cpp
===
--- source/API/SBType.cpp
+++ source/API/SBType.cpp
@@ -19,11 +19,9 @@
 #include "lldb/Symbol/TypeSystem.h"
 
 #include "llvm/ADT/APSInt.h"
-#include "clang/AST/Decl.h"
 
 using namespace lldb;
 using namespace lldb_private;
-using namespace clang;
 
 SBType::SBType() :
 m_opaque_sp()
@@ -271,9 +269,9 @@
 {
 if (IsValid())
 {
-CompilerType return_clang_type 
(m_opaque_sp->GetCompilerType(true).GetFunctionReturnType());
-if (return_clang_type.IsValid())
-return SBType(return_clang_type);
+CompilerType return_type 
(m_opaque_sp->GetCompilerType(true).GetFunctionReturnType());
+if (return_type.IsValid())
+return SBType(return_type);
 }
 return lldb::SBType();
 }


Index: source/API/SBTypeEnumMember.cpp
===
--- source/API/SBTypeEnumMember.cpp
+++ source/API/SBTypeEnumMember.cpp
@@ -17,7 +17,6 @@
 
 using namespace lldb;
 using namespace lldb_private;
-using namespace clang;
 
 SBTypeEnumMember::SBTypeEnumMember() :
 m_opaque_sp()
Index: source/API/SBType.cpp
===
--- source/API/SBType.cpp
+++ source/API/SBType.cpp
@@ -19,11 +19,9 @@
 #include "lldb/Symbol/TypeSystem.h"
 
 #include "llvm/ADT/APSInt.h"
-#include "clang/AST/Decl.h"
 
 using namespace lldb;
 using namespace lldb_private;
-using namespace clang;
 
 SBType::SBType() :
 m_opaque_sp()
@@ -271,9 +269,9 @@
 {
 if (IsValid())
 {
-CompilerType return_clang_type (m_opaque_sp->GetCompilerType(true).GetFunctionReturnType());
-if (return_clang_type.IsValid())
-return SBType(return_clang_type);
+CompilerType return_type (m_opaque_sp->GetCompilerType(true).GetFunctionReturnType());
+if (return_type.IsValid())
+return SBType(return_type);
 }
 return lldb::SBType();
 }
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D12954: Reduce inclusion of clang headers.

2015-09-17 Thread Bruce Mitchener via lldb-commits
brucem created this revision.
brucem added a reviewer: clayborg.
brucem added a subscriber: lldb-commits.

With the recent changes to separate clang from the core structures
of LLDB, many inclusions of clang headers can be removed.

http://reviews.llvm.org/D12954

Files:
  include/lldb/Core/Value.h
  include/lldb/Core/ValueObjectList.h
  include/lldb/Expression/ASTDumper.h
  include/lldb/Symbol/Function.h
  include/lldb/Symbol/TypeSystem.h
  source/API/SBType.cpp
  source/API/SBTypeEnumMember.cpp
  source/Core/Debugger.cpp
  source/Core/ValueObject.cpp
  source/Expression/FunctionCaller.cpp
  source/Expression/UserExpression.cpp
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
  source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp
  source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp
  source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp
  source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp
  source/Symbol/CompilerType.cpp
  source/Symbol/TypeList.cpp

Index: source/Symbol/TypeList.cpp
===
--- source/Symbol/TypeList.cpp
+++ source/Symbol/TypeList.cpp
@@ -13,18 +13,6 @@
 #include 
 
 // Other libraries and framework includes
-#include "clang/AST/ASTConsumer.h"
-#include "clang/AST/ASTContext.h"
-#include "clang/AST/Decl.h"
-#include "clang/AST/DeclCXX.h"
-#include "clang/AST/DeclGroup.h"
-
-#include "clang/Basic/Builtins.h"
-#include "clang/Basic/IdentifierTable.h"
-#include "clang/Basic/LangOptions.h"
-#include "clang/Basic/SourceManager.h"
-#include "clang/Basic/TargetInfo.h"
-
 #include "llvm/Support/FormattedStream.h"
 #include "llvm/Support/raw_ostream.h"
 
@@ -36,7 +24,6 @@
 
 using namespace lldb;
 using namespace lldb_private;
-using namespace clang;
 
 TypeList::TypeList() :
 m_types ()
Index: source/Symbol/CompilerType.cpp
===
--- source/Symbol/CompilerType.cpp
+++ source/Symbol/CompilerType.cpp
@@ -20,7 +20,6 @@
 #include "lldb/Symbol/ClangASTContext.h"
 #include "lldb/Symbol/ClangExternalASTSourceCommon.h"
 #include "lldb/Symbol/Type.h"
-#include "lldb/Symbol/VerifyDecl.h"
 #include "lldb/Target/ExecutionContext.h"
 #include "lldb/Target/Process.h"
 
Index: source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp
===
--- source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp
+++ source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp
@@ -14,9 +14,6 @@
 // Other libraries and framework includes
 // Project includes
 
-#include "clang/AST/ASTContext.h"
-#include "clang/AST/DeclCXX.h"
-
 #include "lldb/lldb-private.h"
 #include "lldb/Core/ConstString.h"
 #include "lldb/Core/Log.h"
Index: source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp
===
--- source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp
+++ source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp
@@ -13,9 +13,6 @@
 // C++ Includes
 // Other libraries and framework includes
 // Project includes
-#include "clang/AST/ASTContext.h"
-#include "clang/AST/DeclCXX.h"
-
 #include "lldb/Core/ConstString.h"
 #include "lldb/Core/Log.h"
 #include "lldb/Core/Module.h"
Index: source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp
===
--- source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp
+++ source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp
@@ -14,9 +14,6 @@
 // Other libraries and framework includes
 // Project includes
 
-#include "clang/AST/ASTContext.h"
-#include "clang/AST/DeclCXX.h"
-
 #include "lldb/Core/ConstString.h"
 #include "lldb/Core/Log.h"
 #include "lldb/Core/Module.h"
Index: source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp
===
--- source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp
+++ source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp
@@ -14,9 +14,6 @@
 // Other libraries and framework includes
 // Project includes
 
-#include "clang/AST/ASTContext.h"
-#include "clang/AST/DeclCXX.h"
-
 #include "lldb/Core/ConstString.h"
 #include "lldb/Core/Log.h"
 #include "lldb/Core/Module.h"
Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
===
--- source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
+++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
@@ -14,8 +14,6 @@
 #include 
 #include 
 
-#include "clang/AST/CharUnits.h"
-
 #include "lldb/Core/RangeMap.h"
 #include "lldb/Symbol/SymbolFile.h"
 
Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
==

Re: [Lldb-commits] [PATCH] D12953: Remove some clang references from API.

2015-09-17 Thread Bruce Mitchener via lldb-commits
brucem abandoned this revision.
brucem added a comment.

Abandoning this one as I'd rather do a lot more of the clang inclusion 
reduction separately.


http://reviews.llvm.org/D12953



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


Re: [Lldb-commits] [PATCH] D12079: [MIPS] microMIPS breakpoints, disassembly and compressed addresses

2015-09-17 Thread Jaydeep Patil via lldb-commits
jaydeep updated this revision to Diff 35059.
jaydeep added a comment.

Addressed review comments.


Repository:
  rL LLVM

http://reviews.llvm.org/D12079

Files:
  source/Core/Address.cpp
  source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
  source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  source/Target/RegisterContext.cpp
  source/Target/Target.cpp

Index: source/Target/Target.cpp
===
--- source/Target/Target.cpp
+++ source/Target/Target.cpp
@@ -2092,6 +2092,27 @@
 addr_t code_addr = load_addr;
 switch (m_arch.GetMachine())
 {
+case llvm::Triple::mips:
+case llvm::Triple::mipsel:
+case llvm::Triple::mips64:
+case llvm::Triple::mips64el:
+switch (addr_class)
+{
+case eAddressClassData:
+case eAddressClassDebug:
+return LLDB_INVALID_ADDRESS;
+
+case eAddressClassUnknown:
+case eAddressClassInvalid:
+case eAddressClassCode:
+case eAddressClassCodeAlternateISA:
+case eAddressClassRuntime:
+if ((code_addr & 2ull) || (addr_class == eAddressClassCodeAlternateISA))
+code_addr |= 1ull;
+break;
+}
+break;
+
 case llvm::Triple::arm:
 case llvm::Triple::thumb:
 switch (addr_class)
@@ -2137,6 +2158,10 @@
 addr_t opcode_addr = load_addr;
 switch (m_arch.GetMachine())
 {
+case llvm::Triple::mips:
+case llvm::Triple::mipsel:
+case llvm::Triple::mips64:
+case llvm::Triple::mips64el:
 case llvm::Triple::arm:
 case llvm::Triple::thumb:
 switch (addr_class)
Index: source/Target/RegisterContext.cpp
===
--- source/Target/RegisterContext.cpp
+++ source/Target/RegisterContext.cpp
@@ -20,6 +20,7 @@
 #include "lldb/Target/StackFrame.h"
 #include "lldb/Target/Process.h"
 #include "lldb/Target/Thread.h"
+#include "lldb/Target/Target.h"
 
 using namespace lldb;
 using namespace lldb_private;
@@ -103,7 +104,20 @@
 RegisterContext::GetPC(uint64_t fail_value)
 {
 uint32_t reg = ConvertRegisterKindToRegisterNumber (eRegisterKindGeneric, LLDB_REGNUM_GENERIC_PC);
-return ReadRegisterAsUnsigned (reg, fail_value);
+uint64_t pc = ReadRegisterAsUnsigned (reg, fail_value);
+
+if (pc != fail_value)
+{
+TargetSP target_sp = m_thread.CalculateTarget();
+if (target_sp)
+{
+Target *target = target_sp.get();
+if (target)
+pc = target->GetOpcodeLoadAddress (pc, eAddressClassCode);
+}
+}
+
+return pc;
 }
 
 bool
Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===
--- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -1128,6 +1128,7 @@
 {
 LineTable* line_table;
 std::unique_ptr sequence_ap;
+lldb::addr_t addr_mask;
 };
 
 //--
@@ -1157,7 +1158,7 @@
 assert(info->sequence_ap.get());
 }
 line_table->AppendLineEntryToSequence (info->sequence_ap.get(),
-   state.address,
+   state.address & info->addr_mask,
state.line,
state.column,
state.file,
@@ -1197,6 +1198,28 @@
 {
 ParseDWARFLineTableCallbackInfo info;
 info.line_table = line_table_ap.get();
+
+/*
+ * MIPS:
+ * The SymbolContext may not have a valid target, thus we may not be able
+ * to call Address::GetOpcodeLoadAddress() which would clear the bit #0
+ * for MIPS. Use ArchSpec to clear the bit #0.
+*/
+ArchSpec arch;
+GetObjectFile()->GetArchitecture(arch);
+switch (arch.GetMachine())
+{
+case llvm::Triple::mips:
+case llvm::Triple::mipsel:
+case llvm::Triple::mips64:
+case llvm::Triple::mips64el:
+info.addr_mask = ~((lldb::addr_t)1);
+break;
+default:
+info.addr_mask = ~((lldb::addr_t)0);
+break;
+}
+
 lldb::offset_t offset = cu_line_offset;
 DWARFDebugLine::ParseStatementTable(get_debug_line_data(), &offset, ParseDWARFLineTableCallback, &info);
 if (m_debug_map_symfile)
Index: source/Plugins/ObjectFile

[Lldb-commits] [lldb] r247968 - [LLDB][MIPS] Debug bare-iron targets lacking support for qC /qfThreadInfo

2015-09-17 Thread Jaydeep Patil via lldb-commits
Author: jaydeep
Date: Fri Sep 18 00:32:54 2015
New Revision: 247968

URL: http://llvm.org/viewvc/llvm-project?rev=247968&view=rev
Log:
[LLDB][MIPS] Debug bare-iron targets lacking support for qC /qfThreadInfo
SUMMARY:
Using response.IsUnsupportedResponse instead of 
!response.IsNormalResponse().

Reviewers: clayborg, labath
Subscribers: nitesh.jain, mohit.bhakkad, sagar, bhushan and lldb-commits
Differential Revision: http://reviews.llvm.org/D12876

Modified:

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

Modified: 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp?rev=247968&r1=247967&r2=247968&view=diff
==
--- 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp 
(original)
+++ 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp 
Fri Sep 18 00:32:54 2015
@@ -3400,6 +3400,17 @@ GDBRemoteCommunicationClient::SetCurrent
 m_curr_tid = tid;
 return true;
 }
+
+/*
+ * Connected bare-iron target (like YAMON gdb-stub) may not have 
support for Hg packet.
+ * The reply from '?' packet could be as simple as 'S05'. There is no 
packet which can
+ * give us pid and/or tid. Assume pid=tid=1 in such cases.
+*/
+if (response.IsUnsupportedResponse() && IsConnected())
+{
+m_curr_tid = 1;
+return true;
+}
 }
 return false;
 }
@@ -3426,6 +3437,17 @@ GDBRemoteCommunicationClient::SetCurrent
 m_curr_tid_run = tid;
 return true;
 }
+
+/*
+ * Connected bare-iron target (like YAMON gdb-stub) may not have 
support for Hc packet.
+ * The reply from '?' packet could be as simple as 'S05'. There is no 
packet which can
+ * give us pid and/or tid. Assume pid=tid=1 in such cases.
+*/
+if (response.IsUnsupportedResponse() && IsConnected())
+{
+m_curr_tid_run = 1;
+return true;
+}
 }
 return false;
 }
@@ -3551,6 +3573,17 @@ GDBRemoteCommunicationClient::GetCurrent
 } while (ch == ',');// Make sure we got a comma 
separator
 }
 }
+
+/*
+ * Connected bare-iron target (like YAMON gdb-stub) may not have 
support for
+ * qProcessInfo, qC and qfThreadInfo packets. The reply from '?' 
packet could
+ * be as simple as 'S05'. There is no packet which can give us pid 
and/or tid.
+ * Assume pid=tid=1 in such cases.
+*/
+if (response.IsUnsupportedResponse() && thread_ids.size() == 0 && 
IsConnected())
+{
+thread_ids.push_back (1);
+}
 }
 else
 {


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


Re: [Lldb-commits] [PATCH] D12876: [MIPS] Debug bare-iron targets lacking support for qC /qfThreadInfo

2015-09-17 Thread Jaydeep Patil via lldb-commits
jaydeep added a comment.

Changed "!response.IsNormalResponse()" to "response.IsUnsupportedResponse()" by 
commit http://reviews.llvm.org/rL247968


Repository:
  rL LLVM

http://reviews.llvm.org/D12876



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