return m_last_natural_stop_event;
return lldb::EventSP();
}
-
- void SetSafeToCallFunctions(bool safe) {
- m_safe = safe;
- }
-
- bool GetSafeToCallFunctions() {
- return m_safe;
- }
private:
uint32_t m_stop_id = 0;
uint32_t m_running_user_expression = false;
uint32_t m_running_utility_function = 0;
lldb::EventSP m_last_natural_stop_event;
- std::atomic<bool> m_safe = true;
};
inline bool operator==(const ProcessModID &lhs, const ProcessModID &rhs) {
void SetRestarted(bool new_value) { m_restarted = new_value; }
void SetInterrupted(bool new_value) { m_interrupted = new_value; }
-
+
void AddRestartedReason(const char *reason) {
m_restarted_reasons.push_back(reason);
}
DiagnosticManager &diagnostic_manager);
static const char *ExecutionResultAsCString(lldb::ExpressionResults result);
-
- void SetSafeToCallFunctions(bool safe) {
- GetModID().SetSafeToCallFunctions(safe);
- }
-
- bool GetSafeToCallFunctions() {
- return GetModID().GetSafeToCallFunctions();
- }
void GetStatus(Stream &ostrm);
class TestStepOverWatchpoint(TestBase):
NO_DEBUG_INFO_TESTCASE = True
- def get_to_start(self, bkpt_text):
+ @expectedFailureAll(
+ oslist=["freebsd", "linux"],
+ archs=[
+ 'aarch64',
+ 'arm'],
+ bugnumber="llvm.org/pr26031")
+ # Read-write watchpoints not supported on SystemZ
+ @expectedFailureAll(archs=['s390x'])
+ @expectedFailureAll(
+ oslist=["ios", "watchos", "tvos", "bridgeos", "macosx"],
+ archs=['aarch64', 'arm'],
+ bugnumber="<rdar://problem/34027183>")
+ @add_test_categories(["basic_process"])
+ def test(self):
"""Test stepping over watchpoints."""
self.build()
- target, process, thread, bkpt = lldbutil.run_to_source_breakpoint(self, bkpt_text,
- lldb.SBFileSpec("main.c"))
+ target = self.createTestTarget()
+
+ lldbutil.run_break_set_by_symbol(self, 'main')
+
+ process = target.LaunchSimple(None, None,
+ self.get_process_working_directory())
+ self.assertTrue(process.IsValid(), PROCESS_IS_VALID)
+ self.assertState(process.GetState(), lldb.eStateStopped,
+ PROCESS_STOPPED)
+
+ thread = lldbutil.get_stopped_thread(process,
+ lldb.eStopReasonBreakpoint)
+ self.assertTrue(thread.IsValid(), "Failed to get thread.")
+
frame = thread.GetFrameAtIndex(0)
self.assertTrue(frame.IsValid(), "Failed to get frame.")
self.assertSuccess(error, "Error while setting watchpoint")
self.assertTrue(read_watchpoint, "Failed to set read watchpoint.")
- # Disable the breakpoint we hit so we don't muddy the waters with
- # stepping off from the breakpoint:
- bkpt.SetEnabled(False)
-
- return (target, process, thread, read_watchpoint)
-
- @expectedFailureAll(
- oslist=["freebsd", "linux"],
- archs=[
- 'aarch64',
- 'arm'],
- bugnumber="llvm.org/pr26031")
- # Read-write watchpoints not supported on SystemZ
- @expectedFailureAll(archs=['s390x'])
- @add_test_categories(["basic_process"])
- def test_step_over(self):
- target, process, thread, wp = self.get_to_start("Set a breakpoint here")
-
thread.StepOver()
self.assertStopReason(thread.GetStopReason(), lldb.eStopReasonWatchpoint,
STOPPED_DUE_TO_WATCHPOINT)
self.assertEquals(thread.GetStopDescription(20), 'watchpoint 1')
- @expectedFailureAll(
- oslist=["freebsd", "linux"],
- archs=[
- 'aarch64',
- 'arm'],
- bugnumber="llvm.org/pr26031")
- # Read-write watchpoints not supported on SystemZ
- @expectedFailureAll(archs=['s390x'])
- @expectedFailureAll(
- oslist=["ios", "watchos", "tvos", "bridgeos", "macosx"],
- archs=['aarch64', 'arm'],
- bugnumber="<rdar://problem/34027183>")
- @add_test_categories(["basic_process"])
- def test_step_instruction(self):
- target, process, thread, wp = self.get_to_start("Set breakpoint after call")
-
+ process.Continue()
+ self.assertState(process.GetState(), lldb.eStateStopped,
+ PROCESS_STOPPED)
self.assertEquals(thread.GetStopDescription(20), 'step over')
self.step_inst_for_watchpoint(1)