-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for function breakpoints
Signed-off-by: Rob Moran <[email protected]>
- Loading branch information
Showing
10 changed files
with
180 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/********************************************************************* | ||
* Copyright (c) 2019 Arm and others | ||
* | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*********************************************************************/ | ||
|
||
import { join } from 'path'; | ||
import { expect } from 'chai'; | ||
import { CdtDebugClient } from './debugClient'; | ||
import { LaunchRequestArguments } from '../GDBDebugSession'; | ||
import { | ||
standardBeforeEach, | ||
gdbPath, | ||
testProgramsDir, | ||
openGdbConsole, | ||
getScopes, | ||
} from './utils'; | ||
|
||
describe('function breakpoints', async () => { | ||
let dc: CdtDebugClient; | ||
|
||
beforeEach(async () => { | ||
dc = await standardBeforeEach(); | ||
|
||
await dc.launchRequest({ | ||
verbose: true, | ||
gdb: gdbPath, | ||
program: join(testProgramsDir, 'functions'), | ||
openGdbConsole, | ||
} as LaunchRequestArguments); | ||
}); | ||
|
||
afterEach(async () => { | ||
await dc.stop(); | ||
}); | ||
|
||
it('hits the main function breakpoint', async () => { | ||
await dc.setFunctionBreakpointsRequest({ | ||
breakpoints: [ | ||
{ | ||
name: 'main', | ||
}, | ||
], | ||
}); | ||
await dc.configurationDoneRequest(); | ||
dc.waitForEvent('stopped'); | ||
const scope = await getScopes(dc); | ||
expect(scope.frame.line).to.eq(6); | ||
}); | ||
|
||
it('hits the sub function breakpoint', async () => { | ||
await dc.setFunctionBreakpointsRequest({ | ||
breakpoints: [ | ||
{ | ||
name: 'sub', | ||
}, | ||
], | ||
}); | ||
await dc.configurationDoneRequest(); | ||
dc.waitForEvent('stopped'); | ||
const scope = await getScopes(dc); | ||
expect(scope.frame.line).to.eq(2); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
count | ||
functions | ||
disassemble | ||
empty | ||
empty space | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
int sub() { | ||
return 0; | ||
} | ||
|
||
int main() { | ||
sub(); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters