(head_line: str)
| 338 | return None |
| 339 | return cleaned |
| 340 | |
| 341 | |
| 342 | def _normalize_library_uri(raw: str) -> Optional[str]: |
| 343 | t = raw.strip() |
| 344 | if not t: |
| 345 | return None |
| 346 | if t.startswith("package:") or t.startswith("dart:") or t.startswith("file:"): |
| 347 | return t |
| 348 | return None |
| 349 | |
| 350 | |
| 351 | def _sanitize_class_name(raw: str) -> Optional[str]: |
| 352 | t = raw.strip() |
| 353 | if not t: |
| 354 | return None |
| 355 | t = re.sub(r"<.*?>", "", t) |
| 356 | t = "".join(ch for ch in t if ch.isalnum() or ch in "_$") |
| 357 | if not t or _is_placeholder(t): |
| 358 | return None |
| 359 | return t |
| 360 | |
| 361 | |
| 362 | # -------------------------------------------------------------------------- |
| 363 | # internal backend: string carving plus prologue scanning |
| 364 | # -------------------------------------------------------------------------- |
| 365 | |
| 366 | |
| 367 | def _decode_bl_target(pc: int, word: int) -> Optional[int]: |
| 368 | if ((word >> 26) & 0x3F) != 0b100101: |
| 369 | return None |
| 370 | imm26 = word & 0x03FFFFFF |
| 371 | if imm26 & (1 << 25): |
| 372 | imm26 -= 1 << 26 |
| 373 | return pc + (imm26 << 2) |
| 374 | |
| 375 | |
| 376 | def _is_frame_prologue(word: int) -> bool: |
| 377 | rt = word & 0x1F |
| 378 | rn = (word >> 5) & 0x1F |
| 379 | rt2 = (word >> 10) & 0x1F |
| 380 | is_store_pair = ((word >> 30) & 0x3) == 0b10 |
| 381 | return is_store_pair and rt == 29 and rt2 == 30 and rn == 31 |
| 382 | |
| 383 | |
| 384 | def _recover_code_ranges(instr: bytes, base_va: int) -> List[dict]: |
no outgoing calls
no test coverage detected