From 94649dde0d847aa2407d565632f7d2c3cdff32f5 Mon Sep 17 00:00:00 2001 From: rose <47357290+rose4096@users.noreply.github.com> Date: Thu, 9 Jun 2022 17:06:30 -0400 Subject: Add `IsExternal` callback to debug info API --- debuginfo.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'debuginfo.cpp') diff --git a/debuginfo.cpp b/debuginfo.cpp index e8450399..59636d4a 100644 --- a/debuginfo.cpp +++ b/debuginfo.cpp @@ -222,6 +222,12 @@ Ref DebugInfoParser::Parse(Ref view, Ref exist } +bool DebugInfoParser::IsExternal() const +{ + return BNIsDebugInfoParserExternal(m_object); +} + + bool DebugInfoParser::IsValidForView(const Ref view) const { return BNIsDebugInfoParserValidForView(m_object, view->GetObject()); @@ -232,6 +238,12 @@ bool DebugInfoParser::IsValidForView(const Ref view) const // Plugin registration APIs // ////////////////////////////// +bool CustomDebugInfoParser::IsExternalCallback(void* ctxt) +{ + CustomDebugInfoParser* parser = (CustomDebugInfoParser*)ctxt; + return parser->IsExternal(); +} + bool CustomDebugInfoParser::IsValidCallback(void* ctxt, BNBinaryView* view) { @@ -249,5 +261,5 @@ void CustomDebugInfoParser::ParseCallback(void* ctxt, BNDebugInfo* debugInfo, BN CustomDebugInfoParser::CustomDebugInfoParser(const string& name) : DebugInfoParser( - BNNewDebugInfoParserReference(BNRegisterDebugInfoParser(name.c_str(), IsValidCallback, ParseCallback, this))) + BNNewDebugInfoParserReference(BNRegisterDebugInfoParser(name.c_str(), IsExternalCallback, IsValidCallback, ParseCallback, this))) {} -- cgit v1.3.1