Commit df1fa005 authored by Mathieu Maret's avatar Mathieu Maret

stack: add comments

parent 0e6a80f6
...@@ -12,6 +12,9 @@ void printStackTrace(unsigned int maxFrames) ...@@ -12,6 +12,9 @@ void printStackTrace(unsigned int maxFrames)
// first function argument (maxFrames) // first function argument (maxFrames)
// return address from caller // return address from caller
// EBP (Extended Base Pointer) of calling function // EBP (Extended Base Pointer) of calling function
//
// retrace function from address could done by optaining function address with gdb or
// objdump -S kernel
unsigned int *ebp = __builtin_frame_address(0); unsigned int *ebp = __builtin_frame_address(0);
for (unsigned int frame = 0; frame < maxFrames; frame++) { for (unsigned int frame = 0; frame < maxFrames; frame++) {
unsigned int eip = ebp[1]; unsigned int eip = ebp[1];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment