Don't use "lldb." global variables in LLDB commands.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@212852 91177308-0d34-0410-b5e6-96231b3b80d8
Don't crash when a SBType is handed out through the API and later used after the module that owns the type is deleted.

The fix adds a std::weak_ptr<Module> into the TypeImpl and fills in the weak pointer when possible. It also checks to make sure the module is still alive prior to using it which should make our API safer to use.

<rdar://problem/15455145> 



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@212853 91177308-0d34-0410-b5e6-96231b3b80d8
Added llgs --named-pipe support and program_name-version_number printout support.

Added a unit test to test debugserver and llgs compliance on --named-pipe support.

Modified llgs to implement --named-pipe support.  (Note: need to revisit with
new generic pipe support).


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@212854 91177308-0d34-0410-b5e6-96231b3b80d8
Remove assert now that we have a 'i' character that might come through as well as the 'q' character on the interrupt pipe.

<rdar://problem/15840749>



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@212856 91177308-0d34-0410-b5e6-96231b3b80d8
Allow generic ARM cores to match any more specific ARM architecture.

<rdar://problem/15932248>



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@212863 91177308-0d34-0410-b5e6-96231b3b80d8
lldb needs to support DW_op_piece masks for values in subregister and also to be able to piece together a value that is spread across multiple registers.

Patch from Adrian Prantl.

<rdar://problem/16040521> 



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

The --setsid (-S) option changes the session id for the lldb-gdbserver process.
This is used by tools such as lldb-platform and allows the user to prevent
llgs from being in the same session as a calling terminal session.
This will prevents terminal group control signals from affecting
lldb-gdbserver.

See also:
https://github.com/tfiala/lldb/issues/38


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@212873 91177308-0d34-0410-b5e6-96231b3b80d8
Add FreeBSD decorator for TestMultipleDebuggers

llvm.org/pr20282


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@212877 91177308-0d34-0410-b5e6-96231b3b80d8
Add FreeBSD failure decorator for TestCallStopAndContinue

The testrun now completes successfully on my FreeBSD 11.0-CURRENT
laptop.  There are some intermittent failures on the FreeBSD buildbot
still, which should be addressed in later commits.

llvm.org/pr20274


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@212878 91177308-0d34-0410-b5e6-96231b3b80d8
llgs: modify to accept --native-regs flag.

This is the last flag sent by lldb-platform that was not accepted
by llgs and is accepted by debugserver.

Conditionalized out a bit more code in prep for Windows
support one day based on _WIN32 define.

Updated the lldb-gdbserver usage string to represent
recent updates to command line arguments (and some older
ones like --attach pid).

Implements https://github.com/tfiala/lldb/issues/37


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

s_listen_thread had the wrong type.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@212884 91177308-0d34-0410-b5e6-96231b3b80d8
Modified gdb-remote tests to run with automatically-chosen ports.

Now that llgs supports communicating the 0-port choose-a-port
mechanism and can communicate that back to a caller via the
--named-pipe option (at parity with debugserver), we use this
mechanism to always start llgs and debugserver gdb-remote
protocol tests without needing to use some port arbitration
mechanism.  This eliminates some potential intermittent failures vs. the
previous random port and collision-avoidance strategy used.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@212923 91177308-0d34-0410-b5e6-96231b3b80d8
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