Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(debuggerLinesStartAt1, isServer) {
super(path.join(__dirname, '..', '..', '..', 'debug.log'), debuggerLinesStartAt1, isServer === true);
this.breakPointCounter = 0;
this._variableHandles = new vscode_debugadapter_1.Handles();
this._pythonStackFrames = new vscode_debugadapter_1.Handles();
this.registeredBreakpoints = new Map();
this.registeredBreakpointsByFileName = new Map();
this.debuggerLoaded = new Promise(resolve => {
this.debuggerLoadedPromiseResolve = resolve;
});
}
// tslint:disable-next-line:no-unnecessary-override
constructor(debuggerLinesStartAt1, isServer) {
super(path.join(__dirname, '..', '..', '..', 'debug.log'), debuggerLinesStartAt1, isServer === true);
this.breakPointCounter = 0;
this._variableHandles = new vscode_debugadapter_1.Handles();
this._pythonStackFrames = new vscode_debugadapter_1.Handles();
this.registeredBreakpoints = new Map();
this.registeredBreakpointsByFileName = new Map();
this.debuggerLoaded = new Promise(resolve => {
this.debuggerLoadedPromiseResolve = resolve;
});
}
// tslint:disable-next-line:no-unnecessary-override
constructor(threadID: number, allThreads: boolean = true) {
super('custom-continued', { threadID: threadID, allThreads: allThreads });
}
}
const traceThreads = false;
export class GDBDebugSession extends DebugSession {
private server: GDBServer;
private args: ConfigurationArguments;
private ports: { [name: string]: number };
private serverController: GDBServerController;
private symbolTable: SymbolTable;
protected variableHandles = new Handles(VAR_HANDLES_START);
protected variableHandlesReverse: { [id: string]: number } = {};
protected quit: boolean;
protected attached: boolean;
protected trimCWD: string;
protected switchCWD: string;
protected started: boolean;
protected crashed: boolean;
protected debugReady: boolean;
protected miDebugger: MI2;
protected commandServer: net.Server;
protected forceDisassembly: boolean = false;
protected activeEditorPath: string = null;
// currentThreadId is the currently selected thread or where execution has stopped. It not very
// meaningful since the current thread id in gdb can change in many ways (when you use a --thread
// option on certain commands)
protected currentThreadId: number = 0;
public constructor(debuggerLinesStartAt1: boolean, isServer: boolean) {
super(debuggerLinesStartAt1, isServer === true);
this._variableHandles = new Handles();
}
}
class CustomContinuedEvent extends Event implements DebugProtocol.Event {
body: {
threadID: number;
allThreads: boolean;
}
event: string;
constructor(threadID: number, allThreads: boolean = true) {
super('custom-continued', { threadID: threadID, allThreads: allThreads });
}
}
export class MI2DebugSession extends DebugSession {
protected variableHandles = new Handles(VAR_HANDLES_START);
protected variableHandlesReverse: { [id: string]: number } = {};
protected quit: boolean;
protected attached: boolean;
protected trimCWD: string;
protected switchCWD: string;
protected started: boolean;
protected crashed: boolean;
protected debugReady: boolean;
protected miDebugger: MI2;
protected threadID: number = 1;
protected commandServer: net.Server;
public constructor(debuggerLinesStartAt1: boolean, isServer: boolean = false, threadID: number = 1) {
super(debuggerLinesStartAt1, isServer);
this.threadID = threadID;
}
constructor(debuggerLinesStartAt1, isServer = false) {
super('', debuggerLinesStartAt1, isServer);
this.packageInfo = new Map();
this.logLevel = vscode_debugadapter_1.Logger.LogLevel.Error;
this.initdone = 'initdone·';
this.showGlobalVariables = false;
this.continueEpoch = 0;
this.continueRequestRunning = false;
this.variableHandles = new vscode_debugadapter_1.Handles();
this.skipStopEventOnce = false;
this.stopOnEntry = false;
this.goroutines = new Set();
this.debugState = null;
this.delve = null;
this.breakpoints = new Map();
this.stackFrameHandles = new vscode_debugadapter_1.Handles();
}
initializeRequest(response, args) {
constructor(debuggerLinesStartAt1, isServer = false) {
super('', debuggerLinesStartAt1, isServer);
this.packageInfo = new Map();
this.logLevel = vscode_debugadapter_1.Logger.LogLevel.Error;
this.initdone = 'initdone·';
this.showGlobalVariables = false;
this.continueEpoch = 0;
this.continueRequestRunning = false;
this.variableHandles = new vscode_debugadapter_1.Handles();
this.skipStopEventOnce = false;
this.stopOnEntry = false;
this.goroutines = new Set();
this.debugState = null;
this.delve = null;
this.breakpoints = new Map();
this.stackFrameHandles = new vscode_debugadapter_1.Handles();
}
initializeRequest(response, args) {
constructor(runtime: RuntimeInterface) {
this._runtime = runtime;
this._scopes = new Array();
this._scopes.push(new Scope(SCOPES.all.name, SCOPES.all.ref, false));
this._handles = new Handles(SCOPES.dynamicVariables.ref);
}
public constructor(debuggerLinesStartAt1: boolean, isServer: boolean) {
super(debuggerLinesStartAt1, isServer === true);
this._variableHandles = new Handles();
this.registeredBreakpoints = new Map();
this.registeredBreakpointsByFileName = new Map();
}
this._launchArgs = args;
this._debuggerProc = child_process.spawn('ocamldebug', ocdArgs);
this._debuggerProc.on('exit', () => {
this.sendEvent(new TerminatedEvent());
});
let debuggerEncoding = checkEncoding('ocamldebugEncoding', args.ocamldebugEncoding);
this._debuggerProc[DECODED_STDOUT] = iconv.decodeStream(debuggerEncoding);
this._debuggerProc.stdout.pipe(this._debuggerProc[DECODED_STDOUT]);
this._debuggerProc[DECODED_STDERR] = iconv.decodeStream(debuggerEncoding);
this._debuggerProc.stderr.pipe(this._debuggerProc[DECODED_STDERR]);
this._breakpoints = new Map();
this._functionBreakpoints = [];
this._variableHandles = new Handles();
this._wait = this.readUntilPrompt().then(() => { });
this.ocdCommand(['set', 'loadingmode', 'manual'], () => { });
let once = false;
let onceSocketListened = (message: string) => {
if (once) return;
once = true;
if (this._remoteMode) {
this.sendEvent(new OutputEvent(message));
} else {
launchDebuggee();
}
};