- struct opt_c_struct *st
- = DICT_FIND_REF(dict_opt_c, &libsym->name,
- struct opt_c_struct);
- if (st == NULL) {
- const char *na = strdup(libsym->name);
- struct opt_c_struct new_st = {.count = 0, .tv = {0, 0}};
- if (na == NULL
- || DICT_INSERT(dict_opt_c, &na, &new_st) < 0) {
- free((char *)na);
- DICT_DESTROY(dict_opt_c, const char *,
- struct opt_c_struct,
- free_stringp_cb, NULL, NULL);
- goto oom;
+ /* This mimics the output produced by libunwind below. */
+ fprintf(options.output, " > %s(%s+0x%" PRIx64 ") [%" PRIx64 "]\n",
+ modname, symname, off, pc);
+
+ /* See if we can extract the source line too and print it on
+ the next line if we can find it. */
+ if (mod != NULL) {
+ Dwfl_Line *l = dwfl_module_getsrc(mod, pc);
+ if (l != NULL) {
+ int line, col;
+ line = col = -1;
+ const char *src = dwfl_lineinfo(l, NULL, &line, &col,
+ NULL, NULL);
+ if (src != NULL) {
+ fprintf(options.output, "\t%s", src);
+ if (line > 0) {
+ fprintf(options.output, ":%d", line);
+ if (col > 0)
+ fprintf(options.output,
+ ":%d", col);
+ }
+ fprintf(options.output, "\n");