Commit Graph

14154 Commits

Author SHA1 Message Date
Sean Callanan f45270342c Fix stripping of _ when looking for symbols in IRExecutionUnit.
Previously we would try both versions of a symbol -- the one with _ in it and
the one without -- in all cases, because we didn't know what the current
platform's policy was.  However, stripping _ is only necessary on platforms
where _ is the prefix for global symbols.

There's an API that does this, though, on llvm::DataLayout, so this patch fixes
IRExecutionUnit to use that API to determine whether or not to strip _ from the
symbol or not.

llvm-svn: 260767
2016-02-12 23:55:13 +00:00
Enrico Granata fdecea7f59 Remove an unnecessary include
llvm-svn: 260761
2016-02-12 23:12:27 +00:00
Enrico Granata 75995b5e86 Data formatter support for libc++ std::atomic<T>
On libc++ std::atomic is a fairly simple data type (layout wise, at least), wrapping actual contents in a member variable named "__a_"

All the formatters are doing is "peel away" this intermediate layer and exposing user data as direct children or values of the std::atomic root variable

Fixes rdar://24329405

llvm-svn: 260752
2016-02-12 22:18:24 +00:00
Sean Callanan 8c05fb9fff Disable recognition of "using" declarations at translation-unit level.
Currently CountDeclLevels uses the ASTs which have no distinction between
separate translation units.  If one .o file has a "using" declaration at
translation unit level, that "using" declaration will be in the same translation
unit as functions from other .o files in the same module.  This leads to
erroneous name conflicts as the CountDeclLevels-based function filtering logic
accepts too many fucntions.

In the future we will identify the translation units for top-level Decls more
reliably and restore that functionality.  There's a TODO to that effect in the
code.

llvm-svn: 260747
2016-02-12 21:55:05 +00:00
Sean Callanan 8c62daf250 IRInterpreter now recognizes expressions with constants it doesn't handle.
If an instruction has a constant that IRInterpreter doesn't know how to deal
with (say, an array constant, because we can't materialize it to APInt) then we
used to ignore that and only fail during expression execution.  This is annoying
because if IRInterpreter had just returned false from CanInterpret(), the JIT
would have been used.

Now the IRInterpreter checks constants as part of CanInterpret(), so this should
hopefully no longer be an issue.

llvm-svn: 260735
2016-02-12 21:16:58 +00:00
Sean Callanan b281480203 Centralized symbol lookup in IRExecutionUnit, and fixed the code model.
I'm preparing to remove symbol lookup from IRForTarget, where it constitutes a
dreadful hack working around no-longer-existing JIT bugs.  Thanks to our 
contributors, IRForTarget has a lot of smarts that IRExecutionUnit doesn't have,
so I've cleaned them up a bit and moved them over to IRExecutionUnit.

Also for historical reasons, IRExecutionUnit used the "Small" code model on non-
ELF platforms (namely, OS X).  That's no longer necessary, and we can use the
same code model as everyone else on OS X.  I've fixed that.

llvm-svn: 260734
2016-02-12 21:11:25 +00:00
Siva Chandra 29d9bea93f Adjust for Python-3.
Summary:
This does not yet give us a clean testsuite run but it does help with:
1. Actually building on linux
2. Run the testsuite with over 70% tests passing on linux.

Reviewers: tfiala, labath, zturner

Subscribers: lldb-commits

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

llvm-svn: 260721
2016-02-12 20:30:47 +00:00
Sean Callanan 7b3ef05a37 Objective-C++ is a kind of C++.
llvm-svn: 260715
2016-02-12 19:47:57 +00:00
Sean Callanan 92734d1b2b Make Target::CalculateProcess() return a sensible result.
The Calculate* functions in general should not derive any information that isn't
implicit, but for Target the process pointer is a member so it's fine to return
it for CalculateProcess().

llvm-svn: 260713
2016-02-12 19:45:31 +00:00
Sean Callanan abece15858 Renamed TestRdar12991846 to the more descriptive TestUnicodeLiterals.
Test cases should not be named after PR or Radar numbers.  It's fine to
annotate them with these numbers in comments, however.

llvm-svn: 260699
2016-02-12 18:42:00 +00:00
Enrico Granata 2543d29048 The data formatters for NSArray, NSDictionary and (only partially) NSSet contain logic to inspect the objects without running code.
However, they also contain fallback logic that - in cases where LLDB can't recognize the specific subclass - actually does run code in order to inspect those objects.

The argument for this logic was that these data types are critical enough that the risk of getting it wrong is outweighed by the advantage of always providing accurate child information.

Practical experience however shows that "po" - a code running data-inspection command - is quite frequently used, and not considered burdensome by users.
As such, this makes the code-running fallback in the data formatters a risk that carries very little actual reward. Also, unlike the time this code was originally written, we now have accurate class information for Objective-C, and thus we are less likely to improperly identify classes.

This commit removes support for the code-running fallback, and aligns the data formatters for NSArray, NSDictionary and NSSet to the general no-code-running behavior of other data formatters.

While it is possible for us to add support for some subclasses that are now no longer covered by static inspection alone, this is beyond the scope of this commit.

llvm-svn: 260664
2016-02-12 07:50:15 +00:00
Greg Clayton 9ddad935b9 Don't crash if we have a DIE that has a DW_AT_ranges attribute and yet the SymbolFileDWARF doesn't have a DebugRanges. If this happens print a nice error message to prompt the user to file a bug and attach the offending DWARF file so we can get the correct compiler fixed.
<rdar://problem/24458016>

llvm-svn: 260626
2016-02-12 00:07:16 +00:00
Jim Ingham 0ea010aecb When calling TypeSystemMap::Clear, objects being destroyed in the process of
clearing the map ended up calling back into the TypeSystemMap to do lookups.  
Not a good idea, and in this case it would cause a deadlock.

You would only see this when replacing the target contents after an exec, and only if you 
had stopped before the exec, evaluated an expression, then continued
on to the point where you did the exec.  

Fixed this by making sure the TypeSystemMap::Clear tears down the TypeSystems in the map before clearing the map.
I also add an expression before exec to the TestExec.py so that we'll catch this
issue if it crops up again in the future.

<rdar://problem/24554920>

llvm-svn: 260624
2016-02-12 00:03:19 +00:00
Greg Clayton 565aaf6194 Removed a bad assertion:
assert(((SymbolFileDWARF*)m_ast.GetSymbolFile())->UserIDMatches(die.GetDIERef().GetUID()) &&
       "Adding incorrect type to forward declaration map");

The problem is that "m_ast.GetSymbolFile()" can return a SymbolFileDWARFDebugMap. The code is doing the right thing if the assertion is ignored.

<rdar://problem/24437972>

llvm-svn: 260618
2016-02-11 23:36:57 +00:00
Ed Maste e3ddf4c25d XFAIL TestCommandScriptImmediateOutput on FreeBSD also
llvm-svn: 260589
2016-02-11 21:15:49 +00:00
Adrian McCarthy 6fadea62b5 Improve ReadRegister for RegisterContextWindowsx86
In some circumstances (notably, certain minidumps), the thread CONTEXT does not have values for the
control registers (EIP, ESP, EBP, EFLAGS).  There are flags in the CONTEXT which indicate which
portions are valid, but those flags weren't checked.  The old code would not detect this and give a
garbage value for the register.  The new code will log the problem and return an error.

I consolidated the error checking and logging into a helper function, which makes the big switch
statement easier to read and verify.

Ran tests to ensure this doesn't break anything.  Manually verified that a minidump without info on
the control registers now indicates the problem instead of giving bad information.

Differential Review: http://reviews.llvm.org/D17152

llvm-svn: 260559
2016-02-11 18:24:57 +00:00
Aidan Dodds 72f775253f [Renderscript] Fix typo in mips64 argument reading code.
A typo in the mips64 argument reading code would cause register passed arguments to be truncated to 32bits.

llvm-svn: 260546
2016-02-11 17:17:12 +00:00
Aidan Dodds f478678549 [Renderscript] Refactor target argument reading code.
This patch reworks the function argument reading code, allowing us to annotate arguments with their types.  The type/size information is needed to correctly parse arguments passed on the stack.

llvm-svn: 260525
2016-02-11 15:16:37 +00:00
Omair Javaid 62498ff8f5 Handle floating-point type homogeneous aggregate return values in ABISysV_arm
For details refer to review link given below.

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

llvm-svn: 260512
2016-02-11 11:41:22 +00:00
Jim Ingham b4a5aa239c Revert 260436. I pretty consistently upper-case the letter I use for the
short option as an aid to memory.  Like it's w because of the W in throW.

That helps me remember.  If we are going to take these out we should take them
all out.  But I kind of like them.

llvm-svn: 260452
2016-02-10 22:30:20 +00:00
Sean Callanan 3f9de74ba1 When importing Objective-C protocols, mark them as having external decls.
We already do this for Objective-C interfaces, but we never handled protocols
because the DWARF didn't represent them.  Nowadays, though, we can import them
from modules, and we have to mark them properly.

<rdar://problem/24193009>

llvm-svn: 260445
2016-02-10 22:00:32 +00:00
Zachary Turner fa61bb5be9 Fix copy/paste error in TestCModules.
llvm-svn: 260440
2016-02-10 21:47:36 +00:00
Enrico Granata 909e2cdc54 No reason for these two letters to be uppercase
llvm-svn: 260436
2016-02-10 21:30:20 +00:00
Greg Clayton ae088e52f3 Now that SymbolFileDWARF supports having types in completely separate .pcm file with "-fmodules -gmodules", each SymbolFileDWARF can reference module DWARF info by looking in other DWARF files. Then if you have 1000 .o files that each reference one or more .pcm files in their debug info, a simple Module::FindTypes(...) call can end up searching the same .pcm file over and over and over. Now all internal FindTypes methods in classes (ModuleList, Module, SymbolFile) now take an extra argument:
llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files
    
Each time a SymbolFile::FindTypes() is called, it needs to check the searched_symbol_files list to make sure it hasn't already been asked to find the type and return immediately if it has been checked. This will stop circular dependencies from also crashing LLDB during type queries. 

This has proven to be an issue when debugging large applications on MacOSX that use DWARF in .o files. 

<rdar://problem/24581488>

llvm-svn: 260434
2016-02-10 21:28:13 +00:00
Zachary Turner b3cce5d33a Remove skipUnlessListedRemote.
This was supposed to have been removed but made it back in
accidentally.

llvm-svn: 260423
2016-02-10 19:53:45 +00:00
Zachary Turner 362e06d7ba Remove expectedFailureLinux decorator.
llvm-svn: 260422
2016-02-10 19:53:36 +00:00
Tamas Berghammer 5bfd4d0008 Revert "Improve the handling of missing elf symtab and missing symbol sizes"
This reverts commit 252dda67782f2cbf838e375bce21ed4191f6d9ce.

The commit caused several test failure on the OSX build bot.

llvm-svn: 260377
2016-02-10 12:10:58 +00:00
Ewan Crawford ea0636b554 [RenderScript] Refactor allocation expressions
Patch refractors RS plugin code specifying how format strings are used to JIT the runtime.

Author: Dean De Leo <dean@codeplay.com>
llvm-svn: 260372
2016-02-10 11:23:27 +00:00
Tamas Berghammer ed844cbc0f Improve the handling of missing elf symtab and missing symbol sizes
* Generate artificial symbol names from eh_fame during symbol parsing
  so these symbols are already present when we calcualte the size of
  the symbols where 0 is specified.
* Fix symbol size calculation for the last symbol in the file where
  it have to last until the end of the parent section.

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

llvm-svn: 260369
2016-02-10 10:43:34 +00:00
Tamas Berghammer 10e9923841 Fix handling of the arm IT instruction in the unwinder
The IT instruction can specify condition code for up to 4 consecutive
instruction and it is used quite often by clang in epilogues causing
an issue when trying to unwind from locations covered by the IT
instruction and for locatins inmediately after the IT instruction.

Changes made to fix it:
* Introduce the concept of conditional instruction block what is a list
  of consecutive instructions with the same condition. We update the
  unwind information during the conditional instruction block and when
  we reach the end of it (first instruction with a differemt condition)
  then we restore the unwind information we had before the condition.
* Fix a bug in the ARM instruction emulator where neither PC nor the
  ITSTATE was advanced when we reached an instruction what we can't
  decode.

After the change we have no regression on android-arm running the
regular test suit and TestStandardUnwind also passes when running it
with clang as the compiler (previously it failed on an IT instruction).

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

llvm-svn: 260368
2016-02-10 10:42:13 +00:00
Tamas Berghammer 1b6dacbb86 Use BKPT instead of UDF for arm/thumb breakpoints
The UDF instruction is deprecated in armv7 and in case of thumb2
instructions set it don't work well together with the IT instruction.

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

llvm-svn: 260367
2016-02-10 10:42:00 +00:00
Tamas Berghammer 2e912ec705 Add new option to lldb-server to display its version
llvm-svn: 260366
2016-02-10 10:35:48 +00:00
Mohit K. Bhakkad e92e3606dd [LLDB][MIPS] Generalise MIPS arch names
Patch by Nitesh Jain

Reviewers: clayborg, jaydeep.
Subscribers: zturner, bhushan, mohit.bhakkad, sagar, lldb-commits.
Differential Revision: http://reviews.llvm.org/D16840

llvm-svn: 260362
2016-02-10 06:58:13 +00:00
Jim Ingham c17d6bdbfb This is an idea to make "thread step-in --target" work for the common
case where you have:

1 ->    foo (bar(),
2            baz(),
3            lala());
4

You are sitting on line 1, and want to step into foo, but not bar, baz & lala.  Unfortunately
there are line table entries for lines 1-3, and lldb doesn't know anything about the nesting
of statement in these lines.  So we'll have to use the user's intelligence...  This patch adds:

(lldb) thread step-in -t foo --end-line 4

That tells lldb to keep stepping in till line 4, but stop if you step into foo.  I think I would
remember to use this when faced with some of the long gnarly call sequences in lldb.  But there
might be ways I haven't thought of to make it more convenient.  Jason suggests having "end" as a
special token for --end-line which just means keep going to the end of the function, I really want
to get into this thing...

There should be an SB API and tests, which will come if this seems useful.

llvm-svn: 260352
2016-02-10 03:25:24 +00:00
Enrico Granata 14086ed75d Change lldb.value.__int__() so that it takes into account the signedness of the value being cast to return a Python number with the proper value
The explicit APIs on SBValue obviously remain if one wants to be explicit in intent, or override this guess, but since __int__() has to pick one, an educated guess is definitely better than than always going to signed regardless

Fixes rdar://24556976

llvm-svn: 260349
2016-02-10 02:12:42 +00:00
Jim Ingham 78591726fd Add a missing break.
llvm-svn: 260345
2016-02-10 01:33:58 +00:00
Adrian McCarthy e286b8d652 Don't dereference the first element of an empty container.
llvm-svn: 260331
2016-02-10 00:06:50 +00:00
Ed Maste 9d67c1e352 Remove FreeBSD failure decorator from TestCppIncompleteTypes
CFLAGS is now being set correctly to pass -flimit-debug-info or
-fno-limit-debug-info on FreeBSD.  I'm not sure which change is
responsible for the fix, though.

llvm.org/pr25626

llvm-svn: 260330
2016-02-10 00:03:52 +00:00
Adrian McCarthy 78b368f124 Add status for LLDB on Windows to status.html.
Differential Revision: http://reviews.llvm.org/D16902

llvm-svn: 260328
2016-02-09 23:52:57 +00:00
Zachary Turner 657f930824 Change `CoreTests` to LLDBCoreTests to avoid name clash.
lld was already using a target named CoreTests so CMake
was erroring due to this conflict.

llvm-svn: 260326
2016-02-09 23:45:21 +00:00
Greg Clayton 343f898443 Added code that was commented out during testing to stops template member functions from being added to class definitions (see revision 260308 for details).
<rdar://problem/24483905>
<rdar://problem/24508374>

llvm-svn: 260322
2016-02-09 23:25:54 +00:00
Greg Clayton fb85e6288b Fixed many issues that were causing differing type definition issues to show up when parsing expressions.
1) Turns out we weren't correctly uniquing types for C++. We would search our repository for "lldb_private::Process", but yet store just "Process" in the unique type map. Now we store things correctly and correctly unique types.
2) SymbolFileDWARF::CompleteType() can be called at any time in order to complete a C++ or Objective C class. All public inquiries into the SymbolFile go through SymbolVendor, and SymbolVendor correctly takes the module lock before it call the SymbolFile API call, but when we let CompilerType objects out in the wild, they can complete themselves at any time from the expression parser, so the ValueObjects or (SBValue objects in the public API), and many more places. So we now take the module lock when completing a type to avoid two threads being in the SymbolFileDWARF at the same time.
3) If a class has a template member function like:

    class A
    { 
        <template T>
        void Foo(T t);
    };
    
    The DWARF will _only_ contain a DW_TAG_subprogram for "Foo" if anyone specialized it. This would cause a class definition for A inside a.cpp that used a "int" and "float" overload to look like:
    class A
    {
        void Foo(int t);
        void Foo(double t);
    };
    
    And a version from b.cpp that used a "float" overload to look like:
    class A
    {
        void Foo(float t);
    };

    And a version from c.cpp that use no overloads to look like:    
    
    class A
    {
    };
    
    Then in an expression if you have two variables, one name "a" from a.cpp in liba.dylib, and one named "b" from b.cpp in libb.dylib, you will get conflicting definitions for "A" and your expression will fail. This all stems from the fact that DWARF _only_ emits template specializations, not generic definitions, and they are only emitted if they are used. There are two solutions to this:
    a) When ever you run into ANY class, you must say "just because this class doesn't have templatized member functions, it doesn't mean that any other instances might not have any, so when ever I run into ANY class, I must parse all compile units and parse all instances of class "A" just in case it has member functions that are templatized.". That is really bad because it means you always pull in ALL DWARF that contains most likely exact duplicate definitions of the class "A" and you bloat the memory that the SymbolFileDWARF plug-in uses in LLDB (since you pull in all DIEs from all compile units that contain a "A" definition) uses for little value most of the time.
    b) Modify DWARF to emit generic template member function definitions so that you know from looking at any instance of class "A" wether it has template member functions or not. In order to do this, we would have to have the ability to correctly parse a member function template, but there is a compiler bug: 
    <rdar://problem/24515533> [PR 26553] C++ Debug info should reference DW_TAG_template_type_parameter
    This bugs means that not all of the info needed to correctly make a template member function is in the DWARF. The main source of the problem is if we have DWARF for a template instantiation for "int" like: "void A::Foo<int>(T)" the DWARF comes out as "void A::Foo<int>(int)" (it doesn't mention type "T", it resolves the type to the specialized type to "int"). But if you actually have your function defined as "<template T> void Foo(int t)" and you only use T for local variables inside the function call, we can't correctly make the function prototype up in the clang::ASTContext. 
    
    So the best we can do for now we just omit all member functions that are templatized from the class definition so that "A" never has any template member functions. This means all defintions of "A" look like:
    
    class A
    {
    };
    
    And our expressions will work. You won't be able to call template member fucntions in expressions (not a regression, we weren't able to do this before) and if you are stopped in a templatized member function, we won't know that are are in a method of class "A". All things we should fix, but we need <rdar://problem/24515533> fixed first, followed by:
    
    <rdar://problem/24515624> Classes should always include a template subprogram definition, even when no template member functions are used
    
    before we can do anything about it in LLDB.

This bug mainly fixed the following Apple radar:

<rdar://problem/24483905>

llvm-svn: 260308
2016-02-09 22:36:24 +00:00
Greg Clayton 36ab260b0d Don't complete a class type just to test if it is a class. Code in CompilerType and in clang::QualType knows how to complete a type if it needs to.
llvm-svn: 260299
2016-02-09 22:09:26 +00:00
Zachary Turner 81d0804d96 Fix incorrect usage of `str` in _match_decorator_property.
llvm-svn: 260292
2016-02-09 21:36:38 +00:00
Zachary Turner 9625c6fc9f Remove skipIf<compiler> decorators.
These were supposed to have been removed in a previous patch,
but I missed them.

llvm-svn: 260291
2016-02-09 21:36:32 +00:00
Zachary Turner 2b1a416cb5 Remove decorators related to debug info types.
All existing usages were ported over to the common decorators.

llvm-svn: 260290
2016-02-09 21:36:23 +00:00
Zachary Turner 8158a2037a Delete all the xfail / skip decorators for specific compilers.
Ported everything over to using expectedFailureAll.

llvm-svn: 260289
2016-02-09 21:36:15 +00:00
Zachary Turner 0c3e003697 Remove expected failure and skip decorators for host os.
All decorator invocations are updated to use the generic
expectedFailureAll and skipIf decorators.

llvm-svn: 260288
2016-02-09 21:36:02 +00:00
Greg Clayton 0e14c04479 If we set the DYLD_INSERT_LIBRARIES environment variable when launching debugserver, for use with /usr/lib/libgmalloc.dylib, then make sure we don't pass this environment variable on to any child processes.
llvm-svn: 260284
2016-02-09 21:20:17 +00:00
Greg Clayton e0bd048547 Don't enable -flimit-debug-info by default for the LLDB Xcode builds. This was put in back in 2011 when -flimit-debug-info did a lot less than it does now. With llvm-dsymutil doing ODR type unique stuff we still have reasonably sized dSYM files.
llvm-svn: 260282
2016-02-09 21:18:44 +00:00
Jim Ingham cc3a4595f7 Mention the --all-files option in the -p help string.
llvm-svn: 260247
2016-02-09 18:53:49 +00:00
Pavel Labath b625a0e1bc Fix invalid shift operator overload in Scalar
Summary: This also fixes an infinite recursion between lldb_private::operator>> () and Scalar::operator>>= ().

Reviewers: sagar, tberghammer, labath

Subscribers: lldb-commits

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

Patch by Marianne Mailhot-Sarrasin

llvm-svn: 260239
2016-02-09 17:28:01 +00:00
Tamas Berghammer bf8f8073dc Fix a typo in an xfail decorator in TestExprsChar
llvm-svn: 260216
2016-02-09 10:10:42 +00:00
Enrico Granata b1cf558d83 Fix an issue where pressing CTRL+C in the interactive script interpreter causes LLDB to crash
This is because PyThreadState_Get() assumes a non-NULL thread state and crashes otherwise; but PyThreadState_GET is just a shortcut (in non-Python-debugging builds) for the global variable that holds the thread state

The behavior of CTRL+C is slightly more erratic than one would like. CTRL+C in the middle of execution of Python code will cause that execution to be interrupted (e.g. time.sleep(1000)), but a CTRL+C at the prompt will just cause a KeyboardInterrupt and not exit the interpreter - worse, it will only trigger the exception once one presses ENTER.

None of this is optimal, of course, but I don't have a lot of time to appease the Python deities with the proper spells right now, and fixing the crasher is already a good thing in and of itself

llvm-svn: 260199
2016-02-09 05:46:47 +00:00
Siva Chandra 4a33ab7b2c [TestExprsChar] Fix a typo is failure archs list
Reviewers: zturner

Subscribers: lldb-commits

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

llvm-svn: 260192
2016-02-09 02:18:50 +00:00
Zachary Turner 05021bb2ed Remove skip and xfail decorators for target architecture.
This removes the following decorators:

* skipIfI386
* expectedFailureI386
* expectedFailurex86_64
* skipIfArch
* skipUnlessArch
* skipUnlessI386

And other related decorators.  All code using those decorators
is updated to use expectedFailureAll and skipIf

llvm-svn: 260178
2016-02-09 00:36:34 +00:00
Zachary Turner 7fade35ec2 Remove skipIfHostPlatform and skipUnlessHostPlatform decorators.
llvm-svn: 260177
2016-02-09 00:36:27 +00:00
Zachary Turner 779df76c56 Remove the skipUnlessArch decorator.
Convert everything over to using skipIf.

llvm-svn: 260176
2016-02-09 00:36:22 +00:00
Zachary Turner 2e887acea8 A number of improvements to decorator conditionals.
* Change the `not_in` function to be called `no_match`.  This makes
  it clear that keyword arguments can be more than just lists.
* Change the name of `_check_list_or_lambda` to
  `_match_decorator_property`.  Again clarifying that decorator params
  are not always lists.
* Always use a regex match when matching strings.  This allows automatic
  support for regex matching on all decorator properties.  Also support
  compiled regex values.
* Fix a bug in the compiler check used by _decorateTest.  The two
  arguments were reversed, the condition was always wrong.
* Change one test that uses skipUnlessArch to use skipIf, to
  demonstrate that skipIf can now handle more scenarios.

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

llvm-svn: 260135
2016-02-08 19:35:18 +00:00
Zachary Turner 4a289a93f7 Remove expectedFailureWindows decorator.
expectedFailureWindows is equivalent to using the general
expectedFailureAll decorator with oslist="windows".  Additionally,
by moving towards these common decorators we can solve the issue
of having to support decorators that can be called with or without
arguments.  Once all decorators are always called with arguments,
and this is enforced by design (because you can't specify the condition
you're decorating for without passing an argument) the implementation
of the decorators can become much simpler

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

llvm-svn: 260134
2016-02-08 19:34:59 +00:00
Eugene Leviant ed203da558 Show real error message in -data-evaluate-expression
llvm-svn: 260082
2016-02-08 10:04:51 +00:00
Pavel Labath 22a2a7fec1 Revert "Enable test_lldbmi_settings_set_target_run_args_before on linux"
Test is still flaky.

llvm-svn: 260081
2016-02-08 09:58:27 +00:00
Pavel Labath 6698f6f4e5 Have lldb-server log the timestamp in its log messages
llvm-svn: 260078
2016-02-08 09:35:53 +00:00
Bhushan D. Attarde b4fd8bb27e [LLDB][MIPS] Fix TestExpressionInSyscall.py for MIPS
SUMMARY:
    This patch fixes TestExpressionInSyscall.py and solves bug 23659 for MIPS.
    Corrected indentation at couple of places.
    
    Reviewers: clayborg
    Subscribers: mohit.bhakkad, sagar, jaydeep, lldb-commits
    Differential Revision: http://reviews.llvm.org/D16916

llvm-svn: 260072
2016-02-08 04:35:51 +00:00
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
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
Todd Fiala 0647dbb1d8 Revert "fix up missing header from change r259084."
This change was made based on a bad signal from the
Green Dragon LLDB builder.  This change was not needed.
Reverting out r259114.

llvm-svn: 259216
2016-01-29 18:13:30 +00:00
Eugene Leviant ec4d04e507 Fix crash in lldb-mi when stack variable name is nullptr. This always happens when execution stops in try scope with unnamed catch clause
llvm-svn: 259189
2016-01-29 12:17:09 +00:00
Pavel Labath 941ca06688 Fix linking of lldb-server with BUILD_SHARED_LIBS
Summary:
The BUILD_SHARED_LIBS branch of lldb-server link flags was hopelessly broken, at least since we
started restricting the symbols exported by liblldb. lldb-server depends on symbols from the
lldb_private namespace, so it cannot link to the public interface of liblldb. Instead I make it
link to the individual libraries constituting liblldb, just like it does in the
!BUILD_SHARED_LIBS case.

This does not make the BUILD_SHARED_LIBS build of lldb fully functional yet, due to the way
liblldb dependencies are managed, but it's a step in that direction.

Reviewers: zturner, tfiala

Subscribers: lldb-commits

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

llvm-svn: 259188
2016-01-29 11:59:57 +00:00
Eugene Leviant 24785bd0b8 Ignore breakpoints by default in SBFrame::EvaluateExpression
llvm-svn: 259185
2016-01-29 10:48:11 +00:00
Ewan Crawford 36175cc095 [RenderScript] Remove unused RS command
Patch deletes the 'language renderscript module probe' command.
This command was present in the initial commit to help debug the plugin.
However we haven't used it recently and it's functionality is unclear, so can be removed entirely. 

Also add back 'kernel coordinate' command, removed by accident in clang format patch r259056.

llvm-svn: 259181
2016-01-29 10:11:03 +00:00
Chaoren Lin 3b2bec41fd Fix TestDataFormatterScript for Linux.
Summary:
m_function_name will contain a dummy name for the auto-generated function from
the python script on Linux. Check for script name first.

Reviewers: granata.enrico

Subscribers: lldb-commits

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

llvm-svn: 259153
2016-01-29 03:48:08 +00:00
Enrico Granata fa7ae77af4 Fix a bug where type <formatter> list would ignore the -w argument
rdar://24379879

llvm-svn: 259135
2016-01-29 01:12:13 +00:00
Enrico Granata 6cc1998814 Fix a bug where LLDB would not print the name of the function that a scripted summary is bound to
rdar://24380076

llvm-svn: 259131
2016-01-29 00:56:52 +00:00
Todd Fiala d12f3750a3 fix up missing header from change r259084.
llvm-svn: 259114
2016-01-28 23:17:53 +00:00
Todd Fiala 56d2073319 add back an Xcode-specific Makefile for header installation
llvm-svn: 259102
2016-01-28 22:34:36 +00:00
Eugene Zelenko c33088f41e Remove autoconf support from source directories.
Differential revision: http://reviews.llvm.org/D16662

llvm-svn: 259098
2016-01-28 22:05:24 +00:00
Chaoren Lin edf25990a4 Fix build after rL259070.
llvm-svn: 259086
2016-01-28 20:25:46 +00:00
Manman Ren 98f9bc6456 Update lldb for API change in clang r259070.
llvm-svn: 259084
2016-01-28 19:55:50 +00:00
Enrico Granata 6b7427856a Fix an issue where the type <formatter> list command would not accept a valid argument and instead error out complaining about a malformed regex
rdar://problem/24380025

llvm-svn: 259078
2016-01-28 19:21:38 +00:00
Aidan Dodds b3f7f69d9a [Renderscript] Clang-format the renderscript plugin.
Run clang-format over the renderscript plugin and fix common formatting deviations.

llvm-svn: 259056
2016-01-28 16:39:44 +00:00
Aidan Dodds bdc52ef38b Fix const cast error for MSVC2015 build.
The Visual Studio 2015 build was failing with the following error:
error C2440: 'initializing': cannot convert from 'const char [12]' to 'char *'

This should fix the problem by initializing a non const char array, instead of taking a pointer to const static data.

llvm-svn: 259042
2016-01-28 13:05:21 +00:00
Todd Fiala edcdfda969 fixed Xcode gtest build failure
llvm-svn: 259028
2016-01-28 08:16:18 +00:00
Todd Fiala 2c0802c559 modify Xcode build to use cmake/ninja for internal llvm/clang
This change restores the Xcode build to working after Makefile support
was stripped from LLVM and clang recently.

With this change, the Xcode build now requires cmake (2.8.12.2+).
The cmake must either be on the path that Xcode sees, or it must
exist in one of the following locations:

* /usr/local/bin/cmake
* /opt/local/bin/cmake
* $HOME/bin/cmake

If the ninja build tool is present on the path, it will be used.
If not, ninja will be cloned (via git), bootstrap-built, and
used for the llvm/clang build.

LLDB now requires a minimum deployment target of OS X 10.9.  Prior
to this, it was 10.8.  The llvm/clang cmake build will not run
with Xcode 7.2 or Xcode 7.3 beta's compiler with the minimum
deployment target set to anything lower than 10.9.  This is
related to #include <atomic>.

When llvm or clang source code does not exist in the lldb tree,
it will be cloned via git using http://llvm.org/git/{project}.git.
Previously it used SVN.  If this causes any heartache, we can
make this smarter, autodetect an embedded svn and use svn instead.
(And/or use SVN if a git command is not available).

This change also fixes an lldb-mi linkage failure (needed
libncurses) as exposed by one of the LLVM libs.

llvm-svn: 259027
2016-01-28 07:36:44 +00:00
Greg Clayton 17499dde46 A while back in revison 244716 we added support for getting the host OS version info from debugserver. We added keys to "qHostInfo" that were "osmajor", "osminor" and "ospatch", but no one ever parsed those, so I am removing them from debugserver. We accidentally also added a "version" key to qHostInfo instead of "os_version". So now we need to support both "version" and "os_version" in qHostInfo since we have debugserver binaries out in the wild that support this old packet type. I have updated debugserver ot use the correct "os_version" for future compatability or correctness.
<rdar://problem/24378699> 

llvm-svn: 259003
2016-01-28 00:16:11 +00:00
Zachary Turner 95b533fe4b Revert "Resubmit r258759 with proper unicode handling."
This reverts commit 2c79d60214e146b13b233392a859b4f79340e90e.

llvm-svn: 258978
2016-01-27 19:47:28 +00:00
Zachary Turner 671e6340da Resubmit r258759 with proper unicode handling.
Instead of opening the file in unicode mode, we need only encode
data which potentially has non-ASCII characters as UTF8 before
writing.  This should work across both Python versions, and is
also far simpler than anything else discussed.

llvm-svn: 258969
2016-01-27 19:00:51 +00:00
Zachary Turner e89a66bd4a Fix some python 3 incompatibilities that went in overnight.
* basestring is not a thing anymore.  Must use `six.string_types`.
* Must use from __future__ import print_function in every new test
  file.

llvm-svn: 258967
2016-01-27 18:49:35 +00:00
Zachary Turner 7289e43831 Refactor some of the xfail / skip decorators to share logic.
Previously the logic of skipIf and expectedFailure were 99%
the same, but they took different sets of arguments since they
were maintained separately, and had slightly differences in
their behavior.  This makes everything consistent, there is now
only one real implementation, and the previous ones are changed
to use the single master implementation.

llvm-svn: 258966
2016-01-27 18:49:31 +00:00
Zachary Turner 74b7965d38 Don't automtically try to import pexpect in lldbpexpect.
Since pexpect doesn't exist on Windows, tests which are xfail'ed
are not being run at all because they are failing when the file
is imported due to the `import pexpect`.  This puts the import
behind a conditional and makes an empty base class in the case
where pexpect is not present.

llvm-svn: 258965
2016-01-27 18:49:25 +00:00
Adrian McCarthy 7ae98efe85 XFail TestCPPAuto on Windows until we can find the root problem.
llvm.org/pr26339

llvm-svn: 258943
2016-01-27 17:03:25 +00:00
Omair Javaid 7124c11ad9 Decorarte TestInferiorAssert xfails on AArch64 Linux
This patch decorates some of TestInferiorAssert test cases with expectedFailureLinux on AArch64.

llvm-svn: 258930
2016-01-27 13:57:33 +00:00
Pavel Labath 48003e721e Fix linking with LLVM_LINK_LLVM_DYLIB=ON
Linking with LLVM shared libraries currently produces linker errors.  This works around the issue
(pr24953) by disabling linking with llvm so for lldb libraries.

Patch by Evangelos Foutras.

Reviewers: zturner

Subscribers: lldb-commits

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

llvm-svn: 258921
2016-01-27 11:02:02 +00:00
Bhushan D. Attarde df5f0b448c [LLDB][MIPS] A small fix in GetBreakableLoadAddress() for MIPS
SUMMARY:
    Get the load address for the address given by symbol and function.
    Earlier, this was done for function only, this patch does it for symbol too.
    This patch also adds TestAvoidBreakpointInDelaySlot.py to test this change.
    
    Reviewers: clayborg
    Subscribers: labath, zturner, mohit.bhakkad, sagar, jaydeep, lldb-commits
    Differential Revision: http://reviews.llvm.org/D16049

llvm-svn: 258919
2016-01-27 10:16:30 +00:00
Saleem Abdulrasool 329860e495 Revert r258546.
Seems that the patch was rebased on top of another change which obsoleted the
change but wasnt caught.

Thanks to nbjoerg for pointing this out!

llvm-svn: 258821
2016-01-26 17:43:48 +00:00
Benjamin Kramer 79dad1d056 Update for LLVM change
llvm-svn: 258819
2016-01-26 16:45:00 +00:00
Ewan Crawford b649b0053b [RenderScript] Provide option to specify a single allocation to print
Patch replaces the 'renderscript allocation list' command flag --refresh, with a new option --id <ID>.
This new option only prints the details of a single allocation with a given id, rather than printing all the allocations.
Functionality from the removed '--refresh' flag will be moved into its own command in a subsequent commit.

llvm-svn: 258800
2016-01-26 10:41:08 +00:00
Enrico Granata dd54a3a887 Reverting r258759 as it is breaking the OSX build
llvm-svn: 258791
2016-01-26 04:53:10 +00:00
Zachary Turner a37eac51de Fix TestRerun.py on Windows.
This is another example of a test that was looking for the thread
at index 0 instead of requesting the thread that was stopped at
the created breakpoint.  This assumption isn't true on Windows 10.

llvm-svn: 258764
2016-01-26 01:19:50 +00:00
Sean Callanan bca81c5a18 Fix the lldbinline tests so they make well-formed Makefiles.
lldbinline tests previously did not run correctly unless there was already a
Makefile for them.  This was because the syntax of the emitted Makefile made the
default make rule be the "cleanup" rule, which is pretty unhelpful.  Now the
default rule is the one included from Makefile.rules, which is much better.

llvm-svn: 258763
2016-01-26 01:15:57 +00:00
Zachary Turner ff33e3636d Remove XFAIL Windows from a test that was fixed by r258758.
llvm-svn: 258761
2016-01-26 01:09:38 +00:00
Zachary Turner 00b87282cd Write the session log file in UTF-8.
Previously we were writing in the default encoding, which depends
on the operating system and is not guaranteed to be unicode aware.
On Python 3, this would lead to a situation where writing unicode
text to the log file generates an exception.  The fix here is to
write session logs using the proper encoding, which incidentally
fixes another test, so xfail is removed from that.

llvm-svn: 258759
2016-01-26 00:59:42 +00:00
Adrian McCarthy c35b91cee2 Set symbol types for function symbols loaded from PE/COFF
This fixes the regression of several tests on Windows after rL258621.

The root problem is that ObjectFilePECOFF was not setting type information for the symbols, and the new CL rejects symbols without type information, breaking functionality like thread step-over.

The fix sets the type information for functions (and creates a TODO for other types).

Along the way, I fixed some typos and formatting that made the code I was debugging harder to understand.

In the long run, we should consider replacing most of ObjectFilePECOFF with the COFF parsing code from LLVM.

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

llvm-svn: 258758
2016-01-26 00:58:09 +00:00
Zachary Turner 240c72b72c Fix TestSyntheticCapping for Python 3.
In Python 3, whitespace inconsistences are errors.  This synthetic
provider had mixed tabs and spaces, as well as inconsistent
indentation widths.  This led to the file not being imported,
and naturally the test failing.  No functional change here, just
whitespace.

llvm-svn: 258751
2016-01-26 00:07:09 +00:00
Zachary Turner 4407396fb9 Fix some issues with bytes and strings in Python 3.
SBProcess::ReadMemory and other related functions such as
WriteMemory are returning Python string() objects.  This means
that in Python 3 that are returning Unicode objects.  In reality
they should be returning bytes objects which is the same as a string
in Python 2, but different in Python 3.  This patch updates the
generated SWIG code to return Python bytes objects for all
memory related functions.

One quirk of this patch is that the C++ signature of ReadCStringFromMemory
has it writing c-string data into a void*.  This confuses our swig
typemaps which expect that a void* means byte data.  So I hacked up
a custom typemap which maps this specific function to treat the
void* as string data instead of byte data.

llvm-svn: 258743
2016-01-25 23:21:18 +00:00
Zachary Turner bea3a85151 Fix more occurrences of string/bytes/bytearray in swig typemaps.
llvm-svn: 258742
2016-01-25 23:21:13 +00:00
Zachary Turner f9d6d204e8 Fix swig typemap for SBEvent.
This needs to be able to handle bytes, strings, and bytearray objects.
In Python 2 this was easy because bytes and strings are the same thing,
but in Python 3 the 2 cases need to be handled separately.  So as not
to mix raw Python C API code with PythonDataObjects code, I've also
introduced a PythonByteArray class to PythonDataObjects to make the
paradigm used here consistent.

llvm-svn: 258741
2016-01-25 23:21:09 +00:00
Adrian McCarthy 60897300c5 Fix TestSourceManager.py on Windows.
Python 3.5 is picky about writing strings to binary files, so we now open the
file in text mode, and we explicitly set the newline mode to avoid re-writing
it with CR+LF on Windows (which causes git to think the file had changed).

llvm-svn: 258704
2016-01-25 19:13:35 +00:00
Sagar Thakur 9986ed6aa8 [LLDB][MIPS] Fix TestPrintStackTraces.py
Patch by Nitesh Jain.

Summary: The thread_start function in libc doesn't contain any epilogue and prologue instructions. Hence unwinding fail when we are stopped in thread_start.

Reviewers: ovyalov, clayborg
Subscribers: lldb-commits, mohit.bhakkad, sagar, bhushan, jaydeep
Differential: reviews.llvm.org/D16136
llvm-svn: 258685
2016-01-25 12:33:03 +00:00
Sagar Thakur 60481839c0 [LLDB][MIPS] Fix TestExprsChar.py
Patch by Nitesh Jain.

Summary: When incorrect type used for 'char' then (at least) one of the expression evaluates to incorrect value. Please refer to bug llvm.org/pr23069

Reviewers: ovyalov, clayborg
Subscribers: lldb-commits, mohit.bhakkad, sagar, bhushan, jaydeep
Differential: reviews.llvm.org/D16132
llvm-svn: 258684
2016-01-25 12:27:46 +00:00
Mohit K. Bhakkad 0d9dd7df60 [LLDB] Consider only valid symbols while resolving by address
Reviewers: clayborg.
Subscribers: jaydeep, bhushan, sagar, nitesh.jain, lldb-commits.
Differential Revision: http://reviews.llvm.org/D16397

llvm-svn: 258621
2016-01-23 10:36:06 +00:00
Todd Fiala efbb273ea0 Skipped IncompleteModulesTestCase on OS X
This is hitting an assert in clang when evaluating the
module load.  I am seeing it locally on Xcode 7.3 public Beta 1
and on the llvm.org Green Dragon buildbot supposedly running
Xcode 7.0.

Tracked by:
https://llvm.org/bugs/show_bug.cgi?id=26267

llvm-svn: 258602
2016-01-23 02:34:16 +00:00
Todd Fiala 299d42a170 fixed TestConsecutiveBreakpoints test on OS X
Also renamed directory and class name to fix typos.

llvm-svn: 258601
2016-01-23 02:24:41 +00:00
Zachary Turner ec56018938 Fix missing function argument passthrough.
llvm-svn: 258592
2016-01-23 00:49:11 +00:00
Zachary Turner 8012496a91 Decode files with UTF-8 in lldbutil.line_number.
Since Unicode support is different in Py2 and Py3, Py3 was throwing
exceptions about being unable to decode the file with the default
encoding.

llvm-svn: 258588
2016-01-22 23:54:49 +00:00
Zachary Turner 9bd1c596dd Un xfail TestSettings.test_run_args_and_env_vars_with_dwarf
llvm-svn: 258587
2016-01-22 23:54:45 +00:00
Zachary Turner 1da094a5ec More fixes related to counting threads on Windows.
The Windows 10 loader spawns threads at startup, so
tests which count threads or assume that a given user
thread will be at a specific index are incorrect in
this case.  The fix here is to use the standard mechanisms
for getting the stopped thread (which is all we are
really interested in anyway) and correlating them with
the breakpoints that were set, and doing checks against
those things.

This fixes about 6 tests on Windows 10.

llvm-svn: 258586
2016-01-22 23:54:41 +00:00
Todd Fiala 8c8c9fb5d4 candidate fix for Green Dragon lldb testbot
The python test run target started failing recently.
I tracked it down to what looks like the passing of
environment variables into the python script.

This locally fixes the vast majority of errors that
were ultimately inferior test build command failures.
Not sure what caused that to start happening.

llvm-svn: 258585
2016-01-22 23:50:57 +00:00
Enrico Granata 6eeb5e70e7 Add a helper function to ProcessStructReader to allow one to inquire about the offset of a field
llvm-svn: 258584
2016-01-22 23:50:46 +00:00
Adrian McCarthy bce5d9adce XFail a test from TestConditionalBreak.py on Windows.
Filed a bug to investigate later:  llvm.org/pr26265

llvm-svn: 258578
2016-01-22 23:05:47 +00:00
Adrian McCarthy 3ca8aa5af6 XFail TestNamespaceLookup tests on Windows.
There's already a pr:  https://llvm.org/bugs/show_bug.cgi?id=25819

llvm-svn: 258577
2016-01-22 23:05:29 +00:00
Todd Fiala 16c4e16c35 added test fixture to EditlineTest gtest
Primarily a trial test for me to try out the
git clang-format integration.  Works like a charm!

This change adds a gtest fixture for the EditlineTest
common setup and teardown code.

llvm-svn: 258565
2016-01-22 21:58:55 +00:00
Saleem Abdulrasool c98d969e9f Commands: silence dumb -Wextra warning from GCC
This is a rather unhelpful warning indicating that the ternary operator return
types are mismatched, returning an integer and an enumeral type.  Since the
integeral type is shorter to type, cast the enumeral type to `int`.  Silences
the -Wextra warning from GCC.

llvm-svn: 258548
2016-01-22 20:26:34 +00:00
Saleem Abdulrasool 79e6749da3 Target: fix -Wcast-qual warning
We were unnecessarily stripping the const qualifier on the temporary variable.
Restore the constness to avoid the warning.  NFC.

llvm-svn: 258547
2016-01-22 20:26:32 +00:00
Saleem Abdulrasool 27ea26b7c0 Silence -Wreturn-type warnings
Address a couple of instances of -Wreturn-type warning from GCC.  The switches
are covered, add an llvm_unreachable to the end of the functions to silence the
warning.  NFC.

llvm-svn: 258546
2016-01-22 20:26:30 +00:00
Todd Fiala f8f8a6de06 fixed test suite crash when --platform-name doesn't start with 'remote-'
Also removes Darwin test case files from the expectedTimeout hard-coded
file list.

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

llvm-svn: 258542
2016-01-22 20:20:48 +00:00
Pavel Labath 4b70eb7b2b Revert "Enable test log collection from remote debug servers"
Unfortunately, this turns out not to be working on the lldb-server tests, as there the server is
started in a different way. Since this was a bit of a hack to start with, I am removing it until
I can solve the problem more holistically.

llvm-svn: 258501
2016-01-22 14:50:29 +00:00
Bhushan D. Attarde b56e5d231f Use "_$" prefix instead of "$" for dynamic checker function inserted by LLDB during expression evaluation
SUMMARY:
    The symbol "$" has a special meaning for MIPS i.e it is marker for temporary symbols for MIPS.
    So this patch uses additional _ prefix for "$__lldb_valid_pointer_check" so that it wont be marked as temporary symbol in case of MIPS.
    
    Reviewers: clayborg, spyffe
    Subscribers: dean, emaste, mohit.bhakkad, sagar, jaydeep, lldb-commits
    Differential http://reviews.llvm.org/D14111

llvm-svn: 258485
2016-01-22 05:02:02 +00:00
Eduard Burtescu d05b899252 [opaque pointer types] [NFC] Fix fallout from DataLayout::getIndexedOffset changes (rL258478).
llvm-svn: 258481
2016-01-22 03:43:23 +00:00
Adrian McCarthy 524afae807 Fix TestImport.py to work with Python 3.5.
Differential Revision: http://reviews.llvm.org/D16431

llvm-svn: 258448
2016-01-21 23:07:48 +00:00
Greg Clayton a5d1f62d2d Always try to read DW_TAG_typedef types from DWO files first if we can.
A lot of C code uses code like:

typedef struct 
{
   int a;
} FooType;
          
This creates debug info with an anonymous struct (a DW_TAG_structure_type with no DW_AT_name) and then a DW_TAG_typedef that points to the anonymous structure type. When a typedef is from a module and clang uses -gmodules and -fmodules, then we can end up trying to resolve an anonymous structure type in a DWO symbol file. This doesn't work very well when the structuture has no name, so we now check if a typedef comes from a module, and we directly resolve the typedef type in the module and copy it over. The version we copy from the module of course is correctly able to find the structure in the DWO symbol file, so this fixes the issues we run into.

<rdar://problem/24092915> 

llvm-svn: 258443
2016-01-21 22:26:13 +00:00
Adrian McCarthy f0a275e035 NFC. Corrects name of test class and a comment.
llvm-svn: 258433
2016-01-21 21:10:00 +00:00
Zachary Turner 783550be62 Remove assumptions that thread 0 is always the main thread.
Starting with Windows 10, the Windows loader is itself multi-threaded,
meaning that the loader spins up a few threads to do process
initialization before it executes main.  Windows delivers these
notifications asynchronously and they can come out of order, so
we can't be sure that the first thread we get a notification about
is actually the zero'th thread.

This patch fixes this by requesting the thread stopped at the
breakpoint that was specified, rather than getting thread 0 and
verifying that it is stopped at a breakpoint.

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

llvm-svn: 258432
2016-01-21 21:07:30 +00:00
Adrian McCarthy 225d3ea340 Add CalculateSymbolSizes in ObjectFilePECOFF::GetSymtab to ensure that (nearly) all the symbols have sizes.
This fixes the `thread step-over` regression exposed by http://reviews.llvm.org/D16186 , which depends on the symbols having actual sizes.  Nine tests on Windows had started failing as a result.  They all work again with this fix.

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

llvm-svn: 258429
2016-01-21 20:58:12 +00:00
Pavel Labath e3e6be2aab Enable test log collection from remote debug servers
Summary:
We already have the ability to collect the server logs when doing local debugging. This enables
the collection of remote logs as well. This relies on specifying a relative path "server.log" for
LLDB_DEBUGSERVER_LOG_FILE when starting remote platform. Since we always set the platform working
directory to a fresh folder to avoid conflicts, the actual file path will always be different and
we can pick the logs up from there.

Reviewers: tfiala

Subscribers: lldb-commits

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

llvm-svn: 258414
2016-01-21 17:54:14 +00:00
Jason Molenda 1a75b0d14f When ObjectFileMachO reads a Mach-O file for a 32-bit arm cpu,
set the triple's "vendor" field to Apple.  

We don't want to assume a vendor of Apple for all Mach-O files -
this breaks x86_64 EFI debugging where they put non-Apple binaries
in a Mach-O format for ease of handling.

But on armv7, Apple's ABI always uses r7 as the frame pointer
register; if we don't set the Vendor field to Apple, we can pick
up a generic armv7 ABI where the fp is r11 (or r7 for thumb) which
breaks backtracing altogether.

Greg is reluctant for us to make any assumptions about the Vendor
here, but we'll see how this shakes out.  It's such a big problem
on armv7 if we don't know this is using the Apple ABI that it's worth
trying this approach.

<rdar://problem/22137561> 

llvm-svn: 258387
2016-01-21 04:38:05 +00:00
Enrico Granata 35e0639018 Fix a problem where we were not calling fcntl() with the correct arguments for F_DUPFD
On Mac OS X, this was working just fine in debug builds (presumably, because the right value ended up being at the right location for the variadic ABI), but not in Release builds
As a result, we were seeing failures with commands that set their own immediate output stream - only in Release builds, which always makes for a fun little investigation

I have removed those fcntl() calls and replaced them with dup() calls. This fixes the issue in both Debug and Release builds

llvm-svn: 258367
2016-01-20 23:20:10 +00:00
Sean Callanan 10badfc924 Fixed some #ifdefs. We were erroneously not supporting certain simulators.
We had some #ifdefs that were looking for the wrong #defines and as a result
debugserver didn't have support for certain simulators.  This patch resolves
the problem.

llvm-svn: 258365
2016-01-20 23:12:39 +00:00
Omair Javaid 94b94421a4 Mark arm/aarch64 specific xfails with expectedFailureLinux decorator
This patch marks some known failures and puts on expectedFailureLinux decorator to have testsuite xfail them.

Affected tests are: 

test/functionalities/watchpoint/step_over_watchpoint.py
test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py
test/tools/lldb-server/TestGdbRemoteSingleStep.py
test/tools/lldb-server/TestGdbRemote_vCont.py

llvm-svn: 258315
2016-01-20 15:01:54 +00:00
Pavel Labath a975959996 Fix clang warning in RenderScriptRuntime
std::array should have "the same semantics as a struct holding a C-style array T[N] as its only
non-static data member", so the initialization should have one more level of braces. Hopefully,
no compiler will object to that.

llvm-svn: 258306
2016-01-20 12:23:23 +00:00
Pavel Labath db1958d136 Enable TestInlineStepping on linux i386
Test has been passing at least the last 200 buildbot runs.

llvm-svn: 258305
2016-01-20 12:17:26 +00:00
Pavel Labath 806ad5977d Enable TestConcurrentEvents on i386 linux
The test has been passing reliably the last 100 runs of the build bot.

llvm-svn: 258304
2016-01-20 12:09:12 +00:00
Ewan Crawford 4f8817c2db [RenderScript] New command for viewing coordinate of current kernel invocation
Patch adds command 'language renderscript kernel coordinate' for printing the kernel index in (x,y,z) format.
This is done by walking the call stack and looking for a function with suffix '.expand', as well as the frame variables containing the coordinate data. 

llvm-svn: 258303
2016-01-20 12:03:29 +00:00
Jason Molenda c197e81d07 Some 32-bit arm corefiles on darwin may have their general purpose
register set indicated by ARM_THREAD_STATE32 (value 9) instead of
the old ARM_THREAD_STATE (value 1); this patch changes lldb to
accept either register set flavor code.

<rdar://problem/24246257>

llvm-svn: 258289
2016-01-20 05:17:13 +00:00
Davide Italiano 13fe2a9517 Placate MVSC after my last commit.
Zachary introduced the 'default' case explicitly to placate a warning in
the Microsoft compiler but that broke clang with -Werror. 
The new code should keep both compilers happy.

llvm-svn: 258212
2016-01-19 22:47:51 +00:00
Davide Italiano 576dc8d27d [Process] Remove dead code. All the switch cases are already covered.
llvm-svn: 258199
2016-01-19 21:59:12 +00:00
Sean Callanan 40574bdb7a Removed a bunch of spurious files from the man page Copy Files build phase.
A few files were accidentally added to the Copy Files build phase for our man
page, and they would appear when 'xcodebuild install' was invoked.  This removes
those files – they continue to be built correctly, but they aren't installed
with our man page.

llvm-svn: 258194
2016-01-19 21:48:25 +00:00
Oleksiy Vyalov 8b85b03b06 Implementing the method Target::TargetEventData::Dump (Stream *s) so that its clients can easily dump it out for informational messages.
http://reviews.llvm.org/D16244

Submitting on behalf of vishwesh@google.com.

llvm-svn: 258150
2016-01-19 17:54:47 +00:00
Ravitheja Addepally 15f89c420b Fix for Bug 25338
Summary:
The issue arises because LLDB is not
able to read the vdso library correctly.
The fix adds memory allocation callbacks
to allocate sufficient memory in case the
requested offsets don't fit in the memory
buffer allocated for the ELF.

Reviewers: lldb-commits, clayborg, deepak2427, ovyalov, labath, tberghammer

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

llvm-svn: 258122
2016-01-19 12:55:21 +00:00
Pavel Labath f82d71f025 Remove last XTIMEOUTs from android tests
TestHelloWorld seems to be passing now as far as I can tell. TestExitDuringStep is still hanging.
I have marked the relevant tests as flaky, which should handle the timeouts now as well. I'll be
monitoring the buildbots for fallout.

llvm-svn: 258114
2016-01-19 10:59:10 +00:00
Tamas Berghammer 8c6996f737 Unconditionally accept symbol sizes from elf
The ELF symbol table always contain the size of the symbols so we
don't have to try to guess them based on the address of the next
symbol (it is needed for mach-o).

The change fixes an issue when a symbol is removed after a 0 size
symbol (e.g. because the second one is not public) what previously
caused the symbol lookup algorithm to end up with showing the 0 size
symbol even for the later addresses (what are not part of any symbol).
That symbol lookup error can confuse the user and also confuses the
current stack unwinder.

Re-commit this CL after fixing the issue with gcc-4.9.2 on i386 Linux.

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

llvm-svn: 258113
2016-01-19 10:24:51 +00:00
Rafael Espindola a94ae1e05b Update for llvm change. NFC.
llvm-svn: 258080
2016-01-18 20:57:54 +00:00
Pavel Labath bace94eda8 Remove skipIfLinuxClang decorator
it isn't used in the code anymore, and we're trying to cut down on the decorators.

llvm-svn: 258049
2016-01-18 15:01:14 +00:00
Pavel Labath 4da73573ab Guard against application of an XFAIL decorator on a class
This does not work and causes the class to be silently skipped, which is a bad idea. This makes
sure it cannot happen accidentaly. I've played with the idea of actually making the decorator
work at class level, but it proved too magic to do at this moment.

llvm-svn: 258048
2016-01-18 14:45:35 +00:00
Tamas Berghammer dcad424cd3 Revert "Unconditionally accept symbol sizes from elf"
It causes issues for i386 when compiling with gcc-4.9.2

This reverts commit e248214a3eab8e244095f97d1996c991cb988cc4.

llvm-svn: 258043
2016-01-18 11:49:18 +00:00
Tamas Berghammer 6b2322fb4c Unconditionally accept symbol sizes from elf
The ELF symbol table always contain the size of the symbols so we
don't have to try to guess them based on the address of the next
symbol (it is needed for mach-o).

The change fixes an issue when a symbol is removed after a 0 size
symbol (e.g. because the second one is not public) what previously
caused the symbol lookup algorithm to end up with showing the 0 size
symbol even for the later addresses (what are not part of any symbol).
That symbol lookup error can confuse the user and also confuses the
current stack unwinder.

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

llvm-svn: 258040
2016-01-18 10:38:34 +00:00
Ewan Crawford 836d965168 [RenderScript] Remove mips specific expressions
Reverts earlier commit r254910, which used function pointers for jitted expressions
to avoid a Mips64 compiler bug. Bug has since been fixed, and compiler longer issues the problem instruction.

Author: Dean De Leo <dean@codeplay.com>
llvm-svn: 258038
2016-01-18 09:16:02 +00:00
Zachary Turner 778cec3e30 On non-Windows platforms, asm int 3 generates an eStopReasonSignal.
llvm-svn: 257959
2016-01-15 23:44:45 +00:00
Zachary Turner fa0b4b271a Fix TestDebugBreak.py.
We can't assume that the main thread of an inferior has index 0,
even in a single-threaded app.

llvm-svn: 257946
2016-01-15 22:22:40 +00:00
Zachary Turner 21da1ed15b Fix ResourceWarning about unclosed file in use_lldb_suite_root.py.
llvm-svn: 257945
2016-01-15 22:22:35 +00:00
Adrian McCarthy 8801145ad4 Small fixes to ensure TestLogging.py tests work with Python 3.5 as well as 2.7.
llvm-svn: 257931
2016-01-15 20:45:06 +00:00
Ryan Brown 47d072ca48 Implement missing GoASTContext methods
llvm-svn: 257926
2016-01-15 19:35:48 +00:00
Pavel Labath 0771b18257 Fix decoration of TestConcurrentEvents
TestConcurrentEvents was marked with a XFAIL decorator at class level, which actually does not
work, and causes the class to be silently skipped everywhere. It seems that making it work at
class level is quite a difficult task, so I will just move it to the individual test methods. I
will follow this up with a commit which makes the decorator blow up in case someone tries to
apply it to a class in the future.

llvm-svn: 257901
2016-01-15 16:20:01 +00:00
Jim Ingham cc4609a26b The ASAN report fetching code had two latent bugs:
1) It was forward declaring functions without 'extern "C"'.  That used to work
   but only because of another bug in how we passes symbol only function names to the
   compiler and stopped working recently.
2) These forward declarations were in the body of the User Expression, and they actually
   need to go in the prefix file.

<rdar://problem/24177689>

llvm-svn: 257852
2016-01-15 01:03:50 +00:00
Adrian McCarthy aa1f270151 Fix detection of teardown hooks that are already bound.
llvm-svn: 257829
2016-01-14 22:52:16 +00:00
Sean Callanan e594268e37 Removed a redundant function call after review.
llvm-svn: 257818
2016-01-14 22:05:26 +00:00
Sean Callanan b0300a4c30 Enable the use of modules in the expression parser by default.
If your program refers to modules (as indicated in DWARF) we will now try to
load these modules and give you access to their types in expressions.  This used
to be gated by a setting ("settings set target.auto-import-clang-modules true")
but that setting defaulted to false.  Now it defaults to true -- but you can
disable it by toggling the setting to false.

llvm-svn: 257812
2016-01-14 21:46:09 +00:00
Zachary Turner 1d89df0998 Resubmit the fixes for TestProcessLaunch.py.
I was calling the base class tearDown() function the wrong way
which for some reason is ok on Python 3 but not on Python 2.

llvm-svn: 257788
2016-01-14 19:14:02 +00:00
Sean Callanan 9b0cfe2510 Fixed a crasher when dealing with table entries that have blank names.
This can happen with -gmodules tables when an anonymous struct is referred to.

llvm-svn: 257786
2016-01-14 18:59:49 +00:00
Aidan Dodds e09c44b6ff [RenderScript] Hook kernel invocation.
This patch adds a hook to track kernel invocations and to track all script and allocation objects used.

llvm-svn: 257772
2016-01-14 15:39:28 +00:00
Tamas Berghammer f84df99520 Update some XFAILs after the 3.8->3.9 version change
llvm-svn: 257761
2016-01-14 12:49:48 +00:00
Ewan Crawford d0d85d22f8 Fix ambiguous resolution of clang::ArrayType/llvm::ArrayType in ClangAstContext
Both llvm and clang have an ArrayType class, which can cause resolution to fail when llvm headers that are implicitly included name this type.
source/Symbol/ClangASTContext.cpp has 'using namespace llvm;' and 'using namespace clang;' 

Author: Luke Drummond <luke.drummond@codeplay.com>
Differential Revision: http://reviews.llvm.org/D16155

llvm-svn: 257759
2016-01-14 12:18:09 +00:00
Tamas Berghammer 3fa2395aa5 XFAIL TestCommandScriptImmediateOutput on Linux
llvm-svn: 257755
2016-01-14 10:56:56 +00:00
Todd Fiala 02fe4b9334 change Xcode test run default to ignore xpass on Xunit output
The Green Dragon LLVM builders are starting to parse xunit output
on LLDB Xcode builders.  By default the XML formatter treats
xpass (unexpected successes) as failures.  The new flag added
ensures we simply ignore those for purposes of xUnit output.
LLDB is not currently XPASS clean.

llvm-svn: 257717
2016-01-13 23:55:16 +00:00
Hans Wennborg 400e1809ad Fix -Wformat-pedantic warning
/work/llvm-3.8/llvm.src/tools/lldb/source/API/SBProcess.cpp:1003:73:
error: format specifies type 'void *' but the argument has type 'lldb_private::Event *' [-Werror,-Wformat-pedantic]
        log->Printf ("SBProcess::%s (event.sp=%p) => %d", __FUNCTION__, event.get(), ret_val);
                                              ~~                        ^~~~~~~~~~~
1 error generated.

llvm-svn: 257692
2016-01-13 22:40:26 +00:00
Hans Wennborg 6ab018ec2e Include IR/DerivedTypes.h instead of IR/Type.h to match LLVM change r256406.
This is similar to r256407 and fixes the following warning:

In file included from /work/llvm-3.8/llvm.src/tools/lldb/source/Target/ThreadPlanCallFunctionUsingABI.cpp:14:
In file included from /work/llvm-3.8/llvm.src/tools/lldb/include/lldb/Target/ThreadPlanCallFunctionUsingABI.h:23:
/work/llvm-3.8/llvm.src/include/llvm/IR/Type.h:350:16: error: inline function 'llvm::Type::getSequentialElementType' is not defined [-Werror,-Wundefined-inline]
  inline Type *getSequentialElementType() const;
               ^
/work/llvm-3.8/llvm.src/include/llvm/IR/Type.h:353:46: note: used here
  Type *getArrayElementType() const { return getSequentialElementType(); }
                                             ^
1 error generated.

I'm not sure why it's not showing on any bots.

llvm-svn: 257691
2016-01-13 22:40:24 +00:00
Zachary Turner 400767af54 Revert changes to TestProcessLaunch.py as they are breaking a build.
llvm-svn: 257690
2016-01-13 22:32:31 +00:00
Zachary Turner d79bc32668 Rename MSVC top-level folder to avoid name collision.
If you have two folders with the same name but different cases,
MSBuild gets confused and generates an error when building
from within Visual Studio.

This patch renames it so that the cases of all folders named
"LLDB tests" match.

Patch by Jonathan Meier
Differential Revision: http://reviews.llvm.org/D16150

llvm-svn: 257684
2016-01-13 22:00:44 +00:00
Zachary Turner a505be4e5d Fix some compiler warnings with MSVC 2015.
llvm-svn: 257671
2016-01-13 21:22:00 +00:00
Zachary Turner 673cf7e80b Get rid of const char** typemaps.
We already have char** typemaps which were near copy-pastes of
the const char** versions.  This way we have only one version that
works for both.

llvm-svn: 257670
2016-01-13 21:21:54 +00:00
Zachary Turner 19e2ea8fb6 Fix TestProcessLaunch for Python 3.
There were a number of problems preventing this from working:

1. The SWIG typemaps for converting Python lists to and from C++
   arrays were not updated for Python 3.  So they were doing things
   like PyString_Check instead of using the PythonString from
   PythonDataObjects.
2. ProcessLauncherWindows was ignoring the environment completely.
   So any test that involved launching an inferior with any kind
   of environment variable would have failed.
3. The test itself was using process.GetSTDOUT(), which isn't
   implemented on Windows.  So this was changed to save the
   value of the environment variable in a local variable and
   have the debugger look at the value of the variable.

llvm-svn: 257669
2016-01-13 21:21:49 +00:00
Enrico Granata 983ad65220 Mark these tests on FreeBSD and Linux as non-flakey. We don't know that they are
llvm-svn: 257656
2016-01-13 19:29:52 +00:00
Sean Callanan f03dbb3cb5 Fixed a problem where the Xcode build put lldb's __init__.py in the wrong place.
Most of the time CONFIGURATION_BUILD_DIR and BUILT_PRODUCTS_DIR are the same,
but they are different in 'xcodebuild install' situations.  The file needs to be
put into BUILT_PRODUCTS_DIR or lldb's Python interface doesn't work when lldb is
built using 'xcodebuild install'.

llvm-svn: 257653
2016-01-13 19:23:30 +00:00
Enrico Granata 744959b9c9 Fix an issue where scripted commands would not actually print any of their output if an immediate output file was set in the result object via a Python file object
Fixes rdar://24130303

llvm-svn: 257644
2016-01-13 18:11:45 +00:00
Tamas Berghammer 808ff186f6 Silence an incorrect dwarf parsing warning
We have a check what warns if the offset of a class member is greater
then or equal to the size of the class. The warning is valid in most
case but it is invalid when the last data member is a 0 size array
because in this case the member offset can be equal to the class size
(subject to alignment limitations).

This CL fixis LLDB to not print out a warning in this special case.

llvm-svn: 257603
2016-01-13 14:58:48 +00:00
Sagar Thakur dd113648af [LLDB][MIPS] Fix TestDisassembleRawData.py
Patch by Nitesh Jain.

Summary: This patch adds check for the correctness of disassembling instruction for MIPS target.

Reviewers: emaste, clayborg, ovyalov
Subscribers: lldb-commits, mohit.bhakkad, sagar, bhushan, jaydeep
Differential: http://reviews.llvm.org/D15915
llvm-svn: 257587
2016-01-13 11:22:56 +00:00
Jason Molenda 50018d3cf5 Add a small refinement to the qSymbol:: support in lldb.
This is a packet which allows the remote gdb stub to ask for the address
of a symbol in the process.  lldb sends the packet (offering to provide
addresses for symbol names) after every solib loaded.  I changed lldb so
that once the stub has indicated that it doesn't need any more symbol
addresses, lldb will stop sending the qSymbol:: packet on new solib loads.

This can yield a performance benefit over slower communication links when
there are many solibs involved.

<rdar://problem/23310049> 

llvm-svn: 257569
2016-01-13 04:08:10 +00:00
Siva Chandra b4f94aaf9b [TestThreadJump] Adjust match sub-string after recent change.
Reviewers: zturner

Subscribers: zturner, lldb-commits

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

llvm-svn: 257531
2016-01-12 22:33:19 +00:00
Zachary Turner 9d59306528 Fix TestThreadJump on Windows.
The system can create threads for a system threadpool, so there is
no guarantee that the thread that is stopped is thread 1.  So use
a more robust check.

llvm-svn: 257513
2016-01-12 20:45:29 +00:00
Stephane Sezer 1307d4c7df Fix build breakage of r257502.
llvm-svn: 257510
2016-01-12 20:22:58 +00:00
Stephane Sezer 87b0fe075e Increase use of svr4 packets to improve performance on POSIX remotes
Summary:
Allows the remote to enumerate the link map when adding and removing
shared libraries, so that lldb doesn't need to read it manually from
the remote's memory.

This provides very large speedups (on the order of 50%) in total
startup time when using the ds2 remote on android or Tizen devices.

Reviewers: ADodds, tberghammer, tfiala

Subscribers: tberghammer, sas, danalbert, llvm-commits, srhines

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

Change by Francis Ricci <fjricci@fb.com>

llvm-svn: 257502
2016-01-12 19:02:41 +00:00