@@ -38,13 +38,14 @@ import (
3838// NewCommand created a new `upload` command
3939func NewCommand (srv rpc.ArduinoCoreServiceServer ) * cobra.Command {
4040 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
4849 )
4950
5051 debugCommand := & cobra.Command {
@@ -54,7 +55,7 @@ func NewCommand(srv rpc.ArduinoCoreServiceServer) *cobra.Command {
5455 Example : " " + os .Args [0 ] + " debug -b arduino:samd:mkr1000 -P atmel_ice /home/user/Arduino/MySketch" ,
5556 Args : cobra .MaximumNArgs (1 ),
5657 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 )
5859 },
5960 }
6061
@@ -66,12 +67,15 @@ func NewCommand(srv rpc.ArduinoCoreServiceServer) *cobra.Command {
6667 debugCommand .Flags ().StringVar (& interpreter , "interpreter" , "console" , i18n .Tr ("Debug interpreter e.g.: %s" , "console, mi, mi1, mi2, mi3" ))
6768 debugCommand .Flags ().StringVarP (& importDir , "input-dir" , "" , "" , i18n .Tr ("Directory containing binaries for debug." ))
6869 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." ))
6972
7073 return debugCommand
7174}
7275
7376func 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 ) {
7579 logrus .Info ("Executing `arduino-cli debug`" )
7680
7781 path := ""
@@ -111,13 +115,14 @@ func runDebugCommand(ctx context.Context, srv rpc.ArduinoCoreServiceServer, args
111115 }
112116
113117 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 ,
121126 }
122127
123128 if printInfo {
0 commit comments