Commit Graph

13890 Commits

Author SHA1 Message Date
Jason Molenda 880988af09 ProcessMachCore scans through the core file pages looking for a
user process dyld binary and/or a mach kernel binary image.  By
default, it prefers the kernel if it finds both.

But if it finds two kernel binary images (which can happen when
random things are mapped into memory), it may pick the wrong
kernel image.  

DynamicLoaderDarwinKernel has heuristics to find a kernel in memory;
once we've established that there is a kernel binary in memory,
call over to that class to see if it can find a kernel address via
its search methods.  If it does, use that.

Some minor cleanups to DynamicLoaderDarwinKernel while I was at it.

<rdar://problem/24446112> 

llvm-svn: 259983
2016-02-06 04:55:26 +00:00
Enrico Granata 41571781c0 Per Jim's suggestion, move checks that we're not mixing and matching Debuggers and Commands deeper in the bowels of LLDB
NFC

llvm-svn: 259972
2016-02-06 01:36:07 +00:00
Enrico Granata 0a66e2f135 Fix an issue where certain CommandObjects (or Options thereof) were being created once, bound to a specific CommandInterpreter (and hence a specific Debugger), and then cached for reuse across different Debugger instances
Obviously, if the original Debugger goes away, those commands are holding on to now stale memory, which has the potential to cause crashes

Fixes rdar://24460882

llvm-svn: 259964
2016-02-06 00:43:07 +00:00
Jim Ingham 1f5fcf8afd Fix "thread backtrace -s": option was misparsed because of a missing break.
<rdar://problem/24525106>

llvm-svn: 259962
2016-02-06 00:31:23 +00:00
Siva Chandra 03ff5c8616 Take 2: Use an artifical namespace so that member vars do not hide local vars.
Summary: This relands r259810 with fix for failures on Mac.

Reviewers: spyffe, tfiala

Subscribers: tfiala, lldb-commits

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

llvm-svn: 259902
2016-02-05 19:10:04 +00:00
Omair Javaid 0a76722518 Add support to detect arm hard float ABI based binaries for ABISysV_arm
This patch adds logic to detect if underlying binary is using arm hard float abi and use that information while handling return values in ABISysV_arm.

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

llvm-svn: 259885
2016-02-05 14:37:53 +00:00
Pavel Labath 5990cd5a0c Bump up the packet timeout for gdbremote tests
Log confirmed that the we are sometimes timing out on the receive, even though the server is
sending the correct packets.

llvm-svn: 259878
2016-02-05 11:17:22 +00:00
Jason Molenda ec504238e4 Add two more addresses to check for the address of the kernel in debug mode;
also add some logging about where lldb is lookin for a kernel as it connects.
<rdar://problem/24454582> 

llvm-svn: 259865
2016-02-05 01:38:56 +00:00
Jason Molenda aa3c37ae79 Add a little logging to ProcessMachCore so it is easier to tell when a user process dyld
or mach kernel binary are found, and if there are multiples of them found within a single
corefile.
<rdar://problem/24446112> 

llvm-svn: 259850
2016-02-04 23:45:17 +00:00
Niels Ole Salscheider 6795eff63e Fix the search path for CMake files
This allows to find the LLVM's CMake files after moving them in
r259821.

llvm-svn: 259845
2016-02-04 23:28:57 +00:00
Zachary Turner 9a1a2946af Move the rest of the tests over to using the new decorator module.
llvm-svn: 259838
2016-02-04 23:04:17 +00:00
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