Lines Matching defs:lr
467 struct line_range *lr,
470 struct perf_probe_point pp = { .function = lr->function,
471 .file = lr->file,
472 .line = lr->start };
478 if (lr->end != INT_MAX)
479 len = lr->end - lr->start;
483 lr->function = result.function;
484 lr->file = result.file;
485 lr->start = result.line;
486 if (lr->end != INT_MAX)
487 lr->end = lr->start + len;
1045 static int sprint_line_description(char *sbuf, size_t size, struct line_range *lr)
1047 if (!lr->function)
1048 return snprintf(sbuf, size, "file: %s, line: %d", lr->file, lr->start);
1050 if (lr->file)
1051 return snprintf(sbuf, size, "function: %s, file:%s, line: %d", lr->function, lr->file, lr->start);
1053 return snprintf(sbuf, size, "function: %s, line:%d", lr->function, lr->start);
1065 static int __show_line_range(struct line_range *lr, const char *module,
1082 ret = debuginfo__find_line_range(dinfo, lr);
1085 ret = get_alternative_line_range(dinfo, lr, module, user);
1087 ret = debuginfo__find_line_range(dinfo, lr);
1099 sprint_line_description(sbuf, sizeof(sbuf), lr);
1108 tmp = lr->path;
1109 ret = find_source_path(tmp, sbuild_id, lr->comp_dir, &lr->path);
1112 if (tmp != lr->path)
1122 if (lr->function)
1123 fprintf(stdout, "<%s@%s:%d>\n", lr->function, lr->path,
1124 lr->start - lr->offset);
1126 fprintf(stdout, "<%s:%d>\n", lr->path, lr->start);
1128 fp = fopen(lr->path, "r");
1130 pr_warning("Failed to open %s: %s\n", lr->path,
1135 while (l < lr->start) {
1141 intlist__for_each_entry(ln, lr->line_list) {
1143 ret = show_one_line(fp, l - lr->offset);
1147 ret = show_one_line_with_num(fp, l++ - lr->offset);
1152 if (lr->end == INT_MAX)
1153 lr->end = l + NR_ADDITIONAL_LINES;
1154 while (l <= lr->end) {
1155 ret = show_one_line_or_eof(fp, l++ - lr->offset);
1164 int show_line_range(struct line_range *lr, const char *module,
1174 ret = __show_line_range(lr, module, user);
1300 int show_line_range(struct line_range *lr __maybe_unused,
1318 void line_range__clear(struct line_range *lr)
1320 zfree(&lr->function);
1321 zfree(&lr->file);
1322 zfree(&lr->path);
1323 zfree(&lr->comp_dir);
1324 intlist__delete(lr->line_list);
1327 int line_range__init(struct line_range *lr)
1329 memset(lr, 0, sizeof(*lr));
1330 lr->line_list = intlist__new(NULL);
1331 if (!lr->line_list)
1363 * Stuff 'lr' according to the line range described by 'arg'.
1372 int parse_line_range_desc(const char *arg, struct line_range *lr)
1381 lr->start = 0;
1382 lr->end = INT_MAX;
1393 err = parse_line_num(&p, &lr->start, "start line");
1400 err = parse_line_num(&p, &lr->end, "end line");
1405 lr->end += lr->start;
1412 lr->end--;
1416 pr_debug("Line range is %d to %d\n", lr->start, lr->end);
1419 if (lr->start > lr->end) {
1434 lr->file = strdup_esq(p);
1435 if (lr->file == NULL) {
1441 lr->function = strdup_esq(buf);
1442 if (!lr->function && !lr->file) {
1448 lr->file = strdup_esq(buf);
1450 lr->function = strdup_esq(buf);