Skip to content

Commit 5a6432e

Browse files
authored
SAM debugconfig: default to stopOnEntry=false #1142
Before: debugging stops at line 1 of the runtime bootstrap file; user must explicitly "Continue" to proceed with debugging. After: debugging does not stop until a user breakpoint is hit.
1 parent d37befe commit 5a6432e

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/shared/sam/debugger/typescriptSamDebug.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ export async function makeTypescriptConfig(config: SamLaunchRequestArgs): Promis
7575
localRoot: config.codeRoot,
7676
remoteRoot: '/var/task',
7777
protocol: 'inspector',
78+
// Stop at first user breakpoint, not the runtime bootstrap file.
79+
stopOnEntry: config.stopOnEntry === undefined ? false : !!config.stopOnEntry,
7880
skipFiles: ['/var/runtime/node_modules/**/*.js', '<node_internals>/**/*.js'],
7981
}
8082

src/test/shared/sam/debugger/samDebugConfigProvider.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,7 @@ describe('SamDebugConfigurationProvider', async () => {
386386
protocol: 'inspector',
387387
remoteRoot: '/var/task',
388388
skipFiles: ['/var/runtime/node_modules/**/*.js', '<node_internals>/**/*.js'],
389+
stopOnEntry: false,
389390
}
390391

391392
assertEqualLaunchConfigs(actual, expected, appDir)
@@ -503,6 +504,7 @@ describe('SamDebugConfigurationProvider', async () => {
503504
protocol: 'inspector',
504505
remoteRoot: '/var/task',
505506
skipFiles: ['/var/runtime/node_modules/**/*.js', '<node_internals>/**/*.js'],
507+
stopOnEntry: false,
506508
}
507509

508510
assertEqualLaunchConfigs(actual, expected, appDir)
@@ -1126,6 +1128,7 @@ Globals:
11261128
runtime: 'nodejs12.x',
11271129
runtimeFamily: lambdaModel.RuntimeFamily.NodeJS,
11281130
skipFiles: ['/var/runtime/node_modules/**/*.js', '<node_internals>/**/*.js'],
1131+
stopOnEntry: false,
11291132
}
11301133

11311134
assertEqualLaunchConfigs(actual, expected, appDir)

0 commit comments

Comments
 (0)