summaryrefslogtreecommitdiffstats
path: root/lldb/examples
Commit message (Collapse)AuthorAgeFilesLines
...
* Optimizations to the Python ObjC formatters - Benchmarking infrastructureEnrico Granata2012-05-182-3/+27
| | | | llvm-svn: 157066
* Make sure to subtract one from the PC when doing the symbolication of stack ↵Greg Clayton2012-05-171-1/+6
| | | | | | frames when it isn't the zero'th frame. llvm-svn: 156974
* Fixed an exception when parsing crash logs.Greg Clayton2012-05-161-1/+2
| | | | llvm-svn: 156945
* Fixing a bug where the summary for certain NSStrings was being returned as ↵Enrico Granata2012-05-151-4/+9
| | | | | | empty in spite of the string actually having a content llvm-svn: 156793
* Remove comments and an extra print statement.Greg Clayton2012-05-111-2/+0
| | | | llvm-svn: 156651
* More fixes to "malloc_history".Greg Clayton2012-05-112-64/+90
| | | | llvm-svn: 156605
* Modified the symbolication.Image object to store its uuid as a uuid.UUID ↵Greg Clayton2012-05-112-27/+44
| | | | | | | | object and made an accessor for getting a normalized UUID value out of the image object. Modified the crashlog darwin module to always create a uuid.UUID object when making the symbolication.Image objects. Also modified it to handle some more types of crash log files and improved the register reading for thread registers of crashed threads. llvm-svn: 156596
* "--stack-history" now works if you have MallocStackLogggingNoCompact defined ↵Greg Clayton2012-05-102-8/+14
| | | | | | in your app's environment. llvm-svn: 156588
* Fixed a build error.Greg Clayton2012-05-101-2/+2
| | | | llvm-svn: 156586
* Added the ability to get the stack history for a malloc block. This is a ↵Greg Clayton2012-05-102-2/+101
| | | | | | work in progress. Checking this in so I can work on it some more. llvm-svn: 156584
* Make crashlog.py more robust when dealing with the "Version: ..." header ↵Johnny Chen2012-05-101-2/+8
| | | | | | | | from the crash log file. rdar://problem/11428134 llvm-svn: 156581
* A simple implementation of a summary and synthetic children providers for ↵Enrico Granata2012-05-081-0/+61
| | | | | | LLDB-specific shared pointers - This could be generalized to work with C++11 shared pointers with relative ease llvm-svn: 156410
* Added an interactive mode to the "crashlog" command so that we can look at ↵Greg Clayton2012-05-042-84/+184
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | multiple crash logs at once and do some data mining. Added an interactive command prompt that allows you to do: % PYTHONPATH=./build/Debug/LLDB.framework/Resources/Python ; ./build/Debug//LLDB.framework/Resources/Python/lldb/macosx/crashlog.py -i ~/Downloads/crashes2/*.crash ) then you get an interactive prompt where you can search for data within all crash logs. For example you can do: % list which will list all crash logs And you can search for all images given an image basename, or full path: % image LLDB % image /Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/LLDB % image LLDB.framework Which would all produce an output listing like: 40CD4430-7D27-3248-BE4C-71B1F36FC5D0 (1.132 - 132) /Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/LLDB, __TEXT=[0x000000011f8bc000 - 0x0000000120d3efbf) B727A528-FF1F-3B20-9E4F-BBE96C7D922D (1.136 - 136) /Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/LLDB, __TEXT=[0x000000011e7f7000 - 0x000000011fc7ff87) 4D6F8DC2-5757-39C7-96B0-1A5B5171DC6B (1.137 - 137) /Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/LLDB, __TEXT=[0x000000012bd7f000 - 0x000000012d1fcfef) FBF8786F-92B9-31E3-8BCD-A82148338966 (1.137 - 137) /Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/LLDB, __TEXT=[0x0000000122d78000 - 0x00000001241f5fd7) 7AE082E3-3BB7-3F64-A308-063E559DFC45 (1.143 - 143) /Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/LLDB, __TEXT=[0x0000000119b8d000 - 0x000000011b02ef5f) 7AE082E3-3BB7-3F64-A308-063E559DFC45 (1.143 - 143) /Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/LLDB, __TEXT=[0x0000000111497000 - 0x0000000112938f5f) 7AE082E3-3BB7-3F64-A308-063E559DFC45 (1.143 - 143) /Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/LLDB, __TEXT=[0x0000000116680000 - 0x0000000117b21f5f) llvm-svn: 156201
* Fix the following error when importing crashlog.py from a Python interactive ↵Johnny Chen2012-05-031-1/+1
| | | | | | | | session: AttributeError: 'module' object has no attribute 'debugger' llvm-svn: 156115
* Fix AttributeError when using crashlog with verbose mode.Johnny Chen2012-05-031-1/+4
| | | | | | rdar://problem/11374653 llvm-svn: 156088
* Automatically enabling the Cocoa formatter categories for command-line LLDB. ↵Enrico Granata2012-04-261-1/+1
| | | | | | Previously, the categories were filled in but disabled by default. Tweaking test cases appropriately to keep working and do the right thing llvm-svn: 155605
* Make the libheap.dylib build into a consistent temp directory so it can be ↵Greg Clayton2012-04-251-9/+13
| | | | | | | | reused between lldb invocations. Also add the module name into the directory path that is used to store the target triple specific build of libheap.dylib. Also added code that will rebuild libheap.dylib if heap_find.cpp is newer that libheap.dylib. llvm-svn: 155590
* Fixing a typo in the NSArray data formatterEnrico Granata2012-04-251-1/+1
| | | | llvm-svn: 155586
* Remove the "-x" from the finish-swig-Python-LLDB.sh shell options so it ↵Greg Clayton2012-04-254-56/+52
| | | | | | | | doesn't print out all of the commands when executing the shell script. Cleaned up the lldb.utils.symbolication, lldb.macosx.heap and lldb.macosx.crashlog. The lldb.macosx.heap can now build a dylib for the current triple into a temp directory and use it from there. llvm-svn: 155577
* Returning data formatters to their previous working condition - Plus fixing ↵Enrico Granata2012-04-2519-114/+114
| | | | | | an issue that was preventing Python oneliners from executing llvm-svn: 155563
* Fixing an over-substitution of textEnrico Granata2012-04-252-80/+80
| | | | llvm-svn: 155556
* Make the C++ formatters importable by having them use the right package to ↵Enrico Granata2012-04-252-82/+82
| | | | | | import and reference the Logger llvm-svn: 155555
* Now that we have an LLDB package, make the "lldb.macosx.crashlog" module ↵Greg Clayton2012-04-252-17/+18
| | | | | | work with all of the new module paths. llvm-svn: 155528
* Making the Cocoa formatters comply with the new on-disk layout of the Python ↵Enrico Granata2012-04-2519-328/+328
| | | | | | resources - This is one of the steps towards making the data formatters work again llvm-svn: 155526
* Remove unneeded files.Greg Clayton2012-04-252-380/+0
| | | | llvm-svn: 155524
* Move the source and Makefile into a directory so it will be easier to install.Greg Clayton2012-04-252-0/+380
| | | | llvm-svn: 155523
* Make the Makefile stand alone.Greg Clayton2012-04-251-5/+46
| | | | llvm-svn: 155520
* Maked LLDB into a package so we can import things without poluting the ↵Greg Clayton2012-04-251-133/+0
| | | | | | | | global namespace. Enrico will follow this up with fixing the data formatter test cases that are failing. llvm-svn: 155514
* Added code to automatically load the libheap.dylib when ptr_refs, cstr_refs ↵Greg Clayton2012-04-212-2/+81
| | | | | | or malloc_info are called. If MallocStackLogging is enabled, then you can now use --stack to dump the backtrace of the code that allocated each malloc block. llvm-svn: 155262
* Fixed some issues with symbolicating things. Fixed ↵Greg Clayton2012-04-202-12/+10
| | | | | | symbolication.add_module() to not use the resolved_path before we have tried to locate it. Fixed crashlog.locate_module_and_debug_symbols() to return true and false correctly. llvm-svn: 155255
* Add the capability of supplying the pre/post-flight functions to the test ↵Johnny Chen2012-04-163-0/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | suite such that the pre-flight code gets executed during setUp() after the debugger instance is available and the post-flight code gets executed during tearDown() after the debugger instance has done killing the inferior and deleting all the target programs. Example: [11:32:48] johnny:/Volumes/data/lldb/svn/ToT/test $ ./dotest.py -A x86_64 -v -c ../examples/test/.lldb-pre-post-flight functionalities/watchpoint/hello_watchpoint config: {'pre_flight': <function pre_flight at 0x1098541b8>, 'post_flight': <function post_flight at 0x109854230>} LLDB build dir: /Volumes/data/lldb/svn/ToT/build/Debug LLDB-139 Path: /Volumes/data/lldb/svn/ToT URL: https://johnny@llvm.org/svn/llvm-project/lldb/trunk Repository Root: https://johnny@llvm.org/svn/llvm-project Repository UUID: 91177308-0d34-0410-b5e6-96231b3b80d8 Revision: 154753 Node Kind: directory Schedule: normal Last Changed Author: gclayton Last Changed Rev: 154730 Last Changed Date: 2012-04-13 18:42:46 -0700 (Fri, 13 Apr 2012) lldb.pre_flight: def pre_flight(test): __import__("lldb") __import__("lldbtest") print "\nRunning pre-flight function:" print "for test case:", test lldb.post_flight: def post_flight(test): __import__("lldb") __import__("lldbtest") print "\nRunning post-flight function:" print "for test case:", test Session logs for test failures/errors/unexpected successes will go into directory '2012-04-16-11_34_08' Command invoked: python ./dotest.py -A x86_64 -v -c ../examples/test/.lldb-pre-post-flight functionalities/watchpoint/hello_watchpoint compilers=['clang'] Configuration: arch=x86_64 compiler=clang ---------------------------------------------------------------------- Collected 2 tests 1: test_hello_watchpoint_with_dsym_using_watchpoint_set (TestMyFirstWatchpoint.HelloWatchpointTestCase) Test a simple sequence of watchpoint creation and watchpoint hit. ... Running pre-flight function: for test case: test_hello_watchpoint_with_dsym_using_watchpoint_set (TestMyFirstWatchpoint.HelloWatchpointTestCase) Running post-flight function: for test case: test_hello_watchpoint_with_dsym_using_watchpoint_set (TestMyFirstWatchpoint.HelloWatchpointTestCase) ok 2: test_hello_watchpoint_with_dwarf_using_watchpoint_set (TestMyFirstWatchpoint.HelloWatchpointTestCase) Test a simple sequence of watchpoint creation and watchpoint hit. ... Running pre-flight function: for test case: test_hello_watchpoint_with_dwarf_using_watchpoint_set (TestMyFirstWatchpoint.HelloWatchpointTestCase) Running post-flight function: for test case: test_hello_watchpoint_with_dwarf_using_watchpoint_set (TestMyFirstWatchpoint.HelloWatchpointTestCase) ok ---------------------------------------------------------------------- Ran 2 tests in 1.584s OK llvm-svn: 154847
* Added a --lldb option to override the locationSean Callanan2012-04-141-15/+19
| | | | | | of LLDB.framework. llvm-svn: 154728
* Added a --memory option to allow dumping the matching malloc block memory ↵Greg Clayton2012-04-131-11/+23
| | | | | | with a default format that makes sense, or that format can be overridden with the --format option. llvm-svn: 154671
* Fixed some expression issues after switching to void * args.Greg Clayton2012-04-121-2/+2
| | | | llvm-svn: 154615
* A few tweaks done to the heap.py in me free time where we now have:Greg Clayton2012-04-122-147/+234
| | | | | | | | | | | | | | | (lldb) command script import heap.py Find all malloc blocks that contains a pointer value of 0x1234000: (lldb) ptr_refs 0x1234000 Find all malloc blocks that contain a C string: (lldb) cstr_refs "hello" Get info on a malloc block that starts at or contains 0x12340000 (lldb) malloc_info 0x12340000 llvm-svn: 154602
* Cleaned up the code and we now also dump the dynamic object for the malloc ↵Greg Clayton2012-04-111-88/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | block. Using this on the lldb/test/lang/objc/foundation test we can see this in action: First we can load the module: (lldb) command script import /Volumes/work/gclayton/Documents/src/lldb/examples/darwin/heap_find/heap.py Loading "/Volumes/work/gclayton/Documents/src/lldb/examples/darwin/heap_find/libheap.dylib"...ok Image 0 loaded. "heap_ptr_refs" and "heap_cstr_refs" commands have been installed, use the "--help" options on these commands for detailed help. Lets take a look at the variable "my": (lldb) fr var *my (MyString) *my = { MyBase = { NSObject = { isa = MyString } propertyMovesThings = 0 } str = 0x0000000100301a60 date = 0x0000000100301e60 _desc_pauses = NO } We can see that this contains an ivar "str" which has a pointer value of "0x0000000100301a60". Lets search the heap for this pointer and see what we find: (lldb) heap_ptr_refs 0x0000000100301a60 found pointer 0x0000000100301a60: block = 0x103800270, size = 384, offset = 168, type = 'void *' found pointer 0x0000000100301a60: block = 0x100301cf0, size = 48, offset = 16, type = 'MyString *', ivar = 'str' (MyString) *addr = { MyBase = { NSObject = { isa = MyString } propertyMovesThings = 0 } str = 0x0000000100301a60 date = 0x0000000100301e60 _desc_pauses = NO } found pointer 0x0000000100301a60: block = 0x100820000, size = 4096, offset = 96, type = (autorelease object pool) found pointer 0x0000000100301a60: block = 0x100820000, size = 4096, offset = 104, type = (autorelease object pool) Note that it used dynamic type info to find that it was in "MyString" at offset 16 and it also found the ivar "str"! We can also look for C string values on the heap. Lets look for "a.out": (lldb) heap_cstr_refs "a.out" found cstr a.out: block = 0x10010ce00, size = 96, offset = 85, type = '__NSCFString *' found cstr a.out: block = 0x100112d90, size = 80, offset = 68, type = 'void *' found cstr a.out: block = 0x100114490, size = 96, offset = 85, type = '__NSCFString *' found cstr a.out: block = 0x100114530, size = 112, offset = 97, type = '__NSCFString *' found cstr a.out: block = 0x100114e40, size = 32, offset = 17, type = '__NSCFString *' found cstr a.out: block = 0x100114fa0, size = 32, offset = 17, type = '__NSCFString *' found cstr a.out: block = 0x100300780, size = 160, offset = 128, type = '__NSCFData *' found cstr a.out: block = 0x100301a60, size = 112, offset = 97, type = '__NSCFString *' found cstr a.out: block = 0x100821000, size = 4096, offset = 100, type = 'void *' We see we have some objective C classes that contain this, so lets "po" all of the results by adding the --po option: (lldb) heap_cstr_refs a.out --po found cstr a.out: block = 0x10010ce00, size = 96, offset = 85, type = '__NSCFString *' (__NSCFString *) 0x10010ce00 /Volumes/work/gclayton/Documents/src/lldb/test/lang/objc/foundation/a.out found cstr a.out: block = 0x100112d90, size = 80, offset = 68, type = 'void *' found cstr a.out: block = 0x100114490, size = 96, offset = 85, type = '__NSCFString *' (__NSCFString *) 0x100114490 /Volumes/work/gclayton/Documents/src/lldb/test/lang/objc/foundation/a.out found cstr a.out: block = 0x100114530, size = 112, offset = 97, type = '__NSCFString *' (__NSCFString *) 0x100114530 Hello from '/Volumes/work/gclayton/Documents/src/lldb/test/lang/objc/foundation/a.out' found cstr a.out: block = 0x100114e40, size = 32, offset = 17, type = '__NSCFString *' (__NSCFString *) 0x100114e40 a.out.dSYM found cstr a.out: block = 0x100114fa0, size = 32, offset = 17, type = '__NSCFString *' (__NSCFString *) 0x100114fa0 a.out found cstr a.out: block = 0x100300780, size = 160, offset = 128, type = '__NSCFData *' (__NSCFData *) 0x100300780 <48656c6c 6f206672 6f6d2027 2f566f6c 756d6573 2f776f72 6b2f6763 6c617974 6f6e2f44 6f63756d 656e7473 2f737263 2f6c6c64 622f7465 73742f6c 616e672f 6f626a63 2f666f75 6e646174 696f6e2f 612e6f75 742700> found cstr a.out: block = 0x100301a60, size = 112, offset = 97, type = '__NSCFString *' (__NSCFString *) 0x100301a60 Hello from '/Volumes/work/gclayton/Documents/src/lldb/test/lang/objc/foundation/a.out' found cstr a.out: block = 0x100821000, size = 4096, offset = 100, type = 'void *' llvm-svn: 154519
* Get rid of absolute path in "process load" command.Greg Clayton2012-04-111-1/+1
| | | | llvm-svn: 154506
* Added a new "heap.py" module that adds a new command line command that can ↵Greg Clayton2012-04-113-41/+195
| | | | | | find values on the heap and print out the dynamic type of the malloc block that contains the data. I will be modifying this a bit more to tweak the output and make the output more useful. llvm-svn: 154504
* Added more documentation in the header file to explain how to use the ↵Greg Clayton2012-04-101-1/+34
| | | | | | results that are found by the function calls to find_pointer_in_heap(). llvm-svn: 154435
* Fixed head_find to compile again.Greg Clayton2012-04-102-107/+6
| | | | llvm-svn: 154419
* Fixing a problem where some uninitialized cases of vectors could cause ↵Enrico Granata2012-04-101-1/+6
| | | | | | diagnostic output from the synthetic children providers - this time the fix should work llvm-svn: 154361
* The remaining time calculation didn't reflect theSean Callanan2012-04-061-1/+1
| | | | | | --start argument. Fixed that. llvm-svn: 154221
* Removed a call to truncate() which slowed downSean Callanan2012-04-061-1/+0
| | | | | | the stress test by a LOT. llvm-svn: 154208
* Updated the disassembler stress tester with twoSean Callanan2012-04-061-20/+54
| | | | | | | | | | | | new features: (1) it outputs the instruction currently being tested to a log file, if a path is provided (2) if instructed, it prints the time remaining in the exhaustive test llvm-svn: 154205
* Added a stress-tester for LLDB's disassembler.Sean Callanan2012-04-061-0/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Right now it only works on Mac OS X, but other platforms would just need to add their own implementation of AddLLDBToSysPathOn*(). The stress-tester has two modes: Used with --bytes N --random, the stress-tester generates random instructions of length N and runs them through the disassembler. This is suitable for architectures like Intel where it is combinatorially infeasible to run through the entire space of possible instructions. Used with --bytes N and no arguments (or --start S --stride T), the stress-tester tests the disassembler with a monotonically increasing sequence of instructions. The --start and --stride arguments are intended for use in multiprocessing environments. Give each core an ID from 0 .. T-1, pass the ID in as the --start, and use T as the stride, and you can launch one copy of the stress-tester on each core you have available. llvm-svn: 154143
* Added a platform agnostic symbolication python module that can be used by ↵Greg Clayton2012-04-032-359/+611
| | | | | | any targets. Then modified the darwin "crashlog.py" to use this agnostic info and the new functionality and classes. llvm-svn: 153969
* One last syntax error fixEnrico Granata2012-04-021-1/+1
| | | | llvm-svn: 153911
* Fixing syntax typos in Python formattersEnrico Granata2012-04-023-6/+6
| | | | llvm-svn: 153910
* Remove unused file as this file is deprecated (use ./crashlog.py instead).Greg Clayton2012-04-021-573/+0
| | | | llvm-svn: 153907
* Removing some instances of str(SBValue)Enrico Granata2012-04-023-6/+6
| | | | llvm-svn: 153899
OpenPOWER on IntegriCloud