summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins
Commit message (Collapse)AuthorAgeFilesLines
* [RenderScript] Fix out of bounds warning.Ewan Crawford2015-10-211-3/+3
| | | | llvm-svn: 250891
* [DataFormatters] Make libc++ list loop detection linearPavel Labath2015-10-211-88/+113
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* [RenderScript] New commands to save/load RS allocations to file.Ewan Crawford2015-10-212-40/+410
| | | | | | | | | | | | | | 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
* Revert r250872 in source/Plugins/Disassembler to fix MSVC builds failures.Eugene Zelenko2015-10-212-45/+53
| | | | llvm-svn: 250874
* Fix Clang-tidy modernize-use-override warnings in some files in ↵Eugene Zelenko2015-10-2116-348/+342
| | | | | | | | source/Plugins; other minor fixes. Differential Revision: http://reviews.llvm.org/D13916 llvm-svn: 250872
* Fix potential file i/o problem with python handles.Zachary Turner2015-10-204-37/+50
| | | | llvm-svn: 250838
* Revert "Make dwarf parsing multi-threaded"Tamas Berghammer2015-10-203-71/+23
| | | | | | | | | Revert it bacuse it introduces several race condition detected by the build bots. This reverts commit 5107a5ebdb7c4571a30a7098b40bf8098b678447. llvm-svn: 250832
* Make dwarf parsing multi-threadedTamas Berghammer2015-10-203-23/+71
| | | | | | | | | | | | 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
* Increase default memory cache line size for androidPavel Labath2015-10-202-0/+10
| | | | | | | | | | | | | | | | 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
* [LLDB] Insert names with same signo as alias instead of a new entryMohit K. Bhakkad2015-10-204-209/+199
| | | | | | | | Reviewers: clayborg, labath. Subscribers: jaydeep, dsanders, bhushan, sagar, nitesh.jain, emaste,lldb-commits. Differential Revision: http://reviews.llvm.org/D13646 llvm-svn: 250801
* Rationalization of includes in the data formatters codeEnrico Granata2015-10-202-1/+4
| | | | llvm-svn: 250798
* Fix Clang-tidy modernize-use-override warnings in source/Plugins/Language; ↵Eugene Zelenko2015-10-2014-468/+480
| | | | | | | | other minor fixes. Differential Revision: http://reviews.llvm.org/D13876 llvm-svn: 250789
* Fixed PlatformDarwin to locate Xcode by using ↵Greg Clayton2015-10-201-48/+55
| | | | | | | | 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
* [PlatformDarwin.cpp] Include <mutex> for std::once_flag.Siva Chandra2015-10-191-0/+2
| | | | | | | | | | Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13877 llvm-svn: 250740
* Allow LLDB.framework to locate debugserver even when it doesn't exist in the ↵Greg Clayton2015-10-196-42/+116
| | | | | | | | | | 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
* Fix Clang-tidy modernize-use-override warnings in some files in ↵Eugene Zelenko2015-10-1917-295/+314
| | | | | | | | source/Plugins; other minor fixes. Differential Revision: http://reviews.llvm.org/D13840 llvm-svn: 250721
* Fix for random watchpoint testsuite failures on AArch64 targets.Omair Javaid2015-10-191-1/+4
| | | | | | | | 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
* [LLDB][MIPS] Use the correct ptrace buffer for writing register value for ↵Sagar Thakur2015-10-191-8/+9
| | | | | | | | | 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
* Silence -Wqual-cast warnings from GCC 5.2Saleem Abdulrasool2015-10-183-5/+9
| | | | | | | | 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
* Silence some -Wunused-but-set-variable with gcc 5.2.0Saleem Abdulrasool2015-10-183-20/+4
| | | | | | Cleanup some unused variables. NFC. llvm-svn: 250661
* [LLDB] Fix Clang-tidy modernize-use-override warnings in some headers in ↵Eugene Zelenko2015-10-1717-367/+375
| | | | | | | | source/Plugins/Process/Utility; other minor fixes. Differential Revision: http://reviews.llvm.org/D13830 llvm-svn: 250593
* [LLDB] Fix Clang-tidy modernize-use-override warnings in source/Plugins/ABI; ↵Eugene Zelenko2015-10-1612-420/+435
| | | | | | | | other minor fixes. Differential Revision: http://reviews.llvm.org/D13684 llvm-svn: 250538
* Fix linkage of `init_lldb` SWIG method in Python 3.Zachary Turner2015-10-161-1/+5
| | | | llvm-svn: 250531
* Convert SWIG typemap string operations to PythonObjects.Zachary Turner2015-10-162-5/+44
| | | | llvm-svn: 250530
* Update SWIG typemaps to use `PythonFile`.Zachary Turner2015-10-162-1/+26
| | | | | | | | Using the Python native C API is non-portable across Python versions, so this patch changes them to use the `PythonFile` class which hides the version specific differences behind a single interface. llvm-svn: 250525
* Resubmit: RenderScript command for printing allocation contents Ewan Crawford2015-10-162-0/+463
| | | | | | | | | Previous commit r250281 broke TestDataFormatterSmartArray.py Resolved in in this patch by adding the new enum eFormatVectorOfFloat16 to FormatManager. Differential Revision: http://reviews.llvm.org/D13730 llvm-svn: 250499
* Split Socket class into Tcp/Udp/DomainSocket subclasses.Oleksiy Vyalov2015-10-152-12/+12
| | | | | | http://reviews.llvm.org/D13754 llvm-svn: 250474
* Introduce a `PythonFile` object, and use it everywhere.Zachary Turner2015-10-154-34/+133
| | | | | | | | | | | | | | | | | | | | | | | Python file handling got an overhaul in Python 3, and it affects the way we have to interact with files. Notably: 1) `PyFile_FromFile` no longer exists, and instead we have to use `PyFile_FromFd`. This means having a way to get an fd from a FILE*. For this we reuse the lldb_private::File class to convert between FILE*s and fds, since there are some subtleties regarding ownership rules when FILE*s and fds refer to the same file. 2) PyFile is no longer a builtin type, so there is no such thing as `PyFile_Check`. Instead, files in Python 3 are just instances of `io.IOBase`. So the logic for checking if something is a file in Python 3 is to check if it is a subclass of that module. Additionally, some unit tests are added to verify that `PythonFile` works as expected on Python 2 and Python 3, and `ScriptInterpreterPython` is updated to use `PythonFile` instead of manual calls to the various `PyFile_XXX` methods. llvm-svn: 250444
* Fix broken assert in DWARFDIE.cpp on OS XTodd Fiala2015-10-151-1/+1
| | | | | | | See: http://reviews.llvm.org/D13777 llvm-svn: 250426
* In r240466, when Greg added the jThreadsInfo packet, he accidentallyJason Molenda2015-10-151-1/+0
| | | | | | | | | | | | | | disabled the use of the jThreadGetExtendedInfo packet which is used to retrieve additional information about a thread, such as the QoS setting for that thread on darwin systems. Re-enable the use of the jThreadGetExtendedInfo packet, and add some quick tests to the TestQueues mac test case which will verify that we can retrieve the QoS names for these test threads. <rdar://problem/22925096> llvm-svn: 250364
* Add a data formatter for __NSArray0, the type of empty arraysEnrico Granata2015-10-142-0/+74
| | | | llvm-svn: 250341
* Make uses of /dev/null portable across OSes.Zachary Turner2015-10-142-5/+7
| | | | | | | | | Most platforms have "/dev/null". Windows has "nul". Instead of hardcoding the string /dev/null at various places, make a constant that contains the correct value depending on the platform, and use that everywhere instead. llvm-svn: 250331
* Get Python unit tests working with Python 3.Zachary Turner2015-10-141-39/+28
| | | | | | | | | | | | | | | | | | | | | There were a couple of issues related to string handling that needed to be fixed. In particular, we cannot get away with converting `PyUnicode` objects to `PyBytes` objects and storing the `PyBytes` regardless of Python version. Instead we have to store a `PyUnicode` on Python 3 and a `PyString` on Python 2. The reason for this is that if you call `PyObject_Str` on a `PyBytes` in Python 3, it will return you a string that actually contains the string value wrappedin the characters b''. So if we create a `PythonString` with the value "test", and we call Str() on it, we will get back the string "b'test'", which breaks string equality. The only way to fix this is to store a native `PyUnicode` object under Python 3. With this CL, ScriptInterpreterPythonTests unit tests pass 100% under Python 2 and Python 3. llvm-svn: 250327
* Avoid a -Wreorder warning in ScriptInterpreterPython.cpp.Stephane Sezer2015-10-141-2/+2
| | | | llvm-svn: 250322
* Fix Python initialization for Python 3.Zachary Turner2015-10-141-46/+91
| | | | | | | | | | | | | Python 3 reverses the order in which you must call Py_InitializeEx and PyEval_InitThreads. Since that log is in itself already a little nuanced, it is refactored into a function so that the reversal is more clear. At the same time, there's a lot of logic during Python initialization to save off a bunch of state and then restore it after initialization is complete. To express this more cleanly, it is refactored to an RAII-style pattern where state is saved off on acquisition and restored on release. llvm-svn: 250306
* Minor cleanup on PythonDataObject constructors.Zachary Turner2015-10-142-5/+13
| | | | | | | | Added a constructor that takes list_size for `PythonList`. Made all single-argument constructors explicit. Re-ordered constructors to be consistent with other classes. llvm-svn: 250304
* Change swig interface files to use PythonDataObjects.Zachary Turner2015-10-142-4/+13
| | | | llvm-svn: 250303
* lldb-server: add support for binary memory readsPavel Labath2015-10-143-14/+19
| | | | | | | | | | | | | | | | | Summary: This commit adds support for binary memory reads ($x) to lldb-server. It also removes the "0x" prefix from the $x client packet, to make it more compatible with the old $m packet. This allows us to use almost the same code for handling both packet types. I have verified that debugserver correctly handles $x packets even without the leading "0x". I have added a test which verifies that the stub returns the same memory contents for both kinds of memory reads ($x and $m). Reviewers: tberghammer, jasonmolenda Subscribers: iancottrell, lldb-commits Differential Revision: http://reviews.llvm.org/D13695 llvm-svn: 250295
* Revert "RenderScript command for printing allocation contents"Pavel Labath2015-10-142-463/+0
| | | | | | This commit breaks TestDataFormatterSmartArray on all buildbots. llvm-svn: 250290
* Make use of lldv::Triple::isAndroidTamas Berghammer2015-10-143-13/+7
| | | | | | | | It is a new function added to the llvm::Triple class to simplify the checking if we are targeting android to clean up the confusion between android being an OS or an environment. llvm-svn: 250286
* Fix compiler warnings in ScriptInterpreterPythonPavel Labath2015-10-141-1/+1
| | | | llvm-svn: 250282
* RenderScript command for printing allocation contentsEwan Crawford2015-10-142-0/+463
| | | | | | | | | | | | | | | | | | | This patch adds the command 'language renderscript allocation dump <ID>' for printing the contents of a RS allocation. Displaying the coordinate of each element as well as its formatted value e.g (lldb) language renderscript allocation dump 1 Data (X, Y, Z): (0, 0, 0) = {0 1} (1, 0, 0) = {2 3} (2, 0, 0) = {4 5} A --file <filename> option is also included, since for large allocations it may be more helpful to view this text as a file. Reviewed by: jingham, clayborg Subscribers: lldb-commits, ADodds, domipheus, brucem Differential Revision: http://reviews.llvm.org/D13699 llvm-svn: 250281
* [LLDB] Adding mips32 in the list of archs with ↵Mohit K. Bhakkad2015-10-141-1/+3
| | | | | | watchpoint_exceptions_received=before llvm-svn: 250272
* [LLDB][MIPS64] Adding mips64 reaturn address register for unwind planMohit K. Bhakkad2015-10-141-0/+1
| | | | llvm-svn: 250267
* ArchSpec: fix unintentional promotion of unspecified unknowns to specified ↵Todd Fiala2015-10-131-0/+6
| | | | | | | | | | | | | | | | | | | | | unknowns * ArchSpec::MergeFrom() would erroneously promote an unspecified unknown to a specified unknown when both the ArchSpec and the merged in ArchSpec were both unspecified unknowns. This no longer happens, which fixes issues with global module cache lookup in some situations. * Added ArchSpec::DumpTriple(Stream&) that now properly prints unspecified unknowns as '*' and specified unknows as 'unknown'. This makes it trivial to tell the difference between the two. Converted printing code over ot using DumpTriple() rather than building from scratch. * Fixed up a couple places that were not guaranteeing that an unspecified unknown was recorded as such. llvm-svn: 250253
* Remove definition of ~PlatformNetBSD(), since its declaration is marked as ↵Bruce Mitchener2015-10-131-13/+0
| | | | | | | | | | | | | | | | '= default' Summary: Local definition of ~PlatformNetBSD() results with a compiler error. Patch by Kamil Rytarowski. Thanks! Reviewers: joerg, brucem Subscribers: brucem, lldb-commits Differential Revision: http://reviews.llvm.org/D13707 llvm-svn: 250249
* Change PyFile_FromFile to use PyFile_FromFd when using Py3.Zachary Turner2015-10-131-5/+17
| | | | llvm-svn: 250213
* Fix ref counting of Python objects.Zachary Turner2015-10-134-770/+659
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PythonObjects were being incorrectly ref-counted. This problem was pervasive throughout the codebase, leading to an unknown number of memory leaks and potentially use-after-free. The issue stems from the fact that Python native methods can either return "borrowed" references or "owned" references. For the former category, you *must* incref it prior to decrefing it. And for the latter category, you should not incref it before decrefing it. This is mostly an issue when a Python C API method returns a `PyObject` to you, but it can also happen with a method accepts a `PyObject`. Notably, this happens in `PyList_SetItem`, which is documented to "steal" the reference that you give it. So if you pass something to `PyList_SetItem`, you cannot hold onto it unless you incref it first. But since this is one of only two exceptions in the entire API, it's confusing and difficult to remember. Our `PythonObject` class was indiscriminantely increfing every object it received, which means that if you passed it an owned reference, you now have a dangling reference since owned references should not be increfed. We were doing this in quite a few places. There was also a fair amount of manual increfing and decrefing prevalent throughout the codebase, which is easy to get wrong. This patch solves the problem by making any construction of a `PythonObject` from a `PyObject` take a flag which indicates whether it is an owned reference or a borrowed reference. There is no way to construct a `PythonObject` without this flag, and it does not offer a default value, forcing the user to make an explicit decision every time. All manual uses of `PyObject` have been cleaned up throughout the codebase and replaced with `PythonObject` in order to make RAII the predominant pattern when dealing with native Python objects. Differential Revision: http://reviews.llvm.org/D13617 Reviewed By: Greg Clayton llvm-svn: 250195
* Fix cast in arm watchpoint handling codeTamas Berghammer2015-10-131-1/+1
| | | | | | | We had an incorrect sign extension when castion from a pointer to an lldb::addr_t what broke the watchpoint hit detection on arm. llvm-svn: 250180
* Preliminary NetBSD supportBruce Mitchener2015-10-132-0/+878
| | | | | | | | | | | | | | | | | | | Summary: This adds platform code without the cmake/gmake glue to the existing infrastructure. The missing and incompatibility ptrace(2) bits (existing in FreeBSD) are under active research and development and will be submitted once verified to work. This code was tested to build and run on NetBSD-current/amd64. Proper build scripts will be integrated separately as a new commit. Reviewers: joerg Subscribers: tfiala, brucem, labath, emaste, lldb-commits Differential Revision: http://reviews.llvm.org/D13334 llvm-svn: 250146
OpenPOWER on IntegriCloud