[Lldb-commits] [lldb] r274488 - Fix ClangASTContext after some clang API changes

2016-07-04 Thread Tamas Berghammer via lldb-commits
Author: tberghammer
Date: Mon Jul  4 04:11:08 2016
New Revision: 274488

URL: http://llvm.org/viewvc/llvm-project?rev=274488&view=rev
Log:
Fix ClangASTContext after some clang API changes

Modified:
lldb/trunk/source/Symbol/ClangASTContext.cpp

Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=274488&r1=274487&r2=274488&view=diff
==
--- lldb/trunk/source/Symbol/ClangASTContext.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp Mon Jul  4 04:11:08 2016
@@ -1402,9 +1402,7 @@ ClangASTContext::CreateFunctionTemplateS

clang::FunctionTemplateDecl *func_tmpl_decl,
const 
TemplateParameterInfos &infos)
 {
-TemplateArgumentList template_args (TemplateArgumentList::OnStack,
-infos.args.data(), 
-infos.args.size());
+TemplateArgumentList template_args (TemplateArgumentList::OnStack, 
infos.args);
 
 func_decl->setFunctionTemplateSpecialization (func_tmpl_decl,
   &template_args,
@@ -1502,8 +1500,7 @@ ClangASTContext::CreateClassTemplateSpec

SourceLocation(), 

SourceLocation(),

class_template_decl,
-   
&template_param_infos.args.front(),
-   
template_param_infos.args.size(),
+   
template_param_infos.args,

nullptr);
 
 
class_template_specialization_decl->setSpecializationKind(TSK_ExplicitSpecialization);


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


[Lldb-commits] [lldb] r274489 - Fix the libc++ pretty printers for the android NDK

2016-07-04 Thread Tamas Berghammer via lldb-commits
Author: tberghammer
Date: Mon Jul  4 04:13:10 2016
New Revision: 274489

URL: http://llvm.org/viewvc/llvm-project?rev=274489&view=rev
Log:
Fix the libc++ pretty printers for the android NDK

The libc++ shipped with the android NDK is shipped using a different
internal namespace then the upstream libc++ (__ndk1 vs. __1) to avoid
an ODR violation between the platform and the user application. This
change fixes our pretty printers to be able to work with the types
from the android NDK libc++.

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

Modified:
lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp

Modified: lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp?rev=274489&r1=274488&r2=274489&view=diff
==
--- lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp 
(original)
+++ lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp Mon Jul  
4 04:13:10 2016
@@ -504,60 +504,68 @@ LoadLibCxxFormatters (lldb::TypeCategory
 
 
cpp_category_sp->GetTypeSummariesContainer()->Add(ConstString("std::__1::string"),
  
std_string_summary_sp);
+
cpp_category_sp->GetTypeSummariesContainer()->Add(ConstString("std::__ndk1::string"),
+ 
std_string_summary_sp);
 
cpp_category_sp->GetTypeSummariesContainer()->Add(ConstString("std::__1::basic_string, std::__1::allocator >"),
  
std_string_summary_sp);
+
cpp_category_sp->GetTypeSummariesContainer()->Add(ConstString("std::__ndk1::basic_string, std::__ndk1::allocator >"),
+ 
std_string_summary_sp);
 
 
cpp_category_sp->GetTypeSummariesContainer()->Add(ConstString("std::__1::wstring"),
  
std_wstring_summary_sp);
+
cpp_category_sp->GetTypeSummariesContainer()->Add(ConstString("std::__ndk1::wstring"),
+ 
std_wstring_summary_sp);
 
cpp_category_sp->GetTypeSummariesContainer()->Add(ConstString("std::__1::basic_string, std::__1::allocator >"),
  
std_wstring_summary_sp);
+
cpp_category_sp->GetTypeSummariesContainer()->Add(ConstString("std::__ndk1::basic_string, std::__ndk1::allocator >"),
+ 
std_wstring_summary_sp);
 
 SyntheticChildren::Flags stl_synth_flags;
 
stl_synth_flags.SetCascades(true).SetSkipPointers(false).SetSkipReferences(false);
 
-AddCXXSynthetic(cpp_category_sp, 
lldb_private::formatters::LibcxxStdVectorSyntheticFrontEndCreator, "libc++ 
std::vector synthetic children", ConstString("^std::__1::vector<.+>(( )?&)?$"), 
stl_synth_flags, true);
-AddCXXSynthetic(cpp_category_sp, 
lldb_private::formatters::LibcxxStdListSyntheticFrontEndCreator, "libc++ 
std::list synthetic children", ConstString("^std::__1::list<.+>(( )?&)?$"), 
stl_synth_flags, true);
-AddCXXSynthetic(cpp_category_sp, 
lldb_private::formatters::LibcxxStdMapSyntheticFrontEndCreator, "libc++ 
std::map synthetic children", ConstString("^std::__1::map<.+> >(( )?&)?$"), 
stl_synth_flags, true);
-AddCXXSynthetic(cpp_category_sp, 
lldb_private::formatters::LibcxxVectorBoolSyntheticFrontEndCreator, "libc++ 
std::vector synthetic children", 
ConstString("std::__1::vector >"), stl_synth_flags);
-AddCXXSynthetic(cpp_category_sp, 
lldb_private::formatters::LibcxxVectorBoolSyntheticFrontEndCreator, "libc++ 
std::vector synthetic children", ConstString("std::__1::vector >"), stl_synth_flags);
-AddCXXSynthetic(cpp_category_sp, 
lldb_private::formatters::LibcxxStdMapSyntheticFrontEndCreator, "libc++ 
std::set synthetic children", ConstString("^std::__1::set<.+> >(( )?&)?$"), 
stl_synth_flags, true);
-AddCXXSynthetic(cpp_category_sp, 
lldb_private::formatters::LibcxxStdMapSyntheticFrontEndCreator, "libc++ 
std::multiset synthetic children", ConstString("^std::__1::multiset<.+> >(( 
)?&)?$"), stl_synth_flags, true);
-AddCXXSynthetic(cpp_category_sp, 
lldb_private::formatters::LibcxxStdMapSyntheticFrontEndCreator, "libc++ 
std::multimap synthetic children", ConstString("^std::__1::multimap<.+> >(( 
)?&)?$"), stl_synth_flags, true);
-AddCXXSynthetic(cpp_category_sp, 
lldb_private::formatters::LibcxxStdUnorderedMapSyntheticFrontEndCreator, 
"libc++ std::unordered containers synthetic children", 
ConstString("^(std::__1::)unordered_(multi)?(map|set)<.+> >$"), 
stl_synth_flags, true);
+AddCXXSynthetic(cpp_category_sp, 
lldb_private::formatters::LibcxxStdVectorSyntheticFrontEndCreator, "libc++ 
std::vector synthetic children", ConstString("^std::__(nd

Re: [Lldb-commits] [PATCH] D21680: Fix the libc++ pretty printers for the android NDK

2016-07-04 Thread Tamas Berghammer via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL274489: Fix the libc++ pretty printers for the android NDK 
(authored by tberghammer).

Changed prior to commit:
  http://reviews.llvm.org/D21680?vs=61770&id=62655#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D21680

Files:
  lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp

Index: lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
===
--- lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
+++ lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
@@ -504,60 +504,68 @@
 
 cpp_category_sp->GetTypeSummariesContainer()->Add(ConstString("std::__1::string"),
  std_string_summary_sp);
+cpp_category_sp->GetTypeSummariesContainer()->Add(ConstString("std::__ndk1::string"),
+ std_string_summary_sp);
 cpp_category_sp->GetTypeSummariesContainer()->Add(ConstString("std::__1::basic_string, std::__1::allocator >"),
  std_string_summary_sp);
+cpp_category_sp->GetTypeSummariesContainer()->Add(ConstString("std::__ndk1::basic_string, std::__ndk1::allocator >"),
+ std_string_summary_sp);
 
 cpp_category_sp->GetTypeSummariesContainer()->Add(ConstString("std::__1::wstring"),
  std_wstring_summary_sp);
+cpp_category_sp->GetTypeSummariesContainer()->Add(ConstString("std::__ndk1::wstring"),
+ std_wstring_summary_sp);
 cpp_category_sp->GetTypeSummariesContainer()->Add(ConstString("std::__1::basic_string, std::__1::allocator >"),
  std_wstring_summary_sp);
+cpp_category_sp->GetTypeSummariesContainer()->Add(ConstString("std::__ndk1::basic_string, std::__ndk1::allocator >"),
+ std_wstring_summary_sp);
 
 SyntheticChildren::Flags stl_synth_flags;
 stl_synth_flags.SetCascades(true).SetSkipPointers(false).SetSkipReferences(false);
 
-AddCXXSynthetic(cpp_category_sp, lldb_private::formatters::LibcxxStdVectorSyntheticFrontEndCreator, "libc++ std::vector synthetic children", ConstString("^std::__1::vector<.+>(( )?&)?$"), stl_synth_flags, true);
-AddCXXSynthetic(cpp_category_sp, lldb_private::formatters::LibcxxStdListSyntheticFrontEndCreator, "libc++ std::list synthetic children", ConstString("^std::__1::list<.+>(( )?&)?$"), stl_synth_flags, true);
-AddCXXSynthetic(cpp_category_sp, lldb_private::formatters::LibcxxStdMapSyntheticFrontEndCreator, "libc++ std::map synthetic children", ConstString("^std::__1::map<.+> >(( )?&)?$"), stl_synth_flags, true);
-AddCXXSynthetic(cpp_category_sp, lldb_private::formatters::LibcxxVectorBoolSyntheticFrontEndCreator, "libc++ std::vector synthetic children", ConstString("std::__1::vector >"), stl_synth_flags);
-AddCXXSynthetic(cpp_category_sp, lldb_private::formatters::LibcxxVectorBoolSyntheticFrontEndCreator, "libc++ std::vector synthetic children", ConstString("std::__1::vector >"), stl_synth_flags);
-AddCXXSynthetic(cpp_category_sp, lldb_private::formatters::LibcxxStdMapSyntheticFrontEndCreator, "libc++ std::set synthetic children", ConstString("^std::__1::set<.+> >(( )?&)?$"), stl_synth_flags, true);
-AddCXXSynthetic(cpp_category_sp, lldb_private::formatters::LibcxxStdMapSyntheticFrontEndCreator, "libc++ std::multiset synthetic children", ConstString("^std::__1::multiset<.+> >(( )?&)?$"), stl_synth_flags, true);
-AddCXXSynthetic(cpp_category_sp, lldb_private::formatters::LibcxxStdMapSyntheticFrontEndCreator, "libc++ std::multimap synthetic children", ConstString("^std::__1::multimap<.+> >(( )?&)?$"), stl_synth_flags, true);
-AddCXXSynthetic(cpp_category_sp, lldb_private::formatters::LibcxxStdUnorderedMapSyntheticFrontEndCreator, "libc++ std::unordered containers synthetic children", ConstString("^(std::__1::)unordered_(multi)?(map|set)<.+> >$"), stl_synth_flags, true);
+AddCXXSynthetic(cpp_category_sp, lldb_private::formatters::LibcxxStdVectorSyntheticFrontEndCreator, "libc++ std::vector synthetic children", ConstString("^std::__(ndk)?1::vector<.+>(( )?&)?$"), stl_synth_flags, true);
+AddCXXSynthetic(cpp_category_sp, lldb_private::formatters::LibcxxStdListSyntheticFrontEndCreator, "libc++ std::list synthetic children", ConstString("^std::__(ndk)?1::list<.+>(( )?&)?$"), stl_synth_flags, true);
+AddCXXSynthetic(cpp_category_sp, lldb_private::formatters::LibcxxStdMapSyntheticFrontEndCreator, "libc++ std::map synthetic children", ConstString("^std::__(ndk)?1::map<.+> >(( )?&)?$"), stl_synth_flags, true);
+AddCXXSynthetic(cpp_category_sp, lldb

[Lldb-commits] [lldb] r274490 - Join TestTlsGlobal tests again and use the proper decorator

2016-07-04 Thread Pavel Labath via lldb-commits
Author: labath
Date: Mon Jul  4 04:27:53 2016
New Revision: 274490

URL: http://llvm.org/viewvc/llvm-project?rev=274490&view=rev
Log:
Join TestTlsGlobal tests again and use the proper decorator

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=274490&r1=274489&r2=274490&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 
Mon Jul  4 04:27:53 2016
@@ -27,18 +27,8 @@ 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.
-@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):
+@expectedFailureAll(bugnumber="llvm.org/pr28392", 
oslist=no_match(lldbplatformutil.getDarwinOSTriples()))
+def 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-04 Thread Pavel Labath via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL274491: Enable test log collection from remote debug servers 
(take 2) (authored by labath).

Changed prior to commit:
  http://reviews.llvm.org/D21898?vs=62369&id=62658#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D21898

Files:
  lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
  
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py

Index: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
@@ -583,24 +583,26 @@
 else:
 categories = "default"
 
-if channel == "gdb-remote":
+if channel == "gdb-remote" and lldb.remote_platform is None:
 # communicate gdb-remote categories to debugserver
 os.environ["LLDB_DEBUGSERVER_LOG_FLAGS"] = categories
 
 self.ci.HandleCommand(log_enable + channel_with_categories, self.res)
 if not self.res.Succeeded():
 raise Exception('log enable failed (check LLDB_LOG_OPTION env variable)')
 
 # Communicate log path name to debugserver & lldb-server
-server_log_path = "{}-server.log".format(log_basename)
-open(server_log_path, 'w').close()
-os.environ["LLDB_DEBUGSERVER_LOG_FILE"] = server_log_path
+# For remote debugging, these variables need to be set when starting the platform
+# instance.
+if lldb.remote_platform is None:
+server_log_path = "{}-server.log".format(log_basename)
+open(server_log_path, 'w').close()
+os.environ["LLDB_DEBUGSERVER_LOG_FILE"] = server_log_path
 
-# Communicate channels to lldb-server
-os.environ["LLDB_SERVER_LOG_CHANNELS"] = ":".join(lldbtest_config.channels)
+# Communicate channels to lldb-server
+os.environ["LLDB_SERVER_LOG_CHANNELS"] = ":".join(lldbtest_config.channels)
 
-if len(lldbtest_config.channels) == 0:
-return
+self.addTearDownHook(self.disableLogChannelsForCurrentTest)
 
 def disableLogChannelsForCurrentTest(self):
 # close all log files that we opened
@@ -611,6 +613,42 @@
 if not self.res.Succeeded():
 raise Exception('log disable failed (check LLDB_LOG_OPTION env variable)')
 
+# Retrieve the server log (if any) from the remote system. It is assumed the server log
+# is writing to the "server.log" file in the current test directory. This can be
+# achieved by setting LLDB_DEBUGSERVER_LOG_FILE="server.log" when starting remote
+# platform. If the remote logging is not enabled, then just let the Get() command silently
+# fail.
+if lldb.remote_platform:
+lldb.remote_platform.Get(lldb.SBFileSpec("server.log"),
+lldb.SBFileSpec(self.getLogBasenameForCurrentTest()+"-server.log"))
+
+def setPlatformWorkingDir(self):
+if not lldb.remote_platform or not configuration.lldb_platform_working_dir:
+return
+
+remote_test_dir = lldbutil.join_remote_paths(
+configuration.lldb_platform_working_dir,
+self.getArchitecture(),
+str(self.test_number),
+self.mydir)
+error = lldb.remote_platform.MakeDirectory(remote_test_dir, 448) # 448 = 0o700
+if error.Success():
+lldb.remote_platform.SetWorkingDirectory(remote_test_dir)
+
+# This function removes all files from the current working directory while leaving
+# the directories in place. The cleaup is required to reduce the disk space required
+# by the test suit while leaving the directories untached is neccessary because
+# sub-directories might belong to an other test
+def clean_working_directory():
+# TODO: Make it working on Windows when we need it for remote debugging support
+# TODO: Replace the heuristic to remove the files with a logic what collects the
+# list of files we have to remove during test runs.
+shell_cmd = lldb.SBPlatformShellCommand("rm %s/*" % remote_test_dir)
+lldb.remote_platform.Run(shell_cmd)
+self.addTearDownHook(clean_working_directory)
+else:
+print("error: making remote directory '%s': %s" % (remote_test_dir, error))
+
 def setUp(self):
 """Fixture for unittest test case setup.
 
@@ -716,6 +754,7 @@
 # And the result object.
 self.res = lldb.SBCommandReturnObject()
 
+self.setPlatformWorkingDir()
 self.enableLogChannelsForCurrentTest()
 
 #Initialize debug_info
@@ -884,8 +923,6 @@
 for dict in reversed(self.dicts):

[Lldb-commits] [lldb] r274491 - Enable test log collection from remote debug servers (take 2)

2016-07-04 Thread Pavel Labath via lldb-commits
Author: labath
Date: Mon Jul  4 04:59:45 2016
New Revision: 274491

URL: http://llvm.org/viewvc/llvm-project?rev=274491&view=rev
Log:
Enable test log collection from remote debug servers (take 2)

Summary:
This is a slightly reworked version of D16322, which I had reverted because it 
did not do what it
advertised. Differences from the previous version are:
- moved the code for cleaning up the remote working dir to a later point as it 
was removing the
  log file before we could get to it.
- specialised log downloading code for gdb-remote tests is not needed, as this 
will cover that
  use case as well.

Reviewers: tfiala

Subscribers: lldb-commits

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

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

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

Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py?rev=274491&r1=274490&r2=274491&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Mon Jul  4 04:59:45 
2016
@@ -583,7 +583,7 @@ class Base(unittest2.TestCase):
 else:
 categories = "default"
 
-if channel == "gdb-remote":
+if channel == "gdb-remote" and lldb.remote_platform is None:
 # communicate gdb-remote categories to debugserver
 os.environ["LLDB_DEBUGSERVER_LOG_FLAGS"] = categories
 
@@ -592,15 +592,17 @@ class Base(unittest2.TestCase):
 raise Exception('log enable failed (check LLDB_LOG_OPTION env 
variable)')
 
 # Communicate log path name to debugserver & lldb-server
-server_log_path = "{}-server.log".format(log_basename)
-open(server_log_path, 'w').close()
-os.environ["LLDB_DEBUGSERVER_LOG_FILE"] = server_log_path
+# For remote debugging, these variables need to be set when starting 
the platform
+# instance.
+if lldb.remote_platform is None:
+server_log_path = "{}-server.log".format(log_basename)
+open(server_log_path, 'w').close()
+os.environ["LLDB_DEBUGSERVER_LOG_FILE"] = server_log_path
 
-# Communicate channels to lldb-server
-os.environ["LLDB_SERVER_LOG_CHANNELS"] = 
":".join(lldbtest_config.channels)
+# Communicate channels to lldb-server
+os.environ["LLDB_SERVER_LOG_CHANNELS"] = 
":".join(lldbtest_config.channels)
 
-if len(lldbtest_config.channels) == 0:
-return
+self.addTearDownHook(self.disableLogChannelsForCurrentTest)
 
 def disableLogChannelsForCurrentTest(self):
 # close all log files that we opened
@@ -611,6 +613,42 @@ class Base(unittest2.TestCase):
 if not self.res.Succeeded():
 raise Exception('log disable failed (check LLDB_LOG_OPTION env 
variable)')
 
+# Retrieve the server log (if any) from the remote system. It is 
assumed the server log
+# is writing to the "server.log" file in the current test directory. 
This can be
+# achieved by setting LLDB_DEBUGSERVER_LOG_FILE="server.log" when 
starting remote
+# platform. If the remote logging is not enabled, then just let the 
Get() command silently
+# fail.
+if lldb.remote_platform:
+lldb.remote_platform.Get(lldb.SBFileSpec("server.log"),
+
lldb.SBFileSpec(self.getLogBasenameForCurrentTest()+"-server.log"))
+
+def setPlatformWorkingDir(self):
+if not lldb.remote_platform or not 
configuration.lldb_platform_working_dir:
+return
+
+remote_test_dir = lldbutil.join_remote_paths(
+configuration.lldb_platform_working_dir,
+self.getArchitecture(),
+str(self.test_number),
+self.mydir)
+error = lldb.remote_platform.MakeDirectory(remote_test_dir, 448) # 448 
= 0o700
+if error.Success():
+lldb.remote_platform.SetWorkingDirectory(remote_test_dir)
+
+# This function removes all files from the current working 
directory while leaving
+# the directories in place. The cleaup is required to reduce the 
disk space required
+# by the test suit while leaving the directories untached is 
neccessary because
+# sub-directories might belong to an other test
+def clean_working_directory():
+# TODO: Make it working on Windows when we need it for remote 
debugging support
+# TODO: Replace the heuristic to remove the files with a logic 
what collects the
+# list of files we have to remove during test runs.
+shell_cmd = lldb.SBPlatformShellCommand("rm %s/*" % 
remote_tes

[Lldb-commits] [lldb] r274499 - Remove SIGPIPE handler in LLGS

2016-07-04 Thread Pavel Labath via lldb-commits
Author: labath
Date: Mon Jul  4 08:07:35 2016
New Revision: 274499

URL: http://llvm.org/viewvc/llvm-project?rev=274499&view=rev
Log:
Remove SIGPIPE handler in LLGS

It is sufficient to set the handeler to SIG_IGN, to get the desired behaviour. 
Also, the handler
calling a lot of signal-unsafe functions.

Modified:
lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp

Modified: lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp?rev=274499&r1=274498&r2=274499&view=diff
==
--- lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp (original)
+++ lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp Mon Jul  4 08:07:35 2016
@@ -77,28 +77,9 @@ static struct option g_long_options[] =
 //--
 // Watch for signals
 //--
-static int g_sigpipe_received = 0;
 static int g_sighup_received_count = 0;
 
 #ifndef _WIN32
-
-static void
-signal_handler(int signo)
-{
-Log *log (GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PROCESS));
-
-fprintf (stderr, "lldb-server:%s received signal %d\n", __FUNCTION__, 
signo);
-if (log)
-log->Printf ("lldb-server:%s received signal %d", __FUNCTION__, signo);
-
-switch (signo)
-{
-case SIGPIPE:
-g_sigpipe_received = 1;
-break;
-}
-}
-
 static void
 sighup_handler(MainLoopBase &mainloop)
 {
@@ -348,7 +329,7 @@ main_gdbserver (int argc, char *argv[])
 MainLoop mainloop;
 #ifndef _WIN32
 // Setup signal handlers first thing.
-signal (SIGPIPE, signal_handler);
+signal(SIGPIPE, SIG_IGN);
 MainLoop::SignalHandleUP sighup_handle = mainloop.RegisterSignal(SIGHUP, 
sighup_handler, error);
 #endif
 


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


Re: [Lldb-commits] [PATCH] D21751: Implement GetMemoryRegions() for Linux and Mac OSX core files.

2016-07-04 Thread Howard Hellyer via lldb-commits
hhellyer updated this revision to Diff 62675.
hhellyer added a comment.

I’ve added a test in TestLinuxCore.py. It found a bug which the change in 
RangeMap.h resolves.

It fills in the implementation of Process::GetMemoryRegions() and makes minor 
changes to support the mapped attribute in MemoryRegionInfo to the Mac and 
Linux process implementations. I also updated the documentation for 
Process::GetMemoryRegionInfo.

Windows will require more changes to support the API correctly, I’m currently 
getting an environment setup where I can work on those.


http://reviews.llvm.org/D21751

Files:
  include/lldb/Core/RangeMap.h
  include/lldb/Target/MemoryRegionInfo.h
  include/lldb/Target/Process.h
  
packages/Python/lldbsuite/test/functionalities/postmortem/linux-core/TestLinuxCore.py
  source/Plugins/Process/Linux/NativeProcessLinux.cpp
  source/Plugins/Process/elf-core/ProcessElfCore.cpp
  source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
  source/Plugins/Process/mach-core/ProcessMachCore.cpp
  source/Target/Process.cpp
  tools/lldb-server/lldb-gdbserver.cpp

Index: tools/lldb-server/lldb-gdbserver.cpp
===
--- tools/lldb-server/lldb-gdbserver.cpp
+++ tools/lldb-server/lldb-gdbserver.cpp
@@ -77,9 +77,28 @@
 //--
 // Watch for signals
 //--
+static int g_sigpipe_received = 0;
 static int g_sighup_received_count = 0;
 
 #ifndef _WIN32
+
+static void
+signal_handler(int signo)
+{
+Log *log (GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PROCESS));
+
+fprintf (stderr, "lldb-server:%s received signal %d\n", __FUNCTION__, signo);
+if (log)
+log->Printf ("lldb-server:%s received signal %d", __FUNCTION__, signo);
+
+switch (signo)
+{
+case SIGPIPE:
+g_sigpipe_received = 1;
+break;
+}
+}
+
 static void
 sighup_handler(MainLoopBase &mainloop)
 {
@@ -329,7 +348,7 @@
 MainLoop mainloop;
 #ifndef _WIN32
 // Setup signal handlers first thing.
-signal(SIGPIPE, SIG_IGN);
+signal (SIGPIPE, signal_handler);
 MainLoop::SignalHandleUP sighup_handle = mainloop.RegisterSignal(SIGHUP, sighup_handler, error);
 #endif
 
Index: source/Target/Process.cpp
===
--- source/Target/Process.cpp
+++ source/Target/Process.cpp
@@ -6609,3 +6609,36 @@
 
 return retval;
 }
+
+Error
+Process::GetMemoryRegions (std::vector& region_list)
+{
+
+Error error;
+
+lldb::addr_t range_base = 0;
+lldb::addr_t range_end = 0;
+
+region_list.clear();
+do
+{
+lldb::MemoryRegionInfoSP region_info( new lldb_private::MemoryRegionInfo() );
+error = GetMemoryRegionInfo (range_end, *region_info);
+// GetMemoryRegionInfo should only return an error if it is unimplemented.
+if (error.Fail())
+{
+region_list.clear();
+break;
+}
+
+range_base = region_info->GetRange().GetRangeBase();
+range_end = region_info->GetRange().GetRangeEnd();
+if( region_info->GetMapped() == MemoryRegionInfo::eYes )
+{
+region_list.push_back(region_info);
+}
+} while (range_end != LLDB_INVALID_ADDRESS);
+
+return error;
+
+}
Index: source/Plugins/Process/mach-core/ProcessMachCore.cpp
===
--- source/Plugins/Process/mach-core/ProcessMachCore.cpp
+++ source/Plugins/Process/mach-core/ProcessMachCore.cpp
@@ -581,19 +581,27 @@
: MemoryRegionInfo::eNo);
 region_info.SetExecutable(permissions.Test(ePermissionsExecutable) ? MemoryRegionInfo::eYes
: MemoryRegionInfo::eNo);
+region_info.SetMapped(MemoryRegionInfo::eYes);
 }
 else if (load_addr < permission_entry->GetRangeBase())
 {
 region_info.GetRange().SetRangeBase(load_addr);
 region_info.GetRange().SetRangeEnd(permission_entry->GetRangeBase());
 region_info.SetReadable(MemoryRegionInfo::eNo);
 region_info.SetWritable(MemoryRegionInfo::eNo);
 region_info.SetExecutable(MemoryRegionInfo::eNo);
+region_info.SetMapped(MemoryRegionInfo::eNo);
 }
 return Error();
 }
 
-return Error("invalid address");
+region_info.GetRange().SetRangeBase(load_addr);
+region_info.GetRange().SetRangeEnd(LLDB_INVALID_ADDRESS);
+region_info.SetReadable(MemoryRegionInfo::eNo);
+region_info.SetWritable(MemoryRegionInfo::eNo);
+region_info.SetExecutable(MemoryRegionInfo::eNo);
+region_info.SetMapped(MemoryRegionInfo::eNo);
+return Error();
 }
 
 void
Index: source/Plugins/Process/gdb-remote/GDBRemoteComm

[Lldb-commits] [lldb] r274500 - Ignore oatdata and oatexec symbols more widely

2016-07-04 Thread Tamas Berghammer via lldb-commits
Author: tberghammer
Date: Mon Jul  4 08:31:57 2016
New Revision: 274500

URL: http://llvm.org/viewvc/llvm-project?rev=274500&view=rev
Log:
Ignore oatdata and oatexec symbols more widely

These are artifical symbols inside android oat files without any value
for the user while causing a significant perfoamce hit inside the
unwinder. We were already ignoring it inside system@framew...@boot.oat
bot they have to be ignored in every oat file. Considering that oat
files are only used on android this have no effect on any other
platfrom.

Modified:
lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp

Modified: lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp?rev=274500&r1=274499&r2=274500&view=diff
==
--- lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp Mon Jul  4 
08:31:57 2016
@@ -2184,15 +2184,15 @@ ObjectFileELF::ParseSymbols (Symtab *sym
 static ConstString bss_section_name(".bss");
 static ConstString opd_section_name(".opd");// For ppc64
 
-// On Android the oatdata and the oatexec symbols in 
system@framew...@boot.oat covers the full
-// .text section what causes issues with displaying unusable symbol name 
to the user and very
-// slow unwinding speed because the instruction emulation based unwind 
plans try to emulate all
+// On Android the oatdata and the oatexec symbols in the oat files covers 
the full .text
+// section what causes issues with displaying unusable symbol name to the 
user and very slow
+// unwinding speed because the instruction emulation based unwind plans 
try to emulate all
 // instructions in these symbols. Don't add these symbols to the symbol 
list as they have no
 // use for the debugger and they are causing a lot of trouble.
 // Filtering can't be restricted to Android because this special object 
file don't contain the
 // note section specifying the environment to Android but the custom 
extension and file name
 // makes it highly unlikely that this will collide with anything else.
-bool skip_oatdata_oatexec = m_file.GetFilename() == 
ConstString("system@framew...@boot.oat");
+bool skip_oatdata_oatexec = m_file.GetFileNameExtension() == 
ConstString("oat");
 
 ArchSpec arch;
 GetArchitecture(arch);


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


[Lldb-commits] [lldb] r274505 - Split TestTemplateIntegerArgs test into two

2016-07-04 Thread Pavel Labath via lldb-commits
Author: labath
Date: Mon Jul  4 08:49:46 2016
New Revision: 274505

URL: http://llvm.org/viewvc/llvm-project?rev=274505&view=rev
Log:
Split TestTemplateIntegerArgs test into two

Summary:
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.

Reviewers: clayborg

Subscribers: lldb-commits

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

Added:

lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/template/TestTemplateArgs.py
  - copied, changed from r274500, 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/template/TestTemplateIntegerArgs.py
Removed:

lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/template/TestTemplateIntegerArgs.py

Copied: 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/template/TestTemplateArgs.py 
(from r274500, 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/template/TestTemplateIntegerArgs.py)
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/template/TestTemplateArgs.py?p2=lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/template/TestTemplateArgs.py&p1=lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/template/TestTemplateIntegerArgs.py&r1=274500&r2=274505&rev=274505&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/template/TestTemplateIntegerArgs.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/template/TestTemplateArgs.py 
Mon Jul  4 08:49:46 2016
@@ -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 @@ class TemplateIntegerArgsTestCase(TestBa
 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 @@ class TemplateIntegerArgsTestCase(TestBa
 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"')

Removed: 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/template/TestTemplateIntegerArgs.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/template/TestTemplateIntegerArgs.py?rev=274504&view=auto
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/template/TestTemplateIntegerArgs.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/template/TestTemplateIntegerArgs.py
 (removed)
@@ -1,84 +0,0 @@
-"""
-Tests that C++ templates work as expected
-"""
-import lldb
-from lldbsuite.test.decorators import *
-from lldbsuite.test.lldbtest import *
-from lldbsuite.test imp

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

2016-07-04 Thread Pavel Labath via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL274505: Split TestTemplateIntegerArgs test into two 
(authored by labath).

Changed prior to commit:
  http://reviews.llvm.org/D21923?vs=62478&id=62681#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D21923

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

Index: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/template/TestTemplateArgs.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/template/TestTemplateArgs.py
+++ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/template/TestTemplateArgs.py
@@ -0,0 +1,87 @@
+"""
+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 TemplateArgsTestCase(TestBase):
+
+mydir = TestBase.compute_mydir(__file__)
+
+def prepareProcess(self):
+self.build()
+
+# Create a target by the debugger.
+exe = os.path.join(os.getcwd(), "a.out")
+target = self.dbg.CreateTarget(exe)
+self.assertTrue(target, VALID_TARGET)
+
+# Set breakpoints inside and outside methods that take pointers to the containing struct.
+line = line_number('main.cpp', '// Breakpoint 1')
+lldbutil.run_break_set_by_file_and_line (self, "main.cpp", line, num_expected_locations=1, loc_exact=True)
+
+arguments = None
+environment = None 
+
+# Now launch the process, and do not stop at entry point.
+process = target.LaunchSimple (arguments, environment, self.get_process_working_directory())
+self.assertTrue(process, PROCESS_IS_VALID)
+ 
+# Get the thread of the process
+self.assertTrue(process.GetState() == lldb.eStateStopped, PROCESS_STOPPED)
+thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint)
+
+# Get frame for current thread
+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"')
+self.assertTrue(testpos.GetType().GetName() == 'TestObj<1>')
+
+expr_result = frame.EvaluateExpression("testpos.getArg()")
+self.assertTrue(expr_result.IsValid(), 'got a valid expression result from expression "testpos.getArg()"');
+self.assertTrue(expr_result.GetValue() == "1", "testpos.getArg() == 1")
+self.assertTrue(expr_result.GetType().GetName() == "int", 'expr_result.GetType().GetName() == "int"') 
+
+testneg = frame.FindVariable('testneg') 
+self.assertTrue(testneg.IsValid(), 'make sure we find a local variabble named "testneg"')
+self.assertTrue(testneg.GetType().GetName() == 'TestObj<-1>')
+
+expr_result = frame.EvaluateExpression("testneg.getArg()")
+self.assertTrue(expr_result.IsValid(), 'got a valid expression result from expression "testneg.getArg()"');
+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"')
+self.assertTrue(member.GetType().GetName() == 'EnumTemplate')
+
+expr_result = frame.EvaluateExpression("member.getMember()")
+self.assertTrue(expr_result.IsValid(), 'got a valid expression result from expression "member.getMember()"');
+self.assertTrue(expr_result.GetValue() == "123", "member.getMember() == 123")
+self.assertTrue(expr_result.GetType().GetName() == "int", 'expr_result.GetType().GetName() == "int"') 
+
+# Make sure "subclass" can be displayed and also used in an expression correctly
+subclass = frame.FindVariable('subclass') 
+self.assertTrue(subclass.IsValid(), 'make sure we find a local variabble named "subclass"')
+self.assertTrue(subclass.Get

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

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

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

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


I have attach log of CMake with --trace. 
F2135359: log 


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


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

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

As fas as I could judge from log, you built LLDB with LLVM/Clang. But problem 
happens when it's necessary to build LLDB separately from LLVM/Clang 
(standalone build).


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