[Lldb-commits] [lldb] r285172 - Enable the use of the new dyld SPI on the current

2016-10-25 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Tue Oct 25 23:48:41 2016
New Revision: 285172

URL: http://llvm.org/viewvc/llvm-project?rev=285172&view=rev
Log:
Enable the use of the new dyld SPI on the current
generation macosx/ios/tvos/watchos.

Modified:
lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp

Modified: 
lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp?rev=285172&r1=285171&r2=285172&view=diff
==
--- lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp 
(original)
+++ lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp 
Tue Oct 25 23:48:41 2016
@@ -1157,11 +1157,6 @@ bool DynamicLoaderDarwin::UseDYLDSPI(Pro
 }
   }
 
-  // FIXME: Temporarily force the use of the old DynamicLoader plugin until all
-  // the different use cases have been tested & the updated SPIs are available
-  // everywhere.
-  use_new_spi_interface = false;
-
   if (log) {
 if (use_new_spi_interface)
   log->Printf(


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


[Lldb-commits] [lldb] r285153 - SBWatchpoint::Disable doesn't actually work. Add a test that shows this.

2016-10-25 Thread Jim Ingham via lldb-commits
Author: jingham
Date: Tue Oct 25 20:09:21 2016
New Revision: 285153

URL: http://llvm.org/viewvc/llvm-project?rev=285153&view=rev
Log:
SBWatchpoint::Disable doesn't actually work.  Add a test that shows this.

Next to fix it!

Added:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_disable/

lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_disable/Makefile

lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_disable/TestWatchpointDisable.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_disable/main.c

Added: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_disable/Makefile
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_disable/Makefile?rev=285153&view=auto
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_disable/Makefile
 (added)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_disable/Makefile
 Tue Oct 25 20:09:21 2016
@@ -0,0 +1,5 @@
+LEVEL = ../../../make
+
+C_SOURCES := main.c
+
+include $(LEVEL)/Makefile.rules

Added: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_disable/TestWatchpointDisable.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_disable/TestWatchpointDisable.py?rev=285153&view=auto
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_disable/TestWatchpointDisable.py
 (added)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_disable/TestWatchpointDisable.py
 Tue Oct 25 20:09:21 2016
@@ -0,0 +1,75 @@
+"""
+Test that the SBWatchpoint::SetEnable API works.
+"""
+
+import os
+import lldb
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test.decorators import *
+from lldbsuite.test import lldbplatform, lldbplatformutil
+
+
+class TestWatchpointSetEnable(TestBase):
+mydir = TestBase.compute_mydir(__file__)
+
+def setUp(self):
+# Call super's setUp().
+TestBase.setUp(self)
+
+# Watchpoints not supported
+@expectedFailureAndroid(archs=['arm', 'aarch64'])
+@expectedFailureAll(
+oslist=["windows"],
+bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not 
supported on Windows")
+@expectedFailureAll(bugnumber="llvm.org/pr30789, 
")
+def test_disable_works (self):
+"""Set a watchpoint, disable it, and make sure it doesn't get hit."""
+self.build()
+self.disable_works()
+
+def disable_works(self):
+"""Set a watchpoint, disable it and make sure it doesn't get hit."""
+
+exe = 'a.out'
+
+exe = os.path.join(os.getcwd(), exe)
+main_file_spec = lldb.SBFileSpec("main.c")
+
+# Create a target by the debugger.
+self.target = self.dbg.CreateTarget(exe)
+self.assertTrue(self.target, VALID_TARGET)
+cwd = os.getcwd()
+
+
+bkpt_before = self.target.BreakpointCreateBySourceRegex("Set a 
breakpoint here", main_file_spec)
+self.assertEqual(bkpt_before.GetNumLocations(),  1, "Failed setting 
the before breakpoint.")
+
+bkpt_after = self.target.BreakpointCreateBySourceRegex("We should have 
stopped", main_file_spec)
+self.assertEqual(bkpt_after.GetNumLocations(), 1, "Failed setting the 
after breakpoint.")
+
+process = self.target.LaunchSimple(
+None, None, self.get_process_working_directory())
+self.assertTrue(process, PROCESS_IS_VALID)
+
+thread = lldbutil.get_one_thread_stopped_at_breakpoint(process, 
bkpt_before)
+self.assertTrue(thread.IsValid(), "We didn't stop at the before 
breakpoint.")
+
+ret_val = lldb.SBCommandReturnObject()
+self.dbg.GetCommandInterpreter().HandleCommand("watchpoint set 
variable -w write global_var", ret_val)
+self.assertTrue(ret_val.Succeeded(), "Watchpoint set variable did not 
return success.")
+
+wp = self.target.FindWatchpointByID(1)
+self.assertTrue(wp.IsValid(), "Didn't make a valid watchpoint.")
+self.assertTrue(wp.GetWatchAddress() != lldb.LLDB_INVALID_ADDRESS, 
"Watch address is invalid")
+
+wp.SetEnabled(False)
+self.assertTrue(not wp.IsEnabled(), "The watchpoint thinks it is still 
enabled")
+
+process.Continue()
+
+stop_reason = thread.GetStopReason()
+
+self.assertEqual(stop_reason, lldb.eStopReasonWatchpoint, "We didn't 
stop at our watchpoint.")
+
+
+

Added: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_disable/main.c
URL: 
http

Re: [Lldb-commits] [lldb] r285068 - Revert "Improve the libstdc++ smart pointer formatters"

2016-10-25 Thread Jim Ingham via lldb-commits
I already fixed this in r285113.

Jim

> On Oct 25, 2016, at 2:49 PM, Tim Hammerquist via lldb-commits 
>  wrote:
> 
> Hi Pavel,
> 
> Looks like some code left after this revert is still expecting this file 
> (added contemporary to r284828) that was removed in this revision.
> 
> --- lldb/trunk/source/Plugins/Language/CPlusPlus/LibStdcppSmartPointer.cpp 
> (original)
> +++ lldb/trunk/source/Plugins/Language/CPlusPlus/LibStdcppSmartPointer.cpp 
> (removed)
> 
> This is causing the build to break. Does this require additional changes, or 
> perhaps further reverts?
> 
> -Tim
> 
> 
> On Tue, Oct 25, 2016 at 6:24 AM, Pavel Labath via lldb-commits 
>  wrote:
> Author: labath
> Date: Tue Oct 25 08:24:53 2016
> New Revision: 285068
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=285068&view=rev
> Log:
> Revert "Improve the libstdc++ smart pointer formatters"
> 
> This reverts commit r284828, as it causes an infinite loop in
> TestPrintStackTraces (funnily enough, only when logging is enabled).
> 
> Removed:
> lldb/trunk/source/Plugins/Language/CPlusPlus/LibStdcppSmartPointer.cpp
> Modified:
> 
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/Makefile
> 
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py
> lldb/trunk/source/Plugins/Language/CPlusPlus/CMakeLists.txt
> lldb/trunk/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp
> 
> Modified: 
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/Makefile
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/Makefile?rev=285068&r1=285067&r2=285068&view=diff
> ==
> --- 
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/Makefile
>  (original)
> +++ 
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/Makefile
>  Tue Oct 25 08:24:53 2016
> @@ -2,7 +2,14 @@ LEVEL = ../../../../../make
> 
>  CXX_SOURCES := main.cpp
> 
> +CXXFLAGS := -O0
>  USE_LIBSTDCPP := 1
> -CFLAGS_EXTRAS += $(NO_LIMIT_DEBUG_INFO_FLAGS)
> +
> +# clang-3.5+ outputs FullDebugInfo by default for Darwin/FreeBSD
> +# targets.  Other targets do not, which causes this test to fail.
> +# This flag enables FullDebugInfo for all targets.
> +ifneq (,$(findstring clang,$(CC)))
> +  CFLAGS_EXTRAS += -fno-limit-debug-info
> +endif
> 
>  include $(LEVEL)/Makefile.rules
> 
> Modified: 
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py?rev=285068&r1=285067&r2=285068&view=diff
> ==
> --- 
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py
>  (original)
> +++ 
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py
>  Tue Oct 25 08:24:53 2016
> @@ -31,58 +31,19 @@ class StdSmartPtrDataFormatterTestCase(T
>  substrs=['stopped', 'stop reason = breakpoint'])
> 
>  self.expect("frame variable nsp", substrs=['nsp = nullptr'])
> -self.expect("frame variable isp", substrs=['isp = 123', 'strong=1', 
> 'weak=1'])
> -self.expect("frame variable ssp", substrs=['ssp = "foobar"', 
> 'strong=1', 'weak=1'])
> -self.expect("frame variable nwp", substrs=['nwp = nullptr'])
> -self.expect("frame variable iwp", substrs=['iwp = 123', 'strong=1', 
> 'weak=1'])
> -self.expect("frame variable swp", substrs=['swp = "foobar"', 
> 'strong=1', 'weak=1'])
> -
> -frame = self.frame()
> -self.assertTrue(frame.IsValid())
> -
> -self.assertEqual(0, 
> frame.GetValueForVariablePath("nsp.pointer").GetValueAsUnsigned())
> -self.assertEqual(0, 
> frame.GetValueForVariablePath("nwp.pointer").GetValueAsUnsigned())
> -
> -self.assertNotEqual(0, 
> frame.GetValueForVariablePath("isp.pointer").GetValueAsUnsigned())
> -self.assertEqual(123, 
> frame.GetValueForVariablePath("isp.object").GetValueAsUnsigned())
> -self.assertEqual(1, 
> frame.GetValueForVariablePath("isp.count").GetValueAsUnsigned())
> -self.assertEqual(1, 
> frame.GetValueForVariablePath("isp.weak_count").GetValueAsUnsigned())
> -
> self.assertFalse(frame.GetValueForVariablePath("isp.fo

Re: [Lldb-commits] [lldb] r285068 - Revert "Improve the libstdc++ smart pointer formatters"

2016-10-25 Thread Tim Hammerquist via lldb-commits
Hi Pavel,

Looks like some code left after this revert is still expecting this file
(added contemporary to r284828) that was removed in this revision.

--- lldb/trunk/source/Plugins/Language/CPlusPlus/LibStdcppSmartPointer.cpp
(original)
+++ lldb/trunk/source/Plugins/Language/CPlusPlus/LibStdcppSmartPointer.cpp
(removed)

This is causing the build to break. Does this require additional changes,
or perhaps further reverts?

-Tim


On Tue, Oct 25, 2016 at 6:24 AM, Pavel Labath via lldb-commits <
lldb-commits@lists.llvm.org> wrote:

> Author: labath
> Date: Tue Oct 25 08:24:53 2016
> New Revision: 285068
>
> URL: http://llvm.org/viewvc/llvm-project?rev=285068&view=rev
> Log:
> Revert "Improve the libstdc++ smart pointer formatters"
>
> This reverts commit r284828, as it causes an infinite loop in
> TestPrintStackTraces (funnily enough, only when logging is enabled).
>
> Removed:
> lldb/trunk/source/Plugins/Language/CPlusPlus/LibStdcppSmartPointer.cpp
> Modified:
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-
> formatter/data-formatter-stl/libstdcpp/smart_ptr/Makefile
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-
> formatter/data-formatter-stl/libstdcpp/smart_ptr/
> TestDataFormatterStdSmartPtr.py
> lldb/trunk/source/Plugins/Language/CPlusPlus/CMakeLists.txt
> lldb/trunk/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp
>
> Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-
> formatter/data-formatter-stl/libstdcpp/smart_ptr/Makefile
> URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/
> Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/
> libstdcpp/smart_ptr/Makefile?rev=285068&r1=285067&r2=285068&view=diff
> 
> ==
> --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-
> formatter/data-formatter-stl/libstdcpp/smart_ptr/Makefile (original)
> +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-
> formatter/data-formatter-stl/libstdcpp/smart_ptr/Makefile Tue Oct 25
> 08:24:53 2016
> @@ -2,7 +2,14 @@ LEVEL = ../../../../../make
>
>  CXX_SOURCES := main.cpp
>
> +CXXFLAGS := -O0
>  USE_LIBSTDCPP := 1
> -CFLAGS_EXTRAS += $(NO_LIMIT_DEBUG_INFO_FLAGS)
> +
> +# clang-3.5+ outputs FullDebugInfo by default for Darwin/FreeBSD
> +# targets.  Other targets do not, which causes this test to fail.
> +# This flag enables FullDebugInfo for all targets.
> +ifneq (,$(findstring clang,$(CC)))
> +  CFLAGS_EXTRAS += -fno-limit-debug-info
> +endif
>
>  include $(LEVEL)/Makefile.rules
>
> Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-
> formatter/data-formatter-stl/libstdcpp/smart_ptr/
> TestDataFormatterStdSmartPtr.py
> URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/
> Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/
> libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.
> py?rev=285068&r1=285067&r2=285068&view=diff
> 
> ==
> --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-
> formatter/data-formatter-stl/libstdcpp/smart_ptr/
> TestDataFormatterStdSmartPtr.py (original)
> +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-
> formatter/data-formatter-stl/libstdcpp/smart_ptr/
> TestDataFormatterStdSmartPtr.py Tue Oct 25 08:24:53 2016
> @@ -31,58 +31,19 @@ class StdSmartPtrDataFormatterTestCase(T
>  substrs=['stopped', 'stop reason = breakpoint'])
>
>  self.expect("frame variable nsp", substrs=['nsp = nullptr'])
> -self.expect("frame variable isp", substrs=['isp = 123',
> 'strong=1', 'weak=1'])
> -self.expect("frame variable ssp", substrs=['ssp = "foobar"',
> 'strong=1', 'weak=1'])
> -self.expect("frame variable nwp", substrs=['nwp = nullptr'])
> -self.expect("frame variable iwp", substrs=['iwp = 123',
> 'strong=1', 'weak=1'])
> -self.expect("frame variable swp", substrs=['swp = "foobar"',
> 'strong=1', 'weak=1'])
> -
> -frame = self.frame()
> -self.assertTrue(frame.IsValid())
> -
> -self.assertEqual(0, frame.GetValueForVariablePath("nsp.pointer").
> GetValueAsUnsigned())
> -self.assertEqual(0, frame.GetValueForVariablePath("nwp.pointer").
> GetValueAsUnsigned())
> -
> -self.assertNotEqual(0, frame.GetValueForVariablePath(
> "isp.pointer").GetValueAsUnsigned())
> -self.assertEqual(123, frame.GetValueForVariablePath(
> "isp.object").GetValueAsUnsigned())
> -self.assertEqual(1, frame.GetValueForVariablePath("isp.count").
> GetValueAsUnsigned())
> -self.assertEqual(1, frame.GetValueForVariablePath(
> "isp.weak_count").GetValueAsUnsigned())
> -self.assertFalse(frame.GetValueForVariablePath("isp.
> foobar").IsValid())
> +self.expect("frame variable isp", substrs=['isp = 123'])
> +self.expect("frame variabl

[Lldb-commits] [lldb] r285114 - Fix a race condition between the "ephemeral watchpoint disabling" and commands the continue the process.

2016-10-25 Thread Jim Ingham via lldb-commits
Author: jingham
Date: Tue Oct 25 15:34:32 2016
New Revision: 285114

URL: http://llvm.org/viewvc/llvm-project?rev=285114&view=rev
Log:
Fix a race condition between the "ephemeral watchpoint disabling" and commands 
the continue the process.

This closes https://reviews.llvm.org/D25875.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandPython.py
lldb/trunk/source/Breakpoint/Watchpoint.cpp
lldb/trunk/source/Target/StopInfo.cpp

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandPython.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandPython.py?rev=285114&r1=285113&r2=285114&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandPython.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandPython.py
 Tue Oct 25 15:34:32 2016
@@ -54,9 +54,6 @@ class WatchpointPythonCommandTestCase(Te
 # Add a breakpoint to set a watchpoint when stopped on the breakpoint.
 lldbutil.run_break_set_by_file_and_line(
 self, None, self.line, num_expected_locations=1)
-#self.expect("breakpoint set -l %d" % self.line, BREAKPOINT_CREATED,
-#startstr = "Breakpoint created: 1: file ='%s', line = %d, 
locations = 1" %
-#   (self.source, self.line))#
 
 # Run the program.
 self.runCmd("run", RUN_SUCCEEDED)
@@ -131,9 +128,6 @@ class WatchpointPythonCommandTestCase(Te
 # Add a breakpoint to set a watchpoint when stopped on the breakpoint.
 lldbutil.run_break_set_by_file_and_line(
 self, None, self.line, num_expected_locations=1)
-#self.expect("breakpoint set -l %d" % self.line, BREAKPOINT_CREATED,
-#startstr = "Breakpoint created: 1: file ='%s', line = %d, 
locations = 1" %
-#   (self.source, self.line))#
 
 # Run the program.
 self.runCmd("run", RUN_SUCCEEDED)
@@ -177,3 +171,4 @@ class WatchpointPythonCommandTestCase(Te
 # second hit and set it to 999
 self.expect("frame variable --show-globals cookie",
 substrs=['(int32_t)', 'cookie = 999'])
+

Modified: lldb/trunk/source/Breakpoint/Watchpoint.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Breakpoint/Watchpoint.cpp?rev=285114&r1=285113&r2=285114&view=diff
==
--- lldb/trunk/source/Breakpoint/Watchpoint.cpp (original)
+++ lldb/trunk/source/Breakpoint/Watchpoint.cpp Tue Oct 25 15:34:32 2016
@@ -232,7 +232,7 @@ void Watchpoint::TurnOffEphemeralMode()
 }
 
 bool Watchpoint::IsDisabledDuringEphemeralMode() {
-  return m_disabled_count > 1;
+  return m_disabled_count > 1 && m_is_ephemeral;
 }
 
 void Watchpoint::SetEnabled(bool enabled, bool notify) {

Modified: lldb/trunk/source/Target/StopInfo.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/StopInfo.cpp?rev=285114&r1=285113&r2=285114&view=diff
==
--- lldb/trunk/source/Target/StopInfo.cpp (original)
+++ lldb/trunk/source/Target/StopInfo.cpp Tue Oct 25 15:34:32 2016
@@ -557,27 +557,44 @@ public:
   // performing watchpoint actions.
   class WatchpointSentry {
   public:
-WatchpointSentry(Process *p, Watchpoint *w) : process(p), watchpoint(w) {
-  if (process && watchpoint) {
+WatchpointSentry(ProcessSP p_sp, WatchpointSP w_sp) : process_sp(p_sp), 
+ watchpoint_sp(w_sp) {
+  if (process_sp && watchpoint_sp) {
 const bool notify = false;
-watchpoint->TurnOnEphemeralMode();
-process->DisableWatchpoint(watchpoint, notify);
+watchpoint_sp->TurnOnEphemeralMode();
+process_sp->DisableWatchpoint(watchpoint_sp.get(), notify);
+process_sp->AddPreResumeAction(SentryPreResumeAction, this);
   }
 }
-
-~WatchpointSentry() {
-  if (process && watchpoint) {
-if (!watchpoint->IsDisabledDuringEphemeralMode()) {
-  const bool notify = false;
-  process->EnableWatchpoint(watchpoint, notify);
+
+void DoReenable() {
+  if (process_sp && watchpoint_sp) {
+bool was_disabled = watchpoint_sp->IsDisabledDuringEphemeralMode();
+watchpoint_sp->TurnOffEphemeralMode();
+const bool notify = false;
+if (was_disabled) {
+  process_sp->DisableWatchpoint(watchpoint_sp.get(), notify);
+} else {
+  process_sp->EnableWatchpoint(watchpoint_sp.get(), notify);
 }
-watchpoint->TurnOf

[Lldb-commits] [lldb] r285113 - Fixing up the project file for the removal of LibStdcppSmartPointer.cpp.

2016-10-25 Thread Jim Ingham via lldb-commits
Author: jingham
Date: Tue Oct 25 15:32:26 2016
New Revision: 285113

URL: http://llvm.org/viewvc/llvm-project?rev=285113&view=rev
Log:
Fixing up the project file for the removal of LibStdcppSmartPointer.cpp.

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=285113&r1=285112&r2=285113&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Tue Oct 25 15:32:26 2016
@@ -750,7 +750,6 @@
4CD0BD0F134BFADF00CB44D4 /* ValueObjectDynamicValue.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = 4CD0BD0E134BFADF00CB44D4 /* 
ValueObjectDynamicValue.cpp */; };
4CDB8D6D1DBA91B6006C5B13 /* LibStdcppUniquePointer.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = 4CDB8D671DBA91A6006C5B13 /* 
LibStdcppUniquePointer.cpp */; };
4CDB8D6E1DBA91B6006C5B13 /* LibStdcppTuple.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 4CDB8D681DBA91A6006C5B13 /* LibStdcppTuple.cpp 
*/; };
-   4CDB8D6F1DBA91B6006C5B13 /* LibStdcppSmartPointer.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = 4CDB8D691DBA91A6006C5B13 /* 
LibStdcppSmartPointer.cpp */; };
4CE4F673162C971A00F75CB3 /* SBExpressionOptions.h in Headers */ 
= {isa = PBXBuildFile; fileRef = 4CE4F672162C971A00F75CB3 /* 
SBExpressionOptions.h */; settings = {ATTRIBUTES = (Public, ); }; };
4CE4F675162C973F00F75CB3 /* SBExpressionOptions.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = 4CE4F674162C973F00F75CB3 /* 
SBExpressionOptions.cpp */; };
4CF3D80C15AF4DC800845BF3 /* Security.framework in Frameworks */ 
= {isa = PBXBuildFile; fileRef = EDB919B414F6F10D008FF64B /* Security.framework 
*/; };
@@ -2581,7 +2580,6 @@
4CD0BD0E134BFADF00CB44D4 /* ValueObjectDynamicValue.cpp */ = 
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = 
sourcecode.cpp.cpp; name = ValueObjectDynamicValue.cpp; path = 
source/Core/ValueObjectDynamicValue.cpp; sourceTree = ""; };
4CDB8D671DBA91A6006C5B13 /* LibStdcppUniquePointer.cpp */ = 
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = 
sourcecode.cpp.cpp; name = LibStdcppUniquePointer.cpp; path = 
Language/CPlusPlus/LibStdcppUniquePointer.cpp; sourceTree = ""; };
4CDB8D681DBA91A6006C5B13 /* LibStdcppTuple.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = LibStdcppTuple.cpp; path = Language/CPlusPlus/LibStdcppTuple.cpp; 
sourceTree = ""; };
-   4CDB8D691DBA91A6006C5B13 /* LibStdcppSmartPointer.cpp */ = {isa 
= PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = LibStdcppSmartPointer.cpp; path = 
Language/CPlusPlus/LibStdcppSmartPointer.cpp; sourceTree = ""; };
4CE4F672162C971A00F75CB3 /* SBExpressionOptions.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = 
SBExpressionOptions.h; path = include/lldb/API/SBExpressionOptions.h; 
sourceTree = ""; };
4CE4F674162C973F00F75CB3 /* SBExpressionOptions.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = SBExpressionOptions.cpp; path = source/API/SBExpressionOptions.cpp; 
sourceTree = ""; };
4CE4F676162CE1E100F75CB3 /* SBExpressionOptions.i */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = 
sourcecode.c.c.preprocessed; path = SBExpressionOptions.i; sourceTree = 
""; };
@@ -6005,7 +6003,6 @@
children = (
4CDB8D671DBA91A6006C5B13 /* 
LibStdcppUniquePointer.cpp */,
4CDB8D681DBA91A6006C5B13 /* LibStdcppTuple.cpp 
*/,
-   4CDB8D691DBA91A6006C5B13 /* 
LibStdcppSmartPointer.cpp */,
49DEF1201CD7BD90006A7C7D /* BlockPointer.h */,
49DEF11F1CD7BD90006A7C7D /* BlockPointer.cpp */,
945261B41B9A11E800BF138D /* CxxStringTypes.h */,
@@ -7527,7 +7524,6 @@
2690B3711381D5C300ECFBAE /* Memory.cpp in 
Sources */,
4C562CC71CC07DF700C52EAC /* PDBASTParser.cpp in 
Sources */,
B28058A1139988B0002D96D0 /* 
InferiorCallPOSIX.cpp in Sources */,
-   4CDB8D6F1DBA91B6006C5B13 /* 
LibStdcppSmartPointer.cpp in Sources */,
AF20F76A1AF18F9000751A6E /* ABISysV_arm64.cpp 
in Sources */,
26F73062139D8FDB00FD51C7 /* History.cpp in 
Sources */,
4CCA644D13B40B82003BDF98 /* 
ItaniumABILanguageRuntime.cpp in Sources */,


__

[Lldb-commits] [PATCH] D25926: Don't set a software stepping breakpoint at 0 on arm or mips.

2016-10-25 Thread Jason Majors via lldb-commits
jmajors updated this revision to Diff 75779.
jmajors added a comment.

Restructured the code to skip setting a software breakpoint at 0.


https://reviews.llvm.org/D25926

Files:
  
packages/Python/lldbsuite/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py
  source/Plugins/Process/Linux/NativeProcessLinux.cpp


Index: source/Plugins/Process/Linux/NativeProcessLinux.cpp
===
--- source/Plugins/Process/Linux/NativeProcessLinux.cpp
+++ source/Plugins/Process/Linux/NativeProcessLinux.cpp
@@ -1361,7 +1361,11 @@
 error = SetSoftwareBreakpoint(next_pc, 0);
   }
 
-  if (error.Fail())
+  // If setting the breakpoint fails because next_pc is out of
+  // the address space, ignore it and let the debugee segfault.
+  if (error.GetError() == EIO || error.GetError() == EFAULT) {
+return Error();
+  } else if (error.Fail())
 return error;
 
   m_threads_stepping_with_breakpoint.insert({thread.GetID(), next_pc});
Index: 
packages/Python/lldbsuite/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py
===
--- 
packages/Python/lldbsuite/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py
+++ 
packages/Python/lldbsuite/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py
@@ -21,11 +21,6 @@
 self.breakpoint = line_number('main.cpp', '// Set breakpoint here')
 
 @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24778")
-@expectedFailureAndroid("llvm.org/pr24497", archs=['arm', 'aarch64'])
-@expectedFailureAll(
-oslist=["linux"],
-archs=["arm"],
-bugnumber="llvm.org/pr24497")
 # IO error due to breakpoint at invalid address
 @expectedFailureAll(triple=re.compile('^mips'))
 def test_step_inst_with(self):


Index: source/Plugins/Process/Linux/NativeProcessLinux.cpp
===
--- source/Plugins/Process/Linux/NativeProcessLinux.cpp
+++ source/Plugins/Process/Linux/NativeProcessLinux.cpp
@@ -1361,7 +1361,11 @@
 error = SetSoftwareBreakpoint(next_pc, 0);
   }
 
-  if (error.Fail())
+  // If setting the breakpoint fails because next_pc is out of
+  // the address space, ignore it and let the debugee segfault.
+  if (error.GetError() == EIO || error.GetError() == EFAULT) {
+return Error();
+  } else if (error.Fail())
 return error;
 
   m_threads_stepping_with_breakpoint.insert({thread.GetID(), next_pc});
Index: packages/Python/lldbsuite/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py
===
--- packages/Python/lldbsuite/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py
+++ packages/Python/lldbsuite/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py
@@ -21,11 +21,6 @@
 self.breakpoint = line_number('main.cpp', '// Set breakpoint here')
 
 @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24778")
-@expectedFailureAndroid("llvm.org/pr24497", archs=['arm', 'aarch64'])
-@expectedFailureAll(
-oslist=["linux"],
-archs=["arm"],
-bugnumber="llvm.org/pr24497")
 # IO error due to breakpoint at invalid address
 @expectedFailureAll(triple=re.compile('^mips'))
 def test_step_inst_with(self):
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D25947: Merge Linux and FreeBSD arm64 register contexts

2016-10-25 Thread Pavel Labath via lldb-commits
labath updated this revision to Diff 75718.
labath added a comment.

clang-format the patch


https://reviews.llvm.org/D25947

Files:
  source/Plugins/Process/FreeBSD/FreeBSDThread.cpp
  source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
  source/Plugins/Process/Utility/CMakeLists.txt
  source/Plugins/Process/Utility/RegisterContextFreeBSD_arm64.cpp
  source/Plugins/Process/Utility/RegisterContextFreeBSD_arm64.h
  source/Plugins/Process/Utility/RegisterContextLinux_arm64.cpp
  source/Plugins/Process/Utility/RegisterContextLinux_arm64.h
  source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp
  source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.h
  source/Plugins/Process/elf-core/ThreadElfCore.cpp

Index: source/Plugins/Process/elf-core/ThreadElfCore.cpp
===
--- source/Plugins/Process/elf-core/ThreadElfCore.cpp
+++ source/Plugins/Process/elf-core/ThreadElfCore.cpp
@@ -15,16 +15,15 @@
 #include "lldb/Target/Unwind.h"
 
 #include "Plugins/Process/Utility/RegisterContextFreeBSD_arm.h"
-#include "Plugins/Process/Utility/RegisterContextFreeBSD_arm64.h"
 #include "Plugins/Process/Utility/RegisterContextFreeBSD_i386.h"
 #include "Plugins/Process/Utility/RegisterContextFreeBSD_mips64.h"
 #include "Plugins/Process/Utility/RegisterContextFreeBSD_powerpc.h"
 #include "Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.h"
 #include "Plugins/Process/Utility/RegisterContextLinux_arm.h"
-#include "Plugins/Process/Utility/RegisterContextLinux_arm64.h"
 #include "Plugins/Process/Utility/RegisterContextLinux_i386.h"
 #include "Plugins/Process/Utility/RegisterContextLinux_s390x.h"
 #include "Plugins/Process/Utility/RegisterContextLinux_x86_64.h"
+#include "Plugins/Process/Utility/RegisterInfoPOSIX_arm64.h"
 #include "ProcessElfCore.h"
 #include "RegisterContextPOSIXCore_arm.h"
 #include "RegisterContextPOSIXCore_arm64.h"
@@ -86,7 +85,7 @@
 case llvm::Triple::FreeBSD: {
   switch (arch.GetMachine()) {
   case llvm::Triple::aarch64:
-reg_interface = new RegisterContextFreeBSD_arm64(arch);
+reg_interface = new RegisterInfoPOSIX_arm64(arch);
 break;
   case llvm::Triple::arm:
 reg_interface = new RegisterContextFreeBSD_arm(arch);
@@ -118,7 +117,7 @@
 reg_interface = new RegisterContextLinux_arm(arch);
 break;
   case llvm::Triple::aarch64:
-reg_interface = new RegisterContextLinux_arm64(arch);
+reg_interface = new RegisterInfoPOSIX_arm64(arch);
 break;
   case llvm::Triple::systemz:
 reg_interface = new RegisterContextLinux_s390x(arch);
Index: source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.h
===
--- source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.h
+++ source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.h
@@ -1,4 +1,4 @@
-//===-- RegisterContextLinux_arm64.h *- C++ -*-===//
+//===-- RegisterInfoPOSIX_arm64.h ---*- C++ -*-===//
 //
 // The LLVM Compiler Infrastructure
 //
@@ -14,7 +14,7 @@
 #include "lldb/Target/RegisterContext.h"
 #include "lldb/lldb-private.h"
 
-class RegisterContextLinux_arm64 : public lldb_private::RegisterInfoInterface {
+class RegisterInfoPOSIX_arm64 : public lldb_private::RegisterInfoInterface {
 public:
   // based on RegisterContextDarwin_arm64.h
   struct GPR {
@@ -54,7 +54,7 @@
 uint64_t mdscr_el1;
   };
 
-  RegisterContextLinux_arm64(const lldb_private::ArchSpec &target_arch);
+  RegisterInfoPOSIX_arm64(const lldb_private::ArchSpec &target_arch);
 
   size_t GetGPRSize() const override;
 
Index: source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp
===
--- source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp
+++ source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp
@@ -1,4 +1,4 @@
-//===-- RegisterContextLinux_arm64.cpp -*- C++ -*-===//
+//===-- RegisterInfoPOSIX_arm64.cpp *- C++ -*-===//
 //
 // The LLVM Compiler Infrastructure
 //
@@ -14,40 +14,40 @@
 #include "lldb/lldb-defines.h"
 #include "llvm/Support/Compiler.h"
 
-#include "RegisterContextLinux_arm64.h"
+#include "RegisterInfoPOSIX_arm64.h"
 
 // Based on RegisterContextDarwin_arm64.cpp
 #define GPR_OFFSET(idx) ((idx)*8)
 #define GPR_OFFSET_NAME(reg)   \
-  (LLVM_EXTENSION offsetof(RegisterContextLinux_arm64::GPR, reg))
+  (LLVM_EXTENSION offsetof(RegisterInfoPOSIX_arm64::GPR, reg))
 
-#define FPU_OFFSET(idx) ((idx)*16 + sizeof(RegisterContextLinux_arm64::GPR))
+#define FPU_OFFSET(idx) ((idx)*16 + sizeof(RegisterInfoPOSIX_arm64::GPR))
 #define FPU_OFFSET_NAME(reg)   \
-  (LLVM_EXTENSION offsetof(RegisterContextLinux_arm64::FPU, reg) + \
-

[Lldb-commits] [PATCH] D25947: Merge Linux and FreeBSD arm64 register contexts

2016-10-25 Thread Pavel Labath via lldb-commits
labath created this revision.
labath added reviewers: emaste, clayborg.
labath added subscribers: lldb-commits, dmikulin.
Herald added subscribers: modocache, mgorny, beanz, rengolin, aemerson.

This is a test-the-water change about possibilities of reducing duplication in
the register context definitions.

I've named the new class RegisterInfoPOSIX, as RegisterContextPOSIX was already
taken :(.  The two files were identical except for a fix by Tamas in 
https://reviews.llvm.org/D12636,
which was applied to the Linux version only, which fixed a discrepancy between
the definitions of fpsr and fpcr on one hand, and all other floating point
register definitions on the other.

Linux test suite still passes after this change. For freebsd, make the floating
point register behavior consistent, but I don't know whether it will be
consistently fixed, or consistently broken. By eyeballing the code, I have a
feeling that a similar fix to https://reviews.llvm.org/D12636 will be required 
in
RegisterContextPOSIXProcessMonitor_arm64::ReadRegister, but I can't be sure as I
have no way to test it (the assert in that function should fire upon accessing
the registers if it is wrong though).


https://reviews.llvm.org/D25947

Files:
  source/Plugins/Process/FreeBSD/FreeBSDThread.cpp
  source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
  source/Plugins/Process/Utility/CMakeLists.txt
  source/Plugins/Process/Utility/RegisterContextFreeBSD_arm64.cpp
  source/Plugins/Process/Utility/RegisterContextFreeBSD_arm64.h
  source/Plugins/Process/Utility/RegisterContextLinux_arm64.cpp
  source/Plugins/Process/Utility/RegisterContextLinux_arm64.h
  source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp
  source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.h
  source/Plugins/Process/elf-core/ThreadElfCore.cpp

Index: source/Plugins/Process/elf-core/ThreadElfCore.cpp
===
--- source/Plugins/Process/elf-core/ThreadElfCore.cpp
+++ source/Plugins/Process/elf-core/ThreadElfCore.cpp
@@ -15,13 +15,12 @@
 #include "lldb/Target/Unwind.h"
 
 #include "Plugins/Process/Utility/RegisterContextFreeBSD_arm.h"
-#include "Plugins/Process/Utility/RegisterContextFreeBSD_arm64.h"
 #include "Plugins/Process/Utility/RegisterContextFreeBSD_i386.h"
 #include "Plugins/Process/Utility/RegisterContextFreeBSD_mips64.h"
 #include "Plugins/Process/Utility/RegisterContextFreeBSD_powerpc.h"
 #include "Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.h"
 #include "Plugins/Process/Utility/RegisterContextLinux_arm.h"
-#include "Plugins/Process/Utility/RegisterContextLinux_arm64.h"
+#include "Plugins/Process/Utility/RegisterInfoPOSIX_arm64.h"
 #include "Plugins/Process/Utility/RegisterContextLinux_i386.h"
 #include "Plugins/Process/Utility/RegisterContextLinux_s390x.h"
 #include "Plugins/Process/Utility/RegisterContextLinux_x86_64.h"
@@ -86,7 +85,7 @@
 case llvm::Triple::FreeBSD: {
   switch (arch.GetMachine()) {
   case llvm::Triple::aarch64:
-reg_interface = new RegisterContextFreeBSD_arm64(arch);
+reg_interface = new RegisterInfoPOSIX_arm64(arch);
 break;
   case llvm::Triple::arm:
 reg_interface = new RegisterContextFreeBSD_arm(arch);
@@ -118,7 +117,7 @@
 reg_interface = new RegisterContextLinux_arm(arch);
 break;
   case llvm::Triple::aarch64:
-reg_interface = new RegisterContextLinux_arm64(arch);
+reg_interface = new RegisterInfoPOSIX_arm64(arch);
 break;
   case llvm::Triple::systemz:
 reg_interface = new RegisterContextLinux_s390x(arch);
Index: source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.h
===
--- source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.h
+++ source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.h
@@ -1,4 +1,4 @@
-//===-- RegisterContextLinux_arm64.h *- C++ -*-===//
+//===-- RegisterInfoPOSIX_arm64.h ---*- C++ -*-===//
 //
 // The LLVM Compiler Infrastructure
 //
@@ -14,7 +14,7 @@
 #include "lldb/Target/RegisterContext.h"
 #include "lldb/lldb-private.h"
 
-class RegisterContextLinux_arm64 : public lldb_private::RegisterInfoInterface {
+class RegisterInfoPOSIX_arm64 : public lldb_private::RegisterInfoInterface {
 public:
   // based on RegisterContextDarwin_arm64.h
   struct GPR {
@@ -54,7 +54,7 @@
 uint64_t mdscr_el1;
   };
 
-  RegisterContextLinux_arm64(const lldb_private::ArchSpec &target_arch);
+  RegisterInfoPOSIX_arm64(const lldb_private::ArchSpec &target_arch);
 
   size_t GetGPRSize() const override;
 
Index: source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp
===
--- source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp
+++ source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp
@@ -1,4 +1,4 @@
-//===-- RegisterContextLinu

[Lldb-commits] [PATCH] D25922: Test infra: expose CFLAGS_NO_ARCH for use by test custom build rules

2016-10-25 Thread Todd Fiala via lldb-commits
tfiala added a comment.

> I am not that excited by this, but I don't see a much better way to achieve 
> the result. :)
>  Possibly I'd consider making the variable name positive (instead of 
> CFLAGS_NO_DEBUG, have a INCLUDES var, and then the test can use $(INCLUDES) 
> $(TRIPLE_CFLAGS)).

Jim and I tried a few different ways to skin this.  The actual problem shows up 
on some CI downstream from here, where we need (but fail to get) the isysroot 
settings.  Those are built with a few more variables that have not yet moved up 
into the Makefile rules in LLVM.org.

The other way to skin this, since it is a macOS only test, is to strip out the 
arch flags in the TestUniversal Makefile.  This approach would work both here 
and downstream since it doesn't require accessing Makefile variables that don't 
exist here.

I'll come back with something slightly different here.




Comment at: Python/lldbsuite/test/make/Makefile.rules:197
-ifeq "$(OS)" "Darwin"
-   CFLAGS += $(ARCHFLAG) $(ARCH) $(FRAMEWORK_INCLUDES) $(CFLAGS_EXTRAS) 
-I$(LLDB_BASE_DIR)include
-else

labath wrote:
> Are you sure this won't actually be missed on darwin for other tests? 
> `-archi386` does not seem to be a valid argument to clang (you need the space 
> here).
Hmm I ran it through x86_64 and that worked.  I didn't try i386.  I'll give 
that a shot.  If it blows up, I'll have a look at why a space is needed in one 
case and not the other on the macOS clang.  Thanks for highlighting.  (It 
looked like a meaningless divergence that I thought perhaps came from code 
motion over time).


https://reviews.llvm.org/D25922



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


[Lldb-commits] [PATCH] D25905: Minidump plugin: Adding ProcessMinidump, ThreadMinidump and register the plugin in SystemInitializerFull

2016-10-25 Thread Dimitar Vlahovski via lldb-commits
dvlahovski added inline comments.



Comment at: source/Plugins/Process/minidump/ProcessMinidump.cpp:67
+  // skip if the Minidump file is Windows generated, because we are still
+  // work-in-progress
+  if (!minidump_parser ||

labath wrote:
> Zach, Adrian: IIUC, the new plugin should generally have feature parity with 
> the windows-only plugin. (Dimitar: could you say exactly what bits are 
> missing?). You should be able to test out this plugin on windows minidumps by 
> removing the windows check below.
> 
> After this goes in, we'll be looking to remove the windows-only plugin.
Yes, I think that now my plugin has full feature parity with the windows-only 
one.


https://reviews.llvm.org/D25905



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


[Lldb-commits] [PATCH] D25905: Minidump plugin: Adding ProcessMinidump, ThreadMinidump and register the plugin in SystemInitializerFull

2016-10-25 Thread Dimitar Vlahovski via lldb-commits
dvlahovski updated this revision to Diff 75709.
dvlahovski marked 4 inline comments as done.
dvlahovski added a comment.

Formatting correctly the test files source code, and added explanation in their 
makefile
ReadModuleList() is called in DoLoadCore()


https://reviews.llvm.org/D25905

Files:
  
packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/TestMiniDumpNew.py
  
packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/install_breakpad.cpp
  
packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-x86_64
  
packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-x86_64.cpp
  
packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-x86_64.dmp
  
packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-x86_64_not_crashed
  
packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-x86_64_not_crashed.cpp
  
packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-x86_64_not_crashed.dmp
  
packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/makefile.txt
  source/API/SystemInitializerFull.cpp
  source/Plugins/Process/minidump/CMakeLists.txt
  source/Plugins/Process/minidump/MinidumpParser.cpp
  source/Plugins/Process/minidump/MinidumpParser.h
  source/Plugins/Process/minidump/MinidumpTypes.h
  source/Plugins/Process/minidump/NtStructures.h
  source/Plugins/Process/minidump/ProcessMinidump.cpp
  source/Plugins/Process/minidump/ProcessMinidump.h
  source/Plugins/Process/minidump/RegisterContextMinidump_x86_32.cpp
  source/Plugins/Process/minidump/RegisterContextMinidump_x86_32.h
  source/Plugins/Process/minidump/RegisterContextMinidump_x86_64.cpp
  source/Plugins/Process/minidump/RegisterContextMinidump_x86_64.h
  source/Plugins/Process/minidump/ThreadMinidump.cpp
  source/Plugins/Process/minidump/ThreadMinidump.h
  unittests/Process/minidump/CMakeLists.txt
  unittests/Process/minidump/Inputs/linux-i386.dmp
  unittests/Process/minidump/MinidumpParserTest.cpp

Index: unittests/Process/minidump/MinidumpParserTest.cpp
===
--- unittests/Process/minidump/MinidumpParserTest.cpp
+++ unittests/Process/minidump/MinidumpParserTest.cpp
@@ -8,9 +8,11 @@
 //===--===//
 
 // Project includes
+#include "Plugins/Process/Utility/RegisterContextLinux_i386.h"
 #include "Plugins/Process/Utility/RegisterContextLinux_x86_64.h"
 #include "Plugins/Process/minidump/MinidumpParser.h"
 #include "Plugins/Process/minidump/MinidumpTypes.h"
+#include "Plugins/Process/minidump/RegisterContextMinidump_x86_32.h"
 #include "Plugins/Process/minidump/RegisterContextMinidump_x86_64.h"
 
 // Other libraries and framework includes
@@ -61,7 +63,7 @@
   std::unique_ptr parser;
 };
 
-TEST_F(MinidumpParserTest, GetThreads) {
+TEST_F(MinidumpParserTest, GetThreadsAndGetThreadContext) {
   SetUpData("linux-x86_64.dmp");
   llvm::ArrayRef thread_list;
 
@@ -132,7 +134,7 @@
 llvm::Optional name =
 parser->GetMinidumpString(modules[i].module_name_rva);
 ASSERT_TRUE(name.hasValue());
-ASSERT_EQ(module_names[i], name.getValue());
+EXPECT_EQ(module_names[i], name.getValue());
   }
 }
 
@@ -273,60 +275,179 @@
   ASSERT_EQ(4440UL, pid.getValue());
 }
 
-// Register stuff
-// TODO probably split register stuff tests into different file?
-#define REG_VAL(x) *(reinterpret_cast(x))
+// wow64
+TEST_F(MinidumpParserTest, GetPidWow64) {
+  SetUpData("fizzbuzz_wow64.dmp");
+  llvm::Optional pid = parser->GetPid();
+  ASSERT_TRUE(pid.hasValue());
+  ASSERT_EQ(7836UL, pid.getValue());
+}
+
+TEST_F(MinidumpParserTest, GetModuleListWow64) {
+  SetUpData("fizzbuzz_wow64.dmp");
+  llvm::ArrayRef modules = parser->GetModuleList();
+  ASSERT_EQ(16UL, modules.size());
+  std::string module_names[16] = {
+  R"(D:\src\llvm\llvm\tools\lldb\packages\Python\lldbsuite\test\functionalities\postmortem\wow64_minidump\fizzbuzz.exe)",
+  R"(C:\Windows\System32\ntdll.dll)",
+  R"(C:\Windows\System32\wow64.dll)",
+  R"(C:\Windows\System32\wow64win.dll)",
+  R"(C:\Windows\System32\wow64cpu.dll)",
+  R"(D:\src\llvm\llvm\tools\lldb\packages\Python\lldbsuite\test\functionalities\postmortem\wow64_minidump\fizzbuzz.exe)",
+  R"(C:\Windows\SysWOW64\ntdll.dll)",
+  R"(C:\Windows\SysWOW64\kernel32.dll)",
+  R"(C:\Windows\SysWOW64\KERNELBASE.dll)",
+  R"(C:\Windows\SysWOW64\advapi32.dll)",
+  R"(C:\Windows\SysWOW64\msvcrt.dll)",
+  R"(C:\Windows\SysWOW64\sechost.dll)",
+  R"(C:\Windows\SysWOW64\rpcrt4.dll)",
+  R"(C:\Windows\SysWOW64\sspicli.dll)",
+  R"(C:\Windows\SysWOW64\CRYPTBASE.dll)",
+  R"(C:\Windows\System32\api-ms-win-core-synch-l1-2-0.DLL)",
+  };
+
+  for (int i = 0; i < 16; ++i) {
+llvm::Optional name =
+parser->GetMinidumpString(modules[i].module_name_rva);
+ASSERT_TRUE(name.hasVal

[Lldb-commits] [PATCH] D25905: Minidump plugin: Adding ProcessMinidump, ThreadMinidump and register the plugin in SystemInitializerFull

2016-10-25 Thread Pavel Labath via lldb-commits
labath added a comment.

Just a bit more cleanup and this will be fine. Sorry about the back and forth, 
I was in a hurry yesterday.

Zachary, Adrian: any thoughts on your side?




Comment at: 
packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-x86_64_not_crashed.cpp:7
+int
+bar(int x)
+{

labath wrote:
> Please format these consistently (llvm-style). clang-format will not work by 
> default as we are still ignoring the test folder.
Still not correct (4 char indent, inconsistent braces). It might be easiest to 
just temporarily remove `packages/Python/lldbsuite/.clang-format`. We'll need 
to figure out a better solution for formatting new test code in the long run 
though.



Comment at: 
packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/makefile.txt:1
+CC=g++
+FLAGS=-g --std=c++11

Please add a short blurb explaining how does this build work and why did we 
choose such a complicated way of generating the minidumps.



Comment at: source/Plugins/Process/minidump/ProcessMinidump.cpp:67
+  // skip if the Minidump file is Windows generated, because we are still
+  // work-in-progress
+  if (!minidump_parser ||

Zach, Adrian: IIUC, the new plugin should generally have feature parity with 
the windows-only plugin. (Dimitar: could you say exactly what bits are 
missing?). You should be able to test out this plugin on windows minidumps by 
removing the windows check below.

After this goes in, we'll be looking to remove the windows-only plugin.



Comment at: source/Plugins/Process/minidump/ProcessMinidump.cpp:89
+
+  // calling this here, and not in DoLoadCore, because we need to be sure this
+  // gets called first, because it initialises m_is_wow64 which is used in

Sorry about the back-and-forth, but I think we should put this back to 
LoadCore(). I did not realize that ReadModuleList was a private function and 
not a public interface of the class. :(

In this case we can assume that anyone will call LoadCore before expecting any 
other values to be valid, and we shouldn't be doing any parsing (especially not 
if it calls target->AddModule and such) as that is not the pattern anywhere 
else.



Comment at: source/Plugins/Process/minidump/ProcessMinidump.cpp:218
+  arch_spec.SetTriple(triple);
+  return arch_spec;
+}

return ArchSpec(triple);


https://reviews.llvm.org/D25905



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


[Lldb-commits] [lldb] r285068 - Revert "Improve the libstdc++ smart pointer formatters"

2016-10-25 Thread Pavel Labath via lldb-commits
Author: labath
Date: Tue Oct 25 08:24:53 2016
New Revision: 285068

URL: http://llvm.org/viewvc/llvm-project?rev=285068&view=rev
Log:
Revert "Improve the libstdc++ smart pointer formatters"

This reverts commit r284828, as it causes an infinite loop in
TestPrintStackTraces (funnily enough, only when logging is enabled).

Removed:
lldb/trunk/source/Plugins/Language/CPlusPlus/LibStdcppSmartPointer.cpp
Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/Makefile

lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py
lldb/trunk/source/Plugins/Language/CPlusPlus/CMakeLists.txt
lldb/trunk/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/Makefile
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/Makefile?rev=285068&r1=285067&r2=285068&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/Makefile
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/Makefile
 Tue Oct 25 08:24:53 2016
@@ -2,7 +2,14 @@ LEVEL = ../../../../../make
 
 CXX_SOURCES := main.cpp
 
+CXXFLAGS := -O0
 USE_LIBSTDCPP := 1
-CFLAGS_EXTRAS += $(NO_LIMIT_DEBUG_INFO_FLAGS)
+
+# clang-3.5+ outputs FullDebugInfo by default for Darwin/FreeBSD
+# targets.  Other targets do not, which causes this test to fail.
+# This flag enables FullDebugInfo for all targets.
+ifneq (,$(findstring clang,$(CC)))
+  CFLAGS_EXTRAS += -fno-limit-debug-info
+endif
 
 include $(LEVEL)/Makefile.rules

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py?rev=285068&r1=285067&r2=285068&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py
 Tue Oct 25 08:24:53 2016
@@ -31,58 +31,19 @@ class StdSmartPtrDataFormatterTestCase(T
 substrs=['stopped', 'stop reason = breakpoint'])
 
 self.expect("frame variable nsp", substrs=['nsp = nullptr'])
-self.expect("frame variable isp", substrs=['isp = 123', 'strong=1', 
'weak=1'])
-self.expect("frame variable ssp", substrs=['ssp = "foobar"', 
'strong=1', 'weak=1'])
-self.expect("frame variable nwp", substrs=['nwp = nullptr'])
-self.expect("frame variable iwp", substrs=['iwp = 123', 'strong=1', 
'weak=1'])
-self.expect("frame variable swp", substrs=['swp = "foobar"', 
'strong=1', 'weak=1'])
-
-frame = self.frame()
-self.assertTrue(frame.IsValid())
-
-self.assertEqual(0, 
frame.GetValueForVariablePath("nsp.pointer").GetValueAsUnsigned())
-self.assertEqual(0, 
frame.GetValueForVariablePath("nwp.pointer").GetValueAsUnsigned())
-
-self.assertNotEqual(0, 
frame.GetValueForVariablePath("isp.pointer").GetValueAsUnsigned())
-self.assertEqual(123, 
frame.GetValueForVariablePath("isp.object").GetValueAsUnsigned())
-self.assertEqual(1, 
frame.GetValueForVariablePath("isp.count").GetValueAsUnsigned())
-self.assertEqual(1, 
frame.GetValueForVariablePath("isp.weak_count").GetValueAsUnsigned())
-self.assertFalse(frame.GetValueForVariablePath("isp.foobar").IsValid())
+self.expect("frame variable isp", substrs=['isp = 123'])
+self.expect("frame variable ssp", substrs=['ssp = "foobar"'])
 
-self.assertNotEqual(0, 
frame.GetValueForVariablePath("ssp.pointer").GetValueAsUnsigned())
-self.assertEqual('"foobar"', 
frame.GetValueForVariablePath("ssp.object").GetSummary())
-self.assertEqual(1, 
frame.GetValueForVariablePath("ssp.count").GetValueAsUnsigned())
-self.assertEqual(1, 
frame.GetValueForVariablePath("ssp.weak_count").GetValueAsUnsigned())
-self.assertFalse(frame.GetValueForVariablePath("ssp.foobar").IsValid())
-
-self.assertNotEqual(0, 
frame.GetValueForVariablePath("iwp.pointer").GetValueAsUnsigned())
-self.assertEqual(123, 
frame.GetValueForVariablePath("iwp.object").GetValueAsUnsigned()

[Lldb-commits] [PATCH] D25926: Don't set a software stepping breakpoint at 0 on arm or mips.

2016-10-25 Thread Pavel Labath via lldb-commits
labath added a comment.

Could you make two more changes to this patch?




Comment at: source/Plugins/Process/Linux/NativeProcessLinux.cpp:1365
 error = SetSoftwareBreakpoint(next_pc, 4);
-  else {
+// If setting the breakpoint fails because next_pc is out of
+// the address space, ignore it and let the debugee segfault.

You can put the code behind this switch on the architecture below, so we don't 
duplicate it needlessly -- I don't know of any arch which uses software single 
stepping and is not arm or mips, so probably the else branch is dead code, but 
even if such arch existed, this should be correct for it as well. (Also, 
probably the whole switch should be a bit deduplicated but that's for a 
different change).



Comment at: source/Plugins/Process/Linux/NativeProcessLinux.cpp:1378
 
   m_threads_stepping_with_breakpoint.insert({thread.GetID(), next_pc});
 

I don't think the thread should be added to this list if setting the breakpoint 
failed, as we will then just try to remove (and fail) the non-existing 
breakpoint in SignalIfAllThreadsStopped().


https://reviews.llvm.org/D25926



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


[Lldb-commits] [PATCH] D25922: Test infra: expose CFLAGS_NO_ARCH for use by test custom build rules

2016-10-25 Thread Pavel Labath via lldb-commits
labath added a comment.

I am not that excited by this, but I don't see a much better way to achieve the 
result. :)
 Possibly I'd consider making the variable name positive (instead of 
CFLAGS_NO_DEBUG, have a INCLUDES var, and then the test can use `$(INCLUDES) 
$(TRIPLE_CFLAGS)`).




Comment at: Python/lldbsuite/test/make/Makefile.rules:197
-ifeq "$(OS)" "Darwin"
-   CFLAGS += $(ARCHFLAG) $(ARCH) $(FRAMEWORK_INCLUDES) $(CFLAGS_EXTRAS) 
-I$(LLDB_BASE_DIR)include
-else

Are you sure this won't actually be missed on darwin for other tests? 
`-archi386` does not seem to be a valid argument to clang (you need the space 
here).


https://reviews.llvm.org/D25922



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