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

Method getDisassemblyForAddresses

src/backend/disasm.ts:992–1015  ·  view source on GitHub ↗
(startAddress: number, length: number)

Source from the content-addressed store, hash-verified

990 }
991
992 private async getDisassemblyForAddresses(startAddress: number, length: number): Promise<DisassemblyInstruction[]> {
993 const endAddress = startAddress + length;
994
995 // tslint:disable-next-line:max-line-length
996 const result = await this.miDebugger.sendCommand(`data-disassemble -s ${hexFormat(startAddress)} -e ${hexFormat(endAddress)} -- 2`);
997 const rawInstructions = result.result('asm_insns');
998 const instructions: DisassemblyInstruction[] = rawInstructions.map((ri) => {
999 const address = MINode.valueOf(ri, 'address');
1000 const functionName = MINode.valueOf(ri, 'func-name');
1001 const offset = parseInt(MINode.valueOf(ri, 'offset'));
1002 const inst = MINode.valueOf(ri, 'inst');
1003 const opcodes = MINode.valueOf(ri, 'opcodes');
1004
1005 return {
1006 address: address,
1007 functionName: functionName,
1008 offset: offset,
1009 instruction: inst,
1010 opcodes: opcodes
1011 };
1012 });
1013
1014 return instructions;
1015 }
1016}

Callers 1

Calls 4

hexFormatFunction · 0.90
sendCommandMethod · 0.80
resultMethod · 0.80
valueOfMethod · 0.80

Tested by

no test coverage detected