r2fas 0.2.0

radare2 core plugin that loads FASM -s symbolic dumps for named labels, source lines, and comments
//! FASM symbolic-dump loader for radare2.
//!
//! # What this crate is
//!
//! FASM can write a proprietary `.fas` file with `fasm source.s -s dump.fas`.
//! radare2 does not understand that format. This crate is a **core plugin**
//! (`core_fas.so`) that parses the dump and feeds r2 the same things DWARF
//! would have provided: named flags, source line maps (`CL`), comments, data
//! sizes, and function starts.
//!
//! After `make install`, opening a FASM binary whose sibling dump exists is
//! enough:
//!
//! ```text
//! fasm hello.asm -s hello.fas
//! r2 -d ./hello
//! # pd @ start already shows names and hello.asm:line
//! ```
//!
//! **Caution:** this crate is totally vibecoded. Use it with caution.
//! Authors: Hamid R. K. Pishghadam and Cursor AI.
//!
//! Autoload looks next to the binary for `*.fas`, the same sidecar idea as
//! `pdb.autoload`, but on by default.
//!
//! # Crate layout
//!
//! - [`fas`] — pure parser (no r2 types); safe to unit-test
//! - [`session`] — debugger-facing labels / addrline derived from a parse
//! - [`discover`] — sibling-file search
//! - `apply` / `plugin` — radare2 integration (crate feature `plugin`, on by default)
//!
//! # Building documentation
//!
//! ```text
//! cargo doc --document-private-items --no-deps --open
//! ```

#![allow(clippy::missing_safety_doc)]

#[cfg(feature = "plugin")]
pub mod apply;
pub mod discover;
pub mod error;
pub mod fas;
#[cfg(feature = "plugin")]
pub mod plugin;
pub mod session;

pub use error::{FasError, Result};
pub use fas::FasFile;
pub use session::DebugInfo;

/// Keep the cdylib from stripping the radare2 entry symbol.
#[cfg(feature = "plugin")]
#[used]
static _RADARE_PLUGIN: &radare2::plugin::LibraryPlugin = &plugin::radare_plugin;