summaryrefslogtreecommitdiffstats
path: root/lldb/test/python_api
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Converted to use SBProcess.LaunchSimple().Johnny Chen2011-04-191-2/+1
| | | | llvm-svn: 129795
* Converted to use SBProcess.LaunchSimple().Johnny Chen2011-04-191-2/+1
| | | | llvm-svn: 129793
* Use self.TraceOn() API.Johnny Chen2011-04-191-5/+9
| | | | llvm-svn: 129792
* Converted to use SBProcess.LaunchSimple() API.Johnny Chen2011-04-192-10/+14
| | | | | | And use self.TraceOn() in order to print more debug output. llvm-svn: 129791
* Converted to use SBProcess.LaunchSimple().Johnny Chen2011-04-191-5/+6
| | | | | | And use self.TraceOn() API. llvm-svn: 129790
* Converted to use SBProcess.LaunchSimple().Johnny Chen2011-04-191-2/+1
| | | | llvm-svn: 129789
* Add support for "dynamic values" for C++ classes. This currently only works ↵Jim Ingham2011-04-161-1/+7
| | | | | | | | | | | | | | | | | | for "frame var" and for the expressions that are simple enough to get passed to the "frame var" underpinnings. The parser code will have to be changed to also query for the dynamic types & offsets as it is looking up variables. The behavior of "frame var" is controlled in two ways. You can pass "-d {true/false} to the frame var command to get the dynamic or static value of the variables you are printing. There's also a general setting: target.prefer-dynamic-value (boolean) = 'true' which is consulted if you call "frame var" without supplying a value for the -d option. llvm-svn: 129623
* Add TestSymbolAPI.py to test the newly added SBSymbol and SBAddress APIs:Johnny Chen2011-04-011-0/+96
| | | | | | | | | | | | lldb::SymbolType SBSymbol::GetType(); lldb::SectionType SBAddress::GetSectionType (); lldb::SBModule SBAddress::GetModule (); Also add an lldb::SBModule::GetUUIDString() API which is easier for Python to work with in the test script. llvm-svn: 128695
* Remove unneeded ExecutionContextScope variables.Jim Ingham2011-03-311-0/+12
| | | | llvm-svn: 128685
* Add test cases to exercise the SBThread.GetProcess() API. We launch the ↵Johnny Chen2011-03-111-2/+58
| | | | | | | | | | process using the SBTarget.Launch() API, stop at a breakpoint, get the stopped thread, and verify that the pid of the stopped thread's process is equal to the pid of the process returned by SBTarget.Launch(). llvm-svn: 127444
* Add a test case test_run_to_address() to exercise the ↵Johnny Chen2011-03-111-0/+53
| | | | | | | | SBThread.RunToAddress(lldb::addr_t addr) API. The test itself is not working yet. llvm-svn: 127436
* Add test cases to TestThreadAPI.py to exercise SBThread.StepOver() by ↵Johnny Chen2011-03-102-2/+61
| | | | | | | | stopping at a breakpoint, doing three step-over's, then verifying that the correct source line number is reached. llvm-svn: 127432
* Test cleanup. Check for the full caller symbol of malloc -- b(int).Johnny Chen2011-03-101-11/+11
| | | | llvm-svn: 127421
* Add test cases for Python SBThread.StepOut() API by stepping out of a malloc ↵Johnny Chen2011-03-093-2/+111
| | | | | | | | call where the call site is at function b(). Verifies that after the thread.StepOut(), we are at the correct line within function b. llvm-svn: 127374
* Add an extra twist of stopping the inferior in a breakpoint, and then ↵Johnny Chen2011-03-071-2/+16
| | | | | | | | continue till it's done. We should still see the entire stdout redirected once the process is finished. llvm-svn: 127184
* Add test cases for SBTarget.Launch() API with the stdout of the inferior ↵Johnny Chen2011-03-071-0/+39
| | | | | | redirected to a file. llvm-svn: 127179
* Add TestThreadAPI.py file to house the Python SBThread API test cases.Johnny Chen2011-03-073-0/+97
| | | | | | | | | | | | | | | Currently it has only test cases for SBThread.GetStopDescription() API. Also modified lldb.swig to add typemap for (char *dst, size_t dst_len) which occurs for SBThread::GetStopDescription() C++ API. For Python scripting: # Due to the typemap magic (see lldb.swig), we pass in an (int)length to GetStopDescription # and expect to get a Python string as the result object! # The 100 is just an arbitrary number specifying the buffer size. stop_description = thread.GetStopDescription(100) llvm-svn: 127173
* Add a test case ProcessAPITestCase.test_remote_launch() which tests ↵Johnny Chen2011-03-051-1/+25
| | | | | | | | | | | SBProcess.RemoteLaunch() API with a process not in eStateConnected, and checks that the remote launch failed. Modify SBProcess::RemoteLaunch()/RemoteAttachToProcessWithID()'s log statements to fix a crasher when logging is turned on. llvm-svn: 127055
* Add a test case for the lldb command 'process connect'.Johnny Chen2011-03-041-8/+8
| | | | | | | We start a fake debugserver listening on localhost:12345 and issue the command 'process connect connect://localhost:12345' to connect to it. llvm-svn: 127048
* Add TestDisasmAPI.py which exercises the newly added ↵Johnny Chen2011-03-034-10/+198
| | | | | | | | | | | | | | | | | | | | | | | | | | | | SBFunction/SBSymbol.GetStartAddress(), among other things: // When stopped on breakppint 1, we can get the line entry using SBFrame API // SBFrame.GetLineEntry(). We'll get the start address for the the line entry // with the SBAddress type, resolve the symbol context using the SBTarget API // SBTarget.ResolveSymbolContextForAddress() in order to get the SBSymbol. // // We then stop at breakpoint 2, get the SBFrame, and the the SBFunction object. // // The address from calling GetStartAddress() on the symbol and the function // should point to the same address, and we also verify that. And add one utility function disassemble(target, function_or_symbol) to lldbutil.py: """Disassemble the function or symbol given a target. It returns the disassembly content in a string object. """ TestDisasm.py uses the disassemble() function to do disassembly on the SBSymbol, and then the SBFunction object. llvm-svn: 126955
* Add TestTargetAPI.py:Johnny Chen2011-03-035-7/+191
| | | | | | | | | | | | | | | | | | | | | | | // When stopped on breakppint 1, and then 2, we can get the line entries using // SBFrame API SBFrame.GetLineEntry(). We'll get the start addresses for the // two line entries; with the start address (of SBAddress type), we can then // resolve the symbol context using the SBTarget API // SBTarget.ResolveSymbolContextForAddress(). // // The two symbol context should point to the same symbol, i.e., 'a' function. Add two utility functions to lldbutil.py: o get_stopped_threads(process, reason): return the list of threads with the specified stop reason or an empty list if not found o get_stopped_thread(process, reason): return the first thread with the given stop reason or None if not found llvm-svn: 126916
* Add some comments.Johnny Chen2011-03-021-0/+4
| | | | llvm-svn: 126867
* Add two utility functions to lldbutil.py:Johnny Chen2011-03-021-13/+13
| | | | | | | | | | | | o int_to_bytearray() o bytearray_to_int() They return/interpret the bytearray in the little endian format. For big endian, simply perform ba.reverse() on the bytearray object. And modify TestProcessAPI.py to take advantage of the functions. llvm-svn: 126813
* Add an API SBProcess::GetByteOrder() and add test cases which utilizes ↵Johnny Chen2011-03-012-0/+92
| | | | | | | | | GetByteOrder(), among other SBProcess APIs, to write (int)256 into a memory location of a global variable (int)my_int and reads/checks the variable afterwards. llvm-svn: 126792
* Fix wrong placement of skipUnless() decorator.Johnny Chen2011-03-011-1/+0
| | | | llvm-svn: 126774
* Add test methods for SBProcess.WriteMemory() API to the TestProcessAPI.py file.Johnny Chen2011-03-011-41/+80
| | | | | | This makes the number of total tests equal to 201. llvm-svn: 126769
* Add TestProcessAPI.py which exercises some Python SBProcess API. In ↵Johnny Chen2011-03-013-0/+132
| | | | | | | | | | | | | particular, this tests the SBProcess.ReadMemory() API, which, due to SWIG typemap'ing, expects 3 arguments (the location to read from, the size in bytes to read, and an SBError object), and returns the result as a Python string object. On SnowLeopard where this has been tested, the SWIG script needs to be pampered (use the exact same parameter names as in SBProcess.h) in order for this to work. llvm-svn: 126736
* Modify test scripts to accomodate SBTarget.Launch() API change.Johnny Chen2011-02-033-7/+7
| | | | llvm-svn: 124828
* Deprecated old forms of SBTarget::Launch. There is not just one and noGreg Clayton2011-01-233-4/+8
| | | | | | SWIG renaming done to work around deprecated APIs. llvm-svn: 124075
* Fix wrong test case in main.c. Oops!Johnny Chen2011-01-102-7/+3
| | | | llvm-svn: 123181
* Add a test case for the SBFrame APIs. In particular, it uses the frame API toJohnny Chen2010-12-233-0/+181
| | | | | | | | | get the argument values of the call stacks when stopped on the breakpoint. Radar has been filed for the expected failures: test failure: ./dotest.py -v -w -t -p TestFrames (argument values are wrong) llvm-svn: 122460
* No need to pass an empty string as an arg or as an env string to the ↵Johnny Chen2010-12-222-3/+3
| | | | | | SBTarget.LaunchProcess() API. llvm-svn: 122450
* Fix some typos in the docstrings and also update the test method names.Johnny Chen2010-12-221-13/+12
| | | | llvm-svn: 122382
OpenPOWER on IntegriCloud