Commit Graph

12929 Commits

Author SHA1 Message Date
Ewan Crawford 2d62328add [RenderScript] Fix out of bounds warning.
llvm-svn: 250891
2015-10-21 10:27:10 +00:00
Pavel Labath 65a16e56b9 [DataFormatters] Make libc++ list loop detection linear
Summary:
Loop detection code is being called before every element access. Although it tries to cache some
of the data by remembering the loop-free initial segment, every time it needs to increase this
segment, it will start from scratch. For the typical usage pattern, where one accesses the
elements in order, the loop detection will need to be run after every access, resulting in
quadratic behavior. This behavior is noticable even for the default 255 element limit.

In this commit, I rewrite the algorithm to be truly incremental -- it maintains the state of its
loop-detection runners between calls, and reuses them when it needs to check another segment.
This way, each part of the list is scanned only once, resulting in linear behavior.

Also note that I have changed the operator== of ListEntry to do the comparison based on the
value() function (instead of relying on ValueObjectSP equality). In my experiments, I kept
getting different ValueObjectSPs when going through the same element twice.

Reviewers: granata.enrico

Subscribers: lldb-commits, sivachandra

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

llvm-svn: 250890
2015-10-21 10:17:21 +00:00
Ewan Crawford 55232f0948 [RenderScript] New commands to save/load RS allocations to file.
Patch adds command 'language renderscript allocation save' to store the contents of an allocation in a binary file.
And 'language renderscript allocation load' to restore an allocation with the saved data from a binary file.

Binary file format contains a header FileHeader with meta information preceding the raw data.


Reviewed by: jingham, clayborg
Subscribers: lldb-commits, domipheus
Differential Revision: http://reviews.llvm.org/D13903

llvm-svn: 250886
2015-10-21 08:50:42 +00:00
Eugene Zelenko 8dd3fdbf43 Revert r250872 in source/Plugins/Disassembler to fix MSVC builds failures.
llvm-svn: 250874
2015-10-21 01:42:15 +00:00
Eugene Zelenko 4c3f2b9446 Fix Clang-tidy modernize-use-override warnings in some files in source/Plugins; other minor fixes.
Differential Revision: http://reviews.llvm.org/D13916

llvm-svn: 250872
2015-10-21 01:03:30 +00:00
Sean Callanan 9a6940cef4 When a REPL creates a new target for itself, it is that target's REPL.
To allow that, I've added a SetREPL call to the Target, which allows a REPL
that just created a target to install itself as the go-to REPL for the
corresponding language.

llvm-svn: 250870
2015-10-21 00:36:34 +00:00
Sean Callanan 3b682de6b1 When target is NULL, provide a debugger so that REPLs can use that to create
their own target.

llvm-svn: 250869
2015-10-21 00:28:44 +00:00
Zachary Turner 43a01e45f9 Use six to portably assign metaclasses in Python 2 and 3.
llvm-svn: 250859
2015-10-20 21:06:05 +00:00
Zachary Turner 8741e31876 Introduce a mechanism for reusing Python modules out of tree.
Right now our Python code does not all share a common root.  Tests and
scripts both contain python code that cannot take advantage of reusability
since they are unrelated siblings of each other.

In particular, this presents a problem for wanting to use third party
packages from both sides, since it does not make sense to copy the module
into both places.

This patch solves this by introducing a script lldb_shared.py which is a
very lightweight script that just searches up the tree until it finds a
root, and then imports a module from there.  That module knows how to
find all of the shared code that LLDB uses, and adjusts sys.path
accordingly to make them all visible.

llvm-svn: 250858
2015-10-20 21:05:57 +00:00
Zachary Turner 4718944d50 Add `six` Python module to lldb/third_party.
Six is a python module designed to smooth the process of porting
Python 2 code to Python 3.  Specifically, six provides a consistent
interface to some of the breaking changes between 2 and 3.  For example,
the syntax for assigning a metaclass differs in Python 2 and 3.  Six
addresses this by providing a single class decorator that will do the
right thing depending on which version of Python is being run.

There are other examples too, such as dealing with renamed modules,
unicode literals, etc.

llvm-svn: 250857
2015-10-20 21:05:49 +00:00
Zachary Turner 32064024b9 Fix potential file i/o problem with python handles.
llvm-svn: 250838
2015-10-20 17:38:49 +00:00
Tamas Berghammer cdaab620d2 Fix MSVC build after 250820
Work around a bug in MSVC 12 where _HAS_EXCEPTIONS=0 don't eliminate
all usage of __uncaught_exception with including eh.h what declares
that function.

llvm-svn: 250833
2015-10-20 16:16:35 +00:00
Tamas Berghammer da4e8ed69a Revert "Make dwarf parsing multi-threaded"
Revert it bacuse it introduces several race condition detected by
the build bots.

This reverts commit 5107a5ebdb7c4571a30a7098b40bf8098b678447.

llvm-svn: 250832
2015-10-20 15:43:40 +00:00
Tamas Berghammer f84916d40f Make dwarf parsing multi-threaded
Loading the debug info from a large application is the slowest task
LLDB do. This CL makes most of the dwarf parsing code multi-threaded.

As a result the speed of "attach; backtrace; exit;" when the inferior
is an LLDB with full debug info increased by a factor of 2 (on my machine).

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

llvm-svn: 250821
2015-10-20 12:42:10 +00:00
Tamas Berghammer ccb367609b Add a new task pool class to LLDB
The purpose of the class is to make it easy to execute tasks in parallel

Basic design goals:
* Have a very lightweight and easy to use interface where a list of
  lambdas can be executed in parallel
* Use a global thread pool to limit the number of threads used
  (std::async don't do it on Linux) and to eliminate the thread creation
  overhead
* Destroy the thread currently not in use to avoid the confusion caused
  by them during debugging LLDB

Possible future improvements:
* Possibility to cancel already added, but not yet started tasks
* Parallel for_each implementation
* Optimizations in the thread creation destroyation code

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

llvm-svn: 250820
2015-10-20 12:42:05 +00:00
Pavel Labath f29914883d Increase default memory cache line size for android
Summary:
ADB packets have a maximum size of 4k. This means the size of memory reads does not affect speed
too much (as long as it fits in one packet). Therefore, I am increasing the default memory read
size for android to 2k. This value is used only if the user has not modified the default
memory-cache-line-size setting.

Reviewers: clayborg, tberghammer

Subscribers: tberghammer, danalbert, srhines, lldb-commits

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

llvm-svn: 250814
2015-10-20 10:33:17 +00:00
Tamas Berghammer 8f81e88184 Fix build and some warnings after r250798
llvm-svn: 250810
2015-10-20 09:21:04 +00:00
Mohit K. Bhakkad 79be9e8cb5 [LLDB] Insert names with same signo as alias instead of a new entry
Reviewers: clayborg, labath.
Subscribers: jaydeep, dsanders, bhushan, sagar, nitesh.jain, emaste,lldb-commits.
Differential Revision: http://reviews.llvm.org/D13646

llvm-svn: 250801
2015-10-20 07:05:46 +00:00
Enrico Granata d717cc9f71 Rationalization of includes in the data formatters code
llvm-svn: 250798
2015-10-20 04:50:09 +00:00
Eugene Zelenko 8d15f33b45 Fix Clang-tidy modernize-use-override warnings in source/Plugins/Language; other minor fixes.
Differential Revision: http://reviews.llvm.org/D13876

llvm-svn: 250789
2015-10-20 01:10:59 +00:00
Siva Chandra b1f4a50912 Adjust TestCompletion.py and TestDumpDynamic.py after recent changes.
Reviewers: zturner, spyffe

Subscribers: lldb-commits

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

llvm-svn: 250782
2015-10-20 01:03:18 +00:00
Sean Callanan f2bd5c3e22 Added support to the expression command for dropping into the REPL at will.
"expr -r" does this.  It also returns to a REPL if the LLDB command interpreter
is neseted inside it, for example in cases where a REPL command resulted in a
breakpoint being hit or a crash.

llvm-svn: 250780
2015-10-20 00:55:21 +00:00
Sean Callanan 3e7e915dca Added support for the "--repl" argument to LLDB.
This makes LLDB launch and create a REPL, specifying no target so that the REPL
can create one for itself.  Also added the "--repl-language" option, which
specifies the language to use.  Plumbed the relevant arguments and errors
through the REPL creation mechanism.

llvm-svn: 250773
2015-10-20 00:23:46 +00:00
Greg Clayton 7449ab9834 Fixed PlatformDarwin to locate Xcode by using HostInfo::GetProgramFileSpec(). This function returns the FileSpec to the program that is running the LLDB.framework or lldb.so and is more reliable than checking the path of LLDB.framework/lldb.so itself since it might not exist within the Xcode.app bundle (DYLD_FRAMEWORK_PATH). Then we check DEVELOPER_DIR, then check the currently installed Xcode with xcrun.
<rdar://problem/23167253>

llvm-svn: 250772
2015-10-20 00:22:50 +00:00
Greg Clayton 5b94e11873 When calling FileSpec::AppendPathComponent() we don't need to include "." in the path if m_filename is set to exactly '.'. Previously this would cause a FileSpec object that looked like:
m_directory = "/tmp"
m_filename = "."
                                         
To look like:

m_directory = "/tmp/."
m_filename = "foo.txt"

if "foo.txt" was appended to it. With this fix it will be:

m_directory = "/tmp"
m_filename = "foo.txt"

llvm-svn: 250770
2015-10-20 00:17:39 +00:00
Greg Clayton e75e5d8afa Make sure we restore the process events so they aren't hijacked when using the async attach when attaching to a process by name and with waitfor.
<rdar://problem/22821480>

llvm-svn: 250768
2015-10-20 00:14:20 +00:00
Enrico Granata b3f0c3400f Introduce the concept of a type that is meaningless without dynamic resolution, which are essentially placeholder types meant to appease a language's type system but do not offer any actual information to the debugger, unless further resolved
This is currently meant for data formatters to know to ignore such types in caching and lookup

llvm-svn: 250767
2015-10-20 00:13:19 +00:00
Zachary Turner ff890daf12 Convert print statements to print function calls.
This patch was generating by running `2to3` on the files in the
lldb/test directory.  This patch should be NFC, but it does
introduce the `from __future__ import print_function` line, which
will break future uses of the print statement.

llvm-svn: 250763
2015-10-19 23:45:41 +00:00
Zachary Turner 1756e05688 Run py2to3 on lldb/scripts folder.
This mostly fixes some print statements, but there were also some
instances of dict.iteritems() lingering that this found.

llvm-svn: 250762
2015-10-19 23:45:25 +00:00
Sean Callanan ffd77e01a5 Added REPL.cpp to the relevant CMakeLists.txt
llvm-svn: 250755
2015-10-19 23:18:49 +00:00
Sean Callanan 6681041d70 Added the concept of a Read-Eval-Print-Loop to LLDB.
A REPL takes over the command line and typically treats input as source code.
REPLs can also do code completion.  The REPL class allows its subclasses to
implement the language-specific functionality without having to know about the
IOHandler-specific internals.

Also added a PluginManager-based way of getting to a REPL given a language and
a target.

Also brought in some utility code and expression options that are useful for
REPLs, such as line offsets for expressions, ANSI terminal coloring of errors,
and a few IOHandler convenience functions.

llvm-svn: 250753
2015-10-19 23:11:07 +00:00
Keno Fischer f23c0c405e Revert r248047 and fix the problem properly
In r248047, I attempted to fix a build breakage introduced by using
llvm's regex support from lldb-mi. However, my approach was flawed
when LLVM and lldb are dynamically linked, in which case two copies
of LLVMSupport would end up in memory, causing crashes on lldb start up.
Instead, use LINK_COMPONENTS to make sure lldb-mi has access to the
LLVMSupport symbols without causing duplication in the dynamic library
case.

llvm-svn: 250751
2015-10-19 22:59:16 +00:00
Enrico Granata a512103bdf Add a flakey category for flakey tests
llvm-svn: 250750
2015-10-19 22:53:34 +00:00
Enrico Granata c8e7649a19 Let Language plugins vend a default DeclPrintingHelper in case a custom one is not specified for the specific invocation
llvm-svn: 250744
2015-10-19 22:04:25 +00:00
Siva Chandra fdbefca88c [PlatformDarwin.cpp] Include <mutex> for std::once_flag.
Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 250740
2015-10-19 21:43:07 +00:00
Greg Clayton 6988abc14d Allow LLDB.framework to locate debugserver even when it doesn't exist in the LLDB.framework.
This allows open source MacOSX clients to not have to build debugserver and the current LLDB can find debugserver inside the selected Xcode.app on your system.

<rdar://problem/23167253>

llvm-svn: 250735
2015-10-19 20:44:01 +00:00
Enrico Granata 238de51eed Teach the lldbinline test cases to run in DWO mode
llvm-svn: 250734
2015-10-19 20:40:50 +00:00
Eugene Zelenko 0af149a813 Fix Clang-tidy modernize-use-override warnings in some files in source/Plugins; other minor fixes.
Differential Revision: http://reviews.llvm.org/D13840

llvm-svn: 250721
2015-10-19 18:52:10 +00:00
Zachary Turner 2adc80107a Py3'ify some of the examples that get run at startup.
Even though these are under examples/, they actually get loaded
when LLDB starts up during initialization of ScriptInterpreterPython.
There's obviously some kind of layering issue here (and comments
in the code even point to that as well), but for now just make them
py3 compatible.

llvm-svn: 250710
2015-10-19 17:35:02 +00:00
Zachary Turner e24ad03ae6 Disable libxml2 on Windows for now.
Newer versions of CMake include a "smarter" FindLibxml2 package.
In theory this is a good thing, but on Windows it's now smart
enough to find the version that comes with Gnuwin32, which doesn't
appear to be a valid libxml2 distribution.  Or at the very least,
LLDB currently uses some header files from libxml2 that are not
part of this distribution.

Nobody on Windows is using any of this functionality right now
anyway, so just disable it.

llvm-svn: 250709
2015-10-19 17:34:51 +00:00
Omair Javaid 5cf948d299 Fix for random watchpoint testsuite failures on AArch64 targets.
This patch corrects the number of bytes of debug register resources which are written while installing or removing a breakpoint using ptrace interface on arm64 targets.

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

llvm-svn: 250700
2015-10-19 14:54:33 +00:00
Sagar Thakur b997792cc6 [LLDB][MIPS] Use the correct ptrace buffer for writing register value for o32 applications
For o32 applications on mips we were getting segmentation fault while launching lldb-server because of overwritting stack when using elf_gregset_t in DoWriteRegisterValue.
We are now using the GPR_mips_linux buffer in DoWriteRegisterValue as done in DoReadRegisterValue also, which solves the above issue.

llvm-svn: 250696
2015-10-19 11:21:20 +00:00
Saleem Abdulrasool a8bf774b96 Python: follow python guidelines for header usage
Python requires that Python.h is included before any std header.  Not doing so
results in conflicts with standards macros such as `_XOPEN_SOURCE`.  NFC.

llvm-svn: 250673
2015-10-19 01:16:17 +00:00
Saleem Abdulrasool 43d3a7ae01 Silence -Wreturn-type with gcc 5.2
The switch is fully covered, mark "default" as unreachable.  NFC.

llvm-svn: 250667
2015-10-18 20:51:18 +00:00
Saleem Abdulrasool ba507b04e1 Silence -Wqual-cast warnings from GCC 5.2
There were a number of const qualifiers being cast away which caused warnings.
This cluttered the output hiding real errors.  Silence them by explicit casting.
NFC.

llvm-svn: 250662
2015-10-18 19:34:38 +00:00
Saleem Abdulrasool 8b8d2a4d99 Silence some -Wunused-but-set-variable with gcc 5.2.0
Cleanup some unused variables.  NFC.

llvm-svn: 250661
2015-10-18 19:34:31 +00:00
Enrico Granata e0ee1e1cd6 Teach an old pony a few new tricks.
ValueObjectPrinter can now mask out pointer values during a printout; also, it supports helper functions to print declarations in different formats if needed

Practically speaking however, this change is NFC as nothing yet uses it in the codebase

llvm-svn: 250599
2015-10-17 01:05:50 +00:00
Eugene Zelenko fb2eec7e11 [LLDB] Fix Clang-tidy modernize-use-override warnings in some headers in source/Plugins/Process/Utility; other minor fixes.
Differential Revision: http://reviews.llvm.org/D13830

llvm-svn: 250593
2015-10-17 00:19:57 +00:00
Enrico Granata 15560778df Handle eFormatVectorOfFloat16
llvm-svn: 250581
2015-10-16 23:42:04 +00:00
Greg Clayton 3fd1f746c3 Split getting the key from a window from the code that handles the key.
llvm-svn: 250580
2015-10-16 23:34:40 +00:00