Fixing various bugs.
This commit is contained in:
parent
44cbe1bbcf
commit
062610c596
|
@ -190,7 +190,7 @@ module.controller('FunctionViewController', function(
|
||||||
var address = sourceLine[1];
|
var address = sourceLine[1];
|
||||||
var breakpoint = app.session.breakpoints[address];
|
var breakpoint = app.session.breakpoints[address];
|
||||||
var el;
|
var el;
|
||||||
if (breakpoint) {
|
if (breakpoint && breakpoint.type == 'code') {
|
||||||
el = document.createElement('span');
|
el = document.createElement('span');
|
||||||
el.classList.add('debugger-fnview-gutter-icon-el');
|
el.classList.add('debugger-fnview-gutter-icon-el');
|
||||||
if (breakpoint.enabled) {
|
if (breakpoint.enabled) {
|
||||||
|
|
|
@ -54,13 +54,22 @@ module.service('app', function(
|
||||||
};
|
};
|
||||||
|
|
||||||
App.prototype.open = function(sessionId) {
|
App.prototype.open = function(sessionId) {
|
||||||
|
var d = $q.defer();
|
||||||
|
|
||||||
|
// Ignore if already open.
|
||||||
|
if (this.session && this.session.id == sessionId) {
|
||||||
|
d.resolve(this.session);
|
||||||
|
return d.promise;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Close existing.
|
||||||
this.close();
|
this.close();
|
||||||
|
|
||||||
var d = $q.defer();
|
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
|
||||||
log.info('Opening session ' + sessionId);
|
log.info('Opening session ' + sessionId);
|
||||||
|
|
||||||
|
// Open session.
|
||||||
var session = new Session(sessionId);
|
var session = new Session(sessionId);
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.setSession(session);
|
this.setSession(session);
|
||||||
|
|
|
@ -132,6 +132,8 @@ module.service('Session', function(
|
||||||
};
|
};
|
||||||
|
|
||||||
Session.prototype.setDataSource = function(dataSource) {
|
Session.prototype.setDataSource = function(dataSource) {
|
||||||
|
var self = this;
|
||||||
|
|
||||||
var d = $q.defer();
|
var d = $q.defer();
|
||||||
if (this.dataSource) {
|
if (this.dataSource) {
|
||||||
this.dataSource.dispose();
|
this.dataSource.dispose();
|
||||||
|
@ -157,6 +159,29 @@ module.service('Session', function(
|
||||||
}
|
}
|
||||||
ps.push(this.dataSource.addBreakpoints(breakpointList));
|
ps.push(this.dataSource.addBreakpoints(breakpointList));
|
||||||
|
|
||||||
|
// Fetch main module info.
|
||||||
|
// We need this for entry point info/etc.
|
||||||
|
var moduleInfoDeferred = $q.defer();
|
||||||
|
this.dataSource.getModuleList().then(function(moduleList) {
|
||||||
|
if (!moduleList.length) {
|
||||||
|
// Uh.
|
||||||
|
log.error('No modules loaded on startup!');
|
||||||
|
moduleInfoDeferred.reject(new Error('No modules found'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
moduleList.forEach(function(module) {
|
||||||
|
dataSource.getModule(module.name).then(function(moduleInfo) {
|
||||||
|
// Put a breakpoint at the entry point.
|
||||||
|
var entryPoint = moduleInfo.exeEntryPoint;
|
||||||
|
self.addTempBreakpoint(entryPoint, entryPoint);
|
||||||
|
moduleInfoDeferred.resolve();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}, function(e) {
|
||||||
|
moduleInfoDeferred.reject(e);
|
||||||
|
});
|
||||||
|
ps.push(moduleInfoDeferred.promise);
|
||||||
|
|
||||||
$q.all(ps).then((function() {
|
$q.all(ps).then((function() {
|
||||||
this.dataSource.makeReady().then(function() {
|
this.dataSource.makeReady().then(function() {
|
||||||
d.resolve();
|
d.resolve();
|
||||||
|
@ -227,6 +252,8 @@ module.service('Session', function(
|
||||||
// Now paused!
|
// Now paused!
|
||||||
this.paused = true;
|
this.paused = true;
|
||||||
|
|
||||||
|
$rootScope.$emit('refresh');
|
||||||
|
|
||||||
if (breakpointId) {
|
if (breakpointId) {
|
||||||
var breakpoint = this.breakpointsById[breakpointId];
|
var breakpoint = this.breakpointsById[breakpointId];
|
||||||
var thread = null; // TODO
|
var thread = null; // TODO
|
||||||
|
@ -239,10 +266,11 @@ module.service('Session', function(
|
||||||
breakpoint.address.toString(16).toUpperCase() + '.');
|
breakpoint.address.toString(16).toUpperCase() + '.');
|
||||||
|
|
||||||
$state.go('session.code.function', {
|
$state.go('session.code.function', {
|
||||||
'function': breakpoint.fnAddress.toString(16).toUpperCase(),
|
sessionId: this.id,
|
||||||
'a': breakpoint.address.toString(16).toUpperCase()
|
function: breakpoint.fnAddress.toString(16).toUpperCase(),
|
||||||
|
a: breakpoint.address.toString(16).toUpperCase()
|
||||||
}, {
|
}, {
|
||||||
notify: false,
|
notify: true,
|
||||||
reloadOnSearch: false
|
reloadOnSearch: false
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
@ -270,6 +298,7 @@ module.service('Session', function(
|
||||||
this.paused = true;
|
this.paused = true;
|
||||||
this.dataSource.breakExecution().then(function() {
|
this.dataSource.breakExecution().then(function() {
|
||||||
log.info('Execution paused.');
|
log.info('Execution paused.');
|
||||||
|
$rootScope.$emit('refresh');
|
||||||
}, function(e) {
|
}, function(e) {
|
||||||
log.error('Unable to break: ' + e);
|
log.error('Unable to break: ' + e);
|
||||||
});
|
});
|
||||||
|
|
|
@ -82,7 +82,7 @@ int IVMFunction::RemoveBreakpointImpl(Breakpoint* breakpoint) {
|
||||||
if (i->debug_flags) {
|
if (i->debug_flags) {
|
||||||
auto old_breakpoint = FindBreakpoint(breakpoint->address());
|
auto old_breakpoint = FindBreakpoint(breakpoint->address());
|
||||||
if (old_breakpoint) {
|
if (old_breakpoint) {
|
||||||
uint64_t breakpoint_ptr = (uint64_t)breakpoint;
|
uint64_t breakpoint_ptr = (uint64_t)old_breakpoint;
|
||||||
i->src2_reg = (uint32_t)breakpoint_ptr;
|
i->src2_reg = (uint32_t)breakpoint_ptr;
|
||||||
i->src3_reg = (uint32_t)(breakpoint_ptr >> 32);
|
i->src3_reg = (uint32_t)(breakpoint_ptr >> 32);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue