}
}
+#define SYSTEM_BUILD_ID_DIR "/usr/lib/debug/.build-id/"
+
/* Open a separate debug info file, using the build ID to find it.
Returns an open file descriptor, or -1.
backtrace_error_callback error_callback,
void *data)
{
- const char * const prefix = "/usr/lib/debug/.build-id/";
+ const char * const prefix = SYSTEM_BUILD_ID_DIR;
const size_t prefix_len = strlen (prefix);
const char * const suffix = ".debug";
const size_t suffix_len = strlen (suffix);
shstr_size = shstrhdr->sh_size;
shstr_off = shstrhdr->sh_offset;
- if (!backtrace_get_view (state, descriptor, shstr_off, shstr_size,
+ if (!backtrace_get_view (state, descriptor, shstr_off, shstrhdr->sh_size,
error_callback, data, &names_view))
goto fail;
names_view_valid = 1;
/* Read the build ID if present. This could check for any
SHT_NOTE section with the right note name and type, but gdb
looks for a specific section name. */
- if (!debuginfo
+ if ((!debuginfo || with_buildid_data != NULL)
&& !buildid_view_valid
&& strcmp (name, ".note.gnu.build-id") == 0)
{
if (debugaltlink_name_len < shdr->sh_size)
{
/* Include terminating zero. */
- debugaltlink_name_len =+ 1;
+ debugaltlink_name_len += 1;
debugaltlink_buildid_data
= debugaltlink_data + debugaltlink_name_len;
if (debugaltlink_view_valid)
backtrace_release_view (state, &debugaltlink_view, error_callback,
data);
- ret = elf_add (state, NULL, d, base_address, error_callback, data,
+ ret = elf_add (state, "", d, base_address, error_callback, data,
fileline_fn, found_sym, found_dwarf, NULL, 0, 1, NULL,
0);
if (ret < 0)
if (debugaltlink_view_valid)
backtrace_release_view (state, &debugaltlink_view, error_callback,
data);
- ret = elf_add (state, NULL, d, base_address, error_callback, data,
+ ret = elf_add (state, "", d, base_address, error_callback, data,
fileline_fn, found_sym, found_dwarf, NULL, 0, 1, NULL,
0);
if (ret < 0)