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