From 159a4ec4a64a8a5d791f40eb577afcbe7ee7303e Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Wed, 27 Aug 2025 23:38:18 +0200 Subject: nasm: Implement the -s/--stats option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This option prints further information on how segments are laid out. In particular, for now it prints the amount of space being filled for each segment. Signed-off-by: Miquel Sabaté Solà --- lib/xixanta/src/assembler.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/xixanta/src/assembler.rs') diff --git a/lib/xixanta/src/assembler.rs b/lib/xixanta/src/assembler.rs index c12773b..1d08b57 100644 --- a/lib/xixanta/src/assembler.rs +++ b/lib/xixanta/src/assembler.rs @@ -88,6 +88,7 @@ pub struct AssemblerResult { pub bundles: Vec, pub errors: Vec, pub warnings: Vec, + pub mappings: Vec, } /// Read the contents from the `reader` as a source file and produce a list of @@ -114,6 +115,7 @@ pub fn assemble( source, }], warnings: vec![], + mappings: vec![], }; } }; @@ -143,6 +145,7 @@ pub fn assemble_with_mapping( bundles: vec![], errors, warnings: asm.warnings, + mappings: asm.mappings, }; } @@ -157,6 +160,7 @@ pub fn assemble_with_mapping( bundles: vec![], errors: e.into(), warnings: vec![], + mappings: asm.mappings, }; } } @@ -168,6 +172,7 @@ pub fn assemble_with_mapping( bundles: vec![], errors, warnings: asm.warnings, + mappings: asm.mappings, }; } @@ -180,6 +185,7 @@ pub fn assemble_with_mapping( bundles: vec![], errors, warnings: asm.warnings, + mappings: asm.mappings, }; } @@ -190,6 +196,7 @@ pub fn assemble_with_mapping( bundles: vec![], errors, warnings: asm.warnings, + mappings: asm.mappings, }; } @@ -199,11 +206,13 @@ pub fn assemble_with_mapping( bundles, errors: vec![], warnings: asm.warnings, + mappings: asm.mappings, }, Err(errors) => AssemblerResult { bundles: vec![], errors, warnings: asm.warnings, + mappings: asm.mappings, }, } } -- cgit v1.2.3