Commit Graph

9199 Commits

Author SHA1 Message Date
Todd Fiala ef7150925f Fixup TestStepNoDebug to cleanup properly on shutdown.
This was causing core dumps on MacOSX and was not properly
cleaning up the state of the inferior before exiting.

The test was overriding def tearDown(), but failed to
call the base class after doing its own cleanup.  This
essentially eliminated normal clean-up activity.

llvm-svn: 214138
2014-07-28 22:53:49 +00:00
Zachary Turner 35ed13262d Teach LLDB about Windows processes.
This patch creates a simple ProcessWindows process plugin.
The only thing it knows how to do currently is create processes.

Differential Revision: http://reviews.llvm.org/D4681

llvm-svn: 214094
2014-07-28 16:45:18 +00:00
Zachary Turner 9e757b7ebe Use llvm Support functions to get the user's home directory.
Assuming that the user's home directory is at ~ is incorrect on
Windows.  This patch delegates the request to LLVM's support
library, which already provides a cross-platform implementation
of this function.

Differential Revision: http://reviews.llvm.org/D4674

llvm-svn: 214093
2014-07-28 16:45:05 +00:00
Zachary Turner ad587ae4ca Fix supported architectures on PlatformWindows.
i386, i486, i486sx, and i686 are all indistinguishable as far as
PE/COFF files are concerned.  This patch adds support for all of
these architectures to PlatformWindows.

Differential Revision: http://reviews.llvm.org/D4658

llvm-svn: 214092
2014-07-28 16:44:49 +00:00
Zachary Turner 3b2065f017 Fix the MSVC build. MSVC does not support constexpr.
llvm-svn: 214091
2014-07-28 16:44:28 +00:00
Matthew Gardiner fc2a8c407d Test commit, please ignore
llvm-svn: 214062
2014-07-28 06:21:40 +00:00
Todd Fiala 31bde322f3 llgs: add --reverse-connect support.
Also includes --reverse-connect tests for llgs and debugserver.

llvm-svn: 214031
2014-07-26 20:39:17 +00:00
Todd Fiala b1d57febf7 Minor fixups to documentation for Process::Launch()/DoLaunch().
The code had moved forward with changes for using ProcessLaunchInfo,
but the documentation still referred to arguments that no longer
get passed to these methods.

llvm-svn: 213965
2014-07-25 19:24:52 +00:00
Todd Fiala d947406427 Fix an x86 assembler stack unwind calculation for non-volatile registers.
This change has the practical effect of fixing some backtrace
scenarios that would fail with inferiors running on the Android Art
host-side JVM under Linux x86_64 on Ubuntu 14.04.

See this lldb-commits thread for more details:
http://lists.cs.uiuc.edu/pipermail/lldb-commits/Week-of-Mon-20140721/011988.html

Change by Tong Shen.
Reviewed by Jason Molenda.

Tested:
Ubuntu 14.04 x86_64, clang-3.5-built lldb.
MacOSX 10.10 Preview 4, Xcode 6 Beta 4-built lldb.

llvm-svn: 213914
2014-07-25 01:15:34 +00:00
Todd Fiala e88aea3234 Fix configure/make builds on MacOSX.
Change by Keno Fischer.

llvm-svn: 213904
2014-07-24 23:22:58 +00:00
Jim Ingham a9b498955c We were turning off all these tests on OSX and FreeBSD because of a known (and fairly unimportant) bug.
Keep a test for that bug, but let the useful parts of the test run anyway.

llvm-svn: 213875
2014-07-24 16:56:19 +00:00
Ed Maste 3feafa78bd Fix endian test for big-endian hosts
The uint16_t cast truncated the magic value to 0x00000304, making the
first byte 0 (eByteOrderInvalid) on big endian hosts.

Reported by Justin Hibbits.

llvm-svn: 213861
2014-07-24 13:28:16 +00:00
Jason Molenda 9e7da0fb44 Add debug asserts / sanity checks to
GDBRemoteRegisterContext::ReadRegisterBytes and
GDBRemoteRegisterContext::WriteRegisterBytes to ensure we don't try
to read/write off the end of the register buffer.  This should never
happen but we've had some target confusion in the past where it
did; adding the checks is prudent to avoid crashing here if it happens
again.

<rdar://problem/16450971> 
<rdar://problem/16458182>

llvm-svn: 213829
2014-07-24 01:53:11 +00:00
Jason Molenda 36a216eefc Increase the gdb-remote packet timeout for the first packet we send
to the remote side (QStartNoAckMode) - it may take a little longer
than normal to get a reply.

In debugserver, hardcode the priority for several threads so they
aren't de-prioritized when a user app is using system resources.
Also, set the names of the threads.

<rdar://problem/17509866>

llvm-svn: 213828
2014-07-24 01:36:24 +00:00
David Majnemer 5149bac8b4 Add a .clang-format file to enhance formatting experience with clang-format
clang-format is a handy tool that formats code very intelligently.  I'd
like to use it with LLDB but it requires a .clang-format file to inform
it about LLDB-specific formatting rules.

More information on these rules are here:
http://clang.llvm.org/docs/ClangFormatStyleOptions.html

Differential Revision: http://reviews.llvm.org/D4630

llvm-svn: 213823
2014-07-24 00:26:04 +00:00
David Majnemer b98a5e04ac ObjectFileMachO: Silence signed/unsigned comparison warning
File::SeekFromStart returns an off_t representing the position of the
file after seeking.  This return value is always going to be one of two
values: the input or -1 in the case of failure.

ObjectFileMachO compares an expression of type off_t from the return of
File::SeekFromStart(segment.fileoff) and compares it for equality with
segment.fileoff.

The type of segment_command_64::fileoff is unsigned while off_t is
signed, comparing them emits a diagnostic under GCC.

Instead, we can just compare SeekFromSTart with -1 to see if we
successfully seeked.

Differential Revision: http://reviews.llvm.org/D4634

llvm-svn: 213822
2014-07-24 00:24:12 +00:00
Enrico Granata d75303581f Ensure that if some unspecified person were to pass in an invalid architecture when trying to create a target, that it would fail, but not cause LLDB to crash.
llvm-svn: 213781
2014-07-23 18:18:38 +00:00
Greg Clayton 56b796856f Make sure we don't crash if someone (E.G.) comments out on entry from g_core_definitions[] without removing the ArchSpec::Core enumeration when submitting from source.
We now catch the issue with a static_assert() at compile time and use llvm::array_lengthof(g_core_definitions) as well.

<rdar://problem/17767541>

llvm-svn: 213778
2014-07-23 18:12:06 +00:00
Todd Fiala 002fb104bd Add kalimba architecture checking to TestImageListMultiArchitecture
Verify that ObjectFileELF's kalimba detection works regardless
of the host platform.

Change by Matthew Gardiner.

llvm-svn: 213763
2014-07-23 15:16:35 +00:00
Todd Fiala a7804f249b Improve documentation on triple encoding expectations for qHostInfo response.
Change by Matthew Gardiner.

llvm-svn: 213756
2014-07-23 14:48:41 +00:00
Todd Fiala d8eaa17587 Update lldb to track recent Triple arm64 enum removal and collapse into aarch64.
See the following llvm change for details:

r213743 | tnorthover | 2014-07-23 05:32:47 -0700 (Wed, 23 Jul 2014) | 9 lines
AArch64: remove arm64 triple enumerator.

This change fixes build breaks on Linux and MacOSX lldb.

llvm-svn: 213755
2014-07-23 14:37:35 +00:00
Saleem Abdulrasool 6310757568 Plugins: silence a few more signed comparision warnings
Address a few signed-compare warnings that were triggered on GCC 4.8.2.

llvm-svn: 213716
2014-07-23 01:53:54 +00:00
Saleem Abdulrasool b5c128b3c7 Target: silence a GCC warning
GCC emits a warning:
    warning: enumeral and non-enumeral type in conditional expression [enabled by default]
which does not seem to have a flag to control it.  Simply add an explicit cast
for the boolean value.

llvm-svn: 213715
2014-07-23 01:53:52 +00:00
Todd Fiala 015d818b59 Enable lldb-platform exe support for Linux.
This change enables lldb-platform for Linux.  In addition, it does the following:

* fixes Host::GetLLDBPath() to work on Linux/*BSD for ePathTypeSupportExecutableDir-relative paths.

* adds more logging and comments around lldb-platform startup and remote lldb-platform usage.

* refactors lldb-platform remote-* support for Darwin and Linux into PlatformPOSIX.  This, in theory, is the bulk of what is needed for *BSD to make remote connections to lldb-platform as well (although I haven't tested that yet).  FreeBSD can make similar changes to their Platform* as was made here for PlatformLinux to pick up the rest of the bits.

* teaches GDBRemoteCommunication to use lldb-gdbserver for non-Apple hosts.

llvm-svn: 213707
2014-07-22 23:41:36 +00:00
David Majnemer 12bb77ddd1 SBCommunication: Fix a pointer-to-function to void-pointer cast
reinterpret_cast may not convert a pointer-to-function to a
void-pointer.  Take a detour through intptr_t and *then* convert to a
pointer-to-function.

This fixes a diagnostic emitted by GCC.

llvm-svn: 213696
2014-07-22 22:12:58 +00:00
David Majnemer f57a430b90 ScriptInterpreterPython: %p should be used with void-pointer
printf's %p format specifier expects an argument of type void-pointer,
not type PyThreadState*.  Fix this with a static_cast.

Differential Revision: http://reviews.llvm.org/D4632

llvm-svn: 213695
2014-07-22 22:02:48 +00:00
David Majnemer 8490da15a8 Host: Fix a pointer-to-function to void-pointer cast
reinterpret_cast may not convert a pointer-to-function to a
void-pointer.  Take a detour through intptr_t and *then* convert to a
pointer-to-function.

This silences a warning emitted by GCC when building LLDB.

Differential Revision: http://reviews.llvm.org/D4631

llvm-svn: 213693
2014-07-22 22:00:42 +00:00
David Majnemer 702c1d0986 SBHostOS: Fix a pointer-to-function to void-pointer cast
reinterpret_cast may not convert a pointer-to-function to a
void-pointer.  Take a detour through intptr_t and *then* convert to a
pointer-to-function.

This fixes a warning emitted by GCC.

Differential Revision: http://reviews.llvm.org/D4624

llvm-svn: 213692
2014-07-22 22:00:04 +00:00
David Majnemer 5ff0278b68 PluginManager: Don't cast from void-pointer to pointer-to-function
GCC warns on reinterpret_cast expressions involving a void-pointer
source and a pointer-to-function destination.  Take a detour through
intptr_t to silence it.

Differential Revision: http://reviews.llvm.org/D4626

llvm-svn: 213691
2014-07-22 21:59:22 +00:00
David Majnemer 695f0f1024 TypeSynthetic: Fix a pointer-to-function to void-pointer cast
reinterpret_cast may not convert a pointer-to-function to a
void-pointer.  Take a detour through intptr_t and *then* convert to a
pointer-to-function.

Differential Revision: http://reviews.llvm.org/D4627

llvm-svn: 213682
2014-07-22 20:40:01 +00:00
David Majnemer fba933f94b Mangled: Fix an 'unused variable' warning on GNU/Linux
Platforms which don't use LLDB's built-in demangler don't use the
'mangled_length' variable.  Instead, replace it's only use by an
expression it is equivalent to.

Differential Revision: http://reviews.llvm.org/D4625

llvm-svn: 213681
2014-07-22 20:36:37 +00:00
Kate Stone e2b2186652 Dramatically improves C++ demangling performance by introducing a new implementation that is much faster than the existing demangler. While not yet complete, the new demangler will fail gracefully when it encounters symbols it isn’t prepared to deal with. In these cases LLDB will fall back to using the full demangler to prevent a loss in functionality. On sizable code bases the fast path succeeds 95% of the time, providing a significant net win.
The new implementation is located in source/Core/FastDemangle.cpp.  It’s fairly straightforward C code with a few basic C++ extensions.  It should compile with little or no change on a variety of platforms, but of course it is still only useful for symbols that comply with the Itanium ABI mangling spec (plus a few Clang extensions.)

<rdar://problem/15397553> <rdar://problem/15794867>

llvm-svn: 213671
2014-07-22 17:03:38 +00:00
Zachary Turner 9ef307bfc1 Make the test runner understand Windows command shell execution.
Currently, the test runner makes the assumption that it will run
commands through /bin/sh.  This is obviously not true on Windows,
so this patch abstracts this logic out somewhat.  Instead of
having the caller build the command string himself, the caller
will now pass in argument list of the form [[a, b], [c, d], ...]
which will get converted into a string of the form a b; c d or
a b && c d, depending on the platform.

Reviewed by: Todd Fiala

Differential Revision: http://reviews.llvm.org/D4590

llvm-svn: 213669
2014-07-22 16:19:29 +00:00
Deepak Panickal 71f5b50f8b Fix an issue where an entry point of 0x00 would cause LLDB to think that the ELF is not executable without checking for ET_EXEC
llvm-svn: 213644
2014-07-22 12:01:43 +00:00
Deepak Panickal d4f3f94e6a Fix the warnings introduced
llvm-svn: 213643
2014-07-22 11:59:11 +00:00
Kate Stone bb1321a7be Improve LLDB's embedded C++ demangler by addressing the following two issues:
1) Preserve ref qualification state in a local variable while parsing a nested name.  Previously, the state was recorded in the shared db reference and could therefore be overwritten when parsing multiple levels of nested names (e.g.: when a qualified name has qualified template args.)

2) Address an off-by-one error when testing whether or not a thunk is non-virtual.  This resulted in the demangled identifying all thunks as non-virtual.

llvm-svn: 213591
2014-07-22 00:18:52 +00:00
Saleem Abdulrasool 0fb2f5d0f9 build: silence GCC warning on Linux
LLDWrapPython.cpp is a generated file.  This contains a double assignment to the
same value, which causes GCC to emit a warning about sequence point evaluation
causing a use-before-init.  Simply silence the warning.

llvm-svn: 213575
2014-07-21 18:18:52 +00:00
Deepak Panickal 5780657be8 Update CMakeLists.txt and Makefiles for building/linking the Hexagon ABI and Dynamic Loader
llvm-svn: 213568
2014-07-21 17:24:05 +00:00
Deepak Panickal 8006d319c2 Add the Hexagon DSP breakpoint opcode to PlatformWindows and PlatformLinux
llvm-svn: 213567
2014-07-21 17:22:12 +00:00
Deepak Panickal 2526ee5a2d ABI for the Hexagon DSP
llvm-svn: 213566
2014-07-21 17:21:01 +00:00
Deepak Panickal ca238a7b82 Dynamic loader for the Hexagon DSP
llvm-svn: 213565
2014-07-21 17:19:12 +00:00
Zachary Turner 07b21d7a69 Rename dosep.ty to dosep.py
llvm-svn: 213555
2014-07-21 16:16:31 +00:00
Zachary Turner 37373b0c98 Remove spurious debugging message from CMake.
llvm-svn: 213553
2014-07-21 16:10:20 +00:00
Saleem Abdulrasool 6747c7d01b linux process: silence GCC switch coverage warning
Add missing entry for eExecMessage message type to silence GCC switch coverage
warning.

llvm-svn: 213470
2014-07-20 05:28:57 +00:00
Saleem Abdulrasool e1401eb747 build: fix cmake warning with newer CMake
Hoist the compatibility macros out a level and re-use them when adding link
dependencies.  Silences a warning from CMake.

llvm-svn: 213469
2014-07-20 05:28:55 +00:00
Jim Ingham 4ac0443fd9 Add the ability to suppress the creation of a persistent
result variable and use in in "Process::LoadImage" so that,
for instance, "process load" doesn't increment the return
variable number.

llvm-svn: 213440
2014-07-19 01:09:16 +00:00
Jim Ingham 6971b861d7 In Process::LoadImage, use the same function call both to call dlopen and to collect
the error if there is one.

llvm-svn: 213436
2014-07-19 00:37:06 +00:00
Greg Clayton 759e7441af LLDB now correctly handles virtual inheritance.
Test case added as well.

<rdar://problem/16785904>

llvm-svn: 213433
2014-07-19 00:12:57 +00:00
Zachary Turner 2f12195b1d Allow the user to override the LLDB_TEST_COMPILER at CMake level.
llvm-svn: 213421
2014-07-18 22:46:22 +00:00
Zachary Turner be9c423b95 Test commit. Having trouble committing from one machine but not
another, attempting to fix it.

llvm-svn: 213413
2014-07-18 21:06:51 +00:00