summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins
Commit message (Collapse)AuthorAgeFilesLines
...
* Decoupled Options from CommandInterpreter.Todd Fiala2016-08-115-20/+24
| | | | | | | | | | | | | | | | Options used to store a reference to the CommandInterpreter instance in the base Options class. This made it impossible to parse options independent of a CommandInterpreter. This change removes the reference from the base class. Instead, it modifies the options-parsing-related methods to take an ExecutionContext pointer, which the options may inspect if they need to do so. Closes https://reviews.llvm.org/D23416 Reviewers: clayborg, jingham llvm-svn: 278440
* [InstrumentationRuntime] Refactor the API (Part 2/N) (NFCI)Vedant Kumar2016-08-114-87/+39
| | | | | | | | | Factor out some common logic used to find the runtime library in a list of modules. Differential Revision: https://reviews.llvm.org/D23150 llvm-svn: 278368
* [InstrumentationRuntime] Refactor the API (Part 1/N) (NFCI)Vedant Kumar2016-08-114-87/+20
| | | | | | | | | | | | | | | | | Adapters for instrumentation runtimes have to do two basic things: 1) Load a runtime library. 2) Install breakpoints in that library. This logic is duplicated in the adapters for asan and tsan. Factor it out and document bits of it to make it easier to add new adapters. I tested this with check-lldb, and double-checked testcases/functionalities/{a,t}san. Differential Revision: https://reviews.llvm.org/D23043 llvm-svn: 278367
* Make sure files include what they use (part 2/2)Pavel Labath2016-08-117-9/+14
| | | | | | This makes lldb still compile on linux after a project-wide clang-format llvm-svn: 278335
* Remove a double send of eRunPacketSent eventPavel Labath2016-08-111-2/+0
| | | | | | | I accidentaly added the send both to the base class and the derived class in my refactor. Fix that. llvm-svn: 278325
* dlopen & dlclose can't throw C++ or ObjC exceptions, so don't do the extra ↵Jim Ingham2016-08-111-0/+1
| | | | | | | | | | work of setting & deleting the breakpoints to watch for this. <rdar://problem/27780214> llvm-svn: 278305
* Fix a problem where if a uint64_t value is placed into a python dictionary ↵Greg Clayton2016-08-101-1/+12
| | | | | | | | and sent up to LLDB and converted to StructuredData, it would not be able to parse the full 64 bit value. A number like 0xf000000000000000L could be placed into a dictionary, and sent to LLDB and it would end up being 0xffffffffffffffff since it would overflow a int64_t. We leave the old code there, but if it overflows, we treat the number like a uint64_t and get it to decode correctly. Added a gtest to cover this so we don't regress. I verified the gtest failed prior to the fix, and it succeeds after it. <rdar://problem/27409265> llvm-svn: 278304
* Make sure files include what they use (part 1/N)Pavel Labath2016-08-108-9/+18
| | | | | | preparation for the big clang-format. llvm-svn: 278222
* Delete Host/windows/win32.hZachary Turner2016-08-0920-28/+38
| | | | | | | | | | | | | | | | | | | It's always hard to remember when to include this file, and when you do include it it's hard to remember what preprocessor check it needs to be behind, and then you further have to remember whether it's windows.h or win32.h which you need to include. This patch changes the name to PosixApi.h, which is more appropriately named, and makes it independent of any preprocessor setting. There's still the issue of people not knowing when to include this, because there's not a well-defined set of things it exposes other than "whatever is missing on Windows", but at least this should make it less painful to fix when problems arise. This patch depends on LLVM revision r278170. llvm-svn: 278177
* Adjust LLDB's iOS simulator interface for changes in CoreSimulatorEnrico Granata2016-08-096-21/+37
| | | | | | rdar://27732333 and rdar://27732377 llvm-svn: 278166
* Reapply "Rewrite gdb-remote's SendContinuePacketAndWaitForResponse"Pavel Labath2016-08-0910-895/+772
| | | | | | | | | | | | Resumbitting the commit after fixing the following problems: - broken unit tests on windows: incorrect gtest usage on my part (TEST vs. TEST_F) - the new code did not correctly handle the case where we went to interrupt the process, but it stopped due to a different reason - the interrupt request would remain queued and would interfere with the following "continue". I also added a unit test for this case. This reapplies r277156 and r277139. llvm-svn: 278118
* Fix more RegisterInfo initialization issues and quiet hundreds of warnings.Greg Clayton2016-08-0811-727/+727
| | | | llvm-svn: 278063
* Fix printf warnings.Greg Clayton2016-08-081-2/+2
| | | | llvm-svn: 278061
* Fix RegisterInfo initializers to have all the required initializers after ↵Greg Clayton2016-08-088-229/+229
| | | | | | recent changes. This quiets a few hundred warnings on MacOSX. llvm-svn: 278060
* Fix uninitialized field warnings in GDBRemoteRegisterContextPavel Labath2016-08-081-109/+111
| | | | | | | also take the opportunity to replace NULL with nullptr and add clang-format guards to prevent it from messing up the nice table there. llvm-svn: 278005
* Remove Android.hPavel Labath2016-08-082-8/+9
| | | | | | | It only contained a reimplementation of std::to_string, which I have replaced with usages of pre-existing llvm::to_string (also, injecting members into the std namespace is evil). llvm-svn: 278000
* Remove SYS_tgkill from Android.hPavel Labath2016-08-082-2/+1
| | | | | | instead, use __NR_tgkill directly, which seems to be the preferred form in the codebase anyway. llvm-svn: 277999
* The lack of classes in the hash table is not an error - it's very ↵Enrico Granata2016-08-061-1/+1
| | | | | | legitimately possible for a process to define no ObjC classes of its own. Discovered by debugging /bin/ls llvm-svn: 277897
* Add a few more needed bits to the scripted thread plans.Jim Ingham2016-08-052-0/+19
| | | | llvm-svn: 277879
* Tweaks to the reporting of "missing dyld shared cached" that make it easier ↵Enrico Granata2016-08-052-23/+69
| | | | | | to grab logs when such issues occur, make the logs more helpful, and also tweaks to the user messaging to make it easier to pinpoint an investigation avenue early on llvm-svn: 277844
* [asan] Remove unused include (NFC)Vedant Kumar2016-08-051-1/+0
| | | | llvm-svn: 277837
* Change the indexing done for kernel/kext directories to be recursive.Jason Molenda2016-08-052-498/+257
| | | | | | | | | | | | | | Also re-write how most of the directory indexing is done - as it has grown over the years, it has become a bit of a mess and was overdue for a cleanup. Most importantly, this allows you to specify a directory with the platform.plugin.darwin-kernel.kext-directories setting and now lldb will search for kexts and kernels in those directories recursively. <rdar://problem/20754467> llvm-svn: 277789
* [RenderScript] Always create a new allocation ID in CaptureAllocationInit hookLuke Drummond2016-08-032-12/+39
| | | | | | | | | | | | | | | | Due to internal reuse of buffers in the RenderScript runtime by the system allocator, comparing pointers is not a safe way to check whether an allocation is tracked by lldb. This change updates the lldb RenderScript internal hook callback to properly identify and remove old allocations that had have an address that is currently being tracked. This change also removes the need for `lldb_private::renderscript::LookupAllocation` to take a `create` flag, as this is now always the case. Original Author: <dean@codeplay.com> Subscribers: lldb-commits llvm-svn: 277613
* Fix an unused variable warning in release builds.Luke Drummond2016-08-031-1/+1
| | | | | | | | | | | | ``num_params`` was unused in RenderScript ABI fixup pass ``cloneToStructRetFnTy`` and was only used in an `assert()` that the number of function parameters for the cloned function was correct. Now we actually use this variable, rather than recomputing it, and avoid the unused variable warning when building without asserts enabled. Subscribers: lldb-commits llvm-svn: 277608
* Support for OCaml native debuggingTamas Berghammer2016-08-028-0/+438
| | | | | | | | | | | | | This introduces basic support for debugging OCaml binaries. Use of the native compiler with DWARF emission support (see https://github.com/ocaml/ocaml/pull/574) is required. Available variables are considered as 64 bits unsigned integers, their interpretation will be left to a OCaml-made debugging layer. Differential revision: https://reviews.llvm.org/D22132 llvm-svn: 277443
* [LLVM][MIPS] Add (D)SUBU, (D)ADDU, LUI instructions emulation . Fix ↵Nitesh Jain2016-08-024-41/+301
| | | | | | | | | | | | emulation for (D)ADDIU, SD/SW and LW/LD instructions Reviewers: clayborg, jaydeep, bhushan Subscribers: mohit.bhakkad, slthakur, sdardis, lldb-commits Differential Revision: https://reviews.llvm.org/D20357 llvm-svn: 277426
* [asan] Remove unused #include (NFC)Vedant Kumar2016-08-011-1/+0
| | | | llvm-svn: 277359
* [lldb][tsan] Perform one map lookup instead of two (NFC)Vedant Kumar2016-08-011-2/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D22983 llvm-svn: 277350
* [lldb][tsan] Avoid a string copy (NFC)Vedant Kumar2016-08-011-5/+5
| | | | | | Differential Revision: https://reviews.llvm.org/D22984 llvm-svn: 277347
* [LLVM][MIPS] Fix FPU Size Based on Dynamic FR.Nitesh Jain2016-08-0119-229/+349
| | | | | | | | | | Reviewers: jingham, clayborg Subscribers: jaydeep, bhushan, mohit.bhakkad, slthakur, lldb-commits, emaste, nemanjai, labath, sdardis Differential Revision: https://reviews.llvm.org/D20357 llvm-svn: 277343
* Revert "Rewrite gdb-remote's SendContinuePacketAndWaitForResponse"Pavel Labath2016-07-2910-766/+895
| | | | | | | | This reverts commit r277139, because: - broken unittest on windows (likely typo on my part) - seems to break TestCallThatRestart (needs investigation) llvm-svn: 277154
* Add/fix support for i386 elf core filesDimitar Vlahovski2016-07-295-27/+158
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: There were places in the code, assuming(hardcoding) offsets and types that were only valid for the x86_64 elf core file format. The NT_PRSTATUS and NT_PRPSINFO structures are with the 64 bit layout. I have reused them and parse i386 files manually, and fill them in the same struct. Also added some error handling during parsing that checks if the available bytes in the buffer are enough to fill the structures. The i386 core file test case now passes. For reference on the structures layout, I generally used the source of binutils (bfd, readelf) Bug: https://llvm.org/bugs/show_bug.cgi?id=26947 Reviewers: labath Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D22917 llvm-svn: 277140
* Rewrite gdb-remote's SendContinuePacketAndWaitForResponsePavel Labath2016-07-2910-895/+766
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SendContinuePacketAndWaitForResponse was huge function with very complex interactions with several other functions (SendAsyncSignal, SendInterrupt, SendPacket). This meant that making any changes to how packet sending functions and threads interact was very difficult and error-prone. This change does not add any functionality yet, it merely paves the way for future changes. In a follow-up, I plan to add the ability to have multiple query packets in flight (i.e., request,request,response,response instead of the usual request,response sequences) and use that to speed up qModuleInfo packet processing. Here, I introduce two special kinds of locks: ContinueLock, which is used by the continue thread, and Lock, which is used by everyone else. ContinueLock (atomically) sends a continue packet, and blocks any other async threads from accessing the connection. Other threads create an instance of the Lock object when they want to access the connection. This object, while in scope prevents the continue from being send. Optionally, it can also interrupt the process to gain access to the connection for async processing. Most of the syncrhonization logic is encapsulated within these two classes. Some of it still had to bleed over into the SendContinuePacketAndWaitForResponse, but the function is still much more manageable than before -- partly because of most of the work is done in the ContinueLock class, and partly because I have factored out a lot of the packet processing code separate functions (this also makes the functionality more easily testable). Most importantly, there is none of syncrhonization code in the async thread users -- as far as they are concerned, they just need to declare a Lock object, and they are good to go (SendPacketAndWaitForResponse is now a very thin wrapper around the NoLock version of the function, whereas previously it had over 100 lines of synchronization code). This will make my follow up changes there easy. I have written a number of unit tests for the new code and I have ran the test suite on linux and osx with no regressions. Subscribers: tberghammer Differential Revision: https://reviews.llvm.org/D22629 llvm-svn: 277139
* PlatformDarwinKernel maintains a list of kexts and kernelsJason Molenda2016-07-292-12/+148
| | | | | | | | | | | | | | | | | | | | | | | that it finds on the local computer in "well known" locations when we start up the darwin-kernel platform. It did not distinguish between kexts/kernels with dSYMs from others - when it needed a kernel/kext with a given UUID, it would grab the first one it finds. This change separates these into two vectors -- a collection of kexts and kernels with dSYMs next t othem, and a collection of kexts and kernels without dSYMs. When we have a bundle ID and uuid to search for, we first try the collections with dSYMs, and if that fails, then we try the collections that did not have dSYMs next to them. Often times we'll have a situation where a kext will be installed in multiple locations on a system, but only one of them will have a dSYM next to it, where the dev just copied it to a local directory. This fixes that problem, giving precedence to those binaries with debug information. llvm-svn: 277123
* Move the code which knows how to get information about the sharedJason Molenda2016-07-295-63/+138
| | | | | | | | | | cache from ObjectFileMachO (very wrong place) to the DynamicLoader plugins (better place). Not much change to the code itself, although the old ObjectFileMachO method would try both the new dyld SPI and reading the dyld_all_image_infos structure. In the new methods, I've separated those into the appropriate DynamicLoader plugins. llvm-svn: 277088
* Small refinement on the memory segment support in core files thatJason Molenda2016-07-281-0/+17
| | | | | | | | | | | Greg added in r272276 -- when working with a non-user-process mach-o core file, force the permissions to readable + executable, else the unwinder can stop backtracing early if it gets a pc value in a segment that it thinks is non-executable. <rdar://problem/27138456> <rdar://problem/27462904> llvm-svn: 277065
* Fixed up Xcode build for r276976 and r277011.Todd Fiala2016-07-282-2/+2
| | | | | | | Also, fixed up typos in RenderScript code that could not possibly compile. llvm-svn: 277012
* Clean up vestigial remnants of locking primitivesSaleem Abdulrasool2016-07-2811-104/+98
| | | | | | | | | | | | | | | | This finally removes the use of the Mutex and Condition classes. This is an intricate patch as the Mutex and Condition classes were tied together. Furthermore, many places had slightly differing uses of time values. Convert timeout values to relative everywhere to permit the use of std::chrono::duration, which is required for the use of std::condition_variable's timeout. Adjust all Condition and related Mutex classes over to std::{,recursive_}mutex and std::condition_variable. This change primarily comes at the cost of breaking the TracingMutex which was based around the Mutex class. It would be possible to write a wrapper to provide similar functionality, but that is beyond the scope of this change. llvm-svn: 277011
* Add IR fixups for RenderScript ABI mismatch between ARMV7 frontend and x86 ↵Luke Drummond2016-07-287-3/+588
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | backend Expression evaluation for function calls to certain public RenderScript API functions in libRSCPURef can segfault. `slang`, the compiler frontend for RenderScript embeds an ARM specific triple in IR that is shipped in the app, after generating IR that has some assumptions that an ARM device is the target. As the IR is then compiled on a device of unknown (at time the IR was generated at least) architecture, when calling RenderScript API function as part of debugger expressions, we have to perform a fixup pass that removes those assumptions right before the module is sent to be generated by the llvm backend. This issue is caused by multiple problems with the ARMv7-specific assumptions encoded in the LLVM IR. x86 large value returns use a hidden first argument (mapping to llvm::Attribute::StructRet), which can't be picked up by the JIT due to the mismatch between IR generated by the slang frontend and llvm backend. This means that code generated by bcc did not necessarily match the default SysV Linux/Android ABI used by the LLDB JIT - Original Authors: Luke Drummond (@ldrumm), Function declarations fixed by Aidan Dodds (@ADodds) Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D18059 llvm-svn: 276976
* Add some logging to the kernel dynamicloader plugin when we fail to readJason Molenda2016-07-281-0/+3
| | | | | | | a kext binary from memory. <rdar://problem/26158095> llvm-svn: 276954
* The ARM single-step handling needs to look for breakpoint on the next ↵Jim Ingham2016-07-261-1/+2
| | | | | | | | instruction. <rdar://problem/27006685> llvm-svn: 276796
* Fix incorrect form test in SymbolFileDWARFPavel Labath2016-07-262-1/+2
| | | | | | | | | | | | | | | | | | Summary: We were checking whether an attribute is in block form by getting the block data pointer, which was not correct as the pointer be null even if the attribute is in block form. Other places in the file already use the correct test. To make this work, I've needed to add DW_FORM_exprlock to the list of "block" forms, which seems correct as that is how we are parsing it. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D22756 llvm-svn: 276735
* Add support for an additional dictionary in the per-arch plistsJason Molenda2016-07-261-0/+51
| | | | | | | | | | | | | | | | | | | | | that may be embedded in the Contents/Resources subdir of a dSYM bundle. These allow for the specification of a build-time path to debug-time path remapping for source files. Files may be built in /BuildDirectory/sources/project-100 but when the debugger is run, they're actually found via ~sources/project-100 - this plist allows for that remapping through the DBGBuildSourcePath and DBGSourcePath keys. This patch adds support for a new DBGSourcePathRemapping dictionary in the plist where the keys are the build-time paths and the values are the debug-time paths that they should be remapped to. There are instances were we have multiple possible build-time paths that need to be included, so the dictionary was required. <rdar://problem/26725174> llvm-svn: 276729
* DynamicLoaderDarwinKernel will look in four addresses for the kernelJason Molenda2016-07-261-2/+3
| | | | | | | | load address on 64-bit devices; it only needs to look in three. <rdar://problem/27061405> llvm-svn: 276721
* Remove some tab characters that snuck in to my mnost recent edits.Jason Molenda2016-07-222-14/+14
| | | | llvm-svn: 276485
* Support loading files even when incorrect file name specified by the linkerTamas Berghammer2016-07-223-0/+30
| | | | | | | | | | | | | | | "Incorrect" file name seen on Android whene the main executable is called "app_process32" (or 64) but the linker specifies the package name (e.g. com.android.calculator2). Additionally it can be present in case of some linker bugs. This CL adds logic to try to fetch the correct file name from the proc file system based on the base address sepcified by the linker in case we are failed to load the module by name. Differential revision: http://reviews.llvm.org/D22219 llvm-svn: 276411
* Fixing layout of elf-core file related structuresPavel Labath2016-07-222-39/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The binary layout of prstatus and prpsinfo was wrong. Some of the member variables where not aligned properly and others where with a wrong type (e.g. the time related stuff in prstatus). I used the structs defined in bfd in binutils to see what the layout of the elf-core format in these section is. (https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=bfd/hosts/x86-64linux.h;h=4e420a1f2081dd3b51f5d6b7a8e4093580f5cdb5;hb=master) Note: those structures are only for x86 64 bit elf-core files This shouldn't have any impact on the functionality, because lldb actually uses only a few of the member variables of those structs and they are with a correct type and alignment. I found this while trying to add/fix the support for i386 core files (https://llvm.org/bugs/show_bug.cgi?id=26947) Reviewers: labath Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D22628 Author: Dimitar Vlahovski <dvlahovski@google.com> llvm-svn: 276406
* Fix a crash when an ELF section symbol have no nameTamas Berghammer2016-07-221-2/+4
| | | | llvm-svn: 276403
* Add support to get the shared cache information from the newJason Molenda2016-07-226-0/+97
| | | | | | | | | | | | | debugserver jGetSharedCacheInfo packet instead of reading the dyld internal data structures directly. This code is (currently) only used for ios native lldb's - I should really move this ObjectFileMachO::GetProcessSharedCacheUUID method somewhere else, it makes less and less sense being in the file reader. <rdar://problem/25251243> llvm-svn: 276369
* Add check for non-null log instance in PlatformAndroid.Oleksiy Vyalov2016-07-211-1/+1
| | | | llvm-svn: 276303
OpenPOWER on IntegriCloud