Завершить разделение SDK и внешних проектов

This commit is contained in:
Александр Петров
2026-09-16 10:01:43 +03:00
parent 0e74aaa7ee
commit 2e7ffd64a4
1965 changed files with 373 additions and 201393 deletions
+17 -1
View File
@@ -66,6 +66,20 @@ class DebugMap:
logical = address & 0xffff
return asdict(Location(address, logical, section, bank, logical >> 14))
def variable_location(self, address, symbol):
"""Разрешить доказанный linker-символ `__at` вне обычных секций.
Код/точки по-прежнему обязаны принадлежать ровно одной секции. Для
global/static SDCC может намеренно поместить объект по абсолютному
адресу (например, scratch в W1); его адрес подтверждают и CDB, и NOI.
"""
try:
return self.location(address)
except ValueError:
if not (0 <= address <= 0xffff and self.symbols.get(symbol) == address):
raise
return asdict(Location(address, address, '_ABS', None, address >> 14))
def _load(self, records):
addresses, declarations = {}, []
module = None
@@ -128,10 +142,12 @@ class DebugMap:
if address is None and parts[0] == 'G': address = self.symbols.get('_'+parts[1])
if address is None: continue
supported = bool(re.fullmatch(r'S[ICL]:[SU]', ctype) or ctype.startswith('DG,'))
linker_symbol = key if key in self.symbols else '_'+parts[1]
variable = {'name': parts[1], 'module': module if parts[0] != 'G' else None,
'size': int(size), 'type': ctype,
'signed': ctype.endswith(':S') and not ctype.startswith('D'),
'supported': supported, **self.location(address)}
'supported': supported,
**self.variable_location(address, linker_symbol)}
if variable not in self.variables: self.variables.append(variable)
self.functions.sort(key=lambda f: f['start'])
self.markers.sort(key=lambda m: m['link_address'])