Improve debugging functions

- More sensible stack tracer, in C++ (no symbols yet)
- Was forgetting to add null frame to new kernel stacks
- __kernel_assert was using an old vector
- A GP fault will only print its associated table entry
This commit is contained in:
Justin C. Miller
2019-03-15 00:47:46 -07:00
parent 6410c898c5
commit bf8286d15f
9 changed files with 81 additions and 66 deletions

View File

@@ -143,8 +143,9 @@ scheduler::load_process(const char *name, const void *data, size_t size)
// Create a one-page kernel stack space
void *stack0 = proc->setup_kernel_stack(stack_size, 0);
// Stack grows down, point to the end
void *sp0 = kutil::offset_pointer(stack0, stack_size);
// Stack grows down, point to the end, resere space for initial null frame
static const size_t null_frame = sizeof(uint64_t);
void *sp0 = kutil::offset_pointer(stack0, stack_size - null_frame);
cpu_state *state = reinterpret_cast<cpu_state *>(sp0) - 1;