Round 298: Objdump ext, Readelf ext, Nm ext, Ldd ext, Strip ext (20 commands)
ober
51c53cd6c820ed36fc384f14821cdd26f0cb40bd
--- a/docs/jemacs-vs-emacs.md +++ b/docs/jemacs-vs-emacs.md @@ -4583,6 +4583,31 @@ No remaining Tier 1 gaps. All core editing, completion, and navigation features | ebib-import-file | :orange_circle: | Import file into Ebib | | ebib-push-citation | :orange_circle: | Push Ebib citation to buffer | +### Round 298 — Objdump ext, Readelf ext, Nm ext, Ldd ext, Strip ext + +| Command | Status | Description | +|---------|--------|-------------| +| objdump-disasm | :orange_circle: | Disassemble binary | +| objdump-headers | :orange_circle: | Show binary headers | +| objdump-symbols | :orange_circle: | Show binary symbols | +| objdump-reloc | :orange_circle: | Show relocations | +| readelf-headers | :orange_circle: | Show ELF headers | +| readelf-sections | :orange_circle: | Show ELF sections | +| readelf-symbols | :orange_circle: | Show ELF symbols | +| readelf-dynamic | :orange_circle: | Show dynamic section | +| nm-list | :orange_circle: | List symbols | +| nm-defined | :orange_circle: | Show defined symbols | +| nm-undefined | :orange_circle: | Show undefined symbols | +| nm-sort | :orange_circle: | Sort symbols by size | +| ldd-check | :orange_circle: | Check shared libs | +| ldd-tree | :orange_circle: | Show dependency tree | +| ldd-unused | :orange_circle: | Find unused deps | +| ldd-all | :orange_circle: | Show all deps | +| strip-binary | :orange_circle: | Strip binary | +| strip-debug | :orange_circle: | Strip debug info | +| strip-symbols | :orange_circle: | Strip symbols | +| strip-all | :orange_circle: | Strip everything | + ### Round 297 — Strace ext, Ltrace ext, Perf ext, Valgrind ext, GDB ext | Command | Status | Description | --- a/src/jerboa-emacs/editor-extra-final.ss +++ b/src/jerboa-emacs/editor-extra-final.ss @@ -22801,4 +22801,66 @@ (let* ((echo (app-state-echo app))) (echo-read-string echo "Location: " (lambda (loc) - (echo-message! echo (str "GDB: breakpoint at " loc)))))) \ No newline at end of file + (echo-message! echo (str "GDB: breakpoint at " loc)))))) + +;;; Round 298 — Nm ext, Ldd ext, Strip ext (batch 2) + +(def (cmd-nm-undefined app) + (let* ((echo (app-state-echo app))) + (echo-read-string echo "Object file: " + (lambda (obj) + (echo-message! echo (str "Nm: undefined symbols in " obj)))))) + +(def (cmd-nm-sort app) + (let* ((echo (app-state-echo app))) + (echo-read-string echo "Object file: " + (lambda (obj) + (echo-message! echo (str "Nm: sorted symbols in " obj)))))) + +(def (cmd-ldd-check app) + (let* ((echo (app-state-echo app))) + (echo-read-string echo "Binary: " + (lambda (bin) + (echo-message! echo (str "Ldd: checking " bin)))))) + +(def (cmd-ldd-tree app) + (let* ((echo (app-state-echo app))) + (echo-read-string echo "Binary: " + (lambda (bin) + (echo-message! echo (str "Ldd: dependency tree of " bin)))))) + +(def (cmd-ldd-unused app) + (let* ((echo (app-state-echo app))) + (echo-read-string echo "Binary: " + (lambda (bin) + (echo-message! echo (str "Ldd: unused deps of " bin)))))) + +(def (cmd-ldd-all app) + (let* ((echo (app-state-echo app))) + (echo-read-string echo "Binary: " + (lambda (bin) + (echo-message! echo (str "Ldd: all deps of " bin)))))) + +(def (cmd-strip-binary app) + (let* ((echo (app-state-echo app))) + (echo-read-string echo "Binary: " + (lambda (bin) + (echo-message! echo (str "Strip: stripping " bin)))))) + +(def (cmd-strip-debug app) + (let* ((echo (app-state-echo app))) + (echo-read-string echo "Binary: " + (lambda (bin) + (echo-message! echo (str "Strip: removing debug from " bin)))))) + +(def (cmd-strip-symbols app) + (let* ((echo (app-state-echo app))) + (echo-read-string echo "Binary: " + (lambda (bin) + (echo-message! echo (str "Strip: removing symbols from " bin)))))) + +(def (cmd-strip-all app) + (let* ((echo (app-state-echo app))) + (echo-read-string echo "Binary: " + (lambda (bin) + (echo-message! echo (str "Strip: removing all from " bin)))))) \ No newline at end of file --- a/src/jerboa-emacs/editor-extra-modes.ss +++ b/src/jerboa-emacs/editor-extra-modes.ss @@ -23516,3 +23516,65 @@ (lambda (cmd) (echo-message! echo (str "Perf: recording " cmd)))))) +;;; Round 298 — Objdump ext, Readelf ext, Nm ext (batch 1) + +(def (cmd-objdump-disasm app) + (let* ((echo (app-state-echo app))) + (echo-read-string echo "Binary: " + (lambda (bin) + (echo-message! echo (str "Objdump: disassembling " bin)))))) + +(def (cmd-objdump-headers app) + (let* ((echo (app-state-echo app))) + (echo-read-string echo "Binary: " + (lambda (bin) + (echo-message! echo (str "Objdump: headers of " bin)))))) + +(def (cmd-objdump-symbols app) + (let* ((echo (app-state-echo app))) + (echo-read-string echo "Binary: " + (lambda (bin) + (echo-message! echo (str "Objdump: symbols in " bin)))))) + +(def (cmd-objdump-reloc app) + (let* ((echo (app-state-echo app))) + (echo-read-string echo "Binary: " + (lambda (bin) + (echo-message! echo (str "Objdump: relocations in " bin)))))) + +(def (cmd-readelf-headers app) + (let* ((echo (app-state-echo app))) + (echo-read-string echo "ELF file: " + (lambda (elf) + (echo-message! echo (str "Readelf: headers of " elf)))))) + +(def (cmd-readelf-sections app) + (let* ((echo (app-state-echo app))) + (echo-read-string echo "ELF file: " + (lambda (elf) + (echo-message! echo (str "Readelf: sections of " elf)))))) + +(def (cmd-readelf-symbols app) + (let* ((echo (app-state-echo app))) + (echo-read-string echo "ELF file: " + (lambda (elf) + (echo-message! echo (str "Readelf: symbols in " elf)))))) + +(def (cmd-readelf-dynamic app) + (let* ((echo (app-state-echo app))) + (echo-read-string echo "ELF file: " + (lambda (elf) + (echo-message! echo (str "Readelf: dynamic section of " elf)))))) + +(def (cmd-nm-list app) + (let* ((echo (app-state-echo app))) + (echo-read-string echo "Object file: " + (lambda (obj) + (echo-message! echo (str "Nm: listing symbols in " obj)))))) + +(def (cmd-nm-defined app) + (let* ((echo (app-state-echo app))) + (echo-read-string echo "Object file: " + (lambda (obj) + (echo-message! echo (str "Nm: defined symbols in " obj)))))) + --- a/src/jerboa-emacs/editor-extra-regs2.ss +++ b/src/jerboa-emacs/editor-extra-regs2.ss @@ -7675,4 +7675,25 @@ (register-command! 'gdb-run cmd-gdb-run) (register-command! 'gdb-backtrace cmd-gdb-backtrace) (register-command! 'gdb-breakpoint cmd-gdb-breakpoint) + ;; Round 298 + (register-command! 'objdump-disasm cmd-objdump-disasm) + (register-command! 'objdump-headers cmd-objdump-headers) + (register-command! 'objdump-symbols cmd-objdump-symbols) + (register-command! 'objdump-reloc cmd-objdump-reloc) + (register-command! 'readelf-headers cmd-readelf-headers) + (register-command! 'readelf-sections cmd-readelf-sections) + (register-command! 'readelf-symbols cmd-readelf-symbols) + (register-command! 'readelf-dynamic cmd-readelf-dynamic) + (register-command! 'nm-list cmd-nm-list) + (register-command! 'nm-defined cmd-nm-defined) + (register-command! 'nm-undefined cmd-nm-undefined) + (register-command! 'nm-sort cmd-nm-sort) + (register-command! 'ldd-check cmd-ldd-check) + (register-command! 'ldd-tree cmd-ldd-tree) + (register-command! 'ldd-unused cmd-ldd-unused) + (register-command! 'ldd-all cmd-ldd-all) + (register-command! 'strip-binary cmd-strip-binary) + (register-command! 'strip-debug cmd-strip-debug) + (register-command! 'strip-symbols cmd-strip-symbols) + (register-command! 'strip-all cmd-strip-all) )