summaryrefslogtreecommitdiffstats
path: root/lldb/examples
Commit message (Collapse)AuthorAgeFilesLines
...
* <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
* <rdar://problem/12161825> Rephrase formatter for NSIndexSet in terms of ↵Enrico Granata2012-09-181-1/+1
| | | | | | indexes instead of objects llvm-svn: 164149
* Making sure to create the count attribute in synthetic children providers ↵Enrico Granata2012-09-131-0/+2
| | | | | | for libcxx at the right time llvm-svn: 163823
* Modified the command template to include best practices.Greg Clayton2012-09-131-17/+24
| | | | llvm-svn: 163773
* Don't allow an extra entry to slip into the heap results and also add a ↵Greg Clayton2012-09-122-15/+42
| | | | | | better output format llvm-svn: 163675
* Added some documentation and an accessor for the target with an explanation ↵Greg Clayton2012-09-121-1/+21
| | | | | | of why to not use "lldb.target". llvm-svn: 163671
* Added "heap" command to get info on all allocations on the heap. Currently ↵Greg Clayton2012-09-112-39/+113
| | | | | | only objective C objects are supported since they are easy to detect. llvm-svn: 163637
* Print the stack size followed by the full stack info.Greg Clayton2012-09-111-2/+2
| | | | llvm-svn: 163589
* Added a python example that will compute which functions in a process are ↵Greg Clayton2012-09-101-0/+56
| | | | | | hogging the stack. llvm-svn: 163543
* Playing around with "objc_refs" over the weekend and improved it to work on ↵Greg Clayton2012-09-102-34/+253
| | | | | | a large ObjC program without running into expression timeouts. Now we get a full list of ObjC classes using a runtime function and then qsort the result. Also added code that can count all instances of each ObjC on the heap and also the total byte sizes for the object allocations. llvm-svn: 163520
* Don't allocate memory when enumerting stack. We now have fixed size buffers ↵Greg Clayton2012-09-081-61/+147
| | | | | | to avoid this issue. llvm-svn: 163441
* Added a quick example to show how disasembly output can be customized.Greg Clayton2012-09-071-0/+24
| | | | llvm-svn: 163421
* <rdar://problem/12068655> Make sure [NSDate distantPast] is formatted correctlyEnrico Granata2012-09-041-0/+4
| | | | llvm-svn: 163162
* Editing a comment to make sure people know not to blame CFString.py for ↵Enrico Granata2012-09-041-2/+2
| | | | | | CFString summary errors llvm-svn: 163157
* <rdar://problem/11485744> Implement important data formatters in C++. Have ↵Enrico Granata2012-09-044-4/+8
| | | | | | the Objective-C language runtime plugin expose class descriptors objects akin to the objc_runtime.py Pythonic implementation. Rewrite the data formatters for some core Cocoa classes in C++ instead of Python. llvm-svn: 163155
* Improved "objc_refs" a bit to be able to find all instances of a class'Greg Clayton2012-09-043-13/+132
| | | | | | | superclasses on top of finding the exact class. The current attempt is still too slow, but it lays the groundwork. llvm-svn: 163135
* <rdar://problem/12069589>Greg Clayton2012-09-012-52/+49
| | | | | | | | Fixed an issue where not all text would always be seen when running any of the functions in heap.py in Xcode. Now we put the text directly into the command result object and skip STDIO since we have issues with STDIO right now in python scripts. Also fixed an issue with the "--stack-history" option where MallocStackLoggingNoCompact was assumed to have to be enabled... It doesn't, just MallocStackLogging. llvm-svn: 163042
* Make the tab character in the thread frame lines optional.Jason Molenda2012-08-311-1/+1
| | | | llvm-svn: 163037
OpenPOWER on IntegriCloud