Commit Graph

12276 Commits

Author SHA1 Message Date
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
Zachary Turner
21708cf970 Revert "Implement basic DidAttach and DidLaunch for DynamicLoaderWindowsDYLD."
This reverts commit 7749a10ddbe22767d0e055753c674fcde7f28d39.

This commit introduces about 15-20 new test failures with windows local
targets.

llvm-svn: 245765
2015-08-21 23:57:25 +00:00
Zachary Turner
2156787b96 XFAIL pthreads test on Windows.
This test needs to be ported to c++ threads.

llvm-svn: 245751
2015-08-21 22:11:50 +00:00
Zachary Turner
b20bafaec8 Fix TestPaths on Windows.
llvm-svn: 245750
2015-08-21 22:11:40 +00:00
Zachary Turner
7c9e1c0bef XFAIL the last Windows test that calls a function in the target.
llvm-svn: 245749
2015-08-21 22:11:31 +00:00
Zachary Turner
6df0cbc040 Skip TestCreateAfterAttach on Windows.
As with every other platform, this test occasionally hangs on
Windows.

llvm-svn: 245748
2015-08-21 22:11:21 +00:00
Zachary Turner
28ee0cd30e XFAIL Tests that require C++ exceptions on Windows.
clang-cl does not yet support C++ exceptions, so these tests will
not even compile.

Re-enabling these tests is tracked by llvm.org/pr24538

llvm-svn: 245747
2015-08-21 22:11:09 +00:00
Stephane Sezer
705ffc1794 Implement basic DidAttach and DidLaunch for DynamicLoaderWindowsDYLD.
Summary:
This commit implements basic DidAttach and DidLaunch for the windows
DynamicLoader plugin which allow us to load shared libraries from the
inferior.

At the moment, I'm unsure how we're going to gather the load address of
the main module over gdb protocol so I always use an offset of 0, which
works well for processes we create ourselves (no randomization). I will
address this point later on.

Reviewers: clayborg, zturner

Subscribers: lldb-commits

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

llvm-svn: 245725
2015-08-21 19:28:34 +00:00
Stephane Sezer
2618e91240 Implement handling of library: keys in thread stop replies.
Summary:
When a windows remote stops because of a DLL load/unload, the debug server
sends a stop reply packet that contains a `library` key with any value (usually
just `library:1`). This indicates to the debugger that a library has been
loaded or unloaded and that the list of libraries should be refreshed (usually
with `qXfer:libraries:read`).

This change just triggers a call to `LoadModules()` which in turns will send a
remote library read command when a stop reply that requests it is received.

Reviewers: clayborg, zturner, tberghammer

Subscribers: lldb-commits

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

llvm-svn: 245708
2015-08-21 16:51:56 +00:00
Tamas Berghammer
f9787b40f7 Fix BuildAddressRangeTable function when no debug arranges present
llvm-svn: 245696
2015-08-21 12:14:50 +00:00
Tamas Berghammer
9a293accbe Fix type of dw_form_t in dwarf.h
llvm-svn: 245695
2015-08-21 12:14:47 +00:00