Lines Matching refs:lf
1833 struct line_finder *lf = data; in line_range_walk_cb() local
1838 if ((strtailcmp(fname, lf->fname) != 0) || in line_range_walk_cb()
1839 (lf->lno_s > lineno || lf->lno_e < lineno)) in line_range_walk_cb()
1843 if (cu_find_lineinfo(&lf->cu_die, addr, &__fname, &__lineno) > 0 in line_range_walk_cb()
1847 err = line_range_add_line(fname, lineno, lf->lr); in line_range_walk_cb()
1855 static int find_line_range_by_line(Dwarf_Die *sp_die, struct line_finder *lf) in find_line_range_by_line() argument
1859 ret = die_walk_lines(sp_die ?: &lf->cu_die, line_range_walk_cb, lf); in find_line_range_by_line()
1863 if (!intlist__empty(lf->lr->line_list)) in find_line_range_by_line()
1864 ret = lf->found = 1; in find_line_range_by_line()
1868 zfree(&lf->lr->path); in find_line_range_by_line()
1890 struct line_finder *lf = param->data; in line_range_search_cb() local
1891 struct line_range *lr = lf->lr; in line_range_search_cb()
1898 lf->fname = dwarf_decl_file(sp_die); in line_range_search_cb()
1900 pr_debug("fname: %s, lineno:%d\n", lf->fname, lr->offset); in line_range_search_cb()
1901 lf->lno_s = lr->offset + lr->start; in line_range_search_cb()
1902 if (lf->lno_s < 0) /* Overflow */ in line_range_search_cb()
1903 lf->lno_s = INT_MAX; in line_range_search_cb()
1904 lf->lno_e = lr->offset + lr->end; in line_range_search_cb()
1905 if (lf->lno_e < 0) /* Overflow */ in line_range_search_cb()
1906 lf->lno_e = INT_MAX; in line_range_search_cb()
1907 pr_debug("New line range: %d to %d\n", lf->lno_s, lf->lno_e); in line_range_search_cb()
1908 lr->start = lf->lno_s; in line_range_search_cb()
1909 lr->end = lf->lno_e; in line_range_search_cb()
1912 line_range_inline_cb, lf); in line_range_search_cb()
1914 param->retval = find_line_range_by_line(sp_die, lf); in line_range_search_cb()
1920 static int find_line_range_by_func(struct line_finder *lf) in find_line_range_by_func() argument
1922 struct dwarf_callback_param param = {.data = (void *)lf, .retval = 0}; in find_line_range_by_func()
1923 dwarf_getfuncs(&lf->cu_die, line_range_search_cb, ¶m, 0); in find_line_range_by_func()
1929 struct line_finder lf = {.lr = lr, .found = 0}; in debuginfo__find_line_range() local
1940 .cu_die = &lf.cu_die, .sp_die = &lf.sp_die, .found = 0}; in debuginfo__find_line_range()
1942 .data = (void *)&lf, .retval = 0}; in debuginfo__find_line_range()
1947 line_range_search_cb(&lf.sp_die, &line_range_param); in debuginfo__find_line_range()
1948 if (lf.found) in debuginfo__find_line_range()
1954 while (!lf.found && ret >= 0) { in debuginfo__find_line_range()
1960 diep = dwarf_offdie(dbg->dbg, off + cuhl, &lf.cu_die); in debuginfo__find_line_range()
1968 lf.fname = cu_find_realpath(&lf.cu_die, lr->file); in debuginfo__find_line_range()
1970 lf.fname = 0; in debuginfo__find_line_range()
1972 if (!lr->file || lf.fname) { in debuginfo__find_line_range()
1974 ret = find_line_range_by_func(&lf); in debuginfo__find_line_range()
1976 lf.lno_s = lr->start; in debuginfo__find_line_range()
1977 lf.lno_e = lr->end; in debuginfo__find_line_range()
1978 ret = find_line_range_by_line(NULL, &lf); in debuginfo__find_line_range()
1986 if (lf.found) { in debuginfo__find_line_range()
1987 comp_dir = cu_get_comp_dir(&lf.cu_die); in debuginfo__find_line_range()
1996 return (ret < 0) ? ret : lf.found; in debuginfo__find_line_range()