summaryrefslogtreecommitdiffstats
path: root/lldb/examples
Commit message (Collapse)AuthorAgeFilesLines
...
* One line I forgot to remove.Jason Molenda2013-04-231-1/+0
| | | | llvm-svn: 180086
* Update the unwind_diagnose script to work correctly with bothJason Molenda2013-04-231-48/+10
| | | | | | | | | | | lldb-179 version numberings and the new lldb-300 version numberings. Remove the pretense that someone might run this from the command line; this is only used from within a live lldb debug session. Fix the loading so it can be loaded via "script import lldb.macosx" or the script can be loaded individually like "command script import unwind_diagnose.py" llvm-svn: 180085
* Add a new -a / --address argument to image show-unwind to get theJason Molenda2013-04-231-1/+4
| | | | | | | | | | | unwind instructions for a function/symbol which contains that address. Update the unwind_diagnose.py script to use this instead of doing image show-unwind by name to avoid cases where there are multiple name definitions. llvm-svn: 180079
* Add a new python file to help diagnose backtrace failures in the field.Jason Molenda2013-04-231-0/+197
| | | | | | | | | | | | | | | It will be installed in the LLDB.framework and can be loaded with (lldb) script import lldb.macosx after which a "unwind-diagnose" command will be registered. Select the thread which has a bad backtrace and run this command -- a lot of information about the stack frames, and an alternate backtrace algorithm, will be used. The information will often be sufficient for a remote person to figure out why the backtrace failed. <rdar://problem/13679300> llvm-svn: 180077
* <rdar://problem/13477795>Greg Clayton2013-04-042-3/+10
| | | | | | crashlog.py was always subtracting 1 to point to the previous instruction when symbolicating ARM backtraces. Many times the backtraces will include bit zero set to 1 to indicate thumb, so we need to make sure we mask the address and then backup one for non frame zero frames. llvm-svn: 178812
* Playing around with making performance test cases run from within python. Greg Clayton2013-04-031-25/+122
| | | | llvm-svn: 178708
* <rdar://problem/13416800>Greg Clayton2013-04-031-4/+21
| | | | | | ptr_refs command frequently doesn't work when run in large applicaton. This was due to the default timeout of 500ms. The timeouts have now been increased and all expression evaluations have been modified. llvm-svn: 178628
* A few more tweaks to the python perf tests. Now there is a MemoryMeasurement.Greg Clayton2013-03-261-19/+60
| | | | llvm-svn: 178069
* Added a python version of the performance tests. It will be good to see if ↵Greg Clayton2013-03-231-0/+197
| | | | | | the overhead of python interferes at all with our performance readings. We can try things out with this script and see how things go. llvm-svn: 177811
* This checkin removes the last Cocoa formatters that were implemented in ↵Enrico Granata2013-03-191-1/+2
| | | | | | Python and reimplements them in C++. The Python Cocoa formatters are not shipped as part of LLDB anymore, but still exist in the source repository for user reference. Python formatters still exist for STL classes and users can still define their own Python formatters llvm-svn: 177366
* NS(Mutable)IndexSet formatter moves from Python to C++Enrico Granata2013-03-161-1/+2
| | | | llvm-svn: 177217
* Converting more data formatters to C++ - NSBundle, CFBinaryHeap, NSMachPort ↵Enrico Granata2013-03-165-5/+10
| | | | | | and NSNotification llvm-svn: 177213
* Created a sample "jump" command that handlesSean Callanan2013-03-121-0/+173
| | | | | | | GDB-style linespecs. This command allows changing the PC without manually looking up the new address. llvm-svn: 176841
* Initial checkin of a new project: LLDB Performance Testing InfrastructureEnrico Granata2013-03-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a very basic implementation of a library that easily allows to drive LLDB.framework to write test cases for performance This is separate from the LLDB testsuite in test/ in that: a) this uses C++ instead of Python to avoid measures being affected by SWIG b) this is in very early development and needs lots of tweaking before it can be considered functionally complete c) this is not meant to test correctness but to help catch performance regressions There is a sample application built against the library (in darwin/sketch) that uses the famous sample app Sketch as an inferior to measure certain basic parameters of LLDB's behavior. The resulting output is a PLIST much like the following: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <array> <dict> <key>fetch-frames</key> <real>0.13161715522222225</real> </dict> <dict> <key>file-line-bkpt</key> <real>0.029111678750000002</real> </dict> <dict> <key>fetch-modules</key> <real>0.00026376766666666668</real> </dict> <dict> <key>fetch-vars</key> <real>0.17820429311111111</real> </dict> <dict> <key>run-expr</key> <real>0.029676525769230768</real> </dict> </array> </plist> Areas for improvement: - code cleanups (I will be out of the office for a couple days this coming week, but please keep ideas coming!) - more metrics and test cases - better error checking This toolkit also comprises a simple event-loop-driven controller for LLDB, similar yet much simpler to what the Driver does to implement the lldb command-line tool. llvm-svn: 176715
* Added a new module that can dump all line tables for all compile units in ↵Greg Clayton2013-03-071-0/+59
| | | | | | | | any modules that are specified as arguments to the "dump_module_line_tables" command. I used this to verify that the debug map line tables were the same as previous LLDB releases prior to my change in the DWARF in .o file linking. llvm-svn: 176610
* Being explicit about how ignoring optparse's exceptions is not a best principleEnrico Granata2013-02-251-0/+2
| | | | llvm-svn: 176059
* Added missing lldb module namespace.Greg Clayton2013-02-251-1/+1
| | | | llvm-svn: 176049
* <rdar://problem/13286937> Greg Clayton2013-02-251-3/+13
| | | | | | Make sure to not look in self.images when we have a symbolicator with a live process. llvm-svn: 176040
* Using __package__ and __name__ seems redundant - __name__ should always ↵Enrico Granata2013-02-221-11/+4
| | | | | | contain the fully qualified module name llvm-svn: 175856
* Mark the command as failed if parsing fails.Jim Ingham2013-02-211-0/+1
| | | | llvm-svn: 175776
* Quick fix for the libc++ std::map synthetic children providerEnrico Granata2013-02-092-4/+8
| | | | | | | | If you try to access any child > 0 without having touched child 0, LLDB won't be able to reconstruct type information from the debug info. Previously, we would fail. Now, we simply go fetch child 0 and then come back. llvm-svn: 174795
* Allow the target to give out the size of the red zone for given ABIs.Greg Clayton2013-02-011-79/+206
| | | | | | A bit of cleanup in the heap module. llvm-svn: 174129
* Added the ability to search segments for data. Currently __TEXT, __LINKEDIT ↵Greg Clayton2013-01-311-251/+138
| | | | | | | | and __PAGEZERO are excluded. Added many more cleanups to the output. llvm-svn: 174045
* expressions + C++11 lambdas == cooooool!!!Greg Clayton2013-01-301-112/+641
| | | | | | | | | | C++11 lambdas that don't capture anything can be used as static callback functions! Heavily modified this python module to be able to not require a dylib in order to traverse the heap allocations. Re-implemented the ptr_refs, objc_refs, malloc_info and cstr_refs to use complex expressions that use lambdas to do all static callback function work. llvm-svn: 173989
* <rdar://problem/12552374> & <rdar://problem/13100674>Enrico Granata2013-01-301-12/+0
| | | | | | The vtable pointer field is not necessarily a pointer and hence cannot be used for validation llvm-svn: 173947
* <rdar://problem/13069948>Greg Clayton2013-01-251-1/+2
| | | | | | | | | | | | Major fixed to allow reading files that are over 4GB. The main problems were that the DataExtractor was using 32 bit offsets as a data cursor, and since we mmap all of our object files we could run into cases where if we had a very large core file that was over 4GB, we were running into the 4GB boundary. So I defined a new "lldb::offset_t" which should be used for all file offsets. After making this change, I enabled warnings for data loss and for enexpected implicit conversions temporarily and found a ton of things that I fixed. Any functions that take an index internally, should use "size_t" for any indexes and also should return "size_t" for any sizes of collections. llvm-svn: 173463
* <rdar://problem/13011717>Greg Clayton2013-01-191-1/+4
| | | | | | Fixed a compilation error that occurs when "lldb.macosx.heap" is imported and "ptr_refs" is used. llvm-svn: 172876
* <rdar://problem/13010007>Greg Clayton2013-01-181-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | Added the ability for OS plug-ins to lazily populate the thread this. The python OS plug-in classes can now implement the following method: class OperatingSystemPlugin: def create_thread(self, tid, context): # Return a dictionary for a new thread to create it on demand This will add a new thread to the thread list if it doesn't already exist. The example code in lldb/examples/python/operating_system.py has been updated to show how this call us used. Cleaned up the code in PythonDataObjects.cpp/h: - renamed all classes that started with PythonData* to be Python*. - renamed PythonArray to PythonList. Cleaned up the code to use inheritance where - Centralized the code that does ref counting in the PythonObject class to a single function. - Made the "bool PythonObject::Reset(PyObject *)" function be virtual so each subclass can correctly check to ensure a PyObject is of the right type before adopting the object. - Cleaned up all APIs and added new constructors for the Python* classes to they can all construct form: - PyObject * - const PythonObject & - const lldb::ScriptInterpreterObjectSP & Cleaned up code in ScriptInterpreterPython: - Made calling python functions safer by templatizing the production of value formats. Python specifies the value formats based on built in C types (long, long long, etc), and code often uses typedefs for uint32_t, uint64_t, etc when passing arguments down to python. We will now always produce correct value formats as the templatized code will "do the right thing" all the time. - Fixed issues with the ScriptInterpreterPython::Locker where entering the session and leaving the session had a bunch of issues that could cause the "lldb" module globals lldb.debugger, lldb.target, lldb.process, lldb.thread, and lldb.frame to not be initialized. llvm-svn: 172873
* Replacing reference to radar number with svn revisionEnrico Granata2013-01-161-1/+1
| | | | llvm-svn: 172641
* Greg created a new API on SBProcess to get an ID that is guaranteed to be ↵Enrico Granata2013-01-161-1/+1
| | | | | | | | unique even in situations where underlying platforms would actually duplicate or hardcode PIDs The Python data formatters use a per-process cache that was previously keying off the PID. Moving that to be based on this new notion of unique ID. llvm-svn: 172633
* <rdar://problem/13011717> Greg Clayton2013-01-151-1/+1
| | | | | | Fixed a compilation error where NULL was being assigned to a uint. llvm-svn: 172566
* Made crashlog.py handle cases where a parentSean Callanan2013-01-121-3/+5
| | | | | | | | | process's name contains spaces. Thanks to Justin Seyster for the patch. <rdar://problem/13002540> llvm-svn: 172294
* <rdar://problem/12239827>Enrico Granata2013-01-121-0/+3
| | | | | | Making a summary for std::wstring as provided by libstdc++ along with a relevant test case llvm-svn: 172286
* Updated documentation on the "register_data_addr" key that can be supplied ↵Greg Clayton2013-01-091-0/+5
| | | | | | in the "thread" dictionary return value for the python OS plug-ins. llvm-svn: 171934
* Tweaking a comment in the NSURL formatter for correctness - the code was ↵Enrico Granata2012-12-181-1/+4
| | | | | | doing the right thing, but the comment was highly misleading llvm-svn: 170441
* <rdar://problem/12848118>Enrico Granata2012-12-102-44/+5
| | | | | | | Making MightHaveChildren() always return true regardless for our own data formatters This is meant to optimize performance for common most-often-not-empty container classes llvm-svn: 169759
* <rdar://problem/12817233>Enrico Granata2012-12-101-2/+2
| | | | | | Change the wording of NSNumber summary from absurd value to unexpected value when a tagged pointer shows up that does not match our knowledge of the internals llvm-svn: 169751
* Replace printf with result.Printf, so that the plugin shows its output with ↵Enrico Granata2012-10-301-1/+1
| | | | | | any configuration of the LLDB I/O streams (esp. useful in graphic environments such as Xcode) llvm-svn: 167030
* Allow operating system plug-ins to specify the address for registers so we ↵Greg Clayton2012-10-251-1/+1
| | | | | | don't have to create data up front. llvm-svn: 166701
* Changing the NSDate data formatter to use GetData().uint64[] instead of ↵Enrico Granata2012-10-241-3/+3
| | | | | | relying on SBValue.GetValueAsUnsigned() to reinterpret a double as a uint64_t llvm-svn: 166610
* <rdar://problem/12523238> Commit 2 of 3Enrico Granata2012-10-233-0/+70
| | | | | | | | | | | Adding the new has_children (or MightHaveChildren() in C++) for the existing synthetic children providers In a few cases, the new call is going to be much more efficient than the previous num_children > 0 check When the optimization was marginal (e.g. std::vector<>), the choice was to use num_children in order to keep implementation details in one function instead of duplicating code Next step is to provide test cases llvm-svn: 166506
* Proper copyright noticeEnrico Granata2012-10-221-0/+9
| | | | llvm-svn: 166443
* <rdar://problem/12491420>Greg Clayton2012-10-181-1/+1
| | | | | | | | | | Added a new setting that allows a python OS plug-in to detect threads and provide registers for memory threads. To enable this you set the setting: settings set target.process.python-os-plugin-path lldb/examples/python/operating_system.py Then run your program and see the extra threads. llvm-svn: 166244
* Checking in fixes that I used to track down a leaking module. The heap ↵Greg Clayton2012-10-082-23/+150
| | | | | | module can now search the vm regions with the --vm-regions options to any of the heap functions. This is currently slow and often will time out when run on a large program since our user expression timeout is set to 500000 usec. We need to add an API to LLDB where we can specify the timeout for an expression. llvm-svn: 165437
* <rdar://problem/12426557> Fixing the NSIndexSet data formatterEnrico Granata2012-10-051-11/+18
| | | | llvm-svn: 165341
* Implementing plugins that provide commands.Enrico Granata2012-09-281-0/+47
| | | | | | | | | | | | | | | | | | | This checkin adds the capability for LLDB to load plugins from external dylibs that can provide new commands It exports an SBCommand class from the public API layer, and a new SBCommandPluginInterface There is a minimal load-only plugin manager built into the debugger, which can be accessed via Debugger::LoadPlugin. Plugins are loaded from two locations at debugger startup (LLDB.framework/Resources/PlugIns and ~/Library/Application Support/LLDB/PlugIns) and more can be (re)loaded via the "plugin load" command For an example of how to make a plugin, refer to the fooplugin.cpp file in examples/plugins/commands Caveats: Currently, the new API objects and features are not exposed via Python. The new commands can only be "parsed" (i.e. not raw) and get their command line via a char** parameter (we do not expose our internal Args object) There is no unloading feature, which can potentially lead to leaks if you overwrite the commands by reloading the same or different plugins There is no API exposed for option parsing, which means you may need to use getopt or roll-your-own llvm-svn: 164865
* Added process attach options and also use the SBLaunchInfo and SBAttachInfo.Greg Clayton2012-09-251-14/+72
| | | | llvm-svn: 164619
* Added auto LLDB import to the crashlog script.Greg Clayton2012-09-191-2/+32
| | | | llvm-svn: 164192
* <rdar://problem/11398693> Making sure we do not attempt to run code on ↵Enrico Granata2012-09-181-3/+5
| | | | | | zombie objects when attempting to format them llvm-svn: 164156
* Fix a potential issue where data formatters can get confused over malformed ↵Enrico Granata2012-09-181-1/+4
| | | | | | UUIDs llvm-svn: 164151
OpenPOWER on IntegriCloud