summaryrefslogtreecommitdiffstats
path: root/lldb
Commit message (Collapse)AuthorAgeFilesLines
...
* Adding Support for Error Strings in Remote PacketsRavitheja Addepally2017-07-129-23/+136
| | | | | | | | | | | | | | | | | | Summary: This patch adds support for sending strings along with error codes in the reply packets. The implementation is based on the feedback recieved in the lldb-dev mailing list. The patch also adds an extra packet for the client to query if the server has the capability to provide strings along with error replys. Reviewers: labath, jingham, sas, lldb-commits, clayborg Reviewed By: labath, clayborg Differential Revision: https://reviews.llvm.org/D34945 llvm-svn: 307768
* switch on enum should be exhaustive and warning-freeTim Hammerquist2017-07-111-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Testing the value of type_code against the closed enum TypeCodes provides statically verifiable completeness of testing. However, one branch assigns to type_code by casting directly from a masked integer value. This is currently handled by adding a default: case after checking each TypeCodes instance. This patch introduces a bool variable containing the "default" state value, allowing the switch to be exhaustive, protect against future instances not being handled in the switch, and preserves the original logic. This addresses the warning: warning: default label in switch which covers all enumeration values [-Wcovered-switch-default] As an issue of maintainability, the bitmask on line 524 handles the current values of TypeCodes enum, but this will be invalid if the enum is extended. This patch does not address this, and a more closed conversion from cfinfoa -> TypeCodes would help protect against this. Reviewers: spyffe, lhames, sas Reviewed By: sas Subscribers: sas, lldb-commits Differential Revision: https://reviews.llvm.org/D35036 llvm-svn: 307712
* NativeProcessLinux: Fix handling of raise(SIGTRAP)Pavel Labath2017-07-113-5/+15
| | | | | | | | | | | | | | | | | | | | | In NativeProcessLinux::MonitorSIGTRAP we were asserting that the si_code value is one of the codes we know about. However, that list was very incomplete -- for example, we were not handling SI_TKILL/SI_USER, generated by raise(SIGTRAP). A cursory examination show there are at least a dozen codes like these that an app can generate, and more can be added at any point. So, instead of trying to play catchup, I change the default behavior to treat an unknown si_code like an ordinary signal. The only reason we needed to inspect si_code in the first place is because watchpoint/breakpoints are notified as SIGTRAP, but we already know about those, and us starting to use a new debug event is far less likely than somebody introducing a new non-debug event. I add a test case to TestRaise to verify we are handling raise(SIGTRAP) in an application properly. llvm-svn: 307644
* NativeProcessLinux: Fix some compiler warningsPavel Labath2017-07-112-21/+6
| | | | llvm-svn: 307636
* [LLDB][ppc64le] Rename enums in AuxVectorPavel Labath2017-07-113-74/+75
| | | | | | | | | | | | | | | | | Summary: On linux on ppc64le some of the enums in AuxVector have the same name as macros defined in the system. Reviewers: mikesart, labath Reviewed By: labath Subscribers: joerg, gut, krytarowski, lldb-commits Differential Revision: https://reviews.llvm.org/D35065 Patch by Bruno Rosa <bruno.rosa@eldorado.org.br> llvm-svn: 307632
* Pass in the disassembler flavor when disassembling inJason Molenda2017-07-111-1/+2
| | | | | | | | DumpDataExtractor. Patch from Jeffrey Crowell, https://reviews.llvm.org/D34929 llvm-svn: 307618
* Don't access Python objects while not holding the GIL.Zachary Turner2017-07-091-8/+6
| | | | | | | Patch by Tatyana Krasnukha Differential Revision: https://reviews.llvm.org/D34942 llvm-svn: 307512
* Update message that Main Thread Checker produces.Kuba Mracek2017-07-082-3/+3
| | | | llvm-svn: 307464
* The x86 instruction unwinder can be asked to disassemble non-instruction Jason Molenda2017-07-083-9/+38
| | | | | | | | | | | | | | | | | | | | | | | | blocks of memory, and if the final bytes of that block look like a long x86 instruction, it can cause the llvm disassembler to read past the end of the buffer. Use the maximum allowed instruction length that we pass to the llvm disassembler as a way to limit this to the size of the buffer. An example of how to trigger this is when lldb does a function call, it puts a breakpoint on the beginning of main() and uses that as the return address from the function call. When we stop at that location, lldb may try to find the first frame up the stack. Because this is on the first instruction of a function, it will get the word-size value at the stack pointer and assume that this was the caller's pc value. But this is random stack memory and could point to anything - an object in memory, something in the data section, whatever. And if we have a symbol for that thing, we'll try to disassemble it. This was leading to infrequent crashes in customer scenarios; figured out what was happening with address sanitizer. <rdar://problem/30463256> llvm-svn: 307454
* Disable TestGoASTContextPavel Labath2017-07-071-0/+1
| | | | | | | it fails with go 1.8 and we don't seem to have a maintainer of that functionality. llvm-svn: 307391
* Add a NativeProcessProtocol Factory classPavel Labath2017-07-0712-553/+357
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This replaces the static functions used for creating NativeProcessProtocol instances with a factory pattern, and modernizes the interface of the new class in the process -- I use llvm::Expected instead of the Status+value combo. I also move some of the common code (like the Delegate registration into the base class). The new arrangement has multiple benefits: - it removes the NativeProcess*** dependency from Process/gdb-remote (which for example means that liblldb no longer pulls in this code). - it enables unit testing of the GDBRemoteCommunicationServerLLGS class (by providing a mock Native Process). - serves as another example on how to use the llvm::Expected class (I couldn't get rid of the Initialize-type functions completely here because of the use of shared_from_this, but that's the next thing on my list here) Tests still pass on Linux and I've made sure NetBSD compiles after this. Reviewers: zturner, eugene, krytarowski Subscribers: srhines, lldb-commits, mgorny Differential Revision: https://reviews.llvm.org/D33778 llvm-svn: 307390
* Fix Xcode project file for gtest schemes.Tim Hammerquist2017-07-061-8/+30
| | | | | | <rdar://problem/33066993> llvm-svn: 307335
* Change remaining references to lit.util.capture to use subprocess.check_output.David L. Jones2017-07-061-3/+3
| | | | | | | | | | | | | | Summary: The capture() function was removed in r306625. This should fix PGO breakages reported by Michael Zolotukhin. Reviewers: mzolotukhin Subscribers: sanjoy, llvm-commits Differential Revision: https://reviews.llvm.org/D35088 llvm-svn: 307320
* Working through testcases, converting to run_to_source_breakpoint.Jim Ingham2017-07-065-99/+14
| | | | llvm-svn: 307287
* Fix a copy-paste error in r307161Pavel Labath2017-07-061-2/+2
| | | | llvm-svn: 307253
* Revert "Android.rules: build x86 tests with -mstackrealign"Pavel Labath2017-07-062-6/+0
| | | | | | | | | | | Starting with android ndk r15, clang much more tests are affected by the -mstackrealign bugl (now nearly all functions are affected, and not just the ones requiring 16-byte alignment). Due to their numbers, Xfailing all of them is not a viable option, so we will just have to declare this configuration unsupported, and wait until ndk ships a clang version that has this bug fixed. llvm-svn: 307252
* Add a lldbutils routine that gathers up the boiler-plateJim Ingham2017-07-066-116/+58
| | | | | | | | | | to make a target, set a source regex breakpoint, run to the breakpoint and find the thread that hit the breakpoint. Start the process of replacing the boiler plate with this routine. llvm-svn: 307234
* 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
OpenPOWER on IntegriCloud