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

Class JLinkServerController

src/jlink.ts:10–227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8const EXECUTABLE_NAMES = ['JLinkGDBServerCLExe', 'JLinkGDBServerCL', 'JLinkGDBServer'];
9
10export class JLinkServerController extends EventEmitter implements GDBServerController {
11 public portsNeeded: string[] = ['gdbPort', 'swoPort', 'consolePort'];
12 public name: 'J-Link';
13
14 private args: ConfigurationArguments;
15 private ports: { [name: string]: number };
16 private rttHelper: RTTServerHelper = new RTTServerHelper();
17
18 constructor() {
19 super();
20 }
21
22 public setPorts(ports: { [name: string]: number }): void {
23 this.ports = ports;
24 }
25
26 public setArguments(args: ConfigurationArguments): void {
27 this.args = args;
28 }
29
30 public customRequest(command: string, response: DebugProtocol.Response, args: any): boolean {
31 return false;
32 }
33
34 public initCommands(): string[] {
35 const gdbport = this.ports[createPortName(this.args.targetProcessor)];
36
37 return [
38 `target-select extended-remote localhost:${gdbport}`
39 ];
40 }
41
42 public launchCommands(): string[] {
43 const commands = [
44 'interpreter-exec console "monitor halt"',
45 ...genDownloadCommands(this.args, ['interpreter-exec console "monitor reset"']),
46 'interpreter-exec console "monitor reset"'
47 ];
48 return commands;
49 }
50
51 public attachCommands(): string[] {
52 const commands = [
53 'interpreter-exec console "monitor halt"'
54 ];
55 return commands;
56 }
57
58 public restartCommands(): string[] {
59 const commands: string[] = [
60 'interpreter-exec console "monitor halt"',
61 'interpreter-exec console "monitor reset"'
62 ];
63 return commands;
64 }
65
66 public rttCommands(): string[] {
67 const commands = [];

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected