diff --git a/App/lib/Phase/BuildPipeline.vp b/App/lib/Phase/BuildPipeline.vp index ec6fe0e..36e0943 100644 --- a/App/lib/Phase/BuildPipeline.vp +++ b/App/lib/Phase/BuildPipeline.vp @@ -1403,8 +1403,21 @@ def _tb_join(mb: memhub.MemBuddy*, base: str, name: str) -> str: def _tb_parse_dec(s: str) -> int: + """Parse a leading decimal integer, skipping leading blanks. + + dwarfdump right-aligns the bracketed indices to a 3-wide field + (`file_names[ 1]:` / `include_directories[ 12]`), so `_tb_bracket_idx` + hands us a string whose first char is a space. Without the blank skip the + digit loop never runs and every index parses as 0 -> every file record's + pidx becomes 0 while a row's fidx is the real 1..N fit -> `_tb_file_rec` + never matches and EVERY row degrades to the "??" placeholder. Measured on + Test/LLvmLiteTest: all 9146 stackmap records carried the single '??' file + string while function names and line numbers were correct. + """ v: int = 0 i: sizet = 0 + while _tb_cc(s, i) == 32 or _tb_cc(s, i) == 9: + i += 1 while _tb_cc(s, i) >= 48 and _tb_cc(s, i) <= 57: v = v * 10 + (_tb_cc(s, i) - 48) i += 1 @@ -1834,7 +1847,9 @@ def _tb_parse_dump(mb: memhub.MemBuddy*, dump: str) -> TbDump | t.CPtr: pkind = 0 continue if _tb_startswith(st, "dir_index:") != 0 and pkind == 1: - pdir = _tb_parse_dec(_tb_ltrim(st + 9)) + # `"dir_index:"` 含冒号共 10 字符:st + 9 指向冒号本身,解析恒得 0 + # (目录索引全丢 → 相对文件名拼不出绝对路径,File 行只剩裸文件名)。 + pdir = _tb_parse_dec(_tb_ltrim(st + 10)) continue if _tb_startswith(st, "Address") != 0 and _tb_contains(st, "Column") != 0: if pkind == 1 and pname is not None and file_count < TB_FILE_CAP: