Re: [Lldb-commits] [lldb] r349397 - Remove sleep() synchronisation from teststcase and

2018-12-18 Thread Pavel Labath via lldb-commits
Not that I want to defend the use of sleep, but my expectation  is that 
this will the test even more flaky.


The only thing that test does after attaching is verifying the process 
backtrace to check that it contains the "main" function. If the test 
doesn't sleep, it increases the likelyhood that you will attach before 
it even enters the main function. This may be particularly true on 
linux, where the process needs to invoke a special api (PR_SET_TRACER) 
before we can attach to it, and so the even the attach will fail if it's 
done too early.


One of the patterns for synchronization we have in other tests is to 
have the inferior create a file when it reaches the "safe to attach" 
point. The test then waits for this file to appear 
(lldbutil.wait_for_file_on_target) before proceeding. This still uses 
sleep() under the hood, but only because we don't have/don't want to 
implement a wait_for_file blocking api. In the end it still provides a 
more predictable state of the process we attach to.


On 17/12/2018 22:18, Adrian Prantl via lldb-commits wrote:

Author: adrian
Date: Mon Dec 17 13:18:11 2018
New Revision: 349397

URL: http://llvm.org/viewvc/llvm-project?rev=349397&view=rev
Log:
Remove sleep() synchronisation from teststcase and
make the executable name more unique.

This test is failing sporadically on some bots. By removing the sleep
synchronisation, I'm hoping to get it to fail more reproducibly so I
can investigate what is going on.

Modified:
 
lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py?rev=349397&r1=349396&r2=349397&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py
 Mon Dec 17 13:18:11 2018
@@ -35,7 +35,7 @@ class HelloWorldTestCase(TestBase):
  def test_with_process_launch_api(self):
  """Create target, breakpoint, launch a process, and then kill it."""
  # Get the full path to our executable to be attached/debugged.
-exe = self.getBuildArtifact(self.testMethodName)
+exe = '%s_%d'%(self.getBuildArtifact(self.testMethodName), os.getpid())
  d = {'EXE': exe}
  self.build(dictionary=d)
  self.setTearDownCleanup(dictionary=d)
@@ -82,7 +82,7 @@ class HelloWorldTestCase(TestBase):
  @expectedFailureAll(oslist=['ios', 'watchos', 'tvos', 'bridgeos'], 
bugnumber="") # old lldb-server has race condition, 
launching an inferior and then launching debugserver in quick succession sometimes fails
  def test_with_attach_to_process_with_id_api(self):
  """Create target, spawn a process, and attach to it with process 
id."""
-exe = self.getBuildArtifact(self.testMethodName)
+exe = '%s_%d'%(self.getBuildArtifact(self.testMethodName), os.getpid())
  d = {'EXE': exe}
  self.build(dictionary=d)
  self.setTearDownCleanup(dictionary=d)
@@ -92,9 +92,6 @@ class HelloWorldTestCase(TestBase):
  popen = self.spawnSubprocess(exe, ["abc", "xyz"])
  self.addTearDownHook(self.cleanupSubprocesses)
  
-# Give the subprocess time to start and wait for user input

-time.sleep(0.25)
-
  listener = lldb.SBListener("my.attach.listener")
  error = lldb.SBError()
  process = target.AttachToProcessWithID(listener, popen.pid, error)
@@ -114,7 +111,7 @@ class HelloWorldTestCase(TestBase):
  @expectedFailureAll(oslist=['ios', 'watchos', 'tvos', 'bridgeos'], 
bugnumber="") # old lldb-server has race condition, 
launching an inferior and then launching debugserver in quick succession sometimes fails
  def test_with_attach_to_process_with_name_api(self):
  """Create target, spawn a process, and attach to it with process 
name."""
-exe = self.getBuildArtifact(self.testMethodName)
+exe = '%s_%d'%(self.getBuildArtifact(self.testMethodName), os.getpid())
  d = {'EXE': exe}
  self.build(dictionary=d)
  self.setTearDownCleanup(dictionary=d)
@@ -124,9 +121,6 @@ class HelloWorldTestCase(TestBase):
  popen = self.spawnSubprocess(exe, ["abc", "xyz"])
  self.addTearDownHook(self.cleanupSubprocesses)
  
-# Give the subprocess time to start and wait for user input

-time.sleep(0.25)
-
  listener = lldb.SBListener("my.attach.listener")
  error = lldb.SBError()
  # Pass 'False' since we don't want to wait for new instance of


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




[Lldb-commits] [lldb] r349461 - build.py: inherit environment in the gcc builder

2018-12-18 Thread Pavel Labath via lldb-commits
Author: labath
Date: Tue Dec 18 01:07:21 2018
New Revision: 349461

URL: http://llvm.org/viewvc/llvm-project?rev=349461&view=rev
Log:
build.py: inherit environment in the gcc builder

Summary:
This should enable the compiler to find the system linker for the link
step.

Reviewers: stella.stamenova, zturner

Subscribers: lldb-commits

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

Modified:
lldb/trunk/lit/helper/build.py

Modified: lldb/trunk/lit/helper/build.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/helper/build.py?rev=349461&r1=349460&r2=349461&view=diff
==
--- lldb/trunk/lit/helper/build.py (original)
+++ lldb/trunk/lit/helper/build.py Tue Dec 18 01:07:21 2018
@@ -153,6 +153,9 @@ def format_text(lines, indent_0, indent_
 return result
 
 def print_environment(env):
+if env is None:
+print('Inherited')
+return
 for e in env:
 value = env[e]
 lines = value.split(os.pathsep)
@@ -633,7 +636,7 @@ class GccBuilder(Builder):
 args.extend(['-o', obj])
 args.append(source)
 
-return ('compiling', [source], obj, {}, args)
+return ('compiling', [source], obj, None, args)
 
 def _get_link_command(self):
 args = []
@@ -649,7 +652,7 @@ class GccBuilder(Builder):
 args.extend(['-o', self._exe_file_name()])
 args.extend(self._obj_file_names())
 
-return ('linking', self._obj_file_names(), self._exe_file_name(), {}, 
args)
+return ('linking', self._obj_file_names(), self._exe_file_name(), 
None, args)
 
 
 def output_files(self):


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


[Lldb-commits] [PATCH] D55736: build.py: inherit environment in the gcc builder

2018-12-18 Thread Pavel Labath via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rLLDB349461: build.py: inherit environment in the gcc builder 
(authored by labath, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D55736?vs=178356&id=178620#toc

Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55736/new/

https://reviews.llvm.org/D55736

Files:
  lit/helper/build.py


Index: lit/helper/build.py
===
--- lit/helper/build.py
+++ lit/helper/build.py
@@ -153,6 +153,9 @@
 return result
 
 def print_environment(env):
+if env is None:
+print('Inherited')
+return
 for e in env:
 value = env[e]
 lines = value.split(os.pathsep)
@@ -633,7 +636,7 @@
 args.extend(['-o', obj])
 args.append(source)
 
-return ('compiling', [source], obj, {}, args)
+return ('compiling', [source], obj, None, args)
 
 def _get_link_command(self):
 args = []
@@ -649,7 +652,7 @@
 args.extend(['-o', self._exe_file_name()])
 args.extend(self._obj_file_names())
 
-return ('linking', self._obj_file_names(), self._exe_file_name(), {}, 
args)
+return ('linking', self._obj_file_names(), self._exe_file_name(), 
None, args)
 
 
 def output_files(self):


Index: lit/helper/build.py
===
--- lit/helper/build.py
+++ lit/helper/build.py
@@ -153,6 +153,9 @@
 return result
 
 def print_environment(env):
+if env is None:
+print('Inherited')
+return
 for e in env:
 value = env[e]
 lines = value.split(os.pathsep)
@@ -633,7 +636,7 @@
 args.extend(['-o', obj])
 args.append(source)
 
-return ('compiling', [source], obj, {}, args)
+return ('compiling', [source], obj, None, args)
 
 def _get_link_command(self):
 args = []
@@ -649,7 +652,7 @@
 args.extend(['-o', self._exe_file_name()])
 args.extend(self._obj_file_names())
 
-return ('linking', self._obj_file_names(), self._exe_file_name(), {}, args)
+return ('linking', self._obj_file_names(), self._exe_file_name(), None, args)
 
 
 def output_files(self):
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D55718: [ARC] Basic support in gdb-remote process plugin

2018-12-18 Thread Tatyana Krasnukha via Phabricator via lldb-commits
tatyana-krasnukha marked 2 inline comments as done.
tatyana-krasnukha added a comment.

My intent was to move ARC-specific code to the architecture plugin as much as 
possible, but it requires to add undesired dependencies to Architecture 
interface. So, you are right, it seems to be better to keep these functions in 
ProcessGDBRemote.cpp and remove ArcArchitecture plugin at all.




Comment at: include/lldb/Core/Architecture.h:15
 
+class DynamicRegisterInfo;
+

clayborg wrote:
> Is DynamicRegisterInfo really in the top level namespace?
Yes, it is, just double-checked



Comment at: source/Target/Target.cpp:74
   m_spec = spec;
-  m_plugin_up = PluginManager::CreateArchitectureInstance(spec);
+  m_plugin_up = PluginManager::CreateArchitectureInstance(m_spec);
   return *this;

clayborg wrote:
> is this change needed?
These 2 changes were needed because ArcArchitecture held a reference to m_spec


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55718/new/

https://reviews.llvm.org/D55718



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


[Lldb-commits] [lldb] r349478 - Un-XFAIL TestNamespaceLookup for linux

2018-12-18 Thread Pavel Labath via lldb-commits
Author: labath
Date: Tue Dec 18 04:55:30 2018
New Revision: 349478

URL: http://llvm.org/viewvc/llvm-project?rev=349478&view=rev
Log:
Un-XFAIL TestNamespaceLookup for linux

These tests are now passing on linux, at least with top-of-tree clang,
clang-6 and gcc-7.3. It's possible it may still be failing with some
older compilers, but I don't have those around to test.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespaceLookup.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespaceLookup.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespaceLookup.py?rev=349478&r1=349477&r2=349478&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespaceLookup.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespaceLookup.py
 Tue Dec 18 04:55:30 2018
@@ -42,10 +42,7 @@ class NamespaceLookupTestCase(TestBase):
  'stop reason = breakpoint'])
 
 @expectedFailureAll(
-oslist=[
-"windows",
-"linux",
-"freebsd"],
+oslist=["windows", "freebsd"],
 bugnumber="llvm.org/pr25819")
 def test_scope_lookup_with_run_command(self):
 """Test scope lookup of functions in lldb."""
@@ -230,10 +227,7 @@ class NamespaceLookupTestCase(TestBase):
 oslist=["linux"],
 debug_info=["dwo"])  # Skip to avoid crash
 @expectedFailureAll(
-oslist=[
-"windows",
-"linux",
-"freebsd"],
+oslist=["windows", "freebsd"],
 bugnumber="llvm.org/pr25819")
 def test_scope_after_using_directive_lookup_with_run_command(self):
 """Test scope lookup after using directive in lldb."""
@@ -297,10 +291,7 @@ class NamespaceLookupTestCase(TestBase):
 self.expect("expr -- func()", startstr="error")
 
 @expectedFailureAll(
-oslist=[
-"windows",
-"linux",
-"freebsd"],
+oslist=["windows", "freebsd"],
 bugnumber="llvm.org/pr25819")
 def test_scope_lookup_shadowed_by_using_with_run_command(self):
 """Test scope lookup shadowed by using in lldb."""


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


[Lldb-commits] [PATCH] D55718: [ARC] Basic support in gdb-remote process plugin

2018-12-18 Thread Tatyana Krasnukha via Phabricator via lldb-commits
tatyana-krasnukha updated this revision to Diff 178643.
tatyana-krasnukha added a comment.

Addressed review comments


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55718/new/

https://reviews.llvm.org/D55718

Files:
  include/lldb/Utility/ArchSpec.h
  source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
  source/Plugins/Process/Utility/DynamicRegisterInfo.h
  source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
  source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
  source/Target/Platform.cpp
  source/Target/Target.cpp
  source/Target/Thread.cpp
  source/Utility/ArchSpec.cpp

Index: source/Utility/ArchSpec.cpp
===
--- source/Utility/ArchSpec.cpp
+++ source/Utility/ArchSpec.cpp
@@ -221,7 +221,8 @@
 {eByteOrderLittle, 4, 1, 1, llvm::Triple::kalimba, ArchSpec::eCore_kalimba4,
  "kalimba4"},
 {eByteOrderLittle, 4, 1, 1, llvm::Triple::kalimba, ArchSpec::eCore_kalimba5,
- "kalimba5"}};
+ "kalimba5"},
+{eByteOrderLittle, 4, 2, 4, llvm::Triple::arc, ArchSpec::eCore_arc, "arc"}};
 
 // Ensure that we have an entry in the g_core_definitions for each core. If you
 // comment out an entry above, you will need to comment out the corresponding
@@ -458,7 +459,9 @@
 {ArchSpec::eCore_kalimba4, llvm::ELF::EM_CSR_KALIMBA,
  llvm::Triple::KalimbaSubArch_v4, 0xu, 0xu}, // KALIMBA
 {ArchSpec::eCore_kalimba5, llvm::ELF::EM_CSR_KALIMBA,
- llvm::Triple::KalimbaSubArch_v5, 0xu, 0xu} // KALIMBA
+ llvm::Triple::KalimbaSubArch_v5, 0xu, 0xu}, // KALIMBA
+{ArchSpec::eCore_arc, llvm::ELF::EM_ARC_COMPACT2, LLDB_INVALID_CPUTYPE,
+ 0xu, 0xu } // ARC
 };
 
 static const ArchDefinition g_elf_arch_def = {
Index: source/Target/Thread.cpp
===
--- source/Target/Thread.cpp
+++ source/Target/Thread.cpp
@@ -2058,6 +2058,7 @@
 switch (machine) {
 case llvm::Triple::x86_64:
 case llvm::Triple::x86:
+case llvm::Triple::arc:
 case llvm::Triple::arm:
 case llvm::Triple::aarch64:
 case llvm::Triple::thumb:
Index: source/Target/Target.cpp
===
--- source/Target/Target.cpp
+++ source/Target/Target.cpp
@@ -1527,7 +1527,7 @@
   os_changed, os_ver_changed, env_changed);
 
 if (!arch_changed && !vendor_changed && !os_changed && !env_changed)
-  replace_local_arch = false;
+  replace_local_arch = arch_spec.GetFlags() != m_arch.GetSpec().GetFlags();
   }
 }
   }
Index: source/Target/Platform.cpp
===
--- source/Target/Platform.cpp
+++ source/Target/Platform.cpp
@@ -1869,6 +1869,12 @@
   size_t trap_opcode_size = 0;
 
   switch (arch.GetMachine()) {
+  case llvm::Triple::arc: {
+static const uint8_t g_hex_opcode[] = { 0xff, 0x7f };
+trap_opcode = g_hex_opcode;
+trap_opcode_size = sizeof(g_hex_opcode);
+  } break;
+
   case llvm::Triple::aarch64: {
 static const uint8_t g_aarch64_opcode[] = {0x00, 0x00, 0x20, 0xd4};
 trap_opcode = g_aarch64_opcode;
Index: source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===
--- source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -4525,6 +4525,58 @@
 
 } // namespace
 
+namespace arc {
+// Adjust architecture according to ARC build configuration registers.
+bool ConfigureArchitecture(ProcessGDBRemote &process,
+   const GDBRemoteDynamicRegisterInfo &dyn_reg_info,
+   ArchSpec& arch_to_use) {
+  // Obtain register file size from the RF_BUILD register.
+  static ConstString reg_name("rf_build");
+  const bool case_sensitive = false;
+  auto rf_build_info = dyn_reg_info.GetRegisterInfo(reg_name, case_sensitive);
+  if(nullptr == rf_build_info)
+return false;
+
+  const auto tid = LLDB_INVALID_THREAD_ID; // BCRs are not context-dependent.
+  // Cannot use GDBRemoteRegisterContext here, it is not created yet.
+  DataBufferSP buffer_sp = process.GetGDBRemote().ReadRegister(tid,
+  rf_build_info->kinds[eRegisterKindProcessPlugin]);
+  if (!buffer_sp || buffer_sp->GetByteSize() < rf_build_info->byte_size)
+return false;
+
+  if (0 != (buffer_sp->GetData()[1] & ArchSpec::eARC_rf16)) {
+// The target is configured to use reduced register file.
+arch_to_use.SetFlags(ArchSpec::eARC_rf16);
+// ABI uses this information to determine how many registers it may
+// use to pass arguments in a function.
+process.GetTarget().SetArchitecture(arch_to_use);
+  }
+  return true;
+}
+
+void AdjustRegisterInfo(DynamicRegisterInfo ®_info, const ArchSpec &arch) {
+  auto reg_count = reg_info.GetNumRegisters();
+  declt

[Lldb-commits] [lldb] r349479 - Un-XFAIL TestExitDuringBreak.py for linux

2018-12-18 Thread Pavel Labath via lldb-commits
Author: labath
Date: Tue Dec 18 05:12:36 2018
New Revision: 349479

URL: http://llvm.org/viewvc/llvm-project?rev=349479&view=rev
Log:
Un-XFAIL TestExitDuringBreak.py for linux

This test is passing now on linux, and probably has been passing since
r282993.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/exit_during_break/TestExitDuringBreak.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/exit_during_break/TestExitDuringBreak.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/exit_during_break/TestExitDuringBreak.py?rev=349479&r1=349478&r2=349479&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/exit_during_break/TestExitDuringBreak.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/exit_during_break/TestExitDuringBreak.py
 Tue Dec 18 05:12:36 2018
@@ -23,9 +23,6 @@ class ExitDuringBreakpointTestCase(TestB
 # Find the line number for our breakpoint.
 self.breakpoint = line_number('main.cpp', '// Set breakpoint here')
 
-@expectedFailureAll(
-oslist=["linux"],
-bugnumber="llvm.org/pr15824 thread states not properly maintained")
 def test(self):
 """Test thread exit during breakpoint handling."""
 self.build(dictionary=self.getBuildFlags())


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


[Lldb-commits] [lldb] r349482 - Un-XFail TestThreadStates.test_process_interrupt

2018-12-18 Thread Pavel Labath via lldb-commits
Author: labath
Date: Tue Dec 18 05:32:42 2018
New Revision: 349482

URL: http://llvm.org/viewvc/llvm-project?rev=349482&view=rev
Log:
Un-XFail TestThreadStates.test_process_interrupt

This test is passing now on linux. The same test is claimed to be flaky
on darwin, so it's possible that's true on linux too. If that's the case
we'll have to skip it here too (or fix it).

I mark the test as not-debug-info-dependent as a drive-by.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py?rev=349482&r1=349481&r2=349482&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py
 Tue Dec 18 05:32:42 2018
@@ -52,17 +52,6 @@ class ThreadStateTestCase(TestBase):
 self.thread_state_after_expression_test()
 
 # thread states not properly maintained
-@unittest2.expectedFailure("llvm.org/pr16712")
-@expectedFailureAll(
-oslist=["windows"],
-bugnumber="llvm.org/pr24668: Breakpoints not resolved correctly")
-@skipIfDarwin # llvm.org/pr15824 thread states not properly maintained and 

-def test_process_interrupt(self):
-"""Test process interrupt."""
-self.build(dictionary=self.getBuildFlags(use_cpp11=False))
-self.process_interrupt_test()
-
-# thread states not properly maintained
 @unittest2.expectedFailure("llvm.org/pr15824 and 
")
 @expectedFailureAll(
 oslist=["windows"],
@@ -198,8 +187,14 @@ class ThreadStateTestCase(TestBase):
 # Let the process run to completion
 self.runCmd("process continue")
 
-def process_interrupt_test(self):
+@expectedFailureAll(
+oslist=["windows"],
+bugnumber="llvm.org/pr24668: Breakpoints not resolved correctly")
+@skipIfDarwin # llvm.org/pr15824 thread states not properly maintained and 

+@no_debug_info_test
+def test_process_interrupt(self):
 """Test process interrupt and continue."""
+self.build(dictionary=self.getBuildFlags(use_cpp11=False))
 exe = self.getBuildArtifact("a.out")
 self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 


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


[Lldb-commits] [lldb] r349485 - Un-XFail TestYMMRegister on linux

2018-12-18 Thread Pavel Labath via lldb-commits
Author: labath
Date: Tue Dec 18 05:50:38 2018
New Revision: 349485

URL: http://llvm.org/viewvc/llvm-project?rev=349485&view=rev
Log:
Un-XFail TestYMMRegister on linux

This test was disabled in r326756 as a part of "upstreaming debugserver
support for AVX-512 (zmm register set)". This looks like an error
because both register set and remote stubs are different.

In any case, the test passes now.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_avx/TestYMMRegister.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_avx/TestYMMRegister.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_avx/TestYMMRegister.py?rev=349485&r1=349484&r2=349485&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_avx/TestYMMRegister.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_avx/TestYMMRegister.py
 Tue Dec 18 05:50:38 2018
@@ -21,7 +21,6 @@ class TestYMMRegister(TestBase):
 @skipIfiOSSimulator
 @skipIfTargetAndroid()
 @skipIf(archs=no_match(['i386', 'x86_64']))
-@expectedFailureAll(oslist=["linux"], bugnumber="rdar://30523153")
 @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr37995")
 def test(self):
 self.build(dictionary={"CFLAGS_EXTRAS": "-march=haswell"})


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


[Lldb-commits] [lldb] r349487 - Skip TestMultithreaded.test_sb_api_listener_resume on linux

2018-12-18 Thread Pavel Labath via lldb-commits
Author: labath
Date: Tue Dec 18 06:24:55 2018
New Revision: 349487

URL: http://llvm.org/viewvc/llvm-project?rev=349487&view=rev
Log:
Skip TestMultithreaded.test_sb_api_listener_resume on linux

The test still fails occasionally (1/100 runs). Upgrade the xfail to
skip.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/TestMultithreaded.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/TestMultithreaded.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/TestMultithreaded.py?rev=349487&r1=349486&r2=349487&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/TestMultithreaded.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/TestMultithreaded.py
 Tue Dec 18 06:24:55 2018
@@ -68,7 +68,7 @@ class SBBreakpointCallbackCase(TestBase)
 # clang-cl does not support throw or catch (llvm.org/pr24538)
 @skipIfWindows
 @expectedFlakeyFreeBSD
-@expectedFailureAll(oslist=["linux"])
+@skipIf(oslist=["linux"]) # flakey
 def test_sb_api_listener_resume(self):
 """ Test that a process can be resumed from a non-main thread. """
 self.build_and_test(


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


[Lldb-commits] [lldb] r349491 - de-flake TestThreadStates.test_process_interrupt

2018-12-18 Thread Pavel Labath via lldb-commits
Author: labath
Date: Tue Dec 18 07:15:02 2018
New Revision: 349491

URL: http://llvm.org/viewvc/llvm-project?rev=349491&view=rev
Log:
de-flake TestThreadStates.test_process_interrupt

the "self.assertEqual(thread.GetStopReason(), lldb.eStopReasonSignal)"
was occasionally failing because the stop reason would come out as
"trace" this happened if we issued the interrupt just as the processed
stopped due to single-stepping over the breakpoint (i.e., the it was not
necessary to send any signal).

Fix this by removing the breakpoint before resuming the process. This
ensures the process can run unobstructed.

After this, the test passed 200 consecutive runs successfully for me,
even while the system was under heavy load.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py?rev=349491&r1=349490&r2=349491&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py
 Tue Dec 18 07:15:02 2018
@@ -199,7 +199,7 @@ class ThreadStateTestCase(TestBase):
 self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
 # This should create a breakpoint in the main thread.
-lldbutil.run_break_set_by_file_and_line(
+bpno = lldbutil.run_break_set_by_file_and_line(
 self, "main.cpp", self.break_1, num_expected_locations=1)
 
 # Run the program.
@@ -213,6 +213,10 @@ class ThreadStateTestCase(TestBase):
 process, lldb.eStopReasonBreakpoint)
 self.assertIsNotNone(thread)
 
+# Remove the breakpoint to avoid the single-step-over-bkpt dance in the
+# "continue" below
+self.assertTrue(target.BreakpointDelete(bpno))
+
 # Continue, the inferior will go into an infinite loop waiting for
 # 'g_test' to change.
 self.dbg.SetAsync(True)


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


[Lldb-commits] [lldb] r349495 - Fix the "dangerous use of tempnam" warning in Host/SocketTest.cpp

2018-12-18 Thread Pavel Labath via lldb-commits
Author: labath
Date: Tue Dec 18 07:33:50 2018
New Revision: 349495

URL: http://llvm.org/viewvc/llvm-project?rev=349495&view=rev
Log:
Fix the "dangerous use of tempnam" warning in Host/SocketTest.cpp

instead, create a unique temporary directory, and place the socket file
there.

Modified:
lldb/trunk/unittests/Host/SocketTest.cpp

Modified: lldb/trunk/unittests/Host/SocketTest.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Host/SocketTest.cpp?rev=349495&r1=349494&r2=349495&view=diff
==
--- lldb/trunk/unittests/Host/SocketTest.cpp (original)
+++ lldb/trunk/unittests/Host/SocketTest.cpp Tue Dec 18 07:33:50 2018
@@ -17,6 +17,8 @@
 #include "lldb/Host/Socket.h"
 #include "lldb/Host/common/TCPSocket.h"
 #include "lldb/Host/common/UDPSocket.h"
+#include "llvm/Support/FileSystem.h"
+#include "llvm/Support/Path.h"
 
 #ifndef LLDB_DISABLE_POSIX
 #include "lldb/Host/posix/DomainSocket.h"
@@ -41,7 +43,6 @@ public:
 
 protected:
   static void AcceptThread(Socket *listen_socket,
-   const char *listen_remote_address,
bool child_processes_inherit, Socket 
**accept_socket,
Status *error) {
 *error = listen_socket->Accept(*accept_socket);
@@ -49,7 +50,7 @@ protected:
 
   template 
   void CreateConnectedSockets(
-  const char *listen_remote_address,
+  llvm::StringRef listen_remote_address,
   const std::function &get_connect_addr,
   std::unique_ptr *a_up, std::unique_ptr *b_up) {
 bool child_processes_inherit = false;
@@ -64,8 +65,8 @@ protected:
 Status accept_error;
 Socket *accept_socket;
 std::thread accept_thread(AcceptThread, listen_socket_up.get(),
-  listen_remote_address, child_processes_inherit,
-  &accept_socket, &accept_error);
+  child_processes_inherit, &accept_socket,
+  &accept_error);
 
 std::string connect_remote_address = get_connect_addr(*listen_socket_up);
 std::unique_ptr connect_socket_up(
@@ -158,15 +159,15 @@ TEST_F(SocketTest, DecodeHostAndPort) {
 
 #ifndef LLDB_DISABLE_POSIX
 TEST_F(SocketTest, DomainListenConnectAccept) {
-  char *file_name_str = tempnam(nullptr, nullptr);
-  EXPECT_NE(nullptr, file_name_str);
-  const std::string file_name(file_name_str);
-  free(file_name_str);
+  llvm::SmallString<64> Path;
+  std::error_code EC = 
llvm::sys::fs::createUniqueDirectory("DomainListenConnectAccept", Path);
+  ASSERT_FALSE(EC);
+  llvm::sys::path::append(Path, "test");
 
   std::unique_ptr socket_a_up;
   std::unique_ptr socket_b_up;
   CreateConnectedSockets(
-  file_name.c_str(), [=](const DomainSocket &) { return file_name; },
+  Path, [=](const DomainSocket &) { return Path.str().str(); },
   &socket_a_up, &socket_b_up);
 }
 #endif


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


Re: [Lldb-commits] [lldb] r349401 - [lit] Detect unexpected passes in lldbtest.

2018-12-18 Thread Pavel Labath via lldb-commits

On 17/12/2018 22:40, Jonas Devlieghere via lldb-commits wrote:

Author: jdevlieghere
Date: Mon Dec 17 13:40:37 2018
New Revision: 349401

URL: http://llvm.org/viewvc/llvm-project?rev=349401&view=rev
Log:
[lit] Detect unexpected passes in lldbtest.

This patch will have lit report unexpected passes when dotest reports at
least one XPASS and no failures.

Modified:
 lldb/trunk/lit/Suite/lldbtest.py

Modified: lldb/trunk/lit/Suite/lldbtest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Suite/lldbtest.py?rev=349401&r1=349400&r2=349401&view=diff
==
--- lldb/trunk/lit/Suite/lldbtest.py (original)
+++ lldb/trunk/lit/Suite/lldbtest.py Mon Dec 17 13:40:37 2018
@@ -96,6 +96,10 @@ class LLDBTest(TestFormat):
  if exitCode:
  return lit.Test.FAIL, out + err
  
+unexpected_test_line = 'XPASS'

+if unexpected_test_line in out or unexpected_test_line in err:
+return lit.Test.XPASS, ''
+
  passing_test_line = 'RESULT: PASSED'
  if passing_test_line not in out and passing_test_line not in err:
  msg = ('Unable to find %r in dotest output:\n\n%s%s' %


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



It would be nice to have some notice before changes like this are 
implemented. I mean, I know there was some talk of this in the past, but 
that was months ago, so it wasn't really clear if/when is that going to 
happen. It didn't take me too long to clean up the remaining unexpected 
passes on my test configuration (and I found some pretty interesting 
things while doing that, for which I am grateful), but I am not sure 
this will be so simple for everyone.


The other issue I have with this patch is that it creates a rift between 
how lit evaluates test results and how dotest does it (I don't know how 
you guys do this, but I still run dotest manually when I want to zero in 
on a single test failure). Now it can happen that someone runs 
"check-lldb", it reports a failure (unexpected success), and when the 
person runs the single test via dotest, it happily reports that 
everything is alright.


I think it would be better to first teach dotest to treat "unexpected 
successes" as a "bad" result (i.e., to exit with non-zero exit code). 
Then, we can play around with how to convert that result into lit test 
states


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


[Lldb-commits] [lldb] r349498 - ELF: Don't create sections for section header index 0

2018-12-18 Thread Pavel Labath via lldb-commits
Author: labath
Date: Tue Dec 18 07:56:45 2018
New Revision: 349498

URL: http://llvm.org/viewvc/llvm-project?rev=349498&view=rev
Log:
ELF: Don't create sections for section header index 0

Summary:
The first section header does not define a real section. Instead it is
used for various elf extensions. This patch skips creation of a section
for index 0.

This has one furtunate side-effect, in that it allows us to use the section
header index as the Section ID (where 0 is also invalid). This way, we
can get rid of a lot of spurious +1s in the ObjectFileELF code.

Reviewers: clayborg, krytarowski, joerg, espindola

Subscribers: emaste, lldb-commits, arichardson

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

Modified:
lldb/trunk/lit/Modules/ELF/many-sections.s
lldb/trunk/lit/Modules/MachO/subsections.yaml
lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.h
lldb/trunk/tools/lldb-test/lldb-test.cpp

Modified: lldb/trunk/lit/Modules/ELF/many-sections.s
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Modules/ELF/many-sections.s?rev=349498&r1=349497&r2=349498&view=diff
==
--- lldb/trunk/lit/Modules/ELF/many-sections.s (original)
+++ lldb/trunk/lit/Modules/ELF/many-sections.s Tue Dec 18 07:56:45 2018
@@ -7,7 +7,7 @@
 ## .., plus a couple of standard ones (.strtab, etc.)
 ## Check the number is correct plus the names of a couple of chosen sections.
 
-# CHECK: Showing 65541 sections
+# CHECK: Showing 65540 sections
 # CHECK: Name: 
 # CHECK: Name: 
 # CHECK: Name: 

Modified: lldb/trunk/lit/Modules/MachO/subsections.yaml
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Modules/MachO/subsections.yaml?rev=349498&r1=349497&r2=349498&view=diff
==
--- lldb/trunk/lit/Modules/MachO/subsections.yaml (original)
+++ lldb/trunk/lit/Modules/MachO/subsections.yaml Tue Dec 18 07:56:45 2018
@@ -3,6 +3,7 @@
 
 #CHECK: Showing 2 sections
 #CHECK-NEXT:  Index: 0
+#CHECK-NEXT:  ID: 0x100
 #CHECK-NEXT:  Name: __PAGEZERO
 #CHECK-NEXT:  Type: container
 #CHECK-NEXT:  Permissions: ---
@@ -13,6 +14,7 @@
 #CHECK-NEXT:  There are no subsections
 #CHECK-EMPTY:
 #CHECK-NEXT:  Index: 1
+#CHECK-NEXT:  ID: 0x200
 #CHECK-NEXT:  Name: __TEXT
 #CHECK-NEXT:  Type: container
 #CHECK-NEXT:  Permissions: r-x
@@ -22,6 +24,7 @@
 #CHECK-NEXT:  File size: 4096
 #CHECK-NEXT:  Showing 3 subsections
 #CHECK-NEXT:Index: 0
+#CHECK-NEXT:ID: 0x1
 #CHECK-NEXT:Name: __text
 #CHECK-NEXT:Type: code
 #CHECK-NEXT:Permissions: r-x
@@ -31,6 +34,7 @@
 #CHECK-NEXT:File size: 22
 #CHECK-EMPTY:
 #CHECK-NEXT:Index: 1
+#CHECK-NEXT:ID: 0x2
 #CHECK-NEXT:Name: __unwind_info
 #CHECK-NEXT:Type: compact-unwind
 #CHECK-NEXT:Permissions: r-x
@@ -40,6 +44,7 @@
 #CHECK-NEXT:File size: 76
 #CHECK-EMPTY:
 #CHECK-NEXT:Index: 2
+#CHECK-NEXT:ID: 0x3
 #CHECK-NEXT:Name: __eh_frame
 #CHECK-NEXT:Type: eh-frame
 #CHECK-NEXT:Permissions: r-x

Modified: lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp?rev=349498&r1=349497&r2=349498&view=diff
==
--- lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp Tue Dec 18 
07:56:45 2018
@@ -889,11 +889,11 @@ AddressClass ObjectFileELF::GetAddressCl
 }
 
 size_t ObjectFileELF::SectionIndex(const SectionHeaderCollIter &I) {
-  return std::distance(m_section_headers.begin(), I) + 1u;
+  return std::distance(m_section_headers.begin(), I);
 }
 
 size_t ObjectFileELF::SectionIndex(const SectionHeaderCollConstIter &I) const {
-  return std::distance(m_section_headers.begin(), I) + 1u;
+  return std::distance(m_section_headers.begin(), I);
 }
 
 bool ObjectFileELF::ParseHeader() {
@@ -1081,7 +1081,7 @@ size_t ObjectFileELF::ParseDependentModu
 return 0;
   // sh_link: section header index of string table used by entries in the
   // section.
-  Section *dynstr = section_list->FindSectionByID(header->sh_link + 1).get();
+  Section *dynstr = section_list->FindSectionByID(header->sh_link).get();
   if (!dynstr)
 return 0;
 
@@ -1717,10 +1717,10 @@ size_t ObjectFileELF::ParseSectionHeader
 
 const ObjectFileELF::ELFSectionHeaderInfo *
 ObjectFileELF::GetSectionHeaderByIndex(lldb::user_id_t id) {
-  if (!id || !ParseSectionHeaders())
+  if (!ParseSectionHeaders())
 return NULL;
 
-  if (--id < m_section_headers.size())
+  if (id < m_section_headers.size())
 return &m_section_headers[id];
 
   return NULL;
@@ -1853,7 +1853,7 @@ void ObjectFileELF::CreateSections(Secti
 m_sections_ap.reset(new SectionList());
 
 VMAddressPr

[Lldb-commits] [PATCH] D55757: ELF: Don't create sections for section header index 0

2018-12-18 Thread Pavel Labath via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL349498: ELF: Don't create sections for section header 
index 0 (authored by labath, committed by ).
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D55757?vs=178431&id=178678#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55757/new/

https://reviews.llvm.org/D55757

Files:
  lldb/trunk/lit/Modules/ELF/many-sections.s
  lldb/trunk/lit/Modules/MachO/subsections.yaml
  lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
  lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.h
  lldb/trunk/tools/lldb-test/lldb-test.cpp

Index: lldb/trunk/tools/lldb-test/lldb-test.cpp
===
--- lldb/trunk/tools/lldb-test/lldb-test.cpp
+++ lldb/trunk/tools/lldb-test/lldb-test.cpp
@@ -732,6 +732,7 @@
 assert(S);
 AutoIndent Indent(Printer, 2);
 Printer.formatLine("Index: {0}", I);
+Printer.formatLine("ID: {0:x}", S->GetID());
 Printer.formatLine("Name: {0}", S->GetName().GetStringRef());
 Printer.formatLine("Type: {0}", S->GetTypeAsCString());
 Printer.formatLine("Permissions: {0}", GetPermissionsAsCString(S->GetPermissions()));
Index: lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.h
===
--- lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.h
+++ lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.h
@@ -220,10 +220,10 @@
   /// The address class for each symbol in the elf file
   FileAddressToAddressClassMap m_address_class_map;
 
-  /// Returns a 1 based index of the given section header.
+  /// Returns the index of the given section header.
   size_t SectionIndex(const SectionHeaderCollIter &I);
 
-  /// Returns a 1 based index of the given section header.
+  /// Returns the index of the given section header.
   size_t SectionIndex(const SectionHeaderCollConstIter &I) const;
 
   // Parses the ELF program headers.
Index: lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
===
--- lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
+++ lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
@@ -889,11 +889,11 @@
 }
 
 size_t ObjectFileELF::SectionIndex(const SectionHeaderCollIter &I) {
-  return std::distance(m_section_headers.begin(), I) + 1u;
+  return std::distance(m_section_headers.begin(), I);
 }
 
 size_t ObjectFileELF::SectionIndex(const SectionHeaderCollConstIter &I) const {
-  return std::distance(m_section_headers.begin(), I) + 1u;
+  return std::distance(m_section_headers.begin(), I);
 }
 
 bool ObjectFileELF::ParseHeader() {
@@ -1081,7 +1081,7 @@
 return 0;
   // sh_link: section header index of string table used by entries in the
   // section.
-  Section *dynstr = section_list->FindSectionByID(header->sh_link + 1).get();
+  Section *dynstr = section_list->FindSectionByID(header->sh_link).get();
   if (!dynstr)
 return 0;
 
@@ -1717,10 +1717,10 @@
 
 const ObjectFileELF::ELFSectionHeaderInfo *
 ObjectFileELF::GetSectionHeaderByIndex(lldb::user_id_t id) {
-  if (!id || !ParseSectionHeaders())
+  if (!ParseSectionHeaders())
 return NULL;
 
-  if (--id < m_section_headers.size())
+  if (id < m_section_headers.size())
 return &m_section_headers[id];
 
   return NULL;
@@ -1853,7 +1853,7 @@
 m_sections_ap.reset(new SectionList());
 
 VMAddressProvider address_provider(CalculateType());
-for (SectionHeaderCollIter I = m_section_headers.begin();
+for (SectionHeaderCollIter I = std::next(m_section_headers.begin());
  I != m_section_headers.end(); ++I) {
   const ELFSectionHeaderInfo &header = *I;
 
@@ -1990,9 +1990,9 @@
 
 SectionSP symbol_section_sp;
 SymbolType symbol_type = eSymbolTypeInvalid;
-Elf64_Half section_idx = symbol.st_shndx;
+Elf64_Half shndx = symbol.st_shndx;
 
-switch (section_idx) {
+switch (shndx) {
 case SHN_ABS:
   symbol_type = eSymbolTypeAbsolute;
   break;
@@ -2000,7 +2000,7 @@
   symbol_type = eSymbolTypeUndefined;
   break;
 default:
-  symbol_section_sp = section_list->GetSectionAtIndex(section_idx);
+  symbol_section_sp = section_list->FindSectionByID(shndx);
   break;
 }
 
@@ -2169,7 +2169,7 @@
 // symbols. See above for more details.
 uint64_t symbol_value = symbol.st_value + symbol_value_offset;
 
-if (symbol_section_sp == nullptr && section_idx == SHN_ABS &&
+if (symbol_section_sp == nullptr && shndx == SHN_ABS &&
 symbol.st_size != 0) {
   // We don't have a section for a symbol with non-zero size. Create a new
   // section for it so the address range covered by the symbol is also
@@ -2282,9 +2282,8 @@
   assert(symtab_hdr->sh_type == SHT_SYMTAB ||
  symtab_hdr->sh_type == SHT_DYNSYM);
 
-  // sh_link: section header ind

[Lldb-commits] [PATCH] D55827: Update current working directory to avoid test crashes

2018-12-18 Thread Tatyana Krasnukha via Phabricator via lldb-commits
tatyana-krasnukha created this revision.
tatyana-krasnukha added reviewers: JDevlieghere, zturner.
tatyana-krasnukha added a project: LLDB.
Herald added subscribers: lldb-commits, abidh.

Running `dotest.py` with a path to tests directory results in:

  terminate called after throwing an instance of 'std::logic_error'
what():  basic_string::_M_construct null not valid
  Aborted

for some tests. For example, when a test executes command "script import 
relative_path.py" the exception happens in 
ScriptInterpreterPython::LoadScriptingModule at the line

  std::string directory = target_file.GetDirectory().GetCString();

because GetCString returns nullptr.

The reason of such behavior is that llvm::RealFileSystem returns cached current 
working directory value until it will be updated with 
setCurrentWorkingDirectory. So, we permanently have cwd == directory of the 
first test, FileSystem::Resolve doesn't find the file and just returns the 
original value.

P.S. What about FileSpec::GetDirectory and FileSpec::GetFileName those never 
return nullptr? There is a lot of code that doesn't check result on nullptr 
(look at llvm.org/pr37054, for example). I made a patch where these functions 
return empty strings instead of nullptr, but some tests fail as they expect the 
result is None. Other API users can be broken also.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D55827

Files:
  include/lldb/API/SBHostOS.h
  include/lldb/Host/FileSystem.h
  packages/Python/lldbsuite/test/lldbtest.py
  scripts/interface/SBHostOS.i
  source/API/SBHostOS.cpp
  source/Host/common/FileSystem.cpp


Index: source/Host/common/FileSystem.cpp
===
--- source/Host/common/FileSystem.cpp
+++ source/Host/common/FileSystem.cpp
@@ -247,6 +247,11 @@
   file_spec.SetIsResolved(true);
 }
 
+bool FileSystem::SetCurrentWorkingDirectory(const llvm::Twine &cwd) {
+  std::error_code error = m_fs->setCurrentWorkingDirectory(cwd);
+  return !error;
+}
+
 std::shared_ptr
 FileSystem::CreateDataBuffer(const llvm::Twine &path, uint64_t size,
  uint64_t offset) {
Index: source/API/SBHostOS.cpp
===
--- source/API/SBHostOS.cpp
+++ source/API/SBHostOS.cpp
@@ -94,6 +94,10 @@
   return sb_fspec;
 }
 
+bool SBHostOS::SetCurrentWorkingDirectory(const char *cwd) {
+  return cwd ? FileSystem::Instance().SetCurrentWorkingDirectory(cwd) : false;
+}
+
 lldb::thread_t SBHostOS::ThreadCreate(const char *name,
   lldb::thread_func_t thread_function,
   void *thread_arg, SBError *error_ptr) {
Index: scripts/interface/SBHostOS.i
===
--- scripts/interface/SBHostOS.i
+++ scripts/interface/SBHostOS.i
@@ -24,6 +24,9 @@
 
 static lldb::SBFileSpec
 GetUserHomeDirectory ();
+
+static bool
+SetCurrentWorkingDirectory(const char *cwd);
 
 static void
 ThreadCreated (const char *name);
Index: packages/Python/lldbsuite/test/lldbtest.py
===
--- packages/Python/lldbsuite/test/lldbtest.py
+++ packages/Python/lldbsuite/test/lldbtest.py
@@ -552,6 +552,9 @@
 print("Change dir to:", full_dir, file=sys.stderr)
 os.chdir(full_dir)
 
+if not lldb.SBHostOS.SetCurrentWorkingDirectory(full_dir):
+raise Exception("Failed to re-write cached cwd value.")
+
 # Set platform context.
 cls.platformContext = lldbplatformutil.createPlatformContext()
 
Index: include/lldb/Host/FileSystem.h
===
--- include/lldb/Host/FileSystem.h
+++ include/lldb/Host/FileSystem.h
@@ -130,6 +130,11 @@
   void Resolve(FileSpec &file_spec);
   /// @}
 
+  /// Set current working directory.
+  /// @{
+  bool SetCurrentWorkingDirectory(const llvm::Twine &cwd);
+  /// @}
+
    Create memory buffer from path.
   /// @{
   std::shared_ptr CreateDataBuffer(const llvm::Twine &path,
Index: include/lldb/API/SBHostOS.h
===
--- include/lldb/API/SBHostOS.h
+++ include/lldb/API/SBHostOS.h
@@ -25,6 +25,8 @@
 
   static lldb::SBFileSpec GetUserHomeDirectory();
 
+  static bool SetCurrentWorkingDirectory(const char *cwd);
+
   static void ThreadCreated(const char *name);
 
   static lldb::thread_t ThreadCreate(const char *name,


Index: source/Host/common/FileSystem.cpp
===
--- source/Host/common/FileSystem.cpp
+++ source/Host/common/FileSystem.cpp
@@ -247,6 +247,11 @@
   file_spec.SetIsResolved(true);
 }
 
+bool FileSystem::SetCurrentWorkingDirectory(const llvm::Twine &cwd) {
+  std::error_code error = m_fs->setCurrentWorkingDirectory(cwd);
+  return !error;
+}
+
 std::shared_ptr
 Fi

Re: [Lldb-commits] [lldb] r349397 - Remove sleep() synchronisation from teststcase and

2018-12-18 Thread Adrian Prantl via lldb-commits


> On Dec 18, 2018, at 12:11 AM, Pavel Labath  wrote:
> 
> Not that I want to defend the use of sleep, but my expectation  is that this 
> will the test even more flaky.
> 
> The only thing that test does after attaching is verifying the process 
> backtrace to check that it contains the "main" function. If the test doesn't 
> sleep, it increases the likelyhood that you will attach before it even enters 
> the main function. This may be particularly true on linux, where the process 
> needs to invoke a special api (PR_SET_TRACER) before we can attach to it, and 
> so the even the attach will fail if it's done too early.
> 
> One of the patterns for synchronization we have in other tests is to have the 
> inferior create a file when it reaches the "safe to attach" point. The test 
> then waits for this file to appear (lldbutil.wait_for_file_on_target) before 
> proceeding. This still uses sleep() under the hood, but only because we don't 
> have/don't want to implement a wait_for_file blocking api. In the end it 
> still provides a more predictable state of the process we attach to.

That is an excellent idea. My first thought was to use piped IO to communicate 
that the process has launched but then immediately realized that this doesn't 
work on a remote platform. I'll try the file method!

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


[Lldb-commits] [PATCH] D55607: Make crashlog.py work when a .dSYM is present, but a binary is missing

2018-12-18 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added a comment.

Can you confirm that reverting this path actually fixes the issue? I'm asking 
because the only test that is executing this script has a REQUIRES: 
system-darwin line in it.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55607/new/

https://reviews.llvm.org/D55607



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


[Lldb-commits] [PATCH] D55827: Update current working directory to avoid test crashes

2018-12-18 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

Hm... this seems like an important issue in the `RealFileSystem` (or our usage 
of it), and I'm not sure it should be papered over like that. I mean, lldb is a 
library, and requiring every call to `chdir` in the whole process go through 
"our" implementation is not very friendly towards everyone else we happen to be 
sharing a process with.

It sounds like we want a VFS that is slightly more "real" than the 
RealFileSystem, and which shares the notion of the CWD with the OS.


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55827/new/

https://reviews.llvm.org/D55827



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


[Lldb-commits] [PATCH] D55472: Speadup memory regions handling and cleanup related code

2018-12-18 Thread Tatyana Krasnukha via Phabricator via lldb-commits
tatyana-krasnukha updated this revision to Diff 178690.
tatyana-krasnukha added a comment.

Replace vector of unique pointers with vector of values, revert some API 
changes, remove MinidumpParser changes.
I will put overridden GetMemoryRegions in a separate patch.


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55472/new/

https://reviews.llvm.org/D55472

Files:
  include/lldb/API/SBMemoryRegionInfo.h
  include/lldb/API/SBMemoryRegionInfoList.h
  include/lldb/Target/Process.h
  include/lldb/lldb-forward.h
  source/API/SBMemoryRegionInfo.cpp
  source/API/SBMemoryRegionInfoList.cpp
  source/API/SBProcess.cpp
  source/Target/Process.cpp

Index: source/Target/Process.cpp
===
--- source/Target/Process.cpp
+++ source/Target/Process.cpp
@@ -6030,7 +6030,7 @@
 }
 
 Status
-Process::GetMemoryRegions(std::vector ®ion_list) {
+Process::GetMemoryRegions(std::vector ®ion_list) {
 
   Status error;
 
@@ -6038,7 +6038,7 @@
 
   region_list.clear();
   do {
-lldb::MemoryRegionInfoSP region_info(new lldb_private::MemoryRegionInfo());
+lldb_private::MemoryRegionInfo region_info;
 error = GetMemoryRegionInfo(range_end, *region_info);
 // GetMemoryRegionInfo should only return an error if it is unimplemented.
 if (error.Fail()) {
@@ -6048,7 +6048,7 @@
 
 range_end = region_info->GetRange().GetRangeEnd();
 if (region_info->GetMapped() == MemoryRegionInfo::eYes) {
-  region_list.push_back(region_info);
+  region_list.push_back(std::move(region_info));
 }
   } while (range_end != LLDB_INVALID_ADDRESS);
 
Index: source/API/SBProcess.cpp
===
--- source/API/SBProcess.cpp
+++ source/API/SBProcess.cpp
@@ -1358,17 +1358,17 @@
SBMemoryRegionInfo &sb_region_info) {
   lldb::SBError sb_error;
   ProcessSP process_sp(GetSP());
-  MemoryRegionInfoSP region_info_sp =
-  std::make_shared();
   if (process_sp) {
 Process::StopLocker stop_locker;
 if (stop_locker.TryLock(&process_sp->GetRunLock())) {
   std::lock_guard guard(
   process_sp->GetTarget().GetAPIMutex());
+
+  MemoryRegionInfo region_info;
   sb_error.ref() =
-  process_sp->GetMemoryRegionInfo(load_addr, *region_info_sp);
+  process_sp->GetMemoryRegionInfo(load_addr, region_info);
   if (sb_error.Success()) {
-sb_region_info.ref() = *region_info_sp;
+sb_region_info.ref() = std::move(region_info);
   }
 } else {
   Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
@@ -1385,35 +1385,31 @@
 }
 
 lldb::SBMemoryRegionInfoList SBProcess::GetMemoryRegions() {
-  lldb::SBError sb_error;
   lldb::SBMemoryRegionInfoList sb_region_list;
+
   ProcessSP process_sp(GetSP());
-  if (process_sp) {
-Process::StopLocker stop_locker;
-if (stop_locker.TryLock(&process_sp->GetRunLock())) {
-  std::lock_guard guard(
-  process_sp->GetTarget().GetAPIMutex());
-  std::vector region_list;
-  sb_error.ref() = process_sp->GetMemoryRegions(region_list);
-  if (sb_error.Success()) {
-std::vector::iterator end = region_list.end();
-for (std::vector::iterator it = region_list.begin();
- it != end; it++) {
-  SBMemoryRegionInfo sb_region_info(it->get());
-  sb_region_list.Append(sb_region_info);
-}
-  }
-} else {
-  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-  if (log)
-log->Printf(
-"SBProcess(%p)::GetMemoryRegionInfo() => error: process is running",
-static_cast(process_sp.get()));
-  sb_error.SetErrorString("process is running");
+  if (!process_sp)
+return sb_region_list;
+
+  Process::StopLocker stop_locker;
+  if (stop_locker.TryLock(&process_sp->GetRunLock())) {
+std::lock_guard guard(
+process_sp->GetTarget().GetAPIMutex());
+
+std::vector region_list;
+if (process_sp->GetMemoryRegions(region_list).Success()) {
+  sb_region_list.Reserve(sb_region_list.GetSize() + region_list.size());
+  for (auto& region : region_list)
+sb_region_list.Append(SBMemoryRegionInfo(std::move(region)));
 }
   } else {
-sb_error.SetErrorString("SBProcess is invalid");
+Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+if (log)
+  log->Printf(
+  "SBProcess(%p)::GetMemoryRegionInfo() => error: process is running",
+  static_cast(process_sp.get()));
   }
+
   return sb_region_list;
 }
 
Index: source/API/SBMemoryRegionInfoList.cpp
===
--- source/API/SBMemoryRegionInfoList.cpp
+++ source/API/SBMemoryRegionInfoList.cpp
@@ -32,20 +32,24 @@
 return *this;
   }
 
-  uint32_t GetSize() { return m_regions.size(); }
+  size_t GetSize() const { return m_regions.size(); }
+
+  void Reserve(size_t 

[Lldb-commits] [PATCH] D55328: [CMake] Revised LLDB.framework builds

2018-12-18 Thread Stefan Gränitz via Phabricator via lldb-commits
sgraenitz marked an inline comment as done.
sgraenitz added a comment.

Thanks everyone for your patience with the review. I will spare us the 
potential merge conflicts before Christmas and land this after the holidays. 
Cheers


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55328/new/

https://reviews.llvm.org/D55328



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


[Lldb-commits] [PATCH] D55835: [dotest] Consider unexpected passes as failures.

2018-12-18 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere created this revision.
JDevlieghere added reviewers: labath, davide, jingham, clayborg.
JDevlieghere added a project: LLDB.

Unexpected successes should be considered failures because they can hide 
regressions when not addressed. When a test is fixed and not re-enabled, it can 
easily regress without us noticing.

I couldn't find a good way to make this change other than changing it in the 
unittest2 framework. I know this is less than optimal but since we have the 
dependency checked in and the change is pretty fundamental to the framework I 
think it's not unreasonable.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D55835

Files:
  lit/Suite/lldbtest.py
  third_party/Python/module/unittest2/unittest2/result.py


Index: third_party/Python/module/unittest2/unittest2/result.py
===
--- third_party/Python/module/unittest2/unittest2/result.py
+++ third_party/Python/module/unittest2/unittest2/result.py
@@ -148,7 +148,9 @@
 
 def wasSuccessful(self):
 "Tells whether or not this result was a success"
-return (len(self.failures) + len(self.errors) == 0)
+return (len(self.failures) +
+len(self.errors) +
+len(self.unexpectedSuccesses) == 0)
 
 def stop(self):
 "Indicates that the tests should be aborted"
Index: lit/Suite/lldbtest.py
===
--- lit/Suite/lldbtest.py
+++ lit/Suite/lldbtest.py
@@ -94,11 +94,10 @@
 litConfig.maxIndividualTestTime))
 
 if exitCode:
-return lit.Test.FAIL, out + err
-
-unexpected_test_line = 'XPASS'
-if unexpected_test_line in out or unexpected_test_line in err:
-return lit.Test.XPASS, ''
+if 'FAIL' in out or 'FAIL' in err:
+return lit.Test.FAIL, out + err
+if 'XPASS' in out or 'XPASS' in err:
+return lit.Test.XPASS, out + err
 
 passing_test_line = 'RESULT: PASSED'
 if passing_test_line not in out and passing_test_line not in err:


Index: third_party/Python/module/unittest2/unittest2/result.py
===
--- third_party/Python/module/unittest2/unittest2/result.py
+++ third_party/Python/module/unittest2/unittest2/result.py
@@ -148,7 +148,9 @@
 
 def wasSuccessful(self):
 "Tells whether or not this result was a success"
-return (len(self.failures) + len(self.errors) == 0)
+return (len(self.failures) +
+len(self.errors) +
+len(self.unexpectedSuccesses) == 0)
 
 def stop(self):
 "Indicates that the tests should be aborted"
Index: lit/Suite/lldbtest.py
===
--- lit/Suite/lldbtest.py
+++ lit/Suite/lldbtest.py
@@ -94,11 +94,10 @@
 litConfig.maxIndividualTestTime))
 
 if exitCode:
-return lit.Test.FAIL, out + err
-
-unexpected_test_line = 'XPASS'
-if unexpected_test_line in out or unexpected_test_line in err:
-return lit.Test.XPASS, ''
+if 'FAIL' in out or 'FAIL' in err:
+return lit.Test.FAIL, out + err
+if 'XPASS' in out or 'XPASS' in err:
+return lit.Test.XPASS, out + err
 
 passing_test_line = 'RESULT: PASSED'
 if passing_test_line not in out and passing_test_line not in err:
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r349401 - [lit] Detect unexpected passes in lldbtest.

2018-12-18 Thread Jonas Devlieghere via lldb-commits
I understand that it's annoying to fix these tests but I strongly believe
it will pay off in the long run. The motivation for this change is that we
fixed tests that were XFAILED, but forgot to enable them again. Later they
started failing and we didn't notice. This was especially a problem with
lit where this information was not at all available.

I created a patch that changes the dotest behavior to match what lit does.

https://reviews.llvm.org/D55835

On Tue, Dec 18, 2018 at 7:54 AM Pavel Labath  wrote:

> On 17/12/2018 22:40, Jonas Devlieghere via lldb-commits wrote:
> > Author: jdevlieghere
> > Date: Mon Dec 17 13:40:37 2018
> > New Revision: 349401
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=349401&view=rev
> > Log:
> > [lit] Detect unexpected passes in lldbtest.
> >
> > This patch will have lit report unexpected passes when dotest reports at
> > least one XPASS and no failures.
> >
> > Modified:
> >  lldb/trunk/lit/Suite/lldbtest.py
> >
> > Modified: lldb/trunk/lit/Suite/lldbtest.py
> > URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Suite/lldbtest.py?rev=349401&r1=349400&r2=349401&view=diff
> >
> ==
> > --- lldb/trunk/lit/Suite/lldbtest.py (original)
> > +++ lldb/trunk/lit/Suite/lldbtest.py Mon Dec 17 13:40:37 2018
> > @@ -96,6 +96,10 @@ class LLDBTest(TestFormat):
> >   if exitCode:
> >   return lit.Test.FAIL, out + err
> >
> > +unexpected_test_line = 'XPASS'
> > +if unexpected_test_line in out or unexpected_test_line in err:
> > +return lit.Test.XPASS, ''
> > +
> >   passing_test_line = 'RESULT: PASSED'
> >   if passing_test_line not in out and passing_test_line not in
> err:
> >   msg = ('Unable to find %r in dotest output:\n\n%s%s' %
> >
> >
> > ___
> > lldb-commits mailing list
> > lldb-commits@lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
> >
>
> It would be nice to have some notice before changes like this are
> implemented. I mean, I know there was some talk of this in the past, but
> that was months ago, so it wasn't really clear if/when is that going to
> happen. It didn't take me too long to clean up the remaining unexpected
> passes on my test configuration (and I found some pretty interesting
> things while doing that, for which I am grateful), but I am not sure
> this will be so simple for everyone.
>
> The other issue I have with this patch is that it creates a rift between
> how lit evaluates test results and how dotest does it (I don't know how
> you guys do this, but I still run dotest manually when I want to zero in
> on a single test failure). Now it can happen that someone runs
> "check-lldb", it reports a failure (unexpected success), and when the
> person runs the single test via dotest, it happily reports that
> everything is alright.
>
> I think it would be better to first teach dotest to treat "unexpected
> successes" as a "bad" result (i.e., to exit with non-zero exit code).
> Then, we can play around with how to convert that result into lit test
> states
>
> cheers,
> pavel
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D55837: [cmake] Make libcxx(abi) a dependency when building in-tree clang

2018-12-18 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere created this revision.
JDevlieghere added reviewers: clayborg, sgraenitz, aprantl.
JDevlieghere added a project: LLDB.
Herald added a subscriber: mgorny.
Herald added a reviewer: EricWF.

As discussed on IRC this morning, when building an in-tree clang for testing we 
have to have libcxx and libcxxabi checked out. This is a common pitfall that 
manifests that is non-obvious and manifests itself only after building when 
running the test suite.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D55837

Files:
  CMakeLists.txt


Index: CMakeLists.txt
===
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -157,6 +157,8 @@
 
   if(TARGET clang)
 list(APPEND LLDB_TEST_DEPS clang)
+list(APPEND LLDB_TEST_DEPS cxx)
+list(APPEND LLDB_TEST_DEPS cxxabi)
   endif()
 
   if(TARGET dsymutil)


Index: CMakeLists.txt
===
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -157,6 +157,8 @@
 
   if(TARGET clang)
 list(APPEND LLDB_TEST_DEPS clang)
+list(APPEND LLDB_TEST_DEPS cxx)
+list(APPEND LLDB_TEST_DEPS cxxabi)
   endif()
 
   if(TARGET dsymutil)
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D55837: [cmake] Make libcxx(abi) a dependency when building in-tree clang

2018-12-18 Thread Michał Górny via Phabricator via lldb-commits
mgorny added a comment.

How does this affect platforms that use other ABI library than libcxxabi? How 
does this affect platforms that use libstdc++ as default C++ backend?


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55837/new/

https://reviews.llvm.org/D55837



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


[Lldb-commits] [PATCH] D55837: [cmake] Make libcxx(abi) a dependency when building in-tree clang

2018-12-18 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment.

In D55837#1334872 , @mgorny wrote:

> How does this affect platforms that use other ABI library than libcxxabi? How 
> does this affect platforms that use libstdc++ as default C++ backend?


I'm not familiar with that use case myself, so I might be able to give a better 
answer if I understand how that works today. I think it wouldn't change 
anything other than that the target has to be present.


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55837/new/

https://reviews.llvm.org/D55837



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


[Lldb-commits] [PATCH] D55837: [cmake] Make libcxx(abi) a dependency when building in-tree clang

2018-12-18 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

On linux libc++ is not a hard dependency for running tests (in fact, clang will 
not use it even if it is checked out). I guess that has something  to do with 
the fact that libc++ is not the default c++ implementation on that platform. I 
think this will need to be darwin-only or something like that.


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55837/new/

https://reviews.llvm.org/D55837



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


[Lldb-commits] [PATCH] D55837: [cmake] Make libcxx(abi) a dependency when building in-tree clang for macOS

2018-12-18 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment.

In D55837#1334893 , @labath wrote:

> On linux libc++ is not a hard dependency for running tests (in fact, clang 
> will not use it even if it is checked out). I guess that has something  to do 
> with the fact that libc++ is not the default c++ implementation on that 
> platform. I think this will need to be darwin-only or something like that.


I didn't know, cool, then that solves both issues.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55837/new/

https://reviews.llvm.org/D55837



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


[Lldb-commits] [PATCH] D55837: [cmake] Make libcxx(abi) a dependency when building in-tree clang for macOS

2018-12-18 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere updated this revision to Diff 178727.
JDevlieghere retitled this revision from "[cmake] Make libcxx(abi) a dependency 
when building in-tree clang" to "[cmake] Make libcxx(abi) a dependency when 
building in-tree clang for macOS".
JDevlieghere added a comment.

Only do this for macOS


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55837/new/

https://reviews.llvm.org/D55837

Files:
  CMakeLists.txt


Index: CMakeLists.txt
===
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -157,6 +157,10 @@
 
   if(TARGET clang)
 list(APPEND LLDB_TEST_DEPS clang)
+if(APPLE)
+  list(APPEND LLDB_TEST_DEPS cxx)
+  list(APPEND LLDB_TEST_DEPS cxxabi)
+endif()
   endif()
 
   if(TARGET dsymutil)


Index: CMakeLists.txt
===
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -157,6 +157,10 @@
 
   if(TARGET clang)
 list(APPEND LLDB_TEST_DEPS clang)
+if(APPLE)
+  list(APPEND LLDB_TEST_DEPS cxx)
+  list(APPEND LLDB_TEST_DEPS cxxabi)
+endif()
   endif()
 
   if(TARGET dsymutil)
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D55472: Speadup memory regions handling and cleanup related code

2018-12-18 Thread Tatyana Krasnukha via Phabricator via lldb-commits
tatyana-krasnukha updated this revision to Diff 178732.
tatyana-krasnukha marked an inline comment as done.
tatyana-krasnukha added a comment.

Addressed more comments


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55472/new/

https://reviews.llvm.org/D55472

Files:
  include/lldb/API/SBMemoryRegionInfo.h
  include/lldb/API/SBMemoryRegionInfoList.h
  include/lldb/Target/Process.h
  include/lldb/lldb-forward.h
  source/API/SBMemoryRegionInfoList.cpp
  source/API/SBProcess.cpp
  source/Target/Process.cpp

Index: source/Target/Process.cpp
===
--- source/Target/Process.cpp
+++ source/Target/Process.cpp
@@ -6030,7 +6030,7 @@
 }
 
 Status
-Process::GetMemoryRegions(std::vector ®ion_list) {
+Process::GetMemoryRegions(lldb_private::MemoryRegionInfos ®ion_list) {
 
   Status error;
 
@@ -6038,17 +6038,17 @@
 
   region_list.clear();
   do {
-lldb::MemoryRegionInfoSP region_info(new lldb_private::MemoryRegionInfo());
-error = GetMemoryRegionInfo(range_end, *region_info);
+lldb_private::MemoryRegionInfo region_info;
+error = GetMemoryRegionInfo(range_end, region_info);
 // GetMemoryRegionInfo should only return an error if it is unimplemented.
 if (error.Fail()) {
   region_list.clear();
   break;
 }
 
-range_end = region_info->GetRange().GetRangeEnd();
-if (region_info->GetMapped() == MemoryRegionInfo::eYes) {
-  region_list.push_back(region_info);
+range_end = region_info.GetRange().GetRangeEnd();
+if (region_info.GetMapped() == MemoryRegionInfo::eYes) {
+  region_list.push_back(std::move(region_info));
 }
   } while (range_end != LLDB_INVALID_ADDRESS);
 
Index: source/API/SBProcess.cpp
===
--- source/API/SBProcess.cpp
+++ source/API/SBProcess.cpp
@@ -1358,18 +1358,14 @@
SBMemoryRegionInfo &sb_region_info) {
   lldb::SBError sb_error;
   ProcessSP process_sp(GetSP());
-  MemoryRegionInfoSP region_info_sp =
-  std::make_shared();
   if (process_sp) {
 Process::StopLocker stop_locker;
 if (stop_locker.TryLock(&process_sp->GetRunLock())) {
   std::lock_guard guard(
   process_sp->GetTarget().GetAPIMutex());
+
   sb_error.ref() =
-  process_sp->GetMemoryRegionInfo(load_addr, *region_info_sp);
-  if (sb_error.Success()) {
-sb_region_info.ref() = *region_info_sp;
-  }
+  process_sp->GetMemoryRegionInfo(load_addr, sb_region_info.ref());
 } else {
   Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
   if (log)
@@ -1385,35 +1381,23 @@
 }
 
 lldb::SBMemoryRegionInfoList SBProcess::GetMemoryRegions() {
-  lldb::SBError sb_error;
   lldb::SBMemoryRegionInfoList sb_region_list;
+
   ProcessSP process_sp(GetSP());
-  if (process_sp) {
-Process::StopLocker stop_locker;
-if (stop_locker.TryLock(&process_sp->GetRunLock())) {
-  std::lock_guard guard(
-  process_sp->GetTarget().GetAPIMutex());
-  std::vector region_list;
-  sb_error.ref() = process_sp->GetMemoryRegions(region_list);
-  if (sb_error.Success()) {
-std::vector::iterator end = region_list.end();
-for (std::vector::iterator it = region_list.begin();
- it != end; it++) {
-  SBMemoryRegionInfo sb_region_info(it->get());
-  sb_region_list.Append(sb_region_info);
-}
-  }
-} else {
-  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-  if (log)
-log->Printf(
-"SBProcess(%p)::GetMemoryRegionInfo() => error: process is running",
-static_cast(process_sp.get()));
-  sb_error.SetErrorString("process is running");
-}
+  Process::StopLocker stop_locker;
+  if (process_sp && stop_locker.TryLock(&process_sp->GetRunLock())) {
+std::lock_guard guard(
+process_sp->GetTarget().GetAPIMutex());
+
+process_sp->GetMemoryRegions(sb_region_list.ref());
   } else {
-sb_error.SetErrorString("SBProcess is invalid");
+Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+if (log)
+  log->Printf(
+  "SBProcess(%p)::GetMemoryRegionInfo() => error: process is running",
+  static_cast(process_sp.get()));
   }
+
   return sb_region_list;
 }
 
Index: source/API/SBMemoryRegionInfoList.cpp
===
--- source/API/SBMemoryRegionInfoList.cpp
+++ source/API/SBMemoryRegionInfoList.cpp
@@ -32,31 +32,47 @@
 return *this;
   }
 
-  uint32_t GetSize() { return m_regions.size(); }
+  size_t GetSize() const { return m_regions.size(); }
 
-  void Append(const lldb::SBMemoryRegionInfo &sb_region) {
+  void Reserve(size_t capacity) { return m_regions.reserve(capacity); }
+
+  void Append(const MemoryRegionInfo &sb_region) {
 m_regions.push_back(sb_region);
   }
 
   void Append(const MemoryRegio

[Lldb-commits] [PATCH] D55841: GetMemoryRegions for the ProcessMinidump

2018-12-18 Thread Tatyana Krasnukha via Phabricator via lldb-commits
tatyana-krasnukha created this revision.
tatyana-krasnukha added a reviewer: clayborg.
tatyana-krasnukha added a project: LLDB.
Herald added a subscriber: lldb-commits.

Moved from D55472 


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D55841

Files:
  
C:/Repos/Svn/llvm/tools/lldb/source/Plugins/Process/minidump/MinidumpParser.cpp
  C:/Repos/Svn/llvm/tools/lldb/source/Plugins/Process/minidump/MinidumpParser.h
  C:/Repos/Svn/llvm/tools/lldb/source/Plugins/Process/minidump/MinidumpTypes.cpp
  
C:/Repos/Svn/llvm/tools/lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp
  C:/Repos/Svn/llvm/tools/lldb/source/Plugins/Process/minidump/ProcessMinidump.h


Index: 
C:/Repos/Svn/llvm/tools/lldb/source/Plugins/Process/minidump/ProcessMinidump.h
===
--- 
C:/Repos/Svn/llvm/tools/lldb/source/Plugins/Process/minidump/ProcessMinidump.h
+++ 
C:/Repos/Svn/llvm/tools/lldb/source/Plugins/Process/minidump/ProcessMinidump.h
@@ -78,6 +78,9 @@
   Status GetMemoryRegionInfo(lldb::addr_t load_addr,
  MemoryRegionInfo &range_info) override;
 
+  Status GetMemoryRegions(
+  lldb_private::MemoryRegionInfos ®ion_list) override;
+
   bool GetProcessInfo(ProcessInstanceInfo &info) override;
 
   Status WillResume() override {
Index: 
C:/Repos/Svn/llvm/tools/lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp
===
--- 
C:/Repos/Svn/llvm/tools/lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp
+++ 
C:/Repos/Svn/llvm/tools/lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp
@@ -288,6 +288,12 @@
   return Status();
 }
 
+Status ProcessMinidump::GetMemoryRegions(
+lldb_private::MemoryRegionInfos ®ion_list) {
+  region_list = m_minidump_parser.GetMemoryRegions();
+  return Status();
+}
+
 void ProcessMinidump::Clear() { Process::m_thread_list.Clear(); }
 
 bool ProcessMinidump::UpdateThreadList(ThreadList &old_thread_list,
Index: 
C:/Repos/Svn/llvm/tools/lldb/source/Plugins/Process/minidump/MinidumpTypes.cpp
===
--- 
C:/Repos/Svn/llvm/tools/lldb/source/Plugins/Process/minidump/MinidumpTypes.cpp
+++ 
C:/Repos/Svn/llvm/tools/lldb/source/Plugins/Process/minidump/MinidumpTypes.cpp
@@ -242,6 +242,8 @@
 return {};
 
   std::vector result;
+  result.reserve(header->num_of_entries);
+
   for (uint64_t i = 0; i < header->num_of_entries; ++i) {
 result.push_back(reinterpret_cast(
 data.data() + i * header->size_of_entry));
Index: 
C:/Repos/Svn/llvm/tools/lldb/source/Plugins/Process/minidump/MinidumpParser.h
===
--- 
C:/Repos/Svn/llvm/tools/lldb/source/Plugins/Process/minidump/MinidumpParser.h
+++ 
C:/Repos/Svn/llvm/tools/lldb/source/Plugins/Process/minidump/MinidumpParser.h
@@ -87,6 +87,8 @@
 
   MemoryRegionInfo GetMemoryRegionInfo(lldb::addr_t load_addr);
 
+  const std::vector &GetMemoryRegions();
+
   // Perform consistency checks and initialize internal data structures
   Status Initialize();
 
Index: 
C:/Repos/Svn/llvm/tools/lldb/source/Plugins/Process/minidump/MinidumpParser.cpp
===
--- 
C:/Repos/Svn/llvm/tools/lldb/source/Plugins/Process/minidump/MinidumpParser.cpp
+++ 
C:/Repos/Svn/llvm/tools/lldb/source/Plugins/Process/minidump/MinidumpParser.cpp
@@ -537,6 +537,12 @@
 
 MemoryRegionInfo
 MinidumpParser::GetMemoryRegionInfo(lldb::addr_t load_addr) {
+  if (!m_parsed_regions)
+GetMemoryRegions();
+  return FindMemoryRegion(load_addr);
+}
+
+const std::vector &MinidumpParser::GetMemoryRegions() {
   if (!m_parsed_regions) {
 m_parsed_regions = true;
 // We haven't cached our memory regions yet we will create the region cache
@@ -552,7 +558,7 @@
   CreateRegionsCacheFromMemory64List(*this, m_regions);
 std::sort(m_regions.begin(), m_regions.end());
   }
-  return FindMemoryRegion(load_addr);
+  return m_regions;
 }
 
 Status MinidumpParser::Initialize() {


Index: C:/Repos/Svn/llvm/tools/lldb/source/Plugins/Process/minidump/ProcessMinidump.h
===
--- C:/Repos/Svn/llvm/tools/lldb/source/Plugins/Process/minidump/ProcessMinidump.h
+++ C:/Repos/Svn/llvm/tools/lldb/source/Plugins/Process/minidump/ProcessMinidump.h
@@ -78,6 +78,9 @@
   Status GetMemoryRegionInfo(lldb::addr_t load_addr,
  MemoryRegionInfo &range_info) override;
 
+  Status GetMemoryRegions(
+  lldb_private::MemoryRegionInfos ®ion_list) override;
+
   bool GetProcessInfo(ProcessInstanceInfo &info) override;
 
   Status WillResume() override {
Index: C:/Repos/Svn/llvm/tools/lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp
===
--- C:/Repos/Svn/llvm/tools/lldb/source/Plugins/Proces

[Lldb-commits] [PATCH] D55607: Make crashlog.py work when a .dSYM is present, but a binary is missing

2018-12-18 Thread Stella Stamenova via Phabricator via lldb-commits
stella.stamenova added a comment.

In D55607#1334666 , @aprantl wrote:

> Can you confirm that reverting this path actually fixes the issue? I'm asking 
> because the only test that is executing this script has a REQUIRES: 
> system-darwin line in it.


Removing the test does fix the issue. I suspect the problem is the ordering of 
the REQUIRES and RUN lines, but I have not tested it. Regardless, the crashlog 
changes were the only two changes to LLDB in the first build that got stuck 
(there was also an llvm change). Please fix/revert this in the next couple of 
hours as we haven't had a good test run for LLDB on Windows since your change.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55607/new/

https://reviews.llvm.org/D55607



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


[Lldb-commits] [PATCH] D55607: Make crashlog.py work when a .dSYM is present, but a binary is missing

2018-12-18 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added a comment.

Ah.. that's possible. REQUIRES needs to be very high up in the file, but I 
don't know what the exact threshold is


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55607/new/

https://reviews.llvm.org/D55607



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


[Lldb-commits] [lldb] r349533 - Fix REQUIRES line

2018-12-18 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Tue Dec 18 12:28:54 2018
New Revision: 349533

URL: http://llvm.org/viewvc/llvm-project?rev=349533&view=rev
Log:
Fix REQUIRES line

Modified:
lldb/trunk/lit/Python/crashlog.test

Modified: lldb/trunk/lit/Python/crashlog.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Python/crashlog.test?rev=349533&r1=349532&r2=349533&view=diff
==
--- lldb/trunk/lit/Python/crashlog.test (original)
+++ lldb/trunk/lit/Python/crashlog.test Tue Dec 18 12:28:54 2018
@@ -1,6 +1,6 @@
 # -*- python 
-*-
+# REQUIRES: system-darwin
 # RUN: cd %S/../../examples/python && %lldb -S %s | FileCheck %s
-# REQUIRES : system-darwin
 # CHECK-LABEL: {{S}}KIP BEYOND CHECKS
 script
 import crashlog


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


[Lldb-commits] [lldb] r349539 - [cmake] Make libcxx(abi) a dependency when building in-tree clang for macOS

2018-12-18 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Tue Dec 18 12:59:23 2018
New Revision: 349539

URL: http://llvm.org/viewvc/llvm-project?rev=349539&view=rev
Log:
[cmake] Make libcxx(abi) a dependency when building in-tree clang for macOS

As discussed on IRC this morning, when building an in-tree clang for
testing we have to have libcxx and libcxxabi checked out. This is a
common pitfall. Not only are the resulting failures non-obvious, they
only manifest when running the test suite, *after* building lldb and
clang. By making them a hard dependency (on macOS) we fail earlier with
a more useful error message.

Differential revision: https://reviews.llvm.org/D55837

Modified:
lldb/trunk/CMakeLists.txt

Modified: lldb/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/CMakeLists.txt?rev=349539&r1=349538&r2=349539&view=diff
==
--- lldb/trunk/CMakeLists.txt (original)
+++ lldb/trunk/CMakeLists.txt Tue Dec 18 12:59:23 2018
@@ -157,6 +157,10 @@ if(LLDB_INCLUDE_TESTS)
 
   if(TARGET clang)
 list(APPEND LLDB_TEST_DEPS clang)
+if(APPLE)
+  list(APPEND LLDB_TEST_DEPS cxx)
+  list(APPEND LLDB_TEST_DEPS cxxabi)
+endif()
   endif()
 
   if(TARGET dsymutil)


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


[Lldb-commits] [PATCH] D55837: [cmake] Make libcxx(abi) a dependency when building in-tree clang for macOS

2018-12-18 Thread Jonas Devlieghere via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rLLDB349539: [cmake] Make libcxx(abi) a dependency when 
building in-tree clang for macOS (authored by JDevlieghere, committed by ).

Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55837/new/

https://reviews.llvm.org/D55837

Files:
  CMakeLists.txt


Index: CMakeLists.txt
===
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -157,6 +157,10 @@
 
   if(TARGET clang)
 list(APPEND LLDB_TEST_DEPS clang)
+if(APPLE)
+  list(APPEND LLDB_TEST_DEPS cxx)
+  list(APPEND LLDB_TEST_DEPS cxxabi)
+endif()
   endif()
 
   if(TARGET dsymutil)


Index: CMakeLists.txt
===
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -157,6 +157,10 @@
 
   if(TARGET clang)
 list(APPEND LLDB_TEST_DEPS clang)
+if(APPLE)
+  list(APPEND LLDB_TEST_DEPS cxx)
+  list(APPEND LLDB_TEST_DEPS cxxabi)
+endif()
   endif()
 
   if(TARGET dsymutil)
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D55384: [NativePDB] Reconstruct FunctionDecl AST nodes from PDB debug info

2018-12-18 Thread Stella Stamenova via Phabricator via lldb-commits
stella.stamenova added a comment.

A bunch of the NativePDB tests are failing on Windows now.

http://lab.llvm.org:8014/builders/lldb-x64-windows-ninja/builds/2365/steps/test/logs/stdio


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55384/new/

https://reviews.llvm.org/D55384



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


[Lldb-commits] [PATCH] D55837: [cmake] Make libcxx(abi) a dependency when building in-tree clang for macOS

2018-12-18 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added inline comments.



Comment at: CMakeLists.txt:160
 list(APPEND LLDB_TEST_DEPS clang)
+if(APPLE)
+  list(APPEND LLDB_TEST_DEPS cxx)

What if the user wants to use a different compiler for tests? cmake has 
LLDB_TEST_USE_CUSTOM_C_COMPILER and LLDB_TEST_C_COMPILER and 
LLDB_TEST_CXX_COMPILER which can supposedly be set.


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55837/new/

https://reviews.llvm.org/D55837



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


[Lldb-commits] [PATCH] D55837: [cmake] Make libcxx(abi) a dependency when building in-tree clang for macOS

2018-12-18 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere marked 2 inline comments as done.
JDevlieghere added inline comments.



Comment at: CMakeLists.txt:160
 list(APPEND LLDB_TEST_DEPS clang)
+if(APPLE)
+  list(APPEND LLDB_TEST_DEPS cxx)

clayborg wrote:
> What if the user wants to use a different compiler for tests? cmake has 
> LLDB_TEST_USE_CUSTOM_C_COMPILER and LLDB_TEST_C_COMPILER and 
> LLDB_TEST_CXX_COMPILER which can supposedly be set.
That still works. The change says that *if* you are going to build the in-tree 
clang, it has to build libcxx(abi) too. That should always make sense, because 
clang (on Darwin) won't be able to find the standard library otherwise. 


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55837/new/

https://reviews.llvm.org/D55837



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


[Lldb-commits] [PATCH] D55841: GetMemoryRegions for the ProcessMinidump

2018-12-18 Thread Greg Clayton via Phabricator via lldb-commits
clayborg requested changes to this revision.
clayborg added a comment.
This revision now requires changes to proceed.

Change looks good.

We need to add a test for this. You can use the minidump file from 
"lldb/unittests/Process/minidump/Inputs/regions-linux-map.dmp" and copy it over 
into 
"lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new" 
and then add a test to 
"packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/TestMiniDumpNew.py"
 to ensure this doesn't regress.


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55841/new/

https://reviews.llvm.org/D55841



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


[Lldb-commits] [PATCH] D55607: Make crashlog.py work when a .dSYM is present, but a binary is missing

2018-12-18 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added a comment.

Sorry I forgot to comment: this should be fixed in r349533.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55607/new/

https://reviews.llvm.org/D55607



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


[Lldb-commits] [PATCH] D55827: Update current working directory to avoid test crashes

2018-12-18 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment.

In D55827#1334671 , @labath wrote:

> Hm... this seems like an important issue in the `RealFileSystem` (or our 
> usage of it), and I'm not sure it should be papered over like that. I mean, 
> lldb is a library, and requiring every call to `chdir` in the whole process 
> go through "our" implementation is not very friendly towards everyone else we 
> happen to be sharing a process with.


On the other hand (playing the devil's advocate) it could be considered nice 
that lldb as a library isn't affected by that if we explicitly set the cwd?

> It sounds like we want a VFS that is slightly more "real" than the 
> RealFileSystem, and which shares the notion of the CWD with the OS.

Did you have a look at the comment in `VirtualFileSystem.cpp` that explains why 
they went this route?

  // FIXME: chdir is thread hostile; on the other hand, creating the same
  // behavior as chdir is complex: chdir resolves the path once, thus
  // guaranteeing that all subsequent relative path operations work
  // on the same path the original chdir resulted in. This makes a
  // difference for example on network filesystems, where symlinks might be
  // switched during runtime of the tool. Fixing this depends on having a
  // file system abstraction that allows openat() style interactions.

Wouldn't we encounter the same problem?


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55827/new/

https://reviews.llvm.org/D55827



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


[Lldb-commits] [PATCH] D55384: [NativePDB] Reconstruct FunctionDecl AST nodes from PDB debug info

2018-12-18 Thread Stella Stamenova via Phabricator via lldb-commits
stella.stamenova added a comment.

It looks like this might not be specific to your change as a few other tests 
are failing with a similar error. I'm looking into it.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55384/new/

https://reviews.llvm.org/D55384



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


[Lldb-commits] [PATCH] D55718: [ARC] Basic support in gdb-remote process plugin

2018-12-18 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment.

See inline comments and let me know what you think.




Comment at: include/lldb/Utility/ArchSpec.h:91-92
 
+  // ARC configuration flags
+  enum ARCflags { eARC_rf32 = 0 /*0b00*/, eARC_rf16 = 2 /*0b10*/ };
+

Since no other place needs these flags, it would be nice to define them in 
ProcessGDBRemote.cpp and remove them from here? Eventually we should get rid of 
all flags in here and move then to the Architecture.h subclass headers.



Comment at: source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp:4549
+// The target is configured to use reduced register file.
+arch_to_use.SetFlags(ArchSpec::eARC_rf16);
+// ABI uses this information to determine how many registers it may

Do we need to set this flags in the arch_to_use still? The eARC_rf16 only seems 
to be used in this file. If you plan on using eARC_rf16 in other parts of the 
code, then we should define it in ArchSpec as you have it, otherwise we should 
remove it and avoid polluting that header if possible 



Comment at: source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp:4564
+if (LLDB_INVALID_REGNUM == reg_num) {
+  if (ArchSpec::eARC_rf16 & arch.GetFlags()) {
+  // In reduced mode we don't have r4-r9, r16-r25.

the rf16 could be passed into this function as an argument and then the enum 
can be removed from ArchSpec.h?



Comment at: source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp:4704-4707
+if (!arc::ConfigureArchitecture(*this, m_register_info, arch_to_use))
+  return false;
+
+arc::AdjustRegisterInfo(m_register_info, arch_to_use);

This logic still seems possibly incorrect as we will skip the finalize call 
below? Shouldn't this just be:

```
if (arc::ConfigureArchitecture(*this, m_register_info, arch_to_use))
  arc::AdjustRegisterInfo(m_register_info, arch_to_use);
```
And fall through to below?


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55718/new/

https://reviews.llvm.org/D55718



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


[Lldb-commits] [lldb] r349546 - [CMake] Don't require libcxxabi on darwin

2018-12-18 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Tue Dec 18 13:40:05 2018
New Revision: 349546

URL: http://llvm.org/viewvc/llvm-project?rev=349546&view=rev
Log:
[CMake] Don't require libcxxabi on darwin

Just libcxx should suffice.

Modified:
lldb/trunk/CMakeLists.txt

Modified: lldb/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/CMakeLists.txt?rev=349546&r1=349545&r2=349546&view=diff
==
--- lldb/trunk/CMakeLists.txt (original)
+++ lldb/trunk/CMakeLists.txt Tue Dec 18 13:40:05 2018
@@ -159,7 +159,6 @@ if(LLDB_INCLUDE_TESTS)
 list(APPEND LLDB_TEST_DEPS clang)
 if(APPLE)
   list(APPEND LLDB_TEST_DEPS cxx)
-  list(APPEND LLDB_TEST_DEPS cxxabi)
 endif()
   endif()
 


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


[Lldb-commits] [lldb] r349550 - TestHelloWorld: Use a file on the target platform for synchronisation.

2018-12-18 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Tue Dec 18 14:17:38 2018
New Revision: 349550

URL: http://llvm.org/viewvc/llvm-project?rev=349550&view=rev
Log:
TestHelloWorld: Use a file on the target platform for synchronisation.

Thanks to Pavel Labath for the idea!

Modified:

lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py
lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/main.c

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py?rev=349550&r1=349549&r2=349550&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py
 Tue Dec 18 14:17:38 2018
@@ -10,8 +10,7 @@ import time
 import lldb
 from lldbsuite.test.decorators import *
 from lldbsuite.test.lldbtest import *
-from lldbsuite.test import lldbutil
-
+import lldbsuite.test.lldbutil as lldbutil
 
 class HelloWorldTestCase(TestBase):
 NO_DEBUG_INFO_TESTCASE = True
@@ -88,8 +87,12 @@ class HelloWorldTestCase(TestBase):
 target = self.dbg.CreateTarget(exe)
 
 # Spawn a new process
-popen = self.spawnSubprocess(exe, ["abc", "xyz"])
+token = exe+'.token'
+if os.path.exists(token):
+os.remove(token)
+popen = self.spawnSubprocess(exe, [token])
 self.addTearDownHook(self.cleanupSubprocesses)
+lldbutil.wait_for_file_on_target(self, token)
 
 listener = lldb.SBListener("my.attach.listener")
 error = lldb.SBError()
@@ -98,11 +101,10 @@ class HelloWorldTestCase(TestBase):
 self.assertTrue(error.Success() and process, PROCESS_IS_VALID)
 
 # Let's check the stack traces of the attached process.
-import lldbsuite.test.lldbutil as lldbutil
 stacktraces = lldbutil.print_stacktraces(process, string_buffer=True)
 self.expect(stacktraces, exe=False,
 substrs=['main.c:%d' % self.line2,
- '(int)argc=3'])
+ '(int)argc=2'])
 
 @add_test_categories(['pyapi'])
 @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24600")
@@ -115,9 +117,13 @@ class HelloWorldTestCase(TestBase):
 self.setTearDownCleanup(dictionary=d)
 target = self.dbg.CreateTarget(exe)
 
-# Spawn a new process
-popen = self.spawnSubprocess(exe, ["abc", "xyz"])
+# Spawn a new process.
+token = exe+'.token'
+if os.path.exists(token):
+os.remove(token)
+popen = self.spawnSubprocess(exe, [token])
 self.addTearDownHook(self.cleanupSubprocesses)
+lldbutil.wait_for_file_on_target(self, token)
 
 listener = lldb.SBListener("my.attach.listener")
 error = lldb.SBError()
@@ -132,7 +138,6 @@ class HelloWorldTestCase(TestBase):
 target.ConnectRemote(listener, None, None, error)
 
 process = target.AttachToProcessWithName(listener, name, False, error)
-
 self.assertTrue(error.Success() and process, PROCESS_IS_VALID)
 
 # Verify that after attach, our selected target indeed matches name.
@@ -142,8 +147,7 @@ class HelloWorldTestCase(TestBase):
 startstr=name)
 
 # Let's check the stack traces of the attached process.
-import lldbsuite.test.lldbutil as lldbutil
 stacktraces = lldbutil.print_stacktraces(process, string_buffer=True)
 self.expect(stacktraces, exe=False,
 substrs=['main.c:%d' % self.line2,
- '(int)argc=3'])
+ '(int)argc=2'])

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/main.c
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/main.c?rev=349550&r1=349549&r2=349550&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/main.c 
(original)
+++ lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/main.c Tue 
Dec 18 14:17:38 2018
@@ -8,16 +8,22 @@
 
 int main(int argc, char const *argv[])
 {
-lldb_enable_attach();
+  lldb_enable_attach();
 
-printf("Hello world.\n"); // Set break point at this line.
-if (argc == 1)
-return 0;
+  printf("Hello world.\n"); // Set break point at this line.
+  if (argc == 1)
+return 1;
 
-// Waiting to be attached by the debugger, otherwise.
-char line[100];
-while (1) 
-sleep (1); // Waiting to be attached...
+  // Create the synchronization token.
+  FILE *f;
+  if (f = fopen(argv[1], "wx")) {
+fputs("\n", f);
+fflush(f);
+fclose(f);
+  } else
+ 

[Lldb-commits] [PATCH] D55854: Show the memory region name if there is one in the output of the "memory region" command

2018-12-18 Thread Greg Clayton via Phabricator via lldb-commits
clayborg created this revision.
clayborg added reviewers: zturner, labath, lemo, jingham.

Prior to this change we would show the name of the section that a memory region 
belonged to but not its actual region name. Now we show this,. Added a test 
that reuses the regions-linux-map.dmp minidump file to test this and verify the 
correct region names for various memory regions.


https://reviews.llvm.org/D55854

Files:
  
packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/TestMiniDumpNew.py
  
packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/regions-linux-map.dmp
  source/Commands/CommandObjectMemory.cpp


Index: source/Commands/CommandObjectMemory.cpp
===
--- source/Commands/CommandObjectMemory.cpp
+++ source/Commands/CommandObjectMemory.cpp
@@ -1723,6 +1723,7 @@
 error = process_sp->GetMemoryRegionInfo(load_addr, range_info);
 if (error.Success()) {
   lldb_private::Address addr;
+  ConstString name = range_info.GetName();
   ConstString section_name;
   if (process_sp->GetTarget().ResolveLoadAddress(load_addr, addr)) {
 SectionSP section_sp(addr.GetSection());
@@ -1734,13 +1735,14 @@
 }
   }
   result.AppendMessageWithFormat(
-  "[0x%16.16" PRIx64 "-0x%16.16" PRIx64 ") %c%c%c%s%s\n",
+  "[0x%16.16" PRIx64 "-0x%16.16" PRIx64 ") %c%c%c%s%s%s%s\n",
   range_info.GetRange().GetRangeBase(),
   range_info.GetRange().GetRangeEnd(),
   range_info.GetReadable() ? 'r' : '-',
   range_info.GetWritable() ? 'w' : '-',
-  range_info.GetExecutable() ? 'x' : '-', section_name ? " " : "",
-  section_name ? section_name.AsCString() : "");
+  range_info.GetExecutable() ? 'x' : '-',
+  name ? " " : "", name.AsCString(""),
+  section_name ? " " : "", section_name.AsCString(""));
   m_prev_end_addr = range_info.GetRange().GetRangeEnd();
   result.SetStatus(eReturnStatusSuccessFinishResult);
 } else {
Index: 
packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/TestMiniDumpNew.py
===
--- 
packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/TestMiniDumpNew.py
+++ 
packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/TestMiniDumpNew.py
@@ -88,6 +88,36 @@
 self.assertEqual(self.process.GetProcessID(), self._linux_x86_64_pid)
 self.check_state()
 
+def test_memory_region_name(self):
+self.dbg.CreateTarget(None)
+self.target = self.dbg.GetSelectedTarget()
+self.process = self.target.LoadCore("regions-linux-map.dmp")
+result = lldb.SBCommandReturnObject()
+addr_region_name_pairs = [
+("0x400d9000", "/system/bin/app_process"),
+("0x400db000", "/system/bin/app_process"),
+("0x400dd000", "/system/bin/linker"),
+("0x400ed000", "/system/bin/linker"),
+("0x400ee000", "/system/bin/linker"),
+("0x400fb000", "/system/lib/liblog.so"),
+("0x400fc000", "/system/lib/liblog.so"),
+("0x400fd000", "/system/lib/liblog.so"),
+("0x400ff000", "/system/lib/liblog.so"),
+("0x4010", "/system/lib/liblog.so"),
+("0x40101000", "/system/lib/libc.so"),
+("0x40122000", "/system/lib/libc.so"),
+("0x40123000", "/system/lib/libc.so"),
+("0x40167000", "/system/lib/libc.so"),
+("0x40169000", "/system/lib/libc.so"),
+]
+ci = self.dbg.GetCommandInterpreter()
+for (addr, region_name) in addr_region_name_pairs:
+command = 'memory region ' + addr
+ci.HandleCommand(command, result, False)
+message = 'Ensure memory "%s" shows up in output for "%s"' % (
+region_name, command)
+self.assertTrue(region_name in result.GetOutput(), message)
+
 def test_modules_in_mini_dump(self):
 """Test that lldb can read the list of modules from the minidump."""
 # target create -c linux-x86_64.dmp


Index: source/Commands/CommandObjectMemory.cpp
===
--- source/Commands/CommandObjectMemory.cpp
+++ source/Commands/CommandObjectMemory.cpp
@@ -1723,6 +1723,7 @@
 error = process_sp->GetMemoryRegionInfo(load_addr, range_info);
 if (error.Success()) {
   lldb_private::Address addr;
+  ConstString name = range_info.GetName();
   ConstString section_name;
   if (process_sp->GetTarget().ResolveLoadAddress(load_addr, addr)) {
 SectionSP section_sp(addr.GetSection());
@@ -1734,13 +1735,14 @@
 }
   }
   result.AppendMessageWithFormat(
-  "

[Lldb-commits] [lldb] r349553 - Un-conditionalize use of libcompression. debugserver only builds

2018-12-18 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Tue Dec 18 14:21:48 2018
New Revision: 349553

URL: http://llvm.org/viewvc/llvm-project?rev=349553&view=rev
Log:
Un-conditionalize use of libcompression.  debugserver only builds
on Darwin systems and libcompression has been in the OS for over
three years. 

Remove use of / linking to zlib.  We'll always have libcompression
available now.

Create a scratch buffer via compression_encode_scratch_buffer_size()
and use it in calls to compression_encode_buffer() to avoid 
compression_encode_buffer having to malloc & free a scratch buffer
on each call.  

Tested by forcing compression to be enabled on macos native (normally
only enabled on iOS et al devices), running the testsuite.



Modified:
lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj
lldb/trunk/tools/debugserver/source/RNBRemote.cpp

Modified: lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj?rev=349553&r1=349552&r2=349553&view=diff
==
--- lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj 
(original)
+++ lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj Tue Dec 
18 14:21:48 2018
@@ -710,12 +710,9 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
-   LLDB_COMPRESSION_CFLAGS = 
"-DHAVE_LIBCOMPRESSION=1";
LLDB_COMPRESSION_LDFLAGS = "-lcompression";
LLDB_OS_LOG_CFLAGS = 
"-DLLDB_USE_OS_LOG=$(LLDB_USE_OS_LOG)";
LLDB_USE_OS_LOG = 0;
-   LLDB_ZLIB_CFLAGS = "-DHAVE_LIBZ=1";
-   LLDB_ZLIB_LDFLAGS = "-lz";
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = "";
STRIP_INSTALLED_PRODUCT = NO;
@@ -749,13 +746,10 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
-   LLDB_COMPRESSION_CFLAGS = 
"-DHAVE_LIBCOMPRESSION=1";
LLDB_COMPRESSION_LDFLAGS = "-lcompression";
LLDB_ENERGY_LDFLAGS = "-lpmenergy -lpmsample";
LLDB_OS_LOG_CFLAGS = 
"-DLLDB_USE_OS_LOG=$(LLDB_USE_OS_LOG)";
LLDB_USE_OS_LOG = 0;
-   LLDB_ZLIB_CFLAGS = "-DHAVE_LIBZ=1";
-   LLDB_ZLIB_LDFLAGS = "-lz";
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = "";
STRIPFLAGS = "-x";
@@ -790,12 +784,9 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
-   LLDB_COMPRESSION_CFLAGS = 
"-DHAVE_LIBCOMPRESSION=1";
LLDB_COMPRESSION_LDFLAGS = "-lcompression";
LLDB_OS_LOG_CFLAGS = 
"-DLLDB_USE_OS_LOG=$(LLDB_USE_OS_LOG)";
LLDB_USE_OS_LOG = 1;
-   LLDB_ZLIB_CFLAGS = "-DHAVE_LIBZ=1";
-   LLDB_ZLIB_LDFLAGS = "-lz";
OTHER_CFLAGS = "";
STRIPFLAGS = "-x";
STRIP_STYLE = debugging;
@@ -828,20 +819,15 @@
HEADER_SEARCH_PATHS = 
/System/Library/Frameworks/System.framework/PrivateHeaders;
INSTALL_PATH = /usr/bin;
"INSTALL_PATH[sdk=iphoneos*]" = 
/Developer/usr/bin/;
-   LLDB_COMPRESSION_CFLAGS = 
"-DHAVE_LIBCOMPRESSION=1";
LLDB_COMPRESSION_LDFLAGS = "-lcompression";
LLDB_DEBUGSERVER = 1;
LLDB_ENERGY_CFLAGS = "";
"LLDB_ENERGY_CFLAGS[sdk=*internal]" = 
"-DLLDB_ENERGY";
LLDB_ENERGY_LDFLAGS = "-lpmenergy -lpmsample";
-   LLDB_ZLIB_CFLAGS = "-DHAVE_LIBZ=1";
-   LLDB_ZLIB_LDFLAGS = "-lz";
OTHER_CFLAGS = (
"-Wparentheses",
"$(LLDB_ENERGY_CFLAGS)",
"-DDT_VARIANT_$(DT_VARIANT)",
-   "$(LLDB_COMPR

[Lldb-commits] [lldb] r349562 - [lit] Use the new build.py script in the lldb-mi tests

2018-12-18 Thread Stella Stamenova via lldb-commits
Author: stella.stamenova
Date: Tue Dec 18 14:54:17 2018
New Revision: 349562

URL: http://llvm.org/viewvc/llvm-project?rev=349562&view=rev
Log:
[lit] Use the new build.py script in the lldb-mi tests

This allows the tests to pass on Windows as well

Modified:
lldb/trunk/lit/Driver/Inputs/hello.c
lldb/trunk/lit/Driver/TestConvenienceVariables.test
lldb/trunk/lit/tools/lldb-mi/breakpoint/break-insert.test
lldb/trunk/lit/tools/lldb-mi/data/data-info-line.test
lldb/trunk/lit/tools/lldb-mi/exec/exec-continue.test
lldb/trunk/lit/tools/lldb-mi/exec/exec-finish.test
lldb/trunk/lit/tools/lldb-mi/exec/exec-interrupt.test
lldb/trunk/lit/tools/lldb-mi/exec/exec-next-instruction.test
lldb/trunk/lit/tools/lldb-mi/exec/exec-next.test
lldb/trunk/lit/tools/lldb-mi/exec/exec-step-instruction.test
lldb/trunk/lit/tools/lldb-mi/exec/exec-step.test
lldb/trunk/lit/tools/lldb-mi/symbol/symbol-list-lines.test

lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py

Modified: lldb/trunk/lit/Driver/Inputs/hello.c
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Driver/Inputs/hello.c?rev=349562&r1=349561&r2=349562&view=diff
==
--- lldb/trunk/lit/Driver/Inputs/hello.c (original)
+++ lldb/trunk/lit/Driver/Inputs/hello.c Tue Dec 18 14:54:17 2018
@@ -1,5 +1,6 @@
-int puts(const char*);
+#include 
+
 int main(int argc, char **argv) {
-  puts("Hello World\n");
+  printf("Hello World\n");
   return 0;
 }

Modified: lldb/trunk/lit/Driver/TestConvenienceVariables.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Driver/TestConvenienceVariables.test?rev=349562&r1=349561&r2=349562&view=diff
==
--- lldb/trunk/lit/Driver/TestConvenienceVariables.test (original)
+++ lldb/trunk/lit/Driver/TestConvenienceVariables.test Tue Dec 18 14:54:17 2018
@@ -1,4 +1,4 @@
-RUN: %clang %p/Inputs/hello.c -g -o %t
+RUN: %build %p/Inputs/hello.c -o %t
 RUN: %lldb %t -s %p/Inputs/convenience.in -o quit | FileCheck %s
 
 script print(lldb.debugger)
@@ -15,7 +15,7 @@ CHECK-SAME:   executable = TestConve
 CHECK: script print(lldb.thread.GetStopDescription(100))
 CHECK: breakpoint 1.1
 CHECK: script lldb.frame.GetLineEntry().GetLine()
-CHECK: 3
+CHECK: 4
 CHECK: script lldb.frame.GetLineEntry().GetFileSpec().GetFilename()
 CHECK: hello.c
 CHECK: script lldb.frame.GetFunctionName()

Modified: lldb/trunk/lit/tools/lldb-mi/breakpoint/break-insert.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/tools/lldb-mi/breakpoint/break-insert.test?rev=349562&r1=349561&r2=349562&view=diff
==
--- lldb/trunk/lit/tools/lldb-mi/breakpoint/break-insert.test (original)
+++ lldb/trunk/lit/tools/lldb-mi/breakpoint/break-insert.test Tue Dec 18 
14:54:17 2018
@@ -1,7 +1,4 @@
-# XFAIL: system-windows
-# -> llvm.org/pr24452
-#
-# RUN: %clang -o a.exe %p/inputs/break-insert.c -g
+# RUN: %build %p/inputs/break-insert.c --nodefaultlib -o a.exe
 # RUN: %lldbmi < %s | FileCheck %s
 
 # Test that a breakpoint can be inserted before creating a target.

Modified: lldb/trunk/lit/tools/lldb-mi/data/data-info-line.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/tools/lldb-mi/data/data-info-line.test?rev=349562&r1=349561&r2=349562&view=diff
==
--- lldb/trunk/lit/tools/lldb-mi/data/data-info-line.test (original)
+++ lldb/trunk/lit/tools/lldb-mi/data/data-info-line.test Tue Dec 18 14:54:17 
2018
@@ -1,7 +1,4 @@
-# XFAIL: system-windows
-# -> llvm.org/pr24452
-#
-# RUN: %clang -o %t %p/inputs/data-info-line.c -g
+# RUN: %build %p/inputs/data-info-line.c --nodefaultlib -o %t
 # RUN: %lldbmi %t < %s | FileCheck %s
 
 # Test lldb-mi -data-info-line command.

Modified: lldb/trunk/lit/tools/lldb-mi/exec/exec-continue.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/tools/lldb-mi/exec/exec-continue.test?rev=349562&r1=349561&r2=349562&view=diff
==
--- lldb/trunk/lit/tools/lldb-mi/exec/exec-continue.test (original)
+++ lldb/trunk/lit/tools/lldb-mi/exec/exec-continue.test Tue Dec 18 14:54:17 
2018
@@ -1,7 +1,4 @@
-# XFAIL: system-windows
-# -> llvm.org/pr24452
-#
-# RUN: %clang -o %t %p/inputs/main.c -g
+# RUN: %build %p/inputs/main.c --nodefaultlib -o %t
 # RUN: %lldbmi %t < %s | FileCheck %s
 
 # Test lldb-mi -exec-continue command.

Modified: lldb/trunk/lit/tools/lldb-mi/exec/exec-finish.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/tools/lldb-mi/exec/exec-finish.test?rev=349562&r1=349561&r2=349562&view=diff
==
--- lldb/trunk/lit/tools/lldb-mi/exec/exec-finish.test (original)
+++ lldb

[Lldb-commits] [lldb] r349563 - Force libcompression calls to be enabled when building on Darwin

2018-12-18 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Tue Dec 18 15:02:50 2018
New Revision: 349563

URL: http://llvm.org/viewvc/llvm-project?rev=349563&view=rev
Log:
Force libcompression calls to be enabled when building on Darwin
systems.  It has been available in the OS over over three years
now.  If lldb doesn't link against -lcompression, it should be an
error.

Allocate a scratch buffer for libcompression to use when decoding
packets, instead of it having to allocate & free one on every call.

Fix a typeo with the size of the buffer that compression_decode_buffer()
is expanding into.

 

Modified:
lldb/trunk/lldb.xcodeproj/project.pbxproj
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h

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

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=349563&r1=349562&r2=349563&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Tue Dec 18 15:02:50 2018
@@ -8712,8 +8712,7 @@
GCC_WARN_UNUSED_LABEL = YES;
GCC_WARN_UNUSED_VALUE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
-   LLDB_COMPRESSION_CFLAGS = 
"-DHAVE_LIBCOMPRESSION=1";
-   LLDB_COMPRESSION_LDFLAGS = "-weak-lcompression";
+   LLDB_COMPRESSION_LDFLAGS = "-lcompression";
LLDB_COVERAGE_CFLAGS = 
"$(LLDB_COVERAGE_CFLAGS_$(LLDB_ENABLE_COVERAGE))";
LLDB_COVERAGE_CFLAGS_1 = 
"-fprofile-instr-generate -fcoverage-mapping";
LLDB_COVERAGE_LDFLAGS = 
"$(LLDB_COVERAGE_LDFLAGS_$(LLDB_ENABLE_COVERAGE))";
@@ -8734,12 +8733,11 @@
OTHER_CFLAGS = (
"-Wparentheses",
"$(LLDB_ZLIB_CFLAGS)",
-   "$(LLDB_COMPRESSION_CFLAGS)",
"$(LLDB_COVERAGE_CFLAGS)",
"-Wimplicit-fallthrough",
);
OTHER_LDFLAGS = (
-   "$(LLDB_COMPRESSION_LDFLAGS)",
+   "-lcompression",
"$(LLDB_ZLIB_LDFLAGS)",
"$(LLDB_COVERAGE_LDFLAGS)",
);
@@ -8802,8 +8800,7 @@
GCC_WARN_UNUSED_LABEL = YES;
GCC_WARN_UNUSED_VALUE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
-   LLDB_COMPRESSION_CFLAGS = 
"-DHAVE_LIBCOMPRESSION=1";
-   LLDB_COMPRESSION_LDFLAGS = "-weak-lcompression";
+   LLDB_COMPRESSION_LDFLAGS = "-lcompression";
LLDB_COVERAGE_CFLAGS = 
"$(LLDB_COVERAGE_CFLAGS_$(LLDB_ENABLE_COVERAGE))";
LLDB_COVERAGE_CFLAGS_1 = 
"-fprofile-instr-generate -fcoverage-mapping";
LLDB_COVERAGE_LDFLAGS = 
"$(LLDB_COVERAGE_LDFLAGS_$(LLDB_ENABLE_COVERAGE))";
@@ -8824,12 +8821,11 @@
OTHER_CFLAGS = (
"-Wparentheses",
"$(LLDB_ZLIB_CFLAGS)",
-   "$(LLDB_COMPRESSION_CFLAGS)",
"$(LLDB_COVERAGE_CFLAGS)",
"-Wimplicit-fallthrough",
);
OTHER_LDFLAGS = (
-   "$(LLDB_COMPRESSION_LDFLAGS)",
+   "-lcompression",
"$(LLDB_ZLIB_LDFLAGS)",
"$(LLDB_COVERAGE_LDFLAGS)",
);
@@ -8965,7 +8961,6 @@
"-fno-rtti",
"-Wparentheses",
"$(LLDB_ZLIB_CFLAGS)",
-   "$(LLDB_COMPRESSION_CFLAGS)",
"$(LLDB_GTESTS_CFLAGS)",
"-DGTEST_HAS_RTTI=0",
);
@@ -9007,7 +9002,6 @@
"-fno-rtti",
"-Wparentheses",
"$(LLDB_ZLIB_CFLAGS)",
-

[Lldb-commits] [PATCH] D55858: noexternal 1/2: refactor testsuite spawnLldbMi args->exe+args

2018-12-18 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil created this revision.
jankratochvil added reviewers: LLDB, labath.
jankratochvil added a project: LLDB.
Herald added subscribers: abidh, ki.stfu.

Currently `spawnLldbMi` accepts both lldb-mi options and executable to debug as 
a single parameter. Split them.
As in the next patch we will need to execute one lldb-mi command before loading 
the exe.  Therefore we can no longer use the exe as lldb-mi command-line 
parameter as then there is no way to execute a command before loading exe 
specified as lldb-mi command-line parameter.
`LocateExecutableSymbolFileDsym` should be static, that is also a little 
refactorization.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D55858

Files:
  packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py
  
packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py
  packages/Python/lldbsuite/test/tools/lldb-mi/syntax/TestMiSyntax.py
  source/Host/common/Symbols.cpp

Index: source/Host/common/Symbols.cpp
===
--- source/Host/common/Symbols.cpp
+++ source/Host/common/Symbols.cpp
@@ -199,7 +199,7 @@
   return false;
 }
 
-FileSpec LocateExecutableSymbolFileDsym(const ModuleSpec &module_spec) {
+static FileSpec LocateExecutableSymbolFileDsym(const ModuleSpec &module_spec) {
   const FileSpec *exec_fspec = module_spec.GetFileSpecPtr();
   const ArchSpec *arch = module_spec.GetArchitecturePtr();
   const UUID *uuid = module_spec.GetUUIDPtr();
Index: packages/Python/lldbsuite/test/tools/lldb-mi/syntax/TestMiSyntax.py
===
--- packages/Python/lldbsuite/test/tools/lldb-mi/syntax/TestMiSyntax.py
+++ packages/Python/lldbsuite/test/tools/lldb-mi/syntax/TestMiSyntax.py
@@ -53,7 +53,7 @@
 os.symlink(self.myexe, complicated_myexe)
 self.addTearDownHook(lambda: os.unlink(complicated_myexe))
 
-self.spawnLldbMi(args="\"%s\"" % complicated_myexe)
+self.spawnLldbMi(exe=complicated_myexe)
 
 # Test that the executable was loaded
 self.expect(
Index: packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py
===
--- packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py
+++ packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py
@@ -22,7 +22,7 @@
 def test_lldbmi_executable_option_file(self):
 """Test that 'lldb-mi --interpreter %s' loads executable file."""
 
-self.spawnLldbMi(args="%s" % self.myexe)
+self.spawnLldbMi(exe=self.myexe)
 
 # Test that the executable is loaded when file was specified
 self.expect("-file-exec-and-symbols \"%s\"" % self.myexe)
@@ -52,7 +52,7 @@
 # Prepare path to executable
 path = "unknown_file"
 
-self.spawnLldbMi(args="%s" % path)
+self.spawnLldbMi(exe=path)
 
 # Test that the executable isn't loaded when unknown file was specified
 self.expect("-file-exec-and-symbols \"%s\"" % path)
@@ -71,7 +71,7 @@
 """Test that 'lldb-mi --interpreter %s' loads executable which is specified via absolute path."""
 
 # Prepare path to executable
-self.spawnLldbMi(args="%s" % self.myexe)
+self.spawnLldbMi(exe=self.myexe)
 
 # Test that the executable is loaded when file was specified using
 # absolute path
@@ -95,7 +95,7 @@
 
 # Prepare path to executable
 path = os.path.relpath(self.myexe, self.getBuildDir())
-self.spawnLldbMi(args="%s" % path)
+self.spawnLldbMi(exe=path)
 
 # Test that the executable is loaded when file was specified using
 # relative path
@@ -119,7 +119,7 @@
 # Prepare path to executable
 path = "unknown_dir" + self.myexe
 
-self.spawnLldbMi(args="%s" % path)
+self.spawnLldbMi(exe=path)
 
 # Test that the executable isn't loaded when file was specified using
 # unknown path
@@ -259,7 +259,7 @@
 """Test that 'lldb-mi --log' creates a log file in the current directory."""
 
 logDirectory = self.getBuildDir()
-self.spawnLldbMi(args="%s --log" % self.myexe)
+self.spawnLldbMi(exe=self.myexe, args="--log")
 
 # Test that the executable is loaded when file was specified
 self.expect("-file-exec-and-symbols \"%s\"" % self.myexe)
@@ -296,9 +296,8 @@
 import tempfile
 logDirectory = tempfile.gettempdir()
 
-self.spawnLldbMi(
-args="%s --log --log-dir=%s" %
-(self.myexe, logDirectory))
+self.spawnLldbMi(exe=self.myexe,
+args="--log --log-dir=%s" % logDirectory)
 
 # Test that the executable is loaded when file was specified
 self.expect("-file-exec-and-symbols \"%s\"" % self.myexe)
Index: packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi

[Lldb-commits] [lldb] r349565 - [NativePDB] Correctly reconstruct DeclContext for nested enums.

2018-12-18 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Tue Dec 18 15:12:08 2018
New Revision: 349565

URL: http://llvm.org/viewvc/llvm-project?rev=349565&view=rev
Log:
[NativePDB] Correctly reconstruct DeclContext for nested enums.

We reconstruct the AST hierarchy by trying to hack up a mangled
name for the parent type using the child type's mangled name.
This was failing for enums because their tag type is represented
with two letters ("W4") instead of one letter ("T", "U", etc) as
it is with classes, structs, and unions.  After accounting for
this we can now correctly determine when an enum is nested
inside of a namespace or a class.

Modified:
lldb/trunk/lit/SymbolFile/NativePDB/Inputs/nested-types.lldbinit
lldb/trunk/lit/SymbolFile/NativePDB/nested-types.cpp
lldb/trunk/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp

Modified: lldb/trunk/lit/SymbolFile/NativePDB/Inputs/nested-types.lldbinit
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/NativePDB/Inputs/nested-types.lldbinit?rev=349565&r1=349564&r2=349565&view=diff
==
--- lldb/trunk/lit/SymbolFile/NativePDB/Inputs/nested-types.lldbinit (original)
+++ lldb/trunk/lit/SymbolFile/NativePDB/Inputs/nested-types.lldbinit Tue Dec 18 
15:12:08 2018
@@ -8,5 +8,6 @@ target variable -T GlobalE
 target variable -T GlobalF
 target variable -T GlobalG
 target variable -T GlobalH
+target variable -T GlobalEnum
 
 target modules dump ast

Modified: lldb/trunk/lit/SymbolFile/NativePDB/nested-types.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/NativePDB/nested-types.cpp?rev=349565&r1=349564&r2=349565&view=diff
==
--- lldb/trunk/lit/SymbolFile/NativePDB/nested-types.cpp (original)
+++ lldb/trunk/lit/SymbolFile/NativePDB/nested-types.cpp Tue Dec 18 15:12:08 
2018
@@ -11,6 +11,11 @@ struct S {
 int A = 0;
 int B = 1;
   };
+
+  enum class NestedEnum {
+EnumValue1 = 0,
+EnumValue2 = 1,
+  };
   int C = 2;
   int D = 3;
   using VoidPtrT = void *;
@@ -70,6 +75,7 @@ constexpr T::U GlobalE;
 constexpr U GlobalF;
 constexpr U::V GlobalG;
 constexpr U::W GlobalH;
+constexpr S::NestedEnum GlobalEnum = S::NestedEnum::EnumValue1;
 
 
 int main(int argc, char **argv) {
@@ -113,6 +119,8 @@ int main(int argc, char **argv) {
 // CHECK:   (int) I = 8
 // CHECK:   (int) J = 9
 // CHECK: }
+// CHECK: (lldb) target variable -T GlobalEnum
+// CHECK: (const S::NestedEnum) GlobalEnum = EnumValue1
 // CHECK: (lldb) target modules dump ast
 // CHECK: Dumping clang ast for 1 modules.
 // CHECK: TranslationUnitDecl {{.*}}
@@ -120,9 +128,12 @@ int main(int argc, char **argv) {
 // CHECK: | |-FieldDecl {{.*}} C 'int'
 // CHECK: | |-FieldDecl {{.*}} D 'int'
 // CHECK: | |-FieldDecl {{.*}} DD 'void *'
-// CHECK: | `-CXXRecordDecl {{.*}} struct NestedStruct definition
-// CHECK: |   |-FieldDecl {{.*}} A 'int'
-// CHECK: |   `-FieldDecl {{.*}} B 'int'
+// CHECK: | |-CXXRecordDecl {{.*}} struct NestedStruct definition
+// CHECK: | | |-FieldDecl {{.*}} A 'int'
+// CHECK: | | `-FieldDecl {{.*}} B 'int'
+// CHECK: | `-EnumDecl {{.*}} NestedEnum
+// CHECK: |   |-EnumConstantDecl {{.*}} EnumValue1 'S::NestedEnum'
+// CHECK: |   `-EnumConstantDecl {{.*}} EnumValue2 'S::NestedEnum'
 // CHECK: |-CXXRecordDecl {{.*}} struct T definition
 // CHECK: | |-FieldDecl {{.*}} NT 'int'
 // CHECK: | |-CXXRecordDecl {{.*}} struct NestedStruct definition

Modified: lldb/trunk/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp?rev=349565&r1=349564&r2=349565&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp Tue Dec 18 
15:12:08 2018
@@ -188,7 +188,10 @@ GetNestedTagRecord(const NestedTypeRecor
   // inner tag type is not necessarily the same as the outer tag type, re-write
   // it to match the inner tag type.
   qname[3] = child.asTag().getUniqueName()[3];
-  std::string piece = Record.Name;
+  std::string piece;
+  if (qname[3] == 'W')
+piece = "4";
+  piece += Record.Name;
   piece.push_back('@');
   qname.insert(4, std::move(piece));
   if (qname != child.asTag().UniqueName)


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


[Lldb-commits] [PATCH] D55859: noexternal 2/2: symbols.enable-external-lookup=false on all hosts (not just OSX)

2018-12-18 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil created this revision.
jankratochvil added reviewers: LLDB, labath.
jankratochvil added a project: LLDB.
Herald added subscribers: abidh, ki.stfu.

There is already in use:

  lit/lit-lldb-init:settings set symbols.enable-external-lookup false
  packages/Python/lldbsuite/test/lldbtest.py:self.runCmd('settings set 
symbols.enable-external-lookup false')

But those are not in effect during MI part of the testsuite.  Another problem 
is that `symbols.enable-external-lookup` (read by `GetEnableExternalLookup`) 
has been currently read only by `LocateMacOSXFilesUsingDebugSymbols` and 
therefore it had no effect on Linux.
On Red Hat platforms (Fedoras, RHEL-7) there is DWZ in use and so 
`MiSyntaxTestCase-test_lldbmi_output_grammar` FAILs due to:

  AssertionError: error: inconsistent pattern ''^.+?\n'' for state 0x5f 
(matched string: warning: (x86_64) /lib64/libstdc++.so.6 unsupported DW_FORM 
values: 0x1f20 0x1f21

It is the only testcase with this error. It happens due to:

  (lldb) target create "/lib64/libstdc++.so.6"
  Current executable set to '/lib64/libstdc++.so.6' (x86_64).
  (lldb) b main
  warning: (x86_64) /lib64/libstdc++.so.6 unsupported DW_FORM values: 0x1f20 
0x1f21
  Breakpoint 1: no locations (pending).
  WARNING:  Unable to resolve breakpoint to any actual locations.

which happens only with `gcc-base-debuginfo` rpm installed (similarly for other 
packages).
It should also speed up the testsuite as it no longer needs to read 
`/usr/lib/debug` symbols which have no effect (and should not have any effect) 
on the testsuite results.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D55859

Files:
  packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py
  
packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py
  
packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/start_script_error
  source/Host/common/Symbols.cpp

Index: source/Host/common/Symbols.cpp
===
--- source/Host/common/Symbols.cpp
+++ source/Host/common/Symbols.cpp
@@ -253,6 +253,9 @@
   FileSystem::Instance().Exists(symbol_file_spec))
 return symbol_file_spec;
 
+  bool external_lookup =
+  ModuleList::GetGlobalModuleListProperties().GetEnableExternalLookup();
+
   const char *symbol_filename = symbol_file_spec.GetFilename().AsCString();
   if (symbol_filename && symbol_filename[0]) {
 FileSpecList debug_file_search_paths(
@@ -270,30 +273,32 @@
   debug_file_search_paths.AppendIfUnique(file_spec);
 }
 
-// Add current working directory.
-{
-  FileSpec file_spec(".");
-  FileSystem::Instance().Resolve(file_spec);
-  debug_file_search_paths.AppendIfUnique(file_spec);
-}
+if (external_lookup) {
+  // Add current working directory.
+  {
+FileSpec file_spec(".");
+FileSystem::Instance().Resolve(file_spec);
+debug_file_search_paths.AppendIfUnique(file_spec);
+  }
 
 #ifndef _WIN32
 #if defined(__NetBSD__)
-// Add /usr/libdata/debug directory.
-{
-  FileSpec file_spec("/usr/libdata/debug");
-  FileSystem::Instance().Resolve(file_spec);
-  debug_file_search_paths.AppendIfUnique(file_spec);
-}
+  // Add /usr/libdata/debug directory.
+  {
+FileSpec file_spec("/usr/libdata/debug");
+FileSystem::Instance().Resolve(file_spec);
+debug_file_search_paths.AppendIfUnique(file_spec);
+  }
 #else
-// Add /usr/lib/debug directory.
-{
-  FileSpec file_spec("/usr/lib/debug");
-  FileSystem::Instance().Resolve(file_spec);
-  debug_file_search_paths.AppendIfUnique(file_spec);
-}
+  // Add /usr/lib/debug directory.
+  {
+FileSpec file_spec("/usr/lib/debug");
+FileSystem::Instance().Resolve(file_spec);
+debug_file_search_paths.AppendIfUnique(file_spec);
+  }
 #endif
 #endif // _WIN32
+}
 
 std::string uuid_str;
 const UUID &module_uuid = module_spec.GetUUID();
@@ -357,6 +362,12 @@
 }
   }
 
+  if (!external_lookup) {
+Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
+if (log)
+  log->Printf("External lookup for symbol files is disabled.");
+return FileSpec();
+  }
   return LocateExecutableSymbolFileDsym(module_spec);
 }
 
Index: packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/start_script_error
===
--- packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/start_script_error
+++ packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/start_script_error
@@ -1,2 +1,3 @@
+settings set symbols.enable-external-lookup false
 -file-exec-and-symbols a.out
 -break-ins -f main
Index: packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py
===
--- packages/Python/lldbsuite/test/tools/lldb-mi/startup_opt

[Lldb-commits] [lldb] r349572 - Remove the zlib CFLAGS and LDFLAGS settings from the xcode project file.

2018-12-18 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Tue Dec 18 15:33:42 2018
New Revision: 349572

URL: http://llvm.org/viewvc/llvm-project?rev=349572&view=rev
Log:
Remove the zlib CFLAGS and LDFLAGS settings from the xcode project file.
We're linking against libcompression all the time now, we don't need to
fall back to zlib.  zlib support will still be used when lldb is built on
linux et al systems, so I'm not removing any of the source support, but
when built on darwin with xcode, we'll be using libcompression.

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=349572&r1=349571&r2=349572&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Tue Dec 18 15:33:42 2018
@@ -8722,8 +8722,6 @@
LLDB_ENABLE_COVERAGE = 0;
LLDB_FRAMEWORK_INSTALL_DIR = 
/Applications/Xcode.app/Contents/SharedFrameworks;
LLDB_TOOLS_INSTALL_DIR = /usr/bin;
-   LLDB_ZLIB_CFLAGS = "-DHAVE_LIBZ=1";
-   LLDB_ZLIB_LDFLAGS = "-lz";
LLVM_BUILD_DIR = 
"$(SRCROOT)/llvm-build/$(LLVM_CONFIGURATION)";
LLVM_BUILD_DIRTREE = "$(SRCROOT)/llvm-build";
LLVM_BUILD_DIR_ARCH = x86_64/;
@@ -8732,13 +8730,11 @@
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = (
"-Wparentheses",
-   "$(LLDB_ZLIB_CFLAGS)",
"$(LLDB_COVERAGE_CFLAGS)",
"-Wimplicit-fallthrough",
);
OTHER_LDFLAGS = (
"-lcompression",
-   "$(LLDB_ZLIB_LDFLAGS)",
"$(LLDB_COVERAGE_LDFLAGS)",
);
PYTHON_FRAMEWORK_PATH = 
/System/Library/Frameworks/Python.framework/;
@@ -8810,8 +8806,6 @@
LLDB_ENABLE_COVERAGE = 0;
LLDB_FRAMEWORK_INSTALL_DIR = 
/Applications/Xcode.app/Contents/SharedFrameworks;
LLDB_TOOLS_INSTALL_DIR = /usr/bin;
-   LLDB_ZLIB_CFLAGS = "-DHAVE_LIBZ=1";
-   LLDB_ZLIB_LDFLAGS = "-lz";
LLVM_BUILD_DIR = 
"$(SRCROOT)/llvm-build/$(LLVM_CONFIGURATION)";
LLVM_BUILD_DIRTREE = "$(SRCROOT)/llvm-build";
LLVM_BUILD_DIR_ARCH = x86_64/;
@@ -8820,13 +8814,11 @@
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = (
"-Wparentheses",
-   "$(LLDB_ZLIB_CFLAGS)",
"$(LLDB_COVERAGE_CFLAGS)",
"-Wimplicit-fallthrough",
);
OTHER_LDFLAGS = (
"-lcompression",
-   "$(LLDB_ZLIB_LDFLAGS)",
"$(LLDB_COVERAGE_LDFLAGS)",
);
PYTHON_FRAMEWORK_PATH = 
/System/Library/Frameworks/Python.framework/;
@@ -8960,7 +8952,6 @@
OTHER_CFLAGS = (
"-fno-rtti",
"-Wparentheses",
-   "$(LLDB_ZLIB_CFLAGS)",
"$(LLDB_GTESTS_CFLAGS)",
"-DGTEST_HAS_RTTI=0",
);
@@ -9001,7 +8992,6 @@
OTHER_CFLAGS = (
"-fno-rtti",
"-Wparentheses",
-   "$(LLDB_ZLIB_CFLAGS)",
"$(LLDB_GTESTS_CFLAGS)",
"-DGTEST_HAS_RTTI=0",
);
@@ -9042,7 +9032,6 @@
OTHER_CFLAGS = (
"-fno-rtti",
"-Wparentheses",
-   "$(LLDB_ZLIB_CFLAGS)",
"$(LLDB_GTESTS_CFLAGS)",
"-DGTEST_HAS_RTTI=0",
);
@@ -9083,7

[Lldb-commits] [lldb] r349573 - [lit] Rather than including stdio.h, forward-declare printf in TestConvenienceVariables.test

2018-12-18 Thread Stella Stamenova via lldb-commits
Author: stella.stamenova
Date: Tue Dec 18 15:36:35 2018
New Revision: 349573

URL: http://llvm.org/viewvc/llvm-project?rev=349573&view=rev
Log:
[lit] Rather than including stdio.h, forward-declare printf in 
TestConvenienceVariables.test

Modified:
lldb/trunk/lit/Driver/Inputs/hello.c

Modified: lldb/trunk/lit/Driver/Inputs/hello.c
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Driver/Inputs/hello.c?rev=349573&r1=349572&r2=349573&view=diff
==
--- lldb/trunk/lit/Driver/Inputs/hello.c (original)
+++ lldb/trunk/lit/Driver/Inputs/hello.c Tue Dec 18 15:36:35 2018
@@ -1,4 +1,4 @@
-#include 
+int printf(const char *format, ...);
 
 int main(int argc, char **argv) {
   printf("Hello World\n");


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


[Lldb-commits] [lldb] r349580 - Don't forget to free the libcompression scratch buffer in the dtor.

2018-12-18 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Tue Dec 18 15:45:45 2018
New Revision: 349580

URL: http://llvm.org/viewvc/llvm-project?rev=349580&view=rev
Log:
Don't forget to free the libcompression scratch buffer in the dtor.

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

Modified: 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp?rev=349580&r1=349579&r2=349580&view=diff
==
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp 
(original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp Tue 
Dec 18 15:45:45 2018
@@ -81,6 +81,9 @@ GDBRemoteCommunication::~GDBRemoteCommun
 Disconnect();
   }
 
+  if (m_decompression_scratch)
+free (m_decompression_scratch);
+
   // Stop the communications read thread which is used to parse all incoming
   // packets.  This function will block until the read thread returns.
   if (m_read_thread_enabled)


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