aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2019-01-17 00:07:43 +0000
committerTom de Vries <vries@gcc.gnu.org>2019-01-17 00:07:43 +0000
commit9ad458d5397ffccd419cdd4a00dd816a500ab018 (patch)
tree53f7bad707d051b375f18d8d7d537787deace525
parente6f00c83f4478e7e9174edf39219a6e0c1043c6c (diff)
downloadgcc-9ad458d5397ffccd419cdd4a00dd816a500ab018.zip
gcc-9ad458d5397ffccd419cdd4a00dd816a500ab018.tar.gz
gcc-9ad458d5397ffccd419cdd4a00dd816a500ab018.tar.bz2
[libbacktrace] Add altlink field to struct dwarf_data
Add an altlink field to struct dwarf_data, and initialize it with the pointer to the struct dwarf_data for the .gnu_debugaltlink. 2019-01-17 Tom de Vries <tdevries@suse.de> * dwarf.c (struct dwarf_data): Add altlink field. (backtrace_dwarf_add): Add and handle fileline_altlink parameter. * elf.c (elf_add): Add argument to backtrace_dwarf_add call. (phdr_callback, backtrace_initialize): Add argument to elf_add calls. * internal.h (backtrace_dwarf_add): Add fileline_altlink parameter. * pecoff.c (coff_add): Add argument to backtrace_dwarf_add call. * xcoff.c (xcoff_add): Same. From-SVN: r267994
-rw-r--r--libbacktrace/ChangeLog10
-rw-r--r--libbacktrace/dwarf.c7
-rw-r--r--libbacktrace/elf.c4
-rw-r--r--libbacktrace/internal.h1
-rw-r--r--libbacktrace/pecoff.c1
-rw-r--r--libbacktrace/xcoff.c1
6 files changed, 22 insertions, 2 deletions
diff --git a/libbacktrace/ChangeLog b/libbacktrace/ChangeLog
index f2d2954..dfb17f5 100644
--- a/libbacktrace/ChangeLog
+++ b/libbacktrace/ChangeLog
@@ -1,5 +1,15 @@
2019-01-17 Tom de Vries <tdevries@suse.de>
+ * dwarf.c (struct dwarf_data): Add altlink field.
+ (backtrace_dwarf_add): Add and handle fileline_altlink parameter.
+ * elf.c (elf_add): Add argument to backtrace_dwarf_add call.
+ (phdr_callback, backtrace_initialize): Add argument to elf_add calls.
+ * internal.h (backtrace_dwarf_add): Add fileline_altlink parameter.
+ * pecoff.c (coff_add): Add argument to backtrace_dwarf_add call.
+ * xcoff.c (xcoff_add): Same.
+
+2019-01-17 Tom de Vries <tdevries@suse.de>
+
* internal.h (backtrace_dwarf_add): Add fileline_entry parameter.
* dwarf.c (backtrace_dwarf_add): Add and handle fileline_entry parameter.
* elf.c (elf_add): Add and handle fileline_entry parameter. Add
diff --git a/libbacktrace/dwarf.c b/libbacktrace/dwarf.c
index 190c6fc..83cdb52 100644
--- a/libbacktrace/dwarf.c
+++ b/libbacktrace/dwarf.c
@@ -343,6 +343,8 @@ struct dwarf_data
{
/* The data for the next file we know about. */
struct dwarf_data *next;
+ /* The data for .gnu_debugaltlink. */
+ struct dwarf_data *altlink;
/* The base address for this file. */
uintptr_t base_address;
/* A sorted list of address ranges. */
@@ -3000,6 +3002,7 @@ build_dwarf_data (struct backtrace_state *state,
const unsigned char *dwarf_str,
size_t dwarf_str_size,
int is_bigendian,
+ struct dwarf_data *altlink,
backtrace_error_callback error_callback,
void *data)
{
@@ -3028,6 +3031,7 @@ build_dwarf_data (struct backtrace_state *state,
return NULL;
fdata->next = NULL;
+ fdata->altlink = altlink;
fdata->base_address = base_address;
fdata->addrs = addrs;
fdata->addrs_count = addrs_count;
@@ -3063,6 +3067,7 @@ backtrace_dwarf_add (struct backtrace_state *state,
const unsigned char *dwarf_str,
size_t dwarf_str_size,
int is_bigendian,
+ struct dwarf_data *fileline_altlink,
backtrace_error_callback error_callback,
void *data, fileline *fileline_fn,
struct dwarf_data **fileline_entry)
@@ -3073,7 +3078,7 @@ backtrace_dwarf_add (struct backtrace_state *state,
dwarf_line, dwarf_line_size, dwarf_abbrev,
dwarf_abbrev_size, dwarf_ranges, dwarf_ranges_size,
dwarf_str, dwarf_str_size, is_bigendian,
- error_callback, data);
+ fileline_altlink, error_callback, data);
if (fdata == NULL)
return 0;
diff --git a/libbacktrace/elf.c b/libbacktrace/elf.c
index a863327..87e7b0d 100644
--- a/libbacktrace/elf.c
+++ b/libbacktrace/elf.c
@@ -3097,6 +3097,7 @@ elf_add (struct backtrace_state *state, const char *filename, int descriptor,
debuglink_view_valid = 0;
}
+ struct dwarf_data *fileline_altlink = NULL;
if (debugaltlink_name != NULL)
{
int d;
@@ -3108,7 +3109,7 @@ elf_add (struct backtrace_state *state, const char *filename, int descriptor,
int ret;
ret = elf_add (state, filename, d, base_address, error_callback, data,
- fileline_fn, found_sym, found_dwarf, NULL,
+ fileline_fn, found_sym, found_dwarf, &fileline_altlink,
0, 1, debugaltlink_buildid_data,
debugaltlink_buildid_size);
backtrace_release_view (state, &debugaltlink_view, error_callback,
@@ -3265,6 +3266,7 @@ elf_add (struct backtrace_state *state, const char *filename, int descriptor,
sections[DEBUG_STR].data,
sections[DEBUG_STR].size,
ehdr.e_ident[EI_DATA] == ELFDATA2MSB,
+ fileline_altlink,
error_callback, data, fileline_fn,
fileline_entry))
goto fail;
diff --git a/libbacktrace/internal.h b/libbacktrace/internal.h
index d9ab401..e838977 100644
--- a/libbacktrace/internal.h
+++ b/libbacktrace/internal.h
@@ -303,6 +303,7 @@ extern int backtrace_dwarf_add (struct backtrace_state *state,
const unsigned char *dwarf_str,
size_t dwarf_str_size,
int is_bigendian,
+ struct dwarf_data *fileline_altlink,
backtrace_error_callback error_callback,
void *data, fileline *fileline_fn,
struct dwarf_data **fileline_entry);
diff --git a/libbacktrace/pecoff.c b/libbacktrace/pecoff.c
index cd20cbe..da1982f 100644
--- a/libbacktrace/pecoff.c
+++ b/libbacktrace/pecoff.c
@@ -867,6 +867,7 @@ coff_add (struct backtrace_state *state, int descriptor,
sections[DEBUG_STR].data,
sections[DEBUG_STR].size,
0, /* FIXME */
+ NULL,
error_callback, data, fileline_fn,
NULL))
goto fail;
diff --git a/libbacktrace/xcoff.c b/libbacktrace/xcoff.c
index 095800b..d50b5bc 100644
--- a/libbacktrace/xcoff.c
+++ b/libbacktrace/xcoff.c
@@ -1315,6 +1315,7 @@ xcoff_add (struct backtrace_state *state, int descriptor, off_t offset,
dwsect[DWSECT_STR].data,
dwsect[DWSECT_STR].size,
1, /* big endian */
+ NULL,
error_callback, data, fileline_fn,
NULL))
goto fail;