Commit Graph

8568 Commits

Author SHA1 Message Date
Jason Molenda 53b8ea1c89 Need to use rm -rf on dSYM bundle directories.
llvm-svn: 203332
2014-03-08 01:53:27 +00:00
Jason Molenda ac605f4a3a Add API logging to the SBQueue/SBQueueItem/SBThread calls.
llvm-svn: 203330
2014-03-08 01:34:55 +00:00
Jason Molenda 0d6a1ff23d Fix a small inferior process memory leak in SystemRuntimeMacOSX::PopulatePendingItemsForQueue().
llvm-svn: 203312
2014-03-07 23:28:54 +00:00
Jason Molenda 790b4e527b Re-enable ProcessElfCore for non-FreeBSD/Linux builds; with Greg's fix in r203274
this is not installing itself for Mach-O binaries.

llvm-svn: 203310
2014-03-07 23:23:10 +00:00
Greg Clayton 289dde27a2 Remove unused code.
llvm-svn: 203292
2014-03-07 21:51:19 +00:00
Greg Clayton 9cbd3c628c Verify we have a correct ELF or Mach core file before we return a valid instace of ProcessElfCore or ProcessMachCore respectively.
llvm-svn: 203274
2014-03-07 19:24:39 +00:00
Ed Maste c5a3c9f483 Use predefined $(RM) in clean rule, and -r only for (expected) directories
llvm-svn: 203271
2014-03-07 19:11:00 +00:00
Ed Maste 49f359aea4 Fix malloc thread step-out test on FreeBSD
After hitting the malloc() breakpoint on FreeBSD our top frame is actually
an inlined function malloc_init.

  * frame #0: 0x0000000800dcba19 libc.so.7`malloc [inlined] malloc_init at malloc.c:5397
    frame #1: 0x0000000800dcba19 libc.so.7`malloc(size=1024) + 9 at malloc.c:5949
    frame #2: 0x00000000004006e5 test_step_out_of_malloc_into_function_b_with_dwarf`b(val=1) + 37 at main2.cpp:29

Add a heuristic to keep stepping out until we come to a non-malloc caller,
before checking if it is our desired caller from the test code.

llvm.org/pr17944

llvm-svn: 203268
2014-03-07 19:02:20 +00:00
Ed Maste 0990e05d43 Fix test 'make clean' target for empty $(DSYM) on FreeBSD
A freebsd issue with rm prevents '[g]make clean' from working if $(DSYM)
is empty (fts_open(3) fails if passed an empty argument).

To work around this, simplify the clean target by using three separate
rm invocations: one for the common files, one for the case of non-empty
$(DYLIB_NAME), and one for non-empty $(DSYM).

Issue diagnosed (and reported to FreeBSD) by John Wolfe.

llvm.org/pr17933

llvm-svn: 203253
2014-03-07 17:20:50 +00:00
Ed Maste 11cbb11611 Add decorator for recent FreeBSD failure
llvm.org/pr19075

llvm-svn: 203245
2014-03-07 14:50:29 +00:00
Jim Ingham 4a65fb1f25 Don't hold the ThreadList lock over calls to the GetStatus (Process or Thread) calls
or the lower levels of the Process won't be able to restart.

<rdar://problem/16244835>

llvm-svn: 203233
2014-03-07 11:20:03 +00:00
Jim Ingham a04ef756d4 If you are disabling a hardware breakpoint, use z1 not z0.
<rdar://problem/16256532>

llvm-svn: 203232
2014-03-07 11:18:02 +00:00
Jim Ingham 0ff099f10c The ThreadPlanCallFunction needs to pass its "StopOthers" to its run to address subplan.
llvm-svn: 203231
2014-03-07 11:16:37 +00:00
Ben Langmuir 9f0bac5cd1 Update for clang r203213
llvm-svn: 203217
2014-03-07 08:31:36 +00:00
Jason Molenda e4ea6f5901 Todd points out that my change to ProcessElfCore is probably
not going to key off of the ELF object file like I'd intended.
Revert my change in r203205; also revert Greg's change in
r203107 which builds ProcessElfCore on non-Linux/FreeBSD systems
for the moment until we can straighten this out.

llvm-svn: 203207
2014-03-07 06:28:29 +00:00
Jason Molenda 75fb3d70e2 Only enable ProcessElfCore if this is an ELF file. Right now this plugin is winning over
ProcessMachCore because it doesn't check the format of the file up front.  (this is only now
happening because of Greg's change in r203178 to build ProcessElfCore for non-Linux/FreeBSD
hosts).
<rdar://problem/16257533> 

llvm-svn: 203205
2014-03-07 06:15:24 +00:00
Ahmed Charles 8f926ad0d9 Replace uses of OwningPtr<T> with std::unique_ptr<T>.
llvm-svn: 203200
2014-03-07 04:45:22 +00:00
Greg Clayton f6913cd7af Allow line numbers to be shown in multi-line expressions.
llvm-svn: 203185
2014-03-07 00:53:24 +00:00
Steve Pucci befe2b1c48 This commit provides support for running the dosep.ty test driver with multiple threads.
It speeds up running the full test suite on my HP z620 Ubuntu machine with 32 hyperthreaded CPUs from 11 minutes to about 1m13s (about 9x).

The default behavior is to run single-threaded as before.  If the environment variable LLDB_TEST_THREADS is set, a Python work queue is set up with that many worker threads.

To avoid collisions within a test directory where multiple tests make use of the same prebuilt executable, the unit of work for the worker threads is a single directory (that is, all tests within a directory are processed in the normal serial way by a single thread).

tfiala & I have run this way a number of times; the only issue I found was that the TestProcessAttach.py test failed once, when attempting to attach to the process "a.out" by name.  I assume this is because some other thread was running an executable of that name at the same time, and we were attempting to attach to the wrong one, so I changed that test to use a different executable name (that change is also included in this commit).

llvm-svn: 203180
2014-03-07 00:01:11 +00:00
Greg Clayton 0e4b605e47 Re-enable the JITLoaderGDB and ProcessElfCore that were disabled by:
Author: ace2001ac
Date: Thu Mar  6 05:30:34 2014
New Revision: 203107

URL: http://llvm.org/viewvc/llvm-project?rev=203107&view=rev
Log:
Fix Windows build break introduced in r203035.

Add '#if defined(__linux__) || defined(__FreeBSD__)' around JITLoaderGDB
and ProcessElfCore, which are only built on Linux and FreeBSD.

Modified:
   lldb/trunk/source/lldb.cpp

Windows will need to start building all files necessary so that JITLoaderGDB and ProcessElfCore can build since they should work on all platforms.

llvm-svn: 203178
2014-03-06 23:29:58 +00:00
Greg Clayton 747c593474 Get rid of lldb-dll-export.h and place the smarts of this into lldb-defines.h.
Please do not add header files that are required in public APIs without first checking with us. This broke the LLDB builds at Apple because the lldb-dll-export.h wasn't included in the LLDB.framework and it was being included by public API header files.

llvm-svn: 203177
2014-03-06 23:11:53 +00:00
Sean Callanan 9b5256c566 Added lldb-dll-export.h to the public API, fixing
clients of LLDB.

<rdar://problem/16248988>

llvm-svn: 203139
2014-03-06 17:50:01 +00:00
Ahmed Charles 943d4a6896 Fix Windows build break introduced in r203035.
Add '#if defined(__linux__) || defined(__FreeBSD__)' around JITLoaderGDB
and ProcessElfCore, which are only built on Linux and FreeBSD.

llvm-svn: 203107
2014-03-06 11:30:34 +00:00
Jason Molenda a8ff543c28 When a client asks for a queue pending item's extended backtrace,
hold a strong pointer to that extended backtrace thread in the Process
just like we do for asking a thread's extended backtrace.
Also, give extended backtrace threads an invalid ThreadIndexID number.
We'll still give them valid thread_id's.  Clients who want to know the
original thread's IndexID can call GetExtendedBacktraceOriginatingIndexID().
<rdar://problem/16126034> 

llvm-svn: 203088
2014-03-06 06:31:18 +00:00
Jim Ingham 82536bdbbf Temporarily disable the JIT loading detector till we figure out why it crashes when lldb follows through exec's...
llvm-svn: 203068
2014-03-06 03:47:34 +00:00
Greg Clayton 4b047f2378 Moved JITLoader.cpp and JITLoaderList.cpp over into "source/Target" since the header files were in "include/lldb/Target".
Also enabled the ELF Core file support in all builds since the header files have been properly separated from ProcessMonitor.

llvm-svn: 203035
2014-03-06 00:14:12 +00:00
Jason Molenda b509a414f0 Add the new JITLoader plugin files to the lldb xcode project file.
Add a cast for a size_t / PRIu64 printf formatter.

llvm-svn: 203030
2014-03-05 23:48:15 +00:00
Ed Maste 32aa12b86c Build JITLoader on FreeBSD also
llvm-svn: 202980
2014-03-05 13:57:24 +00:00
Ed Maste 29150c1731 Put "jit" in alpha order in log category list
llvm-svn: 202976
2014-03-05 13:43:23 +00:00
Andrew MacPherson 17220c1886 Add support for JIT debugging on Linux using the GDB JIT interface. Patch written with Keno Fischer.
llvm-svn: 202956
2014-03-05 10:12:43 +00:00
Andrew MacPherson 05511fd3e6 Test commit.
llvm-svn: 202955
2014-03-05 09:40:33 +00:00
Jason Molenda 0ddfe7f8dc Small fix to DynamicLoaderDarwinKernel::KextImageInfo::LoadImageUsingMemoryModule needed
with Greg's change to how we load modules in r202890.

llvm-svn: 202933
2014-03-05 03:33:01 +00:00
Todd Fiala 02c11e384d lldb-gdbserver: add support for optional host in connection string and handle other startup errors.
This change addresses the following bug:
http://www.llvm.org/bugs/show_bug.cgi?id=18814

llvm-svn: 202910
2014-03-04 23:41:34 +00:00
Steve Pucci 03904accc0 Add ProcessGDBRemote::GetAuxvData() and fix multiple-packet concatenation for binary data.
ProcessGDBRemote::GetAuxvData obtains the auxv from a remote gdbserver (via a binary-data packet), and returns the data as a DataBufferSP.

The patch includes a small fix to GDBRemoteCommunicationClient::SendPacketsAndConcatenateResponses() to support binary file format packet returns (by not assuming each binary packet is a null-terminated string when concatenating them).

llvm-svn: 202907
2014-03-04 23:18:46 +00:00
Sean Callanan 9bbf3cd3d7 Hardened against reads in the IRMemoryMap that
exceed the bounds of the backing memory.

<rdar://problem/16088322>

llvm-svn: 202899
2014-03-04 21:56:11 +00:00
Greg Clayton 34f1159bbd Fixed SBDebugger.CreateTarget("filename") and also make sure remote targets don't pickup bogus locally cached files.
<rdar://problem/16217254>
<rdar://problem/16078651>

llvm-svn: 202890
2014-03-04 21:20:23 +00:00
Todd Fiala 1251053e04 Get Linux i386 running.
This change uses a fixed known offset for the Linux i386 DR0 register.
This change also undoes the 32-bit wordsize change from r169645 that
revolved around being 32-bit/64-bit friendly in
WriteRegOperation::Execute within the Linux ProcessMonitor.cpp. I ran
all the tests on x86_64 Linux with no failures. I also ran some simple
tests with 32-bit Linux exe on x86_64 host and 32-bit linux exe on
i686 32-bit host and these worked fine.

Note (from Todd): the UserData struct in the Linux i386 register
context (only used by Linux i386 host running Linux 32-bit inferior)
is out of sync with what shows up in the sys/user.h for an 32-bit
Linux build (per an earlier change of mine to make it look more like
x86_64 host running x86 exe). I think we should (1) make i386 Linux
targets run using the same register context (and correct ones) on i386
and x86_64 linux hosts if that is possible, and (2) we could use some
tests around the register handling, particularly to verify things like
DR0 registers are in the right spots on host/target combos that we can
verify vs. known correct values.

Change by Matthew Gardiner.

llvm-svn: 202887
2014-03-04 20:46:32 +00:00
Todd Fiala c25fd190ef Modified some test annotations so that tests on Linux that should be skipped don't show up as XFAIL.
The following two tests showed up as XFAIL even though they should
always be skipped on Linux, due to the @unittest2.expectedFailure
annotation appearing above the @dsym_test annotation:

TestObjCNewSyntax.ObjCNewSyntaxTestCase.test_expr_with_dsym
TestBlocks.BlocksTestCase.test_expr_with_dsym.

For those two, I simply moved the @dsym_test annotation to the top so
that it would be marked for skip ahead of being marked for XFAIL.

TestObjCNewSyntax.ObjCNewSyntaxTestCase.test_expr_with_dwarf I marked
as @skipIfLinux since my understanding is that isn't a valid test to
run on Linux. So rather than categorize as a fail (i.e. something
wrong to be fixed), just skip it. (My recent changes to Linux tests
have been following that model: if it could never work, skip; if it's
broken, mark XFAIL so we can easily track, fix, notice the fix and
adjust accordingly).

TestDeadStrip.DeadStripTestCase.test_with_dwarf I had previously
marked as XFAIL but this would never work on Linux with the current
linker AFAICT.  Marked it as skip.

llvm-svn: 202788
2014-03-04 05:28:24 +00:00
Jim Ingham 8f63266569 Fix a couple of typo's in breakpoint descriptions.
llvm-svn: 202782
2014-03-04 03:09:00 +00:00
Jason Molenda 8d08a78c30 Temporarily revert part of Greg's changes in r202738 which are causing problems with the testsuite and SBDebugger::CreateTarget().
llvm-svn: 202776
2014-03-04 02:07:24 +00:00
Greg Clayton e556a4230c Stop messages from being emitted out of order when detaching.
llvm-svn: 202756
2014-03-03 20:29:02 +00:00
Jim Ingham 8225d59b3f Only require thread scope when we're about to run the function on a thread.
llvm-svn: 202740
2014-03-03 19:16:45 +00:00
Greg Clayton 6fea17e874 "size_t" isn't always 64 bit, it is 32 bit on 32 bit systems. All printf style statements that were assuming size_t were 64 bit were changed, and they were also changed to display them as unsigned values as "size_t" isn't signed.
If you print anything with 'size_t', please cast it to "uint64_t" in the printf and use PRIu64 or PRIx64.

llvm-svn: 202738
2014-03-03 19:15:20 +00:00
Deepak Panickal 6419e98ee1 Check if the terminal is interactive and set the flags accordingly
llvm-svn: 202726
2014-03-03 15:53:37 +00:00
Deepak Panickal d582f69469 Move Windows getopt for building the DLL
llvm-svn: 202725
2014-03-03 15:52:27 +00:00
Deepak Panickal 627f4ae811 Build liblldb.dll in Windows
llvm-svn: 202724
2014-03-03 15:50:36 +00:00
Deepak Panickal 99fbc07600 Fix Windows build using portable types for formatting the log outputs
llvm-svn: 202723
2014-03-03 15:39:47 +00:00
Ed Maste 6fa32b6f54 Don't require a valid thread if expr can be evaluated statically
This seems reasonable and the BackticksWithNoTargetTestCase suggests it
should be this way.

llvm-svn: 202722
2014-03-03 15:37:30 +00:00
Ed Maste aa954d1188 Update test class name and comment to match test
llvm-svn: 202718
2014-03-03 15:01:28 +00:00
Jim Ingham 36a02e0655 Make sure the exe_ctx passed to ClangUserExpression::Execute has a valid thread.
<rdar://problem/15949113>

llvm-svn: 202561
2014-03-01 00:17:06 +00:00