Draft
Implement symbol names in backtrace functionality#11
Conversation
Co-authored-by: 0x6D70 <43414123+0x6D70@users.noreply.github.com>
Co-authored-by: 0x6D70 <43414123+0x6D70@users.noreply.github.com>
Co-authored-by: 0x6D70 <43414123+0x6D70@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] print symbol names
Implement symbol names in backtrace functionality
Jul 5, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements the TODO to print symbol names in the backtrace functionality located in
kernel/src/utils/backtrace.rs.Changes Made
1. Created Symbol Management Module (
kernel/src/symbols.rs)BTreeMapfor efficient symbol lookups by addressKernelFileRequest2. Enhanced Backtrace Output (
kernel/src/utils/backtrace.rs)symbols::get_symbol(rip)for each stack frame3. Integration and Testing
Before vs After
Before (TODO):
After (Implemented):
Example backtrace output:
Technical Details
The implementation uses limine's
KernelFileRequestto access the kernel ELF file at runtime, then parses the symbol table to extract function names and addresses. Symbol lookup uses efficient binary search through the sorted address space, with support for both exact matches and reasonable offset-based matches.The symbol resolution algorithm:
<unknown>for addresses that can't be resolvedFixes #10.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.