Usermode/ld-acess - Clean up loadlib.c, improved debug
[tpg/acess2.git] / KernelLand / Kernel / debug_hooks.c
1 /*
2  * Acess2 Kernel
3  * - By John Hodge (thePowersGang)
4  * 
5  * debug_hooks.c
6  * - Keyboard/serial kernel debug hooks
7  */
8 #include <acess.h>
9 #include <debug_hooks.h>
10
11 // === CODE ===
12 void DebugHook_HandleInput(tDebugHook *HookHandle, size_t Length, const char *Input)
13 {
14         switch(*Input)
15         {
16         case '0' ... '9':
17                 HookHandle->Value *= 10;
18                 HookHandle->Value += *Input - '0';
19                 break;
20         // Instruction Tracing
21         case 't':
22                 Log("Toggle instruction tracing on %i\n", HookHandle->Value);
23                 Threads_ToggleTrace( HookHandle->Value );
24                 HookHandle->Value = 0;
25                 break;
26         
27         // Thread List Dump
28         case 'p':       Threads_Dump(); return;
29         // Heap Statistics
30         case 'h':       Heap_Stats();   return;
31         // PMem Statistics
32         case 'm':       MM_DumpStatistics();    return;
33         // Dump Structure
34         case 's':       return;
35         
36         // Validate structures
37         //case 'v':
38         //      Validate_VirtualMemoryUsage();
39         //      return;
40         }
41 }
42

UCC git Repository :: git.ucc.asn.au