Skip to content

Add SQLite-based model import/export and REVNG_NO_FETCH_DEBUG_INFO#559

Open
revng-claudietto wants to merge 4 commits intorevng:developfrom
revng-claudietto:feature/model-sqlite
Open

Add SQLite-based model import/export and REVNG_NO_FETCH_DEBUG_INFO#559
revng-claudietto wants to merge 4 commits intorevng:developfrom
revng-claudietto:feature/model-sqlite

Conversation

@revng-claudietto
Copy link

@revng-claudietto revng-claudietto commented Feb 17, 2026

Summary

  • Restore Sqlite3.h C++ wrapper (dropped in a previous refactor) and add int64_t column support
  • Add REVNG_NO_FETCH_DEBUG_INFO environment variable to skip debug info fetching during import-binary, useful for batch processing where debug symbols are pre-cached
  • Add revng model export sqlite Python command to export model YAML files into a SQLite database (types, symbols, dependencies)
  • Add revng model import sqlite C++ tool to query the SQLite database and reconstruct model YAML for selected symbols with transitive type dependencies

Test plan

  • Build with orc install -b revng
  • Verify revng model export sqlite --help works
  • Verify revng model import sqlite --help works
  • Export a model to SQLite: revng model export sqlite --db test.db --platform test model.yml
  • Import symbols back: revng model import sqlite --db test.db --platform test --library <lib> --symbol <sym>
  • Verify round-trip produces valid YAML
  • Verify REVNG_NO_FETCH_DEBUG_INFO=1 revng analyze import-binary skips fetching

Restore the Sqlite3 C++ wrapper that was previously removed and add
support for reading INTEGER columns via a new int64_t unpackRow
specialization.
When the environment variable REVNG_NO_FETCH_DEBUG_INFO is set,
runFetchDebugInfo returns immediately without spawning the
fetch-debuginfo subprocess. This is useful for batch processing
where debug info has already been fetched separately.
Add a Python command that imports rev.ng YAML model files into a SQLite
database. The schema stores platforms, libraries, type definitions (with
their YAML bodies), symbols, and type definition dependency edges.

This enables efficient querying and subsetting of type information
across multiple binaries.
Add a C++ tool that exports a subset of type definitions and symbols
from a SQLite database (populated by `revng model export sqlite`) back
into a rev.ng model YAML file.

Given a platform, library, and set of symbol names, the tool:
- Fetches the library header from the database
- Resolves all transitively-depended-upon type definitions via a
  recursive CTE query
- Composes the model YAML via string concatenation
- Parses it through TupleTree<model::Binary>::fromString
- Verifies and serializes the result
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

Comments