Add kdumpling Python library for building Linux kdump files#1
Merged
Add kdumpling Python library for building Linux kdump files#1
Conversation
Implements a minimal MVP with: - KdumpBuilder class with fluent API for creating vmcore files - Support for setting vmcoreinfo metadata - Support for adding memory segments at physical addresses - ELF64 header and program header generation - PT_NOTE section with VMCOREINFO - PT_LOAD sections for memory data - Multi-architecture support (x86_64, aarch64, s390x, ppc64, riscv64) https://claude.ai/code/session_017YyEoftir1U4kuDrRffjjU
- Add comprehensive pytest tests using pyelftools for ELF validation - Add type hints and py.typed marker for PEP 561 compliance - Set up GitHub Actions CI workflow with: - Linting and formatting (ruff) - Type checking (mypy) - Tests across Python 3.8-3.12 - Configure ruff and mypy in pyproject.toml https://claude.ai/code/session_017YyEoftir1U4kuDrRffjjU
- Add cpu_context.py with architecture-specific register layouts: - x86_64: 27 registers (RIP, RSP, RBP, RAX, etc.) - aarch64: 34 registers (X0-X30, SP, PC, PSTATE) - s390x, ppc64, riscv64: basic support - Add pack_prstatus() for creating NT_PRSTATUS note data - Add KdumpBuilder.add_cpu_context() method for fluent API - Add tests for single/multiple CPU contexts - Verified with drgn debugger (opens and recognizes as Linux kernel dump) https://claude.ai/code/session_017YyEoftir1U4kuDrRffjjU
- Add test_drgn_integration.py with 6 tests validating: - drgn can open generated vmcores - Platform/architecture detection works correctly - Linux kernel flag is recognized - CPU context notes are accepted - Endianness is correctly detected - Add drgn as optional test dependency - Update CI to run drgn tests on Python 3.9+ - Add release.yml workflow that: - Triggers on version tags (vX.Y.Z) - Builds source and wheel distributions - Tests the built package - Publishes to TestPyPI and PyPI - Creates GitHub release with artifacts https://claude.ai/code/session_017YyEoftir1U4kuDrRffjjU
- Add install-libkdumpfile.sh script to build from source with Python bindings - Add test_libkdumpfile_integration.py with 6 tests: - Opening vmcore files - Reading vmcoreinfo attributes - Memory segment access - CPU context support - Architecture detection - Multiple memory segments - Add CI job to run libkdumpfile tests (builds from Codeberg source) - Tests gracefully skip when kdumpfile module is not installed https://claude.ai/code/session_017YyEoftir1U4kuDrRffjjU
- Add DumpStats dataclass with statistics about dumps (architecture, memory segments, CPU contexts, sizes, etc.) - Add stats property to KdumpBuilder for inspection - Add human-readable size formatting methods - Add 8 new tests for statistics API (41 total tests) - Create ReadTheDocs documentation with Sphinx config - Add quickstart guide and API reference docs - Create README.md with CI, PyPI, Python version, and license badges https://claude.ai/code/session_017YyEoftir1U4kuDrRffjjU
- Add logo to README.md and docs homepage - Create tests/conftest.py with shared fixtures: - Common vmcoreinfo constants for all architectures - vmcore_output_path fixture for automatic cleanup - Test data constants (patterns, addresses) - Refactor test_drgn_integration.py to use shared fixtures - Refactor test_libkdumpfile_integration.py to use shared fixtures - Remove duplicated vmcoreinfo definitions across test files https://claude.ai/code/session_017YyEoftir1U4kuDrRffjjU
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.
Implements a minimal MVP with:
https://claude.ai/code/session_017YyEoftir1U4kuDrRffjjU