diff options
Diffstat (limited to 'packages/Python/lldbsuite/test/python_api/watchpoint')
6 files changed, 176 insertions, 93 deletions
diff --git a/packages/Python/lldbsuite/test/python_api/watchpoint/TestSetWatchpoint.py b/packages/Python/lldbsuite/test/python_api/watchpoint/TestSetWatchpoint.py index bedf286e199b..e4f2c5c7a182 100644 --- a/packages/Python/lldbsuite/test/python_api/watchpoint/TestSetWatchpoint.py +++ b/packages/Python/lldbsuite/test/python_api/watchpoint/TestSetWatchpoint.py @@ -5,14 +5,15 @@ Use lldb Python SBValue API to create a watchpoint for read_write of 'globl' var from __future__ import print_function - -import os, time +import os +import time import re import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil + class SetWatchpointAPITestCase(TestBase): mydir = TestBase.compute_mydir(__file__) @@ -23,12 +24,17 @@ class SetWatchpointAPITestCase(TestBase): # Our simple source filename. self.source = 'main.c' # Find the line number to break inside main(). - self.line = line_number(self.source, '// Set break point at this line.') + self.line = line_number( + self.source, '// Set break point at this line.') @add_test_categories(['pyapi']) - @expectedFailureAndroid(archs=['arm', 'aarch64']) # Watchpoints not supported - @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows") - @expectedFailureAll(archs=['s390x']) # Read-write watchpoints not supported on SystemZ + # Watchpoints not supported + @expectedFailureAndroid(archs=['arm', 'aarch64']) + @expectedFailureAll( + oslist=["windows"], + bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows") + # Read-write watchpoints not supported on SystemZ + @expectedFailureAll(archs=['s390x']) def test_watch_val(self): """Exercise SBValue.Watch() API to set a watchpoint.""" self.build() @@ -45,18 +51,20 @@ class SetWatchpointAPITestCase(TestBase): VALID_BREAKPOINT) # Now launch the process, and do not stop at the entry point. - process = target.LaunchSimple (None, None, self.get_process_working_directory()) + process = target.LaunchSimple( + None, None, self.get_process_working_directory()) # We should be stopped due to the breakpoint. Get frame #0. process = target.GetProcess() self.assertTrue(process.GetState() == lldb.eStateStopped, PROCESS_STOPPED) - thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint) + thread = lldbutil.get_stopped_thread( + process, lldb.eStopReasonBreakpoint) frame0 = thread.GetFrameAtIndex(0) # Watch 'global' for read and write. value = frame0.FindValue('global', lldb.eValueTypeVariableGlobal) - error = lldb.SBError(); + error = lldb.SBError() watchpoint = value.Watch(True, True, True, error) self.assertTrue(value and watchpoint, "Successfully found the variable and set a watchpoint") @@ -68,28 +76,35 @@ class SetWatchpointAPITestCase(TestBase): print(watchpoint) - # Continue. Expect the program to stop due to the variable being written to. + # Continue. Expect the program to stop due to the variable being + # written to. process.Continue() if (self.TraceOn()): lldbutil.print_stacktraces(process) - thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonWatchpoint) + thread = lldbutil.get_stopped_thread( + process, lldb.eStopReasonWatchpoint) self.assertTrue(thread, "The thread stopped due to watchpoint") self.DebugSBValue(value) - # Continue. Expect the program to stop due to the variable being read from. + # Continue. Expect the program to stop due to the variable being read + # from. process.Continue() if (self.TraceOn()): lldbutil.print_stacktraces(process) - thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonWatchpoint) + thread = lldbutil.get_stopped_thread( + process, lldb.eStopReasonWatchpoint) self.assertTrue(thread, "The thread stopped due to watchpoint") self.DebugSBValue(value) - # Continue the process. We don't expect the program to be stopped again. + # Continue the process. We don't expect the program to be stopped + # again. process.Continue() # At this point, the inferior process should have exited. - self.assertTrue(process.GetState() == lldb.eStateExited, PROCESS_EXITED) + self.assertTrue( + process.GetState() == lldb.eStateExited, + PROCESS_EXITED) diff --git a/packages/Python/lldbsuite/test/python_api/watchpoint/TestWatchpointIgnoreCount.py b/packages/Python/lldbsuite/test/python_api/watchpoint/TestWatchpointIgnoreCount.py index d7b45a533e39..1bef9968b4ab 100644 --- a/packages/Python/lldbsuite/test/python_api/watchpoint/TestWatchpointIgnoreCount.py +++ b/packages/Python/lldbsuite/test/python_api/watchpoint/TestWatchpointIgnoreCount.py @@ -5,14 +5,15 @@ Use lldb Python SBWatchpoint API to set the ignore count. from __future__ import print_function - -import os, time +import os +import time import re import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil + class WatchpointIgnoreCountTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) @@ -23,12 +24,17 @@ class WatchpointIgnoreCountTestCase(TestBase): # Our simple source filename. self.source = 'main.c' # Find the line number to break inside main(). - self.line = line_number(self.source, '// Set break point at this line.') + self.line = line_number( + self.source, '// Set break point at this line.') @add_test_categories(['pyapi']) - @expectedFailureAndroid(archs=['arm', 'aarch64']) # Watchpoints not supported - @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows") - @expectedFailureAll(archs=['s390x']) # Read-write watchpoints not supported on SystemZ + # Watchpoints not supported + @expectedFailureAndroid(archs=['arm', 'aarch64']) + @expectedFailureAll( + oslist=["windows"], + bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows") + # Read-write watchpoints not supported on SystemZ + @expectedFailureAll(archs=['s390x']) def test_set_watch_ignore_count(self): """Test SBWatchpoint.SetIgnoreCount() API.""" self.build() @@ -45,18 +51,20 @@ class WatchpointIgnoreCountTestCase(TestBase): VALID_BREAKPOINT) # Now launch the process, and do not stop at the entry point. - process = target.LaunchSimple (None, None, self.get_process_working_directory()) + process = target.LaunchSimple( + None, None, self.get_process_working_directory()) # We should be stopped due to the breakpoint. Get frame #0. process = target.GetProcess() self.assertTrue(process.GetState() == lldb.eStateStopped, PROCESS_STOPPED) - thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint) + thread = lldbutil.get_stopped_thread( + process, lldb.eStopReasonBreakpoint) frame0 = thread.GetFrameAtIndex(0) # Watch 'global' for read and write. value = frame0.FindValue('global', lldb.eValueTypeVariableGlobal) - error = lldb.SBError(); + error = lldb.SBError() watchpoint = value.Watch(True, True, True, error) self.assertTrue(value and watchpoint, "Successfully found the variable and set a watchpoint") @@ -82,7 +90,9 @@ class WatchpointIgnoreCountTestCase(TestBase): process.Continue() # At this point, the inferior process should have exited. - self.assertTrue(process.GetState() == lldb.eStateExited, PROCESS_EXITED) + self.assertTrue( + process.GetState() == lldb.eStateExited, + PROCESS_EXITED) # Verify some vital statistics. self.assertTrue(watchpoint) diff --git a/packages/Python/lldbsuite/test/python_api/watchpoint/TestWatchpointIter.py b/packages/Python/lldbsuite/test/python_api/watchpoint/TestWatchpointIter.py index 8bbb93af07e5..33f1be77ad57 100644 --- a/packages/Python/lldbsuite/test/python_api/watchpoint/TestWatchpointIter.py +++ b/packages/Python/lldbsuite/test/python_api/watchpoint/TestWatchpointIter.py @@ -5,7 +5,6 @@ Use lldb Python SBTarget API to iterate on the watchpoint(s) for the target. from __future__ import print_function - import os import re import time @@ -15,6 +14,7 @@ from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil + class WatchpointIteratorTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) @@ -25,11 +25,15 @@ class WatchpointIteratorTestCase(TestBase): # Our simple source filename. self.source = 'main.c' # Find the line number to break inside main(). - self.line = line_number(self.source, '// Set break point at this line.') + self.line = line_number( + self.source, '// Set break point at this line.') @add_test_categories(['pyapi']) - @expectedFailureAndroid(archs=['arm', 'aarch64']) # Watchpoints not supported - @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows") + # Watchpoints not supported + @expectedFailureAndroid(archs=['arm', 'aarch64']) + @expectedFailureAll( + oslist=["windows"], + bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows") def test_watch_iter(self): """Exercise SBTarget.watchpoint_iter() API to iterate on the available watchpoints.""" self.build() @@ -46,18 +50,20 @@ class WatchpointIteratorTestCase(TestBase): VALID_BREAKPOINT) # Now launch the process, and do not stop at the entry point. - process = target.LaunchSimple (None, None, self.get_process_working_directory()) + process = target.LaunchSimple( + None, None, self.get_process_working_directory()) # We should be stopped due to the breakpoint. Get frame #0. process = target.GetProcess() self.assertTrue(process.GetState() == lldb.eStateStopped, PROCESS_STOPPED) - thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint) + thread = lldbutil.get_stopped_thread( + process, lldb.eStopReasonBreakpoint) frame0 = thread.GetFrameAtIndex(0) # Watch 'global' for read and write. value = frame0.FindValue('global', lldb.eValueTypeVariableGlobal) - error = lldb.SBError(); + error = lldb.SBError() watchpoint = value.Watch(True, False, True, error) self.assertTrue(value and watchpoint, "Successfully found the variable and set a watchpoint") @@ -73,7 +79,8 @@ class WatchpointIteratorTestCase(TestBase): watch_id = watchpoint.GetID() self.assertTrue(watch_id != 0) - # Continue. Expect the program to stop due to the variable being written to. + # Continue. Expect the program to stop due to the variable being + # written to. process.Continue() # Hide stdout if not running with '-t' option. @@ -83,7 +90,8 @@ class WatchpointIteratorTestCase(TestBase): # Print the stack traces. lldbutil.print_stacktraces(process) - thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonWatchpoint) + thread = lldbutil.get_stopped_thread( + process, lldb.eStopReasonWatchpoint) self.assertTrue(thread, "The thread stopped due to watchpoint") self.DebugSBValue(value) @@ -107,7 +115,9 @@ class WatchpointIteratorTestCase(TestBase): process.Continue() # At this point, the inferior process should have exited. - self.assertTrue(process.GetState() == lldb.eStateExited, PROCESS_EXITED) + self.assertTrue( + process.GetState() == lldb.eStateExited, + PROCESS_EXITED) # Verify some vital statistics and exercise the iterator API. for watchpoint in target.watchpoint_iter(): @@ -115,4 +125,3 @@ class WatchpointIteratorTestCase(TestBase): self.assertTrue(watchpoint.GetWatchSize() == 4) self.assertTrue(watchpoint.GetHitCount() == 1) print(watchpoint) - diff --git a/packages/Python/lldbsuite/test/python_api/watchpoint/condition/TestWatchpointConditionAPI.py b/packages/Python/lldbsuite/test/python_api/watchpoint/condition/TestWatchpointConditionAPI.py index b368cc066615..03c94b6d04fa 100644 --- a/packages/Python/lldbsuite/test/python_api/watchpoint/condition/TestWatchpointConditionAPI.py +++ b/packages/Python/lldbsuite/test/python_api/watchpoint/condition/TestWatchpointConditionAPI.py @@ -5,13 +5,14 @@ Test watchpoint condition API. from __future__ import print_function - -import os, time +import os +import time import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil + class WatchpointConditionAPITestCase(TestBase): mydir = TestBase.compute_mydir(__file__) @@ -22,16 +23,23 @@ class WatchpointConditionAPITestCase(TestBase): # Our simple source filename. self.source = 'main.cpp' # Find the line number to break inside main(). - self.line = line_number(self.source, '// Set break point at this line.') + self.line = line_number( + self.source, '// Set break point at this line.') # And the watchpoint variable declaration line number. - self.decl = line_number(self.source, '// Watchpoint variable declaration.') - # Build dictionary to have unique executable names for each test method. + self.decl = line_number(self.source, + '// Watchpoint variable declaration.') + # Build dictionary to have unique executable names for each test + # method. self.exe_name = self.testMethodName self.d = {'CXX_SOURCES': self.source, 'EXE': self.exe_name} - @expectedFailureAndroid(archs=['arm', 'aarch64']) # Watchpoints not supported - @expectedFailureAll(oslist=["linux"], archs=["aarch64"], bugnumber="llvm.org/pr27710") - @skipIfWindows # Watchpoints not supported on Windows, and this test hangs + # Watchpoints not supported + @expectedFailureAndroid(archs=['arm', 'aarch64']) + @expectedFailureAll( + oslist=["linux"], + archs=["aarch64"], + bugnumber="llvm.org/pr27710") + @skipIfWindows # Watchpoints not supported on Windows, and this test hangs def test_watchpoint_cond_api(self): """Test watchpoint condition API.""" self.build(dictionary=self.d) @@ -49,18 +57,20 @@ class WatchpointConditionAPITestCase(TestBase): VALID_BREAKPOINT) # Now launch the process, and do not stop at the entry point. - process = target.LaunchSimple (None, None, self.get_process_working_directory()) + process = target.LaunchSimple( + None, None, self.get_process_working_directory()) # We should be stopped due to the breakpoint. Get frame #0. process = target.GetProcess() self.assertTrue(process.GetState() == lldb.eStateStopped, PROCESS_STOPPED) - thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint) + thread = lldbutil.get_stopped_thread( + process, lldb.eStopReasonBreakpoint) frame0 = thread.GetFrameAtIndex(0) # Watch 'global' for write. value = frame0.FindValue('global', lldb.eValueTypeVariableGlobal) - error = lldb.SBError(); + error = lldb.SBError() watchpoint = value.Watch(True, False, True, error) self.assertTrue(value and watchpoint, "Successfully found the variable and set a watchpoint") @@ -69,7 +79,7 @@ class WatchpointConditionAPITestCase(TestBase): # Now set the condition as "global==5". watchpoint.SetCondition('global==5') self.expect(watchpoint.GetCondition(), exe=False, - startstr = 'global==5') + startstr='global==5') # Hide stdout if not running with '-t' option. if not self.TraceOn(): @@ -77,13 +87,15 @@ class WatchpointConditionAPITestCase(TestBase): print(watchpoint) - # Continue. Expect the program to stop due to the variable being written to. + # Continue. Expect the program to stop due to the variable being + # written to. process.Continue() if (self.TraceOn()): lldbutil.print_stacktraces(process) - thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonWatchpoint) + thread = lldbutil.get_stopped_thread( + process, lldb.eStopReasonWatchpoint) self.assertTrue(thread, "The thread stopped due to watchpoint") self.DebugSBValue(value) diff --git a/packages/Python/lldbsuite/test/python_api/watchpoint/watchlocation/TestSetWatchlocation.py b/packages/Python/lldbsuite/test/python_api/watchpoint/watchlocation/TestSetWatchlocation.py index d0a2c2fff128..1cbaf5f46f61 100644 --- a/packages/Python/lldbsuite/test/python_api/watchpoint/watchlocation/TestSetWatchlocation.py +++ b/packages/Python/lldbsuite/test/python_api/watchpoint/watchlocation/TestSetWatchlocation.py @@ -5,7 +5,6 @@ Use lldb Python SBValue.WatchPointee() API to create a watchpoint for write of ' from __future__ import print_function - import os import re import time @@ -15,6 +14,7 @@ from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil + class SetWatchlocationAPITestCase(TestBase): mydir = TestBase.compute_mydir(__file__) @@ -25,13 +25,17 @@ class SetWatchlocationAPITestCase(TestBase): # Our simple source filename. self.source = 'main.cpp' # Find the line number to break inside main(). - self.line = line_number(self.source, '// Set break point at this line.') + self.line = line_number( + self.source, '// Set break point at this line.') # This is for verifying that watch location works. - self.violating_func = "do_bad_thing_with_location"; + self.violating_func = "do_bad_thing_with_location" @add_test_categories(['pyapi']) - @expectedFailureAndroid(archs=['arm', 'aarch64']) # Watchpoints not supported - @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows") + # Watchpoints not supported + @expectedFailureAndroid(archs=['arm', 'aarch64']) + @expectedFailureAll( + oslist=["windows"], + bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows") def test_watch_location(self): """Exercise SBValue.WatchPointee() API to set a watchpoint.""" self.build() @@ -48,22 +52,25 @@ class SetWatchlocationAPITestCase(TestBase): VALID_BREAKPOINT) # Now launch the process, and do not stop at the entry point. - process = target.LaunchSimple (None, None, self.get_process_working_directory()) + process = target.LaunchSimple( + None, None, self.get_process_working_directory()) # We should be stopped due to the breakpoint. Get frame #0. process = target.GetProcess() self.assertTrue(process.GetState() == lldb.eStateStopped, PROCESS_STOPPED) - thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint) + thread = lldbutil.get_stopped_thread( + process, lldb.eStopReasonBreakpoint) frame0 = thread.GetFrameAtIndex(0) value = frame0.FindValue('g_char_ptr', lldb.eValueTypeVariableGlobal) - pointee = value.CreateValueFromAddress("pointee", - value.GetValueAsUnsigned(0), - value.GetType().GetPointeeType()) + pointee = value.CreateValueFromAddress( + "pointee", + value.GetValueAsUnsigned(0), + value.GetType().GetPointeeType()) # Watch for write to *g_char_ptr. - error = lldb.SBError(); + error = lldb.SBError() watchpoint = value.WatchPointee(True, False, True, error) self.assertTrue(value and watchpoint, "Successfully found the pointer and set a watchpoint") @@ -76,18 +83,25 @@ class SetWatchlocationAPITestCase(TestBase): print(watchpoint) - # Continue. Expect the program to stop due to the variable being written to. + # Continue. Expect the program to stop due to the variable being + # written to. process.Continue() if (self.TraceOn()): lldbutil.print_stacktraces(process) - thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonWatchpoint) + thread = lldbutil.get_stopped_thread( + process, lldb.eStopReasonWatchpoint) self.assertTrue(thread, "The thread stopped due to watchpoint") self.DebugSBValue(value) self.DebugSBValue(pointee) - self.expect(lldbutil.print_stacktrace(thread, string_buffer=True), exe=False, - substrs = [self.violating_func]) + self.expect( + lldbutil.print_stacktrace( + thread, + string_buffer=True), + exe=False, + substrs=[ + self.violating_func]) # This finishes our test. diff --git a/packages/Python/lldbsuite/test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py b/packages/Python/lldbsuite/test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py index 468f3131f337..6078901c6697 100644 --- a/packages/Python/lldbsuite/test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py +++ b/packages/Python/lldbsuite/test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py @@ -5,14 +5,15 @@ Use lldb Python SBtarget.WatchAddress() API to create a watchpoint for write of from __future__ import print_function - -import os, time +import os +import time import re import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil + class TargetWatchAddressAPITestCase(TestBase): mydir = TestBase.compute_mydir(__file__) @@ -23,13 +24,17 @@ class TargetWatchAddressAPITestCase(TestBase): # Our simple source filename. self.source = 'main.cpp' # Find the line number to break inside main(). - self.line = line_number(self.source, '// Set break point at this line.') + self.line = line_number( + self.source, '// Set break point at this line.') # This is for verifying that watch location works. - self.violating_func = "do_bad_thing_with_location"; + self.violating_func = "do_bad_thing_with_location" @add_test_categories(['pyapi']) - @expectedFailureAndroid(archs=['arm', 'aarch64']) # Watchpoints not supported - @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows") + # Watchpoints not supported + @expectedFailureAndroid(archs=['arm', 'aarch64']) + @expectedFailureAll( + oslist=["windows"], + bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows") def test_watch_address(self): """Exercise SBTarget.WatchAddress() API to set a watchpoint.""" self.build() @@ -46,23 +51,27 @@ class TargetWatchAddressAPITestCase(TestBase): VALID_BREAKPOINT) # Now launch the process, and do not stop at the entry point. - process = target.LaunchSimple (None, None, self.get_process_working_directory()) + process = target.LaunchSimple( + None, None, self.get_process_working_directory()) # We should be stopped due to the breakpoint. Get frame #0. process = target.GetProcess() self.assertTrue(process.GetState() == lldb.eStateStopped, PROCESS_STOPPED) - thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint) + thread = lldbutil.get_stopped_thread( + process, lldb.eStopReasonBreakpoint) frame0 = thread.GetFrameAtIndex(0) value = frame0.FindValue('g_char_ptr', lldb.eValueTypeVariableGlobal) - pointee = value.CreateValueFromAddress("pointee", - value.GetValueAsUnsigned(0), - value.GetType().GetPointeeType()) + pointee = value.CreateValueFromAddress( + "pointee", + value.GetValueAsUnsigned(0), + value.GetType().GetPointeeType()) # Watch for write to *g_char_ptr. - error = lldb.SBError(); - watchpoint = target.WatchAddress(value.GetValueAsUnsigned(), 1, False, True, error) + error = lldb.SBError() + watchpoint = target.WatchAddress( + value.GetValueAsUnsigned(), 1, False, True, error) self.assertTrue(value and watchpoint, "Successfully found the pointer and set a watchpoint") self.DebugSBValue(value) @@ -74,26 +83,36 @@ class TargetWatchAddressAPITestCase(TestBase): print(watchpoint) - # Continue. Expect the program to stop due to the variable being written to. + # Continue. Expect the program to stop due to the variable being + # written to. process.Continue() if (self.TraceOn()): lldbutil.print_stacktraces(process) - thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonWatchpoint) + thread = lldbutil.get_stopped_thread( + process, lldb.eStopReasonWatchpoint) self.assertTrue(thread, "The thread stopped due to watchpoint") self.DebugSBValue(value) self.DebugSBValue(pointee) - self.expect(lldbutil.print_stacktrace(thread, string_buffer=True), exe=False, - substrs = [self.violating_func]) + self.expect( + lldbutil.print_stacktrace( + thread, + string_buffer=True), + exe=False, + substrs=[ + self.violating_func]) # This finishes our test. @add_test_categories(['pyapi']) - @expectedFailureAndroid(archs=['arm', 'aarch64']) # Watchpoints not supported - @skipIf(archs=['mips', 'mipsel', 'mips64', 'mips64el']) # No size constraint on MIPS for watches - @skipIf(archs=['s390x']) # Likewise on SystemZ + # Watchpoints not supported + @expectedFailureAndroid(archs=['arm', 'aarch64']) + # No size constraint on MIPS for watches + @skipIf(archs=['mips', 'mipsel', 'mips64', 'mips64el']) + @skipIf(archs=['s390x']) # Likewise on SystemZ + @expectedFailureAll(oslist=["windows"]) def test_watch_address_with_invalid_watch_size(self): """Exercise SBTarget.WatchAddress() API but pass an invalid watch_size.""" self.build() @@ -110,23 +129,27 @@ class TargetWatchAddressAPITestCase(TestBase): VALID_BREAKPOINT) # Now launch the process, and do not stop at the entry point. - process = target.LaunchSimple (None, None, self.get_process_working_directory()) + process = target.LaunchSimple( + None, None, self.get_process_working_directory()) # We should be stopped due to the breakpoint. Get frame #0. process = target.GetProcess() self.assertTrue(process.GetState() == lldb.eStateStopped, PROCESS_STOPPED) - thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint) + thread = lldbutil.get_stopped_thread( + process, lldb.eStopReasonBreakpoint) frame0 = thread.GetFrameAtIndex(0) value = frame0.FindValue('g_char_ptr', lldb.eValueTypeVariableGlobal) - pointee = value.CreateValueFromAddress("pointee", - value.GetValueAsUnsigned(0), - value.GetType().GetPointeeType()) + pointee = value.CreateValueFromAddress( + "pointee", + value.GetValueAsUnsigned(0), + value.GetType().GetPointeeType()) # Watch for write to *g_char_ptr. - error = lldb.SBError(); - watchpoint = target.WatchAddress(value.GetValueAsUnsigned(), 365, False, True, error) + error = lldb.SBError() + watchpoint = target.WatchAddress( + value.GetValueAsUnsigned(), 365, False, True, error) self.assertFalse(watchpoint) self.expect(error.GetCString(), exe=False, - substrs = ['watch size of %d is not supported' % 365]) + substrs=['watch size of %d is not supported' % 365]) |