mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Support doing kernel calltraces on another stack.
This commit is contained in:
parent
ef53864d36
commit
7b3fd0f06f
4 changed files with 22 additions and 10 deletions
|
@ -1,6 +1,6 @@
|
|||
/*******************************************************************************
|
||||
|
||||
Copyright(C) Jonas 'Sortie' Termansen 2012.
|
||||
Copyright(C) Jonas 'Sortie' Termansen 2012, 2013.
|
||||
|
||||
This file is part of Sortix.
|
||||
|
||||
|
@ -28,16 +28,16 @@
|
|||
namespace Sortix {
|
||||
namespace Calltrace {
|
||||
|
||||
extern "C" void calltrace();
|
||||
extern "C" void calltrace(unsigned long ptr);
|
||||
extern "C" void calltrace_print_function(size_t index, addr_t ip)
|
||||
{
|
||||
Log::PrintF("%zu: 0x%zx\n", index, ip);
|
||||
}
|
||||
|
||||
void Perform()
|
||||
void Perform(unsigned long ptr)
|
||||
{
|
||||
Log::PrintF("Calltrace:\n");
|
||||
calltrace();
|
||||
calltrace(ptr);
|
||||
}
|
||||
|
||||
} // namespace Calltrace
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*******************************************************************************
|
||||
|
||||
Copyright(C) Jonas 'Sortie' Termansen 2012.
|
||||
Copyright(C) Jonas 'Sortie' Termansen 2012, 2013.
|
||||
|
||||
This file is part of Sortix.
|
||||
|
||||
|
@ -27,7 +27,9 @@
|
|||
|
||||
namespace Sortix {
|
||||
namespace Calltrace {
|
||||
void Perform();
|
||||
|
||||
void Perform(unsigned long ptr = 0);
|
||||
|
||||
} // namespace Calltrace
|
||||
} // namespace Sortix
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*******************************************************************************
|
||||
|
||||
Copyright(C) Jonas 'Sortie' Termansen 2011, 2012.
|
||||
Copyright(C) Jonas 'Sortie' Termansen 2012, 2013.
|
||||
|
||||
This file is part of Sortix.
|
||||
|
||||
|
@ -31,8 +31,13 @@ calltrace:
|
|||
push %rbp
|
||||
push %rbx
|
||||
movq %rsp, %rbp
|
||||
xorl %edi, %edi
|
||||
push %rbx
|
||||
movq %rdi, %rbx
|
||||
testq %rbx, %rbx
|
||||
jnz 1f
|
||||
movq %rbp, %rbx
|
||||
1:
|
||||
xorl %edi, %edi
|
||||
|
||||
calltrace_unwind:
|
||||
testq %rbx, %rbx
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*******************************************************************************
|
||||
|
||||
Copyright(C) Jonas 'Sortie' Termansen 2011, 2012.
|
||||
Copyright(C) Jonas 'Sortie' Termansen 2012, 2013.
|
||||
|
||||
This file is part of Sortix.
|
||||
|
||||
|
@ -31,8 +31,13 @@ calltrace:
|
|||
push %ebp
|
||||
push %ebx
|
||||
movl %esp, %ebp
|
||||
xorl %edi, %edi
|
||||
push %ebx
|
||||
movl 8(%ebp), %ebx
|
||||
testl %ebx, %ebx
|
||||
jnz 1f
|
||||
movl %ebp, %ebx
|
||||
1:
|
||||
xorl %edi, %edi
|
||||
|
||||
calltrace_unwind:
|
||||
testl %ebx, %ebx
|
||||
|
|
Loading…
Reference in a new issue