Commit Graph

12286 Commits

Author SHA1 Message Date
Enrico Granata d1216d6b12 And of course, typos
llvm-svn: 246519
2015-09-01 01:23:22 +00:00
Enrico Granata fcc353d952 Attempt at fixing the CMake build
llvm-svn: 246518
2015-09-01 01:23:02 +00:00
Enrico Granata 2233895a3b Add support for language plugins to provide data formatters
Historically, data formatters all exist in a global repository (the category map)
On top of that, some formatters can be "hardcoded" when the conditions under which they apply are not expressible as a typename (or typename regex)

This change paves the way to move formatters into per-language buckets such that the C++ plugin is responsible for ownership of the C++ formatters, and so on
The advantages of this are:
a) language formatters only get created when they might apply
b) formatters for a language are clearly owned by the matching language plugin

The current model is one of static instantiation, that is a language knows the full set of formatters it vends and that is only asked-for once, and then handed off to the FormatManager
In a future revision it might be interesting to add similar ability to the language runtimes, and monitor for certain shared library events to add even more library-specific formatters

No formatters are moved as part of this change, so practically speaking this is NFC

llvm-svn: 246515
2015-09-01 01:01:48 +00:00
Enrico Granata ad91c7cee2 Make FormatEntity be a little bit smarter when printing function arguments
llvm-svn: 246512
2015-09-01 00:19:35 +00:00
Ed Maste 8bb3d04adc Remove expectedFailureFreeBSD for passing pexpect tests
These tests work when run locally. They had been occasionally failing
on the FreeBSD buildbot due to pexpect issues. That buildbot is
currently down, and I expect the replacement will not have this issue.

llvm.org/pr22784

llvm-svn: 246490
2015-08-31 21:37:15 +00:00
Greg Clayton 915272ff54 Stop objects from keeping a strong reference to the process when they should have a weak reference.
llvm-svn: 246488
2015-08-31 21:25:45 +00:00
Adrian McCarthy 23d14b6ade Differential Review: http://reviews.llvm.org/D12363
llvm-svn: 246302
2015-08-28 14:42:03 +00:00
Sylvestre Ledru 79cb0090ff Avoid usage of F_DUPFD_CLOEXEC where not available (e.g. kfreebsd*)
Summary:
kfreebsd doesn't have F_DUPFD_CLOEXEC, so use it conditionally.

Author: Emilio Pozuelo Monfort <pochu@debian.org>
Author: Petr Salinger <Petr.Salinger@seznam.cz>
Author: Gianfranco Costamagna

Reviewers: emaste

Subscribers: emaste

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

llvm-svn: 246294
2015-08-28 12:24:07 +00:00
Mohit K. Bhakkad 16ad032183 [LLDB][MIPS] Aligning code with rL245831
Reviewers: jaydeep
Subscribers: lldb-commits.
Differential Revision: http://reviews.llvm.org/D12427

llvm-svn: 246293
2015-08-28 12:08:26 +00:00
Greg Clayton 261ac3f4b5 Made a new abstract class named "DWARFASTParser" which lives in "source/Plugins/SymbolFile/DWARF":
class DWARFASTParser
{
public:
    virtual ~DWARFASTParser() {}

    virtual lldb::TypeSP
    ParseTypeFromDWARF (const lldb_private::SymbolContext& sc,
                        const DWARFDIE &die,
                        lldb_private::Log *log,
                        bool *type_is_new_ptr) = 0;


    virtual lldb_private::Function *
    ParseFunctionFromDWARF (const lldb_private::SymbolContext& sc,
                            const DWARFDIE &die) = 0;

    virtual bool
    CompleteTypeFromDWARF (const DWARFDIE &die,
                           lldb_private::Type *type,
                           lldb_private::CompilerType &clang_type) = 0;

    virtual lldb_private::CompilerDeclContext
    GetDeclContextForUIDFromDWARF (const DWARFDIE &die) = 0;

    virtual lldb_private::CompilerDeclContext
    GetDeclContextContainingUIDFromDWARF (const DWARFDIE &die) = 0;

};

We have one subclass named DWARFASTParserClang that implements all of the clang specific AST type parsing. This keeps all DWARF parsing in the DWARF plug-in. Moved all of the DWARF parsing code that was in ClangASTContext over into DWARFASTParserClang.

lldb_private::TypeSystem classes no longer have any DWARF parsing functions in them, but they can hand out a DWARFASTParser:

virtual DWARFASTParser *
GetDWARFParser ()
{
    return nullptr;
}

This keeps things clean and makes for easy merging when we have different AST's for different languages.

llvm-svn: 246242
2015-08-28 01:01:03 +00:00
Enrico Granata 2996d8236c Include <mutex>
llvm-svn: 246222
2015-08-27 22:14:06 +00:00
Enrico Granata 0f72c8ee4e Fixup one of the CMakeLists
llvm-svn: 246220
2015-08-27 21:55:55 +00:00
Enrico Granata 8f5e331dc2 Added a missing file to the CMakeLists
llvm-svn: 246216
2015-08-27 21:45:59 +00:00
Enrico Granata 5f9d310640 Add a new type of plugin: Language plugin
The Language plugin is menat to answer language-specific questions that are not bound to the existence of a process. Those are still the domain of the LanguageRuntime plugin

The Language plugin will, instead, answer questions such as providing language-specific data formatters or expression evaluation

At the moment, the interface is hollowed out, and empty do-nothing plugins have been setup for ObjC, C++ and ObjC++

llvm-svn: 246212
2015-08-27 21:33:50 +00:00
Enrico Granata db3d58b94a Remove class Language - the only thing it was actually being used for is provided by LanguageRuntime already
llvm-svn: 246177
2015-08-27 18:18:49 +00:00
Greg Clayton 5ce1a84f9a More cleanup to make sure no one plays with DWARFDebugInfoEntry. Clients outside of DWARFDebugInfoEntry of DWARFCompileUnit should use DWARFDIE only.
llvm-svn: 246172
2015-08-27 18:09:44 +00:00
Dawn Perchik f71e8370d1 Fix lldb build on older OSX versions after svn commit r244716
Older OSX versions don't define NSOperatingSystemVersion, so building
lldb gets: error: unknown type name 'NSOperatingSystemVersion'
This patch fixes the build by having GetOSVersionNumbers return false if
__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101000, causing lldb to
behave the same as it did before the commit.

Reviewed by: jasonmolenda
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D12396

llvm-svn: 246138
2015-08-27 03:42:56 +00:00
Enrico Granata 6e25aeea96 Add functionality to the platforms to figure out the proper name for a dynamic library on the system given a basename
This will do things like,
given mylibrary,
return

libmylibrary.dylib on OSX
mylibrary.dll on Windows

and so on for other platforms
It is currently implemented for Windows, Darwin, and Linux. Other platforms should fill in accordingly

llvm-svn: 246131
2015-08-27 00:53:57 +00:00
Enrico Granata c0499c9848 Switch data formatters over to using std::function for their callbacks instead of raw function pointers. NFC
llvm-svn: 246130
2015-08-27 00:45:33 +00:00
Stephane Sezer 03439a87cf Silence some MSVC warnings.
Summary:
Just `assert("string" && false)` instead of `assert("string" == NULL)`.

This avoid errors like

    [...]\Core\SourceManager.cpp(647): warning C4130: '==' : logical operation on address of string constant

Reviewers: zturner

Subscribers: lldb-commits

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

llvm-svn: 246123
2015-08-26 23:55:14 +00:00
Greg Clayton 6071e6fc94 Major DWARF cleanup.
Added a new class called DWARFDIE that contains a DWARFCompileUnit and DWARFDebugInfoEntry so that these items always stay together.

There were many places where we just handed out DWARFDebugInfoEntry pointers and then use them with a compile unit that may or may not be the correct one. Clients outside of DWARFCompileUnit and DWARFDebugInfoEntry should all be dealing with DWARFDIE instances instead of playing with DWARFCompileUnit/DWARFDebugInfoEntry pairs manually.

This paves to the way for some modifications that are coming for DWO.

llvm-svn: 246100
2015-08-26 22:57:51 +00:00
Todd Fiala f50b20d819 http://reviews.llvm.org/D12380: remove DWARFCompileUnit printf spam.
llvm-svn: 246091
2015-08-26 22:08:26 +00:00
Enrico Granata 7539b02803 Fix missing override warnings
llvm-svn: 246084
2015-08-26 21:39:52 +00:00
Zachary Turner b1490b6172 Don't throw an exception when module cleanup fails.
Just because one test fails to clean up correctly, it should not
prevent other tests from attempting to run.

llvm-svn: 246063
2015-08-26 19:44:56 +00:00
Zachary Turner 0844d8db4c On Windows, use 'del' instead of 'rm' to delete the test executable.
This is a nasty hack to work around the issue described in
https://llvm.org/pr24589

llvm-svn: 246062
2015-08-26 19:44:45 +00:00
Zachary Turner 893b09e1af XFAIL environment variable setting test on Windows.
Fixing this is tracked by https://llvm.org/pr24579

llvm-svn: 246061
2015-08-26 19:44:36 +00:00
Zachary Turner 93bf79a719 Disable Objective C test on non-Darwin platforms.
llvm-svn: 246060
2015-08-26 19:44:28 +00:00
Omair Javaid 3a56363aec Error checking correction in AArch64 hardware watchpoint code
Differential Revision: http://reviews.llvm.org/D12328

llvm-svn: 246045
2015-08-26 18:23:27 +00:00
Dawn Perchik 2b6eab3273 Skip test which is causing ERRORs in dotest.py after r237053
This test runs fine on its own, but leaves python in a bad state to
where all tests that run after it error out.  See llvm.org/pr24575.
This resolves the concerns raised in http://reviews.llvm.org/rL237053.

Reviewed by: clayborg, ted
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D12329

llvm-svn: 246043
2015-08-26 18:16:45 +00:00
Bhushan D. Attarde 7f3daeda9a [MIPS] Avoid breakpoint in delay slot
SUMMARY:
    This patch implements Target::GetBreakableLoadAddress() method that takes an address
    and checks for any reason there is a better address than this to put a breakpoint on.
    If there is then return that address.
    MIPS uses this method to avoid breakpoint in delay slot.
    
    Reviewers: clayborg, jingham
    Subscribers: jingham, mohit.bhakkad, sagar, jaydeep, nitesh.jain, lldb-commits
    Differential Revision: http://http://reviews.llvm.org/D12184

llvm-svn: 246015
2015-08-26 06:04:54 +00:00
Jason Molenda da9765b966 In SendContinuePacketAndWaitForResponse there is a special bit of
code that looks for a second stop-reply packet in response to an
interrupt (control-c).  This is to handle the case where where a
stop packet is making its way up to lldb right as lldb decides to
interrupt the inferior.  If the inferior is running and we interrupt
it, we'd expect a T11 type response meaning that the inferior halted
because of the interrupt.  But if the interrupt gets a T05 type
response instead, meaning that we stopped execution by hitting a
breakpoint or whatever, then the interrupt was received while the
inferior was already paused and so it is treated as a "?" packet
-- the remote stub will send the stop message a second time.

There's a timeout where we wait to get this second stop reply packet
in SendContinuePacketAndWaitForResponse, currently 1ms.  For a slow
remote target, it may take longer than that to send the second stop
reply packet.  If that happens, then lldb will use that second stop
reply packet as the response for the next packet request it makes 
to the remote stub.  The two will be out of sync by one packet for
the rest of the debug session and it's going to go badly from then on.

I've seen times as slow as 46ms, and given the severity of missing that
second stop reply packet, I'm increasing the timeout to 100ms, or 0.1sec.
<rdar://problem/21990791> 

llvm-svn: 246004
2015-08-26 04:07:30 +00:00
Enrico Granata 54ed7e18f2 Rename all functionalities/data-formatter test case with radar bug numbers in them to more meaningful names
llvm-svn: 245993
2015-08-25 23:55:10 +00:00
Zachary Turner 2cd2f39ea5 XFAIL TestQuoting on Windows.
A couple of edge cases are broken with regards to quote handling.

Fixing this is tracked by http://llvm.org/pr24557

llvm-svn: 245984
2015-08-25 22:25:33 +00:00
Zachary Turner d1c5b6f66b Fix a bunch of portability issues in test executables.
llvm-svn: 245983
2015-08-25 22:25:21 +00:00
Omair Javaid 2441aecd1e Adds support for hardware watchpoints on Arm targets.
http://reviews.llvm.org/D9703

This updated patches correct problems in arm hardware watchpoint support patch posted earlier.

This patch has been tested on samsung chromebook (ARM - Linux) and PandaBoard using basic watchpoint test application.

Also it was tested on Nexus 7 Android device.

On chromebook linux we are able to set and clear all types of watchpoints but on android we end up getting a watchpoint packet error because we are not able to call hardware watchpoint ptrace functions successfully.

llvm-svn: 245961
2015-08-25 18:22:04 +00:00
Tamas Berghammer 35d9d2dc1e Handle DW_OP_GNU_addr_index in DWARF expressions
Differential revision: http://reviews.llvm.org/D12290

llvm-svn: 245932
2015-08-25 11:46:06 +00:00
Tamas Berghammer c178d4c0ce Add support for DW_FORM_GNU_[addr,str]_index
These are 2 new value currently in experimental status used when split
debug info is enabled.

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

llvm-svn: 245931
2015-08-25 11:45:58 +00:00
Tamas Berghammer b7c64651e4 Fix buffer overflow for fixed_form_sizes
The array is indexed by the value in the DW_FORM filed what can be
bigger then the size of the array. This CL add bound checking to avoid
buffer overflows

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

llvm-svn: 245930
2015-08-25 11:45:46 +00:00
Tamas Berghammer bb9729eb4b Fix source manager regression caused by r245905
llvm-svn: 245928
2015-08-25 10:27:38 +00:00
Sagar Thakur 3024117757 Fix build on mips
Setting and getting register values as bytes instead of depending on the 128 bit integer support in register value.
This patch will fix the build failure in the release branch.

Reviewers: tberghammer, clayborg, hans
Subscribers: bhushan, nitesh.jain, jaydeep, lldb-commits
Differential: http://reviews.llvm.org/D12275
llvm-svn: 245927
2015-08-25 09:52:59 +00:00
Greg Clayton 99558cc424 Final bit of type system cleanup that abstracts declaration contexts into lldb_private::CompilerDeclContext and renames ClangType to CompilerType in many accessors and functions.
Create a new "lldb_private::CompilerDeclContext" class that will replace all direct uses of "clang::DeclContext" when used in compiler agnostic code, yet still allow for conversion to clang::DeclContext subclasses by clang specific code. This completes the abstraction of type parsing by removing all "clang::" references from the SymbolFileDWARF. The new "lldb_private::CompilerDeclContext" class abstracts decl contexts found in compiler type systems so they can be used in internal API calls. The TypeSystem is required to support CompilerDeclContexts with new pure virtual functions that start with "DeclContext" in the member function names. Converted all code that used lldb_private::ClangNamespaceDecl over to use the new CompilerDeclContext class and removed the ClangNamespaceDecl.cpp and ClangNamespaceDecl.h files.

Removed direct use of clang APIs from SBType and now use the abstract type systems to correctly explore types.

Bulk renames for things that used to return a ClangASTType which is now CompilerType:

    "Type::GetClangFullType()" to "Type::GetFullCompilerType()"
    "Type::GetClangLayoutType()" to "Type::GetLayoutCompilerType()"
    "Type::GetClangForwardType()" to "Type::GetForwardCompilerType()"
    "Value::GetClangType()" to "Value::GetCompilerType()"
    "Value::SetClangType (const CompilerType &)" to "Value::SetCompilerType (const CompilerType &)"
    "ValueObject::GetClangType ()" to "ValueObject::GetCompilerType()"
    many more renames that are similar.

llvm-svn: 245905
2015-08-24 23:46:31 +00:00
Adrian McCarthy 27785dd530 Reorg code to allow Windows Process Plugins to share some common code.
Differential Revision: http://reviews.llvm.org/D12252

llvm-svn: 245850
2015-08-24 16:00:51 +00:00
Pavel Labath db2f8a3cfd Add the correct decorator to TestCreateDuringInstructionStep
apparently, just placing the file under linux/ does not make the test linux specific. :)

llvm-svn: 245848
2015-08-24 15:49:12 +00:00
Pavel Labath d3aaa18e5d Fix TestCreateDuringInstructionStep on i386
llvm-svn: 245842
2015-08-24 14:24:20 +00:00
Pavel Labath 0f4b17d12c Simplify NativeThreadLinux includes
there is no need to include architecture-specific register contexts when the generic one will
suffice.

llvm-svn: 245839
2015-08-24 13:25:54 +00:00
Pavel Labath 84f43f36f3 Make TestCreateDuringInstructionStep linux-specific
Summary:
There were a number of issues about the way I have designed this test originally:
- it relied on single-stepping through large parts of code, which was slow and unreliable
- the threading libraries interfered with the exact thing we wanted to test

For this reason, I have rewritted the test using low-level linux api, which allows the test to be
much more focused. The functionality for other platforms will need to be tested separately.

Reviewers: tberghammer

Subscribers: tberghammer, danalbert, srhines, lldb-commits

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

llvm-svn: 245838
2015-08-24 13:23:48 +00:00
Tamas Berghammer e5197af450 Fix teardown cleanup in TestRecursiveTypes
llvm-svn: 245836
2015-08-24 10:31:36 +00:00
Tamas Berghammer 42ecef3b15 Add absolute load address support for the DynamicLoader plugins
The POSIX linker generally reports the load bias for the loaded
libraries but in some case it is useful to handle a library based on
absolute load address. Example usecases:
* Windows linker uses absolute addresses
* Library list came from different source (e.g. /proc/<pid>/maps)

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

llvm-svn: 245834
2015-08-24 10:21:55 +00:00
Pavel Labath b9cc0c7593 [NativeProcessLinux] Pass around threads by reference
Summary:
Most NPL private functions took (shared) pointers to threads as arguments. This meant that the
callee could not be sure if the pointer was valid and so most functions were peppered with
null-checks. Now, I move the check closer to the source, and pass around the threads as
references (which are then assumed to be valid).

Reviewers: tberghammer

Subscribers: lldb-commits

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

llvm-svn: 245831
2015-08-24 09:22:04 +00:00
Keno Fischer 6e77677f7b Also initialize ScriptInterpreterNone if Python is disabled
Summary: We get an assertion otherwise because the None Interpreter cannot be found

Reviewers: zturner

Subscribers: zturner, lldb-commits

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

llvm-svn: 245808
2015-08-23 09:05:29 +00:00