mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 00:14:32 -08:00
[kernel] Add get_grandcaller debug function
This should probably be replaced with a function taking the number of steps back, but this is quick and useful.
This commit is contained in:
@@ -10,6 +10,7 @@ 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();
|
||||
|
||||
@@ -14,6 +14,13 @@ get_caller:
|
||||
mov rax, [rbp+8]
|
||||
ret
|
||||
|
||||
global get_grandcaller
|
||||
get_grandcaller:
|
||||
; No prelude - don't touch rsp or rbp
|
||||
mov rax, [rbp]
|
||||
mov rax, [rax+8]
|
||||
ret
|
||||
|
||||
global get_gsbase
|
||||
get_gsbase:
|
||||
rdgsbase rax
|
||||
|
||||
Reference in New Issue
Block a user