[Lldb-commits] [PATCH] D14542: [lldb] Fix name lookup in ClangASTContext

2015-11-10 Thread Eugene Leviant via lldb-commits
evgeny777 created this revision.
evgeny777 added a reviewer: clayborg.
evgeny777 added subscribers: lldb-commits, KLapshin.

The check for already searched namespaces has disappeared from 
DeclContextFindDeclByName() recently. This breaks variable evaluation in many 
cases, for example in this one   

```
namespace ns1 {
int var = 100;
}

namespace ns2 {
int var = 101;
}

int main(void) {
{
using namespace ns1;
printf("var=%d\n", var); // evaluation fails - multiple candidates
}

{
using namespace ns2;
printf("var=%d\n", var); // evaluation fails - multiple candidates
}
}
```

http://reviews.llvm.org/D14542

Files:
  source/Symbol/ClangASTContext.cpp

Index: source/Symbol/ClangASTContext.cpp
===
--- source/Symbol/ClangASTContext.cpp
+++ source/Symbol/ClangASTContext.cpp
@@ -9097,6 +9097,8 @@
 
 for (auto it = search_queue.find(decl_context); it != 
search_queue.end(); it++)
 {
+if (searched.find(it->second) != searched.end())
+continue;
 searched.insert(it->second);
 symbol_file->ParseDeclsForContext(CompilerDeclContext(this, 
it->second));
 


Index: source/Symbol/ClangASTContext.cpp
===
--- source/Symbol/ClangASTContext.cpp
+++ source/Symbol/ClangASTContext.cpp
@@ -9097,6 +9097,8 @@
 
 for (auto it = search_queue.find(decl_context); it != search_queue.end(); it++)
 {
+if (searched.find(it->second) != searched.end())
+continue;
 searched.insert(it->second);
 symbol_file->ParseDeclsForContext(CompilerDeclContext(this, it->second));
 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D14542: [lldb] Fix name lookup in ClangASTContext

2015-11-10 Thread Tamas Berghammer via lldb-commits
tberghammer added a subscriber: tberghammer.
tberghammer requested changes to this revision.
tberghammer added a reviewer: tberghammer.
tberghammer added a comment.
This revision now requires changes to proceed.

Please create a test case for this scenario so it won't break again


http://reviews.llvm.org/D14542



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


Re: [Lldb-commits] [PATCH] D14531: Add more autotools/gmake NetBSD glue

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

If you want to autotools build support fro FenBSD then please go for it, but 
wanted to mention that it will most likely go away within a few month so you 
won't invest too much time into it.


Repository:
  rL LLVM

http://reviews.llvm.org/D14531



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


[Lldb-commits] [lldb] r252637 - This test is now passing on Darwin

2015-11-10 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Tue Nov 10 13:07:42 2015
New Revision: 252637

URL: http://llvm.org/viewvc/llvm-project?rev=252637=rev
Log:
This test is now passing on Darwin


Modified:

lldb/trunk/packages/Python/lldbsuite/test/lang/c/const_variables/TestConstVariables.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/lang/c/const_variables/TestConstVariables.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/c/const_variables/TestConstVariables.py?rev=252637=252636=252637=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/lang/c/const_variables/TestConstVariables.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/lang/c/const_variables/TestConstVariables.py
 Tue Nov 10 13:07:42 2015
@@ -25,7 +25,6 @@ class ConstVariableTestCase(TestBase):
 @expectedFailureAll(oslist=["freebsd", "linux"], compiler="icc")
 @expectedFailureWindows("llvm.org/pr24489: Name lookup not working 
correctly on Windows")
 @expectedFailureWindows("llvm.org/pr24490: We shouldn't be using 
platform-specific names like `getpid` in tests")
-@expectedFailureDarwin
 def test_and_run_command(self):
 """Test interpreted and JITted expressions on constant values."""
 self.build()


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


[Lldb-commits] [lldb] r252622 - Fixed TypeMemberFunctionImpl to not use clang types directly but use the new CompilerDecl class to do the job in an abstract way.

2015-11-10 Thread Greg Clayton via lldb-commits
Author: gclayton
Date: Tue Nov 10 11:47:04 2015
New Revision: 252622

URL: http://llvm.org/viewvc/llvm-project?rev=252622=rev
Log:
Fixed TypeMemberFunctionImpl to not use clang types directly but use the new 
CompilerDecl class to do the job in an abstract way.
Fixed a crash that would happen if you tried to get the name of a constructor 
or destructor by calling "getDeclName()" instead of calling getName() (which 
would assert and crash).

Added the ability to get function arguments names from SBFunction.


Modified:
lldb/trunk/include/lldb/API/SBFunction.h
lldb/trunk/include/lldb/API/SBType.h
lldb/trunk/include/lldb/Symbol/ClangASTContext.h
lldb/trunk/include/lldb/Symbol/CompilerDecl.h
lldb/trunk/include/lldb/Symbol/Type.h
lldb/trunk/include/lldb/Symbol/TypeSystem.h
lldb/trunk/scripts/Python/python-extensions.swig
lldb/trunk/scripts/interface/SBFunction.i
lldb/trunk/scripts/interface/SBType.i
lldb/trunk/source/API/SBFunction.cpp
lldb/trunk/source/API/SBType.cpp
lldb/trunk/source/Symbol/ClangASTContext.cpp
lldb/trunk/source/Symbol/CompilerDecl.cpp
lldb/trunk/source/Symbol/Type.cpp
lldb/trunk/source/Symbol/TypeSystem.cpp

Modified: lldb/trunk/include/lldb/API/SBFunction.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBFunction.h?rev=252622=252621=252622=diff
==
--- lldb/trunk/include/lldb/API/SBFunction.h (original)
+++ lldb/trunk/include/lldb/API/SBFunction.h Tue Nov 10 11:47:04 2015
@@ -53,6 +53,9 @@ public:
 lldb::SBAddress
 GetEndAddress ();
 
+const char *
+GetArgumentName (uint32_t arg_idx);
+
 uint32_t
 GetPrologueByteSize ();
 

Modified: lldb/trunk/include/lldb/API/SBType.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBType.h?rev=252622=252621=252622=diff
==
--- lldb/trunk/include/lldb/API/SBType.h (original)
+++ lldb/trunk/include/lldb/API/SBType.h Tue Nov 10 11:47:04 2015
@@ -85,7 +85,13 @@ public:
 
 const char *
 GetName ();
-
+
+const char *
+GetDemangledName ();
+
+const char *
+GetMangledName ();
+
 lldb::SBType
 GetType ();
 

Modified: lldb/trunk/include/lldb/Symbol/ClangASTContext.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTContext.h?rev=252622=252621=252622=diff
==
--- lldb/trunk/include/lldb/Symbol/ClangASTContext.h (original)
+++ lldb/trunk/include/lldb/Symbol/ClangASTContext.h Tue Nov 10 11:47:04 2015
@@ -117,6 +117,9 @@ public:
 clang::DiagnosticConsumer *
 getDiagnosticConsumer();
 
+clang::MangleContext *
+getMangleContext();
+
 std::shared_ptr ();
 
 clang::TargetInfo *
@@ -533,6 +536,21 @@ public:
 ConstString
 DeclGetName (void *opaque_decl) override;
 
+ConstString
+DeclGetMangledName (void *opaque_decl) override;
+
+CompilerDeclContext
+DeclGetDeclContext (void *opaque_decl) override;
+
+CompilerType
+DeclGetFunctionReturnType(void *opaque_decl) override;
+
+size_t
+DeclGetFunctionNumArguments(void *opaque_decl) override;
+
+CompilerType
+DeclGetFunctionArgumentType (void *opaque_decl, size_t arg_idx) override;
+
 //--
 // CompilerDeclContext override functions
 //--
@@ -1161,6 +1179,7 @@ protected:
 std::unique_ptrm_builtins_ap;
 std::unique_ptr m_dwarf_ast_parser_ap;
 std::unique_ptr m_scratch_ast_source_ap;
+std::unique_ptr   m_mangle_ctx_ap;
 CompleteTagDeclCallback m_callback_tag_decl;
 CompleteObjCInterfaceDeclCallback   m_callback_objc_decl;
 void *  m_callback_baton;

Modified: lldb/trunk/include/lldb/Symbol/CompilerDecl.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/CompilerDecl.h?rev=252622=252621=252622=diff
==
--- lldb/trunk/include/lldb/Symbol/CompilerDecl.h (original)
+++ lldb/trunk/include/lldb/Symbol/CompilerDecl.h Tue Nov 10 11:47:04 2015
@@ -12,6 +12,7 @@
 
 #include "lldb/lldb-private.h"
 #include "lldb/Core/ConstString.h"
+#include "lldb/Symbol/CompilerType.h"
 
 namespace lldb_private {
 
@@ -102,6 +103,24 @@ public:
 ConstString
 GetName () const;
 
+ConstString
+GetMangledName () const;
+
+CompilerDeclContext
+GetDeclContext() const;
+
+// If this decl represents a function, return the return type
+CompilerType
+GetFunctionReturnType() const;
+
+// If this decl represents a function, return the number of 

Re: [Lldb-commits] [PATCH] D13819: LLDBStandalone: Report nice errors on missing vars

2015-11-10 Thread Ramkumar Ramachandra via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL252624: LLDBStandalone: Report nice errors on missing vars 
(authored by artagnon).

Changed prior to commit:
  http://reviews.llvm.org/D13819?vs=37616=39822#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D13819

Files:
  lldb/trunk/cmake/modules/LLDBStandalone.cmake

Index: lldb/trunk/cmake/modules/LLDBStandalone.cmake
===
--- lldb/trunk/cmake/modules/LLDBStandalone.cmake
+++ lldb/trunk/cmake/modules/LLDBStandalone.cmake
@@ -23,22 +23,35 @@
 else()
   get_filename_component(LLVM_MAIN_SRC_DIR ${LLDB_PATH_TO_LLVM_SOURCE}
  ABSOLUTE)
+  set(LLVM_MAIN_INCLUDE_DIR "${LLVM_MAIN_SRC_DIR}/include")
   list(APPEND CMAKE_MODULE_PATH "${LLVM_MAIN_SRC_DIR}/cmake/modules")
 endif()
   endif()
 
   if (LLDB_PATH_TO_CLANG_SOURCE)
   get_filename_component(CLANG_MAIN_SRC_DIR ${LLDB_PATH_TO_CLANG_SOURCE}
  ABSOLUTE)
+  set(CLANG_MAIN_INCLUDE_DIR "${CLANG_MAIN_SRC_DIR}/include")
   endif()
 
   list(APPEND CMAKE_MODULE_PATH "${LLDB_PATH_TO_LLVM_BUILD}/share/llvm/cmake")
 
-  get_filename_component(PATH_TO_LLVM_BUILD ${LLDB_PATH_TO_LLVM_BUILD}
- ABSOLUTE)
+  if (LLDB_PATH_TO_LLVM_BUILD)
+get_filename_component(PATH_TO_LLVM_BUILD ${LLDB_PATH_TO_LLVM_BUILD}
+   ABSOLUTE)
+  else()
+message(FATAL_ERROR "Please set LLDB_PATH_TO_LLVM_BUILD to the root "
+"directory of LLVM build or install site.")
+  endif()
+
+  if (LLDB_PATH_TO_CLANG_BUILD)
+get_filename_component(PATH_TO_CLANG_BUILD ${LLDB_PATH_TO_CLANG_BUILD}
+   ABSOLUTE)
+  else()
+message(FATAL_ERROR "Please set LLDB_PATH_TO_CLANG_BUILD to the root "
+"directory of Clang build or install site.")
+  endif()
 
-  get_filename_component(PATH_TO_CLANG_BUILD ${LLDB_PATH_TO_CLANG_BUILD}
- ABSOLUTE)
 
   # These variables are used by add_llvm_library.
   set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin)
@@ -67,11 +80,8 @@
 
   set(PACKAGE_VERSION "${LLVM_PACKAGE_VERSION}")
 
-  set(LLVM_MAIN_INCLUDE_DIR "${LLVM_MAIN_SRC_DIR}/include")
   set(LLVM_BINARY_DIR ${CMAKE_BINARY_DIR})
 
-  set(CLANG_MAIN_INCLUDE_DIR "${CLANG_MAIN_SRC_DIR}/include")
-
   set(CMAKE_INCLUDE_CURRENT_DIR ON)
   include_directories("${PATH_TO_LLVM_BUILD}/include"
   "${LLVM_MAIN_INCLUDE_DIR}"


Index: lldb/trunk/cmake/modules/LLDBStandalone.cmake
===
--- lldb/trunk/cmake/modules/LLDBStandalone.cmake
+++ lldb/trunk/cmake/modules/LLDBStandalone.cmake
@@ -23,22 +23,35 @@
 else()
   get_filename_component(LLVM_MAIN_SRC_DIR ${LLDB_PATH_TO_LLVM_SOURCE}
  ABSOLUTE)
+  set(LLVM_MAIN_INCLUDE_DIR "${LLVM_MAIN_SRC_DIR}/include")
   list(APPEND CMAKE_MODULE_PATH "${LLVM_MAIN_SRC_DIR}/cmake/modules")
 endif()
   endif()
 
   if (LLDB_PATH_TO_CLANG_SOURCE)
   get_filename_component(CLANG_MAIN_SRC_DIR ${LLDB_PATH_TO_CLANG_SOURCE}
  ABSOLUTE)
+  set(CLANG_MAIN_INCLUDE_DIR "${CLANG_MAIN_SRC_DIR}/include")
   endif()
 
   list(APPEND CMAKE_MODULE_PATH "${LLDB_PATH_TO_LLVM_BUILD}/share/llvm/cmake")
 
-  get_filename_component(PATH_TO_LLVM_BUILD ${LLDB_PATH_TO_LLVM_BUILD}
- ABSOLUTE)
+  if (LLDB_PATH_TO_LLVM_BUILD)
+get_filename_component(PATH_TO_LLVM_BUILD ${LLDB_PATH_TO_LLVM_BUILD}
+   ABSOLUTE)
+  else()
+message(FATAL_ERROR "Please set LLDB_PATH_TO_LLVM_BUILD to the root "
+"directory of LLVM build or install site.")
+  endif()
+
+  if (LLDB_PATH_TO_CLANG_BUILD)
+get_filename_component(PATH_TO_CLANG_BUILD ${LLDB_PATH_TO_CLANG_BUILD}
+   ABSOLUTE)
+  else()
+message(FATAL_ERROR "Please set LLDB_PATH_TO_CLANG_BUILD to the root "
+"directory of Clang build or install site.")
+  endif()
 
-  get_filename_component(PATH_TO_CLANG_BUILD ${LLDB_PATH_TO_CLANG_BUILD}
- ABSOLUTE)
 
   # These variables are used by add_llvm_library.
   set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin)
@@ -67,11 +80,8 @@
 
   set(PACKAGE_VERSION "${LLVM_PACKAGE_VERSION}")
 
-  set(LLVM_MAIN_INCLUDE_DIR "${LLVM_MAIN_SRC_DIR}/include")
   set(LLVM_BINARY_DIR ${CMAKE_BINARY_DIR})
 
-  set(CLANG_MAIN_INCLUDE_DIR "${CLANG_MAIN_SRC_DIR}/include")
-
   set(CMAKE_INCLUDE_CURRENT_DIR ON)
   include_directories("${PATH_TO_LLVM_BUILD}/include"
   "${LLVM_MAIN_INCLUDE_DIR}"
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r252638 - Upstream changes to the ValueObjectPrinter; nfc

2015-11-10 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Tue Nov 10 13:07:58 2015
New Revision: 252638

URL: http://llvm.org/viewvc/llvm-project?rev=252638=rev
Log:
Upstream changes to the ValueObjectPrinter; nfc

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

Modified: lldb/trunk/include/lldb/DataFormatters/DumpValueObjectOptions.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/DumpValueObjectOptions.h?rev=252638=252637=252638=diff
==
--- lldb/trunk/include/lldb/DataFormatters/DumpValueObjectOptions.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/DumpValueObjectOptions.h Tue Nov 10 
13:07:58 2015
@@ -24,157 +24,162 @@
 
 namespace lldb_private {
 
-class DumpValueObjectOptions
-{
-public:
-struct PointerDepth
+class DumpValueObjectOptions
 {
-enum class Mode
+public:
+struct PointerDepth
 {
-Always,
-Formatters,
-Default,
-Never
-} m_mode;
-uint32_t m_count;
+enum class Mode
+{
+Always,
+Formatters,
+Default,
+Never
+} m_mode;
+uint32_t m_count;
+
+PointerDepth
+operator --() const
+{
+if (m_count > 0)
+return PointerDepth {m_mode,m_count-1};
+return PointerDepth {m_mode,m_count};
+}
+
+bool
+CanAllowExpansion () const;
+
+bool
+CanAllowExpansion (bool is_root,
+   TypeSummaryImpl* entry,
+   ValueObject *valobj,
+   const std::string& summary);
+};
 
-PointerDepth
-operator --() const
+typedef std::function DeclPrintingHelper;
+
+static const DumpValueObjectOptions
+DefaultOptions()
 {
-if (m_count > 0)
-return PointerDepth {m_mode,m_count-1};
-return PointerDepth {m_mode,m_count};
+static DumpValueObjectOptions g_default_options;
+
+return g_default_options;
 }
 
-bool
-CanAllowExpansion () const;
+DumpValueObjectOptions();
 
-bool
-CanAllowExpansion (bool is_root,
-   TypeSummaryImpl* entry,
-   ValueObject *valobj,
-   const std::string& summary);
-};
-
-typedef std::function DeclPrintingHelper;
-
-static const DumpValueObjectOptions
-DefaultOptions()
-{
-static DumpValueObjectOptions g_default_options;
+DumpValueObjectOptions (const DumpValueObjectOptions& rhs) = default;
 
-return g_default_options;
-}
-
-DumpValueObjectOptions();
-
-DumpValueObjectOptions (const DumpValueObjectOptions& rhs) = default;
-
-DumpValueObjectOptions (ValueObject& valobj);
-
-DumpValueObjectOptions&
-SetMaximumPointerDepth(PointerDepth depth = {PointerDepth::Mode::Never,0});
-
-DumpValueObjectOptions&
-SetMaximumDepth(uint32_t depth = 0);
-
-DumpValueObjectOptions&
-SetDeclPrintingHelper(DeclPrintingHelper helper);
-
-DumpValueObjectOptions&
-SetShowTypes(bool show = false);
-
-DumpValueObjectOptions&
-SetShowLocation(bool show = false);
-
-DumpValueObjectOptions&
-SetUseObjectiveC(bool use = false);
-
-DumpValueObjectOptions&
-SetShowSummary(bool show = true);
-
-DumpValueObjectOptions&
-SetUseDynamicType(lldb::DynamicValueType dyn = lldb::eNoDynamicValues);
-
-DumpValueObjectOptions&
-SetUseSyntheticValue(bool use_synthetic = true);
-
-DumpValueObjectOptions&
-SetScopeChecked(bool check = true);
-
-DumpValueObjectOptions&
-SetFlatOutput(bool flat = false);
-
-DumpValueObjectOptions&
-SetOmitSummaryDepth(uint32_t depth = 0);
-
-DumpValueObjectOptions&
-SetIgnoreCap(bool ignore = false);
-
-DumpValueObjectOptions&
-SetRawDisplay();
-
-DumpValueObjectOptions&
-SetFormat (lldb::Format format = lldb::eFormatDefault);
-
-DumpValueObjectOptions&
-

Re: [Lldb-commits] [PATCH] D14524: Create a `PythonModule` class and add a root-level method for name lookup

2015-11-10 Thread Todd Fiala via lldb-commits
tfiala added a subscriber: tfiala.
tfiala added a comment.

(Which I guess means Greg, seeing Enrico's comment earlier!)


http://reviews.llvm.org/D14524



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


Re: [Lldb-commits] [lldb] r252583 - The other half of a change made by Enrico for trying to get a correct

2015-11-10 Thread Todd Fiala via lldb-commits
Yeah, we can get some gtests in for this.  I'll tail back on it.  It'll be
a bit before I can put cycles on it but it's on my list.

On Mon, Nov 9, 2015 at 9:46 PM, Zachary Turner  wrote:

> This is really the kind of thing that would be good to write a unit test
> for.  There's a lot of institutional knowledge hidden away in these kinds
> of deep low level stuff, and a unit test is good documentation for it.
>
> I suspect this is almost guaranteed to break at some point in the future
> without an explicit test (especially since it's not immediately obvious why
> a Target should behave that way)
>
>
> It should be really easy to write one for this.  You'd need to make a
> TargetUnitTests target, create an empty target, set the triple to one
> thing, set it to another thing, and ensure it retains the original value.
>  +todd in case you're interested in trying, he can probably help
>
>
> On Mon, Nov 9, 2015 at 8:14 PM Jason Molenda via lldb-commits <
> lldb-commits@lists.llvm.org> wrote:
>
>> Author: jmolenda
>> Date: Mon Nov  9 22:11:37 2015
>> New Revision: 252583
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=252583=rev
>> Log:
>> The other half of a change made by Enrico for trying to get a correct
>> triple for a process.  He writes, "Changes to the way setting the
>> triple works on a target so that if the target has passed a fully
>> specified triple, and the newly passed triple is not a revamp of
>> the current one, and the current one is fully specified, then do
>> not replace the existing triple."
>>
>> Triple handling got a bit more complicated on mac with the addition
>> of ios/watchos/tvos and their simulators, and tracking the correct
>> os versions for them so expressions are compiled with the expected
>> APIs available to the user.
>>
>> 
>>
>> Modified:
>> lldb/trunk/source/Target/Target.cpp
>>
>> Modified: lldb/trunk/source/Target/Target.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Target.cpp?rev=252583=252582=252583=diff
>>
>> ==
>> --- lldb/trunk/source/Target/Target.cpp (original)
>> +++ lldb/trunk/source/Target/Target.cpp Mon Nov  9 22:11:37 2015
>> @@ -1243,44 +1243,70 @@ bool
>>  Target::SetArchitecture (const ArchSpec _spec)
>>  {
>>  Log *log(lldb_private::GetLogIfAllCategoriesSet
>> (LIBLLDB_LOG_TARGET));
>> -if (m_arch.IsCompatibleMatch(arch_spec) || !m_arch.IsValid())
>> +bool missing_local_arch = (false == m_arch.IsValid());
>> +bool replace_local_arch = true;
>> +bool compatible_local_arch = false;
>> +ArchSpec other(arch_spec);
>> +
>> +if (!missing_local_arch)
>> +{
>> +if (m_arch.IsCompatibleMatch(arch_spec))
>> +{
>> +other.MergeFrom(m_arch);
>> +
>> +if (m_arch.IsCompatibleMatch(other))
>> +{
>> +compatible_local_arch = true;
>> +bool arch_changed, vendor_changed, os_changed,
>> os_ver_changed, env_changed;
>> +
>> +m_arch.PiecewiseTripleCompare(other,
>> +  arch_changed,
>> +  vendor_changed,
>> +  os_changed,
>> +  os_ver_changed,
>> +  env_changed);
>> +
>> +if (!arch_changed && !vendor_changed && !os_changed)
>> +replace_local_arch = false;
>> +}
>> +}
>> +}
>> +
>> +if (compatible_local_arch || missing_local_arch)
>>  {
>> -// If we haven't got a valid arch spec, or the architectures are
>> -// compatible, so just update the architecture. Architectures
>> can be
>> -// equal, yet the triple OS and vendor might change, so we need
>> to do
>> -// the assignment here just in case.
>> -m_arch = arch_spec;
>> +// If we haven't got a valid arch spec, or the architectures are
>> compatible
>> +// update the architecture, unless the one we already have is
>> more specified
>> +if (replace_local_arch)
>> +m_arch = other;
>>  if (log)
>> -log->Printf ("Target::SetArchitecture setting architecture
>> to %s (%s)", arch_spec.GetArchitectureName(),
>> arch_spec.GetTriple().getTriple().c_str());
>> +log->Printf ("Target::SetArchitecture set architecture to %s
>> (%s)", m_arch.GetArchitectureName(),
>> m_arch.GetTriple().getTriple().c_str());
>>  return true;
>>  }
>> -else
>> +
>> +// If we have an executable file, try to reset the executable to the
>> desired architecture
>> +if (log)
>> +  log->Printf ("Target::SetArchitecture changing architecture to %s
>> (%s)", arch_spec.GetArchitectureName(),
>> arch_spec.GetTriple().getTriple().c_str());
>> +m_arch = other;
>> +ModuleSP executable_sp = 

[Lldb-commits] [lldb] r252655 - Fixed a bug where the size of a type was used instead of the size of a pointer.

2015-11-10 Thread Sean Callanan via lldb-commits
Author: spyffe
Date: Tue Nov 10 15:48:05 2015
New Revision: 252655

URL: http://llvm.org/viewvc/llvm-project?rev=252655=rev
Log:
Fixed a bug where the size of a type was used instead of the size of a pointer.

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=252655=252654=252655=diff
==
--- lldb/trunk/source/Expression/Materializer.cpp (original)
+++ lldb/trunk/source/Expression/Materializer.cpp Tue Nov 10 15:48:05 2015
@@ -112,7 +112,7 @@ public:
   
m_persistent_variable_sp->GetName(),
   
mem,
   
eAddressTypeLoad,
-  
m_persistent_variable_sp->GetByteSize());
+  
map.GetAddressByteSize());
 
 // Clear the flag if the variable will never be deallocated.
 


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


[Lldb-commits] [PATCH] D14549: Use uniqueness of C++ fully-qualified names to resolve conflicts

2015-11-10 Thread Ramkumar Ramachandra via lldb-commits
artagnon created this revision.
artagnon added reviewers: clayborg, tfiala.
artagnon added a subscriber: lldb-commits.

A very expected layout: source tree is in ~/src/llvm, the build directory is in
~/src/llvm-build, and the install location is in /usr/local/{lib,include}.

The DWARF information in /usr/local/lib/libLLVM.a for ilist.h points to
~/src/llvm-build/include/llvm/ADT/ilist.h. Now, when someone includes
"llvm/ADT/ilist.h" and links against /usr/local/lib/libLLVM.a. Disaster.

The DWARF information in libUser.so for ilist.h points to two locations: the one
in /usr/include, and the one in ~/src/llvm-build/include. LLDB gets confused.

Let's uniquify fully-qualified names and never trip on such a thing.

Patch-by: Greg Clayton

http://reviews.llvm.org/D14549

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
@@ -457,24 +457,44 @@
 // and clang isn't good and sharing the stack space for variables in different blocks.
 std::unique_ptr unique_ast_entry_ap(new UniqueDWARFASTType());
 
-// Only try and unique the type if it has a name.
-if (type_name_const_str &&
-dwarf->GetUniqueDWARFASTTypeMap().Find (type_name_const_str,
-die,
-decl,
-byte_size_valid ? byte_size : -1,
-*unique_ast_entry_ap))
+if (type_name_const_str)
 {
-// We have already parsed this type or from another
-// compile unit. GCC loves to use the "one definition
-// rule" which can result in multiple definitions
-// of the same class over and over in each compile
-// unit.
-type_sp = unique_ast_entry_ap->m_type_sp;
-if (type_sp)
+LanguageType die_language = die.GetLanguage();
+bool handled = false;
+if (Language::LanguageIsCPlusPlus(die_language))
 {
+std::string qualified_name;
+if (die.GetQualifiedName(qualified_name))
+{
+handled = true;
+ConstString const_qualified_name(qualified_name);
+if (dwarf->GetUniqueDWARFASTTypeMap().Find(const_qualified_name, die, Declaration(),
+   byte_size_valid ? byte_size : -1,
+   *unique_ast_entry_ap))
+{
+type_sp = unique_ast_entry_ap->m_type_sp;
+if (type_sp)
+{
+dwarf->GetDIEToType()[die.GetDIE()] = type_sp.get();
+return type_sp;
+}
+}
+}
+}
+
+if (!handled)
+{
+if (dwarf->GetUniqueDWARFASTTypeMap().Find(type_name_const_str, die, decl,
+   byte_size_valid ? byte_size : -1,
+   *unique_ast_entry_ap))
+{
+type_sp = unique_ast_entry_ap->m_type_sp;
+if (type_sp)
+{
 dwarf->GetDIEToType()[die.GetDIE()] = type_sp.get();
 return type_sp;
+}
+}
 }
 }
 
@@ -1251,13 +1271,13 @@
  class_type->GetName().GetCString(),
  die.GetID(),
  dwarf->GetObjectFile()->GetFileSpec().GetPath().c_str());
-
+
 const bool is_attr_used = false;

[Lldb-commits] [lldb] r252642 - Updated lldb_pylint_helper to work with recent Python package changes.

2015-11-10 Thread Todd Fiala via lldb-commits
Author: tfiala
Date: Tue Nov 10 14:01:33 2015
New Revision: 252642

URL: http://llvm.org/viewvc/llvm-project?rev=252642=rev
Log:
Updated lldb_pylint_helper to work with recent Python package changes.

Modified:
lldb/trunk/packages/Python/lldbsuite/test/lldb_pylint_helper.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/lldb_pylint_helper.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldb_pylint_helper.py?rev=252642=252641=252642=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/lldb_pylint_helper.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lldb_pylint_helper.py Tue Nov 10 
14:01:33 2015
@@ -44,9 +44,9 @@ def add_lldb_test_paths(check_dir):
 .pylintrc file in your home directory:
 
 [Master]
-init-hook='import os; import sys; 
sys.path.append(os.path.expanduser("~/path/to/lldb/test")); import 
lldb_pylint_helper; lldb_pylint_helper.add_lldb_test_paths(os.getcwd()); 
print("sys.path={}\n".format(sys.path))'
+init-hook='import os; import sys; 
sys.path.append(os.path.expanduser("~/path/to/lldb/packages/Python/lldbsuite/test"));
 import lldb_pylint_helper; 
lldb_pylint_helper.add_lldb_test_paths(os.getcwd()); 
print("sys.path={}\n".format(sys.path))'
 
-Replace ~/path/to/lldb/test with a valid path to your local lldb source
+Replace ~/path/to/lldb with a valid path to your local lldb source
 tree.  Note you can have multiple lldb source trees on your system, and
 this will work just fine.  The path in your .pylintrc is just needed to
 find the paths needed for pylint in whatever lldb source tree you're in.
@@ -144,21 +144,33 @@ def add_lldb_test_package_paths(check_di
 
 @param check_dir the directory of the test.
 """
+
+def child_dirs(parent_dir):
+return [os.path.join(parent_dir, child)
+for child in os.listdir(parent_dir)
+if os.path.isdir(os.path.join(parent_dir, child))]
+
 check_dir = os.path.realpath(check_dir)
 while check_dir and len(check_dir) > 0:
-# If the current directory is test, it might be the lldb/test
-# directory. If so, we've found an anchor that will allow us
-# to add the relevant lldb-sourcetree-relative python lib
-# dirs.
-if os.path.basename(check_dir) == 'test':
-# If this directory has a dotest.py file in it,
-# then this is an lldb test tree.  Add the
-# test directories to the python path.
-if os.path.exists(os.path.join(check_dir, "dotest.py")):
-sys.path.insert(0, check_dir)
-sys.path.insert(0, os.path.join(
-check_dir, "test_runner", "lib"))
-break
+# If the current directory contains a packages/Python
+# directory, add that directory to the path.
+packages_python_child_dir = os.path.join(
+check_dir, "packages", "Python")
+if os.path.exists(packages_python_child_dir):
+sys.path.insert(0, packages_python_child_dir)
+sys.path.insert(0, os.path.join(
+packages_python_child_dir, "test_runner", "lib"))
+
+# Handle third_party module/package directory.
+third_party_module_dir = os.path.join(
+check_dir, "third_party", "Python", "module")
+for child_dir in child_dirs(third_party_module_dir):
+# Yes, we embed the module in the module parent dir
+sys.path.insert(0, child_dir)
+
+# We're done.
+break
+
 # Continue looking up the parent chain until we have no more
 # directories to check.
 new_check_dir = os.path.dirname(check_dir)


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


Re: [Lldb-commits] [PATCH] D14524: Create a `PythonModule` class and add a root-level method for name lookup

2015-11-10 Thread Todd Fiala via lldb-commits
tfiala resigned from this revision.
tfiala removed a reviewer: tfiala.
tfiala added a comment.

Zachary, I am going to defer to Enrico on this.  He has better context.


http://reviews.llvm.org/D14524



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


[Lldb-commits] [lldb] r252663 - Introduce a way for Languages to specify whether values of "reference types" are "nil" (not pointing to anything) or uninitialized (never made to point at anything)

2015-11-10 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Tue Nov 10 16:39:15 2015
New Revision: 252663

URL: http://llvm.org/viewvc/llvm-project?rev=252663=rev
Log:
Introduce a way for Languages to specify whether values of "reference types" 
are "nil" (not pointing to anything) or uninitialized (never made to point at 
anything)
This latter determination may or may not be possible on a per-language basis; 
and neither is mandatory to implement for any language

Use this knowledge in the ValueObjectPrinter to generalize the notion of 
IsObjCNil() and the respective printout


Modified:
lldb/trunk/include/lldb/Core/ValueObject.h
lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h
lldb/trunk/include/lldb/Target/Language.h
lldb/trunk/source/Core/ValueObject.cpp
lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp
lldb/trunk/source/Plugins/Language/ObjC/ObjCLanguage.cpp
lldb/trunk/source/Plugins/Language/ObjC/ObjCLanguage.h
lldb/trunk/source/Target/Language.cpp

Modified: lldb/trunk/include/lldb/Core/ValueObject.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObject.h?rev=252663=252662=252663=diff
==
--- lldb/trunk/include/lldb/Core/ValueObject.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObject.h Tue Nov 10 16:39:15 2015
@@ -424,8 +424,11 @@ public:
 virtual bool
 IsPossibleDynamicType ();
 
-virtual bool
-IsObjCNil ();
+bool
+IsNilReference ();
+
+bool
+IsUninitializedReference ();
 
 virtual bool
 IsBaseClass ()

Modified: lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h?rev=252663=252662=252663=diff
==
--- lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h Tue Nov 10 
16:39:15 2015
@@ -27,175 +27,179 @@
 //#include 
 
 namespace lldb_private {
+
+class ValueObjectPrinter
+{
+public:
+
+ValueObjectPrinter (ValueObject* valobj,
+Stream* s);
+
+ValueObjectPrinter (ValueObject* valobj,
+Stream* s,
+const DumpValueObjectOptions& options);
+
+~ValueObjectPrinter () {}
+
+bool
+PrintValueObject ();
+
+protected:
+typedef std::set InstancePointersSet;
+typedef std::shared_ptr InstancePointersSetSP;
+
+InstancePointersSetSP m_printed_instance_pointers;
+
+// only this class (and subclasses, if any) should ever be concerned with
+// the depth mechanism
+ValueObjectPrinter (ValueObject* valobj,
+Stream* s,
+const DumpValueObjectOptions& options,
+const DumpValueObjectOptions::PointerDepth& ptr_depth,
+uint32_t curr_depth,
+InstancePointersSetSP printed_instance_pointers);
+
+// we should actually be using delegating constructors here
+// but some versions of GCC still have trouble with those
+void
+Init (ValueObject* valobj,
+  Stream* s,
+  const DumpValueObjectOptions& options,
+  const DumpValueObjectOptions::PointerDepth& ptr_depth,
+  uint32_t curr_depth,
+  InstancePointersSetSP printed_instance_pointers);
+
+bool
+GetMostSpecializedValue ();
+
+const char*
+GetDescriptionForDisplay ();
+
+const char*
+GetRootNameForDisplay (const char* if_fail = nullptr);
+
+bool
+ShouldPrintValueObject ();
+
+bool
+ShouldPrintValidation ();
+
+bool
+IsNil ();
+
+bool
+IsUninitialized ();
+
+bool
+IsPtr ();
+
+bool
+IsRef ();
+
+bool
+IsInstancePointer ();
+
+bool
+IsAggregate ();
+
+bool
+PrintValidationMarkerIfNeeded ();
+
+bool
+PrintValidationErrorIfNeeded ();
+
+bool
+PrintLocationIfNeeded ();
+
+void
+PrintDecl ();
+
+bool
+CheckScopeIfNeeded ();
+
+bool
+ShouldPrintEmptyBrackets (bool value_printed,
+  bool summary_printed);
+
+TypeSummaryImpl*
+GetSummaryFormatter (bool null_if_omitted = true);
+
+void
+GetValueSummaryError (std::string& value,
+  std::string& summary,
+  std::string& error);
+
+bool
+PrintValueAndSummaryIfNeeded (bool& value_printed,
+  bool& summary_printed);
+
+bool
+PrintObjectDescriptionIfNeeded (bool value_printed,
+bool summary_printed);
+
+bool
+ShouldPrintChildren (bool is_failed_description,
+ 

[Lldb-commits] [lldb] r252665 - Made the ClangASTImporter into a shared pointer, eliminating a race condition.

2015-11-10 Thread Sean Callanan via lldb-commits
Author: spyffe
Date: Tue Nov 10 16:54:42 2015
New Revision: 252665

URL: http://llvm.org/viewvc/llvm-project?rev=252665=rev
Log:
Made the ClangASTImporter into a shared pointer, eliminating a race condition.

It used to be a unique pointer, and there could be a case where ClangASTSource
held onto a copy of the pointer but Target::Destroy destroyed the unique pointer
in the mean time.

I also ensured that there is a validity check on the target (which confirms that
a ClangASTImporter can be generated) before the target's shared pointer is
copied into ClangASTSource.

This race condition caused a crash if Target::Destroy was called and then later
the target objecct was deleted.

Modified:
lldb/trunk/include/lldb/Target/Target.h
lldb/trunk/include/lldb/lldb-forward.h
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangASTSource.h
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
lldb/trunk/source/Symbol/ClangASTContext.cpp
lldb/trunk/source/Target/Target.cpp

Modified: lldb/trunk/include/lldb/Target/Target.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Target.h?rev=252665=252664=252665=diff
==
--- lldb/trunk/include/lldb/Target/Target.h (original)
+++ lldb/trunk/include/lldb/Target/Target.h Tue Nov 10 16:54:42 2015
@@ -1287,7 +1287,7 @@ public:
 ClangASTContext *
 GetScratchClangASTContext(bool create_on_demand=true);
 
-ClangASTImporter *
+lldb::ClangASTImporterSP
 GetClangASTImporter();
 
 //--
@@ -1568,7 +1568,7 @@ protected:
 typedef std::map REPLMap;
 REPLMap m_repl_map;
 
-lldb::ClangASTImporterUP m_ast_importer_ap;
+lldb::ClangASTImporterSP m_ast_importer_sp;
 lldb::ClangModulesDeclVendorUP m_clang_modules_decl_vendor_ap;
 
 lldb::SourceManagerUP m_source_manager_ap;

Modified: lldb/trunk/include/lldb/lldb-forward.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-forward.h?rev=252665=252664=252665=diff
==
--- lldb/trunk/include/lldb/lldb-forward.h (original)
+++ lldb/trunk/include/lldb/lldb-forward.h Tue Nov 10 16:54:42 2015
@@ -310,7 +310,7 @@ namespace lldb {
 typedef std::shared_ptr 
BreakpointResolverSP;
 typedef std::shared_ptr BroadcasterSP;
 typedef std::unique_ptr ClangASTContextUP;
-typedef std::unique_ptr ClangASTImporterUP;
+typedef std::shared_ptr ClangASTImporterSP;
 typedef std::unique_ptr 
ClangModulesDeclVendorUP;
 typedef std::unique_ptr 
ClangPersistentVariablesUP;
 typedef std::shared_ptr UserExpressionSP;

Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp?rev=252665=252664=252665=diff
==
--- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp 
(original)
+++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp Tue Nov 
10 16:54:42 2015
@@ -57,7 +57,7 @@ namespace {
 
 ClangASTSource::~ClangASTSource()
 {
-m_ast_importer->ForgetDestination(m_ast_context);
+m_ast_importer_sp->ForgetDestination(m_ast_context);
 
 // We are in the process of destruction, don't create clang ast context on 
demand
 // by passing false to Target::GetScratchClangASTContext(create_on_demand).
@@ -72,7 +72,7 @@ ClangASTSource::~ClangASTSource()
 return;
 
 if (m_ast_context != scratch_ast_context)
-m_ast_importer->ForgetSource(scratch_ast_context, m_ast_context);
+m_ast_importer_sp->ForgetSource(scratch_ast_context, m_ast_context);
 }
 
 void
@@ -221,7 +221,7 @@ ClangASTSource::CompleteType (TagDecl *t
 m_active_lexical_decls.insert(tag_decl);
 ScopedLexicalDeclEraser eraser(m_active_lexical_decls, tag_decl);
 
-if (!m_ast_importer->CompleteTagDecl (tag_decl))
+if (!m_ast_importer_sp->CompleteTagDecl (tag_decl))
 {
 // We couldn't complete the type.  Maybe there's a definition
 // somewhere else that can be completed.
@@ -235,7 +235,7 @@ ClangASTSource::CompleteType (TagDecl *t
 
 if (const NamespaceDecl *namespace_context = 
dyn_cast(decl_ctx))
 {
-ClangASTImporter::NamespaceMapSP namespace_map = 
m_ast_importer->GetNamespaceMap(namespace_context);
+ClangASTImporter::NamespaceMapSP namespace_map = 
m_ast_importer_sp->GetNamespaceMap(namespace_context);
 
 if (log && log->GetVerbose())
 log->Printf("  CTD[%u] Inspecting namespace map %p (%d 
entries)",
@@ -283,7 +283,7 @@ ClangASTSource::CompleteType 

[Lldb-commits] [lldb] r252657 - Updated a relative path in Makefile.rules to reflect the new testsuite location.

2015-11-10 Thread Sean Callanan via lldb-commits
Author: spyffe
Date: Tue Nov 10 15:56:04 2015
New Revision: 252657

URL: http://llvm.org/viewvc/llvm-project?rev=252657=rev
Log:
Updated a relative path in Makefile.rules to reflect the new testsuite location.

Modified:
lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules

Modified: lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules?rev=252657=252656=252657=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules Tue Nov 10 
15:56:04 2015
@@ -28,7 +28,7 @@
 # SHELL = /bin/sh -x
 
 THIS_FILE_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST/
-LLDB_BASE_DIR := $(THIS_FILE_DIR)../../
+LLDB_BASE_DIR := $(THIS_FILE_DIR)../../../../../
 
 
 #--


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


[Lldb-commits] [PATCH] D14555: Create PythonCallable and PythonTuple wrappers with appropriate unit tests

2015-11-10 Thread Zachary Turner via lldb-commits
zturner created this revision.
zturner added reviewers: granata.enrico, clayborg.
zturner added a subscriber: lldb-commits.
zturner added a dependency: D14524: Create a `PythonModule` class and add a 
root-level method for name lookup.

This adds PythonTuple and PythonCallable classes to PythonDataObjects.

Additionally, unit tests are provided that exercise this functionality,
including invoking manipulating and checking for validity of tuples,
and invoking and checking for validity of callables using a variety
of different syntaxes.

The goal here is to eventually replace the code in python-wrapper.swig
that directly uses the Python C API to deal with callables and name
resolution with this code that can be more easily tested and debugged.

Note that this patch depends on D14524 (still pending review from Greg) before 
it can go in.

http://reviews.llvm.org/D14555

Files:
  source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
  source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
  unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp

Index: unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp
===
--- unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp
+++ unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp
@@ -35,16 +35,29 @@
 // Py_INCREF.  So acquire the GIL for the entire duration of this
 // test suite.
 m_gil_state = PyGILState_Ensure();
+
+PythonString sys_module("sys");
+m_sys_module.Reset(PyRefType::Owned, PyImport_Import(sys_module.get()));
+m_main_module = PythonModule::MainModule();
+m_builtins_module = PythonModule::BuiltinsModule();
 }
 
 void
 TearDown() override
 {
+m_sys_module.Reset();
+m_main_module.Reset();
+m_builtins_module.Reset();
 PyGILState_Release(m_gil_state);
 
 ScriptInterpreterPython::Terminate();
 }
 
+  protected:
+PythonModule m_sys_module;
+PythonModule m_main_module;
+PythonModule m_builtins_module;
+
   private:
 PyGILState_STATE m_gil_state;
 };
@@ -98,16 +111,16 @@
 
 TEST_F(PythonDataObjectsTest, TestGlobalNameResolutionNoDot)
 {
-PythonObject sys_module = PythonObject::ResolveNameGlobal("sys");
+PythonObject sys_module = m_main_module.ResolveName("sys");
+EXPECT_EQ(m_sys_module.get(), sys_module.get());
 EXPECT_TRUE(sys_module.IsAllocated());
 EXPECT_TRUE(PythonModule::Check(sys_module.get()));
 }
 
 TEST_F(PythonDataObjectsTest, TestModuleNameResolutionNoDot)
 {
-PythonObject sys_module = PythonObject::ResolveNameGlobal("sys");
-PythonObject sys_path = sys_module.ResolveName("path");
-PythonObject sys_version_info = sys_module.ResolveName("version_info");
+PythonObject sys_path = m_sys_module.ResolveName("path");
+PythonObject sys_version_info = m_sys_module.ResolveName("version_info");
 EXPECT_TRUE(sys_path.IsAllocated());
 EXPECT_TRUE(sys_version_info.IsAllocated());
 
@@ -116,8 +129,7 @@
 
 TEST_F(PythonDataObjectsTest, TestTypeNameResolutionNoDot)
 {
-PythonObject sys_module = PythonObject::ResolveNameGlobal("sys");
-PythonObject sys_version_info = sys_module.ResolveName("version_info");
+PythonObject sys_version_info = m_sys_module.ResolveName("version_info");
 
 PythonObject version_info_type(PyRefType::Owned, PyObject_Type(sys_version_info.get()));
 EXPECT_TRUE(version_info_type.IsAllocated());
@@ -127,8 +139,7 @@
 
 TEST_F(PythonDataObjectsTest, TestInstanceNameResolutionNoDot)
 {
-PythonObject sys_module = PythonObject::ResolveNameGlobal("sys");
-PythonObject sys_version_info = sys_module.ResolveName("version_info");
+PythonObject sys_version_info = m_sys_module.ResolveName("version_info");
 PythonObject major_version_field = sys_version_info.ResolveName("major");
 PythonObject minor_version_field = sys_version_info.ResolveName("minor");
 
@@ -144,12 +155,12 @@
 
 TEST_F(PythonDataObjectsTest, TestGlobalNameResolutionWithDot)
 {
-PythonObject sys_path = PythonObject::ResolveNameGlobal("sys.path");
+PythonObject sys_path = m_main_module.ResolveName("sys.path");
 EXPECT_TRUE(sys_path.IsAllocated());
 EXPECT_TRUE(PythonList::Check(sys_path.get()));
 
-PythonInteger version_major = PythonObject::ResolveNameGlobal("sys.version_info.major").AsType();
-PythonInteger version_minor = PythonObject::ResolveNameGlobal("sys.version_info.minor").AsType();
+PythonInteger version_major = m_main_module.ResolveName("sys.version_info.major").AsType();
+PythonInteger version_minor = m_main_module.ResolveName("sys.version_info.minor").AsType();
 EXPECT_TRUE(version_major.IsAllocated());
 EXPECT_TRUE(version_minor.IsAllocated());
 EXPECT_EQ(PY_MAJOR_VERSION, version_major.GetInteger());
@@ -333,6 +344,72 @@
 EXPECT_STREQ(string_value1, string_sp->GetValue().c_str());
 }
 

Re: [Lldb-commits] [PATCH] D14507: Make sure we use symbol flags to detect thumbness.

2015-11-10 Thread Stephane Sezer via lldb-commits
sas added a comment.

Ok I'll integrate that with the code that uses m_address_class_map.


http://reviews.llvm.org/D14507



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


[Lldb-commits] [PATCH] D14531: Add more autotools/gmake NetBSD glue

2015-11-10 Thread Kamil Rytarowski via lldb-commits
krytarowski created this revision.
krytarowski added subscribers: lldb-commits, brucem, joerg.
krytarowski set the repository for this revision to rL LLVM.

This diff approaches building the project natively on NetBSD with the 
autoconf/gmake framework.

Repository:
  rL LLVM

http://reviews.llvm.org/D14531

Files:
  lib/Makefile
  tools/driver/Makefile
  tools/lldb-mi/Makefile
  tools/lldb-server/Makefile

Index: tools/lldb-server/Makefile
===
--- tools/lldb-server/Makefile
+++ tools/lldb-server/Makefile
@@ -20,6 +20,6 @@
LLVMLibsOptions += -Wl,-rpath,@loader_path/../lib/
 endif
 
-ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux FreeBSD GNU/kFreeBSD))
+ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux FreeBSD GNU/kFreeBSD NetBSD))
LLVMLibsOptions += -Wl,-rpath,$(LibDir) -lpthread
 endif
Index: tools/lldb-mi/Makefile
===
--- tools/lldb-mi/Makefile
+++ tools/lldb-mi/Makefile
@@ -22,12 +22,11 @@
LLVMLibsOptions += -Wl,-sectcreate -Wl,__TEXT -Wl,__info_plist 
-Wl,"$(PROJ_SRC_DIR)/lldb-Info.plist"
 endif
 
-ifneq (,$(filter $(HOST_OS), Linux GNU/kFreeBSD))
+ifneq (,$(filter $(HOST_OS), Linux GNU/kFreeBSD NetBSD))
LLVMLibsOptions += -Wl,-rpath,$(LibDir) -lpthread
 endif
 
 ifeq ($(HOST_OS),FreeBSD)
CPP.Flags += -I/usr/include/edit #-v
LLVMLibsOptions += -Wl,-rpath,$(LibDir) -lpthread
 endif
-
Index: tools/driver/Makefile
===
--- tools/driver/Makefile
+++ tools/driver/Makefile
@@ -26,12 +26,11 @@
LLVMLibsOptions += -Wl,-sectcreate -Wl,__TEXT -Wl,__info_plist 
-Wl,"$(PROJ_SRC_DIR)/lldb-Info.plist"
 endif
 
-ifneq (,$(filter $(HOST_OS), Linux GNU/kFreeBSD))
+ifneq (,$(filter $(HOST_OS), Linux GNU/kFreeBSD NetBSD))
LLVMLibsOptions += -Wl,-rpath,$(LibDir)
 endif
 
 ifeq ($(HOST_OS),FreeBSD)
CPP.Flags += -I/usr/include/edit #-v
LLVMLibsOptions += -Wl,-rpath,$(LibDir)
 endif
-
Index: lib/Makefile
===
--- lib/Makefile
+++ lib/Makefile
@@ -203,3 +203,14 @@
 LLVMLibsOptions += $(PYTHON_BUILD_FLAGS) -lrt -L/usr/local/lib -lexecinfo \
-ledit -lncurses -lpanel -lpthread
 endif
+
+ifeq ($(HOST_OS),NetBSD)
+# Include everything from the .a's into the shared library.
+ProjLibsOptions := -Wl,--whole-archive $(ProjLibsOptions) \
+   -Wl,--no-whole-archive
+# Allow unresolved symbols.
+LLVMLibsOptions += -Wl,--allow-shlib-undefined
+# Link in python
+LLVMLibsOptions += $(PYTHON_BUILD_FLAGS) -lrt -L/usr/pkg/lib -lexecinfo \
+   -ledit -lcurses -lpthread -lkvm -Wl,-rpath,/usr/pkg/lib
+endif


Index: tools/lldb-server/Makefile
===
--- tools/lldb-server/Makefile
+++ tools/lldb-server/Makefile
@@ -20,6 +20,6 @@
 	LLVMLibsOptions += -Wl,-rpath,@loader_path/../lib/
 endif
 
-ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux FreeBSD GNU/kFreeBSD))
+ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux FreeBSD GNU/kFreeBSD NetBSD))
 	LLVMLibsOptions += -Wl,-rpath,$(LibDir) -lpthread
 endif
Index: tools/lldb-mi/Makefile
===
--- tools/lldb-mi/Makefile
+++ tools/lldb-mi/Makefile
@@ -22,12 +22,11 @@
 	LLVMLibsOptions += -Wl,-sectcreate -Wl,__TEXT -Wl,__info_plist -Wl,"$(PROJ_SRC_DIR)/lldb-Info.plist"
 endif
 
-ifneq (,$(filter $(HOST_OS), Linux GNU/kFreeBSD))
+ifneq (,$(filter $(HOST_OS), Linux GNU/kFreeBSD NetBSD))
 	LLVMLibsOptions += -Wl,-rpath,$(LibDir) -lpthread
 endif
 
 ifeq ($(HOST_OS),FreeBSD)
 	CPP.Flags += -I/usr/include/edit #-v
 	LLVMLibsOptions += -Wl,-rpath,$(LibDir) -lpthread
 endif
-
Index: tools/driver/Makefile
===
--- tools/driver/Makefile
+++ tools/driver/Makefile
@@ -26,12 +26,11 @@
 	LLVMLibsOptions += -Wl,-sectcreate -Wl,__TEXT -Wl,__info_plist -Wl,"$(PROJ_SRC_DIR)/lldb-Info.plist"
 endif
 
-ifneq (,$(filter $(HOST_OS), Linux GNU/kFreeBSD))
+ifneq (,$(filter $(HOST_OS), Linux GNU/kFreeBSD NetBSD))
 	LLVMLibsOptions += -Wl,-rpath,$(LibDir)
 endif
 
 ifeq ($(HOST_OS),FreeBSD)
 	CPP.Flags += -I/usr/include/edit #-v
 	LLVMLibsOptions += -Wl,-rpath,$(LibDir)
 endif
-
Index: lib/Makefile
===
--- lib/Makefile
+++ lib/Makefile
@@ -203,3 +203,14 @@
 LLVMLibsOptions += $(PYTHON_BUILD_FLAGS) -lrt -L/usr/local/lib -lexecinfo \
-ledit -lncurses -lpanel -lpthread
 endif
+
+ifeq ($(HOST_OS),NetBSD)
+# Include everything from the .a's into the shared library.
+ProjLibsOptions := -Wl,--whole-archive $(ProjLibsOptions) \
+   -Wl,--no-whole-archive
+# Allow unresolved symbols.
+LLVMLibsOptions += -Wl,--allow-shlib-undefined
+ 

Re: [Lldb-commits] [PATCH] D14507: Make sure we use symbol flags to detect thumbness.

2015-11-10 Thread Tamas Berghammer via lldb-commits
tberghammer requested changes to this revision.


Comment at: source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp:2191-2213
@@ -2170,25 +2190,25 @@
 
 if (arch.GetMachine() == llvm::Triple::arm)
 {
 if (symbol_type == eSymbolTypeCode)
 {
 if (symbol.st_value & 1)
 {
 // Subtracting 1 from the address effectively unsets
 // the low order bit, which results in the address
 // actually pointing to the beginning of the symbol.
 // This delta will be used below in conjunction with
 // symbol.st_value to produce the final symbol_value
 // that we store in the symtab.
 symbol_value_offset = -1;
 additional_flags = ARM_ELF_SYM_IS_THUMB;
 m_address_class_map[symbol.st_value^1] = 
eAddressClassCodeAlternateISA;
 }
 else
 {
 // This address is ARM
 m_address_class_map[symbol.st_value] = 
eAddressClassCode;
 }
 }
 }
 

The function you are looking for is already implemented here (in the way Greg 
suggested). If it isn't working in your case then you should try to figure out 
why it isn't working in the way it is intended.


http://reviews.llvm.org/D14507



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


Re: [Lldb-commits] [PATCH] D14531: Add more autotools/gmake NetBSD glue

2015-11-10 Thread Tamas Berghammer via lldb-commits
tberghammer added a subscriber: tberghammer.
tberghammer added a comment.

I have no objection against this change but considering that LLVM plans to 
remove the autotools/gmake support after branching the 3.8 release (most likely 
in January 2016) it would be good if you can bring up CMake on NetBSD instead 
of autotools/gmake.


Repository:
  rL LLVM

http://reviews.llvm.org/D14531



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


[Lldb-commits] [PATCH] D14538: Fix DwarfSymbolFile when appending global functions from different modules

2015-11-10 Thread Aidan Dodds via lldb-commits
ADodds created this revision.
ADodds added a reviewer: clayborg.
ADodds added a subscriber: lldb-commits.
ADodds set the repository for this revision to rL LLVM.

This patch fixes a bug in SymbolFileDWARF::FindFunctions(), where functions may 
not be correctly found when appending to a list already containing some symbols.
Upon entering this function, original_size is set to the size of sc_list, 
however the target code should be executed not when the list is empty but when 
this list has not grown during this function invocation.  This patch corrects 
this problem.

Running the lldb test suite shows no regressions caused by this change, and 
fixes Bug 25433.
https://llvm.org/bugs/show_bug.cgi?id=25433


Repository:
  rL LLVM

http://reviews.llvm.org/D14538

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

Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===
--- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -2711,7 +2711,7 @@
 // TODO: The arch in the object file isn't correct for MSVC
 // binaries on windows, we should find a way to make it
 // correct and handle those symbols as well.
-if (sc_list.GetSize() == 0)
+if (sc_list.GetSize() == original_size)
 {
 ArchSpec arch;
 if (!parent_decl_ctx &&


Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===
--- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -2711,7 +2711,7 @@
 // TODO: The arch in the object file isn't correct for MSVC
 // binaries on windows, we should find a way to make it
 // correct and handle those symbols as well.
-if (sc_list.GetSize() == 0)
+if (sc_list.GetSize() == original_size)
 {
 ArchSpec arch;
 if (!parent_decl_ctx &&
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D14538: Fix DwarfSymbolFile when appending global functions from different modules

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

Looks good (I remember fixing some similar issues in SymbolFileDWARF where we 
specify append=true, but I missed this one)


Repository:
  rL LLVM

http://reviews.llvm.org/D14538



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


[Lldb-commits] [PATCH] D14536: Add empty symbols to symtab for skipped symbols

2015-11-10 Thread Tamas Berghammer via lldb-commits
tberghammer created this revision.
tberghammer added a reviewer: clayborg.
tberghammer added a subscriber: lldb-commits.
Herald added a subscriber: aemerson.

Add empty symbols to symtab for skipped symbols

LLDB skips several special purpose symbols during symtab parsing (e.g.:
arm/aarch64 mapping symbols) because we don't use them in later stages.
This CL changes the behavior to add an empty symbol to the symtab for
each skipped symbol to preserve the symbol indexes between the symtab in
the object file and LLDBs representation (it is needed because the
relocations are referencing the symbols by index).

http://reviews.llvm.org/D14536

Files:
  source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp

Index: source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
===
--- source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
+++ source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
@@ -2019,12 +2019,18 @@
 // No need to add non-section symbols that have no names
 if (symbol.getType() != STT_SECTION &&
 (symbol_name == NULL || symbol_name[0] == '\0'))
+{
+symtab->AddSymbol(Symbol());
 continue;
+}
 
 // Skipping oatdata and oatexec sections if it is requested. See 
details above the
 // definition of skip_oatdata_oatexec for the reasons.
 if (skip_oatdata_oatexec && (::strcmp(symbol_name, "oatdata") == 0 || 
::strcmp(symbol_name, "oatexec") == 0))
+{
+symtab->AddSymbol(Symbol());
 continue;
+}
 
 SectionSP symbol_section_sp;
 SymbolType symbol_type = eSymbolTypeInvalid;
@@ -2141,7 +2147,10 @@
 }
 }
 if (mapping_symbol)
+{
+symtab->AddSymbol(Symbol());
 continue;
+}
 }
 }
 else if (arch.GetMachine() == llvm::Triple::aarch64)
@@ -2164,7 +2173,10 @@
 }
 }
 if (mapping_symbol)
+{
+symtab->AddSymbol(Symbol());
 continue;
+}
 }
 }
 


Index: source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
===
--- source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
+++ source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
@@ -2019,12 +2019,18 @@
 // No need to add non-section symbols that have no names
 if (symbol.getType() != STT_SECTION &&
 (symbol_name == NULL || symbol_name[0] == '\0'))
+{
+symtab->AddSymbol(Symbol());
 continue;
+}
 
 // Skipping oatdata and oatexec sections if it is requested. See details above the
 // definition of skip_oatdata_oatexec for the reasons.
 if (skip_oatdata_oatexec && (::strcmp(symbol_name, "oatdata") == 0 || ::strcmp(symbol_name, "oatexec") == 0))
+{
+symtab->AddSymbol(Symbol());
 continue;
+}
 
 SectionSP symbol_section_sp;
 SymbolType symbol_type = eSymbolTypeInvalid;
@@ -2141,7 +2147,10 @@
 }
 }
 if (mapping_symbol)
+{
+symtab->AddSymbol(Symbol());
 continue;
+}
 }
 }
 else if (arch.GetMachine() == llvm::Triple::aarch64)
@@ -2164,7 +2173,10 @@
 }
 }
 if (mapping_symbol)
+{
+symtab->AddSymbol(Symbol());
 continue;
+}
 }
 }
 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r252707 - Marked test_qRegisterInfo_returns_{one_valid_result, all_valid_results} XFAIL on Darwin.

2015-11-10 Thread Todd Fiala via lldb-commits
Author: tfiala
Date: Wed Nov 11 00:32:44 2015
New Revision: 252707

URL: http://llvm.org/viewvc/llvm-project?rev=252707=rev
Log:
Marked test_qRegisterInfo_returns_{one_valid_result,all_valid_results} XFAIL on 
Darwin.

Tracked by:
https://llvm.org/bugs/show_bug.cgi?id=25486

Modified:

lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py?rev=252707=252706=252707=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py
 Wed Nov 11 00:32:44 2015
@@ -336,6 +336,7 @@ class LldbGdbServerTestCase(gdbremote_te
 
self.assert_valid_reg_info(lldbgdbserverutils.parse_reg_info_response(reg_info_packet))
 
 @debugserver_test
+@expectedFailureDarwin("llvm.org/pr25486")
 def test_qRegisterInfo_returns_one_valid_result_debugserver(self):
 self.init_debugserver_test()
 self.build()
@@ -367,6 +368,7 @@ class LldbGdbServerTestCase(gdbremote_te
 self.assert_valid_reg_info(reg_info)
 
 @debugserver_test
+@expectedFailureDarwin("llvm.org/pr25486")
 def test_qRegisterInfo_returns_all_valid_results_debugserver(self):
 self.init_debugserver_test()
 self.build()


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


Re: [Lldb-commits] [PATCH] D14538: Fix DwarfSymbolFile when appending global functions from different modules

2015-11-10 Thread Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL252605: Differential Revision: 
http://reviews.llvm.org/D14538 (authored by aidandodds).

Changed prior to commit:
  http://reviews.llvm.org/D14538?vs=39802=39809#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D14538

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

Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -2711,7 +2711,7 @@
 // TODO: The arch in the object file isn't correct for MSVC
 // binaries on windows, we should find a way to make it
 // correct and handle those symbols as well.
-if (sc_list.GetSize() == 0)
+if (sc_list.GetSize() == original_size)
 {
 ArchSpec arch;
 if (!parent_decl_ctx &&


Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -2711,7 +2711,7 @@
 // TODO: The arch in the object file isn't correct for MSVC
 // binaries on windows, we should find a way to make it
 // correct and handle those symbols as well.
-if (sc_list.GetSize() == 0)
+if (sc_list.GetSize() == original_size)
 {
 ArchSpec arch;
 if (!parent_decl_ctx &&
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r252605 - Differential Revision: http://reviews.llvm.org/D14538

2015-11-10 Thread Aidan Dodds via lldb-commits
Author: aidandodds
Date: Tue Nov 10 08:10:57 2015
New Revision: 252605

URL: http://llvm.org/viewvc/llvm-project?rev=252605=rev
Log:
Differential Revision: http://reviews.llvm.org/D14538

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

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=252605=252604=252605=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Tue Nov 10 
08:10:57 2015
@@ -2711,7 +2711,7 @@ SymbolFileDWARF::FindFunctions (const Co
 // TODO: The arch in the object file isn't correct for MSVC
 // binaries on windows, we should find a way to make it
 // correct and handle those symbols as well.
-if (sc_list.GetSize() == 0)
+if (sc_list.GetSize() == original_size)
 {
 ArchSpec arch;
 if (!parent_decl_ctx &&


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


Re: [Lldb-commits] [PATCH] D14555: Create PythonCallable and PythonTuple wrappers with appropriate unit tests

2015-11-10 Thread Eugene Zelenko via lldb-commits
Eugene.Zelenko added a subscriber: Eugene.Zelenko.
Eugene.Zelenko added a comment.

Please also run Clang-tidy modernize checks.



Comment at: source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp:895
@@ +894,3 @@
+
+
+void

Unnecessary line.


Comment at: source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h:300
@@ -297,2 +299,3 @@
 public:
+PythonList() {}
 explicit PythonList(PyInitialValue value);

Should be PythonList() = default; Same for other similar default constructors.


Comment at: source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h:337
@@ +336,3 @@
+
+~PythonTuple() override;
+

Should be ~PythonTuple() override = default; Same for PythonCallable.


http://reviews.llvm.org/D14555



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


Re: [Lldb-commits] [PATCH] D14524: Create a `PythonModule` class and add a root-level method for name lookup

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

Okay Greg's not had a chance to look at this.  I just had a look at it.  I'm 
okay with it, Zachary.  Feel free to check it in.


http://reviews.llvm.org/D14524



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


[Lldb-commits] [lldb] r252702 - Mark TestCompletion.py test_symbol_name_dwarf XFAIL on Darwin.

2015-11-10 Thread Todd Fiala via lldb-commits
Author: tfiala
Date: Tue Nov 10 23:01:30 2015
New Revision: 252702

URL: http://llvm.org/viewvc/llvm-project?rev=252702=rev
Log:
Mark TestCompletion.py test_symbol_name_dwarf XFAIL on Darwin.

This test fails most of the time when run under heavy load.  The dsym
variant doesn't seem to be failing.

Tracking XFAIL marker with:
https://llvm.org/bugs/show_bug.cgi?id=25485

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py?rev=252702=252701=252702=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py
 Tue Nov 10 23:01:30 2015
@@ -254,6 +254,7 @@ class CommandLineCompletionTestCase(Test
 self.complete_from_to('target va', 'target variable ')
 
 @expectedFailureHostWindows("llvm.org/pr24679")
+@expectedFailureDarwin("llvm.org/pr25485")
 def test_symbol_name(self):
 self.build()
 self.complete_from_to('''file a.out


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


[Lldb-commits] [lldb] r252703 - Bump up test timeout interval on Darwin from 4 to 6 minutes.

2015-11-10 Thread Todd Fiala via lldb-commits
Author: tfiala
Date: Tue Nov 10 23:10:07 2015
New Revision: 252703

URL: http://llvm.org/viewvc/llvm-project?rev=252703=rev
Log:
Bump up test timeout interval on Darwin from 4 to 6 minutes.

We have several tests that TIMEOUT under heavy load but just need a bit
more time to complete.

Modified:
lldb/trunk/packages/Python/lldbsuite/test/dosep.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/dosep.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dosep.py?rev=252703=252702=252703=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/dosep.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/dosep.py Tue Nov 10 23:10:07 2015
@@ -1048,6 +1048,9 @@ def getDefaultTimeout(platform_name):
 
 if platform_name.startswith("remote-"):
 return "10m"
+elif platform_name == 'darwin':
+# We are consistently needing more time on a few tests.
+return "6m"
 else:
 return "4m"
 


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


Re: [Lldb-commits] [PATCH] D14531: Add more autotools/gmake NetBSD glue

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

In http://reviews.llvm.org/D14531#285997, @tberghammer wrote:

> I have no objection against this change but considering that LLVM plans to 
> remove the autotools/gmake support after branching the 3.8 release (most 
> likely in January 2016) it would be good if you can bring up CMake on NetBSD 
> instead of autotools/gmake.


This diff is for CMake:
http://reviews.llvm.org/D14529 Use library discovery for curses and panel

This is general support:
http://reviews.llvm.org/D14529 Plug-in PlatformNetBSD initializer and terminator

This one and the following one for autoconf/gmake:
http://reviews.llvm.org/D14528 Allow to override python-config executable name 
from command line

With these diffs I can build lldb/llvm on CMake. autotools build is almost 
there. They shouldn't be big deal to land them in the sources.


Repository:
  rL LLVM

http://reviews.llvm.org/D14531



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


[Lldb-commits] [lldb] r252699 - Mark TestTerminal.py as XFAIL on OS X.

2015-11-10 Thread Todd Fiala via lldb-commits
Author: tfiala
Date: Tue Nov 10 21:43:05 2015
New Revision: 252699

URL: http://llvm.org/viewvc/llvm-project?rev=252699=rev
Log:
Mark TestTerminal.py as XFAIL on OS X.

See the following tracking bug:
https://llvm.org/bugs/show_bug.cgi?id=25484

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/tty/TestTerminal.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/tty/TestTerminal.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/tty/TestTerminal.py?rev=252699=252698=252699=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/tty/TestTerminal.py 
(original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/tty/TestTerminal.py 
Tue Nov 10 21:43:05 2015
@@ -20,6 +20,7 @@ class LaunchInTerminalTestCase(TestBase)
 # a program in a separate terminal window. It would be great if other 
platforms
 # added support for this.
 @skipUnlessDarwin
+@expectedFailureDarwin("llvm.org/pr25484")
 # If the test is being run under sudo, the spawned terminal won't retain 
that elevated
 # privilege so it can't open the socket to talk back to the test case
 @unittest2.skipIf(hasattr(os, 'geteuid') and os.geteuid() == 0, "test 
cannot be run as root")


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