Commit Graph

12313 Commits

Author SHA1 Message Date
Jim Ingham aa816b8f3b Move more functionality from the LanguageRuntimes to the Languages.
llvm-svn: 246616
2015-09-02 01:59:14 +00:00
Enrico Granata 28b3831e39 Add a Language::ForAllLanguages helper function
llvm-svn: 246614
2015-09-02 01:31:10 +00:00
Enrico Granata 578c8a7841 Use Language::LanguageIsCPlusPlus instead of doing the same switch over language
llvm-svn: 246613
2015-09-02 01:28:24 +00:00
Enrico Granata df7e79e646 Move the functions that FormatManager uses to actually load formatters into their own file
These are useful helpers over the low-level API of the FormattersContainer, and since we're actually going to start moving formatters into plugins, it makes sense to simplify things

llvm-svn: 246612
2015-09-02 01:21:31 +00:00
Jim Ingham 0e0984eebb Move things from the LanguageRuntime that obviously belong in the new Language plugin instead.
llvm-svn: 246611
2015-09-02 01:06:46 +00:00
Bruce Mitchener e8433cc179 Simplify find_first_of & find_last_of on single char.
Summary:
When calling find_first_of and find_last_of on a single character,
we can instead just call find / rfind and make our intent more
clear.

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 246609
2015-09-01 23:57:17 +00:00
Bruce Mitchener 11deaae8a1 Remove ABIMacOSX_i386::PrepareNormalCall().
Summary:
This was removed from the other ABI plugins long ago. This removes
a warning that was happening in this unused code as a result of
adding 2 new types to Scalar.h (e_uint128 and e_sint128).

Reviewers: clayborg

Subscribers: llvm-commits

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

llvm-svn: 246608
2015-09-01 23:51:30 +00:00
Bruce Mitchener dcad05b4eb [debugserver] Fix sign comparison warning.
Summary:
Comparing m_page_size against kInvalidPageSize was resulting in
a warning about comparing integers with different signs. Since
kInvalidPageSize isn't used anywhere outside of MachVMMemory.cpp,
we can readily transform it into a static const vm_size_t with
the correct value to avoid the sign comparison warnings.

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 246606
2015-09-01 23:45:14 +00:00
Bruce Mitchener 4aed72571a Use -Wno-vla-extension globally.
Summary:
This was previously only established within debugserver, but
there is a use of the VLA extension in source/Host/macosx/Symbols.cpp,
so ignore this warning globally.

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 246605
2015-09-01 23:43:51 +00:00
Jim Ingham 5a3bb64fca Fix ProcessKDP.cpp for the change in r246578.
llvm-svn: 246601
2015-09-01 22:56:59 +00:00
Enrico Granata b6f8ca152a std::initializer_list is not safe to return from a function, as copies are not guaranteed to extend the lifetime of the underlying storage
llvm-svn: 246597
2015-09-01 22:24:35 +00:00
Enrico Granata 45a98fffa5 Add logging to a couple of regions of code
llvm-svn: 246580
2015-09-01 20:11:13 +00:00
Zachary Turner 1d397bfe40 Make ProcessWindows not create a strong reference to itself.
llvm-svn: 246579
2015-09-01 20:02:44 +00:00
Zachary Turner 7529df9abd Have the Process hold a weak_ptr to the Target.
llvm-svn: 246578
2015-09-01 20:02:29 +00:00
Oleksiy Vyalov e7eabbb550 Make remote-android platform to use dynamic local tcp ports when forwarding device ports.
http://reviews.llvm.org/D12510

llvm-svn: 246574
2015-09-01 19:02:14 +00:00
Zachary Turner 81ab77d424 Un-XFAIL a couple tests that are now passing.
llvm-svn: 246570
2015-09-01 18:25:05 +00:00
Zachary Turner bc556d382b XFAIL TestHelloWorld on Windows.
https://llvm.org/pr24600

llvm-svn: 246569
2015-09-01 18:24:49 +00:00
Enrico Granata 980c0484c5 Add support for language plugins to provide data formatters (second attempt)
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: 246568
2015-09-01 18:22:39 +00:00
Sean Callanan 761844be66 When looking up types, find the first type we can import rather than just taking
the first type we find and failing if it can't be imported.

llvm-svn: 246563
2015-09-01 18:00:35 +00:00
Sean Callanan 77bc4d12c7 Add a predicate to allow a ClangASTContext to identify Clang types.
llvm-svn: 246562
2015-09-01 17:58:03 +00:00
Adrian McCarthy 6c3d03c468 Implement DoReadMemory for Windows mini dumps.
Differential Revision: http://reviews.llvm.org/D12507

llvm-svn: 246558
2015-09-01 16:59:31 +00:00
Chaoren Lin c963a222f1 Make ProcessGDBRemote get a //copy// of platform Unix signals.
Summary: Update to http://reviews.llvm.org/rL243618.

Reviewers: jaydeep, clayborg

Subscribers: labath, tberghammer, lldb-commits

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

llvm-svn: 246557
2015-09-01 16:58:45 +00:00
Pavel Labath 7a9495bcd5 [NativeProcessLinux] Fix detach of multithreaded inferiors
When detaching, we need to detach from all threads of the inferior and not just the main one.
Without this, a multi-threaded inferior would usually crash once the server exits.

llvm-svn: 246549
2015-09-01 15:00:51 +00:00
Pavel Labath 86852d3676 [NativeProcessLinux] Fix assertion failure when killing a process
Linux sometimes sends us a PTRACE_EVENT_EXIT when an inferior process gets a SIGKILL. This can be
confusing, since normally we don't expect any events when the inferior is stopped. This commit
adds code to handle this situation (resume the thread and let it exit normally) and avoid an
assertion failure in ResumeThread().

llvm-svn: 246539
2015-09-01 10:59:36 +00:00
Pavel Labath f15a16704b Revert "Add support for language plugins to provide data formatters"
This reverts r246515 (and related cmake fixes) as it breaks all libcxx tests.

llvm-svn: 246536
2015-09-01 09:02:54 +00:00
Jason Molenda bf67a30bdd A few small comment fixups with terminology "gcc" -> "eh_frame", "gdb" -> "stabs".
Just noticed these while reading through some code.

llvm-svn: 246530
2015-09-01 05:17:01 +00:00
Bruce Mitchener ee188ba20e [lldb-mi] Use find, not find_first_of, for "--".
Summary:
find_first_of will look for any of the characters, not the full
string passed in. When looking for "--" then, we must use find
and not find_first_of.

Reviewers: ki.stfu, abidh

Subscribers: lldb-commits

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

llvm-svn: 246529
2015-09-01 04:36:54 +00:00
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