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

Method findInstrIndex

src/backend/disasm.ts:90–104  ·  view source on GitHub ↗
(address: number)

Source from the content-addressed store, hash-verified

88 }
89
90 public findInstrIndex(address: number): number {
91 const len = this.instructions.length;
92 for (let ix = 0; ix < len ; ix++ ) {
93 const instr = this.instructions[ix];
94 if (instr.pvtAddress === address) {
95 return ix;
96 } else if (instr.pvtIsData) {
97 const endAddr = instr.pvtAddress + ((instr.pvtInstructionBytes.length + 1) / 3);
98 if ((address >= instr.pvtAddress) && (address < endAddr)) {
99 return ix;
100 }
101 }
102 }
103 return -1;
104 }
105
106 public findNearbyLowerInstr(address: number, thresh: number): number {
107 const lowerAddress = Math.max(0, address - thresh);

Callers 2

doWorkMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected