summaryrefslogtreecommitdiffstats
path: root/lldb/examples
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Improved the TreeItem delegate which simplifies making tree items:Greg Clayton2014-10-071-135/+419
| | | | | | | | - tree items can define any number of key/value pairs - creating a tree you specify which columns you want to display and it will pick out the right key/value pairs from the new tree item dictionaries - added new "tk-target" command to explore the target's images, sections, symbols, compile units and line tables. llvm-svn: 219219
* Fix some errors that crept in when I cut & pasted into emacs.Jim Ingham2014-09-301-16/+16
| | | | llvm-svn: 218656
* Add a very trivial example for scripted stepping.Jim Ingham2014-09-301-0/+130
| | | | llvm-svn: 218650
* Played around with TK UI a bit this weekend.Greg Clayton2014-09-221-0/+260
| | | | | | | | | | | | | If you "command script import" this file, then you will have two new commands: (lldb) tk-variables (lldb) tk-process Not sure how this will work on all other systems, but on MacOSX, you will get a window with a tree view that allows you to inspect your local variables by expanding variables to see the child values. The "tk-process" allows you to inspect the currently selected process by expanding the process to see the threads, the threads to see the frames, and the frames to see the variables. Very handy if you want to view variables for all frames simultaneously. llvm-svn: 218279
* Fix some typos:Sylvestre Ledru2014-08-111-1/+1
| | | | | | | | * transfered => transferred * unkown => unknown * sucessfully => successfully llvm-svn: 215367
* Don't use "lldb." global variables in LLDB commands.Greg Clayton2014-07-111-1/+4
| | | | llvm-svn: 212852
* Fix typos.Bruce Mitchener2014-07-013-12/+12
| | | | llvm-svn: 212132
* Allow classes to be intialized using current lldb::SB objects. This can help ↵Greg Clayton2014-05-281-4/+55
| | | | | | to import/export the current process state. llvm-svn: 209702
* Fixed an issue where if you called:Greg Clayton2014-04-071-1/+2
| | | | | | | | | | | | | | | | | SBTarget::AddModule(const char *path, const char *triple, const char *uuid_cstr, const char *symfile); If "symfile" was filled in, it would cause us to not correctly add the module. Same goes for: SBTarget::AddModule(SBModuleSpec ...) Where you filled in the symfile. <rdar://problem/16529799> llvm-svn: 205750
* Add example target description file for QEMU for x86-64.Hafiz Abid Qadeer2014-02-201-0/+352
| | | | llvm-svn: 201790
* An example summary provider for PyObject and the LLDB wrapper PythonObject ↵Enrico Granata2014-02-051-0/+18
| | | | | | hierarchy - this would have probably helped track down those refcount bugs.. llvm-svn: 200879
* Added a new lldb command that can parse all struct and class types for one ↵Greg Clayton2014-01-231-1/+14
| | | | | | or more shared libraries. llvm-svn: 199937
* 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
* Fix to only update the offset for concrete registers (ones that don't have ↵Greg Clayton2013-12-131-1/+1
| | | | | | 'slice' or 'composite' key/value pairs). llvm-svn: 197191
* Adjust PC after hitting breakpoint on remote target.Hafiz Abid Qadeer2013-10-181-0/+353
| | | | | | | | This commit adds an example python file that can be used with 'target-definition-file' setting for Linux gdbserver. This file has an extra key 'breakpoint-pc-offset' that LLDB uses to determine how much to change the PC after hitting the breakpoint. llvm-svn: 192962
* <rdar://problem/14972424>Greg Clayton2013-10-171-58/+117
| | | | | | | | | | | | | | | - Made the dynamic register context for the GDB remote plug-in inherit from the generic DynamicRegisterInfo to avoid code duplication - Finished up the target definition python setting stuff. - Added a new "slice" key/value pair that can specify that a register is part of another register: { 'name':'eax', 'set':0, 'bitsize':32, 'encoding':eEncodingUint, 'format':eFormatHex, 'slice': 'rax[31:0]' }, - Added a new "composite" key/value pair that can specify that a register is made up of two or more registers: { 'name':'d0', 'set':0, 'bitsize':64 , 'encoding':eEncodingIEEE754, 'format':eFormatFloat, 'composite': ['s1', 's0'] }, - Added a new "invalidate-regs" key/value pair for when a register is modified, it can invalidate other registers: { 'name':'cpsr', 'set':0, 'bitsize':32 , 'encoding':eEncodingUint, 'format':eFormatHex, 'invalidate-regs': ['r8', 'r9', 'r10', 'r11', 'r12', 'r13', 'r14', 'r15']}, This now completes the feature that allows a GDB remote target to completely describe itself. llvm-svn: 192858
* <rdar://problem/14972424>Greg Clayton2013-10-151-0/+298
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When debugging with the GDB remote in LLDB, LLDB uses special packets to discover the registers on the remote server. When those packets aren't supported, LLDB doesn't know what the registers look like. This checkin implements a setting that can be used to specify a python file that contains the registers definitions. The setting is: (lldb) settings set plugin.process.gdb-remote.target-definition-file /path/to/module.py Inside module there should be a function: def get_dynamic_setting(target, setting_name): This dynamic setting function is handed the "target" which is a SBTarget, and the "setting_name", which is the name of the dynamic setting to retrieve. For the GDB remote target definition the setting name is 'gdb-server-target-definition'. The return value is a dictionary that follows the same format as the OperatingSystem plugins follow. I have checked in an example file that implements the x86_64 GDB register set for people to see: examples/python/x86_64_target_definition.py This allows LLDB to debug to any archticture that is support and allows users to define the registers contexts when the discovery packets (qRegisterInfo, qHostInfo) are not supported by the remote GDB server. A few benefits of doing this in Python: 1 - The dynamic register context was already supported in the OperatingSystem plug-in 2 - Register contexts can use all of the LLDB enumerations and definitions for things like lldb::Format, lldb::Encoding, generic register numbers, invalid registers numbers, etc. 3 - The code that generates the register context can use the program to calculate the register context contents (like offsets, register numbers, and more) 4 - True dynamic detection could be used where variables and types could be read from the target program itself in order to determine which registers are available since the target is passed into the python function. This is designed to be used instead of XML since it is more dynamic and code flow and functions can be used to make the dictionary. llvm-svn: 192646
* An example of data formatters that generate a summary for a Unicode UTF ↵Enrico Granata2013-10-081-0/+48
| | | | | | encoded string represented as a (pointer,length) pair llvm-svn: 192206
* This is an example synthetic provider for libc++ unordered (multi) maps&setEnrico Granata2013-09-041-0/+110
| | | | | | Thanks to Jared Grubb for writing it and sharing it! llvm-svn: 189964
* Added a "sources.py" which adds a command that can print out the source ↵Greg Clayton2013-09-044-0/+1997
| | | | | | | | files contained in one or more modules. Added "mach_o.py" which is a mach-o parser that can dump mach-o file contents and also extract sections. It uses the "file_extract" module and the "dict_utils" module. llvm-svn: 189959
* Fixed a crash in objc_refs caused by improperSean Callanan2013-08-131-2/+4
| | | | | | | | resolution of class_getSuperclass. <rdar://problem/14662686> llvm-svn: 188240
* Fix typeo in diagnose-unwind.py.Jason Molenda2013-07-151-1/+1
| | | | llvm-svn: 186358
* Enabled the "--debug" option functionality that will SIGSTOP the current ↵Greg Clayton2013-07-121-0/+5
| | | | | | process allowing a debugger to attach. llvm-svn: 186194
* Added a memory.py module that contains a 'memfind' command which allows you ↵Greg Clayton2013-07-111-0/+181
| | | | | | to search memory for a byte pattern. llvm-svn: 186127
* Tweaks to the Python reference and example command to use the preferred ↵Enrico Granata2013-07-111-5/+5
| | | | | | print style and the (finally available :-) SetError API llvm-svn: 186122
* Add the frame content dumper function call to one more place.Jason Molenda2013-07-091-0/+2
| | | | llvm-svn: 185906
* Add new information gathering to the lldb & simple backtrace methods:Jason Molenda2013-07-091-5/+30
| | | | | | | print five words of memory at the beginning of the stack frame so it's easier to track where an incorrect saved-fp or saved-pc may have come from. llvm-svn: 185903
* A bit more cleanup on the process_events.py to use best practices for event ↵Greg Clayton2013-06-271-54/+72
| | | | | | handling. llvm-svn: 185089
* Update the platform options help strings.Greg Clayton2013-06-263-3/+3
| | | | llvm-svn: 185028
* Fixed the process_events.py example to be able to specify the platform and ↵Greg Clayton2013-06-261-64/+63
| | | | | | also use the debugger's listener. llvm-svn: 185027
* Added a regex that can be specified to avoid showing contents on types that ↵Greg Clayton2013-06-221-70/+105
| | | | | | match. Also split things up a bit so this can be run as a stand alone script or in lldb. llvm-svn: 184628
* Also report any OS python plugin in use.Jason Molenda2013-06-201-0/+3
| | | | llvm-svn: 184487
* Print the general purpose registers for frame 0.Jason Molenda2013-06-201-0/+8
| | | | llvm-svn: 184483
* Cleanup the output a bit by removing old print statements and also printing ↵Greg Clayton2013-06-201-4/+4
| | | | | | the number of types found. llvm-svn: 184389
* Implemented a types.py module that allows types to be inspected for padding.Greg Clayton2013-06-191-0/+212
| | | | | | The script was able to point out and save 40 bytes in each lldb_private::Section by being very careful where we need to have virtual destructors and also by re-ordering members. llvm-svn: 184364
* A few small enhancements to the diagnose-unwind command.Jason Molenda2013-06-191-24/+82
| | | | | | | | | | | | | | | | Change the simple-minded stack walk to not depend on lldb to unwind the first frame. Collect a list of Modules and Addresses seen while backtracing (with both methods), display the image list output for all of those modules, plus disassemble and image show-unwind any additional frames that the simple backtrace was able to unwind through instead of just the lldb unwind algorithm frames. Remove checks for older lldb's that didn't support -a for disassemble or specifying the assembler syntax on x86 targets. llvm-svn: 184280
* Added the ability options to:Greg Clayton2013-06-141-74/+256
| | | | | | | | | - specify the architecture - specify the platform - specify if only external symbols should be dumped - specify if types in the function signatures should be canonicalized llvm-svn: 183961
* Remove unneeded include.Greg Clayton2013-06-131-1/+0
| | | | llvm-svn: 183959
* Added a new makefile setting that can be set in LLDB makefiles: USE_LIBCPP. ↵Greg Clayton2013-06-134-40/+175
| | | | | | | | | | | | This will enable libc++ support. Improved the makefile "clean" to include deleting all ".d.[0-9]+" files. Added options to the "lldb/examples/lookup" example and made it build using the LLDB_BUILD_DIR. If this is not set, it will default to "/Applications/Xcode.app/Contents/SharedFrameworks" on Darwin. Added options to the "lldb/examples/function" example and made it build using the LLDB_BUILD_DIR. llvm-svn: 183949
* Added some new example code that can grab all functions from any executable, ↵Greg Clayton2013-06-132-0/+183
| | | | | | | | and it will print out the function name, range, return type and argument types. This example shows someone could iterate over all functions and do something intelligent with them, like create function signatures. Then two different builds could be compared to verify the API hasn't changed. llvm-svn: 183923
* Small changes to diagnose_unwind. Correctly provide help text.Jason Molenda2013-06-051-6/+15
| | | | | | Print the lldb version at the top of the output. llvm-svn: 183289
* Adding a diagnose-nsstring commandEnrico Granata2013-05-302-1/+172
| | | | | | This should help us figure out issues with the NSString data formatter llvm-svn: 182972
* Providing a more interesting command template for LLDBEnrico Granata2013-05-091-25/+41
| | | | | | This one actually exploits the SB API to obtain information about your inferior process llvm-svn: 181500
* Adding some LLDB-specific logic to the tracer (in a separate tracer module) ↵Enrico Granata2013-05-071-12/+91
| | | | | | | | to improve the quality of the output when debugging data formatters (more improvements are necessary before this is really legible) llvm-svn: 181367
* First iteration of a Python tracer moduleEnrico Granata2013-05-071-0/+249
| | | | | | | | | | | | | | | | | | | This module uses Python's sys.settrace() mechanism so setup a hook that can log every significant operation This is a first step in providing a good debugging experience of Python embedded in LLDB This module comprises an OO infrastructure that wraps Python's tracing and inspecting mechanisms, plus a very simple logging tracer Output from this tracer looks like: call print_keyword_args from <module> @ 243 args are kwargs are {'first_name': 'John', 'last_name': 'Doe'} running print_keyword_args @ 228 locals are {'kwargs': {'first_name': 'John', 'last_name': 'Doe'}} running print_keyword_args @ 229 locals are {'key': 'first_name', 'value': 'John', 'kwargs': {'first_name': 'John', 'last_name': 'Doe'}} first_name = John running print_keyword_args @ 228 locals are {'key': 'first_name', 'value': 'John', 'kwargs': {'first_name': 'John', 'last_name': 'Doe'}} running print_keyword_args @ 229 locals are {'key': 'last_name', 'value': 'Doe', 'kwargs': {'first_name': 'John', 'last_name': 'Doe'}} last_name = Doe running print_keyword_args @ 228 locals are {'key': 'last_name', 'value': 'Doe', 'kwargs': {'first_name': 'John', 'last_name': 'Doe'}} return from print_keyword_args value is None locals are {'key': 'last_name', 'value': 'Doe', 'kwargs': {'first_name': 'John', 'last_name': 'Doe'}} llvm-svn: 181343
* Print a backtrace line for a pc value even if we can't make an SBAddressJason Molenda2013-05-011-1/+2
| | | | | | out of it. llvm-svn: 180835
* Put a try/catch block around the SBAddress setting; don't want to Jason Molenda2013-04-301-13/+16
| | | | | | | terminate the command early if we happen to have an invalid load address. llvm-svn: 180826
* Rename unwind_diagnose.py to diagnose_unwind.py. ChangeJason Molenda2013-04-301-7/+7
| | | | | | | | | | | finish-swig-Python-LLDB.sh to create a new lldb.diagnose subdirectory in the LLDB framework; the first diagnostic command in this directory is diagnose-unwind. There may be others added in the future. Users can load these diagnostic tools into their session with "script import lldb.diagnose". llvm-svn: 180768
* Remove a print statement that was left in accidentally.Greg Clayton2013-04-241-1/+0
| | | | llvm-svn: 180223
OpenPOWER on IntegriCloud