Skip to content

Commit ac3518c

Browse files
authored
Covering the case when source file for Breakpoint is unknown (#426)
* updating breakpoint modified case to cover unknown source file scenario * checking on file in notification
1 parent 8d9715c commit ac3518c

File tree

2 files changed

+23
-9
lines changed

2 files changed

+23
-9
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Change Log
22

3+
## Unreleased
4+
5+
- Fixes [`#427`](https://github.com/eclipse-cdt-cloud/cdt-gdb-adapter/issues/427): Breakpoint source code reference to module disappears when breakpoint is hit
6+
37
## 1.2.0
48

59
- Fixes [cdt-gdb-vscode `#173`](https://github.com/eclipse-cdt-cloud/cdt-gdb-vscode/issues/173): Add `target`>`watchServerProcess` setting to ignore early exit of `server` executable, e.g. if a launcher for actual gdbserver.

src/gdb/GDBDebugSessionBase.ts

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2021,15 +2021,25 @@ export abstract class GDBDebugSessionBase extends LoggingDebugSession {
20212021
if (notifyData.bkpt.disp === 'del') {
20222022
break;
20232023
}
2024-
const breakpoint: DebugProtocol.Breakpoint = {
2025-
id: parseInt(notifyData.bkpt.number, 10),
2026-
verified: true,
2027-
source: {
2028-
name: notifyData.bkpt.fullname,
2029-
path: notifyData.bkpt.file,
2030-
},
2031-
line: parseInt(notifyData.bkpt.line, 10),
2032-
};
2024+
let breakpoint: DebugProtocol.Breakpoint;
2025+
if (notifyData.bkpt.file) {
2026+
breakpoint = {
2027+
id: parseInt(notifyData.bkpt.number, 10),
2028+
verified: true,
2029+
source: {
2030+
name: notifyData.bkpt.fullname,
2031+
path: notifyData.bkpt.file,
2032+
},
2033+
line: parseInt(notifyData.bkpt.line, 10),
2034+
};
2035+
} else {
2036+
breakpoint = {
2037+
id: parseInt(notifyData.bkpt.number, 10),
2038+
verified: true,
2039+
instructionReference: notifyData.bkpt.addr,
2040+
};
2041+
}
2042+
20332043
const breakpointevent = new BreakpointEvent(
20342044
'changed',
20352045
breakpoint

0 commit comments

Comments
 (0)