mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-24 08:41:16 +00:00
refactor: db access from pdb_extraction.py
This commit is contained in:
parent
f306f48fc4
commit
eb0d736eb8
@ -126,7 +126,7 @@ def handle_matched_function(
|
|||||||
self, match_info: MatchInfo
|
self, match_info: MatchInfo
|
||||||
) -> Optional[tuple[MatchInfo, FunctionSignature]]:
|
) -> Optional[tuple[MatchInfo, FunctionSignature]]:
|
||||||
assert match_info.orig_addr is not None
|
assert match_info.orig_addr is not None
|
||||||
match_options = self.compare.db.get_match_options(match_info.orig_addr)
|
match_options = self.compare.get_match_options(match_info.orig_addr)
|
||||||
assert match_options is not None
|
assert match_options is not None
|
||||||
if match_options.get("skip", False) or match_options.get("stub", False):
|
if match_options.get("skip", False) or match_options.get("stub", False):
|
||||||
return None
|
return None
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
import struct
|
import struct
|
||||||
import uuid
|
import uuid
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from typing import Callable, Iterable, List, Optional
|
from typing import Any, Callable, Iterable, List, Optional
|
||||||
from isledecomp.bin import Bin as IsleBin, InvalidVirtualAddressError
|
from isledecomp.bin import Bin as IsleBin, InvalidVirtualAddressError
|
||||||
from isledecomp.cvdump.demangler import demangle_string_const
|
from isledecomp.cvdump.demangler import demangle_string_const
|
||||||
from isledecomp.cvdump import Cvdump, CvdumpAnalysis
|
from isledecomp.cvdump import Cvdump, CvdumpAnalysis
|
||||||
@ -88,11 +88,6 @@ def __init__(
|
|||||||
self._match_thunks()
|
self._match_thunks()
|
||||||
self._find_vtordisp()
|
self._find_vtordisp()
|
||||||
|
|
||||||
@property
|
|
||||||
def db(self):
|
|
||||||
"""Newer code needs to access this field, legacy code uses _db"""
|
|
||||||
return self._db
|
|
||||||
|
|
||||||
def _load_cvdump(self):
|
def _load_cvdump(self):
|
||||||
logger.info("Parsing %s ...", self.pdb_file)
|
logger.info("Parsing %s ...", self.pdb_file)
|
||||||
self.cv = (
|
self.cv = (
|
||||||
@ -745,6 +740,9 @@ def get_vtables(self) -> List[MatchInfo]:
|
|||||||
def get_variables(self) -> List[MatchInfo]:
|
def get_variables(self) -> List[MatchInfo]:
|
||||||
return self._db.get_matches_by_type(SymbolType.DATA)
|
return self._db.get_matches_by_type(SymbolType.DATA)
|
||||||
|
|
||||||
|
def get_match_options(self, addr: int) -> Optional[dict[str, Any]]:
|
||||||
|
return self._db.get_match_options(addr)
|
||||||
|
|
||||||
def compare_address(self, addr: int) -> Optional[DiffReport]:
|
def compare_address(self, addr: int) -> Optional[DiffReport]:
|
||||||
match = self._db.get_one_match(addr)
|
match = self._db.get_one_match(addr)
|
||||||
if match is None:
|
if match is None:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user