Skip to content

Conversation

@sdimitro
Copy link
Owner

Replace the custom .sdb bundle format with kdumpling-generated vmcore
files for session recording and replay. This provides:

  • Standard ELF64 vmcore format compatible with drgn, crash, gdb
  • Simplified replay using drgn's native set_core_dump()
  • Virtual address support in memory segments
  • Custom ELF notes for SDB session metadata

Key changes:

  • session.py: Use KdumpBuilder instead of custom SparseMemory/bundle
  • cli.py: Simplified setup_replay_target() using set_core_dump()
  • repl.py: Updated %session commands for new format
  • stacks.py: Removed replay-specific code paths (drgn unwinds natively)

The recorded files use .vmcore.recorded extension and are standard
vmcores that can be loaded by any tool supporting the format.

https://claude.ai/code/session_017jLJzNMm6GwvhxsDFNzTKd

Replace the custom .sdb bundle format with kdumpling-generated vmcore
files for session recording and replay. This provides:

- Standard ELF64 vmcore format compatible with drgn, crash, gdb
- Simplified replay using drgn's native set_core_dump()
- Virtual address support in memory segments
- Custom ELF notes for SDB session metadata

Key changes:
- session.py: Use KdumpBuilder instead of custom SparseMemory/bundle
- cli.py: Simplified setup_replay_target() using set_core_dump()
- repl.py: Updated %session commands for new format
- stacks.py: Removed replay-specific code paths (drgn unwinds natively)

The recorded files use .vmcore.recorded extension and are standard
vmcores that can be loaded by any tool supporting the format.

https://claude.ai/code/session_017jLJzNMm6GwvhxsDFNzTKd
Rewrite tests to use the new kdumpling-based session recording API:

- test_session.py: Test SparseMemory, TraceManager state, and constants
  - Remove tests for old bundle format (ZipFile, MemoryRecord, etc.)
  - Remove tests for deprecated APIs (record_symbol, record_thread_stack)
  - Add tests for new get_segments() merging behavior
  - Simplify to focus on recording state and sparse memory

- test_session_tracing.py: Integration tests for vmcore recording
  - Test that recorded vmcores are valid ELF files
  - Test SDB custom note preservation
  - Test memory content preservation through record/replay
  - Test vmcoreinfo capture for drgn compatibility
  - Remove tests for pre-computed stack traces (native unwinding now)

https://claude.ai/code/session_017jLJzNMm6GwvhxsDFNzTKd
Add user-configurable options for recorded vmcore output:

- Format options: 'elf' (default) or 'kdump' (kdump compressed)
- Compression options for kdump: none, zlib, lzo, snappy, zstd
- Compression level: 1-9 (default 6)

New REPL commands:
- %session config - Show current config
- %session config format <elf|kdump> - Set output format
- %session config compression <type> - Set compression
- %session config compression-level <1-9> - Set level

Also fixes CI issues:
- Fix yapf formatting throughout
- Fix ruff unused imports/variables
- Fix mypy type errors (pyelftools, threads.py)
- Remove deprecated replay mode code from threads.py
  (native drgn unwinding now works with vmcores)

https://claude.ai/code/session_017jLJzNMm6GwvhxsDFNzTKd
The CI workflows were failing because they only installed pytest/mypy
directly without installing SDB's dependencies (kdumpling, pyelftools).

Add `pip install .` to all jobs that need the SDB package:
- pylint
- pytest-unit
- pytest-integration
- mypy

https://claude.ai/code/session_017jLJzNMm6GwvhxsDFNzTKd
@codecov
Copy link

codecov bot commented Jan 30, 2026

Codecov Report

❌ Patch coverage is 39.89899% with 119 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.13%. Comparing base (ba1cc31) to head (ca1a730).
⚠️ Report is 6 commits behind head on develop.

Files with missing lines Patch % Lines
sdb/internal/repl.py 6.49% 69 Missing and 3 partials ⚠️
sdb/session.py 75.28% 12 Missing and 10 partials ⚠️
sdb/internal/cli.py 9.52% 19 Missing ⚠️
sdb/commands/linux/threads.py 40.00% 6 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop      #24      +/-   ##
===========================================
- Coverage    76.98%   76.13%   -0.85%     
===========================================
  Files           69       69              
  Lines         4405     4036     -369     
  Branches       703      625      -78     
===========================================
- Hits          3391     3073     -318     
+ Misses         832      809      -23     
+ Partials       182      154      -28     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

- Fix import order: kdumpling before drgn (C0411)
- Add pylint disable for too-many-instance-attributes on TraceManager
- Rename unused 'prog' argument to '_prog' in _save_vmcore
- Add pylint disable for broad-exception-caught in extract_sdb_notes
- Add pylint disable for too-many-return-statements in _handle_session_config
- Add pylint disable for broad-exception-caught in cli.py setup_replay_target

https://claude.ai/code/session_017jLJzNMm6GwvhxsDFNzTKd
- Add pylint disable for broad-exception-caught in test_vmcore_loadable_by_drgn
- Add pylint disable for too-few-public-methods on TestMemorySegment

https://claude.ai/code/session_017jLJzNMm6GwvhxsDFNzTKd
@sdimitro sdimitro merged commit b60d241 into develop Jan 30, 2026
20 of 22 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.

3 participants