Skip to content

Commit

Permalink
Addiontal fix for #923
Browse files Browse the repository at this point in the history
  • Loading branch information
haneefdm committed Aug 25, 2023
1 parent ef51590 commit 254af82
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/backend/mi2/mi2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,7 @@ export class MI2 extends EventEmitter implements IBackend {
}
expression = expression.replace(/"/g, '\\"');

const thFr = ((scope === '*') && (threadId !== undefined) && (frameId !== undefined)) ? `--thread ${threadId} --frame ${frameId}` : '';
const thFr = ((threadId !== undefined) && (frameId !== undefined)) ? `--thread ${threadId} --frame ${frameId}` : '';
const createResp = await this.sendCommand(`var-create ${thFr} ${name} ${scope} "${expression}"`);
let overrideVal = null;
if (fmt && name !== '-') {
Expand Down
7 changes: 6 additions & 1 deletion src/gdb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3211,7 +3211,12 @@ export class GDBDebugSession extends LoggingDebugSession {
// We always create a floating variable so it will be updated in the context of the current frame
// Technicall, we should be able to bind this to this frame but for some reason gdb gets confused
// from previous stack frames and returns the wrong results or says nothing changed when in fact it has
varObj = await this.miDebugger.varCreate(0, exp, varObjName, '@'); // Create floating variable
if (args.frameId === undefined) {
varObj = await this.miDebugger.varCreate(0, exp, varObjName, '@'); // Create floating variable
} else {
varObj = await this.miDebugger.varCreate(0, exp, varObjName, '@', threadId, frameId);
}

const varId = findOrCreateVariable(varObj);
varObj.exp = exp;
varObj.id = varId;
Expand Down
2 changes: 1 addition & 1 deletion src/live-watch-monitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export class VariablesHandler {
if (forceNoFrameId || (args.frameId === undefined)) {
varObj = await miDebugger.varCreate(0, exp, varObjName, '@'); // Create floating variable
} else {
varObj = await miDebugger.varCreate(0, exp, varObjName, '*', threadId, frameId);
varObj = await miDebugger.varCreate(0, exp, varObjName, '@', threadId, frameId);
}
const varId = this.findOrCreateVariable(varObj);
varObj.exp = exp;
Expand Down

0 comments on commit 254af82

Please sign in to comment.