def fuzz_obj(obj): obj.GetStopReason() obj.GetStopReasonDataCount() obj.GetStopReasonDataAtIndex(100) obj.GetStopDescription(256) obj.GetThreadID() obj.GetIndexID() obj.GetName() obj.GetQueueName() obj.StepOver(lldb.eOnlyDuringStepping) obj.StepInto(lldb.eOnlyDuringStepping) obj.StepOut() frame = lldb.SBFrame() obj.StepOutOfFrame(frame) obj.StepInstruction(True) filespec = lldb.SBFileSpec() obj.StepOverUntil(frame, filespec, 1234) obj.RunToAddress(0xabcd) obj.Suspend() obj.Resume() obj.IsSuspended() obj.GetNumFrames() obj.GetFrameAtIndex(200) obj.GetSelectedFrame() obj.SetSelectedFrame(999) obj.GetProcess() obj.GetDescription(lldb.SBStream()) obj.Clear() for frame in obj: s = str(frame) len(obj)
def test_SBFrame(self): obj = lldb.SBFrame() if self.TraceOn(): print obj self.assertFalse(obj) # Do fuzz testing on the invalid obj, it should not crash lldb. import sb_frame sb_frame.fuzz_obj(obj)
def fuzz_obj(obj): obj.GetAddress() obj.GetByteSize() obj.DoesBranch() obj.Print(None) obj.GetDescription(lldb.SBStream()) obj.EmulateWithFrame(lldb.SBFrame(), 0) obj.DumpEmulation("armv7") obj.TestEmulation(lldb.SBStream(), "my-file")
def test_step_until(self): """Test stepping until when hardware breakpoints are required.""" self.build() _, _, thread, _ = lldbutil.run_to_line_breakpoint( self, lldb.SBFileSpec("main.c"), 7) self.runCmd("settings set target.require-hardware-breakpoint true") self.expect("thread until 5", error=True) # Ensure we fail when stepping through the API. error = thread.StepOverUntil(lldb.SBFrame(), lldb.SBFileSpec(), 5) self.assertTrue(error.Fail()) self.assertTrue("Could not create hardware breakpoint for thread plan" in error.GetCString())