diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 390e433..df49275 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -79,28 +79,28 @@ jobs: run: python3 -m pip install . - name: bss_check - run: python3 -m mapfile_parser bss_check tests/maps/drmario64.us.map tests/maps/drmario64.us.map + run: python3 -m mapfile_parser bss_check tests/maps/gnuld/n64/drmario64.us.map tests/maps/gnuld/n64/drmario64.us.map - name: first_diff - run: python3 -m mapfile_parser first_diff tests/maps/drmario64.us.map tests/maps/drmario64.us.map tests/maps/drmario64.us.map tests/maps/drmario64.us.map + run: python3 -m mapfile_parser first_diff tests/maps/gnuld/n64/drmario64.us.map tests/maps/gnuld/n64/drmario64.us.map tests/maps/gnuld/n64/drmario64.us.map tests/maps/gnuld/n64/drmario64.us.map - name: jsonify - run: python3 -m mapfile_parser jsonify tests/maps/drmario64.us.map + run: python3 -m mapfile_parser jsonify tests/maps/gnuld/n64/drmario64.us.map - name: objdiff_report - run: python3 -m mapfile_parser objdiff_report tests/maps/drmario64.us.map objdiff_report.json + run: python3 -m mapfile_parser objdiff_report tests/maps/gnuld/n64/drmario64.us.map objdiff_report.json - name: pj64_syms - run: python3 -m mapfile_parser pj64_syms tests/maps/drmario64.us.map + run: python3 -m mapfile_parser pj64_syms tests/maps/gnuld/n64/drmario64.us.map - name: progress - run: python3 -m mapfile_parser progress tests/maps/drmario64.us.map asm asm/nonmatchings + run: python3 -m mapfile_parser progress tests/maps/gnuld/n64/drmario64.us.map asm asm/nonmatchings - name: sym_info - run: python3 -m mapfile_parser sym_info tests/maps/drmario64.us.map entrypoint + run: python3 -m mapfile_parser sym_info tests/maps/gnuld/n64/drmario64.us.map entrypoint - name: symbol_sizes_csv - run: python3 -m mapfile_parser symbol_sizes_csv tests/maps/drmario64.us.map + run: python3 -m mapfile_parser symbol_sizes_csv tests/maps/gnuld/n64/drmario64.us.map - name: upload_frogress - run: python3 -m mapfile_parser upload_frogress tests/maps/drmario64.us.map asm asm/nonmatchings drmario64 us code --verbose --dry-run + run: python3 -m mapfile_parser upload_frogress tests/maps/gnuld/n64/drmario64.us.map asm asm/nonmatchings drmario64 us code --verbose --dry-run diff --git a/CHANGELOG.md b/CHANGELOG.md index df5103e..1472fa2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [2.9.4] - 2025-06-02 + +### Changed + +- Implement parsing for `mwld` 2.7+ generated mapfiles. +- Handle `*fill*`s in `mwld`. + ## [2.9.3] - 2025-06-01 ### Fixed @@ -613,6 +620,7 @@ Full changes: "] diff --git a/README.md b/README.md index 5d2323a..639a49c 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ If you use a `requirements.txt` file in your repository, then you can add this library with the following line: ```txt -mapfile_parser>=2.9.3,<3.0.0 +mapfile_parser>=2.9.4,<3.0.0 ``` #### Development version @@ -75,7 +75,7 @@ cargo add mapfile_parser Or add the following line manually to your `Cargo.toml` file: ```toml -mapfile_parser = "2.9.3" +mapfile_parser = "2.9.4" ``` ## Versioning and changelog diff --git a/pyproject.toml b/pyproject.toml index b1b9194..dc837bf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ [project] name = "mapfile_parser" -version = "2.9.3" +version = "2.9.4" description = "Map file parser library focusing decompilation projects" readme = "README.md" requires-python = ">=3.9" diff --git a/src/mapfile_parser/__init__.py b/src/mapfile_parser/__init__.py index 36ecc58..1671e4c 100644 --- a/src/mapfile_parser/__init__.py +++ b/src/mapfile_parser/__init__.py @@ -5,7 +5,7 @@ from __future__ import annotations -__version_info__ = (2, 9, 3) +__version_info__ = (2, 9, 4) __version__ = ".".join(map(str, __version_info__)) # + "-dev0" __author__ = "Decompollaborate" diff --git a/src/rs/lib.rs b/src/rs/lib.rs index 628a801..fc4122a 100644 --- a/src/rs/lib.rs +++ b/src/rs/lib.rs @@ -63,6 +63,6 @@ mod tests { #[test] fn w0_000_map() { - let _ = MapFile::new_from_map_file(&PathBuf::from("tests/maps/w0_000.map")); + let _ = MapFile::new_from_map_file(&PathBuf::from("tests/maps/gnuld/misc/w0_000.map")); } } diff --git a/src/rs/parser.rs b/src/rs/parser.rs index c7f3913..1e2a5ff 100644 --- a/src/rs/parser.rs +++ b/src/rs/parser.rs @@ -232,7 +232,7 @@ impl MapFile { filepath, vram, size, - section_type, + section_type.into(), )); } else if let Some(section_alone_match) = regex_section_alone_entry.captures(prev_line) @@ -250,7 +250,7 @@ impl MapFile { filepath, vram, size, - section_type, + section_type.into(), )); } } @@ -319,7 +319,7 @@ impl MapFile { filepath, vram, size, - §ion_type, + section_type, )); } } @@ -497,8 +497,8 @@ impl MapFile { } let mut new_section = - section::Section::new_fill(filepath, vram, size, §ion_type); - if !utils::is_noload_section(§ion_type) { + section::Section::new_fill(filepath, vram, size, section_type); + if !utils::is_noload_section(&new_section.section_type) { new_section.vrom = vrom; } current_segment.sections_list.push(new_section); @@ -510,9 +510,13 @@ impl MapFile { if size > 0 { let current_segment = temp_segment_list.last_mut().unwrap(); - let mut new_section = - section::Section::new_default(filepath, vram, size, section_type); - if !utils::is_noload_section(section_type) { + let mut new_section = section::Section::new_default( + filepath, + vram, + size, + section_type.into(), + ); + if !utils::is_noload_section(&new_section.section_type) { new_section.vrom = vrom; } new_section.align = Some(align); @@ -608,34 +612,41 @@ impl MapFile { let map_data = preprocess_map_data_mw(map_contents); let memory_map = parse_memory_map_mw(map_data); - - // Almost every line starts with this information, so instead of duplicating it we put them on one single regex - let regex_row_entry = Regex::new(r"^\s*(?P[0-9a-fA-F]+)\s+(?P[0-9a-fA-F]+)\s+(?P[0-9a-fA-F]+)\s+(?P[0-9a-fA-F]+)\s+(?P.+)").unwrap(); - - let regex_segment_entry = Regex::new(r"^(?P.+) section layout$").unwrap(); - let regex_label_entry = - Regex::new(r"^(?P