From 2bb2bd4326c752640ee467ca42f3fb0172757e72 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Fri, 5 Dec 2014 14:32:18 -0500 Subject: [PATCH] display trap name for GetToolTrap, etc. --- toolbox/os.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/toolbox/os.cpp b/toolbox/os.cpp index b7a8091..1dc5a6c 100644 --- a/toolbox/os.cpp +++ b/toolbox/os.cpp @@ -47,6 +47,7 @@ #include #include +#include #include "os.h" #include "os_internal.h" @@ -1042,7 +1043,10 @@ namespace OS * */ uint16_t trapNumber = cpuGetDReg(0); - Log("%04x GetToolTrapAddress($%04x)\n", trap, trapNumber); + const char *trapName = TrapName(trapNumber | 0xa800); + if (!trapName) trapName = "Unknown"; + + Log("%04x GetToolTrapAddress($%04x %s)\n", trap, trapNumber, trapName); cpuSetAReg(0, 0); return MacOS::dsCoreErr; @@ -1066,9 +1070,11 @@ namespace OS uint16_t trapNumber = cpuGetDReg(0); uint32_t trapAddress = cpuGetAReg(0); + const char *trapName = TrapName(trapNumber | 0xa800); + if (!trapName) trapName = "Unknown"; - Log("%04x SetToolTrapAddress($%08x, $%04x)\n", - trap, trapAddress, trapNumber); + Log("%04x SetToolTrapAddress($%08x, $%04x %s)\n", + trap, trapAddress, trapNumber, trapName); return MacOS::dsCoreErr; @@ -1085,7 +1091,10 @@ namespace OS * */ uint16_t trapNumber = cpuGetDReg(0); - Log("%04x GetOSTrapAddress($%04x)\n", trap, trapNumber); + const char *trapName = TrapName(trapNumber | 0xa000); + if (!trapName) trapName = "Unknown"; + + Log("%04x GetOSTrapAddress($%04x %s)\n", trap, trapNumber, trapName); cpuSetAReg(0, 0); return MacOS::dsCoreErr; @@ -1287,4 +1296,4 @@ namespace OS return MacOS::noErr; } -} \ No newline at end of file +}