MCPcopy Index your code
hub / github.com/Marus/cortex-debug / normalizeArguments

Method normalizeArguments

src/gdb.ts:430–474  ·  view source on GitHub ↗
(args: ConfigurationArguments)

Source from the content-addressed store, hash-verified

428 }
429
430 private normalizeArguments(args: ConfigurationArguments): ConfigurationArguments {
431 args.graphConfig = args.graphConfig || [];
432
433 if (args.executable && !path.isAbsolute(args.executable)) {
434 args.executable = path.normalize(path.join(args.cwd, args.executable));
435 }
436
437 if (args.svdFile && !path.isAbsolute(args.svdFile)) {
438 args.svdFile = path.normalize(path.join(args.cwd, args.svdFile));
439 }
440
441 if (args.swoConfig && args.swoConfig.decoders) {
442 args.swoConfig.decoders = args.swoConfig.decoders.map((dec) => {
443 if (dec.type === 'advanced' && dec.decoder && !path.isAbsolute(dec.decoder)) {
444 dec.decoder = path.normalize(path.join(args.cwd, dec.decoder));
445 }
446 return dec;
447 });
448 }
449
450 if (args.rttConfig && args.rttConfig.decoders) {
451 args.rttConfig.decoders = args.rttConfig.decoders.map((dec: any) => {
452 if (dec.type === 'advanced' && dec.decoder && !path.isAbsolute(dec.decoder)) {
453 dec.decoder = path.normalize(path.join(args.cwd, dec.decoder));
454 }
455 return dec;
456 });
457 }
458
459 if (args.chainedConfigurations && args.chainedConfigurations.enabled && args.chainedConfigurations.launches) {
460 for (const config of args.chainedConfigurations.launches) {
461 let folder = config.folder || args.cwd || process.cwd();
462 if (!path.isAbsolute(folder)) {
463 folder = path.join(args.cwd || process.cwd(), folder);
464 }
465 folder = path.normalize(folder).replace(/\\/g, '/');
466 while ((folder.length > 1) && folder.endsWith('/') && !folder.endsWith(':/')) {
467 folder = folder.substring(0, folder.length - 1);
468 }
469 config.folder = folder;
470 }
471 }
472
473 return args;
474 }
475
476 private getTCPPorts(useParent): Thenable<void> {
477 return new Promise((resolve, reject) => {

Callers 1

launchAttachInitMethod · 0.95

Calls 1

normalizeMethod · 0.80

Tested by

no test coverage detected