summaryrefslogtreecommitdiffstats
path: root/lldb
Commit message (Collapse)AuthorAgeFilesLines
* add googlemock include dir to lldb-gtest Xcode targetTim Hammerquist2017-07-061-8/+8
| | | | | | | | | Add the googlemock include directory from LLVM to CFLAGS arguments in Xcode's lldb-gtest. <rdar://problem/33066993> llvm-svn: 307228
* [lldb] Add a testcase for MainThreadCheckerRuntime pluginKuba Mracek2017-07-054-0/+92
| | | | | | This adds a simple testcase for MainThreadCheckerRuntime. The tool (Main Thread Checker) is only available on Darwin, so the test also detects the presence of libMainThreadChecker.dylib and is skipped if the tool is not available. llvm-svn: 307170
* Fix assorted compiler warnings (mismatched signedness and printf specifiers)Pavel Labath2017-07-054-36/+31
| | | | llvm-svn: 307161
* Fix "process load" on new android targetsPavel Labath2017-07-054-9/+13
| | | | | | | | | | | | | | | Summary: On older android targets, we needed a dlopen rename workaround to get "process load" working. Since API 26 this is not required as the targets have a proper libdl so with the function names one would expect. To make this work I've had to remove the const qualifier from the GetLibdlFunctionDeclarations function (as now the declarations can depend on the connected target). Since I was already modifying the prototype (and the lower levels were already converted to StringRef) I took the oportunity to convert this function as well. llvm-svn: 307160
* Update lldb architecture docsPavel Labath2017-07-042-352/+75
| | | | | | | | | | | | | | | | | | Summary: Due to recent refactors, the descriptions of various modules were wildly out of date. With this patch, I am not trying to legislate anything, I am merely documenting the current state of affairs. I am also deleting one copy of the architecture docs. AFAIK, this one is not referenced from the web page. Reviewers: zturner, jingham Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D34872 llvm-svn: 307072
* Fix some warnings in ProcessorTraceTest.cppPavel Labath2017-07-041-17/+15
| | | | llvm-svn: 307071
* Fixing warnings for unused variables and copy ellisionRavitheja Addepally2017-07-031-20/+15
| | | | | | | | | | | | | | | | Summary: The std::move was preventing copy ellision when compiled with clang, the patch fixes the warning along with rearranging code to remove unused variables warnings on Linux machines with older perf_event interface. Reviewers: labath, ted Reviewed By: labath Differential Revision: https://reviews.llvm.org/D34946 llvm-svn: 307030
* Fix typo/unbreak windows build broken by r307009Pavel Labath2017-07-031-1/+1
| | | | llvm-svn: 307018
* Use llvm::sys::RetryAfterSignal instead of a manual while errno!=EINTR loopPavel Labath2017-07-037-109/+60
| | | | | | | | | | Reviewers: zturner, eugene, krytarowski Subscribers: emaste, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D33831 llvm-svn: 307009
* Remove dead Core/StreamFile includesPavel Labath2017-06-305-24/+12
| | | | llvm-svn: 306817
* Fix a cmake typo to unbreak windows unit testsPavel Labath2017-06-301-1/+1
| | | | llvm-svn: 306802
* [Data formatters] Make NSSetM support both old- and new-style representationSean Callanan2017-06-301-28/+76
| | | | | | | | | | | NSSetM has two in-memory representations depending on what Foundation version is in use. This patch separates the two. rdar://33057292 Differential Revision: https://reviews.llvm.org/D34821 llvm-svn: 306773
* Fix some type-based warningsTim Hammerquist2017-06-293-6/+6
| | | | llvm-svn: 306765
* Update default cpu subtype for armv7 processes to armv7k, the mostJason Molenda2017-06-291-1/+1
| | | | | | likely cpu subtype at this point. llvm-svn: 306752
* Timer.{h,cpp} moved, find them again in the project file.Jim Ingham2017-06-291-6/+6
| | | | llvm-svn: 306725
* Speculative fix for windows build broken by r306668Pavel Labath2017-06-291-6/+2
| | | | llvm-svn: 306693
* Fix Mac build for the Timer movePavel Labath2017-06-292-2/+2
| | | | llvm-svn: 306686
* Android.rules: build x86 tests with -mstackrealignPavel Labath2017-06-292-12/+6
| | | | | | | | | | | | | All android builds systems have switched to -mstackrealign for building x86 binaries, so follow their cue with our mini build system. This presently breaks just one test (TestReturnValue), and this is due to a compiler bug, which has already been fixed in clang, but it hasn't made it yet into the official NDK compiler. While I'm touching that test, I also remove an android-specific XFAIL, which is not relevant anymore. llvm-svn: 306683
* Move Timer and TraceOptions from Core to UtilityPavel Labath2017-06-2947-69/+52
| | | | | | | | | | | | | | Summary: The classes have no dependencies, and they are used both by lldb and lldb-server, so it makes sense for them to live in the lowest layers. Reviewers: zturner, jingham Subscribers: emaste, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D34746 llvm-svn: 306682
* Make scripts/analyze-project-deps.py executablePavel Labath2017-06-291-1/+3
| | | | llvm-svn: 306669
* [unittests] Add a helper function for getting an input filePavel Labath2017-06-2922-100/+89
| | | | | | | | | | | | | | | | | Summary: Fetching an input file required about five lines of code, and this was repeated in multiple unit tests, with slight variations. Add a helper function for doing that into the lldbUtilityMocks module (which I rename to lldbUtilityHelpers to commemorate the fact it includes more than mocks) Reviewers: zturner, eugene Subscribers: emaste, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D34683 llvm-svn: 306668
* [UnwindAssembly/x86] Add support for "lea imm(%ebp), %esp" patternPavel Labath2017-06-293-0/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The instruction pattern: and $-16, %esp sub $imm, %esp ... lea imm(%ebp), %esp appears when the compiler is realigning the stack (for example in main(), or almost everywhere with -mstackrealign switch). The "and" instruction is very difficult to model, but that's not necessary, as these frames are always %ebp-based (the compiler also needs a way to restore the original %esp). Therefore the plans we were generating for these function were almost correct already. The only place we were doing it wrong were the last instructions of the epilogue (usually just "ret"), where we had to revert to %esp-based unwinding, as the %ebp had been popped already. This was wrong because our "distance of esp from cfa" counter had picked up the "sub" instruction (and incremented the counter) but it had not seen that the register was reset by the "lea" instruction. This patch fixes that shortcoming, and adds a test for handling functions like this. I have not been able to tickle the compiler into producing a 64-bit function with this pattern, but I don't see a reason why it couldn't produce it, if it chose to, so I add a x86_64 test as well. Reviewers: jasonmolenda, tberghammer Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D34750 llvm-svn: 306666
* Fix two places in RegisterContextLLDB::InitializeNonZerothFrame whereJason Molenda2017-06-291-13/+14
| | | | | | | | I'm not running the saved pc through FixCodeAddress as soon as I should. <rdar://problem/30686307> llvm-svn: 306634
* Change the ABI class to have a weak pointer to its Process;Jason Molenda2017-06-2933-78/+88
| | | | | | | | | | | | | | | | some methods in the ABI need a Process to do their work. Instead of passing it in as a one-off argument to those methods, this patch puts it in the base class and the methods can retrieve if it needed. Note that ABI's are sometimes built without a Process (e.g. SBTarget::GetStackRedZoneSize) so it's entirely possible that the process weak pointer will not be able to reconsistitue into a strong pointer. <rdar://problem/32526754> llvm-svn: 306633
* Added a project for the unified IR interpreter.Sean Callanan2017-06-281-0/+12
| | | | llvm-svn: 306611
* [DWARFCallFrameInfo] Add Type enum to differentiate eh/debug_frame sectionsPavel Labath2017-06-285-39/+39
| | | | | | | | | | | | | | | | | Summary: instead of using a boolean to differentiate between the two section types, use an enum to make the intent clearer. I also remove the RegisterKind argument from the constructor, as this can be deduced from the Type argument. Reviewers: clayborg, jasonmolenda Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D34681 llvm-svn: 306521
* Linux unit tests should only run onRavitheja Addepally2017-06-281-1/+3
| | | | | | Linux based systems. llvm-svn: 306520
* Implementation of Intel(R) Processor Trace support for LinuxRavitheja Addepally2017-06-2812-13/+1061
| | | | | | | | | | | | | | | | | | | | | | Summary: This patch implements support for Intel(R) Processor Trace in lldb server. The changes have support for starting/stopping and reading the trace data. The code is only available on Linux versions where the perf attributes for aux buffers are available. The patch also consists of Unit tests for testing the core buffer reading function. Reviewers: lldb-commits, labath, clayborg, zturner, tberghammer Reviewed By: labath, clayborg Subscribers: mgorny Differential Revision: https://reviews.llvm.org/D33674 llvm-svn: 306516
* Upstream the 'eInstrumentationRuntimeTypeSwiftRuntimeReporting' value of the ↵Kuba Mracek2017-06-271-0/+1
| | | | | | 'eInstrumentationRuntimeType' enum from the swift-lldb project (to avoid potential clashes). llvm-svn: 306469
* [build system] If there's an OVERRIDE, don't guess the current SCM.Sean Callanan2017-06-272-0/+14
| | | | | | | | This makes automatic checkout work even in situations where the current repository can't be determined, such as in the case of a Git tag. llvm-svn: 306460
* Fix up the Xcode project:Jim Ingham2017-06-271-49/+41
| | | | | | | | 1) Renaming the InstrumentationRuntime directory & file names 2) Bunch of stuff moved from Core to Utility 3) Deleted a bunch of files records for files that have gone away llvm-svn: 306445
* Fix windows build for the Connection movePavel Labath2017-06-271-1/+1
| | | | llvm-svn: 306400
* Add debug_frame section supportPavel Labath2017-06-2710-105/+544
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This is a beefed-up version of D33504, which adds support for dwarf 4 debug_frame section format. The main difference here is that the decision whether to use eh_frame or debug_frame is done on a per-function basis instead of per-object file. This is necessary because one module can contain both sections (for example, the start files added by the linker will typically pull in eh_frame), but we want to be able to access both, for maximum information. I also add unit test for parsing various CFI formats (eh_frame, debug_frame v3 and debug_frame v4). Reviewers: jasonmolenda, clayborg Subscribers: mgorny, aprantl, abidh, lldb-commits, tatyana-krasnukha Differential Revision: https://reviews.llvm.org/D34613 llvm-svn: 306397
* 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
OpenPOWER on IntegriCloud