lldb.LLDB_ARCH_DEFAULT now works correctly on Macs with haswell enabled kernels.

<rdar://problem/17604133>



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@213004 91177308-0d34-0410-b5e6-96231b3b80d8
If Process::Finalize() has been called, don't track process state changes.

<rdar://problem/17540766>



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@213007 91177308-0d34-0410-b5e6-96231b3b80d8
Any commands that are executed through the public interface using SBCommandInterpreter::HandleCommand() are assumed to be in non-interactive mode.

Any commands that want interactivity (stdin) will need to be executed through the normal command interpreter using the debugger's in/out/err file handles, or by using "command source".

Individual commands through the API will have their STDIN disabled. The STDOUT and STDERR will be redirected into the SBCommandReturnObject argument to SBCommandInterpreter::HandleCommand() as usual.

This helps with a deadlock situation in an IDE (Xcode) where the IDE was managing the breakpoint actions by setting a breakpoint callback and doing things manually.

<rdar://problem/17386271>


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

LinuxThread.cpp
LinuxThread.h
NativeRegisterContext.h
ProcessLinux.cpp
ProcessLinux.h
ProcessMonitor.cpp
ProcessMonitor.h

Were inserted in the CopyFiles phase of the "desktop" aggregate target.  That caused them to get
copied to /usr/shared/man/man1 on install, which isn't right.  Not sure why they were there...
I removed them.  If this was supposed to achieve some other purpose, we should discuss how to do
that correctly on the mailing list.

<rdar://problem/17642262>



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



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@213106 91177308-0d34-0410-b5e6-96231b3b80d8
TestObjCMethods.FoundationTestCase was failing due to an error, fixed now.

<rdar://problem/16322133>
llvm.org/pr20267



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@213111 91177308-0d34-0410-b5e6-96231b3b80d8
Fixed the an objective C test case so it passes correctly.

Fixed the test case to use a runtime function prototype that will be correct ([NSString stringWithCString: "new"]) instead of one that won't (expression str = [NSString stringWithFormat: @"%cew", 'N']). The runtime doesn't track vararg functions correctly so we can't reconstitute the function correctly.

Also fixed some expressions that used "str_id" whose type was "id" and do the necessary casting since "id" doesn't have any methods.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@213113 91177308-0d34-0410-b5e6-96231b3b80d8
Add kalimba as a platform.

This change comprises of additions and some minor changes in order that
"kalimba" is listed as a supported platform and that debugging any
kalimbas results in PlatformKalimba being associated with the target.

The changes are as follows:

* The PlatformKalimba implementation itself
* A tweak to ArchSpec
* .note parsing for Kalimba in ObjectFileELF.cpp
* Plugin registration
* Makefile additions

Change by Matthew Gardiner

Minor tweak for cmake and Xcode by Todd Fiala

Tested:
Ubuntu 14.04 x86_64, clang 3.5-built lldb, all tests pass.
MacOSX 10.9.4, Xcode 6.0 Beta 1-built lldb, all tests pass.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@213158 91177308-0d34-0410-b5e6-96231b3b80d8
gdb-remote test noise suppression on MacOSX.

This change adds a member to the base test case for gdb-remote that
indicates whether a stub makes two X stop notification reports on kill
commands.  This is set to true for debugserver tests.

The test for killing an attached process after it's first stop notification
has been modified to look at that flag and add an extra X packet matcher
so the "unmatched packet warning" doesn't get emitted for the second X on
MacOSX with debugserver.

I also broke those tests out of the monolithic TestLldbGdbServer mega test
case and put it in its own, new TestGdbRemoteKill.py file and test case.

Tested:
Ubuntu 14.04 x86_64, clang-3.5 built lldb, no test failures.
MacOSX 10.9.4, Xcode 6.0 Beta 3 built lldb, no test failures.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@213166 91177308-0d34-0410-b5e6-96231b3b80d8
Fix build broken as a result of r213171.

r213171 renames the 'clangRewriteCore' library to 'clangRewrite'.
This change simply updates the makefiles to reference the correct
library name.

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@213181 91177308-0d34-0410-b5e6-96231b3b80d8
Add Host::MAX_THREAD_NAME_LENGTH constant.

This value gets set to a max uint32_t value when there is no known limit; otherwise,
it is set to a value appropriate for the platform.  For the moment, only
Linux, FreeBSD and NetBSD set it to 16.  All other platforms set it to
the max uint32_t value.

Modifies the Process private state thread names to fit within a 16-character limit
when the max thread name length is <= 16.  These guarantee that the thread names
can be distinguished within the first 16 characters.  Prior to this change, those
threads had names in the final dotted name segment that were not distinguishable
within the first 16 characters.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@213183 91177308-0d34-0410-b5e6-96231b3b80d8
Fix some warnings in the Windows build.

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@213194 91177308-0d34-0410-b5e6-96231b3b80d8
^C wasn't interrupting an expression during a long evaluation or deadlock.

The problem was that we have an IOHandler thread that services the IOHandler stack. The command interepter is on the top of the stack and it receives a "expression ..." command, and it calls the IOHandlerIsComplete() callback in the command interpereter delegate which runs an expression. This causes the IOHandlerProcessSTDIO to be pushed, but since we are running the code from the IOHandler thread, it won't get run. When CTRL+C is pressed, we do deliver the interrupt to the IOHandlerProcessSTDIO::Interrupt() function, but it was always writing 'i' to the interrupt pipe, even if we weren't actively reading from the debugger input and the pipes. This fix works around the issue by directly issuing the async interrupt to the process if the process is running.

A longer term more correct fix would to be run the IOHandler thread and have it just do the determination of the input and when complete input is received, run the code that handles that input on another thread and syncronize with that other thread to detect when more input is desired. That change is too big to make right now, so this fix will tide us over until we can get there.

<rdar://problem/16556228>




git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@213196 91177308-0d34-0410-b5e6-96231b3b80d8
Modify the EFI KDP debugging to not use any dynamic loader since it does manual dynamic loading itself via python modules.

Also track down the required binary by trying to locate the main executable module through LLDB's symbol and executable file locating code.

<rdar://problem/16570258>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@213199 91177308-0d34-0410-b5e6-96231b3b80d8
Two fixes in the Objective-C language runtime:

- First, when logging, be helpful by printing
  the real name of the class;

- Second, up the limit for number of classes
  from 16k to 128k, and put in an assertion
  (and better error handling when not in a
  debug configuration) when we cross that
  limit the next time.

<rdar://problem/17052976>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@213218 91177308-0d34-0410-b5e6-96231b3b80d8
Fixed our install-headers script to set version
numbers correctly.

<rdar://problem/17708687>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@213284 91177308-0d34-0410-b5e6-96231b3b80d8
In Process::LoadImage, if dlopen returns 0x0 fetch the error with dlerror and report 
that in the returned Error.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@213294 91177308-0d34-0410-b5e6-96231b3b80d8
Create an _d suffixed symlink when doing a debug Windows build.

_lldb is built as an extension module on Windows.  Normally to load
an extension module named 'foo', Python would look for the file
'foo.pyd'.  However, when a debug interpreter is used, Python will
look for the file 'foo_d.pyd'.  This change checks the build
configuration and creates the correct symlink name based on the
build configuration.

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@213306 91177308-0d34-0410-b5e6-96231b3b80d8
ReadPointedString takes a Stream not a DataBuffer.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@213314 91177308-0d34-0410-b5e6-96231b3b80d8
Fixed the objective C symbol parsing in ObjectFileMachO.

This fixes all of the hidden ivar test cases and any case where we try to find the full definition of an objective C class.

This also means hidden ivars show up again.

<rdar://problem/15458957>
llvm.org/pr20270
llvm.org/pr20269
llvm.org/pr20272



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