diff options
author | Tom de Vries <tdevries@suse.de> | 2019-01-23 10:22:43 +0000 |
---|---|---|
committer | Tom de Vries <vries@gcc.gnu.org> | 2019-01-23 10:22:43 +0000 |
commit | 3f5d2012fb0ba2306b8f0799b50ccee6dc3762fc (patch) | |
tree | 0f735c02a3010558504dbd36dd3992f0fafe0114 /libbacktrace | |
parent | 37aa68563b3af16a1623490ae81f0712062f39e0 (diff) | |
download | gcc-3f5d2012fb0ba2306b8f0799b50ccee6dc3762fc.zip gcc-3f5d2012fb0ba2306b8f0799b50ccee6dc3762fc.tar.gz gcc-3f5d2012fb0ba2306b8f0799b50ccee6dc3762fc.tar.bz2 |
[libbacktrace] Use size_t for low_offset/high_offset fields of struct unit
2019-01-23 Tom de Vries <tdevries@suse.de>
* dwarf.c (struct unit): Use size_t for low_offset/high_offset fields.
(units_search, find_unit): Use size_t for offset.
(build_address_map): Use size_t for unit_offset.
From-SVN: r268180
Diffstat (limited to 'libbacktrace')
-rw-r--r-- | libbacktrace/ChangeLog | 6 | ||||
-rw-r--r-- | libbacktrace/dwarf.c | 12 |
2 files changed, 12 insertions, 6 deletions
diff --git a/libbacktrace/ChangeLog b/libbacktrace/ChangeLog index 131c9fe..1c6b1bd 100644 --- a/libbacktrace/ChangeLog +++ b/libbacktrace/ChangeLog @@ -1,3 +1,9 @@ +2019-01-23 Tom de Vries <tdevries@suse.de> + + * dwarf.c (struct unit): Use size_t for low_offset/high_offset fields. + (units_search, find_unit): Use size_t for offset. + (build_address_map): Use size_t for unit_offset. + 2019-01-20 Gerald Pfeifer <gerald@pfeifer.com> * allocfail.c (main): Increase portability of printf statement. diff --git a/libbacktrace/dwarf.c b/libbacktrace/dwarf.c index aacbd3a..e78d36b 100644 --- a/libbacktrace/dwarf.c +++ b/libbacktrace/dwarf.c @@ -285,10 +285,10 @@ struct unit size_t unit_data_offset; /* Offset of the start of the compilation unit from the start of the .debug_info section. */ - off_t low_offset; + size_t low_offset; /* Offset of the end of the compilation unit from the start of the .debug_info section. */ - off_t high_offset; + size_t high_offset; /* DWARF version. */ int version; /* Whether unit is DWARF64. */ @@ -891,9 +891,9 @@ read_attribute (enum dwarf_form form, struct dwarf_buf *buf, static int units_search (const void *vkey, const void *ventry) { - const off_t *key = (const off_t *) vkey; + const size_t *key = (const size_t *) vkey; const struct unit *entry = *((const struct unit *const *) ventry); - off_t offset; + size_t offset; offset = *key; if (offset < entry->low_offset) @@ -907,7 +907,7 @@ units_search (const void *vkey, const void *ventry) /* Find a unit in PU containing OFFSET. */ static struct unit * -find_unit (struct unit **pu, size_t units_count, off_t offset) +find_unit (struct unit **pu, size_t units_count, size_t offset) { struct unit **u; u = bsearch (&offset, pu, units_count, sizeof (struct unit *), units_search); @@ -1514,7 +1514,7 @@ build_address_map (struct backtrace_state *state, uintptr_t base_address, size_t i; struct unit **pu; size_t prev_addrs_count; - off_t unit_offset = 0; + size_t unit_offset = 0; memset (&addrs->vec, 0, sizeof addrs->vec); memset (&unit_vec->vec, 0, sizeof unit_vec->vec); |