Skip to content

Commit b93c639

Browse files
authored
Allow optional programmer in debug (#2544)
This is a cherry-pick of #2540 from the 0.35.x branch
1 parent d99184e commit b93c639

File tree

3 files changed

+8
-18
lines changed

3 files changed

+8
-18
lines changed

commands/debug/debug_info.go

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -154,15 +154,14 @@ func getDebugProperties(req *rpc.GetDebugConfigRequest, pme *packagemanager.Expl
154154
}
155155
}
156156

157-
if req.GetProgrammer() == "" {
158-
return nil, &cmderrors.MissingProgrammerError{}
159-
}
160-
if p, ok := platformRelease.Programmers[req.GetProgrammer()]; ok {
161-
toolProperties.Merge(p.Properties)
162-
} else if refP, ok := referencedPlatformRelease.Programmers[req.GetProgrammer()]; ok {
163-
toolProperties.Merge(refP.Properties)
164-
} else {
165-
return nil, &cmderrors.ProgrammerNotFoundError{Programmer: req.GetProgrammer()}
157+
if req.GetProgrammer() != "" {
158+
if p, ok := platformRelease.Programmers[req.GetProgrammer()]; ok {
159+
toolProperties.Merge(p.Properties)
160+
} else if refP, ok := referencedPlatformRelease.Programmers[req.GetProgrammer()]; ok {
161+
toolProperties.Merge(refP.Properties)
162+
} else {
163+
return nil, &cmderrors.ProgrammerNotFoundError{Programmer: req.GetProgrammer()}
164+
}
166165
}
167166

168167
var importPath *paths.Path

commands/debug/debug_test.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,6 @@ func TestGetCommandLine(t *testing.T) {
6565
pme, release := pm.NewExplorer()
6666
defer release()
6767

68-
{
69-
// Check programmer required
70-
_, err := getCommandLine(req, pme)
71-
require.Error(t, err)
72-
}
73-
7468
{
7569
// Check programmer not found
7670
req.Programmer = "not-existent"

internal/integrationtest/debug/debug_test.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,9 +336,6 @@ func testAllDebugInformation(t *testing.T, env *integrationtest.Environment, cli
336336
}
337337

338338
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-
342339
out, _, err := cli.Run("debug", "check", "-b", "arduino:samd:mkr1000", "-P", "atmel_ice")
343340
require.NoError(t, err)
344341
require.Contains(t, string(out), "The given board/programmer configuration supports debugging.")

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy