1 2019-11-10 Mark Wielaard <mark@klomp.org>
3 * libdwP.h (libdw_unalloc): New define.
4 (libdw_typed_unalloc): Likewise.
5 (__libdw_thread_tail): New function declaration.
6 * libdw_alloc.c (__libdw_thread_tail): New function.
7 * dwarf_getabbrev.c (__libdw_getabbrev): Call libdw_typed_unalloc
8 when reading invalid data or when hash collission detected.
10 2019-10-28 Jonathon Anderson <jma14@rice.edu>
12 * libdw_alloc.c: Added __libdw_alloc_tail.
13 (__libdw_allocate): Switch to use the mem_tails array.
14 * libdwP.h (Dwarf): Likewise.
15 * dwarf_begin_elf.c (dwarf_begin_elf): Support for above.
16 * dwarf_end.c (dwarf_end): Likewise.
17 * atomics.h: Add support for thread_local.
19 2019-10-28 Mark Wielaard <mark@klomp.org>
21 * dwarf_sig8_hash.h: Include libdw.h. Remove COMPARE. Include
22 dynamicsizehash_concurrent.h.
23 * dwarf_sig8_hash.c: Include dynamicsizehash_concurrent.c.
24 * dwarf_formref_die.c (dwarf_formref_die): Drop NULL argument to
27 2019-08-26 Srđan Milaković <sm108@rice.edu@rice.edu>
29 * dwarf_abbrev_hash.{c,h}: Use the *_concurrent hash table.
31 2019-11-01 Jonathon Anderson <jma14@rice.edu>
33 * dwarf_begin_elf.c (valid_p): Switch calloc for malloc for fake CUs.
34 Add explicit initialization of some fields.
35 * dwarf_end.c (cu_free): Add clause to limit freeing of CU internals.
37 2019-08-26 Jonathon Anderson <jma14@rice.edu>
39 * libdw_alloc.c (__libdw_allocate): Added thread-safe stack allocator.
40 * libdwP.h (Dwarf): Likewise.
41 * dwarf_begin_elf.c (dwarf_begin_elf): Support for above.
42 * dwarf_end.c (dwarf_end): Likewise.
43 * Makefile.am: Use -pthread to provide rwlocks.
45 2019-07-05 Omar Sandoval <osandov@fb.com>
47 * Makefile.am (libdw_so_LIBS): Replace libebl.a with libebl_pic.a.
48 Move libebl_pic.a to the beginning so that libdw symbols are resolved.
49 (libdw_so_LDLIBS): Remove -ldl.
50 (libdw.so): Remove -rpath.
51 (libdw_a_LIBADD): Add libebl, libebl_backends, and libcpu objects.
53 2019-08-25 Jonathon Anderson <jma14@rice.edu>
55 * dwarf_getcfi.c (dwarf_getcfi): Set default_same_value to false.
57 2019-08-12 Mark Wielaard <mark@klomp.org>
59 * libdw.map (ELFUTILS_0.177): Add new version of dwelf_elf_begin.
61 2019-06-28 Mark Wielaard <mark@klomp.org>
63 * libdw.map (ELFUTILS_0.177): New section. Add
64 dwelf_elf_e_machine_string.
66 2019-05-16 Mark Wielaard <mark@klomp.org>
68 * dwarf.h: Add DW_AT_GNU_numerator, DW_AT_GNU_denominator and
71 2019-04-28 Mark Wielaard <mark@klomp.org>
73 * dwarf_siblingof.c (dwarf_siblingof): Don't initialize addr.
75 2019-04-28 Mark Wielaard <mark@klomp.org>
77 * dwarf_getlocation.c (dwarf_getlocation_addr): Call
78 check_constant_offset with llbufs and listlens directly.
80 2019-04-27 Mark Wielaard <mark@klomp.org>
82 * dwarf_getlocation.c (store_implicit_value): Check dbg isn't
85 2019-02-02 Mark Wielaard <mark@klomp.org>
87 * dwarf_nextcu.c (__libdw_next_unit): Define bytes_end.
88 Check there are enough bytes to read extended lenght, version
91 2019-01-20 Mark Wielaard <mark@klomp.org>
93 * dwarf_getsrclines.c (read_srclines): Check terminating NUL byte
94 for dir and file lists.
96 2018-10-23 Mark Wielaard <mark@klomp.org>
98 * dwarf_child.c (__libdw_find_attr): Initialize readp to NULL.
99 * dwarf_getattrs.c (dwarf_getattrs): Initialize die_addr to NULL.
101 2018-10-20 Mark Wielaard <mark@klomp.org>
103 * libdw.map (ELFUTILS_0.175): New section. Add dwelf_elf_begin.
105 2018-10-29 Milian Wolff <milian.wolff@kdab.com>
107 * dwarf_getcfi_elf.c (getcfi_shdr): Check sh_type != SHT_NOBITS.
109 2018-09-13 Mark Wielaard <mark@klomp.org>
111 * dwarf_begin_elf.c (check_section): Drop ehdr argument, add and
112 use shstrndx argument.
113 (global_read): Likewise.
114 (scngrp_read): Likewise.
115 (dwarf_begin_elf): Call elf_getshdrstrndx. Pass shstrndx to
116 global_read or scngrp_read.
118 2018-08-18 Mark Wielaard <mark@klomp.org>
120 * dwarf_getabbrev.c (__libdw_getabbrev): Continue until both name
122 * dwarf_hasattr.c (dwarf_hasattr): Stop when both name and form
125 2018-08-18 Mark Wielaard <mark@klomp.org>
127 * dwarf_getaranges.c (dwarf_getaranges.c): Make sure there is enough
128 data to read the address and segment size.
130 2018-07-04 Ross Burton <ross.burton@intel.com>
132 * libdw_alloc.c: Remove error.h include.
134 2018-06-28 Mark Wielaard <mark@klomp.org>
136 * dwarf_next_cfi.c (dwarf_next_cfi): Check whether length is zero.
138 2018-06-27 Mark Wielaard <mark@klomp.org>
140 * dwarf_begin_elf.c (check_section): Allow a single .debug_frame
143 2018-06-26 Mark Wielaard <mark@klomp.org>
145 * libdw.h (dwarf_getscn_info): Remove.
146 * libdw.map (ELFUTILS_0.122): Remove dwarf_getscn_info.
148 2018-06-25 Mark Wielaard <mark@klomp.org>
150 * Makefile.am (libdw_a_SOURCES): Add dwarf_next_lines.c.
151 * libdw.h (dwarf_next_lines): New function declaration.
152 * libdw.map (ELFUTILS_0.173): New section.
153 * dwarf_next_lines.c: New files.
154 * dwarf_begin_elf.c (check_section): Don't error out when elf
156 (valid_p): Allow just a single .debug_line section.
157 * dwarf_getsrclines.c (read_srclines): Keep files relative if comp_dir
160 2018-06-22 Mark Wielaard <mark@klomp.org>
162 * dwarf_nextcu.c (__libdw_next_unit): Set next_off to -1 when it would
165 2018-06-18 Mark Wielaard <mark@klomp.org>
167 * dwarf_aggregate_size.c (array_size): New depth argument. Use
168 aggregate_size instead of dwarf_aggregate_size and pass depth.
169 (aggregate_size): New depth argument. Check depth isn't bigger
170 than MAX_DEPTH (256). Pass depth to recursive calls.
171 (dwarf_aggregate_size): ass zero as depth to aggregate_size.
173 2018-06-18 Mark Wielaard <mark@klomp.org>
175 * dwarf_peel_type.c (dwarf_peel_type): Limit modifier chain to 64.
177 2018-06-18 Mark Wielaard <mark@klomp.org>
179 * dwarf_aggregate_size.c (aggregate_size): Check die is not NULL.
181 2018-06-17 Luiz Angelo Daros de Luca <luizluca@gmail.com>
183 * dwarf_getsrclines.c (read_srclines): Intialize filelist early.
185 2018-06-15 Mark Wielaard <mark@klomp.org>
187 * dwarf_getlocation.c (check_constant_offset): Clarify DW_FORM_data16
188 isn't really a constant.
189 (dwarf_getlocation): Don't handle DW_FORM_data16 as block.
190 (dwarf_getlocation_addr): Likewise.
191 (dwarf_getlocations): Likewise.
193 2018-06-12 Mark Wielaard <mark@klomp.org>
195 * memory-access.h (read_3ubyte_unaligned_inc): New define.
197 2018-06-12 Mark Wielaard <mark@klomp.org>
199 * libdw.h (__libdw_dieabbrev): Set die->abbrev to DWARF_END_ABBREV
202 2018-06-10 Mark Wielaard <mark@klomp.org>
204 * dwarf_attr_integrate.c (dwarf_attr_integrate): Stop after 16 DIE
206 * dwarf_hasattr_integrate.c (dwarf_hasattr_integrate): Likewise.
208 2018-06-08 Mark Wielaard <mark@klomp.org>
210 * dwarf_getabbrev.c (dwarf_getabbrev): Check die and offset.
212 2018-06-08 Mark Wielaard <mark@klomp.org>
214 * dwarf_get_units.c (dwarf_get_units): Handle existing error, no
217 2018-06-08 Mark Wielaard <mark@klomp.org>
219 * dwarf_getlocation.c (store_implicit_value): Return error when
220 seeing bad DWARF or when tsearch runs out of memory.
221 (__libdw_intern_expression): Report error when store_implicit_value
224 2018-06-08 Mark Wielaard <mark@klomp.org>
226 * dwarf_getsrclines.c (read_srclines): Sanity check ndirs and nfiles.
228 2018-06-08 Mark Wielaard <mark@klomp.org>
230 * dwarf_getlocation_attr.c (addr_valp): Set error and return NULL
231 when there is no .debug_addr section.
232 (dwarf_getlocation_attr): If addr_valp returns NULL, then return -1.
234 2018-06-07 Mark Wielaard <mark@klomp.org>
236 * libdw_findcu.c (__libdw_intern_next_unit): Report DWARF_E_VERSION,
237 not DWARF_E_INVALID_DWARF on unknown version. Set address_size and
238 offset_size to 8 when unknown.
240 2018-06-06 Mark Wielaard <mark@klomp.org>
242 * libdwP.h (__libdw_dieabbrev): Check DIE addr falls in cu.
244 2018-06-06 Mark Wielaard <mark@klomp.org>
246 * dwarf_getlocation_die.c (dwarf_getlocation_die): Check offset
247 falls inside cu data.
249 2018-06-05 Mark Wielaard <mark@klomp.org>
251 * dwarf_getsrclines.c (read_srclines): Explicitly set diridx to -1
252 in case dwarf_formudata fails.
254 2018-06-05 Mark Wielaard <mark@klomp.org>
256 * dwarf_getaranges (dwarf_getaranges): Free new_arange if
257 __libdw_findcu fails.
259 2018-06-05 Mark Wielaard <mark@klomp.org>
261 * dwarf_getsrclines.c (read_srclines): Define dirarray early and
262 check whether or not it is equal to dirstack on exit/out before
265 2018-06-05 Mark Wielaard <mark@klomp.org>
267 * dwarf_getalt.c (find_debug_altlink): id_path array should be 2
268 larger to contain MAX_BUILD_ID_BYTES.
270 2018-05-31 Mark Wielaard <mark@klomp.org>
272 * libdw_find_split_unit.c (try_split_file): New function extracted
274 (__libdw_find_split_unit): ... here. Try both the relative and
275 absolute paths to find a .dwo file.
277 2018-05-30 Mark Wielaard <mark@klomp.org>
279 * libdw/dwarf_getsrclines.c (read_srclines): Change ndir and
280 ndirlist to size_t. Add check to see ndirlist doesn't overflow.
282 2018-05-31 Mark Wielaard <mark@klomp.org>
284 * dwarf_dieoffset.c: Check die->cu != NULL. Return -1, not ~0ul
287 2018-05-29 Mark Wielaard <mark@klomp.org>
289 * dwarf_cuoffset.c (dwarf_cuoffset): Check die->cu is not NULL.
290 * dwarf_die_addr_die.c (dwarf_die_addr_die): Also search split
292 * libdwP.h (struct Dwarf): Add split_tree field.
293 (__libdw_find_split_dbg_addr): New internal function definition.
294 (__libdw_finddbg_cb): Likewise.
295 * libdw_find_split_unit.c (__libdw_find_split_unit): Insert split
296 Dwarf into skeleton dbg split_tree.
297 * libdw_findcu.c (__libdw_finddbg_cb): New function.
298 (__libdw_find_split_dbg_addr): Likewise.
299 * dwarf_end (dwarf_end): Destroy split_tree.
301 2018-05-29 Mark Wielaard <mark@klomp.org>
303 * dwarf.h: Add GNU DebugFission list entry encodings
304 DW_LLE_GNU_end_of_list_entry,
305 DW_LLE_GNU_base_address_selection_entry,
306 DW_LLE_GNU_start_end_entry and DW_LLE_GNU_start_length_entry.
307 * dwarf_ranges.c (__libdw_read_begin_end_pair_inc): Handle
308 GNU DebugFission list entries.
310 2018-05-28 Mark Wielaard <mark@klomp.org>
312 * libdw_find_split_unit.c (__libdw_find_split_unit): End split_dwarf
313 only after we tried every unit id in it.
315 2018-04-07 Mark Wielaard <mark@klomp.org>
317 * libdwP.h (struct Dwarf_CU): Add locs_base.
318 (__libdw_cu_locs_base): New static inline function.
319 * libdw_findcu.c (__libdw_intern_next_unit): Initialize locs_base.
320 * dwarf_begin_elf.c (valid_p): Create fake_loclists_cu if necessary.
321 * dwarf_end.c (dwarf_end): Clean up fake_loclists_cu.
322 * dwarf_getlocation.c (initial_offset): Handle .debug_loclists.
323 (getlocations_addr): Likewise.
324 (dwarf_getlocation_addr): Likewise.
325 * dwarf_getlocation_attr.c (attr_form_cu): Use fake_loclists_cu for
327 (initial_offset): Handle DW_FORM_loclistx.
328 * dwarf_ranges.c (__libdw_read_begin_end_pair_inc): Handle
330 * libdwP.h (struct Dwarf): Add fake_loclists_cu.
332 2018-04-12 Mark Wielaard <mark@klomp.org>
334 * dwarf.h: Add DWARF5 location list entry DW_LLE encodings.
335 * begin_elf.c (dwarf_scnnames): Add IDX_debug_loclists.
336 * dwarf_error.c (errmsgs): Remove DWARF_E_NO_LOCLIST. And replace
337 with DWARF_E_NO_DEBUG_LOC, DWARF_E_NO_DEBUG_LOCLISTS and
338 DWARF_E_NO_LOC_VALUE.
339 * dwarf_formudata.c (dwarf_formudata): Handle DW_AT_loclists_base
340 and DW_FORM_loclistx.
341 * dwarf_getlocation.c (attr_ok): Use DWARF_E_NO_LOC_VALUE.
342 (initial_offset): Use DWARF_E_NO_DEBUG_LOC.
343 * libdwP.h: Add IDX_debug_rnglists. Remove DWARF_E_NO_LOCLIST.
344 Add DWARF_E_NO_DEBUG_LOC, DWARF_E_NO_DEBUG_LOCLISTS and
345 DWARF_E_NO_LOC_VALUE.
347 2018-05-25 Mark Wielaard <mark@klomp.org>
349 * libdw_find_split_unit.c (__libdw_find_split_unit): Extract linking
350 skeleton and split compile units code into...
351 * libdwP (__libdw_link_skel_split): ...this new function.
353 2018-04-06 Mark Wielaard <mark@klomp.org>
355 * dwarf_formaddr.c (__libdw_addrx): New function, extracted from...
356 (dwarf_formaddr): here. Use __libdw_addrx.
357 * dwarf_getlocation.c (getlocations_addr): Pass cu to
358 __libdw_read_begin_end_pair_inc.
359 * dwarf_ranges.c (__libdw_read_begin_end_pair_inc): Take cu as
360 argument. Handle .debug_rnglists.
361 (initial_offset): Handle .debug_rnglists and DW_FORM_rnglistx.
362 (dwarf_ranges): Likewise. Check cu isn't NULL before use. Pass cu to
363 __libdw_read_begin_end_pair_inc.
364 * libdwP.h (__libdw_read_begin_end_pair_inc): Take cu as argument.
365 (__libdw_cu_ranges_base): Handle DW_AT_rnglists_base.
366 (__libdw_addrx): New function definition.
368 2018-04-11 Mark Wielaard <mark@klomp.org>
370 * dwarf.h: Add DWARF5 range list entry DW_RLE encodings.
371 * begin_elf.c (dwarf_scnnames): Add IDX_debug_rnglists.
372 * dwarf_error.c (errmsgs): Add DWARF_E_NO_DEBUG_RNGLISTS.
373 * dwarf_formudata.c (dwarf_formudata): Handle DW_AT_rnglists_base
374 and DW_FORM_rnglistx.
375 * dwarf_getscopes.c (pc_match): Also check for
376 DWARF_E_NO_DEBUG_RNGLISTS.
377 * libdwP.h: Add IDX_debug_rnglists.
379 2018-05-25 Mark Wielaard <mark@klomp.org>
381 * dwarf_getlocation_attr.c (__libdw_cu_addr_base): Cast offset to
382 uintptr_t before returning as pointer.
384 2018-05-22 Mark Wielaard <mark@klomp.org>
386 * dwarf_getlocation.c (__libdw_cu_base_address): Treat errors of
387 getting lowpc or entrypc the same as missing base address (zero).
388 * dwarf_highpc (dwarf_highpc): Handle any address form. Always set
389 error when attribute could not be found.
391 2018-05-21 Mark Wielaard <mark@klomp.org>
393 * dwarf_begin_elf.c (valid_p): Add a fake_addr_cu to the result.
394 * dwarf_end.c (cu_free): Disconnect the fake_addr_cu from the split
395 dwarf if shared with skeleton.
396 (dwarf_end): release fake_addr_cu.
397 * dwarf_formaddr.c (__libdw_cu_addr_base): Move to...
398 * libdwP.h (__libdw_cu_addr_base): ... here.
399 (struct Dwarf): Add fake_addr_cu field.
400 * dwarf_formudata.c (dwarf_formudata): Handle
401 DW_FORM_GNU_addr_index and DW_FORM_addrx[1234].
402 * dwarf_getlocation_attr.c (addr_valp): New static function.
403 (dwarf_getlocation_attr): Create attribute for values of
404 DW_OP_GNU_const_index, DW_OP_constx and DW_OP_GNU_addr_index and
406 * libdw_find_split_unit.c (__libdw_find_split_unit): Connect
407 IDX_debug_addr sectiondata and fake_addr_cu between split and
410 2018-05-20 Mark Wielaard <mark@klomp.org>
412 * dwarf_cu_info.c: New file.
413 * Makefile.am (libdw_a_SOURCES): Add dwarf_cu_info.c.
414 * libdw.h (dwarf_cu_info): New function declaration.
415 * libdw.map (ELFUTILS_0.171): Add dwarf_cu_info.
417 2018-05-24 Mark Wielaard <mark@klomp.org>
419 * dwarf_ranges.c (dwarf_ranges): Check for NULL cu.
420 * libdw_findcu.c (__libdw_intern_next_unit): Initialize ranges_base.
422 2018-05-18 Mark Wielaard <mark@klomp.org>
424 * dwarf_formudata.c (__libdw_formptr): Handle the special case
425 of IDX_debug_ranges for DW_UT_split_compile with version < 5.
426 * dwarf_highpc.c (dwarf_highpc): Use dwarf_lowpc, check for
428 * dwarf_lowpc.c (dwarf_lowpc): Check for split compile cudie.
429 * dwarf_ranges.c (dwarf_ranges): Switch cu and sectiondata for
431 * libdwP.h (struct Dwarf_CU): Add ranges_base field.
432 (__libdw_cu_ranges_base): New static inline function.
434 2018-05-18 Mark Wielaard <mark@klomp.org>
436 * libdw_findcu.c (__libdw_intern_next_unit): Init files to NULL.
437 * dwarf_getsrclines.c (dwarf_getsrclines): Handle split units by
438 taking the line table from the skeleton.
439 * dwarf_getsrcfiles.c (dwarf_getsrcfiles): Handle split units by
440 only taking the files from .debug_line offset zero (if it exists),
441 otherwise fall back to the skeleton.
443 2018-05-17 Mark Wielaard <mark@klomp.org>
445 * dwarf_begin_elf.c (__libdw_debugdir): New function.
446 (valid_p): Call __libdw_debugdir.
447 * dwarf_end.c (dwarf_end.c): Free debugdir.
448 * dwarf_getalt.c (__libdw_filepath): Extract __libdw_debugdir logic.
449 take debugdir as argument instead of fd.
450 (find_debug_altlink): Call __libdw_filepath with debugdir.
451 * libdwP.h (struct Dwarf): Add debugdir field.
452 (__libdw_debugdir): New function prototype.
453 (__libdw_filepath): Adjust prototype to take a const char * instead of
455 * libdw_find_split_unit.c (__libdw_find_split_unit): Call
456 __libdw_filepath with debugdir.
458 2018-05-17 Mark Wielaard <mark@klomp.org>
460 * dwarf_attr_integrate.c (dwarf_attr_integrate): Handle split_compile
461 unit DIE, search skeleton_compile unit DIE.
462 * dwarf_hasattr_integrate.c (dwarf_hasattr_integrate): Likewise.
463 * libdwP.h (is_cudie): Check cu is not NULL.
465 2018-05-19 Mark Wielaard <mark@klomp.org>
467 * libdwP.h (__libdw_find_split_unit): Mark as internal_function.
469 2018-05-15 Mark Wielaard <mark@klomp.org>
471 * Makefile.am (libdw_a_SOURCES): Add libdw_find_split_unit.c.
472 * dwarf_end.c (cu_free): Free split Dwarf.
473 * dwarf_get_units.c (dwarf_get_units): Handle DW_UT_skeleton by
474 calling __libdw_find_split_unit.
475 * libdwP.h (struct Dwarf_CU): Add split Dwarf_CU field.
476 (__libdw_find_split_unit): New function prototype.
477 (str_offsets_base_off): Use cu Dwarf if dbg is NULL.
478 (filepath): Rename to ...
479 (__libdw_filepath): This. Which is the actual function name in
481 (libdw_find_split_unit.c): New file.
482 * libdw_findcu.c (__libdw_intern_next_unit): Initialize split to -1.
484 2018-05-15 Mark Wielaard <mark@klomp.org>
486 * libdwP.h (__libdw_first_die_from_cu_start): Adjust commented out
488 * libdw_findcu.c (__libdw_intern_next_unit): For version 4 DWARF if
489 the cudie has a DW_AT_GNU_dwi_id set the unit_id8 and unit_type to
490 DW_UT_skeleton or DW_UT_split_compile based on whether the cudie has
491 child DIEs and a DW_AT_GNU_dwo_name attribute.
493 2018-05-14 Mark Wielaard <mark@klomp.org>
495 * dwarf.h: Add GNU Debug Fission extensions. DW_AT_GNU_dwo_name,
496 DW_AT_GNU_dwo_id, DW_AT_GNU_ranges_base, DW_AT_GNU_addr_base,
497 DW_AT_GNU_pubnames, DW_AT_GNU_pubtypes. DW_FORM_GNU_addr_index,
498 DW_FORM_GNU_str_index. DW_OP_GNU_addr_index, DW_OP_GNU_const_index.
499 * dwarf_formaddr.c (dwarf_formaddr): Handle DW_FORM_GNU_addr_index
501 (__libdw_cu_addr_base): Check for both DW_AT_GNU_addr_base and
503 * dwarf_formstring.c (dwarf_formstring): Handle DW_FORM_GNU_str_index
505 * dwarf_formudata.c (dwarf_formudata): Recognize DW_AT_GNU_addr_base
506 as addrptr. Recognize DW_AT_GNU_ranges_base as rangelistptr.
507 * dwarf_getlocation.c (__libdw_intern_expression): Handle
508 DW_OP_GNU_addr_index as DW_OP_addrx and DW_OP_GNU_const_index as
510 * libdw_form.c (__libdw_form_val_compute_len): Handle
511 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index taking an uleb128.
513 2018-05-12 Mark Wielaard <mark@klomp.org>
515 * dwarf_begin_elf.c (check_section): Also recognize .dwo section
518 2018-05-11 Mark Wielaard <mark@klomp.org>
520 * dwarf_formudata.c (dwarf_formudata): Handle DW_AT_macros as macptr.
521 * dwarf_getmacros.c (get_table_for_offset): Add DW_MACRO_define_sup,
522 DW_MACRO_undef_sup, DW_MACRO_import_sup, DW_MACRO_define_strx and
523 DW_MACRO_undef_strx. Add str_offsets_base_off to fake CU. Deal with
524 DW_AT_macros. Use libdw_valid_user_form.
526 2018-05-09 Mark Wielaard <mark@klomp.org>
528 * dwarf_formstring.c (__libdw_cu_str_off_base): Moved to...
529 * libdwP.h (__libdw_cu_str_off_base): ...here. Make static inline.
530 (str_offsets_base_off): New internal function that also parses
531 .debug_str_offsets header if necessary.
533 2018-05-11 Mark Wielaard <mark@klomp.org>
535 * dwarf_siblingof.c (dwarf_siblingof): Don't reference cu till it is
536 known the Dwarf_Die is came from is valid.
537 * libdwP.h (__libdw_dieabbrev): Check cu is not NULL.
539 2018-05-08 Mark Wielaard <mark@klomp.org>
541 * dwarf_formref.c (__libdw_formref): Explicitly don't handle
542 DW_FORM_ref_sup4 and DW_FORM_ref_sup8.
543 * dwarf_formref_die.c (dwarf_formref_die): Handle DW_FORM_ref_sup4
544 and DW_FORM_ref_sup8.
545 * dwarf_formstring.c (dwarf_formstring): Handle DW_FORM_strp_sup
546 as DW_FORM_GNU_strp_alt.
548 2018-05-05 Mark Wielaard <mark@klomp.org>
550 * dwarf.h: Add DWARF line content descriptions.
551 * libdwP.h (libdw_valid_user_form): New static function.
552 * dwarf_getsrclines.c (read_srclines): Check and parse version 5
553 DWARF header, dir and file tables separately from older versions
556 2018-04-24 Mark Wielaard <mark@klomp.org>
558 * dwarf_begin_elf.c (dwarf_scnnames): Add ".debug_line_str".
559 * dwarf_error.c (errmsgs): Add DWARF_E_NO_DEBUG_STR and
560 DWARF_E_NO_DEBUG_LINE_STR.
561 * dwarf_formstring.c (dwarf_formstring): Handle DW_FORM_line_strp.
562 Get data from either .debug_str or .debug_line_str.
563 * libdwP.h: Add IDX_debug_line_str, DWARF_E_NO_DEBUG_STR and
564 DWARF_E_NO_DEBUG_LINE_STR.
566 2018-04-03 Mark Wielaard <mark@klomp.org>
568 * dwarf_formudata.c (__libdw_formptr): Take and return const
569 unsigned char pointers.
570 * dwarf_getlocation.c (attr_base_address): Rename to...
571 (__libdw_cu_base_address): this. Take Dwarf_CU, check and set
573 (initial_offset_base): Renamed to...
574 (initial_offset): this. Only provide offset.
575 (getlocations_addr): Move data size check and
576 address base addition into __libdw_read_begin_end_pair_inc. Use
577 __libdw_cu_base_address and initial_offset. Drop Elf_Data NULL
578 check (already done by initial_offset, through __libdw_formptr).
579 (dwarf_getlocations): Use __libdw_cu_base_address and initial_offset.
580 Drop Elf_Data NULL check.
581 * dwarf_ranges.c (__libdw_read_begin_end_pair_inc): Change argument
582 type of readp to Add readend argument. Check data size. Include base
583 in begin and end result.
584 (initial_offset): New static function.
585 (dwarf_ranges): Don't check Elf_Data being NULL (already done by
586 initial_offset, through __libdw_formptr). Use __libdw_cu_base_address
587 and initial_offset. Remove base check and addition (already done by
588 __libdw_read_begin_end_pair_inc.
589 * libdwP.h (Dwarf_CU): Add base_address field.
590 (__libdw_read_begin_end_pair_inc): Change argument type of readp to
591 const. Add readend argument.
592 (__libdw_formptr): Take and return const unsigned char pointers.
593 * libdw_findcu.c (__libdw_intern_next_unit): Initialize Dwarf_CU
596 2018-04-04 Mark Wielaard <mark@klomp.org>
598 * libdw_findcu.c (__libdw_intern_next_unit): Initialize Dwarf_CU
599 addr_base and str_off_base.
601 2018-03-23 Mark Wielaard <mark@klomp.org>
603 * dwarf_begin_elf.c (dwarf_scnnames): Add IDX_debug_str_offsets,
605 * dwarf_error.c (errmsgs): Add DWARF_E_NO_STR_OFFSETS.
606 * dwarf_formstring.c (dwarf_formstring): Handle DW_FORM_strx[1234].
607 (__libdw_cu_str_off_base): New function.
608 * dwarf_formudata.c (dwarf_formudata): Handle IDX_debug_str_offsets
610 * libdwP.h: Add IDX_debug_str_offsets and DWARF_E_NO_STR_OFFSETS.
611 (struct Dwarf_CU): Add str_off_base field.
612 (__libdw_cu_str_off_base): New function declaration.
614 2018-03-22 Mark Wielaard <mark@klomp.org>
616 * dwarf_begin_elf.c (dwarf_scnnames): Add IDX_debug_addr.
617 * dwarf_error.c (errmsgs): Add DWARF_E_NO_DEBUG_ADDR.
618 * dwarf_formaddr.c (dwarf_formaddr): Handle DW_FORM_addrx[1234].
619 (__libdw_cu_addr_base): New function.
620 * dwarf_formudata.c (dwarf_formudata): Handle DW_AT_addr_base as
622 * libdwP.h: Add IDX_debug_addr and DWARF_E_NO_DEBUG_ADDR.
623 (struct Dwarf_CU): Add addr_base field.
624 (__libdw_cu_addr_base): New function definition.
625 * memory-access.h (file_byte_order): New static function.
626 (read_3ubyte_unaligned): New inline function.
628 2018-03-29 Mark Wielaard <mark@klomp.org>
630 * libdw.h (dwarf_decl_file): Extend documentation.
631 (dwarf_linesrc): Likewise.
632 (dwarf_filesrc): Likewise.
634 2018-03-06 Mark Wielaard <mark@klomp.org>
636 * dwarf.h: Add DW_OP_implicit_pointer, DW_OP_addrx, DW_OP_constx,
637 DW_OP_entry_value, DW_OP_const_type, DW_OP_regval_type,
638 DW_OP_deref_type, DW_OP_xderef_type, DW_OP_convert and
640 * dwarf_getlocation.c (__libdw_intern_expression): Handle
641 DW_OP_convert, DW_OP_reinterpret, DW_OP_addrx, DW_OP_constx,
642 DW_OP_regval_type, DW_OP_entry_value, DW_OP_implicit_pointer,
643 DW_OP_deref_type, DW_OP_xderef_type and DW_OP_const_type.
644 * dwarf_getlocation_attr.c (dwarf_getlocation_attr): Handle
645 DW_OP_entry_value, DW_OP_const_type and DW_OP_implicit_pointer.
646 * dwarf_getlocation_die.c (dwarf_getlocation_die): Handle
647 DW_OP_implicit_pointer, DW_OP_convert, DW_OP_reinterpret,
648 DW_OP_const_type, DW_OP_regval_type, DW_OP_deref_type and
650 * dwarf_getlocation_implicit_pointer.c
651 (dwarf_getlocation_implicit_pointer): Handle DW_OP_implicit_pointer.
653 2018-03-01 Mark Wielaard <mark@klomp.org>
655 * dwarf.h: Add DW_AT_GNU_locviews and DW_AT_GNU_entry_view.
656 * dwarf_formudata.c (dwarf_formudata): Handle DW_AT_GNU_locviews
659 2018-02-09 Mark Wielaard <mark@klomp.org>
661 * dwarf_formblock.c (dwarf_formblock): Handle DW_FORM_data16 as a
664 2018-02-09 Mark Wielaard <mark@klomp.org>
666 * dwarf_child.c (__libdw_find_attr): Handle DW_FORM_implicit_const.
667 * dwarf_formsdata.c (dwarf_formsdata): Likewise.
668 * dwarf_formudata.c (dwarf_formudata): Likewise.
669 * dwarf_getabbrev.c (__libdw_getabbrev): Likewise.
670 * dwarf_getattrs.c (dwarf_getattrs): Likewise.
671 * dwarf_hasattr.c (dwarf_hasattr): Likewise.
672 * dwarf_getabbrevattr.c (dwarf_getabbrevattr_data): New function
673 that will also return any data associated with the abbrev. Which
674 currently is only for DW_FORM_implicit_const. Based on...
675 (dwarf_getabbrevattr): ... this function. Which now just calls
676 dwarf_getabbrevattr_data.
677 * libdw.h (dwarf_getabbrevattr_data): Declare new function.
678 * libdw.map (ELFUTILS_0.170): Add dwarf_getabbrevattr_data.
679 * libdwP.h (dwarf_getabbrevattr_data): INTDECL.
680 * memory-access.h (__libdw_get_sleb128_unchecked): New inlined
681 function based on __libdw_get_uleb128_unchecked.
683 2018-02-08 Mark Wielaard <mark@klomp.org>
685 * dwarf.h: Add DWARF5 DW_FORMs.
686 * libdwP.h (__libdw_form_val_compute_len): Handle fix length
687 DW_FORM_implicit_const, DW_FORM_addrx[1234], DW_FORM_strx[1234],
688 DW_FORM_ref_sup[48] and DW_FORM_data16.
689 * libdw_form.c (__libdw_form_val_compute_len): DW_FORM_strp_sup
690 and DW_FORM_line_strp are offset_size. DW_FORM_addrx, DW_FORM_strx,
691 DW_FORM_loclistx and DW_FORM_rnglistx are uleb128.
693 2018-01-30 Mark Wielaard <mark@klomp.org>
695 * Makefile.am (libdw_a_SOURCES): Add dwarf_get_units.c.
696 * dwarf_get_units.c: New file.
697 * libdw.h (dwarf_get_units): New function declaration.
698 * libdw.map (ELFUTILS_0.170): Add dwarf_get_units.
700 2018-01-29 Mark Wielaard <mark@klomp.org>
702 * dwarf.h (DW_UT_*): Add DWARF Unit Header Types.
703 * dwarf_cu_die.c (dwarf_cu_die): Rename arguments. type_signaturep
704 is now called unit_idp. type_offsetp is now called subdie_offsetp.
705 * dwarf_formref_die.c (dwarf_formref_die): Scan both .debug_info
706 and .debug_types sections for type units when type signature ref
708 * dwarf_getaranges.c (dwarf_getaranges): Use __libdw_findcu and
709 __libdw_first_die_off_from_cu instead of trying by hand.
710 * dwarf_getlocation_die.c (dwarf_getlocation_die): Use ISV4TU
711 instead of checking type_offset by hand.
712 * dwarf_getlocation_implicit_pointer.c
713 (dwarf_getlocation_implicit_pointer): Likewise.
714 * dwarf_nextcu.c (dwarf_next_unit): Call __libdw_next_unit.
715 (__libdw_next_unit): New function based on dwarf_next_unit with
716 DWARF5 header support.
717 * libdwP.h (struct Dwarf_CU): Renamed type_offset to subdie_offset
718 and type_sig8 to unit_id8.
719 (ISV4TU): New macro to determine whether a CU is a version 4 type
720 unit (which comes from the .debug_types section).
721 (DIE_OFFSET_FROM_CU_OFFSET): Replaced macro by real function...
722 (__libdw_first_die_from_cu_start): ... that also handles DWARF5
724 (__libdw_first_die_off_from_cu): New function that calls the above
726 (CUDIE): Use __libdw_first_die_off_from_cu.
727 (SUBDIE): New macro that provides the DIE for a CU using the
729 (__libdw_next_unit): New internal function declaration.
730 * libdw_findcu.c (__libdw_intern_next_unit): Use __libdw_next_unit.
731 Accept DWARF version 5 headers. Setup unit_type.
732 (__libdw_findcu): Rename debug_types argument to v4_debug_types
733 argument (to indicate that we are looking in the .debug_types
734 section). Support finding the exact offset (unit header start).
736 2018-01-25 Mark Wielaard <mark@klomp.org>
738 * Makefile.am (libdw_a_SOURCES): Add dwarf_die_addr_die.c.
739 * dwarf_die_addr_die.c: New file.
740 * libdw.h (dwarf_die_addr_die): New function declaration.
741 * libdw.map (ELFUTILS_0.171): New section with dwarf_die_addr_die.
742 * libdwP.h (__libdw_findcu_addr): New internal function declaration.
743 * libdw_findcu.c (__libdw_findcu_addr): New internal function.
745 2018-02-09 Joshua Watt <JPEWhacker@gmail.com>
747 * cfi.c (execute_cfi): Use FALLTHROUGH macro instead of comment.
748 * dwarf_frame_register.c (dwarf_frame_register): Likewise.
750 2018-01-22 Mark Wielaard <mark@klomp.org>
752 * Makefile.am (AM_CPPFLAGS): Add -I libdwelf.
753 * dwarf_begin_elf.c (dwarf_begin_elf): Initialize Dwarf alt_fd to -1.
754 * dwarf_end.c (dwarf_end): Call dwarf_end and close on the alt_dwarf
755 and alt_fd if we allocated them.
756 * dwarf_fromref_die.c (dwarf_formref_die): Call dwarf_getalt.
757 * dwarf_formstring.c (dwarf_formstring): Likewise.
758 * dwarf_getalt.c (__libdw_filepath): New internal function.
759 (find_debug_altlink): New static function.
760 (dwarf_getalt): Check Dwarf alt_dwarf and call find_debug_altlink.
762 * dwarf_setalt.c (dwarf_setalt): Clean up Dwarf alt_dwarf and alt_fd
764 * libdw.h (dwarf_getalt): Extend documentation.
765 (dwarf_setalt): Likewise.
766 * libdwP.h (struct Dwarf): Add alt_fd field.
767 (filepath): Declare new internal function.
769 2018-01-14 Petr Machata <pmachata@gmail.com>
771 * dwarf_formsdata.c (dwarf_formsdata):
772 <DW_FORM_data1>: Cast to signed char.
773 <DW_FORM_data2,4,8>: Use read_*sbyte_unaligned instead of
774 read_*ubyte_unaligned.
776 2017-12-26 Mark Wielaard <mark@klomp.org>
778 * libdwP.h (struct Dwarf_Abbrev): Pack struct. Remove attrcnt,
779 use bitfields for has_children and code.
780 * dwarf_getabbrev.c (__libdw_getabbrev): Don't count attrs.
781 * dwarf_getattrcnt.c (dwarf_getattrcnt): Count attrs.
783 2017-12-26 Mark Wielaard <mark@klomp.org>
785 * memory-access.h (__libdw_get_uleb128_unchecked): New function.
786 (get_uleb128_unchecked): New define.
787 * dwarf_child.c (__libdw_find_attr): Use get_uleb128_unchecked to
788 read attr name and form.
789 * dwarf_getabbrevattr.c (dwarf_getabbrevattr): Likewise.
790 * dwarf_getattrs.c (dwarf_getattrs): Likewise.
791 * dwarf_hasattr.c (dwarf_hasattr): Likewise.
793 2017-12-28 Mark Wielaard <mark@klomp.org>
795 * dwarf_offdie.c (__libdw_offdie): Check sectiondata exists.
797 2017-05-09 Ulf Hermann <ulf.hermann@qt.io>
798 Mark Wielaard <mark@klomp.org>
800 * libdwP.h (__libdw_in_section): Fix check for the upper border of
802 (__libdw_offset_in_section): Likewise.
804 2017-12-20 Mark Wielaard <mark@klomp.org>
806 * libdwP.h (struct Dwarf_CU): Add sec_idx field.
807 (cu_sec_idx): Return cu->sec_idx.
808 * libdw_findcu.c (__libdw_intern_next_unit): Set cu sec_idx to
809 IDX_debug_info or IDX_debug_types.
810 * dwarf_begin_elf.c (valid_p): Set fake_loc_cu->sec_idx to
812 * dwarf_getmacros.c (read_macros): Set fake_cu->sec_idx to
813 IDX_debug_macro or IDX_debug_macinfo.
815 2017-12-12 Mark Wielaard <mark@klomp.org>
817 * dwarf_aggregate_size.c (dwarf_aggregate_size): Don't peel the
818 given DIE. Reserve memory for a new DIE first.
820 2017-12-11 Dima Kogan <dima@secretsauce.net>
822 * dwarf_aggregate_size.c (array_size): Handle multi-dimensional
825 2017-11-03 Mark Wielaard <mark@klomp.org>
827 * dwarf_getlocation.c (__libdw_intern_expression): Handle
828 DW_OP_GNU_variable_value.
829 * dwarf_getlocation_attr.c (dwarf_getlocation_attr): Likewise.
830 * dwarf_getlocation_die.c (dwarf_getlocation_die): Likewise.
832 2017-11-03 Mark Wielaard <mark@klomp.org>
834 * dwarf_getlocation.c (attr_ok): Always accept DW_FORM_exprloc.
835 Update list of acceptable attribute codes based on DWARF5.
837 2017-11-03 Mark Wielaard <mark@klomp.org>
839 * dwarf.h: Add DW_OP_GNU_variable_value.
841 2017-10-03 Mark Wielaard <mark@klomp.org>
843 * libdw.h: Define LIBDW_CIE_ID and use it in dwarf_cfi_cie_p.
845 2017-08-18 Ulf Hermann <ulf.hermann@qt.io>
847 * memory-access.h: Use attribute_packed.
849 2017-02-27 Ulf Hermann <ulf.hermann@qt.io>
851 * libdwP.h: Use attribute_hidden.
852 * libdw_alloc.c: Likewise.
854 2017-02-27 Ulf Hermann <ulf.hermann@qt.io>
856 * Makefile.am: Use fpic_CFLAGS and dso_LDFLAGS.
858 2017-07-26 Mark Wielaard <mark@klomp.org>
860 * dwarf.h: Add DW_MACRO_* and compat defines for DW_MACRO_GNU_*.
861 * dwarf_getmacros.c (get_table_for_offset): Accept either version
862 4 or 5. Use DW_MACRO names instead of DW_MACRO_GNU names.
863 (read_macros): Use table version for fake_cu.
865 2017-07-26 Mark Wielaard <mark@klomp.org>
867 * dwarf_peel_type.c (dwarf_peel_type): Handle DW_TAG_immutable_type,
868 DW_TAG_packed_type and DW_TAG_shared_type.
869 * libdw.h (dwarf_peel_type): Extend documentation.
871 2017-07-26 Mark Wielaard <mark@klomp.org>
873 * dwarf.h: Add DW_DEFAULTED_no, DW_DEFAULTED_in_class and
874 DW_DEFAULTED_out_of_class.
876 2017-07-26 Mark Wielaard <mark@klomp.org>
878 * dwarf.h: Add DW_CC_pass_by_reference and DW_CC_pass_by_reference.
880 2017-07-26 Mark Wielaard <mark@klomp.org>
882 * dwarf_default_lower_bound.c: New file.
883 * Makefile.am (libdw_a_SOURCES): Add dwarf_default_lower_bound.c.
884 * dwarf_aggregate_size.c (array_size): Use dwarf_default_lower_bound.
885 * dwarf_error.c (errmsgs): Add DWARF_E_UNKNOWN_LANGUAGE.
886 * libdw.h: Add dwarf_default_lower_bound.
887 * libdw.map (ELFUTILS_0.170): Add dwarf_default_lower_bound.
888 * libdwP.h: Add DWARF_E_UNKNOWN_LANGUAGE and
889 dwarf_default_lower_bound INTDECL.
891 2017-07-26 Mark Wielaard <mark@klomp.org>
893 * dwarf.h: Add DW_LANG_OpenCL, DW_LANG_Modula3,
894 DW_LANG_C_plus_plus_03, DW_LANG_OCaml, DW_LANG_Rust, DW_LANG_Swift,
895 DW_LANG_Julia, DW_LANG_Dylan, DW_LANG_RenderScript, DW_LANG_BLISS.
896 * dwarf_aggregate_size.c (array_size): Add lower bound for
897 DW_LANG_C_plus_plus_03, DW_LANG_Python, DW_LANG_OpenCL,
898 DW_LANG_Haskell, DW_LANG_OCaml, DW_LANG_Rust, DW_LANG_Swift,
899 DW_LANG_Dylan, DW_LANG_RenderScript, DW_LANG_Modula3,
900 DW_LANG_Julia and DW_LANG_BLISS.
902 2017-07-26 Mark Wielaard <mark@klomp.org>
904 * dwarf.h: Add DW_ATE_UCS and DW_ATE_ASCII.
906 2017-07-25 Mark Wielaard <mark@klomp.org>
908 * dwarf.h: Add DW_TAG_coarray_type, DW_TAG_generic_subrange,
909 DW_TAG_dynamic_type, DW_TAG_call_site, DW_TAG_call_site_parameter,
910 DW_TAG_skeleton_unit, DW_TAG_immutable_type. Add reserved comments
911 for currently unused numbers.
913 2017-07-25 Mark Wielaard <mark@klomp.org>
915 * dwarf.h (DWARF attributes enum): Remove DW_AT_subscr_data,
916 DW_AT_element_list and DW_AT_member. Add DWARF5 attribute constants.
917 (DW_AT_subscr_data, DW_AT_element_list, DW_AT_member): New defines.
919 2017-07-21 Mark Wielaard <mark@klomp.org>
921 * dwarf_line_file.c: New file.
922 * Makefile.am (libdw_a_SOURCES): Add dwarf_line_file.c.
923 * libdw.h (dwarf_line_file): New function declaration.
924 * libdw.map (ELFUTILS_0.170): New. Add dwarf_line_file.
926 2017-02-17 Ulf Hermann <ulf.hermann@qt.io>
928 * Makefile.am: Add libdw_so_LIBS to specify the archives libdw is is
929 made of, libdw_so_DEPS for libraries it depends on (including
930 libeu.a), libdw_so_LDLIBS to specify libraries libdw links against.
931 (libdw.so$(EXEEXT)): Add $(libdw_so_LDLIBS), remove enumeration of
932 library dependencies, use libdw_so_LIBS rather than relying on the
933 order of dependencies specified, add -z,relro.
935 2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
937 * libdw.h: Remove attribute macro declarations and use
938 __noreturn_attribute__ as defined in libelf.h.
940 2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
942 * dwarf_begin_elf.c: Include endian.h.
944 2017-03-30 Mark Wielaard <mjw@redhat.com>
946 * dwarf_peel_type.c (dwarf_peel_type): Call dwarf_attr_integrate on
949 2016-10-22 Mark Wielaard <mjw@redhat.com>
951 * dwarf.h: Correct spelling of DW_LANG_PLI. Add compatibility define.
952 * dwarf_aggregate_size.c (array_size): Use correct spelling of
955 2016-11-02 Mark Wielaard <mjw@redhat.com>
957 * cfi.c (execute_cfi): Add fallthrough comments.
958 * encoded-value.h (encoded_value_size): Add explicit return instead
959 of relying on fallthrough.
960 * dwfl_report_elf.c (__libdwfl_elf_address_range): Add fallthrough
963 2016-10-11 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
965 * dwarf_getpubnames.c: Remove sys/param.h include, add system.h.
966 * libdw_alloc.c: Likewise.
968 2016-07-08 Mark Wielaard <mjw@redhat.com>
970 * libdw.map (ELFUTILS_0.167): New. Add dwelf_strtab_init,
971 dwelf_strtab_add, dwelf_strtab_add_len, dwelf_strtab_finalize,
972 dwelf_strent_off, dwelf_strent_str and dwelf_strtab_free.
974 2016-02-13 Mark Wielaard <mjw@redhat.com>
976 * dwarf_getsrclines.c (read_srclines): Calculate ndirs first, then
979 2015-12-18 Mark Wielaard <mjw@redhat.com>
981 * libdwP.h (struct Dwarf): Remove sectiondata_gzip_mask.
982 (__libdw_free_zdata): Remove.
983 * dwarf_begin_elf.c (inflate_section): Remove.
984 (check_section): Remove __libdw_free_zdata calls. Use elf_compress
985 and elf_compress_gnu to decompress if necessary.
986 (valid_p): Remove __libdw_free_zdata calls.
987 (scngrp_read): Use elf_compress if section is compressed. Remove
988 __libdw_free_zdata calls.
989 * dwarf_end.c (__libdw_free_zdata): Remove.
990 (dwarf_end): Don't call __libdw_free_zdata.
992 2015-10-28 Mark Wielaard <mjw@redhat.com>
994 * libdw.map (ELFUTILS_0.165): New. Add dwelf_scn_gnu_compressed_size.
996 2015-12-02 Mark Wielaard <mjw@redhat.com>
998 * fde.c (intern_fde): Don't leak duplicate FDEs.
1000 2015-12-01 Mark Wielaard <mjw@redhat.com>
1002 * fde.c (intern_fde): Don't intern an fde that doesn't cover a
1005 2015-12-01 Mark Wielaard <mjw@redhat.com>
1007 * dwarf_end.c (dwarf_end): Call cu_free on fake_loc_cu if it exists.
1009 2015-10-14 Chih-Hung Hsieh <chh@google.com>
1011 * dwarf_entry_breakpoints.c (dwarf_entry_breakpoints): Move recursive
1012 functions 'add_bkpt', 'entrypc_bkpt', and 'search_range' to file scope.
1014 2015-10-14 Chih-Hung Hsieh <chh@google.com>
1016 * libdw_visit_scopes.c (__libdw_visit_scopes): Move recursive nested
1017 function 'walk_children' to file scope; inline 'recurse' at its call
1020 2015-10-19 Mark Wielaard <mjw@redhat.com>
1022 * frame-cache.c (__libdw_destroy_frame_cache): Call ebl_closebackend
1025 2015-10-16 Dmitry V. Levin <ldv@altlinux.org>
1027 * dwarf_getsrclines.c (read_srclines): Initialize state early.
1029 2015-10-13 Chih-Hung Hsieh <chh@google.com>
1031 * dwarf_getsrclines.c (read_srclines): Move nested functions
1032 'advance_pc' and 'add_new_line' to file scope and keep many
1033 local state variables within one structure.
1035 2015-10-13 Chih-Hung Hsieh <chh@google.com>
1037 * dwarf_getscopevar.c (dwarf_getscopevar): Move nested
1038 function 'file_matches' to file scope.
1040 2015-10-16 Mark Wielaard <mjw@redhat.com>
1042 * Makefile.am (libdw.so): Add -lz.
1044 2015-10-14 Chih-Hung Hsieh <chh@google.com>
1046 * cfi.c (execute_cfi): Move nested functions 'enough_registers'
1047 and 'require_cfa_offset' to file scope.
1049 2015-10-09 Josh Stone <jistone@redhat.com>
1051 * dwarf_begin.c (dwarf_begin): Replace stat64 and fstat64 with stat
1054 2015-10-05 Josh Stone <jistone@redhat.com>
1056 * Makefile.am (libdw.so): Add AM_V_CCLD and AM_V_at silencers.
1058 2015-09-24 Jose E. Marchesi <jose.marchesi@oracle.com>
1060 * Makefile.am (AM_CFLAGS): Use -fPIC instead of -fpic to avoid
1061 relocation overflows in some platforms.
1063 2015-09-23 Mark Wielaard <mjw@redhat.com>
1065 * dwarf_error.c (__libdw_seterrno): Mark as internal_function.
1066 * dwarf_formref.c (__libdw_formref): Likewise.
1067 * libdw_findcu.c (__libdw_findcu): Likewise.
1068 * libdw_visit_scopes.c (__libdw_visit_scopes): Likewise.
1070 2015-09-22 Mark Wielaard <mjw@redhat.com>
1072 * *.c: Remove old-style function definitions.
1074 2015-09-15 Mark Wielaard <mjw@redhat.com>
1076 * dwarf_peel_type.c (dwarf_peel_type): Don't reassign result pointer.
1078 2015-09-09 Chih-Hung Hsieh <chh@google.com>
1080 * dwarf_macro_getsrcfiles.c (dwarf_macro_getsrcfiles): Remove
1081 redundant NULL tests on parameters declared with __nonnull_attribute__.
1082 * dwarf_siblingof.c (dwarf_siblingof): Likewise.
1083 * libdw_visit_scopes.c (__libdw_visit_scopes): Likewise.
1085 2015-09-04 Chih-Hung Hsieh <chh@google.com>
1086 Mark Wielaard <mjw@redhat.com>
1088 * dwarf_getlocation.c (getlocations_addr): Replace K&R function
1089 definition with ansi-C definition and add const qualifier to
1092 2015-09-04 Chih-Hung Hsieh <chh@google.com>
1094 * libdw_findcu.c (__libdw_intern_next_unit): Replace K&R function
1095 definition with ansi-C definitions.
1096 (__libdw_findcu): Likewise.
1098 2015-08-25 Mark Wielaard <mjw@redhat.com>
1100 * dwarf.h: Add DW_LANG_Haskell.
1102 2015-06-18 Mark Wielaard <mjw@redhat.com>
1104 * dwarf_begin_elf.c (dwarf_begin_elf): Assert page size is big enough
1107 2015-06-18 Mark Wielaard <mjw@redhat.com>
1109 * dwarf_getpubnames.c (get_offsets): Always free mem on error.
1111 2015-06-18 Mark Wielaard <mjw@redhat.com>
1113 * dwarf_getmacros.c (get_macinfo_table): Return NULL when
1114 dwarf_formudata reports an error.
1115 (get_table_for_offset): Likewise.
1117 2015-06-08 Mark Wielaard <mjw@redhat.com>
1119 * dwarf_getsrclines.c (read_srclines): Initialize dirarray early.
1121 2015-06-06 Mark Wielaard <mjw@redhat.com>
1123 * dwarf_getsrclines.c (read_srclines): Initialize filelist early.
1125 2015-05-27 Mark Wielaard <mjw@redhat.com>
1127 * encoded-value.h (read_encoded_value): Check data d_size contains
1128 at least enough data to hold a pointer for DW_EH_PE_indirect.
1130 2015-05-22 Mark Wielaard <mjw@redhat.com>
1132 * dwarf_getsrclines.c (read_srclines): Limit stack usage of lines
1133 with MAX_STACK_LINES, files with MAX_STACK_LINES and dirs with
1134 MAX_STACK_DIRS. Calculate number of dirs needed first, then
1135 create dirarray directly, without needing the next field. Free
1136 not stack allocated lines and files at the end.
1138 2015-05-19 Mark Wielaard <mjw@redhat.com>
1140 * dwarf_getlocation.c (__libdw_intern_expression): Create a stack
1141 allocated array to hold locs. Allocate locs bigger than the array
1142 with malloc and free them when done.
1144 2015-05-11 Jonathan Lebon <jlebon@redhat.com>
1146 * libdwP.h (DWARF_E_COMPRESSED_ERROR): New enumerator.
1147 * dwarf_error.c (errmsgs): Add DWARF_E_COMPRESSED_ERROR message.
1148 * dwarf_begin_elf.c (inflate_section): New static function, lifted
1150 (check_section): ... here. Call inflate_section, set libdw errno to
1151 DWARF_E_COMPRESSED_ERROR if .debug_info section couldn't be inflated.
1153 2015-05-11 Jonathan Lebon <jlebon@redhat.com>
1155 * dwarf_begin_elf.c (check_section): Add compressed flag. Always
1156 check for .zdebug sections. Only wrap decompression in #if USE_ZLIB.
1158 2015-05-06 Mark Wielaard <mjw@redhat.com>
1160 * dwarf_getsrclines.c (read_srclines): Use an int64_t to store and
1161 check the line number.
1163 2015-05-05 Mark Wielaard <mjw@redhat.com>
1165 * dwarf_getaranges.c (dwarf_getaranges): Check there is enough data
1166 left before reading values.
1168 2015-05-04 Anthony G. Basile <blueness@gentoo.org>
1170 * Makefile.am (libdw_so_SOURCES): Append $(argp_LDADD) to link
1173 2015-04-22 Mark Wielaard <mjw@redhat.com>
1175 * memory-access.h (__libdw_max_len_leb128): Take type_len as argument.
1176 (__libdw_max_len_uleb128): New function.
1177 (__libdw_max_len_sleb128): Likewise.
1178 (__libdw_get_uleb128): Use __libdw_max_len_uleb128.
1179 (__libdw_get_sleb128): Use __libdw_max_len_sleb128.
1181 2015-04-21 Mark Wielaard <mjw@redhat.com>
1183 * dwarf_getmacros.c (read_macros): Allocate attributes dynamically
1184 when there are more than 8.
1186 2015-04-01 Petr Machata <pmachata@redhat.com>
1188 * libdwP.h (DWARF_E_NOT_CUDIE): New enumerator.
1189 (is_cudie): New function.
1190 * dwarf_error.c (errmsgs): Add message for DWARF_E_NOT_CUDIE.
1191 * dwarf_getsrcfiles.c (dwarf_getsrcfiles): Call is_cudie instead
1192 of white-listing valid tags.
1193 * dwarf_getsrclines.c (dwarf_getsrclines): Likewise.
1195 2015-03-18 Petr Machata <pmachata@redhat.com>
1197 * Makefile.am (pkginclude_HEADERS): Add known-dwarf.h.
1198 (EXTRA_DIST): Remove known-dwarf.h.
1200 2015-02-09 Mark Wielaard <mjw@redhat.com>
1202 * dwarf.h: Add DW_LANG_Fortran03 and DW_LANG_Fortran08.
1203 * dwarf_aggregate_size.c (array_size): Recognize array lower bound
1204 for new Fortran language codes is 1.
1206 2015-02-09 Mark Wielaard <mjw@redhat.com>
1208 * dwarf.h: Add DW_TAG_atomic_type.
1209 * libdw.h (dwarf_peel_type): Document DW_TAG_atomic_type.
1210 * dwarf_peel_type.c (dwarf_peel_type): Handle DW_TAG_atomic_type.
1212 2015-02-11 Josh Stone <jistone@redhat.com>
1214 * encoded-value.h (read_encoded_value): Initialize value.
1216 2015-02-11 Petr Machata <pmachata@redhat.com>
1218 * dwarf_ranges.c (dwarf_ranges): Do not bail out when neither
1219 DW_AT_entry_pc nor DW_AT_low_pc are available. Instead remember
1220 the fact in *BASEP and bail out later if it hasn't been updated by
1221 __libdw_read_begin_end_pair_inc.
1223 2014-12-24 Mark Wielaard <mjw@redhat.com>
1225 * dwarf_getsrc_die.c (dwarf_getsrc_die): Return the last line record
1226 smaller than or equal to addr, rather than returning immediately on
1229 2015-01-07 Mark Wielaard <mjw@redhat.com>
1231 * cfi.h (struct Dwarf_CFI_s): Add search_table_len.
1232 * dwarf_getcfi_elf.c (getcfi_gnu_eh_frame): Check there is enough
1233 room in the search table for all entries. Store search_table_len.
1234 (getcfi_scn_eh_frame): Likewise.
1235 * encoded-value.h (encoded_value_size): Don't abort, return zero.
1236 (__libdw_cfi_read_address_inc): Check there is enough room to read
1237 values. Pass other byte order to read functions.
1238 (read_encoded_value): Check encoded_value_size. Don't abort, but
1239 set libdw errno and report failure. Check there is enough room to
1241 * fde.c (binary_search_fde): Check encoded value size. Add hdr
1242 data buf and size to dummy_cfi.
1244 2015-01-04 Mark Wielaard <mjw@redhat.com>
1246 * dwarf_siblingof.c (dwarf_siblingof): Check sibling attribute
1247 is after current DIE.
1249 2015-01-04 Mark Wielaard <mjw@redhat.com>
1251 * cfi.c (enough_registers): Check reg < INT32_MAX / sizeof
1252 (dwarf_frame_register).
1254 2015-01-02 Mark Wielaard <mjw@redhat.com>
1256 * dwarf_getcfi_elf.c (parse_eh_frame_hdr): Add size check.
1257 (getcfi_gnu_eh_frame): Remove size check. Check d_buf is not NULL.
1258 (getcfi_scn_eh_frame): Check d_buf is not NULL.
1260 2015-01-02 Mark Wielaard <mjw@redhat.com>
1262 * dwarf_getlocation.c (__libdw_intern_expression): Check dbg is not
1263 NULL for DW_OP_call_ref and DW_OP_GNU_implicit_pointer. For
1264 DW_OP_addr if dbg is NULL then read argument directly.
1266 2015-01-14 Jason P. Leasure <jpleasu@super.org>
1268 * dwarf_formref_die.c (dwarf_formref_die): Offset is cu->type_offset
1271 2014-12-27 Mark Wielaard <mjw@redhat.com>
1273 * dwarf_siblingof.c (dwarf_siblingof): Check sibling attribute offset
1274 still falls inside CU data.
1276 2015-01-11 Mark Wielaard <mjw@redhat.com>
1278 * dwarf_func_inline.c (dwarf_func_inline_instances): Call
1279 __libdw_visit_scopes with NULL imports.
1280 * dwarf_getfuncs.c (dwarf_getfuncs): Likewise.
1281 * dwarf_getscopes.c (pc_record): Likewise.
1282 (dwarf_getscopes): Likewise.
1283 * dwarf_getscopes_die.c (dwarf_getscopes_die): Likewise.
1284 * libdwP.h (__libdw_visit_scopes): Add imports argument.
1285 * libdw_visit_scopes.c (__libdw_visit_scopes): Likewise. Add new
1286 function imports_contains. Push and pop imports around walk_children
1287 when processing DW_TAG_imported_unit.
1289 2014-12-18 Ulrich Drepper <drepper@gmail.com>
1291 * Makefile.am: Suppress output of textrel_check command.
1293 2014-12-16 Mark Wielaard <mjw@redhat.com>
1295 * dwarf_getsrclines.c (read_srclines): Check diridx is valid under
1298 2014-12-16 Mark Wielaard <mjw@redhat.com>
1300 * dwarf_getpubnames.c (dwarf_getpubnames): Make sure there is enough
1301 space to read die offset.
1303 2014-12-16 Mark Wielaard <mjw@redhat.com>
1305 * dwarf_getsrclines.c (read_srclines): Correct overflow check for
1308 2014-12-15 Mark Wielaard <mjw@redhat.com>
1310 * dwarf_getpubnames.c (get_offsets): Make sure whole unit fall inside
1311 section data. Set error to DWARF_E_NO_ENTRY if cnt is zero.
1312 (dwarf_getpubnames): Make sure section data contains string zero
1315 2014-12-16 Mark Wielaard <mjw@redhat.com>
1317 * memory-access.h (__libdw_get_sleb128): Unroll the first step to help
1318 the compiler optimize for the common single-byte case.
1320 2014-12-15 Josh Stone <jistone@redhat.com>
1322 * memory-access.h (__libdw_max_len_leb128): New.
1323 (__libdw_get_uleb128): Use __libdw_max_len_leb128.
1324 (__libdw_get_sleb128): Likewise.
1326 2014-12-14 Mark Wielaard <mjw@redhat.com>
1328 * cfi.c (execute_cfi): Add program bounds checks.
1329 * dwarf_child.c (__libdw_find_attr): Add attrp bounds checks.
1330 * dwarf_formblock.c (dwarf_formblock): Call get_uleb128 with endp.
1331 * dwarf_formref.c (__libdw_formref): Add datap bounds checks.
1332 * dwarf_formsdata.c (dwarf_formsdata): Likewise.
1333 * dwarf_formudata.c (dwarf_formudata): Likewise.
1334 * dwarf_frame_register.c (dwarf_frame_register): Call get_uleb128
1335 with end of data buf.
1336 * dwarf_getabbrev.c (__libdw_getabbrev): Add abbrevp bounds checks.
1337 * dwarf_getabbrevattr.c (dwarf_getabbrevattr): Assume get_uleb128
1338 call gets enough data.
1339 * dwarf_getattrs,c (dwarf_getattrs): Call get_uleb128 with endp.
1340 * dwarf_getlocation.c (store_implicit_value): Call get_uleb128
1342 (__libdw_intern_expression): Call get_uleb128/get_sleb128 with
1344 * dwarf_getmacros.c (get_table_for_offset): Add nforms bounds check.
1345 * dwarf_getsrclines.c (read_srclines): Bounds check linep and call
1346 get_uleb128 with lineendp.
1347 * dwarf_hasattr.c (dwarf_hasattr): Bounds check attrp and call
1348 get_uleb128 with endp.
1349 * dwarf_next_cfi.c (dwarf_next_cfi): Bounds check bytes and call
1350 get_uleb128/get_sleb128 with limit.
1351 * encoded-value.h (read_encoded_value): Assume get_uleb128 and
1352 get_sleb128 get called with enough data.
1353 * fde.c (intern_fde): Call get_uleb128 with instructions_end.
1354 * libdwP.h (__libdw_dieabbrev): Call get_uleb128 with die->cu->endp.
1355 * libdw_form.c (__libdw_form_val_compute_len): Call get_uleb128 with
1357 * memory-access.h (__libdw_get_uleb128): Take an extra endp.
1358 Don't call get_uleb128_step if out of data.
1359 (__libdw_get_sleb128): Likewise for get_sleb128_step.
1361 2014-12-12 Mark Wielaard <mjw@redhat.com>
1363 * libdwP.h (struct Dwarf): Add fake_loc_cu.
1365 (DIE_OFFSET_FROM_CU_OFFSET): Don't use cu_data, use cu_sec_idx.
1366 (__libdw_form_val_compute_len): Drop dbg and endp arguments.
1367 (__libdw_form_val_len): Likewise.
1368 * libdw_form.c (__libdw_form_val_compute_len): Likewise.
1369 * libdw_findcu.c (__libdw_intern_next_unit): Don't use cu_data, use
1370 the already found data buffer directly.
1371 * dwarf_begin_elf.c (valid_p): Setup fake_loc_cu.
1372 * dwarf_end.c (dwarf_end): Free fake_loc_cu.
1373 * dwarf_child.c (__libdw_find_attr): Call __libdw_form_val_len with
1375 * dwarf_getattrs.c (dwarf_getattrs): Likewise.
1376 * dwarf_formblock.c (dwarf_formblock): Add bounds checking.
1377 * dwarf_getlocation_attr.c (attr_form_cu): New function.
1378 (dwarf_getlocation_attr): Use attr_form_cu to set result->cu.
1379 (getlocation): Handle empty blocks immediately.
1380 * dwarf_getlocation_implicit_pointer.c (empty_cu): New static var.
1381 (__libdw_empty_loc_attr): Drop cu argument, use empty_cu.
1382 (dwarf_getlocation_implicit_pointer): Call __libdw_empty_loc_attr with
1384 * dwarf_getmacros.c (read_macros): Also setup startp and endp for
1385 fake_cu. Call __libdw_form_val_len with just fake_cu.
1386 * dwarf_formref_die.c (dwarf_formref_die): Don't use cu_data, get
1387 datap and size directly from cu startp and endp.
1389 2014-12-11 Mark Wielaard <mjw@redhat.com>
1391 * libdw_findcu.c (__libdw_intern_next_unit): Sanity check offset.
1393 2014-12-13 Mark Wielaard <mjw@redhat.com>
1395 * dwarf_getaranges.c (compare_aranges): Make sure Dwarf_Addr
1396 difference doesn't wrap around before returning as int.
1398 2014-12-11 Josh Stone <jistone@redhat.com>
1400 * dwarf_getsrclines.c (struct linelist): Add sequence.
1401 (compare_lines): Take linelists, and break ties by sequence.
1402 (read_srclines): Use linelists for sorting.
1403 (read_srclines::add_new_line): Set sequence.
1405 2014-12-10 Josh Stone <jistone@redhat.com>
1407 * libdwP.h (Dwarf_CU): Add startp and endp boundaries.
1408 * libdw_findcu.c (__libdw_intern_next_unit): Set startp and endp.
1409 * dwarf_child.c (dwarf_child): Use cu->endp.
1410 * dwarf_cuoffset.c (dwarf_cuoffset): Use cu->startp.
1411 * dwarf_dieoffset.c (dwarf_dieoffset): Use cu->startp.
1412 * dwarf_siblingof.c (dwarf_siblingof): Use both.
1414 2014-12-10 Josh Stone <jistone@redhat.com>
1416 * dwarf_hasattr.c (dwarf_hasattr): Just walk abbrev for presence.
1418 2014-12-10 Josh Stone <jistone@redhat.com>
1420 * libdwP.h (__libdw_dieabbrev): New die->abbrev lookup function.
1421 * dwarf_child.c (__libdw_find_attr, dwarf_child): Use it.
1422 * dwarf_getattrs.c (dwarf_getattrs): Likewise.
1423 * dwarf_haschildren.c (dwarf_haschildren): Likewise.
1424 * dwarf_tag.c (dwarf_tag): Likewise.
1426 2014-12-04 Mark Wielaard <mjw@redhat.com>
1428 * libdwP.h (__libdw_form_val_compute_len): Add endp argument.
1429 (__libdw_form_val_len): Likewise and check len doesn't overflow.
1430 * libdw_form.c (__libdw_form_val_compute_len): Likewise.
1431 * dwarf_child.c (__libdw_find_attr): Call __libdw_form_val_len
1433 * dwarf_getattrs.c (dwarf_getattrs): Likewise.
1434 * dwarf_getmacros.c (read_macros): Likewise and check for errors.
1436 2014-12-02 Petr Machata <pmachata@redhat.com>
1438 * dwarf_getmacros.c (token_from_offset, offset_from_token): New
1440 (do_dwarf_getmacros_die): Merge into dwarf_getmacros.
1441 * libdw.h (DWARF_GETMACROS_START): New macro.
1443 2014-11-27 Mark Wielaard <mjw@redhat.com>
1445 * Makefile.am (libdw.so): Use textrel_check.
1447 2014-11-27 Mark Wielaard <mjw@redhat.com>
1449 * dwarf_getcfi_elf.c (getcfi_gnu_eh_frame): Initialize
1450 search_table_entries and search_table_encoding.
1452 2014-11-24 Mark Wielaard <mjw@redhat.com>
1454 * dwarf_getsrclines.c (read_srclines): Check line_range is not zero
1457 2014-11-23 Mark Wielaard <mjw@redhat.com>
1459 * dwarf_attr.c (dwarf_attr): Check __libdw_find_attr return value.
1460 * dwarf_hasattr.c (dwarf_hasattr): Likewise.
1461 * dwarf_siblingof.c (dwarf_siblingof): Likewise.
1463 2014-11-23 Mark Wielaard <mjw@redhat.com>
1465 * dwarf_getabbrev.c (__libdw_getabbrev): Don't assert on bad DWARF.
1466 Set libdw errno and return NULL.
1468 2014-11-24 Mark Wielaard <mjw@redhat.com>
1470 * dwarf.h (DW_LANG_C_plus_plus_11): Added.
1471 (DW_LANG_C11): Likewise.
1472 (DW_LANG_C_plus_plus_14): Likewise.
1473 * dwarf_aggregate_size.c (array_size): Handle DW_LANG_C11,
1474 DW_LANG_C_plus_plus_11, DW_LANG_C_plus_plus_14 and DW_LANG_Go
1476 * dwarf_getfuncs.c (dwarf_getfuncs): Set c_cu to true for
1479 2014-11-26 Mark Wielaard <mjw@redhat.com>
1481 * dwarf.h (DW_AT_noreturn): Added.
1483 2014-11-11 Mark Wielaard <mjw@redhat.com>
1485 * dwarf_getsrclines.c (read_srclines): Do address_size comparison
1486 explicitly as uint8_t.
1487 (__libdw_getsrclines): Add internal_function to declaration.
1489 2014-09-10 Petr Machata <pmachata@redhat.com>
1491 * dwarf_macro_getparamcnt.c: New file.
1492 * dwarf_macro_param.c: New file.
1493 * dwarf_macro_getsrcfiles.c: New file.
1494 * Makefile.am (libdw_a_SOURCES): Add the new files.
1495 * libdwP.h (struct files_lines_s): New structure.
1496 (DWARF_E_INVALID_OPCODE): New enumerator.
1497 (struct Dwarf): New fields macro_ops, files_lines.
1498 (Dwarf_Macro_Op_Proto, Dwarf_Macro_Op_Table): New structures for
1499 keeping macro opcode prototypes in.
1500 (Dwarf_Macro_s): Redefine from scratch.
1501 (__libdw_getsrclines, __libdw_getcompdir, libdw_macro_nforms): New
1502 internal interfaces.
1503 * dwarf_error.c (errmsgs): Add a message for
1504 DWARF_E_INVALID_OPCODE.
1505 * dwarf_end.c (dwarf_end): Destroy struct Dwarf.macro_ops and
1507 * libdw.h (dwarf_getmacros_off, dwarf_macro_getparamcnt)
1508 (dwarf_macro_getsrcfiles, dwarf_macro_param): New public
1510 * dwarf_getmacros.c (dwarf_getmacros_off): New function,
1511 (get_offset_from, macro_op_compare, build_table)
1512 (init_macinfo_table, get_macinfo_table, get_table_for_offset)
1513 (cache_op_table, read_macros, gnu_macros_getmacros_off)
1514 (macro_info_getmacros_off, do_dwarf_getmacros_die): New helper
1516 (dwarf_getmacros): Adjust to dispatch to the new interfaces.
1517 * dwarf_getsrclines.c (read_srclines): New function with guts
1518 taken from dwarf_getsrclines.
1519 (__libdw_getsrclines): Likewise.
1520 (__libdw_getcompdir, files_lines_compare): New functions.
1521 (dwarf_getsrclines): Make it dispatch to the new interfaces.
1522 * dwarf_macro_param1.c (dwarf_macro_param1): Adjust to dispatch to
1524 * dwarf_macro_param2.c (dwarf_macro_param2): Likewise.
1525 * libdw.map (ELFUTILS_0.161): New. Add dwarf_getmacros_off,
1526 dwarf_macro_getsrcfiles, dwarf_macro_getparamcnt, dwarf_macro_param.
1528 2014-10-06 Mark Wielaard <mjw@redhat.com>
1530 * Makefile.am (libdw_a_SOURCES): Add dwarf_peel_type.c.
1531 * dwarf_aggregate_size.c (get_type): Use dwarf_peel_type.
1532 (aggregate_size): Likewise. Add old and new version.
1533 * dwarf_peel_type.c: New file.
1534 * libdw.h (dwarf_peel_type): New function declaration.
1535 * libdwP.h (dwarf_peel_type): New internal declaration.
1536 * libdw.map (ELFUTILS_0.161): New section.
1538 2014-10-15 Petr Machata <pmachata@redhat.com>
1540 * libdwP.h (struct Dwarf_Files_s.cu): Drop field.
1541 * dwarf_getsrclines.c (dwarf_getsrclines): Don't set it.
1543 2014-10-05 Mark Wielaard <mjw@redhat.com>
1545 * dwarf.h: Add DW_AT_GNU_deleted.
1547 2014-10-02 Mark Wielaard <mjw@redhat.com>
1549 * dwarf_aggregate_size.c (aggregate_size): Return CU address_size
1550 for sizeless DW_TAG_pointer_type, DW_TAG_reference_type or
1551 DW_TAG_rvalue_reference_type.
1553 2014-09-12 Petr Machata <pmachata@redhat.com>
1555 * memory-access.h (read_ubyte_unaligned_inc): Allow only 4- and
1556 8-byte quantities. Consequently, rename to...
1557 (read_addr_unaligned_inc): ... this.
1558 (read_sbyte_unaligned_inc, read_ubyte_unaligned): Drop.
1559 (read_sbyte_unaligned): Drop.
1561 2014-09-10 Petr Machata <pmachata@redhat.com>
1563 * dwarf_getlocation.c (attr_ok): Also accept
1564 DW_AT_GNU_call_site_value, DW_AT_GNU_call_site_data_value,
1565 DW_AT_GNU_call_site_target, DW_AT_GNU_call_site_target_clobbered.
1567 2014-08-15 Mark Wielaard <mjw@redhat.com>
1569 * dwarf_cu_die.c: New file.
1570 * Makefile.am (libdw_a_SOURCES): Add dwarf_cu_die.c.
1571 * libdw.h (dwarf_cu_die): New function declaration.
1572 * libdw.map (ELFUTILS_0.160): Add dwarf_cu_die.
1574 2014-08-15 Mark Wielaard <mjw@redhat.com>
1576 * dwarf_cu_getdwarf.c: New file.
1577 * Makefile.am (libdw_a_SOURCES): Add dwarf_cu_getdwarf.c.
1578 * libdw.h (Dwarf_CU): New typedef.
1579 (dwarf_cu_getdwarf): New function declaration.
1580 * libdw.map (ELFUTILS_0.160): New. Add dwarf_cu_getdwarf.
1582 2014-06-18 Mark Wielaard <mjw@redhat.com>
1584 * dwarf.h: Remove DW_TAG_mutable_type.
1586 2014-05-02 Mark Wielaard <mjw@redhat.com>
1588 * libdwP.h (__check_build_id): Removed now unused.
1590 2014-05-01 Mark Wielaard <mjw@redhat.com>
1592 * libdwP.h (struct Dwarf): Remove free_alt.
1593 * dwarf_end.c (dwarf_end): Don't check free_alt, don't end alt_dwarf.
1594 * dwarf_setalt.c (dwarf_setalt): Don't check or set free_alt.
1596 2014-04-30 Mark Wielaard <mjw@redhat.com>
1598 * libdw.map (ELFUTILS_0.159): Add dwelf_elf_gnu_build_id.
1600 2014-04-15 Florian Weimer <fweimer@redhat.com>
1602 * dwarf_begin_elf.c (__check_build_id, try_debugaltlink)
1603 (open_debugaltlink): Move to libdwfl.
1604 (check_section): Do not locate alternate debuginfo.
1606 2014-04-24 Florian Weimer <fweimer@redhat.com>
1608 * libdw.map (ELFUTILS_0.159): Export dwelf_dwarf_gnu_debugaltlink.
1610 2014-04-22 Florian Weimer <fweimer@redhat.com>
1612 * dwarf_getalt.c, dwarf_setalt.c: New files.
1613 * Makefile.am (libdw_a_SOURCES): Add them.
1614 * libdw.h (dwarf_getalt, dwarf_setalt): Add function declarations.
1615 * libdwP.h (dwarf_getalt, dwarf_setalt): Add internal function
1617 * libdw.map (ELFUTILS_0.159): Export the two new functions.
1619 2014-04-15 Florian Weimer <fweimer@redhat.com>
1621 * libdwP.h (enum IDX_gnu_debugaltlink): New.
1622 * dwarf_begin_elf.c (dwarf_scnnames): Increase string size and add
1624 (check_section): Obtain .gnu_debugaltlink section from the
1627 2014-04-11 Mark Wielaard <mjw@redhat.com>
1629 * libdw.map (ELFUTILS_0.159): New. Add dwelf_elf_gnu_debuglink.
1630 * Makefile.am (libdw.so): Depend on libdwelf_pic.a.
1631 (libdwelf_objects): New variable.
1632 (libdw_a_LIBADD): Add libdwelf objects.
1634 2014-04-22 Mark Wielaard <mjw@redhat.com>
1636 * memory-access.h (get_sleb128_step): Remove undefined behavior
1637 of left shifting a signed value. Replace it with a multiplication.
1639 2014-04-13 Mark Wielaard <mjw@redhat.com>
1641 * Makefile.am: Remove !MUDFLAP conditions.
1643 2014-04-09 Mark Wielaard <mjw@redhat.com>
1645 * dwarf_begin_elf.c (check_section): Check for unsigned overflow
1646 before calling malloc to uncompress data.
1648 2014-03-03 Jan Kratochvil <jan.kratochvil@redhat.com>
1650 Fix abort() on missing section headers.
1651 * dwarf_begin_elf.c (check_section): Replace abort call by goto err.
1652 New label err to return NULL.
1654 2014-02-05 Josh Stone <jistone@redhat.com>
1656 * dwarf_decl_file.c (dwarf_decl_file): Read the idx as unsigned.
1657 * dwarf_decl_line.c (__libdw_attr_intval): Read the line/column as
1658 unsigned. Change the range assert to DWARF_E_INVALID_DWARF.
1660 2013-12-30 Mark Wielaard <mjw@redhat.com>
1662 * libdw.map (ELFUTILS_0.158): Add dwfl_core_file_attach and
1663 dwfl_linux_proc_attach.
1665 2013-12-20 Mark Wielaard <mjw@redhat.com>
1667 * libdw.map (ELFUTILS_0.158): Add dwfl_getthread_frames.
1669 2013-12-18 Mark Wielaard <mjw@redhat.com>
1671 * libdw.map (ELFUTILS_0.158): Remove dwfl_module_addrsym_elf and
1672 dwfl_module_getsym_elf. Add dwfl_module_addrinfo and
1673 dwfl_module_getsym_info.
1675 2013-12-16 Mark Wielaard <mjw@redhat.com>
1677 * libdw.map (ELFUTILS_0.158): Add dwfl_module_getsymtab_first_global.
1679 2013-12-10 Josh Stone <jistone@redhat.com>
1681 * memory-access.h (get_uleb128_rest_return): Removed.
1682 (get_sleb128_rest_return): Removed.
1683 (get_uleb128_step): Make this a self-contained block.
1684 (get_sleb128_step): Ditto, and use a bitfield to extend signs.
1685 (get_uleb128): Make this wholly implemented by __libdw_get_uleb128.
1686 (get_sleb128): Make this wholly implemented by __libdw_get_sleb128.
1687 (__libdw_get_uleb128): Simplify and inline for all callers.
1688 (__libdw_get_sleb128): Ditto.
1689 * dwarf_getlocation.c (store_implicit_value): Void the unused uleb128.
1690 * memory-access.c: Delete file.
1691 * Makefile.am (libdw_a_SOURCES): Remove it.
1692 (DEFS): Remove the now unused -DIS_LIBDW.
1694 2013-12-09 Josh Stone <jistone@redhat.com>
1696 * libdw_form.c (__libdw_form_val_compute_len): Renamed function from
1697 __libdw_form_val_len, now handling only non-constant form lengths.
1698 * libdwP.h (__libdw_form_val_len): New inlined function.
1700 2013-12-09 Mark Wielaard <mjw@redhat.com>
1702 * dwarf_getlocation.c (__libdw_intern_expression): Handle empty
1703 location expressions.
1704 * dwarf_getlocation_attr.c (dwarf_getlocation_attr): When no
1705 location found, return empty location expression.
1706 * dwarf_getlocation_implicit_pointer.c
1707 (dwarf_getlocation_implicit_pointer): Likewise.
1708 (__libdw_empty_loc_attr): New internal function.
1709 * libdwP.h (__libdw_empty_loc_attr): Define.
1711 2013-11-27 Mark Wielaard <mjw@redhat.com>
1713 * libdw.map (ELFUTILS_0.158): Add dwfl_module_addrsym_elf and
1714 dwfl_module_getsym_elf.
1716 2013-11-26 Mark Wielaard <mjw@redhat.com>
1718 * libdw.map (ELFUTILS_0.156): Move dwfl_attach_state, dwfl_pid,
1719 dwfl_thread_dwfl, dwfl_thread_tid, dwfl_frame_thread,
1720 dwfl_thread_state_registers, dwfl_thread_state_register_pc,
1721 dwfl_getthreads, dwfl_thread_getframes and dwfl_frame_pc to ...
1722 (ELFUTILS_0.158): ... here.
1724 2013-11-09 Mark Wielaard <mjw@redhat.com>
1726 * dwarf_getaranges.c (dwarf_getaranges): Read segment_size and
1727 check that it is zero.
1729 2013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com>
1731 * cfi.h (struct Dwarf_Frame_s): Make the comment more specific.
1732 * libdw.map (ELFUTILS_0.156): Add dwfl_attach_state, dwfl_pid,
1733 dwfl_thread_dwfl, dwfl_thread_tid, dwfl_frame_thread,
1734 dwfl_thread_state_registers, dwfl_thread_state_register_pc,
1735 dwfl_getthreads, dwfl_thread_getframes and dwfl_frame_pc.
1737 2013-11-01 Michael Forney <mforney@mforney.org>
1739 * Makefile.am (libdwfl_objects): New definition.
1740 (libdw_a_LIBADD): Use libdwfl_objects.
1742 2013-11-01 Michael Forney <mforney@mforney.org>
1744 * Makefile.am: Use READELF.
1746 2013-10-30 Jan Kratochvil <jan.kratochvil@redhat.com>
1748 * libdw.map (ELFUTILS_0.158): New.
1750 2013-10-10 Mark Wielaard <mjw@redhat.com>
1752 * dwarf_getfuncs.c (struct visitor_info): Rename start_offset to
1753 start_addr and rename last_offset to last_addr. Now both void *.
1754 (tree_visitor): Use start_add and die_addr instead of start_offset
1756 (dwarf_getfuncs): Use last_addr instead of last_offset.
1758 2013-10-06 Mark Wielaard <mjw@redhat.com>
1760 * cfi.c (execute_cfi): Make sure DW_CFA_expression and
1761 DW_CFA_val_expression are not used with abi_cfi.
1763 2013-10-03 Josh Stone <jistone@redhat.com>
1765 * dwarf_formref_die.c (dwarf_formref_die): Don't hash the sig8 here.
1766 * libdw_findcu.c (__libdw_intern_next_unit): Since this never revisits
1767 a unit, make sure to always hash the sig8 here, so none are missed.
1769 2013-09-29 Mark Wielaard <mjw@redhat.com>
1771 * dwarf_getlocation.c (store_implicit_value): Cast op->number2 to
1772 uintptr_t before casting to char *.
1773 (__libdw_intern_expression): Cast data to uintptr_t before casting
1775 * dwarf_getlocation_attr.c (dwarf_getlocation_attr): Cast
1776 op->number2 to uintptr_t before casting to char *.
1778 2013-09-24 Josh Stone <jistone@redhat.com>
1780 * libdw_visit_scopes.c (classify_die): Removed.
1781 (may_have_scopes): New function to replace classify_die. There's no
1782 need for full classification; just find tags that may contain scopes.
1783 (__libdw_visit_scopes): Use a direct tag comparison for imported
1784 units, and use may_have_scopes to test if recursion is needed.
1786 2013-09-20 Mark Wielaard <mjw@redhat.com>
1788 * dwarf_getfuncs.c (visitor_info): New struct.
1789 (tree_visitor): New function.
1790 (dwarf_getfuncs): Use __libdw_visit_scopes with tree_visitor.
1791 * libdw.h (dwarf_getfuncs): Expand function documentation.
1793 2013-09-12 Mark Wielaard <mjw@redhat.com>
1795 * fde.c (intern_fde): Free fde and set libdw errno when start
1796 or end could not be read.
1798 2013-08-24 Mark Wielaard <mjw@redhat.com>
1800 * dwarf_getlocation.c (store_implicit_value): Don't take data
1801 as argument, get block data from op number2. Return false when
1802 block data length and op number don't match up.
1803 (__libdw_intern_expression): Store start of block for
1804 DW_OP_implicit_value and DW_OP_GNU_entry_value instead of
1805 relative data offset. Also store block start (including length)
1806 for DW_OP_GNU_const_type. Don't pass data to store_implicit_value.
1807 * dwarf_getlocation_attr.c: New file.
1808 * dwarf_getlocation_die.c: Likewise.
1809 * libdw.h (dwarf_getlocation_die): New function definition.
1810 (dwarf_getlocation_attr): Likewise.
1811 * libdwP.h: Declare internal dwarf_getlocation_die.
1812 * libdw.map (ELFUTILS_0.157): Add dwarf_getlocation_die and
1813 dwarf_getlocation_attr.
1814 * Makefile.am (libdw_a_SOURCES): Add dwarf_getlocation_die.c and
1815 dwarf_getlocation_attr.c.
1817 2013-08-23 Mark Wielaard <mjw@redhat.com>
1819 * dwarf_getlocation.c (attr_ok): Also accept DW_AT_segment.
1820 (attr_base_address): New function.
1821 (initial_offset_base): New function.
1822 (getlocations_addr): New function. Taken from...
1823 (dwarf_getlocation_addr): here. Use new initial_offset_base and
1825 (dwarf_getlocations): New function.
1826 * libdw.h (dwarf_getlocations): New function definition.
1827 * libdw.map (ELFUTILS_0.157): New.
1829 2013-07-02 Mark Wielaard <mjw@redhat.com>
1831 * dwarf_getsrclines.c (dwarf_getsrclines): Add new stack allocation
1832 limit MAX_STACK_ALLOC. After MAX_STACK_ALLOC lines use malloc in
1833 NEW_LINE macro. Free malloced line records if any at the end.
1835 2013-07-02 Mark Wielaard <mjw@redhat.com>
1837 * dwarf_getcfi_elf.c (getcfi_shdr): Check sh_type == SHT_PROGBITS.
1839 2013-06-26 Mark Wielaard <mjw@redhat.com>
1841 * libdw_visit_scopes.c (__libdw_visit_scopes): Don't reject root
1842 DIEs without children. Return an error whenever dwarf_child or
1843 dwarf_siblingof return an error. Don't call recurse and increase
1844 the depth for an imported unit. Walk the children of an imported
1845 unit as if they are logical children of the parent root DIE.
1847 2013-05-03 Mark Wielaard <mjw@redhat.com>
1849 * dwarf_getsrclines.c (dwarf_getsrclines): Only set end_sequence
1852 2013-04-28 Jan Kratochvil <jan.kratochvil@redhat.com>
1854 * libdw.map (ELFUTILS_0.156): New.
1856 2013-04-24 Mark Wielaard <mjw@redhat.com>
1858 * Makefile.am: Use AM_CPPFLAGS instead of INCLUDES.
1860 2013-04-10 Mark Wielaard <mjw@redhat.com>
1862 * dwarf_formref_die.c (dwarf_formref_die): Reference size is only
1863 equal to address size when we have a DW_FORM_ref_addr for DWARF
1866 2013-03-25 Mark Wielaard <mjw@redhat.com>
1868 * dwarf_getsrclines.c (dwarf_getsrclines): Mark highest address as
1871 2013-03-12 Mark Wielaard <mjw@redhat.com>
1873 * dwarf_getsrcfiles.c (dwarf_getsrcfiles): Allow DW_TAG_partial_unit.
1874 * dwarf_getsrclines.c (dwarf_getsrclines): Likewise.
1876 2013-02-15 Mark Wielaard <mjw@redhat.com>
1878 * dwarf_formstring.c (dwarf_formstring): Check dbg_ret->sectiondata,
1879 not dbg->sectiondata.
1881 2013-01-07 Roland McGrath <roland@hack.frob.com>
1884 [ALLOW_UNALIGNED] (read_8ubyte_unaligned_noncvt): New macro.
1885 [!ALLOW_UNALIGNED] (read_8ubyte_unaligned_noncvt): New inline function.
1887 2012-12-18 Mark Wielaard <mjw@redhat.com>
1889 * dwarf_begin_elf.c (valid_p): Call Dwarf_Sig8_Hash_free if invalid.
1890 (check_section): Likewise on error.
1891 (scngrp_read): Likewise.
1892 (dwarf_begin_elf): Likewise.
1894 2012-10-09 Petr Machata <pmachata@redhat.com>
1896 * dwarf_getlocation.c (__libdw_intern_expression): Handle
1897 DW_OP_GNU_parameter_ref, DW_OP_GNU_convert, DW_OP_GNU_reinterpret,
1898 DW_OP_GNU_regval_type, DW_OP_GNU_entry_value,
1899 DW_OP_GNU_deref_type, DW_OP_GNU_const_type.
1901 2012-10-08 Jan Kratochvil <jan.kratochvil@redhat.com>
1903 * cfi.c: New include system.h.
1904 (execute_cfi) (enough_registers): Clear new memory after realloc.
1906 2012-10-08 Jan Kratochvil <jan.kratochvil@redhat.com>
1908 * fde.c (__libdw_find_fde): Change <fde != NULL> to likely. Return
1909 DWARF_E_NO_MATCH if .eh_frame_hdr points to FDE which is too short for
1912 2012-10-08 Jan Kratochvil <jan.kratochvil@redhat.com>
1914 * dwarf_getlocation.c (__libdw_intern_expression) <cfap>: Make new
1915 loclist element DW_OP_call_frame_cfa before decoding the opcodes.
1916 Remove the later DW_OP_call_frame_cfa push to RESULT.
1918 2012-10-08 Jan Kratochvil <jan.kratochvil@redhat.com>
1921 * fde.c (binary_search_fde): Remove always true <address >= start>
1922 conditional. Move L initialization upwards.
1924 2012-08-24 Mark Wielaard <mjw@redhat.com>
1926 * dwarf_begin_elf.c (check_section): Only probe for dwz multi files
1927 when ENABLE_DWZ is defined.
1928 * libdwP.h (__check_build_id): Only declare when ENABLE_DWZ is
1931 2012-08-16 Mark Wielaard <mjw@redhat.com>
1933 * Makefile.am (EXTRA_DIST): Add known-dwarf.h.
1934 * dwarf.h (DW_LANG_Go): Update comment.
1935 (DW_LANG_Mips_Assembler): Likewise.
1937 2012-06-27 Mark Wielaard <mjw@redhat.com>
1939 * dwarf.h: Add DW_FORM_GNU_ref_alt and DW_FORM_GNU_strp_alt.
1940 * dwarf_begin.c (dwarf_begin): Add INTDEF.
1941 * dwarf_begin_elf.c (__check_build_id): New internal_function.
1942 (try_debugaltlink): New function.
1943 (open_debugaltlink): Likewise.
1944 (check_section): Try open_debugaltlink for .gnu_debugaltlink.
1945 * dwarf_end.c (dwarf_end): Free the alternative Dwarf descriptor if
1947 * dwarf_error.c (errmsgs): Add DWARF_E_NO_ALT_DEBUGLINK.
1948 * dwarf_formref.c (__libdw_formref): Using DW_FORM_GNU_ref_alt
1950 * dwarf_formref_die.c (dwarf_formref_die): Handle DW_FORM_GNU_ref_alt.
1951 * dwarf_formstring.c (dwarf_formstring): Handle DW_FORM_GNU_strp_alt.
1952 * dwarf_formudata.c (__libdw_formptr): Adjust __libdw_read_offset
1954 * dwarf_getpubnames.c (get_offsets): Adjust __libdw_read_offset call.
1955 * libdwP.h: Add DWARF_E_NO_ALT_DEBUGLINK.
1956 (struct Dwarf): Add alt_dwarf and free_alt fields.
1957 (__libdw_read_offset): Add dbg_ret argument, use to check with
1958 __libdw_offset_in_section.
1959 (__check_build_id): New function declaration.
1960 (dwarf_begin): Define as INTDECL.
1961 * libdw_form.c (__libdw_form_val_len): Handle DW_FORM_GNU_ref_alt
1962 and DW_FORM_GNU_strp_alt.
1964 2012-07-19 Mark Wielaard <mjw@redhat.com>
1966 * dwarf.h: Add DW_OP_GNU_parameter_ref.
1968 2012-07-24 Mark Wielaard <mjw@redhat.com>
1970 * dwarf.h: Correct spelling of DW_LANG_ObjC.
1971 * dwarf_aggregate_size.c (array_size): Use correct spelling of
1974 2012-07-24 Mark Wielaard <mjw@redhat.com>
1976 * dwarf.h: Add DW_ATE_UTF.
1978 2012-06-27 Mark Wielaard <mjw@redhat.com>
1980 * dwarf.h: Add DW_MACRO_GNU .debug_macro type encodings.
1982 2012-06-26 Mark Wielaard <mjw@redhat.com>
1984 * libdwP.h: Add IDX_debug_macro.
1985 * dwarf.h: Add DW_AT_GNU_macros.
1986 * dwarf_begin_elf.c (dwarf_scnnames): Add .debug_macro.
1987 * dwarf_formudata.c (dwarf_formudata): Recognize DW_AT_GNU_macros.
1989 2012-04-27 Mark Wielaard <mjw@redhat.com>
1991 * libdw/dwarf_highpc.c (dwarf_highpc): Handle DW_AT_high_pc being
1992 a constant offset from DW_AT_low_pc.
1994 2012-03-19 Tom Tromey <tromey@redhat.com>
1996 * libdw_findcu.c (findcu_cb): Move earlier.
1997 (__libdw_intern_next_unit): Add new CU to search tree here...
1998 (__libdw_findcu): ... not here.
2000 2012-01-31 Mark Wielaard <mjw@redhat.com>
2002 * dwarf_formudata.c (dwarf_formudata): Handle DW_FORM_sec_offset.
2004 2011-11-31 Mark Wielaard <mjw@redhat.com>
2006 * Makefile.am (known-dwarf.h): Run gawk on config/known-dwarf.awk.
2008 2011-07-14 Mark Wielaard <mjw@redhat.com>
2010 * libdw.h (dwarf_offdie): Fix documentation to mention .debug_info.
2012 2011-05-16 Jakub Jelinek <jakub@redhat.com>
2014 * dwarf.h (DW_OP_GNU_const_type, DW_OP_GNU_regval_type,
2015 DW_OP_GNU_deref_type, DW_OP_GNU_convert, DW_OP_GNU_reinterpret):
2018 2011-04-26 Mark Wielaard <mjw@redhat.com>
2020 * dwarf_child (dwarf_child): Sanity check end of section against
2021 cu_data () of die->cu.
2023 2011-03-22 Mark Wielaard <mjw@redhat.com>
2025 * dwarf.h: Add DW_TAG_GNU_call_site,
2026 DW_TAG_GNU_call_site_parameter,
2027 DW_AT_GNU_call_site_value,
2028 DW_AT_GNU_call_site_data_value,
2029 DW_AT_GNU_call_site_target,
2030 DW_AT_GNU_call_site_target_clobbered,
2031 DW_AT_GNU_tail_call,
2032 DW_AT_GNU_all_tail_call_sites,
2033 DW_AT_GNU_all_call_sites,
2034 DW_AT_GNU_all_source_call_sites,
2035 and DW_OP_GNU_entry_value.
2037 2011-03-10 Petr Machata <pmachata@redhat.com>
2039 * libdw/dwarf_tag.c (__libdw_findabbrev): Reject requests for
2040 abbreviation with code 0.
2042 2011-03-09 Petr Machata <pmachata@redhat.com>
2044 * libdw/dwarf_child.c (dwarf_child): Check for section overrun.
2046 2011-02-23 Roland McGrath <roland@redhat.com>
2048 * libdwP.h (struct Dwarf) [USE_ZLIB]: New member sectiondata_gzip_mask.
2049 Declare __libdw_free_zdata.
2050 * dwarf_end.c [USE_ZLIB] (__libdw_free_zdata): New function.
2051 (dwarf_end): Call it.
2053 * dwarf_begin_elf.c (valid_p): Likewise.
2054 (check_section, scngrp_read): Likewise.
2055 (check_section) [USE_ZLIB]: Grok .z* flavors of sections.
2057 2010-10-13 Roland McGrath <roland@redhat.com>
2059 * dwarf.h: Add DW_LANG_Go.
2061 2010-10-05 Roland McGrath <roland@redhat.com>
2063 * dwarf_getaranges.c: Use malloc rather than alloca,
2064 since the total number of elements can be quite huge.
2066 2010-07-26 Roland McGrath <roland@redhat.com>
2068 * dwarf_getlocation_implicit_pointer.c: New file.
2069 * Makefile.am (libdw_a_SOURCES): Add it.
2070 * libdw.map (ELFUTILS_0.149): New set.
2071 Add dwarf_getlocation_implicit_pointer.
2072 * libdw.h: Declare it.
2074 * dwarf_offdie.c (do_offdie): Renamed to __libdw_offdie, made global.
2075 (dwarf_offdie, dwarf_offdie_types): Update callers.
2076 * libdwP.h: Declare it.
2078 * dwarf.h: Add DW_OP_GNU_implicit_pointer.
2079 * dwarf_getlocation.c (__libdw_intern_expression): Handle it.
2081 2010-08-24 Roland McGrath <roland@redhat.com>
2083 * libdw.map (ELFUTILS_0.149): New set. Add dwfl_dwarf_line.
2085 2010-07-27 Roland McGrath <roland@redhat.com>
2087 * dwarf_formref_die.c: Fix sig8 hash insertion.
2089 2010-06-23 Roland McGrath <roland@redhat.com>
2091 * cfi.c (dwarf_cfi_validate_fde): Function removed.
2092 * libdw.h: Remove it.
2093 * libdw.map: Likewise.
2095 2010-06-22 Roland McGrath <roland@redhat.com>
2097 * dwarf_getlocation.c (check_constant_offset): data[48] are constant.
2099 * dwarf_getsrclines.c: Fix signed comparison warning in extended
2102 2010-06-21 Roland McGrath <roland@redhat.com>
2104 * dwarf.h: Add DW_TAG_GNU_* constants.
2106 * memory-access.h (get_sleb128_rest_return): Fix sign extension for
2109 2010-06-20 Roland McGrath <roland@redhat.com>
2111 * libdw_findcu.c (__libdw_findcu): Take new flag argument,
2112 to search TUs instead of CUs.
2113 * libdwP.h: Update decl.
2114 (struct Dwarf): New member tu_tree.
2115 * dwarf_end.c (dwarf_end): Clean up tu_tree.
2116 * dwarf_offdie.c (do_offdie): New function, broken out of ...
2117 (dwarf_offdie): ... here.
2118 (dwarf_offdie_types): New function.
2119 * libdw.h: Declare it.
2120 * libdw.map (ELFUTILS_0.148): Add it.
2122 * libdwP.h (CUDIE): Use cu_data.
2123 * dwarf_formblock.c: Likewise.
2124 * dwarf_formref_die.c: Likewise.
2125 * dwarf_diecu.c: Use CUDIE macro.
2126 * dwarf_formaddr.c: Use cu_sec_idx.
2128 2010-06-16 Roland McGrath <roland@redhat.com>
2130 * dwarf_formref_die.c: Use dwarf_offdie only for DW_FORM_ref_addr, so
2131 we don't repeat a CU lookup we've already done. Handle
2132 DW_FORM_ref_sig8 using sig8_hash table and __libdw_intern_next_unit.
2134 * libdw_findcu.c (__libdw_intern_next_unit): New function,
2136 (__libdw_findcu): ... here. Call it.
2137 * libdwP.h: Declare it.
2138 (struct Dwarf): New member next_tu_offset.
2140 * dwarf_sig8_hash.c: New file.
2141 * dwarf_sig8_hash.h: New file.
2142 * Makefile.am (libdw_a_SOURCES, noinst_HEADERS): Add them.
2143 * dwarf_abbrev_hash.c: Include dwarf_sig8_hash.h before
2145 * libdwP.h (struct Dwarf): New member sig8_hash.
2146 * dwarf_begin_elf.c: Call Dwarf_Sig8_Hash_init on it.
2147 * dwarf_end.c: Call Dwarf_Sig8_Hash_free on it.
2149 * dwarf_nextcu.c (dwarf_next_unit): New function, broken out of ...
2150 (dwarf_nextcu): ... here. Call it.
2151 * libdw.h: Declare it.
2152 * libdwP.h: Add INTDECL.
2153 * libdw_findcu.c (__libdw_findcu): Use it instead of dwarf_nextcu.
2154 * libdw.map (ELFUTILS_0.148): New set, add dwarf_next_unit.
2156 * libdwP.h (cu_sec_idx, cu_data): New functions.
2157 Use .debug_types when CU is a TU.
2158 * dwarf_cuoffset.c: Use that instead of assuming IDX_debug_info.
2159 * dwarf_siblingof.c: Likewise.
2160 * dwarf_formstring.c: Likewise.
2161 * dwarf_formudata.c (__libdw_formptr, dwarf_formudata): Likewise.
2162 * dwarf_getlocation.c (dwarf_getlocation): Likewise.
2163 (dwarf_getlocation_addr): Likewise.
2165 * libdwP.h (struct Dwarf_CU): Add new members type_offset, type_sig8.
2166 (DIE_OFFSET_FROM_CU_OFFSET): Take flag argument; if true, compute
2167 .debug_types header size instead of .debug_info header size.
2169 * dwarf_diecu.c: Update caller.
2170 * dwarf_getaranges.c: Likewise.
2171 * dwarf_nextcu.c: Likewise.
2172 * libdw_findcu.c (__libdw_findcu): Initialize new members.
2174 * fde.c (fde_by_offset): Renamed to ...
2175 (__libdw_fde_by_offset): ... this, made global and internal_function.
2176 Don't take ADDRESS argument.
2177 (__libdw_find_fde): Update caller. Do address sanity check here.
2178 * cfi.h: Declare __libdw_fde_by_offset.
2179 * cfi.c (dwarf_cfi_validate_fde): New function.
2180 * libdw.h: Declare it.
2181 * libdw.map (ELFUTILS_0.148): Add it.
2183 * cie.c (intern_new_cie): Canonicalize DW_EH_PE_absptr FDE encoding to
2184 either DW_EH_PE_udata8 or DW_EH_PE_udata4.
2186 * encoded-value.h (read_encoded_value): Handle DW_EH_PE_indirect.
2187 Don't assume DW_EH_PE_aligned refers to native address size.
2189 * cfi.c (execute_cfi): Barf on CIE initial instructions changing the
2192 2010-06-17 Roland McGrath <roland@redhat.com>
2194 * libdwP.h (struct Dwarf_Line_s): Add members isa, discriminator, and
2196 * dwarf_getsrclines.c (dwarf_getsrclines): Move NEW_FILE macro guts
2197 into an inner inline function. Set new fields. Check all fields for
2198 overflow when setting.
2199 * dwarf_lineisa.c: New file.
2200 * dwarf_linediscriminator.c: New file.
2201 * dwarf_lineop_index.c: New file.
2202 * Makefile.am (libdw_a_SOURCES): Add them.
2203 * libdw.map (ELFUTILS_0.148): Add them.
2204 * libdw.h: Declare them.
2206 2010-06-16 Roland McGrath <roland@redhat.com>
2208 * dwarf_next_cfi.c: Fix version 4 return_address_register decoding.
2210 * fde.c (fde_by_offset): Renamed to ...
2211 (__libdw_fde_by_offset): ... this, made global and internal_function.
2212 Don't take ADDRESS argument.
2213 (__libdw_find_fde): Update caller. Do address sanity check here.
2214 * cfi.h: Declare __libdw_fde_by_offset.
2215 * cfi.c (dwarf_cfi_validate_fde): New function.
2216 * libdw.h: Declare it.
2217 * libdw.map (ELFUTILS_0.148): Add it.
2219 * cie.c (intern_new_cie): Canonicalize DW_EH_PE_absptr FDE encoding to
2220 either DW_EH_PE_udata8 or DW_EH_PE_udata4.
2222 * encoded-value.h (read_encoded_value): Handle DW_EH_PE_indirect.
2223 Don't assume DW_EH_PE_aligned refers to native address size.
2225 * cfi.c (execute_cfi): Barf on CIE initial instructions changing the
2228 2010-06-15 Roland McGrath <roland@redhat.com>
2230 * dwarf_formref.c (__libdw_formref): Diagnose DW_FORM_ref_sig8 like
2232 * dwarf_formref_die.c (dwarf_formref_die): Diagnose it the same way
2233 here, since we don't support it yet.
2235 * dwarf_next_cfi.c: Handle version 4 format.
2237 * dwarf_getsrclines.c: Handle version 4 format.
2239 2010-06-01 Roland McGrath <roland@redhat.com>
2241 * libdwP.h: Remove unused IDX_debug_*names, add IDX_debug_types.
2242 * dwarf_begin_elf.c (dwarf_scnnames): Likewise.
2244 * libdwP.h (CIE_VERSION): Remove unused macro.
2246 * dwarf_getsrclines.c: Fix version field test.
2247 * libdwP.h (DWARF_VERSION): Remove useless macro.
2249 * dwarf_formudata.c (__libdw_formptr): Fix DW_FORM_sec_offset handling.
2251 * dwarf_formblock.c (dwarf_formblock): Handle DW_FORM_exprloc.
2253 * libdw_findcu.c (__libdw_findcu): Accept version 4.
2255 2010-05-31 Mark Wielaard <mjw@redhat.com>
2257 * cfi.h (dwarf_cfi_cie_p): Move definition from here, to ..
2258 * libdw.h (dwarf_cfi_cie_p): ... here.
2260 2010-05-31 Mark Wielaard <mjw@redhat.com>
2262 * dwarf.h: Fix DW_LANG_Python constant.
2264 2010-05-28 Eduardo Santiago <santiago@redhat.com>
2266 * dwarf_getlocation.c (dwarf_getlocation): Do attr_ok check first
2269 2010-05-27 Roland McGrath <roland@redhat.com>
2271 * dwarf.h: Add DW_AT_enum_class, DW_AT_linkage_name,
2272 DW_TAG_template_alias, DW_LANG_Python, DW_LNE_set_discriminator.
2274 2010-05-08 Roland McGrath <roland@redhat.com>
2276 * dwarf_getlocation.c (__libdw_intern_expression): Take new argument
2277 REF_SIZE. Use that to handle DW_OP_call_ref correctly.
2278 (getlocation): Update caller.
2279 * dwarf_frame_cfa.c (dwarf_frame_cfa): Likewise.
2280 * dwarf_frame_register.c (dwarf_frame_register): Likewise.
2281 * libdwP.h: Update decl.
2283 2010-04-26 Roland McGrath <roland@redhat.com>
2285 * cfi.h (struct Dwarf_Frame_s): Add cfa_invalid alternative in cfa_rule.
2286 * cfi.c (execute_cfi): Set that instead of doing cfi_assert for
2287 DW_CFA_def_cfa_{offset*,register} when a non-offset rule is in force.
2288 * dwarf_frame_cfa.c (dwarf_frame_cfa): Handle cfa_invalid.
2290 * dwarf_getlocation.c (__libdw_intern_expression): Take new arg CFAP.
2291 Prepend DW_OP_call_frame_cfa if true.
2292 (getlocation): Update caller.
2293 * dwarf_frame_cfa.c (dwarf_frame_cfa): Likewise.
2294 * dwarf_frame_register.c (dwarf_frame_register): Likewise.
2295 * libdwP.h: Update decl.
2297 2010-04-22 Roland McGrath <roland@redhat.com>
2299 * cfi.c (execute_cfi): Never return without cleanup.
2301 (cie_cache_initial_state): Adjust caller to expect that free.
2302 (__libdw_frame_at_address): Likewise.
2304 2010-03-10 Roland McGrath <roland@redhat.com>
2306 * libdw.map (ELFUTILS_0.146): New set. Add dwfl_core_file_report.
2308 2010-02-15 Roland McGrath <roland@redhat.com>
2310 * Makefile.am: Use config/eu.am for common stuff.
2312 2010-02-02 Mark Wielaard <mjw@redhat.com>
2314 * fde.c (intern_fde): Fix length check for sized_augmentation_data.
2316 2010-01-07 Roland McGrath <roland@redhat.com>
2318 * dwarf_getcfi_elf.c (getcfi_phdr): Use elf_getphdrnum.
2320 2010-01-05 Roland McGrath <roland@redhat.com>
2322 * dwarf_aggregate_size.c: New file.
2323 * Makefile.am (libdw_a_SOURCES): Add it.
2324 * libdw.h: Declare it.
2325 * libdwP.h: Add INTDECL.
2326 * libdw.map (ELFUTILS_0.144): New set. Add dwarf_aggregate_size.
2328 * dwarf_srclang.c: Add INTDEF.
2329 * libdwP.h: Add INTDECL.
2331 * dwarf.h: Add some more DW_AT_GNU_* types from gcc.
2333 * dwarf.h: Add DW_AT_GNU_vector, DW_AT_GNU_template_name.
2335 2009-11-21 Roland McGrath <roland@redhat.com>
2337 * dwarf_getlocation.c (check_constant_offset): Return 1 for all
2340 2009-10-15 Roland McGrath <roland@redhat.com>
2342 * libdw_form.c (__libdw_form_val_len): Grok DW_FORM_sec_offset,
2343 DW_FORM_exprloc, DW_FORM_flag_present, and DW_FORM_ref_sig8.
2345 2009-09-17 Roland McGrath <roland@redhat.com>
2347 * dwarf_getlocation.c (dwarf_getlocation_implicit_value): Make OP
2348 argument a pointer to const.
2349 * libdw.h: Update decl.
2351 2009-09-10 Roland McGrath <roland@redhat.com>
2353 * dwarf_getlocation.c (store_implicit_value): New function.
2354 (__libdw_intern_expression): Use it, handle DW_OP_implicit_value.
2355 (dwarf_getlocation_implicit_value): New function.
2356 * libdw.h: Declare it.
2357 * libdw.map (ELFUTILS_0.143): Add it.
2359 2009-09-09 Mark Wielaard <mjw@redhat.com>
2361 * dwarf_getcfi.c (dwarf_getcfi): Clear cfi->ebl.
2363 2009-08-21 Josh Stone <jistone@redhat.com>
2365 * dwarf_hasattr_integrate.c: Integrate DW_AT_specification too.
2367 2009-08-10 Roland McGrath <roland@redhat.com>
2369 * dwarf_getscopevar.c: Use dwarf_diename.
2371 2009-08-09 Roland McGrath <roland@redhat.com>
2373 * libdw.map (ELFUTILS_0.143): New version set,
2374 inherits from ELFUTILS_0.142.
2375 * dwarf_arrayorder.c: Use OLD_VERSION and NEW_VERSION to define an
2376 alias in the ELFUTILS_0.122 version set and the default in the new set.
2377 * dwarf_srclang.c: Likewise.
2378 * dwarf_decl_file.c: Likewise.
2379 * dwarf_decl_line.c: Likewise.
2380 * dwarf_decl_column.c: Likewise.
2381 * dwarf_bytesize.c: Likewise.
2382 * dwarf_bitsize.c: Likewise.
2383 * dwarf_bitoffset.c: Likewise.
2385 2009-08-07 Roland McGrath <roland@redhat.com>
2387 * dwarf_arrayorder.c: Use dwarf_attr_integrate.
2388 * dwarf_srclang.c: Likewise.
2389 * dwarf_decl_file.c: Likewise.
2390 * dwarf_decl_line.c (__libdw_attr_intval): Likewise.
2391 * dwarf_bytesize.c: Likewise.
2392 * dwarf_bitsize.c: Likewise.
2393 * dwarf_bitoffset.c: Likewise.
2395 2009-07-22 Roland McGrath <roland@redhat.com>
2397 * dwarf_frame_cfa.c: Change calling convention.
2398 * libdw.h: Update decl.
2400 * dwarf_frame_register.c: Change calling/return-value convention for
2401 value-only results and undefined/same_value.
2402 * libdw.h: Update decl.
2404 * dwarf_getlocation.c (__libdw_intern_expression): Take new bool
2405 argument, append DW_OP_stack_value if set. Don't take NOPS argument,
2406 return that value instead.
2407 (getlocation): Update caller.
2408 * dwarf_frame_cfa.c: Likewise.
2409 * libdwP.h: Update decl.
2411 2009-07-21 Roland McGrath <roland@redhat.com>
2413 * dwarf_getsrc_file.c: Ignore a CU that just has no DW_AT_stmt_list.
2414 Fix loop iteration after skipping a bogus or useless CU.
2416 * dwarf_entry_breakpoints.c: Handle 0 dwarf_errno () as harmless
2417 absence, not DWARF_E_NO_DEBUG_LINE.
2419 2009-07-20 Roland McGrath <roland@redhat.com>
2421 * dwarf_getlocation.c (__libdw_intern_expression):
2422 Handle DW_OP_stack_value.
2424 2009-07-16 Roland McGrath <roland@redhat.com>
2426 * dwarf_formudata.c (__libdw_formptr): Handle DW_FORM_sec_offset,
2427 reject others when CU's version > 3.
2429 * dwarf_formflag.c: Handle DW_FORM_flag_present.
2431 * dwarf.h: Add DW_OP_{implicit,stack}_value from DWARF 4 draft.
2432 Also DW_TAG_type_unit and DW_TAG_rvalue_reference_type.
2433 Also DW_AT_signature, DW_AT_main_subprogram, DW_AT_data_bit_offset,
2434 and DW_AT_const_expr.
2435 Also DW_FORM_sec_offset, DW_FORM_exprloc, DW_FORM_flag_present,
2436 and DW_FORM_ref_sig8.
2438 2009-07-15 Roland McGrath <roland@redhat.com>
2440 * dwarf_getlocation.c: Grok DW_OP_form_tls_address,
2441 DW_OP_GNU_push_tls_address, and DW_OP_bit_piece.
2443 2009-07-13 Roland McGrath <roland@redhat.com>
2445 * dwarf_getlocation.c: Grok DW_OP_call_frame_cfa.
2447 2009-07-08 Roland McGrath <roland@redhat.com>
2449 * libdw.map (ELFUTILS_0.142): Add dwfl_module_dwarf_cfi,
2452 * libdwP.h (struct Dwarf): Add member `cfi'.
2453 * dwarf_end.c (dwarf_end): Call __libdw_destroy_frame_cache on it.
2454 * dwarf_getcfi.c: New file.
2455 * dwarf_getcfi_elf.c: New file.
2456 * dwarf_cfi_end.c: New file.
2457 * dwarf_cfi_addrframe.c: New file.
2458 * dwarf_frame_cfa.c: New file.
2459 * dwarf_frame_register.c: New file.
2460 * dwarf_frame_return_address_register.c: New file.
2461 * Makefile.am (libdw_a_SOURCES): Add them.
2462 * unwind.h: Declare those functions.
2463 * libdw.map (ELFUTILS_0.142): Export them.
2465 * dwarf_getlocation.c (__libdw_intern_expression): New function,
2467 (getlocation): ... here, call it.
2468 * libdwP.h: Declare it.
2472 * frame-cache.c: New file.
2475 * encoded-value.h: New file.
2476 * Makefile.am (libdw_a_SOURCES, noinst_HEADERS): Add them.
2477 * libdwP.h: Add DWARF_E_INVALID_CFI to errors enum.
2478 * dwarf_error.c (errmsgs): Add element for it.
2480 * dwarf_next_cfi.c: New file.
2481 * Makefile.am (libdw_a_SOURCES): Add it.
2482 * libdw.h (Dwarf_CIE, Dwarf_FDE, Dwarf_CIE_Entry): New types.
2483 Declare dwarf_next_cfi.
2484 * libdw.map (ELFUTILS_0.142): New set, inherits from ELFUTILS_0.136.
2487 * memory-access.h [! ALLOW_UNALIGNED]
2488 (read_2ubyte_unaligned): Renamed to ...
2489 (read_2ubyte_unaligned_1): ... this. Take bool rather than Dwarf *.
2490 (read_2ubyte_unaligned): Define as macro passing dbg->other_byte_order.
2491 (read_2sbyte_unaligned): Likewise.
2492 (read_4ubyte_unaligned): Likewise.
2493 (read_4sbyte_unaligned): Likewise.
2494 (read_8ubyte_unaligned): Likewise.
2495 (read_8sbyte_unaligned): Likewise.
2497 * libdwP.h (IDX_eh_frame): Remove it.
2498 * dwarf_begin_elf.c (dwarf_scnnames): Remove its element.
2500 2009-07-08 Roland McGrath <roland@redhat.com>
2502 * libdwP.h (struct Dwarf_Line_s): Reorder members to pack better.
2504 * dwarf_getlocation.c (check_constant_offset): New function.
2505 (dwarf_getlocation, dwarf_getlocation_addr): Call it to
2506 handle DW_AT_data_member_location of data[48] as constant offset.
2508 2009-06-18 Roland McGrath <roland@redhat.com>
2510 * libdwP.h (__libdw_read_address_inc): Constify.
2511 (__libdw_read_offset_inc): Likewise.
2512 * dwarf_getaranges.c: Likewise.
2513 * dwarf_getlocation.c: Likewise.
2514 * dwarf_getsrclines.c: Likewise.
2515 * dwarf_nextcu.c: Likewise.
2517 2009-05-05 Petr Machata <pmachata@redhat.com>
2519 * libdwP.h (__libdw_formptr): Declare new function.
2520 * dwarf_formudata.c: Implement it here.
2521 * dwarf_getlocation.c (dwarf_getlocation_addr):
2522 Call it instead of hand-rolled offset handling code.
2523 * dwarf_getsrclines.c (dwarf_getsrclines): Likewise.
2524 * dwarf_ranges.c (dwarf_ranges): Likewise.
2526 2009-05-04 Petr Machata <pmachata@redhat.com>
2528 * libdwP.h (__libdw_read_begin_end_pair_inc): Declare new function.
2529 * dwarf_ranges.c: Implement it here.
2530 (dwarf_ranges): Call it.
2531 * dwarf_getlocation.c (dwarf_getlocation_addr): Call it also here.
2533 2009-04-23 Petr Machata <pmachata@redhat.com>
2535 * dwarf_formaddr.c (dwarf_formaddr): Call __libdw_read_* instead
2536 of read_*ubyte_unaligned.
2537 * dwarf_formref_die.c (dwarf_formref_die): Likewise.
2538 * dwarf_formstring.c (dwarf_formstring): Likewise.
2539 * dwarf_formudate.c (dwarf_formudata): Likewise.
2540 * dwarf_getaranges.c (dwarf_getaranges): Likewise.
2541 * dwarf_getlocation.c (dwarf_getlocation_addr): Likewise.
2542 * dwarf_getpubnames.c (get_offsets): Likewise.
2543 * dwarf_nextcu.c (dwarf_nextcu): Likewise.
2545 2009-04-23 Petr Machata <pmachata@redhat.com>
2547 * libdwP.h (__libdw_read_addr_inc, __libdw_read_off_inc,
2548 __libdw_read_addr, __libdw_read_off): Add four new internal
2551 2009-05-07 Roland McGrath <roland@redhat.com>
2553 * dwarf_getmacros.c (dwarf_getmacros): Use absolute section offset in
2554 return value and OFFSET argument, not CU-relative. Only fetch the
2555 attribute data when called with OFFSET of 0.
2557 2009-05-07 Petr Machata <pmachata@redhat.com>
2559 * dwarf_getmacros.c (dwarf_getmacros): Take into account offset in
2560 DW_AT_macro_info attribute of CU DIE.
2562 2009-04-15 Roland McGrath <roland@redhat.com>
2564 * dwarf.h (DW_CIE_ID): Removed.
2565 (DW_CIE_ID_32, DW_CIE_ID_64): New constants replace it.
2567 2009-04-01 Roland McGrath <roland@redhat.com>
2569 * dwarf.h: Add DW_CFA_GNU_negative_offset_extended.
2571 2009-01-28 Roland McGrath <roland@redhat.com>
2573 * libdwP.h (struct Dwarf_Line_s): Move out of struct Dwarf_Lines_s
2574 defn so C++ doesn't scope the name to not match the Dwarf_Line typedef.
2576 * libdwP.h (struct Dwarf_Files_s): Replace dbg field with cu field.
2578 2009-01-26 Roland McGrath <roland@redhat.com>
2580 * dwarf_ranges.c: Return 0 when no ranges or *_pc attrs at all.
2582 2009-01-25 Roland McGrath <roland@redhat.com>
2584 * dwarf_getattrs.c: Correctly skip attribute values when restarting.
2586 2009-01-23 Roland McGrath <roland@redhat.com>
2588 * Makefile.am ($(srcdir)/known-dwarf.h): Target renamed back.
2589 Put these rules under if MAINTAINER_MODE.
2591 2009-01-22 Roland McGrath <roland@redhat.com>
2593 * dwarf.h: Add DW_OP_GNU_encoded_addr.
2595 2009-01-21 Roland McGrath <roland@redhat.com>
2597 * Makefile.am (CLEANFILES): Renamed to ...
2598 (MOSTLYCLEANFILES): ... here.
2599 (CLEANFILES): New variable, add known-dwarf.h.
2601 2009-01-17 Roland McGrath <roland@redhat.com>
2603 * Makefile.am (known-dwarf.h): Target renamed, not in $(srcdir).
2604 Make it unconditional.
2605 (BUILT_SOURCES): Updated.
2607 * dwarf.h: Add description comments for DW_LANG_* values.
2609 * Makefile.am [MAINTAINER_MODE]
2610 ($(srcdir)/known-dwarf.h): New target.
2611 (BUILT_SOURCES): Add it.
2613 * dwarf.h: Add DW_OP_GNU_push_tls_address, DW_OP_GNU_uninit.
2615 2009-01-10 Ulrich Drepper <drepper@redhat.com>
2617 * dwarf_error.c: Always use __thread. Remove all !USE_TLS code.
2619 2009-01-08 Roland McGrath <roland@redhat.com>
2621 * Makefile.am (libdw.so): Don't depend on $(zip_LIBS), just link it in.
2623 2008-01-06 Roland McGrath <roland@redhat.com>
2625 * libdwP.h (struct Dwarf_Abbrev): Change type of 'has_children' to bool.
2627 * dwarf_haschildren.c: Return -1 for error case, not 0.
2629 * Makefile.am (libdw.so): Link in $(zip_LIBS).
2631 2009-01-06 Ulrich Drepper <drepper@redhat.com>
2633 * dwarf.h: Add definition for unwind and call frame information.
2635 * memory-access.h: Define read_ubyte_unaligned, read_sbyte_unaligned,
2636 read_ubyte_unaligned_inc, and read_sbyte_unaligned_inc.
2638 2008-08-15 Roland McGrath <roland@redhat.com>
2640 * libdw.map (ELFUTILS_0.136): New version set, inherits from
2641 ELFUTILS_0.130. Add dwfl_addrsegment, dwfl_report_segment.
2643 2008-01-21 Ulrich Drepper <drepper@redhat.com>
2645 * dwarf_child.c: Minor optimizations.
2646 * dwarf_getattrs.c: Likewise.
2647 * dwarf_getpubnames.c: Likewise.
2648 * dwarf_siblingof.c: Likewise.
2649 * dwarf_tag.c: Likewise.
2651 2008-01-18 Ulrich Drepper <drepper@redhat.com>
2653 * dwarf_getsrclines.c (dwarf_getsrclines): Don't require exact match
2654 of DWARF_VERSION comparison, just fail if the file's version is newer.
2656 2008-01-17 Nick Clifton <nickc@redhat.com>
2658 * dwarf.h (DWARF3_LENGTH_MIN_ESCAPE_CODE): New define.
2659 (DWARF3_LENGTH_MAX_ESCAPE_CODE): New define.
2660 (DWARF3_LENGTH_64_BIT): New define.
2661 * dwarf_getaranges (dwarf_getaranges): Use the new definitions.
2662 * dwarf_getpubnames: Include dwarf.h.
2663 (get_offsets): Use the new definitions.
2664 * dwarf_getsrclines.c (dwarf_getsrclines): Use the new defintions.
2665 * dwarf_nextcu.c: Include dwarf.h. Correct comment.
2666 (dwarf_nextcu): Use the new definitions.
2668 * libdwP.h (DIE_OFFSET_FROM_CU_OFFSET): New macro.
2669 * dwarf_diecu.c (dwarf_diecu): Use the new macro.
2670 * dwarf_getaranges (dwarf_getaranges): Use the new macro.
2671 * dwarf_nextcu.c (dwarf_nextcu): Use the new macro.
2673 * dwarf_getpubnames (get_offsets): Replace assertion with test and
2676 * dwarf_entry_breakpoints.c (dwarf_entry_breakpoints): Use CUDIE.
2678 * dwarf_siblingof (dwarf_siblingof): Detect a NULL return pointer.
2679 Set the address in the return structure to the address of the next
2680 non-sibling die, if there is no sibling and the return pointer is
2681 not the same as the die pointer.
2682 * libdw.h: Expand the description of the dwarf_siblingof prototype.
2684 * dwarf_child.c: Fix typo in comment.
2686 * libdwP.h (DWARF_VERSION): Change to 3.
2688 * dwarf_formref.c (__libdw_formref.c): Handle attributes which do
2689 not have a initialised valp pointer.
2691 * dwarf_getattrs.c (dwarf_getattrs): Return 1 rather than 0 when
2692 the end of the attributes is reached. When the callback fails,
2693 return the address of the failing attribute, not the address of
2695 * libdw.h: Expand the description of the dwarf_getattrs prototype.
2697 * dwarf_child.c (__libdw_find_attr): Use the new definition.
2698 (dwarf_child): Likewise.
2699 * dwarf_tag.c (__libdw_findabbrev): Likewise.
2700 (dwarf_tag): Likewise.
2702 2008-01-08 Roland McGrath <roland@redhat.com>
2704 * Makefile.am (euinclude): Variable removed.
2705 (pkginclude_HEADERS): Set this instead of euinclude_HEADERS.
2706 (libdw.so): Pass -Wl,--enable-new-dtags,-rpath,$(pkglibdir).
2708 2007-10-17 Roland McGrath <roland@redhat.com>
2710 * libdw.h (__deprecated_attribute__): New macro.
2711 (dwarf_formref): Mark it deprecated.
2712 * dwarf_formref.c (__libdw_formref): New function, broken out of ...
2713 (dwarf_formref): ... here. Call it. Remove INTDEF.
2714 * libdwP.h: Remove INTDECL.
2715 Declare __libdw_formref.
2716 * dwarf_siblingof.c (dwarf_siblingof): Call __libdw_formref instead.
2717 * dwarf_formref_die.c: Likewise. Handle DW_FORM_ref_addr here.
2719 * libdw_form.c (__libdw_form_val_len): Fix DW_FORM_ref_addr result,
2720 needs to check CU->version.
2722 * libdwP.h (struct Dwarf_CU): New member `version'.
2723 * libdw_findcu.c (__libdw_findcu): Initialize it.
2725 * dwarf_child.c: Return 1 for null entry as first child.
2727 2007-10-05 Roland McGrath <roland@redhat.com>
2729 * dwarf_begin_elf.c (check_section): Punt on SHT_NOBITS sections.
2731 * libdw.h (__extern_inline): Rename to __libdw_extern_inline.
2732 [__OPTIMIZE__] (dwarf_whatattr, dwarf_whatform): Update uses.
2734 2007-10-03 Roland McGrath <roland@redhat.com>
2736 * libdw.map (ELFUTILS_0.130: Add dwfl_build_id_find_elf
2737 and dwfl_build_id_find_debuginfo.
2739 * libdw.map (ELFUTILS_0.130): New version set, inherits from
2740 ELFUTILS_0.127. Add dwfl_module_build_id, dwfl_module_report_build_id.
2742 2007-10-02 Roland McGrath <roland@redhat.com>
2744 * libdw_visit_scopes.c (classify_die): Return walk for class_type and
2747 2007-08-07 Roland McGrath <roland@redhat.com>
2749 * dwarf_getscopes.c (pc_match): Swallow dwarf_haspc error return when
2750 error code is DWARF_E_NOERROR (0).
2752 * dwarf_getscopes.c (pc_record): Always bail early if DIE->prune.
2753 Fix typo in __libdw_visit_scopes argument.
2755 * dwarf_getscopes.c (pc_match): Check dwarf_haspc error return,
2756 swallow DWARF_E_NO_DEBUG_RANGES but not other errors.
2758 2007-07-03 Roland McGrath <roland@redhat.com>
2760 * libdw.h (__extern_inline): New macro.
2761 [__OPTIMIZE__] (dwarf_whatattr, dwarf_whatform): Use it.
2763 2007-04-16 Roland McGrath <roland@redhat.com>
2765 * libdw.map (ELFUTILS_0.127): Add dwfl_module_address_section.
2767 2007-04-05 Roland McGrath <roland@redhat.com>
2769 * dwarf_getsrcdirs.c: New file.
2770 * Makefile.am (libdw_a_SOURCES): Add it.
2771 * libdw.h: Declare dwarf_getsrcdirs.
2772 * libdw.map (ELFUTILS_0.127): Add it.
2774 * libdwP.h (struct Dwarf_Files_s): New member ndirs.
2775 * dwarf_getsrclines.c (dwarf_getsrclines): Don't clobber NDIRLIST to
2776 zero before we use it to check for DWARF_E_INVALID_DIR_IDX.
2777 Save DIRARRAY in the Dwarf_Files.
2779 * dwarf_ranges.c (dwarf_ranges): Don't sign-extend 32-bit BEGIN
2780 address to check for all-ones base address entry. Check directly.
2781 Reported by Sébastien Dugué <sebastien.dugue@bull.net>.
2783 2007-03-25 Roland McGrath <roland@redhat.com>
2785 * dwarf_begin_elf.c (check_section): Return Dwarf * instead of void.
2786 Return NULL when freeing RESULT on error.
2787 (global_read, scngrp_read): Check return value from check_section,
2788 break out of loop after it has freed RESULT.
2789 (valid_p): Handle null argument.
2791 2007-03-12 Roland McGrath <roland@redhat.com>
2793 * libdw.map (ELFUTILS_0.127): Add dwfl_report_begin_add.
2795 2007-03-04 Roland McGrath <roland@redhat.com>
2797 * libdw.map (ELFUTILS_0.127): New version set, inherits from
2798 ELFUTILS_0.126. Add dwfl_module_addrsym.
2800 2007-02-10 Roland McGrath <roland@redhat.com>
2802 * dwarf.h (DW_OP_fbreg): Comment fix.
2804 2007-02-03 Roland McGrath <roland@redhat.com>
2806 * dwarf_getelf.c (dwarf_getelf): Renamed from dwarf_get_elf.
2807 * libdw.map (ELFUTILS_0.126): New version set, inherits from
2808 ELFUTILS_0.122. Move dwarf_getelf there; it was never truly
2809 exported in the past.
2811 2006-12-17 Roland McGrath <roland@redhat.com>
2813 * dwarf_getlocation.c (dwarf_getlocation_addr): Use zero as base
2814 address when the CU is missing attributes due to buggy GCC.
2816 2006-08-29 Roland McGrath <roland@redhat.com>
2818 * Makefile.am (CLEANFILES): Add libdw.so.$(VERSION).
2820 * libdw.h (dwarf_diecu): Add __nonnull_attribute__.
2821 (dwarf_child): Don't list arg 1 in __nonnull_attribute__.
2823 * libdw_alloc.c (__libdw_allocate): Take new ALIGN argument, make sure
2824 result is aligned. Adjust NEWP->remaining here for this allocation.
2825 * libdwP.h: Update decl.
2826 (libdw_alloc): Update caller.
2828 2006-07-12 Ulrich Drepper <drepper@redhat.com>
2830 * dwarf_child.c: Adjust for internal_function_def removal.
2831 * dwarf_getabbrev.c: Likewise.
2832 * dwarf_tag.c: Likewise.
2833 * libdw_form.c: Likewise.
2834 * memory-access.c: Likewise.
2836 2006-06-28 Roland McGrath <roland@redhat.com>
2838 * libdw.map: Export dwfl_linecu, dwfl_line_comp_dir.
2840 * libdw.map: Bump to 0.122; export dwfl_module_getsymtab and
2843 2006-05-27 Ulrich Drepper <drepper@redhat.com>
2845 * libdw.h: Add extern "C".
2847 2006-05-22 Ulrich Drepper <drepper@redhat.com>
2849 * dwarf_getaranges.c (dwarf_getaranges): Handle files without
2850 aranges information.
2852 2006-05-21 Ulrich Drepper <drepper@redhat.com>
2854 * libdw.h: Add nonnull attributes to dwarf_tag, dwarf_getattrs,
2857 2006-02-28 Roland McGrath <roland@redhat.com>
2859 * dwarf.h: Add missing DW_ATE_*, DW_TAG_*, DW_LANG_*, DW_CFA_*,
2860 DW_OP_* values, to match DWARF 3.0. Add new DW_DS_*, DW_END_*
2861 values from DWARF 3.0.
2863 2006-02-22 Roland McGrath <roland@redhat.com>
2865 * libdw.map: Bump to 0.120; export dwfl_version.
2867 2005-12-22 Roland McGrath <roland@redhat.com>
2869 * libdw.map: Bump to 0.119; export dwfl_linux_proc_maps_report.
2871 2005-12-12 Roland McGrath <roland@redhat.com>
2873 * dwarf_ranges.c: Copy CU base address-finding code from
2876 2005-12-09 Roland McGrath <roland@redhat.com>
2878 * dwarf_getlocation.c (dwarf_getlocation_addr): Add some unlikelys.
2879 Delay CU base lookup until it's needed.
2880 If CU base lookup fails with no error, flag invalid DWARF.
2882 2005-11-25 Roland McGrath <roland@redhat.com>
2884 * libdw.map: Bump to 0.118; export dwfl_module_register_names.
2886 2005-11-15 Roland McGrath <roland@redhat.com>
2888 * Makefile.am [BUILD_STATIC] (AM_CFLAGS): Add -fpic.
2890 2005-11-13 Roland McGrath <roland@redhat.com>
2892 * libdw.map: Bump to 0.117; export dwfl_module_return_value_location.
2894 2005-10-27 Roland McGrath <roland@redhat.com>
2896 * dwarf_entry_breakpoints.c (search_range): Fix binary search code;
2897 don't match end_sequence markers.
2899 * dwarf_getsrclines.c (compare_lines): Sort end_sequence markers
2900 before normal records at the same address.
2901 * dwarf_getsrc_die.c (dwarf_getsrc_die): Don't match an end_sequence
2904 2005-10-26 Roland McGrath <roland@redhat.com>
2906 * dwarf_getfuncs.c (dwarf_getfuncs): Use Dwarf_Die, not Dwarf_Func.
2907 * dwarf_func_file.c: Renamed to ...
2908 * dwarf_decl_file.c: ... here.
2909 * dwarf_func_col.c: Renamed to ...
2910 * dwarf_decl_column.c: ... here.
2911 * dwarf_func_line.c: Renamed to ...
2912 * dwarf_decl_line.c: ... here.
2913 (dwarf_func_line): Renamed to ...
2914 (dwarf_decl_line): ... this. Take a Dwarf_Die * argument.
2915 (__libdw_func_intval): Renamed __libdw_attr_intval.
2916 * dwarf_func_name.c: File removed.
2917 * dwarf_func_lowpc.c: File removed.
2918 * dwarf_func_highpc.c: File removed.
2919 * dwarf_func_entrypc.c: File removed.
2920 * dwarf_func_die.c: File removed.
2921 * Makefile.am (libdw_a_SOURCES): Updated.
2922 * libdw.h: Update decls.
2923 (Dwarf_Func): Type removed.
2924 * libdwP.h: Update decls.
2925 (struct Dwarf_Func_s): Type removed.
2926 * libdw.map: Updated.
2928 * libdwP.h (CUDIE): New macro.
2929 * dwarf_getlocation.c (dwarf_getlocation_addr): Use it.
2930 * dwarf_getscopes_die.c (dwarf_getscopes_die): Likewise.
2931 * dwarf_ranges.c (dwarf_ranges): Likewise.
2933 * dwarf_getloclist.c: Renamed to ...
2934 * dwarf_getlocation.c: ... here.
2935 (getloclist): Renamed to getlocation.
2936 (dwarf_getloclist): Renamed to dwarf_getlocation.
2937 (dwarf_addrloclists): Renamed to dwarf_getlocation_addr.
2938 * Makefile.am (libdw_a_SOURCES): Updated.
2939 * libdw.h (dwarf_getloclist): Renamed to dwarf_getlocation.
2940 (dwarf_addrloclists): Renamed dwarf_getlocation_addr.
2941 (Dwarf_Loc): Renamed Dwarf_Op.
2942 * libdwP.h (struct loc_s): Update use.
2943 * libdw.map: Update map.
2945 * dwarf_entry_breakpoints.c: Use the second line record within the
2946 function, regardless of its source location data.
2948 2005-10-25 Roland McGrath <roland@redhat.com>
2950 * dwarf_entry_breakpoints.c: Fall back to entrypc for contiguous too.
2952 * libdw.map: Add dwarf_entrypc, dwarf_entry_breakpoints.
2954 2005-10-14 Roland McGrath <roland@redhat.com>
2956 * dwarf_diecu.c (dwarf_diecu): New file.
2957 * Makefile.am (libdw_a_SOURCES): Add it.
2958 * libdw.h: Declare dwarf_diecu.
2959 * libdw.map: Export it.
2961 * libdw.map: Bump to 0.116; export dwarf_ranges.
2963 2005-09-20 Roland McGrath <roland@redhat.com>
2965 * dwarf_haspc.c: Use dwarf_ranges.
2966 * dwarf_entry_breakpoints.c: Likewise.
2968 * dwarf_ranges.c: New file.
2969 * Makefile.am (libdw_a_SOURCES): Add it.
2970 * libdw.h: Declare dwarf_ranges.
2971 * libdwP.h: Add INTDECL.
2973 2005-09-14 Roland McGrath <roland@redhat.com>
2975 * dwarf_entry_breakpoints.c (dwarf_entry_breakpoints): Fix braino in
2976 prologue_end marker scanning loop.
2978 2005-09-11 Roland McGrath <roland@redhat.com>
2980 * dwarf.h: Comment typo fix.
2982 2005-09-07 Roland McGrath <roland@redhat.com>
2984 * dwarf_entry_breakpoints.c: New file.
2985 * Makefile.am (libdw_a_SOURCES): Add it.
2986 * libdw.h: Declare dwarf_entry_breakpoints.
2988 * dwarf_entrypc.c: New file.
2989 * Makefile.am (libdw_a_SOURCES): Add it.
2990 * libdw.h: Declare dwarf_entrypc.
2991 * libdwP.h: Add INTDECL.
2993 2005-08-28 Ulrich Drepper <drepper@redhat.com>
2995 * Makefile.am: Use $(LINK) not $(CC) when creating DSO.
2996 (%.os): Use COMPILE.os.
2997 (COMPILE.os): Filter out gconv options.
2999 2005-08-27 Roland McGrath <roland@redhat.com>
3001 * dwarf_getscopes.c (dwarf_getscopes): Rewritten using
3002 __libdw_visit_scopes.
3004 * dwarf_getscopes_die.c: New file.
3005 * Makefile.am (libdw_a_SOURCES): Add it.
3006 * libdw.h: Declare dwarf_getscopes_die.
3007 * libdw.map: Bump to 0.115 and add it.
3009 * libdw_visit_scopes.c (__libdw_visit_scopes): Pass a struct
3010 containing a DIE and its parent pointer, instead of just Dwarf_Die.
3011 Take two functions for both preorder and postorder visitors.
3012 * libdwP.h: Update decl.
3013 (struct Dwarf_Die_Chain): New type.
3014 * dwarf_func_inline.c: Update uses.
3016 * dwarf_diename.c (dwarf_diename): Use dwarf_attr_integrate.
3018 * libdwP.h: Add INTDECL.
3019 * dwarf_func_name.c (dwarf_func_name): Use dwarf_diename.
3021 2005-08-23 Roland McGrath <roland@redhat.com>
3023 * dwarf_attr_integrate.c (dwarf_attr_integrate): Treat
3024 DW_AT_specification the same as DW_AT_abstract_origin.
3026 2005-08-20 Roland McGrath <roland@redhat.com>
3028 * libdw.map: Add dwfl_cumodule, remove dwfl_linecu.
3029 Add dwfl_linux_kernel_report_offline, dwfl_offline_section_address,
3030 and dwfl_report_offline.
3032 2005-08-19 Roland McGrath <roland@redhat.com>
3034 * libdw.map: Bump version to ELFUTILS_0.114 for libdwfl changes.
3035 Add dwfl_module_relocate_address, dwfl_module_relocations,
3036 dwfl_module_relocation_info.
3038 2005-08-18 Roland McGrath <roland@redhat.com>
3040 * dwarf_getscopes.c (dwarf_getscopes): Include the CU itself as
3041 outermost scope in the results.
3043 2005-08-15 Roland McGrath <roland@redhat.com>
3045 * dwarf_func_inline.c: New file.
3046 * Makefile.am (libdw_a_SOURCES): Add it.
3047 * libdw.h: Declare dwarf_func_inline, dwarf_func_inline_instances.
3048 * libdw.map: Add them.
3050 * dwarf_func_die.c: New file.
3051 * Makefile.am (libdw_a_SOURCES): Add it.
3052 * libdw.h: Declare dwarf_func_die.
3053 * libdw.map: Add it. Bump version to ELFUTILS_0.114.
3055 2005-08-10 Ulrich Drepper <drepper@redhat.com>
3057 * dwarf_getsrclines.c (dwarf_getsrclines): Correct fallout of renaming
3058 of DW_LNS_set_epilog_begin.
3060 2005-08-09 Roland McGrath <roland@redhat.com>
3062 * dwarf.h (DW_LNS_set_epilog_begin): Renamed DW_LNS_set_epilogue_begin.
3064 * dwarf_end.c: Add INTDEF.
3065 * dwarf_error.c (dwarf_errmsg): Likewise.
3066 * libdwP.h (dwarf_end, dwarf_errmsg): Add INTDECLs.
3068 2005-08-01 Roland McGrath <roland@redhat.com>
3070 * dwarf_getaranges.c (dwarf_getaranges): Check for bogus offset.
3071 * dwarf_getabbrev.c (__libdw_getabbrev): Likewise.
3073 2005-07-28 Ulrich Drepper <drepper@redhat.com>
3075 * Makefile.am (libdw.so): No need to link with libeu.a anymore.
3076 (libdw_a_LIBADD): Add all files from libdwfl.a.
3078 2005-07-27 Roland McGrath <roland@redhat.com>
3080 * Makefile.am (libdw.so): Link ../libdwfl/libdwfl_pic.a in,
3081 along with ../libebl/libebl.a and ../lib/libeu.a;
3082 depend on ../libelf/libelf.so.
3083 (libdw_so_LDADD): New variable.
3084 * libdw.map: Add dwfl_* symbols formerly in ../libdwfl/libdwfl.map.
3086 * libdw.map: Define an empty base version and move all symbols to
3087 version ELFUTILS_0.111; don't define ELFUTILS_1.0 at all yet.
3089 2005-07-23 Ulrich Drepper <drepper@redhat.com>
3091 * dwarf_error.c: Add internal alias for dwarf_errno.
3092 * libdwP.h: Declare __dwarf_errno_internal.
3093 * dwarf_getloclist.c: Use INTDEF for dwarf_errno.
3095 * dwarf_error.c [USE_TLS]: Actually use __thread in definition of
3098 2005-06-01 Roland McGrath <roland@redhat.com>
3100 * dwarf_getaranges.c (dwarf_getaranges): Sort result array.
3101 * dwarf_getarange_addr.c (dwarf_getarange_addr): Use binary search.
3103 2005-06-08 Roland McGrath <roland@redhat.com>
3105 * memory-access.h (get_uleb128_step, get_uleb128): Remove casts.
3106 (get_sleb128_step, get_sleb128): Likewise.
3107 * dwarf_getattrs.c (dwarf_getattrs): Add consts.
3108 * dwarf_getloclist.c (getloclist): Likewise.
3109 * dwarf_formblock.c (dwarf_formblock): Likewise.
3110 * dwarf_getsrclines.c (dwarf_getsrclines): Likewise.
3111 * dwarf_getabbrevattr.c (dwarf_getabbrevattr): Likewise.
3112 * dwarf_formref.c (dwarf_formref): Likewise.
3113 * dwarf_formsdata.c (dwarf_formsdata): Likewise.
3114 * dwarf_formudata.c (dwarf_formudata): Likewise.
3115 * dwarf_haschildren.c (dwarf_haschildren): Likewise.
3116 * dwarf_child.c (__libdw_find_attr, __libdw_find_attr): Likewise.
3117 * dwarf_tag.c (dwarf_tag): Likewise.
3118 * dwarf_getabbrev.c (__libdw_getabbrev): Likewise.
3119 * memory-access.c (__libdw_get_uleb128, __libdw_get_sleb128): Likewise.
3120 * libdw_form.c (__libdw_form_val_len): Likewise.
3121 * libdwP.h: Update decl.
3123 2005-06-04 Roland McGrath <roland@redhat.com>
3125 * memory-access.h (get_uleb128_rest_return): New macro.
3126 [! IS_LIBDW] (__libdw_get_uleb128): New static, defined using it.
3127 (get_sleb128_rest_return): New macro.
3128 [! IS_LIBDW] (__libdw_get_sleb128): New static, defined using it.
3129 * memory-access.c: New file.
3130 * Makefile.am (libdw_a_SOURCES): Add it.
3131 (DEFS): Add -DIS_LIBDW.
3133 2005-05-31 Roland McGrath <roland@redhat.com>
3135 * dwarf_formref_die.c (dwarf_formref_die): Add CU header offset to
3138 2005-05-30 Roland McGrath <roland@redhat.com>
3140 * dwarf_getloclist.c (dwarf_addrloclists): Use DW_AT_entry_pc for base
3141 address if DW_AT_low_pc is missing. Not to spec, but GCC generates it.
3143 * dwarf_getloclist.c (dwarf_addrloclists): Don't sign-extend 4-byte
3144 BEGIN value. Instead, match base address entries separately for
3147 2005-05-28 Roland McGrath <roland@redhat.com>
3149 * dwarf_getloclist.c (dwarf_addrloclists): Fix decoding to advance
3150 past location expression contents.
3152 2005-05-23 Roland McGrath <roland@redhat.com>
3154 * dwarf_getsrclines.c: Comment typo fix.
3156 * dwarf_haspc.c (dwarf_haspc): Fix CU DIE address calculation.
3157 * dwarf_getloclist.c (dwarf_addrloclists): Likewise.
3159 2005-05-22 Ulrich Drepper <drepper@redhat.com>
3161 * libdwP.h: Only use INTDECL for alias prototypes.
3163 2005-05-19 Roland McGrath <roland@redhat.com>
3165 * dwarf_getloclist.c (attr_ok): Permit DW_AT_static_link too.
3167 * dwarf_getscopevar.c: New file.
3168 * Makefile.am (libdw_a_SOURCES): Add it.
3169 * libdw.h: Declare dwarf_getscopevar.
3171 * dwarf_getsrcfiles.c: Add INTDEF.
3172 * dwarf_haschildren.c: Likewise.
3173 * libdwP.h (dwarf_getsrcfiles, dwarf_haschildren): Add INTDECL.
3175 * dwarf_getscopes.c: New file.
3176 * Makefile.am (libdw_a_SOURCES): Add it.
3177 * libdw.h: Declare dwarf_getscopes.
3178 * libdw.map: Add it.
3180 2005-05-18 Roland McGrath <roland@redhat.com>
3182 * libdwP.h (IDX_debug_ranges): New enum constant.
3183 * dwarf_begin_elf.c (dwarf_scnnames): Add it for ".debug_ranges".
3184 * libdwP.h (DWARF_E_NO_DEBUG_RANGES): New enum constant.
3185 * dwarf_error.c (errmsgs): Add it.
3186 * dwarf_haspc.c: New file.
3187 * libdw.h: Declare dwarf_haspc.
3188 * libdw.map: Add it.
3189 * libdwP.h: Add INTDECL.
3191 * dwarf_attr_integrate.c: New file.
3192 * dwarf_hasattr_integrate.c: New file.
3193 * Makefile.am (libdw_a_SOURCES): Add them.
3194 * libdw.h: Declare dwarf_attr_integrate, dwarf_hasattr_integrate.
3195 * libdw.map: Add them.
3197 * dwarf_hasattr.c: Add INTDEF.
3198 * libdwP.h: Add INTDECL for it.
3200 * dwarf_formref_die.c: New file.
3201 * Makefile.am (libdw_a_SOURCES): Add it.
3202 * libdw.h (dwarf_formref_die): Declare it.
3203 * libdwP.h (dwarf_formref_die): Add INTDECL.
3204 * libdw.map: Add it.
3206 * dwarf_getloclist.c (attr_ok, getloclist): New functions, broken out
3208 (dwarf_getloclist): ... here. Call them.
3209 (dwarf_addrloclists): New function.
3210 * libdw.h: Declare it.
3211 * libdw.map: Add it.
3213 * dwarf_getmacros.c (dwarf_getmacros): Don't bail at
3214 DW_MACINFO_end_file. Recognize type 0 as terminator.
3216 2005-05-05 Roland McGrath <roland@redhat.com>
3218 * dwarf_getsrc_die.c (dwarf_getsrc_die): Use binary search.
3220 * dwarf_getsrclines.c (dwarf_getsrclines): Sort result array, since
3221 the line program does not produce all entries in ascending order.
3223 2005-04-25 Ulrich Drepper <drepper@redhat.com>
3225 * dwarf_getsrc_file.c (dwarf_getsrc_file): Handle multiple
3226 occurences (e.g., inlines) better.
3228 2005-04-24 Ulrich Drepper <drepper@redhat.com>
3230 * libdw.h (DWARF_END_ABBREV): Define.
3231 * dwarf_getabbrev.c (__libdw_getabbrev): Return DWARF_END_ABBREV if
3233 * dwarf_offabbrev.c (dwarf_offabbrev): Return -1 on error, 1 if end
3235 * dwarf_tag.c (__libdw_findabbrev): Also recognize DWARF_END_ABBREV
3236 as error of __libdw_getabbrev.
3238 2005-04-04 Ulrich Drepper <drepper@redhat.com>
3240 * dwarf_getsrc_file.c (dwarf_getsrc_file): Minor optimization.
3242 * dwarf_getsrc_file.c (dwarf_getsrc_file): Always pass number of
3243 results back to caller.
3245 2005-04-04 Roland McGrath <roland@redhat.com>
3247 * dwarf_getsrc_file.c (dwarf_getsrc_file): Use size_t for CUHL.
3249 * dwarf_func_line.c (__libdw_func_intval): Use internal_function in
3252 2005-04-04 Ulrich Drepper <drepper@redhat.com>
3254 * dwarf_getsrc_file.c (dwarf_getsrc_file): Use INTUSE.
3256 * dwarf_getsrc_file.c: New file.
3257 * Makefile.am (libdw_a_SOURCES): Add dwarf_getsrc_file.c.
3258 * libdw.h: Declare dwarf_getsrc_file.
3259 * libdw.map: Add dwarf_getsrc_file.
3261 2005-04-02 Ulrich Drepper <drepper@redhat.com>
3263 * dwarf_func_entrypc.c: New file.
3264 * dwarf_func_col.c: New file.
3265 * dwarf_func_line.c: New file.
3266 * dwarf_func_file.c: New file.
3267 * libdw.h: Add prototypes for new functions.
3268 * libdw.map: Add dwarf_func_entrypc, dwarf_func_col, dwarf_func_line,
3270 * Makefile.am (libdw_a_SOURCES): Add dwarf_func_entrypc.c,
3271 dwarf_func_col.c, dwarf_func_line.c, dwarf_func_file.c.
3272 * libdwP.h (struct Dwarf_Func_s): Add cudie element.
3273 Declare __libdw_func_intval and __dwarf_formsdata_internal.
3274 * dwarf_getfuncs.c: Also fill in cudie in Dwarf_Func object.
3275 * dwarf_formsdata.c: Use INTUSE and INTDEF to avoid PLTs.
3277 * dwarf.h: Add some DWARF3 definitions.
3279 2005-04-01 Ulrich Drepper <drepper@redhat.com>
3281 * dwarf_getfuncs.c: New file.
3282 * dwarf_func_highpc.c: New file.
3283 * dwarf_func_lowpc.c: New file.
3284 * dwarf_func_name.c: New file.
3285 * Makefile.am (libdw_a_SOURCES): Add dwarf_getfuncs.c,
3286 dwarf_func_highpc.c, dwarf_func_lowpc.c, and dwarf_func_name.c.
3287 * libdw.map: Add dwarf_getfuncs, dwarf_func_highpc, dwarf_func_lowpc,
3288 and dwarf_func_name.
3289 * libdw.h: Add prototypes for new functions.
3290 * dwarf_child.c: Use INTUSE and INTDEF to avoid PLTs.
3291 * dwarf_siblingof.c: Likewise.
3292 * dwarf_dieoffset.c: Likewise.
3293 * dwarf_highpc.c: Likewise.
3294 * dwarf_lowpc.c: Likewise.
3295 * libdwP.h: Add prototypes for internal functions.
3296 Define Dwarf_Func_s structure.
3298 2005-03-29 Ulrich Drepper <drepper@redhat.com>
3300 * libdw.h: Add padding in Dwarf_die.
3302 * dwarf_arrayorder.c: Use INTUSE and INTDEF to avoid PLTs.
3303 * dwarf_attr.c: Likewise.
3304 * dwarf_begin.c: Likewise.
3305 * dwarf_begin_elf.c: Likewise.
3306 * dwarf_bitoffset.c: Likewise.
3307 * dwarf_bitsize.c: Likewise.
3308 * dwarf_bytesize.c: Likewise.
3309 * dwarf_diename.c: Likewise.
3310 * dwarf_formaddr.c: Likewise.
3311 * dwarf_formblock.c: Likewise.
3312 * dwarf_formref.c: Likewise.
3313 * dwarf_formstring.c: Likewise.
3314 * dwarf_formudata.c: Likewise.
3315 * dwarf_getarange_addr.c: Likewise.
3316 * dwarf_getarangeinfo.c: Likewise.
3317 * dwarf_getaranges.c: Likewise.
3318 * dwarf_getloclist.c: Likewise.
3319 * dwarf_getmacros.c: Likewise.
3320 * dwarf_getsrc_die.c: Likewise.
3321 * dwarf_getsrcfiles.c: Likewise.
3322 * dwarf_getsrclines.c: Likewise.
3323 * dwarf_highpc.c: Likewise.
3324 * dwarf_lowpc.c: Likewise.
3325 * dwarf_nextcu.c: Likewise.
3326 * dwarf_offdie.c: Likewise.
3327 * dwarf_siblingof.c: Likewise.
3328 * dwarf_srclang.c: Likewise.
3329 * dwarf_tag.c: Likewise.
3330 * libdw_findcu.c: Likewise.
3331 * libdwP.h: Add prototypes for internal functions.
3333 * dwarf_addrdie.c: New file.
3334 * dwarf_macro_opcode.c: New file.
3335 * dwarf_macro_param1.c: New file.
3336 * dwarf_macro_param2.c: New file.
3337 * libdw.h: Add declarations. Move Dwarf_Macro definition to libdwP.h.
3338 * libdwP.h: Remove Dwarf_Macro definition.
3339 * Makefile.am (libdw_a_SOURCES): Add dwarf_addrdie.c,
3340 dwarf_macro_opcode.c, dwarf_macro_param1.c, and dwarf_macro_param2.c.
3341 * libdw.map: Add entries for new functions.
3343 2005-03-21 Ulrich Drepper <drepper@redhat.com>
3345 * libdw.h: Handle broken gcc < 4.
3347 2005-02-15 Ulrich Drepper <drepper@redhat.com>
3349 * Makefile (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2.
3351 * dwarf_begin_elf.c: Fix warnings.
3352 * dwarf_dieoffset.c: Likewise.
3353 * dwarf_end.c: Likewise.
3354 * dwarf_error.c: Likewise.
3355 * dwarf_getpubnames.c: Likewise.
3357 * libdwP.h: Add new error values.
3358 * dwarf_error.c: Support new error values.
3359 * dwarf_getpubnames.c: Check parameter value.
3361 2005-02-05 Ulrich Drepper <drepper@redhat.com>
3363 * Makefile.am: Check for text relocations in constructed DSO.
3365 * Makefile.am [MUDFLAP] (AM_CFLAGS): Add -fmudflap.
3367 2005-02-04 Ulrich Drepper <drepper@redhat.com>
3369 * dwarf_siblingof.c (dwarf_siblingof): Add some buffer boundary
3370 checks to not read over buffer boundaries for ill-formed DWARF data.
3372 2004-09-25 Ulrich Drepper <drepper@redhat.com>
3374 * dwarf_child.c: Make compile with gcc 4.0.
3375 * dwarf_error.c: Likewise.
3376 * dwarf_formblock.c: Likewise.
3377 * dwarf_getabbrev.c: Likewise.
3378 * dwarf_getattrs.c: Likewise.
3379 * dwarf_getsrclines.c: Likewise.
3380 * dwarf_tag.c: Likewise.
3381 * libdw_form.c: Likewise.
3383 2004-01-20 Ulrich Drepper <drepper@redhat.com>
3385 * Makefile.am: Support building with mudflap.
3387 * dwarf_getloclist.c: Fix warnings gcc 3.4 spits out.
3388 * dwarf_getsrclines.c: Likewise.
3389 * dwarf_memory-access.h: Likewise.
3391 2004-01-19 Ulrich Drepper <drepper@redhat.com>
3393 * dwarf_getsrcfiles.c: Third parameter can be NULL.
3395 * libdw.h: Define Dwarf_macro. Declare dwarf_getmacros.
3396 Third parameter of dwarf_getsrcfiles can be NULL.
3398 * libdw.map: Add dwarf_getmacros.
3399 * Makefile.am (libdw_a_SOURCES): Add dwarf_getmacros.
3400 * dwarf_getmacros.c: New file.
3402 2004-01-18 Ulrich Drepper <drepper@redhat.com>
3404 * libdw.h: Second parameter of dwarf_getaranges can be NULL.
3406 * dwarf_nextcu.c: Return -1 if dwarf parameter is NULL.
3408 * dwarf_getsrclines.c:
3409 Use read_2ubyte_unaligned_inc instead of _inc-less variant.
3411 * dwarf_getaranges.c: Allow naranges parameter to be NULL.
3413 * libdwP.h (_): Use elfutils domain.
3415 * dwarf_getsrclines.c (dwarf_getsrclines): Add more branch prediction.
3417 * dwarf_getsrclines.c: Fix typo in comment.
3419 2004-01-17 Ulrich Drepper <drepper@redhat.com>
3421 * Makefile.am: Support building with mudflap.
3423 2004-01-16 Ulrich Drepper <drepper@redhat.com>
3425 * memory-access.h: Add lots of const in case a pointer passed is const.
3427 * dwarf_formflag.c: New file.
3428 * dwarf_getattrs.c: New file.
3429 * dwarf_error.c: Add new error value.
3430 * libdw.h: Add prototypes for new functions. Adjust prototype for
3432 * libdw.map: Add new functions.
3433 * dwarf_getpubnames.c: Change type of return value and fourth parameter
3435 * libdwP.h: Add new error value.
3436 * Makefile.am (libdw_a_SOURCES): Add dwarf_getattrs.c and
3439 * dwarf_getpubnames.c (dwarf_getpubnames): Just fail if dbg is NULL.
3441 2004-01-12 Ulrich Drepper <drepper@redhat.com>
3443 * dwarf_getarange_addr.c: New file
3444 * dwarf_getarangeinfo.c: New file.
3445 * dwarf_getaranges.c: New file.
3446 * dwarf_onerange.c: New file.
3447 * libdw.h: Declare new functions. Define Dwarf_Arange and
3449 * libdw.map: Add new functions.
3450 * libdwP.h: Add new errors. Add aranges member to struct Dwarf.
3451 Define Dwarf_Aranges_s and Dwarf_Arange_s.
3452 * Makefile.am (libdw_a_SOURCES): Add dwarf_getaranges.c,
3453 dwarf_onearange.c, dwarf_getarangeinfo.c, dwarf_getarange_addr.c.
3454 * dwarf_error.c: Add new message.
3456 2004-01-11 Ulrich Drepper <drepper@redhat.com>
3458 * Makefile.am (libdw_a_SOURCES): Add dwarf_lineaddr.c, dwarf_linecol.c,
3459 dwarf_linebeginstatement.c, dwarf_lineendsequence.c, dwarf_lineblock.c,
3460 dwarf_lineprologueend.c, dwarf_lineepiloguebegin.c, dwarf_onesrcline.c.
3461 * dwarf_error.c: Add another message.
3462 * dwarf_getsrc_die.c: Adjust for Dwarf_Files and Dwarf_Lines
3464 * dwarf_filesrc.c: Likewise.
3465 * dwarf_getsrcfiles.c: Likewise.
3466 * dwarf_getsrclines.c: Likewise.
3467 * dwarf_lineaddr.c: New file.
3468 * dwarf_linebeginstatement.c: New file.
3469 * dwarf_lineblock.c: New file.
3470 * dwarf_linecol.c: New file.
3471 * dwarf_lineendsequence.c: New file.
3472 * dwarf_lineepiloguebegin.c: New file.
3473 * dwarf_lineno.c: New file.
3474 * dwarf_lineprologueend.c: New file.
3475 * dwarf_onesrcline.c: New file.
3476 * dwarf_lineno.c: Change interface to store result in object pointed
3477 to by second parameter.
3478 * libdw.h: Add prototypes for new functions. Change dwarf_lineno
3479 prototype. Define Dwarf_Files and Dwarf_Lines.
3480 * libdw.map: Add new functions.
3481 * libdwP.h: Define Dwarf_Files_s and Dwarf_Lines_s.
3482 * libdw_findcu.c: Don't initialize nlines field.
3484 * dwarf_siblingof: Little optimization.
3486 * dwarf_begin.c: Remember that the ELF descriptor must be closed.
3487 * dwarf_end.c: Close ELF descriptor if free_elf is set.
3488 * libdwP.h (struct Dwarf): Add free_elf field.
3490 * Makefile.am (libdw_a_SOURCES): Add dwarf_getstring.c and
3492 * dwarf_getstring.c: New file.
3493 * dwarf_offabbrev.c: New file.
3494 * libdw.map: Add dwarf_getstring and dwarf_offabbrev.
3495 * dwarf_getabbrev.c (__libdw_getabbrev): Add new dbg and result
3496 parameters. Don't allocate memory if not necessary and don't lookup
3497 previous results if no CU given.
3498 (dwarf_getabbrev): Adjust call to __libdw_getabbrev.
3499 * dwarf_tag.c: Adjust call to __libdw_getabbrev.
3500 * libdw.h: Declare dwarf_offabbrev and dwarf_getstring.
3501 * libdwP.h: Change prototype for __libdw_getabbrev.
3503 * dwarf_getabbrevattr.c: Add offsetp parameter. Fill in before
3504 returning if this is wanted.
3506 2004-01-09 Ulrich Drepper <drepper@redhat.com>
3508 * dwarf_nextcu.c: Add new parameter offset_sizep. Initialize it
3509 with offset_size value.
3510 * libdw.h: Adjust dwarf_nextcu prototype.
3511 * libdwP.h (struct Dwarf_CU): Add offset_size member.
3512 * libdw_findcu.c: Adjust dwarf_nextcu call. Initialize offset_size
3513 member of new CU struct.
3514 * dwarf_formstring.c: Depend on offset_size not address_size for
3515 DW_FORM_strp handling.
3516 * dwarf_form.c: Likewise for DW_FORM_strp and DW_FORM_ref_addr.
3518 * dwarf_tag.c (__libdw_findabbrev): Return correct value for
3520 (dwarf_tag): Correctly recognize failed lookup.
3522 * dwarf_end.c (cu_free): Call tdestroy for locs member. Use new
3524 * dwarf_error.c: Add message for DWARF_E_NO_BLOCK.
3525 * dwarf_formblock.c: New file.
3526 * dwarf_getloclist.c: Rewrite to handle a single block.
3527 * libdw.h: Define Dwarf_Block. Rename Dwarf_Loc members. Remove
3528 Dwarf_Locdesc definition. Declare dwarf_formblock. Remove
3529 dwarf_getloclistent declaration.
3530 * libdw.map: Add dwarf_formblock, remove dwarf_getloclistent.
3531 * libdwP.h: Define struct loc_s and DWARF_E_NO_BLOCK.
3532 Add locs member to struct Dwarf_CU.
3533 * libdw_fundcu.c: Initialize locs member of new CU.
3534 * Makefile.am (libdw_a_SOURCES): Add dwarf_formblock.c.
3535 Remove dwarf_getloclistent.c.
3537 2004-01-07 Ulrich Drepper <drepper@redhat.com>
3539 * libdw.h: Use __nonnull__ attribute only for gcc >= 3.3.
3540 * libdwP.h: Likewise.
3542 * dwarf_getloclist.c: New file.
3543 * dwarf_getloclistent.c: New file.
3544 * libdw.h: Define Dwarf_Loc and Dwarf_Locdesc.
3545 Declare dwarf_getloclistent and dwarf_getloclist.
3546 * libdw.map: Add dwarf_getloclistent and dwarf_getloclist.
3547 * libdwP.h: Define DWARF_E_NO_LOCLIST.
3548 * Makefile.am (libdw_a_SOURCES): Add dwarf_getloclistent.c and
3551 * dwarf_error.c: More error messages.
3553 2004-01-06 Ulrich Drepper <drepper@redhat.com>
3555 * dwarf_getsrclines.c: Remove debugging support.
3557 * dwarf_getsrcfiles.c: New file.
3558 * dwarf_filesrc.c: New file.
3559 * libdw.h: Declare these functions. Define Dwarf_File.
3560 * libdwP.c: Adjust Dwarf_File_s definition.
3561 * libdw.map: Add these functions.
3562 * Makefile.am (libdw_a_SOURCES): Add dwarf_getsrcfiles.c and
3564 * dwarf_getsrclines.c: Initialize cu->files.
3566 2004-01-05 Ulrich Drepper <drepper@redhat.com>
3568 * libdw.h: Add more nonnull function attributes.
3570 * dwarf_begin_elf.c (dwarf_begin_elf): Don't initialize mem_tail->next.
3571 * dwarf_end.c (cu_free): New function.
3572 (dwarf_end): Also free CU tree. Correct freeing of memory blocks.
3573 * dwarf_error.c (errmsgs): Add new messages.
3574 * dwarf_getsrc_die.c: New file.
3575 * dwarf_getsrclines.c: New file.
3576 * dwarf_lineno.c: New file.
3577 * dwarf_linesrc.c: New file.
3578 * dwarf_nextcu.c (dwarf_nextcu): Use read_*byte_unaligned_inc
3579 instead of the *_inc-less variants.
3580 * libdw.h: Define Dwarf_Line. Add some function attributes. Declare
3581 dwarf_getsrclines, dwarf_getsrc_die, dwarf_lineno, and dwarf_linesrc.
3582 * libdw.map: Add dwarf_getsrclines, dwarf_getsrc_die, dwarf_lineno,
3584 * libdwP.h: Add more error codes.
3585 (struct Dwarf): Remove mem_tail.next member.
3586 (Dwarf_File): Define type.
3587 (struct Dwarf_Line_s): Define type.
3588 (struct Dwarf_CU): Add lines and nlines members.
3589 (libdw_alloc): Define local variable _tail and use it.
3590 Add some function attributes.
3591 * libdw_alloc.c (__libdw_allocate): Don't initialize next member.
3592 * libdw_findcu.c (__libdw_findcu): Initialize lines and nlines members.
3593 * memory-access.h: Add unlikely for the endian conversion paths.
3594 * Makefile.am (AM_CFLAGS): Add -std parameter.
3595 (libdw_a_SOURCES): Add dwarf_getsrclines, dwarf_getsrc_die,
3596 dwarf_lineno, and dwarf_linesrc.
3598 2003-08-11 Ulrich Drepper <drepper@redhat.com>
3600 * Moved to CVS archive.