Added examining memory locations (fix #64)

also added a way to run mi commands over unix domain sockets so other applications can communicate with code-debug
This commit is contained in:
WebFreak001 2016-07-23 02:13:36 +02:00
commit 87ff8b8644
5 changed files with 184 additions and 7 deletions

View file

@ -56,4 +56,5 @@ export interface IBackend {
evalExpression(name: string): Thenable<any>;
isReady(): boolean;
changeVariable(name: string, rawValue: string): Thenable<any>;
examineMemory(from: number, to: number): Thenable<any>;
}

View file

@ -556,6 +556,14 @@ export class MI2 extends EventEmitter implements IBackend {
});
}
examineMemory(from: number, length: number): Thenable<any> {
return new Promise((resolve, reject) => {
this.sendCommand("data-read-memory-bytes 0x" + from.toString(16) + " " + length).then((result) => {
resolve(result.result("memory[0].contents"));
}, reject);
});
}
evalExpression(name: string): Thenable<any> {
return new Promise((resolve, reject) => {
this.sendCommand("data-evaluate-expression " + name).then((result) => {