Commit Graph

208 Commits

Author SHA1 Message Date
Enrico Granata
39cf67e573 <rdar://problem/12068655> Make sure [NSDate distantPast] is formatted correctly
llvm-svn: 163162
2012-09-04 20:02:39 +00:00
Enrico Granata
7a204359dc Editing a comment to make sure people know not to blame CFString.py for CFString summary errors
llvm-svn: 163157
2012-09-04 19:18:17 +00:00
Enrico Granata
3467d80ba3 <rdar://problem/11485744> Implement important data formatters in C++. Have the Objective-C language runtime plugin expose class descriptors objects akin to the objc_runtime.py Pythonic implementation. Rewrite the data formatters for some core Cocoa classes in C++ instead of Python.
llvm-svn: 163155
2012-09-04 18:47:54 +00:00
Greg Clayton
7143f00ae9 Improved "objc_refs" a bit to be able to find all instances of a class'
superclasses on top of finding the exact class. The current attempt is still
too slow, but it lays the groundwork.

llvm-svn: 163135
2012-09-04 14:09:21 +00:00
Greg Clayton
c373ca5c74 <rdar://problem/12069589>
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
2012-09-01 00:34:35 +00:00
Jason Molenda
d204afaee8 Make the tab character in the thread frame lines optional.
llvm-svn: 163037
2012-08-31 23:27:24 +00:00
Greg Clayton
97e44a0cc7 Added command lists that can be executed on launch, stop, crash and exit. Added code to auto import the lldb module that we can use on many stand alone modules.
llvm-svn: 162972
2012-08-31 02:55:56 +00:00
Greg Clayton
c769722a16 Added an example that show correct usage of the async process event API.
llvm-svn: 162967
2012-08-31 01:11:17 +00:00
Greg Clayton
1f7460716b <rdar://problem/11757916>
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-29 21:13:06 +00:00
Jason Molenda
e5ad3859eb Instead of using re.split and requiring two spaces between the "regname: 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-28 23:46:12 +00:00
Enrico Granata
114bb19d19 Data formatters for libc++ deque and shared/weak ptrs - a contribution by Jared Grubb
llvm-svn: 162680
2012-08-27 17:42:50 +00:00
Greg Clayton
435ce13937 The OS plug-in can now get data from a python script that implements the protocol.
llvm-svn: 162540
2012-08-24 05:45:15 +00:00
Greg Clayton
a83b6cf244 We have a partially working OS plug-in through python!
llvm-svn: 162532
2012-08-24 02:01:39 +00:00
Enrico Granata
b710b8db3d Fixing an issue in the OS sample
llvm-svn: 162531
2012-08-24 01:53:47 +00:00
Greg Clayton
2443cbd7f5 Added Args::StringForEncoding(), Args::StringToGenericRegister() and centralized the parsing of the string to encoding and string to generic register.
Added code the initialize the register context in the OperatingSystemPython plug-in with the new PythonData classes, and added a test OperatingSystemPython module in lldb/examples/python/operating_system.py that we can use for testing.

llvm-svn: 162530
2012-08-24 01:42:50 +00:00
Johnny Chen
d79f06cf12 Modified .lldb-loggings now to direct the lldb log files to the same session directory which also houses the test logs.
llvm-svn: 162387
2012-08-22 20:25:33 +00:00
Johnny Chen
c50ce97745 Demonstrate how to use the config file and the pre-flight functionality to route the lldb gdb-remote log messages
into individually named log destinations.  In the simple usage-lldb-loggings example, we ran two cases which resulted
in two lldb_log files.

llvm-svn: 162378
2012-08-22 18:48:13 +00:00
Greg Clayton
486290078c Added qVAttachOrWaitSupported packet support.
llvm-svn: 162207
2012-08-20 16:50:43 +00:00
Greg Clayton
45b673dad5 <rdar://problem/12087275>
Make the crashlog parser able to deal with spaces in the process name.

llvm-svn: 161772
2012-08-13 18:48:03 +00:00
Greg Clayton
774ebdfcd1 Added a new "objc_refs" command that will track down all allocations on the 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
2012-08-11 02:26:26 +00:00
Filipe Cabecinhas
bbb648ef80 Make the objc-runtime work with Python 2.6
llvm-svn: 161111
2012-08-01 14:38:37 +00:00
Jim Ingham
584745a692 Added a few more summaries I find useful for lldb.
llvm-svn: 160909
2012-07-28 00:37:21 +00:00
Greg Clayton
784933b791 Enable the "symbolicate" interactive command to symbolicate all crash logs 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-16 20:40:20 +00:00
Enrico Granata
4b7b5aa0bc <rdar://problem/11773899> Formatters for BOOL* and BOOL&
llvm-svn: 160181
2012-07-13 18:55:41 +00:00
Enrico Granata
811e9055fd <rdar://problem/11753405> Making sure we deal correctly with signed NSNumber values
llvm-svn: 160179
2012-07-13 18:53:14 +00:00
Greg Clayton
c51d70d9d5 Show source by default for the first 4 frames of the crash thread. Also added options to allow showing source for all frames (--source-frames=NFRAMES) and for all threads (--source-all).
llvm-svn: 160175
2012-07-13 17:58:52 +00:00
Greg Clayton
563d03934c Added the ability to see source context with each frame in the "crashlog" 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-13 03:19:35 +00:00
Greg Clayton
e04cfd2180 Added the ability to search through sections for pointer data.
llvm-svn: 160083
2012-07-11 22:13:18 +00:00
Greg Clayton
9407302d37 Make const result value objects able to return dynamic types.
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
2012-07-07 01:22:45 +00:00
Greg Clayton
39cacebd26 Added a new example that extracts all global variables from an object file and prints any available info.
llvm-svn: 159775
2012-07-05 20:24:41 +00:00
Greg Clayton
f7ab038ada Make the interactive command interpreter build into the "crashlog" command 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-07-03 21:40:18 +00:00
Greg Clayton
a7fb1dcd4b Listen to the "--verbose" flag when running "crashlog" and if verbose is 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-28 18:10:14 +00:00
Greg Clayton
f47b2c26bb Added a "save_crashlog" command to the lldb.macosx.crashlog package that 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-27 20:02:04 +00:00
Greg Clayton
89d4f338a7 Check the return status of the make command.
llvm-svn: 159284
2012-06-27 19:57:59 +00:00
Greg Clayton
5b889eec4a Remove dependency on internal header file.
llvm-svn: 159283
2012-06-27 19:57:13 +00:00
Greg Clayton
f51a23fb6f Cleaned up some stuff in symbolication where we can now lazily get images 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-06-04 23:22:17 +00:00
Greg Clayton
8ebb9a8564 Added the ability to disassembly GDB remote packets with the python file. This will make it easier to symbolicate the packet log output since we can use the lldb.utils.symbolication package module to symbolicate register values.
llvm-svn: 157835
2012-06-01 20:23:54 +00:00
Greg Clayton
eb749096e0 Added the ability to run "symbolicate [options] <crashlog-index>" in interactive mode.
llvm-svn: 157770
2012-05-31 21:21:08 +00:00
Enrico Granata
7c015e1020 Fixes for performance to data formatters - Python < 3.0 is much slower when using True/False as compared to 1/0 for logical values. Wexploit this to our advantage. Other minor tweaks
llvm-svn: 157209
2012-05-21 21:52:38 +00:00
Enrico Granata
263ebe5f78 Optimizations to the Python ObjC formatters - Benchmarking infrastructure
llvm-svn: 157066
2012-05-18 19:55:37 +00:00
Greg Clayton
f67002dd4c Make sure to subtract one from the PC when doing the symbolication of stack frames when it isn't the zero'th frame.
llvm-svn: 156974
2012-05-17 03:58:23 +00:00
Greg Clayton
563566c9dd Fixed an exception when parsing crash logs.
llvm-svn: 156945
2012-05-16 20:49:19 +00:00
Enrico Granata
bd5a7a9f03 Fixing a bug where the summary for certain NSStrings was being returned as empty in spite of the string actually having a content
llvm-svn: 156793
2012-05-15 01:22:45 +00:00
Greg Clayton
0021bd2fe3 Remove comments and an extra print statement.
llvm-svn: 156651
2012-05-11 21:57:50 +00:00
Greg Clayton
341039faca More fixes to "malloc_history".
llvm-svn: 156605
2012-05-11 02:42:36 +00:00
Greg Clayton
60bb58f669 Modified the symbolication.Image object to store its uuid as a uuid.UUID 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-11 00:30:14 +00:00
Greg Clayton
7200ed1b94 "--stack-history" now works if you have MallocStackLogggingNoCompact defined in your app's environment.
llvm-svn: 156588
2012-05-10 23:37:52 +00:00
Greg Clayton
370f5fd20a Fixed a build error.
llvm-svn: 156586
2012-05-10 23:20:50 +00:00
Greg Clayton
d9fc53509e Added the ability to get the stack history for a malloc block. This is a work in progress. Checking this in so I can work on it some more.
llvm-svn: 156584
2012-05-10 23:17:28 +00:00
Johnny Chen
afc98a6d7e Make crashlog.py more robust when dealing with the "Version: ..." header from the crash log file.
rdar://problem/11428134

llvm-svn: 156581
2012-05-10 22:45:54 +00:00