MCPcopy Create free account
hub / github.com/Marus/cortex-debug / findInCache

Method findInCache

src/backend/disasm.ts:563–575  ·  view source on GitHub ↗
(startAddr: number, endAddr: number)

Source from the content-addressed store, hash-verified

561 }
562
563 private findInCache(startAddr: number, endAddr: number): InstructionRange {
564 for (const old of this.cache) {
565 if (old.isInsideRange(startAddr, endAddr)) {
566 if (GdbDisassembler.debug) {
567 console.log('Instruction cache hit: ',
568 {startAddr: hexFormat(startAddr), endAddr: hexFormat(endAddr)}, old);
569 }
570 return old;
571 }
572 }
573 // TODO: We should also look for things that are partially overlapping and adjust for the start/end lookups
574 return null;
575 }
576
577 private addToCache(arg: InstructionRange) {
578 for (let ix = 0; ix < this.cache.length;) {

Callers 1

doWorkMethod · 0.95

Calls 3

hexFormatFunction · 0.90
isInsideRangeMethod · 0.80
logMethod · 0.80

Tested by

no test coverage detected