mirror of
https://github.com/xenia-project/xenia.git
synced 2026-04-06 07:03:33 +00:00
Threads displayed.
This commit is contained in:
parent
d368e0cb74
commit
a1da55a006
19 changed files with 468 additions and 131 deletions
|
|
@ -1,18 +1,18 @@
|
|||
<div class="debugger-main" ng-controller="CodeTabController">
|
||||
<div class="debugger-header">
|
||||
<div class="btn-group btn-group-sm">
|
||||
<button type="button" class="btn btn-success" ng-click="app.session.continueExecution()" ng-disabled="!app.session.dataSource || !app.session.paused">
|
||||
<button type="button" class="btn btn-success" ng-click="app.session.continueExecution()" ng-disabled="!app.session.paused">
|
||||
<span class="glyphicon glyphicon-play"></span>
|
||||
</button>
|
||||
<button type="button" class="btn btn-danger" ng-click="app.session.breakExecution()" ng-disabled="!app.session.dataSource || app.session.paused">
|
||||
<button type="button" class="btn btn-danger" ng-click="app.session.breakExecution()" ng-disabled="app.session.paused">
|
||||
<span class="glyphicon glyphicon-pause"></span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="btn-group btn-group-sm">
|
||||
<button type="button" class="btn btn-default" ng-click="showLocation()" ng-disabled="!app.session.dataSource || !app.session.paused">
|
||||
<button type="button" class="btn btn-default" ng-click="showLocation()" ng-disabled="!app.session.paused">
|
||||
<span class="glyphicon glyphicon glyphicon-arrow-right"></span>
|
||||
</button>
|
||||
<button type="button" class="btn btn-default" ng-click="app.session.stepNext()" ng-disabled="!app.session.dataSource || !app.session.paused">
|
||||
<button type="button" class="btn btn-default" ng-click="app.session.stepNext()" ng-disabled="!app.session.paused">
|
||||
<span class="glyphicon glyphicon-step-forward"></span>
|
||||
</button>
|
||||
</div>
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
<div class="debugger-fnlist">
|
||||
<div class="debugger-fnlist-header">
|
||||
<div class="debugger-fnlist-header-left btn-group btn-group-xs full-width">
|
||||
<button type="button" class="btn btn-default dropdown-toggle full-width" data-toggle="dropdown">
|
||||
<button type="button" class="btn btn-default dropdown-toggle left-align full-width" data-toggle="dropdown">
|
||||
{{selectedModule.name}} <span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
|
|
@ -29,7 +29,7 @@
|
|||
</ul>
|
||||
</div>
|
||||
<div class="debugger-fnlist-header-right btn-group btn-group-xs">
|
||||
<button type="button" class="btn btn-default" ng-click="showModuleInfo(selectedModule)">
|
||||
<button type="button" class="btn btn-default" ng-click="showModuleInfo()">
|
||||
Info
|
||||
</button>
|
||||
</div>
|
||||
|
|
@ -52,15 +52,21 @@
|
|||
<div class="debugger-fnview-outer" ui-view></div>
|
||||
<div class="debugger-tools">
|
||||
<div class="debugger-tools-threads">
|
||||
<div class="btn-group btn-group-xs full-width">
|
||||
<button type="button" class="btn btn-default dropdown-toggle full-width" data-toggle="dropdown">
|
||||
thread 0 <span class="caret"></span>
|
||||
<div class="debugger-tools-threads-header-left btn-group btn-group-xs full-width">
|
||||
<button type="button" class="btn btn-default left-align dropdown-toggle full-width" data-toggle="dropdown">
|
||||
Thread {{app.session.activeThread.id}}: {{app.session.activeThread.name}} <span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="#">thread 1</a></li>
|
||||
<li><a href="#">thread 2</a></li>
|
||||
<li ng-repeat="thread in app.session.state.threadList | orderBy:'id'">
|
||||
<a href="" ng-click="app.session.activeThread = thread;">Thread {{thread.id}}: {{thread.name}}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="debugger-tools-threads-header-right btn-group btn-group-xs">
|
||||
<button type="button" class="btn btn-default" ng-click="showThreadInfo()">
|
||||
Info
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="debugger-tools-callstack">
|
||||
callstack
|
||||
|
|
|
|||
|
|
@ -23,24 +23,19 @@ module.controller('CodeTabController', function(
|
|||
$scope.functionList = [];
|
||||
|
||||
function refresh() {
|
||||
if (!app.session || !app.session.dataSource) {
|
||||
if (!app.session) {
|
||||
$scope.moduleList = [];
|
||||
return;
|
||||
}
|
||||
var dataSource = app.session.dataSource;
|
||||
|
||||
dataSource.getModuleList().then(function(list) {
|
||||
$scope.moduleList = list;
|
||||
if (!$scope.selectedModule) {
|
||||
if (list.length) {
|
||||
$scope.selectModule(list[0]);
|
||||
}
|
||||
} else {
|
||||
$scope.selectModule($scope.selectedModule);
|
||||
$scope.moduleList = app.session.state.getModuleList();
|
||||
if (!$scope.selectedModule) {
|
||||
if ($scope.moduleList.length) {
|
||||
$scope.selectModule($scope.moduleList[0]);
|
||||
}
|
||||
}, function(e) {
|
||||
log.error('Unable to fetch module list');
|
||||
});
|
||||
} else {
|
||||
$scope.selectModule($scope.selectedModule);
|
||||
}
|
||||
|
||||
console.log('refresh');
|
||||
};
|
||||
|
|
@ -54,15 +49,10 @@ module.controller('CodeTabController', function(
|
|||
$scope.functionList = [];
|
||||
}
|
||||
|
||||
var dataSource = app.session.dataSource;
|
||||
dataSource.getFunctionList(module.name).then(function(list) {
|
||||
$scope.functionList = list;
|
||||
}, function(e) {
|
||||
log.error('Unable to fetch function list');
|
||||
});
|
||||
$scope.functionList = app.session.state.getFunctionList(module.name);
|
||||
};
|
||||
|
||||
$scope.showModuleInfo = function(module) {
|
||||
$scope.showModuleInfo = function() {
|
||||
var modalInstance = $modal.open({
|
||||
templateUrl: 'assets/ui/code/module-info.html',
|
||||
controller: 'ModuleInfoController',
|
||||
|
|
@ -72,13 +62,23 @@ module.controller('CodeTabController', function(
|
|||
return $scope.selectedModule.name;
|
||||
},
|
||||
moduleInfo: function() {
|
||||
return app.session.dataSource.getModule(
|
||||
return app.session.state.getModule(
|
||||
$scope.selectedModule.name);
|
||||
}
|
||||
}
|
||||
});
|
||||
modalInstance.result.then(function() {
|
||||
}, function () {
|
||||
};
|
||||
|
||||
$scope.showThreadInfo = function() {
|
||||
var modalInstance = $modal.open({
|
||||
templateUrl: 'assets/ui/code/thread-info.html',
|
||||
controller: 'ThreadInfoController',
|
||||
windowClass: 'debugger-module-info',
|
||||
resolve: {
|
||||
thread: function() {
|
||||
return app.session.activeThread;
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<div class="debugger-fnview" ng-controller="FunctionViewController">
|
||||
<div class="debugger-fnview-header">
|
||||
<div class="debugger-fnview-header-left">
|
||||
<span class="debugger-fnview-header-name" ng-bind="fn.name"></span>
|
||||
<span class="debugger-fnview-header-name" ng-bind="fn.name"></span><br/>
|
||||
<span class="debugger-fnview-header-address">(0x{{fn.startAddress | hex32}}-0x{{fn.endAddress | hex32}})</span>
|
||||
</div>
|
||||
<div class="debugger-fnview-header-right">
|
||||
|
|
@ -14,6 +14,7 @@
|
|||
<button type="button" class="btn btn-default" ng-model="codeType" btn-radio="'lir'">LIR</button>
|
||||
<button type="button" class="btn btn-default" ng-model="codeType" btn-radio="'machineCode'">MC</button>
|
||||
</div>
|
||||
<!--
|
||||
<div class="btn-group btn-group-sm">
|
||||
<button type="button" class="btn btn-default">1</button>
|
||||
<button type="button" class="btn btn-default">2</button>
|
||||
|
|
@ -28,6 +29,7 @@
|
|||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -21,17 +21,15 @@ module.controller('FunctionViewController', function(
|
|||
$scope.highlightInfo = null;
|
||||
|
||||
function refresh() {
|
||||
if (!app.session || !app.session.dataSource) {
|
||||
if (!app.session) {
|
||||
$scope.fn = null;
|
||||
return;
|
||||
}
|
||||
var dataSource = app.session.dataSource;
|
||||
|
||||
dataSource.getFunction($scope.functionAddress).then(function(fn) {
|
||||
app.session.state.fetchFunction($scope.functionAddress).then(function(fn) {
|
||||
$scope.fn = fn;
|
||||
updateCode();
|
||||
}, function(e) {
|
||||
log.error('Unable to fetch function');
|
||||
log.error('Unable to fetch function.');
|
||||
});
|
||||
};
|
||||
$rootScope.$on('refresh', refresh);
|
||||
|
|
|
|||
35
debugger/assets/ui/code/thread-info.html
Normal file
35
debugger/assets/ui/code/thread-info.html
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" ng-click="close()">×</button>
|
||||
<h4 class="modal-title">Thread {{ thread.id }}: {{ thread.name }}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<table class="table debugger-module-info-outer-table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Thread</td>
|
||||
<td>
|
||||
<table class="table table-hover table-condensed debugger-module-info-inner-table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Stack Address</td>
|
||||
<td><a xe-memref="{{ thread.stackAddress | hex32 }}" ng-click="$close()">{{ thread.stackAddress | hex32 }}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Stack Size</td>
|
||||
<td>{{ thread.stackSize }}b</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>State Address</td>
|
||||
<td><a xe-memref="{{ thread.threadStateAddress | hex32 }}" ng-click="$close()">{{ thread.threadStateAddress | hex32 }}</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
51
debugger/assets/ui/code/thread-info.js
Normal file
51
debugger/assets/ui/code/thread-info.js
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
/**
|
||||
******************************************************************************
|
||||
* Xenia : Xbox 360 Emulator Research Project *
|
||||
******************************************************************************
|
||||
* Copyright 2013 Ben Vanik. All rights reserved. *
|
||||
* Released under the BSD license - see LICENSE in the root for more details. *
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
var module = angular.module('xe.ui.code.threadInfo', [
|
||||
'ui.bootstrap',
|
||||
'xe.log',
|
||||
'xe.session'
|
||||
]);
|
||||
|
||||
|
||||
module.controller('ThreadInfoController', function(
|
||||
$rootScope, $scope, $modal, log, thread) {
|
||||
$scope.thread = thread;
|
||||
|
||||
$scope.headerSort = {
|
||||
column: 'key',
|
||||
reverse: false
|
||||
};
|
||||
$scope.sectionSort = {
|
||||
column: 'startAddress',
|
||||
reverse: false
|
||||
};
|
||||
$scope.staticLibrarySort = {
|
||||
column: 'name',
|
||||
reverse: false
|
||||
};
|
||||
$scope.importSort = {
|
||||
column: 'ordinal',
|
||||
reverse: false
|
||||
};
|
||||
$scope.changeSort = function(sort, column) {
|
||||
if (sort.column == column) {
|
||||
sort.reverse = !sort.reverse;
|
||||
} else {
|
||||
sort.column = column;
|
||||
sort.reverse = false;
|
||||
}
|
||||
};
|
||||
|
||||
$scope.close = function() {
|
||||
$scope.$close(null);
|
||||
};
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue