Deleted Added
full compact
libdwarf_abbrev.c (276398) libdwarf_abbrev.c (300311)
1/*-
2 * Copyright (c) 2007 John Birrell (jb@freebsd.org)
3 * Copyright (c) 2009-2011 Kai Wang
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 13 unchanged lines hidden (view full) ---

22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 */
27
28#include "_libdwarf.h"
29
1/*-
2 * Copyright (c) 2007 John Birrell (jb@freebsd.org)
3 * Copyright (c) 2009-2011 Kai Wang
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 13 unchanged lines hidden (view full) ---

22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 */
27
28#include "_libdwarf.h"
29
30ELFTC_VCSID("$Id: libdwarf_abbrev.c 3136 2014-12-24 16:04:38Z kaiwang27 $");
30ELFTC_VCSID("$Id: libdwarf_abbrev.c 3420 2016-02-27 02:14:05Z emaste $");
31
32int
33_dwarf_abbrev_add(Dwarf_CU cu, uint64_t entry, uint64_t tag, uint8_t children,
34 uint64_t aboff, Dwarf_Abbrev *abp, Dwarf_Error *error)
35{
36 Dwarf_Abbrev ab;
37 Dwarf_Debug dbg;
38

--- 71 unchanged lines hidden (view full) ---

110 uint64_t adoff;
111 uint64_t tag;
112 uint8_t children;
113 int ret;
114
115 assert(abp != NULL);
116
117 ds = _dwarf_find_section(dbg, ".debug_abbrev");
31
32int
33_dwarf_abbrev_add(Dwarf_CU cu, uint64_t entry, uint64_t tag, uint8_t children,
34 uint64_t aboff, Dwarf_Abbrev *abp, Dwarf_Error *error)
35{
36 Dwarf_Abbrev ab;
37 Dwarf_Debug dbg;
38

--- 71 unchanged lines hidden (view full) ---

110 uint64_t adoff;
111 uint64_t tag;
112 uint8_t children;
113 int ret;
114
115 assert(abp != NULL);
116
117 ds = _dwarf_find_section(dbg, ".debug_abbrev");
118 assert(ds != NULL);
119
120 if (*offset >= ds->ds_size)
118 if (ds == NULL || *offset >= ds->ds_size)
121 return (DW_DLE_NO_ENTRY);
122
123 aboff = *offset;
124
125 entry = _dwarf_read_uleb128(ds->ds_data, offset);
126 if (entry == 0) {
127 /* Last entry. */
128 ret = _dwarf_abbrev_add(cu, entry, 0, 0, aboff, abp,

--- 140 unchanged lines hidden ---
119 return (DW_DLE_NO_ENTRY);
120
121 aboff = *offset;
122
123 entry = _dwarf_read_uleb128(ds->ds_data, offset);
124 if (entry == 0) {
125 /* Last entry. */
126 ret = _dwarf_abbrev_add(cu, entry, 0, 0, aboff, abp,

--- 140 unchanged lines hidden ---