mapfile-parser 2.9.2__tar.gz → 2.9.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. {mapfile_parser-2.9.2 → mapfile_parser-2.9.3}/CHANGELOG.md +9 -1
  2. {mapfile_parser-2.9.2 → mapfile_parser-2.9.3}/Cargo.lock +1 -1
  3. {mapfile_parser-2.9.2 → mapfile_parser-2.9.3}/Cargo.toml +1 -1
  4. {mapfile_parser-2.9.2 → mapfile_parser-2.9.3}/PKG-INFO +3 -3
  5. {mapfile_parser-2.9.2 → mapfile_parser-2.9.3}/README.md +2 -2
  6. {mapfile_parser-2.9.2 → mapfile_parser-2.9.3}/pyproject.toml +1 -1
  7. {mapfile_parser-2.9.2 → mapfile_parser-2.9.3}/src/mapfile_parser/__init__.py +1 -1
  8. {mapfile_parser-2.9.2 → mapfile_parser-2.9.3}/src/rs/parser.rs +19 -9
  9. {mapfile_parser-2.9.2 → mapfile_parser-2.9.3}/.gitattributes +0 -0
  10. {mapfile_parser-2.9.2 → mapfile_parser-2.9.3}/.gitignore +0 -0
  11. {mapfile_parser-2.9.2 → mapfile_parser-2.9.3}/LICENSE +0 -0
  12. {mapfile_parser-2.9.2 → mapfile_parser-2.9.3}/src/mapfile_parser/__main__.py +0 -0
  13. {mapfile_parser-2.9.2 → mapfile_parser-2.9.3}/src/mapfile_parser/frontends/__init__.py +0 -0
  14. {mapfile_parser-2.9.2 → mapfile_parser-2.9.3}/src/mapfile_parser/frontends/bss_check.py +0 -0
  15. {mapfile_parser-2.9.2 → mapfile_parser-2.9.3}/src/mapfile_parser/frontends/first_diff.py +0 -0
  16. {mapfile_parser-2.9.2 → mapfile_parser-2.9.3}/src/mapfile_parser/frontends/jsonify.py +0 -0
  17. {mapfile_parser-2.9.2 → mapfile_parser-2.9.3}/src/mapfile_parser/frontends/objdiff_report.py +0 -0
  18. {mapfile_parser-2.9.2 → mapfile_parser-2.9.3}/src/mapfile_parser/frontends/pj64_syms.py +0 -0
  19. {mapfile_parser-2.9.2 → mapfile_parser-2.9.3}/src/mapfile_parser/frontends/progress.py +0 -0
  20. {mapfile_parser-2.9.2 → mapfile_parser-2.9.3}/src/mapfile_parser/frontends/sym_info.py +0 -0
  21. {mapfile_parser-2.9.2 → mapfile_parser-2.9.3}/src/mapfile_parser/frontends/symbol_sizes_csv.py +0 -0
  22. {mapfile_parser-2.9.2 → mapfile_parser-2.9.3}/src/mapfile_parser/frontends/upload_frogress.py +0 -0
  23. {mapfile_parser-2.9.2 → mapfile_parser-2.9.3}/src/mapfile_parser/internals/__init__.py +0 -0
  24. {mapfile_parser-2.9.2 → mapfile_parser-2.9.3}/src/mapfile_parser/internals/objdiff_report.py +0 -0
  25. {mapfile_parser-2.9.2 → mapfile_parser-2.9.3}/src/mapfile_parser/mapfile.py +0 -0
  26. {mapfile_parser-2.9.2 → mapfile_parser-2.9.3}/src/mapfile_parser/mapfile_parser.pyi +0 -0
  27. {mapfile_parser-2.9.2 → mapfile_parser-2.9.3}/src/mapfile_parser/mapfile_rs.py +0 -0
  28. {mapfile_parser-2.9.2 → mapfile_parser-2.9.3}/src/mapfile_parser/progress_stats.py +0 -0
  29. {mapfile_parser-2.9.2 → mapfile_parser-2.9.3}/src/mapfile_parser/progress_stats_rs.py +0 -0
  30. {mapfile_parser-2.9.2 → mapfile_parser-2.9.3}/src/mapfile_parser/utils.py +0 -0
  31. {mapfile_parser-2.9.2 → mapfile_parser-2.9.3}/src/rs/found_symbol_info.rs +0 -0
  32. {mapfile_parser-2.9.2 → mapfile_parser-2.9.3}/src/rs/lib.rs +0 -0
  33. {mapfile_parser-2.9.2 → mapfile_parser-2.9.3}/src/rs/mapfile.rs +0 -0
  34. {mapfile_parser-2.9.2 → mapfile_parser-2.9.3}/src/rs/maps_comparison_info.rs +0 -0
  35. {mapfile_parser-2.9.2 → mapfile_parser-2.9.3}/src/rs/progress_stats.rs +0 -0
  36. {mapfile_parser-2.9.2 → mapfile_parser-2.9.3}/src/rs/report.rs +0 -0
  37. {mapfile_parser-2.9.2 → mapfile_parser-2.9.3}/src/rs/section.rs +0 -0
  38. {mapfile_parser-2.9.2 → mapfile_parser-2.9.3}/src/rs/segment.rs +0 -0
  39. {mapfile_parser-2.9.2 → mapfile_parser-2.9.3}/src/rs/symbol.rs +0 -0
  40. {mapfile_parser-2.9.2 → mapfile_parser-2.9.3}/src/rs/symbol_comparison_info.rs +0 -0
  41. {mapfile_parser-2.9.2 → mapfile_parser-2.9.3}/src/rs/symbol_decomp_state.rs +0 -0
  42. {mapfile_parser-2.9.2 → mapfile_parser-2.9.3}/src/rs/utils.rs +0 -0
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [2.9.3] - 2025-06-01
11
+
12
+ ### Fixed
13
+
14
+ - Try to infer the rom address of sections and segments even when the mapfile
15
+ does not have it explictly on GNU mapfiles.
16
+
10
17
  ## [2.9.2] - 2025-05-28
11
18
 
12
19
  ### Changed
@@ -606,7 +613,8 @@ Full changes: <https://github.com/Decompollaborate/mapfile_parser/compare/702a73
606
613
  - Initial release
607
614
 
608
615
  [unreleased]: https://github.com/Decompollaborate/mapfile_parser/compare/master...develop
609
- [2.9.2]: https://github.com/Decompollaborate/mapfile_parser/compare/2.9.0...2.9.2
616
+ [2.9.3]: https://github.com/Decompollaborate/mapfile_parser/compare/2.9.2...2.9.3
617
+ [2.9.2]: https://github.com/Decompollaborate/mapfile_parser/compare/2.9.1...2.9.2
610
618
  [2.9.1]: https://github.com/Decompollaborate/mapfile_parser/compare/2.9.0...2.9.1
611
619
  [2.9.0]: https://github.com/Decompollaborate/mapfile_parser/compare/2.8.1...2.9.0
612
620
  [2.8.1]: https://github.com/Decompollaborate/mapfile_parser/compare/2.8.0...2.8.1
@@ -171,7 +171,7 @@ checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94"
171
171
 
172
172
  [[package]]
173
173
  name = "mapfile_parser"
174
- version = "2.9.2"
174
+ version = "2.9.3"
175
175
  dependencies = [
176
176
  "lazy_static",
177
177
  "objdiff-core",
@@ -3,7 +3,7 @@
3
3
 
4
4
  [package]
5
5
  name = "mapfile_parser"
6
- version = "2.9.2"
6
+ version = "2.9.3"
7
7
  edition = "2021"
8
8
  rust-version = "1.74.0"
9
9
  authors = ["Anghelo Carvajal <angheloalf95@gmail.com>"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mapfile_parser
3
- Version: 2.9.2
3
+ Version: 2.9.3
4
4
  Classifier: Programming Language :: Rust
5
5
  Classifier: Programming Language :: Python :: Implementation :: CPython
6
6
  Classifier: Programming Language :: Python :: Implementation :: PyPy
@@ -55,7 +55,7 @@ If you use a `requirements.txt` file in your repository, then you can add
55
55
  this library with the following line:
56
56
 
57
57
  ```txt
58
- mapfile_parser>=2.9.2,<3.0.0
58
+ mapfile_parser>=2.9.3,<3.0.0
59
59
  ```
60
60
 
61
61
  #### Development version
@@ -94,7 +94,7 @@ cargo add mapfile_parser
94
94
  Or add the following line manually to your `Cargo.toml` file:
95
95
 
96
96
  ```toml
97
- mapfile_parser = "2.9.2"
97
+ mapfile_parser = "2.9.3"
98
98
  ```
99
99
 
100
100
  ## Versioning and changelog
@@ -36,7 +36,7 @@ If you use a `requirements.txt` file in your repository, then you can add
36
36
  this library with the following line:
37
37
 
38
38
  ```txt
39
- mapfile_parser>=2.9.2,<3.0.0
39
+ mapfile_parser>=2.9.3,<3.0.0
40
40
  ```
41
41
 
42
42
  #### Development version
@@ -75,7 +75,7 @@ cargo add mapfile_parser
75
75
  Or add the following line manually to your `Cargo.toml` file:
76
76
 
77
77
  ```toml
78
- mapfile_parser = "2.9.2"
78
+ mapfile_parser = "2.9.3"
79
79
  ```
80
80
 
81
81
  ## Versioning and changelog
@@ -3,7 +3,7 @@
3
3
 
4
4
  [project]
5
5
  name = "mapfile_parser"
6
- version = "2.9.2"
6
+ version = "2.9.3"
7
7
  description = "Map file parser library focusing decompilation projects"
8
8
  readme = "README.md"
9
9
  requires-python = ">=3.9"
@@ -5,7 +5,7 @@
5
5
 
6
6
  from __future__ import annotations
7
7
 
8
- __version_info__ = (2, 9, 2)
8
+ __version_info__ = (2, 9, 3)
9
9
  __version__ = ".".join(map(str, __version_info__)) # + "-dev0"
10
10
  __author__ = "Decompollaborate"
11
11
 
@@ -335,6 +335,9 @@ impl MapFile {
335
335
  ) -> Vec<segment::Segment> {
336
336
  let mut segments_list = Vec::with_capacity(temp_segment_list.len());
337
337
 
338
+ // We need to keep a calculated rom in case the segment doesn't specify it explicitly
339
+ let mut current_calculated_section_rom = 0;
340
+
338
341
  for (i, segment) in temp_segment_list.into_iter().enumerate() {
339
342
  if i == 0 && segment.is_placeholder() {
340
343
  // skip the dummy segment if it has no size, sections or symbols
@@ -347,7 +350,13 @@ impl MapFile {
347
350
 
348
351
  let mut new_segment = segment.clone_no_sectionlist();
349
352
 
350
- let mut vrom_offset = segment.vrom;
353
+ let mut vrom_offset = if let Some(vrom) = segment.vrom {
354
+ current_calculated_section_rom = vrom;
355
+ vrom
356
+ } else {
357
+ new_segment.vrom = Some(current_calculated_section_rom);
358
+ current_calculated_section_rom
359
+ };
351
360
  for mut section in segment.sections_list.into_iter() {
352
361
  if section.is_placeholder() {
353
362
  // drop placeholders
@@ -359,12 +368,12 @@ impl MapFile {
359
368
  let symbols_count = section.symbols.len();
360
369
  let is_noload_section = section.is_noload_section();
361
370
 
362
- if section.vrom.is_some() {
363
- vrom_offset = section.vrom;
371
+ if let Some(vrom) = section.vrom {
372
+ vrom_offset = vrom;
364
373
  }
365
374
 
366
375
  if !is_noload_section {
367
- section.vrom = vrom_offset;
376
+ section.vrom = Some(vrom_offset);
368
377
  }
369
378
 
370
379
  if symbols_count > 0 {
@@ -377,7 +386,7 @@ impl MapFile {
377
386
  // by the difference in vram address between the first symbol and the vram
378
387
  // of the section.
379
388
  if let Some(first_sym) = section.symbols.first() {
380
- sym_vrom = sym_vrom.map(|x| x + first_sym.vram - section.vram);
389
+ sym_vrom = sym_vrom + first_sym.vram - section.vram;
381
390
 
382
391
  // Aditionally, if the first symbol is missing then calculation of the size
383
392
  // for the last symbol would be wrong, since we subtract the accumulated
@@ -397,8 +406,8 @@ impl MapFile {
397
406
 
398
407
  if !is_noload_section {
399
408
  // Only set vrom of non bss variables
400
- sym.vrom = sym_vrom;
401
- sym_vrom = sym_vrom.map(|x| x + sym_size);
409
+ sym.vrom = Some(sym_vrom);
410
+ sym_vrom += sym_size;
402
411
  }
403
412
  }
404
413
 
@@ -407,7 +416,7 @@ impl MapFile {
407
416
  let sym_size = section.size - acummulated_size;
408
417
  sym.size = sym_size;
409
418
  if !is_noload_section {
410
- sym.vrom = sym_vrom;
419
+ sym.vrom = Some(sym_vrom);
411
420
  //sym_vrom += sym_size;
412
421
  }
413
422
 
@@ -415,7 +424,8 @@ impl MapFile {
415
424
  }
416
425
 
417
426
  if !is_noload_section {
418
- vrom_offset = vrom_offset.map(|x| x + section.size);
427
+ vrom_offset += section.size;
428
+ current_calculated_section_rom += section.size;
419
429
  }
420
430
 
421
431
  new_segment.sections_list.push(section);
File without changes