@@ -38,13 +38,14 @@ import (
38
38
// NewCommand created a new `upload` command
39
39
func NewCommand(srv rpc.ArduinoCoreServiceServer) *cobra.Command {
40
40
var (
41
-
fqbnArg arguments.Fqbn
42
-
portArgs arguments.Port
43
-
profileArg arguments.Profile
44
-
interpreter string
45
-
importDir string
46
-
printInfo bool
47
-
programmer arguments.Programmer
41
+
fqbnArg arguments.Fqbn
42
+
portArgs arguments.Port
43
+
profileArg arguments.Profile
44
+
interpreter string
45
+
importDir string
46
+
printInfo bool
47
+
programmer arguments.Programmer
48
+
debugProperties []string
48
49
)
49
50
50
51
debugCommand := &cobra.Command{
@@ -54,7 +55,7 @@ func NewCommand(srv rpc.ArduinoCoreServiceServer) *cobra.Command {
54
55
Example: " " + os.Args[0] + " debug -b arduino:samd:mkr1000 -P atmel_ice /home/user/Arduino/MySketch",
55
56
Args: cobra.MaximumNArgs(1),
56
57
Run: func(cmd *cobra.Command, args []string) {
57
-
runDebugCommand(cmd.Context(), srv, args, &portArgs, &fqbnArg, interpreter, importDir, &programmer, printInfo, &profileArg)
58
+
runDebugCommand(cmd.Context(), srv, args, &portArgs, &fqbnArg, interpreter, importDir, &programmer, printInfo, &profileArg, debugProperties)
58
59
},
59
60
}
60
61
@@ -66,12 +67,15 @@ func NewCommand(srv rpc.ArduinoCoreServiceServer) *cobra.Command {
66
67
debugCommand.Flags().StringVar(&interpreter, "interpreter", "console", i18n.Tr("Debug interpreter e.g.: %s", "console, mi, mi1, mi2, mi3"))
67
68
debugCommand.Flags().StringVarP(&importDir, "input-dir", "", "", i18n.Tr("Directory containing binaries for debug."))
68
69
debugCommand.Flags().BoolVarP(&printInfo, "info", "I", false, i18n.Tr("Show metadata about the debug session instead of starting the debugger."))
70
+
debugCommand.Flags().StringArrayVar(&debugProperties, "debug-property", []string{},
71
+
i18n.Tr("Override an debug property with a custom value. Can be used multiple times for multiple properties."))
69
72
70
73
return debugCommand
71
74
}
72
75
73
76
func runDebugCommand(ctx context.Context, srv rpc.ArduinoCoreServiceServer, args []string, portArgs *arguments.Port, fqbnArg *arguments.Fqbn,
74
-
interpreter string, importDir string, programmer *arguments.Programmer, printInfo bool, profileArg *arguments.Profile) {
77
+
interpreter string, importDir string, programmer *arguments.Programmer, printInfo bool, profileArg *arguments.Profile,
78
+
debugProperties []string) {
75
79
logrus.Info("Executing `arduino-cli debug`")
76
80
77
81
path := ""
@@ -111,13 +115,14 @@ func runDebugCommand(ctx context.Context, srv rpc.ArduinoCoreServiceServer, args
111
115
}
112
116
113
117
debugConfigRequested := &rpc.GetDebugConfigRequest{
114
-
Instance: inst,
115
-
Fqbn: fqbn,
116
-
SketchPath: sketchPath.String(),
117
-
Port: port,
118
-
Interpreter: interpreter,
119
-
ImportDir: importDir,
120
-
Programmer: prog,
118
+
Instance: inst,
119
+
Fqbn: fqbn,
120
+
SketchPath: sketchPath.String(),
121
+
Port: port,
122
+
Interpreter: interpreter,
123
+
ImportDir: importDir,
124
+
Programmer: prog,
125
+
DebugProperties: debugProperties,
121
126
}
122
127
123
128
if printInfo {
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4