[Lldb-commits] [lldb] r313642 - Fix build of TaskPoolTest with xcodebuild

2017-09-19 Thread Francis Ricci via lldb-commits
Author: fjricci
Date: Tue Sep 19 10:13:39 2017
New Revision: 313642

URL: http://llvm.org/viewvc/llvm-project?rev=313642=rev
Log:
Fix build of TaskPoolTest with xcodebuild

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

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=313642=313641=313642=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Tue Sep 19 10:13:39 2017
@@ -3372,6 +3372,7 @@
2321F9391BDD332400BA9A93 /* 
SocketAddressTest.cpp */,
2321F93A1BDD332400BA9A93 /* SocketTest.cpp */,
2321F93B1BDD332400BA9A93 /* SymbolsTest.cpp */,
+   2321F9451BDD346100BA9A93 /* TaskPoolTest.cpp */,
);
path = Host;
sourceTree = "";
@@ -3411,7 +3412,6 @@
2321F9431BDD346100BA9A93 /* CMakeLists.txt */,
23CB15041D66CD9200EDDDE1 /* Inputs */,
2321F9441BDD346100BA9A93 /* 
StringExtractorTest.cpp */,
-   2321F9451BDD346100BA9A93 /* TaskPoolTest.cpp */,
8C3BD99F1EF5D1B50016C343 /* JSONTest.cpp */,
2321F9461BDD346100BA9A93 /* UriParserTest.cpp 
*/,
);


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


[Lldb-commits] [lldb] r313637 - Use ThreadLauncher to launch TaskPool threads

2017-09-19 Thread Francis Ricci via lldb-commits
Author: fjricci
Date: Tue Sep 19 08:38:30 2017
New Revision: 313637

URL: http://llvm.org/viewvc/llvm-project?rev=313637=rev
Log:
Use ThreadLauncher to launch TaskPool threads

Summary:
This allows for the stack size to be configured, which isn't
possible with std::thread. Prevents overflowing the stack when
performing complex operations in the task pool on darwin,
where the default pthread stack size is only 512kb.

This also moves TaskPool from Utility to Host.

Reviewers: labath, tberghammer, clayborg

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D37930

Added:
lldb/trunk/include/lldb/Host/TaskPool.h
  - copied, changed from r313540, lldb/trunk/include/lldb/Utility/TaskPool.h
lldb/trunk/source/Host/common/TaskPool.cpp
  - copied, changed from r313540, lldb/trunk/source/Utility/TaskPool.cpp
lldb/trunk/unittests/Host/TaskPoolTest.cpp
  - copied, changed from r313540, 
lldb/trunk/unittests/Utility/TaskPoolTest.cpp
Removed:
lldb/trunk/include/lldb/Utility/TaskPool.h
lldb/trunk/source/Utility/TaskPool.cpp
lldb/trunk/unittests/Utility/TaskPoolTest.cpp
Modified:
lldb/trunk/lldb.xcodeproj/project.pbxproj
lldb/trunk/source/Host/CMakeLists.txt
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
lldb/trunk/source/Utility/CMakeLists.txt
lldb/trunk/unittests/Host/CMakeLists.txt
lldb/trunk/unittests/Utility/CMakeLists.txt

Copied: lldb/trunk/include/lldb/Host/TaskPool.h (from r313540, 
lldb/trunk/include/lldb/Utility/TaskPool.h)
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/TaskPool.h?p2=lldb/trunk/include/lldb/Host/TaskPool.h=lldb/trunk/include/lldb/Utility/TaskPool.h=313540=313637=313637=diff
==
(empty)

Removed: lldb/trunk/include/lldb/Utility/TaskPool.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/TaskPool.h?rev=313636=auto
==
--- lldb/trunk/include/lldb/Utility/TaskPool.h (original)
+++ lldb/trunk/include/lldb/Utility/TaskPool.h (removed)
@@ -1,92 +0,0 @@
-//===- TaskPool.h ---*- C++ 
-*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===--===//
-
-#ifndef utility_TaskPool_h_
-#define utility_TaskPool_h_
-
-#include "llvm/ADT/STLExtras.h"
-#include  // for bind, function
-#include 
-#include 
-#include   // for make_shared
-#include// for mutex, unique_lock, condition_variable
-#include  // for forward, result_of, move
-
-// Global TaskPool class for running tasks in parallel on a set of worker 
thread
-// created the first
-// time the task pool is used. The TaskPool provide no guarantee about the 
order
-// the task will be run
-// and about what tasks will run in parallel. None of the task added to the 
task
-// pool should block
-// on something (mutex, future, condition variable) what will be set only by 
the
-// completion of an
-// other task on the task pool as they may run on the same thread sequentally.
-class TaskPool {
-public:
-  // Add a new task to the task pool and return a std::future belonging to the
-  // newly created task.
-  // The caller of this function has to wait on the future for this task to
-  // complete.
-  template 
-  static std::future::type>
-  AddTask(F &, Args &&... args);
-
-  // Run all of the specified tasks on the task pool and wait until all of them
-  // are finished
-  // before returning. This method is intended to be used for small number 
tasks
-  // where listing
-  // them as function arguments is acceptable. For running large number of 
tasks
-  // you should use
-  // AddTask for each task and then call wait() on each returned future.
-  template  static void RunTasks(T &&... tasks);
-
-private:
-  TaskPool() = delete;
-
-  template  struct RunTaskImpl;
-
-  static void AddTaskImpl(std::function &_fn);
-};
-
-template 
-std::future::type>
-TaskPool::AddTask(F &, Args &&... args) {
-  auto task_sp = std::make_shared<
-  std::packaged_task::type()>>(
-  std::bind(std::forward(f), std::forward(args)...));
-
-  AddTaskImpl([task_sp]() { (*task_sp)(); });
-
-  return task_sp->get_future();
-}
-
-template  void TaskPool::RunTasks(T &&... tasks) {
-  RunTaskImpl::Run(std::forward(tasks)...);
-}
-
-template 
-struct TaskPool::RunTaskImpl {
-  static void Run(Head &, Tail &&... t) {
-auto f = AddTask(std::forward(h));
-RunTaskImpl::Run(std::forward(t)...);
-f.wait();
-  }
-};
-
-template <> struct TaskPool::RunTaskImpl<> {
-  static void Run() {}
-};
-
-// Run 'func' on every value from begin .. end-1.  Each worker will grab
-// 'batch_size' numbers at a 

[Lldb-commits] [lldb] r313539 - Revert "Use ThreadLauncher to launch TaskPool threads"

2017-09-18 Thread Francis Ricci via lldb-commits
Author: fjricci
Date: Mon Sep 18 08:43:59 2017
New Revision: 313539

URL: http://llvm.org/viewvc/llvm-project?rev=313539=rev
Log:
Revert "Use ThreadLauncher to launch TaskPool threads"

This reverts commit r313537 because it fails to link on linux buildbots

Modified:
lldb/trunk/source/Utility/TaskPool.cpp

Modified: lldb/trunk/source/Utility/TaskPool.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/TaskPool.cpp?rev=313539=313538=313539=diff
==
--- lldb/trunk/source/Utility/TaskPool.cpp (original)
+++ lldb/trunk/source/Utility/TaskPool.cpp Mon Sep 18 08:43:59 2017
@@ -8,7 +8,6 @@
 
//===--===//
 
 #include "lldb/Utility/TaskPool.h"
-#include "lldb/Host/ThreadLauncher.h"
 
 #include  // for uint32_t
 #include// for queue
@@ -24,8 +23,6 @@ public:
 private:
   TaskPoolImpl();
 
-  static lldb::thread_result_t WorkerPtr(void *pool);
-
   static void Worker(TaskPoolImpl *pool);
 
   std::queue> m_tasks;
@@ -48,7 +45,6 @@ TaskPoolImpl::TaskPoolImpl() : m_thread_
 
 void TaskPoolImpl::AddTask(std::function &_fn) {
   static const uint32_t max_threads = std::thread::hardware_concurrency();
-  const size_t min_stack_size = 8 * 1024 * 1024;
 
   std::unique_lock lock(m_tasks_mutex);
   m_tasks.emplace(std::move(task_fn));
@@ -58,17 +54,10 @@ void TaskPoolImpl::AddTask(std::function
 // This prevents the thread
 // from exiting prematurely and triggering a linux libc bug
 // (https://sourceware.org/bugzilla/show_bug.cgi?id=19951).
-lldb_private::ThreadLauncher::LaunchThread("task-pool.worker", WorkerPtr,
-   this, nullptr, min_stack_size)
-.Release();
+std::thread(Worker, this).detach();
   }
 }
 
-lldb::thread_result_t TaskPoolImpl::WorkerPtr(void *pool) {
-  Worker((TaskPoolImpl *)pool);
-  return 0;
-}
-
 void TaskPoolImpl::Worker(TaskPoolImpl *pool) {
   while (true) {
 std::unique_lock lock(pool->m_tasks_mutex);


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


[Lldb-commits] [lldb] r313537 - Use ThreadLauncher to launch TaskPool threads

2017-09-18 Thread Francis Ricci via lldb-commits
Author: fjricci
Date: Mon Sep 18 08:18:48 2017
New Revision: 313537

URL: http://llvm.org/viewvc/llvm-project?rev=313537=rev
Log:
Use ThreadLauncher to launch TaskPool threads

Summary:
This allows for the stack size to be configured, which isn't
possible with std::thread. Prevents overflowing the stack when
performing complex operations in the task pool on darwin,
where the default pthread stack size is only 512kb.

Reviewers: labath, tberghammer, clayborg

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D37930

Modified:
lldb/trunk/source/Utility/TaskPool.cpp

Modified: lldb/trunk/source/Utility/TaskPool.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/TaskPool.cpp?rev=313537=313536=313537=diff
==
--- lldb/trunk/source/Utility/TaskPool.cpp (original)
+++ lldb/trunk/source/Utility/TaskPool.cpp Mon Sep 18 08:18:48 2017
@@ -8,6 +8,7 @@
 
//===--===//
 
 #include "lldb/Utility/TaskPool.h"
+#include "lldb/Host/ThreadLauncher.h"
 
 #include  // for uint32_t
 #include// for queue
@@ -23,6 +24,8 @@ public:
 private:
   TaskPoolImpl();
 
+  static lldb::thread_result_t WorkerPtr(void *pool);
+
   static void Worker(TaskPoolImpl *pool);
 
   std::queue> m_tasks;
@@ -45,6 +48,7 @@ TaskPoolImpl::TaskPoolImpl() : m_thread_
 
 void TaskPoolImpl::AddTask(std::function &_fn) {
   static const uint32_t max_threads = std::thread::hardware_concurrency();
+  const size_t min_stack_size = 8 * 1024 * 1024;
 
   std::unique_lock lock(m_tasks_mutex);
   m_tasks.emplace(std::move(task_fn));
@@ -54,10 +58,17 @@ void TaskPoolImpl::AddTask(std::function
 // This prevents the thread
 // from exiting prematurely and triggering a linux libc bug
 // (https://sourceware.org/bugzilla/show_bug.cgi?id=19951).
-std::thread(Worker, this).detach();
+lldb_private::ThreadLauncher::LaunchThread("task-pool.worker", WorkerPtr,
+   this, nullptr, min_stack_size)
+.Release();
   }
 }
 
+lldb::thread_result_t TaskPoolImpl::WorkerPtr(void *pool) {
+  Worker((TaskPoolImpl *)pool);
+  return 0;
+}
+
 void TaskPoolImpl::Worker(TaskPoolImpl *pool) {
   while (true) {
 std::unique_lock lock(pool->m_tasks_mutex);


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


[Lldb-commits] [lldb] r302260 - Add missing 'arch' key to valid qHostInfo keys

2017-05-05 Thread Francis Ricci via lldb-commits
Author: fjricci
Date: Fri May  5 12:18:08 2017
New Revision: 302260

URL: http://llvm.org/viewvc/llvm-project?rev=302260=rev
Log:
Add missing 'arch' key to valid qHostInfo keys

Summary:
'arch' is a valid qHostInfo key, but the unit
test for qHostInfo did not include it in the set of possible keys.

Reviewers: tfiala, labath

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D32711

Modified:

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

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteHostInfo.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteHostInfo.py?rev=302260=302259=302260=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteHostInfo.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteHostInfo.py
 Fri May  5 12:18:08 2017
@@ -14,6 +14,7 @@ class TestGdbRemoteHostInfo(GdbRemoteTes
 mydir = TestBase.compute_mydir(__file__)
 
 KNOWN_HOST_INFO_KEYS = set([
+"arch",
 "cputype",
 "cpusubtype",
 "distribution_id",


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


[Lldb-commits] [lldb] r302027 - Don't attempt to use mpx registers on unsupported platforms

2017-05-03 Thread Francis Ricci via lldb-commits
Author: fjricci
Date: Wed May  3 10:00:04 2017
New Revision: 302027

URL: http://llvm.org/viewvc/llvm-project?rev=302027=rev
Log:
Don't attempt to use mpx registers on unsupported platforms

Summary:
The existing cpp-level checks using PR_MPX_ENABLE_MANAGEMENT aren't sufficient,
as this isn't defined for linux kernel versions below 3.19.

Reviewers: valentinagiusti, zturner, labath

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D32719

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/main.cpp

lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/main.cpp

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/main.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/main.cpp?rev=302027=302026=302027=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/main.cpp
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/main.cpp
 Wed May  3 10:00:04 2017
@@ -14,6 +14,11 @@
 int
 main(int argc, char const *argv[])
 {
+// PR_MPX_ENABLE_MANAGEMENT won't be defined on linux kernel versions below 
3.19
+#ifndef PR_MPX_ENABLE_MANAGEMENT
+return -1;
+#endif
+
 // This call returns 0 only if the CPU and the kernel support Intel(R) MPX.
 if (prctl(PR_MPX_ENABLE_MANAGEMENT, 0, 0, 0, 0) != 0)
 return -1;

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/main.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/main.cpp?rev=302027=302026=302027=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/main.cpp
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/main.cpp
 Wed May  3 10:00:04 2017
@@ -29,6 +29,11 @@ main(int argc, char const *argv[])
   unsigned int rax, rbx, rcx, rdx;
   int array[5];
 
+// PR_MPX_ENABLE_MANAGEMENT won't be defined on linux kernel versions below 
3.19
+#ifndef PR_MPX_ENABLE_MANAGEMENT
+return -1;
+#endif
+
   // This call returns 0 only if the CPU and the kernel support Intel(R) MPX.
   if (prctl(PR_MPX_ENABLE_MANAGEMENT, 0, 0, 0, 0) != 0)
 return -1;


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


[Lldb-commits] [lldb] r283491 - Fix GetDisplayName when only a demangled name is available

2016-10-06 Thread Francis Ricci via lldb-commits
Author: fjricci
Date: Thu Oct  6 15:41:11 2016
New Revision: 283491

URL: http://llvm.org/viewvc/llvm-project?rev=283491=rev
Log:
Fix GetDisplayName when only a demangled name is available

Summary:
GetDisplayDemangledName will already return a ConstString() when
there is neither a mangled name or a demangled name, so we don't need to special
case here. This will fix GetDisplayName in cases where m_mangled contains
only a demangled name and not a mangled name.

Reviewers: clayborg, granata.enrico, sas

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D25201

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

Modified: lldb/trunk/source/Symbol/Function.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Function.cpp?rev=283491=283490=283491=diff
==
--- lldb/trunk/source/Symbol/Function.cpp (original)
+++ lldb/trunk/source/Symbol/Function.cpp Thu Oct  6 15:41:11 2016
@@ -347,8 +347,6 @@ bool Function::IsTopLevelFunction() {
 }
 
 ConstString Function::GetDisplayName() const {
-  if (!m_mangled)
-return ConstString();
   return m_mangled.GetDisplayDemangledName(GetLanguage());
 }
 

Modified: lldb/trunk/source/Symbol/Symbol.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Symbol.cpp?rev=283491=283490=283491=diff
==
--- lldb/trunk/source/Symbol/Symbol.cpp (original)
+++ lldb/trunk/source/Symbol/Symbol.cpp Thu Oct  6 15:41:11 2016
@@ -117,8 +117,6 @@ bool Symbol::ValueIsAddress() const {
 }
 
 ConstString Symbol::GetDisplayName() const {
-  if (!m_mangled)
-return ConstString();
   return m_mangled.GetDisplayDemangledName(GetLanguage());
 }
 


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


[Lldb-commits] [PATCH] D25201: Fix GetDisplayName when only a demangled name is available

2016-10-06 Thread Francis Ricci via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL283491: Fix GetDisplayName when only a demangled name is 
available (authored by fjricci).

Changed prior to commit:
  https://reviews.llvm.org/D25201?vs=73307=73847#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D25201

Files:
  lldb/trunk/source/Symbol/Function.cpp
  lldb/trunk/source/Symbol/Symbol.cpp


Index: lldb/trunk/source/Symbol/Function.cpp
===
--- lldb/trunk/source/Symbol/Function.cpp
+++ lldb/trunk/source/Symbol/Function.cpp
@@ -347,8 +347,6 @@
 }
 
 ConstString Function::GetDisplayName() const {
-  if (!m_mangled)
-return ConstString();
   return m_mangled.GetDisplayDemangledName(GetLanguage());
 }
 
Index: lldb/trunk/source/Symbol/Symbol.cpp
===
--- lldb/trunk/source/Symbol/Symbol.cpp
+++ lldb/trunk/source/Symbol/Symbol.cpp
@@ -117,8 +117,6 @@
 }
 
 ConstString Symbol::GetDisplayName() const {
-  if (!m_mangled)
-return ConstString();
   return m_mangled.GetDisplayDemangledName(GetLanguage());
 }
 


Index: lldb/trunk/source/Symbol/Function.cpp
===
--- lldb/trunk/source/Symbol/Function.cpp
+++ lldb/trunk/source/Symbol/Function.cpp
@@ -347,8 +347,6 @@
 }
 
 ConstString Function::GetDisplayName() const {
-  if (!m_mangled)
-return ConstString();
   return m_mangled.GetDisplayDemangledName(GetLanguage());
 }
 
Index: lldb/trunk/source/Symbol/Symbol.cpp
===
--- lldb/trunk/source/Symbol/Symbol.cpp
+++ lldb/trunk/source/Symbol/Symbol.cpp
@@ -117,8 +117,6 @@
 }
 
 ConstString Symbol::GetDisplayName() const {
-  if (!m_mangled)
-return ConstString();
   return m_mangled.GetDisplayDemangledName(GetLanguage());
 }
 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D24988: Improvements to testing blacklist

2016-10-04 Thread Francis Ricci via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL283238: Improvements to testing blacklist (authored by 
fjricci).

Changed prior to commit:
  https://reviews.llvm.org/D24988?vs=73363=73525#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D24988

Files:
  lldb/trunk/packages/Python/lldbsuite/test/configuration.py
  lldb/trunk/packages/Python/lldbsuite/test/dotest.py
  lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py
  lldb/trunk/packages/Python/lldbsuite/test/test_result.py

Index: lldb/trunk/packages/Python/lldbsuite/test/test_result.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/test_result.py
+++ lldb/trunk/packages/Python/lldbsuite/test/test_result.py
@@ -18,8 +18,6 @@
 # Third-party modules
 import unittest2
 
-from unittest2.util import strclass
-
 # LLDB Modules
 from . import configuration
 from lldbsuite.test_event.event_builder import EventBuilder
@@ -139,8 +137,7 @@
 self.getCategoriesForTest(test)):
 self.hardMarkAsSkipped(test)
 if self.checkExclusion(
-configuration.skip_methods,
-test._testMethodName):
+configuration.skip_tests, test.id()):
 self.hardMarkAsSkipped(test)
 
 configuration.setCrashInfoHook(
@@ -161,11 +158,7 @@
 
 def addSuccess(self, test):
 if self.checkExclusion(
-configuration.xfail_files,
-strclass(
-test.__class__)) or self.checkExclusion(
-configuration.xfail_methods,
-test._testMethodName):
+configuration.xfail_tests, test.id()):
 self.addUnexpectedSuccess(test, None)
 return
 
@@ -239,11 +232,7 @@
 
 def addFailure(self, test, err):
 if self.checkExclusion(
-configuration.xfail_files,
-strclass(
-test.__class__)) or self.checkExclusion(
-configuration.xfail_methods,
-test._testMethodName):
+configuration.xfail_tests, test.id()):
 self.addExpectedFailure(test, err, None)
 return
 
Index: lldb/trunk/packages/Python/lldbsuite/test/configuration.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/configuration.py
+++ lldb/trunk/packages/Python/lldbsuite/test/configuration.py
@@ -102,10 +102,8 @@
 regexp = None
 
 # Sets of tests which are excluded at runtime
-skip_files = None
-skip_methods = None
-xfail_files = None
-xfail_methods = None
+skip_tests = None
+xfail_tests = None
 
 # By default, recorded session info for errored/failed test are dumped into its
 # own file under a session directory named after the timestamp of the test suite
Index: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/dotest.py
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py
@@ -216,33 +216,24 @@

 """
 excl_type = None
-case_type = None
 
 with open(exclusion_file) as f:
 for line in f:
+line = line.strip()
 if not excl_type:
-[excl_type, case_type] = line.split()
+excl_type = line
 continue
 
-line = line.strip()
 if not line:
 excl_type = None
-elif excl_type == 'skip' and case_type == 'files':
-if not configuration.skip_files:
-configuration.skip_files = []
-configuration.skip_files.append(line)
-elif excl_type == 'skip' and case_type == 'methods':
-if not configuration.skip_methods:
-configuration.skip_methods = []
-configuration.skip_methods.append(line)
-elif excl_type == 'xfail' and case_type == 'files':
-if not configuration.xfail_files:
-configuration.xfail_files = []
-configuration.xfail_files.append(line)
-elif excl_type == 'xfail' and case_type == 'methods':
-if not configuration.xfail_methods:
-configuration.xfail_methods = []
-configuration.xfail_methods.append(line)
+elif excl_type == 'skip':
+if not configuration.skip_tests:
+configuration.skip_tests = []
+configuration.skip_tests.append(line)
+elif excl_type == 'xfail':
+if not configuration.xfail_tests:
+configuration.xfail_tests = []
+configuration.xfail_tests.append(line)
 
 
 def parseOptionsAndInitTestdirs():
@@ -375,7 +366,8 @@
 lldbtest_config.lldbExec = os.path.realpath(args.executable)
 
 if args.excluded:
- 

[Lldb-commits] [lldb] r283238 - Improvements to testing blacklist

2016-10-04 Thread Francis Ricci via lldb-commits
Author: fjricci
Date: Tue Oct  4 13:48:00 2016
New Revision: 283238

URL: http://llvm.org/viewvc/llvm-project?rev=283238=rev
Log:
Improvements to testing blacklist

Summary:
This patch is necessary because individual test cases are not required
to have unique names. Therefore, test cases must now
be specified explicitly in the form ..
Because it works by regex matching, passing just  will
still disable an entire file.

This also allows for multiple exclusion files to be specified.

Reviewers: zturner, labath, jingham, tfiala

Subscribers: lldb-commits, sas

Differential Revision: https://reviews.llvm.org/D24988

Modified:
lldb/trunk/packages/Python/lldbsuite/test/configuration.py
lldb/trunk/packages/Python/lldbsuite/test/dotest.py
lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py
lldb/trunk/packages/Python/lldbsuite/test/test_result.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/configuration.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/configuration.py?rev=283238=283237=283238=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/configuration.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/configuration.py Tue Oct  4 
13:48:00 2016
@@ -102,10 +102,8 @@ parsable = False
 regexp = None
 
 # Sets of tests which are excluded at runtime
-skip_files = None
-skip_methods = None
-xfail_files = None
-xfail_methods = None
+skip_tests = None
+xfail_tests = None
 
 # By default, recorded session info for errored/failed test are dumped into its
 # own file under a session directory named after the timestamp of the test 
suite

Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest.py?rev=283238=283237=283238=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/dotest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py Tue Oct  4 13:48:00 2016
@@ -216,33 +216,24 @@ def parseExclusion(exclusion_file):

 """
 excl_type = None
-case_type = None
 
 with open(exclusion_file) as f:
 for line in f:
+line = line.strip()
 if not excl_type:
-[excl_type, case_type] = line.split()
+excl_type = line
 continue
 
-line = line.strip()
 if not line:
 excl_type = None
-elif excl_type == 'skip' and case_type == 'files':
-if not configuration.skip_files:
-configuration.skip_files = []
-configuration.skip_files.append(line)
-elif excl_type == 'skip' and case_type == 'methods':
-if not configuration.skip_methods:
-configuration.skip_methods = []
-configuration.skip_methods.append(line)
-elif excl_type == 'xfail' and case_type == 'files':
-if not configuration.xfail_files:
-configuration.xfail_files = []
-configuration.xfail_files.append(line)
-elif excl_type == 'xfail' and case_type == 'methods':
-if not configuration.xfail_methods:
-configuration.xfail_methods = []
-configuration.xfail_methods.append(line)
+elif excl_type == 'skip':
+if not configuration.skip_tests:
+configuration.skip_tests = []
+configuration.skip_tests.append(line)
+elif excl_type == 'xfail':
+if not configuration.xfail_tests:
+configuration.xfail_tests = []
+configuration.xfail_tests.append(line)
 
 
 def parseOptionsAndInitTestdirs():
@@ -375,7 +366,8 @@ def parseOptionsAndInitTestdirs():
 lldbtest_config.lldbExec = os.path.realpath(args.executable)
 
 if args.excluded:
-parseExclusion(args.excluded)
+for excl_file in args.excluded:
+parseExclusion(excl_file)
 
 if args.p:
 if args.p.startswith('-'):
@@ -799,8 +791,8 @@ def visit_file(dir, name):
 # We didn't match the regex, we're done.
 return
 
-if configuration.skip_files:
-for file_regexp in configuration.skip_files:
+if configuration.skip_tests:
+for file_regexp in configuration.skip_tests:
 if re.search(file_regexp, name):
 return
 

Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py?rev=283238=283237=283238=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py (original)
+++ 

[Lldb-commits] [PATCH] D24988: Improvements to testing blacklist

2016-10-03 Thread Francis Ricci via lldb-commits
fjricci updated this revision to Diff 73363.
fjricci added a comment.

Fix typo


https://reviews.llvm.org/D24988

Files:
  packages/Python/lldbsuite/test/configuration.py
  packages/Python/lldbsuite/test/dotest.py
  packages/Python/lldbsuite/test/dotest_args.py
  packages/Python/lldbsuite/test/test_result.py

Index: packages/Python/lldbsuite/test/test_result.py
===
--- packages/Python/lldbsuite/test/test_result.py
+++ packages/Python/lldbsuite/test/test_result.py
@@ -18,8 +18,6 @@
 # Third-party modules
 import unittest2
 
-from unittest2.util import strclass
-
 # LLDB Modules
 from . import configuration
 from lldbsuite.test_event.event_builder import EventBuilder
@@ -139,8 +137,7 @@
 self.getCategoriesForTest(test)):
 self.hardMarkAsSkipped(test)
 if self.checkExclusion(
-configuration.skip_methods,
-test._testMethodName):
+configuration.skip_tests, test.id()):
 self.hardMarkAsSkipped(test)
 
 configuration.setCrashInfoHook(
@@ -161,11 +158,7 @@
 
 def addSuccess(self, test):
 if self.checkExclusion(
-configuration.xfail_files,
-strclass(
-test.__class__)) or self.checkExclusion(
-configuration.xfail_methods,
-test._testMethodName):
+configuration.xfail_tests, test.id()):
 self.addUnexpectedSuccess(test, None)
 return
 
@@ -239,11 +232,7 @@
 
 def addFailure(self, test, err):
 if self.checkExclusion(
-configuration.xfail_files,
-strclass(
-test.__class__)) or self.checkExclusion(
-configuration.xfail_methods,
-test._testMethodName):
+configuration.xfail_tests, test.id()):
 self.addExpectedFailure(test, err, None)
 return
 
Index: packages/Python/lldbsuite/test/dotest_args.py
===
--- packages/Python/lldbsuite/test/dotest_args.py
+++ packages/Python/lldbsuite/test/dotest_args.py
@@ -96,7 +96,7 @@
 '-p',
 metavar='pattern',
 help='Specify a regexp filename pattern for inclusion in the test suite')
-group.add_argument('--excluded', metavar='exclusion-file', help=textwrap.dedent(
+group.add_argument('--excluded', metavar='exclusion-file', action='append', help=textwrap.dedent(
 '''Specify a file for tests to exclude. File should contain lists of regular expressions for test files or methods,
 with each list under a matching header (xfail files, xfail methods, skip files, skip methods)'''))
 group.add_argument(
Index: packages/Python/lldbsuite/test/dotest.py
===
--- packages/Python/lldbsuite/test/dotest.py
+++ packages/Python/lldbsuite/test/dotest.py
@@ -216,33 +216,24 @@

 """
 excl_type = None
-case_type = None
 
 with open(exclusion_file) as f:
 for line in f:
+line = line.strip()
 if not excl_type:
-[excl_type, case_type] = line.split()
+excl_type = line
 continue
 
-line = line.strip()
 if not line:
 excl_type = None
-elif excl_type == 'skip' and case_type == 'files':
-if not configuration.skip_files:
-configuration.skip_files = []
-configuration.skip_files.append(line)
-elif excl_type == 'skip' and case_type == 'methods':
-if not configuration.skip_methods:
-configuration.skip_methods = []
-configuration.skip_methods.append(line)
-elif excl_type == 'xfail' and case_type == 'files':
-if not configuration.xfail_files:
-configuration.xfail_files = []
-configuration.xfail_files.append(line)
-elif excl_type == 'xfail' and case_type == 'methods':
-if not configuration.xfail_methods:
-configuration.xfail_methods = []
-configuration.xfail_methods.append(line)
+elif excl_type == 'skip':
+if not configuration.skip_tests:
+configuration.skip_tests = []
+configuration.skip_tests.append(line)
+elif excl_type == 'xfail':
+if not configuration.xfail_tests:
+configuration.xfail_tests = []
+configuration.xfail_tests.append(line)
 
 
 def parseOptionsAndInitTestdirs():
@@ -375,7 +366,8 @@
 lldbtest_config.lldbExec = os.path.realpath(args.executable)
 
 if args.excluded:
-parseExclusion(args.excluded)
+for excl_file in args.excluded:
+  

[Lldb-commits] [PATCH] D24988: Improvements to testing blacklist

2016-10-03 Thread Francis Ricci via lldb-commits
fjricci updated this revision to Diff 73362.
fjricci added a comment.

Match against filename + test case + method name


https://reviews.llvm.org/D24988

Files:
  packages/Python/lldbsuite/test/configuration.py
  packages/Python/lldbsuite/test/dotest.py
  packages/Python/lldbsuite/test/dotest_args.py
  packages/Python/lldbsuite/test/test_result.py

Index: packages/Python/lldbsuite/test/test_result.py
===
--- packages/Python/lldbsuite/test/test_result.py
+++ packages/Python/lldbsuite/test/test_result.py
@@ -18,8 +18,6 @@
 # Third-party modules
 import unittest2
 
-from unittest2.util import strclass
-
 # LLDB Modules
 from . import configuration
 from lldbsuite.test_event.event_builder import EventBuilder
@@ -139,8 +137,7 @@
 self.getCategoriesForTest(test)):
 self.hardMarkAsSkipped(test)
 if self.checkExclusion(
-configuration.skip_methods,
-test._testMethodName):
+configuration.skip_tests, test.id()):
 self.hardMarkAsSkipped(test)
 
 configuration.setCrashInfoHook(
@@ -161,11 +158,7 @@
 
 def addSuccess(self, test):
 if self.checkExclusion(
-configuration.xfail_files,
-strclass(
-test.__class__)) or self.checkExclusion(
-configuration.xfail_methods,
-test._testMethodName):
+configuration.skip_tests, test.id()):
 self.addUnexpectedSuccess(test, None)
 return
 
@@ -239,11 +232,7 @@
 
 def addFailure(self, test, err):
 if self.checkExclusion(
-configuration.xfail_files,
-strclass(
-test.__class__)) or self.checkExclusion(
-configuration.xfail_methods,
-test._testMethodName):
+configuration.skip_tests, test.id()):
 self.addExpectedFailure(test, err, None)
 return
 
Index: packages/Python/lldbsuite/test/dotest_args.py
===
--- packages/Python/lldbsuite/test/dotest_args.py
+++ packages/Python/lldbsuite/test/dotest_args.py
@@ -96,7 +96,7 @@
 '-p',
 metavar='pattern',
 help='Specify a regexp filename pattern for inclusion in the test suite')
-group.add_argument('--excluded', metavar='exclusion-file', help=textwrap.dedent(
+group.add_argument('--excluded', metavar='exclusion-file', action='append', help=textwrap.dedent(
 '''Specify a file for tests to exclude. File should contain lists of regular expressions for test files or methods,
 with each list under a matching header (xfail files, xfail methods, skip files, skip methods)'''))
 group.add_argument(
Index: packages/Python/lldbsuite/test/dotest.py
===
--- packages/Python/lldbsuite/test/dotest.py
+++ packages/Python/lldbsuite/test/dotest.py
@@ -216,33 +216,24 @@

 """
 excl_type = None
-case_type = None
 
 with open(exclusion_file) as f:
 for line in f:
+line = line.strip()
 if not excl_type:
-[excl_type, case_type] = line.split()
+excl_type = line
 continue
 
-line = line.strip()
 if not line:
 excl_type = None
-elif excl_type == 'skip' and case_type == 'files':
-if not configuration.skip_files:
-configuration.skip_files = []
-configuration.skip_files.append(line)
-elif excl_type == 'skip' and case_type == 'methods':
-if not configuration.skip_methods:
-configuration.skip_methods = []
-configuration.skip_methods.append(line)
-elif excl_type == 'xfail' and case_type == 'files':
-if not configuration.xfail_files:
-configuration.xfail_files = []
-configuration.xfail_files.append(line)
-elif excl_type == 'xfail' and case_type == 'methods':
-if not configuration.xfail_methods:
-configuration.xfail_methods = []
-configuration.xfail_methods.append(line)
+elif excl_type == 'skip':
+if not configuration.skip_tests:
+configuration.skip_tests = []
+configuration.skip_tests.append(line)
+elif excl_type == 'xfail':
+if not configuration.xfail_tests:
+configuration.xfail_tests = []
+configuration.xfail_tests.append(line)
 
 
 def parseOptionsAndInitTestdirs():
@@ -375,7 +366,8 @@
 lldbtest_config.lldbExec = os.path.realpath(args.executable)
 
 if args.excluded:
-parseExclusion(args.excluded)
+for 

[Lldb-commits] [PATCH] D24988: Improvements to testing blacklist

2016-10-03 Thread Francis Ricci via lldb-commits
fjricci added a comment.

In https://reviews.llvm.org/D24988#559775, @tfiala wrote:

> In https://reviews.llvm.org/D24988#559314, @fjricci wrote:
>
> > For an example of something that couldn't be disabled with the original 
> > implementation, consider a test like:
> >
> > `CreateDuringStepTestCase.test_step_inst`
> >
> > Disabling by method name (`test_step_inst`) would also disable 
> > `CreateDuringInstructionStepTestCase.test_step_inst`.
>
>
> I see what you're saying there.
>
> The part you're missing is that the Test Case class name itself does not have 
> to be unique, either.  i.e. You *can* have two CreateDuringStepTestCase 
> classes in different files.  Nothing uniquifies at that level.


Ahh, I see. I didn't realize that we could have duplication in the test case 
names as well.

> That is why I'm saying you need to include the module name, which comes from 
> the filename, or have it be something like FileBaseName:TestCase.test_method. 
> I have to do this in the test runner architecture for this very reason. And 
> you will find at least some test cases that are cut and pasted and therefore 
> have duplicate test case names (at least, they used to exist, and nothing 
> enforces them being different in the runner logic).

I'll try this then.


https://reviews.llvm.org/D24988



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


[Lldb-commits] [PATCH] D24988: Improvements to testing blacklist

2016-10-03 Thread Francis Ricci via lldb-commits
fjricci added a comment.

For an example of something that couldn't be disabled with the original 
implementation, consider a test like:

`CreateDuringStepTestCase.test_step_inst`

Disabling by method name (`test_step_inst`) would also disable 
`CreateDuringInstructionStepTestCase.test_step_inst`.


https://reviews.llvm.org/D24988



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


[Lldb-commits] [PATCH] D24988: Improvements to testing blacklist

2016-10-03 Thread Francis Ricci via lldb-commits
fjricci added a comment.

The problem with the existing code is that file names are required to be 
unique, but method names are not. So if the user wants to disable an individual 
test method with a non-unique name, there is no way to do so. This patch still 
allows the tests to be disabled by file name, but removes the ability to 
disable by only method name, instead requiring the method name as a modifier to 
the file.

I may have used the wrong terminology when I said .. 
Here, I meant essentially what is printed by the test runner when a test fails. 
So, for example:

`BadAddressBreakpointTestCase.test_bad_address_breakpoints_dwarf`
`LldbGdbServerTestCase.test_Hc_then_Csignal_signals_correct_thread_launch_llgs`

These names are guaranteed to be unique, and so I think they're the better way 
to go. The user can still disable an entire file, by passing something 
something like:

`TestConcurrentEvents`


https://reviews.llvm.org/D24988



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


[Lldb-commits] [PATCH] D24988: Improvements to testing blacklist

2016-10-03 Thread Francis Ricci via lldb-commits
fjricci added a comment.

Since this is strictly an improvement and simplification, and won't break 
anyone's workflow because it's still a new feature, I'll plan on merging this 
tomorrow unless I hear any objections.


https://reviews.llvm.org/D24988



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


[Lldb-commits] [PATCH] D24988: Improvements to testing blacklist

2016-09-27 Thread Francis Ricci via lldb-commits
fjricci created this revision.
fjricci added reviewers: zturner, labath, tfiala, jingham.
fjricci added subscribers: sas, lldb-commits.

This patch is necessary because individual test cases are not required
to have unique names. Therefore, test cases must now
be specified explicitly in the form ..
Because it works by regex matching, passing just  will
still disable an entire file.

This also allows for multiple exclusion files to be specified.

https://reviews.llvm.org/D24988

Files:
  packages/Python/lldbsuite/test/configuration.py
  packages/Python/lldbsuite/test/dotest.py
  packages/Python/lldbsuite/test/dotest_args.py
  packages/Python/lldbsuite/test/test_result.py

Index: packages/Python/lldbsuite/test/test_result.py
===
--- packages/Python/lldbsuite/test/test_result.py
+++ packages/Python/lldbsuite/test/test_result.py
@@ -139,8 +139,8 @@
 self.getCategoriesForTest(test)):
 self.hardMarkAsSkipped(test)
 if self.checkExclusion(
-configuration.skip_methods,
-test._testMethodName):
+configuration.skip_tests,
+strclass(test.__class__) + '.' + test._testMethodName):
 self.hardMarkAsSkipped(test)
 
 configuration.setCrashInfoHook(
@@ -161,11 +161,8 @@
 
 def addSuccess(self, test):
 if self.checkExclusion(
-configuration.xfail_files,
-strclass(
-test.__class__)) or self.checkExclusion(
-configuration.xfail_methods,
-test._testMethodName):
+configuration.xfail_tests,
+strclass(test.__class__) + '.' + test._testMethodName):
 self.addUnexpectedSuccess(test, None)
 return
 
@@ -239,11 +236,8 @@
 
 def addFailure(self, test, err):
 if self.checkExclusion(
-configuration.xfail_files,
-strclass(
-test.__class__)) or self.checkExclusion(
-configuration.xfail_methods,
-test._testMethodName):
+configuration.xfail_tests,
+strclass(test.__class__) + '.' + test._testMethodName):
 self.addExpectedFailure(test, err, None)
 return
 
Index: packages/Python/lldbsuite/test/dotest_args.py
===
--- packages/Python/lldbsuite/test/dotest_args.py
+++ packages/Python/lldbsuite/test/dotest_args.py
@@ -96,7 +96,7 @@
 '-p',
 metavar='pattern',
 help='Specify a regexp filename pattern for inclusion in the test suite')
-group.add_argument('--excluded', metavar='exclusion-file', help=textwrap.dedent(
+group.add_argument('--excluded', metavar='exclusion-file', action='append', help=textwrap.dedent(
 '''Specify a file for tests to exclude. File should contain lists of regular expressions for test files or methods,
 with each list under a matching header (xfail files, xfail methods, skip files, skip methods)'''))
 group.add_argument(
Index: packages/Python/lldbsuite/test/dotest.py
===
--- packages/Python/lldbsuite/test/dotest.py
+++ packages/Python/lldbsuite/test/dotest.py
@@ -216,33 +216,24 @@

 """
 excl_type = None
-case_type = None
 
 with open(exclusion_file) as f:
 for line in f:
+line = line.strip()
 if not excl_type:
-[excl_type, case_type] = line.split()
+excl_type = line
 continue
 
-line = line.strip()
 if not line:
 excl_type = None
-elif excl_type == 'skip' and case_type == 'files':
-if not configuration.skip_files:
-configuration.skip_files = []
-configuration.skip_files.append(line)
-elif excl_type == 'skip' and case_type == 'methods':
-if not configuration.skip_methods:
-configuration.skip_methods = []
-configuration.skip_methods.append(line)
-elif excl_type == 'xfail' and case_type == 'files':
-if not configuration.xfail_files:
-configuration.xfail_files = []
-configuration.xfail_files.append(line)
-elif excl_type == 'xfail' and case_type == 'methods':
-if not configuration.xfail_methods:
-configuration.xfail_methods = []
-configuration.xfail_methods.append(line)
+elif excl_type == 'skip':
+if not configuration.skip_tests:
+configuration.skip_tests = []
+configuration.skip_tests.append(line)
+elif excl_type == 'xfail':
+if not configuration.xfail_tests:
+

[Lldb-commits] [lldb] r282298 - Allow for tests to be disabled at runtime

2016-09-23 Thread Francis Ricci via lldb-commits
Author: fjricci
Date: Fri Sep 23 16:32:47 2016
New Revision: 282298

URL: http://llvm.org/viewvc/llvm-project?rev=282298=rev
Log:
Allow for tests to be disabled at runtime

Summary:
The current implementation of the test suite allows the user to run
a certain subset of tests using '-p', but does not allow the inverse,
where a user wants to run all but some number of known failing tests.
Implement this functionality.

Reviewers: labath, zturner, tfiala

Subscribers: jingham, sas, lldb-commits

Differential Revision: https://reviews.llvm.org/D24629

Modified:
lldb/trunk/packages/Python/lldbsuite/test/configuration.py
lldb/trunk/packages/Python/lldbsuite/test/dotest.py
lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py
lldb/trunk/packages/Python/lldbsuite/test/test_result.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/configuration.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/configuration.py?rev=282298=282297=282298=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/configuration.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/configuration.py Fri Sep 23 
16:32:47 2016
@@ -101,6 +101,12 @@ parsable = False
 # our test cases.
 regexp = None
 
+# Sets of tests which are excluded at runtime
+skip_files = None
+skip_methods = None
+xfail_files = None
+xfail_methods = None
+
 # By default, recorded session info for errored/failed test are dumped into its
 # own file under a session directory named after the timestamp of the test 
suite
 # run.  Use '-s session-dir-name' to specify a specific dir name.

Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest.py?rev=282298=282297=282298=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/dotest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py Fri Sep 23 16:32:47 2016
@@ -26,6 +26,7 @@ import atexit
 import os
 import errno
 import platform
+import re
 import signal
 import socket
 import subprocess
@@ -202,6 +203,48 @@ o GDB_REMOTE_LOG: if defined, specifies
 sys.exit(0)
 
 
+def parseExclusion(exclusion_file):
+"""Parse an exclusion file, of the following format, where
+   'skip files', 'skip methods', 'xfail files', and 'xfail methods'
+   are the possible list heading values:
+
+   skip files
+   
+   
+
+   xfail methods
+   
+"""
+excl_type = None
+case_type = None
+
+with open(exclusion_file) as f:
+for line in f:
+if not excl_type:
+[excl_type, case_type] = line.split()
+continue
+
+line = line.strip()
+if not line:
+excl_type = None
+elif excl_type == 'skip' and case_type == 'files':
+if not configuration.skip_files:
+configuration.skip_files = []
+configuration.skip_files.append(line)
+elif excl_type == 'skip' and case_type == 'methods':
+if not configuration.skip_methods:
+configuration.skip_methods = []
+configuration.skip_methods.append(line)
+elif excl_type == 'xfail' and case_type == 'files':
+if not configuration.xfail_files:
+configuration.xfail_files = []
+configuration.xfail_files.append(line)
+elif excl_type == 'xfail' and case_type == 'methods':
+if not configuration.xfail_methods:
+configuration.xfail_methods = []
+configuration.xfail_methods.append(line)
+
+
 def parseOptionsAndInitTestdirs():
 """Initialize the list of directories containing our unittest scripts.
 
@@ -331,6 +374,9 @@ def parseOptionsAndInitTestdirs():
 if args.executable:
 lldbtest_config.lldbExec = os.path.realpath(args.executable)
 
+if args.excluded:
+parseExclusion(args.excluded)
+
 if args.p:
 if args.p.startswith('-'):
 usage(parser)
@@ -749,11 +795,15 @@ def setupSysPath():
 def visit_file(dir, name):
 # Try to match the regexp pattern, if specified.
 if configuration.regexp:
-import re
 if not re.search(configuration.regexp, name):
 # We didn't match the regex, we're done.
 return
 
+if configuration.skip_files:
+for file_regexp in configuration.skip_files:
+if re.search(file_regexp, name):
+return
+
 # We found a match for our test.  Add it to the suite.
 
 # Update the sys.path first.

Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py
URL: 

Re: [Lldb-commits] [PATCH] D24629: Allow for tests to be disabled at runtime

2016-09-23 Thread Francis Ricci via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL282298: Allow for tests to be disabled at runtime (authored 
by fjricci).

Changed prior to commit:
  https://reviews.llvm.org/D24629?vs=71651=72360#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D24629

Files:
  lldb/trunk/packages/Python/lldbsuite/test/configuration.py
  lldb/trunk/packages/Python/lldbsuite/test/dotest.py
  lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py
  lldb/trunk/packages/Python/lldbsuite/test/test_result.py

Index: lldb/trunk/packages/Python/lldbsuite/test/configuration.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/configuration.py
+++ lldb/trunk/packages/Python/lldbsuite/test/configuration.py
@@ -101,6 +101,12 @@
 # our test cases.
 regexp = None
 
+# Sets of tests which are excluded at runtime
+skip_files = None
+skip_methods = None
+xfail_files = None
+xfail_methods = None
+
 # By default, recorded session info for errored/failed test are dumped into its
 # own file under a session directory named after the timestamp of the test suite
 # run.  Use '-s session-dir-name' to specify a specific dir name.
Index: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/dotest.py
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py
@@ -26,6 +26,7 @@
 import os
 import errno
 import platform
+import re
 import signal
 import socket
 import subprocess
@@ -202,6 +203,48 @@
 sys.exit(0)
 
 
+def parseExclusion(exclusion_file):
+"""Parse an exclusion file, of the following format, where
+   'skip files', 'skip methods', 'xfail files', and 'xfail methods'
+   are the possible list heading values:
+
+   skip files
+   
+   
+
+   xfail methods
+   
+"""
+excl_type = None
+case_type = None
+
+with open(exclusion_file) as f:
+for line in f:
+if not excl_type:
+[excl_type, case_type] = line.split()
+continue
+
+line = line.strip()
+if not line:
+excl_type = None
+elif excl_type == 'skip' and case_type == 'files':
+if not configuration.skip_files:
+configuration.skip_files = []
+configuration.skip_files.append(line)
+elif excl_type == 'skip' and case_type == 'methods':
+if not configuration.skip_methods:
+configuration.skip_methods = []
+configuration.skip_methods.append(line)
+elif excl_type == 'xfail' and case_type == 'files':
+if not configuration.xfail_files:
+configuration.xfail_files = []
+configuration.xfail_files.append(line)
+elif excl_type == 'xfail' and case_type == 'methods':
+if not configuration.xfail_methods:
+configuration.xfail_methods = []
+configuration.xfail_methods.append(line)
+
+
 def parseOptionsAndInitTestdirs():
 """Initialize the list of directories containing our unittest scripts.
 
@@ -331,6 +374,9 @@
 if args.executable:
 lldbtest_config.lldbExec = os.path.realpath(args.executable)
 
+if args.excluded:
+parseExclusion(args.excluded)
+
 if args.p:
 if args.p.startswith('-'):
 usage(parser)
@@ -749,11 +795,15 @@
 def visit_file(dir, name):
 # Try to match the regexp pattern, if specified.
 if configuration.regexp:
-import re
 if not re.search(configuration.regexp, name):
 # We didn't match the regex, we're done.
 return
 
+if configuration.skip_files:
+for file_regexp in configuration.skip_files:
+if re.search(file_regexp, name):
+return
+
 # We found a match for our test.  Add it to the suite.
 
 # Update the sys.path first.
Index: lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py
@@ -96,6 +96,9 @@
 '-p',
 metavar='pattern',
 help='Specify a regexp filename pattern for inclusion in the test suite')
+group.add_argument('--excluded', metavar='exclusion-file', help=textwrap.dedent(
+'''Specify a file for tests to exclude. File should contain lists of regular expressions for test files or methods,
+with each list under a matching header (xfail files, xfail methods, skip files, skip methods)'''))
 group.add_argument(
 '-G',
 '--category',
Index: lldb/trunk/packages/Python/lldbsuite/test/test_result.py
===

Re: [Lldb-commits] [PATCH] D24629: Allow for tests to be disabled at runtime

2016-09-23 Thread Francis Ricci via lldb-commits
fjricci added a comment.

Ok. Barring objections from anyone else, I'll merge this later on today then, 
with the understanding that if it causes issues like the ones you describe, it 
should be reverted.


https://reviews.llvm.org/D24629



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


Re: [Lldb-commits] [PATCH] D24629: Allow for tests to be disabled at runtime

2016-09-23 Thread Francis Ricci via lldb-commits
fjricci added a comment.

In https://reviews.llvm.org/D24629#550823, @tfiala wrote:

> > > There is no reasonable thing we can base the expectation as the exact 
> > > same device with a different cpu revision could support watchpoints just 
> > > fine, so we could just define the list of these tests externally (in this 
> > > case, I would probably annotate them with the watchpoint category and 
> > > then do the skips based on categories instead).
>
> > 
>
>
> Tangential: most chips I've worked on that had hardware watchpoint support 
> had an instruction that could be called to find out if such a feature exists. 
>  I think ARM does this.  I would think we could expose an API that says 
> whether watchpoints are supported or not, and use that info in LLDB and the 
> test suite to enable or disable them.


I believe that PTRACE_GETHBPREGS with a value of 0 returns that hardware 
stoppoint info on arm, and the byte representing the number of available 
hardware watchpoints will be 0 if they aren't supported. Not sure if there's a 
simpler way.


https://reviews.llvm.org/D24629



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


Re: [Lldb-commits] [PATCH] D24629: Allow for tests to be disabled at runtime

2016-09-16 Thread Francis Ricci via lldb-commits
fjricci added a comment.

I do understand the complexity problem, and it was one of my concerns with this 
as well. For my cases, the complexity here is significantly less than the 
alternatives, but I also do understand if you don't think that's generally true.

It probably comes down to how often we think that people are running the test 
suite in cases where this sort of functionality would be useful. I don't really 
have a good sense for how other people tend to use the test suite, so I'm 
personally not sure.  For our case, it's a big deal, but if we're the only 
people who this patch helps, I know it doesn't make sense to merge it.


https://reviews.llvm.org/D24629



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


Re: [Lldb-commits] [PATCH] D24629: Allow for tests to be disabled at runtime

2016-09-16 Thread Francis Ricci via lldb-commits
fjricci updated this revision to Diff 71651.
fjricci added a comment.

Refactor re


https://reviews.llvm.org/D24629

Files:
  packages/Python/lldbsuite/test/configuration.py
  packages/Python/lldbsuite/test/dotest.py
  packages/Python/lldbsuite/test/dotest_args.py
  packages/Python/lldbsuite/test/test_result.py

Index: packages/Python/lldbsuite/test/test_result.py
===
--- packages/Python/lldbsuite/test/test_result.py
+++ packages/Python/lldbsuite/test/test_result.py
@@ -18,6 +18,8 @@
 # Third-party modules
 import unittest2
 
+from unittest2.util import strclass
+
 # LLDB Modules
 from . import configuration
 from lldbsuite.test_event.event_builder import EventBuilder
@@ -124,10 +126,23 @@
 test,
 test._testMethodName).__func__.__unittest_skip_why__ = "test case does not fall in any category of interest for this run"
 
+def checkExclusion(self, exclusion_list, name):
+if exclusion_list:
+import re
+for item in exclusion_list:
+if re.search(item, name):
+return True
+return False
+
 def startTest(self, test):
 if configuration.shouldSkipBecauseOfCategories(
 self.getCategoriesForTest(test)):
 self.hardMarkAsSkipped(test)
+if self.checkExclusion(
+configuration.skip_methods,
+test._testMethodName):
+self.hardMarkAsSkipped(test)
+
 configuration.setCrashInfoHook(
 "%s at %s" %
 (str(test), inspect.getfile(
@@ -145,6 +160,15 @@
 EventBuilder.event_for_start(test))
 
 def addSuccess(self, test):
+if self.checkExclusion(
+configuration.xfail_files,
+strclass(
+test.__class__)) or self.checkExclusion(
+configuration.xfail_methods,
+test._testMethodName):
+self.addUnexpectedSuccess(test, None)
+return
+
 super(LLDBTestResult, self).addSuccess(test)
 if configuration.parsable:
 self.stream.write(
@@ -214,6 +238,15 @@
 test, err))
 
 def addFailure(self, test, err):
+if self.checkExclusion(
+configuration.xfail_files,
+strclass(
+test.__class__)) or self.checkExclusion(
+configuration.xfail_methods,
+test._testMethodName):
+self.addExpectedFailure(test, err, None)
+return
+
 configuration.sdir_has_content = True
 super(LLDBTestResult, self).addFailure(test, err)
 method = getattr(test, "markFailure", None)
Index: packages/Python/lldbsuite/test/dotest_args.py
===
--- packages/Python/lldbsuite/test/dotest_args.py
+++ packages/Python/lldbsuite/test/dotest_args.py
@@ -96,6 +96,9 @@
 '-p',
 metavar='pattern',
 help='Specify a regexp filename pattern for inclusion in the test suite')
+group.add_argument('--excluded', metavar='exclusion-file', help=textwrap.dedent(
+'''Specify a file for tests to exclude. File should contain lists of regular expressions for test files or methods,
+with each list under a matching header (xfail files, xfail methods, skip files, skip methods)'''))
 group.add_argument(
 '-G',
 '--category',
Index: packages/Python/lldbsuite/test/dotest.py
===
--- packages/Python/lldbsuite/test/dotest.py
+++ packages/Python/lldbsuite/test/dotest.py
@@ -26,6 +26,7 @@
 import os
 import errno
 import platform
+import re
 import signal
 import socket
 import subprocess
@@ -202,6 +203,48 @@
 sys.exit(0)
 
 
+def parseExclusion(exclusion_file):
+"""Parse an exclusion file, of the following format, where
+   'skip files', 'skip methods', 'xfail files', and 'xfail methods'
+   are the possible list heading values:
+
+   skip files
+   
+   
+
+   xfail methods
+   
+"""
+excl_type = None
+case_type = None
+
+with open(exclusion_file) as f:
+for line in f:
+if not excl_type:
+[excl_type, case_type] = line.split()
+continue
+
+line = line.strip()
+if not line:
+excl_type = None
+elif excl_type == 'skip' and case_type == 'files':
+if not configuration.skip_files:
+configuration.skip_files = []
+configuration.skip_files.append(line)
+elif excl_type == 'skip' and case_type == 'methods':
+if not configuration.skip_methods:
+configuration.skip_methods = []
+configuration.skip_methods.append(line)
+elif excl_type == 'xfail' 

Re: [Lldb-commits] [PATCH] D24629: Allow for tests to be disabled at runtime

2016-09-15 Thread Francis Ricci via lldb-commits
fjricci added a comment.

The issue is that you can only commit a patch to xfail a test that fails when 
you run the test suite on master with no local changes.

The problem is that if you run into test failures on other branches or in 
unconventional configurations, there is no good way to disable failing tests, 
other than carrying local patches to xfail the tests which fail. Carrying these 
sorts of local patches is tedious, prone to breakages, and requires many manual 
changes whenever test suite sources changes.

I'm particular, we run into this with ds2, since it fails some tests passed by 
lldb-server (and passes some tests xfail-ed by lldb-server).

I also find that I fail different tests on master (with lldb-server) between 
Ubuntu and CentOS, for example, and I'm not sure that it makes sense to xfail 
in those cases.


https://reviews.llvm.org/D24629



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


[Lldb-commits] [PATCH] D24629: Allow for tests to be disabled at runtime

2016-09-15 Thread Francis Ricci via lldb-commits
fjricci created this revision.
fjricci added reviewers: zturner, labath, tfiala.
fjricci added subscribers: lldb-commits, sas.

The current implementation of the test suite allows the user to run
a certain subset of tests using '-p', but does not allow the inverse,
where a user wants to run all but some number of known failing tests.
Implement this functionality.

https://reviews.llvm.org/D24629

Files:
  packages/Python/lldbsuite/test/configuration.py
  packages/Python/lldbsuite/test/dotest.py
  packages/Python/lldbsuite/test/dotest_args.py
  packages/Python/lldbsuite/test/test_result.py

Index: packages/Python/lldbsuite/test/test_result.py
===
--- packages/Python/lldbsuite/test/test_result.py
+++ packages/Python/lldbsuite/test/test_result.py
@@ -18,6 +18,8 @@
 # Third-party modules
 import unittest2
 
+from unittest2.util import strclass
+
 # LLDB Modules
 from . import configuration
 from lldbsuite.test_event.event_builder import EventBuilder
@@ -124,10 +126,23 @@
 test,
 test._testMethodName).__func__.__unittest_skip_why__ = "test case does not fall in any category of interest for this run"
 
+def checkExclusion(self, exclusion_list, name):
+if exclusion_list:
+import re
+for item in exclusion_list:
+if re.search(item, name):
+return True
+return False
+
 def startTest(self, test):
 if configuration.shouldSkipBecauseOfCategories(
 self.getCategoriesForTest(test)):
 self.hardMarkAsSkipped(test)
+if self.checkExclusion(
+configuration.skip_methods,
+test._testMethodName):
+self.hardMarkAsSkipped(test)
+
 configuration.setCrashInfoHook(
 "%s at %s" %
 (str(test), inspect.getfile(
@@ -145,6 +160,15 @@
 EventBuilder.event_for_start(test))
 
 def addSuccess(self, test):
+if self.checkExclusion(
+configuration.xfail_files,
+strclass(
+test.__class__)) or self.checkExclusion(
+configuration.xfail_methods,
+test._testMethodName):
+self.addUnexpectedSuccess(test, None)
+return
+
 super(LLDBTestResult, self).addSuccess(test)
 if configuration.parsable:
 self.stream.write(
@@ -214,6 +238,15 @@
 test, err))
 
 def addFailure(self, test, err):
+if self.checkExclusion(
+configuration.xfail_files,
+strclass(
+test.__class__)) or self.checkExclusion(
+configuration.xfail_methods,
+test._testMethodName):
+self.addExpectedFailure(test, err, None)
+return
+
 configuration.sdir_has_content = True
 super(LLDBTestResult, self).addFailure(test, err)
 method = getattr(test, "markFailure", None)
Index: packages/Python/lldbsuite/test/dotest_args.py
===
--- packages/Python/lldbsuite/test/dotest_args.py
+++ packages/Python/lldbsuite/test/dotest_args.py
@@ -96,6 +96,9 @@
 '-p',
 metavar='pattern',
 help='Specify a regexp filename pattern for inclusion in the test suite')
+group.add_argument('--excluded', metavar='exclusion-file', help=textwrap.dedent(
+'''Specify a file for tests to exclude. File should contain lists of regular expressions for test files or methods,
+with each list under a matching header (xfail files, xfail methods, skip files, skip methods)'''))
 group.add_argument(
 '-G',
 '--category',
Index: packages/Python/lldbsuite/test/dotest.py
===
--- packages/Python/lldbsuite/test/dotest.py
+++ packages/Python/lldbsuite/test/dotest.py
@@ -202,6 +202,48 @@
 sys.exit(0)
 
 
+def parseExclusion(exclusion_file):
+"""Parse an exclusion file, of the following format, where
+   'skip files', 'skip methods', 'xfail files', and 'xfail methods'
+   are the possible list heading values:
+
+   skip files
+   
+   
+
+   xfail methods
+   
+"""
+excl_type = None
+case_type = None
+
+with open(exclusion_file) as f:
+for line in f:
+if not excl_type:
+[excl_type, case_type] = line.split()
+continue
+
+line = line.strip()
+if not line:
+excl_type = None
+elif excl_type == 'skip' and case_type == 'files':
+if not configuration.skip_files:
+configuration.skip_files = []
+configuration.skip_files.append(line)
+elif excl_type == 'skip' and case_type == 'methods':
+if not 

[Lldb-commits] [lldb] r276166 - Fix typo in test runner

2016-07-20 Thread Francis Ricci via lldb-commits
Author: fjricci
Date: Wed Jul 20 14:37:31 2016
New Revision: 276166

URL: http://llvm.org/viewvc/llvm-project?rev=276166=rev
Log:
Fix typo in test runner

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

Modified: lldb/trunk/packages/Python/lldbsuite/test/decorators.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/decorators.py?rev=276166=276165=276166=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/decorators.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/decorators.py Wed Jul 20 14:37:31 
2016
@@ -486,7 +486,7 @@ def skipUnlessPlatform(oslist):
 # This decorator cannot be ported to `skipIf` yet because it is used on 
entire
 # classes, which `skipIf` explicitly forbids.
 return unittest2.skipUnless(lldbplatformutil.getPlatform() in oslist,
-"requires on of %s" % (", ".join(oslist)))
+"requires one of %s" % (", ".join(oslist)))
 
 def skipIfTargetAndroid(api_levels=None, archs=None):
 """Decorator to skip tests when the target is Android.


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


Re: [Lldb-commits] [PATCH] D22294: Add functionality for rewriting symbols

2016-07-13 Thread Francis Ricci via lldb-commits
fjricci added a comment.

@clayborg: As you saw when running the test with debug info enabled, we might 
end up calling the non-rewritten `putchar()`, which is due to the compiler 
emitting debug symbols with the non-rewritten name. The `-g0` option is just a 
workaround until we can fix that.

I suppose Adrian Prantl's idea of modifying the emitted DWARF to add a linkage 
name attached to the function would work. Does that mean we would only add an 
entry for the rewritten symbol when lldb parses the DWARF, and ignore the 
non-rewritten function name?


http://reviews.llvm.org/D22294



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


Re: [Lldb-commits] [PATCH] D22294: Add functionality for rewriting symbols

2016-07-13 Thread Francis Ricci via lldb-commits
fjricci updated this revision to Diff 63816.
fjricci marked an inline comment as done.
fjricci added a comment.

Fix const SP and update unit test

Will now only run the unit test as a dwarf test (with -g0),
but since we don't want to test the debug data anyway,
this shouldn't be an issue, and avoids the use of strip.


http://reviews.llvm.org/D22294

Files:
  include/lldb/Core/Module.h
  include/lldb/Core/ModuleList.h
  include/lldb/Symbol/SymbolRewriter.h
  include/lldb/Symbol/Symtab.h
  include/lldb/Target/Target.h
  include/lldb/lldb-forward.h
  lldb.xcodeproj/project.pbxproj
  packages/Python/lldbsuite/test/lang/c/symbol_rewriter/Makefile
  packages/Python/lldbsuite/test/lang/c/symbol_rewriter/TestSymbolRewriter.py
  packages/Python/lldbsuite/test/lang/c/symbol_rewriter/main.c
  packages/Python/lldbsuite/test/lang/c/symbol_rewriter/rewrite.map
  source/API/SBModule.cpp
  source/API/SBTarget.cpp
  source/Breakpoint/BreakpointResolverName.cpp
  source/Commands/CommandObjectSource.cpp
  source/Commands/CommandObjectTarget.cpp
  source/Core/AddressResolverName.cpp
  source/Core/Disassembler.cpp
  source/Core/Module.cpp
  source/Core/ModuleList.cpp
  source/Core/SourceManager.cpp
  source/Expression/IRExecutionUnit.cpp
  source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
  source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp
  source/Plugins/DynamicLoader/Hexagon-DYLD/HexagonDYLDRendezvous.cpp
  source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
  source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
  source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
  source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
  source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
  
source/Plugins/InstrumentationRuntime/AddressSanitizer/AddressSanitizerRuntime.cpp
  
source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp
  source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp
  source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
  source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp
  source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
  
source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp
  
source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
  source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp
  source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
  source/Plugins/Process/Utility/InferiorCallPOSIX.cpp
  source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
  source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp
  source/Symbol/CMakeLists.txt
  source/Symbol/Symbol.cpp
  source/Symbol/SymbolRewriter.cpp
  source/Symbol/Symtab.cpp
  source/Target/ObjCLanguageRuntime.cpp
  source/Target/Target.cpp

Index: source/Target/Target.cpp
===
--- source/Target/Target.cpp
+++ source/Target/Target.cpp
@@ -78,6 +78,7 @@
   m_mutex(),
   m_arch(target_arch),
   m_images(this),
+  m_symbol_rewriter(),
   m_section_load_history(),
   m_breakpoint_list(false),
   m_internal_breakpoint_list(true),
Index: source/Target/ObjCLanguageRuntime.cpp
===
--- source/Target/ObjCLanguageRuntime.cpp
+++ source/Target/ObjCLanguageRuntime.cpp
@@ -105,6 +105,7 @@
 
 SymbolContextList sc_list;
 const size_t matching_symbols = modules.FindSymbolsWithNameAndType (name,
+m_process->GetTarget().GetSymbolRewriter(),
 eSymbolTypeObjCClass,
 sc_list);
 
Index: source/Symbol/Symtab.cpp
===
--- source/Symbol/Symtab.cpp
+++ source/Symbol/Symtab.cpp
@@ -18,6 +18,7 @@
 #include "lldb/Symbol/ObjectFile.h"
 #include "lldb/Symbol/Symbol.h"
 #include "lldb/Symbol/SymbolContext.h"
+#include "lldb/Symbol/SymbolRewriter.h"
 #include "lldb/Symbol/Symtab.h"
 #include "Plugins/Language/ObjC/ObjCLanguage.h"
 #include "Plugins/Language/CPlusPlus/CPlusPlusLanguage.h"
@@ -806,11 +807,14 @@
 }
 
 size_t
-Symtab::FindAllSymbolsWithNameAndType (const ConstString , SymbolType symbol_type, std::vector& symbol_indexes)
+Symtab::FindAllSymbolsWithNameAndType (const ConstString , const SymbolRewriterSP , SymbolType symbol_type, std::vector& symbol_indexes)
 {
 std::lock_guard guard(m_mutex);
 
 Timer scoped_timer (__PRETTY_FUNCTION__, "%s", __PRETTY_FUNCTION__);
+
+ConstString rewrittenName = RewriteName(rewriter, name);
+
 // Initialize all of the lookup 

Re: [Lldb-commits] [PATCH] D22294: Add functionality for rewriting symbols

2016-07-13 Thread Francis Ricci via lldb-commits
fjricci marked 3 inline comments as done.


Comment at: 
packages/Python/lldbsuite/test/lang/c/symbol_rewriter/TestSymbolRewriter.py:28
@@ +27,3 @@
+# Clang does not rewrite dwarf debug info, so it must be stripped
+subprocess.check_call(['strip', '-g', exe])
+

labath wrote:
> This is not going to work for remote targets on different architectures. If 
> you don't need debug info, could you just avoid generating it in the first 
> place (-g0 ?). Maybe then you would be able to get this working on windows as 
> well.
> If it doesn't work, then we should wire up this call to go through the 
> Makefile, as it already knows how to find the right toolchain for 
> cross-compilation.
Unfortunately, the '-g0' override will only work for dwarf tests. However, 
based on TestWithLimitDebugInfo, it looks like we can skip the test for 
non-dwarf symbols (`@skipIf(debug_info=no_match(["dwarf"]))`). I think this is 
probably the cleanest way to go.


http://reviews.llvm.org/D22294



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


[Lldb-commits] [PATCH] D22294: Add functionality for rewriting symbols

2016-07-12 Thread Francis Ricci via lldb-commits
fjricci created this revision.
fjricci added reviewers: clayborg, lattner.
fjricci added subscribers: sas, lldb-commits.
Herald added a subscriber: kubabrecka.

Clang supports symbol rewrites via the -frewrite-map-file flag,
this patch adds complementary functionality in lldb.

Re-written symbols are required when, for example, two versions of the
same library are linked to the same binary, and the user needs to
differentiate the symbols.

The SymbolRewriter implemented in this patch will use a rewrite map
provided via the 'target symbols rewrite' command to lookup the original
symbol names instead of the names re-written by clang.

http://reviews.llvm.org/D22294

Files:
  include/lldb/Core/Module.h
  include/lldb/Core/ModuleList.h
  include/lldb/Symbol/SymbolRewriter.h
  include/lldb/Symbol/Symtab.h
  include/lldb/Target/Target.h
  include/lldb/lldb-forward.h
  lldb.xcodeproj/project.pbxproj
  packages/Python/lldbsuite/test/lang/c/symbol_rewriter/Makefile
  packages/Python/lldbsuite/test/lang/c/symbol_rewriter/TestSymbolRewriter.py
  packages/Python/lldbsuite/test/lang/c/symbol_rewriter/main.c
  packages/Python/lldbsuite/test/lang/c/symbol_rewriter/rewrite.map
  source/API/SBModule.cpp
  source/API/SBTarget.cpp
  source/Breakpoint/BreakpointResolverName.cpp
  source/Commands/CommandObjectSource.cpp
  source/Commands/CommandObjectTarget.cpp
  source/Core/AddressResolverName.cpp
  source/Core/Disassembler.cpp
  source/Core/Module.cpp
  source/Core/ModuleList.cpp
  source/Core/SourceManager.cpp
  source/Expression/IRExecutionUnit.cpp
  source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
  source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp
  source/Plugins/DynamicLoader/Hexagon-DYLD/HexagonDYLDRendezvous.cpp
  source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
  source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
  source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
  source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
  source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
  
source/Plugins/InstrumentationRuntime/AddressSanitizer/AddressSanitizerRuntime.cpp
  
source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp
  source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp
  source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
  source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp
  source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
  
source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp
  
source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
  source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp
  source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
  source/Plugins/Process/Utility/InferiorCallPOSIX.cpp
  source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
  source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp
  source/Symbol/CMakeLists.txt
  source/Symbol/Symbol.cpp
  source/Symbol/SymbolRewriter.cpp
  source/Symbol/Symtab.cpp
  source/Target/ObjCLanguageRuntime.cpp
  source/Target/Target.cpp

Index: source/Target/Target.cpp
===
--- source/Target/Target.cpp
+++ source/Target/Target.cpp
@@ -78,6 +78,7 @@
   m_mutex(),
   m_arch(target_arch),
   m_images(this),
+  m_symbol_rewriter(),
   m_section_load_history(),
   m_breakpoint_list(false),
   m_internal_breakpoint_list(true),
Index: source/Target/ObjCLanguageRuntime.cpp
===
--- source/Target/ObjCLanguageRuntime.cpp
+++ source/Target/ObjCLanguageRuntime.cpp
@@ -105,6 +105,7 @@
 
 SymbolContextList sc_list;
 const size_t matching_symbols = modules.FindSymbolsWithNameAndType (name,
+m_process->GetTarget().GetSymbolRewriter(),
 eSymbolTypeObjCClass,
 sc_list);
 
Index: source/Symbol/Symtab.cpp
===
--- source/Symbol/Symtab.cpp
+++ source/Symbol/Symtab.cpp
@@ -18,6 +18,7 @@
 #include "lldb/Symbol/ObjectFile.h"
 #include "lldb/Symbol/Symbol.h"
 #include "lldb/Symbol/SymbolContext.h"
+#include "lldb/Symbol/SymbolRewriter.h"
 #include "lldb/Symbol/Symtab.h"
 #include "Plugins/Language/ObjC/ObjCLanguage.h"
 #include "Plugins/Language/CPlusPlus/CPlusPlusLanguage.h"
@@ -806,11 +807,14 @@
 }
 
 size_t
-Symtab::FindAllSymbolsWithNameAndType (const ConstString , SymbolType symbol_type, std::vector& symbol_indexes)

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=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


[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=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=274363=274364=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


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

2016-06-30 Thread Francis Ricci via lldb-commits
fjricci created this revision.
fjricci added reviewers: clayborg, zturner, spyffe.
fjricci added a subscriber: lldb-commits.

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).

http://reviews.llvm.org/D21906

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

Index: 
packages/Python/lldbsuite/test/python_api/disassemble-raw-data/TestDisassembleRawData.py
===
--- 
packages/Python/lldbsuite/test/python_api/disassemble-raw-data/TestDisassembleRawData.py
+++ 
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: packages/Python/lldbsuite/test/python_api/disassemble-raw-data/TestDisassembleRawData.py
===
--- packages/Python/lldbsuite/test/python_api/disassemble-raw-data/TestDisassembleRawData.py
+++ 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] D21648: Don't run TestImageListMultiArchitecture during remote test suite

2016-06-24 Thread Francis Ricci via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL273720: Don't run TestImageListMultiArchitecture during 
remote test suite (authored by fjricci).

Changed prior to commit:
  http://reviews.llvm.org/D21648?vs=61803=61831#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D21648

Files:
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/object-file/TestImageListMultiArchitecture.py

Index: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/object-file/TestImageListMultiArchitecture.py
===
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/object-file/TestImageListMultiArchitecture.py
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/object-file/TestImageListMultiArchitecture.py
@@ -21,6 +21,7 @@
 mydir = TestBase.compute_mydir(__file__)
 
 @no_debug_info_test
+@skipIfRemote
 def test_image_list_shows_multiple_architectures(self):
 """Test that image list properly shows the correct architecture for a 
set of different architecture object files."""
 images = {


Index: lldb/trunk/packages/Python/lldbsuite/test/functionalities/object-file/TestImageListMultiArchitecture.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/object-file/TestImageListMultiArchitecture.py
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/object-file/TestImageListMultiArchitecture.py
@@ -21,6 +21,7 @@
 mydir = TestBase.compute_mydir(__file__)
 
 @no_debug_info_test
+@skipIfRemote
 def test_image_list_shows_multiple_architectures(self):
 """Test that image list properly shows the correct architecture for a set of different architecture object files."""
 images = {
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r273720 - Don't run TestImageListMultiArchitecture during remote test suite

2016-06-24 Thread Francis Ricci via lldb-commits
Author: fjricci
Date: Fri Jun 24 15:44:23 2016
New Revision: 273720

URL: http://llvm.org/viewvc/llvm-project?rev=273720=rev
Log:
Don't run TestImageListMultiArchitecture during remote test suite

Reviewers: zturner, clayborg, tfiala

Subscribers: sas, lldb-commits

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

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/object-file/TestImageListMultiArchitecture.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/object-file/TestImageListMultiArchitecture.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/object-file/TestImageListMultiArchitecture.py?rev=273720=273719=273720=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/object-file/TestImageListMultiArchitecture.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/object-file/TestImageListMultiArchitecture.py
 Fri Jun 24 15:44:23 2016
@@ -21,6 +21,7 @@ class TestImageListMultiArchitecture(Tes
 mydir = TestBase.compute_mydir(__file__)
 
 @no_debug_info_test
+@skipIfRemote
 def test_image_list_shows_multiple_architectures(self):
 """Test that image list properly shows the correct architecture for a 
set of different architecture object files."""
 images = {


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


Re: [Lldb-commits] [PATCH] D21648: Make sure to reset to correct platform after TestImageListMultiArchitecture

2016-06-24 Thread Francis Ricci via lldb-commits
fjricci updated this revision to Diff 61803.
fjricci added a comment.
This revision is now accepted and ready to land.

Skip test on remote platforms


http://reviews.llvm.org/D21648

Files:
  
packages/Python/lldbsuite/test/functionalities/object-file/TestImageListMultiArchitecture.py

Index: 
packages/Python/lldbsuite/test/functionalities/object-file/TestImageListMultiArchitecture.py
===
--- 
packages/Python/lldbsuite/test/functionalities/object-file/TestImageListMultiArchitecture.py
+++ 
packages/Python/lldbsuite/test/functionalities/object-file/TestImageListMultiArchitecture.py
@@ -21,6 +21,7 @@
 mydir = TestBase.compute_mydir(__file__)
 
 @no_debug_info_test
+@skipIfRemote
 def test_image_list_shows_multiple_architectures(self):
 """Test that image list properly shows the correct architecture for a 
set of different architecture object files."""
 images = {


Index: packages/Python/lldbsuite/test/functionalities/object-file/TestImageListMultiArchitecture.py
===
--- packages/Python/lldbsuite/test/functionalities/object-file/TestImageListMultiArchitecture.py
+++ packages/Python/lldbsuite/test/functionalities/object-file/TestImageListMultiArchitecture.py
@@ -21,6 +21,7 @@
 mydir = TestBase.compute_mydir(__file__)
 
 @no_debug_info_test
+@skipIfRemote
 def test_image_list_shows_multiple_architectures(self):
 """Test that image list properly shows the correct architecture for a set of different architecture object files."""
 images = {
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D21648: Make sure to reset to correct platform after TestImageListMultiArchitecture

2016-06-23 Thread Francis Ricci via lldb-commits
fjricci planned changes to this revision.
fjricci added a comment.

That's reasonable, will do.


http://reviews.llvm.org/D21648



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


Re: [Lldb-commits] [PATCH] D21648: Make sure to reset to correct platform after TestImageListMultiArchitecture

2016-06-23 Thread Francis Ricci via lldb-commits
fjricci added a comment.

I was wondering that as well. I thought there might be some value to testing 
that the "disconnect->change platform->reconnect" path worked though. I have no 
problem disabling if that doesn't seem useful though.


http://reviews.llvm.org/D21648



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


Re: [Lldb-commits] [PATCH] D21648: Make sure to reset to correct platform after TestImageListMultiArchitecture

2016-06-23 Thread Francis Ricci via lldb-commits
fjricci updated this revision to Diff 61717.
fjricci added a comment.
This revision is now accepted and ready to land.

Disconnect from existing platform connection to prevent extra hanging 
connections

This is good practice on all debug servers, and required for debug servers which
can't handle more than one simultaneous platform mode connection.


http://reviews.llvm.org/D21648

Files:
  
packages/Python/lldbsuite/test/functionalities/object-file/TestImageListMultiArchitecture.py

Index: 
packages/Python/lldbsuite/test/functionalities/object-file/TestImageListMultiArchitecture.py
===
--- 
packages/Python/lldbsuite/test/functionalities/object-file/TestImageListMultiArchitecture.py
+++ 
packages/Python/lldbsuite/test/functionalities/object-file/TestImageListMultiArchitecture.py
@@ -23,6 +23,10 @@
 @no_debug_info_test
 def test_image_list_shows_multiple_architectures(self):
 """Test that image list properly shows the correct architecture for a 
set of different architecture object files."""
+# Don't leave residual open platform connections
+if lldb.remote_platform:
+lldb.remote_platform.DisconnectRemote()
+
 images = {
 "hello-freebsd-10.0-x86_64-clang-3.3": 
re.compile(r"x86_64-(\*)?-freebsd10.0(-unknown)? x86_64"),
 "hello-freebsd-10.0-x86_64-gcc-4.7.3": 
re.compile(r"x86_64-(\*)?-freebsd10.0(-unknown)? x86_64"),
@@ -39,5 +43,11 @@
 
 self.runCmd("file {}".format(file_name))
 self.match("image list -t -A", [expected_triple_and_arch_regex])
-# Revert to the host platform after all of this is done
-self.runCmd("platform select host")
+
+# Revert to the original platform after all of this is done
+if lldb.remote_platform:
+platform_connect_options = 
lldb.SBPlatformConnectOptions(configuration.lldb_platform_url)
+err = lldb.remote_platform.ConnectRemote(platform_connect_options)
+self.assertTrue(err.Success())
+else:
+self.runCmd("platform select host")


Index: packages/Python/lldbsuite/test/functionalities/object-file/TestImageListMultiArchitecture.py
===
--- packages/Python/lldbsuite/test/functionalities/object-file/TestImageListMultiArchitecture.py
+++ packages/Python/lldbsuite/test/functionalities/object-file/TestImageListMultiArchitecture.py
@@ -23,6 +23,10 @@
 @no_debug_info_test
 def test_image_list_shows_multiple_architectures(self):
 """Test that image list properly shows the correct architecture for a set of different architecture object files."""
+# Don't leave residual open platform connections
+if lldb.remote_platform:
+lldb.remote_platform.DisconnectRemote()
+
 images = {
 "hello-freebsd-10.0-x86_64-clang-3.3": re.compile(r"x86_64-(\*)?-freebsd10.0(-unknown)? x86_64"),
 "hello-freebsd-10.0-x86_64-gcc-4.7.3": re.compile(r"x86_64-(\*)?-freebsd10.0(-unknown)? x86_64"),
@@ -39,5 +43,11 @@
 
 self.runCmd("file {}".format(file_name))
 self.match("image list -t -A", [expected_triple_and_arch_regex])
-# Revert to the host platform after all of this is done
-self.runCmd("platform select host")
+
+# Revert to the original platform after all of this is done
+if lldb.remote_platform:
+platform_connect_options = lldb.SBPlatformConnectOptions(configuration.lldb_platform_url)
+err = lldb.remote_platform.ConnectRemote(platform_connect_options)
+self.assertTrue(err.Success())
+else:
+self.runCmd("platform select host")
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D21648: Make sure to reset to correct platform after TestImageListMultiArchitecture

2016-06-23 Thread Francis Ricci via lldb-commits
fjricci planned changes to this revision.
fjricci added a comment.

This fix does not work without something along the lines of 
http://reviews.llvm.org/D21649, I'll re-upload with a better fix.


http://reviews.llvm.org/D21648



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


Re: [Lldb-commits] [PATCH] D21649: Don't create unnecessary remote platforms

2016-06-23 Thread Francis Ricci via lldb-commits
fjricci abandoned this revision.
fjricci added a comment.

I don't think that we can assume that the user always wants to re-use an 
existing platform, even of the same type. Probably the only way to resolve the 
problem this tries to fix would be to add a command to display all connected 
platforms, and an option to "platform select" to choose an existing platform to 
connect to. But that's outside the scope of this patch, and a bit of a design 
decision.


http://reviews.llvm.org/D21649



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


Re: [Lldb-commits] [PATCH] D21649: Don't create unnecessary remote platforms

2016-06-23 Thread Francis Ricci via lldb-commits
fjricci added a comment.

Although, given your comments about the ios platforms, IsConnected() doesn't 
seem like the right API to use anyway...


http://reviews.llvm.org/D21649



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


Re: [Lldb-commits] [PATCH] D21649: Don't create unnecessary remote platforms

2016-06-23 Thread Francis Ricci via lldb-commits
fjricci added a comment.

As I'm poking through the APIs, I found that platform_sp->IsConnected() will 
return true even if the remote server has been killed since connecting (at 
least on remote-linux with lldb-server in platform mode). Is this the expected 
behavior of that set of functions?


http://reviews.llvm.org/D21649



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


Re: [Lldb-commits] [PATCH] D21649: Don't create unnecessary remote platforms

2016-06-23 Thread Francis Ricci via lldb-commits
fjricci planned changes to this revision.
fjricci added a comment.

This will fail in the case where the remote-platform server dies, as lldb will 
not cleanup its data structures. I'll investigate how to make sure the platform 
is alive before connecting to it.


http://reviews.llvm.org/D21649



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


[Lldb-commits] [PATCH] D21649: Don't create unnecessary remote platforms

2016-06-23 Thread Francis Ricci via lldb-commits
fjricci created this revision.
fjricci added reviewers: clayborg, jingham, vharron.
fjricci added subscribers: sas, lldb-commits.

When using 'platform select', re-use an existing platform
which matches the remote platform specs, rather than creating a new one.

Without this patch, repeating the following sequence of commands will generate a
large number of platforms which are unused (and inaccessible):
platform select remote-linux
platform connect 
platform select host
platform select remote-linux

http://reviews.llvm.org/D21649

Files:
  source/Commands/CommandObjectPlatform.cpp

Index: source/Commands/CommandObjectPlatform.cpp
===
--- source/Commands/CommandObjectPlatform.cpp
+++ source/Commands/CommandObjectPlatform.cpp
@@ -237,20 +237,41 @@
 {
 const bool select = true;
 m_platform_options.SetPlatformName (platform_name);
-Error error;
-ArchSpec platform_arch;
-PlatformSP platform_sp 
(m_platform_options.CreatePlatformWithOptions (m_interpreter, ArchSpec(), 
select, error, platform_arch));
-if (platform_sp)
+
+bool found = false;
+PlatformList  = 
m_interpreter.GetDebugger().GetPlatformList();
+for (size_t i = 0; i <  list.GetSize(); ++i)
 {
-
m_interpreter.GetDebugger().GetPlatformList().SetSelectedPlatform(platform_sp);
+PlatformSP platform_sp = list.GetAtIndex(i);
+if (m_platform_options.PlatformMatches(platform_sp))
+{
+list.SetSelectedPlatform(platform_sp);
 
-platform_sp->GetStatus (result.GetOutputStream());
-result.SetStatus (eReturnStatusSuccessFinishResult);
+platform_sp->GetStatus (result.GetOutputStream());
+result.SetStatus (eReturnStatusSuccessFinishResult);
+
+found = true;
+break;
+}
 }
-else
+
+if (!found)
 {
-result.AppendError(error.AsCString());
-result.SetStatus (eReturnStatusFailed);
+Error error;
+ArchSpec platform_arch;
+PlatformSP platform_sp 
(m_platform_options.CreatePlatformWithOptions (m_interpreter, ArchSpec(), 
select, error, platform_arch));
+if (platform_sp)
+{
+list.SetSelectedPlatform(platform_sp);
+
+platform_sp->GetStatus (result.GetOutputStream());
+result.SetStatus (eReturnStatusSuccessFinishResult);
+}
+else
+{
+result.AppendError(error.AsCString());
+result.SetStatus (eReturnStatusFailed);
+}
 }
 }
 else


Index: source/Commands/CommandObjectPlatform.cpp
===
--- source/Commands/CommandObjectPlatform.cpp
+++ source/Commands/CommandObjectPlatform.cpp
@@ -237,20 +237,41 @@
 {
 const bool select = true;
 m_platform_options.SetPlatformName (platform_name);
-Error error;
-ArchSpec platform_arch;
-PlatformSP platform_sp (m_platform_options.CreatePlatformWithOptions (m_interpreter, ArchSpec(), select, error, platform_arch));
-if (platform_sp)
+
+bool found = false;
+PlatformList  = m_interpreter.GetDebugger().GetPlatformList();
+for (size_t i = 0; i <  list.GetSize(); ++i)
 {
-m_interpreter.GetDebugger().GetPlatformList().SetSelectedPlatform(platform_sp);
+PlatformSP platform_sp = list.GetAtIndex(i);
+if (m_platform_options.PlatformMatches(platform_sp))
+{
+list.SetSelectedPlatform(platform_sp);
 
-platform_sp->GetStatus (result.GetOutputStream());
-result.SetStatus (eReturnStatusSuccessFinishResult);
+platform_sp->GetStatus (result.GetOutputStream());
+result.SetStatus (eReturnStatusSuccessFinishResult);
+
+found = true;
+break;
+}
 }
-else
+
+if (!found)
 {
-result.AppendError(error.AsCString());
-result.SetStatus (eReturnStatusFailed);
+Error error;
+ArchSpec platform_arch;
+PlatformSP 

[Lldb-commits] [PATCH] D21648: Make sure to reset to correct platform after TestImageListMultiArchitecture

2016-06-23 Thread Francis Ricci via lldb-commits
fjricci created this revision.
fjricci added reviewers: clayborg, tfiala, zturner.
fjricci added subscribers: lldb-commits, sas.

When running the test suite in platform mode, this test would
use 'platform select host', which would cause the rest of the suite to stop 
running
in platform mode.

Instead, use 'platform select' to select the remote platform, if it exists.

http://reviews.llvm.org/D21648

Files:
  
packages/Python/lldbsuite/test/functionalities/object-file/TestImageListMultiArchitecture.py

Index: 
packages/Python/lldbsuite/test/functionalities/object-file/TestImageListMultiArchitecture.py
===
--- 
packages/Python/lldbsuite/test/functionalities/object-file/TestImageListMultiArchitecture.py
+++ 
packages/Python/lldbsuite/test/functionalities/object-file/TestImageListMultiArchitecture.py
@@ -39,5 +39,9 @@
 
 self.runCmd("file {}".format(file_name))
 self.match("image list -t -A", [expected_triple_and_arch_regex])
-# Revert to the host platform after all of this is done
-self.runCmd("platform select host")
+
+# Revert to the original platform after all of this is done
+if lldb.remote_platform:
+self.runCmd('platform select %s' % lldb.remote_platform.GetName())
+else:
+self.runCmd("platform select host")


Index: packages/Python/lldbsuite/test/functionalities/object-file/TestImageListMultiArchitecture.py
===
--- packages/Python/lldbsuite/test/functionalities/object-file/TestImageListMultiArchitecture.py
+++ packages/Python/lldbsuite/test/functionalities/object-file/TestImageListMultiArchitecture.py
@@ -39,5 +39,9 @@
 
 self.runCmd("file {}".format(file_name))
 self.match("image list -t -A", [expected_triple_and_arch_regex])
-# Revert to the host platform after all of this is done
-self.runCmd("platform select host")
+
+# Revert to the original platform after all of this is done
+if lldb.remote_platform:
+self.runCmd('platform select %s' % lldb.remote_platform.GetName())
+else:
+self.runCmd("platform select host")
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D21422: Fix typo in eOpenOptionDontFollowSymlinks

2016-06-20 Thread Francis Ricci via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL273225: Fix typo in eOpenOptionDontFollowSymlinks (authored 
by fjricci).

Changed prior to commit:
  http://reviews.llvm.org/D21422?vs=60937=61325#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D21422

Files:
  lldb/trunk/include/lldb/Host/File.h
  lldb/trunk/source/Host/common/File.cpp
  lldb/trunk/source/Target/Platform.cpp

Index: lldb/trunk/source/Host/common/File.cpp
===
--- lldb/trunk/source/Host/common/File.cpp
+++ lldb/trunk/source/Host/common/File.cpp
@@ -238,7 +238,7 @@
 oflag |= O_RDONLY;
 
 #ifndef _WIN32
-if (options & eOpenoptionDontFollowSymlinks)
+if (options & eOpenOptionDontFollowSymlinks)
 oflag |= O_NOFOLLOW;
 #endif
 }
Index: lldb/trunk/source/Target/Platform.cpp
===
--- lldb/trunk/source/Target/Platform.cpp
+++ lldb/trunk/source/Target/Platform.cpp
@@ -1431,7 +1431,7 @@
 
 uint32_t source_open_options = File::eOpenOptionRead | 
File::eOpenOptionCloseOnExec;
 if (source.GetFileType() == FileSpec::eFileTypeSymbolicLink)
-source_open_options |= File::eOpenoptionDontFollowSymlinks;
+source_open_options |= File::eOpenOptionDontFollowSymlinks;
 
 File source_file(source, source_open_options, 
lldb::eFilePermissionsUserRW);
 Error error;
Index: lldb/trunk/include/lldb/Host/File.h
===
--- lldb/trunk/include/lldb/Host/File.h
+++ lldb/trunk/include/lldb/Host/File.h
@@ -45,7 +45,7 @@
 eOpenOptionNonBlocking  = (1u << 4),// File reads
 eOpenOptionCanCreate= (1u << 5),// Create file if 
doesn't already exist
 eOpenOptionCanCreateNewOnly = (1u << 6),// Can create file 
only if it doesn't already exist
-eOpenoptionDontFollowSymlinks   = (1u << 7),
+eOpenOptionDontFollowSymlinks   = (1u << 7),
 eOpenOptionCloseOnExec  = (1u << 8) // Close the file when 
executing a new process
 };
 


Index: lldb/trunk/source/Host/common/File.cpp
===
--- lldb/trunk/source/Host/common/File.cpp
+++ lldb/trunk/source/Host/common/File.cpp
@@ -238,7 +238,7 @@
 oflag |= O_RDONLY;
 
 #ifndef _WIN32
-if (options & eOpenoptionDontFollowSymlinks)
+if (options & eOpenOptionDontFollowSymlinks)
 oflag |= O_NOFOLLOW;
 #endif
 }
Index: lldb/trunk/source/Target/Platform.cpp
===
--- lldb/trunk/source/Target/Platform.cpp
+++ lldb/trunk/source/Target/Platform.cpp
@@ -1431,7 +1431,7 @@
 
 uint32_t source_open_options = File::eOpenOptionRead | File::eOpenOptionCloseOnExec;
 if (source.GetFileType() == FileSpec::eFileTypeSymbolicLink)
-source_open_options |= File::eOpenoptionDontFollowSymlinks;
+source_open_options |= File::eOpenOptionDontFollowSymlinks;
 
 File source_file(source, source_open_options, lldb::eFilePermissionsUserRW);
 Error error;
Index: lldb/trunk/include/lldb/Host/File.h
===
--- lldb/trunk/include/lldb/Host/File.h
+++ lldb/trunk/include/lldb/Host/File.h
@@ -45,7 +45,7 @@
 eOpenOptionNonBlocking  = (1u << 4),// File reads
 eOpenOptionCanCreate= (1u << 5),// Create file if doesn't already exist
 eOpenOptionCanCreateNewOnly = (1u << 6),// Can create file only if it doesn't already exist
-eOpenoptionDontFollowSymlinks   = (1u << 7),
+eOpenOptionDontFollowSymlinks   = (1u << 7),
 eOpenOptionCloseOnExec  = (1u << 8) // Close the file when executing a new process
 };
 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D21422: Fix typo in eOpenOptionDontFollowSymlinks

2016-06-15 Thread Francis Ricci via lldb-commits
fjricci created this revision.
fjricci added reviewers: clayborg, labath.
fjricci added a subscriber: lldb-commits.

Fix capitalization

http://reviews.llvm.org/D21422

Files:
  include/lldb/Host/File.h
  source/Host/common/File.cpp
  source/Target/Platform.cpp

Index: source/Target/Platform.cpp
===
--- source/Target/Platform.cpp
+++ source/Target/Platform.cpp
@@ -1431,7 +1431,7 @@
 
 uint32_t source_open_options = File::eOpenOptionRead | 
File::eOpenOptionCloseOnExec;
 if (source.GetFileType() == FileSpec::eFileTypeSymbolicLink)
-source_open_options |= File::eOpenoptionDontFollowSymlinks;
+source_open_options |= File::eOpenOptionDontFollowSymlinks;
 
 File source_file(source, source_open_options, 
lldb::eFilePermissionsUserRW);
 Error error;
Index: source/Host/common/File.cpp
===
--- source/Host/common/File.cpp
+++ source/Host/common/File.cpp
@@ -238,7 +238,7 @@
 oflag |= O_RDONLY;
 
 #ifndef _WIN32
-if (options & eOpenoptionDontFollowSymlinks)
+if (options & eOpenOptionDontFollowSymlinks)
 oflag |= O_NOFOLLOW;
 #endif
 }
Index: include/lldb/Host/File.h
===
--- include/lldb/Host/File.h
+++ include/lldb/Host/File.h
@@ -45,7 +45,7 @@
 eOpenOptionNonBlocking  = (1u << 4),// File reads
 eOpenOptionCanCreate= (1u << 5),// Create file if 
doesn't already exist
 eOpenOptionCanCreateNewOnly = (1u << 6),// Can create file 
only if it doesn't already exist
-eOpenoptionDontFollowSymlinks   = (1u << 7),
+eOpenOptionDontFollowSymlinks   = (1u << 7),
 eOpenOptionCloseOnExec  = (1u << 8) // Close the file when 
executing a new process
 };
 


Index: source/Target/Platform.cpp
===
--- source/Target/Platform.cpp
+++ source/Target/Platform.cpp
@@ -1431,7 +1431,7 @@
 
 uint32_t source_open_options = File::eOpenOptionRead | File::eOpenOptionCloseOnExec;
 if (source.GetFileType() == FileSpec::eFileTypeSymbolicLink)
-source_open_options |= File::eOpenoptionDontFollowSymlinks;
+source_open_options |= File::eOpenOptionDontFollowSymlinks;
 
 File source_file(source, source_open_options, lldb::eFilePermissionsUserRW);
 Error error;
Index: source/Host/common/File.cpp
===
--- source/Host/common/File.cpp
+++ source/Host/common/File.cpp
@@ -238,7 +238,7 @@
 oflag |= O_RDONLY;
 
 #ifndef _WIN32
-if (options & eOpenoptionDontFollowSymlinks)
+if (options & eOpenOptionDontFollowSymlinks)
 oflag |= O_NOFOLLOW;
 #endif
 }
Index: include/lldb/Host/File.h
===
--- include/lldb/Host/File.h
+++ include/lldb/Host/File.h
@@ -45,7 +45,7 @@
 eOpenOptionNonBlocking  = (1u << 4),// File reads
 eOpenOptionCanCreate= (1u << 5),// Create file if doesn't already exist
 eOpenOptionCanCreateNewOnly = (1u << 6),// Can create file only if it doesn't already exist
-eOpenoptionDontFollowSymlinks   = (1u << 7),
+eOpenOptionDontFollowSymlinks   = (1u << 7),
 eOpenOptionCloseOnExec  = (1u << 8) // Close the file when executing a new process
 };
 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D20990: Don't remove PIE executables when using svr4 packets

2016-06-06 Thread Francis Ricci via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL271899: Don't remove PIE executables when using svr4 packets 
(authored by fjricci).

Changed prior to commit:
  http://reviews.llvm.org/D20990?vs=59637=59723#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D20990

Files:
  lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

Index: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -4875,11 +4875,10 @@
 found = true;
 }
 
-if (!found)
+// The main executable will never be included in libraries-svr4, 
don't remove it
+if (!found && loaded_module.get() != 
target.GetExecutableModulePointer())
 {
-lldb_private::ObjectFile * obj = loaded_module->GetObjectFile 
();
-if (obj && obj->GetType () != 
ObjectFile::Type::eTypeExecutable)
-removed_modules.Append (loaded_module);
+removed_modules.Append (loaded_module);
 }
 }
 


Index: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -4875,11 +4875,10 @@
 found = true;
 }
 
-if (!found)
+// The main executable will never be included in libraries-svr4, don't remove it
+if (!found && loaded_module.get() != target.GetExecutableModulePointer())
 {
-lldb_private::ObjectFile * obj = loaded_module->GetObjectFile ();
-if (obj && obj->GetType () != ObjectFile::Type::eTypeExecutable)
-removed_modules.Append (loaded_module);
+removed_modules.Append (loaded_module);
 }
 }
 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r271899 - Don't remove PIE executables when using svr4 packets

2016-06-06 Thread Francis Ricci via lldb-commits
Author: fjricci
Date: Mon Jun  6 10:00:50 2016
New Revision: 271899

URL: http://llvm.org/viewvc/llvm-project?rev=271899=rev
Log:
Don't remove PIE executables when using svr4 packets

Summary:
Because PIE executables have an e_type of llvm::ELF::ET_DYN,
they are not of type eTypeExecutable, and were being removed
when svr4 packets were used.

Reviewers: clayborg, ADodds, tfiala, sas

Subscribers: lldb-commits

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

Modified:
lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp?rev=271899=271898=271899=diff
==
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Mon Jun  
6 10:00:50 2016
@@ -4875,11 +4875,10 @@ ProcessGDBRemote::LoadModules (LoadedMod
 found = true;
 }
 
-if (!found)
+// The main executable will never be included in libraries-svr4, 
don't remove it
+if (!found && loaded_module.get() != 
target.GetExecutableModulePointer())
 {
-lldb_private::ObjectFile * obj = loaded_module->GetObjectFile 
();
-if (obj && obj->GetType () != 
ObjectFile::Type::eTypeExecutable)
-removed_modules.Append (loaded_module);
+removed_modules.Append (loaded_module);
 }
 }
 


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


Re: [Lldb-commits] [PATCH] D20990: Don't remove PIE executables when using svr4 packets

2016-06-03 Thread Francis Ricci via lldb-commits
fjricci updated this revision to Diff 59637.
fjricci added a comment.

Refactor to remove unnecessary object file type checking


http://reviews.llvm.org/D20990

Files:
  source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

Index: source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===
--- source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -4875,11 +4875,9 @@
 found = true;
 }
 
-if (!found)
+if (!found && loaded_module.get() != 
target.GetExecutableModulePointer())
 {
-lldb_private::ObjectFile * obj = loaded_module->GetObjectFile 
();
-if (obj && obj->GetType () != 
ObjectFile::Type::eTypeExecutable)
-removed_modules.Append (loaded_module);
+removed_modules.Append (loaded_module);
 }
 }
 


Index: source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===
--- source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -4875,11 +4875,9 @@
 found = true;
 }
 
-if (!found)
+if (!found && loaded_module.get() != target.GetExecutableModulePointer())
 {
-lldb_private::ObjectFile * obj = loaded_module->GetObjectFile ();
-if (obj && obj->GetType () != ObjectFile::Type::eTypeExecutable)
-removed_modules.Append (loaded_module);
+removed_modules.Append (loaded_module);
 }
 }
 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D20990: Don't remove PIE executables when using svr4 packets

2016-06-03 Thread Francis Ricci via lldb-commits
fjricci updated this revision to Diff 59633.
fjricci added a comment.

Fix curly-brace style


http://reviews.llvm.org/D20990

Files:
  source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

Index: source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===
--- source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -4878,8 +4878,11 @@
 if (!found)
 {
 lldb_private::ObjectFile * obj = loaded_module->GetObjectFile 
();
-if (obj && obj->GetType () != 
ObjectFile::Type::eTypeExecutable)
+if (obj && obj->GetType () != 
ObjectFile::Type::eTypeExecutable &&
+loaded_module.get() != target.GetExecutableModulePointer())
+{
 removed_modules.Append (loaded_module);
+}
 }
 }
 


Index: source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===
--- source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -4878,8 +4878,11 @@
 if (!found)
 {
 lldb_private::ObjectFile * obj = loaded_module->GetObjectFile ();
-if (obj && obj->GetType () != ObjectFile::Type::eTypeExecutable)
+if (obj && obj->GetType () != ObjectFile::Type::eTypeExecutable &&
+loaded_module.get() != target.GetExecutableModulePointer())
+{
 removed_modules.Append (loaded_module);
+}
 }
 }
 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D20990: Don't remove PIE executables when using svr4 packets

2016-06-03 Thread Francis Ricci via lldb-commits
fjricci created this revision.
fjricci added reviewers: clayborg, ADodds, tfiala.
fjricci added a subscriber: lldb-commits.

Because PIE executables have an e_type of llvm::ELF::ET_DYN,
they are not of type eTypeExecutable, and were being removed
when svr4 packets were used.

http://reviews.llvm.org/D20990

Files:
  source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

Index: source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===
--- source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -4878,8 +4878,10 @@
 if (!found)
 {
 lldb_private::ObjectFile * obj = loaded_module->GetObjectFile 
();
-if (obj && obj->GetType () != 
ObjectFile::Type::eTypeExecutable)
+if (obj && obj->GetType () != 
ObjectFile::Type::eTypeExecutable &&
+loaded_module.get() != 
target.GetExecutableModulePointer()) {
 removed_modules.Append (loaded_module);
+}
 }
 }
 


Index: source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===
--- source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -4878,8 +4878,10 @@
 if (!found)
 {
 lldb_private::ObjectFile * obj = loaded_module->GetObjectFile ();
-if (obj && obj->GetType () != ObjectFile::Type::eTypeExecutable)
+if (obj && obj->GetType () != ObjectFile::Type::eTypeExecutable &&
+loaded_module.get() != target.GetExecutableModulePointer()) {
 removed_modules.Append (loaded_module);
+}
 }
 }
 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D20509: Skip leading spaces when decoding hex values

2016-05-24 Thread Francis Ricci via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL270592: Skip leading spaces when decoding hex values 
(authored by fjricci).

Changed prior to commit:
  http://reviews.llvm.org/D20509?vs=58041=58277#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D20509

Files:
  lldb/trunk/source/Utility/StringExtractor.cpp

Index: lldb/trunk/source/Utility/StringExtractor.cpp
===
--- lldb/trunk/source/Utility/StringExtractor.cpp
+++ lldb/trunk/source/Utility/StringExtractor.cpp
@@ -104,6 +104,7 @@
 int
 StringExtractor::DecodeHexU8()
 {
+SkipSpaces();
 if (GetBytesLeft() < 2)
 {
 return -1;
@@ -230,6 +231,7 @@
 uint32_t result = 0;
 uint32_t nibble_count = 0;
 
+SkipSpaces();
 if (little_endian)
 {
 uint32_t shift_amount = 0;
@@ -292,6 +294,7 @@
 uint64_t result = 0;
 uint32_t nibble_count = 0;
 
+SkipSpaces();
 if (little_endian)
 {
 uint32_t shift_amount = 0;


Index: lldb/trunk/source/Utility/StringExtractor.cpp
===
--- lldb/trunk/source/Utility/StringExtractor.cpp
+++ lldb/trunk/source/Utility/StringExtractor.cpp
@@ -104,6 +104,7 @@
 int
 StringExtractor::DecodeHexU8()
 {
+SkipSpaces();
 if (GetBytesLeft() < 2)
 {
 return -1;
@@ -230,6 +231,7 @@
 uint32_t result = 0;
 uint32_t nibble_count = 0;
 
+SkipSpaces();
 if (little_endian)
 {
 uint32_t shift_amount = 0;
@@ -292,6 +294,7 @@
 uint64_t result = 0;
 uint32_t nibble_count = 0;
 
+SkipSpaces();
 if (little_endian)
 {
 uint32_t shift_amount = 0;
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D20509: Skip leading spaces when decoding hex values

2016-05-21 Thread Francis Ricci via lldb-commits
fjricci created this revision.
fjricci added reviewers: vharron, clayborg, jasonmolenda.
fjricci added a subscriber: lldb-commits.

The StringExtractor functions using stroull will already
skip leading whitespace (ie GetU64). Make sure that the manual
hex parsing functions also skip leading whitespace.

This is important for members of the gdb protocol which are defined
as using whitespace separators (ie qfThreadInfo, qC, etc). While
lldb-server does not use the whitespace separators, gdb-remotes
should work if they do, as the whitespace is defined by the gdb-remote
protocol.

http://reviews.llvm.org/D20509

Files:
  source/Utility/StringExtractor.cpp

Index: source/Utility/StringExtractor.cpp
===
--- source/Utility/StringExtractor.cpp
+++ source/Utility/StringExtractor.cpp
@@ -104,6 +104,7 @@
 int
 StringExtractor::DecodeHexU8()
 {
+SkipSpaces();
 if (GetBytesLeft() < 2)
 {
 return -1;
@@ -230,6 +231,7 @@
 uint32_t result = 0;
 uint32_t nibble_count = 0;
 
+SkipSpaces();
 if (little_endian)
 {
 uint32_t shift_amount = 0;
@@ -292,6 +294,7 @@
 uint64_t result = 0;
 uint32_t nibble_count = 0;
 
+SkipSpaces();
 if (little_endian)
 {
 uint32_t shift_amount = 0;


Index: source/Utility/StringExtractor.cpp
===
--- source/Utility/StringExtractor.cpp
+++ source/Utility/StringExtractor.cpp
@@ -104,6 +104,7 @@
 int
 StringExtractor::DecodeHexU8()
 {
+SkipSpaces();
 if (GetBytesLeft() < 2)
 {
 return -1;
@@ -230,6 +231,7 @@
 uint32_t result = 0;
 uint32_t nibble_count = 0;
 
+SkipSpaces();
 if (little_endian)
 {
 uint32_t shift_amount = 0;
@@ -292,6 +294,7 @@
 uint64_t result = 0;
 uint32_t nibble_count = 0;
 
+SkipSpaces();
 if (little_endian)
 {
 uint32_t shift_amount = 0;
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r268397 - Split out console and file writing cases in TestCommandScriptImmediateOutput

2016-05-03 Thread Francis Ricci via lldb-commits
Author: fjricci
Date: Tue May  3 11:31:36 2016
New Revision: 268397

URL: http://llvm.org/viewvc/llvm-project?rev=268397=rev
Log:
Split out console and file writing cases in TestCommandScriptImmediateOutput

Summary:
As these are really testing separate issues, they should be run as separate
tests.

Reviewers: zturner, granata.enrico, clayborg

Subscribers: lldb-commits

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

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py?rev=268397=268396=268397=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py
 Tue May  3 11:31:36 2016
@@ -24,17 +24,25 @@ class CommandScriptImmediateOutputTestCa
 @skipIfRemote # test not remote-ready llvm.org/pr24813
 @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need 
a pexpect replacement for windows")
 @expectedFailureAll(oslist=["freebsd","linux"], 
bugnumber="llvm.org/pr26139")
-def test_command_script_immediate_output (self):
-"""Test that LLDB correctly allows scripted commands to set an 
immediate output file."""
-self.launch(timeout=60)
+def test_command_script_immediate_output_console (self):
+"""Test that LLDB correctly allows scripted commands to set immediate 
output to the console."""
+self.launch(timeout=10)
 
 script = os.path.join(os.getcwd(), 'custom_command.py')
 prompt = "\(lldb\) "
-  
+
 self.sendline('command script import %s' % script, patterns=[prompt])
 self.sendline('command script add -f custom_command.command_function 
mycommand', patterns=[prompt])
 self.sendline('mycommand', patterns='this is a test string, just a 
test string')
 self.sendline('command script delete mycommand', patterns=[prompt])
+self.quit(gracefully=False)
+
+@skipIfRemote # test not remote-ready llvm.org/pr24813
+@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need 
a pexpect replacement for windows")
+@expectedFailureAll(oslist=["freebsd","linux"], 
bugnumber="llvm.org/pr26139")
+def test_command_script_immediate_output_file (self):
+"""Test that LLDB correctly allows scripted commands to set immediate 
output to a file."""
+self.launch(timeout=10)
 
 test_files = {os.path.join(os.getcwd(), 'read.txt'):'r',
   os.path.join(os.getcwd(), 'write.txt')   :'w',
@@ -50,6 +58,11 @@ class CommandScriptImmediateOutputTestCa
 with open(path, 'w+') as init:
 init.write(starter_string)
 
+script = os.path.join(os.getcwd(), 'custom_command.py')
+prompt = "\(lldb\) "
+
+self.sendline('command script import %s' % script, patterns=[prompt])
+
 self.sendline('command script add -f custom_command.write_file 
mywrite', patterns=[prompt])
 for path, mode in test_files.iteritems():
 command = 'mywrite "' + path + '" ' + mode


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


Re: [Lldb-commits] [PATCH] D19690: Split out console and file writing cases in TestCommandScriptImmediateOutput

2016-05-03 Thread Francis Ricci via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL268397: Split out console and file writing cases in 
TestCommandScriptImmediateOutput (authored by fjricci).

Changed prior to commit:
  http://reviews.llvm.org/D19690?vs=55619=56020#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D19690

Files:
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py

Index: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py
===
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py
@@ -24,17 +24,25 @@
 @skipIfRemote # test not remote-ready llvm.org/pr24813
 @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need 
a pexpect replacement for windows")
 @expectedFailureAll(oslist=["freebsd","linux"], 
bugnumber="llvm.org/pr26139")
-def test_command_script_immediate_output (self):
-"""Test that LLDB correctly allows scripted commands to set an 
immediate output file."""
-self.launch(timeout=60)
+def test_command_script_immediate_output_console (self):
+"""Test that LLDB correctly allows scripted commands to set immediate 
output to the console."""
+self.launch(timeout=10)
 
 script = os.path.join(os.getcwd(), 'custom_command.py')
 prompt = "\(lldb\) "
-  
+
 self.sendline('command script import %s' % script, patterns=[prompt])
 self.sendline('command script add -f custom_command.command_function 
mycommand', patterns=[prompt])
 self.sendline('mycommand', patterns='this is a test string, just a 
test string')
 self.sendline('command script delete mycommand', patterns=[prompt])
+self.quit(gracefully=False)
+
+@skipIfRemote # test not remote-ready llvm.org/pr24813
+@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need 
a pexpect replacement for windows")
+@expectedFailureAll(oslist=["freebsd","linux"], 
bugnumber="llvm.org/pr26139")
+def test_command_script_immediate_output_file (self):
+"""Test that LLDB correctly allows scripted commands to set immediate 
output to a file."""
+self.launch(timeout=10)
 
 test_files = {os.path.join(os.getcwd(), 'read.txt'):'r',
   os.path.join(os.getcwd(), 'write.txt')   :'w',
@@ -50,6 +58,11 @@
 with open(path, 'w+') as init:
 init.write(starter_string)
 
+script = os.path.join(os.getcwd(), 'custom_command.py')
+prompt = "\(lldb\) "
+
+self.sendline('command script import %s' % script, patterns=[prompt])
+
 self.sendline('command script add -f custom_command.write_file 
mywrite', patterns=[prompt])
 for path, mode in test_files.iteritems():
 command = 'mywrite "' + path + '" ' + mode


Index: lldb/trunk/packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py
@@ -24,17 +24,25 @@
 @skipIfRemote # test not remote-ready llvm.org/pr24813
 @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
 @expectedFailureAll(oslist=["freebsd","linux"], bugnumber="llvm.org/pr26139")
-def test_command_script_immediate_output (self):
-"""Test that LLDB correctly allows scripted commands to set an immediate output file."""
-self.launch(timeout=60)
+def test_command_script_immediate_output_console (self):
+"""Test that LLDB correctly allows scripted commands to set immediate output to the console."""
+self.launch(timeout=10)
 
 script = os.path.join(os.getcwd(), 'custom_command.py')
 prompt = "\(lldb\) "
-  
+
 self.sendline('command script import %s' % script, patterns=[prompt])
 self.sendline('command script add -f custom_command.command_function mycommand', patterns=[prompt])
 self.sendline('mycommand', patterns='this is a test string, just a test string')
 self.sendline('command script delete mycommand', patterns=[prompt])
+self.quit(gracefully=False)
+
+@skipIfRemote # test not 

Re: [Lldb-commits] [PATCH] D19690: Split out console and file writing cases in TestCommandScriptImmediateOutput

2016-04-29 Thread Francis Ricci via lldb-commits
fjricci updated this revision to Diff 55619.
fjricci added a comment.

Update timeout to 10 seconds for console case


http://reviews.llvm.org/D19690

Files:
  
packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py

Index: 
packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py
===
--- 
packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py
+++ 
packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py
@@ -24,17 +24,25 @@
 @skipIfRemote # test not remote-ready llvm.org/pr24813
 @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need 
a pexpect replacement for windows")
 @expectedFailureAll(oslist=["freebsd","linux"], 
bugnumber="llvm.org/pr26139")
-def test_command_script_immediate_output (self):
-"""Test that LLDB correctly allows scripted commands to set an 
immediate output file."""
-self.launch(timeout=60)
+def test_command_script_immediate_output_console (self):
+"""Test that LLDB correctly allows scripted commands to set immediate 
output to the console."""
+self.launch(timeout=10)
 
 script = os.path.join(os.getcwd(), 'custom_command.py')
 prompt = "\(lldb\) "
-  
+
 self.sendline('command script import %s' % script, patterns=[prompt])
 self.sendline('command script add -f custom_command.command_function 
mycommand', patterns=[prompt])
 self.sendline('mycommand', patterns='this is a test string, just a 
test string')
 self.sendline('command script delete mycommand', patterns=[prompt])
+self.quit(gracefully=False)
+
+@skipIfRemote # test not remote-ready llvm.org/pr24813
+@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need 
a pexpect replacement for windows")
+@expectedFailureAll(oslist=["freebsd","linux"], 
bugnumber="llvm.org/pr26139")
+def test_command_script_immediate_output_file (self):
+"""Test that LLDB correctly allows scripted commands to set immediate 
output to a file."""
+self.launch(timeout=10)
 
 test_files = {os.path.join(os.getcwd(), 'read.txt'):'r',
   os.path.join(os.getcwd(), 'write.txt')   :'w',
@@ -50,6 +58,11 @@
 with open(path, 'w+') as init:
 init.write(starter_string)
 
+script = os.path.join(os.getcwd(), 'custom_command.py')
+prompt = "\(lldb\) "
+
+self.sendline('command script import %s' % script, patterns=[prompt])
+
 self.sendline('command script add -f custom_command.write_file 
mywrite', patterns=[prompt])
 for path, mode in test_files.iteritems():
 command = 'mywrite "' + path + '" ' + mode


Index: packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py
===
--- packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py
+++ packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py
@@ -24,17 +24,25 @@
 @skipIfRemote # test not remote-ready llvm.org/pr24813
 @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
 @expectedFailureAll(oslist=["freebsd","linux"], bugnumber="llvm.org/pr26139")
-def test_command_script_immediate_output (self):
-"""Test that LLDB correctly allows scripted commands to set an immediate output file."""
-self.launch(timeout=60)
+def test_command_script_immediate_output_console (self):
+"""Test that LLDB correctly allows scripted commands to set immediate output to the console."""
+self.launch(timeout=10)
 
 script = os.path.join(os.getcwd(), 'custom_command.py')
 prompt = "\(lldb\) "
-  
+
 self.sendline('command script import %s' % script, patterns=[prompt])
 self.sendline('command script add -f custom_command.command_function mycommand', patterns=[prompt])
 self.sendline('mycommand', patterns='this is a test string, just a test string')
 self.sendline('command script delete mycommand', patterns=[prompt])
+self.quit(gracefully=False)
+
+@skipIfRemote # test not remote-ready llvm.org/pr24813
+@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
+@expectedFailureAll(oslist=["freebsd","linux"], bugnumber="llvm.org/pr26139")
+def 

Re: [Lldb-commits] [PATCH] D19633: Move TestCommandScriptImmediateOutput from PExpectTest to TestBase

2016-04-28 Thread Francis Ricci via lldb-commits
fjricci added a comment.

Would it be acceptable to split it into two test methods inside the same test 
case? Both are testing writing immediate output from a command script, just one 
is immediate output to the console and the other is immediate output to a file.


http://reviews.llvm.org/D19633



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


Re: [Lldb-commits] [PATCH] D19633: Move TestCommandScriptImmediateOutput from PExpectTest to TestBase

2016-04-28 Thread Francis Ricci via lldb-commits
fjricci abandoned this revision.
fjricci added a comment.

Ok, I'll put up a new revision to split out the test cases.


http://reviews.llvm.org/D19633



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


Re: [Lldb-commits] [PATCH] D19633: Move TestCommandScriptImmediateOutput from PExpectTest to TestBase

2016-04-27 Thread Francis Ricci via lldb-commits
fjricci added a comment.

As of r264351, this test already writes to both the console and to files (since 
the file writing is testing the same python file io bugs tested by the console 
writing). I can make another patch to split it out if that's preferable.

However, this patch is intended to move the test off of PExpect, because I 
noticed that sendline() has some issues when running with older versions of 
lldb (like 3.8, for example), regardless of whether we're testing files or the 
console.


http://reviews.llvm.org/D19633



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


Re: [Lldb-commits] [PATCH] D19633: Move TestCommandScriptImmediateOutput from PExpectTest to TestBase

2016-04-27 Thread Francis Ricci via lldb-commits
fjricci updated this revision to Diff 55340.
fjricci added a comment.

Remove windows expected failure


http://reviews.llvm.org/D19633

Files:
  
packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py

Index: 
packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py
===
--- 
packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py
+++ 
packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py
@@ -13,28 +13,24 @@
 from lldbsuite.test.lldbpexpect import *
 from lldbsuite.test import lldbutil
 
-class CommandScriptImmediateOutputTestCase (PExpectTest):
+class CommandScriptImmediateOutputTestCase (TestBase):
 
 mydir = TestBase.compute_mydir(__file__)
 
 def setUp(self):
 # Call super's setUp().
-PExpectTest.setUp(self)
+TestBase.setUp(self)
 
 @skipIfRemote # test not remote-ready llvm.org/pr24813
-@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need 
a pexpect replacement for windows")
 @expectedFailureAll(oslist=["freebsd","linux"], 
bugnumber="llvm.org/pr26139")
 def test_command_script_immediate_output (self):
 """Test that LLDB correctly allows scripted commands to set an 
immediate output file."""
-self.launch(timeout=60)
-
 script = os.path.join(os.getcwd(), 'custom_command.py')
-prompt = "\(lldb\) "
   
-self.sendline('command script import %s' % script, patterns=[prompt])
-self.sendline('command script add -f custom_command.command_function 
mycommand', patterns=[prompt])
-self.sendline('mycommand', patterns='this is a test string, just a 
test string')
-self.sendline('command script delete mycommand', patterns=[prompt])
+self.runCmd('command script import %s' % script)
+self.runCmd('command script add -f custom_command.command_function 
mycommand')
+self.expect('mycommand', substrs = ['this is a test string, just a 
test string'])
+self.runCmd('command script delete mycommand')
 
 test_files = {os.path.join(os.getcwd(), 'read.txt'):'r',
   os.path.join(os.getcwd(), 'write.txt')   :'w',
@@ -50,15 +46,12 @@
 with open(path, 'w+') as init:
 init.write(starter_string)
 
-self.sendline('command script add -f custom_command.write_file 
mywrite', patterns=[prompt])
+self.runCmd('command script add -f custom_command.write_file mywrite')
+self.runCmd('command script list')
 for path, mode in test_files.iteritems():
-command = 'mywrite "' + path + '" ' + mode
-
-self.sendline(command, patterns=[prompt])
-
-self.sendline('command script delete mywrite', patterns=[prompt])
+self.runCmd('mywrite ' + path + ' ' + mode)
 
-self.quit(gracefully=False)
+self.runCmd('command script delete mywrite')
 
 for path, mode in test_files.iteritems():
 with open(path, 'r') as result:


Index: packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py
===
--- packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py
+++ packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py
@@ -13,28 +13,24 @@
 from lldbsuite.test.lldbpexpect import *
 from lldbsuite.test import lldbutil
 
-class CommandScriptImmediateOutputTestCase (PExpectTest):
+class CommandScriptImmediateOutputTestCase (TestBase):
 
 mydir = TestBase.compute_mydir(__file__)
 
 def setUp(self):
 # Call super's setUp().
-PExpectTest.setUp(self)
+TestBase.setUp(self)
 
 @skipIfRemote # test not remote-ready llvm.org/pr24813
-@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
 @expectedFailureAll(oslist=["freebsd","linux"], bugnumber="llvm.org/pr26139")
 def test_command_script_immediate_output (self):
 """Test that LLDB correctly allows scripted commands to set an immediate output file."""
-self.launch(timeout=60)
-
 script = os.path.join(os.getcwd(), 'custom_command.py')
-prompt = "\(lldb\) "
   
-self.sendline('command script import %s' % script, patterns=[prompt])
-self.sendline('command script add -f custom_command.command_function mycommand', patterns=[prompt])
-self.sendline('mycommand', patterns='this is a test 

[Lldb-commits] [PATCH] D19633: Move TestCommandScriptImmediateOutput from PExpectTest to TestBase

2016-04-27 Thread Francis Ricci via lldb-commits
fjricci created this revision.
fjricci added reviewers: granata.enrico, zturner.
fjricci added subscribers: sas, lldb-commits.

This should make TestCommandScriptImmediateOutput more consistent
with the rest of the test suite.

http://reviews.llvm.org/D19633

Files:
  
packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py

Index: 
packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py
===
--- 
packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py
+++ 
packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py
@@ -13,28 +13,25 @@
 from lldbsuite.test.lldbpexpect import *
 from lldbsuite.test import lldbutil
 
-class CommandScriptImmediateOutputTestCase (PExpectTest):
+class CommandScriptImmediateOutputTestCase (TestBase):
 
 mydir = TestBase.compute_mydir(__file__)
 
 def setUp(self):
 # Call super's setUp().
-PExpectTest.setUp(self)
+TestBase.setUp(self)
 
 @skipIfRemote # test not remote-ready llvm.org/pr24813
 @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need 
a pexpect replacement for windows")
 @expectedFailureAll(oslist=["freebsd","linux"], 
bugnumber="llvm.org/pr26139")
 def test_command_script_immediate_output (self):
 """Test that LLDB correctly allows scripted commands to set an 
immediate output file."""
-self.launch(timeout=60)
-
 script = os.path.join(os.getcwd(), 'custom_command.py')
-prompt = "\(lldb\) "
   
-self.sendline('command script import %s' % script, patterns=[prompt])
-self.sendline('command script add -f custom_command.command_function 
mycommand', patterns=[prompt])
-self.sendline('mycommand', patterns='this is a test string, just a 
test string')
-self.sendline('command script delete mycommand', patterns=[prompt])
+self.runCmd('command script import %s' % script)
+self.runCmd('command script add -f custom_command.command_function 
mycommand')
+self.expect('mycommand', substrs = ['this is a test string, just a 
test string'])
+self.runCmd('command script delete mycommand')
 
 test_files = {os.path.join(os.getcwd(), 'read.txt'):'r',
   os.path.join(os.getcwd(), 'write.txt')   :'w',
@@ -50,15 +47,12 @@
 with open(path, 'w+') as init:
 init.write(starter_string)
 
-self.sendline('command script add -f custom_command.write_file 
mywrite', patterns=[prompt])
+self.runCmd('command script add -f custom_command.write_file mywrite')
+self.runCmd('command script list')
 for path, mode in test_files.iteritems():
-command = 'mywrite "' + path + '" ' + mode
-
-self.sendline(command, patterns=[prompt])
-
-self.sendline('command script delete mywrite', patterns=[prompt])
+self.runCmd('mywrite ' + path + ' ' + mode)
 
-self.quit(gracefully=False)
+self.runCmd('command script delete mywrite')
 
 for path, mode in test_files.iteritems():
 with open(path, 'r') as result:


Index: packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py
===
--- packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py
+++ packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py
@@ -13,28 +13,25 @@
 from lldbsuite.test.lldbpexpect import *
 from lldbsuite.test import lldbutil
 
-class CommandScriptImmediateOutputTestCase (PExpectTest):
+class CommandScriptImmediateOutputTestCase (TestBase):
 
 mydir = TestBase.compute_mydir(__file__)
 
 def setUp(self):
 # Call super's setUp().
-PExpectTest.setUp(self)
+TestBase.setUp(self)
 
 @skipIfRemote # test not remote-ready llvm.org/pr24813
 @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
 @expectedFailureAll(oslist=["freebsd","linux"], bugnumber="llvm.org/pr26139")
 def test_command_script_immediate_output (self):
 """Test that LLDB correctly allows scripted commands to set an immediate output file."""
-self.launch(timeout=60)
-
 script = os.path.join(os.getcwd(), 'custom_command.py')
-prompt = "\(lldb\) "
   
-self.sendline('command script import %s' % script, patterns=[prompt])
-self.sendline('command script add -f 

[Lldb-commits] [PATCH] D19608: Checkout release_38 branches of llvm and clang when building lldb 3.8

2016-04-27 Thread Francis Ricci via lldb-commits
fjricci created this revision.
fjricci added reviewers: clayborg, jasonmolenda.
fjricci added subscribers: hans, sas, lldb-commits.

This commit is intended only for the release_38 branch, not for master.

Fixes xcodebuild for the release_38 branch, since llvm and clang must
be on the same branch as lldb when building.

http://reviews.llvm.org/D19608

Files:
  scripts/build-llvm.pl

Index: scripts/build-llvm.pl
===
--- scripts/build-llvm.pl
+++ scripts/build-llvm.pl
@@ -22,10 +22,6 @@
 
 our $llvm_configuration = $ENV{LLVM_CONFIGURATION};
 
-our $llvm_revision = "HEAD";
-our $clang_revision = "HEAD";
-our $compiler_rt_revision = "HEAD";
-
 our $SRCROOT = "$ENV{SRCROOT}";
 our @archs = split (/\s+/, $ENV{ARCHS});
 my $os_release = 11;
@@ -64,12 +60,12 @@
 }
 else
 {
-print "Checking out llvm sources from revision $llvm_revision...\n";
-do_command ("cd '$SRCROOT' && svn co --quiet --revision $llvm_revision 
http://llvm.org/svn/llvm-project/llvm/trunk llvm", "checking out llvm from 
repository", 1);
-print "Checking out clang sources from revision $clang_revision...\n";
-do_command ("cd '$llvm_srcroot/tools' && svn co --quiet --revision 
$clang_revision http://llvm.org/svn/llvm-project/cfe/trunk clang", "checking 
out clang from repository", 1);
-#print "Checking out compiler-rt sources from revision 
$compiler_rt_revision...\n";
-#do_command ("cd '$llvm_srcroot/projects' && svn co --quiet --revision 
$compiler_rt_revision http://llvm.org/svn/llvm-project/compiler-rt/trunk 
compiler-rt", "checking out compiler-rt from repository", 1);
+print "Checking out llvm sources from release_38...\n";
+do_command ("cd '$SRCROOT' && svn co --quiet 
http://llvm.org/svn/llvm-project/llvm/branches/release_38 llvm", "checking out 
llvm from repository", 1);
+print "Checking out clang sources from release_38...\n";
+do_command ("cd '$llvm_srcroot/tools' && svn co --quiet 
http://llvm.org/svn/llvm-project/cfe/branches/release_38 clang", "checking out 
clang from repository", 1);
+#print "Checking out compiler-rt sources from release_38...\n";
+#do_command ("cd '$llvm_srcroot/projects' && svn co --quiet 
http://llvm.org/svn/llvm-project/compiler-rt/branches/release_38 compiler-rt", 
"checking out compiler-rt from repository", 1);
 print "Applying any local patches to LLVM/Clang...";
 
 my @llvm_patches = bsd_glob("$ENV{SRCROOT}/scripts/llvm.*.diff");


Index: scripts/build-llvm.pl
===
--- scripts/build-llvm.pl
+++ scripts/build-llvm.pl
@@ -22,10 +22,6 @@
 
 our $llvm_configuration = $ENV{LLVM_CONFIGURATION};
 
-our $llvm_revision = "HEAD";
-our $clang_revision = "HEAD";
-our $compiler_rt_revision = "HEAD";
-
 our $SRCROOT = "$ENV{SRCROOT}";
 our @archs = split (/\s+/, $ENV{ARCHS});
 my $os_release = 11;
@@ -64,12 +60,12 @@
 }
 else
 {
-print "Checking out llvm sources from revision $llvm_revision...\n";
-do_command ("cd '$SRCROOT' && svn co --quiet --revision $llvm_revision http://llvm.org/svn/llvm-project/llvm/trunk llvm", "checking out llvm from repository", 1);
-print "Checking out clang sources from revision $clang_revision...\n";
-do_command ("cd '$llvm_srcroot/tools' && svn co --quiet --revision $clang_revision http://llvm.org/svn/llvm-project/cfe/trunk clang", "checking out clang from repository", 1);
-#print "Checking out compiler-rt sources from revision $compiler_rt_revision...\n";
-#do_command ("cd '$llvm_srcroot/projects' && svn co --quiet --revision $compiler_rt_revision http://llvm.org/svn/llvm-project/compiler-rt/trunk compiler-rt", "checking out compiler-rt from repository", 1);
+print "Checking out llvm sources from release_38...\n";
+do_command ("cd '$SRCROOT' && svn co --quiet http://llvm.org/svn/llvm-project/llvm/branches/release_38 llvm", "checking out llvm from repository", 1);
+print "Checking out clang sources from release_38...\n";
+do_command ("cd '$llvm_srcroot/tools' && svn co --quiet http://llvm.org/svn/llvm-project/cfe/branches/release_38 clang", "checking out clang from repository", 1);
+#print "Checking out compiler-rt sources from release_38...\n";
+#do_command ("cd '$llvm_srcroot/projects' && svn co --quiet http://llvm.org/svn/llvm-project/compiler-rt/branches/release_38 compiler-rt", "checking out compiler-rt from repository", 1);
 print "Applying any local patches to LLVM/Clang...";
 
 my @llvm_patches = bsd_glob("$ENV{SRCROOT}/scripts/llvm.*.diff");
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r267443 - test commit

2016-04-25 Thread Francis Ricci via lldb-commits
Author: fjricci
Date: Mon Apr 25 14:02:05 2016
New Revision: 267443

URL: http://llvm.org/viewvc/llvm-project?rev=267443=rev
Log:
test commit

Modified:
lldb/trunk/docs/lldb-for-gdb-users.txt

Modified: lldb/trunk/docs/lldb-for-gdb-users.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/docs/lldb-for-gdb-users.txt?rev=267443=267442=267443=diff
==
--- lldb/trunk/docs/lldb-for-gdb-users.txt (original)
+++ lldb/trunk/docs/lldb-for-gdb-users.txt Mon Apr 25 14:02:05 2016
@@ -222,7 +222,7 @@ Or you can attach to a process by name w
 
 (lldb) process attach -n Sketch
 
-the "attach by name"  also supports the "-w" option which waits for the
+The "attach by name"  also supports the "-w" option which waits for the
 next process of that name to show up, and attaches to that.  You can also
 attach by PID:
 


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


Re: [Lldb-commits] [PATCH] D19303: Maintain register numbering across xml include features

2016-04-25 Thread Francis Ricci via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL267468: Maintain register numbering across xml include 
features (authored by fjricci).

Changed prior to commit:
  http://reviews.llvm.org/D19303?vs=54298=54904#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D19303

Files:
  lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

Index: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -4372,14 +4372,11 @@
 };
 
 bool
-ParseRegisters (XMLNode feature_node, GdbServerTargetInfo _info, 
GDBRemoteDynamicRegisterInfo _reg_info, ABISP abi_sp)
+ParseRegisters (XMLNode feature_node, GdbServerTargetInfo _info, 
GDBRemoteDynamicRegisterInfo _reg_info, ABISP abi_sp, uint32_t 
_reg_num, uint32_t _offset)
 {
 if (!feature_node)
 return false;
 
-uint32_t cur_reg_num = 0;
-uint32_t reg_offset = 0;
-
 feature_node.ForEachChildElementWithName("reg", [_info, 
_reg_info, _reg_num, _offset, _sp](const XMLNode _node) -> 
bool {
 std::string gdb_group;
 std::string gdb_type;
@@ -4635,12 +4632,16 @@
 return true; // Keep iterating through all children of the 
target_node
 });
 
+// Initialize these outside of ParseRegisters, since they should 
not be reset inside each include feature
+uint32_t cur_reg_num = 0;
+uint32_t reg_offset = 0;
+
 // Don't use Process::GetABI, this code gets called from 
DidAttach, and in that context we haven't
 // set the Target's architecture yet, so the ABI is also 
potentially incorrect.
 ABISP abi_to_use_sp = ABI::FindPlugin(arch_to_use);
 if (feature_node)
 {
-ParseRegisters(feature_node, target_info, 
this->m_register_info, abi_to_use_sp);
+ParseRegisters(feature_node, target_info, 
this->m_register_info, abi_to_use_sp, cur_reg_num, reg_offset);
 }
 
 for (const auto  : target_info.includes)
@@ -4658,7 +4659,7 @@
 XMLNode include_feature_node = 
include_xml_document.GetRootElement("feature");
 if (include_feature_node)
 {
-ParseRegisters(include_feature_node, target_info, 
this->m_register_info, abi_to_use_sp);
+ParseRegisters(include_feature_node, target_info, 
this->m_register_info, abi_to_use_sp, cur_reg_num, reg_offset);
 }
 }
 this->m_register_info.Finalize(arch_to_use);


Index: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -4372,14 +4372,11 @@
 };
 
 bool
-ParseRegisters (XMLNode feature_node, GdbServerTargetInfo _info, GDBRemoteDynamicRegisterInfo _reg_info, ABISP abi_sp)
+ParseRegisters (XMLNode feature_node, GdbServerTargetInfo _info, GDBRemoteDynamicRegisterInfo _reg_info, ABISP abi_sp, uint32_t _reg_num, uint32_t _offset)
 {
 if (!feature_node)
 return false;
 
-uint32_t cur_reg_num = 0;
-uint32_t reg_offset = 0;
-
 feature_node.ForEachChildElementWithName("reg", [_info, _reg_info, _reg_num, _offset, _sp](const XMLNode _node) -> bool {
 std::string gdb_group;
 std::string gdb_type;
@@ -4635,12 +4632,16 @@
 return true; // Keep iterating through all children of the target_node
 });
 
+// Initialize these outside of ParseRegisters, since they should not be reset inside each include feature
+uint32_t cur_reg_num = 0;
+uint32_t reg_offset = 0;
+
 // Don't use Process::GetABI, this code gets called from DidAttach, and in that context we haven't
 // set the Target's architecture yet, so the ABI is also potentially incorrect.
 ABISP abi_to_use_sp = ABI::FindPlugin(arch_to_use);
 if (feature_node)
 {
-ParseRegisters(feature_node, target_info, this->m_register_info, abi_to_use_sp);
+ParseRegisters(feature_node, target_info, this->m_register_info, abi_to_use_sp, cur_reg_num, reg_offset);
 }
 
 for (const auto  : target_info.includes)
@@ -4658,7 +4659,7 @@
 XMLNode include_feature_node = include_xml_document.GetRootElement("feature");
 if (include_feature_node)
 {
-ParseRegisters(include_feature_node, target_info, this->m_register_info, abi_to_use_sp);
+ParseRegisters(include_feature_node, target_info, this->m_register_info, abi_to_use_sp, 

[Lldb-commits] [lldb] r267468 - Maintain register numbering across xml include features

2016-04-25 Thread Francis Ricci via lldb-commits
Author: fjricci
Date: Mon Apr 25 16:03:55 2016
New Revision: 267468

URL: http://llvm.org/viewvc/llvm-project?rev=267468=rev
Log:
Maintain register numbering across xml include features

Summary:
If the remote uses include features when communicating
xml register info back to lldb, the existing code would reset the
lldb register index at the beginning of each include node.
This would lead to multiple registers having the same lldb register index.
Since the lldb register numbers should be contiguous and unique,
maintain them accross the parsing of all of the xml feature nodes.

Reviewers: jingham, jasonmolenda, clayborg

Subscribers: lldb-commits, sas

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

Modified:
lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp?rev=267468=267467=267468=diff
==
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Mon Apr 
25 16:03:55 2016
@@ -4372,14 +4372,11 @@ struct GdbServerTargetInfo
 };
 
 bool
-ParseRegisters (XMLNode feature_node, GdbServerTargetInfo _info, 
GDBRemoteDynamicRegisterInfo _reg_info, ABISP abi_sp)
+ParseRegisters (XMLNode feature_node, GdbServerTargetInfo _info, 
GDBRemoteDynamicRegisterInfo _reg_info, ABISP abi_sp, uint32_t 
_reg_num, uint32_t _offset)
 {
 if (!feature_node)
 return false;
 
-uint32_t cur_reg_num = 0;
-uint32_t reg_offset = 0;
-
 feature_node.ForEachChildElementWithName("reg", [_info, 
_reg_info, _reg_num, _offset, _sp](const XMLNode _node) -> 
bool {
 std::string gdb_group;
 std::string gdb_type;
@@ -4635,12 +4632,16 @@ ProcessGDBRemote::GetGDBServerRegisterIn
 return true; // Keep iterating through all children of the 
target_node
 });
 
+// Initialize these outside of ParseRegisters, since they should 
not be reset inside each include feature
+uint32_t cur_reg_num = 0;
+uint32_t reg_offset = 0;
+
 // Don't use Process::GetABI, this code gets called from 
DidAttach, and in that context we haven't
 // set the Target's architecture yet, so the ABI is also 
potentially incorrect.
 ABISP abi_to_use_sp = ABI::FindPlugin(arch_to_use);
 if (feature_node)
 {
-ParseRegisters(feature_node, target_info, 
this->m_register_info, abi_to_use_sp);
+ParseRegisters(feature_node, target_info, 
this->m_register_info, abi_to_use_sp, cur_reg_num, reg_offset);
 }
 
 for (const auto  : target_info.includes)
@@ -4658,7 +4659,7 @@ ProcessGDBRemote::GetGDBServerRegisterIn
 XMLNode include_feature_node = 
include_xml_document.GetRootElement("feature");
 if (include_feature_node)
 {
-ParseRegisters(include_feature_node, target_info, 
this->m_register_info, abi_to_use_sp);
+ParseRegisters(include_feature_node, target_info, 
this->m_register_info, abi_to_use_sp, cur_reg_num, reg_offset);
 }
 }
 this->m_register_info.Finalize(arch_to_use);


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


Re: [Lldb-commits] [PATCH] D19230: Properly unload modules from target image list when using svr4 packets

2016-04-25 Thread Francis Ricci via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL267467: Properly unload modules from target image list when 
using svr4 packets (authored by fjricci).

Changed prior to commit:
  http://reviews.llvm.org/D19230?vs=54083=54902#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D19230

Files:
  lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

Index: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -4879,7 +4879,31 @@
 
 if (new_modules.GetSize() > 0)
 {
+ModuleList removed_modules;
 Target  = GetTarget();
+ModuleList _modules = m_process->GetTarget().GetImages();
+
+for (size_t i = 0; i < loaded_modules.GetSize(); ++i)
+{
+const lldb::ModuleSP loaded_module = 
loaded_modules.GetModuleAtIndex(i);
+
+bool found = false;
+for (size_t j = 0; j < new_modules.GetSize(); ++j)
+{
+if (new_modules.GetModuleAtIndex(j).get() == 
loaded_module.get())
+found = true;
+}
+
+if (!found)
+{
+lldb_private::ObjectFile * obj = loaded_module->GetObjectFile 
();
+if (obj && obj->GetType () != 
ObjectFile::Type::eTypeExecutable)
+removed_modules.Append (loaded_module);
+}
+}
+
+loaded_modules.Remove (removed_modules);
+m_process->GetTarget().ModulesDidUnload (removed_modules, false);
 
 new_modules.ForEach ([](const lldb::ModuleSP module_sp) -> bool
 {
@@ -4895,13 +4919,11 @@
 return false;
 });
 
-ModuleList _modules = m_process->GetTarget().GetImages();
 loaded_modules.AppendIfNeeded (new_modules);
 m_process->GetTarget().ModulesDidLoad (new_modules);
 }
 
 return new_modules.GetSize();
-
 }
 
 size_t


Index: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -4879,7 +4879,31 @@
 
 if (new_modules.GetSize() > 0)
 {
+ModuleList removed_modules;
 Target  = GetTarget();
+ModuleList _modules = m_process->GetTarget().GetImages();
+
+for (size_t i = 0; i < loaded_modules.GetSize(); ++i)
+{
+const lldb::ModuleSP loaded_module = loaded_modules.GetModuleAtIndex(i);
+
+bool found = false;
+for (size_t j = 0; j < new_modules.GetSize(); ++j)
+{
+if (new_modules.GetModuleAtIndex(j).get() == loaded_module.get())
+found = true;
+}
+
+if (!found)
+{
+lldb_private::ObjectFile * obj = loaded_module->GetObjectFile ();
+if (obj && obj->GetType () != ObjectFile::Type::eTypeExecutable)
+removed_modules.Append (loaded_module);
+}
+}
+
+loaded_modules.Remove (removed_modules);
+m_process->GetTarget().ModulesDidUnload (removed_modules, false);
 
 new_modules.ForEach ([](const lldb::ModuleSP module_sp) -> bool
 {
@@ -4895,13 +4919,11 @@
 return false;
 });
 
-ModuleList _modules = m_process->GetTarget().GetImages();
 loaded_modules.AppendIfNeeded (new_modules);
 m_process->GetTarget().ModulesDidLoad (new_modules);
 }
 
 return new_modules.GetSize();
-
 }
 
 size_t
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r267467 - Properly unload modules from target image list when using svr4 packets

2016-04-25 Thread Francis Ricci via lldb-commits
Author: fjricci
Date: Mon Apr 25 16:02:24 2016
New Revision: 267467

URL: http://llvm.org/viewvc/llvm-project?rev=267467=rev
Log:
Properly unload modules from target image list when using svr4 packets

Summary:
When we receive an svr4 packet from the remote, we check for new modules
and add them to the list of images in the target. However, we did not
do the same for modules which have been removed.

This was causing TestLoadUnload to fail when using ds2, which uses
svr4 packets to communicate all library info on Linux. This patch fixes
the failing test.

Reviewers: zturner, tfiala, ADodds

Subscribers: lldb-commits, sas

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

Modified:
lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp?rev=267467=267466=267467=diff
==
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Mon Apr 
25 16:02:24 2016
@@ -4879,7 +4879,31 @@ ProcessGDBRemote::LoadModules (LoadedMod
 
 if (new_modules.GetSize() > 0)
 {
+ModuleList removed_modules;
 Target  = GetTarget();
+ModuleList _modules = m_process->GetTarget().GetImages();
+
+for (size_t i = 0; i < loaded_modules.GetSize(); ++i)
+{
+const lldb::ModuleSP loaded_module = 
loaded_modules.GetModuleAtIndex(i);
+
+bool found = false;
+for (size_t j = 0; j < new_modules.GetSize(); ++j)
+{
+if (new_modules.GetModuleAtIndex(j).get() == 
loaded_module.get())
+found = true;
+}
+
+if (!found)
+{
+lldb_private::ObjectFile * obj = loaded_module->GetObjectFile 
();
+if (obj && obj->GetType () != 
ObjectFile::Type::eTypeExecutable)
+removed_modules.Append (loaded_module);
+}
+}
+
+loaded_modules.Remove (removed_modules);
+m_process->GetTarget().ModulesDidUnload (removed_modules, false);
 
 new_modules.ForEach ([](const lldb::ModuleSP module_sp) -> bool
 {
@@ -4895,13 +4919,11 @@ ProcessGDBRemote::LoadModules (LoadedMod
 return false;
 });
 
-ModuleList _modules = m_process->GetTarget().GetImages();
 loaded_modules.AppendIfNeeded (new_modules);
 m_process->GetTarget().ModulesDidLoad (new_modules);
 }
 
 return new_modules.GetSize();
-
 }
 
 size_t


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


Re: [Lldb-commits] [PATCH] D19305: Use Process Plugin register indices when communicating with remote

2016-04-25 Thread Francis Ricci via lldb-commits
fjricci added a comment.

Committed with comment added to ReadRegister declaration to specify that the 
argument is an eRegisterKindProcessPlugin register number


Repository:
  rL LLVM

http://reviews.llvm.org/D19305



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


[Lldb-commits] [lldb] r267466 - Use Process Plugin register indices when communicating with remote

2016-04-25 Thread Francis Ricci via lldb-commits
Author: fjricci
Date: Mon Apr 25 15:59:11 2016
New Revision: 267466

URL: http://llvm.org/viewvc/llvm-project?rev=267466=rev
Log:
Use Process Plugin register indices when communicating with remote

Summary:
eRegisterKindProcessPlugin is used to store the register
indices used by the remote, and eRegisterKindLLDB is used
to store the internal lldb register indices. However, we're currently
using the lldb indices instead of the process plugin indices
when sending p/P packets. This will break if the remote uses
non-contiguous register indices.

Reviewers: jasonmolenda, clayborg

Subscribers: lldb-commits, sas

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

Modified:
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp

Modified: 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h?rev=267466=267465=267466=diff
==
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h 
(original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h 
Mon Apr 25 15:59:11 2016
@@ -527,7 +527,7 @@ public:
 
 bool
 ReadRegister(lldb::tid_t tid,
- uint32_t reg_num,
+ uint32_t reg_num,   // Must be the eRegisterKindProcessPlugin 
register number, to be sent to the remote
  StringExtractorGDBRemote );
 
 bool

Modified: 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp?rev=267466=267465=267466=diff
==
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp 
(original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp 
Mon Apr 25 15:59:11 2016
@@ -198,10 +198,11 @@ bool
 GDBRemoteRegisterContext::GetPrimordialRegister(const RegisterInfo *reg_info,
 GDBRemoteCommunicationClient 
_comm)
 {
-const uint32_t reg = reg_info->kinds[eRegisterKindLLDB];
+const uint32_t lldb_reg = reg_info->kinds[eRegisterKindLLDB];
+const uint32_t remote_reg = reg_info->kinds[eRegisterKindProcessPlugin];
 StringExtractorGDBRemote response;
-if (gdb_comm.ReadRegister(m_thread.GetProtocolID(), reg, response))
-return PrivateSetRegisterValue (reg, response);
+if (gdb_comm.ReadRegister(m_thread.GetProtocolID(), remote_reg, response))
+return PrivateSetRegisterValue (lldb_reg, response);
 return false;
 }
 
@@ -316,7 +317,7 @@ GDBRemoteRegisterContext::SetPrimordialR
 StreamString packet;
 StringExtractorGDBRemote response;
 const uint32_t reg = reg_info->kinds[eRegisterKindLLDB];
-packet.Printf ("P%x=", reg);
+packet.Printf ("P%x=", reg_info->kinds[eRegisterKindProcessPlugin]);
 packet.PutBytesAsRawHex8 (m_reg_data.PeekData(reg_info->byte_offset, 
reg_info->byte_size),
   reg_info->byte_size,
   endian::InlHostByteOrder(),
@@ -813,7 +814,7 @@ GDBRemoteRegisterContext::WriteAllRegist
 if (restore_src)
 {
 StreamString packet;
-packet.Printf ("P%x=", reg);
+packet.Printf ("P%x=", 
reg_info->kinds[eRegisterKindProcessPlugin]);
 packet.PutBytesAsRawHex8 (restore_src,
   reg_byte_size,
   
endian::InlHostByteOrder(),
@@ -836,7 +837,7 @@ GDBRemoteRegisterContext::WriteAllRegist
 if (write_reg)
 {
 StreamString packet;
-packet.Printf ("P%x=", reg);
+packet.Printf ("P%x=", 
reg_info->kinds[eRegisterKindProcessPlugin]);
 packet.PutBytesAsRawHex8 (restore_src,
   reg_byte_size,
   
endian::InlHostByteOrder(),
@@ -894,7 +895,7 @@ GDBRemoteRegisterContext::WriteAllRegist
 continue;
 }
 StreamString packet;
-packet.Printf ("P%x=", reg_info->kinds[eRegisterKindLLDB]);
+packet.Printf ("P%x=", 
reg_info->kinds[eRegisterKindProcessPlugin]);
 packet.PutBytesAsRawHex8 

Re: [Lldb-commits] [PATCH] D19305: Use Process Plugin register indices when communicating with remote

2016-04-25 Thread Francis Ricci via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL267466: Use Process Plugin register indices when 
communicating with remote (authored by fjricci).

Changed prior to commit:
  http://reviews.llvm.org/D19305?vs=54303=54900#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D19305

Files:
  lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
  lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp

Index: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
===
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
@@ -198,10 +198,11 @@
 GDBRemoteRegisterContext::GetPrimordialRegister(const RegisterInfo *reg_info,
 GDBRemoteCommunicationClient 
_comm)
 {
-const uint32_t reg = reg_info->kinds[eRegisterKindLLDB];
+const uint32_t lldb_reg = reg_info->kinds[eRegisterKindLLDB];
+const uint32_t remote_reg = reg_info->kinds[eRegisterKindProcessPlugin];
 StringExtractorGDBRemote response;
-if (gdb_comm.ReadRegister(m_thread.GetProtocolID(), reg, response))
-return PrivateSetRegisterValue (reg, response);
+if (gdb_comm.ReadRegister(m_thread.GetProtocolID(), remote_reg, response))
+return PrivateSetRegisterValue (lldb_reg, response);
 return false;
 }
 
@@ -316,7 +317,7 @@
 StreamString packet;
 StringExtractorGDBRemote response;
 const uint32_t reg = reg_info->kinds[eRegisterKindLLDB];
-packet.Printf ("P%x=", reg);
+packet.Printf ("P%x=", reg_info->kinds[eRegisterKindProcessPlugin]);
 packet.PutBytesAsRawHex8 (m_reg_data.PeekData(reg_info->byte_offset, 
reg_info->byte_size),
   reg_info->byte_size,
   endian::InlHostByteOrder(),
@@ -813,7 +814,7 @@
 if (restore_src)
 {
 StreamString packet;
-packet.Printf ("P%x=", reg);
+packet.Printf ("P%x=", 
reg_info->kinds[eRegisterKindProcessPlugin]);
 packet.PutBytesAsRawHex8 (restore_src,
   reg_byte_size,
   
endian::InlHostByteOrder(),
@@ -836,7 +837,7 @@
 if (write_reg)
 {
 StreamString packet;
-packet.Printf ("P%x=", reg);
+packet.Printf ("P%x=", 
reg_info->kinds[eRegisterKindProcessPlugin]);
 packet.PutBytesAsRawHex8 (restore_src,
   reg_byte_size,
   
endian::InlHostByteOrder(),
@@ -894,7 +895,7 @@
 continue;
 }
 StreamString packet;
-packet.Printf ("P%x=", reg_info->kinds[eRegisterKindLLDB]);
+packet.Printf ("P%x=", 
reg_info->kinds[eRegisterKindProcessPlugin]);
 packet.PutBytesAsRawHex8 (data_sp->GetBytes() + 
reg_info->byte_offset, reg_info->byte_size, endian::InlHostByteOrder(), 
endian::InlHostByteOrder());
 if (thread_suffix_supported)
 packet.Printf (";thread:%4.4" PRIx64 ";", 
m_thread.GetProtocolID());
Index: 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
===
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
@@ -527,7 +527,7 @@
 
 bool
 ReadRegister(lldb::tid_t tid,
- uint32_t reg_num,
+ uint32_t reg_num,   // Must be the eRegisterKindProcessPlugin 
register number, to be sent to the remote
  StringExtractorGDBRemote );
 
 bool


Index: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
===
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
@@ -198,10 +198,11 @@
 GDBRemoteRegisterContext::GetPrimordialRegister(const RegisterInfo *reg_info,
 GDBRemoteCommunicationClient _comm)
 {
-const uint32_t reg = reg_info->kinds[eRegisterKindLLDB];
+const uint32_t lldb_reg = reg_info->kinds[eRegisterKindLLDB];
+const uint32_t remote_reg = 

Re: [Lldb-commits] [PATCH] D19082: Store absolute path for lldb executable in dotest.py

2016-04-25 Thread Francis Ricci via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL267463: Store absolute path for lldb executable in dotest.py 
(authored by fjricci).

Changed prior to commit:
  http://reviews.llvm.org/D19082?vs=53637=54895#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D19082

Files:
  lldb/trunk/packages/Python/lldbsuite/test/dotest.py

Index: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/dotest.py
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py
@@ -307,7 +307,7 @@
 configuration.lldbFrameworkPath = args.framework
 
 if args.executable:
-lldbtest_config.lldbExec = args.executable
+lldbtest_config.lldbExec = os.path.realpath(args.executable)
 
 if args.p:
 if args.p.startswith('-'):


Index: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/dotest.py
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py
@@ -307,7 +307,7 @@
 configuration.lldbFrameworkPath = args.framework
 
 if args.executable:
-lldbtest_config.lldbExec = args.executable
+lldbtest_config.lldbExec = os.path.realpath(args.executable)
 
 if args.p:
 if args.p.startswith('-'):
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r267463 - Store absolute path for lldb executable in dotest.py

2016-04-25 Thread Francis Ricci via lldb-commits
Author: fjricci
Date: Mon Apr 25 15:36:22 2016
New Revision: 267463

URL: http://llvm.org/viewvc/llvm-project?rev=267463=rev
Log:
Store absolute path for lldb executable in dotest.py

Summary:
lldb-server tests are currently being skipped on the
check-lldb target. This is because we get the path of
lldb-server by modifying the path to the lldb executable.
However, by this point, we've changed directories, and a
relative path to the build/bin directory will no longer point
to the location of lldb-server.

Storing an absolute path solves this issue.

Reviewers: vharron, zturner, tfiala, labath

Subscribers: labath, lldb-commits, sas

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

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

Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest.py?rev=267463=267462=267463=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/dotest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py Mon Apr 25 15:36:22 2016
@@ -307,7 +307,7 @@ def parseOptionsAndInitTestdirs():
 configuration.lldbFrameworkPath = args.framework
 
 if args.executable:
-lldbtest_config.lldbExec = args.executable
+lldbtest_config.lldbExec = os.path.realpath(args.executable)
 
 if args.p:
 if args.p.startswith('-'):


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


Re: [Lldb-commits] [PATCH] D19067: Make sure to use lib instead of lib64 for LLDB_LIB_DIR

2016-04-25 Thread Francis Ricci via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL267462: Create _lldb python symlink correctly when 
LLVM_LIBDIR_SUFFIX is used (authored by fjricci).

Changed prior to commit:
  http://reviews.llvm.org/D19067?vs=54077=54894#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D19067

Files:
  lldb/trunk/CMakeLists.txt
  lldb/trunk/scripts/Python/finishSwigPythonLLDB.py
  lldb/trunk/scripts/finishSwigWrapperClasses.py

Index: lldb/trunk/scripts/Python/finishSwigPythonLLDB.py
===
--- lldb/trunk/scripts/Python/finishSwigPythonLLDB.py
+++ lldb/trunk/scripts/Python/finishSwigPythonLLDB.py
@@ -358,11 +358,12 @@
 # Args: vDictArgs   - (R) Program input parameters.
 #   vstrFrameworkPythonDir  - (R) Python framework directory.
 #   vstrLiblldbName - (R) File name for _lldb library.
+#   vstrLiblldbDir  - (R) liblldb directory.
 # Returns:  Bool - True = function success, False = failure.
 #   Str - Error description on task failure.
 # Throws:   None.
 #--
-def make_symlink_liblldb(vDictArgs, vstrFrameworkPythonDir, vstrLiblldbFileName):
+def make_symlink_liblldb(vDictArgs, vstrFrameworkPythonDir, vstrLiblldbFileName, vstrLldbLibDir):
 dbg = utilsDebug.CDebugFnVerbose("Python script make_symlink_liblldb()")
 bOk = True
 strErrMsg = ""
@@ -382,7 +383,7 @@
 
 bMakeFileCalled = "-m" in vDictArgs
 if not bMakeFileCalled:
-strSrc = os.path.join("lib", "LLDB")
+strSrc = os.path.join(vstrLldbLibDir, "LLDB")
 else:
 strLibFileExtn = ""
 if eOSType == utilsOsType.EnumOsType.Windows:
@@ -392,7 +393,7 @@
 strLibFileExtn = ".dylib"
 else:
 strLibFileExtn = ".so"
-strSrc = os.path.join("lib", "liblldb" + strLibFileExtn)
+strSrc = os.path.join(vstrLldbLibDir, "liblldb" + strLibFileExtn)
 
 bOk, strErrMsg = make_symlink(vDictArgs, vstrFrameworkPythonDir, strSrc, strTarget)
 
@@ -462,11 +463,12 @@
 #   the Python framework directory.
 # Args: vDictArgs   - (R) Program input parameters.
 #   vstrFrameworkPythonDir  - (R) Python framework directory.
+#   vstrLldbLibDir  - (R) liblldb directory.
 # Returns:  Bool - True = function success, False = failure.
 #   strErrMsg - Error description on task failure.
 # Throws:   None.
 #--
-def create_symlinks(vDictArgs, vstrFrameworkPythonDir):
+def create_symlinks(vDictArgs, vstrFrameworkPythonDir, vstrLldbLibDir):
 dbg = utilsDebug.CDebugFnVerbose("Python script create_symlinks()")
 bOk = True
 strErrMsg = ""
@@ -477,7 +479,8 @@
 if bOk:
 bOk, strErrMsg = make_symlink_liblldb(vDictArgs,
   vstrFrameworkPythonDir,
-  strLibLldbFileName)
+  strLibLldbFileName,
+  vstrLldbLibDir)
 
 # Make symlink for darwin-debug on Darwin
 strDarwinDebugFileName = "darwin-debug"
@@ -672,6 +675,28 @@
 
 return (bOk, strWkDir, strErrMsg)
 
+#++---
+# Details:  Retrieve the liblldb directory path, if it exists and is valid.
+# Args: vDictArgs   - (R) Program input parameters.
+# Returns:  Bool - True = function success, False = failure.
+#   Str - liblldb directory path.
+#   strErrMsg - Error description on task failure.
+# Throws:   None.
+#--
+def get_liblldb_dir(vDictArgs):
+dbg = utilsDebug.CDebugFnVerbose("Python script get_liblldb_dir()")
+bOk = True
+strErrMsg = ""
+
+strLldbLibDir = ""
+bHaveLldbLibDir = "--lldbLibDir" in vDictArgs
+if bHaveLldbLibDir:
+strLldbLibDir = vDictArgs["--lldbLibDir"]
+if (bHaveLldbLibDir == False) or (strLldbLibDir.__len__() == 0):
+strLldbLibDir = "lib"
+
+return (bOk, strLldbLibDir, strErrMsg)
+
 #-
 #-
 #-
@@ -697,6 +722,8 @@
 be installed. Where non-Darwin systems want to put
 the .py and .so files so that Python can find them
 automatically. Python install directory.
+--lldbLibDirThe name of the directory containing liblldb.so.
+(optional)  "lib" by default.
 Results:0   Success
 -100+   Error from this script to the caller script.
 -100Error program failure with optional message.
@@ -727,10 +754,13 @@
 print((strMsgConfigBuildDir % strCfgBldDir))
 
 if bOk:
+  

[Lldb-commits] [lldb] r267462 - Create _lldb python symlink correctly when LLVM_LIBDIR_SUFFIX is used

2016-04-25 Thread Francis Ricci via lldb-commits
Author: fjricci
Date: Mon Apr 25 15:34:34 2016
New Revision: 267462

URL: http://llvm.org/viewvc/llvm-project?rev=267462=rev
Log:
Create _lldb python symlink correctly when LLVM_LIBDIR_SUFFIX is used

Summary:
Do not assume that liblldb.so is located in $(lldb -P)/../../../lib
when creating the _lldb python symlink. Instead, use the path passed
to LLVM_LIBDIR_SUFFIX, defaulting to $(lldb -P)/../../../lib when this
variable is not set.

Reviewers: vharron, emaste, zturner

Subscribers: zturner, labath, lldb-commits, sas

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

Modified:
lldb/trunk/CMakeLists.txt
lldb/trunk/scripts/Python/finishSwigPythonLLDB.py
lldb/trunk/scripts/finishSwigWrapperClasses.py

Modified: lldb/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/CMakeLists.txt?rev=267462=267461=267462=diff
==
--- lldb/trunk/CMakeLists.txt (original)
+++ lldb/trunk/CMakeLists.txt Mon Apr 25 15:34:34 2016
@@ -31,7 +31,7 @@ add_subdirectory(lit)
 if (NOT LLDB_DISABLE_PYTHON)
 # Add a Post-Build Event to copy over Python files and create the symlink 
to liblldb.so for the Python API(hardlink on Windows)
 add_custom_target( finish_swig ALL
-COMMAND ${PYTHON_EXECUTABLE} 
${CMAKE_CURRENT_SOURCE_DIR}/scripts/finishSwigWrapperClasses.py 
"--srcRoot=${LLDB_SOURCE_DIR}" 
"--targetDir=${CMAKE_CURRENT_BINARY_DIR}/scripts" 
"--cfgBldDir=${CMAKE_CURRENT_BINARY_DIR}/scripts" 
"--prefix=${CMAKE_BINARY_DIR}" "--cmakeBuildConfiguration=${CMAKE_CFG_INTDIR}" 
-m
+COMMAND ${PYTHON_EXECUTABLE} 
${CMAKE_CURRENT_SOURCE_DIR}/scripts/finishSwigWrapperClasses.py 
"--srcRoot=${LLDB_SOURCE_DIR}" 
"--targetDir=${CMAKE_CURRENT_BINARY_DIR}/scripts" 
"--cfgBldDir=${CMAKE_CURRENT_BINARY_DIR}/scripts" 
"--prefix=${CMAKE_BINARY_DIR}" "--cmakeBuildConfiguration=${CMAKE_CFG_INTDIR}" 
"--lldbLibDir=lib${LLVM_LIBDIR_SUFFIX}" -m
 DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/scripts/finishSwigWrapperClasses.py
 DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/scripts/lldb.py
 COMMENT "Python script sym-linking LLDB Python API")

Modified: lldb/trunk/scripts/Python/finishSwigPythonLLDB.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/finishSwigPythonLLDB.py?rev=267462=267461=267462=diff
==
--- lldb/trunk/scripts/Python/finishSwigPythonLLDB.py (original)
+++ lldb/trunk/scripts/Python/finishSwigPythonLLDB.py Mon Apr 25 15:34:34 2016
@@ -358,11 +358,12 @@ def make_symlink(vDictArgs, vstrFramewor
 # Args: vDictArgs   - (R) Program input parameters.
 #   vstrFrameworkPythonDir  - (R) Python framework directory.
 #   vstrLiblldbName - (R) File name for _lldb library.
+#   vstrLiblldbDir  - (R) liblldb directory.
 # Returns:  Bool - True = function success, False = failure.
 #   Str - Error description on task failure.
 # Throws:   None.
 #--
-def make_symlink_liblldb(vDictArgs, vstrFrameworkPythonDir, 
vstrLiblldbFileName):
+def make_symlink_liblldb(vDictArgs, vstrFrameworkPythonDir, 
vstrLiblldbFileName, vstrLldbLibDir):
 dbg = utilsDebug.CDebugFnVerbose("Python script make_symlink_liblldb()")
 bOk = True
 strErrMsg = ""
@@ -382,7 +383,7 @@ def make_symlink_liblldb(vDictArgs, vstr
 
 bMakeFileCalled = "-m" in vDictArgs
 if not bMakeFileCalled:
-strSrc = os.path.join("lib", "LLDB")
+strSrc = os.path.join(vstrLldbLibDir, "LLDB")
 else:
 strLibFileExtn = ""
 if eOSType == utilsOsType.EnumOsType.Windows:
@@ -392,7 +393,7 @@ def make_symlink_liblldb(vDictArgs, vstr
 strLibFileExtn = ".dylib"
 else:
 strLibFileExtn = ".so"
-strSrc = os.path.join("lib", "liblldb" + strLibFileExtn)
+strSrc = os.path.join(vstrLldbLibDir, "liblldb" + strLibFileExtn)
 
 bOk, strErrMsg = make_symlink(vDictArgs, vstrFrameworkPythonDir, strSrc, 
strTarget)
 
@@ -462,11 +463,12 @@ def make_symlink_lldb_argdumper(vDictArg
 #   the Python framework directory.
 # Args: vDictArgs   - (R) Program input parameters.
 #   vstrFrameworkPythonDir  - (R) Python framework directory.
+#   vstrLldbLibDir  - (R) liblldb directory.
 # Returns:  Bool - True = function success, False = failure.
 #   strErrMsg - Error description on task failure.
 # Throws:   None.
 #--
-def create_symlinks(vDictArgs, vstrFrameworkPythonDir):
+def create_symlinks(vDictArgs, vstrFrameworkPythonDir, vstrLldbLibDir):
 dbg = utilsDebug.CDebugFnVerbose("Python script create_symlinks()")
 bOk = True
 strErrMsg = ""
@@ -477,7 +479,8 @@ def create_symlinks(vDictArgs, vstrFrame
 if bOk:
 bOk, strErrMsg = make_symlink_liblldb(vDictArgs,
   vstrFrameworkPythonDir,
-  

Re: [Lldb-commits] [PATCH] D18807: Add missing qRegisterInfo option to gdbremote testcase

2016-04-25 Thread Francis Ricci via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL267459: Add missing qRegisterInfo option to gdbremote 
testcase (authored by fjricci).

Changed prior to commit:
  http://reviews.llvm.org/D18807?vs=52743=54892#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D18807

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

Index: 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
===
--- 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
+++ 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
@@ -630,6 +630,7 @@
 "encoding",
 "format",
 "set",
+"gcc",
 "ehframe",
 "dwarf",
 "generic",


Index: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
+++ lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
@@ -630,6 +630,7 @@
 "encoding",
 "format",
 "set",
+"gcc",
 "ehframe",
 "dwarf",
 "generic",
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r267459 - Add missing qRegisterInfo option to gdbremote testcase

2016-04-25 Thread Francis Ricci via lldb-commits
Author: fjricci
Date: Mon Apr 25 15:24:30 2016
New Revision: 267459

URL: http://llvm.org/viewvc/llvm-project?rev=267459=rev
Log:
Add missing qRegisterInfo option to gdbremote testcase

Summary:
"gcc" is equivalent to "ehframe" in ProcessGDBRemote, but
only "ehframe" was a valid response in the test suite.

Reviewers: tfiala, jasonmolenda, clayborg

Subscribers: lldb-commits, sas

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

Modified:

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

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py?rev=267459=267458=267459=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
 Mon Apr 25 15:24:30 2016
@@ -630,6 +630,7 @@ class GdbRemoteTestCaseBase(TestBase):
 "encoding",
 "format",
 "set",
+"gcc",
 "ehframe",
 "dwarf",
 "generic",


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


Re: [Lldb-commits] [PATCH] D19305: Use Process Plugin register indices when communicating with remote

2016-04-20 Thread Francis Ricci via lldb-commits
fjricci added a comment.

I can add a comment to the ReadRegister decl.

Alternatively, if you think it would be preferable, I could change the 
parameter name from reg_num to something more descriptive, like remote_reg_num 
or plugin_reg_num.

Or I could change ReadRegister to take a RegisterInfo instead of a register 
number, and that way it could select the appropriate ProcessPlugin regnum on 
its own, right when it generates the packet. This method actually might be most 
consistent with the rest of the changes in the patch.


http://reviews.llvm.org/D19305



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


[Lldb-commits] [PATCH] D19305: Use Process Plugin register indices when communicating with remote

2016-04-19 Thread Francis Ricci via lldb-commits
fjricci created this revision.
fjricci added reviewers: jasonmolenda, clayborg.
fjricci added subscribers: sas, lldb-commits.

eRegisterKindProcessPlugin is used to store the register
indices used by the remote, and eRegisterKindLLDB is used
to store the internal lldb register indices. However, we're currently
using the lldb indices instead of the process plugin indices
when sending p/P packets. This will break if the remote uses
non-contiguous register indices.

http://reviews.llvm.org/D19305

Files:
  source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp

Index: source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
===
--- source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
+++ source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
@@ -198,10 +198,11 @@
 GDBRemoteRegisterContext::GetPrimordialRegister(const RegisterInfo *reg_info,
 GDBRemoteCommunicationClient 
_comm)
 {
-const uint32_t reg = reg_info->kinds[eRegisterKindLLDB];
+const uint32_t lldb_reg = reg_info->kinds[eRegisterKindLLDB];
+const uint32_t remote_reg = reg_info->kinds[eRegisterKindProcessPlugin];
 StringExtractorGDBRemote response;
-if (gdb_comm.ReadRegister(m_thread.GetProtocolID(), reg, response))
-return PrivateSetRegisterValue (reg, response);
+if (gdb_comm.ReadRegister(m_thread.GetProtocolID(), remote_reg, response))
+return PrivateSetRegisterValue (lldb_reg, response);
 return false;
 }
 
@@ -316,7 +317,7 @@
 StreamString packet;
 StringExtractorGDBRemote response;
 const uint32_t reg = reg_info->kinds[eRegisterKindLLDB];
-packet.Printf ("P%x=", reg);
+packet.Printf ("P%x=", reg_info->kinds[eRegisterKindProcessPlugin]);
 packet.PutBytesAsRawHex8 (m_reg_data.PeekData(reg_info->byte_offset, 
reg_info->byte_size),
   reg_info->byte_size,
   endian::InlHostByteOrder(),
@@ -813,7 +814,7 @@
 if (restore_src)
 {
 StreamString packet;
-packet.Printf ("P%x=", reg);
+packet.Printf ("P%x=", 
reg_info->kinds[eRegisterKindProcessPlugin]);
 packet.PutBytesAsRawHex8 (restore_src,
   reg_byte_size,
   
endian::InlHostByteOrder(),
@@ -836,7 +837,7 @@
 if (write_reg)
 {
 StreamString packet;
-packet.Printf ("P%x=", reg);
+packet.Printf ("P%x=", 
reg_info->kinds[eRegisterKindProcessPlugin]);
 packet.PutBytesAsRawHex8 (restore_src,
   reg_byte_size,
   
endian::InlHostByteOrder(),
@@ -894,7 +895,7 @@
 continue;
 }
 StreamString packet;
-packet.Printf ("P%x=", reg_info->kinds[eRegisterKindLLDB]);
+packet.Printf ("P%x=", 
reg_info->kinds[eRegisterKindProcessPlugin]);
 packet.PutBytesAsRawHex8 (data_sp->GetBytes() + 
reg_info->byte_offset, reg_info->byte_size, endian::InlHostByteOrder(), 
endian::InlHostByteOrder());
 if (thread_suffix_supported)
 packet.Printf (";thread:%4.4" PRIx64 ";", 
m_thread.GetProtocolID());


Index: source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
===
--- source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
+++ source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
@@ -198,10 +198,11 @@
 GDBRemoteRegisterContext::GetPrimordialRegister(const RegisterInfo *reg_info,
 GDBRemoteCommunicationClient _comm)
 {
-const uint32_t reg = reg_info->kinds[eRegisterKindLLDB];
+const uint32_t lldb_reg = reg_info->kinds[eRegisterKindLLDB];
+const uint32_t remote_reg = reg_info->kinds[eRegisterKindProcessPlugin];
 StringExtractorGDBRemote response;
-if (gdb_comm.ReadRegister(m_thread.GetProtocolID(), reg, response))
-return PrivateSetRegisterValue (reg, response);
+if (gdb_comm.ReadRegister(m_thread.GetProtocolID(), remote_reg, response))
+return PrivateSetRegisterValue (lldb_reg, response);
 return false;
 }
 
@@ -316,7 +317,7 @@
 StreamString packet;
 StringExtractorGDBRemote response;
 const uint32_t reg = reg_info->kinds[eRegisterKindLLDB];
-packet.Printf ("P%x=", reg);
+packet.Printf ("P%x=", 

[Lldb-commits] [PATCH] D19303: Maintain register numbering across xml include features

2016-04-19 Thread Francis Ricci via lldb-commits
fjricci created this revision.
fjricci added reviewers: jingham, clayborg, jasonmolenda.
fjricci added subscribers: sas, lldb-commits.

If the remote uses include features when communicating
xml register info back to lldb, the existing code would reset the 
lldb register index at the beginning of each include node.
This would lead to multiple registers having the same lldb register index.
Since the lldb register numbers should be contiguous and unique,
maintain them accross the parsing of all of the xml feature nodes.

http://reviews.llvm.org/D19303

Files:
  source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

Index: source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===
--- source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -4372,14 +4372,11 @@
 };
 
 bool
-ParseRegisters (XMLNode feature_node, GdbServerTargetInfo _info, 
GDBRemoteDynamicRegisterInfo _reg_info, ABISP abi_sp)
+ParseRegisters (XMLNode feature_node, GdbServerTargetInfo _info, 
GDBRemoteDynamicRegisterInfo _reg_info, ABISP abi_sp, uint32_t 
_reg_num, uint32_t _offset)
 {
 if (!feature_node)
 return false;
 
-uint32_t cur_reg_num = 0;
-uint32_t reg_offset = 0;
-
 feature_node.ForEachChildElementWithName("reg", [_info, 
_reg_info, _reg_num, _offset, _sp](const XMLNode _node) -> 
bool {
 std::string gdb_group;
 std::string gdb_type;
@@ -4635,12 +4632,16 @@
 return true; // Keep iterating through all children of the 
target_node
 });
 
+// Initialize these outside of ParseRegisters, since they should 
not be reset inside each include feature
+uint32_t cur_reg_num = 0;
+uint32_t reg_offset = 0;
+
 // Don't use Process::GetABI, this code gets called from 
DidAttach, and in that context we haven't
 // set the Target's architecture yet, so the ABI is also 
potentially incorrect.
 ABISP abi_to_use_sp = ABI::FindPlugin(arch_to_use);
 if (feature_node)
 {
-ParseRegisters(feature_node, target_info, 
this->m_register_info, abi_to_use_sp);
+ParseRegisters(feature_node, target_info, 
this->m_register_info, abi_to_use_sp, cur_reg_num, reg_offset);
 }
 
 for (const auto  : target_info.includes)
@@ -4658,7 +4659,7 @@
 XMLNode include_feature_node = 
include_xml_document.GetRootElement("feature");
 if (include_feature_node)
 {
-ParseRegisters(include_feature_node, target_info, 
this->m_register_info, abi_to_use_sp);
+ParseRegisters(include_feature_node, target_info, 
this->m_register_info, abi_to_use_sp, cur_reg_num, reg_offset);
 }
 }
 this->m_register_info.Finalize(arch_to_use);


Index: source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===
--- source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -4372,14 +4372,11 @@
 };
 
 bool
-ParseRegisters (XMLNode feature_node, GdbServerTargetInfo _info, GDBRemoteDynamicRegisterInfo _reg_info, ABISP abi_sp)
+ParseRegisters (XMLNode feature_node, GdbServerTargetInfo _info, GDBRemoteDynamicRegisterInfo _reg_info, ABISP abi_sp, uint32_t _reg_num, uint32_t _offset)
 {
 if (!feature_node)
 return false;
 
-uint32_t cur_reg_num = 0;
-uint32_t reg_offset = 0;
-
 feature_node.ForEachChildElementWithName("reg", [_info, _reg_info, _reg_num, _offset, _sp](const XMLNode _node) -> bool {
 std::string gdb_group;
 std::string gdb_type;
@@ -4635,12 +4632,16 @@
 return true; // Keep iterating through all children of the target_node
 });
 
+// Initialize these outside of ParseRegisters, since they should not be reset inside each include feature
+uint32_t cur_reg_num = 0;
+uint32_t reg_offset = 0;
+
 // Don't use Process::GetABI, this code gets called from DidAttach, and in that context we haven't
 // set the Target's architecture yet, so the ABI is also potentially incorrect.
 ABISP abi_to_use_sp = ABI::FindPlugin(arch_to_use);
 if (feature_node)
 {
-ParseRegisters(feature_node, target_info, this->m_register_info, abi_to_use_sp);
+ParseRegisters(feature_node, target_info, this->m_register_info, abi_to_use_sp, cur_reg_num, reg_offset);
 }
 
 for (const auto  : target_info.includes)
@@ -4658,7 +4659,7 @@
 XMLNode include_feature_node = include_xml_document.GetRootElement("feature");
 if (include_feature_node)
 {
-ParseRegisters(include_feature_node, 

Re: [Lldb-commits] [PATCH] D19230: Properly unload modules from target image list when using svr4 packets

2016-04-18 Thread Francis Ricci via lldb-commits
fjricci added inline comments.


Comment at: source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp:4907
@@ -4883,2 +4906,3 @@
+m_process->GetTarget().ModulesDidUnload (removed_modules, false);
 
 new_modules.ForEach ([](const lldb::ModuleSP module_sp) -> bool

tfiala wrote:
> It looks like this code will unload any modules currently listed as loaded 
> via m_process->GetTarget().GetImages(), if they do not appear in the 
> module_list argument to this function.  Is that correct behavior?  (It might 
> be, but that's not what I would have guessed without digging deeper).
> 
> I might be not following the flow here correctly, though.  Can you clarify?  
> Did the full test suite run with this change?  Thanks!
So yes, this will remove any existing modules that are not in the svr4 packet, 
provided that there were modules listed in the svr4 packet (indicating that the 
remote is using the packet) - if `new_modules.GetSize() == 0`, we won't remove 
anything.

As far as I can tell from the gdb protocol specs, the svr4 packet should 
contain a list of all loaded libraries, so as long as the svr4 packet contains 
libraries, I believe that removing modules which are no longer listed is the 
correct behavior.

I did run the full suite on linux (with lldb-server), and it passes with this 
change.

As a side note, the module_list argument is actually an output parameter, 
filled by GetLoadedModuleList().


http://reviews.llvm.org/D19230



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


[Lldb-commits] [PATCH] D19230: Properly unload modules from target image list when using svr4 packets

2016-04-18 Thread Francis Ricci via lldb-commits
fjricci created this revision.
fjricci added reviewers: ADodds, zturner, tfiala.
fjricci added subscribers: sas, lldb-commits.

When we receive an svr4 packet from the remote, we check for new modules
and add them to the list of images in the target. However, we did not
do the same for modules which have been removed.

This was causing TestLoadUnload to fail when using ds2, which uses
svr4 packets to communicate all library info on Linux. This patch fixes
the failing test.

http://reviews.llvm.org/D19230

Files:
  source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

Index: source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===
--- source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -4879,7 +4879,31 @@
 
 if (new_modules.GetSize() > 0)
 {
+ModuleList removed_modules;
 Target  = GetTarget();
+ModuleList _modules = m_process->GetTarget().GetImages();
+
+for (size_t i = 0; i < loaded_modules.GetSize(); ++i)
+{
+const lldb::ModuleSP loaded_module = 
loaded_modules.GetModuleAtIndex(i);
+
+bool found = false;
+for (size_t j = 0; j < new_modules.GetSize(); ++j)
+{
+if (new_modules.GetModuleAtIndex(j).get() == 
loaded_module.get())
+found = true;
+}
+
+if (!found)
+{
+lldb_private::ObjectFile * obj = loaded_module->GetObjectFile 
();
+if (obj && obj->GetType () != 
ObjectFile::Type::eTypeExecutable)
+removed_modules.Append (loaded_module);
+}
+}
+
+loaded_modules.Remove (removed_modules);
+m_process->GetTarget().ModulesDidUnload (removed_modules, false);
 
 new_modules.ForEach ([](const lldb::ModuleSP module_sp) -> bool
 {
@@ -4895,13 +4919,11 @@
 return false;
 });
 
-ModuleList _modules = m_process->GetTarget().GetImages();
 loaded_modules.AppendIfNeeded (new_modules);
 m_process->GetTarget().ModulesDidLoad (new_modules);
 }
 
 return new_modules.GetSize();
-
 }
 
 size_t


Index: source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===
--- source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -4879,7 +4879,31 @@
 
 if (new_modules.GetSize() > 0)
 {
+ModuleList removed_modules;
 Target  = GetTarget();
+ModuleList _modules = m_process->GetTarget().GetImages();
+
+for (size_t i = 0; i < loaded_modules.GetSize(); ++i)
+{
+const lldb::ModuleSP loaded_module = loaded_modules.GetModuleAtIndex(i);
+
+bool found = false;
+for (size_t j = 0; j < new_modules.GetSize(); ++j)
+{
+if (new_modules.GetModuleAtIndex(j).get() == loaded_module.get())
+found = true;
+}
+
+if (!found)
+{
+lldb_private::ObjectFile * obj = loaded_module->GetObjectFile ();
+if (obj && obj->GetType () != ObjectFile::Type::eTypeExecutable)
+removed_modules.Append (loaded_module);
+}
+}
+
+loaded_modules.Remove (removed_modules);
+m_process->GetTarget().ModulesDidUnload (removed_modules, false);
 
 new_modules.ForEach ([](const lldb::ModuleSP module_sp) -> bool
 {
@@ -4895,13 +4919,11 @@
 return false;
 });
 
-ModuleList _modules = m_process->GetTarget().GetImages();
 loaded_modules.AppendIfNeeded (new_modules);
 m_process->GetTarget().ModulesDidLoad (new_modules);
 }
 
 return new_modules.GetSize();
-
 }
 
 size_t
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D19067: Make sure to use lib instead of lib64 for LLDB_LIB_DIR

2016-04-15 Thread Francis Ricci via lldb-commits
fjricci added a comment.

So I looked at `finishSwigPythonLLDB.py`, and it does look like that's where 
the bug is. This script sets the end of the symlink path with:

  strSrc = os.path.join("lib", "liblldb" + strLibFileExtn)

Note here that "lib" is hardcoded, and doesn't use the `LLVM_LIBDIR_SUFFIX`, 
which is why the symlink is broken. The only way I can think of to communicate 
this suffix from cmake into python would be by having cmake set an environment 
variable (presumably with the same name). Does this seem reasonable, or do you 
think there's a better solution?

The solution from `finish-swig-Python-LLDB.sh` would also probably work 
(enforcing that liblldb.so and python2.7/site-packages/lldb be in the same 
directory). That solution actually would be more consistent with the way the 
unit test suite works anyway. It does seem less flexible though.


http://reviews.llvm.org/D19067



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


Re: [Lldb-commits] [PATCH] D19067: Make sure to use lib instead of lib64 for LLDB_LIB_DIR

2016-04-14 Thread Francis Ricci via lldb-commits
fjricci added a comment.

When I use LLVM_LIBDIR_SUFFIX=64, it looks like the python _lldb.so symlink 
still points to build/lib/liblldb.so, instead of using the lib64 directory. So 
if I do this, none of the tests will run on the check-lldb target, since 
importing lldb in python fails.

Perhaps this symlink is the bug that should be fixed? However, it appears that 
finish-swig-Python-LLDB.sh already has the correct logic for this, so it's not 
immediately clear to me why the symlink is incorrect (if this seems like a bug 
we want fixed, I'll investigate):

  ln -s "../../../liblldb${SOEXT}" _lldb.so


http://reviews.llvm.org/D19067



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


[Lldb-commits] [PATCH] D19082: Store absolute path for lldb executable in dotest.py

2016-04-13 Thread Francis Ricci via lldb-commits
fjricci created this revision.
fjricci added reviewers: vharron, zturner, tfiala.
fjricci added subscribers: sas, lldb-commits.

lldb-server tests are currently being skipped on the 
check-lldb target. This is because we get the path of 
lldb-server by modifying the path to the lldb executable.
However, by this point, we've changed directories, and a 
relative path to the build/bin directory will no longer point
to the location of lldb-server.

Storing an absolute path solves this issue.

http://reviews.llvm.org/D19082

Files:
  packages/Python/lldbsuite/test/dotest.py

Index: packages/Python/lldbsuite/test/dotest.py
===
--- packages/Python/lldbsuite/test/dotest.py
+++ packages/Python/lldbsuite/test/dotest.py
@@ -309,7 +309,7 @@
 configuration.lldbFrameworkPath = args.framework
 
 if args.executable:
-lldbtest_config.lldbExec = args.executable
+lldbtest_config.lldbExec = os.path.realpath(args.executable)
 
 if args.p:
 if args.p.startswith('-'):


Index: packages/Python/lldbsuite/test/dotest.py
===
--- packages/Python/lldbsuite/test/dotest.py
+++ packages/Python/lldbsuite/test/dotest.py
@@ -309,7 +309,7 @@
 configuration.lldbFrameworkPath = args.framework
 
 if args.executable:
-lldbtest_config.lldbExec = args.executable
+lldbtest_config.lldbExec = os.path.realpath(args.executable)
 
 if args.p:
 if args.p.startswith('-'):
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D19067: Make sure to use lib instead of lib64 for LLDB_LIB_DIR

2016-04-13 Thread Francis Ricci via lldb-commits
fjricci created this revision.
fjricci added reviewers: zturner, vharron, emaste.
fjricci added subscribers: sas, lldb-commits.

$(lldb -P)/../../ is assumed to be the lldb library directory
by the test suite. However, it is possible that the python
libs would be installed in build/lib64 instead of build/lib.
Since liblldb.so is always installed in lib,
make sure this is always used as LLDB_LIB_DIR.

In cases where the python libs were already in build/lib, this
patch will not affect LLDB_LIB_DIR.

http://reviews.llvm.org/D19067

Files:
  packages/Python/lldbsuite/test/dotest.py

Index: packages/Python/lldbsuite/test/dotest.py
===
--- packages/Python/lldbsuite/test/dotest.py
+++ packages/Python/lldbsuite/test/dotest.py
@@ -635,7 +635,7 @@
 if len(lines) >= 1 and os.path.isfile(os.path.join(lines[-1], 
init_in_python_dir)):
 lldbPythonDir = lines[-1]
 if "freebsd" in sys.platform or "linux" in sys.platform:
-os.environ['LLDB_LIB_DIR'] = os.path.join(lldbPythonDir, 
'..', '..')
+os.environ['LLDB_LIB_DIR'] = os.path.join(lldbPythonDir, 
'..', '..', '..', 'lib')
 
 if not lldbPythonDir:
 if platform.system() == "Darwin":


Index: packages/Python/lldbsuite/test/dotest.py
===
--- packages/Python/lldbsuite/test/dotest.py
+++ packages/Python/lldbsuite/test/dotest.py
@@ -635,7 +635,7 @@
 if len(lines) >= 1 and os.path.isfile(os.path.join(lines[-1], init_in_python_dir)):
 lldbPythonDir = lines[-1]
 if "freebsd" in sys.platform or "linux" in sys.platform:
-os.environ['LLDB_LIB_DIR'] = os.path.join(lldbPythonDir, '..', '..')
+os.environ['LLDB_LIB_DIR'] = os.path.join(lldbPythonDir, '..', '..', '..', 'lib')
 
 if not lldbPythonDir:
 if platform.system() == "Darwin":
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D18807: Add missing qRegisterInfo option to gdbremote testcase

2016-04-05 Thread Francis Ricci via lldb-commits
fjricci created this revision.
fjricci added reviewers: jasonmolenda, tfiala, clayborg.
fjricci added subscribers: sas, lldb-commits.

"gcc" is equivalent to "ehframe" in ProcessGDBRemote, but
only "ehframe" was a valid response in the test suite.

I know that "gcc" was replaced by "ehframe" in the test suite in D247741,
but since it hasn't been removed from ProcessGDBRemote, I'm
assuming that it's still a valid parameter.

http://reviews.llvm.org/D18807

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

Index: packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
===
--- packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
+++ packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
@@ -630,6 +630,7 @@
 "encoding",
 "format",
 "set",
+"gcc",
 "ehframe",
 "dwarf",
 "generic",


Index: packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
===
--- packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
+++ packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
@@ -630,6 +630,7 @@
 "encoding",
 "format",
 "set",
+"gcc",
 "ehframe",
 "dwarf",
 "generic",
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D18779: Fix dotest.py '-p' option for multi-process mode

2016-04-04 Thread Francis Ricci via lldb-commits
fjricci created this revision.
fjricci added reviewers: zturner, tfiala.
fjricci added subscribers: sas, lldb-commits.

The '-p' option for dotest.py was ignored in multiprocess mode,
as the -p argument to the inferior would overwrite the -p argument
passed on the command line.

http://reviews.llvm.org/D18779

Files:
  packages/Python/lldbsuite/test/dosep.py

Index: packages/Python/lldbsuite/test/dosep.py
===
--- packages/Python/lldbsuite/test/dosep.py
+++ packages/Python/lldbsuite/test/dosep.py
@@ -420,6 +420,10 @@
 results = []
 for (base_name, full_test_path) in files:
 import __main__ as main
+global dotest_options
+if dotest_options.p and not re.search(dotest_options.p, base_name):
+continue
+
 script_file = main.__file__
 command = ([sys.executable, script_file] +
dotest_argv +


Index: packages/Python/lldbsuite/test/dosep.py
===
--- packages/Python/lldbsuite/test/dosep.py
+++ packages/Python/lldbsuite/test/dosep.py
@@ -420,6 +420,10 @@
 results = []
 for (base_name, full_test_path) in files:
 import __main__ as main
+global dotest_options
+if dotest_options.p and not re.search(dotest_options.p, base_name):
+continue
+
 script_file = main.__file__
 command = ([sys.executable, script_file] +
dotest_argv +
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D18631: Make sure to update Target arch if environment changed

2016-03-31 Thread Francis Ricci via lldb-commits
fjricci added a comment.

android is detected from the ELF, so we can get around using the gdb-remote 
info.


http://reviews.llvm.org/D18631



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


[Lldb-commits] [PATCH] D18631: Make sure to update Target arch if environment changed

2016-03-30 Thread Francis Ricci via lldb-commits
fjricci created this revision.
fjricci added reviewers: jasonmolenda, tfiala, clayborg.
fjricci added subscribers: sas, lldb-commits.
Herald added subscribers: danalbert, tberghammer.

Fixes "target list" for non-android linux platforms (ie gnu, gnueabi)

http://reviews.llvm.org/D18631

Files:
  source/Target/Target.cpp

Index: source/Target/Target.cpp
===
--- source/Target/Target.cpp
+++ source/Target/Target.cpp
@@ -1301,7 +1301,7 @@
   os_ver_changed,
   env_changed);
 
-if (!arch_changed && !vendor_changed && !os_changed)
+if (!arch_changed && !vendor_changed && !os_changed && 
!env_changed)
 replace_local_arch = false;
 }
 }


Index: source/Target/Target.cpp
===
--- source/Target/Target.cpp
+++ source/Target/Target.cpp
@@ -1301,7 +1301,7 @@
   os_ver_changed,
   env_changed);
 
-if (!arch_changed && !vendor_changed && !os_changed)
+if (!arch_changed && !vendor_changed && !os_changed && !env_changed)
 replace_local_arch = false;
 }
 }
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D18621: Allow remote to update individual arch triple components

2016-03-30 Thread Francis Ricci via lldb-commits
fjricci abandoned this revision.
fjricci added a comment.

Doesn't appear necessary after applying http://reviews.llvm.org/D18620


http://reviews.llvm.org/D18621



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


[Lldb-commits] [PATCH] D18621: Allow remote to update individual arch triple components

2016-03-30 Thread Francis Ricci via lldb-commits
fjricci created this revision.
fjricci added reviewers: clayborg, tfiala, tberghammer.
fjricci added subscribers: sas, lldb-commits.
Herald added subscribers: danalbert, tberghammer, aemerson.

If we determine an OS from the executable, but not an environment,
the existing code will not update the target triple to add an
environment provided by the remote.

This manifests if we have an android exe, where we could parse
arm-*-linux from the ELF, but then the remote gives a triple of
arm-*-linux-android. The existing code will not update the
environment in this case, because the OS has not changed.

http://reviews.llvm.org/D18621

Files:
  source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

Index: source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===
--- source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -1220,19 +1220,20 @@
 if (new_target_triple.getVendorName().size() == 0)
 {
 new_target_triple.setVendor 
(remote_triple.getVendor());
+}
+if (new_target_triple.getOSName().size() == 0)
+{
+new_target_triple.setOS (remote_triple.getOS());
 
-if (new_target_triple.getOSName().size() == 0)
-{
-new_target_triple.setOS (remote_triple.getOS());
-
-if (new_target_triple.getEnvironmentName().size() 
== 0)
-new_target_triple.setEnvironment 
(remote_triple.getEnvironment());
-}
-
-ArchSpec new_target_arch = target_arch;
-new_target_arch.SetTriple(new_target_triple);
-GetTarget().SetArchitecture(new_target_arch);
 }
+if (new_target_triple.getEnvironmentName().size() == 0)
+{
+new_target_triple.setEnvironment 
(remote_triple.getEnvironment());
+}
+
+ArchSpec new_target_arch = target_arch;
+new_target_arch.SetTriple(new_target_triple);
+GetTarget().SetArchitecture(new_target_arch);
 }
 
 if (log)


Index: source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===
--- source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -1220,19 +1220,20 @@
 if (new_target_triple.getVendorName().size() == 0)
 {
 new_target_triple.setVendor (remote_triple.getVendor());
+}
+if (new_target_triple.getOSName().size() == 0)
+{
+new_target_triple.setOS (remote_triple.getOS());
 
-if (new_target_triple.getOSName().size() == 0)
-{
-new_target_triple.setOS (remote_triple.getOS());
-
-if (new_target_triple.getEnvironmentName().size() == 0)
-new_target_triple.setEnvironment (remote_triple.getEnvironment());
-}
-
-ArchSpec new_target_arch = target_arch;
-new_target_arch.SetTriple(new_target_triple);
-GetTarget().SetArchitecture(new_target_arch);
 }
+if (new_target_triple.getEnvironmentName().size() == 0)
+{
+new_target_triple.setEnvironment (remote_triple.getEnvironment());
+}
+
+ArchSpec new_target_arch = target_arch;
+new_target_arch.SetTriple(new_target_triple);
+GetTarget().SetArchitecture(new_target_arch);
 }
 
 if (log)
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D18620: Print environment when dumping arch triple

2016-03-30 Thread Francis Ricci via lldb-commits
fjricci created this revision.
fjricci added reviewers: tfiala, clayborg.
fjricci added subscribers: sas, lldb-commits.

Print environment from triple if it exists.

http://reviews.llvm.org/D18620

Files:
  source/Core/ArchSpec.cpp

Index: source/Core/ArchSpec.cpp
===
--- source/Core/ArchSpec.cpp
+++ source/Core/ArchSpec.cpp
@@ -1529,10 +1529,14 @@
 llvm::StringRef arch_str = triple.getArchName();
 llvm::StringRef vendor_str = triple.getVendorName();
 llvm::StringRef os_str = triple.getOSName();
+llvm::StringRef environ_str = triple.getEnvironmentName();
 
 s.Printf("%s-%s-%s",
  arch_str.empty() ? "*" : arch_str.str().c_str(),
  vendor_str.empty() ? "*" : vendor_str.str().c_str(),
  os_str.empty() ? "*" : os_str.str().c_str()
  );
+
+if (!environ_str.empty())
+s.Printf("-%s", environ_str.str().c_str());
 }


Index: source/Core/ArchSpec.cpp
===
--- source/Core/ArchSpec.cpp
+++ source/Core/ArchSpec.cpp
@@ -1529,10 +1529,14 @@
 llvm::StringRef arch_str = triple.getArchName();
 llvm::StringRef vendor_str = triple.getVendorName();
 llvm::StringRef os_str = triple.getOSName();
+llvm::StringRef environ_str = triple.getEnvironmentName();
 
 s.Printf("%s-%s-%s",
  arch_str.empty() ? "*" : arch_str.str().c_str(),
  vendor_str.empty() ? "*" : vendor_str.str().c_str(),
  os_str.empty() ? "*" : os_str.str().c_str()
  );
+
+if (!environ_str.empty())
+s.Printf("-%s", environ_str.str().c_str());
 }
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D18531: Allow gdbremote process to read modules from memory

2016-03-29 Thread Francis Ricci via lldb-commits
fjricci updated this revision to Diff 51962.
fjricci added a comment.

Refactor to remove code duplication


http://reviews.llvm.org/D18531

Files:
  include/lldb/Target/DynamicLoader.h
  source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp
  source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.h
  source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
  source/Plugins/Process/gdb-remote/ProcessGDBRemote.h

Index: source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
===
--- source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
+++ source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
@@ -468,7 +468,8 @@
 GetLoadedModuleList (LoadedModuleInfoList &);
 
 lldb::ModuleSP
-LoadModuleAtAddress (const FileSpec , lldb::addr_t base_addr, bool value_is_offset);
+LoadModuleAtAddress (const FileSpec , lldb::addr_t link_map, lldb::addr_t base_addr,
+ bool value_is_offset);
 
 private:
 //--
Index: source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===
--- source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -4804,25 +4804,14 @@
 }
 
 lldb::ModuleSP
-ProcessGDBRemote::LoadModuleAtAddress (const FileSpec , lldb::addr_t base_addr, bool value_is_offset)
+ProcessGDBRemote::LoadModuleAtAddress (const FileSpec , lldb::addr_t link_map,
+   lldb::addr_t base_addr, bool value_is_offset)
 {
-Target  = m_process->GetTarget();
-ModuleList  = target.GetImages();
-ModuleSP module_sp;
+DynamicLoader *loader = GetDynamicLoader();
+if (!loader)
+return nullptr;
 
-bool changed = false;
-
-ModuleSpec module_spec (file, target.GetArchitecture());
-if ((module_sp = modules.FindFirstModule (module_spec)))
-{
-module_sp->SetLoadAddress (target, base_addr, value_is_offset, changed);
-}
-else if ((module_sp = target.GetSharedModule (module_spec)))
-{
-module_sp->SetLoadAddress (target, base_addr, value_is_offset, changed);
-}
-
-return module_sp;
+return loader->LoadModuleAtAddress(file, link_map, base_addr, value_is_offset);
 }
 
 size_t
@@ -4841,6 +4830,7 @@
 {
 std::string  mod_name;
 lldb::addr_t mod_base;
+lldb::addr_t link_map;
 bool mod_base_is_offset;
 
 bool valid = true;
@@ -4850,15 +4840,19 @@
 if (!valid)
 continue;
 
+if (!modInfo.get_link_map (link_map))
+link_map = LLDB_INVALID_ADDRESS;
+
 // hack (cleaner way to get file name only?) (win/unix compat?)
 size_t marker = mod_name.rfind ('/');
 if (marker == std::string::npos)
 marker = 0;
 else
 marker += 1;
 
 FileSpec file (mod_name.c_str()+marker, true);
-lldb::ModuleSP module_sp = LoadModuleAtAddress (file, mod_base, mod_base_is_offset);
+lldb::ModuleSP module_sp = LoadModuleAtAddress (file, link_map, mod_base,
+mod_base_is_offset);
 
 if (module_sp.get())
 new_modules.Append (module_sp);
Index: source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.h
===
--- source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.h
+++ source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.h
@@ -123,14 +123,6 @@
 void
 UnloadSections(const lldb::ModuleSP module) override;
 
-/// Locates or creates a module given by @p file and updates/loads the
-/// resulting module at the virtual base address @p base_addr.
-lldb::ModuleSP
-LoadModuleAtAddress(const lldb_private::FileSpec ,
-lldb::addr_t link_map_addr,
-lldb::addr_t base_addr,
-bool base_addr_is_offset) override;
-
 /// Callback routine invoked when we hit the breakpoint on process entry.
 ///
 /// This routine is responsible for resolving the load addresses of all
Index: source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp
===
--- source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp
+++ source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp
@@ -574,34 +574,6 @@
 m_process->GetTarget().ModulesDidLoad(module_list);
 }
 
-/// Helper for the entry breakpoint callback.  Resolves the load addresses
-/// of all dependent modules.
-ModuleSP
-DynamicLoaderHexagonDYLD::LoadModuleAtAddress(const FileSpec ,
-  addr_t link_map_addr,
-  addr_t base_addr,
-

Re: [Lldb-commits] [PATCH] D18531: Allow gdbremote process to read modules from memory

2016-03-29 Thread Francis Ricci via lldb-commits
fjricci added a comment.

I see that DynamicLoaderHexagonDYLD also has a LoadModuleAtAddress function, 
which seems to be the same as the one in DynamicLoader, except that the member 
functions it calls are overloaded, and it is also missing the newly added 
ReadFromMemory code.

I think this function should be safe to remove, but I wanted to double check 
before I do that.


http://reviews.llvm.org/D18531



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


Re: [Lldb-commits] [PATCH] D18531: Allow gdbremote process to read modules from memory

2016-03-29 Thread Francis Ricci via lldb-commits
fjricci added a comment.

That was actually one of the fixes I originally tried. My only concern is that 
LoadModuleAtAddress is a protected method in the dynamic loader. If you think 
it's fine to change it to public, I'll go ahead and do that.


http://reviews.llvm.org/D18531



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


[Lldb-commits] [PATCH] D18531: Allow gdbremote process to read modules from memory

2016-03-28 Thread Francis Ricci via lldb-commits
fjricci created this revision.
fjricci added reviewers: tberghammer, ADodds, tfiala.
fjricci added subscribers: sas, lldb-commits.

The logic to read modules from memory was added to LoadModuleAtAddress
in the dynamic loader, but not in process gdb remote. This means that when
the remote uses svr4 packets to give library info, libraries only present
on the remote will not be loaded.

This patch therefore involves some code duplication from LoadModuleAtAddress
in the dynamic loader, but removing this would require some amount of code
refactoring.

http://reviews.llvm.org/D18531

Files:
  source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

Index: source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===
--- source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -4821,6 +4821,25 @@
 {
 module_sp->SetLoadAddress (target, base_addr, value_is_offset, 
changed);
 }
+else
+{
+if (value_is_offset)
+{
+// Try to fetch the load address of the file from the process as 
we need absolute load
+// address to read the file out of the memory instead of a load 
bias.
+bool is_loaded;
+lldb::addr_t load_addr;
+Error error = GetFileLoadAddress (file, is_loaded, load_addr);
+if (error.Success() && is_loaded)
+base_addr = load_addr;
+}
+
+if ((module_sp = ReadModuleFromMemory (file, base_addr)))
+{
+module_sp->SetLoadAddress (target, base_addr, false, changed);
+target.GetImages().AppendIfNeeded (module_sp);
+}
+}
 
 return module_sp;
 }


Index: source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===
--- source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -4821,6 +4821,25 @@
 {
 module_sp->SetLoadAddress (target, base_addr, value_is_offset, changed);
 }
+else
+{
+if (value_is_offset)
+{
+// Try to fetch the load address of the file from the process as we need absolute load
+// address to read the file out of the memory instead of a load bias.
+bool is_loaded;
+lldb::addr_t load_addr;
+Error error = GetFileLoadAddress (file, is_loaded, load_addr);
+if (error.Success() && is_loaded)
+base_addr = load_addr;
+}
+
+if ((module_sp = ReadModuleFromMemory (file, base_addr)))
+{
+module_sp->SetLoadAddress (target, base_addr, false, changed);
+target.GetImages().AppendIfNeeded (module_sp);
+}
+}
 
 return module_sp;
 }
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D16488: Fix getCompiler in unit testing framework on compiler symlinks

2016-03-25 Thread Francis Ricci via lldb-commits
fjricci abandoned this revision.
fjricci added a comment.

Committed.


http://reviews.llvm.org/D16488



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


Re: [Lldb-commits] [PATCH] D18459: Fix FILE * leak in Python API

2016-03-25 Thread Francis Ricci via lldb-commits
fjricci abandoned this revision.
fjricci added a comment.

Committed.


http://reviews.llvm.org/D18459



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


  1   2   >