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