()
| 55 | save_json(launch, filename) |
| 56 | |
| 57 | def update_launch(): |
| 58 | filename = '.vscode/launch.json' |
| 59 | launch = load_json(filename, False) |
| 60 | template = load_template('launch.json', appPath) |
| 61 | if env.get('ENABLE_WOKWI'): |
| 62 | wokwi_template = load_template('wokwi/launch.json', appPath) |
| 63 | template["configurations"].extend(wokwi_template["configurations"]) |
| 64 | if launch is None: |
| 65 | launch = template.copy() |
| 66 | configurations = get_property(launch, 'configurations', []) |
| 67 | |
| 68 | wokwi_config_name = "Wokwi GDB" |
| 69 | config_names = ["%s GDB" % env['SMING_ARCH']] |
| 70 | if env.get('ENABLE_WOKWI'): |
| 71 | config_names.append(wokwi_config_name) |
| 72 | for config_name in config_names: |
| 73 | config = find_object(configurations, config_name) |
| 74 | template_config = find_object(template['configurations'], config_name) |
| 75 | if template_config is None: |
| 76 | print("Warning: Template launch configuration '%s' not found" % config_name) |
| 77 | elif not config is None: |
| 78 | configurations.remove(config) |
| 79 | config = template_config.copy() |
| 80 | configurations.append(config) |
| 81 | |
| 82 | if config is None: |
| 83 | return |
| 84 | |
| 85 | config['miDebuggerPath'] = find_tool(env['GDB']) |
| 86 | dbgargs = "-x ${env:SMING_HOME}/Arch/%s/Components/gdbstub/gdbcmds" % env['SMING_ARCH'] |
| 87 | if env['SMING_ARCH'] == 'Host': |
| 88 | args = [] |
| 89 | args += env['CLI_TARGET_OPTIONS'].split() |
| 90 | args += ["--"] |
| 91 | args += env['HOST_PARAMETERS'].split() |
| 92 | config['args'] = args |
| 93 | else: |
| 94 | if not env.isWsl(): |
| 95 | dbgargs += " -b %s" % env.resolve('${COM_SPEED_GDB}') |
| 96 | if config_name != wokwi_config_name: |
| 97 | config['miDebuggerServerAddress'] = env.resolve('${COM_PORT_GDB}') |
| 98 | if config_name != wokwi_config_name: |
| 99 | config['miDebuggerArgs'] = dbgargs |
| 100 | config['program'] = "${workspaceFolder}/" + env.resolve('${TARGET_OUT_0}') |
| 101 | |
| 102 | save_json(launch, filename) |
| 103 | |
| 104 | def update_workspace(): |
| 105 | filename = 'sming.code-workspace' |
no test coverage detected