mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 08:24:32 -08:00
I'm a tabs guy. I like tabs, it's an elegant way to represent indentation instead of brute-forcing it. But I have to admit that the world seems to be going towards spaces, and tooling tends not to play nice with tabs. So here we go, changing the whole repo to spaces since I'm getting tired of all the inconsistent formatting.
29 lines
710 B
C
29 lines
710 B
C
#pragma once
|
|
/// \file debug.h
|
|
/// Debugging utilities
|
|
|
|
#include <stdint.h>
|
|
|
|
struct cpu_state;
|
|
|
|
extern "C" {
|
|
uintptr_t get_rsp();
|
|
uintptr_t get_rip();
|
|
uintptr_t get_caller();
|
|
uintptr_t get_grandcaller();
|
|
uintptr_t get_frame(int frame);
|
|
uintptr_t get_gsbase();
|
|
void _halt();
|
|
}
|
|
|
|
extern size_t __counter_syscall_enter;
|
|
extern size_t __counter_syscall_sysret;
|
|
|
|
void print_regs(const cpu_state ®s);
|
|
void print_stack(const cpu_state ®s);
|
|
|
|
#define print_regL(name, value) cons->printf(" %s: %016lx", name, (value));
|
|
#define print_regM(name, value) cons->printf(" %s: %016lx", name, (value));
|
|
#define print_regR(name, value) cons->printf(" %s: %016lx\n", name, (value));
|
|
|