summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/LanguageRuntime
Commit message (Collapse)AuthorAgeFilesLines
* *** This commit represents a complete reformatting of the LLDB source codeKate Stone2016-09-0628-12116/+11218
| | | | | | | | | | | | | | | | | | | | | | | *** to conform to clang-format’s LLVM style. This kind of mass change has *** two obvious implications: Firstly, merging this particular commit into a downstream fork may be a huge effort. Alternatively, it may be worth merging all changes up to this commit, performing the same reformatting operation locally, and then discarding the merge for this particular commit. The commands used to accomplish this reformatting were as follows (with current working directory as the root of the repository): find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} + find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ; The version of clang-format used was 3.9.0, and autopep8 was 1.2.4. Secondly, “blame” style tools will generally point to this commit instead of a meaningful prior commit. There are alternatives available that will attempt to look through this change and find the appropriate prior commit. YMMV. llvm-svn: 280751
* Remove unused variables.Zachary Turner2016-08-311-2/+1
| | | | | | Patch by Taras Tsugrii llvm-svn: 280283
* Add logic to the ObjC runtime in LLDB to extract the pointer values of the ↵Enrico Granata2016-08-204-1/+63
| | | | | | | | two singleton (pairtons?) instances of __NSCFBoolean that represent true and false This is useful because that knowledge will in turn allow no-code-running formatting of boolean NSNumbers; but that's a commit that will have to wait Monday.. llvm-svn: 279353
* Decoupled Options from CommandInterpreter.Todd Fiala2016-08-112-17/+21
| | | | | | | | | | | | | | | | 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
* Delete Host/windows/win32.hZachary Turner2016-08-091-1/+1
| | | | | | | | | | | | | | | | | | | 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
* 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
* 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
* [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
* 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
* Fix an issue where LLDB would detect an empty shared cache - which is ↵Enrico Granata2016-07-212-25/+43
| | | | | | | | | | legitimate albeit suboptimal - and warn about being unable to fetch ObjC class information, even though class data was actually properly loaded from the dynamic hashmap Only ever warn about missing ObjC runtime class data if one either can't run the expressions to obtain such data, or the total count of classes is below a threshold that makes things sound really suspicious Fixes rdar://27438500 llvm-svn: 276220
* Typo corrections identified by codespellEd Maste2016-07-191-5/+5
| | | | | | | | | Submitted by giffunip@yahoo.com; I fixed a couple of nearby errors and incorrect changes in the patch. llvm.org/pr27634 llvm-svn: 275983
* LLDB help content has accumulated over time without a recent attempt toKate Stone2016-07-143-27/+19
| | | | | | | | | review it for consistency, accuracy, and clarity. These changes attempt to address all of the above while keeping the text relatively terse. <rdar://problem/24868841> llvm-svn: 275485
* Fix a check in the objc trampoline handlerStephane Sezer2016-07-131-1/+1
| | | | | | | | | | | | | | | | Summary: The function FunctionCaller::WriteFunctionArguments returns false on errors, so they should check for the false return value. Change by Walter Erquinigo <a20012251@gmail.com> Reviewers: jingham, clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D22278 llvm-svn: 275287
* Don't cache the stret/vrs. non-stret code pointer as static data in the runtime.Jim Ingham2016-05-262-6/+6
| | | | | | | | | It belongs in the instance, since then when you change architectures it can be adjusted appropriately. <rdar://problem/26308079> llvm-svn: 270938
* Add a missing include to ItaniumABILanguageRuntime.hPavel Labath2016-05-241-0/+1
| | | | | | | some (I'm not sure why only some, actually) implementations of std::map require the value type to be a fully specified type when declaring then. This make sure TypeAndOrName is. llvm-svn: 270570
* We have many radars showing that stepping through C++ code can result in ↵Greg Clayton2016-05-232-136/+173
| | | | | | | | | | | | slow steps. One of the things slowing us down is that ItaniumABILanguageRuntime class doesn't cache vtable to types in a map. This causes us, on every step, for every variable, to read the first pointer in a C++ type that could be dynamic and lookup the symbol, possibly in every symbol file (some symbols files on Darwin can end up having thousands of .o files when using DWARF in .o files, so thousands of .o files are searched each time). This fix caches lldb_private::Address (the resolved vtable symbol address in section + offset format) to TypeAndOrName instances inside the one ItaniumABILanguageRuntime in a process. This allows caching of dynamic types and stops us from always doing deep searches in each file. <rdar://problem/18890778> llvm-svn: 270488
* second pass over removal of Mutex and ConditionSaleem Abdulrasool2016-05-193-5/+5
| | | | llvm-svn: 270024
* remove use of Mutex in favour of std::{,recursive_}mutexSaleem Abdulrasool2016-05-186-38/+38
| | | | | | | | | | This is a pretty straightforward first pass over removing a number of uses of Mutex in favor of std::mutex or std::recursive_mutex. The problem is that there are interfaces which take Mutex::Locker & to lock internal locks. This patch cleans up most of the easy cases. The only non-trivial change is in CommandObjectTarget.cpp where a Mutex::Locker was split into two. llvm-svn: 269877
* Add a check for version 15 of the shared cache formatEnrico Granata2016-05-121-1/+1
| | | | | | <rdar://problem/26207478> llvm-svn: 269378
* Revert r268591Enrico Granata2016-05-0514-59/+26
| | | | | | | | | | | | | | "Allow LanguageRuntimes to return an error if they fail in the course of dynamic type discovery This is not meant to report that a value doesn't have a dynamic type - it is only meant as a mechanism to propagate actual type discovery issues (e.g. malformed type metadata for languages that have such a notion) This information is used by ValueObjectDynamic to set its own m_error, which is a fairly sharp and heavyweight tool to begin with For the time being, this is an architectural improvement but a practical no-op as no existing runtimes are actually setting errors" I need to think about what I want to do in this space more carefully - this attempt might be too heavy of a hammer for the nail I am trying to fix, and I don't want to leave it in while I ponder llvm-svn: 268686
* Allow LanguageRuntimes to return an error if they fail in the course of ↵Enrico Granata2016-05-0514-26/+59
| | | | | | | | | | | | dynamic type discovery This is not meant to report that a value doesn't have a dynamic type - it is only meant as a mechanism to propagate actual type discovery issues (e.g. malformed type metadata for languages that have such a notion) This information is used by ValueObjectDynamic to set its own m_error, which is a fairly sharp and heavyweight tool to begin with For the time being, this is an architectural improvement but a practical no-op as no existing runtimes are actually setting errors llvm-svn: 268591
* Make the functions that fetch data from the ObjC runtime choose whether or ↵Enrico Granata2016-05-051-15/+13
| | | | | | | | not to log depending on whether the types log is enabled This can prove helpful in debugging issues with that retrieval even if LLDB wasn't compiled with the magic macros defined llvm-svn: 268587
* Add more debug logging to g_get_shared_cache_class_info_bodyEnrico Granata2016-05-021-1/+14
| | | | llvm-svn: 268303
* Rename out->std_out in AppleObjCRuntimeV2.cpp.Oleksiy Vyalov2016-04-151-17/+17
| | | | llvm-svn: 266401
* Fix Android build after r266267Oleksiy Vyalov2016-04-141-17/+17
| | | | llvm-svn: 266274
* Don't use auto - (try to) appease the Android g++ botEnrico Granata2016-04-141-1/+1
| | | | llvm-svn: 266271
* Augment the 'language objc class-table dump' command to take a "-v" option, ↵Enrico Granata2016-04-142-8/+159
| | | | | | which makes it print ivar and method information, as well as an optional regex argument which filters out all class names that don't match the regex llvm-svn: 266267
* Add support for resolving dynamic types of extended ObjC tagged pointersEnrico Granata2016-04-112-0/+188
| | | | | | rdar://problem/24401051 llvm-svn: 266001
* Move some functions from DWARFASTParserClang to ClangASTImporter.Zachary Turner2016-03-282-21/+20
| | | | | | | | | | | | | | | | | | This allows these functions to be re-used by a forthcoming PDBASTParser. The functions in question are CanCompleteType, CompleteType, and CanImport. Conceptually, these functions belong on ClangASTImporter anyway, and previously they were just ping ponging around through a few levels of indirection to end up there as well, so this patch actually makes the code somewhat simpler. A few methods were moved to a new file called ClangUtil, so that they can be shared between ClangASTImporter and ClangASTContext without creating a circular dependency between those two cpp files. Differential Revision: http://reviews.llvm.org/D18381 llvm-svn: 264685
* Add a 'language cplusplus demangle' command. This can be useful to provide a ↵Enrico Granata2016-03-251-1/+89
| | | | | | low-friction reproduction for issues with the LLDB demangling of C++ symbols llvm-svn: 264474
* Get rid of two global constructors by making things static variables in the ↵Greg Clayton2016-03-242-9/+8
| | | | | | only function that uses these variables. llvm-svn: 264347
* Compilation can end up calling functions (e.g. to resolve indirect ↵Jim Ingham2016-03-212-1/+6
| | | | | | | | | | functions) so I added a way for compilation to take a "thread to use for compilation". If it isn't set then the compilation will use the currently selected thread. This should help keep function execution to the one thread intended. llvm-svn: 263972
* Add a DiagnosticManager replace error streams in the expression parser.Sean Callanan2016-03-194-111/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We want to do a better job presenting errors that occur when evaluating expressions. Key to this effort is getting away from a model where all errors are spat out onto a stream where the client has to take or leave all of them. To this end, this patch adds a new class, DiagnosticManager, which contains errors produced by the compiler or by LLDB as an expression is created. The DiagnosticManager can dump itself to a log as well as to a string. Clients will (in the future) be able to filter out the errors they're interested in by ID or present subsets of these errors to the user. This patch is not intended to change the *users* of errors - only to thread DiagnosticManagers to all the places where streams are used. I also attempt to standardize our use of errors a bit, removing trailing newlines and making clients omit 'error:', 'warning:' etc. and instead pass the Severity flag. The patch is testsuite-neutral, with modifications to one part of the MI tests because it relied on "error: error:" being erroneously printed. This patch fixes the MI variable handling and the testcase. <rdar://problem/22864976> llvm-svn: 263859
* This change introduces a "ExpressionExecutionThread" to the ThreadList. Jim Ingham2016-03-121-2/+2
| | | | | | | | | | | | | | | | | | | Turns out that most of the code that runs expressions (e.g. the ObjC runtime grubber) on behalf of the expression parser was using the currently selected thread. But sometimes, e.g. when we are evaluating breakpoint conditions/commands, we don't select the thread we're running on, we instead set the context for the interpreter, and explicitly pass that to other callers. That wasn't getting communicated to these utility expressions, so they would run on some other thread instead, and that could cause a variety of subtle and hard to reproduce problems. I also went through the commands and cleaned up the use of GetSelectedThread. All those uses should have been trying the thread in the m_exe_ctx belonging to the command object first. It would actually have been pretty hard to get misbehavior in these cases, but for correctness sake it is good to make this usage consistent. <rdar://problem/24978569> llvm-svn: 263326
* [Renderscript] Add stack argument reading code for Mipsel 3Aidan Dodds2016-03-101-7/+7
| | | | | | | | Fix a problem raised with the previous patches being applied in the wrong order. Committed on behalf of: Dean De Leo <dean@codeplay.com> llvm-svn: 263134
* [Renderscript] Add stack argument reading code for Mipsel 2Aidan Dodds2016-03-101-2/+9
| | | | | | | | This commit implements the reading of stack spilled function arguments for little endian MIPS targets. Committed on behalf of: Dean De Leo <dean@codeplay.com> llvm-svn: 263131
* [Renderscript] Add stack argument reading code for MipselAidan Dodds2016-03-101-6/+17
| | | | | | | | This commit implements the reading of stack spilled function arguments for little endian MIPS targets. Committed on behalf of: Dean De Leo <dean@codeplay.com> llvm-svn: 263130
* [Renderscript] Explicitly set the language to evaluate allocationsAidan Dodds2016-03-101-1/+3
| | | | | | | | | | | | | | | | | | | | Currently it is not specified, and since allocations are usually requested once we hit a renderscript breakpoint, the language will be inferred being as renderscript by the ExpressionParser. Actually allocations attempt to invoke functions part of the RS runtime, written in C/C++, so evaluating the calls in RenderScript could be misleading. In particular, in MIPS, the ABI between C/C++ (mips o32) and renderscript (arm) might introduce subtle bugs when evaluating such expressions. This change explicitly sets the language used to evaluate the allocations as C++. Committed on behalf of: Dean De Leo <dean@codeplay.com> llvm-svn: 263129
* Add an "offset" option to "break set -n" and "break set -f -l". Jim Ingham2016-03-093-0/+3
| | | | | | | | | | | | That way you can set offset breakpoints that will move as the function they are contained in moves (which address breakpoints can't do...) I don't align the new address to instruction boundaries yet, so you have to get this right yourself for now. <rdar://problem/13365575> llvm-svn: 263049
* Add a set of new plugins to handle Java debuggingTamas Berghammer2016-02-264-0/+270
| | | | | | | | | The purpose of these plugins is to make LLDB capable of debugging java code JIT-ed by the android runtime. Differential revision: http://reviews.llvm.org/D17616 llvm-svn: 262015
* Fix all of the unannotated switch cases to annotate the fall through or do ↵Greg Clayton2016-02-261-4/+4
| | | | | | the right thing and break. llvm-svn: 261950
* [Renderscript] Change expression strings to use portable format specifiers.Aidan Dodds2016-02-241-22/+26
| | | | | | Mips64 tests were failing on windows because the sscanf implementation differs between clang/gcc/msvc such that on windows %lx specifies a 32bits parameter and %llx is for 64bits. For us this meant that 64bit pointers were being truncated to 32bits on their way into a JIT'd expression. llvm-svn: 261741
* RenderScript: silence some -Wmissing-brace warningsSaleem Abdulrasool2016-02-231-2/+2
| | | | | | Silence some -Wmissing-brace warnings on Linux with clang 3.7. llvm-svn: 261612
* [Renderscript] Refactor .rs.info parser.Aidan Dodds2016-02-181-52/+66
| | | | | | This patch refactors the .rs.info table parser so that its more in line with the current language runtime code. llvm-svn: 261202
* Apple simulator platforms don't have a shared cache to load Objective-C ↵Enrico Granata2016-02-171-8/+2
| | | | | | | | | | | class information from This code was doing the right thing for the iOS simulator, but not other simulator platforms Fix it by making the warning not happen for all platforms whose name ends in "-simulator" Since this code lives in AppleObjCRuntimeV2.cpp, this already only applies to Apple platforms by definition, so I am not too worried about conflicts with other vendors llvm-svn: 261165
* Silence some clang warningsSaleem Abdulrasool2016-02-151-13/+13
| | | | | | Silences -Wmissing-brace and -Wformat-pedantic warnings from clang on Linux. NFC. llvm-svn: 260914
* [Renderscript] Fix typo in mips64 argument reading code.Aidan Dodds2016-02-111-1/+1
| | | | | | A typo in the mips64 argument reading code would cause register passed arguments to be truncated to 32bits. llvm-svn: 260546
* [Renderscript] Refactor target argument reading code.Aidan Dodds2016-02-112-340/+463
| | | | | | This patch reworks the function argument reading code, allowing us to annotate arguments with their types. The type/size information is needed to correctly parse arguments passed on the stack. llvm-svn: 260525
* Now that SymbolFileDWARF supports having types in completely separate .pcm ↵Greg Clayton2016-02-102-0/+7
| | | | | | | | | | | | | | file with "-fmodules -gmodules", each SymbolFileDWARF can reference module DWARF info by looking in other DWARF files. Then if you have 1000 .o files that each reference one or more .pcm files in their debug info, a simple Module::FindTypes(...) call can end up searching the same .pcm file over and over and over. Now all internal FindTypes methods in classes (ModuleList, Module, SymbolFile) now take an extra argument: llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files Each time a SymbolFile::FindTypes() is called, it needs to check the searched_symbol_files list to make sure it hasn't already been asked to find the type and return immediately if it has been checked. This will stop circular dependencies from also crashing LLDB during type queries. This has proven to be an issue when debugging large applications on MacOSX that use DWARF in .o files. <rdar://problem/24581488> llvm-svn: 260434
OpenPOWER on IntegriCloud