Commit Graph

5096 Commits

Author SHA1 Message Date
Jason Molenda 30815837b0 Bump to lldb-145.
llvm-svn: 155687
2012-04-27 02:25:20 +00:00
Greg Clayton b69bb2e43f Clean up the way modules are looked for when calling Target::GetSharedModule(...). We were ignoring remapped files, even if they were valid. Also if we have a UUID, we should check our global module list first.
llvm-svn: 155683
2012-04-27 00:58:27 +00:00
Jim Ingham 57190baa6c Don't call SBDebugger::SetInternalVariable in the sigwinch_handler, since that takes locks and potentially does allocations.
Just call SBDebugger::SetTerminalWidth on the driver's SBDebugger, which does the same job, but no locks.
Also add the value checking to SetTerminalWidth you get with SetInternalVariable(..., "term-width", ...).

rdar://problem/11310563

llvm-svn: 155665
2012-04-26 21:39:32 +00:00
Sean Callanan 822944c97d Made the IR interpreter move all floats, not just "wide"
ones, to its own constant pool.  This reflects the fact
that the LLVM code generators for different targets move
floats to their constant pools under varying conditions,
and the JIT cannot (yet) be relied upon to relocate references to
its constant pool correctly.

llvm-svn: 155660
2012-04-26 20:51:20 +00:00
Greg Clayton c32e5c9bc2 Patch from Filipe Cabecinhas.
llvm-svn: 155644
2012-04-26 17:33:20 +00:00
Greg Clayton 512034b8bd Patch from Filipe Cabecinhas.
llvm-svn: 155642
2012-04-26 17:12:07 +00:00
Greg Clayton caca09b628 Patch from Filipe Cabecinhas.
llvm-svn: 155641
2012-04-26 17:11:01 +00:00
Greg Clayton 7afbe07a0d Patch from Filipe Cabecinhas.
llvm-svn: 155640
2012-04-26 17:09:38 +00:00
Greg Clayton f22f6ff32a Patch from Filipe Cabecinhas.
llvm-svn: 155639
2012-04-26 17:07:53 +00:00
Greg Clayton 9efa076aa6 Save more memory by not parsing the symbol table for stand alone DWARF files. We currently have SymbolFile plug-ins which all get the chance to say what they can parse in a symbol file. Prior to this fix we would ask the SymbolFileDWARF plug-in what abilities it had, and it would answer with "everything", and then we would check the SymbolFileSymtab plug-in what abilities it had, in case it had more abilities. The checking that SymbolFileSymtab does is a bit expensive as it pulls in the entire symbol table just to see if it can offer a few scraps of debug information. This causes all stand along DWARF files to pull in their symbol tables even though those symbols will never be used. This fix will check all SymbolFile plug-ins for their abilities and if any plug-in responds with "everything", then we stop the search.
llvm-svn: 155638
2012-04-26 16:53:42 +00:00
Jason Molenda fc6a17b0a8 Add an Error string specifically for when we hit an ENOMEM when
trying to mmap a file fails so parent caller function can 
provide helpful information to use about what went wrong.

llvm-svn: 155617
2012-04-26 06:39:51 +00:00
Enrico Granata 73076f9269 Automatically enabling the Cocoa formatter categories for command-line LLDB. Previously, the categories were filled in but disabled by default. Tweaking test cases appropriately to keep working and do the right thing
llvm-svn: 155605
2012-04-26 01:40:38 +00:00
Greg Clayton 83b6fabdf7 <rdar://problem/11271074>
<rdar://problem/11285931>

Use the DWARRF end prologue markers when trying to skip prologue instructions instead of blindly using the second line table address entry.

llvm-svn: 155600
2012-04-26 01:01:34 +00:00
Greg Clayton da91b17bc7 Patch from Viktor Kutuzov: changes the method declarations to const for the Args::GetCommandString and Agrs::GetQuotedCommandString methods. It allows using of these methods within the other const methods.
llvm-svn: 155593
2012-04-25 22:30:32 +00:00
Greg Clayton 4f76fef267 Make the libheap.dylib build into a consistent temp directory so it can be 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
2012-04-25 21:23:07 +00:00
Enrico Granata de93b6b42f Fixing a typo in the NSArray data formatter
llvm-svn: 155586
2012-04-25 20:59:02 +00:00
Jim Ingham e5b2245d68 Make sure the end of the first line is still within the function, and if not, don't push the prologue past it.
rdar://problem/11271074

llvm-svn: 155579
2012-04-25 19:48:30 +00:00
Greg Clayton d712ef0fd7 Remove the "-x" from the finish-swig-Python-LLDB.sh shell options so it 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
2012-04-25 18:40:20 +00:00
Enrico Granata 7d22221759 Returning data formatters to their previous working condition - Plus fixing an issue that was preventing Python oneliners from executing
llvm-svn: 155563
2012-04-25 17:53:41 +00:00
Sean Callanan e8dea98b5e Hardened LLDB against NULL identifiers being passed
into FindExternalVisibleDeclsByName.

llvm-svn: 155561
2012-04-25 17:46:01 +00:00
Jim Ingham 5d2735e502 Suspend program threads before sending the SIGSTOP & resuming, so other threads won't get into trouble while we are waiting for the SIGSTOP.
rdar://problem/11174834

llvm-svn: 155560
2012-04-25 17:45:26 +00:00
Enrico Granata eb36cadb68 Fixing an over-substitution of text
llvm-svn: 155556
2012-04-25 16:35:54 +00:00
Enrico Granata 85ce21c04d Make the C++ formatters importable by having them use the right package to import and reference the Logger
llvm-svn: 155555
2012-04-25 16:32:39 +00:00
Greg Clayton ed3eee6e55 Now that we have an LLDB package, make the "lldb.macosx.crashlog" module work with all of the new module paths.
llvm-svn: 155528
2012-04-25 01:49:50 +00:00
Jason Molenda 68b922590d Bump to lldb-144.
llvm-svn: 155527
2012-04-25 01:44:49 +00:00
Enrico Granata 28399adad8 Making the Cocoa formatters comply with the new on-disk layout of the Python resources - This is one of the steps towards making the data formatters work again
llvm-svn: 155526
2012-04-25 01:39:27 +00:00
Enrico Granata 5b4ab4c848 Ensure that lldb/runtime is not a dead point in the Python package hierarchy - This is a first preliminary step in fixing data formatters after Greg's changes to the Python resources on-disk layout
llvm-svn: 155525
2012-04-25 01:26:37 +00:00
Greg Clayton 938aa00795 Remove unneeded files.
llvm-svn: 155524
2012-04-25 01:25:22 +00:00
Greg Clayton 81e9ebf798 Move the source and Makefile into a directory so it will be easier to install.
llvm-svn: 155523
2012-04-25 01:25:04 +00:00
Johnny Chen 6381f01012 Renaming to rid of the '++' in the test file name and simplify the Makefile.
llvm-svn: 155521
2012-04-25 01:20:15 +00:00
Greg Clayton b1ba1bb194 Make the Makefile stand alone.
llvm-svn: 155520
2012-04-25 01:19:20 +00:00
Jim Ingham c9efdbb0d4 Fix the docs for "breakpoint command add" to specify the arguments passed into the python function.
llvm-svn: 155517
2012-04-25 01:05:21 +00:00
Sean Callanan dd42e097eb Removed a binary that I accidentally committed.
llvm-svn: 155516
2012-04-25 01:04:34 +00:00
Sean Callanan 7457f8d7c9 Recognize Objective-C classes with runtime class
ObjCPlusPlus as Objective-C classes.  Really the
compiler should say they have Objective-C runtime
class, but we should be a little more resilient
(we were refusing to find ivars in those classes
before).

Also added a test case.

llvm-svn: 155515
2012-04-25 01:03:57 +00:00
Greg Clayton 6d98f56c58 Maked LLDB into a package so we can import things without poluting the global namespace.
Enrico will follow this up with fixing the data formatter test cases that are failing.

llvm-svn: 155514
2012-04-25 00:58:03 +00:00
Sean Callanan 374bd0c9e5 Made it safe to re-import a Python module, allowing
the same test to be run multiple times in the same
session.

llvm-svn: 155511
2012-04-25 00:21:42 +00:00
Enrico Granata 45034810aa Fixing a bunch of i386 testsuite failures
llvm-svn: 155510
2012-04-25 00:13:06 +00:00
Jason Molenda 216d91f16e Change Target::ReadMemoryFromFileCache to not read from the file
if the section is marked as encrypted.  It will likely be readable
in live memory.
<rdar://problem/11305675>

llvm-svn: 155509
2012-04-25 00:06:56 +00:00
Johnny Chen c4f4d056ab Make the test case more robust in terms of remote testsuite execution.
rdar://problem/11312971

llvm-svn: 155505
2012-04-24 23:33:16 +00:00
Sean Callanan dfc066d274 Forgo the selector test on i386, where we can't
test whether an object responds to a selector
from outside the process.

llvm-svn: 155504
2012-04-24 23:31:54 +00:00
Sean Callanan 72546f01d3 Create an NSAutoreleasePool correctly in a test
case so that the Objective-C runtime doesn't
complain about lack of one, causing the test case
to fail.

llvm-svn: 155503
2012-04-24 23:18:47 +00:00
Johnny Chen 8da4ddf990 Add a suffix rule for compiling objc++ files and a sample directory under test/lang/objcxx.
llvm-svn: 155501
2012-04-24 23:05:07 +00:00
Enrico Granata bce6b17d7a Fixing a typo in the previous commit that broke the build
llvm-svn: 155497
2012-04-24 22:33:23 +00:00
Enrico Granata 9f1e204130 Fixing an issue where the expression parser was not correctly freeze-drying bitfields - This patch ensures that (a) freeze-drying bitfields works correctly and (b) that we actually access bitfields through IR instead of the 'frame var en lieu of expr' shortcut, for added safety in corner cases that may arise
llvm-svn: 155494
2012-04-24 22:15:37 +00:00
Johnny Chen 8f198c96fd Add a '-R' option, which is similar to '-r', except that the relocated directory, if exists, will be removed entirely
before running the test suite.  A usage example looks like this:

test $ ./dotest.py -A x86_64 -R /tmp/x86_64 &
test $ ./dotest.py -A i386 -R /tmp/i386 &

where we would want to run the x86_64 and i386 archs concurrently but relocate the test suite to different directory
hierarchies in order not to stump on each other's intermediate files.

llvm-svn: 155491
2012-04-24 21:44:10 +00:00
Greg Clayton a8022fa70d <rdar://problem/11291668>
Fixed an issue that would happen when using debug map with DWARF in the .o files where we wouldn't ever track down the actual definition for a type when things were in namespaces. We now serialize the decl context information into an intermediate format which allows us to track down the correct definition for a type regardless of which DWARF symbol file it comes from. We do this by creating a "DWARFDeclContext" object that contains the DW_TAG + name for each item in a decl context which we can then use to veto potential accelerator table matches. For example, the accelerator tables store the basename of the type, so if you have "std::vector<int>", we would end up with an accelerator table entry for the type that contained "vector<int>", which we would then search for using a DWARFDeclContext object that contained:

  [0] DW_TAG_class_type "vector<int>"
  [1] DW_TAG_namespace "std"

This is currently used to track down forward declarations for things like "class a:🅱️:Foo;". 

llvm-svn: 155488
2012-04-24 21:22:41 +00:00
Sean Callanan 4538aa25bd Fixed a crasher that occurs when an expression
doesn't return a result.  If that expression can't
be run in the current context (for example, if it
uses a function and there is no running process)
then we used to try to destroy the nonexistent
result variable.  We now only destroy the result
variable if we actually made one.

llvm-svn: 155455
2012-04-24 17:56:40 +00:00
Greg Clayton 1eac0c729f Added support for the LC_ENCRYPTION_INFO load command.
llvm-svn: 155423
2012-04-24 03:06:13 +00:00
Jim Ingham a503881635 Report the command error when we are in "stop on error mode."
llvm-svn: 155422
2012-04-24 02:25:07 +00:00
Jason Molenda 0a287e0356 A small fix for ObjectFileMachO::ParseSymtab() where a pointer
into the middle of a vector was being used after the vector may
have been resized.  
<rdar://problem/11284937>

llvm-svn: 155421
2012-04-24 02:09:58 +00:00
Enrico Granata fe945e83e0 Fixing the test case so that it runs correctly on i386 as well as on x86_64
llvm-svn: 155420
2012-04-24 02:01:17 +00:00
Enrico Granata f1dfbad036 Removing the @expectedFailurei386 decorator from test cases that now work as a result of the latest changes to Value.cpp
llvm-svn: 155419
2012-04-24 01:45:19 +00:00
Enrico Granata b046e0320c This patch fixes a bug where LLDB was incorrectly setting the address-size on a DataExtractor to be sizeof(void*) when the ValueObject came out of the expression parser
This worked correctly for 64-bit targets, but broke down data formatters in i386 mode. The formatters would try to read pointers out of the frozen-dried objects,
but were unable to do so because they would try fetching 8 bytes from a DataExtractor with only 4 bytes in it. This patch fixes the issue by always making the pointer-size
for a DataExtractor match the target setting.

llvm-svn: 155418
2012-04-24 01:23:23 +00:00
Jim Ingham 927f09ca0e Pass *this in explicitly to save the FileSpec copy construction.
llvm-svn: 155407
2012-04-23 23:22:24 +00:00
Greg Clayton d61c0fc049 Added the ability to log a message with a backtrace when verbose logging is enabled to the Module class. Used this new function in the DWARF parser.
llvm-svn: 155404
2012-04-23 22:55:20 +00:00
Greg Clayton 2dafd8ed4b <rdar://problem/11282938>
Fixed an issue where we get NULL compile units back from the symbol vendor. We need symbol vendors to be able to quickly give an estimate of the compile units that they have without having to fully vette them first, so anyone getting compile units from a module should be able to deal with a NULL compile unit being returned for a given index.

llvm-svn: 155398
2012-04-23 22:00:21 +00:00
Greg Clayton b210aec64d Added the ability to specify the symbol file for a module when adding it to a target.
llvm-svn: 155384
2012-04-23 20:23:39 +00:00
Johnny Chen 7debd16c95 Test file renaming.
llvm-svn: 155369
2012-04-23 17:54:40 +00:00
Sean Callanan 1ef77434e3 Implemented zext as a no-op cast in the IR
interpreter.

llvm-svn: 155360
2012-04-23 17:25:38 +00:00
Jason Molenda 0c72f85690 Bump version to lldb-143.
llvm-svn: 155272
2012-04-21 02:10:22 +00:00
Johnny Chen 910667004f Remove the expectedFailure decorator as the bug has been fixed.
llvm-svn: 155264
2012-04-21 01:02:50 +00:00
Greg Clayton b403a15ded Added code to automatically load the libheap.dylib when ptr_refs, cstr_refs 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
2012-04-21 00:11:26 +00:00
Johnny Chen 34d3a38a9c Method name change to avoid further conflicts when merging from ToT to branches/lldb-platform-work.
llvm-svn: 155260
2012-04-20 23:59:21 +00:00
Greg Clayton f99295c3a6 Fixed some issues with symbolicating things. Fixed symbolication.add_module() to not use the resolved_path before we have tried to locate it. Fixed crashlog.locate_module_and_debug_symbols() to return true and false correctly.
llvm-svn: 155255
2012-04-20 23:31:27 +00:00
Jim Ingham 6d66ce67d7 Make sure the "synchronous breakpoint callbacks" get called before the thread plan logic gets invoked, and if they
ask to continue that should short-circuit the thread plans for that thread.  Also add a bit more explanation for
how this machinery is supposed to work.  
Also pass eExecutionPolicyOnlyWhenNeeded, not eExecutionPolicyAlways when evaluating the expression for breakpoint
conditions.

llvm-svn: 155236
2012-04-20 21:16:56 +00:00
Greg Clayton 9bbddbf84a Added logging so we can see when we are trying to complete a forward type and pull in the world. This is due to a compiler bug we are tracking (<rdar://problem/11291658>) where forward decls to classes and types are not properly scoped in namespaces, which results in the current LLDB looking for a type it will find many times in the accelerator tables, but never match. For example, when debugging with clang we get a forward decl like:
class AnalysisResolver;

And we will look for it everywhere and find many many matches, but the decl context of those matching DIEs is "clang::AnalysisResolver", so we never match anything, yet we pull in waaayyy too much DWARF in the process.

To enable this logging enable the "lookups" category in the "dwarf" log channel:

(lldb) log enable dwarf lookups

llvm-svn: 155233
2012-04-20 20:35:47 +00:00
Greg Clayton 3e10cf3b51 Don't put the address of the module in the module basename as this hoses up our ability to find shared libraries by name. We now put it into the Module object name.
llvm-svn: 155223
2012-04-20 19:50:20 +00:00
Greg Clayton 3f24d36160 <rdar://problem/11259893>
Fixed an issue where iOS debugging would trust the first file it found in the SDK regardless of the UUID not matching. Now we actually get smart and can find modules in ANY of the installed SDKs and remember which SDK is our fallback SDK.

llvm-svn: 155184
2012-04-20 02:02:02 +00:00
Jim Ingham 28209d55fd Missed one place where the assert should have been in a #ifdef. Thanks Jason.
llvm-svn: 155175
2012-04-20 00:08:56 +00:00
Johnny Chen 6acfb690b5 Tests decorated with @benchmarks_test do not participate in the remote-macosx test suite run.
But, still, tearDown() should call super.tearDown(), not super.setUp(). :-)

llvm-svn: 155170
2012-04-19 23:50:00 +00:00
Johnny Chen c9cb71a0b3 LLDB test suite should also output the config info string along with the stack trace.
rdar://problem/11283401

Example:

Collected 1 test

1: test_with_dwarf (TestCallStdStringFunction.ExprCommandCallFunctionTestCase)
   Test calling std::String member function. ... FAIL

======================================================================
FAIL: test_with_dwarf (TestCallStdStringFunction.ExprCommandCallFunctionTestCase)
   Test calling std::String member function.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Volumes/data/lldb/svn/ToT/test/lldbtest.py", line 427, in wrapper
    return func(self, *args, **kwargs)
  File "/Volumes/data/lldb/svn/ToT/test/expression_command/call-function/TestCallStdStringFunction.py", line 34, in test_with_dwarf
    self.call_function()
  File "/Volumes/data/lldb/svn/ToT/test/expression_command/call-function/TestCallStdStringFunction.py", line 48, in call_function
    substrs = ['Hello world'])
  File "/Volumes/data/lldb/svn/ToT/test/lldbtest.py", line 1235, in expect
    msg if msg else EXP_MSG(str, exe))
AssertionError: False is not True : 'Hello world' returns expected result
Config=i386-clang
----------------------------------------------------------------------
Ran 1 test in 1.148s

FAILED (failures=1)

llvm-svn: 155157
2012-04-19 21:33:55 +00:00
Johnny Chen 39b8c3567a Simplify the progress bar display when neither "-v" nor "-t" is passed to the test driver.
llvm-svn: 155152
2012-04-19 20:09:44 +00:00
Sean Callanan 82b6f48331 Updated LLVM to take a variety of ARM
disassembler fixes.  The ARM disassembler is
now crash-free on all opcodes.

llvm-svn: 155149
2012-04-19 20:00:54 +00:00
Johnny Chen 92f162a798 The session file name should be tagged with (architecture, compiler) in addition
to the already existing (test result, test id) to avoid collision and to
facilitate postmortem analysis.

llvm-svn: 155148
2012-04-19 19:39:11 +00:00
Johnny Chen 4fdc339db5 Not a test failure for i386; instead, the test case should be modified to not over-expect type fields for the synthetic childs.
rdar://problem/11277013

llvm-svn: 155144
2012-04-19 18:36:11 +00:00
Jim Ingham c1c19a6f02 In debug mode, assert when we fail to get the sequence mutex. We need to remove as many places where this can happen as possible.
llvm-svn: 155138
2012-04-19 16:57:50 +00:00
Jason Molenda 7c3e6f3134 bump version to lldb-142.
llvm-svn: 155093
2012-04-19 02:02:12 +00:00
Jim Ingham 3b8285d90d Switch to setting the write side of the run lock when we call Resume. Then make a PrivateResume that doesn't switch the run-lock state, and use that where we are resuming without changing the public resume state.
llvm-svn: 155092
2012-04-19 01:40:33 +00:00
Johnny Chen 61f305cdb8 Add expected failure decorators for test cases which are failing for i386 architecture.
Plus fix some test cases to skip/succeed for i386.

llvm-svn: 155087
2012-04-19 01:07:54 +00:00
Jim Ingham fd29c36fbf Add a WriteTryLock function.
llvm-svn: 155080
2012-04-19 00:19:47 +00:00
Jim Ingham e1471230e2 The plan stack should never be used while empty. GetCurrentPlan is the entry point to contol logic
for the plan stack, so assert here if it gets called with an empty plan stack.
<rdar://problem/11265974>

llvm-svn: 155078
2012-04-19 00:17:05 +00:00
Jim Ingham 1f628f4e8f We take the API mutex first and the stop mutex second in general, so do it here as well.
llvm-svn: 155077
2012-04-19 00:14:53 +00:00
Greg Clayton af54653c32 Make sure EmulateInstructionARM doesn't have to have "armv4", "armv6", "armv7" as the exact architecture name, the arch name can just start with any of these strings. We need to be able to recognize different variants that might come along and not fail to backtrace completely (which happens when we aren't able to find an architecture that matches) when we don't have exact matches.
llvm-svn: 155045
2012-04-18 21:16:06 +00:00
Greg Clayton 26b47e24fe Added an iOS local debugging optimization when reading the __LINKEDIT section data for files in the dyld shared cache.
llvm-svn: 154984
2012-04-18 05:19:20 +00:00
Greg Clayton bade1fb874 Find and allows users to use the cached SDK's that might be in "~/Library/Developer/Xcode/iOS DeviceSupport".
Also enabled PlatformRemoteiOS to select an SDK using the build number in case you have mutliple 5.0 SDKs installed:

(lldb) platform select remote-ios --build 11C123

llvm-svn: 154978
2012-04-18 02:08:08 +00:00
Jason Molenda edfb0dcf0c Bump to lldb-141.
llvm-svn: 154975
2012-04-18 01:35:37 +00:00
Jason Molenda 9cf296d177 Add armv7s to recognized cpu type for arm instruction emulation.
llvm-svn: 154974
2012-04-18 01:28:49 +00:00
Sean Callanan ad880767fc We now record metadata for Objective-C interfaces,
Objective-C methods, and Objective-C properties.

llvm-svn: 154972
2012-04-18 01:06:17 +00:00
Greg Clayton d38e55e815 Update the way SDK directories are found so we are not reliant on the old "Latest" symlinks in the DeviceSupport directory.
llvm-svn: 154966
2012-04-18 00:06:56 +00:00
Greg Clayton ac7a3db067 Make sure an error is returned when Process::LoadImage() fails.
llvm-svn: 154965
2012-04-18 00:05:19 +00:00
Sean Callanan d9804fbd01 When an AST import fails, provide the metadata
for the original Decl, for debugging purposes.

llvm-svn: 154957
2012-04-17 22:30:04 +00:00
Jason Molenda 7bfc33077e Bump to lldb-140.
llvm-svn: 154887
2012-04-17 00:59:15 +00:00
Sean Callanan 0765c82694 Disabled spell checking in the expression parser,
which incurs large overheads in terms of type
parsing and importing.

llvm-svn: 154885
2012-04-17 00:49:48 +00:00
Greg Clayton 1e8ac36b60 Fixed the ability to load multiple __LINKEDIT segments at the same address for darwin shared cache entries. Now when registering the load address of a section, the DynamicLoader objects can specify if they should warn or not. This will fix the ability to load the nlist entries for shared libraries in the darwin shared caches when no on disk representation is available for a shared library.
llvm-svn: 154860
2012-04-16 21:01:30 +00:00
Johnny Chen 44d2497138 Add the capability of supplying the pre/post-flight functions to the test suite such that
the pre-flight code gets executed during setUp() after the debugger instance is available
and the post-flight code gets executed during tearDown() after the debugger instance has
done killing the inferior and deleting all the target programs.

Example:

[11:32:48] johnny:/Volumes/data/lldb/svn/ToT/test $ ./dotest.py -A x86_64 -v -c ../examples/test/.lldb-pre-post-flight  functionalities/watchpoint/hello_watchpoint
config: {'pre_flight': <function pre_flight at 0x1098541b8>, 'post_flight': <function post_flight at 0x109854230>}
LLDB build dir: /Volumes/data/lldb/svn/ToT/build/Debug
LLDB-139
Path: /Volumes/data/lldb/svn/ToT
URL: https://johnny@llvm.org/svn/llvm-project/lldb/trunk
Repository Root: https://johnny@llvm.org/svn/llvm-project
Repository UUID: 91177308-0d34-0410-b5e6-96231b3b80d8
Revision: 154753
Node Kind: directory
Schedule: normal
Last Changed Author: gclayton
Last Changed Rev: 154730
Last Changed Date: 2012-04-13 18:42:46 -0700 (Fri, 13 Apr 2012)


lldb.pre_flight: def pre_flight(test):
    __import__("lldb")
    __import__("lldbtest")
    print "\nRunning pre-flight function:"
    print "for test case:", test

lldb.post_flight: def post_flight(test):
    __import__("lldb")
    __import__("lldbtest")
    print "\nRunning post-flight function:"
    print "for test case:", test


Session logs for test failures/errors/unexpected successes will go into directory '2012-04-16-11_34_08'
Command invoked: python ./dotest.py -A x86_64 -v -c ../examples/test/.lldb-pre-post-flight functionalities/watchpoint/hello_watchpoint
compilers=['clang']

Configuration: arch=x86_64 compiler=clang
----------------------------------------------------------------------
Collected 2 tests

1: test_hello_watchpoint_with_dsym_using_watchpoint_set (TestMyFirstWatchpoint.HelloWatchpointTestCase)
   Test a simple sequence of watchpoint creation and watchpoint hit. ... 
Running pre-flight function:
for test case: test_hello_watchpoint_with_dsym_using_watchpoint_set (TestMyFirstWatchpoint.HelloWatchpointTestCase)

Running post-flight function:
for test case: test_hello_watchpoint_with_dsym_using_watchpoint_set (TestMyFirstWatchpoint.HelloWatchpointTestCase)
ok
2: test_hello_watchpoint_with_dwarf_using_watchpoint_set (TestMyFirstWatchpoint.HelloWatchpointTestCase)
   Test a simple sequence of watchpoint creation and watchpoint hit. ... 
Running pre-flight function:
for test case: test_hello_watchpoint_with_dwarf_using_watchpoint_set (TestMyFirstWatchpoint.HelloWatchpointTestCase)

Running post-flight function:
for test case: test_hello_watchpoint_with_dwarf_using_watchpoint_set (TestMyFirstWatchpoint.HelloWatchpointTestCase)
ok

----------------------------------------------------------------------
Ran 2 tests in 1.584s

OK

llvm-svn: 154847
2012-04-16 18:55:15 +00:00
Greg Clayton d1cf11a74d Added a new host function that allows us to run shell command and get the output from them along with the status and signal:
Error
Host::RunShellCommand (const char *command,
                       const char *working_dir,
                       int *status_ptr,
                       int *signo_ptr,
                       std::string *command_output_ptr,
                       uint32_t timeout_sec);

This will allow us to use this functionality in the host lldb_private::Platform, and also use it in our lldb-platform binary. It leverages the existing code in Host::LaunchProcess and ProcessLaunchInfo.

llvm-svn: 154730
2012-04-14 01:42:46 +00:00
Sean Callanan f5c87882a0 Added a --lldb option to override the location
of LLDB.framework.

llvm-svn: 154728
2012-04-14 01:06:06 +00:00
Sean Callanan 2a7d20405d Made sure that the collections of mutexes used in
checking for LLDB mutex validity are static so
that entries put in there actually persist between
calls to error_check_mutex.

llvm-svn: 154727
2012-04-14 01:05:29 +00:00
Johnny Chen 7b9f93a186 Patch from Viktor Kutuzov <vkutuzov@accesssoftek.com>:
Hello everyone,
 
please find the attached patch for TOT and lldb-platform-work branch, which provides the following changes:
 - fixed a crash in the ProcessPOSIX constructor when an executable module object is not yet created.
 - added support for the multi instanciated FreeBSD platform objects (the local host and remote as example).
 - enabled the remote gdb plugin on FreeBSD.

llvm-svn: 154724
2012-04-14 00:54:42 +00:00
Sean Callanan 0fcd749a51 Updated LLVM to take a variety of fixes to
disassembler problems:

- r153766, fixing a crash disassembling vmov
- r154628, fixing relative branches
- r154459, fixing a crash disassembling vld
- r154544, fixing a crash disassembling vst

llvm-svn: 154722
2012-04-14 00:08:14 +00:00
Jim Ingham d846f1f2b1 The API lock was getting dropped too soon in GetVariables. GetValueObjectForFrameVariable could run the target (to get dynamic values) and that requires the target lock.
llvm-svn: 154711
2012-04-13 23:29:44 +00:00
Jim Ingham 99ff2c42f6 In debug mode, assert if we haven't initialized a mutex we thought we'd initialized.
llvm-svn: 154710
2012-04-13 23:28:33 +00:00
Jim Ingham 87d0e61839 Don't do the work in DoTakedown if the thread plan isn't valid.
Also fixed up some logging.

llvm-svn: 154709
2012-04-13 23:11:52 +00:00
Jim Ingham e39f85c774 The run all threads timeout in RunThreadPlan should respect the user timeout, not be arbitrarily 10 seconds (which was too long anyway...)
Also added some logging to RunThreadPlan and made others more regular.

llvm-svn: 154708
2012-04-13 23:09:49 +00:00
Greg Clayton d451c1a843 Added the thread ID (tid) to each packet history item and the packet history now always dumps to a lldb_private::Stream.
Enable logging the packet history when registers fail to read due to not getting the sequence mutex if "--verbose" is enabled on the log channel for the "gdb-remote" log category.

This will help us track down some issues.

llvm-svn: 154704
2012-04-13 21:24:18 +00:00
Johnny Chen 9a27713a74 First step to make the test suite runnable for remote platforms.
For the types directory, we were running lldbtest.system() to execute the compiled program
on the test host to collect golden output in order to compare with the output of various
lldb debugger commands as performed later.  This won't work for the remote platform
scenario where the architecture of the target and host platforms are different.

Modify the AbstractBase class to use lldb to launch the inferior while specifying the
output file, from which the golden output is collected and grokked.  How to bootstrap and
to connect to the remote platform is still being worked at.

llvm-svn: 154699
2012-04-13 20:40:52 +00:00
Jim Ingham 0092c8eb2f Factor out a bunch of common code in the two ThreadPlanCallFunction constructors. Also add a sanity check - try reading the frame, and if we fail bag out.
llvm-svn: 154698
2012-04-13 20:38:13 +00:00
Greg Clayton de0e9d04ad <rdar://problem/11193466>
Fixed an error where lldb would hang when writing memory near the end of the addres space due to an unsigned overflow.

llvm-svn: 154697
2012-04-13 20:37:20 +00:00
Jim Ingham cbbdaa9378 Couple more places in SBValue where you need to take the run-lock.
llvm-svn: 154683
2012-04-13 18:30:20 +00:00
Jim Ingham 718583ff23 ThreadPlanCallFunction's destructor wasn't calling DoTakedown, so if the that plan got discarded we weren't doing the takedown.
llvm-svn: 154681
2012-04-13 18:27:58 +00:00
Greg Clayton d84bb48582 Added a --memory option to allow dumping the matching malloc block memory with a default format that makes sense, or that format can be overridden with the --format option.
llvm-svn: 154671
2012-04-13 16:24:09 +00:00
Greg Clayton f958f348c8 <rdar://problem/11241798>
The less locks there are, the better. I removed the thread ID mutex and now just shared the m_thread_list's mutex to make sure we don't deadlock due to lock inversion.

llvm-svn: 154652
2012-04-13 02:11:32 +00:00
Jason Molenda 5a9f9d3241 version bump to lldb-139.
llvm-svn: 154650
2012-04-13 02:00:58 +00:00
Sean Callanan 84790aedb1 Updated llvm.zip to include a fix for a leak in
the MC disassembler.

llvm-svn: 154649
2012-04-13 01:46:44 +00:00
Johnny Chen 18104239b4 Ditto 'requires modern objc runtime' for TestRealDefinition.py -- fix test suite errors for i386.
llvm-svn: 154638
2012-04-13 00:23:26 +00:00
Greg Clayton ce7d345a57 Added more complete error checking for mutexes only for "Debug" builds where we always check if a mutex is valid prior to doing stuff with it. We also track when mutexes are initialized and destroyed and keep these in sets that can very subsequent pthread_mutex_XXX API calls.
llvm-svn: 154637
2012-04-13 00:21:53 +00:00
Johnny Chen 97ccf9f3b2 Ditto 'requires modern objc runtime' for TestObjCProperty.py -- fix test suite errors for i386.
llvm-svn: 154636
2012-04-13 00:18:17 +00:00
Johnny Chen 45872c01ff Fix some test suite errors. TestForwardDecl.py errors were due to bad Makefile.rules, while TestHiddenIvars.py errors due to features only available in modern objc runtime.
llvm-svn: 154635
2012-04-13 00:13:35 +00:00
Sean Callanan 60217120b5 Added a mechanism for keeping track of where in
the debug information individual Decls came from.

We've had a metadata infrastructure for a while,
which was intended to solve a problem we've since
dealt with in a different way.  (It was meant to
keep track of which definition of an Objective-C
class was the "true" definition, but we now find
it by searching the symbols for the class symbol.)
The metadata is attached to the ExternalASTSource,
which means it has a one-to-one correspondence with
AST contexts.

I've repurposed the metadata infrastructure to
hold the object file and DIE offset for the DWARF
information corresponding to a Decl.  There are
methods in ClangASTContext that get and set this
metadata, and the ClangASTImporter is capable of
tracking down the metadata for Decls that have been
copied out of the debug information into the
parser's AST context without using any additional
memory.

To see the metadata, you just have to enable the
expression log:
-
(lldb) log enable lldb expr
-
and watch the import messages.  The high 32 bits
of the metadata indicate the index of the object
file in its containing DWARFDebugMap; I have also
added a log which you can use to track that mapping:
-
(lldb) log enable dwarf map
-

This adds 64 bits per Decl, which in my testing
hasn't turned out to be very much (debugging Clang
produces around 6500 Decls in my tests).  To track
how much data is being consumed, I've also added a
global variable g_TotalSizeOfMetadata which tracks
the total number of Decls that have metadata in all
active AST contexts.

Right now this metadata is enormously useful for
tracking down bugs in the debug info parser.  In the
future I also want to use this information to provide
more intelligent error messages instead of printing
empty source lines wherever Clang refers to the
location where something is defined.

llvm-svn: 154634
2012-04-13 00:10:03 +00:00
Greg Clayton c8e0c244e4 Expose GetAddressClass() from both the SBAddress and SBInstruction so clients can tell the difference between ARM/Thumb opcodes when disassembling ARM.
llvm-svn: 154633
2012-04-13 00:07:34 +00:00
Sean Callanan 02eee4d4f7 Fixed a problem where LLDB inserted regular C
FunctionDecls into classes if it looked up a
method in a different DWARF context than the
one where it found the parent class's definition.

The symptom of this was, for a method A::B(),

1) LLDB finds A in context 1, creating a
   CXXRecordDecl for A and marking it as needing
   completion

2) LLDB looks up B in context 2, finds that its
   parent A already has a CXXRecordDecl, but can't
   find a CXXMethodDecl for B

3) Not finding a CXXMethodDecl for B, LLDB doesn't
   set the flag indicating that B was resolved

4) Because the flag wasn't set, LLDB's fallthrough
   code creates a FunctionDecl for B and sticks it
   in the DeclContext -- in this case, A.

5) Clang crashes on finding a FunctionDecl inside a
   CXXRecordDecl.

llvm-svn: 154627
2012-04-12 23:10:00 +00:00
Greg Clayton 1bcb26c672 Fixed some expression issues after switching to void * args.
llvm-svn: 154615
2012-04-12 21:06:22 +00:00
Greg Clayton af2589ea09 Fixed an issue that happens in LLDB versions after SBFrame switched to using a lldb::ExecutionContextRefSP where we might segfault due to using a shared pointer with NULL in it. The SBFrame object should always have a valid lldb::ExecutionContextRefSP in it. The SBFrame::Clear() method was doing the wrong thing and is now fixed.
llvm-svn: 154614
2012-04-12 20:58:26 +00:00
Greg Clayton c3c0b0e59a Remove the GetSequenceMutex timeout that isn't being used in the GDB remote plug-in.
Also fixed the ProcessLinux, ProcessPOSIX and ProcessFreeBSD to have the correct UpdateThreadList() prototype.

llvm-svn: 154603
2012-04-12 19:04:34 +00:00
Greg Clayton 7767716d0f A few tweaks done to the heap.py in me free time where we now have:
(lldb) command script import heap.py

Find all malloc blocks that contains a pointer value of 0x1234000:
(lldb) ptr_refs 0x1234000

Find all malloc blocks that contain a C string:
(lldb) cstr_refs "hello"

Get info on a malloc block that starts at or contains 0x12340000
(lldb) malloc_info 0x12340000

llvm-svn: 154602
2012-04-12 18:57:36 +00:00
Jim Ingham b1e2e848f3 Make sure that DoResume doesn't stall if we shut down the async thread while DoResume is waiting
for packet confirmation.  
Also added a bit more logging.
Also, unlock the writer end of the run lock in Process.cpp on our way out of the private state
thread so that the Process can shut down cleanly.

<rdar://problem/11228538>

llvm-svn: 154601
2012-04-12 18:49:31 +00:00
Jim Ingham 5b7a845a0a Cleanup, keep private types separate from private member variables.
llvm-svn: 154600
2012-04-12 18:25:11 +00:00
Sean Callanan 6f3e5ad704 Make sure frozen_sp for a ClangExpressionVariable
is non-NULL before asking for its name.

llvm-svn: 154593
2012-04-12 16:58:26 +00:00
Johnny Chen b127f00b51 Make the default architectures to run as both 64 and 32-bit.
rdar://problem/11031264

llvm-svn: 154573
2012-04-12 00:55:57 +00:00
Sean Callanan 18a11e33ea Fixed a crash in Clang when a superclass of an
Objective-C class doesn't have a definition but
Clang tries to read through its protocols anyway.

llvm-svn: 154538
2012-04-11 21:48:13 +00:00
Greg Clayton d1411e1aa2 Cleaned up code that was getting SBData for an SBInstruction.
llvm-svn: 154535
2012-04-11 21:13:31 +00:00
Greg Clayton 7fb671bac0 Cleaned up the code and we now also dump the dynamic object for the malloc block. Using this on the lldb/test/lang/objc/foundation test we can see this in action:
First we can load the module:

(lldb) command script import /Volumes/work/gclayton/Documents/src/lldb/examples/darwin/heap_find/heap.py
Loading "/Volumes/work/gclayton/Documents/src/lldb/examples/darwin/heap_find/libheap.dylib"...ok
Image 0 loaded.
"heap_ptr_refs" and "heap_cstr_refs" commands have been installed, use the "--help" options on these commands for detailed help.


Lets take a look at the variable "my":

(lldb) fr var *my
(MyString) *my = {
  MyBase = {
    NSObject = {
      isa = MyString
    }
    propertyMovesThings = 0
  }
  str = 0x0000000100301a60
  date = 0x0000000100301e60
  _desc_pauses = NO
}


We can see that this contains an ivar "str" which has a pointer value of "0x0000000100301a60". Lets search the heap for this pointer and see what we find:

(lldb) heap_ptr_refs 0x0000000100301a60
found pointer 0x0000000100301a60: block = 0x103800270, size = 384, offset = 168, type = 'void *'
found pointer 0x0000000100301a60: block = 0x100301cf0, size = 48, offset = 16, type = 'MyString *', ivar = 'str' 
(MyString) *addr = {
  MyBase = {
    NSObject = {
      isa = MyString
    }
    propertyMovesThings = 0
  }
  str = 0x0000000100301a60
  date = 0x0000000100301e60
  _desc_pauses = NO
}
found pointer 0x0000000100301a60: block = 0x100820000, size = 4096, offset = 96, type = (autorelease object pool)
found pointer 0x0000000100301a60: block = 0x100820000, size = 4096, offset = 104, type = (autorelease object pool)


Note that it used dynamic type info to find that it was in "MyString" at offset 16 and it also found the ivar "str"!

We can also look for C string values on the heap. Lets look for "a.out":

(lldb) heap_cstr_refs "a.out"
found cstr a.out: block = 0x10010ce00, size = 96, offset = 85, type = '__NSCFString *'
found cstr a.out: block = 0x100112d90, size = 80, offset = 68, type = 'void *'
found cstr a.out: block = 0x100114490, size = 96, offset = 85, type = '__NSCFString *'
found cstr a.out: block = 0x100114530, size = 112, offset = 97, type = '__NSCFString *'
found cstr a.out: block = 0x100114e40, size = 32, offset = 17, type = '__NSCFString *'
found cstr a.out: block = 0x100114fa0, size = 32, offset = 17, type = '__NSCFString *'
found cstr a.out: block = 0x100300780, size = 160, offset = 128, type = '__NSCFData *'
found cstr a.out: block = 0x100301a60, size = 112, offset = 97, type = '__NSCFString *'
found cstr a.out: block = 0x100821000, size = 4096, offset = 100, type = 'void *'

We see we have some objective C classes that contain this, so lets "po" all of the results by adding the --po option:

(lldb)  heap_cstr_refs a.out --po
found cstr a.out: block = 0x10010ce00, size = 96, offset = 85, type = '__NSCFString *'
  (__NSCFString *) 0x10010ce00 /Volumes/work/gclayton/Documents/src/lldb/test/lang/objc/foundation/a.out

found cstr a.out: block = 0x100112d90, size = 80, offset = 68, type = 'void *'
found cstr a.out: block = 0x100114490, size = 96, offset = 85, type = '__NSCFString *'
  (__NSCFString *) 0x100114490 /Volumes/work/gclayton/Documents/src/lldb/test/lang/objc/foundation/a.out

found cstr a.out: block = 0x100114530, size = 112, offset = 97, type = '__NSCFString *'
  (__NSCFString *) 0x100114530 Hello from '/Volumes/work/gclayton/Documents/src/lldb/test/lang/objc/foundation/a.out'

found cstr a.out: block = 0x100114e40, size = 32, offset = 17, type = '__NSCFString *'
  (__NSCFString *) 0x100114e40 a.out.dSYM

found cstr a.out: block = 0x100114fa0, size = 32, offset = 17, type = '__NSCFString *'
  (__NSCFString *) 0x100114fa0 a.out

found cstr a.out: block = 0x100300780, size = 160, offset = 128, type = '__NSCFData *'
  (__NSCFData *) 0x100300780 <48656c6c 6f206672 6f6d2027 2f566f6c 756d6573 2f776f72 6b2f6763 6c617974 6f6e2f44 6f63756d 656e7473 2f737263 2f6c6c64 622f7465 73742f6c 616e672f 6f626a63 2f666f75 6e646174 696f6e2f 612e6f75 742700>

found cstr a.out: block = 0x100301a60, size = 112, offset = 97, type = '__NSCFString *'
  (__NSCFString *) 0x100301a60 Hello from '/Volumes/work/gclayton/Documents/src/lldb/test/lang/objc/foundation/a.out'

found cstr a.out: block = 0x100821000, size = 4096, offset = 100, type = 'void *'

llvm-svn: 154519
2012-04-11 18:30:53 +00:00
Greg Clayton 885294808a Get rid of absolute path in "process load" command.
llvm-svn: 154506
2012-04-11 17:04:00 +00:00
Greg Clayton 804de01c33 Added a new "heap.py" module that adds a new command line command that can find values on the heap and print out the dynamic type of the malloc block that contains the data. I will be modifying this a bit more to tweak the output and make the output more useful.
llvm-svn: 154504
2012-04-11 16:27:06 +00:00
Greg Clayton 6a0afeb9c8 Fixed an issue that would cause a crash when dumping fully qualified types.
llvm-svn: 154503
2012-04-11 16:21:20 +00:00
Greg Clayton 851eacb507 Added a property to get the dynamic type which uses the most permissive way to get a dynamic type.
llvm-svn: 154502
2012-04-11 16:20:15 +00:00
Greg Clayton 37a0a24a5f No functionality changes, mostly cleanup.
Cleaned up the Mutex::Locker and the ReadWriteLock classes a bit.

Also cleaned up the GDBRemoteCommunication class to not have so many packet functions. Used the "NoLock" versions of send/receive packet functions when possible for a bit of performance.

llvm-svn: 154458
2012-04-11 00:24:49 +00:00
Jason Molenda 9704e82978 Tweak arm variants list for valid arches settings.
llvm-svn: 154450
2012-04-10 23:08:02 +00:00
Sean Callanan 62ecb9b97b Improved detection of ARM branch instructions to
cover all possible condition codes.

llvm-svn: 154440
2012-04-10 21:51:12 +00:00
Greg Clayton 470dfcbc42 Added more documentation in the header file to explain how to use the results that are found by the function calls to find_pointer_in_heap().
llvm-svn: 154435
2012-04-10 20:59:36 +00:00
Greg Clayton b10973af64 Fixed head_find to compile again.
llvm-svn: 154419
2012-04-10 18:19:20 +00:00
Sean Callanan 6153c518b9 Set variables returned by utility functions to
not consume slots in the persistent variable
store.

llvm-svn: 154416
2012-04-10 18:16:59 +00:00
Greg Clayton 4463399b0d Added a new packet to our GDB remote protocol:
QListThreadsInStopReply
	
This GDB remote query command can enable added a "threads" key/value pair to all stop reply packets so that we always get a list of all threads in each stop reply packet. It increases performance if enabled (the reply to the "QListThreadsInStopReply" is "OK") by saving us from sending to command/reply pairs (the "qfThreadInfo" and "qsThreadInfo" packets), and also helps us keep the current process state up to date. 

llvm-svn: 154380
2012-04-10 03:22:03 +00:00
Greg Clayton 9e92090b3c A general stability fix where we _always_ get the thread list immediately after we get the stop packets. We had some racy conditions where thread 1 might be sending a packet and thread 2 tries to send a packet to get the thread list and it fails and ends up with an empty list. Packets use a sequence mutex to be able to ensure when you send a packet, you get the resonse. This sequence mutex is take when the process is running, and as we exit the running state and notify our process with the stop packet, we now always get the thread ID list before we do anything and before we can run into race conditions.
The next step is to have our stop reply packets send the thread list in the actual stop reply packet to avoid a 2 packet overhead of sending the qfThreadInfo + response and qfThreadInfo + response.

llvm-svn: 154376
2012-04-10 02:25:43 +00:00
Jim Ingham 076b3041c0 Two changes,
1) Start the PrivateStateThread stopped, and then in
StartPrivateStateThread, make the private state thread and then
resume it before we say the thread is created.  That way we know it is
listening for events by the time we get out of
StartPrivateStateThread.

2) Backstop running a thread plan when calling Process::RunThreadPlan
on the private state thread with a ThreadPlanBase so that running the
plan doesn't pass its stop events to whatever plans happen to be above
us on the thread plan stack.

llvm-svn: 154368
2012-04-10 01:21:57 +00:00
Jim Ingham d8ba464b6a Clear the "m_actual_stop_info_sp" in the thread during Destroy. It might be a StopInfoThreadPlan, and that would hold onto members that need to be destroyed while the Full thread is still around.
llvm-svn: 154366
2012-04-10 00:44:25 +00:00
Greg Clayton 9fc13556b4 Trying to solve our disappearing thread issues by making thread list updates safer.
The current ProcessGDBRemote function that updates the threads could end up with an empty list if any other thread had the sequence mutex. We now don't clear the thread list when we can't access it, and we also have changed how lldb_private::Process handles the return code from the:

virtual bool
Process::UpdateThreadList (lldb_private::ThreadList &old_thread_list, 
                       	   lldb_private::ThreadList &new_thread_list) = 0;

A bool is now returned to indicate if the list was actually updated or not and the lldb_private::Process class will only update the stop ID of the validity of the thread list if "true" is returned.

The ProcessGDBRemote also got an extra assertion that will hopefully assert when running debug builds so we can find the source of this issue.

llvm-svn: 154365
2012-04-10 00:18:59 +00:00
Enrico Granata cb50d341aa Fixing a problem where some uninitialized cases of vectors could cause diagnostic output from the synthetic children providers - this time the fix should work
llvm-svn: 154361
2012-04-10 00:11:03 +00:00
Greg Clayton c1422c1d31 Added a packet history object to the GDBRemoteCommunication class that is always remembering the last 512 packets that were sent/received. These packets get dumped if logging gets enabled, or when the new expr lldb::DumpProcessGDBRemotePacketHistory (void *process, const char *log_file_path) global function is called.
llvm-svn: 154354
2012-04-09 22:46:21 +00:00
Greg Clayton 5c61054742 Removed an include that wasn't needed.
llvm-svn: 154353
2012-04-09 22:44:52 +00:00
Greg Clayton 437a135dd2 Fixed an issue that could occur when looking up functions inside of a namespace where if the NamespaceDecl hadn't been parsed yet, we would say a function wasn't in a namespace.
Also improved the logging that happens with "log enable dwarf lookups" is enabled to show when we find matches.

llvm-svn: 154352
2012-04-09 22:43:43 +00:00
Jim Ingham cf274f910e Rework how master plans declare themselves. Also make "PlanIsBasePlan" not rely only on this being the bottom plan in the stack, but allow the plan to declare itself as such.
llvm-svn: 154351
2012-04-09 22:37:39 +00:00
Greg Clayton 0cd7086604 <rdar://problem/11202426>
Work around a deadlocking issue where "SBDebugger::MemoryPressureDetected ()" is being called and is causing a deadlock. We now just try and get the lock when trying to trim down the unique modules so we don't deadlock debugger GUI programs until we can find the root cause.

llvm-svn: 154339
2012-04-09 20:22:01 +00:00
Benjamin Kramer c2b5c67df3 Linux/ProcessMonitor: include sys/user.h for user_regs_struct and user_fpregs_struct.
llvm-svn: 154255
2012-04-07 09:13:49 +00:00
Jason Molenda 7a2f433367 Version bump to lldb-138.
llvm-svn: 154252
2012-04-07 06:18:20 +00:00
Jason Molenda b9e88d4186 Fix a integer trauction issue - calculating the current time in
nanoseconds in 32-bit expression would cause pthread_cond_timedwait
to time out immediately.  Add explicit casts to the TimeValue::TimeValue
ctor that takes a struct timeval and change the NanoSecsPerSec etc
constants defined in TimeValue to be uint64_t so any other calculations
involving these should be promoted to 64-bit even when lldb is built
for 32-bit.

<rdar://problem/11204073>, <rdar://problem/11179821>, <rdar://problem/11194705>.

llvm-svn: 154250
2012-04-07 04:55:02 +00:00
Greg Clayton 7b70be3970 Removed redundant isxdigit checks and added the ability to GetHexU8() so it can extract an 8 bit hex value if one is available. It will set EOF if "set_eof_on_fail" is true or if out of data. This allows a string decoder to grab a string without losing the last part of the packet with a packet like "414243,abc" (it can extract "ABC" and leave the file position set to the comma).
llvm-svn: 154239
2012-04-07 00:42:53 +00:00
Sean Callanan bf81ea5a9f Hardened the struct layout code to eliminate a
potential crash if the underlying type couldn't
be completed.

llvm-svn: 154234
2012-04-07 00:06:00 +00:00
Jim Ingham 372787fc19 We sometimes need to be able to call functions (via Process::RunThreadPlan) from code run on the private state thread. To do that we have to
spin up a temporary "private state thread" that will respond to events from the lower level process plugins.  This check-in should work to do
that, but it is still buggy.  However, if you don't call functions on the private state thread, these changes make no difference.

This patch also moves the code in the AppleObjCRuntime step-through-trampoline handler that might call functions (in the case where the debug
server doesn't support the memory allocate/deallocate packet) out to a safe place to do that call.

llvm-svn: 154230
2012-04-07 00:00:41 +00:00
Sean Callanan d13c23c393 Changed some tabs to spaces to make Python like
this file.

llvm-svn: 154222
2012-04-06 23:02:44 +00:00
Sean Callanan 1106434be3 The remaining time calculation didn't reflect the
--start argument.  Fixed that.

llvm-svn: 154221
2012-04-06 23:00:31 +00:00
Johnny Chen 7bba2c6d64 The final batch of adding @dsym_test/@dwarf_test decorators.
llvm-svn: 154211
2012-04-06 21:33:58 +00:00
Sean Callanan afc7b13e56 Removed a call to truncate() which slowed down
the stress test by a LOT.

llvm-svn: 154208
2012-04-06 21:04:20 +00:00
Sean Callanan ceabd2d712 Updated the disassembler stress tester with two
new features:

(1) it outputs the instruction currently being
    tested to a log file, if a path is provided

(2) if instructed, it prints the time remaining
    in the exhaustive test

llvm-svn: 154205
2012-04-06 20:53:23 +00:00
Johnny Chen 24086bc93b Second batch of adding @dsym_test/@dwarf_test decorators to existing test cases.
Plus some minor cleanup of test method names.
Third and final batch is coming.

llvm-svn: 154197
2012-04-06 19:54:10 +00:00
Greg Clayton 780af51505 Fixed ModuleList::FindTypes() so that when a symbol context is supplied that contains a valid module, it will search that module first, then if we are still looking for matches (we have found less that "max_matches"), search in all of the other modules as well.
llvm-svn: 154186
2012-04-06 18:09:43 +00:00
Sean Callanan 2b54db7664 Fixed a leak in the LLVM disassembler where we
did not destroy the underlying disassembler in 
our destructor.

llvm-svn: 154185
2012-04-06 17:59:49 +00:00
Greg Clayton 29399a24c6 In a prior commit, I changed the parameters around on a ModuleList::FindTypes where the old parameters that existing clients were using would have been compatible, so I renamed ModuleList::FindTypes to ModuleList::FindTypes2. Then I made fixes and verified I updated and fixed all client code, but I forgot to rename the function back to ModuleList::FindTypes(). I am doing that now and also cleaning up the C++ dynamic type code a bit.
llvm-svn: 154182
2012-04-06 17:41:13 +00:00
Greg Clayton 55995ebb58 Check if the two clang opaque type pointers are equal before doing anything more exhaustive comparison.
llvm-svn: 154181
2012-04-06 17:38:55 +00:00
Greg Clayton c9858e4d05 Added logging when API calls try to do something that shouldn't be done when the process is stopped by having logging calls that end with "error: process is running".
Also test for the process to be stopped when many SBValue API calls are made to make sure it is safe to evaluate values, children of values and much more.

llvm-svn: 154160
2012-04-06 02:17:47 +00:00
Johnny Chen f1548d4f74 Add a new option to the test driver, -N dsym or -N dwarf, in order to exclude tests decorated with
either @dsym_test or @dwarf_test to be executed during the testsuite run.  There are still lots of
Test*.py files which have not been decorated with the new decorator.

An example:

# From TestMyFirstWatchpoint.py ->
class HelloWatchpointTestCase(TestBase):

    mydir = os.path.join("functionalities", "watchpoint", "hello_watchpoint")

    @dsym_test
    def test_hello_watchpoint_with_dsym_using_watchpoint_set(self):
        """Test a simple sequence of watchpoint creation and watchpoint hit."""
        self.buildDsym(dictionary=self.d)
        self.setTearDownCleanup(dictionary=self.d)
        self.hello_watchpoint()

    @dwarf_test
    def test_hello_watchpoint_with_dwarf_using_watchpoint_set(self):
        """Test a simple sequence of watchpoint creation and watchpoint hit."""
        self.buildDwarf(dictionary=self.d)
        self.setTearDownCleanup(dictionary=self.d)
        self.hello_watchpoint()


# Invocation ->
[17:50:14] johnny:/Volumes/data/lldb/svn/ToT/test $ ./dotest.py -N dsym -v -p TestMyFirstWatchpoint.py
LLDB build dir: /Volumes/data/lldb/svn/ToT/build/Debug
LLDB-137
Path: /Volumes/data/lldb/svn/ToT
URL: https://johnny@llvm.org/svn/llvm-project/lldb/trunk
Repository Root: https://johnny@llvm.org/svn/llvm-project
Repository UUID: 91177308-0d34-0410-b5e6-96231b3b80d8
Revision: 154133
Node Kind: directory
Schedule: normal
Last Changed Author: gclayton
Last Changed Rev: 154109
Last Changed Date: 2012-04-05 10:43:02 -0700 (Thu, 05 Apr 2012)



Session logs for test failures/errors/unexpected successes will go into directory '2012-04-05-17_50_49'
Command invoked: python ./dotest.py -N dsym -v -p TestMyFirstWatchpoint.py
compilers=['clang']

Configuration: arch=x86_64 compiler=clang
----------------------------------------------------------------------
Collected 2 tests

1: test_hello_watchpoint_with_dsym_using_watchpoint_set (TestMyFirstWatchpoint.HelloWatchpointTestCase)
   Test a simple sequence of watchpoint creation and watchpoint hit. ... skipped 'dsym tests'
2: test_hello_watchpoint_with_dwarf_using_watchpoint_set (TestMyFirstWatchpoint.HelloWatchpointTestCase)
   Test a simple sequence of watchpoint creation and watchpoint hit. ... ok

----------------------------------------------------------------------
Ran 2 tests in 1.138s

OK (skipped=1)
Session logs for test failures/errors/unexpected successes can be found in directory '2012-04-05-17_50_49'
[17:50:50] johnny:/Volumes/data/lldb/svn/ToT/test $ 

llvm-svn: 154154
2012-04-06 00:56:05 +00:00
Bill Wendling c80efb418b Add flag to warn about ivar initialization reordering.
llvm-svn: 154153
2012-04-06 00:48:15 +00:00
Bill Wendling 04e7e0ba7a explicitly cast the value.
llvm-svn: 154148
2012-04-06 00:10:46 +00:00
Bill Wendling 7a4b007c65 Order ivar initializers to how they're declared in the class.
llvm-svn: 154147
2012-04-06 00:10:21 +00:00
Bill Wendling e6eeef0164 Order ivar initializers to how they're declared in the class.
llvm-svn: 154146
2012-04-06 00:09:59 +00:00
Bill Wendling 4fe443aa21 Silence unused warning.
llvm-svn: 154145
2012-04-06 00:09:21 +00:00
Sean Callanan d181730aa5 Added a stress-tester for LLDB's disassembler.
Right now it only works on Mac OS X, but other
platforms would just need to add their own
implementation of AddLLDBToSysPathOn*().

The stress-tester has two modes:

Used with --bytes N --random, the stress-tester
generates random instructions of length N and
runs them through the disassembler.  This is
suitable for architectures like Intel where it
is combinatorially infeasible to run through the
entire space of possible instructions.

Used with --bytes N and no arguments (or --start
S --stride T), the stress-tester tests the
disassembler with a monotonically increasing
sequence of instructions.

The --start and --stride arguments are intended
for use in multiprocessing environments.  Give
each core an ID from 0 .. T-1, pass the ID in as
the --start, and use T as the stride, and you
can launch one copy of the stress-tester on each
core you have available.

llvm-svn: 154143
2012-04-06 00:04:36 +00:00
Greg Clayton d84cec07c9 Enable building the POSIX-DYLD dynamic loader plug-in in the Makefile build since it can be used for remote debugging.
llvm-svn: 154109
2012-04-05 17:43:02 +00:00
Bill Wendling e50ab408e5 Revert r154086. It may be needed for Darwin. But the symbols are still missing in the dylib.
llvm-svn: 154108
2012-04-05 17:38:07 +00:00
Greg Clayton 7fdf9ef15d Added a new Host class: ReadWriteLock
This abstracts read/write locks on the current host system. It is currently backed by pthread_rwlock_t objects so it should work on all unix systems.

We also need a way to control multi-threaded access to the process through the public API when it is running. For example it isn't a good idea to try and get stack frames while the process is running. To implement this, the lldb_private::Process class now contains a ReadWriteLock member variable named m_run_lock which is used to control the public process state. The public process state represents the state of the process as the client knows it. The private is used to control the actual current process state. So the public state of the process can be stopped, yet the private state can be running when evaluating an expression for example. 

Adding the read/write lock where readers are clients that want the process to stay stopped, and writers are clients that run the process, allows us to accurately control multi-threaded access to the process.

Switched the SBThread and SBFrame over to us shared pointers to the ExecutionContextRef class instead of making their own class to track this. This fixed an issue with assigning on SBFrame to another and will also centralize the code that tracks weak references to execution context objects into one location.

llvm-svn: 154099
2012-04-05 16:12:35 +00:00
Bill Wendling e914660c0d The DynamicLoaderPOSIXDYLD calls aren't available on Apple systems.
llvm-svn: 154086
2012-04-05 06:21:02 +00:00
Bill Wendling de59fb02b9 Add Security framework to the list of frameworks needed for linking.
llvm-svn: 154085
2012-04-05 06:20:13 +00:00
Sean Callanan a03156fc66 Tolerate decimal points in the LLDB version number.
They are truncated when generating the version
numbers seen in the headers, so for example
lldb-100.1 would have #define LLDB_VERSION=100

llvm-svn: 154074
2012-04-05 01:30:56 +00:00
Sean Callanan a658226ac0 Fixed a problem where we did not read properties
correctly if the setter/getter were not present
in the debug information.  The fixes are as follows:

- We not only look for the method by its full name,
  but also look for automatically-generated methods
  when searching for a selector in an Objective-C
  interface.  This is necessary to find accessors.

- Extract the getter and setter name from the
  DW_TAG_APPLE_Property declaration in the DWARF
  if they are present; generate them if not.

llvm-svn: 154067
2012-04-05 00:12:52 +00:00
Bill Wendling c359aafc55 Order the initializations so that they reflect how they're declared in the class.
llvm-svn: 154055
2012-04-04 21:19:57 +00:00
Greg Clayton 0b88d815e3 <rdar://problem/11184458>
Found an issue where we might still have shared pointer references to lldb_private::Thread objects where the object itself is not valid and has been removed from the Process. When a thread is removed from a process, it will call Thread::DestroyThread() which well set a boolean member variable which is exposed now via:

bool
Thread::IsValid() const;

We then check the thread validity before handing out a shared pointer.

llvm-svn: 154048
2012-04-04 20:43:47 +00:00
Greg Clayton 7e8a601c56 Change SBAddress back to using a std::auto_ptr to a lldb_private::Address as the lldb_private::Address has a weak pointer to the section which has a weak pointer back to the module, so it is safe to have just a lldb_private::Address object now.
llvm-svn: 154045
2012-04-04 20:36:48 +00:00
Greg Clayton b8a54482b3 Use LLDB as the default debugger for launcherXPCService.
llvm-svn: 154043
2012-04-04 20:07:33 +00:00
Greg Clayton 3c18cd3de1 Fixed the C++11 #defines that wrap std::weak_ptr to actually use std::weak_ptr.
llvm-svn: 154041
2012-04-04 20:03:33 +00:00
Enrico Granata f18c03e49e Attempt at fixing a crasher where summary strings where looping endlessly.
llvm-svn: 154028
2012-04-04 17:34:10 +00:00
Enrico Granata 0249fba8c3 Fixing a potential crasher where Python would assume we have no thread state while clearing out an SBDebugger which was acquiring input from the interactive interpreter
llvm-svn: 154027
2012-04-04 17:31:29 +00:00
Enrico Granata 8d4a8010cf Adding a new --python-function (-F) option to breakpoint command add. The option allows the user to specify a Python function name instead of a Python oneliner or interactive script input as a breakpoint command
llvm-svn: 154026
2012-04-04 17:30:31 +00:00
Greg Clayton 3c2c4bb2ce Added a platform agnostic symbolication python module that can be used by any targets. Then modified the darwin "crashlog.py" to use this agnostic info and the new functionality and classes.
llvm-svn: 153969
2012-04-03 21:35:43 +00:00
Bill Wendling d53b5dedb2 Initialize ivars in the correct order.
llvm-svn: 153947
2012-04-03 08:46:13 +00:00
Bill Wendling 9e5bf87516 Possibly too soon for this commit.
llvm-svn: 153946
2012-04-03 08:45:33 +00:00
Bill Wendling 90de801caa Revert accidental checkin.
llvm-svn: 153945
2012-04-03 08:44:00 +00:00
Bill Wendling c08a5e7e8b Possibly too soon for this change.
llvm-svn: 153944
2012-04-03 08:41:55 +00:00
Bill Wendling f0146cb3d3 Use the path to the header file. Use an integer instead of NULL. And get rid of a superfluous 'default' label.
llvm-svn: 153943
2012-04-03 07:51:16 +00:00
Bill Wendling 84ddbc57ee The option is 'NoInlineDefine.'
llvm-svn: 153942
2012-04-03 07:50:37 +00:00
Bill Wendling ed24dcc05f Use integers instead of NULL.
llvm-svn: 153941
2012-04-03 07:50:11 +00:00
Bill Wendling 542f2429f3 Spell 'DW_TAG_APPLE_property' with the correct capitalization.
llvm-svn: 153940
2012-04-03 07:49:34 +00:00
Bill Wendling cac9d9b3f6 Use the correct class/struct keyword so that they match the declarations.
llvm-svn: 153932
2012-04-03 04:15:34 +00:00
Bill Wendling c9851e2630 Initialize ivars in the order they are defined in the class.
llvm-svn: 153931
2012-04-03 04:14:58 +00:00
Bill Wendling 60fd91ff48 Return 0 for the size_t return type.
llvm-svn: 153930
2012-04-03 04:14:31 +00:00
Bill Wendling a0cd2bca6d Use 0 instead of NULL for the integral value.
llvm-svn: 153929
2012-04-03 04:13:41 +00:00
Sean Callanan 38d4df5bcb Fixed ClangASTContext to correctly recognize
wchar_t as distinct from int.

llvm-svn: 153920
2012-04-03 01:10:10 +00:00
Johnny Chen b58337cd45 Add a Test case to make sure that __apple_types section does get produced by dsymutil.
This is supposed to succeed even with rdar://problem/11166975.

llvm-svn: 153919
2012-04-03 01:07:24 +00:00
Johnny Chen 1b8af41116 Add some more debug prints and retrieve the debug subsections from the DWARF section.
llvm-svn: 153915
2012-04-03 00:41:25 +00:00
Enrico Granata 51e318737a One last syntax error fix
llvm-svn: 153911
2012-04-02 23:49:34 +00:00
Enrico Granata a20e863875 Fixing syntax typos in Python formatters
llvm-svn: 153910
2012-04-02 23:43:22 +00:00
Greg Clayton 53eb1c2f03 <rdar://problem/11160171>
Fixed an issue where there were more than one way to get a CompileUnitSP created when using SymbolFileDWARF with SymbolFileDWARFDebugMap. This led to an assertion that would fire under certain conditions. Now there is only one way to create the compile unit and it will "do the right thing".

llvm-svn: 153908
2012-04-02 22:59:12 +00:00
Greg Clayton 675a856e07 Remove unused file as this file is deprecated (use ./crashlog.py instead).
llvm-svn: 153907
2012-04-02 22:57:32 +00:00
Enrico Granata 98bcde4264 Removing some instances of str(SBValue)
llvm-svn: 153899
2012-04-02 21:37:02 +00:00
Greg Clayton 74ae3f5a45 Export the ability to see if a symbol is externally visible and also if the symbol was synthetically added to the symbol table (the symbol was not part of the symbol table itself but came from another section).
llvm-svn: 153893
2012-04-02 20:08:08 +00:00
Johnny Chen d6fbc8ff66 Add testcase that verifies that __apple_types is a valid section in a .o file generated by clang.
rdar://problem/11167268

llvm-svn: 153891
2012-04-02 19:46:14 +00:00
Enrico Granata 247bd419ce Logging for data formatters.
llvm-svn: 153878
2012-04-02 16:39:29 +00:00
Jason Molenda 152694393f Building llvm for multiple arches could cause problems
with some archs, tweak the way we update PATH to fix that.

llvm-svn: 153868
2012-04-02 08:56:42 +00:00
Sean Callanan 139656580f Updating Xcode project version numbers for lldb-137 and debugserver-186
llvm-svn: 153823
2012-04-01 06:36:59 +00:00
Sean Callanan fe630c51ba Updated LLVM to take a comprehensive fix to the
JIT that enables paired relocations in the i386
Mach-O JIT.  This eliminates crashes in the
testsuite when running under i386.

llvm-svn: 153822
2012-04-01 06:35:00 +00:00
Enrico Granata 79c1baf6dd Making sure the count on synthetic providers is always setup - This should prevent errors about count being undefined from showing up
llvm-svn: 153791
2012-03-31 00:15:24 +00:00
Greg Clayton 1517dd33d9 Patch from Viktor Kutuzov: delete the temporary process we created when "process connect" fails.
llvm-svn: 153790
2012-03-31 00:10:30 +00:00
Greg Clayton baf95daa99 Added the ability to log when things get completed in DWARF. This can be enabled using:
(lldb) log enable --verbose lldb completion

This will print out backtraces for all type completion calls which will help us verify that we don't ever complete a type when we don't need to.

llvm-svn: 153787
2012-03-30 23:50:54 +00:00
Greg Clayton 2053398f63 Remove unused code.
llvm-svn: 153786
2012-03-30 23:48:28 +00:00
Greg Clayton aec366f75b Don't log to a temp file and delete it, just use the API that gives us a malloc'ed string array.
llvm-svn: 153785
2012-03-30 23:47:35 +00:00
Greg Clayton c15f55e267 <rdar://problem/11148044>
Fixed a potential crasher that could happen after Debugger::Terminate() was called.

llvm-svn: 153774
2012-03-30 20:53:46 +00:00
Greg Clayton ab950c34d0 Patch from Viktor Kutuzov: fixes a segmentation fault crash in lldb in the ProcessPOSIX class when the object gets destroyed. I can reproduce this problem on the FreeBSD platform and it should be reproducable for the other platforms also.
llvm-svn: 153769
2012-03-30 19:56:32 +00:00
Enrico Granata 7f3296a6e1 Disabling blocks support because of rdar://problem/11024417 - This is hopefully just a temporary countermeasure
llvm-svn: 153758
2012-03-30 16:58:37 +00:00
Enrico Granata 22fe3171ee Added some logging to STL synthetic children providers - this should help us catch problems; more logging might/will be added as needed
llvm-svn: 153750
2012-03-30 16:07:08 +00:00
Sean Callanan 356e17ce69 Be more careful when overriding the type for a
ValueObject, and make sure that ValueObjects that
have null type names (because they have null types)
also have null qualified type names.  This avoids
some potential crashes if 
ValueObject::GetQualifiedTypeName tries to get the
name of their type by calling GetClangTypeImpl().

llvm-svn: 153718
2012-03-30 02:04:38 +00:00
Greg Clayton 219cf31f7d <rdar://problem/11082392>
Fixed an issue that could cause circular type parsing that will assert and kill LLDB.

Prior to this fix the DWARF parser would always create class types and not start their definitions (for both C++ and ObjC classes) until we were asked to complete the class later. When we had cases like:

class A
{
    class B
    {
    };
};

We would alway try to complete A before specifying "A" as the decl context for B. Turns out we can just start the definition and still not complete the class since we can check the TagDecl::isCompleteDefinition() function. This only works for C++ types. This means we will not be pulling in the full definition of parent classes all the time and should help with our memory consumption and also reduce the amount of debug info we have to parse.

I also reduced redundant code that was checking in a lldb::clang_type_t was a possible C++ dynamic type since it was still completing the type, just to see if it was dynamic. This was fixed in another function that was checking for a type being dynamic as an ObjC or a C++ type, but there was dedicated fucntion for C++ that we missed.

llvm-svn: 153713
2012-03-30 00:51:13 +00:00
Enrico Granata a7daeebbff Fixing a whole class of crashers and potential crashers related to data formatters eating up all the stack when an unknown class has to be summarized ; this should make the whole Objective-C summaries more stable
llvm-svn: 153712
2012-03-30 00:51:12 +00:00
Greg Clayton 843d62d14d Added a "add-dsym" alias to "target symbols add" to keep gdb converts happy.
llvm-svn: 153695
2012-03-29 21:47:51 +00:00
Greg Clayton 12b834d626 <rdar://problem/10103468>
Symbol files (dSYM files on darwin) can now be specified during program execution:

(lldb) target symbols add /path/to/symfile/a.out.dSYM/Contents/Resources/DWARF/a.out

This command can be used when you have a debug session in progress and want to add symbols to get better debug info fidelity.

llvm-svn: 153693
2012-03-29 21:43:25 +00:00
Greg Clayton 322654a7f7 <rdar://problem/11149427>
Line tables when using DWARF in .o files can be wrong when two entries get moved around by the compiler. This was due to incorrect logic in the line entry comparison operator.

llvm-svn: 153685
2012-03-29 20:50:37 +00:00
Johnny Chen 55d85f3bab Add log entries for HijackBroadcaster() as well as RestoreBroadcaster().
llvm-svn: 153683
2012-03-29 20:02:33 +00:00
Enrico Granata d50f18b1a0 Part 1 of a series of fixes meant to improve reliability and increase ease of bug fixing for data formatter issues.
We are introducing a new Logger class on the Python side. This has the same purpose, but is unrelated, to the C++ logging facility
The Pythonic logging can be enabled by using the following scripting commands:
(lldb) script Logger._lldb_formatters_debug_level = {0,1,2,...}
0 = no logging
1 = do log
2 = flush after logging each line - slower but safer
3 or more = each time a Logger is constructed, log the function that has created it
more log levels may be added, each one being more log-active than the previous
by default, the log output will come out on your screen, to direct it to a file:
(lldb) script Logger._lldb_formatters_debug_filename = 'filename'
that will make the output go to the file - set to None to disable the file output and get screen logging back
Logging has been enabled for the C++ STL formatters and for Cocoa class NSData - more logging will follow


synthetic children providers for classes list and map (both libstdcpp and libcxx) now have internal capping for safety reasons
this will fix crashers where a malformed list or map would not ever meet our termination conditions

to set the cap to a different value:

(lldb) script {gnu_libstdcpp|libcxx}.{map|list}_capping_size = new_cap (by default, it is 255)

you can optionally disable the loop detection algorithm for lists

(lldb) script {gnu_libstdcpp|libcxx}.list_uses_loop_detector = False

llvm-svn: 153676
2012-03-29 19:29:45 +00:00
Sean Callanan 751aac610a Added support for the DW_AT_APPLE_Property tag
for unbacked properties.  We support two variants:
one in which the getter/setter are provided by
selector ("mySetter:") and one in which the
getter/setter are provided by signature 
("-[MyClass mySetter:]").

llvm-svn: 153675
2012-03-29 19:07:06 +00:00
Greg Clayton 45cffd4943 Missed a file in the last FreeBSD patch.
llvm-svn: 153662
2012-03-29 17:46:49 +00:00
Greg Clayton 59b4fa1813 FreeBSD patch that enabled the lldb-platform to be built from Viktor Kutuzov.
llvm-svn: 153661
2012-03-29 17:46:11 +00:00
Sean Callanan e41438ca8b Updating Xcode project version numbers for lldb-136 and debugserver-185
llvm-svn: 153630
2012-03-29 02:40:34 +00:00
Greg Clayton 2687cd116a <rdar://problem/11052174>
<rdar://problem/11051056>

Found a race condition when sending async packets in the ProcessGDBRemote.

A little background: GDB remote clients can only send one packet at a time. You must send a packet and wait for a response. So when we continue, we obviously can't hold up the calling thread waiting for the process to stop again, so we have an async thread in the ProcessGDBRemote whose only job is to run packets that control the inferior process. When you send a continue packet, the only packet you can send is an interrupt packet (which consists of sending a CTRL+C (or a '\x03' byte)). This then stops the inferior and we can send the async packet, and then resume the target. There was a race condition that often happened during stepping where we are doing a source level single step which consists of many instruction steps and a few runs here and there when we step into a function. So the flow looks like:

inst single step
inst single step
inst single step
inst single step
inst single step
step BP and run
inst single step
inst single step
inst single step

Now if we got an async packet while the program is running we get something like:

send --> continue
send --> interrupt
recv <-- interrupt stop reply packet
send --> async packet
recv <-- async response
send --> continue again and wait for actual stop

Problems arise when this was happening when single stepping a thread where we would get:

send --> step thread 123
send --> interrupt
send --> stop reply for thread 123 (from the step)

Now we _might_ have an extra stop reply packet from the "interrupt" which we weren't checking for and we could end up with:

send --> async packet (like memory read!)
recv <-- async response (which is the interrupt stop reply packet)

Now we have the read memroy reply sitting in our buffer and waiting to be used as the reply for the next packet... 

To further complicate things, the single step should have exited the async thread since the run control is finished, but now it will continue if it was interrupted.

The fixes I checked in to two major things:
- watch for the extra stop reply if we need to
- make sure we exit from the async thread run loop when the previous run control (like the instruction level single step) is finished.

Needless to say this makes very fast stepping in Xcode much more reliable.

llvm-svn: 153629
2012-03-29 01:55:41 +00:00
Greg Clayton 39d0ab3243 <rdar://problem/11035349>
Fixed an issue with stepping where the stack frame list could get changed out from underneath you when multiple threads start accessing frame info.

llvm-svn: 153627
2012-03-29 01:41:38 +00:00
Greg Clayton 6ca75a00dc When running this from the command line, don't pass the python script file itself to be disassembled.
llvm-svn: 153626
2012-03-29 01:40:28 +00:00
Greg Clayton d761d42707 Removed unused variable.
llvm-svn: 153625
2012-03-29 01:39:57 +00:00
Enrico Granata 86ea8d821a Fixing an issue where Unicode characters in an NSString were printed as escape sequences by the summary provider shipping with LLDB - Added relevant test case code. Bonus points for identifying the source of the quotes :-)
llvm-svn: 153624
2012-03-29 01:34:34 +00:00
Enrico Granata 770eb05aa5 Fixing an issue where saying 'po foo' made both the summary and the description for foo come out. If one is po'ing something they most probably only care about the description - We will not omit the summary
llvm-svn: 153608
2012-03-28 22:17:37 +00:00
Greg Clayton 726bc52a2e Converted commented out printf statements for dynamic type logging to use the log for "log enabe lldb types".
llvm-svn: 153583
2012-03-28 17:13:26 +00:00
Greg Clayton 31950a530d Fixed some space formatting.
llvm-svn: 153582
2012-03-28 17:12:37 +00:00
Sean Callanan 2f22999bab Updated LLVM and LLDB to fix compilation errors
with recent Clang.  Clang is now stricter about
presence of complete types and about use of the
"template" keyword in C++ for template-dependent
types.

llvm-svn: 153563
2012-03-28 02:25:40 +00:00
Enrico Granata f981060503 Adding missing file
llvm-svn: 153559
2012-03-28 02:16:50 +00:00