MCPcopy Index your code
hub / github.com/nodejs/node / AddDebugSettings

Method AddDebugSettings

tools/gyp/pylib/gyp/MSVSUserFile.py:79–137  ·  view source on GitHub ↗

Adds a DebugSettings node to the user file for a particular config. Args: command: command line to run. First element in the list is the executable. All elements of the command will be quoted if necessary. working_directory: other files which ma

(
        self, config_name, command, environment={}, working_directory=""
    )

Source from the content-addressed store, hash-verified

77 self.configurations[name] = ["Configuration", {"Name": name}]
78
79 def AddDebugSettings(
80 self, config_name, command, environment={}, working_directory=""
81 ):
82 """Adds a DebugSettings node to the user file for a particular config.
83
84 Args:
85 command: command line to run. First element in the list is the
86 executable. All elements of the command will be quoted if
87 necessary.
88 working_directory: other files which may trigger the rule. (optional)
89 """
90 command = _QuoteWin32CommandLineArgs(command)
91
92 abs_command = _FindCommandInPath(command[0])
93
94 if environment and isinstance(environment, dict):
95 env_list = [f'{key}="{val}"' for (key, val) in environment.items()]
96 environment = " ".join(env_list)
97 else:
98 environment = ""
99
100 n_cmd = [
101 "DebugSettings",
102 {
103 "Command": abs_command,
104 "WorkingDirectory": working_directory,
105 "CommandArguments": " ".join(command[1:]),
106 "RemoteMachine": socket.gethostname(),
107 "Environment": environment,
108 "EnvironmentMerge": "true",
109 # Currently these are all "dummy" values that we're just setting
110 # in the default manner that MSVS does it. We could use some of
111 # these to add additional capabilities, I suppose, but they might
112 # not have parity with other platforms then.
113 "Attach": "false",
114 "DebuggerType": "3", # 'auto' debugger
115 "Remote": "1",
116 "RemoteCommand": "",
117 "HttpUrl": "",
118 "PDBPath": "",
119 "SQLDebugging": "",
120 "DebuggerFlavor": "0",
121 "MPIRunCommand": "",
122 "MPIRunArguments": "",
123 "MPIRunWorkingDirectory": "",
124 "ApplicationCommand": "",
125 "ApplicationArguments": "",
126 "ShimCommand": "",
127 "MPIAcceptMode": "",
128 "MPIAcceptFilter": "",
129 },
130 ]
131
132 # Find the config, and add it if it doesn't exist.
133 if config_name not in self.configurations:
134 self.AddConfig(config_name)
135
136 # Add the DebugSettings onto the appropriate config.

Callers 1

_WriteMSVSUserFileFunction · 0.80

Calls 6

AddConfigMethod · 0.95
_FindCommandInPathFunction · 0.85
itemsMethod · 0.45
joinMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected