aboutsummaryrefslogtreecommitdiff
path: root/lldb/examples/python/crashlog.py
AgeCommit message (Collapse)AuthorFilesLines
2020-11-02[crashlog] Fix and simplify the way we import lldbJonas Devlieghere1-38/+24
Don't try to guess the location of LLDB.framework but use xcrun to ask the command line driver for the location of the lldb module.
2020-10-30[lldb] Ignore binary data in crashlogJonas Devlieghere1-7/+16
Skip the instruction stream section in the crashlog section. Differential revision: https://reviews.llvm.org/D90414
2020-07-16Harmonize Python shebangserge-sans-paille1-1/+1
Differential Revision: https://reviews.llvm.org/D83857
2020-05-28Fix the crashlog.py script's use of the load_address property.Jim Ingham1-3/+3
This property is explicitly for use only in the interactive editor, and NOT in commands. It's use worked until we got more careful about not leaving lldb.target lying around in the script interpreter. I also added a quick sniff test for the save_crashlog command. <rdar://problem/60350620> Differential Revision: https://reviews.llvm.org/D80680
2019-11-07crashlog.py: Improve regular expressionsAdrian Prantl1-8/+22
This is yet another change to the regular expressions in crashlog.py that fix a few edge cases, and attempt to improve the readability quite a bit in the process. My last change to support spaces in filenames introduced a bug that caused the version/archspec field to be parsed as part of the image name. For example, in "0x1111111 - 0x22222 +MyApp Pro arm64 <01234>", the name of the image was recognized as "MyApp Pro arm64" instead of "MyApp Pro" with a "version" of arm64. The bugfix makes the space following an optional field mandatory *inside* the optional group. rdar://problem/56883435 Differential Revision: https://reviews.llvm.org/D69871
2019-07-09[crashlog] Fix a mismatch between bytes and strings.Davide Italiano1-1/+1
The functions in read_plist() want bytes as input, not strings. <rdar://problem/52600712> llvm-svn: 365416
2019-06-14Python 3: decode string as utf-8 to avoid type mismatch.Adrian Prantl1-5/+5
rdar://problem/51464644 Differential Revision: https://reviews.llvm.org/D63311 llvm-svn: 363413
2019-06-14Make crashlog.py less noisyAdrian Prantl1-9/+27
For end-users there is no point in printing dSYM load errors for system frameworks, since they will all fail and there's nothing they can do about it. This patch hides them by default and shows them when --verbose is present. Differential Revision: https://reviews.llvm.org/D63310 llvm-svn: 363412
2019-06-12[lldb] Ignore null frames in lldb.macosx crashlogStefan Granitz1-0/+4
llvm-svn: 363172
2019-05-30[crashlog] Add a missing call to decode.Davide Italiano1-1/+1
<rdar://problem/51139357> llvm-svn: 362044
2019-05-18[crashlog] Use loads() instead of readPlistFromString() for python 3.Davide Italiano1-1/+7
<rdar://problem/50903413> llvm-svn: 361087
2019-04-18[crashlog] Strip trailing `\n` from check_output return.Davide Italiano1-1/+1
Generally having spurious `\n` doesn't matter, but here the returning string is a command which is executed, so we want to strip it. Pointed out by Jason. llvm-svn: 358717
2019-04-17[crashlog] Use the right path for dsymforUUID and remove an unnecessary import.Davide Italiano1-6/+1
<rdar://problem/49925960> llvm-svn: 358615
2019-03-21Portable exception value access across Python 2 / Python 3Serge Guelton1-1/+1
Differential Revision: https://reviews.llvm.org/D59583 llvm-svn: 356670
2019-03-07crashlog.py: Catch exception from subprocess.Adrian Prantl1-1/+5
llvm-svn: 355572
2019-03-06[Python] Unbreak the recently modified tests for python 2.Davide Italiano1-0/+1
llvm-svn: 355566
2019-03-06[testsuite] Port crashlog to python 3, second attempt.Davide Italiano1-63/+63
llvm-svn: 355562
2019-03-05Revert "[testsuite] Port crashlog and dependencies to Python 3."Davide Italiano1-67/+62
This revert the commit because it broke the bots. I need to find a way that works with both versions. llvm-svn: 355364
2019-03-05[testsuite] Port crashlog and dependencies to Python 3.Davide Italiano1-62/+67
Fixes three tests in the testsuite. llvm-svn: 355359
2019-01-31Fix use of non-existing variable in crashlog.pyShafik Yaghmour1-1/+1
Summary: The method find_matching_slice(self) uses uuid_str on one of the paths but the variable does not exist and so this results in a NameError exception if we take that path. Differential Revision: https://reviews.llvm.org/D57467 llvm-svn: 352772
2018-12-17Make crashlog.py work or binaries with spaces in their namesAdrian Prantl1-21/+10
This is a little dangerous since the crashlog files aren't 100% unambiguous, but the risk is mitigated by using a non-greedy +? pattern. rdar://problem/38478511 Differential Revision: https://reviews.llvm.org/D55608 llvm-svn: 349367
2018-12-17Make crashlog.py work when a .dSYM is present, but a binary is missingAdrian Prantl1-15/+37
Often users have a crash log an d a .dSYM bundle, but not the original application binary. It turns out that for crash symbolication, we can safely fall back to using the binary inside the .dSYM bundle. Differential Revision: https://reviews.llvm.org/D55607 llvm-svn: 349366
2017-10-12The save_crashlog command was still looking at lldb.target andJim Ingham1-6/+7
lldb.process. That hasn't worked for a long time. Convert it to the form that takes an SBExecutionContext and use that instead. llvm-svn: 315549
2017-03-28Print the error if dsymForUUID sometimes produces bad plists.Jim Ingham1-1/+5
Not much we can do about it but at least we can print the bad plist and the error. llvm-svn: 298958
2016-12-08Improve crashlog.py so it can handle more iOS crashlog files.Greg Clayton1-0/+11
<rdar://problem/29191857> llvm-svn: 289006
2016-09-06*** This commit represents a complete reformatting of the LLDB source codeKate Stone1-204/+375
*** 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
2016-06-10Fixed a few places that were building a regex from an identifier without ↵Greg Clayton1-1/+1
escaping the identifier text. <rdar://problem/26090553> llvm-svn: 272423
2015-06-23Remove a few uses of lldb.target, which is not validJim Ingham1-5/+6
in a scripted command. llvm-svn: 240451
2015-04-01Add a call to SBDebugger:Destroy() at the end of the self-hostedJason Molenda1-0/+1
version of this script. We picked up a bug at some point in March where scripts that fail to call SBDebugger::Destroy() will crash in the Debugger C++ dtor. I want to track the change down which introduced the change - but this script should be calling SBDebugger::Destroy() in the first place, so do that. llvm-svn: 233779
2015-03-05symbolicate the application specific backtraces that are in MacOSX crash log ↵Greg Clayton1-77/+121
files. <rdar://problem/20039160> llvm-svn: 231415
2014-04-07Fixed an issue where if you called:Greg Clayton1-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
2013-04-04<rdar://problem/13477795>Greg Clayton1-2/+2
crashlog.py was always subtracting 1 to point to the previous instruction when symbolicating ARM backtraces. Many times the backtraces will include bit zero set to 1 to indicate thumb, so we need to make sure we mask the address and then backup one for non frame zero frames. llvm-svn: 178812
2013-01-12Made crashlog.py handle cases where a parentSean Callanan1-3/+5
process's name contains spaces. Thanks to Justin Seyster for the patch. <rdar://problem/13002540> llvm-svn: 172294
2012-09-19Added auto LLDB import to the crashlog script.Greg Clayton1-2/+32
llvm-svn: 164192
2012-08-31Make the tab character in the thread frame lines optional.Jason Molenda1-1/+1
llvm-svn: 163037
2012-08-29<rdar://problem/11757916>Greg Clayton1-5/+8
Make breakpoint setting by file and line much more efficient by only looking for inlined breakpoint locations if we are setting a breakpoint in anything but a source implementation file. Implementing this complex for a many reasons. Turns out that parsing compile units lazily had some issues with respect to how we need to do things with DWARF in .o files. So the fixes in the checkin for this makes these changes: - Add a new setting called "target.inline-breakpoint-strategy" which can be set to "never", "always", or "headers". "never" will never try and set any inlined breakpoints (fastest). "always" always looks for inlined breakpoint locations (slowest, but most accurate). "headers", which is the default setting, will only look for inlined breakpoint locations if the breakpoint is set in what are consudered to be header files, which is realy defined as "not in an implementation source file". - modify the breakpoint setting by file and line to check the current "target.inline-breakpoint-strategy" setting and act accordingly - Modify compile units to be able to get their language and other info lazily. This allows us to create compile units from the debug map and not have to fill all of the details in, and then lazily discover this information as we go on debuggging. This is needed to avoid parsing all .o files when setting breakpoints in implementation only files (no inlines). Otherwise we would need to parse the .o file, the object file (mach-o in our case) and the symbol file (DWARF in the object file) just to see what the compile unit was. - modify the "SymbolFileDWARFDebugMap" to subclass lldb_private::Module so that the virtual "GetObjectFile()" and "GetSymbolVendor()" functions can be intercepted when the .o file contenst are later lazilly needed. Prior to this fix, when we first instantiated the "SymbolFileDWARFDebugMap" class, we would also make modules, object files and symbol files for every .o file in the debug map because we needed to fix up the sections in the .o files with information that is in the executable debug map. Now we lazily do this in the DebugMapModule::GetObjectFile() Cleaned up header includes a bit as well. llvm-svn: 162860
2012-08-28Instead of using re.split and requiring two spaces between the "regname: ↵Jason Molenda1-1/+2
regvalue" pairs, use re.findall and specify the regexp of regname: regvalue that we're interested in. <rdar://problem/12188752> llvm-svn: 162806
2012-08-13<rdar://problem/12087275>Greg Clayton1-1/+1
Make the crashlog parser able to deal with spaces in the process name. llvm-svn: 161772
2012-07-16Enable the "symbolicate" interactive command to symbolicate all crash logs ↵Greg Clayton1-15/+18
if no indexes are supplied. This can be handy to use as: (lldb) script import lldb.macosx.crashlog (lldb) crashlog -i /tmp/*.crash % symbolicate --crashed-only This will symbolicate all of the crash logs only for the crashed thread. Also print out the crash log index number in the output of the interactive "image" command: (lldb) script import lldb.macosx.crashlog (lldb) crashlog -i /tmp/*.crash % image LLDB.framework ... This then allows you to symbolicate a crash log by index accurately when you looked for an image of a specific version llvm-svn: 160316
2012-07-13Show source by default for the first 4 frames of the crash thread. Also ↵Greg Clayton1-13/+18
added options to allow showing source for all frames (--source-frames=NFRAMES) and for all threads (--source-all). llvm-svn: 160175
2012-07-13Added the ability to see source context with each frame in the "crashlog" ↵Greg Clayton1-8/+37
command with the "--source-context" (-C for short to match grep) option. Also made the symbolication of the crash logs more efficient when using the "--crashed-only" ("-c") option where only the crashed thread is symbolicated. We now only download the images for the frames in the crashed thread. llvm-svn: 160160
2012-07-03Make the interactive command interpreter build into the "crashlog" command ↵Greg Clayton1-0/+1
work correctly when run inside LLDB. Before this fix the "cmd.Cmd" object was trying to read from stdin itself and it was competing without command interpreter for the bytes. llvm-svn: 159688
2012-06-28Listen to the "--verbose" flag when running "crashlog" and if verbose is ↵Greg Clayton1-6/+7
enabled, then dump full paths to source files and modules. Changed much of the output that was coming out with "--verbose" over to use the new "--debug" flag. llvm-svn: 159363
2012-06-27Added a "save_crashlog" command to the lldb.macosx.crashlog package that ↵Greg Clayton1-1/+81
allow you to dump your current process state out to a crash log file. This will dump all of the target module information with all load addresses, UUID values, and shared library paths, as well as all thread stacks and the crash log header. This will make it easy for us to save the current state of a process and then reload it later into LLDB. llvm-svn: 159286
2012-06-04Cleaned up some stuff in symbolication where we can now lazily get images ↵Greg Clayton1-7/+11
when symbolicating after loading a crash log file. Added colorization to the gdbremote.py output and also added the ability to symbolicate the addresses in registers. llvm-svn: 157965
2012-05-31Added the ability to run "symbolicate [options] <crashlog-index>" in ↵Greg Clayton1-98/+123
interactive mode. llvm-svn: 157770
2012-05-17Make sure to subtract one from the PC when doing the symbolication of stack ↵Greg Clayton1-1/+6
frames when it isn't the zero'th frame. llvm-svn: 156974
2012-05-16Fixed an exception when parsing crash logs.Greg Clayton1-1/+2
llvm-svn: 156945
2012-05-11Modified the symbolication.Image object to store its uuid as a uuid.UUID ↵Greg Clayton1-23/+34
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
2012-05-10Make crashlog.py more robust when dealing with the "Version: ..." header ↵Johnny Chen1-2/+8
from the crash log file. rdar://problem/11428134 llvm-svn: 156581