(response: DebugProtocol.Response, startAddress: string, length: number)
| 1270 | } |
| 1271 | |
| 1272 | protected readMemoryRequestCustom(response: DebugProtocol.Response, startAddress: string, length: number) { |
| 1273 | this.miDebugger.sendCommand(`data-read-memory-bytes "${startAddress}" ${length}`).then((node) => { |
| 1274 | const results = parseReadMemResults(node); |
| 1275 | // const bytes = results.data.match(/[0-9a-f]{2}/g).map((b) => parseInt(b, 16)); |
| 1276 | const bytes = []; |
| 1277 | const numBytes = results.data.length / 2; |
| 1278 | const data = results.data; |
| 1279 | for (let ix = 0, dx = 0; ix < numBytes; ix++, dx += 2) { |
| 1280 | const tmp = data[dx] + data[dx + 1]; |
| 1281 | bytes.push(twoCharsToIntMap[tmp]); |
| 1282 | } |
| 1283 | response.body = { |
| 1284 | startAddress: results.startAddress, |
| 1285 | endAddress: results.endAddress, |
| 1286 | bytes: bytes |
| 1287 | }; |
| 1288 | this.sendResponse(response); |
| 1289 | }, (error) => { |
| 1290 | response.body = { error: error }; |
| 1291 | this.sendErrorResponse(response, 114, `Read memory error: ${error.toString()}`); |
| 1292 | this.sendEvent(new TelemetryEvent('Error', 'Reading Memory', `${startAddress}-${length.toString(16)}`)); |
| 1293 | }); |
| 1294 | } |
| 1295 | |
| 1296 | protected writeMemoryRequestCustom(response: DebugProtocol.Response, startAddress: number, data: string) { |
| 1297 | const address = hexFormat(startAddress, 8); |
no test coverage detected