Commit Graph

13879 Commits

Author SHA1 Message Date
Adrian McCarthy 510ca1b0b7 Replace tabs with spaces for consistent indentation. No actual text changes.
llvm-svn: 259834
2016-02-04 22:20:30 +00:00
Siva Chandra 77b326f39d Revert "Use an artifical namespace so that member vars do not hide local vars."
Summary:
This reverts commit 8af14b5f9af68c31ac80945e5b5d56f0a14b38e4.
Reverting as it breaks a few tests on Mac.

Reviewers: spyffe

Subscribers: lldb-commits

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

llvm-svn: 259823
2016-02-04 20:08:40 +00:00
Jim Ingham 97c2868362 Make HostThread SetName work on OS X. GetName doesn't currently work, the code that was in
GetName actually got the queue name not the thread name and anyway didn't actually work to do
that.  So I just deleted it with a fixme.

<rdar://problem/24487554>

llvm-svn: 259818
2016-02-04 19:42:32 +00:00
Siva Chandra 375882dddb Use an artifical namespace so that member vars do not hide local vars.
Summary:
While evaluating expressions when stopped in a class method, there was a
problem of member variables hiding local variables. This was happening
because, in the context of a method, clang already knew about member
variables with their name and assumed that they were the only variables
with those names in scope. Consequently, clang never checks with LLDB
about the possibility of local variables with the same name and goes
wrong. This change addresses the problem by using an artificial
namespace "$__lldb_local_vars". All local variables in scope are
declared in the "$__lldb_expr" method as follows:

    using $__lldb_local_vars::<local var 1>;
    using $__lldb_local_vars::<local var 2>;
    ...

This hides the member variables with the same name and forces clang to
enquire about the variables which it thinks are declared in
$__lldb_local_vars. When LLDB notices that clang is enquiring about
variables in $__lldb_local_vars, it looks up local vars and conveys
their information if found. This way, member variables do not hide local
variables, leading to correct evaluation of expressions.

A point to keep in mind is that the above solution does not solve the
problem for one specific case:

    namespace N
    {
        int a;
    }

    class A
    {
    public:
        void Method();
        int a;
    };

    void
    A::Method()
    {
        using N::a;
        ...

        // Since the above solution only touches locals, it does not
        // force clang to enquire about "a" coming from namespace N.
    }

Reviewers: clayborg, spyffe

Subscribers: lldb-commits

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

llvm-svn: 259810
2016-02-04 18:38:35 +00:00
Zachary Turner 7a5382de82 Move some of the common decorators to decorators.py.
This doesn't attempt to move every decorator.  The reason for
this is that it requires touching every single test file to import
decorators.py.  I would like to do this in a followup patch, but
in the interest of keeping the patches as bite-sized as possible,
I've only attempted to move the underlying common decorators first.
A few tests call these directly, so those tests are updated as part
of this patch.

llvm-svn: 259807
2016-02-04 18:03:01 +00:00
Adrian McCarthy 25bfa7859c Provide arguments for all the format string placeholders!
Log message was wrong because an argument was missing.

llvm-svn: 259793
2016-02-04 15:35:55 +00:00
Pavel Labath 1dafd45e6f Enable test_lldbmi_settings_set_target_run_args_before on linux
Test has passed last 200 runs of the build bot.

llvm-svn: 259777
2016-02-04 11:51:07 +00:00
Pavel Labath e1649a7853 Mark TestProcessIO as flaky on android
previously, I have marked only one test as flaky, but now I noticed another test failing with the
same error. I am going to assume all of them are flaky.

llvm-svn: 259775
2016-02-04 09:53:37 +00:00
Pavel Labath fcf08db0f9 Add verbose logging support to gdb-remote tests
Summary:
gdb-remote tests are not able to use the same logging mechanisms as the rest of our tests, and
currently we get no host logs from them, even though the tests themselves have logging
capability. This commit changes that. When user specifies that he would like to log the
gdb-remote channel (--channel gdb-remote argument to dotest.py), we write detailed logs to the
<TEST_ID>-host.log file, just like we would in the case of regular tests. If this argument is not
specified, we only log the serious messages to stderr, which matches the existing behaviour.

Reviewers: tfiala, tberghammer

Subscribers: lldb-commits

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

llvm-svn: 259774
2016-02-04 09:53:33 +00:00
Ewan Crawford 0d2bfcfb34 [RenderScript] Add command for recalculating allocation details
Patch replaces the --refresh flag removed in r258800 with it's own command, 'language renderscript allocation refresh'.
Since there is no reason this functionality should be tied to another command as an option. 
The command itself simply re-JITs all our cached information about allocations.

llvm-svn: 259773
2016-02-04 09:44:23 +00:00
Jim Ingham a1ca8148a1 Fix a little threading thinko in StartPrivateStateThread - don't pass stack variables
as args to a pthread_create function...

<rdar://problem/24485206>

llvm-svn: 259738
2016-02-04 01:34:33 +00:00
Zachary Turner 3abbf6f6db Fix missing module qualification of subprocess.PIPE.
llvm-svn: 259724
2016-02-03 22:53:18 +00:00
Oleksiy Vyalov e551051a58 Pass socket scheme as part of debug server listen URL.
http://reviews.llvm.org/D16861

llvm-svn: 259714
2016-02-03 22:02:43 +00:00
Reid Kleckner de9dfe7888 Fix sign conversion warnings in LLDB Python unittests
llvm-svn: 259689
2016-02-03 20:48:09 +00:00
Davide Italiano f5935a0abc [NetBSD] Remove dead code.
PR:		http://reviews.llvm.org/D16818
llvm-svn: 259686
2016-02-03 20:13:50 +00:00
Jim Ingham ac96dd3335 Remove a stray ;.
llvm-svn: 259685
2016-02-03 19:49:03 +00:00
Jim Ingham 22eeb7227c The SetStopInfo from a Mach Exception was setting the stop
reason to None when we stop due to a trace, then noticed that
we were on a breakpoint that was not valid for the current thread.
That should actually have set it back to trace.

This was pr26441 (<rdar://problem/24470203>)

llvm-svn: 259684
2016-02-03 19:45:31 +00:00
Zachary Turner 62d3a6570a Move some android platform functions to lldbplatformutil.
My eventual goal is to move all of the test decorators to their
own module such as `decorators.py`.  But some of the decorators
use existing functions in `lldbtest.py` and conceptually the
functions are probably more appropriately placed in lldbplatformutil.
Moreover, lldbtest.py is a huge file with a ton of random utility
functions scattered around, so this patch also workds toward the
goal of reducing the footprint of this one module to a more
reasonable size.

So this patch moves some of them over to lldbplatformutil with the
eventual goal of moving decorators over to their own module.

Reviewed By: Tamas Berghammer, Pavel Labath
Differential Revision: http://reviews.llvm.org/D16830

llvm-svn: 259680
2016-02-03 19:12:30 +00:00
Aidan Dodds 1b6785a1df Add ability to override JIT expr compiler options.
Runtimes should be able to pass custom compilation options to the JIT for their stack frame. This patch adds a custom expression options member class to LanguageOptions, and modifies the clang expression evaluator to check the current runtime for those options. If those options are available on the runtime, they are passed to the clang compiler.

Committed for Luke Drummond.
Differential Revision: http://reviews.llvm.org/D15527

llvm-svn: 259644
2016-02-03 12:33:05 +00:00
Pavel Labath 5f496fb941 Remove skipUnlessListedRemote test decorator
This decorator was used in only one test, and it's behaviour was quite complicated. It skipped
if:
- test was remote
- platform was *not* android

I am not aware of anyone running tests with this configuration (and even then, I am not aware of
a reason why the test should not pass), but if TestLoadUnload starts breaking for you after this
commit, please disable the test with
@expectedFailureAll(remote=True, oslist=[YOUR_PLATFORM])

llvm-svn: 259642
2016-02-03 11:51:25 +00:00
Pavel Labath 1b58f5cbbb Fix an off-by-one in SocketTest::DecodeHostAndPort
65535 is still a valid port. This should fix the android failures we were getting when we chose
to connect over 65535 to the remote lldb-server.

llvm-svn: 259638
2016-02-03 11:12:23 +00:00
Ewan Crawford 75f0ff5ba1 [RenderScript] Use LLVM DWARF language enum
A DWARF language vender extension for RenderScript was added to LLVM in r259348(http://reviews.llvm.org/D16409)
We should use this generated enum instead of the hardcoded value.

RenderScript is also based on C99 with some extensions, so we want to use ClangASTContext when RS is detected.

Reviewers:  clayborg
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D16766

llvm-svn: 259634
2016-02-03 09:17:03 +00:00
Jim Ingham 39f7353a60 The compiler may use "line number 0" to indicate compiler generated goo that it can't
track a source for.  When we are pushing breakpoints and stepping past function prologues,
also push past code from line 0 immediately following the prologue end.

<rdar://problem/23730696>

llvm-svn: 259611
2016-02-03 00:07:23 +00:00
Zachary Turner 0d473d12fe Fix inverted conditional in TestInferiorAssert.py
llvm-svn: 259608
2016-02-02 23:56:45 +00:00
Siva Chandra b90168ff41 Fix a thinko in StackFrame::GetInScopeVariableList.
Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 259607
2016-02-02 23:49:41 +00:00
Adrian McCarthy 12a8ae23b0 Set correct thread stop info when single-step lands on a breakpoint [Windows]
I don't understand how this worked before, but this fixes the recent test regressions on Windows in TestConsecutiveBreakpoints.py.

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

llvm-svn: 259605
2016-02-02 23:38:08 +00:00
Zachary Turner c67466054f Don't return a tuple from the skip test function.
Previously we were returning a tuple of (bool, skip_reason) from
the tuple function.  This makes for some awkward code, especially
since a value of True for the first argument implies that the
second argument is None, and a value of False implies that the
second argument is not None.  So it was basically redundant, and
with this patch we simply return the skip reason or None directly.

llvm-svn: 259590
2016-02-02 22:22:53 +00:00
Todd Fiala 015b0cc258 Revert "[NFC] Cleanup RangeMap.h"
This reverts commit r259538.  Caused 92 test failures on
the OS X testbot.

llvm-svn: 259556
2016-02-02 20:26:50 +00:00
Zachary Turner d6609d74a1 Re-write many skip decorators to use shared code.
This should be no functional change, just a refactoring of the
skip decorators to all centralize on a single function,
`skipTestIfFn` that does all the logic.  This allows easier
maintenance of the decorators and also centralizes all the
hard-to-understand logic in one place.

Reviewed by: Pavel Labath
Differential Revision: http://reviews.llvm.org/D16741

llvm-svn: 259543
2016-02-02 18:50:34 +00:00
Tamas Berghammer 7a2a5ce058 [NFC] Cleanup RangeMap.h
The file contained very similar 4 implementation of the same data
structure with a lot of duplicated code and some minor API differences.
This CL refactor the class to eliminate the duplicated codes and to
unify the APIs.

RangeMap.h also contained a class called AddressDataArray what have very
little added functionality over an std::vector and used only by
ObjectFileMacO The CL moves the class to ObjectFileMachO.cpp as it isn't
belongs into RangeMap.h and shouldn't be used in new places anyway
because of the little added functionality.

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

llvm-svn: 259538
2016-02-02 18:18:13 +00:00
Pavel Labath bb3f0ae821 XFAIL TestConsecutiveBreakpoints.test_single_step_thread_specific on OSX
llvm-svn: 259527
2016-02-02 17:02:58 +00:00
Todd Fiala c65a4d8d45 skip TestWatchLocation on OS X
Skipping this test while I investigate.  It started failing
with r259379.  (It is generating an error due to unicode
decode issues.)

llvm-svn: 259526
2016-02-02 17:00:34 +00:00
Pavel Labath b32b19cde1 Remove redundant test in TestExitDuringStep
After recent changes, test_thread_state_is_stopped has become equivalent to test_step_in, as the
function exit_during_step_base was not using the "test_thread_state" parameter. As test was
XFAILed on all platforms anyway, and we have other tests for the bug which it (used to) test, I
am simply removing the function.

llvm-svn: 259517
2016-02-02 15:58:30 +00:00
Pavel Labath d2474ff513 Log error message in SBTarget::Launch
llvm-svn: 259514
2016-02-02 15:16:20 +00:00
Pavel Labath 148e4b7f66 Mark TestProcessIO.test_stdin_redirection as flaky on android
bug #26437

llvm-svn: 259513
2016-02-02 15:16:16 +00:00
Tamas Berghammer 8e18fe6e54 Fix single stepping over the IT instruction
The ARM instruction emulator had 2 bugs related to the handling of the
IT instruction causing an error in single stepping:
* We haven't initialized the IT mask from the CPSR so if the last
  instruction of the IT block is a branch and the condition is false
  then the emulator evaluated the branch what resulted in an incorrect
  pc for the next instruction.
* The ITSTATE was advanced before the execution of each instruction. As
  a result the emulator was using the condition of following instruction
  in every case. The ITSTATE should be edvanced after the execution of
  an instruction except after an IT instruction.

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

llvm-svn: 259509
2016-02-02 14:32:11 +00:00
Pavel Labath e03bd650f3 Fix build after clang interface change in r259489
llvm-svn: 259494
2016-02-02 13:07:27 +00:00
Pavel Labath efd04a6c75 Fix single-stepping onto a breakpoint
Summary:
r259344 introduced a bug, where we fail to perform a single step, when the instruction we are
stepping onto contains a breakpoint which is not valid for this thread. This fixes the problem
and add a test case.

Reviewers: tberghammer, emaste

Subscribers: abhishek.aggarwal, lldb-commits, emaste

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

llvm-svn: 259488
2016-02-02 10:40:56 +00:00
Pavel Labath e8baa4498d Fix compiler lookup when specified without path
r259433 introduced a regression, where if a compiler is specified without a path (e.g., CC=clang,
relying on the fact that clang is in $PATH), then the test suite would fail (at the compiler
version detection step) because realpath would interpret this as a path relative to cwd). The fix
is to perform the $PATH expansion (via `which`) before the realpath step.

llvm-svn: 259484
2016-02-02 09:49:37 +00:00
Kamil Rytarowski d08778bade NetBSD: Define initial RegisterContextNetBSD_x86_64
Summary: Add basic support, i386 version will be added later.

Reviewers: emaste, joerg, clayborg, tfiala

Subscribers: lldb-commits

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

llvm-svn: 259462
2016-02-02 03:47:44 +00:00
Jim Ingham 59dd7fd153 We try to avoid static objects. These are on the error path for unsupported features
in the socket, so just returning freshly constructed objects is fine.

llvm-svn: 259443
2016-02-02 00:21:39 +00:00
Stephane Sezer 0f0f82e58c Fix getCompiler in unit testing framework on compiler symlinks
Summary:
Checks using the result of getCompiler() will fail to identify the compiler
correctly if CC is a symlink path (ie /usr/bin/cc).

Reviewers: zturner, emaste

Subscribers: llvm-commits, sas

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

Change by Francis Ricci <fjricci@fb.com>

llvm-svn: 259433
2016-02-01 23:21:27 +00:00
Jim Ingham 5c94f2942e Add a note on how to create an empty target and use it to attach to
processes whose executables you don't know up front.

llvm-svn: 259396
2016-02-01 20:05:37 +00:00
Zachary Turner e5a7990dbe Always write the session file in UTF-8.
This patch attempts to solve the Python 2 / Python 3 incompatibilities by
introducing a new `encoded_file` abstraction that we use instead of
`io.open()`.  The problem with the builtin implementation of `io.open` is
that `read` and `write` accept and return `unicode` objects, which are not
always convenient to work with in Python 2.  We solve this by making
`encoded_file.open()` return the same object returned by `io.open()` but
with hooked `read()` and `write()` methods.  These hooked methods will
accept binary or text data, and conditionally convert what it gets to a
`unicode` object using the correct encoding.  When calling `read()` it
also does any conversion necessary to convert the output back into the
native `string` type of the running python version.

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

llvm-svn: 259379
2016-02-01 18:12:59 +00:00
Zachary Turner f042c908b3 Fix misnamed variable in TestProcessAPI.py
llvm-svn: 259378
2016-02-01 18:12:54 +00:00
Pavel Labath 916895073e Remove flaky annotation for TestCallWithTimeout on linux
The test has passed last 100 runs of the buildbot.

llvm-svn: 259368
2016-02-01 16:50:28 +00:00
Pavel Labath 061140c680 Remove Timer::Initialize routine
Summary:
I've run into an issue when running unit tests, where the underlying problem turned out to be
that we were creating Timer objects (through several layers of indirection) without calling
Timer::Initialize. Since Timer's thread-local storage was not properly initialized, we were
overwriting gtest's own thread-local storage, causing test failures.

Instead of requiring that every test calls Timer::Initialize(), I remove the function altogether:
The thread-local storage can be initialized on-demand, and the g_file variable initialized to
stdout and never changed, so I have simply removed it.

Reviewers: clayborg, zturner, tberghammer

Subscribers: lldb-commits

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

llvm-svn: 259356
2016-02-01 13:29:41 +00:00
Abhishek Aggarwal c2c8ca1ce3 Set correct ThreadStopInfo in case of trace event
Summary:
 - The patch solves Bug 23478 and Bug 19311. Resolving
   Bug 23478 also resolves Bug 23039.
      Correct ThreadStopInfo is set for Linux and FreeBSD
      platforms.

 - Summary:
      When a trace event is reported, we need to check
      whether the trace event lands at a breakpoint site.

      If it lands at a breakpoint site then set the thread's
      StopInfo with the reason 'breakpoint'. Else, set the reason
      to be 'Trace'.

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

Reviewers: jingham, emaste, lldb-commits, clayborg, ovyalov

Subscribers: emaste

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

llvm-svn: 259344
2016-02-01 09:01:42 +00:00
Jim Ingham cbff63adb4 Fixed a couple of places where we were getting the module from a
section and using it w/o checking that it was valid.  This can
cause crashes - usually when tearing down a target.

llvm-svn: 259237
2016-01-29 20:21:33 +00:00
Jim Ingham 02e73d1c3c Fix this test for the the switch in default for IgnoreBreakpoints in SBFrame.EvaluateExpression.
llvm-svn: 259234
2016-01-29 20:09:30 +00:00