summaryrefslogtreecommitdiffstats
path: root/lldb/test/python_api
Commit message (Collapse)AuthorAgeFilesLines
* Add fuzz calls for SBFrame and SBFunction.Johnny Chen2011-06-273-0/+59
| | | | llvm-svn: 133965
* Add fuzz calls for SBFileSpec.Johnny Chen2011-06-272-0/+17
| | | | llvm-svn: 133956
* Add fuzz calls for SBEvent.Johnny Chen2011-06-272-0/+20
| | | | llvm-svn: 133954
* Move hello_world to now reside under python_api dir.Johnny Chen2011-06-263-0/+199
| | | | llvm-svn: 133890
* Add fuzz calls for SBError.Johnny Chen2011-06-252-0/+22
| | | | llvm-svn: 133850
* Add fuzz calls for SBDebugger.Johnny Chen2011-06-252-0/+54
| | | | llvm-svn: 133848
* Add fuzz calls for SBCompileUnit.Johnny Chen2011-06-242-0/+16
| | | | llvm-svn: 133843
* Add fuzz calls for SBCommunication.Johnny Chen2011-06-242-0/+30
| | | | llvm-svn: 133839
* Add fuzz calls for SBBroadcaster.Johnny Chen2011-06-242-0/+22
| | | | llvm-svn: 133837
* Add fuzz calls for SBBreakpointLocation.Johnny Chen2011-06-242-0/+30
| | | | llvm-svn: 133810
* Add fuzz calls for SBBreakpoint.Johnny Chen2011-06-242-2/+39
| | | | llvm-svn: 133809
* Add fuzz calls for SBBlock.Johnny Chen2011-06-242-0/+20
| | | | llvm-svn: 133780
* Start adding API calls to the invalid SB API object after default construction.Johnny Chen2011-06-242-0/+15
| | | | | | | | It should not crash lldb. This checkin adds calls for SBAddress. llvm-svn: 133778
* o lldbtest.py:Johnny Chen2011-06-231-31/+34
| | | | | | | | | | | | | | | | | | Assign the test method name to self.testMethodName. This can be useful for the test directory (see test/types for a good example) which houses a bunch of executables compiled from different source files. The default build action is to create a.out as the binary executable, which can confuse the module cacheing mechanism and result in the debugger getting a stale image as the target to be debugged, and chaos ensues. o AbstractBase.py, TestThreadAPI.py: Use self.testMethodName to our advantage. o TestLoadUnload.py: Add expected failure marker to test case test_modules_search_paths(). llvm-svn: 133768
* For now, use 'b.out' compiled from main2.cpp as the executable name for ↵Johnny Chen2011-06-231-11/+6
| | | | | | | | test_run_to_address_with_dsym/dwarf() to distinguish between other test cases which use 'a.out' compiled from main.cpp. llvm-svn: 133764
* Add docstring to test_SBSymbolContextList(self) explaining that upon default ↵Johnny Chen2011-06-221-0/+1
| | | | | | construction, the API object is valid. llvm-svn: 133644
* Recent change to SBSymbolContextList (r133498) makes the default constructor ↵Johnny Chen2011-06-221-3/+3
| | | | | | | | return a valid SB API object. Modify the test case to accommodate. llvm-svn: 133602
* Minor module-level docstring change.Johnny Chen2011-06-201-1/+1
| | | | llvm-svn: 133476
* Test lldb Python API object's default constructor and make sure it is invalidJohnny Chen2011-06-201-0/+243
| | | | | | | | | after initial construction. There are two exceptions to the above general rules, though; the API objects are SBCommadnReturnObject and SBStream. llvm-svn: 133475
* Add TestInlinedFrame.py to exercise the newly added SBFrame APIs: ↵Johnny Chen2011-06-204-0/+128
| | | | | | IsInlined() and GetFunctionName(). llvm-svn: 133404
* o lldbutil.py:Johnny Chen2011-06-162-4/+5
| | | | | | | | | | | | | | | | For the print_stacktrace(thread, string_buffer = False) function, if we have debug info for a frame function, let's also emit the args for the current function. o TestFrameUtils.py: Add stronger assertTrue for frame0's args. o TestPrintStackTraces.py: Launch the inferior with ["abc", "xyz"] and expect '(int)argc=3' in the stack traces, since by design the inferior is built with debug info. llvm-svn: 133204
* The extra burden for the Python API test case to assign its process object ↵Johnny Chen2011-06-1513-100/+83
| | | | | | | | | to self.process in order to have its process cleaned up (terminated) upon tearDown is gone for good. Let's simplify a bunch of Python API test cases. llvm-svn: 133097
* Comment out the debug stmts.Johnny Chen2011-06-091-3/+2
| | | | llvm-svn: 132808
* Add rich comparison methods for the SBAddress object.Johnny Chen2011-06-091-1/+6
| | | | | | | | If two SBAddress's have the same module and file address, they are considered equal. Add a test snippet 'sa1 == sa2' to exercise the rich comparison methods for SBAddress. llvm-svn: 132807
* Comment change.Johnny Chen2011-05-261-1/+1
| | | | llvm-svn: 132150
* Simplify test setup; there's no need to pass a customized dictionary here.Johnny Chen2011-05-261-1/+1
| | | | llvm-svn: 132147
* Now that we have added a post-processing step for adding truth value testing toJohnny Chen2011-05-249-60/+60
| | | | | | | those lldb objects which implement the IsValid() method, let's change the rest of the test suite to use the more compact truth value testing pattern (the Python way). llvm-svn: 131970
* Add truth value testing to those lldb Python objects with the IsValid() ↵Johnny Chen2011-05-174-23/+23
| | | | | | | | | | | method definitions. object.__nonzero__(self) is called to implement truth value testing and the built-in operation bool(), via a simple delegation to self.IsValid(). Change tests under python_api/lldbutil to utilize this mechanism. llvm-svn: 131494
* Add implementation of built-in function len() for those lldb containers withJohnny Chen2011-05-161-11/+31
| | | | | | | | | | | | | | | unambiguous iteration support. So that we could, for example: ... REGs = lldbutil.get_GPRs(frame) print "Number of general purpose registers: %d" % len(REGs) for reg in REGs: print "%s => %s" %(reg.GetName(), reg.GetValue()) ... llvm-svn: 131418
* Renamed the test cases more properly to test_lldb_iter_module/breakpoint/farme.Johnny Chen2011-05-161-9/+9
| | | | llvm-svn: 131412
* Clean up the test a little bit; and use lldbutil.get_GPRs(frame) to retrieve ↵Johnny Chen2011-05-131-9/+3
| | | | | | the general purpose register set. llvm-svn: 131324
* Add two utility functions:Johnny Chen2011-05-1210-4/+253
| | | | | | | | | | | o get_parent_frame(frame) o get_args_as_string(frame) to lldbutil.py and create TestFrameUtils.py to exercise the utils. Plus re-arrange the test/python_api/lldbutil to have three directories for testing iteration, process stack traces, and the just added frame utils. llvm-svn: 131213
* Add a utility function get_registers(frame, kind) to get the registers of a ↵Johnny Chen2011-05-101-0/+72
| | | | | | | | | | | given frame and of a given kind. Also add three convenience functions get_GPRs(frame), get_FPRs(frame), and get_ESRs(frame) to get the general purpose registers, the floating point registers, and the exception state registers. Add TestRegistersIterator.py to test these added functions of lldbutil.py. llvm-svn: 131144
* Add an API test script file for SBCommandInterpreter.Johnny Chen2011-05-063-0/+91
| | | | llvm-svn: 131035
* Add implementation of '==' and '!=' for SBFileSpec and SBModule. Modify a ↵Johnny Chen2011-05-021-2/+2
| | | | | | test case to take advantage of 'ths_module == that_module'. llvm-svn: 130709
* Add the Python rich comparison methods for SBBreakpoint, where GetID() returnsJohnny Chen2011-04-291-1/+1
| | | | | | | the breakpoint ID and provides the semantics needed for '==' and '!='. And modify LLDBIteratorTestCase.lldb_iter_2() to use '==' between two SBBreakpoint's. llvm-svn: 130531
* Modify the test suite and lldbutil.py to utilize the Python iteration ↵Johnny Chen2011-04-282-4/+2
| | | | | | | | pattern now that the lldb iteration protocol has been added to lldb.py module. llvm-svn: 130452
* Move the iteration protocol of lldb objects to the auto-generated lldb ↵Johnny Chen2011-04-281-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | Python module. This is so that the objects which support the iteration protocol are immediately obvious from looking at the lldb.py file. SBTarget supports two types of iterations: module and breakpoint. For an SBTarget instance, you will need to issue either: for m in target.module_iter() or for b in target.breakpoint_iter() For other single iteration protocol objects, just use, for example: for thread in process: ID = thread.GetThreadID() for frame in thread: frame.Disassemble() .... llvm-svn: 130442
* Add a utility function smart_iter() which has knowledge of the getsize and ↵Johnny Chen2011-04-271-2/+37
| | | | | | | | | | | | | | | | | | | | | | the getelem method names of all the lldb container objects and returns an iterator object when passed an eligible lldb container object. Example: from lldb_util import smart_iter for thread in smart_iter(process): ID = thread.GetThreadID() if thread.GetStopReason() == lldb.eStopReasonBreakpoint: stopped_due_to_breakpoint = True for frame in smart_iter(thread): self.assertTrue(frame.GetThread().GetThreadID() == ID) ... Add a test case for lldb.smart_iter(). llvm-svn: 130332
* Use new string formatting operations in assert messages to simplify things.Johnny Chen2011-04-271-2/+2
| | | | llvm-svn: 130325
* Add another test case for lldb_iter(), this time using SBTarget to get at ↵Johnny Chen2011-04-272-8/+43
| | | | | | its SBBreakpoint containees. llvm-svn: 130323
* Change the rest of lldbutil.py's function names to all lower case formats to ↵Johnny Chen2011-04-272-3/+3
| | | | | | | | be consistent. And modify the test cases accordingly. llvm-svn: 130314
* Add a test case for lldbutil.lldb_iter() which returns an iterator objectJohnny Chen2011-04-261-0/+64
| | | | | | | | for lldb objects which can contain other lldb objects. Examples are: SBTarget contains SBModule, SBModule contains SBSymbols, SBProcess contains SBThread, SBThread contains SBFrame, etc. llvm-svn: 130258
* For lldbutil.py, Change a bunch of function names to all lower case formats ↵Johnny Chen2011-04-251-1/+1
| | | | | | | | to be consistent. And modify the test cases accordingly. llvm-svn: 130174
* Make SBBreakpointLocation::GetDescription() API to be consistent with SBTarget,Johnny Chen2011-04-251-1/+4
| | | | | | | | | | i.e., with 'SBStream &description' first, followed by 'DescriptionLevel level'. Modify lldbutil.py so that get_description() for a target or breakpoint location can just take the lldb object itself without specifying an option to mean option lldb.eDescriptionLevelBrief. Modify TestTargetAPI.py to exercise this logic path. llvm-svn: 130147
* Convert the rest of the test suite to use the lldbutil.get_description() ↵Johnny Chen2011-04-234-22/+15
| | | | | | utility function. llvm-svn: 130041
* Add a simple utility function get_description(lldb_obj, option=None) to ↵Johnny Chen2011-04-231-7/+8
| | | | | | | | lldbutil.py and use it from TestTargetAPI.py. llvm-svn: 130038
* Add test cases for the SBTarget.GetDescription() API which takes an extra ↵Johnny Chen2011-04-221-0/+36
| | | | | | lldb::DescriptionLevel enum. llvm-svn: 130029
* Rename test/threads to python_api/lldbutil; it uses lldbutil functions to ↵Johnny Chen2011-04-193-0/+191
| | | | | | print stack traces. llvm-svn: 129828
* Converted to use SBProcess.LaunchSimple().Johnny Chen2011-04-191-17/+8
| | | | | | And use self.TraceOn() API. llvm-svn: 129797
OpenPOWER on IntegriCloud