Commit Graph

9785 Commits

Author SHA1 Message Date
Todd Fiala 9c08576389 Fix stale comments in new tests.
Dang.

llvm-svn: 218901
2014-10-02 19:48:30 +00:00
Todd Fiala b72209102f thread state coordinator: add tests and impl to error on creation/death issues.
Added tests and impl to make sure the following errors are reported:
* Notifying a created thread that we are already tracking.
* Notifying a thread death for a thread we don't know about.

llvm-svn: 218900
2014-10-02 19:44:32 +00:00
Ed Maste ee7902d3b2 Add ENABLE_THREADS for these threaded tests
On at least FreeBSD linking with -lpthread is needed for std::thread.

llvm-svn: 218899
2014-10-02 19:15:00 +00:00
Todd Fiala 325111bcc6 thread state coordinator: added simpler deferred stop notification method.
Now that ThreadStateCoordinator errors out on threads in unexpected states,
it has enough information to know which threads need stop requests fired
when we want to do a deferred callback on a thread's behalf.  This change
adds a new method, CallAfterRunningThreadsStop(...), which no longer
takes a set of thread ids that require stop requests.  It's much harder
to misuse this method and (with newer error logic) it's harder to
correctly use the original method.  Expect the original method that takes
the set of thread ids to stop to disappear in the near future.

Adds several tests for CallAfterRunningThreadsStop().

llvm-svn: 218897
2014-10-02 19:03:06 +00:00
Enrico Granata 2b60cd1b68 Make this test case a little more resilient to class name changes
llvm-svn: 218896
2014-10-02 18:34:45 +00:00
Todd Fiala eeb023cf76 Fix codesigning of MacOSX debugserver when built with cmake.
This patch fixes the codesigning of debugserver on OSX when built with
cmake.  Without this you get this error when debugging:
    error: process launch failed: unable to locate debugserver

Note: you also need to set LLDB_DEBUGSERVER_PATH to point to your built debugserver.
e.g. export LLDB_DEBUGSERVER_PATH=`pwd`/bin/debugserver

Change by dawn@burble.org.

Tested on MacOSX 10.9.5 and Xcode 6.1 Beta using cmake/ninja.
Verified no build break on Linux Ubuntu cmake/ninja and Xcode 6.1 canonical build.

llvm-svn: 218890
2014-10-02 16:59:30 +00:00
Todd Fiala 755be7f86a Fix up stale comments from last change.
llvm-svn: 218873
2014-10-02 14:44:33 +00:00
Todd Fiala 404e370892 thread state coordinator: requesting resume now signals error appropriately.
Added tests to verify that the coordinator signals an error if
the given thread to resume is unknown, and if the thread is through to
be running already.

Modified resume handling code to match tests.

llvm-svn: 218872
2014-10-02 14:41:15 +00:00
Todd Fiala 4bb603b2aa gtest runner: now always does a clean step after running.
* Checks for any 'clean' arg, setting clean-only mode.
* If clean-only mode, skip the make.
* Adds the equivalent of os.devnull in a way that supports the file-like 'write' operation.
* Uses a null sysout/syserr for the clean step so we don't see noise from cleaning.
* Now always runs the clean step after a real test run so we don't have cruft left over after a test run.

llvm-svn: 218871
2014-10-02 14:07:46 +00:00
Jason Molenda 75906f4b80 Update to match strings output by lldb.
llvm-svn: 218853
2014-10-02 06:17:15 +00:00
Jason Molenda ce60807ba6 Add a couple of extra exepct strings so this test file keeps in sync with lldb
a little better.

llvm-svn: 218851
2014-10-02 05:15:07 +00:00
Jason Molenda 44b63298a9 Add SBExecutionContext.h to the list of headers to copy into the LLDB framework.
llvm-svn: 218850
2014-10-02 04:34:44 +00:00
Jason Molenda 6a35470563 Add a mutex lock to StackFrame to protect race conditions for
updating its ivars.  We've had a lot of crash reports and careful
analysis shows that we've got multiple threads operating on the
same StackFrame objects, changing their m_sc and m_flags ivars.
<rdar://problem/18406111> 

llvm-svn: 218845
2014-10-02 01:08:16 +00:00
Eric Christopher 78b833bb53 Remove unused variable.
llvm-svn: 218844
2014-10-02 00:52:57 +00:00
Jim Ingham 5346f884da Add SBExecutionContext.cpp to this file as well, as the comment
in source/API/CMakeLists.txt instructs...

llvm-svn: 218837
2014-10-01 22:26:52 +00:00
Enrico Granata da0fd6d3ad Add documentation about the new SBExecutionContext for Python commands feature. This marks the end of rdar://18142728
llvm-svn: 218835
2014-10-01 21:53:32 +00:00
Enrico Granata 06be059ad9 Allow Python commands to optionally take an SBExecutionContext argument in case they need to handle 'where they want to act' separately from the notion of 'currently-selected entity' that is associated to the debugger. Do this in an (hopefully) non-breaking way by running an argcount check before passing in the new argument. Update the test case to also check for this new feature. www update to follow
llvm-svn: 218834
2014-10-01 21:47:29 +00:00
Todd Fiala ebcf42cdec thread state coordinator: added error callbacks, cleaned up tests.
ThreadStateCoordinator changes:
* Most commands that run in the queue now take an error handler that
  will be called with an error string if an error occurs during processing.
  Errors generally stop the operation in progress.  The errors are checked
  at time of execution.  This is intended to help flush out ptrace/waitpid/state management
  issues as quickly as possible.

* Threads now must be known to the coordinator before stops can be reported,
  resumes can be requested, thread deaths can be reported, or deferred stop
  notifications can be made.  Failure to know the thread will cause the coordinator
  to call the error callback for the event being processed.  Threads are introduced
  to the system by the NotifyThreadCreate method.
  
* The NotifyThreadCreate method now takes the initial state of the thread being
  introduces to the system.  We no longer just assume the thread is running.
  
The test cases were cleaned up, too:
* A gtest test fixture is now used, which allows creating less verbose helper
  methods that setup common pieces of callback code for some method invocations.
  Net result: the tests are simpler to read and shorter to write.

llvm-svn: 218833
2014-10-01 21:40:45 +00:00
Chandler Carruth b8a4ecb5d9 [cmake] Include the new file in the CMake lists. Without this every
CMake build of any part of LLVM with LLDB checked out fails immediately.
=[

We appear to not even have a build bot covering the CMake build of LLDB
which makes this truly terrible. That needs to be fixed immediately.

llvm-svn: 218831
2014-10-01 21:33:28 +00:00
Enrico Granata d1fd3ce42e Add an accessor to PyCallable that allows one to determine the count of arguments that a Python function allows, and whether varargs/kwargs are also accepted by the same function
llvm-svn: 218812
2014-10-01 20:51:50 +00:00
Enrico Granata e85e84a769 Add a new SBExecutionContext class that wraps an ExecutionContextRef. This class is a convenient way at the API level to package a target,process,thread and frame all together - or just a subset of those
llvm-svn: 218808
2014-10-01 20:43:45 +00:00
Todd Fiala e825f44761 thread state coordinator: replaced shortened type name Func suffix with Function.
ThreadIDFunc => ThreadIDFunction
LogFunc      => LogIDFunction

We try to avoid abbreviations/shortened names.  Adjusted function parameter names
as well to replace _func with _function.

llvm-svn: 218773
2014-10-01 16:08:20 +00:00
Todd Fiala 241ce99503 Minor tweak to Ed's FreeBSD fix.
Fall back to including the Linux version if not on __FreeBSD__.  Also covers
__ANDROID__ case.

llvm-svn: 218770
2014-10-01 15:10:37 +00:00
Ed Maste 81f59a09f2 Add a bandaid to fix the FreeBSD build
r218568 added an explicit #include of the Linux ProcessMonitor.h to
POSIXThread.cpp, rather than including just "ProcessMonitor.h" and
relying on the build infrastructure for the appropriate paths.

For now add #ifdefs in the source to use the FreeBSD or Linux header
as appropriate; a cleaner fix (and perhaps some refactoring of the
POSIX classes) should still be done later.

llvm-svn: 218762
2014-10-01 12:56:39 +00:00
Matthew Gardiner 2eb85898b2 Adding a test for k5 binaries
llvm-svn: 218754
2014-10-01 10:41:53 +00:00
Matthew Gardiner 60f9392eb7 Fix the kalimba arch 4 test, broken when I introduced handling
of kalimba architecture variants.

llvm-svn: 218749
2014-10-01 09:12:43 +00:00
Jim Ingham 89fd66813b Not all processes have a Dynamic Loader. Be sure to check that it exists before using it.
<rdar://problem/18491391>

llvm-svn: 218699
2014-09-30 20:33:25 +00:00
Jim Ingham 8d81bdf11f Add SBThreadPlan to this CMakeLists.txt as well.
llvm-svn: 218687
2014-09-30 17:11:53 +00:00
Todd Fiala 1f67ded0b2 thread state coordinator: add additional assert missing from previous test check-in.
llvm-svn: 218686
2014-09-30 17:00:52 +00:00
Zachary Turner 25cbf5aac6 Fix FreeBSD build.
llvm-svn: 218685
2014-09-30 16:56:56 +00:00
Zachary Turner c76a445279 Fixup some minor issues with HostProcess.
llvm-svn: 218684
2014-09-30 16:56:40 +00:00
Todd Fiala f8d929dc82 thread state coordinator: add test to be explicit about resume behavior in presence of deferred stop notification still pending.
There is a state transition that seems potentially buggy that I am capturing and
logging here, and including an explicit test to demonstrate expected behavior.  See new test
for detailed description.  Added logging around this area since, if we hit it, we
may have a usage bug, or a new state transition we really need to investigate.

This is around this scenario:
Thread C deferred stop notification awaiting thread A and thread B to stop.
Thread A stops.
Thread A requests resume.
Thread B stops.

Here we will explicitly signal the deferred stop notification after thread B
stops even though thread A is now resumed.  Copious logging happens here.

llvm-svn: 218683
2014-09-30 16:56:28 +00:00
Todd Fiala 8a3716bfab Fix cmake build for new thread plan files.
llvm-svn: 218679
2014-09-30 15:58:56 +00:00
Jim Ingham 2a057f872d Fix some errors that crept in when I cut & pasted into emacs.
llvm-svn: 218656
2014-09-30 01:37:52 +00:00
Jim Ingham 0fbf3af3dc Add a very trivial example for scripted stepping.
llvm-svn: 218650
2014-09-30 00:24:59 +00:00
Jim Ingham 2bdbfd50d2 This checkin is the first step in making the lldb thread stepping mechanism more accessible from
the user level.  It adds the ability to invent new stepping modes implemented by python classes,
and to view the current thread plan stack and to some extent alter it.

I haven't gotten to documentation or tests yet.  But this should not cause any behavior changes
if you don't use it, so its safe to check it in now and work on it incrementally.

llvm-svn: 218642
2014-09-29 23:17:18 +00:00
Todd Fiala 8b6fefb3a3 dwarf: add dwarf v4 maximum_operations_per_instruction to DWARFDebugLine.
See http://reviews.llvm.org/D5533 for details.

Change by Tong Shen.

llvm-svn: 218641
2014-09-29 23:11:09 +00:00
Todd Fiala e2109e7323 thread state coordinator: added a thread resume request and related tests.
The thread resume block is executed in the normal flow of thread
state queued event processing.  The tests verify that it is executed
when we track the thread to be stopped and skipped when we track
it to already be running.

llvm-svn: 218638
2014-09-29 22:57:05 +00:00
Todd Fiala 424723b281 thread state coordinator: add exec reset support, remove empty virtual destructors.
Also added a test for the reset handling.  The reset/state clearing happens
as a processed queue event.  The only diff vs. standard processing is that
the exec clears the queue before queueing the activity to clear internal state.
i.e. once we get an exec, we really stop doing any other queue-based activity.

llvm-svn: 218629
2014-09-29 21:45:21 +00:00
Matthew Gardiner f03e6d84bc Very minimal support 24-bit kalimbas. Vanilla "memory read" for data sections
works, as do breakpoints, run and pause, display zeroth frame.

See
http://reviews.llvm.org/D5503

for a fuller description of the changes in this commit.

llvm-svn: 218596
2014-09-29 08:02:24 +00:00
Matthew Gardiner e598d7b01d Included cstdarg for compilation of va_start and va_end.
llvm-svn: 218594
2014-09-29 07:12:47 +00:00
Todd Fiala 55a02a7478 thread state coordinator: added new thread support.
A new thread arriving while a pending signal notification
is outstanding will (1) add the new thread to the list of
stops expected before the deferred signal notification is
fired, (2) send a stop request for the new thread, and
(3) track the new thread as currently running.

llvm-svn: 218578
2014-09-28 06:50:47 +00:00
Todd Fiala cacde7df6d Enable llgs to build against experimental Android AOSP lldb/llvm/clang/compiler-rt repos.
See http://reviews.llvm.org/D5495 for more details.

These are changes that are part of an effort to support building llgs, within the AOSP source tree, using the Android.mk
build system, when using the llvm/clang/lldb git repos from AOSP replaced with the experimental ones currently in
github.com/tfiala/aosp-{llvm,clang,lldb,compiler-rt}.

llvm-svn: 218568
2014-09-27 16:54:22 +00:00
Todd Fiala ef5dbf55c8 thread state coordinator: added thread death support and more tests.
Tested two pending stops before notification, where one of the pending stop
requirements was already known to be stopped.

Tested pending thread stop before notification, then reporting thread with
pending stop died and verifies pending notification is made.

llvm-svn: 218559
2014-09-27 01:58:13 +00:00
Todd Fiala 9dd7334d69 thread state coordinator: added test for notify after two pending thread stops.
Glad I did - caught a bug where the auto variable was not a reference
to a set and instead was a copy.  I need to review rules on that!

llvm-svn: 218558
2014-09-27 01:11:17 +00:00
Todd Fiala e9c9e7070e thread state coordinator: handle when prerequisite pending stop is already stopped.
Change includes new gtest and functionality.

llvm-svn: 218555
2014-09-26 23:42:53 +00:00
Todd Fiala 80bef312b5 gtest: tweaked test runner to fix an extra comma, added more tdd-based thread coordinator behavior.
Starting to flesh out the thread state coordinator class that will be used
by Linux/llgs.

llvm-svn: 218537
2014-09-26 19:08:00 +00:00
Todd Fiala 4dcb6aded2 gtest: modified Xcode integration so gtest assert/expect failure now shows error content in the error marker at the line of failure.
This change modifies the python test runner to combine lines starting with a
failure report including up to 3 more lines, terminated by the next
"[  FAILED  ]" line.  These are all emitted on the same line as the file:line
indication, which allows Xcode's failure marker code to pick it up and display
it along with the error badge in the Xcode editor window.  Makes for a nice
gtest development experience.

llvm-svn: 218518
2014-09-26 12:58:25 +00:00
Todd Fiala f3a3fc5120 gtest: remove recursive make, add python driver + Xcode error hook-up.
This change does the following:
* Removes the gtest/Makefile recursive-make-based calling strategy
  for gtest execution.
* Adds the gtest/do-gtest.py call script.
  - This handles finding and calling the Makefiles that really
    run tests.
  - This script also transforms the test output into something
    that Xcode can place a failure marker on when a test fails.
* Modifies the Xcode external build command target for gtest.
  It now calls the gtest/do-gtest.py script.

There is still room for improvement on Xcode integration of
do-gtest.py.  Essentially the next several lines of error reporting
from the gtest output should be coalesced into a single line so that
Xcode can tell more about the error directly in the editor.  Right now
it just puts a red mark and says "failure" but doesn't give any
details.

llvm-svn: 218470
2014-09-25 22:12:33 +00:00
Todd Fiala b3185e710e Fixup gtest layout, add Linux ThreadStateCoordinator.cpp.
This change does the following:
* Remove test/c++/...
* Add gtest.
* Add gtest/unittest directory for unittesting individual classes.
* Add an initial Plugins/Process?linux/ThreadStateCoordinatorTest.cpp.
  - currently failing a test (intentional).
  - added a bare-bones ThreadStateCoordinator.cpp to Plugins/Process/Linux,
    more soon. Just enough to prove out running gtest on Ubuntu and MacOSX.
* Added recursive make machinery so that doing a 'make' in gtest/ is
  sufficient to kick off the existing test several directories down.
  - Caveat - I currently short circuit from gtest/unittest/Makefile directly to
    the one and only gtest/unittest/Plugins/Process/Linux directory.  We'll need
    to add the intervening layers.  I haven't done this yet since to fix the
    Xcode test failure correspondence, I may need to add a python layer which
    might just handle the directory crawling.
* Added an Xcode project to the lldb workspace for gtest.
  - Runs the recursive make system in gtest/Makefile.
  - Default target is 'test'.  test and clean are supported.
  - Currently does not support test failure file/line correspondence.
    Requires a bit of text transformation to hook that up.

llvm-svn: 218460
2014-09-25 19:25:07 +00:00
Todd Fiala e15fcaa2e5 Moved PlatformDarwin::GetEnvironment() to PlatformPOSIX to fix Linux/llgs issue.
See http://reviews.llvm.org/D5486 for more details.

I was tracking a problem where llgs on linux would not pick up any environment variables. On OSX there is a virtual function PlatformDarwin::GetEnvironment() which correctly sets up the list of environment variables. On linux llgs it defaults to a base class default implementation which clears the list.

I moved the OSX implementation down to PlatformPOSIX. This fixes my problem on linux still works properly on OSX.

Change by Shawn Best.
Slight tweak to convert 'virtual' to 'override' in PlatformDarwin.h virtual method override by Todd.

Tested:
Ubuntu 14.04 x86_64, cmake/ninja build + tests.
MacOSX 10.9.5 x86_64, Xcode 6.1 Beta build + tests.

llvm-svn: 218424
2014-09-24 23:10:30 +00:00
Todd Fiala f502d72d4e The beginnings of a gtest-based test framework.
Makes use of LLVM gtest support.  This does *not* run as part of
the lldb test suite.

I'm using it to start testing some components that
I'll be adding to the inner guts of NativeThreadLinux to more
maintainably handle thread states and deferred thread state notification.

Runs with default Makefile target "test" using gmake within a given
test directory (currently only test/c++/native_process/thread_state_coordinator).

The Makefile.rules currently assume it is using the LLVM gtest.  It works on
a canonical MacOSX dir structture (i.e. lldb, lldb/llvm, lldb/llvm/tools/clang).
It also works on Ubuntu assuming the standard dir layout of llvm, llvm/tools/clang,
llvm/tools/lldb.  In this case, it expects a directory called build-debug parallel
to the llvm source dir.  All directory assumptions can be overridden with
environment variables.  See test/c++/make/Makefile.rules for details.

We'll want to make this smarter in the future, particularly around finding the LLVM build
output dir.

llvm-svn: 218422
2014-09-24 22:57:33 +00:00
Enrico Granata 5e35cf9dcc Add an explicit cast to silence compiler warning here
llvm-svn: 218410
2014-09-24 20:52:58 +00:00
Todd Fiala ad6eee6399 Change inline-breakpoint-strategy setting to default to eInlineBreakpointsAlways strategy.
See thread started here for motivation:
http://lists.cs.uiuc.edu/pipermail/lldb-dev/2014-September/005225.html

This change enables the ability to set breakpoints in ccache-based and executables that
make use of preprocessed source files.  This ability existed in lldb before, but was off
by default.

Change by Doug Snyder.

llvm-svn: 218405
2014-09-24 19:59:13 +00:00
Enrico Granata a540496e6f These APIs were defined in the .h file, but never actually implemented. Just get rid of them
llvm-svn: 218396
2014-09-24 17:57:11 +00:00
Todd Fiala d5635cdd7f Adjust to LLVM JIT API change
Those wrapper functions seems not used by lldb... Removed

Reference for

replacing JITMemoryManager with SectionMemoryManager
replacing "llvm::JITMemoryManager::CreateDefaultMemManager()" with "new llvm::SectionMemoryManager()"
http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-jitlistener/llvm-jitlistener.cpp?r1=218316&r2=218315&pathrev=218316

Change by Tong Shen.

Tested:
Ubuntu 14.04 x86_64
MacOSX 10.9.5 with Xcode Version 6.1 (6A1030) (Beta)

llvm-svn: 218383
2014-09-24 15:55:47 +00:00
Zachary Turner acee96ae52 Fix up the HostThread interface, making the interface simpler.
Reviewed by: Greg Clayton
Differential Revision: http://reviews.llvm.org/D5417

llvm-svn: 218325
2014-09-23 18:32:09 +00:00
Kuba Brecka 9d28cf5609 Add ASan history threads into process_sp->GetExtendedThreadList, so they don't get freed too early
Reviewed at http://reviews.llvm.org/D5452

llvm-svn: 218323
2014-09-23 18:20:24 +00:00
Todd Fiala 5bc56a4b34 android: add a command script to help display mixed Java/native backtraces.
This script supports displaying developer-focused backtraces when working
with mixed Java and C/C++ stack frames within lldb.  On Android, this represents
just about every app, since all apps start in Java code.

The script currently supports the Art JVM when run on host-side x86_64 and x86,
but does require a patch not yet accepted in AOSP:
AOSP patch: https://android-review.googlesource.com/#/c/106523/

The backtraces will hide Art VM machinery for interpreted and AOT code
and display the Java file/line numbers for Java code, while displaying
native backtrace info for native frames.  Effectively the developer will
get an app-centric view of the call stack.

This script is not yet tested on device-side Art nor is it tested on
any architecture other than x86_64 or x86 32-bit.  Several changes were
needed on the AOSP side to enable it to work properly for x86_64 and x86, 
so it is quite likely we'll need to do something similar for other cpu
architectures as well.

Change by Tong Shen

llvm-svn: 218315
2014-09-23 16:28:01 +00:00
Jason Molenda f6a4258020 ConnectionFileDescriptor::Connect()'s handling of the "fd://" method
was broken in r214984 by the addition of an unconditional error
return at the start of the code block handling this method.  Remove
the errant lines.
<rdar://problem/18416691> 

llvm-svn: 218291
2014-09-23 02:43:35 +00:00
Greg Clayton 994ba64756 Played around with TK UI a bit this weekend.
If you "command script import" this file, then you will have two new commands:

(lldb) tk-variables
(lldb) tk-process

Not sure how this will work on all other systems, but on MacOSX, you will get a window with a tree view that allows you to inspect your local variables by expanding variables to see the child values.

The "tk-process" allows you to inspect the currently selected process by expanding the process to see the threads, the threads to see the frames, and the frames to see the variables. Very handy if you want to view variables for all frames simultaneously.

llvm-svn: 218279
2014-09-22 22:06:41 +00:00
Ed Maste da7c5b253f Enable libcxx map test on FreeBSD again
The test used to trigger an assertion failure "Cannot get layout of
forward declarations!", but it no longer fails when built with
Clang 3.4.1 (system compiler) or 3.5 from SVN on FreeBSD.

llvm.org/pr17231

llvm-svn: 218196
2014-09-21 02:24:01 +00:00
Todd Fiala 21130fbc04 Fix lldb-gdbserver build.
Build break change by Paul Osmialowski.

Minor changes to argument passing (converted unintentional pass-by-value to pass-by-ref) by Todd.

llvm-svn: 218186
2014-09-20 17:34:48 +00:00
Jason Molenda e59b0d2c48 Have CommandObject::CheckRequirements() report the largest missing
requirement for a command instead of the smallest.  e.g. if a command
requires a Target, Process, Thread, and Frame, and none of those
are available, report the largest -- Target -- as being missing
instead of the smallest -- Frame.

Patch by Paul Osmialowski.

llvm-svn: 218181
2014-09-20 09:14:31 +00:00
Jim Ingham 16ebdd6c1b Fix a thinko in how the RemoteiOS Platform looked up files in the SDK & other
platform locations.  We didn't always do an exhaustive search through all the 
platform locations, so we would have to read some files out of memory even though
they existed in the exploded shared cache or SDK.

<rdar://problem/18385947>

llvm-svn: 218157
2014-09-19 21:58:45 +00:00
Jim Ingham 03d1730aad We had to squirrel away the dyld module before doing ResolveExecutableModule, since
that would clear the module list, and then put it back by hand.  But we forgot to 
also put its sections back in the target SectionList, so we would jettison it as
unloaded when we finished handling the first real load event.  Add its sections.

<rdar://problem/18385947>

llvm-svn: 218156
2014-09-19 21:56:45 +00:00
Zachary Turner 4171da5cfe Make sure to #include <atomic> when using std::atomic.
llvm-svn: 218148
2014-09-19 20:12:32 +00:00
Carlo Kok b77aba7708 Fix for 218140 for SBTarget.i, the added functions were in the wrong class definition
llvm-svn: 218147
2014-09-19 20:12:24 +00:00
Greg Clayton 615eb7e609 Test suite runs better again after recent fixes that would select a platform if a "file a.out" auto selected a different platform than the selected one.
Changes include:
- fix it so you can select the "host" platform using "platform select host"
- change all callbacks that create platforms to returns shared pointers
- fix TestImageListMultiArchitecture.py to restore the "host" platform by running "platform select host"
- Add a new "PlatformSP Platform::Find(const ConstString &name)" method to get a cached platform
- cache platforms that are created and re-use them instead of always creating a new one

llvm-svn: 218145
2014-09-19 20:11:50 +00:00
Carlo Kok 0fd6fd4fd4 Adds two new functions to SBTarget FindGlobalVariables and FindGlobalFunctions that lets you search by name, by regular expression and by starts with.
llvm-svn: 218140
2014-09-19 19:38:19 +00:00
Todd Fiala 850f9a25a5 Fix typo in Linux ASLR logging.
llvm-svn: 218133
2014-09-19 18:27:45 +00:00
Enrico Granata 47caf9a956 Extend the member function discovery APIs to also support Objective-C as well as C++
For the Objective-C case, we do not have a "function type" notion, so we actually end up wrapping the clang ObjCMethodDecl in the Impl object, and ask function-y questions of it
In general, you can always ask for return type, number of arguments, and type of each argument using the TypeMemberFunction layer - but in the C++ case, you can also acquire a Type object for the function itself, which instead you can't do in the Objective-C case

llvm-svn: 218132
2014-09-19 18:21:05 +00:00
Greg Clayton ee3be91995 Add some tests to be skipped when run remotely and also fixed a test to be more reliable when it comes to stopping on a specific line.
llvm-svn: 218079
2014-09-18 21:32:05 +00:00
Todd Fiala 87bac59adc llgs: removed some wait-for-stop code in inferior process launch pipeline.
The $A handler was unnecessarily waiting for the launched app to hit a stop
before returning.  Removed this code.

Renamed the llgs inferior launching code to LaunchProcessForDebugging ()
to prevent it from possibly being mistaken as code that lldb-platform uses
to launch a debugserver process.  We probably want to look at breaking out
llgs-specific and lldb-platform-specific code into separate derived classes,
with common code in a shared base class.

llvm-svn: 218075
2014-09-18 21:02:03 +00:00
Greg Clayton 109534cb59 Fix the ability of "lldb-platform" to upload files.
The issue was GDBRemoteCommunication::CheckForPacket() already fixes up any prefixed bytes (0x7d followed by value that is XOR'ed with 0x20). If we do this again, we cause binary packets to lose bytes.

This allows lldb-platform to be able to upload binaries and debug them remotely.

llvm-svn: 218002
2014-09-18 00:20:51 +00:00
Greg Clayton 44272a40dc Hex encode the triple values in case they contain special characters.
llvm-svn: 218001
2014-09-18 00:18:32 +00:00
Greg Clayton 7e2443258f Add better logging for the "$vFile:pwrite:" packet so we can show binary data instead of nothing or unprintable characters. This can easily be extended for other packets that have binary data.
llvm-svn: 218000
2014-09-18 00:17:36 +00:00
Greg Clayton 90d9a35ff1 Listen to the return value of the Platform::WriteFile() call within PlatformPOSIX::PutFile() in case we write less than we wanted to. Also adjust the input stream's offset in such cases.
llvm-svn: 217999
2014-09-18 00:16:13 +00:00
Greg Clayton 56bf559253 Retry remote connection one time in case of timeout and return an error that specifies why debugging failed.
llvm-svn: 217998
2014-09-18 00:14:38 +00:00
Greg Clayton 95bbdf6428 If a new platform is created/selected for an architecture, make it the selected platform so you can do things like:
% lldb ios-executable
(lldb) platform connect connect://localhost:11111

Prior to this fix, the host platform would be selected even though the target was using the ios-remote platform.

llvm-svn: 217963
2014-09-17 16:42:50 +00:00
Ed Maste def0dae250 Build lldb-mi on all platforms with Makefile builds
CMake builds already do so.

llvm-svn: 217931
2014-09-17 00:28:31 +00:00
Enrico Granata 6389a7da08 More categories could be added, and having an explicit list in this test case is a fairly bullet-proof recipe for disaster. Use the * enabling feature to workaround this. Fixes rdar://18358649
llvm-svn: 217927
2014-09-16 22:53:30 +00:00
Greg Clayton e37df2e64b Fixed an issue where the last N load commands in the mach-o core file would not be read in where N was the number of LC_THREAD load commands.
I now properly increment the ncmds for each LC_THREAD and now core files are saved correctly.

<rdar://problem/18312703> 

llvm-svn: 217905
2014-09-16 20:50:29 +00:00
Enrico Granata ba4b788ae7 Unused functions break the -Werror build. Revert for now.
llvm-svn: 217900
2014-09-16 20:28:26 +00:00
Enrico Granata 438aba6fdd Add a convenience function to FormatManager to setup an empty filter (one that suppresses all children, that is)
llvm-svn: 217891
2014-09-16 17:41:54 +00:00
Enrico Granata 2267ad442a Change the ClangASTMap implementation to use a thread-safe wrapper over llvm::DenseMap. This helps avoid a certain class of spins per <rdar://problem/18160764>
llvm-svn: 217888
2014-09-16 17:28:40 +00:00
David Majnemer 8faf9370fa Clean-up warnings on Linux/GCC
llvm-svn: 217862
2014-09-16 06:34:29 +00:00
Greg Clayton 48e17578ed Continuation broken for Python scripts when using non-interactive input (Xcode for example).
The problem was the read_func we were supplying to the interactive interpreter wasn't stripping the newline from the end of the string. Now it does and multi-line python scripts can be typed in Xcode.

<rdar://problem/17696438>

llvm-svn: 217843
2014-09-15 22:46:25 +00:00
Todd Fiala fbd703add5 ELF: store the thumbness of a function in symbol flags.
This allows us to fixup the address of the symbol as soon as we parse it
so that lldb is not confused thinking there are two different symbols in
the binary (one with the thumb bit, one without). Also, differentiating
between THUMB and ARM symbols allows the debugger to place the right
type of breakpoint.

Change by Stephane Sezer.

llvm-svn: 217841
2014-09-15 22:33:39 +00:00
Enrico Granata 6c42cb11d6 Change SBType.GetMemberFunctionAtIndex() to return an object describing the member function in more detail. A type was really quite vague. This now has function name, kind, as well as function type
llvm-svn: 217828
2014-09-15 21:30:36 +00:00
Todd Fiala 7b0917a0c5 use std::atomic<> to protect variables being accessed by multiple threads
There are several places where multiple threads are accessing the same variables simultaneously without any kind of protection. I propose using std::atomic<> to make it safer. I did a special build of lldb, using the google tool 'thread sanitizer' which identified many cases of multiple threads accessing the same memory. std::atomic is low overhead and does not use any locks for simple types such as int/bool.

See http://reviews.llvm.org/D5302 for more details.

Change by Shawn Best.

llvm-svn: 217818
2014-09-15 20:07:33 +00:00
Todd Fiala 49bc2d9dd3 Fix JITLoaderGDB for 64-bit host and 32-bit target
There are target pointer members in struct jit_code_entry and jit_descriptor.

Data layout of those structures should be decided by target, not host.

This fixes JITLoaderGDB for 64-bit host and 32-bit target.

See http://reviews.llvm.org/D5339 for more details.

Change by Tong Shen.

llvm-svn: 217816
2014-09-15 19:55:27 +00:00
Enrico Granata 735152e3b0 Add a --help (-h) option to "command script add" that enables users to define a one-liner short help for their command
Also, in case they don't define any, change the default from "Run Python function <blah>" into "For more information run help <blah>"

The core issue here is that Python only allows one docstring per function, so we can't really attach both a short and a long help to the same command easily
There are alternatives but this is not a pressing enough concern to go through the motions quite yet

Fixes rdar://18322737

llvm-svn: 217795
2014-09-15 17:52:44 +00:00
Todd Fiala 0fceef8065 lldb fix ARM64 register access - llgs side
See http://reviews.llvm.org/D5341 for more details.

Change by Paul Osmialowski.

llvm-svn: 217788
2014-09-15 17:09:23 +00:00
Todd Fiala 1a08866aab Handle ARM ELF symbols properly: skip $t* and $a* symbols in ObjectFileELF.
ELF objects contain marker symbols to differentiate between ARM and
THUMB functions. Instead of storing them internally and having garbage
show up when symbols are searched for by the user, we can just skip them
and not store them at all, as we never actually need them.

Change by Stephane Sezer.

Tested:
Ubuntu 14.04 x86_64
MacOSX 10.9.4 x86_64

llvm-svn: 217782
2014-09-15 16:27:44 +00:00
Todd Fiala 3daa176986 Properly decode architecture type in GDBRemoteCommunicationClient::GetCurrentProcessInfo.
Instead of forcing the remote arch type to MachO all the time, we
inspect the OS/vendor that the remote debug server reports and use it to
set the arch type to MachO, ELF or COFF accordingly.

See thread here for more context:
http://lists.cs.uiuc.edu/pipermail/lldb-commits/Week-of-Mon-20140915/012968.html

Change by Stephane Sezer.

Tested:
MacOSX 10.9.4 x86_64
Ubuntu 14.04 x86_64

llvm-svn: 217779
2014-09-15 16:01:29 +00:00
Todd Fiala 5c9d5bf81e Check for byte order correctness in GDBRemoteCommunicationClient::GetCurrentProcessInfo.
This is useful for checking inconsistencies between what the remote debug server thinks we are debugging and we think we are debugging. This follows the check for pointer byte size done just above.

Change by Stephane Sezer.

Tested:
Ubuntu 14.04 x86_64, llvm-3.5-built lldb
MacOSX 10.9.4, Xcode-Beta(2014-09-09)-built lldb.

llvm-svn: 217773
2014-09-15 15:31:11 +00:00
Todd Fiala b82ad2a8b8 Fix build break in Xcode build of lldb-tool.
llvm-svn: 217772
2014-09-15 15:17:13 +00:00
Ed Maste 279ebe2ded Correct typo in tutorial page
llvm-svn: 217733
2014-09-14 00:56:13 +00:00
Jim Ingham ead45ccc2c Nope, I was right originally. ResolveUsername should resolve "~" to the
current user, and ResolvePartialUsername will resolve "~" to the list of
users.

llvm-svn: 217723
2014-09-12 23:50:36 +00:00
Jim Ingham 1adba8b6e3 Don't make paths with /Foo//bar, that confuses everybody down the line.
This gets the file completer for absolute paths working again.

llvm-svn: 217722
2014-09-12 23:39:38 +00:00
Zachary Turner cf3f3683f8 Fix incorrect initializer list style.
llvm-svn: 217721
2014-09-12 23:10:33 +00:00
Jim Ingham 2f21bbc804 Revert 217719, that wasn't the right fix, that should complete user names, and
anyway /Vol doesn't complete correctly either.  Somehow we're chopping the names
up incorrectly before passing them into the completer.

llvm-svn: 217720
2014-09-12 23:04:40 +00:00
Jim Ingham 2614db1a13 ResolveUsername should resolve "~" to the user's home directory as well as "~/". This
gets command-line file completion from ~ working again.

llvm-svn: 217719
2014-09-12 22:59:05 +00:00
Enrico Granata 7506dc06f4 std::function is a better choice than a raw function pointer here. You probably still want to be careful about cleaning up stuff you captured, but it's not like a function pointer wasn't going to let you shoot yourself in the foot given enough dedication.
llvm-svn: 217718
2014-09-12 22:56:52 +00:00
Todd Fiala 7206c6d11f llgs: fix thread names broken by recent native thread changes.
* Fixes the local stack variable return pointer usage in NativeThreadLinux::GetName().
* Changes NativeThreadProtocol::GetName() to return a std::string.
* Adds a unit test to verify thread names don't regress in the future.  Currently only run on Linux since I know default thread names there.

llvm-svn: 217717
2014-09-12 22:51:49 +00:00
Zachary Turner 44e442b3df Make ProcessLaunchInfo copyable.
llvm-svn: 217714
2014-09-12 22:38:39 +00:00
Enrico Granata 190064ad0d Add logic to LLDB to figure out the types of member functions of C++ classes. Add plumbing for that all the way up to the SB layer
llvm-svn: 217701
2014-09-12 18:45:43 +00:00
Todd Fiala 49131cfd2e lldb fix ARM64 register access
Apparently, PEEKUSER/POKEUSER is something x86 specific, so I had to rework it for AArch64. This fixes assertion that occurs whenever lldb started on AArch64 device tried to read PC register (or any other register)

See http://reviews.llvm.org/D5232 for more details.

Change by Paul Osmialowski.

llvm-svn: 217691
2014-09-12 16:57:28 +00:00
Deepak Panickal 428ab6e0ff Fix lldb-mi driver for running on OSX.
llvm-svn: 217668
2014-09-12 12:17:21 +00:00
Deepak Panickal 7337ae55fa Fix OSX CMake build
llvm-svn: 217667
2014-09-12 12:15:11 +00:00
Jason Molenda e6481c7e0f Fix the ctor ivar initialization formatting for Debugger,
TypeValidatorImpl, FileAction, and ProcessLaunchInfo to match the
lldb coding convention.

llvm-svn: 217653
2014-09-12 01:50:46 +00:00
Enrico Granata 340fa53411 Recent builds of libcxx actually wrap an std::map's children values in a union containing either a member named __cc, or either of __cc and __nc (const vs. non-const). This level of wrapping is quite useless for LLDB to show to people, so try to detect it, and filter it out
llvm-svn: 217651
2014-09-12 00:55:37 +00:00
Jason Molenda 59ac67e993 Change SystemRuntimeMacOSX::ReadLibdispatchTSDIndexes to use the
ProcessStructReader instead of reading the structure out of libdispatch
by hand.  I will convert more of the struct readers in SystemRuntimeMacOSX
over to use this class eventually.

llvm-svn: 217649
2014-09-12 00:09:04 +00:00
Todd Fiala 511e5cdce4 llgs: fix Ctrl-C inferior interrupt handling to do the right thing.
* Sends a SIGSTOP to the process.
* Fixes busted SIGSTOP handling.  Now builds a list of non-stopped
  that we wait for the PTRACE group-stop for.  When the final must-stop
  tid gets its group stop, we propagate the process state change.
  Only the signal receiving the notification of the pending SIGSTOP
  is marked with the SIGSTOP signal.  All the rest, if they weren't
  already stopped, are marked as stopped with signal 0.
* Fixes a few broken tests.
* Marks the Linux test I added earlier as expect-pass (no longer XFAIL).

Implements fix for http://llvm.org/bugs/show_bug.cgi?id=20908.

llvm-svn: 217647
2014-09-11 23:29:14 +00:00
Enrico Granata 13460a59fd Add a ProcessStructReader utility class to LLDB
The purpose of a ProcessStructReader is to allow intelligent reading of data from the underlying process
Traditionally, the way this has been handled is to have a load_address and shuffle it around, and use Process::ReadMemory()-kind APIs

With a ProcessStructReader one can define a clang type that matches exactly the definition of the thing they are trying to ingest from the inferior process, and then just point LLDB at where the data is
Since this work is done in terms of clang types, one can honor packed/aligned attributes, sizes of types on the inferior architecture, and similar tricky caveats without having to hardcode them

llvm-svn: 217644
2014-09-11 23:09:55 +00:00
Enrico Granata 42fa4af8fe When deciding if one-liner printing applies, and you find a summary, the summary is a good candidate to ask. While in theory one could want one-liner printing with a non-one-liner summary, I don't see LLDB as the best place to solve such inner conflicts
llvm-svn: 217641
2014-09-11 23:00:27 +00:00
Zachary Turner d40077839b Add missing constructor definition.
llvm-svn: 217634
2014-09-11 22:42:58 +00:00
Zachary Turner f5e4f37cb6 Update HostProcess to use the same facade pattern as HostThread.
llvm-svn: 217632
2014-09-11 22:22:16 +00:00
Zachary Turner 40a069adcd Fix Windows build.
* ssize_t isn't defined by default on Windows.
* New public API files need to be defined in a different file for
  Windows.

llvm-svn: 217624
2014-09-11 20:26:49 +00:00
Todd Fiala 65b3cff1f2 gdb-remote tests: added test to verify thread stop info when multi-threaded app is interrupted.
The Linux version is marked XFAIL for the moment, fixing next.

Related to http://llvm.org/bugs/show_bug.cgi?id=20908.

llvm-svn: 217613
2014-09-11 17:51:35 +00:00
Todd Fiala ee8bfc687f DWARF64 Fixes
1. DW_FORM_strp and DW_FORM_sec_offset are 64bits for DWARF64 / 32bits for DWARF32
They are different from DW_FORM_addr, whose size is specified in .debug_info

2. Bump DWARF version support form [2,3] to [2,4] in DWARFDebugLine.cpp

3. Fix DWARFDebugLine to support DWARF64

See http://reviews.llvm.org/D5307 for more details.
Reviewed by Greg Clayton and Jason Molenda.

Change by Tong Shen.

llvm-svn: 217607
2014-09-11 17:29:12 +00:00
Jim Ingham 77fd738f58 Rework how resetting breakpoints in changed modules works. Try to match up old
locations with new ones if possible.

Next up some test cases...

llvm-svn: 217551
2014-09-10 21:40:47 +00:00
Todd Fiala 1109ed4245 llgs: implement qThreadStopInfo.
This change implements this ticket:
http://llvm.org/bugs/show_bug.cgi?id=20899

Adds the qThreadStopInfo RSP command for llgs and includes a test that
verifies both debugserver and llgs respond with something reasonable
on a multithreaded app.

llvm-svn: 217549
2014-09-10 21:28:38 +00:00
Ed Maste 3b7382da74 Move FreeBSD's thread SetName implementation to ThisThread
SetName is only used in LLDB to set a thead's own name.  Move it there
to match OS X and Windows and slightly reduce the effort in any future
HostThread/ThisThread name refactoring.

llvm-svn: 217521
2014-09-10 17:09:46 +00:00
Ed Maste 3967764b98 Fix FreeBSD build after thread changes
More work on the GetName/SetName arguments (thread_t vs tid_t) is needed
but this change should restore the build and basic operation.

llvm-svn: 217502
2014-09-10 13:38:47 +00:00
Zachary Turner f76da3469d Include the correct headers for kinfo_proc on FreeBSD.
llvm-svn: 217464
2014-09-09 22:39:56 +00:00
Zachary Turner 9daf1a6c00 Try to fix the FreeBSD build.
llvm-svn: 217462
2014-09-09 22:11:10 +00:00
Zachary Turner 39de311071 Create a HostThread abstraction.
This patch moves creates a thread abstraction that represents a
thread running inside the LLDB process.  This is a replacement for
otherwise using lldb::thread_t, and provides a platform agnostic
interface to managing these threads.

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

Reviewed by: Jim Ingham

llvm-svn: 217460
2014-09-09 20:54:56 +00:00
Eric Christopher 5c91d5c17a Add a comment explaining why we're casting the local
variable.

llvm-svn: 217456
2014-09-09 19:26:45 +00:00
Eric Christopher 9ad8394e3b Quiet unused variable warning that only occurs
when compiling optimized.

llvm-svn: 217429
2014-09-09 08:57:33 +00:00
Eric Christopher fbb0628dc3 Remove the -Wno-unused-function option. We are clean
with -Wunused-function as far as I can tell.

llvm-svn: 217428
2014-09-09 07:49:15 +00:00
Eric Christopher 52dc3c8521 Fix comment and remove duplicated -Wno-sign-compare option.
llvm-svn: 217426
2014-09-09 07:11:52 +00:00
Eric Christopher 94c13b5779 Remove unused class variable and its initialization.
llvm-svn: 217425
2014-09-09 06:37:18 +00:00
Eric Christopher fa0f79207c Remove a pair of default values from fully covered switches.
llvm-svn: 217424
2014-09-09 06:35:14 +00:00
Eric Christopher e551d183db Add a newline to the end of the file.
llvm-svn: 217423
2014-09-09 06:32:02 +00:00
Eric Christopher db1c183422 Compare against the right size integer.
llvm-svn: 217422
2014-09-09 06:30:09 +00:00
Eric Christopher 13f091af85 Remove two default cases out of fully covered switches.
llvm-svn: 217421
2014-09-09 06:26:36 +00:00
Eric Christopher 2af274e675 Remove two unused class variables.
llvm-svn: 217420
2014-09-09 06:20:57 +00:00
Eric Christopher f0e65fc501 Remove unused class variable and update all callers/users.
llvm-svn: 217419
2014-09-09 06:14:23 +00:00
Eric Christopher 34b122fa27 Fix -Werror,-Wcovered-switch-default warning in DWARFExpression
as part of an attempt to get lldb building inside llvm with -Werror
enabled.

llvm-svn: 217418
2014-09-09 06:03:28 +00:00
Keno Fischer a89da49ee7 Add back a return that got lost in rebase
llvm-svn: 217415
2014-09-09 04:56:16 +00:00
Keno Fischer 15d5e2b4d8 Fix configure & make build with python disabled
This makes sure that nothing that requires Python is being built
when the LLDB_DISABLE_PYTHON flag is being passed in.
It also changes a use of CPPFLAGS to CPP.Flags since the former is overridden
when external flags are passed in while the later is not. I'm not sure exactly
why LLDB_DISABLE_PYTHON is in CXXFLAGS rather than CPPFLAGS,
but cleaning that up is for another commit.

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

llvm-svn: 217414
2014-09-09 04:52:37 +00:00
Saleem Abdulrasool 82944983b4 DataFormatters: add missing destructor implementation
The last of the missing symbols to correct the make based build to restore the
FreeBSD buildbot!

llvm-svn: 217394
2014-09-08 18:26:57 +00:00
Kuba Brecka ea65e37bee Fix test failure for test/functionalities/connect_remote/TestConnectRemote.py when port 12345 is already in use
Reviewed at http://reviews.llvm.org/D5221

llvm-svn: 217388
2014-09-08 17:06:54 +00:00
Todd Fiala 3d3e2c72ec Modify call-function and rdar-12437442 tests to clean up all files produced during test run.
llvm-svn: 217387
2014-09-08 16:44:17 +00:00
Todd Fiala 6a2f62cbd3 Linux/FreeBSD local debugging: allow redirection to pts for POSIX process.
See http://reviews.llvm.org/D5135 for more details.

Change by Zephyr Zhao.

llvm-svn: 217382
2014-09-08 15:57:14 +00:00
Saleem Abdulrasool a787422158 remove a couple of default cases from switches
This cleans up a couple of warnings [-Wcovered-switch-default] from the build by
removing the default case from a couple of switches which are fully covered.
This is generally better as it will help identify when a new item is added to
the enumeration but the use sites are not updated.

llvm-svn: 217376
2014-09-08 14:59:36 +00:00
Saleem Abdulrasool 96a60f8e7d DataFormatters: add missing function implementations
This adds a definition for the TypeValidatorImpl_CXX destructor.  Because the
destructor is first virtual method, and declared out-of-line, it also serves as
the key function.  Since no definition was present, no virtual table for
TypeValidatorImpl_CXX was emitted, which results in link failures due to
references to undefined symbols.

Also add a definition for a TypeValidatorImpl contructor which was declared
out-of-line and referenced in a constructor for TypeValidatorImpl_CXX.

llvm-svn: 217375
2014-09-08 14:59:33 +00:00
Saleem Abdulrasool 73cdaed9a8 build: attempt to fix the buildbots
Linking Release+Asserts executable lldb-gdbserver (without symbols)
liblldb.so: undefined reference to `lldb_private::MemoryHistoryASan::Initialize()'
liblldb.so: undefined reference to `lldb_private::MemoryHistoryASan::Terminate()'
liblldb.so: undefined reference to `vtable for lldb_private::TypeValidatorImpl_CXX'
liblldb.so: undefined reference to `lldb_private::TypeValidatorImpl::TypeValidatorImpl(lldb_private::TypeValidatorImpl::Flags const&)'

liblldb.so underlinked to lldbPluginMemoryHistoryASan.a when building with the
make based build system (as opposed to CMake).

llvm-svn: 217360
2014-09-08 04:53:03 +00:00
Saleem Abdulrasool 9e5b49831c driver: handle write error better
We would previously simply assume that the write would always succeed.  However,
write(2) may return -1 for error as well as fail to perform a complete write (in
which case the returned number of bytes will be less than the requested bytes).

Explicitly check if an error condition is encountered.  This would previously
not be caught as we default initialized success to true.  Add an assertion that
we always perform a complete write (a continuous retry could be added to ensure
that we finish writing completely).

This was caught by GCC's signed comparison warning and manual inspection.

llvm-svn: 217355
2014-09-08 02:47:13 +00:00
Saleem Abdulrasool 1f652ed4a8 DataFormatters: use include instead of import in C++
'#import' is an Objective-C construct; avoid using it in C++.  NFC.

Addresses PR20867.

Patch by Kevin Avila!

llvm-svn: 217340
2014-09-07 18:33:44 +00:00
Ed Maste 47a8a5e9fb Correct copied error message
Patch by Remco Verhoef.

llvm-svn: 217312
2014-09-06 11:29:08 +00:00
Enrico Granata 0f883ffbdb Add a -V <bool> flag to frame variable/expression that enables execution of type validators. The jury is still out on what the user experience of type validators should be, so for now gate it on a specific flag. The mode I am using is prefix variables that fail to validate with a bang, and then emitting the actual validation error on a separate line. Of course, given the total absence of validators, this should never actually happen to you
llvm-svn: 217303
2014-09-06 02:20:19 +00:00
Eric Christopher d650b82b22 The original jit no longer exists in llvm, remove from dependencies.
PR20864

llvm-svn: 217301
2014-09-06 02:03:06 +00:00
Kuba Brecka a51ea3822a Implement ASan history threads in SB API
Reviewed at
http://reviews.llvm.org/D5219
and
http://lists.cs.uiuc.edu/pipermail/lldb-commits/Week-of-Mon-20140901/012809.html

llvm-svn: 217300
2014-09-06 01:33:13 +00:00
Enrico Granata edc4414094 Expose the ability to retrieve the result of a type validator via the SB API. To keep it simple, do not expose the pair, but just return a NULL string for success, and a non-NULL string for error; If we were to decide to expose the pair, we would need an SBTypeValidatorResult, which is fine, but it should come as part of exposing type validators through the SB API rather than as a one-off thing. So, KISS for now
llvm-svn: 217299
2014-09-06 01:30:04 +00:00
Kuba Brecka aaa0b81a4e Fix CMake configuration (forgot to add a file in the last commit).
llvm-svn: 217297
2014-09-06 01:22:55 +00:00
Kuba Brecka a5ea1e2b6c Expose ThreadCollection in SB API
Reviewed at
http://reviews.llvm.org/D5218
and
http://lists.cs.uiuc.edu/pipermail/lldb-commits/Week-of-Mon-20140901/012828.html

llvm-svn: 217296
2014-09-06 01:21:19 +00:00
Todd Fiala cefdbdf2fe Added logging of the POSIX-DYLD rendezvous address (i.e. the info_location address)
llvm-svn: 217287
2014-09-05 22:28:40 +00:00
Todd Fiala c82f650a2b Add more logging to DynamicLoaderPOSIXDYLD, especially around rendezvous handling.
Covers more of the behavior of rendezvous breakpoint handling and other
dynamic loader aspects, all on the 'enable log lldb dyld' log channel.

llvm-svn: 217283
2014-09-05 22:01:04 +00:00
Enrico Granata 744794aa96 Start plumbing the type validator logic through to the ValueObjects; allow a ValueObject to have a validator, to update it from the FormatManager, and to retrieve (and cache) the result of the validation
llvm-svn: 217282
2014-09-05 21:46:22 +00:00
Todd Fiala 4bce548a6b Add TypeValidator.cpp to cmake build.
llvm-svn: 217280
2014-09-05 21:23:09 +00:00
Enrico Granata c582713ce6 Introduce the notion of a "type validator" formatter
Type Validators have the purpose of looking at a ValueObject, and making sure that there is nothing semantically wrong about the object's contents
For instance, if you have a class that represents a speed, the validator might trigger if the speed value is greater than the speed of light

This first patch hooks up the moving parts in the formatters subsystem, but does not link ValueObjects to TypeValidators, nor lets the SB API be exposed to validators
It also lacks the notion of Python validators

llvm-svn: 217277
2014-09-05 20:45:07 +00:00
Reid Kleckner e89756f32a Fix CMake configuration
llvm-svn: 217273
2014-09-05 20:11:22 +00:00
Kuba Brecka e4d4801c3a [lldb] Abstract a superclass for a generic thread container.
Reviewed at
http://reviews.llvm.org/D5200
and
http://lists.cs.uiuc.edu/pipermail/lldb-commits/Week-of-Mon-20140901/012799.html

llvm-svn: 217269
2014-09-05 19:13:15 +00:00
Todd Fiala bc5353a83c Properly handle the DYLD attach step for GDB remotes.
Change by Stephane Sezer.

llvm-svn: 217253
2014-09-05 15:06:16 +00:00
Todd Fiala 0cc371c166 Set the process vendor in GDBRemoteCommunicationClient::GetCurrentProcessInfo.
Change by Stephane Sezer.

llvm-svn: 217252
2014-09-05 14:56:13 +00:00
Todd Fiala 0ee56ce640 Add error report when Module::GetObjectFile() fails to find a plugin to open an object file.
Change by Stephane Sezer.

llvm-svn: 217251
2014-09-05 14:48:49 +00:00
Todd Fiala ebecb38d47 Fix up lldb build for llvm r217172.
Changes reference to 4th element in version_min_command from reserved to sdk.

llvm-svn: 217185
2014-09-04 19:31:52 +00:00
Todd Fiala dbec1ff42a Fix build break on Ubuntu 12.04 with ARM64 changes.
See http://llvm.org/bugs/show_bug.cgi?id=20824 for more details.

Tested:
Ubuntu 12.04 x86_64, gcc-4.9.1-built lldb
Ubuntu 14.04 x86_64, clang-3.5-build lldb

llvm-svn: 217169
2014-09-04 16:08:20 +00:00
Todd Fiala 6ce8fef458 Use the process' ReadCStringFromMemory from DYLDRendezvous::ReadStringFromMemory.
Tested:
Ubuntu 14.04 x86_64, clang-3.5-built lldb.
MacOSX 10.9.4, Xcode6-Beta7-built lldb.

Visual packet inspection on lldb <-> llgs shows significant reduction in overly-verbose
memory read traffic on start-up when scanning shared library info.

Change by Stephane Sezer.

llvm-svn: 217153
2014-09-04 14:16:19 +00:00
Kuba Brecka beed821ffb ASan malloc/free history threads
Reviewed at http://reviews.llvm.org/D4596

llvm-svn: 217116
2014-09-04 01:03:18 +00:00
Han Ming Ong cd2d797a79 rdar://problem/18221417
Include compressed memory as part of gauge memory.

llvm-svn: 217084
2014-09-03 22:33:37 +00:00
Jason Molenda f0340c9ab5 Add a new target.process.memory-cache-line-size to change the size of
lldb's internal memory cache chunks that are read from the remote
system.  For a remote connection that is especially slow, a user may
need to reduce it; reading a 512 byte chunk of memory whenever a
4-byte region is requested may not be the right decision in these
kinds of environments.
<rdar://problem/18175117> 

llvm-svn: 217083
2014-09-03 22:30:54 +00:00
Reid Kleckner 5420953303 Really fix the LLDB build
llvm-svn: 217003
2014-09-03 00:40:36 +00:00
Reid Kleckner 634ff8ec04 Remove the JIT from LLDB's dependencies to fix the build
llvm-svn: 217002
2014-09-03 00:35:03 +00:00
Jason Molenda 5de2e7cafb RegisterContextLLDB::InitializeNonZerothFrame had a bit of code to
detct unwind loops but there was a code path through there (using
architecture default unwind plans) that didn't do the check, and
could end up with an infinite loop unwind.  Move that code into a
separate method and call it from both places where it is needed.

Also remove the use of ABI::FunctionCallsChangeCFA in that check.
I thought about it a lot and none of the architecutres that we're
supporting today can have a looping CFA.

Since the unwinder isn't using ABI::FunctionCallsChangeCFA() and
ABI::StackUsesFrames(), and the unwinder was the only reason
those methods exists, I removed them from the ABI and all its
plugins.

<rdar://problem/17364005> 

llvm-svn: 216992
2014-09-02 23:04:01 +00:00
Todd Fiala 726d6a12ad Fix MacOSX cmake build for new HostInfoMacOSX file.
Change by Stephane Sezer.

llvm-svn: 216948
2014-09-02 21:10:23 +00:00
Todd Fiala c5c4e3a35b Linux ARM64: add ProcessMonitor-related RegisterContext support.
See http://reviews.llvm.org/D5089 for more details.

Change by Paul Osmialowski.

llvm-svn: 216907
2014-09-02 14:50:01 +00:00
Matthew Gardiner e77b2948b4 Add an interface on ArchSpec to provide lldb client code
with a mechanism to query if the current target architecture
has non 8-bit bytes.

llvm-svn: 216867
2014-09-01 09:06:03 +00:00
Sean Callanan 302be679bc Fixed a build problem dueo to changes in the
way ownership of memory buffers is handled in
clang's SourceManager.

llvm-svn: 216810
2014-08-30 02:24:56 +00:00
Todd Fiala 5412524025 Fix a test broken by r216564.
llgs Linux is no longer doing the translation to some gdb fixed signal
numbers.  This change modifies the test method to take in the signo
expected for a segfault.  The debugserver test uses the fixed gdb number,
and everything else uses signal.SIGSEGV for the platform.

Sidenote: I somehow did not see this reported in multicore tests.
I will need to verify that we aren't missing test failures in that
script.  I need to verify why this wasn't more obvious with
test/dosep.py.

llvm-svn: 216770
2014-08-29 20:32:18 +00:00
Todd Fiala 352237dbb6 lldb - fix misleading "valid target indexes are" error message
See http://reviews.llvm.org/D4430 for more details.

Change by Paul Osmialowski.

llvm-svn: 216766
2014-08-29 20:14:21 +00:00
Todd Fiala 4ceced3f59 Consolidate UnixSignals setting/getting in Process.
See http://reviews.llvm.org/D5108 for details.

This change does the following:

* eliminates the Process::GetUnixSignals() virtual method and replaces with a fixed getter.
* replaces the Process UnixSignals storage with a shared pointer.
* adds a Process constructor variant that can be passed the UnixSignalsSP. When the constructor without the UnixSignalsSP is specified, the Host's default UnixSignals is used.
* adds a host-specific version of GetUnixSignals() that is used when we need the host's appropriate UnixSignals variant.
* replaces GetUnixSignals() overrides in PlatformElfCore, ProcessGDBRemote, ProcessFreeBSD and ProcessLinux with code that appropriately sets the Process::UnixSignals for the process.

This change also enables some future patches that will enable llgs to be used for local Linux debugging.

llvm-svn: 216748
2014-08-29 17:35:57 +00:00
Jim Ingham b5796cb40e Allow "breakpoint command add" to add commands to more than one breakpoint at a time.
<rdar://problem/13314462>

llvm-svn: 216747
2014-08-29 17:34:17 +00:00
Todd Fiala 34ba426968 Add arbitrary command line flags to llgs/debugserver startup for local debugging.
This patch accepts environment variables of the form:
LLDB_DEBUGSERVER_EXTRA_ARG_n

where n starts with 1, and may continue nearly indefinitely (up through std::numeric_limits<uint32_t>::max()).

The code loops around, starting with 1, until it doesn't find one of the environment variables.  For each one it does find defined, it appends the environment variable's contents to the end of the debugserver/llgs startup command line issued when the stub is started for local debugging.

I am using this to add arbitrary startup commands to the llgs command line for turning on additional logging.  For example:

export LLDB_DEBUGSERVER_EXTRA_ARG_1="-c"
export LLDB_DEBUGSERVER_EXTRA_ARG_2="log enable -f /tmp/llgs_packets.log gdb-remote packets"
export LLDB_DEBUGSERVER_EXTRA_ARG_3="-c"
export LLDB_DEBUGSERVER_EXTRA_ARG_4="log enable -f /tmp/llgs_process.log lldb process"

llvm-svn: 216745
2014-08-29 17:10:31 +00:00
Todd Fiala 33bba9f440 lldb - ELF: add ARM64 relocation jump slot handling in ELFHeader.
See http://reviews.llvm.org/D4579 for more details.

Change by Paul Osmialowski.

llvm-svn: 216739
2014-08-29 16:19:27 +00:00
Todd Fiala b71e89e9af lldb - Register Context Linux ARM64
Yet another step toward ARM64 support. With this commit, lldb-gdbserver started on ARM64 target can be accessed by lldb running on desktop PC and it can process simple commands (like 'continue'). Still ARM64 support lacks NativeRegisterContextLinux_arm64.* code which waits to be implemented.
Based on similar files for Linux x86_64 and Darwin ARM64. Due to common code extraction from Darwin related files, lldb should be tested for any unexpected regression on Darwin ARM64 machines too.

See the following for more details:
http://reviews.llvm.org/D4580
http://lists.cs.uiuc.edu/pipermail/lldb-commits/Week-of-Mon-20140825/012670.html

Change by Paul Osmialowski.

llvm-svn: 216737
2014-08-29 16:01:35 +00:00
Todd Fiala 281961a821 Added setting: platform.plugin.linux.use-llgs-for-local (boolean), defaults to false
This setting is not yet hooked up to anything.  In preparation for
adding/testing llgs for local Linux debugging.

llvm-svn: 216690
2014-08-28 22:17:54 +00:00
Todd Fiala 0b903a0f69 Ensure the Host wait4 thread is able to show pid in thread name.
For hosts that cannot support long thread names, shrink the host
wait4 thread name so that it does not truncate the PID in the thread name.

Change by Shawn Best.

llvm-svn: 216686
2014-08-28 21:21:39 +00:00
Todd Fiala a9882cee50 llgs: add proper exec support for Linux.
This change:
* properly captures execs in NativeProcessLinux.
* clears out all non-main-thread thread metadata in NativeProcessLinux on exec.
* adds a DidExec() method to the NativeProcessProtocol delegate.
* clears out the auxv data cache when we exec (on Linux).

This is a small part of the llgs for local Linux debugging work going on here:
https://github.com/tfiala/lldb/tree/dev-llgs-local

I'm breaking it into small patches.

llvm-svn: 216670
2014-08-28 15:46:54 +00:00
Todd Fiala 02e7181508 lldb - towards AArch64 being recognised as platform architecture
See http://reviews.llvm.org/D4381.

Change by Paul Osmialowski.

llvm-svn: 216668
2014-08-28 14:32:43 +00:00
Jim Ingham 1bb0750b98 Make it clear in the help that "breakpoint command add" will act on the last set
breakpoint if no breakpoint id is specified.

<rdar://problem/17885160>

llvm-svn: 216637
2014-08-28 00:50:17 +00:00
Todd Fiala 76e0fc9884 Add some logging around Process attaching and inferior exec handling.
llvm-svn: 216630
2014-08-27 22:58:26 +00:00
Jim Ingham dc498e516f A quoted - is not the beginning of an option, and should not be completed as such. This was causing:
(lldb) disassemble -n '-<TAB>

to crash.

<rdar://problem/18134531>

llvm-svn: 216626
2014-08-27 22:06:58 +00:00
Jim Ingham 4eb1b271fc Make it clear that the load_addr property on SBAddress relies on lldb.target,
and so can only be used in the script interpreter.

llvm-svn: 216625
2014-08-27 22:05:14 +00:00
Zachary Turner 0b9bab48bb Fix linker error due to missing static variable instantiation.
llvm-svn: 216612
2014-08-27 20:44:26 +00:00
Zachary Turner 4e82ec9caa Create a HostProcess class.
This is a lightweight wrapper around a pid.  It is intended to be
lightweight enough to serve as a replacement anywhere we currently
store a pid.  It provides convenience methods and common process
operations.

This patch does not yet make use of HostProcess anywhere.

llvm-svn: 216607
2014-08-27 20:15:30 +00:00
Zachary Turner 58a559c07e Update LLDB to use LLVM's DynamicLibrary.
LLDB had implemented its own DynamicLibrary class for plugin
support.  LLVM has an equivalent mechanism, so this patch deletes
the duplicated code in LLDB and updates LLDB to reference the
mechanism provided by LLVM.

llvm-svn: 216606
2014-08-27 20:15:09 +00:00
Rafael Espindola 2443e706c1 Update for LLVM API change.
llvm-svn: 216603
2014-08-27 20:09:08 +00:00
Todd Fiala 737f43628a llgs: remove all Initialize() calls except for Debugger::Initialize().
See thread here:
http://lists.cs.uiuc.edu/pipermail/lldb-commits/Week-of-Mon-20140825/012580.html

The original change I made there was due to a segfault.  That was
caused by me directly calling PluginManager::Initialize (), with
PluginManager::Initialize() depending on HostInfo::Initialize () to
have been called already (which it wasn't).

The call to PluginManager::Initialize () was erroneous (at least at the 
current time) since that method is already called by Debugger::Initialize()'s 
implementation.

We will want to revisit initializing a smaller core of the debugger
suitable for lldb-gdbserver and lldb-platform.

llvm-svn: 216581
2014-08-27 19:56:58 +00:00
Todd Fiala 22972a7c59 NativeThreadLinux: remove translation of some Linux signals to gdb signals.
I copied this originally based on what debugserver was doing.  This appears to
be incorrect and unncessary for Linux.  The LinuxSignals on the lldb side
don't look for these and therefore they get handled incorrectly.

Leaving the hook in place since I think darwin will continue to need to
translate those signal numbers.

llvm-svn: 216564
2014-08-27 17:11:56 +00:00
Todd Fiala 1d6082ff17 lldb Missing ARM64 breakpoint opcode for ProcessPOSIX added.
See http://reviews.llvm.org/D5078.

Change by Paul Osmialowski.

llvm-svn: 216559
2014-08-27 16:32:02 +00:00
Todd Fiala e4d6922ceb lldb AArch64 should be listed as yet another 64-bit architecture in HostInfoBase.
See http://reviews.llvm.org/D5070.

Change by Paul Osmialowski.

llvm-svn: 216556
2014-08-27 16:21:41 +00:00
Todd Fiala 8b55cce84c lldb Missing break statement added.
See http://reviews.llvm.org/D5069.

Change by Paul Osmialowski.

llvm-svn: 216554
2014-08-27 16:12:35 +00:00
Todd Fiala 4207968d33 Add Linux support for get thread area on ARM64 using ProcessMonitor debugging.
See http://reviews.llvm.org/D5073.

Change by Paul Osmialowski.

llvm-svn: 216553
2014-08-27 16:05:26 +00:00
Matthew Gardiner 5f67579f69 Add support for kalimba architecture variants 3, 4 and 5.
Add entries to core_definitions and elf_arch_entries for
those variants. Select the subtype for the variant by parsing
the e_flags field of the elf header.

llvm-svn: 216541
2014-08-27 12:09:39 +00:00
Enrico Granata 4419d539cf Add __NSCFDictionary to the list of NSDictionary-like types for which we know to generate synthetic children
llvm-svn: 216513
2014-08-27 01:10:27 +00:00
Jason Molenda 33a3017a7d Clean up after the multithreaded test case finishes.
Patch by Sean Callanan.
<rdar://problem/18140875> 

llvm-svn: 216504
2014-08-26 23:31:00 +00:00
Enrico Granata 689cdb1894 There seems to be no sane reason for a test case to enable logging every time it runs.. probably leftover from when I was debugging it
llvm-svn: 216502
2014-08-26 23:27:51 +00:00
Jason Molenda f37b7c79a3 Don't have ProcessMachCore::CanDebug use the Target's arch when
creating the ModuleSpec to load the core file - we won't have a fat
core file and we can end up with cpu subtype mismatches if the core
file header isn't written out completely accurately.  We need to
be a little loose in this particular case.
<rdar://problem/17843388>

llvm-svn: 216498
2014-08-26 22:39:03 +00:00
Enrico Granata 59953f0dbe It was pointed out to me that an offset of 0 makes sense for ObjC, but not always for C++, and this API claims to be general enough that it should not drop C++ usability on the floor for no good reason. Fix it with an explicit offset argument
llvm-svn: 216487
2014-08-26 21:35:30 +00:00
Bruce Mitchener ca7b0aaa36 [dwarf] Add new language enumerations.
This updates the DWARF language identifiers to include recent additions to
the DWARF 5 specification (draft).

llvm-svn: 216486
2014-08-26 21:22:49 +00:00
Enrico Granata 32556cda18 Add an API on ValueObject to generate a 'synthetic child' of base class type. Note that in this commit, the term synthetic child is not meant to refer to data formatters, but to the programmatically-generated children stored inside a ValueObject itself
llvm-svn: 216483
2014-08-26 20:54:04 +00:00
Todd Fiala 6c9053ef20 Added a couple more gdb-remote tests to ensure qProcessInfo on darwin is not defining triple.
And likewise for qProcessInfo on Linux, but ensures cputype/cpusubtype is not defined.  The
Apple case is the more important one, since we take a slightly different path to initialize
ProcessGDBRemote-related remote host/process info if triple is present.

Related to http://llvm.org/bugs/show_bug.cgi?id=20755.

llvm-svn: 216473
2014-08-26 18:40:56 +00:00
Todd Fiala c540dd0daf Fix llgs to send triple for non-Apple platforms and lldb to interpret correctly.
This change addresses this bug:
http://llvm.org/bugs/show_bug.cgi?id=20755

This change:
* Modifies llgs to send triple instead of cputype and cpusubtype when not on Apple platforms in qProcessInfo.
* Modifies lldb's GDBRemoteCommunicationClient to handle the triple returned from qProcessInfo if given.
  When given, it will prefer to use triple over cputype and cpusubtype.
* Adds gdb-remote protocol tests to verify that cputype and cpusubtype are specified on darwin, and that triple is specified on Linux.

llvm-svn: 216470
2014-08-26 18:21:02 +00:00
Todd Fiala f76a891299 Refactored existing gdb-remote qProcessInfo tests into separate python file.
I'm about to add some more qProcessInfo tests so I wanted to first pull them out
of the monolithic TestLldbGdbServer test case class.

Related to http://llvm.org/bugs/show_bug.cgi?id=20755

llvm-svn: 216465
2014-08-26 17:19:10 +00:00
Matthew Gardiner e81df3bbc9 Remove the hostname part from compilation directories, if supplied by
DWARF2/3 compliant producers.

llvm-svn: 216440
2014-08-26 06:57:23 +00:00
Jason Molenda 7b967f1477 Remove trailing whitespace from lines in UnwindAssembly-x86.cpp. No other changes.
llvm-svn: 216420
2014-08-25 23:46:06 +00:00
Jason Molenda 31e7191513 Clean up the coding conventions in UnwindAssembly-x86.cpp a little bit.
I wrote this originally as a part of an unwind library that was using
a different coding convention and some of that old style remained after
its integration into lldb.

llvm-svn: 216419
2014-08-25 23:45:24 +00:00
Todd Fiala a220946990 Copy unwind plan instead of modifying it directly, so "image show-unwind" prints different plans for asynchronous and synchronous.
Change by Tong Shen.

llvm-svn: 216416
2014-08-25 23:09:40 +00:00
Jason Molenda 1786ebf3d4 Have augment_unwind_plan_from_call_site update the UnwindPlan
name/from-compiler settings to indicate that it was augmented
by assembly profiling.

llvm-svn: 216412
2014-08-25 22:16:23 +00:00
Todd Fiala 1767e11594 Add 64-bit eh_frame section CFI support.
In practice, 64bit eh_frame is not used even for x86_64 binaries. The main reason is in eh_frame we almost always use pc-relative addressing, so addresses are within 32bits and gcc just sticks to 32bit eh_frame.

I generated 64bit eh_frame for Android Java runtime and unwind successfully in gdb, and in lldb with this patch.

Patch by Tong Shen.

llvm-svn: 216409
2014-08-25 21:39:30 +00:00
Todd Fiala 0562524b45 On x86 & x86_64, try to use eh_frame for frame 0.
We decided to use assmbly profiler instead of eh_frame for frame 0 because for compiler generated code, eh_frame is usually synchronous(a.k.a. only valid at call site); and we have no way to tell if it's asynchronous or not.
But for x86 & x86_64 compiler generated code:
1. clang & GCC describes all prologue instructions in eh_frame;
2. mid-function stack pointer altering instructions can be easily detected.
So we can grab eh_frame, and use assembly profiler to augment it into asynchronous unwind table.
This change also benefits hand-written assembly; eh_frame for hand-written assembly is often asynchronous,so we have a much better chance to successfully unwind through them.

Change by Tong Shen.

llvm-svn: 216406
2014-08-25 20:29:09 +00:00
Greg Clayton 21405a86d9 Added a test case to ensure lldb::SBHostOS::GetLLDBPath() doesn't return lldb::SBFileSpec objects with the filename filled in for directory paths.
llvm-svn: 216399
2014-08-25 18:30:00 +00:00
Greg Clayton 0d8400c89c Change back all paths returns for lldb::PathType enumerations from HostInfo::GetLLDBPath() to return the directories in the FileSpec.m_directory field to match previous implementations. This change previously broke some path stuff in upstream branches.
llvm-svn: 216398
2014-08-25 18:21:06 +00:00
Deepak Panickal b709222b8a Fix the Windows build by removing the unused lldb_python_module.cmake inclusion from CMakeLists.
llvm-svn: 216392
2014-08-25 18:16:22 +00:00
Jason Molenda 8cd95a3b2c Add a little documentation for the register kinds
and the method to convert between them.

llvm-svn: 216372
2014-08-25 08:03:10 +00:00
Keno Fischer 5777edf05c Resurect preprocessor definitions that got lost moving to HostInfo
When building without XCode on sytems where these constants are
not in the system header (or I presume with older versions of XCode),
these are needed to make this file compile, since unlike most other
uses of MachO specific constants, these use the system headers
rather than the LLVM-defined ones.

llvm-svn: 216332
2014-08-23 21:40:29 +00:00
Enrico Granata 9f1d33637e I forgot to include the header file for std::find, and that's breaking the Linux build. Push a fix out. Patch suggested by Paul Osmialowski and Randy Smith
llvm-svn: 216323
2014-08-23 18:22:09 +00:00
Sean Callanan 0de7ecd346 Initialize LLVM when LLDB is initialized, and
install a crash handler.

<rdar://problem/18083226>

llvm-svn: 216309
2014-08-23 00:47:22 +00:00
Sean Callanan 62e9fb9727 Fixed a problem where IOObject was wrongly
capitalized.

llvm-svn: 216308
2014-08-23 00:46:02 +00:00
Enrico Granata e3eface17a Extend the encoding parser to support the @typeName syntax for Objective-C object types
llvm-svn: 216305
2014-08-23 00:20:33 +00:00
Enrico Granata 3ee335a762 Fix a couple of potential issues in the lexer where we were ignoring the putback data
llvm-svn: 216304
2014-08-23 00:11:38 +00:00
Zachary Turner cfe910b9d4 Fix a CMake error when using CMake 3.0.1
llvm-svn: 216286
2014-08-22 20:44:55 +00:00
Jason Molenda 05a09c67da When adding a dSYM to an existing ObjectFile, we can have a situation
with binaries in the dyld shared cache (esp on iOS) where the file
address for the executable binary (maybe from memory, maybe from
an expanded copy of the dyld shared cache) is different from the
file address in the dSYM.  In that case, ObjectFileMachO replaces
the file addresses from the original binary with the dSYM file
addresses (usually 0-based) -- lldb doesn't have a notion of two
file addresses for a given module so they need to agree.

There was a cache of file addresses over in the Symtab so I added
a method to the Module and the objects within to clear any file address
caches if they exist, and added an implementation in the Symtab
module to do that.
<rdar://problem/16929569> 

llvm-svn: 216258
2014-08-22 02:46:46 +00:00
Zachary Turner c25146b67b Fixes a few more places where we were manually setting the filename.
llvm-svn: 216247
2014-08-21 23:56:55 +00:00
Jason Molenda fb700b58cc Bump the verison number in the xcode project files.
llvm-svn: 216245
2014-08-21 23:27:02 +00:00
Jason Molenda 6fd86771f2 Two small fixes to get Mac native + debugserver working after the
HostInfo et al changes from Zachary.  Changes suggested by Zachary
- fixes the problems I was seeing.

llvm-svn: 216243
2014-08-21 23:22:33 +00:00
Todd Fiala 3e9af0dd1d Add missing HostInfo::Initialize() in llgs.
This fixes an llgs segfault on startup.

llvm-svn: 216238
2014-08-21 22:41:25 +00:00
Zachary Turner a21fee0ee4 Move the rest of the HostInfo functions over.
This should bring HostInfo up to 99% completion.  The remainder
of code in Host will be split into instantiatable classes
representing host processes, threads, dynamic libraries, and
process launching strategies.

llvm-svn: 216230
2014-08-21 21:49:24 +00:00
Zachary Turner e47ffc3b42 Fix compile error on Linux due to previous commit.
llvm-svn: 216227
2014-08-21 21:02:47 +00:00
Zachary Turner b245ecac79 Move GetUsername and GetGroupname to HostInfoPosix
llvm-svn: 216210
2014-08-21 20:02:17 +00:00
Zachary Turner 673b6e4f3a Convert static constructors to be explicitly initialized at startup
llvm-svn: 216197
2014-08-21 17:57:03 +00:00
Zachary Turner 42ff0ad882 Move Host::GetLLDBPath to HostInfo.
This continues the effort to get Host code moved over to HostInfo,
and removes many more instances of preprocessor defines along the
way.

llvm-svn: 216195
2014-08-21 17:29:12 +00:00
Todd Fiala 4262828132 Fix on Linux for ReadThread lingering after inferior exits
See this email thread:
http://lists.cs.uiuc.edu/pipermail/lldb-commits/Week-of-Mon-20140818/012487.html

This patch handles the case where the inferior process exits but leaves the ReadThread in a continuous loop reading from the communication pipe.  On MacOSX, the ReadThread exits when it receives a 0 return value from the read due to EOF.  On Linux the read returns -1 and sets errno to EIO error, this does not currently cause the thread to shutdown so it continues to read from the comm.   In Communication::ReadThread I added a handler for eConnectionStatusError to disconnect and shutdown the thread.

Change by Alex Pepper.

llvm-svn: 216194
2014-08-21 17:16:26 +00:00
Sean Callanan 7050e0b194 Fixed a typo.
<rdar://problem/18084105>

llvm-svn: 216189
2014-08-21 16:47:01 +00:00
Todd Fiala 2afc596667 Add software breakpoint support for Linux aarch64.
See http://reviews.llvm.org/D4969 for details.

Change by Paul Osmialowski.

llvm-svn: 216188
2014-08-21 16:42:31 +00:00
Todd Fiala 6ac1be4b6d Enable more Linux aarch64 PTRACE support for local and remote debugging.
See http://reviews.llvm.org/D4803 for more details.

Change by Paul Osmialowski.

llvm-svn: 216185
2014-08-21 16:34:03 +00:00