Refactoring the DescribeAddressIfStack function in asan_report.cc to be able to reuse it for http://reviews.llvm.org/D4527. The plan is to use the newly extracted functions in this manner:
const char *frame_descr = t->GetFrameNameByAddr(addr, &offset, &frame_pc);
InternalMmapVector <StackVarDescr> vars(16);
ParseFrameDescription(frame_descr, vars);
for (uptr i = 0; i < vars.size(); i++) {
... do stuff ...
}
Consider the following interface instead:
Note that I passed "vars" by pointer here - we generally don't use non-const references as output parameters in sanitizer runtimes.