Skip to content

Commit

Permalink
Merge pull request #181 from Decompollaborate/develop
Browse files Browse the repository at this point in the history
1.32.0
  • Loading branch information
AngheloAlf authored Dec 28, 2024
2 parents 85c59af + b95c100 commit 185db8b
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 4 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.32.0] - 2024-12-28

### Added

- Add `referencedVrams` member to `SymbolBase`.
- Contains every vram that is referenced by the current symbol.

### Fixed

- Fix jumptable labels sometimes missing their rom suffix, again.

## [1.31.3] - 2024-12-21

### Fixed
Expand Down Expand Up @@ -1720,6 +1731,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Version 1.0.0

[unreleased]: https://github.com/Decompollaborate/spimdisasm/compare/master...develop
[1.32.0]: https://github.com/Decompollaborate/spimdisasm/compare/1.31.3...1.32.0
[1.31.3]: https://github.com/Decompollaborate/spimdisasm/compare/1.31.2...1.31.3
[1.31.2]: https://github.com/Decompollaborate/spimdisasm/compare/1.31.1...1.31.2
[1.31.1]: https://github.com/Decompollaborate/spimdisasm/compare/1.31.0...1.31.1
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[project]
name = "spimdisasm"
# Version should be synced with spimdisasm/__init__.py
version = "1.31.3"
version = "1.32.0"
description = "MIPS disassembler"
readme = "README.md"
license = {file = "LICENSE"}
Expand Down
2 changes: 1 addition & 1 deletion spimdisasm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from __future__ import annotations

__version_info__: tuple[int, int, int] = (1, 31, 3)
__version_info__: tuple[int, int, int] = (1, 32, 0)
__version__ = ".".join(map(str, __version_info__))# + "-dev0"
__author__ = "Decompollaborate"

Expand Down
12 changes: 10 additions & 2 deletions spimdisasm/mips/sections/MipsSectionRodata.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,18 @@ def _analyze_processJumptable(self, localOffset: int, w: int, contextSym: common
return None, firstJumptableWord

# Generate the current label
labelAddr = w
if lastVramSymbol.isGot and common.GlobalConfig.GP_VALUE is not None:
labelAddr = common.GlobalConfig.GP_VALUE + rabbitizer.Utils.from2Complement(w, 32)
labelSym = self.addJumpTableLabel(labelAddr, isAutogenerated=True)
labelVrom = None
else:
labelAddr = w
maybeVrom = self.vromStart + labelAddr - self.vram
segment = self.getSegmentForVrom(self.segmentVromStart)
if not segment._isTheUnknownSegment and segment.isVromInRange(maybeVrom):
labelVrom = maybeVrom
else:
labelVrom = None
labelSym = self.addJumpTableLabel(labelAddr, isAutogenerated=True, symbolVrom=labelVrom)

if labelSym.unknownSegment:
return None, firstJumptableWord
Expand Down
4 changes: 4 additions & 0 deletions spimdisasm/mips/symbols/MipsSymbolBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ def __init__(self, context: common.Context, vromStart: int, vromEnd: int, inFile
self.relocs: dict[int, common.RelocationInfo] = dict()
"key: word offset"

self.referencedVrams: set[int] = set()
"Every referenced vram found"


def getName(self) -> str:
return self.contextSym.getName()
Expand Down Expand Up @@ -228,6 +231,7 @@ def analyze(self) -> None:
if referencedSym is not None:
if not referencedSym.isJumpTable():
referencedSym.referenceSymbols.add(self.contextSym)
self.referencedVrams.add(referencedSym.vram)


def getEndOfLineComment(self, wordIndex: int) -> str:
Expand Down
2 changes: 2 additions & 0 deletions spimdisasm/mips/symbols/MipsSymbolFunction.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,8 @@ def analyze(self) -> None:

self.contextSym.autodetectedSize = self.sizew*4

self.referencedVrams = self.instrAnalyzer.referencedVrams


def countExtraPadding(self) -> int:
count = 0
Expand Down

0 comments on commit 185db8b

Please sign in to comment.