summaryrefslogtreecommitdiffstats
path: root/lldb
Commit message (Collapse)AuthorAgeFilesLines
...
* Move StructuredData from Core to UtilityPavel Labath2017-06-2758-155/+157
| | | | | | | | | | | | | | | | Summary: It had a dependency on StringConvert and file reading code, which is not in Utility. I've replaced that code by equivalent llvm operations. I've added a unit test to demonstrate that parsing a file still works. Reviewers: zturner, jingham Subscribers: kubamracek, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D34625 llvm-svn: 306394
* Move Connection and IOObject interfaces to Utility modulePavel Labath2017-06-2719-56/+48
| | | | | | | | | | | | | | | | | | | Summary: These interfaces have no dependencies, so it makes sense for them to be in the lowest level modules, to make sure that other parts of the codebase can use them without introducing loops. The only exception here is the Connection::CreateDefaultConnection method, which I've moved to Host, as it instantiates concrete implementations, and that's where the implementations live. Reviewers: jingham, zturner Subscribers: lldb-commits, mgorny Differential Revision: https://reviews.llvm.org/D34400 llvm-svn: 306391
* Shorten sanitizer plugin namesPavel Labath2017-06-2611-18/+18
| | | | | | | | | | | | | | | | | | | | | | | Summary: The new UndefinedBehaviorSanitizer plugin was breaking file path length limits, because it's (fairly long name) appears multiple times in the path. Cmake ends up putting the object file at path tools/lldb/source/Plugins/InstrumentationRuntime/UndefinedBehaviorSanitizer/CMakeFiles/lldbPluginInstrumentationRuntimeUndefinedBehaviorSanitizer.dir/UndefinedBehaviorSanitizerRuntime.cpp.obj which is 191 characters long and very dangerously close to the 260 character path limit on windows systems (also, just the include line for that file was breaking the 80 character line limit). This renames the sanitizer plugins to use shorter names (asan, ubsan, tsan). I think this will still be quite understandable to everyone as those are the names everyone uses to refer to them anyway. Reviewers: zturner, kubamracek, jingham Subscribers: lldb-commits, mgorny Differential Revision: https://reviews.llvm.org/D34553 llvm-svn: 306278
* Fix LLDB build.Zachary Turner2017-06-232-2/+2
| | | | | | | | | This was broken due to directly including windows.h, which caused a problem when someone in LLVM called std::min in a header file. LLDB has a windows.h include to work around this, but it wasn't being used in these two files. llvm-svn: 306186
* Updated the NSArray and NSDictionary formatters to support new storage formats.Sean Callanan2017-06-233-21/+493
| | | | | | | | Also un-xfailed a testcase that was affected by this. Thanks to Jason Molenda for the patch. <rdar://problem/32827216> llvm-svn: 306180
* Fix typo: using && instead of & when evaluating a maskMehdi Amini2017-06-231-1/+1
| | | | | | | | | | | | Summary: Reported by coverity, I don't know how to provide a test. Reviewers: zturner Subscribers: lldb-commits, emaste Differential Revision: https://reviews.llvm.org/D34550 llvm-svn: 306134
* Simplify the gdb-remote unit testsPavel Labath2017-06-225-236/+126
| | | | | | | | | Instead of every test creating a client-server combo, do that in the SetUp method of the test fixture. This also means that we can rely on gtest to not run the test if the SetUp method fails and delete the if(HasFailure) calls. llvm-svn: 306013
* Fix a python object leak in SWIG glue.Zachary Turner2017-06-211-1/+2
| | | | | | | | | | PyObject_CallFunction returns a PyObject which needs to be decref'ed when it is no longer needed. Patch by David Luyer Differential Revision: https://reviews.llvm.org/D33740 llvm-svn: 305873
* Correct syntax mistake hidden in assert(3)Kamil Rytarowski2017-06-201-1/+1
| | | | | | | wait_status cannot be compared with WaitStatus::Stop, go for wait_status.type. llvm-svn: 305794
* [linux] Change the way we load vdso pseudo-modulePavel Labath2017-06-204-104/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is basically a revert of D16107 and parts of D10800, which were trying to get vdso loading working. They did this by implementing a generic load-an-elf-file from memory approach, which is not correct, since we cannot assume that an elf file is loaded in memory in full (it usually isn't, as there's no need to load section headers for example). This meant that we would read garbage instead of section sizes, and if that garbage happened to be a large number, we would crash while trying to allocate a buffer to accomodate the hypothetical section. Instead of this, I add a bit of custom code to load the vdso to DynamicLoaderPOSIXDYLD (which already needed to handle the vdso specially). I determine the size of the memory to read using Process::GetMemoryRegionInfo, which is information coming from the OS, and cannot be forged by a malicious/misbehaving application. Reviewers: eugene, clayborg Subscribers: lldb-commits, ravitheja, tberghammer, emaste Differential Revision: https://reviews.llvm.org/D34352 llvm-svn: 305780
* Remove home-grown thread-local storage wrappersPavel Labath2017-06-204-71/+14
| | | | | | | | | | | | | | Summary: Use c++11 thread_local variables instead. As far as I am aware, they are supported by all compilers/targets we care about. Reviewers: zturner, jingham Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D34274 llvm-svn: 305779
* ProcessLauncherPosixFork: Fetch errno earlyPavel Labath2017-06-201-4/+4
| | | | | | | | I was seeing some unlikely errno values here. I am not sure if this will help, but it nontheless seems like a good idea to stash errno value before issuing other syscalls. llvm-svn: 305778
* Updated NSNumber formatter for new internal representation.Sean Callanan2017-06-193-17/+119
| | | | | | <rdar://problem/32780109> llvm-svn: 305727
* Add pretty-printer for wait(2) statuses and modernize the code handling themPavel Labath2017-06-1913-224/+160
| | | | | | | | | | | | | | | Summary: A number of places were trying to decode the result of wait(). Add a simple utility function that does that and a struct that encapsulates the decoded result. Then also provide a pretty-printer for that class. Reviewers: zturner, krytarowski, eugene Subscribers: lldb-commits, mgorny Differential Revision: https://reviews.llvm.org/D33998 llvm-svn: 305689
* Tweak SysV_arm64 function entry unwind planPavel Labath2017-06-191-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The motivation for this is to make sure the first row of the plan compares equal to the first row of a generic debug_frame unwind plan. Right now, the code in FuncUnwinders::GetUnwindPlanAtNonCallSite considers them unequal because they specify the return address in a different way (SetReturnAddressRegister(LR) vs. an explicit PC=LR rule). This means that FuncUnwinders would always choose the debug_frame unwind plan, which is not correct, as that one is usually not correct at all locations. Right now this is basically a noop because we don't have parse any debug_frame plans, but it fixes some test failures when merging D33504 in. I have to say I don't understand the full implications of the switch to SetReturnAddressRegister() way of doing things, but given that all of our other unwind plans (eh_frame, instruction profiling) do it this way, it sounds like the right thing to do. Reviewers: tberghammer, jasonmolenda, omjavaid Subscribers: aemerson, javed.absar, kristof.beyls, lldb-commits Differential Revision: https://reviews.llvm.org/D34199 llvm-svn: 305687
* Delete ProcessLauncherPosixPavel Labath2017-06-197-433/+302
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: ProcessLauncherPosix was using posix_spawn for launching the process, but this function is not available on all platforms we support, and even where it was avaialable, it did not support the full range of options we require for launching (most importantly, launching in stop-on-entry mode). For these reasons, the set of ifdefs around these functions has grown untractably large, and we were forced to implement our own launcher from more basic primitives anyway (ProcessLauncherPosixFork -- used on Linux, Android, and NetBSD). Therefore, I remove this class, and move the relevant parts of the code to the darwin-specific Host.mm file. This is the platform that code was originally written for anyway, and it's the only platform where this implementation makes sense (e.g. the lack of the "thread-specific working directory" concept makes these functions racy on all other platforms). This allows us to remove a lot of ifdefs and simplify the code. Effectively, the only change this introduces is that FreeBSD will now use the fork-based launcher instead of posix_spawnp. That sholdn't be a problem as this approach works at least on one other BSD-based system already. Reviewers: krytarowski, emaste, jingham Subscribers: srhines, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D34236 llvm-svn: 305686
* Fix a -Wmisleading-indentation warningSylvestre Ledru2017-06-191-24/+22
| | | | llvm-svn: 305664
* Fix the CMake files for the new InstrumentationRuntime plugins.Kuba Mracek2017-06-162-2/+22
| | | | llvm-svn: 305594
* Upstreaming the UndefinedBehaviorSanitizerRuntime and ↵Kuba Mracek2017-06-1617-16/+941
| | | | | | MainThreadCheckerRuntime plugins. llvm-svn: 305589
* Change the code I added to LocateDSYMInVincinityOfExecutable to useJason Molenda2017-06-161-20/+34
| | | | | | | | | the FileSpec methods for adding/removing file path components instead of using std::strings; feedback from Sean on the change I added in r305441. <rdar://problem/31825940> llvm-svn: 305547
* Add llvm::Error assignment operator to Status classPavel Labath2017-06-153-6/+15
| | | | | | This enables writing "status = std::move(some_llvm_error)". llvm-svn: 305462
* [swig] Improve the native module import logicPavel Labath2017-06-151-1/+7
| | | | | | | | | | | | | | | The simple module import logic was not sufficient for our distribution model of lldb, which is without the _lldb.pyd file (normally that would be a symlink to the shared library, but symlinks are not really a thing on windows). With the older swigs it worked (loading of the python scripting machinery from within lldb) because the normal swig import logic contained a last-ditch import of a global module _lldb (which is defined when you run python from lldb). Add back the last-ditch import to our custom import logic as well. llvm-svn: 305461
* Change how LocateDSYMInVincinityOfExecutable strips off pathJason Molenda2017-06-1511-32/+332
| | | | | | | | | | | | | | | | | | components to not depend on "." characters in the fileanme (e.g. "Foundation.framework") but instead to just use path separators. The names of the files themselves may have dots in them ("com.apple.sbd") which would break the old scheme. Also add a test case for this (macosx/find-dsym/bundle-with-dot-in-filename) as well as a test case for r304520 (macosx/find-dsym/deep-bundle) which needed a similar setup to test correctly on a single machine. (both of these are really testing remote debug session situations where the binary can't be found on the system where lldb is running, complicating the test case a bit.) <rdar://problem/31825940> llvm-svn: 305441
* [testsuite] xfailed two tests that depend on NSString conforming to NSCopying.Sean Callanan2017-06-141-0/+4
| | | | | | | | | | | | | NSString is loaded from the DWARF, which doesn't have the concept of protocols. When this is used with the NSMutableDictionary type from Objective-C modules, this produces errors of the form error: cannot initialize a parameter of type 'id<NSCopying> _Nonnull' with an rvalue of type 'NSString *' We're aware of these problems and have an internal bug report filed (<rdar://problem/32777981>) llvm-svn: 305424
* [LLDB][MIPS] Skip TestGdbRemoteSingleStep and TestGdbRemote_vCont.py.Nitesh Jain2017-06-142-0/+3
| | | | | | | | The step count depends on code generated by compiler (GCC/Clang). It will also vary for different MIPS arch variant. Hence skipping these test for MIPS. Subscribers: jaydeep, bhushan, lldb-commits, slthakur llvm-svn: 305383
* [LLDB][MIPS] Fix TestNoreturnUnwind.py.Nitesh Jain2017-06-141-0/+1
| | | | | | | bugnumber=llvm.org/pr33452 Subscribers: jaydeep, bhushan, lldb-commits, slthakur llvm-svn: 305380
* [LLDB][MIPS] Fix TestRegisterVariables.py.Nitesh Jain2017-06-141-1/+1
| | | | | | | | | Clang does not accept regparm attribute on these platforms. Fortunately, the default calling convention passes arguments in registers any way Subscribers: jaydeep, bhushan, lldb-commits, slthakur llvm-svn: 305378
* Mark TestCallThatRestarts as flaky on androidPavel Labath2017-06-131-0/+2
| | | | | | | | | | | | | This test started being flaky since r303848 (RunThreadPlan: Fix halting logic in IgnoreBreakpoints = false). I am not reverting that, as I am confident that actually fixed a problem. A more likely explanation is that there is still one corner case that is not handled correctly there. Marking the test as flaky until I get a chance to investigate. I also mark the test as no-debug-info-dependend -- it stresses expression evaluation, as far as debug info goes, the test if extremely simple. llvm-svn: 305286
* Introduce new command: thread backtrace uniquePavel Labath2017-06-1211-86/+314
| | | | | | | | | | | | | | | | | This patch introduces a new thread backtrace command "unique". The command is based off of "thread backtrace all" but will instead find all threads which share matching call stacks and de-duplicate their output, listing call stack and all the threads which share it. This is especially useful for apps which use thread/task pools sitting around waiting for work and cause excessive duplicate output. I needed this behavior recently when debugging a core with 700+ threads. Differential Revision: https://reviews.llvm.org/D33426 Reviewers: clayborg, jingham Patch by Brian Gianforcaro <b.gianfo@gmail.com> llvm-svn: 305197
* [VMRange] Remove unused FindRangeIndexThatContainsValue().Davide Italiano2017-06-092-16/+0
| | | | llvm-svn: 305111
* [VMRange] Implement comparison operators using `==` and `<`.Davide Italiano2017-06-091-17/+4
| | | | llvm-svn: 305109
* [VMRange] Use llvm::find_if. Thanks to Zachary for the suggestion.Davide Italiano2017-06-091-4/+2
| | | | llvm-svn: 305099
* Skip TestNoreturnUnwind on linux+clang+armPavel Labath2017-06-091-0/+2
| | | | | | | | I was over-eager to unable this test in r304976. It still fails in this combination, at there does not seem to be anything we can do about it, as the generated code does not preserve the link register. llvm-svn: 305062
* [VMRange] Simplify a couple of member functions. NFCI.Davide Italiano2017-06-081-10/+2
| | | | llvm-svn: 305035
* Fix backtrace of noreturn functions situated at the end of a modulePavel Labath2017-06-0814-36/+136
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: When a call instruction is the last instruction in a function, the backtrace PC will point past the end of the function. We already had special code to handle that, but we did not handle the case where the PC ends up outside of the bounds of the module containing the function, which is a situation that occured in TestNoreturnUnwind on android for some arch/compiler combinations. I fix this by adding an argument to Address resolution code which states that we are ok with addresses pointing to the end of a module/section to resolve to that module/section. I create a reproducible test case for this situation by hand-crafting an executable which has a noreturn function at the end of a module. Reviewers: jasonmolenda, jingham Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D32022 llvm-svn: 304976
* Switch TaskMapOverInt to llvm::function_refPavel Labath2017-06-073-5/+5
| | | | | | | | | | The function does not persist the callback, so using a lighter-weight asbtraction seems appropriate. Also tweak the signatures of the lambdas to match what the TaskMap interface expects. llvm-svn: 304924
* Move Object format code to lib/BinaryFormat.Zachary Turner2017-06-0713-11/+16
| | | | | | | | | | | | This creates a new library called BinaryFormat that has all of the headers from llvm/Support containing structure and layout definitions for various types of binary formats like dwarf, coff, elf, etc as well as the code for identifying a file from its magic. Differential Revision: https://reviews.llvm.org/D33843 llvm-svn: 304864
* Use exact equality for category language matching, for all languages, except ↵Vadim Chugunov2017-06-061-18/+3
| | | | | | those specifically mentioned. llvm-svn: 304832
* Fix assorted compiler warnings. NFCPavel Labath2017-06-063-12/+12
| | | | llvm-svn: 304796
* replace uses of strerror with llvm::sys::StrErrorPavel Labath2017-06-069-63/+52
| | | | | | | | strerror is not thread-safe. llvm's StrError tries hard to retrieve the string in a thread-safe way and falls back to strerror only if it does not have another way. llvm-svn: 304795
* Remove unused variables. NFCPavel Labath2017-06-061-2/+0
| | | | llvm-svn: 304794
* New framework for lldb client-server communication tests.Pavel Labath2017-06-0610-1/+789
| | | | | | | | | | | | | | | | | | | | Summary: This is a new C++ test framework based on Google Test, and one working example test. The intention is to replace the existing tests in packages/Python/lldbsuite/test/tools/lldb-server/ with this suite and use this framework for all new client server tests. Reviewers: labath, beanz Reviewed By: labath, beanz Subscribers: beanz, emaste, zturner, tberghammer, takuto.ikuta, krytarowski, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D32930 Patch by Jason Majors <jmajors@google.com> llvm-svn: 304793
* Avoid invalid string access in ObjCLanguage::MethodName::SetNameStephane Sezer2017-06-051-1/+1
| | | | | | | | | | | | | | | | | Summary: Don't access `name[1] if the string is only of length 1. Avoids a crash/assertion failure when parsing the string `-`. Test Plan: Debug a swift binary, set a breakpoint, watch lldb not crash Original change by Paul Menage <menage@fb.com> Reviewers: lldb-commits, clayborg Differential Revision: https://reviews.llvm.org/D33853 llvm-svn: 304725
* cmake: Put PROCESS_VM_READV detection results into Config.hPavel Labath2017-06-025-27/+19
| | | | | | | | | | Reviewers: beanz, eugene Subscribers: mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D33771 llvm-svn: 304544
* Remove vestigial CLANG_USED_LIBS.Arnaud A. de Grandmaison2017-06-021-1/+1
| | | | | | The actual definition was removed 4 months ago with r294515. llvm-svn: 304527
* Move the code to find a binary in a bundle in the target.exec-search-pathsJason Molenda2017-06-024-64/+93
| | | | | | | | from PlatformRemoteDarwinDevice into PlatformDarwin, and have both PlatformRemoteDarwinDevice and PlatformMacOSX call it there. <rdar://problem/31825940> llvm-svn: 304520
* [TypeSystem] Handle Clang AttributedTypesSean Callanan2017-06-022-10/+126
| | | | | | | | | | | | | | | | | | | When parsing types originating in modules, it is possible to encounter AttributedTypes (such as the type generated for NSString *_Nonnull). Some of LLDB's ClangASTContext methods deal with them; others do not. In particular, one function that did not was GetTypeInfo, causing TestObjCNewSyntax to fail. This fixes that, treating AttributedType as essentially transparent and getting the information for the modified type. In addition, however, TestObjCNewSyntax is a monolithic test that verifies a bunch of different things, all of which can break independently of one another. I broke it apart into smaller tests so that we get more precise failures when something (like this) breaks. Differential Revision: https://reviews.llvm.org/D33812 llvm-svn: 304510
* cmake: Enable process_vm_readv detection on androidPavel Labath2017-06-011-22/+20
| | | | | | | Only android and linux can have this function as far as I am aware, but it seems cleaner to enable this code for all platforms. llvm-svn: 304405
* Fix a small issue with -var-update.Hafiz Abid Qadeer2017-06-011-15/+13
| | | | | | | | | | If the variable was a pointer, code was ignoring the change in the pointee. Discussed in http://lists.llvm.org/pipermail/lldb-dev/2017-May/012435.html llvm-svn: 304400
* Forgot to mention rewriting CommandObject::DoExecute Jim Ingham2017-06-011-0/+19
| | | | | | using the SB API's not the lldb_private API's. llvm-svn: 304379
OpenPOWER on IntegriCloud