Commit Graph

9227 Commits

Author SHA1 Message Date
Sylvestre Ledru 186ca7dd59 Update the code with clang changes r214450 (FunctionProtoType::ExtProtoInfo update)
llvm-svn: 214501
2014-08-01 12:19:15 +00:00
Matthew Gardiner f39ebbe613 Change the encoding of the Triple string exchanged across GDB-RSP
and update documentation to suit, as suggested by Jason Molenda and
discussed in:

http://lists.cs.uiuc.edu/pipermail/lldb-commits/Week-of-Mon-20140721/011978.html

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

llvm-svn: 214480
2014-08-01 05:12:23 +00:00
Zachary Turner 7c1bc2b8ae Make CMake choose the target architecture according to the build.
Previously, CMake was invoking the test runner and not specifying
what architecture to use when building test executables.  The
Makefiles for the test executables then had logic to choose x64
by default.  This doesn't work on Windows because the test compiler
would then try to link against the 64-bit MSVCRT and not find them
since only the 32-bit MSVCRT was in the path.

This patch addresses this by figuring out, at CMake time, whether
or not you are building LLDB with a 64 or 32-bit toolchain.  Then,
it explicitly passes this value to the test runner, causing the
test runner to build tests whose architecture matches that of LLDB
itself.  This can still be overridden by setting the CMake variable
LLDB_TEST_EXECUTABLE_ARCH=(x64|x86)

llvm-svn: 214443
2014-07-31 21:07:41 +00:00
Zachary Turner 7d186c0152 Remove shell-globbing from all test makefiles.
llvm-svn: 214441
2014-07-31 21:03:11 +00:00
Greg Clayton 380f3d8334 Fixed an issue where the LLDB command prompt isn't interactive if you use -o -O -S -s or specify a file on the command line.
This means TAB completion wasn't working and editline wasn't being used.

<rdar://problem/17872824> 

llvm-svn: 214428
2014-07-31 19:46:19 +00:00
Greg Clayton ac58361047 Rewrote the initial DW_OP_piece support to be able to support opcodes like:
DW_OP_fbreg(N) DW_OP_piece(4) DW_OP_fbreg(M) DW_OP_piece(8)
DW_OP_fbreg(N) DW_OP_piece(4) DW_OP_piece(8)

The first grabs 4 bytes from FP+N followed by 8 bytes from FP+M, the second grabs 4 bytes from FP+N followed by zero filling 8 bytes which are unavailable. Of course regiters are stuff supported:

DW_OP_reg3 DW_OP_piece(4) DW_OP_reg8 DW_OP_piece(8)

The fix does the following:
1 - don't push the full piece value onto the stack, keep it on the side
2 - fill zeros for DW_OP_piece(N) opcodes that have nothing on the stack (instead of previously consuming the full piece that was pushed onto the stack)
3 - simplify the logic

<rdar://problem/16930524>

llvm-svn: 214415
2014-07-31 18:19:28 +00:00
Ed Maste c82dd2b058 Add decorator for TestStopHookMultipleThreads failing on FreeBSD
llvm.org/pr15037

llvm-svn: 214402
2014-07-31 14:02:32 +00:00
Jason Molenda eff58f0d93 Add a new directory path to
PlatformDarwinKernel::GetGenericSDKDirectoriesToSearch
 - /Library/Developer/KDKs where users may store 
the kernel debug kits on their systems.

Change PlatformDarwinKernel::GetKextDirectoriesInSDK
to look in the root directory of places like
/Library/Developer/KDKs/KDK_10.10_14A298i.kdk
as well as the System/Library/Extensions subdir
in that directory (if it exists) and the
Library/Extensions subdir in that directory (if it
exists).
<rdar://problem/16568635> 

llvm-svn: 214391
2014-07-31 06:36:24 +00:00
Jason Molenda a02869de00 When doing an exhaustive search for the kernel in memory, also look
at 16k offsets.
<rdar://problem/17861781> 

llvm-svn: 214387
2014-07-31 06:07:04 +00:00
Zachary Turner 31dd2c125f Disable test on Windows. script print deadlocks on Windows.
llvm-svn: 214351
2014-07-30 22:08:17 +00:00
Enrico Granata 2aa09d4319 When resetting the number of children on a ValueObject, also clear the existing children. This avoids issues where dynamic types change, but children stay the same
llvm-svn: 214341
2014-07-30 21:23:55 +00:00
Enrico Granata eccdbde667 Revert a part of r214335 that I didn't mean to commit
llvm-svn: 214340
2014-07-30 21:10:03 +00:00
Enrico Granata ba8eb12046 Improve the way the ObjC data formatters fetch a valid frame to use for running expressions against
This is not bullet-proof, as you might end up running in a thread where you shouldn't, but the previous policy had the same drawback
Also, in cases where code-running formatters were being recursively applied, the previous policy caused deeper levels to fail, whereas this will at least get such scenarios to function
We might eventually want to consider disqualifying certain threads/frames for "viability", but I'd rather keep it simple until complexity is proven to be necessary

llvm-svn: 214337
2014-07-30 21:07:50 +00:00
Enrico Granata d9119b6884 Reflect changes in LLVM getTypeInfo() API
llvm-svn: 214335
2014-07-30 21:02:00 +00:00
Ed Maste d4779d5b2d lldb is a scope, not a label
llvm-svn: 214327
2014-07-30 19:33:25 +00:00
Ed Maste f8314536ec Fix build: remove bogus ./ at end of line
llvm-svn: 214326
2014-07-30 19:26:11 +00:00
Greg Clayton 4d04309b91 Use Process::ReadMemoryFromPointer() instead of manually reading the pointer.
llvm-svn: 214323
2014-07-30 18:34:58 +00:00
Greg Clayton 06357c930c (no commit message)
llvm-svn: 214319
2014-07-30 17:38:47 +00:00
Sylvestre Ledru 3b6c466e96 Use __linux__ macro throughout, instead of ocasional __linux.
__linux is not universally defined across all standards versions, compilers and architectures. Specifically at C99 and up, it's not defined in GCC on powerpc platform.

See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28314

Bugzilla: http://llvm.org/bugs/show_bug.cgi?id=20380

Patch by Dimitri John Ledkov <dimitri.ledkov@canonical.com>

llvm-svn: 214291
2014-07-30 08:33:21 +00:00
Greg Clayton 49a95e1f41 Silence a warning saying "typedef requires a name" from clang.
llvm-svn: 214247
2014-07-29 23:23:58 +00:00
Todd Fiala 7306cf3cb7 Add $vAttach support to llgs.
Also adds a new test case for vAttach;{pid} for llgs and debugserver.

llvm-svn: 214236
2014-07-29 22:30:01 +00:00
Reid Kleckner 56d861fbb9 Attempt to fix the expression parser after r214119
__INT?_TYPE__ is now explicitly, so adding an explicit 'signed'
specifier causes errors.

llvm-svn: 214233
2014-07-29 21:59:33 +00:00
Greg Clayton 2be78ba934 Remove unused variable that was causing a warning.
llvm-svn: 214230
2014-07-29 21:47:02 +00:00
Greg Clayton c76fa8a3eb Resolve the executable _before_ we try to get the module specifications.
Also fixed the host 32 and 64 bit arch to return "x86_64-apple-macosx" again instead of "x86_64-apple-" (unspecified OS) after recent changes.

<rdar://problem/17845078> 

llvm-svn: 214223
2014-07-29 21:27:21 +00:00
Greg Clayton 82625d3a5f Use the most up to date dsymutil on Darwin, not the one in /usr/bin/dsymutil.
llvm-svn: 214207
2014-07-29 20:10:59 +00:00
Zachary Turner 12f6f53618 [Windows] Delegate str[n]casecmp to the appropriate MSVCRT func.
llvm-svn: 214197
2014-07-29 19:08:55 +00:00
Greg Clayton a3a6c12c03 When constructing an ArchSpec from a MachO cpu type and subtype, don't set the OS for x86_64 and x86 in case the binary ends up being for macosx or ios.
<rdar://problem/17819272> 

llvm-svn: 214188
2014-07-29 18:04:57 +00:00
Zachary Turner d8a5273993 Fix compile error on Windows.
A piece of a future patch accidentally made it in, this simply
fixes the error.

llvm-svn: 214161
2014-07-29 05:39:21 +00:00
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