diff --git a/debugger/assets/ui/code/code-tab.js b/debugger/assets/ui/code/code-tab.js
index 55fb8e14b..1dcbd7735 100644
--- a/debugger/assets/ui/code/code-tab.js
+++ b/debugger/assets/ui/code/code-tab.js
@@ -17,16 +17,42 @@ var module = angular.module('xe.ui.code', [
module.controller('CodeTabController', function(
$rootScope, $scope, app, log) {
+ $scope.moduleList = [];
+ $scope.selectedModule = null;
+ $scope.functionList = [];
$rootScope.$on('refresh', function() {
var dataSource = app.session.dataSource;
dataSource.getModuleList().then(function(list) {
- console.log(list);
+ $scope.moduleList = list;
+ if (!$scope.selectedModule) {
+ if (list.length) {
+ $scope.selectModule(list[0]);
+ }
+ } else {
+ $scope.selectModule($scope.selectedModule);
+ }
}, function(e) {
- log('Unable to fetch module list');
+ log.error('Unable to fetch module list');
});
console.log('refresh');
});
+
+ $scope.selectModule = function(module) {
+ var moduleChange = module != $scope.selectedModule;
+ $scope.selectedModule = module;
+
+ if (moduleChange) {
+ $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');
+ });
+ };
});
diff --git a/debugger/assets/ui/code/function-view.html b/debugger/assets/ui/code/function-view.html
index 980b207bb..884fcf884 100644
--- a/debugger/assets/ui/code/function-view.html
+++ b/debugger/assets/ui/code/function-view.html
@@ -1,2 +1,43 @@
-TODO: function
-
+
diff --git a/debugger/assets/ui/code/function-view.js b/debugger/assets/ui/code/function-view.js
new file mode 100644
index 000000000..c9d46163d
--- /dev/null
+++ b/debugger/assets/ui/code/function-view.js
@@ -0,0 +1,33 @@
+/**
+ ******************************************************************************
+ * 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.functionView', [
+ 'xe.log',
+ 'xe.session'
+]);
+
+
+module.controller('FunctionViewController', function(
+ $rootScope, $scope, app, log) {
+ $scope.codeType = 'ppc';
+
+ function refresh() {
+ var dataSource = app.session.dataSource;
+
+ dataSource.getFunction($scope.functionAddress).then(function(fn) {
+ $scope.fn = fn;
+ }, function(e) {
+ log.error('Unable to fetch function');
+ });
+ };
+ $rootScope.$on('refresh', refresh);
+ $scope.$watch('functionAddress', refresh);
+});
diff --git a/debugger/index.html b/debugger/index.html
index ff21331d1..41b7f67c6 100644
--- a/debugger/index.html
+++ b/debugger/index.html
@@ -26,12 +26,14 @@
+
+