summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins
Commit message (Collapse)AuthorAgeFilesLines
...
* Process: fix FXSAVE on x86Saleem Abdulrasool2017-08-232-4/+2
| | | | | | | | | The FXSAVE member `ftw` (FPU Tag Word) was given the wrong size (8-bit) instead of the correct width (16-bit) as per the x87 Programmer's Manual. Adjust this to ensure that we print out the complete value for the register. llvm-svn: 311579
* ObjC: fix some -Wpedantic warnings by removing ';'Saleem Abdulrasool2017-08-231-3/+3
| | | | | | Remove some stray ';' that were in the source code. NFC. llvm-svn: 311577
* [Plugins/ObjC] Remove more semicolons to placate -Wpedantic. NFCI.Davide Italiano2017-08-191-3/+3
| | | | llvm-svn: 311245
* [Plugins/ObjC] Remove unneded semicolon(s) to placate GCC -Wpedantic.Davide Italiano2017-08-191-4/+4
| | | | llvm-svn: 311244
* Commiting Christopher Brook's patch forJason Molenda2017-08-181-1/+2
| | | | | | | | "Prevent negative chars from being sign-extended into isprint and isspace which take and int and crash if the int is negative" https://reviews.llvm.org/D36620 llvm-svn: 311207
* convert hard tabs to spaces in PlatformOpenBSD.cppEd Maste2017-08-161-1/+1
| | | | | | | Another case of this was responsible for the whitespace conflict in D34776. llvm-svn: 311003
* Make i386-*-freebsd expression work on JIT pathEd Maste2017-08-1610-28/+52
| | | | | | | | | | | | | | | | * Enable i386 ABI creation for freebsd * Added an extra argument in ABISysV_i386::PrepareTrivialCall for mmap syscall * Unlike linux, the last argument of mmap is actually 64-bit(off_t). This requires us to push an additional word for the higher order bits. * Prior to this change, ktrace dump will show mmap failures due to invalid argument coming from the 6th mmap argument. Patch by Karnajit Wangkhem Differential Revision: https://reviews.llvm.org/D34776 llvm-svn: 311002
* Remove the DWARFExpression -> Clang ExpressionParser dependencyTamas Berghammer2017-08-164-16/+11
| | | | | | | | It was completly unused and broke the part of the encapsulation that common code shouldn't depend on specific plugins or language specific features. llvm-svn: 311000
* Update NSArray/NSDictionary/NSSet formatters to handle newJason Molenda2017-08-153-467/+546
| | | | | | | | | macOS 10.13 - High Sierra - internal layouts. Patch by Sean Callanan. <rdar://problem/33282015> llvm-svn: 310959
* [LLDB][MIPS] Fix process load/unload on android.Nitesh Jain2017-08-144-8/+25
| | | | | | | | | | | | To detect the correct function name based on the list of available symbols instead of the SDK version Reviewers: tberghammer, clayborg Subscribers: jaydeep, bhushan, lldb-commits Differential Revision: https://reviews.llvm.org/D36445 llvm-svn: 310856
* [LLDB][MIPS] Set the Section's file address forNitesh Jain2017-08-141-2/+4
| | | | | | | | | | | | ELF section to LLDB_INVALID_ADDRESS if SHF_ALLOC is not set. Reviewers: labath, clayborg Subscribers: jaydeep, bhushan, lldb-commits Differential Revision: https://reviews.llvm.org/D35784 llvm-svn: 310855
* Report inferior signals as signals, not exceptions, on FreeBSDEd Maste2017-08-104-50/+12
| | | | | | | | | | | | | | | | | | | | | This is the FreeBSD equivalent of r238549. This serves 2 purposes: * LLDB should handle inferior process signals SIGSEGV/SIGILL/SIGBUS/ SIGFPE the way it is suppose to be handled. Prior to this fix these signals will neither create a coredump, nor exit from the debugger or work for signal handling scenario. * eInvalidCrashReason need not report "unknown crash reason" if we have a valid si_signo llvm.org/pr23699 Patch by Karnajit Wangkhem Differential Revision: https://reviews.llvm.org/D35223 llvm-svn: 310591
* Fix LLDB crash accessing unknown DW_FORM_* attributesJan Kratochvil2017-07-315-0/+77
| | | | | | | | | | | | | | | | Current LLDB (that is without DWZ support) crashes accessing Fedora debug info: READ of size 8 at 0x60200000ffc8 thread T0 #0 in DWARFDebugInfoEntry::BuildAddressRangeTable(SymbolFileDWARF*, DWARFCompileUnit const*, DWARFDebugAranges*) const tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp:1336 Greg Clayton: We will need a warning to be emitted in SymbolFileDWARF::CalculateAbilities() stating we won't parse the DWARF due to "unsupported DW_FORM value of 0x1f20". Patch has been mostly written by Greg Clayton. Differential revision: https://reviews.llvm.org/D35622 llvm-svn: 309581
* Add support for base address entries in the .debug_ranges sectionTamas Berghammer2017-07-311-18/+19
| | | | | | | | | Summary: Clang recently started to emit base address entries into the .debug_ranges section to reduce the number of relocations needed. Lets make sure LLDB can read them. llvm-svn: 309554
* [CMake] Add checks for libcompressionChris Bieneman2017-07-281-0/+5
| | | | | | This enables libcompression when available in the CMake build system. llvm-svn: 309395
* [LLDB][MIPS] Fix emulation of Instruction for MIPS64R6 target.Nitesh Jain2017-07-271-18/+57
| | | | | Subscribers: jaydeep, bhushan, lldb-commits, slthakur llvm-svn: 309250
* Improve the fix for PR33875 by not hardcoding the section name.Adrian Prantl2017-07-251-6/+6
| | | | | | This is a follow-up to r308905. llvm-svn: 309019
* Don't allow .debug_types to be parsed as LLDB can crash when enums are not ↵Greg Clayton2017-07-241-0/+15
| | | | | | | | able to be found. Differential Revision: https://reviews.llvm.org/D35734 llvm-svn: 308911
* RFix PR33875 by distinguishing between DWO and clang modules.Adrian Prantl2017-07-241-0/+8
| | | | | | | | This reapplies https://reviews.llvm.org/D35740 with a tweak to find the section by name rather than type. Section types don't distinguish between regular sections and their DWO counterparts. llvm-svn: 308905
* Revert "Fix PR33875 by distinguishing between DWO and clang modules"Adrian Prantl2017-07-231-6/+0
| | | | | | This reverts commit r308850. llvm-svn: 308851
* Fix PR33875 by distinguishing between DWO and clang modulesAdrian Prantl2017-07-231-0/+6
| | | | | | | | | | | | | | The DWO handling code can get confused by clang modules which also use skeleton CUs to point to the object file with the full debug info. This patch detects whether an object is a "real" DWO or a clang module and prevents LLDB from interpreting clang modules as DWO. This fixes the regression in TestWithModuleDebugging. http://llvm.org/bugs/show_bug.cgi?id=33875 Differential Revision: https://reviews.llvm.org/D35740 llvm-svn: 308850
* silence a couple of -Wqual-cast warning from GCC (NFC)Saleem Abdulrasool2017-07-192-2/+4
| | | | | | | | | | | | | | | Cast to `const uint8_t *` instead of `uint8_t *` to avoid the warning from GCC. EmulationStateARM.cpp:206:34: warning: cast from type 'const void*' to type 'uint8_t* {aka unsigned char*}' casts away qualifiers [-Wcast-qual] Cast to `const uint32_t *` and the explicitly cast away the const-ness of the value. This seems pretty sketchy as the `DataExtractor` holds a const reference to the data. However, this is no worse than before. ObjectFilePECOFF.cpp:540:78: warning: cast from type 'const uint8_t* {aka const unsigned char*}' to type 'uint32_t* {aka unsigned int*}' casts away qualifiers [-Wcast-qual] llvm-svn: 308489
* Fix NetBSD/FreeBSD build after r308304Pavel Labath2017-07-181-0/+1
| | | | llvm-svn: 308307
* Clean up lldb-types.hPavel Labath2017-07-187-14/+8
| | | | | | | | | | | | | | | | | | | | Summary: It defined a couple of types (condition_t) which we don't use anymore, as we have c++11 goodies now. I remove these definitions. Also it unnecessarily included a couple of headers which weren't necessary for it's operation. I remove these, and place the includes in the relevant files (usually .cpp, usually in Host code) which use them. This allows us to reduce namespace pollution in most of the lldb files which don't need the OS-specific definitions. Reviewers: zturner, jingham Subscribers: ki.stfu, lldb-commits Differential Revision: https://reviews.llvm.org/D35113 llvm-svn: 308304
* Fix linux arm and mips builds broken by r308282Pavel Labath2017-07-182-4/+4
| | | | llvm-svn: 308292
* Remove shared pointer from NativeProcessProtocolPavel Labath2017-07-1812-412/+261
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The usage of shared_from_this forces us to separate construction and initialization phases, because shared_from_this() is not available in the constructor (or destructor). The shared semantics are not necessary, as we always have a clear owner of the native process class (GDBRemoteCommunicationServerLLDB object). Even if we need shared semantics in the future (which I think we should strongly avoid), reverting this will not be necessary -- the owners can still easily store the native process object in a shared pointer if they really want to -- this just prevents the knowledge of that from leaking into the class implementation. After this a NativeThread object will hold a reference to the parent process (instead of a weak_ptr) -- having a process instance always available allows us to simplify some logic in this class (some of it was already simplified because we were asserting that the process is available, but this makes it obvious). Reviewers: krytarowski, eugene, zturner Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D35123 llvm-svn: 308282
* Fixing LLDB build after refactoring of clang's MacroInfoEugene Zemtsov2017-07-171-4/+4
| | | | llvm-svn: 308219
* Enable parsing C++ names generated by lambda functions.Jim Ingham2017-07-132-0/+34
| | | | | | https://reviews.llvm.org/D34911 from Weng Xuetian. llvm-svn: 307944
* Upstreaming a patch from Github: When evaluation user expressions, ignore ↵Kuba Mracek2017-07-134-2/+16
| | | | | | InstrumentationRuntime breakpoints. (#235) llvm-svn: 307881
* Adding Support for Error Strings in Remote PacketsRavitheja Addepally2017-07-126-10/+63
| | | | | | | | | | | | | | | | | | 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-111-5/+3
| | | | | | | | | | | | | | | | | | | | | 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
* 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-081-1/+1
| | | | llvm-svn: 307464
* The x86 instruction unwinder can be asked to disassemble non-instruction Jason Molenda2017-07-082-9/+13
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Add a NativeProcessProtocol Factory classPavel Labath2017-07-078-460/+248
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 assorted compiler warnings (mismatched signedness and printf specifiers)Pavel Labath2017-07-051-1/+1
| | | | 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
* 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
* Use llvm::sys::RetryAfterSignal instead of a manual while errno!=EINTR loopPavel Labath2017-07-033-34/+16
| | | | | | | | | | Reviewers: zturner, eugene, krytarowski Subscribers: emaste, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D33831 llvm-svn: 307009
* [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-291-2/+2
| | | | llvm-svn: 306765
* Fix Mac build for the Timer movePavel Labath2017-06-291-1/+1
| | | | llvm-svn: 306686
* Move Timer and TraceOptions from Core to UtilityPavel Labath2017-06-2918-22/+21
| | | | | | | | | | | | | | 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
* [UnwindAssembly/x86] Add support for "lea imm(%ebp), %esp" patternPavel Labath2017-06-292-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-2927-67/+64
| | | | | | | | | | | | | | | | 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
* [DWARFCallFrameInfo] Add Type enum to differentiate eh/debug_frame sectionsPavel Labath2017-06-281-1/+1
| | | | | | | | | | | | | | | | | 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
OpenPOWER on IntegriCloud