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