summaryrefslogtreecommitdiffstats
path: root/lldb/test/python_api
Commit message (Collapse)AuthorAgeFilesLines
...
* Mark TestChangeValueAPI.py as expected fail with gcc as it still reproduces.Matt Kopec2013-03-191-0/+1
| | | | llvm-svn: 177447
* Fixed incorrect python that was trying to validate that we got a valid ↵Greg Clayton2013-03-1910-20/+20
| | | | | | | | lldb.SBThread object by checking to see if it is equal to "None". This test is incorrect as functions that return lldb.SBThread objects never return None, they just return lldb.SBThread objects that contain invalid opaque classes. llvm-svn: 177416
* Rework TestChangedValueAPI.py to account for gcc setting multiple breakpoints.Matt Kopec2013-03-152-3/+16
| | | | llvm-svn: 177198
* Minor test runner improvemenstDaniel Malea2013-02-192-1/+4
| | | | | | | | - rework the way SBDebugger.SetAsync() is used to avoid side effects (reset original value at TearDownHook) - refactor expectedFailureClang (and add expectedFailureGcc decorator) - mark TestChangeValueAPI.py as expectedFailureGcc due to PR-15039 llvm-svn: 175523
* Fix misuse of python subprocess module (caused "leaking" processes and ↵Daniel Malea2013-02-151-10/+6
| | | | | | | | | | | garbling the terminal) - fixed cleanup of Popen objects by pushing spawn logic into test Base and out of test cases - connect subprocess stdin to PIPE (rather than the parent's STDIN) to fix silent terminal issue Tested on Linux and Mac OS X llvm-svn: 175301
* Linux test case cleanup:Daniel Malea2013-02-151-1/+0
| | | | | | | | | - Enable TestFormatters.py: expressions with "new" work - Enable TestChangeValueAPI.py: llvm.org/PR15039 fixed - Disable expression_command/call-restarts due to llvm.org/PR15278 - Disable expression_command/call-throws due to ObjC test program llvm-svn: 175287
* Fix TestSBData.py test case (tested fix Linux/Mac)Daniel Malea2013-02-141-58/+86
| | | | | | | | | | | | | | | | | - stop ignoring the error-codes in the 'error' variable - removed out-of-bounds accesses with read-only array fields such as: self.assertTrue(data2.uint8[6] == 0, 'binary 0 terminator') Since SBData wraps a (6-character) python string literal, trying to read the null-terminator raises an exception. Instead, I replaced the out-of-bounds read with a length-check. Other out-of-bounds reads (via accessor function like SBData.GetUnsignedInt8) don't throw and are OK. I just added asserts that errors are set for these negative cases. llvm-svn: 175223
* Update test scripts and Makefiles to allow testing with GCC:Daniel Malea2013-01-254-4/+4
| | | | | | | | | | | - introduce new variable ARCHFLAG in make/Makefile.rules to switch between "-arch" on Mac and "-m" everywhere else - update testcase makefiles to use LD_EXTRAS instead of LDFLAGS (the former interacts with Makefile.rules badly) - special treatment for gcc 4.6: replace "-std=c++11" with "-std=c++0x" as the former is not handled correctly - remove hardcoded "-arch" from test Makefile This patch should not have any effect on lldb on Mac OS X. llvm-svn: 173402
* Marking test cases with @expectedFailureLinux as per recently opened bugsDaniel Malea2013-01-243-1/+2
| | | | | | | | | - PR 15038: missing wide char support on Linux - PR 14600 - Exception state registers not supported on Linux - PR 15039: SBProcess.GetSTDOUT() returns an empty buffer - PR 15037: stop-hooks sometimes fail to fire on Linux llvm-svn: 173363
* This patch removes the SymbolFileSymtab support Sean Callanan2012-12-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | for reporting class types from Objective-C runtime class symbols. Instead, LLDB now queries the Objective-C runtime for class types. We have also added a (minimal) Objective-C runtime type vendor for Objective-C runtime version 1, to prevent regressions when calling class methods in the V1 runtime. Other components of this fix include: - We search the Objective-C runtime in a few more places. - We enable enumeration of all members of Objective-C classes, which Clang does in certain circumstances. - SBTarget::FindFirstType and SBTarget::FindTypes now query the Objective-C runtime as needed. - I fixed several test cases. <rdar://problem/12885034> llvm-svn: 170601
* Test suite cleanup for Linux: mark test cases expected to fail due to open ↵Daniel Malea2012-12-191-0/+1
| | | | | | | | bugzillas - bugzillas covered: 14323, 14600, 14541, 14437, 14540, 14541 llvm-svn: 170564
* Marking test_lldb_iter_frame in TestLLDBIterator.py as expectedFailureLinux ↵Andrew Kaylor2012-12-131-0/+1
| | | | | | (due to lack of multi-threaded debugging support). llvm-svn: 170074
* Marking TestPrintStackTraces.py as expectedFailureLinux (due to lack of ↵Andrew Kaylor2012-12-121-0/+1
| | | | | | multi-threaded debugging support). llvm-svn: 170043
* Remove decorator to skip event testsDaniel Malea2012-11-231-2/+0
| | | | | | - hang resolved in r168503 llvm-svn: 168530
* Update test status on LinuxDaniel Malea2012-11-237-0/+7
| | | | | | | | | - add decorators @expectedFailLinux and @skipOnLinux - skip/mark xfail cases due to open bugzillas # 14323, 14416, 14423, 14424, 14425, 14426 Patch by Ashok Thirumurthi! llvm-svn: 168529
* Temporarily skip tests known to hang on LinuxDaniel Malea2012-11-191-0/+2
| | | | | | - opened bugzilla defects #14384 and #14385 llvm-svn: 168323
* Patch from Dan Malea daniel.malea@gmail.com to add some requiredJason Molenda2012-11-084-0/+7
| | | | | | flags to the Linux makefiles to get the tests to run. llvm-svn: 167600
* Fixing the test case for rdar://12481949 to do the right thing with our new ↵Enrico Granata2012-10-241-2/+4
| | | | | | rules for sign-extension in GetValueAsUnsigned() llvm-svn: 166631
* <rdar://problem/12481949> Fixing SBValue.GetValueAsSigned() to do the right ↵Enrico Granata2012-10-243-0/+89
| | | | | | thing when dealing with a 32-bit negative value llvm-svn: 166603
* Fix all the test case breakages caused by folks writing tests all over the ↵Jim Ingham2012-09-222-12/+5
| | | | | | | | place that depended explicitly on the output of "break set". Please don't do this sort of thing!!!!! llvm-svn: 164433
* Initial commit of a new testsuite feature: test categories.Enrico Granata2012-09-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | This feature allows us to group test cases into logical groups (categories), and to only run a subset of test cases based on these categories. Each test-case can have a new method getCategories(self): which returns a list of strings that are the categories to which the test case belongs. If a test-case does not provide its own categories, we will look for categories in the class that contains the test case. If that fails too, the default implementation looks for a .category file, which contains a comma separated list of strings. The test suite will recurse look for .categories up until the top level directory (which we guarantee will have an empty .category file). The driver dotest.py has a new --category <foo> option, which can be repeated, and specifies which categories of tests you want to run. (example: ./dotest.py --category objc --category expression) All tests that do not belong to any specified category will be skipped. Other filtering options still exist and should not interfere with category filtering. A few tests have been categorized. Feel free to categorize others, and to suggest new categories that we could want to use. All categories need to be validly defined in dotest.py, or the test suite will refuse to run when you use them as arguments to --category. In the end, failures will be reported on a per-category basis, as well as in the usual format. This is the very first stage of this feature. Feel free to chime in with ideas for improvements! llvm-svn: 164403
* Added SBDebugger's log callbacks to Python-landFilipe Cabecinhas2012-08-251-6/+7
| | | | | | | | | | | | | | | | | | | - Tweaked a parameter name in SBDebugger.h so my typemap will catch it; - Added a SBDebugger.Create(bool, callback, baton) to the swig interface; - Added SBDebugger.SetLoggingCallback to the swig interface; - Added a callback utility function for log callbacks; - Guard against Py_None on both callback utility functions; - Added a FIXME to the SBDebugger API test; - Added a __del__() stub for SBDebugger. We need to be able to get both the log callback and baton from an SBDebugger if we want to protect against memory leaks (or make the user responsible for holding another reference to the callback). Additionally, it's impossible to revert from a callback-backed log mechanism to a file-backed log mechanism. llvm-svn: 162633
* Added a test for the Python part of SBInputReader callbacks.Filipe Cabecinhas2012-08-223-0/+57
| | | | llvm-svn: 162357
* Added a typemap and wrappers for SBInputReader callbacksFilipe Cabecinhas2012-08-221-1/+4
| | | | | | | | | | | | | | Now it's possible to use SBInputReader callbacks in Python. We leak the callback object, unfortunately. A __del__ method can be added to SBInputReader, but we have no way to check the callback function that is on the reader. So we can't call Py_DECREF on it when we have our PythonCallback function. One way to do it is to assume that reified SBInputReaders always have a Python callback (and always call Py_DECREF). Another one is to add methods or properties to SBInputReader (or make the m_callback_function property public). llvm-svn: 162356
* Fix a crash (_wrap_SBDebugger_SetInputFileHandle -> PyString_AsString) ↵Johnny Chen2012-08-201-1/+4
| | | | | | | | running the test suite. Also modify the boundary condition test case SBDebugger.DispatchInput(None) to be wrapped inside a try-except clause for now. llvm-svn: 162228
* A baton isn't needed to dispatch input.Filipe Cabecinhas2012-08-201-1/+1
| | | | | | I also added a typemap to make DispatchInput usable in Python. llvm-svn: 162204
* rdar://problem/11584012Johnny Chen2012-06-049-10/+68
| | | | | | | | | | | Refactorings of watchpoint creation APIs so that SBTarget::WatchAddress(), SBValue::Watch(), and SBValue::WatchPointee() now take an additional 'SBError &error' parameter (at the end) to contain the reason if there is some failure in the operation. Update 'watchpoint set variable/expression' commands to take advantage of that. Update existing test cases to reflect the API change and add test cases to verify that the SBError mechanism works for SBTarget::WatchAddress() by passing an invalid watch_size. llvm-svn: 157964
* Clean renamed files on 'make clean'Filipe Cabecinhas2012-05-301-0/+3
| | | | llvm-svn: 157669
* Add SBProcess::GetNumSupportedHardwareWatchpoints() API and export it ↵Johnny Chen2012-05-232-0/+26
| | | | | | | | through the Python scripting bridge. Add/modify some test cases. llvm-svn: 157353
* <rdar://problem/11358639>Greg Clayton2012-05-082-2/+2
| | | | | | | | Switch over to the "*-apple-macosx" for desktop and "*-apple-ios" for iOS triples. Also make the selection process for auto selecting platforms based off of an arch much better. llvm-svn: 156354
* Fixing the test case so that it runs correctly on i386 as well as on x86_64Enrico Granata2012-04-242-4/+6
| | | | llvm-svn: 155420
* Second batch of adding @dsym_test/@dwarf_test decorators to existing test cases.Johnny Chen2012-04-0624-3/+79
| | | | | | | Plus some minor cleanup of test method names. Third and final batch is coming. llvm-svn: 154197
* Added a new Host class: ReadWriteLockGreg Clayton2012-04-052-1/+4
| | | | | | | | | | | | This abstracts read/write locks on the current host system. It is currently backed by pthread_rwlock_t objects so it should work on all unix systems. We also need a way to control multi-threaded access to the process through the public API when it is running. For example it isn't a good idea to try and get stack frames while the process is running. To implement this, the lldb_private::Process class now contains a ReadWriteLock member variable named m_run_lock which is used to control the public process state. The public process state represents the state of the process as the client knows it. The private is used to control the actual current process state. So the public state of the process can be stopped, yet the private state can be running when evaluating an expression for example. Adding the read/write lock where readers are clients that want the process to stay stopped, and writers are clients that run the process, allows us to accurately control multi-threaded access to the process. Switched the SBThread and SBFrame over to us shared pointers to the ExecutionContextRef class instead of making their own class to track this. This fixed an issue with assigning on SBFrame to another and will also centralize the code that tracks weak references to execution context objects into one location. llvm-svn: 154099
* Synthetic values are now automatically enabled and active by default. ↵Enrico Granata2012-03-273-1/+85
| | | | | | | | | | | | SBValue is set up to always wrap a synthetic value when one is available. A new setting enable-synthetic-value is provided on the target to disable this behavior. There also is a new GetNonSyntheticValue() API call on SBValue to go back from synthetic to non-synthetic. There is no call to go from non-synthetic to synthetic. The test suite has been changed accordingly. Fallout from changes to type searching: an hack has to be played to make it possible to use maps that contain std::string due to the special name replacement operated by clang Fixing a test case that was using libstdcpp instead of libc++ - caught as a consequence of said changes to type searching llvm-svn: 153495
* Export the APIs submitted by Dawn to the Python bindings. Add a simple test ↵Johnny Chen2012-03-164-1/+39
| | | | | | case for the SBModule.compile_unit_iter() API. llvm-svn: 152952
* Add test case associated with:Johnny Chen2012-03-152-2/+66
| | | | | | | | | | rdar://problem/11034702 For the time being, skip the relevant disassemble action which resulted in a crash. Minor modification (print out format) to the existing TestDisassembleRawBytes.py test file. llvm-svn: 152822
* rdar://problem/10976649Johnny Chen2012-03-051-0/+62
| | | | | | | Add SBFrame::IsEqual(const SBFrame &that) method and export it to the Python binding. Alos add a test case test_frame_api_IsEqual() to TestFrames.py file. llvm-svn: 152050
* added a new formatter for CF(Mutable)BitVectorEnrico Granata2012-03-031-15/+30
| | | | | | | | fixed a few potential NULL-pointer derefs in ValueObject we have a way to provide docstrings for properties we add to the SWIG layer - a few of these properties have a docstring already, more will come in future commits added a new bunch of properties to SBData to make it more natural and Python-like to access the data they contain llvm-svn: 151962
* Adding formatters for several useful Objective-C/Cocoa data types. The new ↵Enrico Granata2012-02-171-0/+15
| | | | | | | | | | categories are not enabled at startup, but can be manually activated if desired. Adding new API calls to SBValue to be able to retrieve the associated formatters Some refactoring to FormatNavigator::Get() in order to shrink its size down to more manageable terms (a future, massive, refactoring effort will still be needed) Test cases added for the above llvm-svn: 150784
* adding a new test case for the SB formatters APIEnrico Granata2012-02-154-0/+327
| | | | llvm-svn: 150559
* Print out the frame only if self.TraceOn() is True.Johnny Chen2012-02-061-1/+2
| | | | llvm-svn: 149893
* Removed all of the "#ifndef SWIG" from the SB header files since we are usingGreg Clayton2012-02-064-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | interface (.i) files for each class. Changed the FindFunction class from: uint32_t SBTarget::FindFunctions (const char *name, uint32_t name_type_mask, bool append, lldb::SBSymbolContextList& sc_list) uint32_t SBModule::FindFunctions (const char *name, uint32_t name_type_mask, bool append, lldb::SBSymbolContextList& sc_list) To: lldb::SBSymbolContextList SBTarget::FindFunctions (const char *name, uint32_t name_type_mask = lldb::eFunctionNameTypeAny); lldb::SBSymbolContextList SBModule::FindFunctions (const char *name, uint32_t name_type_mask = lldb::eFunctionNameTypeAny); This makes the API easier to use from python. Also added the ability to append a SBSymbolContext or a SBSymbolContextList to a SBSymbolContextList. Exposed properties for lldb.SBSymbolContextList in python: lldb.SBSymbolContextList.modules => list() or all lldb.SBModule objects in the list lldb.SBSymbolContextList.compile_units => list() or all lldb.SBCompileUnits objects in the list lldb.SBSymbolContextList.functions => list() or all lldb.SBFunction objects in the list lldb.SBSymbolContextList.blocks => list() or all lldb.SBBlock objects in the list lldb.SBSymbolContextList.line_entries => list() or all lldb.SBLineEntry objects in the list lldb.SBSymbolContextList.symbols => list() or all lldb.SBSymbol objects in the list This allows a call to the SBTarget::FindFunctions(...) and SBModule::FindFunctions(...) and then the result can be used to extract the desired information: sc_list = lldb.target.FindFunctions("erase") for function in sc_list.functions: print function for symbol in sc_list.symbols: print symbol Exposed properties for the lldb.SBSymbolContext objects in python: lldb.SBSymbolContext.module => lldb.SBModule lldb.SBSymbolContext.compile_unit => lldb.SBCompileUnit lldb.SBSymbolContext.function => lldb.SBFunction lldb.SBSymbolContext.block => lldb.SBBlock lldb.SBSymbolContext.line_entry => lldb.SBLineEntry lldb.SBSymbolContext.symbol => lldb.SBSymbol Exposed properties for the lldb.SBBlock objects in python: lldb.SBBlock.parent => lldb.SBBlock for the parent block that contains lldb.SBBlock.sibling => lldb.SBBlock for the sibling block to the current block lldb.SBBlock.first_child => lldb.SBBlock for the first child block to the current block lldb.SBBlock.call_site => for inline functions, return a lldb.declaration object that gives the call site file, line and column lldb.SBBlock.name => for inline functions this is the name of the inline function that this block represents lldb.SBBlock.inlined_block => returns the inlined function block that contains this block (might return itself if the current block is an inlined block) lldb.SBBlock.range[int] => access the address ranges for a block by index, a list() with start and end address is returned lldb.SBBlock.ranges => an array or all address ranges for this block lldb.SBBlock.num_ranges => the number of address ranges for this blcok SBFunction objects can now get the SBType and the SBBlock that represents the top scope of the function. SBBlock objects can now get the variable list from the current block. The value list returned allows varaibles to be viewed prior with no process if code wants to check the variables in a function. There are two ways to get a variable list from a SBBlock: lldb::SBValueList SBBlock::GetVariables (lldb::SBFrame& frame, bool arguments, bool locals, bool statics, lldb::DynamicValueType use_dynamic); lldb::SBValueList SBBlock::GetVariables (lldb::SBTarget& target, bool arguments, bool locals, bool statics); When a SBFrame is used, the values returned will be locked down to the frame and the values will be evaluated in the context of that frame. When a SBTarget is used, global an static variables can be viewed without a running process. llvm-svn: 149853
* Convert all python objects in our API to use overload the __str__ methodGreg Clayton2012-02-043-9/+10
| | | | | | | | | | | | | | | | instead of the __repr__. __repr__ is a function that should return an expression that can be used to recreate an python object and we were using it to just return a human readable string. Fixed a crasher when using the new implementation of SBValue::Cast(SBType). Thread hardened lldb::SBValue and lldb::SBWatchpoint and did other general improvements to the API. Fixed a crasher in lldb::SBValue::GetChildMemberWithName() where we didn't correctly handle not having a target. llvm-svn: 149743
* Added fuzz testing for when we call API calls with an invalid object.Greg Clayton2012-01-313-1/+33
| | | | | | | | | We previously weren't catching that SBValue::Cast(...) would crash if we had an invalid (empty) SBValue object. Cleaned up the SBType API a bit. llvm-svn: 149447
* Dump the raw bytes and the disassembled instruction before calling ↵Johnny Chen2012-01-231-3/+3
| | | | | | | | self.assertTrue() instead of after, in case the assert fails for any reason. llvm-svn: 148717
* Add comment regarding TestHelloWorld.py's use of a dictionary to ↵Johnny Chen2012-01-181-0/+1
| | | | | | specify/overwrite the EXE name. llvm-svn: 148418
* Modify the test cases so that each uses a unique executable name for the ↵Johnny Chen2012-01-181-8/+15
| | | | | | | | | debugger to attach/launch. I've see cases where there are lingering processes ("hello_world") staying around and the test_with_dsym_and_attach_to_process_with_name_api() test case just hangs. llvm-svn: 148417
* rdar://problem/10492827Johnny Chen2012-01-122-3/+5
| | | | | | | | | | | | | | SBProcess.GetSTDERR() not getting stderr of the launched process Since we are launch the inferior with: process = target.LaunchSimple(None, None, os.getcwd()) i.e., without specifying stdin/out/err. A pseudo terminal is used for handling the process I/O, and we are satisfied once the expected output appears in process.GetSTDOUT(). llvm-svn: 147983
* Patch from Enrico Granata that moves SBData related functions into the SBDataGreg Clayton2012-01-071-6/+43
| | | | | | | class instead of requiring a live process in order to be able to create useful SBData objects. llvm-svn: 147702
* http://llvm.org/bugs/show_bug.cgi?id=11619Johnny Chen2012-01-061-0/+42
| | | | | | | | Allow creating SBData values from arrays or primitives in Python Patch submitted by Enrico Granata. llvm-svn: 147639
OpenPOWER on IntegriCloud