| Date: | Thu, 01 Oct 2015 15:35:19 -0500 |
|---|---|
| From: | Bill Williams <bill@xxxxxxxxxxx> |
| Subject: | Re: [DynInst_API:] Not getting sources lines question: getSourceLines API |
Jim, one orthogonal follow-up question:Is there a reason you're going image->module and then iterating over all modules, rather than asking all of these questions at the image level? And if you do that, does that fix the line information problem? Rough pseudocode, omitting a ton of variable declarations and error checking:
getLoopInfo(Address a, BPatch_image* i)
{
i->findFunction(a, funcs);
foreach(f in funcs)
{
CFG = f->getCFG();
CFG->getLoops(loops);
foreach(L in loops)
{
if(a is in L)
{
L->getLoopEntries(entries);
if(entries.size > 1)
{
foreach(e in entries)
{
i->getSourceLines(e.startAddr, lineInfo);
}
}
}
}
}
}
That will be no less efficient (probably moreso) and will ensure that
any glitches between symtab module and BPatch module scopes don't
interfere with the retrieval of line info.
--bw |
| [← Prev in Thread] | Current Thread | [Next in Thread→] |
|---|---|---|
| ||
| Previous by Date: | Re: [DynInst_API:] Not getting sources lines question: getSourceLines API, Bill Williams |
|---|---|
| Next by Date: | Re: [DynInst_API:] BPatch_dynamicTargetExpr on return statements, Marc Brünink |
| Previous by Thread: | Re: [DynInst_API:] Not getting sources lines question: getSourceLines API, Bill Williams |
| Next by Thread: | [DynInst_API:] [PATCH 1/2] common: rewrite caching in Linux P_cplus_demangle(), Josh Stone |
| Indexes: | [Date] [Thread] |