Commit Graph

5772 Commits

Author SHA1 Message Date
Enrico Granata 7389f8454f Ensuring that the swig typemaps for SBData set the size to 0 along with the pointer to NULL
There should be no functional changes as SBData creation functions already checked for NULL regardless of size - but it ensures consistency

llvm-svn: 166978
2012-10-29 23:06:44 +00:00
Enrico Granata b588726ec9 <rdar://problem/11449953> Change Debugger::SetOutputFileHandle() so that it does not automatically initialize the script interpreter in order to transfer its output file handle to it
This should delay initialization of Python until strictly necessary and speed-up debugger startup
Also, convert formatters for SEL and BOOL ObjC data-types from Python to C++, in order to reap more performance benefits from the above changes

llvm-svn: 166967
2012-10-29 21:18:03 +00:00
Greg Clayton 35a4cc5ea7 <rdar://problem/12500785>
I tracked down a leak that could happen when detaching from a process where the lldb_private::Process objects would stay around forever. This was caused by a eStateDetached event that was queued up on the lldb_private::Process private state thread listener. Since process events contain shared pointers to the process, this is dangerous if they don't get consume or cleared as having the lldb_private::Process class contain a collection of things that have a shared pointer to yourself is obviously bad. 

To fix this I modified the Process::Finalize() function to clear this list. The actual thing that was holding onto the ModuleSP and thus the static archive, was a stack frame. Since the process wasn't going away, it still had thread objects and they still had frames. I modified the Thread::Destroy() to clear the stack frames to ensure this further doesn't happen.

llvm-svn: 166964
2012-10-29 20:52:08 +00:00
Jim Ingham 629e7a9846 Fix an incorrect comment...
llvm-svn: 166959
2012-10-29 19:24:56 +00:00
Greg Clayton 6a3efacc0f Improve the broadcast event dumping.
llvm-svn: 166950
2012-10-29 18:08:18 +00:00
Jim Ingham 3793976376 This is the first phase of supporting the DW_AT_object_pointer tag. I expanded the decl metadata
so it could hold this information, and then used it to look up unfound names in the object pointer
if it exists.  This gets "frame var" to work for unqualified references to ivars captured in blocks.
But the expression parser is ignoring this information still.

llvm-svn: 166860
2012-10-27 02:54:13 +00:00
Jim Ingham 4dc613b364 If we got what looks like a single step exception but we weren't single stepping then just report
the raw exception.

llvm-svn: 166859
2012-10-27 02:52:04 +00:00
Enrico Granata 21fd13f9b7 Moving ValueObjectCast over to its own .h/.cpp files instead of sharing ValueObjectDynamic.h/.cpp
Removing the IsDynamic() and GetStaticValue() calls, so that they will default to the base class behavior:
 - non-dynamic
 - itself as the static value
This is in contrast with the previous behavior which could be confusing and could potentially cause issues when using those objects

llvm-svn: 166857
2012-10-27 02:05:48 +00:00
Sean Callanan cd6ce2ff31 Fixes to the Objective-C V2 runtime:
- Only read the statically-defined isa table in the
  shared cache once.  Only the dynamically-constructed
  isa table can change.

- Ignore the statically-defined isa table if its
  version isn't what we expect.

llvm-svn: 166856
2012-10-27 01:51:44 +00:00
Jason Molenda aba75e6495 Show both lldb-168 and earlier "bt -c 5" as well as lldb-169 and later "bt 5" usage.
llvm-svn: 166839
2012-10-26 23:56:03 +00:00
Jason Molenda ca76ecda8a Document "bt <n>" for "thread backtrace -c <n>", note that it is available
in lldb-169 and later.

llvm-svn: 166838
2012-10-26 23:52:49 +00:00
Andrew Kaylor 9ed6ae5ee0 This patch updates comments in the Predicate class to describe a subtle behavior that callers may need to be aware. It also adds documentation for one function which didn’t have any.
The subtle behavior is that the Predicate wait functions may not detect transitory changes in the predicate value.  Consider the following scenario.

Thread A waits for a bit to be set in the predicate value.
Thread B sets the bit in the predicate value.
Before Thread A wakes up, Thread C clears the bit in the predicate value.
Thread A wakes, checks the value and goes back to waiting.

The mutex and condition variables protect access to the value, but they offer no guarantee that another thread will not acquire the mutex and change the value before a waiting thread is restarted after a change.

I believe that the current behavior is correct and reasonable.  I just want to leave a marker to prevent possible problems in the future or to help anyone who might be unfortunate enough to encounter such a problem.

llvm-svn: 166800
2012-10-26 19:28:36 +00:00
Jim Ingham d7b30ef93c Add API to get the process plugin name & short name.
llvm-svn: 166799
2012-10-26 19:18:04 +00:00
Greg Clayton 13b1213de3 Updated the "breakpoint command add" documentation and fixed the web site docs for the signature of the python breakpoint callback functions.
llvm-svn: 166789
2012-10-26 17:53:21 +00:00
Jason Molenda 60f0bd4944 Add a new capability to RegisterContextLLDB: To recognize when the
Full UnwindPlan is trying to do an impossible unwind; in that case
invalidate the Full UnwindPlan and replace it with the architecture
default unwind plan.

This is a scenario that happens occasionally with arm unwinds in
particular; the instruction analysis based full unwindplan can
mis-parse the functions and the stack walk stops prematurely.  Now
we can do a simpleminded frame-chain walk to find the caller frame
and continue the unwind.  It's not ideal but given the complicated
nature of analyzing the arm functions, and the lack of eh_frame
information on iOS, it is a distinct improvement and fixes some
long-standing problems with the unwinder on that platform.  

This is fixing <rdar://problem/12091421>.  I may re-use this
invalidate feature in the future if I can identify other cases where
the full unwindplan's unwind information is clearly incorrect.

This checkin also includes some cleanup for the volatile register
definition in the arm ABI plugin for <rdar://problem/10652166> 
although work remains to be done for that bug.

llvm-svn: 166757
2012-10-26 06:08:58 +00:00
Jason Molenda a3843dd2a5 Document target.source-map as the replacement for gdb's directory command.
llvm-svn: 166753
2012-10-26 04:38:09 +00:00
Filipe Cabecinhas be45ce66d4 Add a teardown function to TestAbbreviations so it doesn't error out when running for two archs.
llvm-svn: 166740
2012-10-25 23:52:28 +00:00
Greg Clayton 82d792958b <rdar://problem/12570550>
TOT lldb broke finding App in app bundles when launching with shell.

llvm-svn: 166733
2012-10-25 22:45:35 +00:00
Jim Ingham 4a58e96846 Found a couple more places where we need to run all threads when stepping.
llvm-svn: 166732
2012-10-25 22:30:09 +00:00
Jim Ingham 5c48d5c536 Add text to the help to explain how to set user defined variables.
llvm-svn: 166704
2012-10-25 18:11:24 +00:00
Greg Clayton ead45e0174 Allow operating system plug-ins to specify the address for registers so we don't have to create data up front.
llvm-svn: 166701
2012-10-25 17:56:31 +00:00
Jim Ingham 06933e2af0 Add section on creating convenience variables.
llvm-svn: 166697
2012-10-25 17:35:53 +00:00
Greg Clayton 89870cebcb Changed the V1 and V2 runtimes to be able to detect when the ISA hash table has changed, and auto update as needed.
llvm-svn: 166693
2012-10-25 16:54:22 +00:00
Sean Callanan ec8f1ef9db Updated LLDB's use of the DiagnosticsEngine to
reflect a change to the initializer.

llvm-svn: 166657
2012-10-25 01:00:25 +00:00
Jason Molenda 840f12cf6b Identify a kdp session that is connecting to an EFI monitor,
use a DynamicLoaderStatic dynamic loader for the session
instead of a kernel or user dynamic loader.

llvm-svn: 166652
2012-10-25 00:25:13 +00:00
Sean Callanan ee1450aece Added --framework and --executable arguments
to dotest.py so that the testsuite can run against
any LLDB.

<rdar://problem/12512268>

llvm-svn: 166635
2012-10-24 22:45:39 +00:00
Enrico Granata 2928d37096 Fixing the test case for rdar://12481949 to do the right thing with our new rules for sign-extension in GetValueAsUnsigned()
llvm-svn: 166631
2012-10-24 22:15:04 +00:00
Enrico Granata df26a90dc2 And one more logging message goes away
llvm-svn: 166628
2012-10-24 21:54:04 +00:00
Enrico Granata 1918627d93 Reverting unwanted changes to the test suite
llvm-svn: 166627
2012-10-24 21:44:48 +00:00
Enrico Granata 5020f958d8 Reverting the changes to Scalar since this class needs to follow C rules for type promotion
llvm-svn: 166626
2012-10-24 21:42:49 +00:00
Enrico Granata 48ea80f9ff Reimplementing SBValue/ValueObject.GetValueAsUnsigned() in terms of appropriate calls in Scalar - Making sure Scalar does the right thing when casting signed values to unsigned ones.
llvm-svn: 166618
2012-10-24 20:24:39 +00:00
Enrico Granata 7b3d205ee3 Changing the NSDate data formatter to use GetData().uint64[] instead of relying on SBValue.GetValueAsUnsigned() to reinterpret a double as a uint64_t
llvm-svn: 166610
2012-10-24 19:05:32 +00:00
Greg Clayton 1c22be6999 Added process and thread logging the python OperatingSystem plug-in.
llvm-svn: 166608
2012-10-24 18:39:14 +00:00
Greg Clayton 5db6b79955 Patch from Ashok Thirumurthi that enabled FPU registers for POSIX x86_64.
llvm-svn: 166604
2012-10-24 18:24:14 +00:00
Enrico Granata 7e137e3d8f <rdar://problem/12481949> Fixing SBValue.GetValueAsSigned() to do the right thing when dealing with a 32-bit negative value
llvm-svn: 166603
2012-10-24 18:14:21 +00:00
Greg Clayton fb9c6b760b Cleanup some variable names to indicate auto pointers and also manager the llvm::Module memory more correctly.
llvm-svn: 166598
2012-10-24 17:37:53 +00:00
Jason Molenda 67c3cf5357 eArgTypePath was removed in r166533; change -c to
expect eArgTypeFilename.

llvm-svn: 166542
2012-10-24 03:29:40 +00:00
Enrico Granata 44818163ed <rdar://problem/12523238> Commit 3 of 3
Changed all relevant test cases to verify that MightHaveChildren() works correctly for objects of interest
Added a bunch of convenience methods for test cases to use: target(), process(), thread() and frame() which mimic the lldb.X convenience variables
As a bonus, edited the documentation on the website to describe the new method available for synthetic children providers writers to implement!

That's all folks!

llvm-svn: 166535
2012-10-24 01:23:57 +00:00
Sean Callanan 3154255fd6 This is a fix for the command option parser.
There was a generic catch-all type for path arguments
called "eArgTypePath," and a specialized version
called "eArgTypeFilename."  It turns out all the
cases where we used eArgTypePath we could have
used Filename or we explicitly meant a directory.

I changed Path to DirectoryName, made it use the
directory completer, and rationalized the uses of
Path.

<rdar://problem/12559915>

llvm-svn: 166533
2012-10-24 01:12:14 +00:00
Enrico Granata 6c61cbbc49 Better error message for invalid argument to --category - silenced the printout of the raw args when not in verbose mode
llvm-svn: 166514
2012-10-23 22:52:49 +00:00
Greg Clayton d64dd12fcf Objective C cleanup. Removed an cache that was no longer needed and changes the code that gets the dynamic type and class name to use our new Objective C cache.
llvm-svn: 166512
2012-10-23 22:41:19 +00:00
Sean Callanan 7fcf0c131b Added a testcase for runtime types in Objective-C.
llvm-svn: 166507
2012-10-23 22:14:39 +00:00
Enrico Granata 91fe01753d <rdar://problem/12523238> Commit 2 of 3
Adding the new has_children (or MightHaveChildren() in C++) for the existing synthetic children providers
In a few cases, the new call is going to be much more efficient than the previous num_children > 0 check
When the optimization was marginal (e.g. std::vector<>), the choice was to use num_children in order to keep
implementation details in one function instead of duplicating code

Next step is to provide test cases

llvm-svn: 166506
2012-10-23 21:54:53 +00:00
Jim Ingham ce0740d8cf Turns out there are 8 bits in a byte.
llvm-svn: 166502
2012-10-23 21:09:09 +00:00
Enrico Granata adaf282c76 <rdar://problem/12523238> Commit 1 of 3
This commit enables the new HasChildren() feature for synthetic children providers
Namely, it hooks up the required bits and pieces so that individual synthetic children providers can implement a new (optional) has_children call
Default implementations have been provided where necessary so that any existing providers continue to work and behave correctly

Next steps are:
2) writing smart implementations of has_children for our providers whenever possible
3) make a test case

llvm-svn: 166495
2012-10-23 19:54:09 +00:00
Jim Ingham a7dfb665e3 Watchpoints remember the type of the expression or variable they were set with, and use
it to print the old and new values.
Temporarily disable the "out of scope" checking since it didn't work correctly, and was
not what people generally expected watchpoints to be doing.  

llvm-svn: 166472
2012-10-23 07:20:06 +00:00
Jason Molenda 7cd5e831e5 Change how the UnwindAssemblyInstEmulation class tracks the setup of
the function's prologue instructions so we can re-instate that prologue
if we hit an early return mid-function.  Add some additional heuristics
to differentiate between prologue and epilogue instruction sequences.

This fixes the specific problem of correctly unwinding through a function
which has an epilogue one instruction after the last prologue setup
instruction has completed.
<rdar://problem/12091139> 

llvm-svn: 166465
2012-10-23 03:08:31 +00:00
Jason Molenda a7dcb33716 Clean up help/usage messages for kdp-remote / gdb-remote a little bit.
llvm-svn: 166464
2012-10-23 03:05:16 +00:00
Enrico Granata db8142b8e8 Fixing a compiler warning about has_children being used before being initialized
llvm-svn: 166462
2012-10-23 02:07:54 +00:00
Greg Clayton 4a792072ce <rdar://problem/12493007>
Added a new API call to help efficiently determine if a SBValue could have children:

     bool
     SBValue::MightHaveChildren ();
     
This is inteneded to be used bui GUI programs that need to show if a SBValue needs a disclosure triangle when displaying a hierarchical type in a tree view without having to complete the type (by calling SBValue::GetNumChildren()) as completing the type is expensive.

llvm-svn: 166460
2012-10-23 01:50:10 +00:00