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