MCPcopy Create free account
hub / github.com/GJDuck/e9patch / findLine

Method findLine

src/e9tool/e9dwarf.cpp:162–177  ·  view source on GitHub ↗

* Find the line associated with the given address. */

Source from the content-addressed store, hash-verified

160 * Find the line associated with the given address.
161 */
162extern const Line *e9tool::findLine(const Lines &Ls, intptr_t addr)
163{
164 auto i = Ls.lower_bound(addr);
165 if (i == Ls.end())
166 return nullptr;
167 if (i->second.lb == addr)
168 return &i->second;
169 auto j = Ls.begin();
170 if (i == j)
171 return nullptr;
172 i--;
173 if (i->second.lb <= addr && addr < i->second.ub)
174 return &i->second;
175 else
176 return nullptr;
177}
178

Callers

nothing calls this directly

Calls 3

lower_boundMethod · 0.80
beginMethod · 0.80
endMethod · 0.45

Tested by

no test coverage detected