summaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h
diff options
context:
space:
mode:
authorLuke Drummond <luke.drummond@codeplay.com>2016-10-05 14:34:52 +0000
committerLuke Drummond <luke.drummond@codeplay.com>2016-10-05 14:34:52 +0000
commit00f56eebcd83eaf6d1936ece7c4ddfe860aa12d6 (patch)
tree2c99cf6152ea49c4addf73645b1b5860555591af /lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h
parent0670e5a35b6fce093c502318991dd55ba000b225 (diff)
cleanup RSCoordinate handling and factor out coordinate parser
- 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
Diffstat (limited to 'lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h')
-rw-r--r--lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h21
1 files changed, 16 insertions, 5 deletions
diff --git a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h
index c19835d6bfb7..bd0c8d89aa7f 100644
--- a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h
+++ b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h
@@ -40,7 +40,15 @@ struct RSReductionDescriptor;
typedef std::shared_ptr<RSModuleDescriptor> RSModuleDescriptorSP;
typedef std::shared_ptr<RSGlobalDescriptor> RSGlobalDescriptorSP;
typedef std::shared_ptr<RSKernelDescriptor> RSKernelDescriptorSP;
-typedef std::array<uint32_t, 3> RSCoordinate;
+struct RSCoordinate {
+ uint32_t x, y, z;
+
+ RSCoordinate() : x(), y(), z(){};
+
+ bool operator==(const lldb_renderscript::RSCoordinate &rhs) {
+ return x == rhs.x && y == rhs.y && z == rhs.z;
+ }
+};
// Breakpoint Resolvers decide where a breakpoint is placed,
// so having our own allows us to limit the search scope to RS kernel modules.
@@ -235,9 +243,9 @@ public:
bool RecomputeAllAllocations(Stream &strm, StackFrame *frame_ptr);
- 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);
void SetBreakAllKernels(bool do_break, lldb::TargetSP target);
@@ -322,7 +330,8 @@ protected:
std::map<lldb::addr_t, lldb_renderscript::RSModuleDescriptorSP>
m_scriptMappings;
std::map<lldb::addr_t, RuntimeHookSP> m_runtimeHooks;
- std::map<lldb::user_id_t, std::shared_ptr<uint32_t>> m_conditional_breaks;
+ std::map<lldb::user_id_t, std::unique_ptr<lldb_renderscript::RSCoordinate>>
+ m_conditional_breaks;
lldb::SearchFilterSP
m_filtersp; // Needed to create breakpoints through Target API
@@ -376,6 +385,8 @@ private:
size_t CalculateElementHeaderSize(const Element &elem);
+ void SetConditional(lldb::BreakpointSP bp, lldb_private::Stream &messages,
+ const lldb_renderscript::RSCoordinate &coord);
//
// Helper functions for jitting the runtime
//