Skip to content

Commit ce6bb98

Browse files
committedDec 1, 2023
Added debug check command to check if a combination of board/programmer supports debugging. (#2443)
* Moved rcp message to proper position * Added gRPC command to check for debugger support * Made debug flags var non-global * Implementation of 'debug check' command * Implementation of cli command 'debug check' * added integration test * Renamed field for clarity * Added minimum debug_fqbn computation in 'debug check' command
1 parent 4d20a25 commit ce6bb98

File tree

13 files changed

+844
-304
lines changed

13 files changed

+844
-304
lines changed
 

‎arduino/cores/fqbn.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,16 @@ type FQBN struct {
3030
Configs *properties.Map
3131
}
3232

33+
// MustParseFQBN extract an FQBN object from the input string
34+
// or panics if the input is not a valid FQBN.
35+
func MustParseFQBN(fqbnIn string) *FQBN {
36+
res, err := ParseFQBN(fqbnIn)
37+
if err != nil {
38+
panic(err)
39+
}
40+
return res
41+
}
42+
3343
// ParseFQBN extract an FQBN object from the input string
3444
func ParseFQBN(fqbnIn string) (*FQBN, error) {
3545
// Split fqbn

‎commands/daemon/debug.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,9 @@ func (s *ArduinoCoreServerImpl) GetDebugConfig(ctx context.Context, req *rpc.Get
6666
res, err := cmd.GetDebugConfig(ctx, req)
6767
return res, convertErrorToRPCStatus(err)
6868
}
69+
70+
// IsDebugSupported checks if debugging is supported for a given configuration
71+
func (s *ArduinoCoreServerImpl) IsDebugSupported(ctx context.Context, req *rpc.IsDebugSupportedRequest) (*rpc.IsDebugSupportedResponse, error) {
72+
res, err := cmd.IsDebugSupported(ctx, req)
73+
return res, convertErrorToRPCStatus(err)
74+
}

‎commands/debug/debug.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ func Debug(ctx context.Context, req *rpc.GetDebugConfigRequest, inStream io.Read
118118

119119
// getCommandLine compose a debug command represented by a core recipe
120120
func getCommandLine(req *rpc.GetDebugConfigRequest, pme *packagemanager.Explorer) ([]string, error) {
121-
debugInfo, err := getDebugProperties(req, pme)
121+
debugInfo, err := getDebugProperties(req, pme, false)
122122
if err != nil {
123123
return nil, err
124124
}

‎commands/debug/debug_info.go

Lines changed: 80 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ package debug
1818
import (
1919
"context"
2020
"encoding/json"
21+
"errors"
22+
"reflect"
2123
"slices"
2224
"strconv"
2325
"strings"
@@ -41,25 +43,83 @@ func GetDebugConfig(ctx context.Context, req *rpc.GetDebugConfigRequest) (*rpc.G
4143
return nil, &arduino.InvalidInstanceError{}
4244
}
4345
defer release()
44-
return getDebugProperties(req, pme)
46+
return getDebugProperties(req, pme, false)
4547
}
4648

47-
func getDebugProperties(req *rpc.GetDebugConfigRequest, pme *packagemanager.Explorer) (*rpc.GetDebugConfigResponse, error) {
48-
// TODO: make a generic function to extract sketch from request
49-
// and remove duplication in commands/compile.go
50-
if req.GetSketchPath() == "" {
51-
return nil, &arduino.MissingSketchPathError{}
49+
// IsDebugSupported checks if the given board/programmer configuration supports debugging.
50+
func IsDebugSupported(ctx context.Context, req *rpc.IsDebugSupportedRequest) (*rpc.IsDebugSupportedResponse, error) {
51+
pme, release := instances.GetPackageManagerExplorer(req.GetInstance())
52+
if pme == nil {
53+
return nil, &arduino.InvalidInstanceError{}
54+
}
55+
defer release()
56+
configRequest := &rpc.GetDebugConfigRequest{
57+
Instance: req.GetInstance(),
58+
Fqbn: req.GetFqbn(),
59+
SketchPath: "",
60+
Port: req.GetPort(),
61+
Interpreter: req.GetInterpreter(),
62+
ImportDir: "",
63+
Programmer: req.GetProgrammer(),
64+
}
65+
expectedOutput, err := getDebugProperties(configRequest, pme, true)
66+
var x *arduino.FailedDebugError
67+
if errors.As(err, &x) {
68+
return &rpc.IsDebugSupportedResponse{DebuggingSupported: false}, nil
5269
}
53-
sketchPath := paths.New(req.GetSketchPath())
54-
sk, err := sketch.New(sketchPath)
5570
if err != nil {
56-
return nil, &arduino.CantOpenSketchError{Cause: err}
71+
return nil, err
72+
}
73+
74+
// Compute the minimum FQBN required to get the same debug configuration.
75+
// (i.e. the FQBN cleaned up of the options that do not affect the debugger configuration)
76+
minimumFQBN := cores.MustParseFQBN(req.GetFqbn())
77+
for _, config := range minimumFQBN.Configs.Keys() {
78+
checkFQBN := minimumFQBN.Clone()
79+
checkFQBN.Configs.Remove(config)
80+
configRequest.Fqbn = checkFQBN.String()
81+
checkOutput, err := getDebugProperties(configRequest, pme, true)
82+
if err == nil && reflect.DeepEqual(expectedOutput, checkOutput) {
83+
minimumFQBN.Configs.Remove(config)
84+
}
85+
}
86+
return &rpc.IsDebugSupportedResponse{
87+
DebuggingSupported: true,
88+
DebugFqbn: minimumFQBN.String(),
89+
}, nil
90+
}
91+
92+
func getDebugProperties(req *rpc.GetDebugConfigRequest, pme *packagemanager.Explorer, skipSketchChecks bool) (*rpc.GetDebugConfigResponse, error) {
93+
var (
94+
sketchName string
95+
sketchDefaultFQBN string
96+
sketchDefaultBuildPath *paths.Path
97+
)
98+
if !skipSketchChecks {
99+
// TODO: make a generic function to extract sketch from request
100+
// and remove duplication in commands/compile.go
101+
if req.GetSketchPath() == "" {
102+
return nil, &arduino.MissingSketchPathError{}
103+
}
104+
sketchPath := paths.New(req.GetSketchPath())
105+
sk, err := sketch.New(sketchPath)
106+
if err != nil {
107+
return nil, &arduino.CantOpenSketchError{Cause: err}
108+
}
109+
sketchName = sk.Name
110+
sketchDefaultFQBN = sk.GetDefaultFQBN()
111+
sketchDefaultBuildPath = sk.DefaultBuildPath()
112+
} else {
113+
// Use placeholder sketch data
114+
sketchName = "Sketch"
115+
sketchDefaultFQBN = ""
116+
sketchDefaultBuildPath = paths.New("SketchBuildPath")
57117
}
58118

59119
// XXX Remove this code duplication!!
60120
fqbnIn := req.GetFqbn()
61-
if fqbnIn == "" && sk != nil {
62-
fqbnIn = sk.GetDefaultFQBN()
121+
if fqbnIn == "" {
122+
fqbnIn = sketchDefaultFQBN
63123
}
64124
if fqbnIn == "" {
65125
return nil, &arduino.MissingFQBNError{}
@@ -124,16 +184,18 @@ func getDebugProperties(req *rpc.GetDebugConfigRequest, pme *packagemanager.Expl
124184
if importDir := req.GetImportDir(); importDir != "" {
125185
importPath = paths.New(importDir)
126186
} else {
127-
importPath = sk.DefaultBuildPath()
128-
}
129-
if !importPath.Exist() {
130-
return nil, &arduino.NotFoundError{Message: tr("Compiled sketch not found in %s", importPath)}
187+
importPath = sketchDefaultBuildPath
131188
}
132-
if !importPath.IsDir() {
133-
return nil, &arduino.NotFoundError{Message: tr("Expected compiled sketch in directory %s, but is a file instead", importPath)}
189+
if !skipSketchChecks {
190+
if !importPath.Exist() {
191+
return nil, &arduino.NotFoundError{Message: tr("Compiled sketch not found in %s", importPath)}
192+
}
193+
if !importPath.IsDir() {
194+
return nil, &arduino.NotFoundError{Message: tr("Expected compiled sketch in directory %s, but is a file instead", importPath)}
195+
}
134196
}
135197
toolProperties.SetPath("build.path", importPath)
136-
toolProperties.Set("build.project_name", sk.Name+".ino")
198+
toolProperties.Set("build.project_name", sketchName+".ino")
137199

138200
// Set debug port property
139201
port := req.GetPort()

‎internal/cli/debug/debug.go

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,27 +36,31 @@ import (
3636
"github.com/spf13/cobra"
3737
)
3838

39-
var (
40-
fqbnArg arguments.Fqbn
41-
portArgs arguments.Port
42-
interpreter string
43-
importDir string
44-
printInfo bool
45-
programmer arguments.Programmer
46-
tr = i18n.Tr
47-
)
39+
var tr = i18n.Tr
4840

4941
// NewCommand created a new `upload` command
5042
func NewCommand() *cobra.Command {
43+
var (
44+
fqbnArg arguments.Fqbn
45+
portArgs arguments.Port
46+
interpreter string
47+
importDir string
48+
printInfo bool
49+
programmer arguments.Programmer
50+
)
51+
5152
debugCommand := &cobra.Command{
5253
Use: "debug",
5354
Short: tr("Debug Arduino sketches."),
5455
Long: tr("Debug Arduino sketches. (this command opens an interactive gdb session)"),
5556
Example: " " + os.Args[0] + " debug -b arduino:samd:mkr1000 -P atmel_ice /home/user/Arduino/MySketch",
5657
Args: cobra.MaximumNArgs(1),
57-
Run: runDebugCommand,
58+
Run: func(cmd *cobra.Command, args []string) {
59+
runDebugCommand(args, &portArgs, &fqbnArg, interpreter, importDir, &programmer, printInfo)
60+
},
5861
}
5962

63+
debugCommand.AddCommand(newDebugCheckCommand())
6064
fqbnArg.AddToCommand(debugCommand)
6165
portArgs.AddToCommand(debugCommand)
6266
programmer.AddToCommand(debugCommand)
@@ -67,7 +71,8 @@ func NewCommand() *cobra.Command {
6771
return debugCommand
6872
}
6973

70-
func runDebugCommand(command *cobra.Command, args []string) {
74+
func runDebugCommand(args []string, portArgs *arguments.Port, fqbnArg *arguments.Fqbn,
75+
interpreter string, importDir string, programmer *arguments.Programmer, printInfo bool) {
7176
instance := instance.CreateAndInit()
7277
logrus.Info("Executing `arduino-cli debug`")
7378

@@ -81,7 +86,7 @@ func runDebugCommand(command *cobra.Command, args []string) {
8186
if err != nil {
8287
feedback.FatalError(err, feedback.ErrGeneric)
8388
}
84-
fqbn, port := arguments.CalculateFQBNAndPort(&portArgs, &fqbnArg, instance, sk.GetDefaultFqbn(), sk.GetDefaultPort(), sk.GetDefaultProtocol())
89+
fqbn, port := arguments.CalculateFQBNAndPort(portArgs, fqbnArg, instance, sk.GetDefaultFqbn(), sk.GetDefaultPort(), sk.GetDefaultProtocol())
8590
debugConfigRequested := &rpc.GetDebugConfigRequest{
8691
Instance: instance,
8792
Fqbn: fqbn,

‎internal/cli/debug/debug_check.go

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
// This file is part of arduino-cli.
2+
//
3+
// Copyright 2023 ARDUINO SA (http://www.arduino.cc/)
4+
//
5+
// This software is released under the GNU General Public License version 3,
6+
// which covers the main part of arduino-cli.
7+
// The terms of this license can be found at:
8+
// https://www.gnu.org/licenses/gpl-3.0.en.html
9+
//
10+
// You can be released from the requirements of the above licenses by purchasing
11+
// a commercial license. Buying such a license is mandatory if you want to
12+
// modify or otherwise use the software for commercial activities involving the
13+
// Arduino software without disclosing the source code of your own applications.
14+
// To purchase a commercial license, send an email to license@arduino.cc.
15+
16+
package debug
17+
18+
import (
19+
"context"
20+
"os"
21+
22+
"github.com/arduino/arduino-cli/commands/debug"
23+
"github.com/arduino/arduino-cli/internal/cli/arguments"
24+
"github.com/arduino/arduino-cli/internal/cli/feedback"
25+
"github.com/arduino/arduino-cli/internal/cli/instance"
26+
rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
27+
"github.com/sirupsen/logrus"
28+
"github.com/spf13/cobra"
29+
)
30+
31+
func newDebugCheckCommand() *cobra.Command {
32+
var (
33+
fqbnArg arguments.Fqbn
34+
portArgs arguments.Port
35+
interpreter string
36+
programmer arguments.Programmer
37+
)
38+
debugCheckCommand := &cobra.Command{
39+
Use: "check",
40+
Short: tr("Check if the given board/programmer combination supports debugging."),
41+
Example: " " + os.Args[0] + " debug check -b arduino:samd:mkr1000 -P atmel_ice",
42+
Run: func(cmd *cobra.Command, args []string) {
43+
runDebugCheckCommand(&portArgs, &fqbnArg, interpreter, &programmer)
44+
},
45+
}
46+
fqbnArg.AddToCommand(debugCheckCommand)
47+
portArgs.AddToCommand(debugCheckCommand)
48+
programmer.AddToCommand(debugCheckCommand)
49+
debugCheckCommand.Flags().StringVar(&interpreter, "interpreter", "console", tr("Debug interpreter e.g.: %s", "console, mi, mi1, mi2, mi3"))
50+
return debugCheckCommand
51+
}
52+
53+
func runDebugCheckCommand(portArgs *arguments.Port, fqbnArg *arguments.Fqbn, interpreter string, programmerArg *arguments.Programmer) {
54+
instance := instance.CreateAndInit()
55+
logrus.Info("Executing `arduino-cli debug`")
56+
57+
port, err := portArgs.GetPort(instance, "", "")
58+
if err != nil {
59+
feedback.FatalError(err, feedback.ErrBadArgument)
60+
}
61+
fqbn := fqbnArg.String()
62+
resp, err := debug.IsDebugSupported(context.Background(), &rpc.IsDebugSupportedRequest{
63+
Instance: instance,
64+
Fqbn: fqbn,
65+
Port: port,
66+
Interpreter: interpreter,
67+
Programmer: programmerArg.String(instance, fqbn),
68+
})
69+
if err != nil {
70+
feedback.FatalError(err, feedback.ErrGeneric)
71+
}
72+
feedback.PrintResult(&debugCheckResult{&isDebugSupportedResponse{
73+
DebuggingSupported: resp.GetDebuggingSupported(),
74+
DebugFQBN: resp.GetDebugFqbn(),
75+
}})
76+
}
77+
78+
type isDebugSupportedResponse struct {
79+
DebuggingSupported bool `json:"debugging_supported"`
80+
DebugFQBN string `json:"debug_fqbn,omitempty"`
81+
}
82+
83+
type debugCheckResult struct {
84+
Result *isDebugSupportedResponse
85+
}
86+
87+
func (d *debugCheckResult) Data() interface{} {
88+
return d.Result
89+
}
90+
91+
func (d *debugCheckResult) String() string {
92+
if d.Result.DebuggingSupported {
93+
return tr("The given board/programmer configuration supports debugging.")
94+
}
95+
return tr("The given board/programmer configuration does NOT support debugging.")
96+
}

‎internal/integrationtest/debug/debug_test.go

Lines changed: 51 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,22 @@ func TestDebug(t *testing.T) {
3333
require.NoError(t, err)
3434

3535
// Install cores
36+
_, _, err = cli.Run("core", "install", "arduino:avr")
37+
require.NoError(t, err)
3638
_, _, err = cli.Run("core", "install", "arduino:samd")
3739
require.NoError(t, err)
3840

41+
// Install custom core
42+
customHw, err := paths.New("testdata", "hardware").Abs()
43+
require.NoError(t, err)
44+
err = customHw.CopyDirTo(cli.SketchbookDir().Join("hardware"))
45+
require.NoError(t, err)
46+
3947
integrationtest.CLISubtests{
4048
{"Start", testDebuggerStarts},
4149
{"WithPdeSketchStarts", testDebuggerWithPdeSketchStarts},
4250
{"DebugInformation", testAllDebugInformation},
51+
{"DebugCheck", testDebugCheck},
4352
}.Run(t, env, cli)
4453
}
4554

@@ -99,12 +108,6 @@ func testAllDebugInformation(t *testing.T, env *integrationtest.Environment, cli
99108
_, _, err := cli.Run("sketch", "new", sketchPath.String())
100109
require.NoError(t, err)
101110

102-
// Install custom core
103-
customHw, err := paths.New("testdata", "hardware").Abs()
104-
require.NoError(t, err)
105-
err = customHw.CopyDirTo(cli.SketchbookDir().Join("hardware"))
106-
require.NoError(t, err)
107-
108111
// Build sketch
109112
_, _, err = cli.Run("compile", "-b", "my:samd:my", sketchPath.String(), "--format", "json")
110113
require.NoError(t, err)
@@ -331,3 +334,45 @@ func testAllDebugInformation(t *testing.T, env *integrationtest.Environment, cli
331334
}
332335
}
333336
}
337+
338+
func testDebugCheck(t *testing.T, env *integrationtest.Environment, cli *integrationtest.ArduinoCLI) {
339+
_, _, err := cli.Run("debug", "check", "-b", "arduino:samd:mkr1000")
340+
require.Error(t, err)
341+
342+
out, _, err := cli.Run("debug", "check", "-b", "arduino:samd:mkr1000", "-P", "atmel_ice")
343+
require.NoError(t, err)
344+
require.Contains(t, string(out), "The given board/programmer configuration supports debugging.")
345+
346+
out, _, err = cli.Run("debug", "check", "-b", "arduino:samd:mkr1000", "-P", "atmel_ice", "--format", "json")
347+
require.NoError(t, err)
348+
requirejson.Query(t, out, `.debugging_supported`, `true`)
349+
350+
out, _, err = cli.Run("debug", "check", "-b", "arduino:avr:uno", "-P", "atmel_ice")
351+
require.NoError(t, err)
352+
require.Contains(t, string(out), "The given board/programmer configuration does NOT support debugging.")
353+
354+
out, _, err = cli.Run("debug", "check", "-b", "arduino:avr:uno", "-P", "atmel_ice", "--format", "json")
355+
require.NoError(t, err)
356+
requirejson.Query(t, out, `.debugging_supported`, `false`)
357+
358+
// Test minimum FQBN compute
359+
out, _, err = cli.Run("debug", "check", "-b", "my:samd:my5", "-P", "atmel_ice", "--format", "json")
360+
require.NoError(t, err)
361+
requirejson.Contains(t, out, `{ "debugging_supported" : false }`)
362+
363+
out, _, err = cli.Run("debug", "check", "-b", "my:samd:my5:dbg=on", "-P", "atmel_ice", "--format", "json")
364+
require.NoError(t, err)
365+
requirejson.Contains(t, out, `{ "debugging_supported" : true, "debug_fqbn" : "my:samd:my5:dbg=on" }`)
366+
367+
out, _, err = cli.Run("debug", "check", "-b", "my:samd:my5:dbg=on,cpu=150m", "-P", "atmel_ice", "--format", "json")
368+
require.NoError(t, err)
369+
requirejson.Contains(t, out, `{ "debugging_supported" : true, "debug_fqbn" : "my:samd:my5:dbg=on" }`)
370+
371+
out, _, err = cli.Run("debug", "check", "-b", "my:samd:my6", "-P", "atmel_ice", "--format", "json")
372+
require.NoError(t, err)
373+
requirejson.Contains(t, out, `{ "debugging_supported" : true, "debug_fqbn" : "my:samd:my6" }`)
374+
375+
out, _, err = cli.Run("debug", "check", "-b", "my:samd:my6:dbg=on", "-P", "atmel_ice", "--format", "json")
376+
require.NoError(t, err)
377+
requirejson.Contains(t, out, `{ "debugging_supported" : true, "debug_fqbn" : "my:samd:my6" }`)
378+
}

‎internal/integrationtest/debug/testdata/hardware/my/samd/boards.txt

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,39 @@ my4.build.mcu=test2
112112
# this one will be overwritten by additional_config
113113
my4.debug.svd_file=svd-file
114114
my4.debug.additional_config=build.debug.config.{build.mcu}
115+
116+
# menu options for the following boards
117+
menu.dbg=Debugger
118+
menu.cpu=CPU Speed
119+
120+
# This does not support debug by default but only after selecting a menu option
121+
my5.name=5th Board
122+
my5.build.core=arduino:arduino
123+
my5.build.variant=arduino:mkr1000
124+
my5.debug.toolchain.path=gcc-path
125+
my5.debug.toolchain.prefix=gcc-prefix
126+
my5.debug.server.openocd.path=openocd-path
127+
my5.debug.server.openocd.scripts_dir=openocd-scripts-dir
128+
my5.debug.server.openocd.script=single-script
129+
my5.debug.executable=
130+
my5.menu.dbg.off=Debug Disabled
131+
my5.menu.dbg.on=Debug Enabled
132+
my5.menu.dbg.on.debug.executable=YES
133+
my5.menu.cpu.100m=100Mhz
134+
my5.menu.cpu.150m=150Mhz
135+
136+
# this one has debugger enabled by default
137+
my6.name=5th Board
138+
my6.build.core=arduino:arduino
139+
my6.build.variant=arduino:mkr1000
140+
my6.debug.toolchain.path=gcc-path
141+
my6.debug.toolchain.prefix=gcc-prefix
142+
my6.debug.server.openocd.path=openocd-path
143+
my6.debug.server.openocd.scripts_dir=openocd-scripts-dir
144+
my6.debug.server.openocd.script=single-script
145+
my6.debug.executable=
146+
my6.menu.dbg.on=Debug Enabled
147+
my6.menu.dbg.on.debug.executable=YES
148+
my6.menu.dbg.off=Debug Disabled
149+
my6.menu.cpu.100m=100Mhz
150+
my6.menu.cpu.150m=150Mhz

‎rpc/cc/arduino/cli/commands/v1/commands.pb.go

Lines changed: 103 additions & 90 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎rpc/cc/arduino/cli/commands/v1/commands.proto

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,11 @@ service ArduinoCoreService {
184184
// Start a debug session and communicate with the debugger tool.
185185
rpc Debug(stream DebugRequest) returns (stream DebugResponse) {}
186186

187+
// Determine if debugging is suported given a specific configuration.
188+
rpc IsDebugSupported(IsDebugSupportedRequest)
189+
returns (IsDebugSupportedResponse) {}
190+
191+
// Query the debugger information given a specific configuration.
187192
rpc GetDebugConfig(GetDebugConfigRequest) returns (GetDebugConfigResponse) {}
188193
}
189194

‎rpc/cc/arduino/cli/commands/v1/commands_grpc.pb.go

Lines changed: 41 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎rpc/cc/arduino/cli/commands/v1/debug.pb.go

Lines changed: 365 additions & 169 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎rpc/cc/arduino/cli/commands/v1/debug.proto

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,39 @@ message DebugRequest {
4343
bool send_interrupt = 3;
4444
}
4545

46+
// The streaming response may contain chunks of data from the debugger or an
47+
// error.
48+
message DebugResponse {
49+
// Incoming data from the debugger tool.
50+
bytes data = 1;
51+
// Incoming error output from the debugger tool.
52+
string error = 2;
53+
}
54+
55+
message IsDebugSupportedRequest {
56+
// Arduino Core Service instance from the `Init` response.
57+
Instance instance = 1;
58+
// Fully qualified board name of the board in use (e.g.,
59+
// `arduino:samd:mkr1000`).
60+
string fqbn = 2;
61+
// Port of the debugger (optional).
62+
Port port = 3;
63+
// Which GDB command interpreter to use.
64+
string interpreter = 4;
65+
// The programmer to use for debugging.
66+
string programmer = 5;
67+
}
68+
69+
message IsDebugSupportedResponse {
70+
// True if debugging is supported
71+
bool debugging_supported = 1;
72+
// This is the same FQBN given in the IsDebugSupportedRequest but cleaned
73+
// up of the board options that do not affect the debugger configuration.
74+
// It may be used by clients/IDE to group slightly different boards option
75+
// selections under the same debug configuration.
76+
string debug_fqbn = 2;
77+
}
78+
4679
message GetDebugConfigRequest {
4780
// Arduino Core Service instance from the `Init` response.
4881
Instance instance = 1;
@@ -65,14 +98,6 @@ message GetDebugConfigRequest {
6598
string programmer = 9;
6699
}
67100

68-
//
69-
message DebugResponse {
70-
// Incoming data from the debugger tool.
71-
bytes data = 1;
72-
// Incoming error output from the debugger tool.
73-
string error = 2;
74-
}
75-
76101
message GetDebugConfigResponse {
77102
// The executable binary to debug
78103
string executable = 1;

0 commit comments

Comments
 (0)
Please sign in to comment.