Re: [Lldb-commits] [PATCH] D20464: [LLDB][MIPS] Check if libatomic needs to be specified explicitly.

2016-07-01 Thread Nitesh Jain via lldb-commits
nitesh.jain added a comment.

In http://reviews.llvm.org/D20464#471803, @Eugene.Zelenko wrote:

> I see HAVE_CXX_ATOMICS64_WITHOUT_LIB messages during LLVM Cmake run, but I 
> don't see such message during LLDB CMake run.
>
> Is this value is supposed to be read form LLVM CMake cache?


Yes.


Repository:
  rL LLVM

http://reviews.llvm.org/D20464



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


[Lldb-commits] [PATCH] D21923: Split TestTemplateIntegerArgs test into two

2016-07-01 Thread Pavel Labath via lldb-commits
labath created this revision.
labath added a reviewer: clayborg.
labath added a subscriber: lldb-commits.

One of the tests there does not work with gcc, so I'm spinning that off into a 
separate test, so
that we can XFAIL it with more granularity.

I am also renaming the test to reflect the fact that it no longer tests only 
integer arguments.

http://reviews.llvm.org/D21923

Files:
  packages/Python/lldbsuite/test/lang/cpp/template/TestTemplateArgs.py
  packages/Python/lldbsuite/test/lang/cpp/template/TestTemplateIntegerArgs.py

Index: packages/Python/lldbsuite/test/lang/cpp/template/TestTemplateArgs.py
===
--- packages/Python/lldbsuite/test/lang/cpp/template/TestTemplateArgs.py
+++ packages/Python/lldbsuite/test/lang/cpp/template/TestTemplateArgs.py
@@ -1,26 +1,21 @@
 """
-Tests that C++ templates work as expected
+Test that C++ template classes that have integer parameters work correctly.
+
+We must reconstruct the types correctly so the template types are correct 
+and display correctly, and also make sure the expression parser works and
+is able the find all needed functions when evaluating expressions
 """
 import lldb
 from lldbsuite.test.decorators import *
 from lldbsuite.test.lldbtest import *
 from lldbsuite.test import lldbutil
 
-class TemplateIntegerArgsTestCase(TestBase):
+class TemplateArgsTestCase(TestBase):
 
 mydir = TestBase.compute_mydir(__file__)
-
-@expectedFailureAll(bugnumber="llvm.org/pr28354", compiler="gcc", 
oslist=["linux"])
-def test_with_run_command(self):
-"""Test that C++ template classes that have integer parameters work 
correctly.
-   
-   We must reconstruct the types correctly so the template types are 
correct 
-   and display correctly, and also make sure the expression parser 
works and
-   is able the find all needed functions when evaluating expressions"""
+
+def prepareProcess(self):
 self.build()
-
-# Set debugger into synchronous mode
-self.dbg.SetAsync(False)
 
 # Create a target by the debugger.
 exe = os.path.join(os.getcwd(), "a.out")
@@ -43,7 +38,10 @@
 thread = lldbutil.get_stopped_thread(process, 
lldb.eStopReasonBreakpoint)
 
 # Get frame for current thread
-frame = thread.GetSelectedFrame()
+return thread.GetSelectedFrame()
+
+def test_integer_args(self):
+frame = self.prepareProcess()
 
 testpos = frame.FindVariable('testpos') 
 self.assertTrue(testpos.IsValid(), 'make sure we find a local 
variabble named "testpos"')
@@ -63,6 +61,11 @@
 self.assertTrue(expr_result.GetValue() == "-1", "testneg.getArg() == 
-1")
 self.assertTrue(expr_result.GetType().GetName() == "int", 
'expr_result.GetType().GetName() == "int"')
 
+# Gcc does not generate the necessary DWARF attribute for enum template 
parameters.
+@expectedFailureAll(bugnumber="llvm.org/pr28354", compiler="gcc")
+def test_enum_args(self):
+frame = self.prepareProcess()
+
 # Make sure "member" can be displayed and also used in an expression 
correctly
 member = frame.FindVariable('member') 
 self.assertTrue(member.IsValid(), 'make sure we find a local variabble 
named "member"')


Index: packages/Python/lldbsuite/test/lang/cpp/template/TestTemplateArgs.py
===
--- packages/Python/lldbsuite/test/lang/cpp/template/TestTemplateArgs.py
+++ packages/Python/lldbsuite/test/lang/cpp/template/TestTemplateArgs.py
@@ -1,26 +1,21 @@
 """
-Tests that C++ templates work as expected
+Test that C++ template classes that have integer parameters work correctly.
+
+We must reconstruct the types correctly so the template types are correct 
+and display correctly, and also make sure the expression parser works and
+is able the find all needed functions when evaluating expressions
 """
 import lldb
 from lldbsuite.test.decorators import *
 from lldbsuite.test.lldbtest import *
 from lldbsuite.test import lldbutil
 
-class TemplateIntegerArgsTestCase(TestBase):
+class TemplateArgsTestCase(TestBase):
 
 mydir = TestBase.compute_mydir(__file__)
-
-@expectedFailureAll(bugnumber="llvm.org/pr28354", compiler="gcc", oslist=["linux"])
-def test_with_run_command(self):
-"""Test that C++ template classes that have integer parameters work correctly.
-   
-   We must reconstruct the types correctly so the template types are correct 
-   and display correctly, and also make sure the expression parser works and
-   is able the find all needed functions when evaluating expressions"""
+
+def prepareProcess(self):
 self.build()
-
-# Set debugger into synchronous mode
-self.dbg.SetAsync(False)
 
 # Create a target by the debugger.
 exe = os.path.join(os.getcwd(), "a.

Re: [Lldb-commits] [PATCH] D20357: [LLDB][MIPS] Fix FPU Size Based on Dynamic FR/FRE bit

2016-07-01 Thread Nitesh Jain via lldb-commits
nitesh.jain added inline comments.


Comment at: 
source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp:497-505
@@ +496,11 @@
+ {
+bool fre;
+bool fr1;
+IsFR1_FRE (fr1, fre);
+
+// fr1  fre fpu_reg_size
+// 10   64
+// 11   32
+// 00   32
+reg_info->byte_size = (fr1 ^ fre) ? 8 : 4;
+ }

clayborg wrote:
> If we don't add anything to RegisterInfo, then this code is fine. Else we 
> will need to check "reg_info->dynamic_size_dwarf_expr_bytes" and evaluate the 
> DWARF expression to get the size.
If Dwarf expression need to be evaluate at server side, then we need to add one 
more function in DWARFExpression::Evaluate to take NativeRegisterContext has a 
parameter. So should I add one more functionality in it ?

Thanks


Repository:
  rL LLVM

http://reviews.llvm.org/D20357



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


Re: [Lldb-commits] [PATCH] D20357: [LLDB][MIPS] Fix FPU Size Based on Dynamic FR/FRE bit

2016-07-01 Thread Pavel Labath via lldb-commits
labath added a subscriber: labath.


Comment at: 
source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp:497-505
@@ +496,11 @@
+ {
+bool fre;
+bool fr1;
+IsFR1_FRE (fr1, fre);
+
+// fr1  fre fpu_reg_size
+// 10   64
+// 11   32
+// 00   32
+reg_info->byte_size = (fr1 ^ fre) ? 8 : 4;
+ }

nitesh.jain wrote:
> clayborg wrote:
> > If we don't add anything to RegisterInfo, then this code is fine. Else we 
> > will need to check "reg_info->dynamic_size_dwarf_expr_bytes" and evaluate 
> > the DWARF expression to get the size.
> If Dwarf expression need to be evaluate at server side, then we need to add 
> one more function in DWARFExpression::Evaluate to take NativeRegisterContext 
> has a parameter. So should I add one more functionality in it ?
> 
> Thanks
Please be careful about pulling more code to lldb-server, as it may cause the 
size to blow up due to transitive dependencies. If you're going to do that, 
please check the impact on the binary size, but I think it would be best to 
keep dwarf expression evaluation out of the server altogether.


Repository:
  rL LLVM

http://reviews.llvm.org/D20357



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


[Lldb-commits] [lldb] r274364 - Skip TestDisassembleRawData when remote

2016-07-01 Thread Francis Ricci via lldb-commits
Author: fjricci
Date: Fri Jul  1 11:47:44 2016
New Revision: 274364

URL: http://llvm.org/viewvc/llvm-project?rev=274364&view=rev
Log:
Skip TestDisassembleRawData when remote

Summary:
As this test will create a new target, it will cause all following tests
to fail when running in platform mode, if the new target does not match
the existing architecture (for example, x86 vs x86_64).

Reviewers: zturner, spyffe, clayborg

Subscribers: lldb-commits

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

Modified:

lldb/trunk/packages/Python/lldbsuite/test/python_api/disassemble-raw-data/TestDisassembleRawData.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/python_api/disassemble-raw-data/TestDisassembleRawData.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/python_api/disassemble-raw-data/TestDisassembleRawData.py?rev=274364&r1=274363&r2=274364&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/python_api/disassemble-raw-data/TestDisassembleRawData.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/python_api/disassemble-raw-data/TestDisassembleRawData.py
 Fri Jul  1 11:47:44 2016
@@ -19,6 +19,7 @@ class DisassembleRawDataTestCase(TestBas
 
 @add_test_categories(['pyapi'])
 @no_debug_info_test
+@skipIfRemote
 def test_disassemble_raw_data(self):
 """Test disassembling raw bytes with the API."""
 # Create a target from the debugger.


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


Re: [Lldb-commits] [PATCH] D21906: Skip TestDisassembleRawData when remote

2016-07-01 Thread Francis Ricci via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL274364: Skip TestDisassembleRawData when remote (authored by 
fjricci).

Changed prior to commit:
  http://reviews.llvm.org/D21906?vs=62406&id=62504#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D21906

Files:
  
lldb/trunk/packages/Python/lldbsuite/test/python_api/disassemble-raw-data/TestDisassembleRawData.py

Index: 
lldb/trunk/packages/Python/lldbsuite/test/python_api/disassemble-raw-data/TestDisassembleRawData.py
===
--- 
lldb/trunk/packages/Python/lldbsuite/test/python_api/disassemble-raw-data/TestDisassembleRawData.py
+++ 
lldb/trunk/packages/Python/lldbsuite/test/python_api/disassemble-raw-data/TestDisassembleRawData.py
@@ -19,6 +19,7 @@
 
 @add_test_categories(['pyapi'])
 @no_debug_info_test
+@skipIfRemote
 def test_disassemble_raw_data(self):
 """Test disassembling raw bytes with the API."""
 # Create a target from the debugger.


Index: lldb/trunk/packages/Python/lldbsuite/test/python_api/disassemble-raw-data/TestDisassembleRawData.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/python_api/disassemble-raw-data/TestDisassembleRawData.py
+++ lldb/trunk/packages/Python/lldbsuite/test/python_api/disassemble-raw-data/TestDisassembleRawData.py
@@ -19,6 +19,7 @@
 
 @add_test_categories(['pyapi'])
 @no_debug_info_test
+@skipIfRemote
 def test_disassemble_raw_data(self):
 """Test disassembling raw bytes with the API."""
 # Create a target from the debugger.
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D20357: [LLDB][MIPS] Fix FPU Size Based on Dynamic FR/FRE bit

2016-07-01 Thread Greg Clayton via lldb-commits
clayborg added a comment.

There should be no need to add code on the lldb-server side. It would just send 
the DWARF expression bytes over when qRegisterInfo or the target xml is sent to 
the host. The host would store this expression and run it each time the 
register info is asked for for a register so that the host can set the register 
byte size correctly.


Repository:
  rL LLVM

http://reviews.llvm.org/D20357



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


Re: [Lldb-commits] [PATCH] D21923: Split TestTemplateIntegerArgs test into two

2016-07-01 Thread Greg Clayton via lldb-commits
clayborg accepted this revision.
clayborg added a comment.
This revision is now accepted and ready to land.

Looks good.


http://reviews.llvm.org/D21923



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


[Lldb-commits] [lldb] r274366 - Added support for thread local variables on all Apple OS variants.

2016-07-01 Thread Greg Clayton via lldb-commits
Author: gclayton
Date: Fri Jul  1 12:17:23 2016
New Revision: 274366

URL: http://llvm.org/viewvc/llvm-project?rev=274366&view=rev
Log:
Added support for thread local variables on all Apple OS variants.

We had support that assumed that thread local data for a variable could be 
determined solely from the module in which the variable exists. While this work 
for linux, it doesn't work for Apple OSs. The DWARF for thread local variables 
consists of location opcodes that do something like:

DW_OP_const8u (x)
DW_OP_form_tls_address

or 

DW_OP_const8u (x)
DW_OP_GNU_push_tls_address

The "x" is allowed to be anything that is needed to determine the location of 
the variable. For Linux "x" is the offset within the TLS data for a given 
executable (ModuleSP in LLDB). For Apple OS variants, it is the file address of 
the data structure that contains a pthread key that can be used with 
pthread_getspecific() and the offset needed. 

This fix passes the "x" along to the thread:

virtual lldb::addr_t
lldb_private::Thread::GetThreadLocalData(const lldb::ModuleSP module, 
lldb::addr_t tls_file_addr);

Then this is passed along to the DynamicLoader::GetThreadLocalData():

virtual lldb::addr_t
lldb_private::DynamicLoader::GetThreadLocalData(const lldb::ModuleSP module, 
const lldb::ThreadSP thread, lldb::addr_t tls_file_addr);

This allows each DynamicLoader plug-in do the right thing for the current OS.

The DynamicLoaderMacOSXDYLD was modified to be able to grab the pthread key 
from the data structure that is in memory and call "void 
*pthread_getspecific(pthread_key_t key)" to get the value of the thread local 
storage and it caches it per thread since it never changes.

I had to update the test case to access the thread local data before trying to 
print it as on Apple OS variants, thread locals are not available unless they 
have been accessed at least one by the current thread.

I also added a new lldb::ValueType named "eValueTypeVariableThreadLocal" so 
that we can ask SBValue objects for their ValueType and be able to tell when we 
have a thread local variable.




Modified:
lldb/trunk/include/lldb/Expression/DWARFExpression.h
lldb/trunk/include/lldb/Target/DynamicLoader.h
lldb/trunk/include/lldb/Target/Thread.h
lldb/trunk/include/lldb/lldb-enumerations.h

lldb/trunk/packages/Python/lldbsuite/test/lang/c/tls_globals/TestTlsGlobals.py
lldb/trunk/packages/Python/lldbsuite/test/lang/c/tls_globals/a.c
lldb/trunk/packages/Python/lldbsuite/test/lang/c/tls_globals/main.c
lldb/trunk/source/API/SBBlock.cpp
lldb/trunk/source/API/SBFrame.cpp
lldb/trunk/source/API/SBValue.cpp
lldb/trunk/source/Commands/CommandObjectFrame.cpp
lldb/trunk/source/Commands/CommandObjectTarget.cpp
lldb/trunk/source/Expression/DWARFExpression.cpp

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

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

lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp

lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h

lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
lldb/trunk/source/Symbol/SymbolContext.cpp
lldb/trunk/source/Symbol/Variable.cpp
lldb/trunk/source/Target/Thread.cpp

Modified: lldb/trunk/include/lldb/Expression/DWARFExpression.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/DWARFExpression.h?rev=274366&r1=274365&r2=274366&view=diff
==
--- lldb/trunk/include/lldb/Expression/DWARFExpression.h (original)
+++ lldb/trunk/include/lldb/Expression/DWARFExpression.h Fri Jul  1 12:17:23 
2016
@@ -10,11 +10,12 @@
 #ifndef liblldb_DWARFExpression_h_
 #define liblldb_DWARFExpression_h_
 
-#include "lldb/lldb-private.h"
 #include "lldb/Core/Address.h"
 #include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/Error.h"
 #include "lldb/Core/Scalar.h"
+#include "lldb/lldb-private.h"
+#include 
 
 class DWARFCompileUnit;
 
@@ -166,7 +167,14 @@ public:
 
 bool
 Update_DW_OP_addr (lldb::addr_t file_addr);
-
+
+bool
+ContainsThreadLocalStorage() const;
+
+bool
+LinkThreadLocalStorage(lldb::ModuleSP new_module_sp,
+   std::function 
const &link_address_callback);
+
 //--
 /// Make the expression parser read its location information from a
 /// given data source.  Does not change the offset and length

Modified: lldb/trunk/include/lldb/Target/DynamicLoader.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/DynamicLoader.h?rev=274366&r1=274365&r2=274366&view=diff
===

[Lldb-commits] [lldb] r274374 - Try to fix Ubuntu buildbots after I broke thread local variables with 274366.

2016-07-01 Thread Greg Clayton via lldb-commits
Author: gclayton
Date: Fri Jul  1 13:22:01 2016
New Revision: 274374

URL: http://llvm.org/viewvc/llvm-project?rev=274374&view=rev
Log:
Try to fix Ubuntu buildbots after I broke thread local variables with 274366.


Modified:

lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp

Modified: 
lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp?rev=274374&r1=274373&r2=274374&view=diff
==
--- 
lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp 
(original)
+++ 
lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp 
Fri Jul  1 13:22:01 2016
@@ -599,10 +599,19 @@ DynamicLoaderPOSIXDYLD::GetEntryPoint()
 }
 
 lldb::addr_t
-DynamicLoaderPOSIXDYLD::GetThreadLocalData(const lldb::ModuleSP module, const 
lldb::ThreadSP thread,
+DynamicLoaderPOSIXDYLD::GetThreadLocalData(const lldb::ModuleSP module_sp, 
const lldb::ThreadSP thread,
lldb::addr_t tls_file_addr)
 {
-auto it = m_loaded_modules.find (module);
+lldb_private::Address tls_addr;
+if (!module_sp->ResolveFileAddress(tls_file_addr, tls_addr))
+return LLDB_INVALID_ADDRESS;
+
+const lldb::addr_t tls_load_addr = 
tls_addr.GetLoadAddress(&m_process->GetTarget());;
+
+if (tls_load_addr == LLDB_INVALID_ADDRESS)
+return LLDB_INVALID_ADDRESS;
+
+auto it = m_loaded_modules.find (module_sp);
 if (it == m_loaded_modules.end())
 return LLDB_INVALID_ADDRESS;
 
@@ -635,14 +644,13 @@ DynamicLoaderPOSIXDYLD::GetThreadLocalDa
 addr_t dtv_slot = dtv + metadata.dtv_slot_size*modid;
 addr_t tls_block = ReadPointer (dtv_slot + metadata.tls_offset);
 
-Module *mod = module.get();
 Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
 if (log)
 log->Printf("DynamicLoaderPOSIXDYLD::Performed TLS lookup: "
 "module=%s, link_map=0x%" PRIx64 ", tp=0x%" PRIx64 ", 
modid=%" PRId64 ", tls_block=0x%" PRIx64 "\n",
-mod->GetObjectName().AsCString(""), link_map, tp, 
(int64_t)modid, tls_block);
+module_sp->GetObjectName().AsCString(""), link_map, tp, 
(int64_t)modid, tls_block);
 
-return tls_block + tls_file_addr;
+return tls_block + tls_load_addr;
 }
 
 void


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


[Lldb-commits] [lldb] r274377 - Revert fix that didn't work. I will need to debug this on linux to figure things out.

2016-07-01 Thread Greg Clayton via lldb-commits
Author: gclayton
Date: Fri Jul  1 13:55:55 2016
New Revision: 274377

URL: http://llvm.org/viewvc/llvm-project?rev=274377&view=rev
Log:
Revert fix that didn't work. I will need to debug this on linux to figure 
things out.


Modified:

lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp

Modified: 
lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp?rev=274377&r1=274376&r2=274377&view=diff
==
--- 
lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp 
(original)
+++ 
lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp 
Fri Jul  1 13:55:55 2016
@@ -602,15 +602,6 @@ lldb::addr_t
 DynamicLoaderPOSIXDYLD::GetThreadLocalData(const lldb::ModuleSP module_sp, 
const lldb::ThreadSP thread,
lldb::addr_t tls_file_addr)
 {
-lldb_private::Address tls_addr;
-if (!module_sp->ResolveFileAddress(tls_file_addr, tls_addr))
-return LLDB_INVALID_ADDRESS;
-
-const lldb::addr_t tls_load_addr = 
tls_addr.GetLoadAddress(&m_process->GetTarget());;
-
-if (tls_load_addr == LLDB_INVALID_ADDRESS)
-return LLDB_INVALID_ADDRESS;
-
 auto it = m_loaded_modules.find (module_sp);
 if (it == m_loaded_modules.end())
 return LLDB_INVALID_ADDRESS;
@@ -650,7 +641,7 @@ DynamicLoaderPOSIXDYLD::GetThreadLocalDa
 "module=%s, link_map=0x%" PRIx64 ", tp=0x%" PRIx64 ", 
modid=%" PRId64 ", tls_block=0x%" PRIx64 "\n",
 module_sp->GetObjectName().AsCString(""), link_map, tp, 
(int64_t)modid, tls_block);
 
-return tls_block + tls_load_addr;
+return tls_block + tls_file_addr;
 }
 
 void


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


Re: [Lldb-commits] [PATCH] D20464: [LLDB][MIPS] Check if libatomic needs to be specified explicitly.

2016-07-01 Thread Eugene Zelenko via lldb-commits
Eugene.Zelenko added a comment.

I run CMake with --trace and is mentioned only in condition added there.


Repository:
  rL LLVM

http://reviews.llvm.org/D20464



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


[Lldb-commits] [lldb] r274388 - Thread local storage was already broken on Linux and the tests were passing because there was a dectorator:

2016-07-01 Thread Greg Clayton via lldb-commits
Author: gclayton
Date: Fri Jul  1 16:25:20 2016
New Revision: 274388

URL: http://llvm.org/viewvc/llvm-project?rev=274388&view=rev
Log:
Thread local storage was already broken on Linux and the tests were passing 
because there was a dectorator:
  
@unittest2.expectedFailure("rdar://7796742")

Which was covering up the fact this was failing on linux and hexagon. I added 
back a decorator so we don't break any build bots.


Modified:

lldb/trunk/packages/Python/lldbsuite/test/lang/c/tls_globals/TestTlsGlobals.py

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

lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/lang/c/tls_globals/TestTlsGlobals.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/c/tls_globals/TestTlsGlobals.py?rev=274388&r1=274387&r2=274388&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/lang/c/tls_globals/TestTlsGlobals.py 
(original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/lang/c/tls_globals/TestTlsGlobals.py 
Fri Jul  1 16:25:20 2016
@@ -27,6 +27,7 @@ class TlsGlobalTestCase(TestBase):
 self.addTearDownHook(lambda: self.runCmd("settings remove 
target.env-vars " + self.dylibPath))
 
 @skipIfWindows # TLS works differently on Windows, this would need to be 
implemented separately.
+@unittest2.expectedFailure("now works on Darwin, but not linux")
 def test(self):
 """Test thread-local storage."""
 self.build()

Modified: 
lldb/trunk/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp?rev=274388&r1=274387&r2=274388&view=diff
==
--- 
lldb/trunk/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp
 (original)
+++ 
lldb/trunk/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp
 Fri Jul  1 16:25:20 2016
@@ -688,5 +688,8 @@ DynamicLoaderHexagonDYLD::GetThreadLocal
 "module=%s, link_map=0x%" PRIx64 ", tp=0x%" PRIx64 ", 
modid=%i, tls_block=0x%" PRIx64,
 mod->GetObjectName().AsCString(""), link_map, tp, modid, 
tls_block);
 
-return tls_block + tls_file_addr;
+if (tls_block == LLDB_INVALID_ADDRESS)
+return LLDB_INVALID_ADDRESS;
+else
+return tls_block + tls_file_addr;
 }

Modified: 
lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp?rev=274388&r1=274387&r2=274388&view=diff
==
--- 
lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp 
(original)
+++ 
lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp 
Fri Jul  1 16:25:20 2016
@@ -641,7 +641,10 @@ DynamicLoaderPOSIXDYLD::GetThreadLocalDa
 "module=%s, link_map=0x%" PRIx64 ", tp=0x%" PRIx64 ", 
modid=%" PRId64 ", tls_block=0x%" PRIx64 "\n",
 module_sp->GetObjectName().AsCString(""), link_map, tp, 
(int64_t)modid, tls_block);
 
-return tls_block + tls_file_addr;
+if (tls_block == LLDB_INVALID_ADDRESS)
+return LLDB_INVALID_ADDRESS;
+else
+return tls_block + tls_file_addr;
 }
 
 void


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


[Lldb-commits] [lldb] r274393 - Fixed thread local storage test case to run normally with no expected fail for Darwin, always skip on windows, and expected fail for all other OSs while mentioning the

2016-07-01 Thread Greg Clayton via lldb-commits
Author: gclayton
Date: Fri Jul  1 17:33:13 2016
New Revision: 274393

URL: http://llvm.org/viewvc/llvm-project?rev=274393&view=rev
Log:
Fixed thread local storage test case to run normally with no expected fail for 
Darwin, always skip on windows, and expected fail for all other OSs while 
mentioning the new bug I filed to track fixing TLS variables: 
https://llvm.org/bugs/show_bug.cgi?id=28392


Modified:

lldb/trunk/packages/Python/lldbsuite/test/lang/c/tls_globals/TestTlsGlobals.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/lang/c/tls_globals/TestTlsGlobals.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/c/tls_globals/TestTlsGlobals.py?rev=274393&r1=274392&r2=274393&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/lang/c/tls_globals/TestTlsGlobals.py 
(original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/lang/c/tls_globals/TestTlsGlobals.py 
Fri Jul  1 17:33:13 2016
@@ -27,8 +27,18 @@ class TlsGlobalTestCase(TestBase):
 self.addTearDownHook(lambda: self.runCmd("settings remove 
target.env-vars " + self.dylibPath))
 
 @skipIfWindows # TLS works differently on Windows, this would need to be 
implemented separately.
-@unittest2.expectedFailure("now works on Darwin, but not linux")
-def test(self):
+@skipIfDarwin # Darwin has its own test below and we don't want it to 
expected fail with decorator below
+@unittest2.expectedFailure("llvm.org/pr28392")
+def test_non_darwin(self):
+'''Mark as expected fail for all except Darwin or Windows'''
+self.run_test()
+
+@skipUnlessDarwin
+def test_darwin(self):
+'''Always run on darwin with no expected fail'''
+self.run_test()
+
+def run_test(self):
 """Test thread-local storage."""
 self.build()
 exe = os.path.join(os.getcwd(), "a.out")


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


Re: [Lldb-commits] [PATCH] D21898: Enable test log collection from remote debug servers (take 2)

2016-07-01 Thread Todd Fiala via lldb-commits
tfiala accepted this revision.
tfiala added a comment.
This revision is now accepted and ready to land.

Looks good, Pavel!


http://reviews.llvm.org/D21898



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