Skip to content

Commit 716fca0

Browse files
authored
Consistently use threadId in MI sendStackInfoDepth. (#455)
Was only used in a few places after adding auxiliary GDB connections. This could confuse the varManager caching mechanisms by reading incorrect `depth` values for a selected thread. Caching needs improvement in future as the intended strategy is a bit unclear at the moment. Signed-off-by: Jens Reinecke <[email protected]>
1 parent 91bc884 commit 716fca0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/gdb/GDBDebugSessionBase.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1622,6 +1622,7 @@ export abstract class GDBDebugSessionBase extends LoggingDebugSession {
16221622
args.name.replace(/^\[(\d+)\]/, '$1');
16231623
const stackDepth = await mi.sendStackInfoDepth(this.gdb, {
16241624
maxDepth: 100,
1625+
threadId: frameRef.threadId,
16251626
});
16261627
const depth = parseInt(stackDepth.depth, 10);
16271628
let varobj = this.gdb.varManager.getVar(
@@ -2590,6 +2591,7 @@ export abstract class GDBDebugSessionBase extends LoggingDebugSession {
25902591
// stack depth necessary for differentiating between similarly named variables at different stack depths
25912592
const stackDepth = await mi.sendStackInfoDepth(this.gdb, {
25922593
maxDepth: 100,
2594+
threadId: frameRef.threadId,
25932595
});
25942596
const depth = parseInt(stackDepth.depth, 10);
25952597

0 commit comments

Comments
 (0)