- DEBUG2("Looking for symbol %d, addr = '%s'", i, addrs[i]);
- fgets(line_func, 1024, pipe);
- line_func[strlen(line_func) - 1] = '\0';
- fgets(line_pos, 1024, pipe);
- line_pos[strlen(line_pos) - 1] = '\0';
-
- if (strcmp("??", line_func)) {
- DEBUG2("Found static symbol %s() at %s", line_func, line_pos);
- e->bt_strings[i] = bprintf("** In %s() at %s", line_func, line_pos);
+ XBT_DEBUG("Looking for symbol %d, addr = '%s'", i, addrs[i]);
+ if (fgets(line_func, 1024, pipe)) {
+ line_func[strlen(line_func) - 1] = '\0';
+ } else {
+ XBT_VERB("Cannot run fgets to look for symbol %d, addr %s", i, addrs[i]);
+ strcpy(line_func, "???");
+ }
+ if (fgets(line_pos, 1024, pipe)) {
+ line_pos[strlen(line_pos) - 1] = '\0';
+ } else {
+ XBT_VERB("Cannot run fgets to look for symbol %d, addr %s", i, addrs[i]);
+ strcpy(line_pos, backtrace_syms[i]);
+ }
+
+ if (strcmp("??", line_func) != 0) {
+ XBT_DEBUG("Found static symbol %s() at %s", line_func, line_pos);
+ e->bt_strings[i] =
+ bprintf("** In %s() at %s", line_func, line_pos);