Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions src/vs/workbench/contrib/debug/browser/disassemblyView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import { applyFontInfo } from 'vs/editor/browser/config/domFontInfo';
interface IDisassembledInstructionEntry {
allowBreakpoint: boolean;
isBreakpointSet: boolean;
isBreakpointEnaled: boolean;
instruction: DebugProtocol.DisassembledInstruction;
instructionAddress?: bigint;
}
Expand All @@ -52,6 +53,7 @@ interface IDisassembledInstructionEntry {
const disassemblyNotAvailable: IDisassembledInstructionEntry = {
allowBreakpoint: false,
isBreakpointSet: false,
isBreakpointEnaled: false,
instruction: {
address: '-1',
instruction: localize('instructionNotAvailable', "Disassembly not available.")
Expand Down Expand Up @@ -232,6 +234,7 @@ export class DisassemblyView extends EditorPane {
const index = this.getIndexFromAddress(bp.instructionReference);
if (index >= 0) {
this._disassembledInstructions!.row(index).isBreakpointSet = true;
this._disassembledInstructions!.row(index).isBreakpointEnaled = bp.enabled;
changed = true;
}
}
Expand All @@ -247,6 +250,18 @@ export class DisassemblyView extends EditorPane {
}
});

bpEvent.changed?.forEach((bp) => {
if (bp instanceof InstructionBreakpoint) {
const index = this.getIndexFromAddress(bp.instructionReference);
if (index >= 0) {
if (this._disassembledInstructions!.row(index).isBreakpointEnaled !== bp.enabled) {
this._disassembledInstructions!.row(index).isBreakpointEnaled = bp.enabled;
changed = true;
}
}
}
});

// get an updated list so that items beyond the current range would render when reached.
this._instructionBpList = this._debugService.getModel().getInstructionBreakpoints();

Expand Down Expand Up @@ -363,7 +378,7 @@ export class DisassemblyView extends EditorPane {
}
}

newEntries.push({ allowBreakpoint: true, isBreakpointSet: found !== undefined, instruction: instruction });
newEntries.push({ allowBreakpoint: true, isBreakpointSet: found !== undefined, isBreakpointEnaled: !!found?.enabled, instruction: instruction });
}

const specialEntriesToRemove = this._disassembledInstructions.length === 1 ? 1 : 0;
Expand Down Expand Up @@ -467,6 +482,7 @@ class BreakpointRenderer implements ITableRenderer<IDisassembledInstructionEntry
templateId: string = BreakpointRenderer.TEMPLATE_ID;

private readonly _breakpointIcon = 'codicon-' + icons.breakpoint.regular.id;
private readonly _breakpointDisabledIcon = 'codicon-' + icons.breakpoint.disabled.id;
private readonly _breakpointHintIcon = 'codicon-' + icons.debugBreakpointHint.id;
private readonly _debugStackframe = 'codicon-' + icons.debugStackframe.id;
private readonly _debugStackframeFocused = 'codicon-' + icons.debugStackframeFocused.id;
Expand Down Expand Up @@ -542,9 +558,16 @@ class BreakpointRenderer implements ITableRenderer<IDisassembledInstructionEntry
icon.classList.remove(this._breakpointHintIcon);

if (element?.isBreakpointSet) {
icon.classList.add(this._breakpointIcon);
if (element.isBreakpointEnaled) {
icon.classList.add(this._breakpointIcon);
icon.classList.remove(this._breakpointDisabledIcon);
} else {
icon.classList.remove(this._breakpointIcon);
icon.classList.add(this._breakpointDisabledIcon);
}
} else {
icon.classList.remove(this._breakpointIcon);
icon.classList.remove(this._breakpointDisabledIcon);
}
}
}
Expand Down