Skip to content

syntax-highlighting#3

Open
laluxx wants to merge 3 commits intoraeburn:masterfrom
laluxx:master
Open

syntax-highlighting#3
laluxx wants to merge 3 commits intoraeburn:masterfrom
laluxx:master

Conversation

@laluxx
Copy link

@laluxx laluxx commented Nov 14, 2024

Enhanced objdump.el with Modern Emacs Features

This PR modernizes the objdump.el package by adding several features that improve navigation, readability, and integration with modern Emacs packages. The enhancements make the package more user-friendly while maintaining its core functionality.

Features Added

1. Syntax Highlighting

  • Added comprehensive font-lock keywords for:
    • Memory addresses
    • Symbol names and references
    • Assembly instructions
    • CPU registers
    • Immediate values
    • Comments and file information
  • Created custom faces for each element type
  • Improved readability of disassembly output

2. Navigation Enhancements

  • Added objdump-next-function (bound to n and j)
  • Added objdump-previous-function (bound to p and k)
  • Functions automatically recenter the view
  • Added proper error messages when no more functions are found

3. Imenu Integration

  • Added full imenu support for jumping to functions
  • Recenters buffer after jumping to a function

4. Marginalia Integration

  • Added rich completion annotations showing:
    • Function addresses (right-aligned)
    • Function sizes in bytes
  • Custom faces for completion annotations
  • Proper alignment of annotations regardless of symbol name length

5. Quality of Life Improvements

  • Added q keybinding to kill buffer
  • Enabled truncate-lines by default for better assembly display
  • Made buffer position persist after reverting
  • Enhanced status messages with colorized "DONE" indicator

Planned Features

Planning to work on:

  • Function folding with the <tab> key
  • Support for the .data, .bss, and .rodata sections with proper formatting and symbol navigation
  • Integration with DWARF debug info for variable location tracking

Update: Enhanced Navigation and hexl Integration

Structural Movement

  • Hex-level navigation with position tracking:
  • C-f/C-b: Move through hex bytes with intelligent wrapping
  • C-n/C-p: Line navigation preserving column position
  • C-a/C-e: Jump to first/last hex byte on line
  • Handles byte boundaries and byte pairs semantically
  • Preserves column position across function boundaries

Binary Integration

  • RET/C-j: Opens address at point in hexl buffer
  • Synced navigation between disassembly and binary views
  • Simple window management with persistent sizing

Function-Level Navigation

  • mark-defun support through beginning/end-of-defun
  • Proper function boundary detection
  • Forward/backward defun navigation

Dired Integration

  • RET on binaries opens them objdump-mode
  • o for 'objdump-other-window'
  • Automatic integration with dired-mode keybindings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant