Commit bb4045bc by Ben Clayton

Vulkan/Debug: Add File::getBreakpoints()

Simple accessor for the breakpoint set. Bug: b/145351270 Change-Id: Ifb534482009b5842d8bd2a796c082625b770e298 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/48691 Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: 's avatarAntonio Maiorano <amaiorano@google.com> Tested-by: 's avatarBen Clayton <bclayton@google.com>
parent aa58f0cf
...@@ -16,8 +16,6 @@ ...@@ -16,8 +16,6 @@
#include "marl/mutex.h" #include "marl/mutex.h"
#include <unordered_set>
namespace { namespace {
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
...@@ -29,6 +27,7 @@ public: ...@@ -29,6 +27,7 @@ public:
void clearBreakpoints() override; void clearBreakpoints() override;
void addBreakpoint(int line) override; void addBreakpoint(int line) override;
bool hasBreakpoint(int line) const override; bool hasBreakpoint(int line) const override;
std::unordered_set<int> getBreakpoints() const override;
protected: protected:
FileBase(ID id, std::string dir, std::string name, std::string source); FileBase(ID id, std::string dir, std::string name, std::string source);
...@@ -60,6 +59,12 @@ bool FileBase::hasBreakpoint(int line) const ...@@ -60,6 +59,12 @@ bool FileBase::hasBreakpoint(int line) const
return breakpoints.count(line) > 0; return breakpoints.count(line) > 0;
} }
std::unordered_set<int> FileBase::getBreakpoints() const
{
marl::lock lock(breakpointMutex);
return breakpoints;
}
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// VirtualFile // VirtualFile
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
...@@ -129,4 +134,4 @@ std::shared_ptr<File> File::createPhysical(ID id, std::string path) ...@@ -129,4 +134,4 @@ std::shared_ptr<File> File::createPhysical(ID id, std::string path)
} }
} // namespace dbg } // namespace dbg
} // namespace vk } // namespace vk
\ No newline at end of file
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <memory> #include <memory>
#include <string> #include <string>
#include <unordered_set>
namespace vk { namespace vk {
namespace dbg { namespace dbg {
...@@ -51,6 +52,9 @@ public: ...@@ -51,6 +52,9 @@ public:
// line with the given index. // line with the given index.
virtual bool hasBreakpoint(int line) const = 0; virtual bool hasBreakpoint(int line) const = 0;
// getBreakpoints() returns all the breakpoints set in the file.
virtual std::unordered_set<int> getBreakpoints() const = 0;
// isVirtual() returns true iff the file is not backed by the filesystem. // isVirtual() returns true iff the file is not backed by the filesystem.
virtual bool isVirtual() const = 0; virtual bool isVirtual() const = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment