Skip to content

Refactor dump commands into a shared streaming implementation - #85

Merged
tlindner merged 1 commit into
nitros9project:mainfrom
tlindner:feature/shared-dump
Oct 27, 2026
Merged

tlindner merged 1 commit into
nitros9project:mainfrom
tlindner:feature/shared-dump

Conversation

@tlindner

Copy link
Copy Markdown
Member

Move dump command handling and incremental formatting into libtoolshed so decb dump, os9 dump, cecb dump, and cecb dumpblock share the same formatting code. Keep formatting options and offsets in per-dump state instead of globals, and preserve hexadecimal, assembler hexadecimal/binary, and C output modes.

Read files in bounded chunks rather than scanning for their size, rewinding, and allocating the entire contents. Decode DECB binary records incrementally, reject truncated headers and payloads, and preserve load addresses, execution addresses, and trailing-byte reporting. Propagate read, close, and output errors.

Give dumpblock the shared formatting options while retaining cassette block metadata, per-block offsets, and nonfatal checksum warnings. Highlight printable ASCII byte values and characters in green only when output is a terminal, leaving redirected output free of color codes.

Remove the abandoned coco source directory, its copied OS-9 commands, obsolete Makefile, and unused cocoutil header. Update command tables, declarations, library builds, and dumpblock documentation. Keep dump verification as manual smoke checks rather than adding output-format unit tests.

Validation: make -C build/unix completed and all 32 existing tests passed. Manually checked all four commands across hex, assembler hex/binary, C, and ASCII-suppressed output using terminal and redirected output; stripping terminal color codes preserves plain output and alignment. HTML documentation generation requires the unavailable markdown executable.

Move dump command handling and incremental formatting into libtoolshed so decb dump, os9 dump, cecb dump, and cecb dumpblock share the same formatting code. Keep formatting options and offsets in per-dump state instead of globals, and preserve hexadecimal, assembler hexadecimal/binary, and C output modes.

Read files in bounded chunks rather than scanning for their size, rewinding, and allocating the entire contents. Decode DECB binary records incrementally, reject truncated headers and payloads, and preserve load addresses, execution addresses, and trailing-byte reporting. Propagate read, close, and output errors.

Give dumpblock the shared formatting options while retaining cassette block metadata, per-block offsets, and nonfatal checksum warnings. Highlight printable ASCII byte values and characters in green only when output is a terminal, leaving redirected output free of color codes.

Remove the abandoned coco source directory, its copied OS-9 commands, obsolete Makefile, and unused cocoutil header. Update command tables, declarations, library builds, and dumpblock documentation. Keep dump verification as manual smoke checks rather than adding output-format unit tests.

Validation: make -C build/unix completed and all 32 existing tests passed. Manually checked all four commands across hex, assembler hex/binary, C, and ASCII-suppressed output using terminal and redirected output; stripping terminal color codes preserves plain output and alignment. HTML documentation generation requires the unavailable markdown executable.
@tlindner
tlindner merged commit 1fa25cf into nitros9project:main Oct 27, 2026
6 checks passed
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.

2 participants