summaryrefslogtreecommitdiffstats
path: root/lldb/examples/python
Commit message (Collapse)AuthorAgeFilesLines
...
* Added options to specify how many instructions before and after the frameGreg Clayton2012-01-211-12/+25
| | | | | | | PC to disassemble. Users can also specify the frame depth to disassemble to and also if disassembly should happen for all threads. llvm-svn: 148627
* Use the "shlex" module to parse the command line that was passed down intoGreg Clayton2012-01-211-6/+25
| | | | | | | | | | python so that single and double quotes and other standard shell like argument parsing happens as expected before passing stuff along to option parsing. Also handle exceptions so that we don't accidentally exit lldb if an uncaught exception occurs. llvm-svn: 148623
* Fixed it so the "--help" option works for the crashlog command. Corrected andGreg Clayton2012-01-211-172/+210
| | | | | | | | | | | | filled out the command help and removed unused options. Updated the command to have a "--load-all" option that will cause the target that gets created to locate and load all images specified in the Binary Images section of the crash log to allow for complete program state to be matched to that of the crash log, not just the images that were in the stack frames (the default). llvm-svn: 148605
* This file is no longer needed since the command:Greg Clayton2012-01-201-5/+0
| | | | | | | | (lldb) script import crashlog will automatically add the "crashlog" command to the command interpreter! llvm-svn: 148598
* Fixed a global reference that should have beenSean Callanan2012-01-201-1/+1
| | | | | | a reference to a class variable. llvm-svn: 148562
* Make the script work again from the command line as long as the PYTHONPATH Greg Clayton2012-01-201-54/+64
| | | | | | | | | | | | | | | | | environment variable it set to include a path to lldb.py. Also fixed the case where the executable can't be located and doesn't match what is installed on the current system. It will still symbolicate the other frames, and will just show what was originally in the crash log file. Also removed the --crash-log option so the arguments to the "crashlog" command are one or more paths to crash logs. Fixed the script to "auto-install" itself when loaded from the embedded script interpreter. Now you only need to import the module and the command is ready for use. llvm-svn: 148561
* More fixed to verify if a file in the crash log is installed in the currentGreg Clayton2012-01-201-38/+72
| | | | | | | system and also deal with dsymForUUID being available on the network, locally, and not at all. llvm-svn: 148534
* Improved the regular expressions to handle "+" characters being at the frontGreg Clayton2012-01-202-30/+41
| | | | | | | | | | of the identifier name in the binary images section. Improved the regular expression for the frames. Added a new file "crashlog.lldb" which can be sourced with "command source" that will import the module and set itself up to be used as a command. llvm-svn: 148529
* Modified the symbolicate-crash.py so it can be imported into python as aGreg Clayton2012-01-201-0/+622
| | | | | | | | | | | | | | | | | | | | | | | | | | module (you can't import a module with a '-' in it) and also added a Symbolcate(...) top level function so it can be imported and used as an LLDB command. Then you can import the module and map a "crashlog" command (for darwin use only currently) to the python function "crashlog.Symbolicate": (lldb) script import crashlog (lldb) command script add -f crashlog.Symbolicate crashlog Then use it to symbolicate: (lldb) crashlog --crash-log /path/to/foo.crash The crash log will then get symbolicated and inline frames will be added to the crash log and the frames will be displayed. The crash log currently will only try and fetch and setup the target images requires in order to do the symbolication. This will need to be iterated upon, but it is getting close to being useful so I am going to check this in. llvm-svn: 148528
* Allow the crash log file path to contain an initial tilde component.Johnny Chen2011-10-061-1/+2
| | | | llvm-svn: 141340
* Simplify code to print symbols and sections within a module using the ↵Johnny Chen2011-10-061-9/+4
| | | | | | built-in iterators. llvm-svn: 141326
* Cleaned up the the code that figures out the inlined stack frames given a Greg Clayton2011-10-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | symbol context that represents an inlined function. This function has been renamed internally to: bool SymbolContext::GetParentOfInlinedScope (const Address &curr_frame_pc, SymbolContext &next_frame_sc, Address &next_frame_pc) const; And externally to: SBSymbolContext SBSymbolContext::GetParentOfInlinedScope (const SBAddress &curr_frame_pc, SBAddress &parent_frame_addr) const; The correct blocks are now correctly calculated. Switched the stack backtracing engine (in StackFrameList) and the address context printing over to using the internal SymbolContext::GetParentOfInlinedScope(...) so all inlined callstacks will match exactly. llvm-svn: 140910
* Fixed the public and internal disassembler API to be named correctly:Greg Clayton2011-09-271-5/+5
| | | | | | | | | | | | | | | const char * SBInstruction::GetMnemonic() const char * SBInstruction::GetOperands() const char * SBInstruction::GetComment() Fixed the symbolicate example script and the internals. llvm-svn: 140591
* Fixes for a few different versions of the darwin crash log.Greg Clayton2011-09-261-20/+32
| | | | llvm-svn: 140554
* Added an example that symbolicates symbol information. This fileGreg Clayton2011-09-261-0/+565
| | | | | | | | | | | | is mostly geared towards darwin crash logs at the moment, though it could be made more generic with a few tweaks. The symbolicate-crash.py script will make a target given a crash log and then symbolicate all frames and expand any frames that had inlined functions in them to show all frames back to the concrete function. It will also disassemble around the crash site. llvm-svn: 140544
* Add usage docstring to SBValue.h, and minor update of docstrings for ↵Johnny Chen2011-07-151-1/+1
| | | | | | SBValueList.h. llvm-svn: 135230
* Remove unnecessary 'import' statement.Johnny Chen2011-07-061-1/+0
| | | | llvm-svn: 134519
* Add a little spice to the script to allow us to specify a function name to ↵Johnny Chen2011-05-251-3/+20
| | | | | | | | break at and to disassemble. Usage: disasm.py [-n name] executable-image By default, it breaks at and disassembles the 'main' function. llvm-svn: 132090
* Add a little twist to the disasm.py script so that it is possible to ↵Johnny Chen2011-05-251-7/+12
| | | | | | | | terminate the inferior process by entering 'Ctrl-D' or 'quit'. llvm-svn: 132088
* Modified to use SBTarget.LaunchSimple() API.Johnny Chen2011-05-251-2/+1
| | | | llvm-svn: 132082
* Use built-in truth value testing.Johnny Chen2011-05-251-6/+6
| | | | llvm-svn: 132079
* Modified to take advantage of the iteration protocol for our lldb container ↵Johnny Chen2011-04-281-12/+8
| | | | | | objects. llvm-svn: 130456
* The example had gotten stale, so I made it work again, and for fun printed ↵Jim Ingham2011-03-301-2/+16
| | | | | | out the frame registers as well. llvm-svn: 128523
* There's no need to explicitly call lldb.SBDebugger.Initialize() now. It is doneJohnny Chen2010-10-151-3/+0
| | | | | | when importing the lldb module. llvm-svn: 116585
* Minor change.Johnny Chen2010-10-091-1/+1
| | | | llvm-svn: 116127
* Cleaned up the SWIG stuff so all includes happen as they should, no pullingGreg Clayton2010-10-071-35/+48
| | | | | | | | | | | | | | | | | | tricks to get types to resolve. I did this by correctly including the correct files: stdint.h and all lldb-*.h files first before including the API files. This allowed me to remove all of the hacks that were in the lldb.swig file and it also allows all of the #defines in lldb-defines.h and enumerations in lldb-enumerations.h to appear in the lldb.py module. This will make the python script code a lot more readable. Cleaned up the "process launch" command to not execute a "process continue" command, it now just does what it should have with the internal API calls instead of executing another command line command. Made the lldb_private::Process set the state to launching and attaching if WillLaunch/WillAttach return no error respectively. llvm-svn: 115902
* Fixed a few issues with the example script.Greg Clayton2010-10-061-2/+2
| | | | llvm-svn: 115801
* Added the first of hopefully many python example scripts that show how toGreg Clayton2010-10-061-0/+79
use the python API that is exposed through SWIG to do some cool stuff. Also fixed synchronous debugging so that all process control APIs exposed through the python API will now wait for the process to stop if you set the async mode to false (see disasm.py). llvm-svn: 115738
OpenPOWER on IntegriCloud