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

Method processPacket

src/frontend/swo/core.ts:355–379  ·  view source on GitHub ↗
(packet: Packet)

Source from the content-addressed store, hash-verified

353 }
354
355 private processPacket(packet: Packet) {
356 if (packet.type === PacketType.SOFTWARE) {
357 this.processors.forEach((p) => p.softwareEvent(packet));
358 }
359 else if (packet.type === PacketType.HARDWARE) {
360 this.processors.forEach((p) => p.hardwareEvent(packet));
361 if (packet.port === 2) {
362 if (this.webview) {
363 const pc = parseUnsigned(packet.data);
364 const symbol = this.getFunctionAtAddress(pc);
365
366 const message: GrapherProgramCounterMessage = {
367 type: 'program-counter',
368 counter: pc,
369 function: symbol ? symbol.name : '**Unknown**'
370 };
371 this.webview.sendMessage(message);
372 }
373 }
374 else {
375 // tslint:disable-next-line:no-console
376 console.log('Received Other Hardware Packet: ', packet);
377 }
378 }
379 }
380
381 private processTimestampPacket(packet: Packet) {
382 let timestamp = 0;

Callers

nothing calls this directly

Calls 6

getFunctionAtAddressMethod · 0.95
parseUnsignedFunction · 0.90
sendMessageMethod · 0.80
logMethod · 0.80
softwareEventMethod · 0.65
hardwareEventMethod · 0.65

Tested by

no test coverage detected