struct stat stat_buf;
char *binary_name = NULL;
- xbt_assert0(e
+ xbt_assert(e
&& e->used,
"Backtrace not setup yet, cannot set it up for display");
XBT_DEBUG("Looking for symbol %d, addr = '%s'", i, addrs[i]);
fgets_res = fgets(line_func, 1024, pipe);
if (fgets_res == NULL)
- THROW2(system_error, 0,
+ THROWF(system_error, 0,
"Cannot run fgets to look for symbol %d, addr %s", i,
addrs[i]);
line_func[strlen(line_func) - 1] = '\0';
fgets_res = fgets(line_pos, 1024, pipe);
if (fgets_res == NULL)
- THROW2(system_error, 0,
+ THROWF(system_error, 0,
"Cannot run fgets to look for symbol %d, addr %s", i,
addrs[i]);
line_pos[strlen(line_pos) - 1] = '\0';
maps_name = bprintf("/proc/%d/maps", (int) getpid());
maps = fopen(maps_name, "r");
- sscanf(addrs[i], "%lx", &addr);
- sprintf(maps_buff, "%#lx", addr);
-
- if (strcmp(addrs[i], maps_buff)) {
+ addr = strtol(addrs[i], &p, 16);
+ if (*p != '\0') {
XBT_CRITICAL("Cannot parse backtrace address '%s' (addr=%#lx)",
addrs[i], addr);
}
}
fgets_res = fgets(line_func, 1024, subpipe);
if (fgets_res == NULL)
- THROW1(system_error, 0, "Cannot read result of subcommand %s",
+ THROWF(system_error, 0, "Cannot read result of subcommand %s",
subcmd);
line_func[strlen(line_func) - 1] = '\0';
fgets_res = fgets(line_pos, 1024, subpipe);
if (fgets_res == NULL)
- THROW1(system_error, 0, "Cannot read result of subcommand %s",
+ THROWF(system_error, 0, "Cannot read result of subcommand %s",
subcmd);
line_pos[strlen(line_pos) - 1] = '\0';
pclose(subpipe);