Function comments (v1)
This commit is contained in:
@@ -9,6 +9,13 @@
|
||||
|
||||
extern struct init_status init;
|
||||
|
||||
/*
|
||||
* debug_stack_trace - Prints the stack trace
|
||||
* @max_frames: Maximum amount of stack frames to walk
|
||||
*
|
||||
* Walks back the stack and gets all return values (RIP)
|
||||
* and prints them to the DEBUG interface.
|
||||
*/
|
||||
void debug_stack_trace(unsigned int max_frames)
|
||||
{
|
||||
DEBUG("*** begin stack trace ***");
|
||||
@@ -52,7 +59,16 @@ typedef struct {
|
||||
__attribute__((weak)) extern kernel_symbol_t symbol_table[];
|
||||
__attribute__((weak)) extern uint64_t symbol_count;
|
||||
|
||||
// binary search
|
||||
/*
|
||||
* debug_find_symbol - Finds the symbol name associated to an address
|
||||
* @rip: Pointer to executable code
|
||||
* @offset: Out pointer to reference the offset in the found function, if any
|
||||
*
|
||||
* Return:
|
||||
* <symbol name> - symbol name
|
||||
* "???" - no symbol table found
|
||||
* "unknown" - symbol table found, but address isn't in the table
|
||||
*/
|
||||
const char* debug_find_symbol(uintptr_t rip, uintptr_t* offset)
|
||||
{
|
||||
if (!symbol_table || symbol_count == 0) {
|
||||
|
||||
Reference in New Issue
Block a user