Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions blutter/src/DartDumper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,12 @@ std::vector<std::pair<intptr_t, std::string>> DartDumper::DumpStructHeaderFile(s
if (unlinkTargetType == dart::ObjectPool::EntryType::kImmediate) {
const auto imm = pool.RawValueAt(i + 1);
auto dartFn = app.GetFunction(imm - app.base());
name = std::format("UnlinkedCall_{:#x}_{:#x}", offset, dartFn->Address(), offset);
if (dartFn) {
name = std::format("UnlinkedCall_{:#x}_{:#x}", offset, dartFn->Address());
}
else {
name = std::format("UnlinkedCall_{:#x}_{:#x}", offset, imm - app.base());
}
}
else {
ASSERT(unlinkTargetType == dart::ObjectPool::EntryType::kTaggedObject);
Expand Down Expand Up @@ -486,7 +491,11 @@ std::string DartDumper::ObjectToString(dart::Object& obj, bool simpleForm, bool
return "SubtypeTestCache";
case dart::kFunctionCid: {
// stub never be in Object Pool
auto dartFn = app.GetFunction(dart::Function::Cast(obj).entry_point() - app.base())->AsFunction();
auto fnBase = app.GetFunction(dart::Function::Cast(obj).entry_point() - app.base());
if (!fnBase) {
return std::format("Function({:#x})", dart::Function::Cast(obj).entry_point() - app.base());
}
auto dartFn = fnBase->AsFunction();
if (dartFn->IsClosure()) {
auto parentFn = dartFn->GetOutermostFunction();
if (parentFn) {
Expand Down Expand Up @@ -803,7 +812,12 @@ std::string DartDumper::getPoolObjectDescription(intptr_t offset, bool simpleFor
if (unlinkTargetType == dart::ObjectPool::EntryType::kImmediate) {
const auto imm = pool.RawValueAt(idx + 1);
auto dartFn = app.GetFunction(imm - app.base());
return std::format("[pp+{:#x}] UnlinkedCall: {:#x} - {}", offset, dartFn->Address(), dartFn->FullName().c_str());
if (dartFn) {
return std::format("[pp+{:#x}] UnlinkedCall: {:#x} - {}", offset, dartFn->Address(), dartFn->FullName().c_str());
}
else {
return std::format("[pp+{:#x}] UnlinkedCall: {:#x} - [unknown]", offset, imm - app.base());
}
}
else {
ASSERT(unlinkTargetType == dart::ObjectPool::EntryType::kTaggedObject);
Expand Down