summaryrefslogtreecommitdiffstats
path: root/lldb/examples/darwin/heap_find
Commit message (Collapse)AuthorAgeFilesLines
* Revert [heap.py] Add missing declaration for malloc_get_all_zonesVedant Kumar2019-08-221-1/+0
| | | | | | | | This reverts r369684 (git commit cc62e38d258f414c196b566374c606e83a85a034) Adding a declaration doesn't appear to be a sufficient fix. llvm-svn: 369706
* [heap.py] Add missing declaration for malloc_get_all_zonesVedant Kumar2019-08-221-0/+1
| | | | | | | | The evaluation context isn't guaranteed to have this declaration. Fixes "error: use of undeclared identifier 'malloc_get_all_zones'" bugs. llvm-svn: 369684
* [NFC] Remove ASCII lines from commentsJonas Devlieghere2019-04-101-36/+0
| | | | | | | | | | | | | | | | | | | | | | | A lot of comments in LLDB are surrounded by an ASCII line to delimit the begging and end of the comment. Its use is not really consistent across the code base, sometimes the lines are longer, sometimes they are shorter and sometimes they are omitted. Furthermore, it looks kind of weird with the 80 column limit, where the comment actually extends past the line, but not by much. Furthermore, when /// is used for Doxygen comments, it looks particularly odd. And when // is used, it incorrectly gives the impression that it's actually a Doxygen comment. I assume these lines were added to improve distinguishing between comments and code. However, given that todays editors and IDEs do a great job at highlighting comments, I think it's worth to drop this for the sake of consistency. The alternative is fixing all the inconsistencies, which would create a lot more churn. Differential revision: https://reviews.llvm.org/D60508 llvm-svn: 358135
* [Python] Unbreak the recently modified tests for python 2.Davide Italiano2019-03-061-0/+1
| | | | llvm-svn: 355566
* [testsuite] Port crashlog to python 3, second attempt.Davide Italiano2019-03-061-16/+15
| | | | llvm-svn: 355562
* Revert "[testsuite] Port crashlog and dependencies to Python 3."Davide Italiano2019-03-051-20/+16
| | | | | | | This revert the commit because it broke the bots. I need to find a way that works with both versions. llvm-svn: 355364
* [testsuite] Port crashlog and dependencies to Python 3.Davide Italiano2019-03-051-16/+20
| | | | | | Fixes three tests in the testsuite. llvm-svn: 355359
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Fix lldb's macosx/heap.py cstr command.Davide Italiano2018-12-171-1/+1
| | | | | | <rdar://problem/44432167> llvm-svn: 349372
* Fix/unify the spelling of Objective-C.Adrian Prantl2018-06-131-2/+2
| | | | llvm-svn: 334614
* Work around a bug in the C++ expression parser.Jim Ingham2017-10-051-47/+47
| | | | | | | | | | | | When the expression parser does name resolution for local variables in C++ closures it doesn't give the local name priority over other global symbols of the same name. heap.py uses "info" which is a fairly common name, and so the commands in it fail. This is a workaround, just use lldb_info not info. <rdar://problem/34026140> llvm-svn: 314959
* *** This commit represents a complete reformatting of the LLDB source codeKate Stone2016-09-062-1036/+1154
| | | | | | | | | | | | | | | | | | | | | | | *** to conform to clang-format’s LLVM style. This kind of mass change has *** two obvious implications: Firstly, merging this particular commit into a downstream fork may be a huge effort. Alternatively, it may be worth merging all changes up to this commit, performing the same reformatting operation locally, and then discarding the merge for this particular commit. The commands used to accomplish this reformatting were as follows (with current working directory as the root of the repository): find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} + find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ; The version of clang-format used was 3.9.0, and autopep8 was 1.2.4. Secondly, “blame” style tools will generally point to this commit instead of a meaningful prior commit. There are alternatives available that will attempt to look through this change and find the appropriate prior commit. YMMV. llvm-svn: 280751
* Fix typos.Bruce Mitchener2015-07-221-4/+4
| | | | | | | | | | | | Summary: Fix a bunch of typos. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D11386 llvm-svn: 242856
* Fix a variety of typos.Bruce Mitchener2015-06-181-5/+5
| | | | | | No functional change. llvm-svn: 239995
* Added a new API to SBFrame:Greg Clayton2015-05-281-18/+112
| | | | | | | | | | lldb::addr_t SBFrame::GetCFA(); This gets the CFA (call frame address) of the frame so it allows us to take an address that is on the stack and figure out which thread it comes from. Also modified the heap.py module to be able to find out which variable in a frame's stack frame contains an address. This way when ptr_refs finds a match on the stack, it get then report which variable contains the pointer. llvm-svn: 238393
* Allow expresions to have unique expression prefixes:Greg Clayton2015-05-271-13/+24
| | | | | | | | | | | | | | | | | | expr_options = lldb.SBExpressionOptions() expr_options.SetPrefix(''' struct Foo { int a; int b; int c; } ''' expr_result = frame.EvaluateExpression ("Foo foo = { 1, 2, 3}; foo", expr_options) This fixed a current issue with ptr_refs, cstr_refs and malloc_info so that they can work. If expressions define their own types and then return expression results that use those types, those types get copied into the target's AST context so they persist and the expression results can be still printed and used in future expressions. Code was added to the expression parser to copy the context in which types are defined if they are used as the expression results. So in the case of types defined by expressions, they get defined in a lldb_expr function and that function and _all_ of its statements get copied. Many types of statements are not supported in this copy (array subscript, lambdas, etc) so this causes expressions to fail as they can't copy the result types. To work around this issue I have added code that allows expressions to specify an expression specific prefix. Then when you evaluate the expression you can pass the "expr_options" and have types that can be correctly copied out into the target. I added this as a way to work around an issue, but I also think it is nice to be allowed to specify an expression prefix that can be reused by many expressions, so this feature is very useful. <rdar://problem/21130675> llvm-svn: 238365
* Specify ObjC++ when running heap commands in case we are stopped in a frame ↵Greg Clayton2015-01-141-0/+4
| | | | | | | | | | with another language. This ensures the expression gets runs with the correct language. <rdar://problem/18816647> llvm-svn: 226041
* Fixed issues with ptr_refs:Greg Clayton2014-01-071-129/+129
| | | | | | | - If there is only 1 frame ptr_refs now works (fixed issue with stack detection) - Fixed test for result now that it isn't a pointer anymore llvm-svn: 198712
* Fixed a crash in objc_refs caused by improperSean Callanan2013-08-131-2/+4
| | | | | | | | resolution of class_getSuperclass. <rdar://problem/14662686> llvm-svn: 188240
* <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
* Using __package__ and __name__ seems redundant - __name__ should always ↵Enrico Granata2013-02-221-11/+4
| | | | | | contain the fully qualified module name llvm-svn: 175856
* 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/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/13011717> Greg Clayton2013-01-151-1/+1
| | | | | | Fixed a compilation error where NULL was being assigned to a uint. llvm-svn: 172566
* 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
* 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 "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
* 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
* 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
* Added a new "objc_refs" command that will track down all allocations on the ↵Greg Clayton2012-08-112-48/+96
| | | | | | heap that have the "isa" for the objective C class at offset zero. This will need to be improved to deal with KVO classes, but it is a start. It also disallows looking up a pointer value of zero since that would return way too many matches. llvm-svn: 161724
* Added the ability to search through sections for pointer data.Greg Clayton2012-07-112-53/+145
| | | | llvm-svn: 160083
* Make const result value objects able to return dynamic types.Greg Clayton2012-07-071-46/+61
| | | | | | Modified the heap.py to be able to correctly indentify the exact ivar for the "ptr_refs" command no matter how deep the ivar is in a class hierarchy. Also fixed the ability for the heap command to symbolicate the stack backtrace when MallocStackLogging is set in the environment and the "--stack" option was specified. llvm-svn: 159883
* Check the return status of the make command.Greg Clayton2012-06-271-2/+3
| | | | llvm-svn: 159284
* Remove dependency on internal header file.Greg Clayton2012-06-271-4/+72
| | | | llvm-svn: 159283
* 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
* "--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 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
* Remove the "-x" from the finish-swig-Python-LLDB.sh shell options so it ↵Greg Clayton2012-04-252-49/+46
| | | | | | | | 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
* Now that we have an LLDB package, make the "lldb.macosx.crashlog" module ↵Greg Clayton2012-04-251-4/+5
| | | | | | work with all of the new module paths. llvm-svn: 155528
* 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
* 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
OpenPOWER on IntegriCloud