[Lldb-commits] [lldb] r331242 - Fix type_lookup test to make buildbots happy

2018-04-30 Thread Eugene Zemtsov via lldb-commits
Author: eugene
Date: Mon Apr 30 20:06:05 2018
New Revision: 331242

URL: http://llvm.org/viewvc/llvm-project?rev=331242=rev
Log:
Fix type_lookup test to make buildbots happy

Added:

lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/type_lookup/TestCppTypeLookup.py
  - copied, changed from r331239, 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/type_lookup/TestTypeLookup.py
Removed:

lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/type_lookup/TestTypeLookup.py
Modified:
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/type_lookup/Makefile
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/type_lookup/main.cpp

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/type_lookup/Makefile
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/type_lookup/Makefile?rev=331242=331241=331242=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/type_lookup/Makefile 
(original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/type_lookup/Makefile Mon 
Apr 30 20:06:05 2018
@@ -1,3 +1,3 @@
 LEVEL = ../../../make
-C_SOURCES := main.c
+CXX_SOURCES := main.cpp
 include $(LEVEL)/Makefile.rules

Copied: 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/type_lookup/TestCppTypeLookup.py
 (from r331239, 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/type_lookup/TestTypeLookup.py)
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/type_lookup/TestCppTypeLookup.py?p2=lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/type_lookup/TestCppTypeLookup.py=lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/type_lookup/TestTypeLookup.py=331239=331242=331242=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/type_lookup/TestTypeLookup.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/type_lookup/TestCppTypeLookup.py
 Mon Apr 30 20:06:05 2018
@@ -10,7 +10,7 @@ import lldbsuite.test.lldbutil as lldbut
 from lldbsuite.test.lldbtest import *
 from lldbsuite.test import decorators
 
-class TestTypeLookup(TestBase):
+class TestCppTypeLookup(TestBase):
 
 mydir = TestBase.compute_mydir(__file__)
 

Removed: 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/type_lookup/TestTypeLookup.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/type_lookup/TestTypeLookup.py?rev=331241=auto
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/type_lookup/TestTypeLookup.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/type_lookup/TestTypeLookup.py
 (removed)
@@ -1,89 +0,0 @@
-"""
-Test that we can lookup types correctly in the expression parser
-"""
-
-from __future__ import print_function
-
-
-import lldb
-import lldbsuite.test.lldbutil as lldbutil
-from lldbsuite.test.lldbtest import *
-from lldbsuite.test import decorators
-
-class TestTypeLookup(TestBase):
-
-mydir = TestBase.compute_mydir(__file__)
-
-def check_value(self, value, ivar_name, ivar_value):
-self.assertTrue(value.GetError().Success(),
-"Invalid valobj: %s" % (
-value.GetError().GetCString()))
-ivar = value.GetChildMemberWithName(ivar_name)
-self.assertTrue(ivar.GetError().Success(),
-"Failed to fetch ivar named '%s'" % (ivar_name))
-self.assertEqual(ivar_value,
- ivar.GetValueAsSigned(),
- "Got the right value for ivar")
-
-def test_namespace_only(self):
-"""
-Test that we fail to lookup a struct type that exists only in a
-namespace.
-"""
-self.build()
-self.main_source_file = lldb.SBFileSpec("main.cpp")
-(target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint(
-self, "Set a breakpoint here", self.main_source_file)
-
-# Get frame for current thread
-frame = thread.GetSelectedFrame()
-
-# Make sure we don't accidentally accept structures that exist only
-# in namespaces when evaluating expressions with top level types.
-# Prior to the revision that added this test, we would accidentally
-# accept types from namespaces, so this will ensure we don't regress
-# to that behavior again
-expr_result = frame.EvaluateExpression("*((namespace_only *))")
-self.assertTrue(expr_result.GetError().Fail(),
-"'namespace_only' exists in namespace only")
-
-# Make sure we can find the correct type in a namespace "a"
-expr_result = frame.EvaluateExpression("*((a::namespace_only *))")
-self.check_value(expr_result, "a", 123)
-# Make sure we can find the 

[Lldb-commits] [lldb] r330163 - Make sure deleting all breakpoints clears their sites first

2018-04-16 Thread Eugene Zemtsov via lldb-commits
Author: eugene
Date: Mon Apr 16 15:26:21 2018
New Revision: 330163

URL: http://llvm.org/viewvc/llvm-project?rev=330163=rev
Log:
Make sure deleting all breakpoints clears their sites first

Bug: https://bugs.llvm.org/show_bug.cgi?id=36430

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

Modified:

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

lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/main.c
lldb/trunk/source/Breakpoint/BreakpointList.cpp

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py?rev=330163=330162=330163=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py
 Mon Apr 16 15:26:21 2018
@@ -45,6 +45,25 @@ class BreakpointCommandTestCase(TestBase
 self.addTearDownHook(
 lambda: self.runCmd("settings clear auto-confirm"))
 
+@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24528")
+def test_delete_all_breakpoints(self):
+"""Test that deleting all breakpoints works."""
+self.build()
+exe = self.getBuildArtifact("a.out")
+self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
+
+lldbutil.run_break_set_by_symbol(self, "main")
+lldbutil.run_break_set_by_file_and_line(
+self, "main.c", self.line, num_expected_locations=1, 
loc_exact=True)
+
+self.runCmd("run", RUN_SUCCEEDED)
+
+self.runCmd("breakpoint delete")
+self.runCmd("process continue")
+self.expect("process status", PROCESS_STOPPED,
+patterns=['Process .* exited with status = 0'])
+
+
 def breakpoint_command_sequence(self):
 """Test a sequence of breakpoint command add, list, and delete."""
 exe = self.getBuildArtifact("a.out")

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/main.c
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/main.c?rev=330163=330162=330163=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/main.c
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/main.c
 Mon Apr 16 15:26:21 2018
@@ -9,5 +9,9 @@
 
 int main (int argc, char const *argv[])
 {
+// Add a body to the function, so we can set more than one
+// breakpoint in it.
+static volatile int var = 0;
+var++;
 return 0; // Set break point at this line.
 }

Modified: lldb/trunk/source/Breakpoint/BreakpointList.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Breakpoint/BreakpointList.cpp?rev=330163=330162=330163=diff
==
--- lldb/trunk/source/Breakpoint/BreakpointList.cpp (original)
+++ lldb/trunk/source/Breakpoint/BreakpointList.cpp Mon Apr 16 15:26:21 2018
@@ -99,7 +99,7 @@ void BreakpointList::RemoveAll(bool noti
 
 void BreakpointList::RemoveAllowed(bool notify) {
   std::lock_guard guard(m_mutex);
-  
+
   bp_collection::iterator pos, end = m_breakpoints.end();
   if (notify) {
 for (pos = m_breakpoints.begin(); pos != end; ++pos) {
@@ -116,10 +116,12 @@ void BreakpointList::RemoveAllowed(bool
   }
   pos = m_breakpoints.begin();
   while ( pos != end) {
-  if((*pos)->AllowDelete())
-pos = m_breakpoints.erase(pos);
-  else
-pos++;
+auto bp = *pos;
+if (bp->AllowDelete()) {
+  bp->ClearAllBreakpointSites();
+  pos = m_breakpoints.erase(pos);
+} else
+  pos++;
   }
 }
 


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


[Lldb-commits] [lldb] r324558 - Deactivate TestTargetSymbolsBuildidCase if host is windows

2018-02-07 Thread Eugene Zemtsov via lldb-commits
Author: eugene
Date: Wed Feb  7 19:05:47 2018
New Revision: 324558

URL: http://llvm.org/viewvc/llvm-project?rev=324558=rev
Log:
Deactivate TestTargetSymbolsBuildidCase if host is windows

Makefile has unix magic and thus not working on windows.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/linux/buildidcase/TestTargetSymbolsBuildidCase.py
lldb/trunk/packages/Python/lldbsuite/test/lldbplatformutil.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/linux/buildidcase/TestTargetSymbolsBuildidCase.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/linux/buildidcase/TestTargetSymbolsBuildidCase.py?rev=324558=324557=324558=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/linux/buildidcase/TestTargetSymbolsBuildidCase.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/linux/buildidcase/TestTargetSymbolsBuildidCase.py
 Wed Feb  7 19:05:47 2018
@@ -14,6 +14,7 @@ class TestTargetSymbolsBuildidCase(TestB
 
 @no_debug_info_test  # Prevent the genaration of the dwarf version of this 
test
 @skipUnlessPlatform(['linux'])
+@skipIf(hostoslist=['windows'])
 def test_target_symbols_buildid_case(self):
 self.build(clean=True)
 exe = self.getBuildArtifact("stripped.out")

Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbplatformutil.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbplatformutil.py?rev=324558=324557=324558=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/lldbplatformutil.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbplatformutil.py Wed Feb  7 
19:05:47 2018
@@ -109,7 +109,7 @@ def getHostPlatform():
 # Attempts to return a platform name matching a target Triple platform.
 if sys.platform.startswith('linux'):
 return 'linux'
-elif sys.platform.startswith('win32'):
+elif sys.platform.startswith('win32') or sys.platform.startswith('cygwin'):
 return 'windows'
 elif sys.platform.startswith('darwin'):
 return 'darwin'


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


[Lldb-commits] [lldb] r324380 - More correct handling of error cases C++ name parser

2018-02-06 Thread Eugene Zemtsov via lldb-commits
Author: eugene
Date: Tue Feb  6 11:04:12 2018
New Revision: 324380

URL: http://llvm.org/viewvc/llvm-project?rev=324380=rev
Log:
More correct handling of error cases C++ name parser

Now incorrect type argument that looks like T doesn't
cause an assert, but just a parsing error.

Bug: 36224
Differential Revision: https://reviews.llvm.org/D42939

Modified:
lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.cpp
lldb/trunk/unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp

Modified: lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.cpp?rev=324380=324379=324380=diff
==
--- lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.cpp 
(original)
+++ lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.cpp Tue 
Feb  6 11:04:12 2018
@@ -242,8 +242,7 @@ bool CPlusPlusNameParser::ConsumeTemplat
 }
   }
 
-  assert(template_counter >= 0);
-  if (template_counter > 0) {
+  if (template_counter != 0) {
 return false;
   }
   start_position.Remove();

Modified: lldb/trunk/unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp?rev=324380=324379=324380=diff
==
--- lldb/trunk/unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp (original)
+++ lldb/trunk/unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp Tue Feb  
6 11:04:12 2018
@@ -160,4 +160,6 @@ TEST(CPlusPlusLanguage, ExtractContextAn
   "selector:otherField:", context, basename));
   EXPECT_FALSE(CPlusPlusLanguage::ExtractContextAndIdentifier(
   "abc::", context, basename));
+  EXPECT_FALSE(CPlusPlusLanguage::ExtractContextAndIdentifier(
+  "f", context, basename));
 }


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


[Lldb-commits] [lldb] r324288 - Disable test_restart_bug failing on Android

2018-02-05 Thread Eugene Zemtsov via lldb-commits
Author: eugene
Date: Mon Feb  5 15:31:58 2018
New Revision: 324288

URL: http://llvm.org/viewvc/llvm-project?rev=324288=rev
Log:
Disable test_restart_bug failing on Android

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/signal/raise/TestRaise.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/signal/raise/TestRaise.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/signal/raise/TestRaise.py?rev=324288=324287=324288=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/signal/raise/TestRaise.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/signal/raise/TestRaise.py
 Mon Feb  5 15:31:58 2018
@@ -189,6 +189,7 @@ class RaiseTestCase(TestBase):
 # reset signal handling to default
 self.set_handle(signal, default_pass, default_stop, default_notify)
 
+@skipIfTargetAndroid()
 def test_restart_bug(self):
 """Test that we catch a signal in the edge case where the process 
receives it while we are
 about to interrupt it"""


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


[Lldb-commits] [lldb] r322251 - Advanced guessing of rendezvous breakpoint (resubmit)

2018-01-10 Thread Eugene Zemtsov via lldb-commits
Author: eugene
Date: Wed Jan 10 19:46:35 2018
New Revision: 322251

URL: http://llvm.org/viewvc/llvm-project?rev=322251=rev
Log:
Advanced guessing of rendezvous breakpoint (resubmit)

When rendezvous structure is not initialized we need to set up
rendezvous breakpoint anyway. In this case the code will locate
dynamic loader (interpreter) and look for known function names.

This is r322209, but with fixed VDSO loading fixed.

Bug: https://bugs.llvm.org/show_bug.cgi?id=25806
Differential Revision: https://reviews.llvm.org/D41533

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py

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

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py?rev=322251=322250=322251=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py
 Wed Jan 10 19:46:35 2018
@@ -17,23 +17,23 @@ class TestBreakpointInGlobalConstructors
 mydir = TestBase.compute_mydir(__file__)
 NO_DEBUG_INFO_TESTCASE = True
 
-def setUp(self):
-TestBase.setUp(self)
+def test(self):
+self.build()
 self.line_foo = line_number('foo.cpp', '// !BR_foo')
 self.line_main = line_number('main.cpp', '// !BR_main')
 
-@expectedFailureAll(bugnumber="llvm.org/pr35480", oslist=["linux"])
-def test(self):
-self.build()
-exe = os.path.join(os.getcwd(), "a.out")
-self.runCmd("file %s" % exe)
+target = self.dbg.CreateTarget("a.out")
+self.assertTrue(target, VALID_TARGET)
+
+env= self.registerSharedLibrariesWithTarget(target, ["foo"])
 
 bp_main = lldbutil.run_break_set_by_file_and_line(
 self, 'main.cpp', self.line_main)
 bp_foo = lldbutil.run_break_set_by_file_and_line(
 self, 'foo.cpp', self.line_foo)
 
-self.runCmd("run")
+process = target.LaunchSimple(
+None, env, self.get_process_working_directory())
 
 self.assertIsNotNone(
 lldbutil.get_one_thread_stopped_at_breakpoint_id(

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py?rev=322251=322250=322251=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py
 Wed Jan 10 19:46:35 2018
@@ -368,7 +368,6 @@ class LoadUnloadTestCase(TestBase):
 
 @skipIfFreeBSD  # llvm.org/pr14424 - missing FreeBSD Makefiles/testcase 
support
 @skipIfWindows  # Windows doesn't have dlopen and friends, dynamic 
libraries work differently
-@unittest2.expectedFailure("llvm.org/pr25806")
 def test_static_init_during_load(self):
 """Test that we can set breakpoints correctly in static initializers"""
 
@@ -395,19 +394,19 @@ class LoadUnloadTestCase(TestBase):
 self.runCmd("continue")
 self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
 substrs=['stopped',
- 'a_init',
- 'stop reason = breakpoint %d' % a_init_bp_num])
+ 'b_init',
+ 'stop reason = breakpoint %d' % b_init_bp_num])
 self.expect("thread backtrace",
-substrs=['a_init',
+substrs=['b_init',
  'dlopen',
  'main'])
 
 self.runCmd("continue")
 self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
 substrs=['stopped',
- 'b_init',
- 'stop reason = breakpoint %d' % b_init_bp_num])
+ 'a_init',
+ 'stop reason = breakpoint %d' % a_init_bp_num])
 self.expect("thread backtrace",
-substrs=['b_init',
+substrs=['a_init',
  'dlopen',
   

[Lldb-commits] [lldb] r322209 - Advanced guessing of rendezvous breakpoint

2018-01-10 Thread Eugene Zemtsov via lldb-commits
Author: eugene
Date: Wed Jan 10 11:04:36 2018
New Revision: 322209

URL: http://llvm.org/viewvc/llvm-project?rev=322209=rev
Log:
Advanced guessing of rendezvous breakpoint

When rendezvous structure is not initialized we need to set up
rendezvous breakpoint anyway. In this case the code will locate
dynamic loader (interpreter) and look for known function names.

Bug: https://bugs.llvm.org/show_bug.cgi?id=25806
Differential Revision: https://reviews.llvm.org/D41533

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py

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

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py?rev=322209=322208=322209=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py
 Wed Jan 10 11:04:36 2018
@@ -17,23 +17,23 @@ class TestBreakpointInGlobalConstructors
 mydir = TestBase.compute_mydir(__file__)
 NO_DEBUG_INFO_TESTCASE = True
 
-def setUp(self):
-TestBase.setUp(self)
+def test(self):
+self.build()
 self.line_foo = line_number('foo.cpp', '// !BR_foo')
 self.line_main = line_number('main.cpp', '// !BR_main')
 
-@expectedFailureAll(bugnumber="llvm.org/pr35480", oslist=["linux"])
-def test(self):
-self.build()
-exe = os.path.join(os.getcwd(), "a.out")
-self.runCmd("file %s" % exe)
+target = self.dbg.CreateTarget("a.out")
+self.assertTrue(target, VALID_TARGET)
+
+env= self.registerSharedLibrariesWithTarget(target, ["foo"])
 
 bp_main = lldbutil.run_break_set_by_file_and_line(
 self, 'main.cpp', self.line_main)
 bp_foo = lldbutil.run_break_set_by_file_and_line(
 self, 'foo.cpp', self.line_foo)
 
-self.runCmd("run")
+process = target.LaunchSimple(
+None, env, self.get_process_working_directory())
 
 self.assertIsNotNone(
 lldbutil.get_one_thread_stopped_at_breakpoint_id(

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py?rev=322209=322208=322209=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py
 Wed Jan 10 11:04:36 2018
@@ -368,7 +368,6 @@ class LoadUnloadTestCase(TestBase):
 
 @skipIfFreeBSD  # llvm.org/pr14424 - missing FreeBSD Makefiles/testcase 
support
 @skipIfWindows  # Windows doesn't have dlopen and friends, dynamic 
libraries work differently
-@unittest2.expectedFailure("llvm.org/pr25806")
 def test_static_init_during_load(self):
 """Test that we can set breakpoints correctly in static initializers"""
 
@@ -395,19 +394,19 @@ class LoadUnloadTestCase(TestBase):
 self.runCmd("continue")
 self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
 substrs=['stopped',
- 'a_init',
- 'stop reason = breakpoint %d' % a_init_bp_num])
+ 'b_init',
+ 'stop reason = breakpoint %d' % b_init_bp_num])
 self.expect("thread backtrace",
-substrs=['a_init',
+substrs=['b_init',
  'dlopen',
  'main'])
 
 self.runCmd("continue")
 self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
 substrs=['stopped',
- 'b_init',
- 'stop reason = breakpoint %d' % b_init_bp_num])
+ 'a_init',
+ 'stop reason = breakpoint %d' % a_init_bp_num])
 self.expect("thread backtrace",
-substrs=['b_init',
+substrs=['a_init',
  'dlopen',
  'main'])

Modified: 

[Lldb-commits] [lldb] r318504 - Fix LLDB build.

2017-11-16 Thread Eugene Zemtsov via lldb-commits
Author: eugene
Date: Thu Nov 16 19:28:58 2017
New Revision: 318504

URL: http://llvm.org/viewvc/llvm-project?rev=318504=rev
Log:
Fix LLDB build.

It was broken by r318489.

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

Modified: lldb/trunk/source/Utility/StructuredData.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/StructuredData.cpp?rev=318504=318503=318504=diff
==
--- lldb/trunk/source/Utility/StructuredData.cpp (original)
+++ lldb/trunk/source/Utility/StructuredData.cpp Thu Nov 16 19:28:58 2017
@@ -15,6 +15,7 @@
 #include "lldb/Utility/Stream.h" // for Stream
 #include "lldb/Utility/StreamString.h"
 #include "llvm/ADT/STLExtras.h" // for make_unique
+#include "llvm/Support/MemoryBuffer.h"
 #include 
 #include 
 #include 


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


[Lldb-commits] [lldb] r315008 - Enable breakpoints and read/write GPRs for ppc64le

2017-10-05 Thread Eugene Zemtsov via lldb-commits
Author: eugene
Date: Thu Oct  5 12:44:05 2017
New Revision: 315008

URL: http://llvm.org/viewvc/llvm-project?rev=315008=rev
Log:
Enable breakpoints and read/write GPRs for ppc64le

Add support for ppc64le to create breakpoints and read/write
general purpose registers.
Other features for ppc64le and functions to read/write
other registers are being implemented.

Patch by Alexandre Yukio Yamashita (alexandreyy)
Differential Revision: https://reviews.llvm.org/D38323

Added:

lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.cpp
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.h
lldb/trunk/source/Plugins/Process/Utility/RegisterInfoPOSIX_ppc64le.cpp
lldb/trunk/source/Plugins/Process/Utility/RegisterInfoPOSIX_ppc64le.h
lldb/trunk/source/Plugins/Process/Utility/RegisterInfos_ppc64le.h
lldb/trunk/source/Plugins/Process/Utility/lldb-ppc64le-register-enums.h
lldb/trunk/source/Utility/PPC64LE_DWARF_Registers.h
lldb/trunk/source/Utility/PPC64LE_ehframe_Registers.h
Modified:
lldb/trunk/source/Plugins/Process/Linux/CMakeLists.txt
lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp
lldb/trunk/source/Plugins/Process/Utility/CMakeLists.txt
lldb/trunk/source/Target/Platform.cpp
lldb/trunk/source/Target/Thread.cpp

Modified: lldb/trunk/source/Plugins/Process/Linux/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/CMakeLists.txt?rev=315008=315007=315008=diff
==
--- lldb/trunk/source/Plugins/Process/Linux/CMakeLists.txt (original)
+++ lldb/trunk/source/Plugins/Process/Linux/CMakeLists.txt Thu Oct  5 12:44:05 
2017
@@ -7,9 +7,10 @@ add_lldb_library(lldbPluginProcessLinux
   NativeRegisterContextLinux.cpp
   NativeRegisterContextLinux_arm.cpp
   NativeRegisterContextLinux_arm64.cpp
-  NativeRegisterContextLinux_x86_64.cpp
   NativeRegisterContextLinux_mips64.cpp
+  NativeRegisterContextLinux_ppc64le.cpp
   NativeRegisterContextLinux_s390x.cpp
+  NativeRegisterContextLinux_x86_64.cpp
   NativeThreadLinux.cpp
   ProcessorTrace.cpp
   SingleStepCheck.cpp

Modified: lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp?rev=315008=315007=315008=diff
==
--- lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp Thu Oct  5 
12:44:05 2017
@@ -1078,7 +1078,8 @@ NativeProcessLinux::SetupSoftwareSingleS
   } else if (m_arch.GetMachine() == llvm::Triple::mips64 ||
  m_arch.GetMachine() == llvm::Triple::mips64el ||
  m_arch.GetMachine() == llvm::Triple::mips ||
- m_arch.GetMachine() == llvm::Triple::mipsel)
+ m_arch.GetMachine() == llvm::Triple::mipsel ||
+ m_arch.GetMachine() == llvm::Triple::ppc64le)
 error = SetSoftwareBreakpoint(next_pc, 4);
   else {
 // No size hint is given for the next breakpoint
@@ -1579,6 +1580,7 @@ Status NativeProcessLinux::GetSoftwareBr
   // set per architecture.  Need ARM, MIPS support here.
   static const uint8_t g_i386_opcode[] = {0xCC};
   static const uint8_t g_s390x_opcode[] = {0x00, 0x01};
+  static const uint8_t g_ppc64le_opcode[] = {0x08, 0x00, 0xe0, 0x7f}; // trap
 
   switch (m_arch.GetMachine()) {
   case llvm::Triple::x86:
@@ -1590,6 +1592,10 @@ Status NativeProcessLinux::GetSoftwareBr
 actual_opcode_size = static_cast(sizeof(g_s390x_opcode));
 return Status();
 
+  case llvm::Triple::ppc64le:
+actual_opcode_size = static_cast(sizeof(g_ppc64le_opcode));
+return Status();
+
   case llvm::Triple::arm:
   case llvm::Triple::aarch64:
   case llvm::Triple::mips64:
@@ -1635,6 +1641,7 @@ Status NativeProcessLinux::GetSoftwareBr
   static const uint8_t g_mips64el_opcode[] = {0x0d, 0x00, 0x00, 0x00};
   static const uint8_t g_s390x_opcode[] = {0x00, 0x01};
   static const uint8_t g_thumb_breakpoint_opcode[] = {0x01, 0xde};
+  static const uint8_t g_ppc64le_opcode[] = {0x08, 0x00, 0xe0, 0x7f}; // trap
 
   switch (m_arch.GetMachine()) {
   case llvm::Triple::aarch64:
@@ -1680,6 +1687,11 @@ Status NativeProcessLinux::GetSoftwareBr
 actual_opcode_size = sizeof(g_s390x_opcode);
 return Status();
 
+  case llvm::Triple::ppc64le:
+trap_opcode_bytes = g_ppc64le_opcode;
+actual_opcode_size = sizeof(g_ppc64le_opcode);
+return Status();
+
   default:
 assert(false && "CPU type not supported!");
 return Status("CPU type not supported");

Added: 
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.cpp?rev=315008=auto

[Lldb-commits] [lldb] r314488 - Fix Android remote debugging tests running on Windows

2017-09-28 Thread Eugene Zemtsov via lldb-commits
Author: eugene
Date: Thu Sep 28 20:25:25 2017
New Revision: 314488

URL: http://llvm.org/viewvc/llvm-project?rev=314488=rev
Log:
Fix Android remote debugging tests running on Windows

Use make based OS check, instad of relying on shell.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile?rev=314488=314487=314488=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile 
(original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile 
Thu Sep 28 20:25:25 2017
@@ -12,7 +12,10 @@ a.out: lib_a lib_b lib_c lib_d hidden_li
 
 lib_%:
$(MAKE) -f $*.mk
-   if [ "$(OS)" = "Darwin" -a -f libloadunload_d.dylib ]; then 
install_name_tool -id @executable_path/libloadunload_d.dylib 
libloadunload_d.dylib; fi
+ifeq ($(OS),Darwin)
+   install_name_tool -id @executable_path/libloadunload_d.dylib 
libloadunload_d.dylib
+endif
+
 
 hidden_lib_d:
$(MAKE) -C hidden


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


[Lldb-commits] [lldb] r314487 - Fix compilation error

2017-09-28 Thread Eugene Zemtsov via lldb-commits
Author: eugene
Date: Thu Sep 28 20:15:08 2017
New Revision: 314487

URL: http://llvm.org/viewvc/llvm-project?rev=314487=rev
Log:
Fix compilation error

Modified:
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
lldb/trunk/source/Symbol/ClangASTContext.cpp

Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp?rev=314487=314486=314487=diff
==
--- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp 
(original)
+++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp Thu Sep 
28 20:15:08 2017
@@ -69,7 +69,7 @@ void ClangASTSource::InstallASTContext(c
 // types from any source that we would do lookups in, which includes the
 // persistent AST context as well as the modules and Objective-C runtime
 // AST contexts.
-
+
 lldbassert(!m_merger_up);
 clang::ExternalASTMerger::ImporterTarget target = {ast_context,
file_manager};
@@ -114,14 +114,14 @@ void ClangASTSource::InstallASTContext(c
 
   sources.push_back(modules_decl_vendor->GetImporterSource());
 } while (0);
-
+
 if (!is_shared_context) {
   // Update the scratch AST context's merger to reflect any new sources we
   // might have come across since the last time an expression was parsed.
-  
+
   auto scratch_ast_context = static_cast(
   m_target->GetScratchClangASTContext());
-  
+
   scratch_ast_context->GetMergerUnchecked().AddSources(sources);
 
   sources.push_back({*scratch_ast_context->getASTContext(),
@@ -429,22 +429,22 @@ void ClangASTSource::CompleteType(clang:
 ASTDumper dumper((Decl *)interface_decl);
 dumper.ToLog(log, "  [COID] ");
   }
-  
+
   if (!m_ast_importer_sp) {
 if (HasMerger()) {
   ObjCInterfaceDecl *complete_iface_decl =
 GetCompleteObjCInterface(interface_decl);
-  
+
   if (complete_iface_decl && (complete_iface_decl != interface_decl)) {
 m_merger_up->ForceRecordOrigin(interface_decl, {complete_iface_decl, 
_iface_decl->getASTContext()});
   }
 
   GetMergerUnchecked().CompleteType(interface_decl);
 } else {
-  lldbassert(!"No mechanism for completing a type!"); 
+  lldbassert(!"No mechanism for completing a type!");
 }
 return;
-  }  
+  }
 
   Decl *original_decl = NULL;
   ASTContext *original_ctx = NULL;
@@ -525,7 +525,7 @@ void ClangASTSource::FindExternalLexical
 if (auto *interface_decl = dyn_cast(decl_context)) {
   ObjCInterfaceDecl *complete_iface_decl =
  GetCompleteObjCInterface(interface_decl);
-  
+
   if (complete_iface_decl && (complete_iface_decl != interface_decl)) {
 m_merger_up->ForceRecordOrigin(interface_decl, {complete_iface_decl, 
_iface_decl->getASTContext()});
   }
@@ -698,7 +698,7 @@ void ClangASTSource::FindExternalVisible
 dyn_cast(context.m_decl_context)) {
   ObjCInterfaceDecl *complete_iface_decl =
   GetCompleteObjCInterface(interface_decl);
-  
+
   if (complete_iface_decl && (complete_iface_decl != interface_decl)) {
 GetMergerUnchecked().ForceRecordOrigin(
 interface_decl,
@@ -1141,12 +1141,12 @@ void ClangASTSource::FindObjCMethodDecls
 if (auto *interface_decl = 
dyn_cast(context.m_decl_context)) {
   ObjCInterfaceDecl *complete_iface_decl =
   GetCompleteObjCInterface(interface_decl);
-  
+
   if (complete_iface_decl && (complete_iface_decl != 
context.m_decl_context)) {
 m_merger_up->ForceRecordOrigin(interface_decl, {complete_iface_decl, 
_iface_decl->getASTContext()});
   }
 }
-
+
 GetMergerUnchecked().FindExternalVisibleDeclsByName(context.m_decl_context,
 context.m_decl_name);
 return;
@@ -2018,7 +2018,7 @@ bool ClangASTSource::ResolveDeclOrigin(c
 }
 
 clang::ExternalASTMerger ::GetMergerUnchecked() {
-  lldbassert(m_merger_up);
+  lldbassert(m_merger_up != nullptr);
   return *m_merger_up;
 }
 

Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=314487=314486=314487=diff
==
--- lldb/trunk/source/Symbol/ClangASTContext.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp Thu Sep 28 20:15:08 2017
@@ -1431,7 +1431,7 @@ static TemplateParameterList *CreateTemp
   is_typename, parameter_pack));
 }
   }
-  
+
   if (template_param_infos.packed_args &&
   template_param_infos.packed_args->args.size()) {
 IdentifierInfo *identifier_info = nullptr;
@@ -10126,7 +10126,7 @@ ClangASTContextForExpressions::GetPersis
 
 

[Lldb-commits] [lldb] r314127 - Use socketpair on all Unix platforms

2017-09-25 Thread Eugene Zemtsov via lldb-commits
Author: eugene
Date: Mon Sep 25 10:41:16 2017
New Revision: 314127

URL: http://llvm.org/viewvc/llvm-project?rev=314127=rev
Log:
Use socketpair on all Unix platforms

Using TCP sockets is insecure against local attackers, and possibly
against remote attackers too (some vulnerabilities may allow tricking a
browser to make a request to localhost). Use socketpair (which is immune
to such attacks) on all Unix platforms.

Patch by Demi Marie Obenour < demioben...@gmail.com >

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

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

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp?rev=314127=314126=314127=diff
==
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Mon Sep 
25 10:41:16 2017
@@ -3289,7 +3289,7 @@ ProcessGDBRemote::EstablishConnectionIfN
   }
   return error;
 }
-#if defined(__APPLE__)
+#if !defined(_WIN32)
 #define USE_SOCKETPAIR_FOR_LOCAL_CONNECTION 1
 #endif
 
@@ -,8 +,8 @@ Status ProcessGDBRemote::LaunchAndConnec
 lldb_utility::CleanUp our_socket(-1, -1, close);
 lldb_utility::CleanUp gdb_socket(-1, -1, close);
 
-// Use a socketpair on Apple for now until other platforms can verify it
-// works and is fast enough
+// Use a socketpair on non-Windows systems for security and performance
+// reasons.
 {
   int sockets[2]; /* the pair of socket descriptors */
   if (socketpair(AF_UNIX, SOCK_STREAM, 0, sockets) == -1) {

Modified: lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp?rev=314127=314126=314127=diff
==
--- lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp (original)
+++ lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp Mon Sep 25 10:41:16 2017
@@ -106,6 +106,7 @@ static struct option g_long_options[] =
// than llgs listening for a connection from address on port.
 {"setsid", no_argument, NULL,
  'S'}, // Call setsid() to make llgs run in its own session.
+{"fd", required_argument, NULL, 'F'},
 {NULL, 0, NULL, 0}};
 
 //--
@@ -132,13 +133,13 @@ static void display_usage(const char *pr
   "[--log-file log-file-name] "
   "[--log-channels log-channel-list] "
   "[--setsid] "
+  "[--fd file-descriptor]"
   "[--named-pipe named-pipe-path] "
   "[--native-regs] "
   "[--attach pid] "
   "[[HOST]:PORT] "
   "[-- PROGRAM ARG1 ARG2 ...]\n",
   progname, subcommand);
-  exit(0);
 }
 
 void handle_attach_to_pid(GDBRemoteCommunicationServerLLGS _server,
@@ -232,10 +233,34 @@ void ConnectToRemote(MainLoop ,
  GDBRemoteCommunicationServerLLGS _server,
  bool reverse_connect, const char *const host_and_port,
  const char *const progname, const char *const subcommand,
- const char *const named_pipe_path, int unnamed_pipe_fd) {
+ const char *const named_pipe_path, int unnamed_pipe_fd,
+ int connection_fd) {
   Status error;
 
-  if (host_and_port && host_and_port[0]) {
+  std::unique_ptr connection_up;
+  if (connection_fd != -1) {
+// Build the connection string.
+char connection_url[512];
+snprintf(connection_url, sizeof(connection_url), "fd://%d", connection_fd);
+
+// Create the connection.
+#if !defined LLDB_DISABLE_POSIX && !defined _WIN32
+::fcntl(connection_fd, F_SETFD, FD_CLOEXEC);
+#endif
+connection_up.reset(new ConnectionFileDescriptor);
+auto connection_result = connection_up->Connect(connection_url, );
+if (connection_result != eConnectionStatusSuccess) {
+  fprintf(stderr, "error: failed to connect to client at '%s' "
+  "(connection status: %d)",
+  connection_url, static_cast(connection_result));
+  exit(-1);
+}
+if (error.Fail()) {
+  fprintf(stderr, "error: failed to connect to client at '%s': %s",
+  connection_url, error.AsCString());
+  exit(-1);
+}
+  } else if (host_and_port && host_and_port[0]) {
 // Parse out host and port.
 std::string final_host_and_port;
 std::string connection_host;
@@ -255,7 +280,6 @@ void ConnectToRemote(MainLoop ,
   connection_portno = StringConvert::ToUInt32(connection_port.c_str(), 0);
 }
 
-std::unique_ptr 

[Lldb-commits] [lldb] r313726 - Signal polling is supported with pselect (re-land r313704 without a Windows breakage)

2017-09-20 Thread Eugene Zemtsov via lldb-commits
Author: eugene
Date: Tue Sep 19 23:56:46 2017
New Revision: 313726

URL: http://llvm.org/viewvc/llvm-project?rev=313726=rev
Log:
Signal polling is supported with pselect (re-land r313704 without a Windows 
breakage)

Older Android API levels don't have ppoll, but LLDB works just fine,
since on Android it always uses pselect anyway.

Modified:
lldb/trunk/include/lldb/Host/MainLoop.h
lldb/trunk/source/Host/common/MainLoop.cpp

Modified: lldb/trunk/include/lldb/Host/MainLoop.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/MainLoop.h?rev=313726=313725=313726=diff
==
--- lldb/trunk/include/lldb/Host/MainLoop.h (original)
+++ lldb/trunk/include/lldb/Host/MainLoop.h Tue Sep 19 23:56:46 2017
@@ -15,7 +15,11 @@
 #include "llvm/ADT/DenseMap.h"
 #include 
 
-#if !HAVE_PPOLL && !HAVE_SYS_EVENT_H
+#ifdef __ANDROID__
+#define FORCE_PSELECT
+#endif
+
+#if !HAVE_PPOLL && !HAVE_SYS_EVENT_H && !defined(FORCE_PSELECT)
 #define SIGNAL_POLLING_UNSUPPORTED 1
 #endif
 

Modified: lldb/trunk/source/Host/common/MainLoop.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/MainLoop.cpp?rev=313726=313725=313726=diff
==
--- lldb/trunk/source/Host/common/MainLoop.cpp (original)
+++ lldb/trunk/source/Host/common/MainLoop.cpp Tue Sep 19 23:56:46 2017
@@ -38,10 +38,6 @@
 #define POLL poll
 #endif
 
-#ifdef __ANDROID__
-#define FORCE_PSELECT
-#endif
-
 #if SIGNAL_POLLING_UNSUPPORTED
 #ifdef LLVM_ON_WIN32
 typedef int sigset_t;


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


[Lldb-commits] [lldb] r313707 - Rollback r313704 because of the Windows build break

2017-09-19 Thread Eugene Zemtsov via lldb-commits
Author: eugene
Date: Tue Sep 19 18:57:59 2017
New Revision: 313707

URL: http://llvm.org/viewvc/llvm-project?rev=313707=rev
Log:
Rollback r313704 because of the Windows build break

Modified:
lldb/trunk/include/lldb/Host/MainLoop.h
lldb/trunk/source/Host/common/MainLoop.cpp

Modified: lldb/trunk/include/lldb/Host/MainLoop.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/MainLoop.h?rev=313707=313706=313707=diff
==
--- lldb/trunk/include/lldb/Host/MainLoop.h (original)
+++ lldb/trunk/include/lldb/Host/MainLoop.h Tue Sep 19 18:57:59 2017
@@ -15,12 +15,7 @@
 #include "llvm/ADT/DenseMap.h"
 #include 
 
-#ifdef __ANDROID__
-#define FORCE_PSELECT
-#endif
-
-#if !defined(HAVE_PPOLL) && !defined(HAVE_SYS_EVENT_H) && \
-!defined(FORCE_PSELECT)
+#if !HAVE_PPOLL && !HAVE_SYS_EVENT_H
 #define SIGNAL_POLLING_UNSUPPORTED 1
 #endif
 

Modified: lldb/trunk/source/Host/common/MainLoop.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/MainLoop.cpp?rev=313707=313706=313707=diff
==
--- lldb/trunk/source/Host/common/MainLoop.cpp (original)
+++ lldb/trunk/source/Host/common/MainLoop.cpp Tue Sep 19 18:57:59 2017
@@ -38,6 +38,10 @@
 #define POLL poll
 #endif
 
+#ifdef __ANDROID__
+#define FORCE_PSELECT
+#endif
+
 #if SIGNAL_POLLING_UNSUPPORTED
 #ifdef LLVM_ON_WIN32
 typedef int sigset_t;


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


[Lldb-commits] [lldb] r313704 - Signal polling is supported with pselect

2017-09-19 Thread Eugene Zemtsov via lldb-commits
Author: eugene
Date: Tue Sep 19 17:39:04 2017
New Revision: 313704

URL: http://llvm.org/viewvc/llvm-project?rev=313704=rev
Log:
Signal polling is supported with pselect

Older Android API levels don't have ppoll, but LLDB works just fine,
since on Android it always uses pselect anyway.

Modified:
lldb/trunk/include/lldb/Host/MainLoop.h
lldb/trunk/source/Host/common/MainLoop.cpp

Modified: lldb/trunk/include/lldb/Host/MainLoop.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/MainLoop.h?rev=313704=313703=313704=diff
==
--- lldb/trunk/include/lldb/Host/MainLoop.h (original)
+++ lldb/trunk/include/lldb/Host/MainLoop.h Tue Sep 19 17:39:04 2017
@@ -15,7 +15,12 @@
 #include "llvm/ADT/DenseMap.h"
 #include 
 
-#if !HAVE_PPOLL && !HAVE_SYS_EVENT_H
+#ifdef __ANDROID__
+#define FORCE_PSELECT
+#endif
+
+#if !defined(HAVE_PPOLL) && !defined(HAVE_SYS_EVENT_H) && \
+!defined(FORCE_PSELECT)
 #define SIGNAL_POLLING_UNSUPPORTED 1
 #endif
 

Modified: lldb/trunk/source/Host/common/MainLoop.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/MainLoop.cpp?rev=313704=313703=313704=diff
==
--- lldb/trunk/source/Host/common/MainLoop.cpp (original)
+++ lldb/trunk/source/Host/common/MainLoop.cpp Tue Sep 19 17:39:04 2017
@@ -38,10 +38,6 @@
 #define POLL poll
 #endif
 
-#ifdef __ANDROID__
-#define FORCE_PSELECT
-#endif
-
 #if SIGNAL_POLLING_UNSUPPORTED
 #ifdef LLVM_ON_WIN32
 typedef int sigset_t;


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


Re: [Lldb-commits] [lldb] r313437 - Check availability of accept4 in C++ instad of C code.

2017-09-18 Thread Eugene Zemtsov via lldb-commits
In GNU C Library, accept4 is guarded by __USE_GNU macro. Whether this macro
is defined or not can depend on the compiler and its arguments for C and
C++.
LLDB uses accept4 in C++ code thus it makes sense to test availability of
this function in C++ mode.

On Mon, Sep 18, 2017 at 9:58 AM, Stephane Sezer <s...@cd80.net> wrote:

> What difference does this make?
>
> On Fri, Sep 15, 2017 at 8:00 PM Eugene Zemtsov via lldb-commits <
> lldb-commits@lists.llvm.org> wrote:
>
>> Author: eugene
>> Date: Fri Sep 15 19:58:49 2017
>> New Revision: 313437
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=313437=rev
>> Log:
>> Check availability of accept4 in C++ instad of C code.
>>
>> Modified:
>> lldb/trunk/cmake/modules/LLDBGenerateConfig.cmake
>>
>> Modified: lldb/trunk/cmake/modules/LLDBGenerateConfig.cmake
>> URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/
>> modules/LLDBGenerateConfig.cmake?rev=313437=313436=313437=diff
>> 
>> ==
>> --- lldb/trunk/cmake/modules/LLDBGenerateConfig.cmake (original)
>> +++ lldb/trunk/cmake/modules/LLDBGenerateConfig.cmake Fri Sep 15
>> 19:58:49 2017
>> @@ -9,7 +9,7 @@ set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SO
>>  check_symbol_exists(ppoll poll.h HAVE_PPOLL)
>>  set(CMAKE_REQUIRED_DEFINITIONS)
>>  check_symbol_exists(sigaction signal.h HAVE_SIGACTION)
>> -check_symbol_exists(accept4 "sys/socket.h" HAVE_ACCEPT4)
>> +check_cxx_symbol_exists(accept4 "sys/socket.h" HAVE_ACCEPT4)
>>
>>  check_include_file(termios.h HAVE_TERMIOS_H)
>>  check_include_files("sys/types.h;sys/event.h" HAVE_SYS_EVENT_H)
>>
>>
>> ___
>> lldb-commits mailing list
>> lldb-commits@lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
>>
> --
> --
> Stephane Sezer
>



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


[Lldb-commits] [lldb] r313437 - Check availability of accept4 in C++ instad of C code.

2017-09-15 Thread Eugene Zemtsov via lldb-commits
Author: eugene
Date: Fri Sep 15 19:58:49 2017
New Revision: 313437

URL: http://llvm.org/viewvc/llvm-project?rev=313437=rev
Log:
Check availability of accept4 in C++ instad of C code.

Modified:
lldb/trunk/cmake/modules/LLDBGenerateConfig.cmake

Modified: lldb/trunk/cmake/modules/LLDBGenerateConfig.cmake
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/LLDBGenerateConfig.cmake?rev=313437=313436=313437=diff
==
--- lldb/trunk/cmake/modules/LLDBGenerateConfig.cmake (original)
+++ lldb/trunk/cmake/modules/LLDBGenerateConfig.cmake Fri Sep 15 19:58:49 2017
@@ -9,7 +9,7 @@ set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SO
 check_symbol_exists(ppoll poll.h HAVE_PPOLL)
 set(CMAKE_REQUIRED_DEFINITIONS)
 check_symbol_exists(sigaction signal.h HAVE_SIGACTION)
-check_symbol_exists(accept4 "sys/socket.h" HAVE_ACCEPT4)
+check_cxx_symbol_exists(accept4 "sys/socket.h" HAVE_ACCEPT4)
 
 check_include_file(termios.h HAVE_TERMIOS_H)
 check_include_files("sys/types.h;sys/event.h" HAVE_SYS_EVENT_H)


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


[Lldb-commits] [lldb] r313436 - More precise c library feature detection for Android.

2017-09-15 Thread Eugene Zemtsov via lldb-commits
Author: eugene
Date: Fri Sep 15 19:19:21 2017
New Revision: 313436

URL: http://llvm.org/viewvc/llvm-project?rev=313436=rev
Log:
More precise c library feature detection for Android.

Modified:
lldb/trunk/cmake/modules/LLDBGenerateConfig.cmake
lldb/trunk/source/Host/common/Socket.cpp
lldb/trunk/source/Host/posix/ProcessLauncherPosixFork.cpp

Modified: lldb/trunk/cmake/modules/LLDBGenerateConfig.cmake
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/LLDBGenerateConfig.cmake?rev=313436=313435=313436=diff
==
--- lldb/trunk/cmake/modules/LLDBGenerateConfig.cmake (original)
+++ lldb/trunk/cmake/modules/LLDBGenerateConfig.cmake Fri Sep 15 19:19:21 2017
@@ -9,6 +9,7 @@ set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SO
 check_symbol_exists(ppoll poll.h HAVE_PPOLL)
 set(CMAKE_REQUIRED_DEFINITIONS)
 check_symbol_exists(sigaction signal.h HAVE_SIGACTION)
+check_symbol_exists(accept4 "sys/socket.h" HAVE_ACCEPT4)
 
 check_include_file(termios.h HAVE_TERMIOS_H)
 check_include_files("sys/types.h;sys/event.h" HAVE_SYS_EVENT_H)

Modified: lldb/trunk/source/Host/common/Socket.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Socket.cpp?rev=313436=313435=313436=diff
==
--- lldb/trunk/source/Host/common/Socket.cpp (original)
+++ lldb/trunk/source/Host/common/Socket.cpp Fri Sep 15 19:19:21 2017
@@ -450,7 +450,7 @@ NativeSocket Socket::AcceptSocket(Native
 close(fd);
   }
   return fd;
-#elif defined(SOCK_CLOEXEC)
+#elif defined(SOCK_CLOEXEC) && defined(HAVE_ACCEPT4)
   int flags = 0;
   if (!child_processes_inherit) {
 flags |= SOCK_CLOEXEC;

Modified: lldb/trunk/source/Host/posix/ProcessLauncherPosixFork.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/posix/ProcessLauncherPosixFork.cpp?rev=313436=313435=313436=diff
==
--- lldb/trunk/source/Host/posix/ProcessLauncherPosixFork.cpp (original)
+++ lldb/trunk/source/Host/posix/ProcessLauncherPosixFork.cpp Fri Sep 15 
19:19:21 2017
@@ -29,7 +29,7 @@
 #define PT_TRACE_ME PTRACE_TRACEME
 #endif
 
-#if defined(__ANDROID_API__) && __ANDROID_API__ < 21
+#if defined(__ANDROID_API__) && __ANDROID_API__ < 15
 #include 
 #elif defined(__linux__)
 #include 


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


[Lldb-commits] [lldb] r313113 - Fix test_attach_to_process_from_different_dir_by_id test on Windows

2017-09-12 Thread Eugene Zemtsov via lldb-commits
Author: eugene
Date: Tue Sep 12 19:44:24 2017
New Revision: 313113

URL: http://llvm.org/viewvc/llvm-project?rev=313113=rev
Log:
Fix test_attach_to_process_from_different_dir_by_id test on Windows

On Windows a process can't delete its own current direcotry, that's why the test
needs to return to the original direcotry before removing newdir.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_attach/TestProcessAttach.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_attach/TestProcessAttach.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_attach/TestProcessAttach.py?rev=313113=313112=313113=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_attach/TestProcessAttach.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_attach/TestProcessAttach.py
 Tue Sep 12 19:44:24 2017
@@ -46,15 +46,18 @@ class ProcessAttachTestCase(TestBase):
 except OSError, e:
 if e.errno != os.errno.EEXIST:
 raise
-
self.buildProgram('main.cpp',os.path.join(os.getcwd(),'newdir','proc_attach'))
-exe = os.path.join('.','newdir','proc_attach')
-self.addTearDownHook(lambda: shutil.rmtree(os.path.join(os.getcwd(
+testdir = os.getcwd()
+newdir = os.path.join(testdir,'newdir')
+exe = os.path.join(newdir, 'proc_attach')
+self.buildProgram('main.cpp', exe)
+self.addTearDownHook(lambda: shutil.rmtree(newdir))
 
 # Spawn a new process
 popen = self.spawnSubprocess(exe)
 self.addTearDownHook(self.cleanupSubprocesses)
 
 os.chdir('newdir')
+self.addTearDownHook(lambda: os.chdir(testdir))
 self.runCmd("process attach -p " + str(popen.pid))
 
 target = self.dbg.GetSelectedTarget()


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


[Lldb-commits] [lldb] r312151 - Now a ppc64le binary is correctly detected:

2017-08-30 Thread Eugene Zemtsov via lldb-commits
Author: eugene
Date: Wed Aug 30 11:36:48 2017
New Revision: 312151

URL: http://llvm.org/viewvc/llvm-project?rev=312151=rev
Log:
Now a ppc64le binary is correctly detected:

(lldb) target create "tst"
Current executable set to 'tst' (powerpc64le).
(lldb) disassemble -n main
tst`main:
tst[0x7b0] <+0>: addis 2, 12, 2
tst[0x7b4] <+4>: addi 2, 2, 30544
tst[0x7b8] <+8>: mflr 0

Wihout the patch, the endianess was incorrect:
(lldb) target create "tst"
Current executable set to 'tst' (powerpc64).
(lldb) disassemble -n main
tst`main:
tst[0x7b0] <+0>: .long 0x02004c3c ; unknown opcode
tst[0x7b4] <+4>: rlwimi 23, 3, 8, 8, 28
tst[0x7b8] <+8>: lhzu 16, 2172(2)
tst[0x7bc] <+12>: .long 0x11f8 ; unknown opcode

Simple binary used is identified as:
$ file tst
tst: ELF 64-bit LSB shared object, 64-bit PowerPC or cisco 7500, version
1 (SYSV), dynamically linked, interpreter /lib64/ld64.so.2, for
GNU/Linux 3.2.0, BuildID[sha1]=17a8fa2b24ce2837ba6625fabb34e6b29c6c5db7,
not stripped

Patch by Gustavo Serra Scalet 
Differential Revision: https://reviews.llvm.org/D36804

Modified:
lldb/trunk/include/lldb/Core/ArchSpec.h
lldb/trunk/source/Core/ArchSpec.cpp

Modified: lldb/trunk/include/lldb/Core/ArchSpec.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ArchSpec.h?rev=312151=312150=312151=diff
==
--- lldb/trunk/include/lldb/Core/ArchSpec.h (original)
+++ lldb/trunk/include/lldb/Core/ArchSpec.h Wed Aug 30 11:36:48 2017
@@ -177,6 +177,7 @@ public:
 eCore_ppc_ppc7450,
 eCore_ppc_ppc970,
 
+eCore_ppc64le_generic,
 eCore_ppc64_generic,
 eCore_ppc64_ppc970_64,
 

Modified: lldb/trunk/source/Core/ArchSpec.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ArchSpec.cpp?rev=312151=312150=312151=diff
==
--- lldb/trunk/source/Core/ArchSpec.cpp (original)
+++ lldb/trunk/source/Core/ArchSpec.cpp Wed Aug 30 11:36:48 2017
@@ -188,6 +188,8 @@ static const CoreDefinition g_core_defin
 {eByteOrderBig, 4, 4, 4, llvm::Triple::ppc, ArchSpec::eCore_ppc_ppc970,
  "ppc970"},
 
+{eByteOrderLittle, 8, 4, 4, llvm::Triple::ppc64le,
+  ArchSpec::eCore_ppc64le_generic, "powerpc64le"},
 {eByteOrderBig, 8, 4, 4, llvm::Triple::ppc64, 
ArchSpec::eCore_ppc64_generic,
  "powerpc64"},
 {eByteOrderBig, 8, 4, 4, llvm::Triple::ppc64,
@@ -414,6 +416,8 @@ static const ArchDefinitionEntry g_elf_a
  0xu, 0xu}, // Intel MCU // FIXME: is this correct?
 {ArchSpec::eCore_ppc_generic, llvm::ELF::EM_PPC, LLDB_INVALID_CPUTYPE,
  0xu, 0xu}, // PowerPC
+{ArchSpec::eCore_ppc64le_generic, llvm::ELF::EM_PPC64, 
LLDB_INVALID_CPUTYPE,
+ 0xu, 0xu}, // PowerPC64le
 {ArchSpec::eCore_ppc64_generic, llvm::ELF::EM_PPC64, LLDB_INVALID_CPUTYPE,
  0xu, 0xu}, // PowerPC64
 {ArchSpec::eCore_arm_generic, llvm::ELF::EM_ARM, LLDB_INVALID_CPUTYPE,


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


[Lldb-commits] [lldb] r309648 - Fix incorrect use of std::unique

2017-07-31 Thread Eugene Zemtsov via lldb-commits
Author: eugene
Date: Mon Jul 31 18:29:55 2017
New Revision: 309648

URL: http://llvm.org/viewvc/llvm-project?rev=309648=rev
Log:
Fix incorrect use of std::unique

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

Modified: lldb/trunk/source/Symbol/Symtab.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Symtab.cpp?rev=309648=309647=309648=diff
==
--- lldb/trunk/source/Symbol/Symtab.cpp (original)
+++ lldb/trunk/source/Symbol/Symtab.cpp Mon Jul 31 18:29:55 2017
@@ -616,8 +616,10 @@ void Symtab::SortSymbolIndexesByValue(st
   std::stable_sort(indexes.begin(), indexes.end(), comparator);
 
   // Remove any duplicates if requested
-  if (remove_duplicates)
-std::unique(indexes.begin(), indexes.end());
+  if (remove_duplicates) {
+auto last = std::unique(indexes.begin(), indexes.end());
+indexes.erase(last, indexes.end());
+  }
 }
 
 uint32_t Symtab::AppendSymbolIndexesWithName(const ConstString _name,


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


[Lldb-commits] [lldb] r308933 - Extend 'target symbols add' to load symbols from a given module

2017-07-24 Thread Eugene Zemtsov via lldb-commits
Author: eugene
Date: Mon Jul 24 15:52:39 2017
New Revision: 308933

URL: http://llvm.org/viewvc/llvm-project?rev=308933=rev
Log:
Extend 'target symbols add' to load symbols from a given module

Now -shlib flag can be provided alongside with names of symbols files:

(lldb) target symbols add --shlib stripper-lib.so unstripper-lib.so

This is helpful when default matching mechanisms by name and UUID
can't find a module, and the user needs to explicitly specify
which module the given symbol file belongs to.

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

Added:
lldb/trunk/packages/Python/lldbsuite/test/linux/add-symbols/
lldb/trunk/packages/Python/lldbsuite/test/linux/add-symbols/Makefile

lldb/trunk/packages/Python/lldbsuite/test/linux/add-symbols/TestTargetSymbolsAddCommand.py
lldb/trunk/packages/Python/lldbsuite/test/linux/add-symbols/main.c
Modified:
lldb/trunk/source/Commands/CommandObjectTarget.cpp
lldb/trunk/source/Interpreter/CommandObject.cpp

Added: lldb/trunk/packages/Python/lldbsuite/test/linux/add-symbols/Makefile
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/linux/add-symbols/Makefile?rev=308933=auto
==
--- lldb/trunk/packages/Python/lldbsuite/test/linux/add-symbols/Makefile (added)
+++ lldb/trunk/packages/Python/lldbsuite/test/linux/add-symbols/Makefile Mon 
Jul 24 15:52:39 2017
@@ -0,0 +1,12 @@
+LEVEL = ../../make
+CXX_SOURCES := main.cpp
+LD_EXTRAS += -Wl,--build-id=none
+
+localall : stripped.out all
+stripped.out : a.out
+  $(OBJCOPY) 
--remove-section=.note.gnu.build-id --remove-section=.gnu_debuglink 
--strip-debug a.out stripped.out
+
+clean::
+   $(RM) stripped.out
+
+include $(LEVEL)/Makefile.rules
\ No newline at end of file

Added: 
lldb/trunk/packages/Python/lldbsuite/test/linux/add-symbols/TestTargetSymbolsAddCommand.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/linux/add-symbols/TestTargetSymbolsAddCommand.py?rev=308933=auto
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/linux/add-symbols/TestTargetSymbolsAddCommand.py
 (added)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/linux/add-symbols/TestTargetSymbolsAddCommand.py
 Mon Jul 24 15:52:39 2017
@@ -0,0 +1,52 @@
+""" Testing explicit symbol loading via target symbols add. """
+import os
+import time
+import lldb
+import sys
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class TargetSymbolsAddCommand(TestBase):
+
+mydir = TestBase.compute_mydir(__file__)
+
+def setUp(self):
+TestBase.setUp(self)
+self.source = 'main.c'
+
+@no_debug_info_test  # Prevent the genaration of the dwarf version of this 
test
+@skipUnlessPlatform(['linux'])
+def test_target_symbols_add(self):
+"""Test that 'target symbols add' can load the symbols
+even if gnu.build-id and gnu_debuglink are not present in the module.
+Similar to test_add_dsym_mid_execution test for macos."""
+self.build(clean=True)
+exe = os.path.join(os.getcwd(), "stripped.out")
+
+self.target = self.dbg.CreateTarget(exe)
+self.assertTrue(self.target, VALID_TARGET)
+
+main_bp = self.target.BreakpointCreateByName("main", "stripped.out")
+self.assertTrue(main_bp, VALID_BREAKPOINT)
+
+self.process = self.target.LaunchSimple(
+None, None, self.get_process_working_directory())
+self.assertTrue(self.process, PROCESS_IS_VALID)
+
+# The stop reason of the thread should be breakpoint.
+self.assertTrue(self.process.GetState() == lldb.eStateStopped,
+STOPPED_DUE_TO_BREAKPOINT)
+
+exe_module = self.target.GetModuleAtIndex(0)
+
+# Check that symbols are not loaded and main.c is not know to be
+# the source file.
+self.expect("frame select", substrs=['main.c'], matching=False)
+
+# Tell LLDB that a.out has symbols for stripped.out
+self.runCmd("target symbols add -s stripped.out a.out")
+
+# Check that symbols are now loaded and main.c is in the output.
+self.expect("frame select", substrs=['main.c'])

Added: lldb/trunk/packages/Python/lldbsuite/test/linux/add-symbols/main.c
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/linux/add-symbols/main.c?rev=308933=auto
==
--- lldb/trunk/packages/Python/lldbsuite/test/linux/add-symbols/main.c (added)
+++ lldb/trunk/packages/Python/lldbsuite/test/linux/add-symbols/main.c Mon Jul 
24 15:52:39 2017
@@ -0,0 +1,6 @@
+#include 
+static int var = 5;
+int main() {
+  printf("%p is %d\n", , var);
+  return ++var;
+}


[Lldb-commits] [lldb] r308219 - Fixing LLDB build after refactoring of clang's MacroInfo

2017-07-17 Thread Eugene Zemtsov via lldb-commits
Author: eugene
Date: Mon Jul 17 13:50:21 2017
New Revision: 308219

URL: http://llvm.org/viewvc/llvm-project?rev=308219=rev
Log:
Fixing LLDB build after refactoring of clang's MacroInfo

Modified:
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp

Modified: 
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp?rev=308219=308218=308219=diff
==
--- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp 
(original)
+++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp 
Mon Jul 17 13:50:21 2017
@@ -451,16 +451,16 @@ void ClangModulesDeclVendorImpl::ForEach
 
   bool first_arg = true;
 
-  for (clang::MacroInfo::arg_iterator ai = macro_info->arg_begin(),
-  ae = macro_info->arg_end();
-   ai != ae; ++ai) {
+  for (auto pi = macro_info->param_begin(),
+pe = macro_info->param_end();
+   pi != pe; ++pi) {
 if (!first_arg) {
   macro_expansion.append(", ");
 } else {
   first_arg = false;
 }
 
-macro_expansion.append((*ai)->getName().str());
+macro_expansion.append((*pi)->getName().str());
   }
 
   if (macro_info->isC99Varargs()) {


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


Re: [Lldb-commits] [PATCH] D32434: ObjectFileELF: Fix symbol lookup in bss section

2017-04-24 Thread Eugene Zemtsov via lldb-commits
Microsoft Visual C++ first comes to my mind.

On Mon, Apr 24, 2017 at 2:31 PM, Zachary Turner  wrote:

> Which C compilers do we have that are not capable of producing ELF
> binaries?   GCC on Windows maybe?  That's not even a supported test
> configuration.
>
> On Mon, Apr 24, 2017 at 2:29 PM Pavel Labath via Phabricator <
> revi...@reviews.llvm.org> wrote:
>
>> labath added a comment.
>>
>> In https://reviews.llvm.org/D32434#735877, @eugene wrote:
>>
>> > Is it  really necessary to check in binary ELF files?
>> >  I understand that we don't always have a C compiler capable of
>> producing ELF files, but maybe it's ok to skip this test on those platforms.
>>
>>
>> That is something very I am very much trying to avoid, as that means
>> people on those platforms cannot validate their changes. (And I'm not sure
>> if I even want to be running a compiler for a test at this level, as that
>> introduces a level of nondeterminism.)
>>
>> That said, I do agree we should be carefully about adding lots of binary
>> bloat. I have been trying to put this off until we have more of these, but
>> maybe I could try integrating this with obj2yaml -- it does not seem to
>> preserve program headers, but I don't actually need those for this test.
>>
>>
>> https://reviews.llvm.org/D32434
>>
>>
>>
>>


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


Re: [Lldb-commits] [PATCH] D31451: New C++ function name parsing logic

2017-04-06 Thread Eugene Zemtsov via lldb-commits
Thanks for vigilance. I added a couple more tests in r299729.

On Thu, Apr 6, 2017 at 4:06 PM, Jim Ingham via Phabricator <
revi...@reviews.llvm.org> wrote:

> jingham added a comment.
>
> I'm sorry, I don't have time actually review the code here for
> correctness...  But can you make sure that this also rejects a two or three
> field selector, not just "selector:" but "selector:otherField:"?  That
> seems sufficiently different that you might get the one : but not the two :
> form right.  You could test 3 & more colons, but at that point it's
> probably overkill.
>
>
> Repository:
>   rL LLVM
>
> https://reviews.llvm.org/D31451
>
>
>
>


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


[Lldb-commits] [lldb] r299729 - Add more tests for ExtractContextAndIdentifier

2017-04-06 Thread Eugene Zemtsov via lldb-commits
Author: eugene
Date: Thu Apr  6 18:12:43 2017
New Revision: 299729

URL: http://llvm.org/viewvc/llvm-project?rev=299729=rev
Log:
Add more tests for ExtractContextAndIdentifier

Modified:
lldb/trunk/unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp

Modified: lldb/trunk/unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp?rev=299729=299728=299729=diff
==
--- lldb/trunk/unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp (original)
+++ lldb/trunk/unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp Thu Apr  
6 18:12:43 2017
@@ -124,6 +124,7 @@ TEST(CPlusPlusLanguage, ExtractContextAn
 
   TestCase test_cases[] = {
   {"main", "", "main"},
+  {"main ", "", "main"},
   {"foo01::bar", "foo01", "bar"},
   {"foo::~bar", "foo", "~bar"},
   {"std::vector::push_back", "std::vector", "push_back"},
@@ -150,4 +151,8 @@ TEST(CPlusPlusLanguage, ExtractContextAn
   CPlusPlusLanguage::ExtractContextAndIdentifier("", context, basename));
   EXPECT_FALSE(CPlusPlusLanguage::ExtractContextAndIdentifier(
   "selector:", context, basename));
+  EXPECT_FALSE(CPlusPlusLanguage::ExtractContextAndIdentifier(
+  "selector:otherField:", context, basename));
+  EXPECT_FALSE(CPlusPlusLanguage::ExtractContextAndIdentifier(
+  "abc::", context, basename));
 }


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


[Lldb-commits] [lldb] r299721 - New C++ function name parsing logic (Resubmit)

2017-04-06 Thread Eugene Zemtsov via lldb-commits
Author: eugene
Date: Thu Apr  6 17:36:02 2017
New Revision: 299721

URL: http://llvm.org/viewvc/llvm-project?rev=299721=rev
Log:
New C++ function name parsing logic (Resubmit)

Current implementation of CPlusPlusLanguage::MethodName::Parse() doesn't
get anywhere close to covering full extent of possible function declarations.
It causes incorrect behavior in avoid-stepping and sometimes messes
printing of thread backtrace.

This change implements more methodical parsing logic based on clang
lexer and simple recursive parser.

Examples:
void std::vector::_M_emplace_back_aux(Class const&)
void (*::_Any_data::_M_access())()

Previous version of this change (D31451) was rolled back due to an issue
with Objective-C selectors being incorrectly recognized as a C++ identifier.

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

Added:
lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.cpp
lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.h
Modified:
lldb/trunk/lldb.xcodeproj/project.pbxproj
lldb/trunk/source/Plugins/Language/CPlusPlus/CMakeLists.txt
lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.h
lldb/trunk/unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=299721=299720=299721=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Thu Apr  6 17:36:02 2017
@@ -712,6 +712,7 @@
49DCF702170E70120092F75E /* Materializer.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 49DCF700170E70120092F75E /* Materializer.cpp */; 
};
49DEF1251CD7C6DF006A7C7D /* BlockPointer.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 49DEF11F1CD7BD90006A7C7D /* BlockPointer.cpp */; 
};
49E4F66B1C9CAD16008487EA /* DiagnosticManager.cpp in Sources */ 
= {isa = PBXBuildFile; fileRef = 49E4F6681C9CAD12008487EA /* 
DiagnosticManager.cpp */; };
+   49F811F31E931B2100F4E163 /* CPlusPlusNameParser.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = 49F811EF1E931B1500F4E163 /* 
CPlusPlusNameParser.cpp */; };
4C0083401B9F9BA900D5CF24 /* UtilityFunction.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 4C00833F1B9F9BA900D5CF24 /* UtilityFunction.cpp 
*/; };
4C2479BD1BA39295009C9A7B /* FunctionCaller.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 4C0083321B9A5DE200D5CF24 /* FunctionCaller.cpp 
*/; };
4C3ADCD61810D88B00357218 /* BreakpointResolverFileRegex.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = 4CAA56141422D986001FFA01 /* 
BreakpointResolverFileRegex.cpp */; };
@@ -2474,6 +2475,8 @@
49EC3E9C118F90D400B1265E /* ThreadPlanCallFunction.h */ = {isa 
= PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name 
= ThreadPlanCallFunction.h; path = 
include/lldb/Target/ThreadPlanCallFunction.h; sourceTree = ""; };
49F1A74511B3388F003ED505 /* ClangExpressionDeclMap.cpp */ = 
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = 
sourcecode.cpp.cpp; name = ClangExpressionDeclMap.cpp; path = 
ExpressionParser/Clang/ClangExpressionDeclMap.cpp; sourceTree = ""; };
49F1A74911B338AE003ED505 /* ClangExpressionDeclMap.h */ = {isa 
= PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name 
= ClangExpressionDeclMap.h; path = 
ExpressionParser/Clang/ClangExpressionDeclMap.h; sourceTree = ""; };
+   49F811EF1E931B1500F4E163 /* CPlusPlusNameParser.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = CPlusPlusNameParser.cpp; path = 
Language/CPlusPlus/CPlusPlusNameParser.cpp; sourceTree = ""; };
+   49F811F01E931B1500F4E163 /* CPlusPlusNameParser.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = 
CPlusPlusNameParser.h; path = Language/CPlusPlus/CPlusPlusNameParser.h; 
sourceTree = ""; };
4C00832C1B9A58A700D5CF24 /* Expression.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = 
Expression.h; path = include/lldb/Expression/Expression.h; sourceTree = 
""; };
4C00832D1B9A58A700D5CF24 /* FunctionCaller.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = 
FunctionCaller.h; path = include/lldb/Expression/FunctionCaller.h; sourceTree = 
""; };
4C00832E1B9A58A700D5CF24 /* UserExpression.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = 
UserExpression.h; path = include/lldb/Expression/UserExpression.h; sourceTree = 
""; };
@@ -6108,6 

Re: [Lldb-commits] [PATCH] D31451: New C++ function name parsing logic

2017-04-04 Thread Eugene Zemtsov via lldb-commits
Sorry about that and thanks for rolling it back. I'll take a look tomorrow.

On Tue, Apr 4, 2017 at 5:22 PM, Jim Ingham  wrote:

> This patch is causing a testsuite failure in ObjC breakpoint setting:
>
> functionalities/breakpoint/objc/TestObjCBreakpoints.py
>
> You must be grabbing ObjC names and somehow treating them as C++ names.
>
> I reverted the patch till the test gets fixed.  If you can't get your
> hands on
> an ObjC binary to test I can send you one.  You don't need to run code,
> you just
> need to load a binary, which you should be able to do on any lldb host.
>
> Jim
>
>
> > On Apr 3, 2017, at 12:12 PM, Eugene Zemtsov via Phabricator <
> revi...@reviews.llvm.org> wrote:
> >
> > This revision was automatically updated to reflect the committed changes.
> > Closed by commit rL299374: New C++ function name parsing logic (authored
> by eugene).
> >
> > Changed prior to commit:
> >  https://reviews.llvm.org/D31451?vs=93694=93910#toc
> >
> > Repository:
> >  rL LLVM
> >
> > https://reviews.llvm.org/D31451
> >
> > Files:
> >  lldb/trunk/source/Plugins/Language/CPlusPlus/CMakeLists.txt
> >  lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
> >  lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.h
> >  lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.cpp
> >  lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.h
> >  lldb/trunk/unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp
> >
> > 
>
>


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


[Lldb-commits] [lldb] r299374 - New C++ function name parsing logic

2017-04-03 Thread Eugene Zemtsov via lldb-commits
Author: eugene
Date: Mon Apr  3 13:59:34 2017
New Revision: 299374

URL: http://llvm.org/viewvc/llvm-project?rev=299374=rev
Log:
New C++ function name parsing logic

Current implementation of CPlusPlusLanguage::MethodName::Parse() doesn't
get anywhere close to covering full extent of possible function declarations.
It causes incorrect behavior in avoid-stepping and sometimes messes
printing of thread backtrace.

This change implements more methodical parsing logic based on clang
lexer and simple recursive parser.

Examples:
void std::vector::_M_emplace_back_aux(Class const&)
void (*::_Any_data::_M_access())()

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

Added:
lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.cpp
lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.h
Modified:
lldb/trunk/source/Plugins/Language/CPlusPlus/CMakeLists.txt
lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.h
lldb/trunk/unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp

Modified: lldb/trunk/source/Plugins/Language/CPlusPlus/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/CPlusPlus/CMakeLists.txt?rev=299374=299373=299374=diff
==
--- lldb/trunk/source/Plugins/Language/CPlusPlus/CMakeLists.txt (original)
+++ lldb/trunk/source/Plugins/Language/CPlusPlus/CMakeLists.txt Mon Apr  3 
13:59:34 2017
@@ -1,6 +1,7 @@
 add_lldb_library(lldbPluginCPlusPlusLanguage PLUGIN
   BlockPointer.cpp
   CPlusPlusLanguage.cpp
+  CPlusPlusNameParser.cpp
   CxxStringTypes.cpp
   LibCxx.cpp
   LibCxxAtomic.cpp

Modified: lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp?rev=299374=299373=299374=diff
==
--- lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp 
(original)
+++ lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp Mon Apr  
3 13:59:34 2017
@@ -21,7 +21,6 @@
 
 // Other libraries and framework includes
 #include "llvm/ADT/StringRef.h"
-#include "llvm/Support/Threading.h"
 
 // Project includes
 #include "lldb/Core/PluginManager.h"
@@ -36,6 +35,7 @@
 #include "lldb/Utility/RegularExpression.h"
 
 #include "BlockPointer.h"
+#include "CPlusPlusNameParser.h"
 #include "CxxStringTypes.h"
 #include "LibCxx.h"
 #include "LibCxxAtomic.h"
@@ -85,15 +85,14 @@ void CPlusPlusLanguage::MethodName::Clea
   m_context = llvm::StringRef();
   m_arguments = llvm::StringRef();
   m_qualifiers = llvm::StringRef();
-  m_type = eTypeInvalid;
   m_parsed = false;
   m_parse_error = false;
 }
 
-bool ReverseFindMatchingChars(const llvm::StringRef ,
-  const llvm::StringRef _right_chars,
-  size_t _pos, size_t _pos,
-  size_t pos = llvm::StringRef::npos) {
+static bool ReverseFindMatchingChars(const llvm::StringRef ,
+ const llvm::StringRef _right_chars,
+ size_t _pos, size_t _pos,
+ size_t pos = llvm::StringRef::npos) {
   assert(left_right_chars.size() == 2);
   left_pos = llvm::StringRef::npos;
   const char left_char = left_right_chars[0];
@@ -119,10 +118,9 @@ bool ReverseFindMatchingChars(const llvm
   return false;
 }
 
-static bool IsValidBasename(const llvm::StringRef ) {
-  // Check that the basename matches with the following regular expression or 
is
-  // an operator name:
-  // "^~?([A-Za-z_][A-Za-z_0-9]*)(<.*>)?$"
+static bool IsTrivialBasename(const llvm::StringRef ) {
+  // Check that the basename matches with the following regular expression
+  // "^~?([A-Za-z_][A-Za-z_0-9]*)$"
   // We are using a hand written implementation because it is significantly 
more
   // efficient then
   // using the general purpose regular expression library.
@@ -149,100 +147,69 @@ static bool IsValidBasename(const llvm::
   if (idx == basename.size())
 return true;
 
-  // Check for basename with template arguments
-  // TODO: Improve the quality of the validation with validating the template
-  // arguments
-  if (basename[idx] == '<' && basename.back() == '>')
-return true;
+  return false;
+}
 
-  // Check if the basename is a vaild C++ operator name
-  if (!basename.startswith("operator"))
-return false;
+bool CPlusPlusLanguage::MethodName::TrySimplifiedParse() {
+  // This method tries to parse simple method definitions
+  // which are presumably most comman in user programs.
+  // Definitions that can be parsed by this function don't have return types
+  // and templates in the name.
+  // A::B::C::fun(std::vector &) const
+  size_t arg_start, arg_end;
+  

[Lldb-commits] [lldb] r297231 - Make LLDB skip server-client roundtrip for signals that don't require any actions

2017-03-07 Thread Eugene Zemtsov via lldb-commits
Author: eugene
Date: Tue Mar  7 15:34:40 2017
New Revision: 297231

URL: http://llvm.org/viewvc/llvm-project?rev=297231=rev
Log:
Make LLDB skip server-client roundtrip for signals that don't require any 
actions

If QPassSignals packaet is supported by lldb-server, lldb-client will
utilize it and ask the server to ignore signals that don't require stops
or notifications.
Such signals will be immediately re-injected into inferior to continue
normal execution.

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

Added:
lldb/trunk/unittests/Signals/
lldb/trunk/unittests/Signals/CMakeLists.txt
lldb/trunk/unittests/Signals/UnixSignalsTest.cpp
Modified:
lldb/trunk/include/lldb/Target/Process.h
lldb/trunk/include/lldb/Target/UnixSignals.h

lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
lldb/trunk/source/Target/Process.cpp
lldb/trunk/source/Target/UnixSignals.cpp
lldb/trunk/unittests/CMakeLists.txt
lldb/trunk/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp

Modified: lldb/trunk/include/lldb/Target/Process.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Process.h?rev=297231=297230=297231=diff
==
--- lldb/trunk/include/lldb/Target/Process.h (original)
+++ lldb/trunk/include/lldb/Target/Process.h Tue Mar  7 15:34:40 2017
@@ -2607,7 +2607,7 @@ public:
   bool RunPreResumeActions();
 
   void ClearPreResumeActions();
-  
+
   void ClearPreResumeAction(PreResumeActionCallback callback, void *baton);
 
   ProcessRunLock ();
@@ -3145,6 +3145,8 @@ protected:
 
   Error StopForDestroyOrDetach(lldb::EventSP _event_sp);
 
+  virtual Error UpdateAutomaticSignalFiltering();
+
   bool StateChangedIsExternallyHijacked();
 
   void LoadOperatingSystemPlugin(bool flush);

Modified: lldb/trunk/include/lldb/Target/UnixSignals.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/UnixSignals.h?rev=297231=297230=297231=diff
==
--- lldb/trunk/include/lldb/Target/UnixSignals.h (original)
+++ lldb/trunk/include/lldb/Target/UnixSignals.h Tue Mar  7 15:34:40 2017
@@ -14,11 +14,13 @@
 // C++ Includes
 #include 
 #include 
+#include 
 
 // Other libraries and framework includes
 // Project includes
 #include "lldb/Utility/ConstString.h"
 #include "lldb/lldb-private.h"
+#include "llvm/ADT/Optional.h"
 
 namespace lldb_private {
 
@@ -88,6 +90,19 @@ public:
 
   void RemoveSignal(int signo);
 
+  // Returns a current version of the data stored in this class.
+  // Version gets incremented each time Set... method is called.
+  uint64_t GetVersion() const;
+
+  // Returns a vector of signals that meet criteria provided in arguments.
+  // Each should_[suppress|stop|notify] flag can be
+  // None  - no filtering by this flag
+  // true  - only signals that have it set to true are returned
+  // false - only signals that have it set to true are returned
+  std::vector GetFilteredSignals(llvm::Optional should_suppress,
+  llvm::Optional should_stop,
+  llvm::Optional should_notify);
+
 protected:
   //--
   // Classes that inherit from UnixSignals can see and modify these
@@ -111,6 +126,12 @@ protected:
 
   collection m_signals;
 
+  // This version gets incremented every time something is changing in
+  // this class, including when we call AddSignal from the constructor.
+  // So after the object is constructed m_version is going to be > 0
+  // if it has at least one signal registered in it.
+  uint64_t m_version = 0;
+
   // GDBRemote signals need to be copyable.
   UnixSignals(const UnixSignals );
 

Modified: 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp?rev=297231=297230=297231=diff
==
--- 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp 
(original)
+++ 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp 
Tue Mar  7 15:34:40 2017
@@ -87,6 +87,7 @@ GDBRemoteCommunicationClient::GDBRemoteC
   m_supports_jThreadExtendedInfo(eLazyBoolCalculate),
   m_supports_jLoadedDynamicLibrariesInfos(eLazyBoolCalculate),
   m_supports_jGetSharedCacheInfo(eLazyBoolCalculate),
+  m_supports_QPassSignals(eLazyBoolCalculate),
   m_supports_qProcessInfoPID(true), m_supports_qfProcessInfo(true),
   

Re: [Lldb-commits] [PATCH] D30520: Make LLDB skip server-client roundtrip for signals that don't require any actions

2017-03-06 Thread Eugene Zemtsov via lldb-commits
UnixSignals::NeedsUpdating() method suggests that there is always at most
one observer of changes in UnixSignals, the guys who clear the flag. Even
though it might be the case now, it still feels like a bomb waiting to
explode when another observer starts calling UnixSignals::ResetNeedsUpdating().
I wouldn't want to introduce this limitation unless I absolutely have to.

On Mon, Mar 6, 2017 at 5:09 PM, Jim Ingham  wrote:

> I like it in the base class and Greg was okay with that too.  So let's
> leave that where it is.
>
> The only bit of this behavior that could be moved into UnixSignals as it
> seemed to me was the handling of "needs updating".  I was mostly proposing
> that because then you can already pass the UnixSignals into the
> communication client to test that the signals get suppressed, so if the
> "needs updating" was in UnixSignals you could test this part in the same
> way.
>
> So I'm not pushing hard on this change.
>
> Jim
>
>
> > On Mar 6, 2017, at 5:09 PM, Eugene Zemtsov via Phabricator <
> revi...@reviews.llvm.org> wrote:
> >
> > eugene added a comment.
> >
> > UnixSignals is a nice self contained class that already does 99% of the
> work (see UnixSignals::GetFilteredSignals). I don't think we should have
> it call anybody.
> > Only process knows when it is the right time to send actual QPassSignals
> packet, there is not need to somehow push this knowledge into UnixSignals.
> >
> > Let's just decide if UpdateAutomaticSignalFiltering() is specific
> enough to live in GDBProcess or it's generic enough to live in the base
> process. I'm fine either way.
> >
> >
> > https://reviews.llvm.org/D30520
> >
> >
> >
>
>


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


[Lldb-commits] [lldb] r296427 - Add a comment to describe purpose of signal-filtering test

2017-02-27 Thread Eugene Zemtsov via lldb-commits
Author: eugene
Date: Mon Feb 27 20:40:34 2017
New Revision: 296427

URL: http://llvm.org/viewvc/llvm-project?rev=296427=rev
Log:
Add a comment to describe purpose of signal-filtering test

Modified:

lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/signal-filtering/TestGdbRemote_QPassSignals.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/signal-filtering/TestGdbRemote_QPassSignals.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/signal-filtering/TestGdbRemote_QPassSignals.py?rev=296427=296426=296427=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/signal-filtering/TestGdbRemote_QPassSignals.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/signal-filtering/TestGdbRemote_QPassSignals.py
 Mon Feb 27 20:40:34 2017
@@ -1,3 +1,5 @@
+# This test makes sure that lldb-server supports and properly handles
+# QPassSignals GDB protocol package.
 from __future__ import print_function
 
 import gdbremote_testcase


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