(startAddr: number, endAddr: number)
| 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;) { |
no test coverage detected