Not all processes have a Dynamic Loader.  Be sure to check that it exists before using it.

<rdar://problem/18491391>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@218699 91177308-0d34-0410-b5e6-96231b3b80d8
Fix the kalimba arch 4 test, broken when I introduced handling
of kalimba architecture variants.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@218749 91177308-0d34-0410-b5e6-96231b3b80d8
Adding a test for k5 binaries


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@218754 91177308-0d34-0410-b5e6-96231b3b80d8
Add a bandaid to fix the FreeBSD build

r218568 added an explicit #include of the Linux ProcessMonitor.h to
POSIXThread.cpp, rather than including just "ProcessMonitor.h" and
relying on the build infrastructure for the appropriate paths.

For now add #ifdefs in the source to use the FreeBSD or Linux header
as appropriate; a cleaner fix (and perhaps some refactoring of the
POSIX classes) should still be done later.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@218762 91177308-0d34-0410-b5e6-96231b3b80d8
Minor tweak to Ed's FreeBSD fix.

Fall back to including the Linux version if not on __FreeBSD__.  Also covers
__ANDROID__ case.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@218770 91177308-0d34-0410-b5e6-96231b3b80d8
thread state coordinator: replaced shortened type name Func suffix with Function.

ThreadIDFunc => ThreadIDFunction
LogFunc      => LogIDFunction

We try to avoid abbreviations/shortened names.  Adjusted function parameter names
as well to replace _func with _function.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@218773 91177308-0d34-0410-b5e6-96231b3b80d8
Add a new SBExecutionContext class that wraps an ExecutionContextRef. This class is a convenient way at the API level to package a target,process,thread and frame all together - or just a subset of those

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@218808 91177308-0d34-0410-b5e6-96231b3b80d8
Add an accessor to PyCallable that allows one to determine the count of arguments that a Python function allows, and whether varargs/kwargs are also accepted by the same function

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@218812 91177308-0d34-0410-b5e6-96231b3b80d8
[cmake] Include the new file in the CMake lists. Without this every
CMake build of any part of LLVM with LLDB checked out fails immediately.
=[

We appear to not even have a build bot covering the CMake build of LLDB
which makes this truly terrible. That needs to be fixed immediately.

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@218831 91177308-0d34-0410-b5e6-96231b3b80d8
thread state coordinator: added error callbacks, cleaned up tests.

ThreadStateCoordinator changes:
* Most commands that run in the queue now take an error handler that
  will be called with an error string if an error occurs during processing.
  Errors generally stop the operation in progress.  The errors are checked
  at time of execution.  This is intended to help flush out ptrace/waitpid/state management
  issues as quickly as possible.

* Threads now must be known to the coordinator before stops can be reported,
  resumes can be requested, thread deaths can be reported, or deferred stop
  notifications can be made.  Failure to know the thread will cause the coordinator
  to call the error callback for the event being processed.  Threads are introduced
  to the system by the NotifyThreadCreate method.
  
* The NotifyThreadCreate method now takes the initial state of the thread being
  introduces to the system.  We no longer just assume the thread is running.
  
The test cases were cleaned up, too:
* A gtest test fixture is now used, which allows creating less verbose helper
  methods that setup common pieces of callback code for some method invocations.
  Net result: the tests are simpler to read and shorter to write.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@218833 91177308-0d34-0410-b5e6-96231b3b80d8
Allow Python commands to optionally take an SBExecutionContext argument in case they need to handle 'where they want to act' separately from the notion of 'currently-selected entity' that is associated to the debugger. Do this in an (hopefully) non-breaking way by running an argcount check before passing in the new argument. Update the test case to also check for this new feature. www update to follow

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@218834 91177308-0d34-0410-b5e6-96231b3b80d8
Add documentation about the new SBExecutionContext for Python commands feature. This marks the end of rdar://18142728

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@218835 91177308-0d34-0410-b5e6-96231b3b80d8
Add SBExecutionContext.cpp to this file as well, as the comment
in source/API/CMakeLists.txt instructs...


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@218837 91177308-0d34-0410-b5e6-96231b3b80d8
Remove unused variable.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@218844 91177308-0d34-0410-b5e6-96231b3b80d8
Add a mutex lock to StackFrame to protect race conditions for
updating its ivars.  We've had a lot of crash reports and careful
analysis shows that we've got multiple threads operating on the
same StackFrame objects, changing their m_sc and m_flags ivars.
<rdar://problem/18406111> 


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@218845 91177308-0d34-0410-b5e6-96231b3b80d8
Add SBExecutionContext.h to the list of headers to copy into the LLDB framework.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@218850 91177308-0d34-0410-b5e6-96231b3b80d8
Add a couple of extra exepct strings so this test file keeps in sync with lldb
a little better.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@218851 91177308-0d34-0410-b5e6-96231b3b80d8
Update to match strings output by lldb.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@218853 91177308-0d34-0410-b5e6-96231b3b80d8
gtest runner: now always does a clean step after running.

* Checks for any 'clean' arg, setting clean-only mode.
* If clean-only mode, skip the make.
* Adds the equivalent of os.devnull in a way that supports the file-like 'write' operation.
* Uses a null sysout/syserr for the clean step so we don't see noise from cleaning.
* Now always runs the clean step after a real test run so we don't have cruft left over after a test run.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@218871 91177308-0d34-0410-b5e6-96231b3b80d8
thread state coordinator: requesting resume now signals error appropriately.

Added tests to verify that the coordinator signals an error if
the given thread to resume is unknown, and if the thread is through to
be running already.

Modified resume handling code to match tests.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@218872 91177308-0d34-0410-b5e6-96231b3b80d8