When set-dumpable=libs, let's also pick the debug symbols for the libs
we're loading. For now we only try /usr/lib/debug/<path>, which is quite
common and easy to guess. Build IDs could also be used but are more
complex to deal with, so let's stay simple for now.
goto leave;
load_file_into_tar(&ctx->storage, &ctx->size, ctx->prefix, fname, NULL, "haproxy-libs-dump");
+
+ /* try to load equivalent debug symbols for absolute paths */
+ if (*fname == '/') {
+ char dbg[PATH_MAX];
+
+ snprintf(dbg, sizeof(dbg), "/usr/lib/debug%s", fname);
+ load_file_into_tar(&ctx->storage, &ctx->size, ctx->prefix, dbg, NULL, "haproxy-libs-dump");
+ }
+
leave:
/* increment the object's number */
ctx->pos++;