Skip to content

Commit 254af82

Browse files
committed
Addiontal fix for #923
1 parent ef51590 commit 254af82

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

src/backend/mi2/mi2.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,7 @@ export class MI2 extends EventEmitter implements IBackend {
928928
}
929929
expression = expression.replace(/"/g, '\\"');
930930

931-
const thFr = ((scope === '*') && (threadId !== undefined) && (frameId !== undefined)) ? `--thread ${threadId} --frame ${frameId}` : '';
931+
const thFr = ((threadId !== undefined) && (frameId !== undefined)) ? `--thread ${threadId} --frame ${frameId}` : '';
932932
const createResp = await this.sendCommand(`var-create ${thFr} ${name} ${scope} "${expression}"`);
933933
let overrideVal = null;
934934
if (fmt && name !== '-') {

src/gdb.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -3211,7 +3211,12 @@ export class GDBDebugSession extends LoggingDebugSession {
32113211
// We always create a floating variable so it will be updated in the context of the current frame
32123212
// Technicall, we should be able to bind this to this frame but for some reason gdb gets confused
32133213
// from previous stack frames and returns the wrong results or says nothing changed when in fact it has
3214-
varObj = await this.miDebugger.varCreate(0, exp, varObjName, '@'); // Create floating variable
3214+
if (args.frameId === undefined) {
3215+
varObj = await this.miDebugger.varCreate(0, exp, varObjName, '@'); // Create floating variable
3216+
} else {
3217+
varObj = await this.miDebugger.varCreate(0, exp, varObjName, '@', threadId, frameId);
3218+
}
3219+
32153220
const varId = findOrCreateVariable(varObj);
32163221
varObj.exp = exp;
32173222
varObj.id = varId;

src/live-watch-monitor.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ export class VariablesHandler {
169169
if (forceNoFrameId || (args.frameId === undefined)) {
170170
varObj = await miDebugger.varCreate(0, exp, varObjName, '@'); // Create floating variable
171171
} else {
172-
varObj = await miDebugger.varCreate(0, exp, varObjName, '*', threadId, frameId);
172+
varObj = await miDebugger.varCreate(0, exp, varObjName, '@', threadId, frameId);
173173
}
174174
const varId = this.findOrCreateVariable(varObj);
175175
varObj.exp = exp;

0 commit comments

Comments
 (0)