summaryrefslogtreecommitdiff
path: root/debuginfo.cpp
diff options
context:
space:
mode:
authorKyleMiles <krm504@nyu.edu>2023-04-22 12:00:38 -0400
committerKyleMiles <krm504@nyu.edu>2023-05-08 15:27:58 -0400
commit99c7a280ae771073b6a36e958426d6f2c7d29462 (patch)
tree02c2f8164c657f5bc24a88a99acdc7fac29e5d93 /debuginfo.cpp
parent2693da23c708d454d3fbed93326ed319dc2d082a (diff)
Pass debug file along with original file to debug info parsers
Diffstat (limited to 'debuginfo.cpp')
-rw-r--r--debuginfo.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/debuginfo.cpp b/debuginfo.cpp
index c2079824..5f4e1af0 100644
--- a/debuginfo.cpp
+++ b/debuginfo.cpp
@@ -355,7 +355,8 @@ string DebugInfoParser::GetName() const
}
-Ref<DebugInfo> DebugInfoParser::Parse(Ref<BinaryView> view, Ref<DebugInfo> existingDebugInfo, std::function<bool(size_t, size_t)> progress) const
+Ref<DebugInfo> DebugInfoParser::Parse(Ref<BinaryView> view, Ref<BinaryView> debugFile, Ref<DebugInfo> existingDebugInfo,
+ std::function<bool(size_t, size_t)> progress) const
{
ProgressContext ctxt;
if (progress)
@@ -366,14 +367,15 @@ Ref<DebugInfo> DebugInfoParser::Parse(Ref<BinaryView> view, Ref<DebugInfo> exist
BNDebugInfo* info = nullptr;
if (existingDebugInfo)
{
- info = BNParseDebugInfo(m_object, view->GetObject(), existingDebugInfo->GetObject(), ProgressCallback, &ctxt);
+ info = BNParseDebugInfo(m_object, view->GetObject(), debugFile->GetObject(), existingDebugInfo->GetObject(),
+ ProgressCallback, &ctxt);
if (!info)
return nullptr;
info = BNNewDebugInfoReference(info);
}
else
{
- info = BNParseDebugInfo(m_object, view->GetObject(), nullptr, ProgressCallback, &ctxt);
+ info = BNParseDebugInfo(m_object, view->GetObject(), debugFile->GetObject(), nullptr, ProgressCallback, &ctxt);
if (!info)
return nullptr;
}
@@ -399,12 +401,12 @@ bool CustomDebugInfoParser::IsValidCallback(void* ctxt, BNBinaryView* view)
}
-bool CustomDebugInfoParser::ParseCallback(void* ctxt, BNDebugInfo* debugInfo, BNBinaryView* view, bool (*progress)(void*, size_t, size_t), void* progressCtxt)
+bool CustomDebugInfoParser::ParseCallback(void* ctxt, BNDebugInfo* debugInfo, BNBinaryView* view,
+ BNBinaryView* debugFile, bool (*progress)(void*, size_t, size_t), void* progressCtxt)
{
CustomDebugInfoParser* parser = (CustomDebugInfoParser*)ctxt;
- return parser->ParseInfo(new DebugInfo(debugInfo), new BinaryView(view), [=](size_t cur, size_t max) {
- return progress(progressCtxt, cur, max);
- });
+ return parser->ParseInfo(new DebugInfo(debugInfo), new BinaryView(view), new BinaryView(debugFile),
+ [=](size_t cur, size_t max) { return progress(progressCtxt, cur, max); });
}