diff options
| author | Glenn Smith <glenn@vector35.com> | 2022-09-26 17:07:52 -0400 |
|---|---|---|
| committer | Glenn Smith <glenn@vector35.com> | 2022-09-29 21:02:25 -0400 |
| commit | 571d4ed2f01c1117237b1a9684ad9b1d1ad8963a (patch) | |
| tree | d63530c2510fc123496e7550625e7ebfc8c594f5 /binaryninjaapi.h | |
| parent | b6442a914783cb2861ff8d1cd6a3865fed29e0f7 (diff) | |
DebugInfo: make parseInfo have a progress callback
This will enable us to have progress bars and cancellation of debuginfo application
Diffstat (limited to 'binaryninjaapi.h')
| -rw-r--r-- | binaryninjaapi.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/binaryninjaapi.h b/binaryninjaapi.h index 3d29520f..70f8d45b 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -1112,6 +1112,13 @@ namespace BinaryNinja { std::function<bool(size_t, size_t)> SplitProgress( std::function<bool(size_t, size_t)> originalFn, size_t subpart, std::vector<double> subpartWeights); + struct ProgressContext + { + std::function<bool(size_t, size_t)> callback; + }; + + bool ProgressCallback(void* ctxt, size_t current, size_t total); + std::string GetUniqueIdentifierString(); std::map<std::string, uint64_t> GetMemoryUsageInfo(); @@ -11984,7 +11991,7 @@ namespace BinaryNinja { static std::vector<Ref<DebugInfoParser>> GetListForView(const Ref<BinaryView> data); std::string GetName() const; - Ref<DebugInfo> Parse(Ref<BinaryView> view, Ref<DebugInfo> existingDebugInfo = nullptr) const; + Ref<DebugInfo> Parse(Ref<BinaryView> view, Ref<DebugInfo> existingDebugInfo = nullptr, std::function<bool(size_t, size_t)> progress = {}) const; bool IsValidForView(const Ref<BinaryView> view) const; }; @@ -11992,7 +11999,7 @@ namespace BinaryNinja { class CustomDebugInfoParser : public DebugInfoParser { static bool IsValidCallback(void* ctxt, BNBinaryView* view); - static bool ParseCallback(void* ctxt, BNDebugInfo* debugInfo, BNBinaryView* view); + static bool ParseCallback(void* ctxt, BNDebugInfo* debugInfo, BNBinaryView* view, bool (*progress)(void*, size_t, size_t), void* progressCtxt); BNDebugInfoParser* Register(const std::string& name); public: @@ -12000,7 +12007,7 @@ namespace BinaryNinja { virtual ~CustomDebugInfoParser() {} virtual bool IsValid(Ref<BinaryView>) = 0; - virtual bool ParseInfo(Ref<DebugInfo>, Ref<BinaryView>) = 0; + virtual bool ParseInfo(Ref<DebugInfo>, Ref<BinaryView>, std::function<bool(size_t, size_t)>) = 0; }; /*! |
