Commit Graph

13609 Commits

Author SHA1 Message Date
Todd Fiala 46a4e34dcc Adds candidate formatter for replacing legacy summary results.
Also cleans up some usages of strings where symbolic names
were safer and made more sense.

Try a test run with something like this to check out the new
basic results formatter (not used by default):

time test/dotest.py --executable `pwd`/build/Debug/lldb --results-formatter lldbsuite.test.basic_results_formatter.BasicResultsFormatter --results-file stdout

This will yield something like:

Testing: 1 test suites, 8 threads
1 out of 1 test suites processed - TestHelp.py
Test Results
Total Test Methods Run (excluding reruns): 13
Test Method rerun count: 0

===================
Test Result Summary
===================
Success:              13
Expected Failure:      0
Failure:               0
Error:                 0
Unexpected Success:    0
Skip:                  0

Whereas something with a bit of error will look more like this:

42 out of 42 test suites processed - TestSymbolTable.py
Test Results
Total Test Methods Run (excluding reruns): 166
Test Method rerun count: 0

===================
Test Result Summary
===================
Success:              93
Expected Failure:     10
Failure:               2
Error:                 2
Unexpected Success:    0
Skip:                 59

Details:
FAIL:
TestModulesInlineFunctions.ModulesInlineFunctionsTestCase.test_expr_dsym
(/Users/tfiala/work/lldb-tot/git-svn/lldb/packages/Python/lldbsuite/test/lang/objc/modules-inline-functions/TestModulesInlineFunctions.py)
FAIL:
TestModulesInlineFunctions.ModulesInlineFunctionsTestCase.test_expr_dwarf
(/Users/tfiala/work/lldb-tot/git-svn/lldb/packages/Python/lldbsuite/test/lang/objc/modules-inline-functions/TestModulesInlineFunctions.py)
ERROR: TestObjCCheckers.ObjCCheckerTestCase.test_objc_checker_dsym
(/Users/tfiala/work/lldb-tot/git-svn/lldb/packages/Python/lldbsuite/test/lang/objc/objc-checker/TestObjCCheckers.py)
ERROR: TestObjCCheckers.ObjCCheckerTestCase.test_objc_checker_dwarf
(/Users/tfiala/work/lldb-tot/git-svn/lldb/packages/Python/lldbsuite/test/lang/objc/objc-checker/TestObjCCheckers.py)

The Details header only prints if there are any issues to report.  The
Details section has tags that should get picked up using the normal
issue text scrapers (e.g. buildbot).

Test numbers reported are strictly test method runs.

The rerun bit at the top is in support of the multi-pass test
runner code (to run the low-load, single worker test pass for
tests that failed the first run), which I'll be able to put up
for review after this.

ResultsFormatters now have the ability to indicate they replace
the legacy summary, as this one does.

Once we come to agreement on the exact format, I will switch
us over to using this by default.

llvm-svn: 254530
2015-12-02 18:48:38 +00:00
Mohit K. Bhakkad 6846bc8de2 [LLDB][MIPS] fix watchpoint searched on client side for same masked variables
Reviewers: clayborg.
Subscribers: jaydeep, bhushan, sagar, nitesh.jain,lldb-commits.
Differential Revision: http://reviews.llvm.org/D15106

llvm-svn: 254522
2015-12-02 17:45:02 +00:00
Tamas Berghammer 2a7043cd70 XFAIL TestReturnValue for linux i386 clang 3.5-3.6
The test failing most likely because clang 3.5 and 3.6 uses an incorrect
ABI for returning small structs from  a function.

llvm-svn: 254507
2015-12-02 13:36:17 +00:00
Tamas Berghammer 3cb132a0f4 Fix "process load/unload" on android
On android the symbols exposed by libdl (dlopen, dlclose, dlerror)
prefixed by "__dl_". This change moves the handling of process
load/unload to the platform object and override it for android to
handle the special prefix.

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

llvm-svn: 254504
2015-12-02 11:58:51 +00:00
Tamas Berghammer fcf334b824 Revert "Added support for -gmodule debugging when debug info is left in the .o files on Darwin."
The commit caused a test failure on the linux buildbot in
TestDataFormatterSynthVal.

llvm-svn: 254502
2015-12-02 11:35:54 +00:00
Abhishek Aggarwal 296e063d8f PTRACE ABI to read FXSAVE area for 32-bit inferior
Summary:
 - Problem occurs when:
    -- 32-bit inferiors run on x86_32 machine and
       the architecture doesn't have AVX feature

    -- This causes FPRType to be set to eFPRTypeFXSAVE

    -- PTRACE_GETFPREGS was being used to read FXSAVE area

    -- For 32-bit inferiors running on x86_32 machine,
       PTRACE_GETFPREGS reads FSAVE area and not FXSAVE area

 - Changed ptrace API to PTRACE_GETREGSET for 32-bit inferiors
    -- This reads FPR data in FXSAVE format.
    -- For 64-bit inferiors, no change has been made.

 - Modified XFAIL for TestReturnValue.py
    -- Earlier, this test was passing for Linux OS
    -- Now, it passes for Android OS as well

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

Reviewers: ovyalov, jingham, lldb-commits, tberghammer, labath

Subscribers: jevinskie, labath, tberghammer, danalbert

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

llvm-svn: 254499
2015-12-02 09:40:17 +00:00
Greg Clayton 5dfc4a4d02 Added support for -gmodule debugging when debug info is left in the .o files on Darwin.
This is done by finding the types that are forward declarations that come from a module, and loading that module's debug info in a separate lldb_private::Module, and copying the type over into the current module using a ClangASTImporter object. ClangASTImporter objects are already used to copy types from on clang::ASTContext to another for expressions so the type copying code has been around for a while.

A new FindTypes variant was added to SymbolVendor and SymbolFile:

size_t
SymbolVendor::FindTypes (const std::vector<CompilerContext> &context, bool append, TypeMap& types);

size_t
SymbolVendor::FindTypes (const std::vector<CompilerContext> &context, bool append, TypeMap& types);

The CompilerContext is a way to represent the exact context of a type and pass it through an agnostic API boundary so that we can find that exact context elsewhere in another file. This was required here because we can have a module that has submodules, both of which have a "foo" type.

I am not able to add tests for this yet as we currently don't build our C/C++/ObjC binaries with the clang binary that we build. There are some driver issues where it can't find the header files for the C and C++ standard library which makes compiling these tests hard. We can't also guarantee that if we are building with clang that it supporst the exact format of -gmodule debugging that we are trying to test. We have had other versions of clang that had a different implementation of -gmodule debugging that we are no longer supporting, so we can't enable tests if we are building with clang without compiling something and looking at the structure of the DWARF that was generated to ensure that it is the format we can actually use.

llvm-svn: 254476
2015-12-02 00:43:32 +00:00
Pavel Labath 00fea63627 Revert "Fix race during process interruption"
The android buildbot gets quite flaky after this change. I'm reverting it while I investigate.

llvm-svn: 254430
2015-12-01 17:59:56 +00:00
Pavel Labath df55f522bd Fix race during process interruption
Summary:
The following situation was occuring in TestAttachResume:
- we did a "continue" from a breakpoint (which involves a private start-stop to step over the
  breakpoint)
- after receiving the stop-reply from the step-over, we issue a "detach" (which requires a
  process interrupt)
- at this moment, the public state is "running", private state is "about-to-be-stopped" (the
  stopped event was broadcast, but it was not received yet)
- StopForDestroyOrDetach (public thread) notes the public state is running, sends an interrupt
  request to the private thread
- private thread gets the eBroadcastBitInterrupt (before the eStateStopped message), and asks the
  process plugin to stop (via Halt())
- process plugin says it has nothing to do as the process is already stopped
- private thread shrugs and carries on. receives the stop event, restores the breakpoint and
  resumes the process.
- after a while, the public thread times out and says it failed to stop the process

This patch does the following:
- splits Halt() into two functions, private and public, their usage depends on the context
  - public Halt(): sends eBroadcastBitInterrupt to the private thread and waits for the Stop
    event
  - HaltPrivate(): asks the plugin to stop and makes a note that the halt was requested. When the
    next stop event comes it sets the interrupt flag on it.
- removes HijackPrivateProcessEvents(), as the only user (old Halt()) has gone away
- removes the m_currently_handling_event hack, as the new Halt() does not need it
- adds a use_run_lock parameter to public Halt() and WaitForProcessToStop(). This was needed
  because RunThreadPlan uses Halt() while holding the run lock and we don't want Halt() to take
  it away from him.

Reviewers: clayborg, jingham

Subscribers: lldb-commits

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

llvm-svn: 254403
2015-12-01 11:28:47 +00:00
Sagar Thakur d4eb7cc3f3 [LLDB][MIPS] Clear bug 25194 - LLDB-Server Assertion raised when single stepping on MIPS
This patch will clear bug 25194 - LLDB-Server Assertion raised when single stepping on MIPS. The problem was that while emulating instructions, old and new pc values would have garbage value in their upper 32 bits. Therefore checking if pc was changed (old_pc == new_pc) would always return false, because of which pc was not getting updated.

/* If we haven't changed the PC, change it here */
if (old_pc == new_pc)
{
    new_pc += 4;
    Context context;
        return false;
}

Reviewers: tberghammer, clayborg
Subscribers: dsanders, lldb-commits, mohit.bhakkad, bhushan, jaydeep, nitesh.jain
Differential: http://reviews.llvm.org/D14633
llvm-svn: 254379
2015-12-01 05:44:18 +00:00
Jaydeep Patil 27c25b1591 [LLDB][MIPS] Change ARCHFLAG for MIPS
SUMMARY:
    For MIPS, ARCH is specified without m.

    Reviewers: clayborg
    Subscribers: nitesh.jain, mohit.bhakkad, sagar, bhushan and lldb-commits
    Differential Revision: http://reviews.llvm.org/D14978

llvm-svn: 254376
2015-12-01 05:24:17 +00:00
Enrico Granata 7aafb6a1d5 Fix a bug where one-lining display of child values would ignore the user's choice of format
llvm-svn: 254349
2015-12-01 00:04:52 +00:00
Zachary Turner 6f12d3335d Unpack the output on the client, completing the cycle.
llvm-svn: 254341
2015-11-30 22:31:24 +00:00
Zachary Turner 24a95f852d Have swig_bot actually run swig, and send back the output.
llvm-svn: 254340
2015-11-30 22:31:13 +00:00
Adrian McCarthy fe06b5ad04 Fix hang in global static initialization
Differential Revision: http://reviews.llvm.org/D15092

llvm-svn: 254338
2015-11-30 22:18:43 +00:00
Ewan Crawford 8b244e21d7 [RS] Support RenderScript struct allocations
This patch adds functionality for dumping allocations of struct elements. This involves:

    + Jitting the runtime for details on all the struct fields.

    + Finding the name of the struct type by looking for a global variable of the same type, which will have been reflected back to the java host code.

    + Using this struct type name to pass into expression evaluation for pretty printing the data for the dump command.

llvm-svn: 254294
2015-11-30 10:29:49 +00:00
Pavel Labath abadc22172 [LLGS] Don't forward I/O when process is stopped
Summary:
This makes sure we do not attempt to send output over the gdb-remote protocol when the client is
not expecting it (i.e., after sending the stop-reply packet). Normally, this should not happen
(the process cannot generate output when it is stopped), but due to the fact that pty
communication is asynchronous in the linux kernel (llvm.org/pr25652), we may sometimes get this
output too late. Instead, we just hold the output, and send it next time we resume. This is not
ideal, but at least it makes sure we do not violate the remote protocol. Given that this happens
extremely rarely it's not worth trying to work around it with sleeps or something like that.

I also remove the m_stdio_communication_mutex, as all of LLGS is now single-threaded anyway.

Reviewers: tberghammer, ovyalov

Subscribers: lldb-commits

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

llvm-svn: 254200
2015-11-27 13:33:29 +00:00
Tamas Berghammer a88453b069 Re-add an xfail removed by r254163
The test is flakey but it fails too often with gcc 4.9.2 on x86_64 to
be marked only as expected flakey.

llvm-svn: 254194
2015-11-27 10:50:33 +00:00
Tamas Berghammer fd29986946 Fix TestRegisters.py on arm
Previously it tried to write a bit in the FPSCR register marked as
do not modify what failed on some device.

llvm-svn: 254166
2015-11-26 17:43:24 +00:00
Tamas Berghammer e4fbec4a37 Remove some xfail-s fixed by r253026
These tests were fixed by r253026 but they was failing on the linux
build bot because of a system setup problem. Remove xfail from them
after we fixed the build bot.

llvm-svn: 254163
2015-11-26 16:11:57 +00:00
Tamas Berghammer 54b0a1f8eb Make some of the tests in TestRegisters.py arm compatible
Differential revision: http://reviews.llvm.org/D15010

llvm-svn: 254153
2015-11-26 15:02:35 +00:00
Tamas Berghammer b4e95a50d7 Add 64/128 bit arm neon register definitions on linux
Differential revision: http://reviews.llvm.org/D14985

llvm-svn: 254152
2015-11-26 15:02:31 +00:00
Zachary Turner 5de07b078d Be *stupider* about what constitutes a supported language binding.
We were trying to be super smart and find all the supported language
bindings.  This led to us scanning the directory and treating all
subdirectories as language binding directories.  This makes it
hard to add unrelated code in this folder.

Besides, we only support one at the moment - Python.  And when new
ones are added it will be trivial to just add their names to a list.

So this patch gets stupider about how to look for language binding
subfolders.  Just put them in a list, and use the list.

llvm-svn: 254078
2015-11-25 17:49:47 +00:00
Pavel Labath 02559bbfd7 Enable TestMiBreak on Linux
test reliably passed last 100 buildbot runs. Enable it and see what happens.

llvm-svn: 254072
2015-11-25 16:29:04 +00:00
Zachary Turner 933626229b Another hack to fix the build bot.
This script really should not be assuming every subdirectory is
a language directory for swig generation.  Using a hack to get
this working for now, but this should be solved once this script
is re-written similar to how prepare_bindings was.

llvm-svn: 254037
2015-11-24 23:11:54 +00:00
Zachary Turner f6a30d3172 Fix build after swig_bot_lib changes.
llvm-svn: 254033
2015-11-24 22:27:02 +00:00
Zachary Turner 48102bd186 swig-bot - Close the socket when shutting down.
llvm-svn: 254026
2015-11-24 21:35:58 +00:00
Zachary Turner 9befc01064 Include config settings in the archive, and extract on the remote.
llvm-svn: 254025
2015-11-24 21:35:50 +00:00
Zachary Turner cc3609362e Make swig_bot server support Ctrl+C
llvm-svn: 254024
2015-11-24 21:35:40 +00:00
Zachary Turner 0a2899ca82 swig_bot remote path connection / preliminary implementation.
With this patch, the client will package up all the required
inputs into a compressed zip file, establish a connection to the
server, send the input to the server, and wait for the server to
send a response (in this case the response is just echoed back to
the client).

This gets the network communication in place, and in a subsequent
patch I will follow up with the code that actually runs swig on
the server and sends back the output instead of echoing back the
input.

llvm-svn: 254023
2015-11-24 21:35:32 +00:00
Zachary Turner 2db36097b4 First implementation of swig_bot.py
This version supports local generation only.  It's intentionally
stupid, and does not support any kind of dependency checking.
If you run the script, it's going to call SWIG.  While this is
a slow process, we are going to combine the use of the swig bot
with checked in static bindings, meaning that it won't be terribly
important to only regenerate the bindings when the input files
have actually changed.

A side benefit of this is that the implementation is drastically
simpler.

This is all experimental at the moment, but it duplicates a lot
of the logic currently found in prepare_bindings.py.  There was
not a good way to reuse some of the logic without invasive changes
on that script, and since this script is still experimental, it
makes sense to just copy them over, and if / when this becomes
more mature, we can get rid of the other ones.

llvm-svn: 254022
2015-11-24 21:35:17 +00:00
Ed Maste 860e29e0c3 Temporarily add expectedFailureFreeBSD to tests that fail to detect Clang on FreeBSD
On FreeBSD we may get Clang via CC=cc or CC=/usr/bin/cc.

llvm.org/pr25626

llvm-svn: 254006
2015-11-24 18:59:51 +00:00
Ed Maste 43bd918475 Add expectedFlakeyFreeBSD to TestBatchMode failing on buildbot
This test was already expectedFlakeyLinux for occasional failures on the
Linux buildbot. It seems the new FreeBSD buildbot fails the same way on
occasion.

llvm.org/pr25172

llvm-svn: 254002
2015-11-24 18:34:17 +00:00
Ed Maste ae82bf7947 Remove expectedFailureFreeBSD decorator from now-passing tests
These pass on my FreeBSD stable/10 desktop and my (not-yet-connected)
FreeBSD 11-CURRENT buildbot

llvm.org/pr20548

llvm-svn: 254001
2015-11-24 18:30:19 +00:00
Ed Maste 99ab4f42b7 Remove expectedFailureFreeBSD from passing ThreadExitTestCase::test_with_dwarf
This passes on my FreeBSD stable/10 desktop and my new FreeBSD
11-current buildbot (which is not yet hooked up to the buildmaster).

llvm.org/pr18190

llvm-svn: 254000
2015-11-24 18:22:37 +00:00
Ed Maste 3868a72d4c Add expectedFailureFreeBSD decorators for new Python fd leak
llvm.org/pr25624

llvm-svn: 253998
2015-11-24 18:05:56 +00:00
Omair Javaid 9d0f44bf8a Disable forcing -marm (A32 instruction set) while running testsuite on arm targets.
Differential revision: http://reviews.llvm.org/D14823

llvm-svn: 253973
2015-11-24 10:35:03 +00:00
Oleksiy Vyalov afd6ce4d29 Prevent ProcessGDBRemote from launching local debug server in case of remote debug server connection failure.
http://reviews.llvm.org/D14895

llvm-svn: 253906
2015-11-23 19:32:24 +00:00
Mohit K. Bhakkad 5a998ed7a6 [LLDB][MIPS] Getting 0 index for H/W watchpoint is not necessarily an error
Reviewers: jaydeep.
Subscribers: bhushan, sagar, nitesh.jain, lldb-commits.
Differential Revision: http://reviews.llvm.org/D14860

llvm-svn: 253864
2015-11-23 12:19:59 +00:00
Jason Molenda e92a74ce64 Add code to PlatformDarwin and HostInfoMacOSX so they return the
correct OS type when running on an apple tv or apple watch.
Also, in TargetList::CreateTargetInternal, check that a platform
is returned by GetPlatformForArchitecture fallback instead of 
adding it to the vector of platforms unconditionally; we can end up
crashing when we call a member function on it later.

<rdar://problem/23601982>, <rdar://problem/21292886>

llvm-svn: 253763
2015-11-21 04:00:43 +00:00
Zachary Turner a3037bd5f9 Create `lldbsuite.support.fs` and move `find_executable` there.
I have plans to reuse this function in another script, so raising
this out of prepare_bindings allows this.

llvm-svn: 253755
2015-11-21 01:39:04 +00:00
Greg Clayton 638b9275d8 Fix Xcode project after recent Windows core file changes.
llvm-svn: 253739
2015-11-20 23:53:53 +00:00
Adrian McCarthy f7d1893f5b Enable saving of mini dumps with lldb process save-core.
Also adds SB API to save a core and tests that use it.

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

llvm-svn: 253734
2015-11-20 23:09:11 +00:00
Sean Callanan aa4d7596f4 Newer versions of the ObjC runtime have an extra field in objc_opt_t.
llvm-svn: 253732
2015-11-20 22:59:57 +00:00
Siva Chandra 7dcad3178b Revert "Make skipIf support the not_in function (second attempt)."
Summary: This reverts commit 70dca28976ee8137acce2cc203dd394f4d761276.

Reviewers: amccarth, zturner

Subscribers: lldb-commits

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

llvm-svn: 253704
2015-11-20 20:30:36 +00:00
Ed Maste d550002c9d Call Platform::SetHostPlatform in the NetBSD platform only on NetBSD
Patch by Kamil Rytarowski

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

llvm-svn: 253699
2015-11-20 19:32:58 +00:00
Enrico Granata 7b57d87ed7 Use the system clang, since this support should now be in; does not un-xfail the test yet
llvm-svn: 253697
2015-11-20 19:25:39 +00:00
Adrian McCarthy f9a2697e13 Revert "FOO"
Accidentally commited before I was done.

This reverts commit 2ec2da4ee52780582d5e9c88b2e982a688fbdbe1.

llvm-svn: 253685
2015-11-20 18:18:21 +00:00
Adrian McCarthy af75dab383 FOO
llvm-svn: 253684
2015-11-20 18:15:14 +00:00
Adrian McCarthy 4d5d1dd6d5 Make skipIf support the not_in function (second attempt).
llvm-svn: 253683
2015-11-20 18:14:24 +00:00
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