MCPcopy Create free account
hub / github.com/compiler-explorer/compiler-explorer / getSymbolBefore

Method getSymbolBefore

lib/mapfiles/map-file.ts:262–279  ·  view source on GitHub ↗
(segment: string, address: number)

Source from the content-addressed store, hash-verified

260 }
261
262 getSymbolBefore(segment: string, address: number): Segment | undefined {
263 let maxNamed: Segment | undefined;
264
265 for (let idx = 0; idx < this.namedAddresses.length; idx++) {
266 const info = this.namedAddresses[idx];
267 if (!segment && info.addressInt <= address) {
268 if (!maxNamed || info.addressInt > maxNamed.addressInt) {
269 maxNamed = info;
270 }
271 } else if (segment === info.segment && info.addressWithoutOffset <= address) {
272 if (!maxNamed || info.addressInt > maxNamed.addressInt) {
273 maxNamed = info;
274 }
275 }
276 }
277
278 return maxNamed;
279 }
280
281 getSymbolInfoByName(name: string): Segment | undefined {
282 for (let idx = 0; idx < this.namedAddresses.length; idx++) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected