libdw: Handle .debug_rnglists in dwarf_ranges.
[platform/upstream/elfutils.git] / libdw / ChangeLog
1 2018-04-06  Mark Wielaard  <mark@klomp.org>
2
3         * dwarf_formaddr.c (__libdw_addrx): New function, extracted from...
4         (dwarf_formaddr): here. Use __libdw_addrx.
5         * dwarf_getlocation.c (getlocations_addr): Pass cu to
6         __libdw_read_begin_end_pair_inc.
7         * dwarf_ranges.c (__libdw_read_begin_end_pair_inc): Take cu as
8         argument. Handle .debug_rnglists.
9         (initial_offset): Handle .debug_rnglists and DW_FORM_rnglistx.
10         (dwarf_ranges): Likewise. Check cu isn't NULL before use. Pass cu to
11         __libdw_read_begin_end_pair_inc.
12         * libdwP.h (__libdw_read_begin_end_pair_inc): Take cu as argument.
13         (__libdw_cu_ranges_base): Handle DW_AT_rnglists_base.
14         (__libdw_addrx): New function definition.
15
16 2018-04-11  Mark Wielaard  <mark@klomp.org>
17
18         * dwarf.h: Add DWARF5 range list entry DW_RLE encodings.
19         * begin_elf.c (dwarf_scnnames): Add IDX_debug_rnglists.
20         * dwarf_error.c (errmsgs): Add DWARF_E_NO_DEBUG_RNGLISTS.
21         * dwarf_formudata.c (dwarf_formudata): Handle DW_AT_rnglists_base
22         and DW_FORM_rnglistx.
23         * dwarf_getscopes.c (pc_match): Also check for
24         DWARF_E_NO_DEBUG_RNGLISTS.
25         * libdwP.h: Add IDX_debug_rnglists.
26
27 2018-05-25  Mark Wielaard  <mark@klomp.org>
28
29         * dwarf_getlocation_attr.c (__libdw_cu_addr_base): Cast offset to
30         uintptr_t before returning as pointer.
31
32 2018-05-22  Mark Wielaard  <mark@klomp.org>
33
34         * dwarf_getlocation.c (__libdw_cu_base_address): Treat errors of
35         getting lowpc or entrypc the same as missing base address (zero).
36         * dwarf_highpc (dwarf_highpc): Handle any address form. Always set
37         error when attribute could not be found.
38
39 2018-05-21  Mark Wielaard  <mark@klomp.org>
40
41         * dwarf_begin_elf.c (valid_p): Add a fake_addr_cu to the result.
42         * dwarf_end.c (cu_free): Disconnect the fake_addr_cu from the split
43         dwarf if shared with skeleton.
44         (dwarf_end): release fake_addr_cu.
45         * dwarf_formaddr.c (__libdw_cu_addr_base): Move to...
46         * libdwP.h (__libdw_cu_addr_base): ... here.
47         (struct Dwarf): Add fake_addr_cu field.
48         * dwarf_formudata.c (dwarf_formudata): Handle
49         DW_FORM_GNU_addr_index and DW_FORM_addrx[1234].
50         * dwarf_getlocation_attr.c (addr_valp): New static function.
51         (dwarf_getlocation_attr): Create attribute for values of
52         DW_OP_GNU_const_index, DW_OP_constx and DW_OP_GNU_addr_index and
53         DW_OP_addrx.
54         * libdw_find_split_unit.c (__libdw_find_split_unit): Connect
55         IDX_debug_addr sectiondata and fake_addr_cu between split and
56         skeleton.
57
58 2018-05-20  Mark Wielaard  <mark@klomp.org>
59
60         * dwarf_cu_info.c: New file.
61         * Makefile.am (libdw_a_SOURCES): Add dwarf_cu_info.c.
62         * libdw.h (dwarf_cu_info): New function declaration.
63         * libdw.map (ELFUTILS_0.171): Add dwarf_cu_info.
64
65 2018-05-24  Mark Wielaard  <mark@klomp.org>
66
67         * dwarf_ranges.c (dwarf_ranges): Check for NULL cu.
68         * libdw_findcu.c (__libdw_intern_next_unit): Initialize ranges_base.
69
70 2018-05-18  Mark Wielaard  <mark@klomp.org>
71
72         * dwarf_formudata.c (__libdw_formptr): Handle the special case
73         of IDX_debug_ranges for DW_UT_split_compile with version < 5.
74         * dwarf_highpc.c (dwarf_highpc): Use dwarf_lowpc, check for
75         split compile cudie.
76         * dwarf_lowpc.c (dwarf_lowpc): Check for split compile cudie.
77         * dwarf_ranges.c (dwarf_ranges): Switch cu and sectiondata for
78         split compile units.
79         * libdwP.h (struct Dwarf_CU): Add ranges_base field.
80         (__libdw_cu_ranges_base): New static inline function.
81
82 2018-05-18  Mark Wielaard  <mark@klomp.org>
83
84         * libdw_findcu.c (__libdw_intern_next_unit): Init files to NULL.
85         * dwarf_getsrclines.c (dwarf_getsrclines): Handle split units by
86         taking the line table from the skeleton.
87         * dwarf_getsrcfiles.c (dwarf_getsrcfiles): Handle split units by
88         only taking the files from .debug_line offset zero (if it exists),
89         otherwise fall back to the skeleton.
90
91 2018-05-17  Mark Wielaard  <mark@klomp.org>
92
93         * dwarf_begin_elf.c (__libdw_debugdir): New function.
94         (valid_p): Call __libdw_debugdir.
95         * dwarf_end.c (dwarf_end.c): Free debugdir.
96         * dwarf_getalt.c (__libdw_filepath): Extract __libdw_debugdir logic.
97         take debugdir as argument instead of fd.
98         (find_debug_altlink): Call __libdw_filepath with debugdir.
99         * libdwP.h (struct Dwarf): Add debugdir field.
100         (__libdw_debugdir): New function prototype.
101         (__libdw_filepath): Adjust prototype to take a const char * instead of
102         an int.
103         * libdw_find_split_unit.c (__libdw_find_split_unit): Call
104         __libdw_filepath with debugdir.
105
106 2018-05-17  Mark Wielaard  <mark@klomp.org>
107
108         * dwarf_attr_integrate.c (dwarf_attr_integrate): Handle split_compile
109         unit DIE, search skeleton_compile unit DIE.
110         * dwarf_hasattr_integrate.c (dwarf_hasattr_integrate): Likewise.
111         * libdwP.h (is_cudie): Check cu is not NULL.
112
113 2018-05-19  Mark Wielaard  <mark@klomp.org>
114
115         * libdwP.h (__libdw_find_split_unit): Mark as internal_function.
116
117 2018-05-15  Mark Wielaard  <mark@klomp.org>
118
119         * Makefile.am (libdw_a_SOURCES): Add libdw_find_split_unit.c.
120         * dwarf_end.c (cu_free): Free split Dwarf.
121         * dwarf_get_units.c (dwarf_get_units): Handle DW_UT_skeleton by
122         calling __libdw_find_split_unit.
123         * libdwP.h (struct Dwarf_CU): Add split Dwarf_CU field.
124         (__libdw_find_split_unit): New function prototype.
125         (str_offsets_base_off): Use cu Dwarf if dbg is NULL.
126         (filepath): Rename to ...
127         (__libdw_filepath): This. Which is the actual function name in
128         dwarf_getalt.c.
129         (libdw_find_split_unit.c): New file.
130         * libdw_findcu.c (__libdw_intern_next_unit): Initialize split to -1.
131
132 2018-05-15  Mark Wielaard  <mark@klomp.org>
133
134         * libdwP.h (__libdw_first_die_from_cu_start): Adjust commented out
135         asserts.
136         * libdw_findcu.c (__libdw_intern_next_unit): For version 4 DWARF if
137         the cudie has a DW_AT_GNU_dwi_id set the unit_id8 and unit_type to
138         DW_UT_skeleton or DW_UT_split_compile based on whether the cudie has
139         child DIEs and a DW_AT_GNU_dwo_name attribute.
140
141 2018-05-14  Mark Wielaard  <mark@klomp.org>
142
143         * dwarf.h: Add GNU Debug Fission extensions. DW_AT_GNU_dwo_name,
144         DW_AT_GNU_dwo_id, DW_AT_GNU_ranges_base, DW_AT_GNU_addr_base,
145         DW_AT_GNU_pubnames, DW_AT_GNU_pubtypes. DW_FORM_GNU_addr_index,
146         DW_FORM_GNU_str_index. DW_OP_GNU_addr_index, DW_OP_GNU_const_index.
147         * dwarf_formaddr.c (dwarf_formaddr): Handle DW_FORM_GNU_addr_index
148         as DW_FORM_addrx.
149         (__libdw_cu_addr_base): Check for both DW_AT_GNU_addr_base and
150         DW_AT_addr_base.
151         * dwarf_formstring.c (dwarf_formstring): Handle DW_FORM_GNU_str_index
152         as DW_FORM_strx.
153         * dwarf_formudata.c (dwarf_formudata): Recognize DW_AT_GNU_addr_base
154         as addrptr. Recognize DW_AT_GNU_ranges_base as rangelistptr.
155         * dwarf_getlocation.c (__libdw_intern_expression): Handle
156         DW_OP_GNU_addr_index as DW_OP_addrx and DW_OP_GNU_const_index as
157         DW_OP_constx.
158         * libdw_form.c (__libdw_form_val_compute_len): Handle
159         DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index taking an uleb128.
160
161 2018-05-12  Mark Wielaard  <mark@klomp.org>
162
163         * dwarf_begin_elf.c (check_section): Also recognize .dwo section
164         name variants.
165
166 2018-05-11  Mark Wielaard  <mark@klomp.org>
167
168         * dwarf_formudata.c (dwarf_formudata): Handle DW_AT_macros as macptr.
169         * dwarf_getmacros.c (get_table_for_offset): Add DW_MACRO_define_sup,
170         DW_MACRO_undef_sup, DW_MACRO_import_sup, DW_MACRO_define_strx and
171         DW_MACRO_undef_strx. Add str_offsets_base_off to fake CU. Deal with
172         DW_AT_macros. Use libdw_valid_user_form.
173
174 2018-05-09  Mark Wielaard  <mark@klomp.org>
175
176         * dwarf_formstring.c (__libdw_cu_str_off_base): Moved to...
177         * libdwP.h (__libdw_cu_str_off_base): ...here. Make static inline.
178         (str_offsets_base_off): New internal function that also parses
179         .debug_str_offsets header if necessary.
180
181 2018-05-11  Mark Wielaard  <mark@klomp.org>
182
183         * dwarf_siblingof.c (dwarf_siblingof): Don't reference cu till it is
184         known the Dwarf_Die is came from is valid.
185         * libdwP.h (__libdw_dieabbrev): Check cu is not NULL.
186
187 2018-05-08  Mark Wielaard  <mark@klomp.org>
188
189         * dwarf_formref.c (__libdw_formref): Explicitly don't handle
190         DW_FORM_ref_sup4 and DW_FORM_ref_sup8.
191         * dwarf_formref_die.c (dwarf_formref_die): Handle DW_FORM_ref_sup4
192         and DW_FORM_ref_sup8.
193         * dwarf_formstring.c (dwarf_formstring): Handle DW_FORM_strp_sup
194         as DW_FORM_GNU_strp_alt.
195
196 2018-05-05  Mark Wielaard  <mark@klomp.org>
197
198         * dwarf.h: Add DWARF line content descriptions.
199         * libdwP.h (libdw_valid_user_form): New static function.
200         * dwarf_getsrclines.c (read_srclines): Check and parse version 5
201         DWARF header, dir and file tables separately from older versions
202         where different.
203
204 2018-04-24  Mark Wielaard  <mark@klomp.org>
205
206         * dwarf_begin_elf.c (dwarf_scnnames): Add ".debug_line_str".
207         * dwarf_error.c (errmsgs): Add DWARF_E_NO_DEBUG_STR and
208         DWARF_E_NO_DEBUG_LINE_STR.
209         * dwarf_formstring.c (dwarf_formstring): Handle DW_FORM_line_strp.
210         Get data from either .debug_str or .debug_line_str.
211         * libdwP.h: Add IDX_debug_line_str, DWARF_E_NO_DEBUG_STR and
212         DWARF_E_NO_DEBUG_LINE_STR.
213
214 2018-04-03  Mark Wielaard  <mark@klomp.org>
215
216         * dwarf_formudata.c (__libdw_formptr): Take and return const
217         unsigned char pointers.
218         * dwarf_getlocation.c (attr_base_address): Rename to...
219         (__libdw_cu_base_address): this. Take Dwarf_CU, check and set
220         base_address.
221         (initial_offset_base): Renamed to...
222         (initial_offset): this. Only provide offset.
223         (getlocations_addr): Move data size check and
224         address base addition into __libdw_read_begin_end_pair_inc. Use
225         __libdw_cu_base_address and initial_offset. Drop Elf_Data NULL
226         check (already done by initial_offset, through __libdw_formptr).
227         (dwarf_getlocations): Use __libdw_cu_base_address and initial_offset.
228         Drop Elf_Data NULL check.
229         * dwarf_ranges.c (__libdw_read_begin_end_pair_inc): Change argument
230         type of readp to Add readend argument. Check data size. Include base
231         in begin and end result.
232         (initial_offset): New static function.
233         (dwarf_ranges): Don't check Elf_Data being NULL (already done by
234         initial_offset, through __libdw_formptr). Use __libdw_cu_base_address
235         and initial_offset. Remove base check and addition (already done by
236         __libdw_read_begin_end_pair_inc.
237         * libdwP.h (Dwarf_CU): Add base_address field.
238         (__libdw_read_begin_end_pair_inc): Change argument type of readp to
239         const. Add readend argument.
240         (__libdw_formptr): Take and return const unsigned char pointers.
241         * libdw_findcu.c (__libdw_intern_next_unit): Initialize Dwarf_CU
242         base_address.
243
244 2018-04-04  Mark Wielaard  <mark@klomp.org>
245
246         * libdw_findcu.c (__libdw_intern_next_unit): Initialize Dwarf_CU
247         addr_base and str_off_base.
248
249 2018-03-23  Mark Wielaard  <mark@klomp.org>
250
251         * dwarf_begin_elf.c (dwarf_scnnames): Add IDX_debug_str_offsets,
252         increase size.
253         * dwarf_error.c (errmsgs): Add DWARF_E_NO_STR_OFFSETS.
254         * dwarf_formstring.c (dwarf_formstring): Handle DW_FORM_strx[1234].
255         (__libdw_cu_str_off_base): New function.
256         * dwarf_formudata.c (dwarf_formudata): Handle IDX_debug_str_offsets
257         as stroffsetsptr.
258         * libdwP.h: Add IDX_debug_str_offsets and DWARF_E_NO_STR_OFFSETS.
259         (struct Dwarf_CU): Add str_off_base field.
260         (__libdw_cu_str_off_base): New function declaration.
261
262 2018-03-22  Mark Wielaard  <mark@klomp.org>
263
264         * dwarf_begin_elf.c (dwarf_scnnames): Add IDX_debug_addr.
265         * dwarf_error.c (errmsgs): Add DWARF_E_NO_DEBUG_ADDR.
266         * dwarf_formaddr.c (dwarf_formaddr): Handle DW_FORM_addrx[1234].
267         (__libdw_cu_addr_base): New function.
268         * dwarf_formudata.c (dwarf_formudata): Handle DW_AT_addr_base as
269         addrptr.
270         * libdwP.h: Add IDX_debug_addr and DWARF_E_NO_DEBUG_ADDR.
271         (struct Dwarf_CU): Add addr_base field.
272         (__libdw_cu_addr_base): New function definition.
273         * memory-access.h (file_byte_order): New static function.
274         (read_3ubyte_unaligned): New inline function.
275
276 2018-03-29  Mark Wielaard  <mark@klomp.org>
277
278         * libdw.h (dwarf_decl_file): Extend documentation.
279         (dwarf_linesrc): Likewise.
280         (dwarf_filesrc): Likewise.
281
282 2018-03-06  Mark Wielaard  <mark@klomp.org>
283
284         * dwarf.h: Add DW_OP_implicit_pointer, DW_OP_addrx, DW_OP_constx,
285         DW_OP_entry_value, DW_OP_const_type, DW_OP_regval_type,
286         DW_OP_deref_type, DW_OP_xderef_type, DW_OP_convert and
287         DW_OP_reinterpret.
288         * dwarf_getlocation.c (__libdw_intern_expression): Handle
289         DW_OP_convert, DW_OP_reinterpret, DW_OP_addrx, DW_OP_constx,
290         DW_OP_regval_type, DW_OP_entry_value, DW_OP_implicit_pointer,
291         DW_OP_deref_type, DW_OP_xderef_type and DW_OP_const_type.
292         * dwarf_getlocation_attr.c (dwarf_getlocation_attr): Handle
293         DW_OP_entry_value, DW_OP_const_type and DW_OP_implicit_pointer.
294         * dwarf_getlocation_die.c (dwarf_getlocation_die): Handle
295         DW_OP_implicit_pointer, DW_OP_convert, DW_OP_reinterpret,
296         DW_OP_const_type, DW_OP_regval_type, DW_OP_deref_type and
297         DW_OP_xderef_type.
298         * dwarf_getlocation_implicit_pointer.c
299         (dwarf_getlocation_implicit_pointer): Handle DW_OP_implicit_pointer.
300
301 2018-03-01  Mark Wielaard  <mark@klomp.org>
302
303         * dwarf.h: Add DW_AT_GNU_locviews and DW_AT_GNU_entry_view.
304         * dwarf_formudata.c (dwarf_formudata): Handle DW_AT_GNU_locviews
305         as a loclistptr.
306
307 2018-02-09  Mark Wielaard  <mark@klomp.org>
308
309         * dwarf_formblock.c (dwarf_formblock): Handle DW_FORM_data16 as a
310         16 byte block.
311
312 2018-02-09  Mark Wielaard  <mark@klomp.org>
313
314         * dwarf_child.c (__libdw_find_attr): Handle DW_FORM_implicit_const.
315         * dwarf_formsdata.c (dwarf_formsdata): Likewise.
316         * dwarf_formudata.c (dwarf_formudata): Likewise.
317         * dwarf_getabbrev.c (__libdw_getabbrev): Likewise.
318         * dwarf_getattrs.c (dwarf_getattrs): Likewise.
319         * dwarf_hasattr.c (dwarf_hasattr): Likewise.
320         * dwarf_getabbrevattr.c (dwarf_getabbrevattr_data): New function
321         that will also return any data associated with the abbrev. Which
322         currently is only for DW_FORM_implicit_const. Based on...
323         (dwarf_getabbrevattr): ... this function. Which now just calls
324         dwarf_getabbrevattr_data.
325         * libdw.h (dwarf_getabbrevattr_data): Declare new function.
326         * libdw.map (ELFUTILS_0.170): Add dwarf_getabbrevattr_data.
327         * libdwP.h (dwarf_getabbrevattr_data): INTDECL.
328         * memory-access.h (__libdw_get_sleb128_unchecked): New inlined
329         function based on __libdw_get_uleb128_unchecked.
330
331 2018-02-08  Mark Wielaard  <mark@klomp.org>
332
333         * dwarf.h: Add DWARF5 DW_FORMs.
334         * libdwP.h (__libdw_form_val_compute_len): Handle fix length
335         DW_FORM_implicit_const, DW_FORM_addrx[1234], DW_FORM_strx[1234],
336         DW_FORM_ref_sup[48] and DW_FORM_data16.
337         * libdw_form.c (__libdw_form_val_compute_len): DW_FORM_strp_sup
338         and DW_FORM_line_strp are offset_size. DW_FORM_addrx, DW_FORM_strx,
339         DW_FORM_loclistx and DW_FORM_rnglistx are uleb128.
340
341 2018-01-30  Mark Wielaard  <mark@klomp.org>
342
343         * Makefile.am (libdw_a_SOURCES): Add dwarf_get_units.c.
344         * dwarf_get_units.c: New file.
345         * libdw.h (dwarf_get_units): New function declaration.
346         * libdw.map (ELFUTILS_0.170): Add dwarf_get_units.
347
348 2018-01-29  Mark Wielaard  <mark@klomp.org>
349
350         * dwarf.h (DW_UT_*): Add DWARF Unit Header Types.
351         * dwarf_cu_die.c (dwarf_cu_die): Rename arguments. type_signaturep
352         is now called unit_idp. type_offsetp is now called subdie_offsetp.
353         * dwarf_formref_die.c (dwarf_formref_die): Scan both .debug_info
354         and .debug_types sections for type units when type signature ref
355         not found.
356         * dwarf_getaranges.c (dwarf_getaranges): Use __libdw_findcu and
357         __libdw_first_die_off_from_cu instead of trying by hand.
358         * dwarf_getlocation_die.c (dwarf_getlocation_die): Use ISV4TU
359         instead of checking type_offset by hand.
360         * dwarf_getlocation_implicit_pointer.c
361         (dwarf_getlocation_implicit_pointer): Likewise.
362         * dwarf_nextcu.c (dwarf_next_unit): Call __libdw_next_unit.
363         (__libdw_next_unit): New function based on dwarf_next_unit with
364         DWARF5 header support.
365         * libdwP.h (struct Dwarf_CU): Renamed type_offset to subdie_offset
366         and type_sig8 to unit_id8.
367         (ISV4TU): New macro to determine whether a CU is a version 4 type
368         unit (which comes from the .debug_types section).
369         (DIE_OFFSET_FROM_CU_OFFSET): Replaced macro by real function...
370         (__libdw_first_die_from_cu_start): ... that also handles DWARF5
371         unit headers.
372         (__libdw_first_die_off_from_cu): New function that calls the above
373         using the CU fields.
374         (CUDIE): Use __libdw_first_die_off_from_cu.
375         (SUBDIE): New macro that provides the DIE for a CU using the
376         subdie_offset.
377         (__libdw_next_unit): New internal function declaration.
378         * libdw_findcu.c (__libdw_intern_next_unit): Use __libdw_next_unit.
379         Accept DWARF version 5 headers. Setup unit_type.
380         (__libdw_findcu): Rename debug_types argument to v4_debug_types
381         argument (to indicate that we are looking in the .debug_types
382         section). Support finding the exact offset (unit header start).
383
384 2018-01-25  Mark Wielaard  <mark@klomp.org>
385
386         * Makefile.am (libdw_a_SOURCES): Add dwarf_die_addr_die.c.
387         * dwarf_die_addr_die.c: New file.
388         * libdw.h (dwarf_die_addr_die): New function declaration.
389         * libdw.map (ELFUTILS_0.171): New section with dwarf_die_addr_die.
390         * libdwP.h (__libdw_findcu_addr): New internal function declaration.
391         * libdw_findcu.c (__libdw_findcu_addr): New internal function.
392
393 2018-02-09  Joshua Watt  <JPEWhacker@gmail.com>
394
395         * cfi.c (execute_cfi): Use FALLTHROUGH macro instead of comment.
396         * dwarf_frame_register.c (dwarf_frame_register): Likewise.
397
398 2018-01-22  Mark Wielaard  <mark@klomp.org>
399
400         * Makefile.am (AM_CPPFLAGS): Add -I libdwelf.
401         * dwarf_begin_elf.c (dwarf_begin_elf): Initialize Dwarf alt_fd to -1.
402         * dwarf_end.c (dwarf_end): Call dwarf_end and close on the alt_dwarf
403         and alt_fd if we allocated them.
404         * dwarf_fromref_die.c (dwarf_formref_die): Call dwarf_getalt.
405         * dwarf_formstring.c (dwarf_formstring): Likewise.
406         * dwarf_getalt.c (__libdw_filepath): New internal function.
407         (find_debug_altlink): New static function.
408         (dwarf_getalt): Check Dwarf alt_dwarf and call find_debug_altlink.
409         Cache result.
410         * dwarf_setalt.c (dwarf_setalt): Clean up Dwarf alt_dwarf and alt_fd
411         if we allocated.
412         * libdw.h (dwarf_getalt): Extend documentation.
413         (dwarf_setalt): Likewise.
414         * libdwP.h (struct Dwarf): Add alt_fd field.
415         (filepath): Declare new internal function.
416
417 2018-01-14  Petr Machata  <pmachata@gmail.com>
418
419         * dwarf_formsdata.c (dwarf_formsdata):
420         <DW_FORM_data1>: Cast to signed char.
421         <DW_FORM_data2,4,8>: Use read_*sbyte_unaligned instead of
422         read_*ubyte_unaligned.
423
424 2017-12-26  Mark Wielaard  <mark@klomp.org>
425
426         * libdwP.h (struct Dwarf_Abbrev): Pack struct. Remove attrcnt,
427         use bitfields for has_children and code.
428         * dwarf_getabbrev.c (__libdw_getabbrev): Don't count attrs.
429         * dwarf_getattrcnt.c (dwarf_getattrcnt): Count attrs.
430
431 2017-12-26  Mark Wielaard  <mark@klomp.org>
432
433         * memory-access.h (__libdw_get_uleb128_unchecked): New function.
434         (get_uleb128_unchecked): New define.
435         * dwarf_child.c (__libdw_find_attr): Use get_uleb128_unchecked to
436         read attr name and form.
437         * dwarf_getabbrevattr.c (dwarf_getabbrevattr): Likewise.
438         * dwarf_getattrs.c (dwarf_getattrs): Likewise.
439         * dwarf_hasattr.c (dwarf_hasattr): Likewise.
440
441 2017-12-28  Mark Wielaard  <mark@klomp.org>
442
443         * dwarf_offdie.c (__libdw_offdie): Check sectiondata exists.
444
445 2017-05-09  Ulf Hermann  <ulf.hermann@qt.io>
446             Mark Wielaard  <mark@klomp.org>
447
448         * libdwP.h (__libdw_in_section): Fix check for the upper border of
449         the range.
450         (__libdw_offset_in_section): Likewise.
451
452 2017-12-20  Mark Wielaard  <mark@klomp.org>
453
454         * libdwP.h (struct Dwarf_CU): Add sec_idx field.
455         (cu_sec_idx): Return cu->sec_idx.
456         * libdw_findcu.c (__libdw_intern_next_unit): Set cu sec_idx to
457         IDX_debug_info or IDX_debug_types.
458         * dwarf_begin_elf.c (valid_p): Set fake_loc_cu->sec_idx to
459         IDX_debug_loc.
460         * dwarf_getmacros.c (read_macros): Set fake_cu->sec_idx to
461         IDX_debug_macro or IDX_debug_macinfo.
462
463 2017-12-12  Mark Wielaard  <mark@klomp.org>
464
465         * dwarf_aggregate_size.c (dwarf_aggregate_size): Don't peel the
466         given DIE. Reserve memory for a new DIE first.
467
468 2017-12-11  Dima Kogan  <dima@secretsauce.net>
469
470         * dwarf_aggregate_size.c (array_size): Handle multi-dimensional
471         arrays properly.
472
473 2017-11-03  Mark Wielaard  <mark@klomp.org>
474
475         * dwarf_getlocation.c (__libdw_intern_expression): Handle
476         DW_OP_GNU_variable_value.
477         * dwarf_getlocation_attr.c (dwarf_getlocation_attr): Likewise.
478         * dwarf_getlocation_die.c (dwarf_getlocation_die): Likewise.
479
480 2017-11-03  Mark Wielaard  <mark@klomp.org>
481
482         * dwarf_getlocation.c (attr_ok): Always accept DW_FORM_exprloc.
483         Update list of acceptable attribute codes based on DWARF5.
484
485 2017-11-03  Mark Wielaard  <mark@klomp.org>
486
487         * dwarf.h: Add DW_OP_GNU_variable_value.
488
489 2017-10-03  Mark Wielaard  <mark@klomp.org>
490
491         * libdw.h: Define LIBDW_CIE_ID and use it in dwarf_cfi_cie_p.
492
493 2017-08-18  Ulf Hermann  <ulf.hermann@qt.io>
494
495         * memory-access.h: Use attribute_packed.
496
497 2017-02-27  Ulf Hermann  <ulf.hermann@qt.io>
498
499         * libdwP.h: Use attribute_hidden.
500         * libdw_alloc.c: Likewise.
501
502 2017-02-27  Ulf Hermann  <ulf.hermann@qt.io>
503
504         * Makefile.am: Use fpic_CFLAGS and dso_LDFLAGS.
505
506 2017-07-26  Mark Wielaard  <mark@klomp.org>
507
508         * dwarf.h: Add DW_MACRO_* and compat defines for DW_MACRO_GNU_*.
509         * dwarf_getmacros.c (get_table_for_offset): Accept either version
510         4 or 5. Use DW_MACRO names instead of DW_MACRO_GNU names.
511         (read_macros): Use table version for fake_cu.
512
513 2017-07-26  Mark Wielaard  <mark@klomp.org>
514
515         * dwarf_peel_type.c (dwarf_peel_type): Handle DW_TAG_immutable_type,
516         DW_TAG_packed_type and DW_TAG_shared_type.
517         * libdw.h (dwarf_peel_type): Extend documentation.
518
519 2017-07-26  Mark Wielaard  <mark@klomp.org>
520
521         * dwarf.h: Add DW_DEFAULTED_no, DW_DEFAULTED_in_class and
522         DW_DEFAULTED_out_of_class.
523
524 2017-07-26  Mark Wielaard  <mark@klomp.org>
525
526         * dwarf.h: Add DW_CC_pass_by_reference and DW_CC_pass_by_reference.
527
528 2017-07-26  Mark Wielaard  <mark@klomp.org>
529
530         * dwarf_default_lower_bound.c: New file.
531         * Makefile.am (libdw_a_SOURCES): Add dwarf_default_lower_bound.c.
532         * dwarf_aggregate_size.c (array_size): Use dwarf_default_lower_bound.
533         * dwarf_error.c (errmsgs): Add DWARF_E_UNKNOWN_LANGUAGE.
534         * libdw.h: Add dwarf_default_lower_bound.
535         * libdw.map (ELFUTILS_0.170): Add dwarf_default_lower_bound.
536         * libdwP.h: Add DWARF_E_UNKNOWN_LANGUAGE and
537         dwarf_default_lower_bound INTDECL.
538
539 2017-07-26  Mark Wielaard  <mark@klomp.org>
540
541         * dwarf.h: Add DW_LANG_OpenCL, DW_LANG_Modula3,
542         DW_LANG_C_plus_plus_03, DW_LANG_OCaml, DW_LANG_Rust, DW_LANG_Swift,
543         DW_LANG_Julia, DW_LANG_Dylan, DW_LANG_RenderScript, DW_LANG_BLISS.
544         * dwarf_aggregate_size.c (array_size): Add lower bound for
545         DW_LANG_C_plus_plus_03, DW_LANG_Python, DW_LANG_OpenCL,
546         DW_LANG_Haskell, DW_LANG_OCaml, DW_LANG_Rust, DW_LANG_Swift,
547         DW_LANG_Dylan, DW_LANG_RenderScript, DW_LANG_Modula3,
548         DW_LANG_Julia and DW_LANG_BLISS.
549
550 2017-07-26  Mark Wielaard  <mark@klomp.org>
551
552         * dwarf.h: Add DW_ATE_UCS and DW_ATE_ASCII.
553
554 2017-07-25  Mark Wielaard  <mark@klomp.org>
555
556         * dwarf.h: Add DW_TAG_coarray_type, DW_TAG_generic_subrange,
557         DW_TAG_dynamic_type, DW_TAG_call_site, DW_TAG_call_site_parameter,
558         DW_TAG_skeleton_unit, DW_TAG_immutable_type. Add reserved comments
559         for currently unused numbers.
560
561 2017-07-25  Mark Wielaard  <mark@klomp.org>
562
563         * dwarf.h (DWARF attributes enum): Remove DW_AT_subscr_data,
564         DW_AT_element_list and DW_AT_member. Add DWARF5 attribute constants.
565         (DW_AT_subscr_data, DW_AT_element_list, DW_AT_member): New defines.
566
567 2017-07-21  Mark Wielaard  <mark@klomp.org>
568
569         * dwarf_line_file.c: New file.
570         * Makefile.am (libdw_a_SOURCES): Add dwarf_line_file.c.
571         * libdw.h (dwarf_line_file): New function declaration.
572         * libdw.map (ELFUTILS_0.170): New. Add dwarf_line_file.
573
574 2017-02-17  Ulf Hermann  <ulf.hermann@qt.io>
575
576         * Makefile.am: Add libdw_so_LIBS to specify the archives libdw is is
577         made of, libdw_so_DEPS for libraries it depends on (including
578         libeu.a), libdw_so_LDLIBS to specify libraries libdw links against.
579         (libdw.so$(EXEEXT)): Add $(libdw_so_LDLIBS), remove enumeration of
580         library dependencies, use libdw_so_LIBS rather than relying on the
581         order of dependencies specified, add -z,relro.
582
583 2017-04-20  Ulf Hermann  <ulf.hermann@qt.io>
584
585         * libdw.h: Remove attribute macro declarations and use
586         __noreturn_attribute__ as defined in libelf.h.
587
588 2017-04-20  Ulf Hermann  <ulf.hermann@qt.io>
589
590         * dwarf_begin_elf.c: Include endian.h.
591
592 2017-03-30  Mark Wielaard  <mjw@redhat.com>
593
594         * dwarf_peel_type.c (dwarf_peel_type): Call dwarf_attr_integrate on
595         result.
596
597 2016-10-22  Mark Wielaard  <mjw@redhat.com>
598
599         * dwarf.h: Correct spelling of DW_LANG_PLI. Add compatibility define.
600         * dwarf_aggregate_size.c (array_size): Use correct spelling of
601         DW_LANG_PLI.
602
603 2016-11-02  Mark Wielaard  <mjw@redhat.com>
604
605         * cfi.c (execute_cfi): Add fallthrough comments.
606         * encoded-value.h (encoded_value_size): Add explicit return instead
607         of relying on fallthrough.
608         * dwfl_report_elf.c (__libdwfl_elf_address_range): Add fallthrough
609         comment.
610
611 2016-10-11  Akihiko Odaki  <akihiko.odaki.4i@stu.hosei.ac.jp>
612
613         * dwarf_getpubnames.c: Remove sys/param.h include, add system.h.
614         * libdw_alloc.c: Likewise.
615
616 2016-07-08  Mark Wielaard  <mjw@redhat.com>
617
618         * libdw.map (ELFUTILS_0.167): New. Add dwelf_strtab_init,
619         dwelf_strtab_add, dwelf_strtab_add_len, dwelf_strtab_finalize,
620         dwelf_strent_off, dwelf_strent_str and dwelf_strtab_free.
621
622 2016-02-13  Mark Wielaard  <mjw@redhat.com>
623
624         * dwarf_getsrclines.c (read_srclines): Calculate ndirs first, then
625         assign to ndirlist.
626
627 2015-12-18  Mark Wielaard  <mjw@redhat.com>
628
629         * libdwP.h (struct Dwarf): Remove sectiondata_gzip_mask.
630         (__libdw_free_zdata): Remove.
631         * dwarf_begin_elf.c (inflate_section): Remove.
632         (check_section): Remove __libdw_free_zdata calls. Use elf_compress
633         and elf_compress_gnu to decompress if necessary.
634         (valid_p): Remove __libdw_free_zdata calls.
635         (scngrp_read): Use elf_compress if section is compressed. Remove
636         __libdw_free_zdata calls.
637         * dwarf_end.c (__libdw_free_zdata): Remove.
638         (dwarf_end): Don't call __libdw_free_zdata.
639
640 2015-10-28  Mark Wielaard  <mjw@redhat.com>
641
642         * libdw.map (ELFUTILS_0.165): New. Add dwelf_scn_gnu_compressed_size.
643
644 2015-12-02  Mark Wielaard  <mjw@redhat.com>
645
646         * fde.c (intern_fde): Don't leak duplicate FDEs.
647
648 2015-12-01  Mark Wielaard  <mjw@redhat.com>
649
650         * fde.c (intern_fde): Don't intern an fde that doesn't cover a
651         valid code range.
652
653 2015-12-01  Mark Wielaard  <mjw@redhat.com>
654
655         * dwarf_end.c (dwarf_end): Call cu_free on fake_loc_cu if it exists.
656
657 2015-10-14  Chih-Hung Hsieh  <chh@google.com>
658
659         * dwarf_entry_breakpoints.c (dwarf_entry_breakpoints): Move recursive
660         functions 'add_bkpt', 'entrypc_bkpt', and 'search_range' to file scope.
661
662 2015-10-14  Chih-Hung Hsieh  <chh@google.com>
663
664         * libdw_visit_scopes.c (__libdw_visit_scopes): Move recursive nested
665         function 'walk_children' to file scope; inline 'recurse' at its call
666         site.
667
668 2015-10-19  Mark Wielaard  <mjw@redhat.com>
669
670         * frame-cache.c (__libdw_destroy_frame_cache): Call ebl_closebackend
671         if necessary.
672
673 2015-10-16  Dmitry V. Levin  <ldv@altlinux.org>
674
675         * dwarf_getsrclines.c (read_srclines): Initialize state early.
676
677 2015-10-13  Chih-Hung Hsieh  <chh@google.com>
678
679         * dwarf_getsrclines.c (read_srclines): Move nested functions
680         'advance_pc' and 'add_new_line' to file scope and keep many
681         local state variables within one structure.
682
683 2015-10-13  Chih-Hung Hsieh  <chh@google.com>
684
685         * dwarf_getscopevar.c (dwarf_getscopevar): Move nested
686         function 'file_matches' to file scope.
687
688 2015-10-16  Mark Wielaard  <mjw@redhat.com>
689
690         * Makefile.am (libdw.so): Add -lz.
691
692 2015-10-14  Chih-Hung Hsieh  <chh@google.com>
693
694         * cfi.c (execute_cfi): Move nested functions 'enough_registers'
695         and 'require_cfa_offset' to file scope.
696
697 2015-10-09  Josh Stone  <jistone@redhat.com>
698
699         * dwarf_begin.c (dwarf_begin): Replace stat64 and fstat64 with stat
700         and fstat.
701
702 2015-10-05  Josh Stone  <jistone@redhat.com>
703
704         * Makefile.am (libdw.so): Add AM_V_CCLD and AM_V_at silencers.
705
706 2015-09-24  Jose E. Marchesi  <jose.marchesi@oracle.com>
707
708         * Makefile.am (AM_CFLAGS): Use -fPIC instead of -fpic to avoid
709         relocation overflows in some platforms.
710
711 2015-09-23  Mark Wielaard  <mjw@redhat.com>
712
713         * dwarf_error.c (__libdw_seterrno): Mark as internal_function.
714         * dwarf_formref.c (__libdw_formref): Likewise.
715         * libdw_findcu.c (__libdw_findcu): Likewise.
716         * libdw_visit_scopes.c (__libdw_visit_scopes): Likewise.
717
718 2015-09-22  Mark Wielaard  <mjw@redhat.com>
719
720         * *.c: Remove old-style function definitions.
721
722 2015-09-15  Mark Wielaard  <mjw@redhat.com>
723
724         * dwarf_peel_type.c (dwarf_peel_type): Don't reassign result pointer.
725
726 2015-09-09  Chih-Hung Hsieh  <chh@google.com>
727
728         * dwarf_macro_getsrcfiles.c (dwarf_macro_getsrcfiles): Remove
729         redundant NULL tests on parameters declared with __nonnull_attribute__.
730         * dwarf_siblingof.c (dwarf_siblingof): Likewise.
731         * libdw_visit_scopes.c (__libdw_visit_scopes): Likewise.
732
733 2015-09-04  Chih-Hung Hsieh  <chh@google.com>
734             Mark Wielaard  <mjw@redhat.com>
735
736         * dwarf_getlocation.c (getlocations_addr): Replace K&R function
737         definition with ansi-C definition and add const qualifier to
738         locs argument.
739
740 2015-09-04  Chih-Hung Hsieh  <chh@google.com>
741
742         * libdw_findcu.c (__libdw_intern_next_unit): Replace K&R function
743         definition with ansi-C definitions.
744         (__libdw_findcu): Likewise.
745
746 2015-08-25  Mark Wielaard  <mjw@redhat.com>
747
748         * dwarf.h: Add DW_LANG_Haskell.
749
750 2015-06-18  Mark Wielaard  <mjw@redhat.com>
751
752         * dwarf_begin_elf.c (dwarf_begin_elf): Assert page size is big enough
753         to hold a Dwarf.
754
755 2015-06-18  Mark Wielaard  <mjw@redhat.com>
756
757         * dwarf_getpubnames.c (get_offsets): Always free mem on error.
758
759 2015-06-18  Mark Wielaard  <mjw@redhat.com>
760
761         * dwarf_getmacros.c (get_macinfo_table): Return NULL when
762         dwarf_formudata reports an error.
763         (get_table_for_offset): Likewise.
764
765 2015-06-08  Mark Wielaard  <mjw@redhat.com>
766
767         * dwarf_getsrclines.c (read_srclines): Initialize dirarray early.
768
769 2015-06-06  Mark Wielaard  <mjw@redhat.com>
770
771         * dwarf_getsrclines.c (read_srclines): Initialize filelist early.
772
773 2015-05-27  Mark Wielaard  <mjw@redhat.com>
774
775         * encoded-value.h (read_encoded_value): Check data d_size contains
776         at least enough data to hold a pointer for DW_EH_PE_indirect.
777
778 2015-05-22  Mark Wielaard  <mjw@redhat.com>
779
780         * dwarf_getsrclines.c (read_srclines): Limit stack usage of lines
781         with MAX_STACK_LINES, files with MAX_STACK_LINES and dirs with
782         MAX_STACK_DIRS. Calculate number of dirs needed first, then
783         create dirarray directly, without needing the next field. Free
784         not stack allocated lines and files at the end.
785
786 2015-05-19  Mark Wielaard <mjw@redhat.com>
787
788         * dwarf_getlocation.c (__libdw_intern_expression): Create a stack
789         allocated array to hold locs. Allocate locs bigger than the array
790         with malloc and free them when done.
791
792 2015-05-11  Jonathan Lebon  <jlebon@redhat.com>
793
794         * libdwP.h (DWARF_E_COMPRESSED_ERROR): New enumerator.
795         * dwarf_error.c (errmsgs): Add DWARF_E_COMPRESSED_ERROR message.
796         * dwarf_begin_elf.c (inflate_section): New static function, lifted
797         from...
798         (check_section): ... here. Call inflate_section, set libdw errno to
799         DWARF_E_COMPRESSED_ERROR if .debug_info section couldn't be inflated.
800
801 2015-05-11  Jonathan Lebon  <jlebon@redhat.com>
802
803         * dwarf_begin_elf.c (check_section): Add compressed flag. Always
804         check for .zdebug sections. Only wrap decompression in #if USE_ZLIB.
805
806 2015-05-06  Mark Wielaard  <mjw@redhat.com>
807
808         * dwarf_getsrclines.c (read_srclines): Use an int64_t to store and
809         check the line number.
810
811 2015-05-05  Mark Wielaard  <mjw@redhat.com>
812
813         * dwarf_getaranges.c (dwarf_getaranges): Check there is enough data
814         left before reading values.
815
816 2015-05-04  Anthony G. Basile  <blueness@gentoo.org>
817
818         * Makefile.am (libdw_so_SOURCES): Append $(argp_LDADD) to link
819         command.
820
821 2015-04-22  Mark Wielaard  <mjw@redhat.com>
822
823         * memory-access.h (__libdw_max_len_leb128): Take type_len as argument.
824         (__libdw_max_len_uleb128): New function.
825         (__libdw_max_len_sleb128): Likewise.
826         (__libdw_get_uleb128): Use __libdw_max_len_uleb128.
827         (__libdw_get_sleb128): Use __libdw_max_len_sleb128.
828
829 2015-04-21  Mark Wielaard  <mjw@redhat.com>
830
831         * dwarf_getmacros.c (read_macros): Allocate attributes dynamically
832         when there are more than 8.
833
834 2015-04-01  Petr Machata  <pmachata@redhat.com>
835
836         * libdwP.h (DWARF_E_NOT_CUDIE): New enumerator.
837         (is_cudie): New function.
838         * dwarf_error.c (errmsgs): Add message for DWARF_E_NOT_CUDIE.
839         * dwarf_getsrcfiles.c (dwarf_getsrcfiles): Call is_cudie instead
840         of white-listing valid tags.
841         * dwarf_getsrclines.c (dwarf_getsrclines): Likewise.
842
843 2015-03-18  Petr Machata  <pmachata@redhat.com>
844
845         * Makefile.am (pkginclude_HEADERS): Add known-dwarf.h.
846         (EXTRA_DIST): Remove known-dwarf.h.
847
848 2015-02-09  Mark Wielaard  <mjw@redhat.com>
849
850         * dwarf.h: Add DW_LANG_Fortran03 and DW_LANG_Fortran08.
851         * dwarf_aggregate_size.c (array_size): Recognize array lower bound
852         for new Fortran language codes is 1.
853
854 2015-02-09  Mark Wielaard  <mjw@redhat.com>
855
856         * dwarf.h: Add DW_TAG_atomic_type.
857         * libdw.h (dwarf_peel_type): Document DW_TAG_atomic_type.
858         * dwarf_peel_type.c (dwarf_peel_type): Handle DW_TAG_atomic_type.
859
860 2015-02-11  Josh Stone  <jistone@redhat.com>
861
862         * encoded-value.h (read_encoded_value): Initialize value.
863
864 2015-02-11  Petr Machata  <pmachata@redhat.com>
865
866         * dwarf_ranges.c (dwarf_ranges): Do not bail out when neither
867         DW_AT_entry_pc nor DW_AT_low_pc are available.  Instead remember
868         the fact in *BASEP and bail out later if it hasn't been updated by
869         __libdw_read_begin_end_pair_inc.
870
871 2014-12-24  Mark Wielaard  <mjw@redhat.com>
872
873         * dwarf_getsrc_die.c (dwarf_getsrc_die): Return the last line record
874         smaller than or equal to addr, rather than returning immediately on
875         a match.
876
877 2015-01-07  Mark Wielaard  <mjw@redhat.com>
878
879         * cfi.h (struct Dwarf_CFI_s): Add search_table_len.
880         * dwarf_getcfi_elf.c (getcfi_gnu_eh_frame): Check there is enough
881         room in the search table for all entries. Store search_table_len.
882         (getcfi_scn_eh_frame): Likewise.
883         * encoded-value.h (encoded_value_size): Don't abort, return zero.
884         (__libdw_cfi_read_address_inc): Check there is enough room to read
885         values. Pass other byte order to read functions.
886         (read_encoded_value): Check encoded_value_size. Don't abort, but
887         set libdw errno and report failure. Check there is enough room to
888         read values.
889         * fde.c (binary_search_fde): Check encoded value size. Add hdr
890         data buf and size to dummy_cfi.
891
892 2015-01-04  Mark Wielaard  <mjw@redhat.com>
893
894         * dwarf_siblingof.c (dwarf_siblingof): Check sibling attribute
895         is after current DIE.
896
897 2015-01-04  Mark Wielaard  <mjw@redhat.com>
898
899         * cfi.c (enough_registers): Check reg < INT32_MAX / sizeof
900         (dwarf_frame_register).
901
902 2015-01-02  Mark Wielaard  <mjw@redhat.com>
903
904         * dwarf_getcfi_elf.c (parse_eh_frame_hdr): Add size check.
905         (getcfi_gnu_eh_frame): Remove size check. Check d_buf is not NULL.
906         (getcfi_scn_eh_frame): Check d_buf is not NULL.
907
908 2015-01-02  Mark Wielaard  <mjw@redhat.com>
909
910         * dwarf_getlocation.c (__libdw_intern_expression): Check dbg is not
911         NULL for DW_OP_call_ref and DW_OP_GNU_implicit_pointer. For
912         DW_OP_addr if dbg is NULL then read argument directly.
913
914 2015-01-14  Jason P. Leasure <jpleasu@super.org>
915
916         * dwarf_formref_die.c (dwarf_formref_die): Offset is cu->type_offset
917         plus cu->start.
918
919 2014-12-27  Mark Wielaard  <mjw@redhat.com>
920
921         * dwarf_siblingof.c (dwarf_siblingof): Check sibling attribute offset
922         still falls inside CU data.
923
924 2015-01-11  Mark Wielaard  <mjw@redhat.com>
925
926         * dwarf_func_inline.c (dwarf_func_inline_instances): Call
927         __libdw_visit_scopes with NULL imports.
928         * dwarf_getfuncs.c (dwarf_getfuncs): Likewise.
929         * dwarf_getscopes.c (pc_record): Likewise.
930         (dwarf_getscopes): Likewise.
931         * dwarf_getscopes_die.c (dwarf_getscopes_die): Likewise.
932         * libdwP.h (__libdw_visit_scopes): Add imports argument.
933         * libdw_visit_scopes.c (__libdw_visit_scopes): Likewise. Add new
934         function imports_contains. Push and pop imports around walk_children
935         when processing DW_TAG_imported_unit.
936
937 2014-12-18  Ulrich Drepper  <drepper@gmail.com>
938
939         * Makefile.am: Suppress output of textrel_check command.
940
941 2014-12-16  Mark Wielaard  <mjw@redhat.com>
942
943         * dwarf_getsrclines.c (read_srclines): Check diridx is valid under
944         DW_LNE_define_file.
945
946 2014-12-16  Mark Wielaard  <mjw@redhat.com>
947
948         * dwarf_getpubnames.c (dwarf_getpubnames): Make sure there is enough
949         space to read die offset.
950
951 2014-12-16  Mark Wielaard  <mjw@redhat.com>
952
953         * dwarf_getsrclines.c (read_srclines): Correct overflow check for
954         unit_length.
955
956 2014-12-15  Mark Wielaard  <mjw@redhat.com>
957
958         * dwarf_getpubnames.c (get_offsets): Make sure whole unit fall inside
959         section data. Set error to DWARF_E_NO_ENTRY if cnt is zero.
960         (dwarf_getpubnames): Make sure section data contains string zero
961         terminator.
962
963 2014-12-16  Mark Wielaard  <mjw@redhat.com>
964
965         * memory-access.h (__libdw_get_sleb128): Unroll the first step to help
966         the compiler optimize for the common single-byte case.
967
968 2014-12-15  Josh Stone  <jistone@redhat.com>
969
970         * memory-access.h (__libdw_max_len_leb128): New.
971         (__libdw_get_uleb128): Use __libdw_max_len_leb128.
972         (__libdw_get_sleb128): Likewise.
973
974 2014-12-14  Mark Wielaard  <mjw@redhat.com>
975
976         * cfi.c (execute_cfi): Add program bounds checks.
977         * dwarf_child.c (__libdw_find_attr): Add attrp bounds checks.
978         * dwarf_formblock.c (dwarf_formblock): Call get_uleb128 with endp.
979         * dwarf_formref.c (__libdw_formref): Add datap bounds checks.
980         * dwarf_formsdata.c (dwarf_formsdata): Likewise.
981         * dwarf_formudata.c (dwarf_formudata): Likewise.
982         * dwarf_frame_register.c (dwarf_frame_register): Call get_uleb128
983         with end of data buf.
984         * dwarf_getabbrev.c (__libdw_getabbrev): Add abbrevp bounds checks.
985         * dwarf_getabbrevattr.c (dwarf_getabbrevattr): Assume get_uleb128
986         call gets enough data.
987         * dwarf_getattrs,c (dwarf_getattrs): Call get_uleb128 with endp.
988         * dwarf_getlocation.c (store_implicit_value): Call get_uleb128
989         with enough data.
990         (__libdw_intern_expression): Call get_uleb128/get_sleb128 with
991         end_data.
992         * dwarf_getmacros.c (get_table_for_offset): Add nforms bounds check.
993         * dwarf_getsrclines.c (read_srclines): Bounds check linep and call
994         get_uleb128 with lineendp.
995         * dwarf_hasattr.c (dwarf_hasattr): Bounds check attrp and call
996         get_uleb128 with endp.
997         * dwarf_next_cfi.c (dwarf_next_cfi): Bounds check bytes and call
998         get_uleb128/get_sleb128 with limit.
999         * encoded-value.h (read_encoded_value): Assume get_uleb128 and
1000         get_sleb128 get called with enough data.
1001         * fde.c (intern_fde): Call get_uleb128 with instructions_end.
1002         * libdwP.h (__libdw_dieabbrev): Call get_uleb128 with die->cu->endp.
1003         * libdw_form.c (__libdw_form_val_compute_len): Call get_uleb128 with
1004         endp.
1005         * memory-access.h (__libdw_get_uleb128): Take an extra endp.
1006         Don't call get_uleb128_step if out of data.
1007         (__libdw_get_sleb128): Likewise for get_sleb128_step.
1008
1009 2014-12-12  Mark Wielaard  <mjw@redhat.com>
1010
1011         * libdwP.h (struct Dwarf): Add fake_loc_cu.
1012         (cu_data): Removed.
1013         (DIE_OFFSET_FROM_CU_OFFSET): Don't use cu_data, use cu_sec_idx.
1014         (__libdw_form_val_compute_len): Drop dbg and endp arguments.
1015         (__libdw_form_val_len): Likewise.
1016         * libdw_form.c (__libdw_form_val_compute_len): Likewise.
1017         * libdw_findcu.c (__libdw_intern_next_unit): Don't use cu_data, use
1018         the already found data buffer directly.
1019         * dwarf_begin_elf.c (valid_p): Setup fake_loc_cu.
1020         * dwarf_end.c (dwarf_end): Free fake_loc_cu.
1021         * dwarf_child.c (__libdw_find_attr): Call __libdw_form_val_len with
1022         just cu.
1023         * dwarf_getattrs.c (dwarf_getattrs): Likewise.
1024         * dwarf_formblock.c (dwarf_formblock): Add bounds checking.
1025         * dwarf_getlocation_attr.c (attr_form_cu): New function.
1026         (dwarf_getlocation_attr): Use attr_form_cu to set result->cu.
1027         (getlocation): Handle empty blocks immediately.
1028         * dwarf_getlocation_implicit_pointer.c (empty_cu): New static var.
1029         (__libdw_empty_loc_attr): Drop cu argument, use empty_cu.
1030         (dwarf_getlocation_implicit_pointer): Call __libdw_empty_loc_attr with
1031         one argument.
1032         * dwarf_getmacros.c (read_macros): Also setup startp and endp for
1033         fake_cu. Call __libdw_form_val_len with just fake_cu.
1034         * dwarf_formref_die.c (dwarf_formref_die): Don't use cu_data, get
1035         datap and size directly from cu startp and endp.
1036
1037 2014-12-11  Mark Wielaard  <mjw@redhat.com>
1038
1039         * libdw_findcu.c (__libdw_intern_next_unit): Sanity check offset.
1040
1041 2014-12-13  Mark Wielaard  <mjw@redhat.com>
1042
1043         * dwarf_getaranges.c (compare_aranges): Make sure Dwarf_Addr
1044         difference doesn't wrap around before returning as int.
1045
1046 2014-12-11  Josh Stone  <jistone@redhat.com>
1047
1048         * dwarf_getsrclines.c (struct linelist): Add sequence.
1049         (compare_lines): Take linelists, and break ties by sequence.
1050         (read_srclines): Use linelists for sorting.
1051         (read_srclines::add_new_line): Set sequence.
1052
1053 2014-12-10  Josh Stone  <jistone@redhat.com>
1054
1055         * libdwP.h (Dwarf_CU): Add startp and endp boundaries.
1056         * libdw_findcu.c (__libdw_intern_next_unit): Set startp and endp.
1057         * dwarf_child.c (dwarf_child): Use cu->endp.
1058         * dwarf_cuoffset.c (dwarf_cuoffset): Use cu->startp.
1059         * dwarf_dieoffset.c (dwarf_dieoffset): Use cu->startp.
1060         * dwarf_siblingof.c (dwarf_siblingof): Use both.
1061
1062 2014-12-10  Josh Stone  <jistone@redhat.com>
1063
1064         * dwarf_hasattr.c (dwarf_hasattr): Just walk abbrev for presence.
1065
1066 2014-12-10  Josh Stone  <jistone@redhat.com>
1067
1068         * libdwP.h (__libdw_dieabbrev): New die->abbrev lookup function.
1069         * dwarf_child.c (__libdw_find_attr, dwarf_child): Use it.
1070         * dwarf_getattrs.c (dwarf_getattrs): Likewise.
1071         * dwarf_haschildren.c (dwarf_haschildren): Likewise.
1072         * dwarf_tag.c (dwarf_tag): Likewise.
1073
1074 2014-12-04  Mark Wielaard  <mjw@redhat.com>
1075
1076         * libdwP.h (__libdw_form_val_compute_len): Add endp argument.
1077         (__libdw_form_val_len): Likewise and check len doesn't overflow.
1078         * libdw_form.c (__libdw_form_val_compute_len): Likewise.
1079         * dwarf_child.c (__libdw_find_attr): Call __libdw_form_val_len
1080         with endp.
1081         * dwarf_getattrs.c (dwarf_getattrs): Likewise.
1082         * dwarf_getmacros.c (read_macros): Likewise and check for errors.
1083
1084 2014-12-02  Petr Machata  <pmachata@redhat.com>
1085
1086         * dwarf_getmacros.c (token_from_offset, offset_from_token): New
1087         helper functions.
1088         (do_dwarf_getmacros_die): Merge into dwarf_getmacros.
1089         * libdw.h (DWARF_GETMACROS_START): New macro.
1090
1091 2014-11-27  Mark Wielaard  <mjw@redhat.com>
1092
1093         * Makefile.am (libdw.so): Use textrel_check.
1094
1095 2014-11-27  Mark Wielaard  <mjw@redhat.com>
1096
1097         * dwarf_getcfi_elf.c (getcfi_gnu_eh_frame): Initialize
1098         search_table_entries and search_table_encoding.
1099
1100 2014-11-24  Mark Wielaard  <mjw@redhat.com>
1101
1102         * dwarf_getsrclines.c (read_srclines): Check line_range is not zero
1103         before usage.
1104
1105 2014-11-23  Mark Wielaard  <mjw@redhat.com>
1106
1107         * dwarf_attr.c (dwarf_attr): Check __libdw_find_attr return value.
1108         * dwarf_hasattr.c (dwarf_hasattr): Likewise.
1109         * dwarf_siblingof.c (dwarf_siblingof): Likewise.
1110
1111 2014-11-23  Mark Wielaard  <mjw@redhat.com>
1112
1113         * dwarf_getabbrev.c (__libdw_getabbrev): Don't assert on bad DWARF.
1114         Set libdw errno and return NULL.
1115
1116 2014-11-24  Mark Wielaard  <mjw@redhat.com>
1117
1118         * dwarf.h (DW_LANG_C_plus_plus_11): Added.
1119         (DW_LANG_C11): Likewise.
1120         (DW_LANG_C_plus_plus_14): Likewise.
1121         * dwarf_aggregate_size.c (array_size): Handle DW_LANG_C11,
1122         DW_LANG_C_plus_plus_11, DW_LANG_C_plus_plus_14 and DW_LANG_Go
1123         lower bound.
1124         * dwarf_getfuncs.c (dwarf_getfuncs): Set c_cu to true for
1125         DW_LANG_C11.
1126
1127 2014-11-26  Mark Wielaard  <mjw@redhat.com>
1128
1129         * dwarf.h (DW_AT_noreturn): Added.
1130
1131 2014-11-11  Mark Wielaard  <mjw@redhat.com>
1132
1133         * dwarf_getsrclines.c (read_srclines): Do address_size comparison
1134         explicitly as uint8_t.
1135         (__libdw_getsrclines): Add internal_function to declaration.
1136
1137 2014-09-10  Petr Machata  <pmachata@redhat.com>
1138
1139         * dwarf_macro_getparamcnt.c: New file.
1140         * dwarf_macro_param.c: New file.
1141         * dwarf_macro_getsrcfiles.c: New file.
1142         * Makefile.am (libdw_a_SOURCES): Add the new files.
1143         * libdwP.h (struct files_lines_s): New structure.
1144         (DWARF_E_INVALID_OPCODE): New enumerator.
1145         (struct Dwarf): New fields macro_ops, files_lines.
1146         (Dwarf_Macro_Op_Proto, Dwarf_Macro_Op_Table): New structures for
1147         keeping macro opcode prototypes in.
1148         (Dwarf_Macro_s): Redefine from scratch.
1149         (__libdw_getsrclines, __libdw_getcompdir, libdw_macro_nforms): New
1150         internal interfaces.
1151         * dwarf_error.c (errmsgs): Add a message for
1152         DWARF_E_INVALID_OPCODE.
1153         * dwarf_end.c (dwarf_end): Destroy struct Dwarf.macro_ops and
1154         files_lines.
1155         * libdw.h (dwarf_getmacros_off, dwarf_macro_getparamcnt)
1156         (dwarf_macro_getsrcfiles, dwarf_macro_param): New public
1157         interfaces.
1158         * dwarf_getmacros.c (dwarf_getmacros_off): New function,
1159         (get_offset_from, macro_op_compare, build_table)
1160         (init_macinfo_table, get_macinfo_table, get_table_for_offset)
1161         (cache_op_table, read_macros, gnu_macros_getmacros_off)
1162         (macro_info_getmacros_off, do_dwarf_getmacros_die): New helper
1163         functions.
1164         (dwarf_getmacros): Adjust to dispatch to the new interfaces.
1165         * dwarf_getsrclines.c (read_srclines): New function with guts
1166         taken from dwarf_getsrclines.
1167         (__libdw_getsrclines): Likewise.
1168         (__libdw_getcompdir, files_lines_compare): New functions.
1169         (dwarf_getsrclines): Make it dispatch to the new interfaces.
1170         * dwarf_macro_param1.c (dwarf_macro_param1): Adjust to dispatch to
1171         the new interfaces.
1172         * dwarf_macro_param2.c (dwarf_macro_param2): Likewise.
1173         * libdw.map (ELFUTILS_0.161): New. Add dwarf_getmacros_off,
1174         dwarf_macro_getsrcfiles, dwarf_macro_getparamcnt, dwarf_macro_param.
1175
1176 2014-10-06  Mark Wielaard  <mjw@redhat.com>
1177
1178         * Makefile.am (libdw_a_SOURCES): Add dwarf_peel_type.c.
1179         * dwarf_aggregate_size.c (get_type): Use dwarf_peel_type.
1180         (aggregate_size): Likewise. Add old and new version.
1181         * dwarf_peel_type.c: New file.
1182         * libdw.h (dwarf_peel_type): New function declaration.
1183         * libdwP.h (dwarf_peel_type): New internal declaration.
1184         * libdw.map (ELFUTILS_0.161): New section.
1185
1186 2014-10-15  Petr Machata  <pmachata@redhat.com>
1187
1188         * libdwP.h (struct Dwarf_Files_s.cu): Drop field.
1189         * dwarf_getsrclines.c (dwarf_getsrclines): Don't set it.
1190
1191 2014-10-05  Mark Wielaard  <mjw@redhat.com>
1192
1193         * dwarf.h: Add DW_AT_GNU_deleted.
1194
1195 2014-10-02  Mark Wielaard  <mjw@redhat.com>
1196
1197         * dwarf_aggregate_size.c (aggregate_size): Return CU address_size
1198         for sizeless DW_TAG_pointer_type, DW_TAG_reference_type or
1199         DW_TAG_rvalue_reference_type.
1200
1201 2014-09-12  Petr Machata  <pmachata@redhat.com>
1202
1203         * memory-access.h (read_ubyte_unaligned_inc): Allow only 4- and
1204         8-byte quantities.  Consequently, rename to...
1205         (read_addr_unaligned_inc): ... this.
1206         (read_sbyte_unaligned_inc, read_ubyte_unaligned): Drop.
1207         (read_sbyte_unaligned): Drop.
1208
1209 2014-09-10  Petr Machata  <pmachata@redhat.com>
1210
1211         * dwarf_getlocation.c (attr_ok): Also accept
1212         DW_AT_GNU_call_site_value, DW_AT_GNU_call_site_data_value,
1213         DW_AT_GNU_call_site_target, DW_AT_GNU_call_site_target_clobbered.
1214
1215 2014-08-15  Mark Wielaard  <mjw@redhat.com>
1216
1217         * dwarf_cu_die.c: New file.
1218         * Makefile.am (libdw_a_SOURCES): Add dwarf_cu_die.c.
1219         * libdw.h (dwarf_cu_die): New function declaration.
1220         * libdw.map (ELFUTILS_0.160): Add dwarf_cu_die.
1221
1222 2014-08-15  Mark Wielaard  <mjw@redhat.com>
1223
1224         * dwarf_cu_getdwarf.c: New file.
1225         * Makefile.am (libdw_a_SOURCES): Add dwarf_cu_getdwarf.c.
1226         * libdw.h (Dwarf_CU): New typedef.
1227         (dwarf_cu_getdwarf): New function declaration.
1228         * libdw.map (ELFUTILS_0.160): New. Add dwarf_cu_getdwarf.
1229
1230 2014-06-18  Mark Wielaard  <mjw@redhat.com>
1231
1232         * dwarf.h: Remove DW_TAG_mutable_type.
1233
1234 2014-05-02  Mark Wielaard  <mjw@redhat.com>
1235
1236         * libdwP.h (__check_build_id): Removed now unused.
1237
1238 2014-05-01  Mark Wielaard  <mjw@redhat.com>
1239
1240         * libdwP.h (struct Dwarf): Remove free_alt.
1241         * dwarf_end.c (dwarf_end): Don't check free_alt, don't end alt_dwarf.
1242         * dwarf_setalt.c (dwarf_setalt): Don't check or set free_alt.
1243
1244 2014-04-30  Mark Wielaard  <mjw@redhat.com>
1245
1246         * libdw.map (ELFUTILS_0.159): Add dwelf_elf_gnu_build_id.
1247
1248 2014-04-15  Florian Weimer  <fweimer@redhat.com>
1249
1250         * dwarf_begin_elf.c (__check_build_id, try_debugaltlink)
1251         (open_debugaltlink): Move to libdwfl.
1252         (check_section): Do not locate alternate debuginfo.
1253
1254 2014-04-24  Florian Weimer  <fweimer@redhat.com>
1255
1256         * libdw.map (ELFUTILS_0.159): Export dwelf_dwarf_gnu_debugaltlink.
1257
1258 2014-04-22  Florian Weimer  <fweimer@redhat.com>
1259
1260         * dwarf_getalt.c, dwarf_setalt.c: New files.
1261         * Makefile.am (libdw_a_SOURCES): Add them.
1262         * libdw.h (dwarf_getalt, dwarf_setalt): Add function declarations.
1263         * libdwP.h (dwarf_getalt, dwarf_setalt): Add internal function
1264         declarations.
1265         * libdw.map (ELFUTILS_0.159): Export the two new functions.
1266
1267 2014-04-15  Florian Weimer  <fweimer@redhat.com>
1268
1269         * libdwP.h (enum IDX_gnu_debugaltlink): New.
1270         * dwarf_begin_elf.c (dwarf_scnnames): Increase string size and add
1271         .gnu_debugaltlink.
1272         (check_section): Obtain .gnu_debugaltlink section from the
1273         setiondata array.
1274
1275 2014-04-11  Mark Wielaard  <mjw@redhat.com>
1276
1277         * libdw.map (ELFUTILS_0.159): New. Add dwelf_elf_gnu_debuglink.
1278         * Makefile.am (libdw.so): Depend on libdwelf_pic.a.
1279         (libdwelf_objects): New variable.
1280         (libdw_a_LIBADD): Add libdwelf objects.
1281
1282 2014-04-22  Mark Wielaard  <mjw@redhat.com>
1283
1284         * memory-access.h (get_sleb128_step): Remove undefined behavior
1285         of left shifting a signed value. Replace it with a multiplication.
1286
1287 2014-04-13  Mark Wielaard  <mjw@redhat.com>
1288
1289         * Makefile.am: Remove !MUDFLAP conditions.
1290
1291 2014-04-09  Mark Wielaard  <mjw@redhat.com>
1292
1293         * dwarf_begin_elf.c (check_section): Check for unsigned overflow
1294         before calling malloc to uncompress data.
1295
1296 2014-03-03  Jan Kratochvil  <jan.kratochvil@redhat.com>
1297
1298         Fix abort() on missing section headers.
1299         * dwarf_begin_elf.c (check_section): Replace abort call by goto err.
1300         New label err to return NULL.
1301
1302 2014-02-05  Josh Stone  <jistone@redhat.com>
1303
1304         * dwarf_decl_file.c (dwarf_decl_file): Read the idx as unsigned.
1305         * dwarf_decl_line.c (__libdw_attr_intval): Read the line/column as
1306         unsigned.  Change the range assert to DWARF_E_INVALID_DWARF.
1307
1308 2013-12-30  Mark Wielaard  <mjw@redhat.com>
1309
1310         * libdw.map (ELFUTILS_0.158): Add dwfl_core_file_attach and
1311         dwfl_linux_proc_attach.
1312
1313 2013-12-20  Mark Wielaard  <mjw@redhat.com>
1314
1315         * libdw.map (ELFUTILS_0.158): Add dwfl_getthread_frames.
1316
1317 2013-12-18  Mark Wielaard  <mjw@redhat.com>
1318
1319         * libdw.map (ELFUTILS_0.158): Remove dwfl_module_addrsym_elf and
1320         dwfl_module_getsym_elf. Add dwfl_module_addrinfo and
1321         dwfl_module_getsym_info.
1322
1323 2013-12-16  Mark Wielaard  <mjw@redhat.com>
1324
1325         * libdw.map (ELFUTILS_0.158): Add dwfl_module_getsymtab_first_global.
1326
1327 2013-12-10  Josh Stone  <jistone@redhat.com>
1328
1329         * memory-access.h (get_uleb128_rest_return): Removed.
1330         (get_sleb128_rest_return): Removed.
1331         (get_uleb128_step): Make this a self-contained block.
1332         (get_sleb128_step): Ditto, and use a bitfield to extend signs.
1333         (get_uleb128): Make this wholly implemented by __libdw_get_uleb128.
1334         (get_sleb128): Make this wholly implemented by __libdw_get_sleb128.
1335         (__libdw_get_uleb128): Simplify and inline for all callers.
1336         (__libdw_get_sleb128): Ditto.
1337         * dwarf_getlocation.c (store_implicit_value): Void the unused uleb128.
1338         * memory-access.c: Delete file.
1339         * Makefile.am (libdw_a_SOURCES): Remove it.
1340         (DEFS): Remove the now unused -DIS_LIBDW.
1341
1342 2013-12-09  Josh Stone  <jistone@redhat.com>
1343
1344         * libdw_form.c (__libdw_form_val_compute_len): Renamed function from
1345         __libdw_form_val_len, now handling only non-constant form lengths.
1346         * libdwP.h (__libdw_form_val_len): New inlined function.
1347
1348 2013-12-09  Mark Wielaard  <mjw@redhat.com>
1349
1350         * dwarf_getlocation.c (__libdw_intern_expression): Handle empty
1351         location expressions.
1352         * dwarf_getlocation_attr.c (dwarf_getlocation_attr): When no
1353         location found, return empty location expression.
1354         * dwarf_getlocation_implicit_pointer.c
1355         (dwarf_getlocation_implicit_pointer): Likewise.
1356         (__libdw_empty_loc_attr): New internal function.
1357         * libdwP.h (__libdw_empty_loc_attr): Define.
1358
1359 2013-11-27  Mark Wielaard  <mjw@redhat.com>
1360
1361         * libdw.map (ELFUTILS_0.158): Add dwfl_module_addrsym_elf and
1362         dwfl_module_getsym_elf.
1363
1364 2013-11-26  Mark Wielaard  <mjw@redhat.com>
1365
1366         * libdw.map (ELFUTILS_0.156): Move dwfl_attach_state, dwfl_pid,
1367         dwfl_thread_dwfl, dwfl_thread_tid, dwfl_frame_thread,
1368         dwfl_thread_state_registers, dwfl_thread_state_register_pc,
1369         dwfl_getthreads, dwfl_thread_getframes and dwfl_frame_pc to ...
1370         (ELFUTILS_0.158): ... here.
1371
1372 2013-11-09  Mark Wielaard  <mjw@redhat.com>
1373
1374         * dwarf_getaranges.c (dwarf_getaranges): Read segment_size and
1375         check that it is zero.
1376
1377 2013-11-07  Jan Kratochvil  <jan.kratochvil@redhat.com>
1378
1379         * cfi.h (struct Dwarf_Frame_s): Make the comment more specific.
1380         * libdw.map (ELFUTILS_0.156): Add dwfl_attach_state, dwfl_pid,
1381         dwfl_thread_dwfl, dwfl_thread_tid, dwfl_frame_thread,
1382         dwfl_thread_state_registers, dwfl_thread_state_register_pc,
1383         dwfl_getthreads, dwfl_thread_getframes and dwfl_frame_pc.
1384
1385 2013-11-01  Michael Forney  <mforney@mforney.org>
1386
1387         * Makefile.am (libdwfl_objects): New definition.
1388         (libdw_a_LIBADD): Use libdwfl_objects.
1389
1390 2013-11-01  Michael Forney  <mforney@mforney.org>
1391
1392         * Makefile.am: Use READELF.
1393
1394 2013-10-30  Jan Kratochvil  <jan.kratochvil@redhat.com>
1395
1396         * libdw.map (ELFUTILS_0.158): New.
1397
1398 2013-10-10  Mark Wielaard  <mjw@redhat.com>
1399
1400         * dwarf_getfuncs.c (struct visitor_info): Rename start_offset to
1401         start_addr and rename last_offset to last_addr. Now both void *.
1402         (tree_visitor): Use start_add and die_addr instead of start_offset
1403         and die_offset.
1404         (dwarf_getfuncs): Use last_addr instead of last_offset.
1405
1406 2013-10-06  Mark Wielaard  <mjw@redhat.com>
1407
1408         * cfi.c (execute_cfi): Make sure DW_CFA_expression and
1409         DW_CFA_val_expression are not used with abi_cfi.
1410
1411 2013-10-03  Josh Stone  <jistone@redhat.com>
1412
1413         * dwarf_formref_die.c (dwarf_formref_die): Don't hash the sig8 here.
1414         * libdw_findcu.c (__libdw_intern_next_unit): Since this never revisits
1415         a unit, make sure to always hash the sig8 here, so none are missed.
1416
1417 2013-09-29  Mark Wielaard  <mjw@redhat.com>
1418
1419         * dwarf_getlocation.c (store_implicit_value): Cast op->number2 to
1420         uintptr_t before casting to char *.
1421         (__libdw_intern_expression): Cast data to uintptr_t before casting
1422         to Dwarf_Word.
1423         * dwarf_getlocation_attr.c (dwarf_getlocation_attr): Cast
1424         op->number2 to uintptr_t before casting to char *.
1425
1426 2013-09-24  Josh Stone  <jistone@redhat.com>
1427
1428         * libdw_visit_scopes.c (classify_die): Removed.
1429         (may_have_scopes): New function to replace classify_die.  There's no
1430         need for full classification; just find tags that may contain scopes.
1431         (__libdw_visit_scopes): Use a direct tag comparison for imported
1432         units, and use may_have_scopes to test if recursion is needed.
1433
1434 2013-09-20  Mark Wielaard  <mjw@redhat.com>
1435
1436         * dwarf_getfuncs.c (visitor_info): New struct.
1437         (tree_visitor): New function.
1438         (dwarf_getfuncs): Use __libdw_visit_scopes with tree_visitor.
1439         * libdw.h (dwarf_getfuncs): Expand function documentation.
1440
1441 2013-09-12  Mark Wielaard  <mjw@redhat.com>
1442
1443         * fde.c (intern_fde): Free fde and set libdw errno when start
1444         or end could not be read.
1445
1446 2013-08-24  Mark Wielaard  <mjw@redhat.com>
1447
1448         * dwarf_getlocation.c (store_implicit_value): Don't take data
1449         as argument, get block data from op number2. Return false when
1450         block data length and op number don't match up.
1451         (__libdw_intern_expression): Store start of block for
1452         DW_OP_implicit_value and DW_OP_GNU_entry_value instead of
1453         relative data offset. Also store block start (including length)
1454         for DW_OP_GNU_const_type. Don't pass data to store_implicit_value.
1455         * dwarf_getlocation_attr.c: New file.
1456         * dwarf_getlocation_die.c: Likewise.
1457         * libdw.h (dwarf_getlocation_die): New function definition.
1458         (dwarf_getlocation_attr): Likewise.
1459         * libdwP.h: Declare internal dwarf_getlocation_die.
1460         * libdw.map (ELFUTILS_0.157): Add dwarf_getlocation_die and
1461         dwarf_getlocation_attr.
1462         * Makefile.am (libdw_a_SOURCES): Add dwarf_getlocation_die.c and
1463         dwarf_getlocation_attr.c.
1464
1465 2013-08-23  Mark Wielaard  <mjw@redhat.com>
1466
1467         * dwarf_getlocation.c (attr_ok): Also accept DW_AT_segment.
1468         (attr_base_address): New function.
1469         (initial_offset_base): New function.
1470         (getlocations_addr): New function. Taken from...
1471         (dwarf_getlocation_addr): here. Use new initial_offset_base and
1472         getlocations_addr.
1473         (dwarf_getlocations): New function.
1474         * libdw.h (dwarf_getlocations): New function definition.
1475         * libdw.map (ELFUTILS_0.157): New.
1476
1477 2013-07-02  Mark Wielaard  <mjw@redhat.com>
1478
1479         * dwarf_getsrclines.c (dwarf_getsrclines): Add new stack allocation
1480         limit MAX_STACK_ALLOC.  After MAX_STACK_ALLOC lines use malloc in
1481         NEW_LINE macro.  Free malloced line records if any at the end.
1482
1483 2013-07-02  Mark Wielaard  <mjw@redhat.com>
1484
1485         * dwarf_getcfi_elf.c (getcfi_shdr): Check sh_type == SHT_PROGBITS.
1486
1487 2013-06-26  Mark Wielaard  <mjw@redhat.com>
1488
1489         * libdw_visit_scopes.c (__libdw_visit_scopes): Don't reject root
1490         DIEs without children. Return an error whenever dwarf_child or
1491         dwarf_siblingof return an error. Don't call recurse and increase
1492         the depth for an imported unit. Walk the children of an imported
1493         unit as if they are logical children of the parent root DIE.
1494
1495 2013-05-03  Mark Wielaard  <mjw@redhat.com>
1496
1497         * dwarf_getsrclines.c (dwarf_getsrclines): Only set end_sequence
1498         when nlinelist > 0.
1499
1500 2013-04-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
1501
1502         * libdw.map (ELFUTILS_0.156): New.
1503
1504 2013-04-24  Mark Wielaard  <mjw@redhat.com>
1505
1506         * Makefile.am: Use AM_CPPFLAGS instead of INCLUDES.
1507
1508 2013-04-10  Mark Wielaard  <mjw@redhat.com>
1509
1510         * dwarf_formref_die.c (dwarf_formref_die): Reference size is only
1511         equal to address size when we have a DW_FORM_ref_addr for DWARF
1512         version 2.
1513
1514 2013-03-25  Mark Wielaard  <mjw@redhat.com>
1515
1516         * dwarf_getsrclines.c (dwarf_getsrclines): Mark highest address as
1517         end_sequence.
1518
1519 2013-03-12  Mark Wielaard  <mjw@redhat.com>
1520
1521         * dwarf_getsrcfiles.c (dwarf_getsrcfiles): Allow DW_TAG_partial_unit.
1522         * dwarf_getsrclines.c (dwarf_getsrclines): Likewise.
1523
1524 2013-02-15  Mark Wielaard  <mjw@redhat.com>
1525
1526         * dwarf_formstring.c (dwarf_formstring): Check dbg_ret->sectiondata,
1527         not dbg->sectiondata.
1528
1529 2013-01-07  Roland McGrath  <roland@hack.frob.com>
1530
1531         * memory-access.h
1532         [ALLOW_UNALIGNED] (read_8ubyte_unaligned_noncvt): New macro.
1533         [!ALLOW_UNALIGNED] (read_8ubyte_unaligned_noncvt): New inline function.
1534
1535 2012-12-18  Mark Wielaard  <mjw@redhat.com>
1536
1537         * dwarf_begin_elf.c (valid_p): Call Dwarf_Sig8_Hash_free if invalid.
1538         (check_section): Likewise on error.
1539         (scngrp_read): Likewise.
1540         (dwarf_begin_elf): Likewise.
1541
1542 2012-10-09  Petr Machata  <pmachata@redhat.com>
1543
1544         * dwarf_getlocation.c (__libdw_intern_expression): Handle
1545         DW_OP_GNU_parameter_ref, DW_OP_GNU_convert, DW_OP_GNU_reinterpret,
1546         DW_OP_GNU_regval_type, DW_OP_GNU_entry_value,
1547         DW_OP_GNU_deref_type, DW_OP_GNU_const_type.
1548
1549 2012-10-08  Jan Kratochvil  <jan.kratochvil@redhat.com>
1550
1551         * cfi.c: New include system.h.
1552         (execute_cfi) (enough_registers): Clear new memory after realloc.
1553
1554 2012-10-08  Jan Kratochvil  <jan.kratochvil@redhat.com>
1555
1556         * fde.c (__libdw_find_fde): Change <fde != NULL> to likely.  Return
1557         DWARF_E_NO_MATCH if .eh_frame_hdr points to FDE which is too short for
1558         searched PC.
1559
1560 2012-10-08  Jan Kratochvil  <jan.kratochvil@redhat.com>
1561
1562         * dwarf_getlocation.c (__libdw_intern_expression) <cfap>: Make new
1563         loclist element DW_OP_call_frame_cfa before decoding the opcodes.
1564         Remove the later DW_OP_call_frame_cfa push to RESULT.
1565
1566 2012-10-08  Jan Kratochvil  <jan.kratochvil@redhat.com>
1567
1568         Code cleanup.
1569         * fde.c (binary_search_fde): Remove always true <address >= start>
1570         conditional.  Move L initialization upwards.
1571
1572 2012-08-24  Mark Wielaard  <mjw@redhat.com>
1573
1574         * dwarf_begin_elf.c (check_section): Only probe for dwz multi files
1575         when ENABLE_DWZ is defined.
1576         * libdwP.h (__check_build_id): Only declare when ENABLE_DWZ is
1577         defined.
1578
1579 2012-08-16  Mark Wielaard  <mjw@redhat.com>
1580
1581         * Makefile.am (EXTRA_DIST): Add known-dwarf.h.
1582         * dwarf.h (DW_LANG_Go): Update comment.
1583         (DW_LANG_Mips_Assembler): Likewise.
1584
1585 2012-06-27  Mark Wielaard  <mjw@redhat.com>
1586
1587         * dwarf.h: Add DW_FORM_GNU_ref_alt and DW_FORM_GNU_strp_alt.
1588         * dwarf_begin.c (dwarf_begin): Add INTDEF.
1589         * dwarf_begin_elf.c (__check_build_id): New internal_function.
1590         (try_debugaltlink): New function.
1591         (open_debugaltlink): Likewise.
1592         (check_section): Try open_debugaltlink for .gnu_debugaltlink.
1593         * dwarf_end.c (dwarf_end): Free the alternative Dwarf descriptor if
1594         necessary.
1595         * dwarf_error.c (errmsgs): Add DWARF_E_NO_ALT_DEBUGLINK.
1596         * dwarf_formref.c (__libdw_formref): Using DW_FORM_GNU_ref_alt
1597         is an error here.
1598         * dwarf_formref_die.c (dwarf_formref_die): Handle DW_FORM_GNU_ref_alt.
1599         * dwarf_formstring.c (dwarf_formstring): Handle DW_FORM_GNU_strp_alt.
1600         * dwarf_formudata.c (__libdw_formptr): Adjust __libdw_read_offset
1601         calls.
1602         * dwarf_getpubnames.c (get_offsets): Adjust __libdw_read_offset call.
1603         * libdwP.h: Add DWARF_E_NO_ALT_DEBUGLINK.
1604         (struct Dwarf): Add alt_dwarf and free_alt fields.
1605         (__libdw_read_offset): Add dbg_ret argument, use to check with
1606         __libdw_offset_in_section.
1607         (__check_build_id): New function declaration.
1608         (dwarf_begin): Define as INTDECL.
1609         * libdw_form.c (__libdw_form_val_len): Handle DW_FORM_GNU_ref_alt
1610         and DW_FORM_GNU_strp_alt.
1611
1612 2012-07-19  Mark Wielaard  <mjw@redhat.com>
1613
1614         * dwarf.h: Add DW_OP_GNU_parameter_ref.
1615
1616 2012-07-24  Mark Wielaard  <mjw@redhat.com>
1617
1618         * dwarf.h: Correct spelling of DW_LANG_ObjC.
1619         * dwarf_aggregate_size.c (array_size): Use correct spelling of
1620         DW_LANG_ObjC.
1621
1622 2012-07-24  Mark Wielaard  <mjw@redhat.com>
1623
1624         * dwarf.h: Add DW_ATE_UTF.
1625
1626 2012-06-27  Mark Wielaard  <mjw@redhat.com>
1627
1628         * dwarf.h: Add DW_MACRO_GNU .debug_macro type encodings.
1629
1630 2012-06-26  Mark Wielaard  <mjw@redhat.com>
1631
1632         * libdwP.h: Add IDX_debug_macro.
1633         * dwarf.h: Add DW_AT_GNU_macros.
1634         * dwarf_begin_elf.c (dwarf_scnnames): Add .debug_macro.
1635         * dwarf_formudata.c (dwarf_formudata): Recognize DW_AT_GNU_macros.
1636
1637 2012-04-27  Mark Wielaard  <mjw@redhat.com>
1638
1639         * libdw/dwarf_highpc.c (dwarf_highpc): Handle DW_AT_high_pc being
1640         a constant offset from DW_AT_low_pc.
1641
1642 2012-03-19  Tom Tromey  <tromey@redhat.com>
1643
1644         * libdw_findcu.c (findcu_cb): Move earlier.
1645         (__libdw_intern_next_unit): Add new CU to search tree here...
1646         (__libdw_findcu): ... not here.
1647
1648 2012-01-31  Mark Wielaard  <mjw@redhat.com>
1649
1650         * dwarf_formudata.c (dwarf_formudata): Handle DW_FORM_sec_offset.
1651
1652 2011-11-31  Mark Wielaard  <mjw@redhat.com>
1653
1654         * Makefile.am (known-dwarf.h): Run gawk on config/known-dwarf.awk.
1655
1656 2011-07-14  Mark Wielaard  <mjw@redhat.com>
1657
1658         * libdw.h (dwarf_offdie): Fix documentation to mention .debug_info.
1659
1660 2011-05-16  Jakub Jelinek  <jakub@redhat.com>
1661
1662         * dwarf.h (DW_OP_GNU_const_type, DW_OP_GNU_regval_type,
1663         DW_OP_GNU_deref_type, DW_OP_GNU_convert, DW_OP_GNU_reinterpret):
1664         New.
1665
1666 2011-04-26  Mark Wielaard  <mjw@redhat.com>
1667
1668         * dwarf_child (dwarf_child): Sanity check end of section against
1669         cu_data () of die->cu.
1670
1671 2011-03-22  Mark Wielaard  <mjw@redhat.com>
1672
1673         * dwarf.h: Add DW_TAG_GNU_call_site,
1674         DW_TAG_GNU_call_site_parameter,
1675         DW_AT_GNU_call_site_value,
1676         DW_AT_GNU_call_site_data_value,
1677         DW_AT_GNU_call_site_target,
1678         DW_AT_GNU_call_site_target_clobbered,
1679         DW_AT_GNU_tail_call,
1680         DW_AT_GNU_all_tail_call_sites,
1681         DW_AT_GNU_all_call_sites,
1682         DW_AT_GNU_all_source_call_sites,
1683         and DW_OP_GNU_entry_value.
1684
1685 2011-03-10  Petr Machata  <pmachata@redhat.com>
1686
1687         * libdw/dwarf_tag.c (__libdw_findabbrev): Reject requests for
1688         abbreviation with code 0.
1689
1690 2011-03-09  Petr Machata  <pmachata@redhat.com>
1691
1692         * libdw/dwarf_child.c (dwarf_child): Check for section overrun.
1693
1694 2011-02-23  Roland McGrath  <roland@redhat.com>
1695
1696         * libdwP.h (struct Dwarf) [USE_ZLIB]: New member sectiondata_gzip_mask.
1697         Declare __libdw_free_zdata.
1698         * dwarf_end.c [USE_ZLIB] (__libdw_free_zdata): New function.
1699         (dwarf_end): Call it.
1700
1701         * dwarf_begin_elf.c (valid_p): Likewise.
1702         (check_section, scngrp_read): Likewise.
1703         (check_section) [USE_ZLIB]: Grok .z* flavors of sections.
1704
1705 2010-10-13  Roland McGrath  <roland@redhat.com>
1706
1707         * dwarf.h: Add DW_LANG_Go.
1708
1709 2010-10-05  Roland McGrath  <roland@redhat.com>
1710
1711         * dwarf_getaranges.c: Use malloc rather than alloca,
1712         since the total number of elements can be quite huge.
1713
1714 2010-07-26  Roland McGrath  <roland@redhat.com>
1715
1716         * dwarf_getlocation_implicit_pointer.c: New file.
1717         * Makefile.am (libdw_a_SOURCES): Add it.
1718         * libdw.map (ELFUTILS_0.149): New set.
1719         Add dwarf_getlocation_implicit_pointer.
1720         * libdw.h: Declare it.
1721
1722         * dwarf_offdie.c (do_offdie): Renamed to __libdw_offdie, made global.
1723         (dwarf_offdie, dwarf_offdie_types): Update callers.
1724         * libdwP.h: Declare it.
1725
1726         * dwarf.h: Add DW_OP_GNU_implicit_pointer.
1727         * dwarf_getlocation.c (__libdw_intern_expression): Handle it.
1728
1729 2010-08-24  Roland McGrath  <roland@redhat.com>
1730
1731         * libdw.map (ELFUTILS_0.149): New set.  Add dwfl_dwarf_line.
1732
1733 2010-07-27  Roland McGrath  <roland@redhat.com>
1734
1735         * dwarf_formref_die.c: Fix sig8 hash insertion.
1736
1737 2010-06-23  Roland McGrath  <roland@redhat.com>
1738
1739         * cfi.c (dwarf_cfi_validate_fde): Function removed.
1740         * libdw.h: Remove it.
1741         * libdw.map: Likewise.
1742
1743 2010-06-22  Roland McGrath  <roland@redhat.com>
1744
1745         * dwarf_getlocation.c (check_constant_offset): data[48] are constant.
1746
1747         * dwarf_getsrclines.c: Fix signed comparison warning in extended
1748         opcode parsing.
1749
1750 2010-06-21  Roland McGrath  <roland@redhat.com>
1751
1752         * dwarf.h: Add DW_TAG_GNU_* constants.
1753
1754         * memory-access.h (get_sleb128_rest_return): Fix sign extension for
1755         10-byte case.
1756
1757 2010-06-20  Roland McGrath  <roland@redhat.com>
1758
1759         * libdw_findcu.c (__libdw_findcu): Take new flag argument,
1760         to search TUs instead of CUs.
1761         * libdwP.h: Update decl.
1762         (struct Dwarf): New member tu_tree.
1763         * dwarf_end.c (dwarf_end): Clean up tu_tree.
1764         * dwarf_offdie.c (do_offdie): New function, broken out of ...
1765         (dwarf_offdie): ... here.
1766         (dwarf_offdie_types): New function.
1767         * libdw.h: Declare it.
1768         * libdw.map (ELFUTILS_0.148): Add it.
1769
1770         * libdwP.h (CUDIE): Use cu_data.
1771         * dwarf_formblock.c: Likewise.
1772         * dwarf_formref_die.c: Likewise.
1773         * dwarf_diecu.c: Use CUDIE macro.
1774         * dwarf_formaddr.c: Use cu_sec_idx.
1775
1776 2010-06-16  Roland McGrath  <roland@redhat.com>
1777
1778         * dwarf_formref_die.c: Use dwarf_offdie only for DW_FORM_ref_addr, so
1779         we don't repeat a CU lookup we've already done.  Handle
1780         DW_FORM_ref_sig8 using sig8_hash table and __libdw_intern_next_unit.
1781
1782         * libdw_findcu.c (__libdw_intern_next_unit): New function,
1783         broken out of ...
1784         (__libdw_findcu): ... here.  Call it.
1785         * libdwP.h: Declare it.
1786         (struct Dwarf): New member next_tu_offset.
1787
1788         * dwarf_sig8_hash.c: New file.
1789         * dwarf_sig8_hash.h: New file.
1790         * Makefile.am (libdw_a_SOURCES, noinst_HEADERS): Add them.
1791         * dwarf_abbrev_hash.c: Include dwarf_sig8_hash.h before
1792         defining NO_UNDEF.
1793         * libdwP.h (struct Dwarf): New member sig8_hash.
1794         * dwarf_begin_elf.c: Call Dwarf_Sig8_Hash_init on it.
1795         * dwarf_end.c: Call Dwarf_Sig8_Hash_free on it.
1796
1797         * dwarf_nextcu.c (dwarf_next_unit): New function, broken out of ...
1798         (dwarf_nextcu): ... here.  Call it.
1799         * libdw.h: Declare it.
1800         * libdwP.h: Add INTDECL.
1801         * libdw_findcu.c (__libdw_findcu): Use it instead of dwarf_nextcu.
1802         * libdw.map (ELFUTILS_0.148): New set, add dwarf_next_unit.
1803
1804         * libdwP.h (cu_sec_idx, cu_data): New functions.
1805         Use .debug_types when CU is a TU.
1806         * dwarf_cuoffset.c: Use that instead of assuming IDX_debug_info.
1807         * dwarf_siblingof.c: Likewise.
1808         * dwarf_formstring.c: Likewise.
1809         * dwarf_formudata.c (__libdw_formptr, dwarf_formudata): Likewise.
1810         * dwarf_getlocation.c (dwarf_getlocation): Likewise.
1811         (dwarf_getlocation_addr): Likewise.
1812
1813         * libdwP.h (struct Dwarf_CU): Add new members type_offset, type_sig8.
1814         (DIE_OFFSET_FROM_CU_OFFSET): Take flag argument; if true, compute
1815         .debug_types header size instead of .debug_info header size.
1816         (CUDIE): Use it.
1817         * dwarf_diecu.c: Update caller.
1818         * dwarf_getaranges.c: Likewise.
1819         * dwarf_nextcu.c: Likewise.
1820         * libdw_findcu.c (__libdw_findcu): Initialize new members.
1821
1822         * fde.c (fde_by_offset): Renamed to ...
1823         (__libdw_fde_by_offset): ... this, made global and internal_function.
1824         Don't take ADDRESS argument.
1825         (__libdw_find_fde): Update caller.  Do address sanity check here.
1826         * cfi.h: Declare __libdw_fde_by_offset.
1827         * cfi.c (dwarf_cfi_validate_fde): New function.
1828         * libdw.h: Declare it.
1829         * libdw.map (ELFUTILS_0.148): Add it.
1830
1831         * cie.c (intern_new_cie): Canonicalize DW_EH_PE_absptr FDE encoding to
1832         either DW_EH_PE_udata8 or DW_EH_PE_udata4.
1833
1834         * encoded-value.h (read_encoded_value): Handle DW_EH_PE_indirect.
1835         Don't assume DW_EH_PE_aligned refers to native address size.
1836
1837         * cfi.c (execute_cfi): Barf on CIE initial instructions changing the
1838         address.
1839
1840 2010-06-17  Roland McGrath  <roland@redhat.com>
1841
1842         * libdwP.h (struct Dwarf_Line_s): Add members isa, discriminator, and
1843         op_index.
1844         * dwarf_getsrclines.c (dwarf_getsrclines): Move NEW_FILE macro guts
1845         into an inner inline function.  Set new fields.  Check all fields for
1846         overflow when setting.
1847         * dwarf_lineisa.c: New file.
1848         * dwarf_linediscriminator.c: New file.
1849         * dwarf_lineop_index.c: New file.
1850         * Makefile.am (libdw_a_SOURCES): Add them.
1851         * libdw.map (ELFUTILS_0.148): Add them.
1852         * libdw.h: Declare them.
1853
1854 2010-06-16  Roland McGrath  <roland@redhat.com>
1855
1856         * dwarf_next_cfi.c: Fix version 4 return_address_register decoding.
1857
1858         * fde.c (fde_by_offset): Renamed to ...
1859         (__libdw_fde_by_offset): ... this, made global and internal_function.
1860         Don't take ADDRESS argument.
1861         (__libdw_find_fde): Update caller.  Do address sanity check here.
1862         * cfi.h: Declare __libdw_fde_by_offset.
1863         * cfi.c (dwarf_cfi_validate_fde): New function.
1864         * libdw.h: Declare it.
1865         * libdw.map (ELFUTILS_0.148): Add it.
1866
1867         * cie.c (intern_new_cie): Canonicalize DW_EH_PE_absptr FDE encoding to
1868         either DW_EH_PE_udata8 or DW_EH_PE_udata4.
1869
1870         * encoded-value.h (read_encoded_value): Handle DW_EH_PE_indirect.
1871         Don't assume DW_EH_PE_aligned refers to native address size.
1872
1873         * cfi.c (execute_cfi): Barf on CIE initial instructions changing the
1874         address.
1875
1876 2010-06-15  Roland McGrath  <roland@redhat.com>
1877
1878         * dwarf_formref.c (__libdw_formref): Diagnose DW_FORM_ref_sig8 like
1879         DW_FORM_ref_addr.
1880         * dwarf_formref_die.c (dwarf_formref_die): Diagnose it the same way
1881         here, since we don't support it yet.
1882
1883         * dwarf_next_cfi.c: Handle version 4 format.
1884
1885         * dwarf_getsrclines.c: Handle version 4 format.
1886
1887 2010-06-01  Roland McGrath  <roland@redhat.com>
1888
1889         * libdwP.h: Remove unused IDX_debug_*names, add IDX_debug_types.
1890         * dwarf_begin_elf.c (dwarf_scnnames): Likewise.
1891
1892         * libdwP.h (CIE_VERSION): Remove unused macro.
1893
1894         * dwarf_getsrclines.c: Fix version field test.
1895         * libdwP.h (DWARF_VERSION): Remove useless macro.
1896
1897         * dwarf_formudata.c (__libdw_formptr): Fix DW_FORM_sec_offset handling.
1898
1899         * dwarf_formblock.c (dwarf_formblock): Handle DW_FORM_exprloc.
1900
1901         * libdw_findcu.c (__libdw_findcu): Accept version 4.
1902
1903 2010-05-31  Mark Wielaard  <mjw@redhat.com>
1904
1905         * cfi.h (dwarf_cfi_cie_p): Move definition from here, to ..
1906         * libdw.h (dwarf_cfi_cie_p): ... here.
1907
1908 2010-05-31  Mark Wielaard  <mjw@redhat.com>
1909
1910         * dwarf.h: Fix DW_LANG_Python constant.
1911
1912 2010-05-28  Eduardo Santiago  <santiago@redhat.com>
1913
1914         * dwarf_getlocation.c (dwarf_getlocation): Do attr_ok check first
1915         thing.
1916
1917 2010-05-27  Roland McGrath  <roland@redhat.com>
1918
1919         * dwarf.h: Add DW_AT_enum_class, DW_AT_linkage_name,
1920         DW_TAG_template_alias, DW_LANG_Python, DW_LNE_set_discriminator.
1921
1922 2010-05-08  Roland McGrath  <roland@redhat.com>
1923
1924         * dwarf_getlocation.c (__libdw_intern_expression): Take new argument
1925         REF_SIZE.  Use that to handle DW_OP_call_ref correctly.
1926         (getlocation): Update caller.
1927         * dwarf_frame_cfa.c (dwarf_frame_cfa): Likewise.
1928         * dwarf_frame_register.c (dwarf_frame_register): Likewise.
1929         * libdwP.h: Update decl.
1930
1931 2010-04-26  Roland McGrath  <roland@redhat.com>
1932
1933         * cfi.h (struct Dwarf_Frame_s): Add cfa_invalid alternative in cfa_rule.
1934         * cfi.c (execute_cfi): Set that instead of doing cfi_assert for
1935         DW_CFA_def_cfa_{offset*,register} when a non-offset rule is in force.
1936         * dwarf_frame_cfa.c (dwarf_frame_cfa): Handle cfa_invalid.
1937
1938         * dwarf_getlocation.c (__libdw_intern_expression): Take new arg CFAP.
1939         Prepend DW_OP_call_frame_cfa if true.
1940         (getlocation): Update caller.
1941         * dwarf_frame_cfa.c (dwarf_frame_cfa): Likewise.
1942         * dwarf_frame_register.c (dwarf_frame_register): Likewise.
1943         * libdwP.h: Update decl.
1944
1945 2010-04-22  Roland McGrath  <roland@redhat.com>
1946
1947         * cfi.c (execute_cfi): Never return without cleanup.
1948         Free FS on failure.
1949         (cie_cache_initial_state): Adjust caller to expect that free.
1950         (__libdw_frame_at_address): Likewise.
1951
1952 2010-03-10  Roland McGrath  <roland@redhat.com>
1953
1954         * libdw.map (ELFUTILS_0.146): New set.  Add dwfl_core_file_report.
1955
1956 2010-02-15  Roland McGrath  <roland@redhat.com>
1957
1958         * Makefile.am: Use config/eu.am for common stuff.
1959
1960 2010-02-02  Mark Wielaard  <mjw@redhat.com>
1961
1962         * fde.c (intern_fde): Fix length check for sized_augmentation_data.
1963
1964 2010-01-07  Roland McGrath  <roland@redhat.com>
1965
1966         * dwarf_getcfi_elf.c (getcfi_phdr): Use elf_getphdrnum.
1967
1968 2010-01-05  Roland McGrath  <roland@redhat.com>
1969
1970         * dwarf_aggregate_size.c: New file.
1971         * Makefile.am (libdw_a_SOURCES): Add it.
1972         * libdw.h: Declare it.
1973         * libdwP.h: Add INTDECL.
1974         * libdw.map (ELFUTILS_0.144): New set.  Add dwarf_aggregate_size.
1975
1976         * dwarf_srclang.c: Add INTDEF.
1977         * libdwP.h: Add INTDECL.
1978
1979         * dwarf.h: Add some more DW_AT_GNU_* types from gcc.
1980
1981         * dwarf.h: Add DW_AT_GNU_vector, DW_AT_GNU_template_name.
1982
1983 2009-11-21  Roland McGrath  <roland@redhat.com>
1984
1985         * dwarf_getlocation.c (check_constant_offset): Return 1 for all
1986         non-constant forms.
1987
1988 2009-10-15  Roland McGrath  <roland@redhat.com>
1989
1990         * libdw_form.c (__libdw_form_val_len): Grok DW_FORM_sec_offset,
1991         DW_FORM_exprloc, DW_FORM_flag_present, and DW_FORM_ref_sig8.
1992
1993 2009-09-17  Roland McGrath  <roland@redhat.com>
1994
1995         * dwarf_getlocation.c (dwarf_getlocation_implicit_value): Make OP
1996         argument a pointer to const.
1997         * libdw.h: Update decl.
1998
1999 2009-09-10  Roland McGrath  <roland@redhat.com>
2000
2001         * dwarf_getlocation.c (store_implicit_value): New function.
2002         (__libdw_intern_expression): Use it, handle DW_OP_implicit_value.
2003         (dwarf_getlocation_implicit_value): New function.
2004         * libdw.h: Declare it.
2005         * libdw.map (ELFUTILS_0.143): Add it.
2006
2007 2009-09-09  Mark Wielaard  <mjw@redhat.com>
2008
2009         * dwarf_getcfi.c (dwarf_getcfi): Clear cfi->ebl.
2010
2011 2009-08-21  Josh Stone  <jistone@redhat.com>
2012
2013         * dwarf_hasattr_integrate.c: Integrate DW_AT_specification too.
2014
2015 2009-08-10  Roland McGrath  <roland@redhat.com>
2016
2017         * dwarf_getscopevar.c: Use dwarf_diename.
2018
2019 2009-08-09  Roland McGrath  <roland@redhat.com>
2020
2021         * libdw.map (ELFUTILS_0.143): New version set,
2022         inherits from ELFUTILS_0.142.
2023         * dwarf_arrayorder.c: Use OLD_VERSION and NEW_VERSION to define an
2024         alias in the ELFUTILS_0.122 version set and the default in the new set.
2025         * dwarf_srclang.c: Likewise.
2026         * dwarf_decl_file.c: Likewise.
2027         * dwarf_decl_line.c: Likewise.
2028         * dwarf_decl_column.c: Likewise.
2029         * dwarf_bytesize.c: Likewise.
2030         * dwarf_bitsize.c: Likewise.
2031         * dwarf_bitoffset.c: Likewise.
2032
2033 2009-08-07  Roland McGrath  <roland@redhat.com>
2034
2035         * dwarf_arrayorder.c: Use dwarf_attr_integrate.
2036         * dwarf_srclang.c: Likewise.
2037         * dwarf_decl_file.c: Likewise.
2038         * dwarf_decl_line.c (__libdw_attr_intval): Likewise.
2039         * dwarf_bytesize.c: Likewise.
2040         * dwarf_bitsize.c: Likewise.
2041         * dwarf_bitoffset.c: Likewise.
2042
2043 2009-07-22  Roland McGrath  <roland@redhat.com>
2044
2045         * dwarf_frame_cfa.c: Change calling convention.
2046         * libdw.h: Update decl.
2047
2048         * dwarf_frame_register.c: Change calling/return-value convention for
2049         value-only results and undefined/same_value.
2050         * libdw.h: Update decl.
2051
2052         * dwarf_getlocation.c (__libdw_intern_expression): Take new bool
2053         argument, append DW_OP_stack_value if set.  Don't take NOPS argument,
2054         return that value instead.
2055         (getlocation): Update caller.
2056         * dwarf_frame_cfa.c: Likewise.
2057         * libdwP.h: Update decl.
2058
2059 2009-07-21  Roland McGrath  <roland@redhat.com>
2060
2061         * dwarf_getsrc_file.c: Ignore a CU that just has no DW_AT_stmt_list.
2062         Fix loop iteration after skipping a bogus or useless CU.
2063
2064         * dwarf_entry_breakpoints.c: Handle 0 dwarf_errno () as harmless
2065         absence, not DWARF_E_NO_DEBUG_LINE.
2066
2067 2009-07-20  Roland McGrath  <roland@redhat.com>
2068
2069         * dwarf_getlocation.c (__libdw_intern_expression):
2070         Handle DW_OP_stack_value.
2071
2072 2009-07-16  Roland McGrath  <roland@redhat.com>
2073
2074         * dwarf_formudata.c (__libdw_formptr): Handle DW_FORM_sec_offset,
2075         reject others when CU's version > 3.
2076
2077         * dwarf_formflag.c: Handle DW_FORM_flag_present.
2078
2079         * dwarf.h: Add DW_OP_{implicit,stack}_value from DWARF 4 draft.
2080         Also DW_TAG_type_unit and DW_TAG_rvalue_reference_type.
2081         Also DW_AT_signature, DW_AT_main_subprogram, DW_AT_data_bit_offset,
2082         and DW_AT_const_expr.
2083         Also DW_FORM_sec_offset, DW_FORM_exprloc, DW_FORM_flag_present,
2084         and DW_FORM_ref_sig8.
2085
2086 2009-07-15  Roland McGrath  <roland@redhat.com>
2087
2088         * dwarf_getlocation.c: Grok DW_OP_form_tls_address,
2089         DW_OP_GNU_push_tls_address, and DW_OP_bit_piece.
2090
2091 2009-07-13  Roland McGrath  <roland@redhat.com>
2092
2093         * dwarf_getlocation.c: Grok DW_OP_call_frame_cfa.
2094
2095 2009-07-08  Roland McGrath  <roland@redhat.com>
2096
2097         * libdw.map (ELFUTILS_0.142): Add dwfl_module_dwarf_cfi,
2098         dwfl_module_eh_cfi.
2099
2100         * libdwP.h (struct Dwarf): Add member `cfi'.
2101         * dwarf_end.c (dwarf_end): Call __libdw_destroy_frame_cache on it.
2102         * dwarf_getcfi.c: New file.
2103         * dwarf_getcfi_elf.c: New file.
2104         * dwarf_cfi_end.c: New file.
2105         * dwarf_cfi_addrframe.c: New file.
2106         * dwarf_frame_cfa.c: New file.
2107         * dwarf_frame_register.c: New file.
2108         * dwarf_frame_return_address_register.c: New file.
2109         * Makefile.am (libdw_a_SOURCES): Add them.
2110         * unwind.h: Declare those functions.
2111         * libdw.map (ELFUTILS_0.142): Export them.
2112
2113         * dwarf_getlocation.c (__libdw_intern_expression): New function,
2114         broken out of ...
2115         (getlocation): ... here, call it.
2116         * libdwP.h: Declare it.
2117
2118         * cie.c: New file.
2119         * fde.c: New file.
2120         * frame-cache.c: New file.
2121         * cfi.c: New file.
2122         * cfi.h: New file.
2123         * encoded-value.h: New file.
2124         * Makefile.am (libdw_a_SOURCES, noinst_HEADERS): Add them.
2125         * libdwP.h: Add DWARF_E_INVALID_CFI to errors enum.
2126         * dwarf_error.c (errmsgs): Add element for it.
2127
2128         * dwarf_next_cfi.c: New file.
2129         * Makefile.am (libdw_a_SOURCES): Add it.
2130         * libdw.h (Dwarf_CIE, Dwarf_FDE, Dwarf_CIE_Entry): New types.
2131         Declare dwarf_next_cfi.
2132         * libdw.map (ELFUTILS_0.142): New set, inherits from ELFUTILS_0.136.
2133         Add dwarf_next_cfi.
2134
2135         * memory-access.h [! ALLOW_UNALIGNED]
2136         (read_2ubyte_unaligned): Renamed to ...
2137         (read_2ubyte_unaligned_1): ... this.  Take bool rather than Dwarf *.
2138         (read_2ubyte_unaligned): Define as macro passing dbg->other_byte_order.
2139         (read_2sbyte_unaligned): Likewise.
2140         (read_4ubyte_unaligned): Likewise.
2141         (read_4sbyte_unaligned): Likewise.
2142         (read_8ubyte_unaligned): Likewise.
2143         (read_8sbyte_unaligned): Likewise.
2144
2145         * libdwP.h (IDX_eh_frame): Remove it.
2146         * dwarf_begin_elf.c (dwarf_scnnames): Remove its element.
2147
2148 2009-07-08  Roland McGrath  <roland@redhat.com>
2149
2150         * libdwP.h (struct Dwarf_Line_s): Reorder members to pack better.
2151
2152         * dwarf_getlocation.c (check_constant_offset): New function.
2153         (dwarf_getlocation, dwarf_getlocation_addr): Call it to
2154         handle DW_AT_data_member_location of data[48] as constant offset.
2155
2156 2009-06-18  Roland McGrath  <roland@redhat.com>
2157
2158         * libdwP.h (__libdw_read_address_inc): Constify.
2159         (__libdw_read_offset_inc): Likewise.
2160         * dwarf_getaranges.c: Likewise.
2161         * dwarf_getlocation.c: Likewise.
2162         * dwarf_getsrclines.c: Likewise.
2163         * dwarf_nextcu.c: Likewise.
2164
2165 2009-05-05  Petr Machata  <pmachata@redhat.com>
2166
2167         * libdwP.h (__libdw_formptr): Declare new function.
2168         * dwarf_formudata.c: Implement it here.
2169         * dwarf_getlocation.c (dwarf_getlocation_addr):
2170         Call it instead of hand-rolled offset handling code.
2171         * dwarf_getsrclines.c (dwarf_getsrclines): Likewise.
2172         * dwarf_ranges.c (dwarf_ranges): Likewise.
2173
2174 2009-05-04  Petr Machata  <pmachata@redhat.com>
2175
2176         * libdwP.h (__libdw_read_begin_end_pair_inc): Declare new function.
2177         * dwarf_ranges.c: Implement it here.
2178         (dwarf_ranges): Call it.
2179         * dwarf_getlocation.c (dwarf_getlocation_addr): Call it also here.
2180
2181 2009-04-23  Petr Machata  <pmachata@redhat.com>
2182
2183         * dwarf_formaddr.c (dwarf_formaddr): Call __libdw_read_* instead
2184         of read_*ubyte_unaligned.
2185         * dwarf_formref_die.c (dwarf_formref_die): Likewise.
2186         * dwarf_formstring.c (dwarf_formstring): Likewise.
2187         * dwarf_formudate.c (dwarf_formudata): Likewise.
2188         * dwarf_getaranges.c (dwarf_getaranges): Likewise.
2189         * dwarf_getlocation.c (dwarf_getlocation_addr): Likewise.
2190         * dwarf_getpubnames.c (get_offsets): Likewise.
2191         * dwarf_nextcu.c (dwarf_nextcu): Likewise.
2192
2193 2009-04-23  Petr Machata  <pmachata@redhat.com>
2194
2195         * libdwP.h (__libdw_read_addr_inc, __libdw_read_off_inc,
2196         __libdw_read_addr, __libdw_read_off): Add four new internal
2197         functions.
2198
2199 2009-05-07  Roland McGrath  <roland@redhat.com>
2200
2201         * dwarf_getmacros.c (dwarf_getmacros): Use absolute section offset in
2202         return value and OFFSET argument, not CU-relative.  Only fetch the
2203         attribute data when called with OFFSET of 0.
2204
2205 2009-05-07  Petr Machata  <pmachata@redhat.com>
2206
2207         * dwarf_getmacros.c (dwarf_getmacros): Take into account offset in
2208         DW_AT_macro_info attribute of CU DIE.
2209
2210 2009-04-15  Roland McGrath  <roland@redhat.com>
2211
2212         * dwarf.h (DW_CIE_ID): Removed.
2213         (DW_CIE_ID_32, DW_CIE_ID_64): New constants replace it.
2214
2215 2009-04-01  Roland McGrath  <roland@redhat.com>
2216
2217         * dwarf.h: Add DW_CFA_GNU_negative_offset_extended.
2218
2219 2009-01-28  Roland McGrath  <roland@redhat.com>
2220
2221         * libdwP.h (struct Dwarf_Line_s): Move out of struct Dwarf_Lines_s
2222         defn so C++ doesn't scope the name to not match the Dwarf_Line typedef.
2223
2224         * libdwP.h (struct Dwarf_Files_s): Replace dbg field with cu field.
2225
2226 2009-01-26  Roland McGrath  <roland@redhat.com>
2227
2228         * dwarf_ranges.c: Return 0 when no ranges or *_pc attrs at all.
2229
2230 2009-01-25  Roland McGrath  <roland@redhat.com>
2231
2232         * dwarf_getattrs.c: Correctly skip attribute values when restarting.
2233
2234 2009-01-23  Roland McGrath  <roland@redhat.com>
2235
2236         * Makefile.am ($(srcdir)/known-dwarf.h): Target renamed back.
2237         Put these rules under if MAINTAINER_MODE.
2238
2239 2009-01-22  Roland McGrath  <roland@redhat.com>
2240
2241         * dwarf.h: Add DW_OP_GNU_encoded_addr.
2242
2243 2009-01-21  Roland McGrath  <roland@redhat.com>
2244
2245         * Makefile.am (CLEANFILES): Renamed to ...
2246         (MOSTLYCLEANFILES): ... here.
2247         (CLEANFILES): New variable, add known-dwarf.h.
2248
2249 2009-01-17  Roland McGrath  <roland@redhat.com>
2250
2251         * Makefile.am (known-dwarf.h): Target renamed, not in $(srcdir).
2252         Make it unconditional.
2253         (BUILT_SOURCES): Updated.
2254
2255         * dwarf.h: Add description comments for DW_LANG_* values.
2256
2257         * Makefile.am [MAINTAINER_MODE]
2258         ($(srcdir)/known-dwarf.h): New target.
2259         (BUILT_SOURCES): Add it.
2260
2261         * dwarf.h: Add DW_OP_GNU_push_tls_address, DW_OP_GNU_uninit.
2262
2263 2009-01-10  Ulrich Drepper  <drepper@redhat.com>
2264
2265         * dwarf_error.c: Always use __thread.  Remove all !USE_TLS code.
2266
2267 2009-01-08  Roland McGrath  <roland@redhat.com>
2268
2269         * Makefile.am (libdw.so): Don't depend on $(zip_LIBS), just link it in.
2270
2271 2008-01-06  Roland McGrath  <roland@redhat.com>
2272
2273         * libdwP.h (struct Dwarf_Abbrev): Change type of 'has_children' to bool.
2274         Reorder members.
2275         * dwarf_haschildren.c: Return -1 for error case, not 0.
2276
2277         * Makefile.am (libdw.so): Link in $(zip_LIBS).
2278
2279 2009-01-06  Ulrich Drepper  <drepper@redhat.com>
2280
2281         * dwarf.h: Add definition for unwind and call frame information.
2282
2283         * memory-access.h: Define read_ubyte_unaligned, read_sbyte_unaligned,
2284         read_ubyte_unaligned_inc, and read_sbyte_unaligned_inc.
2285
2286 2008-08-15  Roland McGrath  <roland@redhat.com>
2287
2288         * libdw.map (ELFUTILS_0.136): New version set, inherits from
2289         ELFUTILS_0.130.  Add dwfl_addrsegment, dwfl_report_segment.
2290
2291 2008-01-21  Ulrich Drepper  <drepper@redhat.com>
2292
2293         * dwarf_child.c: Minor optimizations.
2294         * dwarf_getattrs.c: Likewise.
2295         * dwarf_getpubnames.c: Likewise.
2296         * dwarf_siblingof.c: Likewise.
2297         * dwarf_tag.c: Likewise.
2298
2299 2008-01-18  Ulrich Drepper  <drepper@redhat.com>
2300
2301         * dwarf_getsrclines.c (dwarf_getsrclines): Don't require exact match
2302         of DWARF_VERSION comparison, just fail if the file's version is newer.
2303
2304 2008-01-17  Nick Clifton  <nickc@redhat.com>
2305
2306         * dwarf.h (DWARF3_LENGTH_MIN_ESCAPE_CODE): New define.
2307         (DWARF3_LENGTH_MAX_ESCAPE_CODE): New define.
2308         (DWARF3_LENGTH_64_BIT): New define.
2309         * dwarf_getaranges (dwarf_getaranges): Use the new definitions.
2310         * dwarf_getpubnames: Include dwarf.h.
2311         (get_offsets): Use the new definitions.
2312         * dwarf_getsrclines.c (dwarf_getsrclines): Use the new defintions.
2313         * dwarf_nextcu.c: Include dwarf.h.  Correct comment.
2314         (dwarf_nextcu): Use the new definitions.
2315
2316         * libdwP.h (DIE_OFFSET_FROM_CU_OFFSET): New macro.
2317         * dwarf_diecu.c (dwarf_diecu): Use the new macro.
2318         * dwarf_getaranges (dwarf_getaranges): Use the new macro.
2319         * dwarf_nextcu.c (dwarf_nextcu): Use the new macro.
2320
2321         * dwarf_getpubnames (get_offsets): Replace assertion with test and
2322         error return.
2323
2324         * dwarf_entry_breakpoints.c (dwarf_entry_breakpoints): Use CUDIE.
2325
2326         * dwarf_siblingof (dwarf_siblingof): Detect a NULL return pointer.
2327         Set the address in the return structure to the address of the next
2328         non-sibling die, if there is no sibling and the return pointer is
2329         not the same as the die pointer.
2330         * libdw.h: Expand the description of the dwarf_siblingof prototype.
2331
2332         * dwarf_child.c: Fix typo in comment.
2333
2334         * libdwP.h (DWARF_VERSION): Change to 3.
2335
2336         * dwarf_formref.c (__libdw_formref.c): Handle attributes which do
2337         not have a initialised valp pointer.
2338
2339         * dwarf_getattrs.c (dwarf_getattrs): Return 1 rather than 0 when
2340         the end of the attributes is reached.  When the callback fails,
2341         return the address of the failing attribute, not the address of
2342         its successor.
2343         * libdw.h: Expand the description of the dwarf_getattrs prototype.
2344
2345         * dwarf_child.c (__libdw_find_attr): Use the new definition.
2346         (dwarf_child): Likewise.
2347         * dwarf_tag.c (__libdw_findabbrev): Likewise.
2348         (dwarf_tag): Likewise.
2349
2350 2008-01-08  Roland McGrath  <roland@redhat.com>
2351
2352         * Makefile.am (euinclude): Variable removed.
2353         (pkginclude_HEADERS): Set this instead of euinclude_HEADERS.
2354         (libdw.so): Pass -Wl,--enable-new-dtags,-rpath,$(pkglibdir).
2355
2356 2007-10-17  Roland McGrath  <roland@redhat.com>
2357
2358         * libdw.h (__deprecated_attribute__): New macro.
2359         (dwarf_formref): Mark it deprecated.
2360         * dwarf_formref.c (__libdw_formref): New function, broken out of ...
2361         (dwarf_formref): ... here.  Call it.  Remove INTDEF.
2362         * libdwP.h: Remove INTDECL.
2363         Declare __libdw_formref.
2364         * dwarf_siblingof.c (dwarf_siblingof): Call __libdw_formref instead.
2365         * dwarf_formref_die.c: Likewise.  Handle DW_FORM_ref_addr here.
2366
2367         * libdw_form.c (__libdw_form_val_len): Fix DW_FORM_ref_addr result,
2368         needs to check CU->version.
2369
2370         * libdwP.h (struct Dwarf_CU): New member `version'.
2371         * libdw_findcu.c (__libdw_findcu): Initialize it.
2372
2373         * dwarf_child.c: Return 1 for null entry as first child.
2374
2375 2007-10-05  Roland McGrath  <roland@redhat.com>
2376
2377         * dwarf_begin_elf.c (check_section): Punt on SHT_NOBITS sections.
2378
2379         * libdw.h (__extern_inline): Rename to __libdw_extern_inline.
2380         [__OPTIMIZE__] (dwarf_whatattr, dwarf_whatform): Update uses.
2381
2382 2007-10-03  Roland McGrath  <roland@redhat.com>
2383
2384         * libdw.map (ELFUTILS_0.130: Add dwfl_build_id_find_elf
2385         and dwfl_build_id_find_debuginfo.
2386
2387         * libdw.map (ELFUTILS_0.130): New version set, inherits from
2388         ELFUTILS_0.127.  Add dwfl_module_build_id, dwfl_module_report_build_id.
2389
2390 2007-10-02  Roland McGrath  <roland@redhat.com>
2391
2392         * libdw_visit_scopes.c (classify_die): Return walk for class_type and
2393         structure_type.
2394
2395 2007-08-07  Roland McGrath  <roland@redhat.com>
2396
2397         * dwarf_getscopes.c (pc_match): Swallow dwarf_haspc error return when
2398         error code is DWARF_E_NOERROR (0).
2399
2400         * dwarf_getscopes.c (pc_record): Always bail early if DIE->prune.
2401         Fix typo in __libdw_visit_scopes argument.
2402
2403         * dwarf_getscopes.c (pc_match): Check dwarf_haspc error return,
2404         swallow DWARF_E_NO_DEBUG_RANGES but not other errors.
2405
2406 2007-07-03  Roland McGrath  <roland@redhat.com>
2407
2408         * libdw.h (__extern_inline): New macro.
2409         [__OPTIMIZE__] (dwarf_whatattr, dwarf_whatform): Use it.
2410
2411 2007-04-16  Roland McGrath  <roland@redhat.com>
2412
2413         * libdw.map (ELFUTILS_0.127): Add dwfl_module_address_section.
2414
2415 2007-04-05  Roland McGrath  <roland@redhat.com>
2416
2417         * dwarf_getsrcdirs.c: New file.
2418         * Makefile.am (libdw_a_SOURCES): Add it.
2419         * libdw.h: Declare dwarf_getsrcdirs.
2420         * libdw.map (ELFUTILS_0.127): Add it.
2421
2422         * libdwP.h (struct Dwarf_Files_s): New member ndirs.
2423         * dwarf_getsrclines.c (dwarf_getsrclines): Don't clobber NDIRLIST to
2424         zero before we use it to check for DWARF_E_INVALID_DIR_IDX.
2425         Save DIRARRAY in the Dwarf_Files.
2426
2427         * dwarf_ranges.c (dwarf_ranges): Don't sign-extend 32-bit BEGIN
2428         address to check for all-ones base address entry.  Check directly.
2429         Reported by Sébastien Dugué <sebastien.dugue@bull.net>.
2430
2431 2007-03-25  Roland McGrath  <roland@redhat.com>
2432
2433         * dwarf_begin_elf.c (check_section): Return Dwarf * instead of void.
2434         Return NULL when freeing RESULT on error.
2435         (global_read, scngrp_read): Check return value from check_section,
2436         break out of loop after it has freed RESULT.
2437         (valid_p): Handle null argument.
2438
2439 2007-03-12  Roland McGrath  <roland@redhat.com>
2440
2441         * libdw.map (ELFUTILS_0.127): Add dwfl_report_begin_add.
2442
2443 2007-03-04  Roland McGrath  <roland@redhat.com>
2444
2445         * libdw.map (ELFUTILS_0.127): New version set, inherits from
2446         ELFUTILS_0.126.  Add dwfl_module_addrsym.
2447
2448 2007-02-10  Roland McGrath  <roland@redhat.com>
2449
2450         * dwarf.h (DW_OP_fbreg): Comment fix.
2451
2452 2007-02-03  Roland McGrath  <roland@redhat.com>
2453
2454         * dwarf_getelf.c (dwarf_getelf): Renamed from dwarf_get_elf.
2455         * libdw.map (ELFUTILS_0.126): New version set, inherits from
2456         ELFUTILS_0.122.  Move dwarf_getelf there; it was never truly
2457         exported in the past.
2458
2459 2006-12-17  Roland McGrath  <roland@redhat.com>
2460
2461         * dwarf_getlocation.c (dwarf_getlocation_addr): Use zero as base
2462         address when the CU is missing attributes due to buggy GCC.
2463
2464 2006-08-29  Roland McGrath  <roland@redhat.com>
2465
2466         * Makefile.am (CLEANFILES): Add libdw.so.$(VERSION).
2467
2468         * libdw.h (dwarf_diecu): Add __nonnull_attribute__.
2469         (dwarf_child): Don't list arg 1 in __nonnull_attribute__.
2470
2471         * libdw_alloc.c (__libdw_allocate): Take new ALIGN argument, make sure
2472         result is aligned.  Adjust NEWP->remaining here for this allocation.
2473         * libdwP.h: Update decl.
2474         (libdw_alloc): Update caller.
2475
2476 2006-07-12  Ulrich Drepper  <drepper@redhat.com>
2477
2478         * dwarf_child.c: Adjust for internal_function_def removal.
2479         * dwarf_getabbrev.c: Likewise.
2480         * dwarf_tag.c: Likewise.
2481         * libdw_form.c: Likewise.
2482         * memory-access.c: Likewise.
2483
2484 2006-06-28  Roland McGrath  <roland@redhat.com>
2485
2486         * libdw.map: Export dwfl_linecu, dwfl_line_comp_dir.
2487
2488         * libdw.map: Bump to 0.122; export dwfl_module_getsymtab and
2489         dwfl_module_getsym.
2490
2491 2006-05-27  Ulrich Drepper  <drepper@redhat.com>
2492
2493         * libdw.h: Add extern "C".
2494
2495 2006-05-22  Ulrich Drepper  <drepper@redhat.com>
2496
2497         * dwarf_getaranges.c (dwarf_getaranges): Handle files without
2498         aranges information.
2499
2500 2006-05-21  Ulrich Drepper  <drepper@redhat.com>
2501
2502         * libdw.h: Add nonnull attributes to dwarf_tag, dwarf_getattrs,
2503         dwarf_haschildren.
2504
2505 2006-02-28  Roland McGrath  <roland@redhat.com>
2506
2507         * dwarf.h: Add missing DW_ATE_*, DW_TAG_*, DW_LANG_*, DW_CFA_*,
2508         DW_OP_* values, to match DWARF 3.0.  Add new DW_DS_*, DW_END_*
2509         values from DWARF 3.0.
2510
2511 2006-02-22  Roland McGrath  <roland@redhat.com>
2512
2513         * libdw.map: Bump to 0.120; export dwfl_version.
2514
2515 2005-12-22  Roland McGrath  <roland@redhat.com>
2516
2517         * libdw.map: Bump to 0.119; export dwfl_linux_proc_maps_report.
2518
2519 2005-12-12  Roland McGrath  <roland@redhat.com>
2520
2521         * dwarf_ranges.c: Copy CU base address-finding code from
2522         dwarf_getlocation.
2523
2524 2005-12-09  Roland McGrath  <roland@redhat.com>
2525
2526         * dwarf_getlocation.c (dwarf_getlocation_addr): Add some unlikelys.
2527         Delay CU base lookup until it's needed.
2528         If CU base lookup fails with no error, flag invalid DWARF.
2529
2530 2005-11-25  Roland McGrath  <roland@redhat.com>
2531
2532         * libdw.map: Bump to 0.118; export dwfl_module_register_names.
2533
2534 2005-11-15  Roland McGrath  <roland@redhat.com>
2535
2536         * Makefile.am [BUILD_STATIC] (AM_CFLAGS): Add -fpic.
2537
2538 2005-11-13  Roland McGrath  <roland@redhat.com>
2539
2540         * libdw.map: Bump to 0.117; export dwfl_module_return_value_location.
2541
2542 2005-10-27  Roland McGrath  <roland@redhat.com>
2543
2544         * dwarf_entry_breakpoints.c (search_range): Fix binary search code;
2545         don't match end_sequence markers.
2546
2547         * dwarf_getsrclines.c (compare_lines): Sort end_sequence markers
2548         before normal records at the same address.
2549         * dwarf_getsrc_die.c (dwarf_getsrc_die): Don't match an end_sequence
2550         marker.
2551
2552 2005-10-26  Roland McGrath  <roland@redhat.com>
2553
2554         * dwarf_getfuncs.c (dwarf_getfuncs): Use Dwarf_Die, not Dwarf_Func.
2555         * dwarf_func_file.c: Renamed to ...
2556         * dwarf_decl_file.c: ... here.
2557         * dwarf_func_col.c: Renamed to ...
2558         * dwarf_decl_column.c: ... here.
2559         * dwarf_func_line.c: Renamed to ...
2560         * dwarf_decl_line.c: ... here.
2561         (dwarf_func_line): Renamed to ...
2562         (dwarf_decl_line): ... this.  Take a Dwarf_Die * argument.
2563         (__libdw_func_intval): Renamed __libdw_attr_intval.
2564         * dwarf_func_name.c: File removed.
2565         * dwarf_func_lowpc.c: File removed.
2566         * dwarf_func_highpc.c: File removed.
2567         * dwarf_func_entrypc.c: File removed.
2568         * dwarf_func_die.c: File removed.
2569         * Makefile.am (libdw_a_SOURCES): Updated.
2570         * libdw.h: Update decls.
2571         (Dwarf_Func): Type removed.
2572         * libdwP.h: Update decls.
2573         (struct Dwarf_Func_s): Type removed.
2574         * libdw.map: Updated.
2575
2576         * libdwP.h (CUDIE): New macro.
2577         * dwarf_getlocation.c (dwarf_getlocation_addr): Use it.
2578         * dwarf_getscopes_die.c (dwarf_getscopes_die): Likewise.
2579         * dwarf_ranges.c (dwarf_ranges): Likewise.
2580
2581         * dwarf_getloclist.c: Renamed to ...
2582         * dwarf_getlocation.c: ... here.
2583         (getloclist): Renamed to getlocation.
2584         (dwarf_getloclist): Renamed to dwarf_getlocation.
2585         (dwarf_addrloclists): Renamed to dwarf_getlocation_addr.
2586         * Makefile.am (libdw_a_SOURCES): Updated.
2587         * libdw.h (dwarf_getloclist): Renamed to dwarf_getlocation.
2588         (dwarf_addrloclists): Renamed dwarf_getlocation_addr.
2589         (Dwarf_Loc): Renamed Dwarf_Op.
2590         * libdwP.h (struct loc_s): Update use.
2591         * libdw.map: Update map.
2592
2593         * dwarf_entry_breakpoints.c: Use the second line record within the
2594         function, regardless of its source location data.
2595
2596 2005-10-25  Roland McGrath  <roland@redhat.com>
2597
2598         * dwarf_entry_breakpoints.c: Fall back to entrypc for contiguous too.
2599
2600         * libdw.map: Add dwarf_entrypc, dwarf_entry_breakpoints.
2601
2602 2005-10-14  Roland McGrath  <roland@redhat.com>
2603
2604         * dwarf_diecu.c (dwarf_diecu): New file.
2605         * Makefile.am (libdw_a_SOURCES): Add it.
2606         * libdw.h: Declare dwarf_diecu.
2607         * libdw.map: Export it.
2608
2609         * libdw.map: Bump to 0.116; export dwarf_ranges.
2610
2611 2005-09-20  Roland McGrath  <roland@redhat.com>
2612
2613         * dwarf_haspc.c: Use dwarf_ranges.
2614         * dwarf_entry_breakpoints.c: Likewise.
2615
2616         * dwarf_ranges.c: New file.
2617         * Makefile.am (libdw_a_SOURCES): Add it.
2618         * libdw.h: Declare dwarf_ranges.
2619         * libdwP.h: Add INTDECL.
2620
2621 2005-09-14  Roland McGrath  <roland@redhat.com>
2622
2623         * dwarf_entry_breakpoints.c (dwarf_entry_breakpoints): Fix braino in
2624         prologue_end marker scanning loop.
2625
2626 2005-09-11  Roland McGrath  <roland@redhat.com>
2627
2628         * dwarf.h: Comment typo fix.
2629
2630 2005-09-07  Roland McGrath  <roland@redhat.com>
2631
2632         * dwarf_entry_breakpoints.c: New file.
2633         * Makefile.am (libdw_a_SOURCES): Add it.
2634         * libdw.h: Declare dwarf_entry_breakpoints.
2635
2636         * dwarf_entrypc.c: New file.
2637         * Makefile.am (libdw_a_SOURCES): Add it.
2638         * libdw.h: Declare dwarf_entrypc.
2639         * libdwP.h: Add INTDECL.
2640
2641 2005-08-28  Ulrich Drepper  <drepper@redhat.com>
2642
2643         * Makefile.am: Use $(LINK) not $(CC) when creating DSO.
2644         (%.os): Use COMPILE.os.
2645         (COMPILE.os): Filter out gconv options.
2646
2647 2005-08-27  Roland McGrath  <roland@redhat.com>
2648
2649         * dwarf_getscopes.c (dwarf_getscopes): Rewritten using
2650         __libdw_visit_scopes.
2651
2652         * dwarf_getscopes_die.c: New file.
2653         * Makefile.am (libdw_a_SOURCES): Add it.
2654         * libdw.h: Declare dwarf_getscopes_die.
2655         * libdw.map: Bump to 0.115 and add it.
2656
2657         * libdw_visit_scopes.c (__libdw_visit_scopes): Pass a struct
2658         containing a DIE and its parent pointer, instead of just Dwarf_Die.
2659         Take two functions for both preorder and postorder visitors.
2660         * libdwP.h: Update decl.
2661         (struct Dwarf_Die_Chain): New type.
2662         * dwarf_func_inline.c: Update uses.
2663
2664         * dwarf_diename.c (dwarf_diename): Use dwarf_attr_integrate.
2665         Add INTDEF.
2666         * libdwP.h: Add INTDECL.
2667         * dwarf_func_name.c (dwarf_func_name): Use dwarf_diename.
2668
2669 2005-08-23  Roland McGrath  <roland@redhat.com>
2670
2671         * dwarf_attr_integrate.c (dwarf_attr_integrate): Treat
2672         DW_AT_specification the same as DW_AT_abstract_origin.
2673
2674 2005-08-20  Roland McGrath  <roland@redhat.com>
2675
2676         * libdw.map: Add dwfl_cumodule, remove dwfl_linecu.
2677         Add dwfl_linux_kernel_report_offline, dwfl_offline_section_address,
2678         and dwfl_report_offline.
2679
2680 2005-08-19  Roland McGrath  <roland@redhat.com>
2681
2682         * libdw.map: Bump version to ELFUTILS_0.114 for libdwfl changes.
2683         Add dwfl_module_relocate_address, dwfl_module_relocations,
2684         dwfl_module_relocation_info.
2685
2686 2005-08-18  Roland McGrath  <roland@redhat.com>
2687
2688         * dwarf_getscopes.c (dwarf_getscopes): Include the CU itself as
2689         outermost scope in the results.
2690
2691 2005-08-15  Roland McGrath  <roland@redhat.com>
2692
2693         * dwarf_func_inline.c: New file.
2694         * Makefile.am (libdw_a_SOURCES): Add it.
2695         * libdw.h: Declare dwarf_func_inline, dwarf_func_inline_instances.
2696         * libdw.map: Add them.
2697
2698         * dwarf_func_die.c: New file.
2699         * Makefile.am (libdw_a_SOURCES): Add it.
2700         * libdw.h: Declare dwarf_func_die.
2701         * libdw.map: Add it.  Bump version to ELFUTILS_0.114.
2702
2703 2005-08-10  Ulrich Drepper  <drepper@redhat.com>
2704
2705         * dwarf_getsrclines.c (dwarf_getsrclines): Correct fallout of renaming
2706         of DW_LNS_set_epilog_begin.
2707
2708 2005-08-09  Roland McGrath  <roland@redhat.com>
2709
2710         * dwarf.h (DW_LNS_set_epilog_begin): Renamed DW_LNS_set_epilogue_begin.
2711
2712         * dwarf_end.c: Add INTDEF.
2713         * dwarf_error.c (dwarf_errmsg): Likewise.
2714         * libdwP.h (dwarf_end, dwarf_errmsg): Add INTDECLs.
2715
2716 2005-08-01  Roland McGrath  <roland@redhat.com>
2717
2718         * dwarf_getaranges.c (dwarf_getaranges): Check for bogus offset.
2719         * dwarf_getabbrev.c (__libdw_getabbrev): Likewise.
2720
2721 2005-07-28  Ulrich Drepper  <drepper@redhat.com>
2722
2723         * Makefile.am (libdw.so): No need to link with libeu.a anymore.
2724         (libdw_a_LIBADD): Add all files from libdwfl.a.
2725
2726 2005-07-27  Roland McGrath  <roland@redhat.com>
2727
2728         * Makefile.am (libdw.so): Link ../libdwfl/libdwfl_pic.a in,
2729         along with ../libebl/libebl.a and ../lib/libeu.a;
2730         depend on ../libelf/libelf.so.
2731         (libdw_so_LDADD): New variable.
2732         * libdw.map: Add dwfl_* symbols formerly in ../libdwfl/libdwfl.map.
2733
2734         * libdw.map: Define an empty base version and move all symbols to
2735         version ELFUTILS_0.111; don't define ELFUTILS_1.0 at all yet.
2736
2737 2005-07-23  Ulrich Drepper  <drepper@redhat.com>
2738
2739         * dwarf_error.c: Add internal alias for dwarf_errno.
2740         * libdwP.h: Declare __dwarf_errno_internal.
2741         * dwarf_getloclist.c: Use INTDEF for dwarf_errno.
2742
2743         * dwarf_error.c [USE_TLS]: Actually use __thread in definition of
2744         global_error.
2745
2746 2005-06-01  Roland McGrath  <roland@redhat.com>
2747
2748         * dwarf_getaranges.c (dwarf_getaranges): Sort result array.
2749         * dwarf_getarange_addr.c (dwarf_getarange_addr): Use binary search.
2750
2751 2005-06-08  Roland McGrath  <roland@redhat.com>
2752
2753         * memory-access.h (get_uleb128_step, get_uleb128): Remove casts.
2754         (get_sleb128_step, get_sleb128): Likewise.
2755         * dwarf_getattrs.c (dwarf_getattrs): Add consts.
2756         * dwarf_getloclist.c (getloclist): Likewise.
2757         * dwarf_formblock.c (dwarf_formblock): Likewise.
2758         * dwarf_getsrclines.c (dwarf_getsrclines): Likewise.
2759         * dwarf_getabbrevattr.c (dwarf_getabbrevattr): Likewise.
2760         * dwarf_formref.c (dwarf_formref): Likewise.
2761         * dwarf_formsdata.c (dwarf_formsdata): Likewise.
2762         * dwarf_formudata.c (dwarf_formudata): Likewise.
2763         * dwarf_haschildren.c (dwarf_haschildren): Likewise.
2764         * dwarf_child.c (__libdw_find_attr, __libdw_find_attr): Likewise.
2765         * dwarf_tag.c (dwarf_tag): Likewise.
2766         * dwarf_getabbrev.c (__libdw_getabbrev): Likewise.
2767         * memory-access.c (__libdw_get_uleb128, __libdw_get_sleb128): Likewise.
2768         * libdw_form.c (__libdw_form_val_len): Likewise.
2769         * libdwP.h: Update decl.
2770
2771 2005-06-04  Roland McGrath  <roland@redhat.com>
2772
2773         * memory-access.h (get_uleb128_rest_return): New macro.
2774         [! IS_LIBDW] (__libdw_get_uleb128): New static, defined using it.
2775         (get_sleb128_rest_return): New macro.
2776         [! IS_LIBDW] (__libdw_get_sleb128): New static, defined using it.
2777         * memory-access.c: New file.
2778         * Makefile.am (libdw_a_SOURCES): Add it.
2779         (DEFS): Add -DIS_LIBDW.
2780
2781 2005-05-31  Roland McGrath  <roland@redhat.com>
2782
2783         * dwarf_formref_die.c (dwarf_formref_die): Add CU header offset to
2784         formref offset.
2785
2786 2005-05-30  Roland McGrath  <roland@redhat.com>
2787
2788         * dwarf_getloclist.c (dwarf_addrloclists): Use DW_AT_entry_pc for base
2789         address if DW_AT_low_pc is missing.  Not to spec, but GCC generates it.
2790
2791         * dwarf_getloclist.c (dwarf_addrloclists): Don't sign-extend 4-byte
2792         BEGIN value.  Instead, match base address entries separately for
2793         32/64 size cases.
2794
2795 2005-05-28  Roland McGrath  <roland@redhat.com>
2796
2797         * dwarf_getloclist.c (dwarf_addrloclists): Fix decoding to advance
2798         past location expression contents.
2799
2800 2005-05-23  Roland McGrath  <roland@redhat.com>
2801
2802         * dwarf_getsrclines.c: Comment typo fix.
2803
2804         * dwarf_haspc.c (dwarf_haspc): Fix CU DIE address calculation.
2805         * dwarf_getloclist.c (dwarf_addrloclists): Likewise.
2806
2807 2005-05-22  Ulrich Drepper  <drepper@redhat.com>
2808
2809         * libdwP.h: Only use INTDECL for alias prototypes.
2810
2811 2005-05-19  Roland McGrath  <roland@redhat.com>
2812
2813         * dwarf_getloclist.c (attr_ok): Permit DW_AT_static_link too.
2814
2815         * dwarf_getscopevar.c: New file.
2816         * Makefile.am (libdw_a_SOURCES): Add it.
2817         * libdw.h: Declare dwarf_getscopevar.
2818
2819         * dwarf_getsrcfiles.c: Add INTDEF.
2820         * dwarf_haschildren.c: Likewise.
2821         * libdwP.h (dwarf_getsrcfiles, dwarf_haschildren): Add INTDECL.
2822
2823         * dwarf_getscopes.c: New file.
2824         * Makefile.am (libdw_a_SOURCES): Add it.
2825         * libdw.h: Declare dwarf_getscopes.
2826         * libdw.map: Add it.
2827
2828 2005-05-18  Roland McGrath  <roland@redhat.com>
2829
2830         * libdwP.h (IDX_debug_ranges): New enum constant.
2831         * dwarf_begin_elf.c (dwarf_scnnames): Add it for ".debug_ranges".
2832         * libdwP.h (DWARF_E_NO_DEBUG_RANGES): New enum constant.
2833         * dwarf_error.c (errmsgs): Add it.
2834         * dwarf_haspc.c: New file.
2835         * libdw.h: Declare dwarf_haspc.
2836         * libdw.map: Add it.
2837         * libdwP.h: Add INTDECL.
2838
2839         * dwarf_attr_integrate.c: New file.
2840         * dwarf_hasattr_integrate.c: New file.
2841         * Makefile.am (libdw_a_SOURCES): Add them.
2842         * libdw.h: Declare dwarf_attr_integrate, dwarf_hasattr_integrate.
2843         * libdw.map: Add them.
2844
2845         * dwarf_hasattr.c: Add INTDEF.
2846         * libdwP.h: Add INTDECL for it.
2847
2848         * dwarf_formref_die.c: New file.
2849         * Makefile.am (libdw_a_SOURCES): Add it.
2850         * libdw.h (dwarf_formref_die): Declare it.
2851         * libdwP.h (dwarf_formref_die): Add INTDECL.
2852         * libdw.map: Add it.
2853
2854         * dwarf_getloclist.c (attr_ok, getloclist): New functions, broken out
2855         of ...
2856         (dwarf_getloclist): ... here.  Call them.
2857         (dwarf_addrloclists): New function.
2858         * libdw.h: Declare it.
2859         * libdw.map: Add it.
2860
2861         * dwarf_getmacros.c (dwarf_getmacros): Don't bail at
2862         DW_MACINFO_end_file.  Recognize type 0 as terminator.
2863
2864 2005-05-05  Roland McGrath  <roland@redhat.com>
2865
2866         * dwarf_getsrc_die.c (dwarf_getsrc_die): Use binary search.
2867
2868         * dwarf_getsrclines.c (dwarf_getsrclines): Sort result array, since
2869         the line program does not produce all entries in ascending order.
2870
2871 2005-04-25  Ulrich Drepper  <drepper@redhat.com>
2872
2873         * dwarf_getsrc_file.c (dwarf_getsrc_file): Handle multiple
2874         occurences (e.g., inlines) better.
2875
2876 2005-04-24  Ulrich Drepper  <drepper@redhat.com>
2877
2878         * libdw.h (DWARF_END_ABBREV): Define.
2879         * dwarf_getabbrev.c (__libdw_getabbrev): Return DWARF_END_ABBREV if
2880         end is reached.
2881         * dwarf_offabbrev.c (dwarf_offabbrev): Return -1 on error, 1 if end
2882         of records reached.
2883         * dwarf_tag.c (__libdw_findabbrev): Also recognize DWARF_END_ABBREV
2884         as error of __libdw_getabbrev.
2885
2886 2005-04-04  Ulrich Drepper  <drepper@redhat.com>
2887
2888         * dwarf_getsrc_file.c (dwarf_getsrc_file): Minor optimization.
2889
2890         * dwarf_getsrc_file.c (dwarf_getsrc_file): Always pass number of
2891         results back to caller.
2892
2893 2005-04-04  Roland McGrath  <roland@redhat.com>
2894
2895         * dwarf_getsrc_file.c (dwarf_getsrc_file): Use size_t for CUHL.
2896
2897         * dwarf_func_line.c (__libdw_func_intval): Use internal_function in
2898         defn.
2899
2900 2005-04-04  Ulrich Drepper  <drepper@redhat.com>
2901
2902         * dwarf_getsrc_file.c (dwarf_getsrc_file): Use INTUSE.
2903
2904         * dwarf_getsrc_file.c: New file.
2905         * Makefile.am (libdw_a_SOURCES): Add dwarf_getsrc_file.c.
2906         * libdw.h: Declare dwarf_getsrc_file.
2907         * libdw.map: Add dwarf_getsrc_file.
2908
2909 2005-04-02  Ulrich Drepper  <drepper@redhat.com>
2910
2911         * dwarf_func_entrypc.c: New file.
2912         * dwarf_func_col.c: New file.
2913         * dwarf_func_line.c: New file.
2914         * dwarf_func_file.c: New file.
2915         * libdw.h: Add prototypes for new functions.
2916         * libdw.map: Add dwarf_func_entrypc, dwarf_func_col, dwarf_func_line,
2917         dwarf_func_file.
2918         * Makefile.am (libdw_a_SOURCES): Add dwarf_func_entrypc.c,
2919         dwarf_func_col.c, dwarf_func_line.c, dwarf_func_file.c.
2920         * libdwP.h (struct Dwarf_Func_s): Add cudie element.
2921         Declare __libdw_func_intval and __dwarf_formsdata_internal.
2922         * dwarf_getfuncs.c: Also fill in cudie in Dwarf_Func object.
2923         * dwarf_formsdata.c: Use INTUSE and INTDEF to avoid PLTs.
2924
2925         * dwarf.h: Add some DWARF3 definitions.
2926
2927 2005-04-01  Ulrich Drepper  <drepper@redhat.com>
2928
2929         * dwarf_getfuncs.c: New file.
2930         * dwarf_func_highpc.c: New file.
2931         * dwarf_func_lowpc.c: New file.
2932         * dwarf_func_name.c: New file.
2933         * Makefile.am (libdw_a_SOURCES): Add dwarf_getfuncs.c,
2934         dwarf_func_highpc.c, dwarf_func_lowpc.c, and dwarf_func_name.c.
2935         * libdw.map: Add dwarf_getfuncs, dwarf_func_highpc, dwarf_func_lowpc,
2936         and dwarf_func_name.
2937         * libdw.h: Add prototypes for new functions.
2938         * dwarf_child.c: Use INTUSE and INTDEF to avoid PLTs.
2939         * dwarf_siblingof.c: Likewise.
2940         * dwarf_dieoffset.c: Likewise.
2941         * dwarf_highpc.c: Likewise.
2942         * dwarf_lowpc.c: Likewise.
2943         * libdwP.h: Add prototypes for internal functions.
2944         Define Dwarf_Func_s structure.
2945
2946 2005-03-29  Ulrich Drepper  <drepper@redhat.com>
2947
2948         * libdw.h: Add padding in Dwarf_die.
2949
2950         * dwarf_arrayorder.c: Use INTUSE and INTDEF to avoid PLTs.
2951         * dwarf_attr.c: Likewise.
2952         * dwarf_begin.c: Likewise.
2953         * dwarf_begin_elf.c: Likewise.
2954         * dwarf_bitoffset.c: Likewise.
2955         * dwarf_bitsize.c: Likewise.
2956         * dwarf_bytesize.c: Likewise.
2957         * dwarf_diename.c: Likewise.
2958         * dwarf_formaddr.c: Likewise.
2959         * dwarf_formblock.c: Likewise.
2960         * dwarf_formref.c: Likewise.
2961         * dwarf_formstring.c: Likewise.
2962         * dwarf_formudata.c: Likewise.
2963         * dwarf_getarange_addr.c: Likewise.
2964         * dwarf_getarangeinfo.c: Likewise.
2965         * dwarf_getaranges.c: Likewise.
2966         * dwarf_getloclist.c: Likewise.
2967         * dwarf_getmacros.c: Likewise.
2968         * dwarf_getsrc_die.c: Likewise.
2969         * dwarf_getsrcfiles.c: Likewise.
2970         * dwarf_getsrclines.c: Likewise.
2971         * dwarf_highpc.c: Likewise.
2972         * dwarf_lowpc.c: Likewise.
2973         * dwarf_nextcu.c: Likewise.
2974         * dwarf_offdie.c: Likewise.
2975         * dwarf_siblingof.c: Likewise.
2976         * dwarf_srclang.c: Likewise.
2977         * dwarf_tag.c: Likewise.
2978         * libdw_findcu.c: Likewise.
2979         * libdwP.h: Add prototypes for internal functions.
2980
2981         * dwarf_addrdie.c: New file.
2982         * dwarf_macro_opcode.c: New file.
2983         * dwarf_macro_param1.c: New file.
2984         * dwarf_macro_param2.c: New file.
2985         * libdw.h: Add declarations.  Move Dwarf_Macro definition to libdwP.h.
2986         * libdwP.h: Remove Dwarf_Macro definition.
2987         * Makefile.am (libdw_a_SOURCES): Add dwarf_addrdie.c,
2988         dwarf_macro_opcode.c, dwarf_macro_param1.c, and dwarf_macro_param2.c.
2989         * libdw.map: Add entries for new functions.
2990
2991 2005-03-21  Ulrich Drepper  <drepper@redhat.com>
2992
2993         * libdw.h: Handle broken gcc < 4.
2994
2995 2005-02-15  Ulrich Drepper  <drepper@redhat.com>
2996
2997         * Makefile (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2.
2998
2999         * dwarf_begin_elf.c: Fix warnings.
3000         * dwarf_dieoffset.c: Likewise.
3001         * dwarf_end.c: Likewise.
3002         * dwarf_error.c: Likewise.
3003         * dwarf_getpubnames.c: Likewise.
3004
3005         * libdwP.h: Add new error values.
3006         * dwarf_error.c: Support new error values.
3007         * dwarf_getpubnames.c: Check parameter value.
3008
3009 2005-02-05  Ulrich Drepper  <drepper@redhat.com>
3010
3011         * Makefile.am: Check for text relocations in constructed DSO.
3012
3013         * Makefile.am [MUDFLAP] (AM_CFLAGS): Add -fmudflap.
3014
3015 2005-02-04  Ulrich Drepper  <drepper@redhat.com>
3016
3017         * dwarf_siblingof.c (dwarf_siblingof): Add some buffer boundary
3018         checks to not read over buffer boundaries for ill-formed DWARF data.
3019
3020 2004-09-25  Ulrich Drepper  <drepper@redhat.com>
3021
3022         * dwarf_child.c: Make compile with gcc 4.0.
3023         * dwarf_error.c: Likewise.
3024         * dwarf_formblock.c: Likewise.
3025         * dwarf_getabbrev.c: Likewise.
3026         * dwarf_getattrs.c: Likewise.
3027         * dwarf_getsrclines.c: Likewise.
3028         * dwarf_tag.c: Likewise.
3029         * libdw_form.c: Likewise.
3030
3031 2004-01-20  Ulrich Drepper  <drepper@redhat.com>
3032
3033         * Makefile.am: Support building with mudflap.
3034
3035         * dwarf_getloclist.c: Fix warnings gcc 3.4 spits out.
3036         * dwarf_getsrclines.c: Likewise.
3037         * dwarf_memory-access.h: Likewise.
3038
3039 2004-01-19  Ulrich Drepper  <drepper@redhat.com>
3040
3041         * dwarf_getsrcfiles.c: Third parameter can be NULL.
3042
3043         * libdw.h: Define Dwarf_macro.  Declare dwarf_getmacros.
3044         Third parameter of dwarf_getsrcfiles can be NULL.
3045
3046         * libdw.map: Add dwarf_getmacros.
3047         * Makefile.am (libdw_a_SOURCES): Add dwarf_getmacros.
3048         * dwarf_getmacros.c: New file.
3049
3050 2004-01-18  Ulrich Drepper  <drepper@redhat.com>
3051
3052         * libdw.h: Second parameter of dwarf_getaranges can be NULL.
3053
3054         * dwarf_nextcu.c: Return -1 if dwarf parameter is NULL.
3055
3056         * dwarf_getsrclines.c:
3057         Use read_2ubyte_unaligned_inc instead of _inc-less variant.
3058
3059         * dwarf_getaranges.c: Allow naranges parameter to be NULL.
3060
3061         * libdwP.h (_): Use elfutils domain.
3062
3063         * dwarf_getsrclines.c (dwarf_getsrclines): Add more branch prediction.
3064
3065         * dwarf_getsrclines.c: Fix typo in comment.
3066
3067 2004-01-17  Ulrich Drepper  <drepper@redhat.com>
3068
3069         * Makefile.am: Support building with mudflap.
3070
3071 2004-01-16  Ulrich Drepper  <drepper@redhat.com>
3072
3073         * memory-access.h: Add lots of const in case a pointer passed is const.
3074
3075         * dwarf_formflag.c: New file.
3076         * dwarf_getattrs.c: New file.
3077         * dwarf_error.c: Add new error value.
3078         * libdw.h: Add prototypes for new functions.  Adjust prototype for
3079         dwarf_getpubnames.
3080         * libdw.map: Add new functions.
3081         * dwarf_getpubnames.c: Change type of return value and fourth parameter
3082         to ptrdiff_t.
3083         * libdwP.h: Add new error value.
3084         * Makefile.am (libdw_a_SOURCES): Add dwarf_getattrs.c and
3085         dwarf_formflag.c.
3086
3087         * dwarf_getpubnames.c (dwarf_getpubnames): Just fail if dbg is NULL.
3088
3089 2004-01-12  Ulrich Drepper  <drepper@redhat.com>
3090
3091         * dwarf_getarange_addr.c: New file
3092         * dwarf_getarangeinfo.c: New file.
3093         * dwarf_getaranges.c: New file.
3094         * dwarf_onerange.c: New file.
3095         * libdw.h: Declare new functions.  Define Dwarf_Arange and
3096         Dwarf_Aranges.
3097         * libdw.map: Add new functions.
3098         * libdwP.h: Add new errors.  Add aranges member to struct Dwarf.
3099         Define Dwarf_Aranges_s and Dwarf_Arange_s.
3100         * Makefile.am (libdw_a_SOURCES): Add dwarf_getaranges.c,
3101         dwarf_onearange.c, dwarf_getarangeinfo.c, dwarf_getarange_addr.c.
3102         * dwarf_error.c: Add new message.
3103
3104 2004-01-11  Ulrich Drepper  <drepper@redhat.com>
3105
3106         * Makefile.am (libdw_a_SOURCES): Add dwarf_lineaddr.c, dwarf_linecol.c,
3107         dwarf_linebeginstatement.c, dwarf_lineendsequence.c, dwarf_lineblock.c,
3108         dwarf_lineprologueend.c, dwarf_lineepiloguebegin.c, dwarf_onesrcline.c.
3109         * dwarf_error.c: Add another message.
3110         * dwarf_getsrc_die.c: Adjust for Dwarf_Files and Dwarf_Lines
3111         introduction.
3112         * dwarf_filesrc.c: Likewise.
3113         * dwarf_getsrcfiles.c: Likewise.
3114         * dwarf_getsrclines.c: Likewise.
3115         * dwarf_lineaddr.c: New file.
3116         * dwarf_linebeginstatement.c: New file.
3117         * dwarf_lineblock.c: New file.
3118         * dwarf_linecol.c: New file.
3119         * dwarf_lineendsequence.c: New file.
3120         * dwarf_lineepiloguebegin.c: New file.
3121         * dwarf_lineno.c: New file.
3122         * dwarf_lineprologueend.c: New file.
3123         * dwarf_onesrcline.c: New file.
3124         * dwarf_lineno.c: Change interface to store result in object pointed
3125         to by second parameter.
3126         * libdw.h: Add prototypes for new functions.  Change dwarf_lineno
3127         prototype.  Define Dwarf_Files and Dwarf_Lines.
3128         * libdw.map: Add new functions.
3129         * libdwP.h: Define Dwarf_Files_s and Dwarf_Lines_s.
3130         * libdw_findcu.c: Don't initialize nlines field.
3131
3132         * dwarf_siblingof: Little optimization.
3133
3134         * dwarf_begin.c: Remember that the ELF descriptor must be closed.
3135         * dwarf_end.c: Close ELF descriptor if free_elf is set.
3136         * libdwP.h (struct Dwarf): Add free_elf field.
3137
3138         * Makefile.am (libdw_a_SOURCES): Add dwarf_getstring.c and
3139         dwarf_offabbrev.c.
3140         * dwarf_getstring.c: New file.
3141         * dwarf_offabbrev.c: New file.
3142         * libdw.map: Add dwarf_getstring and dwarf_offabbrev.
3143         * dwarf_getabbrev.c (__libdw_getabbrev): Add new dbg and result
3144         parameters.  Don't allocate memory if not necessary and don't lookup
3145         previous results if no CU given.
3146         (dwarf_getabbrev): Adjust call to __libdw_getabbrev.
3147         * dwarf_tag.c: Adjust call to __libdw_getabbrev.
3148         * libdw.h: Declare dwarf_offabbrev and dwarf_getstring.
3149         * libdwP.h: Change prototype for __libdw_getabbrev.
3150
3151         * dwarf_getabbrevattr.c: Add offsetp parameter.  Fill in before
3152         returning if this is wanted.
3153
3154 2004-01-09  Ulrich Drepper  <drepper@redhat.com>
3155
3156         * dwarf_nextcu.c: Add new parameter offset_sizep.  Initialize it
3157         with offset_size value.
3158         * libdw.h: Adjust dwarf_nextcu prototype.
3159         * libdwP.h (struct Dwarf_CU): Add offset_size member.
3160         * libdw_findcu.c: Adjust dwarf_nextcu call.  Initialize offset_size
3161         member of new CU struct.
3162         * dwarf_formstring.c: Depend on offset_size not address_size for
3163         DW_FORM_strp handling.
3164         * dwarf_form.c: Likewise for DW_FORM_strp and DW_FORM_ref_addr.
3165
3166         * dwarf_tag.c (__libdw_findabbrev): Return correct value for
3167         failing lookup.
3168         (dwarf_tag): Correctly recognize failed lookup.
3169
3170         * dwarf_end.c (cu_free):  Call tdestroy for locs member.  Use new
3171         function noop_free.
3172         * dwarf_error.c: Add message for DWARF_E_NO_BLOCK.
3173         * dwarf_formblock.c: New file.
3174         * dwarf_getloclist.c: Rewrite to handle a single block.
3175         * libdw.h: Define Dwarf_Block.  Rename Dwarf_Loc members.  Remove
3176         Dwarf_Locdesc definition.  Declare dwarf_formblock.  Remove
3177         dwarf_getloclistent declaration.
3178         * libdw.map: Add dwarf_formblock, remove dwarf_getloclistent.
3179         * libdwP.h: Define struct loc_s and DWARF_E_NO_BLOCK.
3180         Add locs member to struct Dwarf_CU.
3181         * libdw_fundcu.c: Initialize locs member of new CU.
3182         * Makefile.am (libdw_a_SOURCES): Add dwarf_formblock.c.
3183         Remove dwarf_getloclistent.c.
3184
3185 2004-01-07  Ulrich Drepper  <drepper@redhat.com>
3186
3187         * libdw.h: Use __nonnull__ attribute only for gcc >= 3.3.
3188         * libdwP.h: Likewise.
3189
3190         * dwarf_getloclist.c: New file.
3191         * dwarf_getloclistent.c: New file.
3192         * libdw.h: Define Dwarf_Loc and Dwarf_Locdesc.
3193         Declare dwarf_getloclistent and dwarf_getloclist.
3194         * libdw.map: Add dwarf_getloclistent and dwarf_getloclist.
3195         * libdwP.h: Define DWARF_E_NO_LOCLIST.
3196         * Makefile.am (libdw_a_SOURCES): Add dwarf_getloclistent.c and
3197         dwarf_getloclist.c.
3198
3199         * dwarf_error.c: More error messages.
3200
3201 2004-01-06  Ulrich Drepper  <drepper@redhat.com>
3202
3203         * dwarf_getsrclines.c: Remove debugging support.
3204
3205         * dwarf_getsrcfiles.c: New file.
3206         * dwarf_filesrc.c: New file.
3207         * libdw.h: Declare these functions.  Define Dwarf_File.
3208         * libdwP.c: Adjust Dwarf_File_s definition.
3209         * libdw.map: Add these functions.
3210         * Makefile.am (libdw_a_SOURCES): Add dwarf_getsrcfiles.c and
3211         dwarf_filesrc.c.
3212         * dwarf_getsrclines.c: Initialize cu->files.
3213
3214 2004-01-05  Ulrich Drepper  <drepper@redhat.com>
3215
3216         * libdw.h: Add more nonnull function attributes.
3217
3218         * dwarf_begin_elf.c (dwarf_begin_elf): Don't initialize mem_tail->next.
3219         * dwarf_end.c (cu_free): New function.
3220         (dwarf_end): Also free CU tree.  Correct freeing of memory blocks.
3221         * dwarf_error.c (errmsgs): Add new messages.
3222         * dwarf_getsrc_die.c: New file.
3223         * dwarf_getsrclines.c: New file.
3224         * dwarf_lineno.c: New file.
3225         * dwarf_linesrc.c: New file.
3226         * dwarf_nextcu.c (dwarf_nextcu): Use read_*byte_unaligned_inc
3227         instead of the *_inc-less variants.
3228         * libdw.h: Define Dwarf_Line.  Add some function attributes.  Declare
3229         dwarf_getsrclines, dwarf_getsrc_die, dwarf_lineno, and dwarf_linesrc.
3230         * libdw.map: Add dwarf_getsrclines, dwarf_getsrc_die, dwarf_lineno,
3231         and dwarf_linesrc.
3232         * libdwP.h: Add more error codes.
3233         (struct Dwarf): Remove mem_tail.next member.
3234         (Dwarf_File): Define type.
3235         (struct Dwarf_Line_s): Define type.
3236         (struct Dwarf_CU): Add lines and nlines members.
3237         (libdw_alloc): Define local variable _tail and use it.
3238         Add some function attributes.
3239         * libdw_alloc.c (__libdw_allocate): Don't initialize next member.
3240         * libdw_findcu.c (__libdw_findcu): Initialize lines and nlines members.
3241         * memory-access.h: Add unlikely for the endian conversion paths.
3242         * Makefile.am (AM_CFLAGS): Add -std parameter.
3243         (libdw_a_SOURCES): Add dwarf_getsrclines, dwarf_getsrc_die,
3244         dwarf_lineno, and dwarf_linesrc.
3245
3246 2003-08-11  Ulrich Drepper  <drepper@redhat.com>
3247
3248         * Moved to CVS archive.