- for (line_number = 1; fgets(line, sizeof line, f); line_number++) {
- if (strstr(line, "[stack]")) {
- uintptr_t end;
- if (sscanf(line, "%*"SCNxPTR"-%"SCNxPTR, &end) != 1) {
- VLOG_WARN("%s:%d: parse error", file_name, line_number);
- continue;
- }
- fclose(f);
- return end;
- }
+ b->n_frames = backtrace(frames, BACKTRACE_MAX_FRAMES);
+ for (i = 0; i < b->n_frames; i++) {
+ b->frames[i] = (uintptr_t) frames[i];