summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [RenderScript] reflow/reword some comments and normalize namesLuke Drummond2016-10-051-544/+488
| | | | | | | | | | | | Pay more attention to comment alignement (Since _The Great Reformat_ (a015ff50) comments are no longer properly aligned) and variable naming conventions. - Manually reflow and cleanup comments and array literals - Be more economical with our naming conventions - Be internally consistent with regard to local variable/member function naming llvm-svn: 283335
* cleanup RSCoordinate handling and factor out coordinate parserLuke Drummond2016-10-051-123/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - This change updates the signature of `RenderScriptRuntime::PlaceBreakpointOnKernel` to take a default RSCoordinate pointer of nullptr. We use this as the predicate value for the breakpoint coordinate rather than trying to fit a sentinel `-1` into a signed version. ``` - void - PlaceBreakpointOnKernel(Stream &strm, const char *name, const std::array<int, 3> coords, Error &error, - lldb::TargetSP target); ``` ``` + bool + PlaceBreakpointOnKernel(lldb::TargetSP target, Stream &messages, const char *name, + const lldb_renderscript::RSCoordinate *coords = nullptr); ``` The above change makes the API for setting breakpoints on kernels cleaner as it returns a failure value rather than modify a sentinel in the caller. The optional arguments are now last and have a default (falsey) value. - RSCoordinate objects are now comparable with operator== and have zero initializers which should make them easier to work on. - Added a `FMT_COORD` macro for use in logging format strings which should make format strings a little less verbose. llvm-svn: 283320
* Try to fix build errors on Android.Zachary Turner2016-09-221-3/+3
| | | | | | | It doesn't like the implicit conversion from T[] to ArrayRef<T> so I'm using `llvm::makeArrayRef()`. Hopefully I got everything. llvm-svn: 282195
* Convert option tables to ArrayRefs.Zachary Turner2016-09-221-30/+27
| | | | | | | | | | | | | | | | | | | | | | | | | This change is very mechanical. All it does is change the signature of `Options::GetDefinitions()` and `OptionGroup:: GetDefinitions()` to return an `ArrayRef<OptionDefinition>` instead of a `const OptionDefinition *`. In the case of the former, it deletes the sentinel entry from every table, and in the case of the latter, it removes the `GetNumDefinitions()` method from the interface. These are no longer necessary as `ArrayRef` carries its own length. In the former case, iteration was done by using a sentinel entry, so there was no knowledge of length. Because of this the individual option tables were allowed to be defined below the corresponding class (after all, only a pointer was needed). Now, however, the length must be known at compile time to construct the `ArrayRef`, and as a result it is necessary to move every option table before its corresponding class. This results in this CL looking very big, but in terms of substance there is not much here. Differential revision: https://reviews.llvm.org/D24834 llvm-svn: 282188
* Make lldb::Regex use StringRef.Zachary Turner2016-09-211-8/+10
| | | | | | | | | | This updates getters and setters to use StringRef instead of const char *. I tested the build on Linux, Windows, and OSX and saw no build or test failures. I cannot test any BSD or Android variants, however I expect the required changes to be minimal or non-existant. llvm-svn: 282079
* [RenderScript] Support tracking and dumping reduction kernelsLuke Drummond2016-09-161-57/+209
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Initial implementation of support for tracking [RenderScript Reductions](https://developer.android.com/guide/topics/renderscript/compute.html#reduction-in-depth) With this patch, `language renderscript module dump` properly lists reductions that are part of loaded RenderScript modules as well the the consituent functions and their roles, within the reduction. This support required new tracking mechanisms for the `#pragma(reduce)` mechanism, and extension of `RSModuleDescriptor::ParseRSInfo` to support the metadata output by `bcc`. This work was also an opportunity to refactor/improve parse code: - `RSModuleDescriptor::ParseExportReduceCount` now has a complete implementation and the debugger can correctly track reductions on receipt of a module hook. - `RSModuleDescriptor::Dump` now dumps Reductions as well as `ForEach` kernels. Also, fixed indentation of the output, and made indentation groupings in the source clearer. - `RSModuleDescriptor::ParseRSInfo` now returns true if the `".rs.info"` packet has nonzero linecount, rather than rejecting RenderScripts that don't contain kernels (an unlikely situation, but possibly valid). This was changed because scripts that only contained reductions were not being tracked in `RenderScriptRuntime::LoadModule`. - Refactor `RSModuleInfo::ParseRSInfo` and add reduction spec parser stub - Prepared ParseRSInfo to more easily be able to add new parser types - Use llvm::StringRef and llvm::StringMap helpers to make the parsing code cleaner - factor out forEachCount, globalVarCount, and pragmaCount parsing block to their own methods - Add ExportReduceCount Parser - Use `llvm::StringRef` in `RSKernelDescriptor` constructor - removed now superfluous `MAXLINE` macros as we've switched from `const char *` to `llvm::StringRef` llvm-svn: 281717
* *** This commit represents a complete reformatting of the LLDB source codeKate Stone2016-09-061-3726/+3613
| | | | | | | | | | | | | | | | | | | | | | | *** 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
* Decoupled Options from CommandInterpreter.Todd Fiala2016-08-111-12/+15
| | | | | | | | | | | | | | | | 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
* [RenderScript] Always create a new allocation ID in CaptureAllocationInit hookLuke Drummond2016-08-031-9/+33
| | | | | | | | | | | | | | | | 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
* Add IR fixups for RenderScript ABI mismatch between ARMV7 frontend and x86 ↵Luke Drummond2016-07-281-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* 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-141-6/+6
| | | | | | | | | 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
* second pass over removal of Mutex and ConditionSaleem Abdulrasool2016-05-191-1/+1
| | | | llvm-svn: 270024
* Revert r268591Enrico Granata2016-05-051-7/+3
| | | | | | | | | | | | | | "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-051-3/+7
| | | | | | | | | | | | 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
* Get rid of two global constructors by making things static variables in the ↵Greg Clayton2016-03-241-7/+8
| | | | | | only function that uses these variables. llvm-svn: 264347
* [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
* 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
* 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-111-337/+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
* [RenderScript] Refactor allocation expressions Ewan Crawford2016-02-101-77/+85
| | | | | | | Patch refractors RS plugin code specifying how format strings are used to JIT the runtime. Author: Dean De Leo <dean@codeplay.com> llvm-svn: 260372
* Fix an issue where certain CommandObjects (or Options thereof) were being ↵Enrico Granata2016-02-061-6/+1
| | | | | | | | | | created once, bound to a specific CommandInterpreter (and hence a specific Debugger), and then cached for reuse across different Debugger instances Obviously, if the original Debugger goes away, those commands are holding on to now stale memory, which has the potential to cause crashes Fixes rdar://24460882 llvm-svn: 259964
* [RenderScript] Add command for recalculating allocation detailsEwan Crawford2016-02-041-0/+58
| | | | | | | | Patch replaces the --refresh flag removed in r258800 with it's own command, 'language renderscript allocation refresh'. Since there is no reason this functionality should be tied to another command as an option. The command itself simply re-JITs all our cached information about allocations. llvm-svn: 259773
* [RenderScript] Remove unused RS commandEwan Crawford2016-01-291-52/+2
| | | | | | | | | | Patch deletes the 'language renderscript module probe' command. This command was present in the initial commit to help debug the plugin. However we haven't used it recently and it's functionality is unclear, so can be removed entirely. Also add back 'kernel coordinate' command, removed by accident in clang format patch r259056. llvm-svn: 259181
* [Renderscript] Clang-format the renderscript plugin.Aidan Dodds2016-01-281-651/+654
| | | | | | Run clang-format over the renderscript plugin and fix common formatting deviations. llvm-svn: 259056
* [RenderScript] Provide option to specify a single allocation to printEwan Crawford2016-01-261-21/+21
| | | | | | | | Patch replaces the 'renderscript allocation list' command flag --refresh, with a new option --id <ID>. This new option only prints the details of a single allocation with a given id, rather than printing all the allocations. Functionality from the removed '--refresh' flag will be moved into its own command in a subsequent commit. llvm-svn: 258800
* Fix clang warning in RenderScriptRuntimePavel Labath2016-01-201-1/+1
| | | | | | | | std::array should have "the same semantics as a struct holding a C-style array T[N] as its only non-static data member", so the initialization should have one more level of braces. Hopefully, no compiler will object to that. llvm-svn: 258306
* [RenderScript] New command for viewing coordinate of current kernel invocationEwan Crawford2016-01-201-34/+131
| | | | | | | Patch adds command 'language renderscript kernel coordinate' for printing the kernel index in (x,y,z) format. This is done by walking the call stack and looking for a function with suffix '.expand', as well as the frame variables containing the coordinate data. llvm-svn: 258303
* [RenderScript] Remove mips specific expressionsEwan Crawford2016-01-181-160/+90
| | | | | | | | Reverts earlier commit r254910, which used function pointers for jitted expressions to avoid a Mips64 compiler bug. Bug has since been fixed, and compiler longer issues the problem instruction. Author: Dean De Leo <dean@codeplay.com> llvm-svn: 258038
* [RenderScript] Hook kernel invocation.Aidan Dodds2016-01-141-17/+114
| | | | | | This patch adds a hook to track kernel invocations and to track all script and allocation objects used. llvm-svn: 257772
* [RenderScript] Improve file format for saving RS allocationsEwan Crawford2016-01-071-29/+151
| | | | | | | | | | | Updates the file format for storing RS allocations to a file, so that the format now supports struct element types. The file header will now contain a subheader for every RS element and it's descendants. Where an element subheader contains element type details and offsets to the subheaders of that elements fields. Patch also improves robustness when loading incorrect files. llvm-svn: 257045
* [Renderscript] Fix stack argument inspection.Aidan Dodds2016-01-061-43/+42
| | | | | | | Function arguments that were spilled and passed on the stack were incorrectly read. The value was written back into the output pointer rather then the memory being pointed to. llvm-svn: 256941
* Revert r256769Ewan Crawford2016-01-051-1/+1
| | | | | | | | | Reverts "Use correct format identifiers to print something meaningful." Original format specifiers were correct. Instead use void* casts to remove warnings, since this is what the %p specifier expects. llvm-svn: 256833
* Use correct format identifiers to print something meaningful.Davide Italiano2016-01-041-1/+1
| | | | llvm-svn: 256769
* [RenderScript] Support all RS allocation types Ewan Crawford2015-12-171-18/+100
| | | | | | | | Currently we can just inspect the details of the most common allocation types. This patch allows us to support all the types defined by the RS runtime in its `RsDataType` enum. Including handlers, matrices and packed graphical data. llvm-svn: 255904
* [RenderScript] Support for amd64 RS hooksEwan Crawford2015-12-111-9/+54
| | | | | | | Adds support for reading a maximum of six integer arguments from a renderscript hook on X86_64. Author: Luke Drummond <luke.drummond@codeplay.com> llvm-svn: 255338
* [RenderScript] Refactor condition deciding when to JIT RS runtimeEwan Crawford2015-12-101-9/+19
| | | | | | | Patch creates a member function that decides when to JIT all the details about an allocation. By checking for zero pointers we can avoid the situation where we store uninitialised data from previously inspecting the allocation during creation. llvm-svn: 255238
* [RenderScript] Add hook for destroyed allocationsEwan Crawford2015-12-091-1/+45
| | | | | | | New hook for rsdAllocationDestroy() which is called when allocations are deleted. LLDB should be aware of this so we can remove the allocation from our internal list. llvm-svn: 255121
* [RenderScript] Mips64 allocations workaroundEwan Crawford2015-12-071-90/+160
| | | | | | | | | Workaround for Mips64 compiler bug by using function pointers to call functions for expression evaluation. This avoids the emission of the JAL instruction, which can only jump within a particular range of the PC. Author: Dean De Leo, dean@codeplay.com llvm-svn: 254910
* Fix hang in global static initializationAdrian McCarthy2015-11-301-4/+10
| | | | | | Differential Revision: http://reviews.llvm.org/D15092 llvm-svn: 254338
* [RS] Support RenderScript struct allocationsEwan Crawford2015-11-301-113/+402
| | | | | | | | | | | | This patch adds functionality for dumping allocations of struct elements. This involves: + Jitting the runtime for details on all the struct fields. + Finding the name of the struct type by looking for a global variable of the same type, which will have been reflected back to the java host code. + Using this struct type name to pass into expression evaluation for pretty printing the data for the dump command. llvm-svn: 254294
* Allow renderscript runtime to read MIPS target arguments.Aidan Dodds2015-11-121-1/+41
| | | | llvm-svn: 252914
* Explicitly cast size_t var to (uint64_t) when printf format is PRIx64.Jason Molenda2015-10-291-2/+2
| | | | llvm-svn: 251585
OpenPOWER on IntegriCloud