diff --git a/debugger/assets/styles/app.css b/debugger/assets/styles/app.css index 1a599c6fa..a66515e68 100644 --- a/debugger/assets/styles/app.css +++ b/debugger/assets/styles/app.css @@ -342,6 +342,68 @@ body { order: 3; flex: 1 1 auto; padding: 5px; + overflow-y: auto; +} +.debugger-tools-registers-container { + display: flex; + flex-direction: column; + flex-wrap: wrap; + justify-content: flex-start; + align-content: flex-start; + align-items: flex-start; + margin-bottom: 5px; +} +.debugger-tools-registers-entry { + flex: 0 0 auto; + font-family: monospace; + padding-right: 5px; + width: 160px; +} +.debugger-tools-registers-entry .name { + font-weight: bold; + width: 26px; + display: inline-block; + text-align: right; +} +.debugger-tools-registers-entry .value { +} +.debugger-tools-registers-container.special { + height: 46px; +} +.debugger-tools-registers-container.gpr { + height: 332px; +} +.special .debugger-tools-registers-entry, +.gpr .debugger-tools-registers-entry { + width: 300px; +} +.debugger-tools-registers-entry .hex-value { + border-style: none; + padding: 0; + width: 130px; + text-align: right; +} +.debugger-tools-registers-entry .int-value { + display: inline-block; + border-style: none; + padding: 0; + width: 92px; + text-align: right; +} +.debugger-tools-registers-container.fpr { + height: 172px; +} +.fpr .debugger-tools-registers-entry { + width: 170px; +} +.fpr .debugger-tools-registers-entry .value { + white-space: pre; +} +.vec .debugger-tools-registers-entry { + width: 160px; +} +.vec .debugger-tools-registers-entry .name { + width: 35px; } .debugger-module-info { diff --git a/debugger/assets/ui/code/code-tab.html b/debugger/assets/ui/code/code-tab.html index 79a7e1bef..e4d58d23d 100644 --- a/debugger/assets/ui/code/code-tab.html +++ b/debugger/assets/ui/code/code-tab.html @@ -37,7 +37,7 @@
- +
{{fn.name}}
@@ -72,7 +72,64 @@ callstack
- registers +
+
+ pc + +
+
+ lr + +
+
+ ctr + + +
+
+
+
+ r{{$index}} + + +
+
+
+
+ f{{$index}} + {{v|exp8}} +
+
+
diff --git a/debugger/assets/ui/code/code-tab.js b/debugger/assets/ui/code/code-tab.js index 6390e7317..07530a919 100644 --- a/debugger/assets/ui/code/code-tab.js +++ b/debugger/assets/ui/code/code-tab.js @@ -18,6 +18,7 @@ var module = angular.module('xe.ui.code', [ module.controller('CodeTabController', function( $rootScope, $scope, $modal, app, log) { + $scope.app = app; $scope.moduleList = []; $scope.selectedModule = null; $scope.functionList = []; diff --git a/debugger/src/filters.js b/debugger/src/filters.js index 8bb6416c6..d76fb4637 100644 --- a/debugger/src/filters.js +++ b/debugger/src/filters.js @@ -31,3 +31,15 @@ module.filter('hex32', function() { } }; }); + +module.filter('exp8', function() { + return function(number) { + if (number !== null && number !== undefined) { + var str = number.toExponential(8); + if (number >= 0) { + str = ' ' + str; + } + return str; + } + } +}); diff --git a/src/xenia/cpu/processor.cc b/src/xenia/cpu/processor.cc index 4b24f88e6..0ae8d0854 100644 --- a/src/xenia/cpu/processor.cc +++ b/src/xenia/cpu/processor.cc @@ -722,13 +722,24 @@ json_t* Processor::DumpThreadState(XenonThreadState* thread_state) { json_object_set_integer_new( result, "threadStateAddress", thread_state->thread_state_address()); + char value[32]; + json_t* context_json = json_object(); auto context = thread_state->context(); + json_object_set_new( + context_json, "pc", json_integer(0)); json_object_set_new( context_json, "lr", json_integer(context->lr)); + json_object_set_new( context_json, "ctr", json_integer(context->ctr)); + xesnprintfa(value, XECOUNT(value), "%.16llX", context->ctr); + json_object_set_new( + context_json, "ctrh", json_string(value)); + xesnprintfa(value, XECOUNT(value), "%lld", context->ctr); + json_object_set_new( + context_json, "ctrs", json_string(value)); // xer // cr* @@ -739,12 +750,34 @@ json_t* Processor::DumpThreadState(XenonThreadState* thread_state) { json_array_append_new(r_json, json_integer(context->r[n])); } json_object_set_new(context_json, "r", r_json); + json_t* rh_json = json_array(); + for (size_t n = 0; n < 32; n++) { + xesnprintfa(value, XECOUNT(value), "%.16llX", context->r[n]); + json_array_append_new(rh_json, json_string(value)); + } + json_object_set_new(context_json, "rh", rh_json); + json_t* rs_json = json_array(); + for (size_t n = 0; n < 32; n++) { + xesnprintfa(value, XECOUNT(value), "%lld", context->r[n]); + json_array_append_new(rs_json, json_string(value)); + } + json_object_set_new(context_json, "rs", rs_json); json_t* f_json = json_array(); for (size_t n = 0; n < 32; n++) { json_array_append_new(f_json, json_real(context->f[n])); } json_object_set_new(context_json, "f", f_json); + json_t* fh_json = json_array(); + for (size_t n = 0; n < 32; n++) { + union { + double f; + uint64_t i; + } fi = { context->f[n] }; + xesnprintfa(value, XECOUNT(value), "%.16llX", fi.i); + json_array_append_new(fh_json, json_string(value)); + } + json_object_set_new(context_json, "fh", fh_json); json_t* v_json = json_array(); for (size_t n = 0; n < 128; n++) {