Commit Graph

13609 Commits

Author SHA1 Message Date
Zachary Turner 4c152690be Remove `lldb.root` and just look for the file we care about.
llvm-svn: 253679
2015-11-20 17:40:57 +00:00
Tamas Berghammer a8dd275609 Use thumb instruction set for ldb-server on android arm
Differential revision: http://reviews.llvm.org/D14816

llvm-svn: 253657
2015-11-20 10:51:39 +00:00
Siva Chandra d2e90129d9 Revert "Make skipIf support the not_in function."
Summary:
This reverts commit 251965377bdfb6227eea42c12a792c059e4e8a4b
as a test marked "skipIf(compiler='gcc')" runs when testing with GCC.

Reviewers: amccarth

Subscribers: lldb-commits

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

llvm-svn: 253631
2015-11-20 01:54:24 +00:00
Adrian McCarthy 257da8ea50 Make skipIf support the not_in function.
llvm-svn: 253623
2015-11-20 00:11:38 +00:00
Greg Clayton 9d47212194 Fix a crasher in SymbolContext::SortTypeList() where something that was iterating over a std::multimap was actually mutating the list.
<rdar://problem/23605600>

llvm-svn: 253618
2015-11-19 23:10:45 +00:00
Greg Clayton 11922d2c1d Fixed Xcode build by adding the PlatformNetBSD code.
llvm-svn: 253616
2015-11-19 23:04:09 +00:00
Siva Chandra fc33b110bc Revert "Plug-in PlatformNetBSD initializer and terminator"
Summary:
This reverts commit 2354cd73101e58540b8b39783df462d06023309f as it
introduced a bunch regressions on the linux bot.

Reviewers: emaste, krytarowski

Subscribers: lldb-commits

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

llvm-svn: 253615
2015-11-19 22:58:48 +00:00
Enrico Granata 46252398f0 Fix up LLDB for a change in the way clang represents anonymous unions such that the 'frame variable' command can still find the members of such union as if they were top-level variables in the current scope
llvm-svn: 253613
2015-11-19 22:28:58 +00:00
Enrico Granata 55d99f0e7c Cleanup work required to get the ASAN tests to run in the new test suite infrastructure; the tests are now xfailed on Darwin pending investigation
llvm-svn: 253604
2015-11-19 21:45:07 +00:00
Ed Maste 3190d17b12 Plug-in PlatformNetBSD initializer and terminator
Patch by Kamil Rytarowski

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

llvm-svn: 253601
2015-11-19 21:30:22 +00:00
Enrico Granata 0cf8c0468d Fix an issue where LLDB would not launch argdumper correctly if there were spaces in the path to it
llvm-svn: 253599
2015-11-19 21:17:56 +00:00
Zachary Turner 7aac24805b Pass -fms-compatibility-version when building test inferiors.
-fms-compatibility-version defaults to VS 2013.  When using
VS 2015, this will lead to compilation failures of the test
inferiors in the C++ standard library for language conformance
reasons.

The fix here is to simply pass -fms-compatibility-version=19.0 when
we detect that a VS 2015 compiler is present.  Even though we're
actually using clang to do the compilation, clang uses this same
detection algorithm to determine the location of the standard
library.  So this check is tantanmount to saying "If clang is going
to find MSVC 2015's standard library, then pass 19.0 for
-fms-compatibility-version.

llvm-svn: 253589
2015-11-19 19:10:54 +00:00
Todd Fiala f6508db485 Revert "prepare_bindings.py: enable static bindings"
This reverts commit 40f789f2dc6bb80fd25a33f91e452d081ed9d0ee.

llvm-svn: 253575
2015-11-19 16:56:12 +00:00
Sagar Thakur 9bf1528573 [LLDB][MIPS] Fix lldbplatformutil.py Failure
Patch by Nitesh Jain

Summary: This patch check whether first register is readable.

Subscribers: lldb-commits, mohit.bhakkad, sagar, bhushan
Reviewers: clayborg, ovyalov, jaydeep
Differential: http://reviews.llvm.org/D14635
llvm-svn: 253555
2015-11-19 11:01:21 +00:00
Jason Molenda f638ffddba I like how PlatformAndroid/PlatformLinux log when their platforms
try to CreateInstance, and log the results.  I copied that for the
Mac platforms.

llvm-svn: 253538
2015-11-19 03:15:37 +00:00
Enrico Granata 293207dd57 Pass the ExecutionContext as well, since it is actually useful
llvm-svn: 253537
2015-11-19 02:50:27 +00:00
Enrico Granata d4129b47d0 Allow the language plugins a say in how the function name is rendered as part of frame formatting
llvm-svn: 253531
2015-11-19 01:11:53 +00:00
Todd Fiala 223f4bb9b2 Remove superseded buildSwigWrapperClasses.py and buildSwigPython.py classes
This closes:
http://reviews.llvm.org/D14783

llvm-svn: 253513
2015-11-18 22:21:47 +00:00
Siva Chandra c7ac7d7a9b [TestExitDuringStep] Adjust after a recent type map change.
Reviewers: zturner

Subscribers: lldb-commits

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

llvm-svn: 253505
2015-11-18 21:22:29 +00:00
Zachary Turner cc2e76d57f Fix CMake dependency on lldb.py
llvm-svn: 253501
2015-11-18 21:09:55 +00:00
Enrico Granata 3de08c5f0c Reapply r253423 and r253424 (which cleanup the data formatters iteration model, as well as the type X list commands), along with a change by Zachary Turner to bypass a MSVC bug with SFINAE
llvm-svn: 253493
2015-11-18 19:42:44 +00:00
Todd Fiala a52e2c8376 Remove the scripts/Python/build-swig-Python.sh script.
This logically goes with my previous commit.

llvm-svn: 253491
2015-11-18 19:37:51 +00:00
Todd Fiala f6b2aa5882 remove defunct scripts/build-swig-wrapper-classes.sh; switch autoconf build to prepare_bindings.py.
Xcode moved off of build-swig-wrapper-classes.sh earlier this week.

llvm-svn: 253490
2015-11-18 19:34:03 +00:00
Ying Chen ca922bb9b9 Support unix-abstract-connect scheme as platform url in lldb testsuite
Reviewers: ovyalov

Subscribers: lldb-commits

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

llvm-svn: 253488
2015-11-18 19:03:20 +00:00
Zachary Turner 48ef8d4c37 Fix some issues with swig & string conversion.
This patch fixes two issues:

1) Popen needs to be used with universal_newlines=True by default.
   This elicits automatic decoding from bytes -> string in Py3,
   and has no negative effects in other Py versions.
2) The swig typemaps for converting between string and (char*, int)
   did not work correctly when the length of the string was 0,
   indicating an error.  In this case we would try to construct a
   string from uninitialized data.
3) Ironically, the bug mentioned in #2 led to a test passing on
   Windows that was actually broken, because the test was written
   such that the assertion was never even getting checked, so it
   passed by default.  So we additionally fix this test to also
   fail if the method errors.  By fixing this test it's now broken
   on Windows, so we also xfail it.

llvm-svn: 253487
2015-11-18 18:40:16 +00:00
Todd Fiala 7d1da7e91c Switched cmake build from using buildSwigWrapperClases.py to the cleaned up version.
This change does not introduce static bindings.  It is simply using
the pylinted cleaned up code in prepare_bindings.py.

If this breaks anyting, I'll revert immediately and figure out what
needs to be addressed.  I'm looking to wrap up
the cleanup aspect of the code change (pylinted, removal of code that
implements existing python stdlib code, fixes for Xcode adoption, etc.).

llvm-svn: 253478
2015-11-18 17:36:15 +00:00
Tamas Berghammer 68aa90a11e Revert 2 commits breaking the MSVC build
Revert "Remove a few vestigial typedefs from the old world"
This reverts commit 05872cda2a00fbd988c4fc761b1f87fe9edce224.

Revert "Cleanup the type X list commands to use the new ForEach goodness"
This reverts commit 85b1d83819a22cdc9ef12f58fd4fa92b473a4f81.

llvm-svn: 253455
2015-11-18 12:11:34 +00:00
Todd Fiala d434a1d3e0 prepare_bindings.py: enable static bindings
Added a new flag, --allow-static-binding.  When specified,
if (and only if) the swig binary cannot be found, then the
LLDBWrapPython.cpp and lldb.py from the
scripts/Python/{static-binding-dir} are copied into the place where
swig would have generated them.

{static-binding-dir} defaults to static-binding, and can be
overridden with the --static-binding-dir command line argument.

The static bindings checked in are from r253424.

llvm-svn: 253448
2015-11-18 08:52:33 +00:00
Sagar Thakur 64dab75c41 [LLDB][MIPS] Fix TestDisassembleBreakpoint.py for MIPS
Patch by Nitesh Jain

Summary: The break is opcode for breakpoint instruction.

Subscribers: lldb-commits, mohit.bhakkad, sagar, bhushan
Reviewers: clayborg, ovyalov, jaydeep
Differential: http://reviews.llvm.org/D14634
llvm-svn: 253445
2015-11-18 08:18:03 +00:00
Sagar Thakur 78086742f3 [MIPS][LLDB]Fix TestBreakpointCondition.py for MIPS
Patch by Nitesh Jain

Summary: The self.getArchitecture() returns the architecture based on the value of -A flag passed to dotest.py script.
There are many possible values for MIPS to this option (like mips32r2, mips32r6, mips64, mips64r2,.... ).
This patch uses re.match(mips,arch) to check if architecture string starts with mips.

Subscribers: lldb-commits, mohit.bhakkad, sagar, bhushan, jaydeep
Reviewers: clayborg, ovyalov
Differential: http://reviews.llvm.org/D14493
llvm-svn: 253444
2015-11-18 08:12:34 +00:00
Enrico Granata 0481df6af4 Remove a few vestigial typedefs from the old world
llvm-svn: 253424
2015-11-18 01:44:36 +00:00
Enrico Granata a76e894bd5 Cleanup the type X list commands to use the new ForEach goodness
llvm-svn: 253423
2015-11-18 01:37:49 +00:00
Enrico Granata a2afcc9911 Cleanup indentation
llvm-svn: 253383
2015-11-17 21:55:09 +00:00
Enrico Granata 32936810c3 Cleanup the type X clear commands, so that one base class can implement all of them
llvm-svn: 253381
2015-11-17 21:43:55 +00:00
Enrico Granata be2e5fac68 Move this back to a pid_t; this file is OSX only anyway, and the signedness of pid_t is actually a thing we want here
llvm-svn: 253364
2015-11-17 19:35:26 +00:00
Todd Fiala 6eac09ecda Remove --swig-executable `which swig` from Xcode prepare_bindings.py call.
This is no longer needed with --find-swig, and although innocuous on systems with
swig in the path, it blows up when there is no swig in the path.  This should
have been removed in the prior check-in.

llvm-svn: 253353
2015-11-17 18:10:54 +00:00
Todd Fiala 090084193f Reinstate Xcode project usage of prepare_bindings.py, with new --find-swig option set.
llvm-svn: 253347
2015-11-17 17:13:09 +00:00
Todd Fiala 9af81570c7 Added --find-swig option to allow searching for swig in path or other likely locations.
llvm-svn: 253346
2015-11-17 17:13:06 +00:00
Todd Fiala 9db6bd229c Revert out Xcode hookup of r253317.
The green dragon OS X builder doesn't have swig on the path.
I need to enable behavior where we can look for it
in some well known spots.

llvm-svn: 253319
2015-11-17 07:56:42 +00:00
Todd Fiala 84c72b6d75 Add Pythonic language binding wrapper generation script.
This is only used by Xcode at the moment.  It replaces the
buildSwigWrapperClasses.py and related per-script-language
scripts.  It also fixes a couple bugs in those w/r/t Xcode
usage:

* the presence of the GCC_PREPROCESSOR_DEFINITIONS env var
  should not be short-circuiting generation of the language
  binding; rather, only if LLDB_DISABLE_PYTHON is present
  within that environment variable.

* some logic around what to do when building in "non-Makefile"
  mode.  I've switched the handling of that to be on a
  "--framework" flag - if specified, we build an OS X-style
  framework; otherwise, we go with non.

Putting this up now only attached to the Xcode build so
others can look at it but not be affected by it yet.
After this, I'll tackle the finalizer, along with trying
it locally on Linux.

llvm-svn: 253317
2015-11-17 07:17:38 +00:00
Jim Ingham 055a08a488 Add the ability (through the SB API & command line) to specify an address
breakpoint as "file address" so that the address breakpoint will track that
module even if it gets loaded in a different place.  Also fixed the Address
breakpoint resolver so that it handles this tracking correctly.

llvm-svn: 253308
2015-11-17 03:39:13 +00:00
Zachary Turner ba1057022c Python 3 - Skip a certain test for a particular (swig,python) combo.
Current versions of SWIG have a bug with Python 3 that causes
Python to assert when iterating over a generator.  This patch
skips the test for the right combination of Python version and
SWIG version.  I'm attempting to upstream a patch to SWIG to
fix this in a subsequent as-of-yet unreleased version, but
I don't know how long that will take.

llvm-svn: 253273
2015-11-16 23:58:20 +00:00
Ying Chen 0c35282c65 Re-Apply "Add a "not_in()" function you can apply to the list type arguments to expectedFailureAll ..." with fix
Summary:
- Re-Commit r253106
- Initialize self.debug_info in Base::setUp()
- Fix argument order when calling check_list_or_lambda for compiler

Reviewers: jingham

Subscribers: lldb-commits

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

llvm-svn: 253272
2015-11-16 23:41:02 +00:00
Zachary Turner abdb839228 Add the ability to xfail or skip based on swig / python version.
llvm-svn: 253263
2015-11-16 22:40:30 +00:00
Zachary Turner eddf19f995 Insert the SWIG version into LLDB's __init__.py
The goal here is to allow us to add skip / xfail decorators
based on SWIG version.

llvm-svn: 253262
2015-11-16 22:40:20 +00:00
Zachary Turner 32ac147b00 Python3 - Fix some issues related to `PythonFile` class.
Python 3 has lots of new debug asserts, and some of these were
firing on PythonFile.  Specifically related to handling of invalid
files.

llvm-svn: 253261
2015-11-16 22:40:12 +00:00
Pavel Labath 311cc7d133 Revert "Add a "not_in()" function you can apply to the list type arguments to expectedFailureAll to reverse"
This reverts commit r253106.

llvm-svn: 253197
2015-11-16 11:11:10 +00:00
Bruce Mitchener b5c891908d Add more autotools/gmake NetBSD glue
Summary: This diff approaches building the project natively on NetBSD with the autoconf/gmake framework.

Patch by Kamil Rytarowski. Thanks!

Reviewers: emaste, clayborg

Subscribers: tberghammer, joerg, brucem, lldb-commits

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

llvm-svn: 253153
2015-11-15 02:00:09 +00:00
Bruce Mitchener 60cd65aac2 Allow to override python-config executable name from command line
Summary: pkgsrc (on NetBSD) ships with python2.7-config.

Patch by Kamil Rytarowski. Thanks!

Reviewers: emaste, clayborg

Subscribers: brucem, lldb-commits, joerg

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

llvm-svn: 253152
2015-11-15 01:56:21 +00:00
Bruce Mitchener eb0a6f4308 Use library discovery for curses and panel
Summary:
This approach is tunable with custom paths for curses library.

It also detects whether there are requirements met.

I make use of it on NetBSD.

Patch by Kamil Rytarowski. Thanks!

Reviewers: clayborg

Subscribers: brucem, joerg, lldb-commits

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

llvm-svn: 253151
2015-11-15 01:53:23 +00:00
Enrico Granata 4fc8416181 Uniquify all the type X delete commands via one common base class
This removes a lot of code, which is A Good Thing(TM)

llvm-svn: 253140
2015-11-14 18:44:37 +00:00
Enrico Granata f7aaf04743 Some cleanup of the type X delete command
llvm-svn: 253137
2015-11-14 18:17:33 +00:00
Enrico Granata b56d01033e The existing logic to loop over formatters is very pre-C++11, using void* batons, and function pointers, and raw memory allocations instead of safer more modern constructs
This is a first pass at a cleanup of that code, modernizing the "type X clear" commands, and providing the basic infrastructure I plan to use all over
More cleanup will come over the next few days

llvm-svn: 253125
2015-11-14 05:44:23 +00:00
Enrico Granata 54c22c2245 Fixes for uniformity in type clear and delete commands
llvm-svn: 253113
2015-11-14 01:09:07 +00:00
Sean Callanan 92655f58bc Always initialize expression variables' flags field.
llvm-svn: 253112
2015-11-14 01:05:33 +00:00
Enrico Granata e86e425945 Add a few useful accessors on the data formatters containers
llvm-svn: 253111
2015-11-14 00:58:37 +00:00
Enrico Granata 6f6f7396ba Minor cleanup to the type format list command
llvm-svn: 253110
2015-11-14 00:58:21 +00:00
Jim Ingham 6d048942c5 Add a "not_in()" function you can apply to the list type arguments to expectedFailureAll to reverse
the sense of the test.

llvm-svn: 253106
2015-11-14 00:20:33 +00:00
Sean Callanan a2c156edad Fixed a testcase problem where disassembly would fail for nameless functions.
llvm-svn: 253101
2015-11-13 23:00:33 +00:00
Jim Ingham dfe0e99517 Change the test to use the instruction list to get the consecutive addresses to break on. Rerunning
was being foiled by ASLR.

llvm-svn: 253094
2015-11-13 22:19:08 +00:00
Enrico Granata 89d8ef7ee3 Upstream some data formatter related cleanups
llvm-svn: 253093
2015-11-13 21:55:41 +00:00
Zachary Turner 8f186f8574 Change the null check to an assert.
llvm-svn: 253092
2015-11-13 21:53:03 +00:00
Enrico Granata c26332abbd Fix indentation
llvm-svn: 253089
2015-11-13 21:37:47 +00:00
Zachary Turner c12392c956 Remove debugging code left in by accident.
llvm-svn: 253088
2015-11-13 21:35:07 +00:00
Enrico Granata 920c587e64 Fix indentation
llvm-svn: 253087
2015-11-13 21:34:39 +00:00
Zachary Turner 0ee8282f4a Add a null check against the ThreadPlan
I'm seeing some cases where the ThreadPlan is null.  It could
be a sign of a valid race condition, but at least we shouldn't
crash.

llvm-svn: 253086
2015-11-13 21:28:53 +00:00
Zachary Turner 2419f1d57c Modernize FormatBacktrace() and make portable for Python 3.
llvm-svn: 253085
2015-11-13 21:28:45 +00:00
Zachary Turner 1f1c5a7b44 Another fix for LLDB_DISABLE_PYTHON=1
llvm-svn: 253073
2015-11-13 20:28:31 +00:00
Zachary Turner 19d4fa26fc Add `PythonExceptionStateTests.cpp` to lldb-gtest target.
llvm-svn: 253057
2015-11-13 18:10:11 +00:00
Zachary Turner a281b42b32 Make PythonDataObjects.h work when LLDB_DISABLE_PYTHON=1
llvm-svn: 253054
2015-11-13 17:27:20 +00:00
Pavel Labath e57331679d Re-XFAIL two more tests I missed
llvm-svn: 253042
2015-11-13 13:37:53 +00:00
Pavel Labath 3c5ada8136 Re-add XFAILs to two tests
these decorators were two of many removed in r253026. Unlike others, these tests still seem to be
failing...

llvm-svn: 253034
2015-11-13 11:56:09 +00:00
Eugene Leviant c1ba9fcb27 Fix multiple symbol lookup in the same namespace
llvm-svn: 253028
2015-11-13 11:00:10 +00:00
Tamas Berghammer 2e31ce1ea7 Remove a broken hack from Scalar::ULongLong and fix a test
Change Test-rdar-12481949.py to expect GetValueAsUnsigned() to return
0xffffffff if the variable is an int32_t (signed, 4 byte integer) with
value of -1. The previous expectation where we expected the value to be
0xffffffffffffffff doesn't make sense as nothing explains why we would
treat it as an 8 byte value.

This CL also removes a hack from Scalar::ULongLong what was most likely
added to get this test passing as it only worked in case the value of
the variable is -1 and didn't make any sense even in that case.

Differential revision: http://reviews.llvm.org/D14611

llvm-svn: 253027
2015-11-13 10:51:35 +00:00
Abhishek Aggarwal be994649b4 Fix to solve Bug 23139 & Bug 23560
Summary:
 - Reason of both bugs:

   1. For the very first frame, Unwinder doesn't check the validity
      of Full UnwindPlan before creating StackFrame from it:

        When 'process launch' command is run after setting a breakpoint
        in inferior, the Unwinder runs and saves only Frame 0 (the frame
        in which breakpoint was set) in thread's StackFrameList i.e.
        m_curr_frames_sp. However, it doesn't check the validity of the
        Full UnwindPlan for this frame by unwinding 2 more frames further.

   2. Unwinder doesn't update the CFA value of Cursor when Full UnwindPlan
      fails and FallBack UnwindPlan succeeds in providing valid CFA values
      for frames:

        Sometimes during unwinding of stack frames, the Full UnwindPlan
        inside the RegisterContextLLDB object may fail to provide valid
        CFA values for these frames. Then the Fallback UnwindPlan is used
        to unwind the frames.

        If the Fallback UnwindPlan succeeds, then it provides a valid new
        CFA value. The RegisterContextLLDB::m_cfa field of Cursor object
        is updated during the Fallback UnwindPlan execution. However,
        UnwindLLDB misses the implementation to update the 'cfa' field
        of this Cursor with this valid new CFA value.

 - This patch fixes both these issues.

 - Remove XFAIL in test files corresponding to these 2 Bugs

Change-Id: I932ea407545ceee2d628f946ecc61a4806d4cc86
Signed-off-by: Abhishek Aggarwal <abhishek.a.aggarwal@intel.com>

Reviewers: jingham, lldb-commits, jasonmolenda

Subscribers: lldb-commits, ovyalov, tberghammer

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

llvm-svn: 253026
2015-11-13 10:47:49 +00:00
Jim Ingham a3f466b9e7 Fix commit 252963 to work around a bug on some platforms where they don't
correctly handle stepping over one breakpoint directly onto another breakpoint.  
This isn't fixing that bug, but rather just changing 252963 to not use breakpoints
if it is only stepping one instruction.

llvm-svn: 253008
2015-11-13 03:37:48 +00:00
Jason Molenda c4172825f2 Add PythonTestSuite.cpp to project file for lldb-gtest.
llvm-svn: 253004
2015-11-13 02:02:30 +00:00
Zachary Turner a87d0ae61b Fix a bug in PythonExceptionState and add unittest coverage.
I forgot to reset the restore flag when calling member function
`Acquire`.  The newly added unittest should cover this case.

llvm-svn: 253002
2015-11-13 01:50:19 +00:00
Jason Molenda 560a5faab0 Add PythonExceptionState.cppto the xocde project file.
llvm-svn: 252998
2015-11-13 01:43:49 +00:00
Zachary Turner 2c69511cd5 Update .gitignore to exclude pyproj folder (used for Python IDE)
llvm-svn: 252995
2015-11-13 01:24:58 +00:00
Zachary Turner 3946247caf Introduce a `PythonExceptionState` class.
This is a helper class which supports a number of
features including exception to string formatting with
backtrace handling and auto-restore of exception state
upon scope exit.

Additionally, unit tests are included to verify the
feature set of the class.

llvm-svn: 252994
2015-11-13 01:24:52 +00:00
Zachary Turner c946d46283 gtest - Make a `PythonTestSuite` base class for setup / teardown.
This allows other potential unit test suites (of which one is
forthcoming in a subsequent patch) to re-use the same initialization
and teardown of the GIL.

llvm-svn: 252993
2015-11-13 01:24:35 +00:00
Zachary Turner b359b10725 Delete `PyObjectToString` and use `PythonObject::Str()`.
The latter function, from PythonDataObjects, is Python 3 ready and
the former was not.

llvm-svn: 252992
2015-11-13 01:24:25 +00:00
Ying Chen 1f6689eae3 Revert "Another little stepping optimization: if any of the source step commands are running through a range "
- Revert because this commit introduce several failures in lldb test suite
- http://lab.llvm.org:8011/builders/lldb-x86_64-ubuntu-14.04-cmake/builds/8391
- This reverts commit 78943bb678c2893703ee4e8b41969372740c8a6f.

llvm-svn: 252980
2015-11-13 00:31:21 +00:00
Jim Ingham 127be38fb8 Another little stepping optimization: if any of the source step commands are running through a range
of addresses, and the range has no branches, instead of running to the last instruction and
single-stepping over that, run to the first instruction after the end of the range.  If there
are no branches in the current range, then the bytes right after it have to be in the current
function, and have to be instructions not data in code, so this is safe.  And it cuts down one
extra stepi per source range step.

Incidentally, this also works around a bug in the llvm Intel assembler where it treats the "rep" 
prefix as a separate instruction from the repeated instruction.  If that were at the end of a
line range, then we would put a trap in place of the repeated instruction, which is undefined
behavior.  Current processors just ignore the repetition in this case, which changes program behavior.
Since there would never be a line range break after the rep prefix, always doing the range stepping 
to the beginning of the new range avoids this problem.

<rdar://problem/23461686>

llvm-svn: 252963
2015-11-12 22:32:09 +00:00
Adrian McCarthy d9fa2b5487 Implement RegisterContext for Mini Dumps.
Differential Revision: http://reviews.llvm.org/D14591

llvm-svn: 252950
2015-11-12 21:16:15 +00:00
Zachary Turner 5b1ffdf674 Finish PyCallable -> PythonCallable conversion.
This finishes the effort to port python-wrapper.swig code over to
using PythonDataObjects.

Also included in this patch is the removal of `PyCallable` from
`python-wrapper.swig`, as it is no longer used after having been
replaced by `PythonCallable` everywhere.

There might be additional cleanup as followup patches, but it should
be all fairly simple and minor.

llvm-svn: 252939
2015-11-12 20:11:02 +00:00
Aidan Dodds 74b396d9cb Allow renderscript runtime to read MIPS target arguments.
llvm-svn: 252914
2015-11-12 17:39:42 +00:00
Zachary Turner 02bf92d226 Fix non-Windows build after r252906.
llvm-svn: 252909
2015-11-12 17:01:48 +00:00
Zachary Turner b58fb2f47a Begin converting uses of PyCallable to PythonCallable.
PyCallable is a class that exists solely within the swig wrapper
code.  PythonCallable is a more generic implementation of the same
idea that can be used by any Python-related interop code, and lives
in PythonDataObjects.h

The CL is mostly mechanical, and it doesn't cover every possible
user of PyCallable, because I want to minimize the impact of this
change (as well as making it easier to figure out what went wrong
in case this causes a failure).  I plan to finish up the rest of
the changes in a subsequent patch, culminating in the removal of
PyCallable entirely.

llvm-svn: 252906
2015-11-12 16:23:16 +00:00
Ramkumar Ramachandra 314b752513 Use uniqueness of C++ fully-qualified names to resolve conflicts
A very expected layout: source tree is in ~/src/llvm, the build directory is in
~/src/llvm-build, and the install location is in /usr/local/{lib,include}.

The DWARF information in /usr/local/lib/libLLVM.a for ilist.h points to
~/src/llvm-build/include/llvm/ADT/ilist.h. Now, when someone includes
"llvm/ADT/ilist.h" and links against /usr/local/lib/libLLVM.a. Disaster.

The DWARF information in libUser.so for ilist.h points to two locations: the one
in /usr/include, and the one in ~/src/llvm-build/include. LLDB gets confused.

Let's uniquify fully-qualified names and never trip on such a thing.

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

llvm-svn: 252898
2015-11-12 14:44:24 +00:00
Dawn Perchik 66dbb2809d [test] Fix comment.
llvm-svn: 252831
2015-11-12 00:43:22 +00:00
Zachary Turner b8058a5e6e Remove `FindSessionDictionary` and rely on PythonDataObjects.
This had been relegated to a simple forwarding function, so just
delete it in preparation of migrating all of these functions out
of python-wrapper.swig.

llvm-svn: 252803
2015-11-11 21:07:29 +00:00
Zachary Turner caab921f8a Convert python-wrapper.swig to use PythonDataObjects.
This only begins to port python-wrapper.swig over.  Since this
code can be pretty hairy, I plan to do this incrementally over a
series of patches, each time removing or converting more code
over to the PythonDataObjects code.

llvm-svn: 252788
2015-11-11 19:42:35 +00:00
Zachary Turner a140514733 Create `PythonTuple` and `PythonCallable` wrapper classes.
This adds PythonTuple and PythonCallable classes to PythonDataObjects.
Additionally, unit tests are provided that exercise this functionality,
including invoking manipulating and checking for validity of tuples,
and invoking and checking for validity of callables using a variety
of different syntaxes.

The goal here is to eventually replace the code in python-wrapper.swig
that directly uses the Python C API to deal with callables and name
resolution with this code that can be more easily tested and debugged.

llvm-svn: 252787
2015-11-11 19:42:27 +00:00
Zachary Turner d4870df9bf Python 3 - Use six in our embedded Python glue code.
llvm-svn: 252767
2015-11-11 17:59:57 +00:00
Zachary Turner 7841efbb92 Add a `PythonModule` class, and a root-level method for resolving names.
llvm-svn: 252765
2015-11-11 17:59:49 +00:00
Zachary Turner 7d7814ae8a Symlink the `six` module during swig generation.
llvm-svn: 252764
2015-11-11 17:59:34 +00:00
Todd Fiala fa93eb8f4f Marked test_qRegisterInfo_returns_{one_valid_result,all_valid_results} XFAIL on Darwin.
Tracked by:
https://llvm.org/bugs/show_bug.cgi?id=25486

llvm-svn: 252707
2015-11-11 06:32:44 +00:00
Todd Fiala 88722f714c Bump up test timeout interval on Darwin from 4 to 6 minutes.
We have several tests that TIMEOUT under heavy load but just need a bit
more time to complete.

llvm-svn: 252703
2015-11-11 05:10:07 +00:00
Todd Fiala f4500f0ea1 Mark TestCompletion.py test_symbol_name_dwarf XFAIL on Darwin.
This test fails most of the time when run under heavy load.  The dsym
variant doesn't seem to be failing.

Tracking XFAIL marker with:
https://llvm.org/bugs/show_bug.cgi?id=25485

llvm-svn: 252702
2015-11-11 05:01:30 +00:00
Todd Fiala b9b0c9c61d Mark TestTerminal.py as XFAIL on OS X.
See the following tracking bug:
https://llvm.org/bugs/show_bug.cgi?id=25484

llvm-svn: 252699
2015-11-11 03:43:05 +00:00
Sean Callanan a3444ffcdd Made the ClangASTImporter into a shared pointer, eliminating a race condition.
It used to be a unique pointer, and there could be a case where ClangASTSource
held onto a copy of the pointer but Target::Destroy destroyed the unique pointer
in the mean time.

I also ensured that there is a validity check on the target (which confirms that
a ClangASTImporter can be generated) before the target's shared pointer is
copied into ClangASTSource.

This race condition caused a crash if Target::Destroy was called and then later
the target objecct was deleted.

llvm-svn: 252665
2015-11-10 22:54:42 +00:00
Enrico Granata 608d67c152 Introduce a way for Languages to specify whether values of "reference types" are "nil" (not pointing to anything) or uninitialized (never made to point at anything)
This latter determination may or may not be possible on a per-language basis; and neither is mandatory to implement for any language

Use this knowledge in the ValueObjectPrinter to generalize the notion of IsObjCNil() and the respective printout

llvm-svn: 252663
2015-11-10 22:39:15 +00:00
Sean Callanan 5d16a4752f Updated a relative path in Makefile.rules to reflect the new testsuite location.
llvm-svn: 252657
2015-11-10 21:56:04 +00:00
Sean Callanan edd508b362 Fixed a bug where the size of a type was used instead of the size of a pointer.
llvm-svn: 252655
2015-11-10 21:48:05 +00:00
Todd Fiala d801575211 Updated lldb_pylint_helper to work with recent Python package changes.
llvm-svn: 252642
2015-11-10 20:01:33 +00:00
Enrico Granata 8cf44d9684 Upstream changes to the ValueObjectPrinter; nfc
llvm-svn: 252638
2015-11-10 19:07:58 +00:00
Enrico Granata 795128fc5d This test is now passing on Darwin
llvm-svn: 252637
2015-11-10 19:07:42 +00:00
Ramkumar Ramachandra f7e934d12a LLDBStandalone: Report nice errors on missing vars
Differential Revision: http://reviews.llvm.org/D13819

llvm-svn: 252624
2015-11-10 18:09:14 +00:00
Greg Clayton fe68904fa6 Fixed TypeMemberFunctionImpl to not use clang types directly but use the new CompilerDecl class to do the job in an abstract way.
Fixed a crash that would happen if you tried to get the name of a constructor or destructor by calling "getDeclName()" instead of calling getName() (which would assert and crash).

Added the ability to get function arguments names from SBFunction.

llvm-svn: 252622
2015-11-10 17:47:04 +00:00
Aidan Dodds c78e89962a Differential Revision: http://reviews.llvm.org/D14538
llvm-svn: 252605
2015-11-10 14:10:57 +00:00
Pavel Labath bf5210f8ed Mark TestMiInterpreterExec.test_lldbmi_thread_continue as flaky on linux
llvm-svn: 252596
2015-11-10 10:33:12 +00:00
Jason Molenda 649a607e11 Add support for tvos and watchos to ObjectFileMachO.
Add support for the new dyld shared cache format on
ios etc devices.
Small changes for classifying ObjC metadata symbols.

llvm-svn: 252588
2015-11-10 05:21:54 +00:00
Jason Molenda d91c3fdfb8 Upstream a small change from Greg Clayton for the REPL support:
"Modify internal breakpoints so they resolve just like external
breakpoints do. This allow you to set symbol and file + line internal
breakpoints and have them get updated correctly."

<rdar://problem/16931767>

llvm-svn: 252584
2015-11-10 04:18:12 +00:00
Jason Molenda dad8af4cf6 The other half of a change made by Enrico for trying to get a correct
triple for a process.  He writes, "Changes to the way setting the
triple works on a target so that if the target has passed a fully
specified triple, and the newly passed triple is not a revamp of
the current one, and the current one is fully specified, then do
not replace the existing triple."

Triple handling got a bit more complicated on mac with the addition
of ios/watchos/tvos and their simulators, and tracking the correct
os versions for them so expressions are compiled with the expected
APIs available to the user.

<rdar://problem/19820698> 

llvm-svn: 252583
2015-11-10 04:11:37 +00:00
Jason Molenda 57e1201e31 The MacOSXi386 ABI should be used for watchos simulator debug sessions.
Also, add an async error message if the dyld solib loaded callback function
can't find an ABI (which results in no solibs being loaded in the process).
This is a big error and we should call attention to it.

<rdar://problem/23471384> 

llvm-svn: 252581
2015-11-10 03:21:59 +00:00
Enrico Granata 97e31cdeed Code cleanup
llvm-svn: 252560
2015-11-10 00:21:10 +00:00
Enrico Granata 5696085a8f More rework of the updating logic for ValueObjectChild. Still just refactoring with no feature change
llvm-svn: 252553
2015-11-09 23:59:53 +00:00
Zachary Turner 88ab3c70e6 Use PythonDataObjects in swig helper functions.
Relying on manual Python C API calls is error prone, especially
when trying to maintain compatibility with Python 2 and Python 3.

This patch additionally fixes what appears to be a potentially
serious memory leak, in that were were incref'ing two values
returned from the session dictionary but never decref'ing them.
There was a comment indicating that it was intentional, but the
reasoning was, I believe, faulty and it resulted in a legitimate
memory leak.

Switching everything to PythonObject based classes solves both
the compatibility issues as well as the resource leak issues.

llvm-svn: 252536
2015-11-09 23:23:52 +00:00
Enrico Granata 99448c6367 Rework the way in which ValueObjectChild decides how to update itself; this is a slight refactoring that I need as part of a larger master plan. As such, should be NFC
llvm-svn: 252529
2015-11-09 23:07:55 +00:00
Tim Northover 974ff61c57 Avoid sending bare '*' and '}' in an lldb-server packet
They get treated as special RLE encoding symbols and packets get
corrupted. Most other packet types already know about this apparently,
but QEnvironment missed these two.

Should fix PR25300.

llvm-svn: 252521
2015-11-09 22:05:05 +00:00
Enrico Granata 6500061e92 Extend the TypeSystem's ShouldPrintAsOneLiner implementation so that the ValueObject itself also gets a say in the process; NFC
llvm-svn: 252516
2015-11-09 21:28:55 +00:00
Enrico Granata dc62ffd37b Add a way for source languages to "mark" ValueObjects with language-specific flags
In this way, when a language needs to tell itself things that are not bound to a type but to a value (imagine a base-class relation, this is not about the type, but about the ValueObject), it can do so in a clean and general fashion

The interpretation of the values of the flags is, of course, up to the language that owns the value (the value object's runtime language, that is)

llvm-svn: 252503
2015-11-09 19:27:34 +00:00
Todd Fiala cee6a6a63b Add --curses shortcut for specifying the curses-based test results formatter.
This commit closes the following review:
http://reviews.llvm.org/D14488

llvm-svn: 252498
2015-11-09 18:51:04 +00:00
Todd Fiala 247662b766 Added myself to the CODE_OWNERS.txt list for a few subsystems.
I'm primarily testing my git-svn setup.

llvm-svn: 252441
2015-11-09 01:24:36 +00:00
Todd Fiala 87f5e80614 Fix up curses_results.py for new package specification requirement.
This was breaking but probably missed since it is currently
infrequently used.

llvm-svn: 252438
2015-11-09 00:23:01 +00:00
Sylvestre Ledru da07885dcc autotools: Also link the new go libraries
llvm-svn: 252429
2015-11-08 22:30:34 +00:00
Davide Italiano a92bc3576a Fix pessimizing moves. Found by clang.
llvm-svn: 252409
2015-11-07 18:15:05 +00:00
Bruce Mitchener d31113f0b9 Add more NetBSD platform glue for lldb
Summary:
These changes are still incomplete, but  we are almost there.

Changes:
- CMake and gmake code
- SWIG code
- minor code additions

Reviewers: emaste, joerg

Subscribers: youri, akat1, brucem, lldb-commits, joerg

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

llvm-svn: 252403
2015-11-07 15:31:54 +00:00
Bruce Mitchener 9ccb970f23 Make lldb::endian::InlHostByteOrder() private.
Summary:
Since this is within the lldb namespace, the compiler tries to
export a symbol for it. Unfortunately, since it is inlined, the
symbol is hidden and this results in a mess of warnings when
building on OS X with cmake.

Moving it to the lldb_private namespace eliminates that problem.

Reviewers: clayborg

Subscribers: emaste, lldb-commits

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

llvm-svn: 252396
2015-11-07 04:40:13 +00:00
Chaoren Lin 6e8fbc6f39 Fix TestThreadSpecificBreakpoint.py on Linux after rL252355.
Summary:
On Linux, if a thread-specific conditional breakpoint was hit, it
won't necessarily be the thread that hit the breakpoint itself that
evaluates the conditional expression, so the thread that hit the
breakpoint could still be asked to stop, even though it hasn't been
allowed to run since the previous stop.

Reviewers: sivachandra, jingham

Subscribers: lldb-commits

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

llvm-svn: 252391
2015-11-07 02:16:31 +00:00
Enrico Granata 7123e2b5d7 Add SBType::IsAnonymousType() and relative plumbing in the debugger internals
For language that support such a thing, this API allows to ask whether a type is anonymous (i.e. has been given no name)

Comes with test case

llvm-svn: 252390
2015-11-07 02:06:57 +00:00
Zachary Turner 37a0fc483b Remove a debug print statement.
llvm-svn: 252384
2015-11-07 01:12:53 +00:00
Zachary Turner c22811bbcc Python 3 - Use __bool__() instead of __nonzero__() for truthiness.
Python has a complicated mechanism of checking an objects truthity.
This involves a number of steps, which end with calling two private
methods on an object (if they are implemented).  In Python 2 these
two methods are `__nonzero__` and `__len__`, and in Python 3 they
are `__bool__` and `__len__`.  Because we *also* define a __len__
method for certain iterable types, this was triggering a situation
in Python 3 where `__nonzero__` wasn't defined, so it was calling
`__len__`, which was returning 0 (for example an SBDebugger with
no targets), and as a result the truthosity was determined to be
False.

We fix this by correctly using ` __bool__` for Python 3, and leave
the behavior under Python 2 unchanged.

Note that this fix is only implemented in the SWIG generation
python script, and not the SWIG generation shell script.  Someone
more familiar than me with shell scripts will need to fix them
to support this for Python 3 if desired.

llvm-svn: 252382
2015-11-07 01:08:25 +00:00
Zachary Turner 8d13fab183 Python 3 - Don't use unbuffered I/O in text mode.
This is unsupported in Python 3.  This could also have been fixed
by using "wb" instead of "w", but it doesn't seem like writing the
session log absolutely *needs* to be unbuffered.

llvm-svn: 252381
2015-11-07 01:08:15 +00:00
Duncan P. N. Exon Smith 33e43ca608 lldb/ADT: Remove implicit ilist iterator conversions, NFC
Remove implicit ilist iterator conversions before reapplying r252372
(which will disallow them).

llvm-svn: 252378
2015-11-07 00:54:13 +00:00
Eugene Zelenko 26f34fb6df Fix some Clang-tidy warnings and formatting in recently added code.
Fixed Clang-tidy warnings:

* modernize-use-override;
* modernize-use-nullptr;
* modernize-use-default;
* readability-simplify-boolean-expr.

llvm-svn: 252374
2015-11-07 00:28:50 +00:00
Jim Ingham 0fcdac363c Make the language specifier to "break set" actually filter the names by their language. So for
instance:

break set -l c++ -r Name

will only break on C++ symbols that match Name, not ObjC or plain C symbols.  This also works
for "break set -n" and there are SB API's to pass this as well.

llvm-svn: 252356
2015-11-06 22:48:59 +00:00
Jim Ingham 569aaf9e1a Another optimization to keep down gdb-remote traffic. If we have suspended a thread while
running, don't request the thread status when deciding why we stopped.

llvm-svn: 252355
2015-11-06 22:45:57 +00:00
Sean Callanan 3b0dfe5a89 Fixed another issue with wrong case in #import.
llvm-svn: 252354
2015-11-06 22:43:55 +00:00
Chaoren Lin c0a55539e0 Fix Linux tests after r252348.
llvm-svn: 252353
2015-11-06 22:30:30 +00:00
Sean Callanan 8121b3f684 Fixed a problem where a test case referred to a
wrongly-capitalized header.

llvm-svn: 252351
2015-11-06 22:05:47 +00:00
Zachary Turner e73a0601bd Python 3 - Port use of string.maketrans and don't use sets.Set.
`sets.Set` has been deprecated in favor of `set` since 2.6, and
`string.maketrans` has to be special cased.  In Python 3 there
is `str.maketrans`, `bytes.maketrans`, and `bytearray.maketrans`
and you have to choose the correct one.  So we need to introduce
a runtime version check at this site.

llvm-svn: 252348
2015-11-06 21:37:33 +00:00
Zachary Turner 5821f79714 Python 3 - Use the exec function, not the exec statement.
exec statement is gone in Python 3, this version works in both.

llvm-svn: 252347
2015-11-06 21:37:21 +00:00
Zachary Turner 059e52c44c Python 3 - Fix some issues with class / instance variables in unittest2.
Explanation from a Python wizard (not me) about why this exhibited
different behavior under Python 2 and Python 3.

    `cmp` is a builtin_function_or_method in Python 2.7, which doesn't
    have a __get__ and doesn't qualify as a "descriptor".  Your lambda is a
    regular function which qualifies as a descriptor whose __get__ method
    returns a bound instance.

His suggested fix was to write

    sortTestMethodsUsing = staticmethod(cmp_)

However, I don't think `sortTestMethodsUsing` (or any of the other fields
of `TestLoader`) should be class attributes anyway.  They are all accessed
through self, so they should be instance attributes.  So the fix employed
here is to convert them to instance attributes.

Differential Revision: http://reviews.llvm.org/D14453
Reviewed By: Todd Fiala

llvm-svn: 252346
2015-11-06 21:37:07 +00:00
Bruce Mitchener ddcd2de0d1 [swig] Remove check_lldb_swig_executable_file_exists.
Summary:
Code that tried to find swig and then split the path into
a separate path and filename is being removed. The invoking
build system always provides the location of swig and we
don't need to split it into 2 pieces only to recombine it
a short time later.

Reviewers: zturner, domipheus

Subscribers: lldb-commits

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

llvm-svn: 252330
2015-11-06 18:53:29 +00:00
Zachary Turner 5cb8e67b17 Don't use module internal implementation details in our decorators.
We tried implementing something akin to a conditionalExpectedFailure
decorator for unittest2.  We did this by making use of some
implementation details of the unittest2 module.  In an effort to make
this work with unittest, this patch removes the reliance on the
implementation details.  I have a hard time wrapping my head around
how this all works with the deeply nested decorators, but the spirit
of the patch here is to do do the following: If the condition function
is true, use the original unittest2.expectedFailure decorator.  Otherwise
don't use any decorator, just call the test function.

Differential Revision: http://reviews.llvm.org/D14406
Reviewed By: tberghammer, labath

llvm-svn: 252326
2015-11-06 18:14:42 +00:00
Zachary Turner f0c3f68e33 Make Windows always use multiprocessing-pool.
We still see "Too many file handles" errors on Windows even with
lower numbers of cores.  It's not clear what the right balance is,
and the bar seems to move as more tests get added.  So just use
the strategy that works until we can investigate more deeply.

llvm-svn: 252325
2015-11-06 18:14:31 +00:00
Omair Javaid f24741d9dc Fix for AArch64 watchpoint cache corruption in case of ptrace failure
Same fix has been submitted for Arm.

Review can be found here:

Differential revision: http://reviews.llvm.org/D14051

llvm-svn: 252298
2015-11-06 12:56:34 +00:00
Enrico Granata 1dfcd650c8 Change the way we read data from the ObjC runtime
llvm-svn: 252272
2015-11-06 03:04:56 +00:00
Enrico Granata 16709ef9dd Add data formatters for NSError and NSException
llvm-svn: 252269
2015-11-06 02:43:32 +00:00
Jason Molenda 03fe45e759 A little more careful handling of platforms and unspecified unknown
vendors & oses, especially on Apple, to handle the new environment
where we have more than macosx or ios (now we have watchos and tvos).

llvm-svn: 252264
2015-11-06 01:43:36 +00:00
Jason Molenda 38cc302796 Jim thinks we shouldn't bother to pollute the svn repo with these
internal details, so I'll pull it back to just our own branch
of the sources.

llvm-svn: 252254
2015-11-06 00:55:17 +00:00
Jason Molenda 313a018bec Upstream a change to MemoryHistoryASan from Sean:
Author: Sean Callanan <scallanan@apple.com>
Date:   Tue Jun 23 13:52:24 2015 -0700

    Memory history should not crash if it can't inspect its data.  Added
    error handling.
            
    <rdar://problem/21231304>

llvm-svn: 252252
2015-11-06 00:43:31 +00:00
Jason Molenda 5e88be9f8c Add PlatformRemoteAppleWatch (apple watch), PlatformRemoteAppleTV (apple tv),
PlatformAppleWatchSimulator (apple watch simulator), PlatformAppleTVSimulator
(apple tv simulator).

llvm-svn: 252251
2015-11-06 00:22:53 +00:00
Bruce Mitchener 27801f4ff7 Reuse native curses(8) library on NetBSD
Summary:
The reason for it is limit of detecting ncurses on various systems. For
example, Ubuntu ships with <curses.h> and linkage from <ncurses.h>, <ncurses.h>
isn't detected by CMake. Detecting `<curses.h>` on NetBSD is reusing
conflicting header from the host curses(8) and pkgsrc's ncurses library.

ncurses ships on most (till conflicting) systems with curses.h. On NetBSD it
might be conflicting, so the ncurses headers are installed with pkgsrc to a
subdirectory "ncurses/".

Patch by Kamil Rytarowski. Thanks!

Reviewers: clayborg

Subscribers: youri, akat1, brucem, joerg, lldb-commits

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

llvm-svn: 252250
2015-11-06 00:21:18 +00:00
Jason Molenda 9d58c72848 Add a warning to TargetList::CreateTargetInternal
so when it is run on a kext (which won't activate
any platform plugins), you'll get a warning message
which may be helpful to the user.

llvm-svn: 252245
2015-11-05 23:59:30 +00:00
Bruce Mitchener a18231a5e9 [swig] Start of pylint on python build scripts.
Summary:
This does a broad first pass on cleaning up a lot of the noise when
using pylint on these scripts. It mostly addresses issues of:

* Mixed tabs and spaces.
* Trailing whitespace.
* Semicolons where they aren't needed.
* Incorrect whitespace around () and [].
* Superfluous parentheses.

There will be subsequent patches with further changes that build
upon these.

Reviewers: zturner, domipheus

Subscribers: lldb-commits

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

llvm-svn: 252244
2015-11-05 23:57:33 +00:00
Jason Molenda 1d3b356dde Use Process::IsAlive instead of just checking for eStateExited.
Two minor tweaks to GetLoadedDynamicLibrariesInfos.

llvm-svn: 252242
2015-11-05 23:54:29 +00:00
Jim Ingham 2125907ebd Add a generic API to return the Concrete type for a given abstract type
name and the execution context in which it is realized.

llvm-svn: 252240
2015-11-05 23:52:05 +00:00
Jason Molenda 60bdafbc16 GDBRemoteCommunicationClient::SendEnvironmentPacket should use the hex-encoded
env packet if the '*' character used for run length encoding is present.

llvm-svn: 252239
2015-11-05 23:51:05 +00:00
Bruce Mitchener b36e4c7b5a Fix cmake build on Mac OS X.
PlatformDarwin uses Host/XML.h which needs to find libxml2, and
so it needs to be told how to find the headers.

llvm-svn: 252238
2015-11-05 23:48:41 +00:00
Jason Molenda 8307ede58f Update the invocation to dsymForUUID (a script plugin used
at Apple, called by the DebugSymbols private framework to
find a dSYM for a UUID on mac) to include the latest
args we need to use when looking for kernel binaries etc.

llvm-svn: 252235
2015-11-05 23:44:08 +00:00
Jason Molenda 8ee4bff5ed Update for tvos or watchos builds.
llvm-svn: 252234
2015-11-05 23:42:18 +00:00
Jason Molenda 519dc14603 One more debug-build assert that addr_size is
a realistic value.

llvm-svn: 252233
2015-11-05 23:41:49 +00:00
Jason Molenda 13ca142fdb Initialize addr_size to match the size of lldb itself
as an initial seed value, instead of 4.

Add some asserts when lldb is built for development to
check that addr_size is a valid value.

llvm-svn: 252232
2015-11-05 23:41:08 +00:00
Chaoren Lin f2a37eeb8f Another import fix for OS X.
llvm-svn: 252230
2015-11-05 23:19:27 +00:00
Jason Molenda 943a42f924 Add support for one API used to detect if a process
is running under System Integrity Protection on 
Mac OS X 10.11.  The rootless_allows_task_for_pid() spi
(see debugserver RNBRemote.cpp) is the final SPI that
is used for this - should add support for that too at
some point.

llvm-svn: 252228
2015-11-05 23:04:57 +00:00
Jason Molenda a814f704d3 Add support for the new (added last week) llvm::Triple::WatchOS and ::TvOS
in places where we check for Triple::IOS.  They're mostly the same as far
as lldb is conerned.
.
Also add a base cass implementation for Process::IsAlive - Greg added this 
last year but it didn't get upstreamed.

llvm-svn: 252227
2015-11-05 23:03:44 +00:00
Jason Molenda 9b6b069a38 Add support for the armv7k ABI which has some small
changes from the normal armv7 ABI used on darwin.

llvm-svn: 252225
2015-11-05 22:51:29 +00:00
Jim Ingham 13c30d2f7d Let the process help figure out the Host OS if nobody else
can figure it out.

llvm-svn: 252224
2015-11-05 22:33:17 +00:00
Chaoren Lin 18da38edb3 Fix OS X tests.
llvm-svn: 252218
2015-11-05 22:00:47 +00:00
Chaoren Lin 2a7a94a655 Completely avoid building Apple simulator on non-Darwin platforms.
Summary:
This is a resubmission of r252179, but correctly ignores the source
files for other platforms.

Reviewers: granata.enrico, tberghammer, zturner, jingham

Subscribers: lldb-commits

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

llvm-svn: 252205
2015-11-05 20:45:29 +00:00
Sean Callanan a95b131c9b Better validation when we think a directory might be Xcode.app.
LLDB could otherwise get confused if it is (for example) in a
root that is meant to install into an Xcode.app but hasn't
been installed yet.  That way Xcode can fall back to the real
Xcode.app rather than trying to look for resources inside the
root.

llvm-svn: 252198
2015-11-05 19:46:12 +00:00
Zachary Turner c1b7cd72db Python 3 - Turn on absolute imports, and fix existing imports.
Absolute imports were introduced in Python 2.5 as a feature
(e.g. from __future__ import absolute_import), and made default
in Python 3.

When absolute imports are enabled, the import system changes in
a couple of ways:

1) The `import foo` syntax will *only* search sys.path.  If `foo`
   isn't in sys.path, it won't be found.  Period.  Without absolute
   imports, the import system will also search the same directory
   that the importing file resides in, so that you can easily
   import from the same folder.

2) From inside a package, you can use a dot syntax to refer to higher
   levels of the current package.  For example, if you are in the
   package lldbsuite.test.utility, then ..foo refers to
   lldbsuite.test.foo.  You can use this notation with the
   `from X import Y` syntax to write intra-package references.  For
   example, using the previous locationa s a starting point, writing
   `from ..support import seven` would import lldbsuite.support.seven

Since this is now the default behavior in Python 3, this means that
importing from the same directory with `import foo` *no longer works*.
As a result, the only way to have portable code is to force absolute
imports for all versions of Python.

See PEP 0328 [https://www.python.org/dev/peps/pep-0328/] for more
information about absolute and relative imports.

Differential Revision: http://reviews.llvm.org/D14342
Reviewed By: Todd Fiala

llvm-svn: 252191
2015-11-05 19:22:28 +00:00
Zachary Turner 185a7aadda Fix build on platforms that don't have dlfcn.h
llvm-svn: 252190
2015-11-05 19:22:06 +00:00
Zachary Turner 71d468be66 Python 3 - Fix usage of `unicode` in unittest2.
llvm-svn: 252189
2015-11-05 19:21:56 +00:00
Jim Ingham 56584698ac Add a comment explaining TypeImpl.
llvm-svn: 252188
2015-11-05 19:20:39 +00:00
Jim Ingham 6192d1c050 Remove Copy and Paste error in a comment.
llvm-svn: 252184
2015-11-05 18:51:48 +00:00
Chaoren Lin edd0e2639e Use lldb::pid_t instead of pid_t.
Reviewers: granata.enrico

Subscribers: lldb-commits

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

llvm-svn: 252183
2015-11-05 18:49:03 +00:00
Chaoren Lin 803cf14e52 Revert "Do not build any of the simulator material on non-Darwin"
This breaks the cmake build on all non-darwin platforms.

This reverts commit ff6cc332dd6654620e3408d06f8f49a0c9b3cd41.

rL252179

llvm-svn: 252182
2015-11-05 18:49:02 +00:00
Zachary Turner cc8aa4f619 Python 3 - Apply 2to3 `filter` fixer to unittest2.
llvm-svn: 252181
2015-11-05 18:38:02 +00:00
Enrico Granata daf1c8bfc7 Do not build any of the simulator material on non-Darwin
llvm-svn: 252179
2015-11-05 18:23:10 +00:00
Chaoren Lin 5911b66335 Fix build for platforms without ObjC++.
Reviewers: jingham, jasonmolenda

Subscribers: lldb-commits

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

llvm-svn: 252143
2015-11-05 03:30:45 +00:00
Chaoren Lin fc5d9dd4b5 Fix TestGoFormatters.py.
llvm-svn: 252133
2015-11-05 02:17:21 +00:00
Jim Ingham c29e698b8e Add IRExecutionUnitSP to lldb-forward and use it instead of hand-rolling in place.
llvm-svn: 252129
2015-11-05 01:50:42 +00:00
Zachary Turner e6ba053037 Python 3 - Don't use `os.path.walk`, it's removed in Py3.
It was deprecated even in 2.7, but not removed until 3.x.  os.walk
provides all of the same functionality and is the correct way to
do this now.

llvm-svn: 252127
2015-11-05 01:33:54 +00:00
Zachary Turner 5167115cf6 Python 3 - Use universal_newlines=True in subprocess.Popen.
This follows the spirit of a previous patch which did essentially
the same thing.  In Python 3, when you use Popen.communicate(),
you get back a bytes object which cannot normally be treated as
a string.  We could decode this manually, but universal_newlines=True
does this automatically, and there's no disadvantage to doing so
even on Python 2.  So just enable it always.

llvm-svn: 252126
2015-11-05 01:33:44 +00:00
Chaoren Lin ad6b54983d Fix build on Linux.
llvm-svn: 252124
2015-11-05 01:23:19 +00:00
Jim Ingham 2471434cc2 CommandObjectProxy needs to proxy GenerateHelpText as well as
everything else.

<rdar://problem/18383591>

llvm-svn: 252122
2015-11-05 01:18:07 +00:00
Enrico Granata 5f92a130ff Teach LLDB how to directly launch processes on the iOS simulator
This allows for command-line debugging of iOS simulator binaries (as long as UI is not required, or a full UI simulator has previously been otherwise launched), as well as execution of the LLDB test suite on the iOS simulator

This is known to compile on OSX 10.11 GM - feedback from people on other platforms and/or older versions of OSX as to the buildability of this code is greatly appreciated

llvm-svn: 252112
2015-11-05 00:46:25 +00:00
Jim Ingham c77ce7b626 LLDB needs a mutex around getopt_long_only() function calls to avoid multi-threading option parsing issues.
<rdar://problem/17052381>

llvm-svn: 252111
2015-11-05 00:38:39 +00:00
Ryan Brown 2dd84882fc Add go data formatters.
Differential Revision: http://reviews.llvm.org/D13878

llvm-svn: 252109
2015-11-05 00:24:36 +00:00
Jim Ingham 51148e9f94 AddInitialArguments -> AddArguments, and we pass in the struct_address and push it too. All the
callers had to do this by hand and we ended up never actually adding initial arguments and then
reusing them by passing in the struct address separately, so the distinction wasn't needed.

llvm-svn: 252108
2015-11-05 00:24:18 +00:00
Jim Ingham a6bc55613e One of the File constructors was missing initializers. Didn't seem
to cause any problems, but still...

llvm-svn: 252106
2015-11-05 00:22:19 +00:00
Adrian McCarthy 38e2d9e6a1 Fix x64 build on Windows, which was broken by my refactor from last week.
No build bots build x64 on Windows yet, but this was spotted by another developer who emailed me directly.

llvm-svn: 252100
2015-11-04 23:47:55 +00:00
Davide Italiano 7769b4a1d0 [FreeBSD] Add missing overrides.
llvm-svn: 252094
2015-11-04 23:12:17 +00:00
Zachary Turner 88a12f5526 Handle keyword args on our patched Popen methods.
Python 3 introduces the `timeout` keyword argument on Popen.wait().
If our patched version doesn't support keyword arguments, then when
the internal Python implementation attempts to call wait() with the
keyword argument, things will explode.

Such as my head, after I finally figured out what was happening.

llvm-svn: 252092
2015-11-04 23:03:21 +00:00
Zachary Turner 9858899148 Don't access class members inside of `__del__`.
Apparently this doesn't work as the attribute doesn't exist anymore.

llvm-svn: 252091
2015-11-04 23:03:10 +00:00
Davide Italiano 7d3e66a58f [Core] Avoid default in switch() that covers all the cases.
Unbreak the build for FreeBSD + -Werror.

llvm-svn: 252079
2015-11-04 21:31:16 +00:00
Jim Ingham 2c38141423 Add "zero_memory" option to IRMemoryMap::FindSpace & IRMemoryMap::Malloc. Zero out
the Expression ResultVariable so it's in a known initial state.

llvm-svn: 252072
2015-11-04 20:32:27 +00:00
Tamas Berghammer 2a2d39d760 Revert r252001 as it brake TestCppIncompleteTypes on all platforms
llvm-svn: 252067
2015-11-04 19:39:32 +00:00
Tamas Berghammer aaaa157673 Fix TestMemoryRead after r252035
llvm-svn: 252065
2015-11-04 19:32:01 +00:00
Todd Fiala e028e4e3bb OS X: fix the Xcode debugserver lookup code when LLDB.framework does not contain a debugserver
LLDB recently started supporting LLDB.framework without a
debugserver in it.  When that happens, the Xcode-included debugserver
is searched for and used.  This change fixes the code that looks for
Xcode when the housing process is not Xcode.  In particular, this
addresses the problem where python is running the test suite and
the LLDB.framework does not contain a debugserver.

llvm-svn: 252059
2015-11-04 18:10:31 +00:00
Todd Fiala d8078ffcfc Fix test infrastructure when using xunit output.
Our test reporting infrastructure needed module names to change based on the python package layout.

llvm-svn: 252058
2015-11-04 17:10:40 +00:00
Enrico Granata 40d3570c44 Option letter o was already in use; use an uppercase E instead
llvm-svn: 252035
2015-11-04 02:12:09 +00:00
Jim Ingham 5d0729300c Add a few useful methods to ThreadSafeDense{Map,Set}. Not used yet.
llvm-svn: 252031
2015-11-04 01:39:05 +00:00
Zachary Turner ff836df6a4 Revert "Python 3 - Don't add the _d suffix to the symlink on Windows."
This reverts commit e59c95ca936f5a0a8abb987b8605fd8bf82b03b6.

This was a mistake on my part.  The real problem was with my
environment.  I was using a release interpreter to try to load
my debug extension module.  I noticed this after I finally managed
to get into my extension module's init method, and then it segfaulted
with heap errors due to mismatched CRT (debug vs. release)

llvm-svn: 252030
2015-11-04 01:26:48 +00:00
Jim Ingham fe617b1e99 Fix a shadowed ivar in SearchFilterByModuleListAndCU.
llvm-svn: 252029
2015-11-04 01:24:04 +00:00
Zachary Turner b20ef35645 Python 3 - Don't add the _d suffix to the symlink on Windows.
In Python 2, a debug extension module required an _d suffix, so
for example the extension module `_lldb` would be backed by the file
`_lldb_d.pyd` if built in debug mode, and `_lldb.pyd` if built in
release mode.  In Python 2, although undocumented, this seems to
no longer be the case, and even for a debug extension module, the
interpreter will only look for the `_lldb.pyd` name.

llvm-svn: 252026
2015-11-04 01:03:57 +00:00
Zachary Turner bbc5b46a10 Python 3 - Use universal_newlines when calling subprocess.check_output
By default in Python 3, check_output() returns a program's output as
an encoded byte sequence.  This means it returns a Py3 `bytes` object,
which cannot be compared to a string since it's a different fundamental
type.

Although it might not be correct from a purist standpoint, from a
practical one we can assume that all output is encoded in the default
locale, in which case using universal_newlines=True will decode it
according to the current locale.  Anyway, universal_newlines also
has the nice behavior that it converts \r\n to \n on Windows platforms
so this makes parsing code easier, should we need that.  So it seems
like a win/win.

llvm-svn: 252025
2015-11-04 01:03:47 +00:00
Jim Ingham 1c58d5ac90 Actually implement Section::GetSectionData.
llvm-svn: 252024
2015-11-04 01:02:43 +00:00
Jim Ingham 6d9880a6b4 Try a little harder to provide a legit CWD to argdumper if
the user hasn't provided one.

llvm-svn: 252023
2015-11-04 01:02:06 +00:00
Enrico Granata b766292951 Fix an issue where LLDB would truncate summaries for string types without producing any evidence thereof
llvm-svn: 252018
2015-11-04 00:02:08 +00:00
Greg Clayton 26014690aa All instance variables start with "m_". Fix "options" to be "m_options".
llvm-svn: 252013
2015-11-03 23:23:59 +00:00
Greg Clayton dee40e72ba Fix __fp16 types so we can display them and use them in expressions.
I am not adding a test case for this since I don't know how portable the __fp16 type is between compilers and I don't want to break the test suite.

<rdar://problem/22375079>

llvm-svn: 252012
2015-11-03 23:23:22 +00:00
Ryan Brown 0fbd187d79 Fix build for go parser unittest.
llvm-svn: 252007
2015-11-03 22:46:37 +00:00
Greg Clayton fc1e77a986 Fix a deadlock when connecting to a remote GDB server that might not support all packets that lldb-server or debugserver supports. The issue was the m_last_stop_packet_mutex mutex was being held by another thread and it was deadlocking getting the thread list. We now try to lock the m_last_stop_packet_mutex, and only continue if we successfully lock it. Else we fall back to qfThreadInfo/qsThreadInfo.
<rdar://problem/22140023>

llvm-svn: 252005
2015-11-03 22:42:04 +00:00
Greg Clayton 0644900004 With the new modules debugging, we have seen cases where clang is not emitting full definitions for types that are member variables of classes. If we try to make a class with a member where the type of the class in a forward declaration, clang will assert and crash and bring down the IDE. This is not acceptable so we need to work around it. We work around it by making sure that if we have a member that is an instance (not a pointer or reference) of a class/struct/union, that it is a complete type. If it isn't then we emit an error to let the user know to file a bug against the compiler, and then we make the class complete, but empty. We also do this for base classes elsewhere. We use the DWARF to help layout the type, so we will get all instance variables correct, but we just won't have visibility into this instance variable.
llvm-svn: 252001
2015-11-03 22:40:07 +00:00
Tamas Berghammer 3bd1def3ec Revert change comitted in accidentally as r251992
llvm-svn: 251997
2015-11-03 22:31:50 +00:00
Tamas Berghammer 5c28ae12ce Use std::list::splice in TaskPool to avoid an allocation
Using std::list::splice to move an element from one list to an other
avoids the allocation of a new element and a move of the data.

llvm-svn: 251993
2015-11-03 22:29:20 +00:00
Tamas Berghammer 276743f060 wip
llvm-svn: 251992
2015-11-03 22:29:16 +00:00
Zachary Turner 46f1784bac Python 3 - Fix checking of string types in unittest2 module.
This patch actually introduces a dependency from unittest2 to
six.  This should be ok since both packages are in our own
repo, and we assume a sys.path of the top-level script that
can find the third party packages.  So unittest2 should be
able to find six.

llvm-svn: 251983
2015-11-03 21:37:42 +00:00
Zachary Turner bac6e4f75b Introduce seven.cmp_ and use it instead of cmp
llvm-svn: 251982
2015-11-03 21:37:27 +00:00
Ramkumar Ramachandra d5fa22620b Squelch a silly warning regarding an extra 'default' in 'case'
Let the editor also clean up whitespace for that file.

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 251979
2015-11-03 21:29:52 +00:00
Zachary Turner 234860133b Python 3 - Fix some issues in unittest2.
unittest2 was using print statements in a few places, and also
using the `cmp` function (which is removed in Python 3).  Again,
we need to stop using unittest2 and using unittest instead, but
this seems like an easier route for now.

llvm-svn: 251978
2015-11-03 21:02:00 +00:00
Zachary Turner 9618980a19 Python 3: Modernize exception raising syntax.
Old-style: `raise foo, bar`
New-style: `raise foo(bar)`

These two statements are equivalent, but the former is an error in
Python 3.

llvm-svn: 251977
2015-11-03 21:01:45 +00:00
Zachary Turner c07138f6a0 Python 3 - modernize exception catching syntax.
Old-style syntax:  `except Exception, e:`
New-style syntax:  `except Exception as e:`

These two statements are identical, except that the former has
been deprecated for may versions, and was removed in Python 3.

This converts everything to use the new syntax (which also works
in Python 2).  I had to convert unittest2 as well.  What we really
need to do is just delete unittest2, and use unittest instead since
it is a standard module that ships with every Python distribution.
But this is the path of least resistance for now, although at
some point we will really need to do it.

llvm-svn: 251968
2015-11-03 19:49:05 +00:00
Zachary Turner 19474e1801 Remove `use_lldb_suite` from the package, and don't import it anymore.
This module was originally intended to be imported by top-level
scripts to be able to find the LLDB packages and third party
libraries.  Packages themselves shouldn't need to import it,
because by the time it gets into the package, the top-level
script should have already done this.  Indeed, it was just
adding the same values to sys.path multiple times, so this
patch is essentially no functional change.

To make sure it doesn't get re-introduced, we also delete the
`use_lldb_suite` module from `lldbsuite/test`, although the
original copy still remains in `lldb/test`

llvm-svn: 251963
2015-11-03 19:20:39 +00:00
Zachary Turner bb03a4660f Python 3 - Don't use `commands` module anymore.
The `commands` module was deprecated in 2.7 and removed in 3.x.
As a workaround, we introduce a new module `seven` in
lldbsuite.support, and write helper functions in there that delegate
to the commands module if it is available, and re-implement their
functionality for cases where it is not available.

llvm-svn: 251959
2015-11-03 18:55:22 +00:00
Enrico Granata 32d68fec56 Revert r251882 as it breaks the test suite
llvm-svn: 251956
2015-11-03 18:35:17 +00:00
Pavel Labath 63103c9279 Fix flakyness in TestWatchLocationWithWatchSet
Two threads in the test can hit the watchpoint simultaneously. Fix the test to account for that.

llvm-svn: 251954
2015-11-03 18:17:21 +00:00
Tamas Berghammer 53feb8c10b Skip TestBacktraceAll on android-arm
The android compiler can't compile the inferior because of an issue
in the standard library.

llvm-svn: 251951
2015-11-03 18:03:47 +00:00
Pavel Labath daa51d4a96 Leave TestAttachResume as flakey on linux
there must be (at least) one more race hidden there...

llvm-svn: 251950
2015-11-03 17:33:31 +00:00
Pavel Labath 862432c90e Fix race during process detach
Summary:
The code which was preventing the usage of the OS plugin while detach is in
progress also prevented us to update the thread list correctly. This resulted
in an empty thread list, which confused the detaching logic. Change the
condition do only do what it says (disable the usage of the OS plugin).

Reviewers: clayborg, jingham

Subscribers: lldb-commits

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

llvm-svn: 251932
2015-11-03 16:05:18 +00:00
Ravitheja Addepally 46bcbaafb5 Changes for Bug 25251
Summary:
The solution to bug 24074,rL249673 needed
to parse the function information from the Dwarf in order
to set the SymbolContext. For that, GetFunction was called
for the parent in GetTypeForDIE, which parses the
ChildParameters and in the flow, GetTypeForDIE was called
for one of the sibling die and so an infinite
loop was triggered by calling GetFunction repeatedly for the
same function.

The changes in this revision modify the GetTypeForDIE to only
resolve the function context in the Type Lookup flow and so
prevent the infinite loop.

A testcase has also been added to check for regression in the
future and a test vector had been added to the testcase of
24074.

Reviewers: jingham, tberghammer, clayborg

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

llvm-svn: 251917
2015-11-03 14:24:24 +00:00
Mohit K. Bhakkad f22bc197e1 [LLDB][MIPS] Fix GetUserRegisterInfoCount to count no of regs which are physically present
Reviewers: clayborg, labath.
Subscribers: jaydeep, bhushan, sagar, nitesh.jain, lldb-commits.
Differential Revision: http://reviews.llvm.org/D13859

llvm-svn: 251906
2015-11-03 09:13:45 +00:00
Mohit K. Bhakkad 13763c3046 [LLDB][Watchpoint] Change ignore_count condition location to fix watchpoint ignore feature for architectures with watchpoint_exceptions_received=before
Reviewers: jingham.
Subscribers: clayborg, jaydeep, bhushan, sagar, nitesh.jain, lldb-commits.
Differential Revision: http://reviews.llvm.org/D13296

llvm-svn: 251905
2015-11-03 09:04:33 +00:00
Enrico Granata 7339b9d75f Do not try to copy host memory from address 0
llvm-svn: 251889
2015-11-03 02:34:43 +00:00
Jim Ingham 19a63fc6fa Add the ability to pass an EvaluateExpressionOptions when you make a UserExpression. This
isn't used in this commit but will be in a future commit.

llvm-svn: 251887
2015-11-03 02:11:24 +00:00
Zachary Turner 95c453a221 Tighten up sys.path, and use absolute imports everywhere.
For convenience, we had added the folder that dotest.py was in
to sys.path, so that we could easily write things like
`import lldbutil` from anywhere and any test.  This introduces
a subtle problem when using Python's package system, because when
unittest2 imports a particular test suite, the test suite is detached
from the package.  Thus, writing "import lldbutil" from dotest imports
it as part of the package, and writing the same line from a test
does a fresh import since the importing module was not part of
the same package.

The real way to fix this is to use absolute imports everywhere.  Instead
of writing "import lldbutil", we need to write "import
lldbsuite.test.util".  This patch fixes up that and all other similar
cases, and additionally removes the script directory from sys.path
to ensure that this can't happen again.

llvm-svn: 251886
2015-11-03 02:06:18 +00:00
Enrico Granata c0d8f0ca7d Emit an error message if the current working directory does not exist when the user is trying to launch argdumper to do shell expansion
llvm-svn: 251882
2015-11-03 01:47:19 +00:00
Pavel Labath 2a3dc2526b Fix usage of removed decorator in TestExpressions
llvm-svn: 251880
2015-11-03 01:39:03 +00:00
Oleksiy Vyalov e7df5f5d41 Provide ADB port forwarding support for abstract sockets.
http://reviews.llvm.org/D14262

llvm-svn: 251879
2015-11-03 01:37:01 +00:00
Oleksiy Vyalov 1ef2cb9f71 Fix module cache sym links' creation for symbol files.
http://reviews.llvm.org/D14264

llvm-svn: 251871
2015-11-03 00:30:19 +00:00
Pavel Labath 23d59c5c0f Revert "Make new dotest.py executable"
This was a misunderstanding on my part. The new dotest.py is not meant to be executed directly.

llvm-svn: 251863
2015-11-02 23:41:44 +00:00
Pavel Labath 05e1f49478 Revert "Remove the __import__ hack of lldbtest_config."
The hack still seems to be necessary. Putting it back in until we figure out why.

llvm-svn: 251862
2015-11-02 23:39:09 +00:00
Enrico Granata adb4d36d76 This test case does not actually depend on Cocoa; Foundation is good enoguh
llvm-svn: 251861
2015-11-02 23:37:55 +00:00
Zachary Turner 9dbf62f927 Create lldbsuite.support package with `seven` file.
This file will be useful for filling in the gaps where `six` is
missing some things we need.

llvm-svn: 251847
2015-11-02 22:41:01 +00:00
Enrico Granata 5ed60285e0 Add a sketched out section on adding Language and LanguageRuntime plugins for language support
llvm-svn: 251844
2015-11-02 22:26:55 +00:00
Zachary Turner a7cd16b252 Revert part of r239007 related to creating the Python symlink.
This has apparently been broken since June, but only on non-Windows.
Perhaps nobody noticed it because if the symlink is already there
it won't try to re-create it, and nobody ever tried doing a clean
build.

In any case, I will let the original author attempt to fix this if
he is still interested.  the problem is that in the normal case
of not setting BUILD_SHARED_LIBS and simply running ninja, it would
link _lldb.so to a non-existent location, creating a dangling
symlink.

llvm-svn: 251840
2015-11-02 22:13:13 +00:00
Enrico Granata 407b5c62ba Change ValueObject::IsLogicalTrue so that it starts by asking the applicable Language plugin before using the C-style rule
llvm-svn: 251838
2015-11-02 21:52:05 +00:00
Ryan Brown f6660e24d7 Move go expression tests to the new location.
llvm-svn: 251835
2015-11-02 21:28:18 +00:00
Todd Fiala 0c3f8135be First pass on www docs: Adding Programming Language Support to LLDB
We'll hook this up to the main page after Greg, Sean and others
iterate on it to a useful point.

llvm-svn: 251831
2015-11-02 21:05:28 +00:00
Pavel Labath 48c6b52f92 [dosep] Fix-up callers of process_dir, after it got its argument removed
llvm-svn: 251830
2015-11-02 20:54:25 +00:00
Oleksiy Vyalov 7e02139dfc Calculate size of sockaddr_un manually for abstract sockets:
- SUN_LEN doesn't work because strlen(sun_path) == 0
 - sizeof(sockaddr_un) doesn't work on Android.

llvm-svn: 251825
2015-11-02 20:04:18 +00:00
Zachary Turner 2264df40df Remove the __import__ hack of lldbtest_config.
I think the underlying problem was fixed by r251819, but I can't
reproduce the problem.  So this is to check whether it does in
fact fix the problem.

llvm-svn: 251822
2015-11-02 19:38:58 +00:00
Ryan Brown 998c8a1c1c Create an expression parser for Go.
The Go interpreter doesn't JIT or use LLVM, so this also
moves all the JIT related code from UserExpression to a new class LLVMUserExpression.

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

Fix merge

llvm-svn: 251820
2015-11-02 19:30:40 +00:00
Zachary Turner 7d564544eb Make dosep correctly invoke the top-level script when forking out
packages/Python/lldbsuite is now a Python package, and it relies
on its __init__.py being called to do package-level initialization.
If you exec packages/Python/lldbsuite/dotest.py directly, you won't
get this package level initialization, and things will fail.  But
without this patch, this is exactly what dosep itself does.  To
launch the multi-processing fork, it was hardcoding a path to
dotest.py and exec'ing it from inside the package.

The fix here is to get the path of the top-level script, and
then exec'ing that instead.  A more robust solution would involve
refactoring the code so that dosep execs some internal script that
imports lldbsuite, but that's a bit more involved.

Differential Revision: http://reviews.llvm.org/D14157
Reviewed by: Todd Fiala

llvm-svn: 251819
2015-11-02 19:19:49 +00:00
Hafiz Abid Qadeer c10e82087b Handle the options and parameters separator in every MI command
Summary:
As per the following link, the "--" separator can appear between the options
and parameters of any MI command. Previously this separator was only
handled by the `-data-disassemble` MI command. I have moved the relevant
code into `CMICmdBase` so that any MI command can handle the
aforementioned separator.

https://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Input-Syntax.html#GDB_002fMI-Input-Syntax

Reviewers: ki.stfu

Subscribers: lldb-commits

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

llvm-svn: 251793
2015-11-02 11:43:40 +00:00
Eugene Zelenko dbb0abbf47 Fix Clang-tidy modernize-use-nullptr warnings in include/lldb/API and source/API; other minor fixes.
Other fixes should reduce number of readability-redundant-smartptr-get and readability-implicit-bool-cast.

llvm-svn: 251733
2015-10-31 01:22:59 +00:00
Enrico Granata 2ef8822951 Harden this test case to do the right thing in the face of compiler changes
llvm-svn: 251732
2015-10-31 01:19:27 +00:00
Eugene Zelenko adb5b1dfc2 Fix Clang-tidy modernize-use-override warnings in include/lldb/Expression, source/Expression and tools/lldb-mi; other minor fixes.
llvm-svn: 251730
2015-10-31 00:43:59 +00:00
Jim Ingham 98e6daf1fb Abstract the notion of the truth value of an expression result, for use
in breakpoint conditions.

llvm-svn: 251727
2015-10-31 00:02:18 +00:00
Jim Ingham d612918367 Make the error return more explicit when an SBValue has no value.
llvm-svn: 251722
2015-10-30 21:43:15 +00:00
Jim Ingham 8731ad72aa Add a few missing includes.
llvm-svn: 251721
2015-10-30 21:32:25 +00:00
Jim Ingham 9f521f22d4 Fix an error message (the debugger was invalid, not the target.)
llvm-svn: 251720
2015-10-30 21:32:03 +00:00
Eugene Zelenko 16fd7511b2 Fix Clang-tidy modernize-use-nullptr warnings in source/Breakpoint; other minor fixes.
llvm-svn: 251716
2015-10-30 18:50:12 +00:00
Hafiz Abid Qadeer 8c6fd6e70a Remove 2 lines missed in earlier commit (r251636).
llvm-svn: 251704
2015-10-30 16:20:40 +00:00
Pavel Labath fe1eb306fe Mark another TestEvents test as flaky on linux
I don't think anything has changed recently - the test was always flaky, but
only very rarely. Still, it is causing noise in the buildbots.

llvm-svn: 251699
2015-10-30 14:08:19 +00:00
Pavel Labath 4761f782e1 Make new dotest.py executable
llvm-svn: 251684
2015-10-30 03:52:27 +00:00
Todd Fiala 45557e34d9 Added real editline tests.
These are two simple tests that make sure single line and
multiline content are processed and received by Editline.cpp.

Fancier tests to come...

llvm-svn: 251681
2015-10-30 02:54:52 +00:00
Enrico Granata 8627209b43 Some test cases that need the lldbExec path were failing because lldbExec was turning out to be None even though it was being validly set by dotest.py
It turns out that lldbtest_config was being imported locally to "lldbsuite.test" instead of globally, so when the test cases got individually brought by a global import via __import__ by unittest2, they did not see the lldbtest_config import, and ended up importing a new separate copy of it, with lldbExec unset

This is a simple hackaround that brings lldbtest_config to global visibility and makes sure the configuration data is correctly shared

llvm-svn: 251678
2015-10-30 01:09:54 +00:00
Eugene Zelenko ca64d675f1 Fix Clang-tidy modernize-use-nullptr warnings in source/Plugins/Process/Utility headers; other minor fixes.
llvm-svn: 251676
2015-10-30 00:55:29 +00:00
Eugene Zelenko ecf34922f0 Fix Clang-tidy modernize-use-nullptr warnings in include/lldb/Symbol; other minor fixes.
llvm-svn: 251673
2015-10-30 00:04:20 +00:00
Enrico Granata e5839f3eae Remove two #if0ed regions of code that we were using for an experiment but don't really want
llvm-svn: 251670
2015-10-29 23:53:34 +00:00
Enrico Granata 7a33621fa5 Add a --offset option to memory read that allows one to specify, given a type, how many sizeof(type) bytes to speak before starting to read memory
llvm-svn: 251668
2015-10-29 23:40:24 +00:00
Enrico Granata 61024e6c0e Do not accept nullptr descriptions as valid summaries to be printed
llvm-svn: 251663
2015-10-29 22:29:06 +00:00
Enrico Granata 9eeabff0b5 Add a --language (-l) option to the formatter delete commands in order to allow removing formatters from language categories
This is slightly harder to test because formatters cannot be added to language categories, so deletions are irreversible (in a debugger run)
I plan to add a test case soon, but I need to think about the right approach to obtain one

llvm-svn: 251660
2015-10-29 22:18:05 +00:00
Jim Ingham 72b5f9bb97 Give the test class it's own name (it was reusing the name from TestCompletions.py).
llvm-svn: 251657
2015-10-29 21:54:50 +00:00
Eugene Zelenko 406d446e78 Fix Clang-tidy modernize-use-nullptr warnings in remaining files in include/lldb/Target; other minor fixes.
llvm-svn: 251648
2015-10-29 20:33:47 +00:00
Eugene Zelenko cf5f0ee20c Fix Clang-tidy modernize-use-nullptr warnings in some files in include/lldb/Target; other minor fixes.
llvm-svn: 251647
2015-10-29 20:12:40 +00:00
Enrico Granata 204aa1d980 Add an 'internal' kind of summary to support one-off subclasses of TypeSummaryImpl
llvm-svn: 251642
2015-10-29 18:58:13 +00:00
Hafiz Abid Qadeer d122fd8d06 Better handle the arguments common to all MI commands.
Summary:
I observed that eclipse was passing --thread-group for many other commands
then we are currently handling. Looking at the MI documentation, the
following link states that each MI command accept the --thread and
--frame option. Looking at the GDB implementation, it seems that apart
from these 2, --thread-group is also handled the same way.

https://sourceware.org/gdb/onlinedocs/gdb/Context-management.html#Context-management

So instead of handling those arguments in every comamnds, I have moved
them into the base class and removed them from elsewhere. Now any command
can use these arguments. The patch seems big but most of the changes are
mechanical.

Reviewers: ki.stfu

Subscribers: lldb-commits

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

llvm-svn: 251636
2015-10-29 16:30:47 +00:00
Pavel Labath 6e813bbf27 Fixup lldb-argdumper cmake build
forgot to rename in one spot.

llvm-svn: 251628
2015-10-29 14:14:24 +00:00
Pavel Labath 7d557910c6 Fix flakyness in TestChangeProcessGroup
The test was verifying that the pid of the child is not equal to its process
group by searching for text substrings. This failed in the rare cases when the
pid actually *was* a substring of the process group (even though they were not
equal).

Change the test to use SB API and do proper numeric comparisons.

llvm-svn: 251626
2015-10-29 13:44:09 +00:00
Todd Fiala 15c0fbaae1 Rename argdumper to lldb-argdumper
http://reviews.llvm.org/D14169

llvm-svn: 251616
2015-10-29 05:07:12 +00:00
Pavel Labath 5935dbdf29 Leave TestAttachResume as flakey on linux
there must be (at least) one more race hidden there...

llvm-svn: 251590
2015-10-29 01:18:45 +00:00
Chaoren Lin 41c502318c Correctly include LLVM_EXTERNAL_CLANG_SOURCE_DIR.
Reviewers: sas, ovyalov

Subscribers: lldb-commits

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

llvm-svn: 251589
2015-10-29 00:48:38 +00:00
Eugene Zelenko 69c3387bcc Fix Clang-tidy modernize-use-nullptr warnings in include/lldb/Expression and Host; other minor fixes.
llvm-svn: 251587
2015-10-29 00:27:24 +00:00
Jason Molenda a26a1eff93 Xcode suggested enabling a "no common blocks" warning
(whatever that is) and wanted to clean up some duplicated
entries in the project files.  

llvm-svn: 251586
2015-10-29 00:21:14 +00:00
Jason Molenda eba832bea6 Explicitly cast size_t var to (uint64_t) when printf format is PRIx64.
llvm-svn: 251585
2015-10-29 00:13:42 +00:00
Jason Molenda d76b2a42f2 Static analyzer noticed that a null get_pending_items_caller could
be used.  Guard against that.

llvm-svn: 251584
2015-10-29 00:08:03 +00:00
Jason Molenda 8fe108766f Fix potential null deref; after SymbolContextSpecifier::SymbolContextMatches
has tested that sc.function is null, it would try to deref sc.function.
It should be calling sc.symbol here.

llvm-svn: 251583
2015-10-28 23:49:55 +00:00
Enrico Granata 22f637a30b Remove an unused local variable
llvm-svn: 251581
2015-10-28 23:36:44 +00:00
Jason Molenda d10f6aa40e Revert r251578. I was in the middle of editing the commit message
and decided to not commit the change, but accidentally committed
it anyway.

This was based on a static analysis complaint; it thought there
was a code path where AdbClient::PushFile would call AdbClient::ReadSyncHeader
and AdbClient::ReadSyncHeader wouldn't set data_len.  But in that
case, the Error object returned will be Fail and we won't use
the data_len or response_id contents.

llvm-svn: 251580
2015-10-28 23:31:03 +00:00
Greg Clayton a37068885a Make sure we don't over specify an architecture when we connect to KDP and use the CPU type and subtype to fill out an architecture. We do this by letting the vendor be an unspecified unknown, or any. We also grab the target architecture, get the KDP host arch, and then merge the two before putting it back into the target.
Also change MH_PRELOAD to be use "unspecified unknown" (any) for the OS and vendor since these mach files can really be anything.

llvm-svn: 251579
2015-10-28 23:26:59 +00:00
Jason Molenda 21e36c4f89 Initialize data_len to 0 in source/Plugins/Platform/Android/AdbClient.cpp
llvm-svn: 251578
2015-10-28 23:23:44 +00:00
Jim Ingham a309efef39 Change Target::EvaluateExpression to take an ExecutionContextScope * rather than a
StackFrame * (StackFrame is an ExecutionContextScope.)  That allows you to call an
expression on a particular Thread, but not using the context of any particular frame.
That in turn is useful for injecting utility functions that don't actually depend on
locals/self/etc of the current frame.

I also had to include StackFrame.h in a couple of places so the compiler knew
how to downcast StackFrame to ExecutionContextScope.

<rdar://problem/22852953>

llvm-svn: 251564
2015-10-28 22:23:17 +00:00