1 2019-01-20 Mark Wielaard <mark@klomp.org>
3 * dwarf_getsrclines.c (read_srclines): Check terminating NUL byte
4 for dir and file lists.
6 2018-10-23 Mark Wielaard <mark@klomp.org>
8 * dwarf_child.c (__libdw_find_attr): Initialize readp to NULL.
9 * dwarf_getattrs.c (dwarf_getattrs): Initialize die_addr to NULL.
11 2018-10-20 Mark Wielaard <mark@klomp.org>
13 * libdw.map (ELFUTILS_0.175): New section. Add dwelf_elf_begin.
15 2018-10-29 Milian Wolff <milian.wolff@kdab.com>
17 * dwarf_getcfi_elf.c (getcfi_shdr): Check sh_type != SHT_NOBITS.
19 2018-09-13 Mark Wielaard <mark@klomp.org>
21 * dwarf_begin_elf.c (check_section): Drop ehdr argument, add and
22 use shstrndx argument.
23 (global_read): Likewise.
24 (scngrp_read): Likewise.
25 (dwarf_begin_elf): Call elf_getshdrstrndx. Pass shstrndx to
26 global_read or scngrp_read.
28 2018-08-18 Mark Wielaard <mark@klomp.org>
30 * dwarf_getabbrev.c (__libdw_getabbrev): Continue until both name
32 * dwarf_hasattr.c (dwarf_hasattr): Stop when both name and form
35 2018-08-18 Mark Wielaard <mark@klomp.org>
37 * dwarf_getaranges.c (dwarf_getaranges.c): Make sure there is enough
38 data to read the address and segment size.
40 2018-07-04 Ross Burton <ross.burton@intel.com>
42 * libdw_alloc.c: Remove error.h include.
44 2018-06-28 Mark Wielaard <mark@klomp.org>
46 * dwarf_next_cfi.c (dwarf_next_cfi): Check whether length is zero.
48 2018-06-27 Mark Wielaard <mark@klomp.org>
50 * dwarf_begin_elf.c (check_section): Allow a single .debug_frame
53 2018-06-26 Mark Wielaard <mark@klomp.org>
55 * libdw.h (dwarf_getscn_info): Remove.
56 * libdw.map (ELFUTILS_0.122): Remove dwarf_getscn_info.
58 2018-06-25 Mark Wielaard <mark@klomp.org>
60 * Makefile.am (libdw_a_SOURCES): Add dwarf_next_lines.c.
61 * libdw.h (dwarf_next_lines): New function declaration.
62 * libdw.map (ELFUTILS_0.173): New section.
63 * dwarf_next_lines.c: New files.
64 * dwarf_begin_elf.c (check_section): Don't error out when elf
66 (valid_p): Allow just a single .debug_line section.
67 * dwarf_getsrclines.c (read_srclines): Keep files relative if comp_dir
70 2018-06-22 Mark Wielaard <mark@klomp.org>
72 * dwarf_nextcu.c (__libdw_next_unit): Set next_off to -1 when it would
75 2018-06-18 Mark Wielaard <mark@klomp.org>
77 * dwarf_aggregate_size.c (array_size): New depth argument. Use
78 aggregate_size instead of dwarf_aggregate_size and pass depth.
79 (aggregate_size): New depth argument. Check depth isn't bigger
80 than MAX_DEPTH (256). Pass depth to recursive calls.
81 (dwarf_aggregate_size): ass zero as depth to aggregate_size.
83 2018-06-18 Mark Wielaard <mark@klomp.org>
85 * dwarf_peel_type.c (dwarf_peel_type): Limit modifier chain to 64.
87 2018-06-18 Mark Wielaard <mark@klomp.org>
89 * dwarf_aggregate_size.c (aggregate_size): Check die is not NULL.
91 2018-06-17 Luiz Angelo Daros de Luca <luizluca@gmail.com>
93 * dwarf_getsrclines.c (read_srclines): Intialize filelist early.
95 2018-06-15 Mark Wielaard <mark@klomp.org>
97 * dwarf_getlocation.c (check_constant_offset): Clarify DW_FORM_data16
98 isn't really a constant.
99 (dwarf_getlocation): Don't handle DW_FORM_data16 as block.
100 (dwarf_getlocation_addr): Likewise.
101 (dwarf_getlocations): Likewise.
103 2018-06-12 Mark Wielaard <mark@klomp.org>
105 * memory-access.h (read_3ubyte_unaligned_inc): New define.
107 2018-06-12 Mark Wielaard <mark@klomp.org>
109 * libdw.h (__libdw_dieabbrev): Set die->abbrev to DWARF_END_ABBREV
112 2018-06-10 Mark Wielaard <mark@klomp.org>
114 * dwarf_attr_integrate.c (dwarf_attr_integrate): Stop after 16 DIE
116 * dwarf_hasattr_integrate.c (dwarf_hasattr_integrate): Likewise.
118 2018-06-08 Mark Wielaard <mark@klomp.org>
120 * dwarf_getabbrev.c (dwarf_getabbrev): Check die and offset.
122 2018-06-08 Mark Wielaard <mark@klomp.org>
124 * dwarf_get_units.c (dwarf_get_units): Handle existing error, no
127 2018-06-08 Mark Wielaard <mark@klomp.org>
129 * dwarf_getlocation.c (store_implicit_value): Return error when
130 seeing bad DWARF or when tsearch runs out of memory.
131 (__libdw_intern_expression): Report error when store_implicit_value
134 2018-06-08 Mark Wielaard <mark@klomp.org>
136 * dwarf_getsrclines.c (read_srclines): Sanity check ndirs and nfiles.
138 2018-06-08 Mark Wielaard <mark@klomp.org>
140 * dwarf_getlocation_attr.c (addr_valp): Set error and return NULL
141 when there is no .debug_addr section.
142 (dwarf_getlocation_attr): If addr_valp returns NULL, then return -1.
144 2018-06-07 Mark Wielaard <mark@klomp.org>
146 * libdw_findcu.c (__libdw_intern_next_unit): Report DWARF_E_VERSION,
147 not DWARF_E_INVALID_DWARF on unknown version. Set address_size and
148 offset_size to 8 when unknown.
150 2018-06-06 Mark Wielaard <mark@klomp.org>
152 * libdwP.h (__libdw_dieabbrev): Check DIE addr falls in cu.
154 2018-06-06 Mark Wielaard <mark@klomp.org>
156 * dwarf_getlocation_die.c (dwarf_getlocation_die): Check offset
157 falls inside cu data.
159 2018-06-05 Mark Wielaard <mark@klomp.org>
161 * dwarf_getsrclines.c (read_srclines): Explicitly set diridx to -1
162 in case dwarf_formudata fails.
164 2018-06-05 Mark Wielaard <mark@klomp.org>
166 * dwarf_getaranges (dwarf_getaranges): Free new_arange if
167 __libdw_findcu fails.
169 2018-06-05 Mark Wielaard <mark@klomp.org>
171 * dwarf_getsrclines.c (read_srclines): Define dirarray early and
172 check whether or not it is equal to dirstack on exit/out before
175 2018-06-05 Mark Wielaard <mark@klomp.org>
177 * dwarf_getalt.c (find_debug_altlink): id_path array should be 2
178 larger to contain MAX_BUILD_ID_BYTES.
180 2018-05-31 Mark Wielaard <mark@klomp.org>
182 * libdw_find_split_unit.c (try_split_file): New function extracted
184 (__libdw_find_split_unit): ... here. Try both the relative and
185 absolute paths to find a .dwo file.
187 2018-05-30 Mark Wielaard <mark@klomp.org>
189 * libdw/dwarf_getsrclines.c (read_srclines): Change ndir and
190 ndirlist to size_t. Add check to see ndirlist doesn't overflow.
192 2018-05-31 Mark Wielaard <mark@klomp.org>
194 * dwarf_dieoffset.c: Check die->cu != NULL. Return -1, not ~0ul
197 2018-05-29 Mark Wielaard <mark@klomp.org>
199 * dwarf_cuoffset.c (dwarf_cuoffset): Check die->cu is not NULL.
200 * dwarf_die_addr_die.c (dwarf_die_addr_die): Also search split
202 * libdwP.h (struct Dwarf): Add split_tree field.
203 (__libdw_find_split_dbg_addr): New internal function definition.
204 (__libdw_finddbg_cb): Likewise.
205 * libdw_find_split_unit.c (__libdw_find_split_unit): Insert split
206 Dwarf into skeleton dbg split_tree.
207 * libdw_findcu.c (__libdw_finddbg_cb): New function.
208 (__libdw_find_split_dbg_addr): Likewise.
209 * dwarf_end (dwarf_end): Destroy split_tree.
211 2018-05-29 Mark Wielaard <mark@klomp.org>
213 * dwarf.h: Add GNU DebugFission list entry encodings
214 DW_LLE_GNU_end_of_list_entry,
215 DW_LLE_GNU_base_address_selection_entry,
216 DW_LLE_GNU_start_end_entry and DW_LLE_GNU_start_length_entry.
217 * dwarf_ranges.c (__libdw_read_begin_end_pair_inc): Handle
218 GNU DebugFission list entries.
220 2018-05-28 Mark Wielaard <mark@klomp.org>
222 * libdw_find_split_unit.c (__libdw_find_split_unit): End split_dwarf
223 only after we tried every unit id in it.
225 2018-04-07 Mark Wielaard <mark@klomp.org>
227 * libdwP.h (struct Dwarf_CU): Add locs_base.
228 (__libdw_cu_locs_base): New static inline function.
229 * libdw_findcu.c (__libdw_intern_next_unit): Initialize locs_base.
230 * dwarf_begin_elf.c (valid_p): Create fake_loclists_cu if necessary.
231 * dwarf_end.c (dwarf_end): Clean up fake_loclists_cu.
232 * dwarf_getlocation.c (initial_offset): Handle .debug_loclists.
233 (getlocations_addr): Likewise.
234 (dwarf_getlocation_addr): Likewise.
235 * dwarf_getlocation_attr.c (attr_form_cu): Use fake_loclists_cu for
237 (initial_offset): Handle DW_FORM_loclistx.
238 * dwarf_ranges.c (__libdw_read_begin_end_pair_inc): Handle
240 * libdwP.h (struct Dwarf): Add fake_loclists_cu.
242 2018-04-12 Mark Wielaard <mark@klomp.org>
244 * dwarf.h: Add DWARF5 location list entry DW_LLE encodings.
245 * begin_elf.c (dwarf_scnnames): Add IDX_debug_loclists.
246 * dwarf_error.c (errmsgs): Remove DWARF_E_NO_LOCLIST. And replace
247 with DWARF_E_NO_DEBUG_LOC, DWARF_E_NO_DEBUG_LOCLISTS and
248 DWARF_E_NO_LOC_VALUE.
249 * dwarf_formudata.c (dwarf_formudata): Handle DW_AT_loclists_base
250 and DW_FORM_loclistx.
251 * dwarf_getlocation.c (attr_ok): Use DWARF_E_NO_LOC_VALUE.
252 (initial_offset): Use DWARF_E_NO_DEBUG_LOC.
253 * libdwP.h: Add IDX_debug_rnglists. Remove DWARF_E_NO_LOCLIST.
254 Add DWARF_E_NO_DEBUG_LOC, DWARF_E_NO_DEBUG_LOCLISTS and
255 DWARF_E_NO_LOC_VALUE.
257 2018-05-25 Mark Wielaard <mark@klomp.org>
259 * libdw_find_split_unit.c (__libdw_find_split_unit): Extract linking
260 skeleton and split compile units code into...
261 * libdwP (__libdw_link_skel_split): ...this new function.
263 2018-04-06 Mark Wielaard <mark@klomp.org>
265 * dwarf_formaddr.c (__libdw_addrx): New function, extracted from...
266 (dwarf_formaddr): here. Use __libdw_addrx.
267 * dwarf_getlocation.c (getlocations_addr): Pass cu to
268 __libdw_read_begin_end_pair_inc.
269 * dwarf_ranges.c (__libdw_read_begin_end_pair_inc): Take cu as
270 argument. Handle .debug_rnglists.
271 (initial_offset): Handle .debug_rnglists and DW_FORM_rnglistx.
272 (dwarf_ranges): Likewise. Check cu isn't NULL before use. Pass cu to
273 __libdw_read_begin_end_pair_inc.
274 * libdwP.h (__libdw_read_begin_end_pair_inc): Take cu as argument.
275 (__libdw_cu_ranges_base): Handle DW_AT_rnglists_base.
276 (__libdw_addrx): New function definition.
278 2018-04-11 Mark Wielaard <mark@klomp.org>
280 * dwarf.h: Add DWARF5 range list entry DW_RLE encodings.
281 * begin_elf.c (dwarf_scnnames): Add IDX_debug_rnglists.
282 * dwarf_error.c (errmsgs): Add DWARF_E_NO_DEBUG_RNGLISTS.
283 * dwarf_formudata.c (dwarf_formudata): Handle DW_AT_rnglists_base
284 and DW_FORM_rnglistx.
285 * dwarf_getscopes.c (pc_match): Also check for
286 DWARF_E_NO_DEBUG_RNGLISTS.
287 * libdwP.h: Add IDX_debug_rnglists.
289 2018-05-25 Mark Wielaard <mark@klomp.org>
291 * dwarf_getlocation_attr.c (__libdw_cu_addr_base): Cast offset to
292 uintptr_t before returning as pointer.
294 2018-05-22 Mark Wielaard <mark@klomp.org>
296 * dwarf_getlocation.c (__libdw_cu_base_address): Treat errors of
297 getting lowpc or entrypc the same as missing base address (zero).
298 * dwarf_highpc (dwarf_highpc): Handle any address form. Always set
299 error when attribute could not be found.
301 2018-05-21 Mark Wielaard <mark@klomp.org>
303 * dwarf_begin_elf.c (valid_p): Add a fake_addr_cu to the result.
304 * dwarf_end.c (cu_free): Disconnect the fake_addr_cu from the split
305 dwarf if shared with skeleton.
306 (dwarf_end): release fake_addr_cu.
307 * dwarf_formaddr.c (__libdw_cu_addr_base): Move to...
308 * libdwP.h (__libdw_cu_addr_base): ... here.
309 (struct Dwarf): Add fake_addr_cu field.
310 * dwarf_formudata.c (dwarf_formudata): Handle
311 DW_FORM_GNU_addr_index and DW_FORM_addrx[1234].
312 * dwarf_getlocation_attr.c (addr_valp): New static function.
313 (dwarf_getlocation_attr): Create attribute for values of
314 DW_OP_GNU_const_index, DW_OP_constx and DW_OP_GNU_addr_index and
316 * libdw_find_split_unit.c (__libdw_find_split_unit): Connect
317 IDX_debug_addr sectiondata and fake_addr_cu between split and
320 2018-05-20 Mark Wielaard <mark@klomp.org>
322 * dwarf_cu_info.c: New file.
323 * Makefile.am (libdw_a_SOURCES): Add dwarf_cu_info.c.
324 * libdw.h (dwarf_cu_info): New function declaration.
325 * libdw.map (ELFUTILS_0.171): Add dwarf_cu_info.
327 2018-05-24 Mark Wielaard <mark@klomp.org>
329 * dwarf_ranges.c (dwarf_ranges): Check for NULL cu.
330 * libdw_findcu.c (__libdw_intern_next_unit): Initialize ranges_base.
332 2018-05-18 Mark Wielaard <mark@klomp.org>
334 * dwarf_formudata.c (__libdw_formptr): Handle the special case
335 of IDX_debug_ranges for DW_UT_split_compile with version < 5.
336 * dwarf_highpc.c (dwarf_highpc): Use dwarf_lowpc, check for
338 * dwarf_lowpc.c (dwarf_lowpc): Check for split compile cudie.
339 * dwarf_ranges.c (dwarf_ranges): Switch cu and sectiondata for
341 * libdwP.h (struct Dwarf_CU): Add ranges_base field.
342 (__libdw_cu_ranges_base): New static inline function.
344 2018-05-18 Mark Wielaard <mark@klomp.org>
346 * libdw_findcu.c (__libdw_intern_next_unit): Init files to NULL.
347 * dwarf_getsrclines.c (dwarf_getsrclines): Handle split units by
348 taking the line table from the skeleton.
349 * dwarf_getsrcfiles.c (dwarf_getsrcfiles): Handle split units by
350 only taking the files from .debug_line offset zero (if it exists),
351 otherwise fall back to the skeleton.
353 2018-05-17 Mark Wielaard <mark@klomp.org>
355 * dwarf_begin_elf.c (__libdw_debugdir): New function.
356 (valid_p): Call __libdw_debugdir.
357 * dwarf_end.c (dwarf_end.c): Free debugdir.
358 * dwarf_getalt.c (__libdw_filepath): Extract __libdw_debugdir logic.
359 take debugdir as argument instead of fd.
360 (find_debug_altlink): Call __libdw_filepath with debugdir.
361 * libdwP.h (struct Dwarf): Add debugdir field.
362 (__libdw_debugdir): New function prototype.
363 (__libdw_filepath): Adjust prototype to take a const char * instead of
365 * libdw_find_split_unit.c (__libdw_find_split_unit): Call
366 __libdw_filepath with debugdir.
368 2018-05-17 Mark Wielaard <mark@klomp.org>
370 * dwarf_attr_integrate.c (dwarf_attr_integrate): Handle split_compile
371 unit DIE, search skeleton_compile unit DIE.
372 * dwarf_hasattr_integrate.c (dwarf_hasattr_integrate): Likewise.
373 * libdwP.h (is_cudie): Check cu is not NULL.
375 2018-05-19 Mark Wielaard <mark@klomp.org>
377 * libdwP.h (__libdw_find_split_unit): Mark as internal_function.
379 2018-05-15 Mark Wielaard <mark@klomp.org>
381 * Makefile.am (libdw_a_SOURCES): Add libdw_find_split_unit.c.
382 * dwarf_end.c (cu_free): Free split Dwarf.
383 * dwarf_get_units.c (dwarf_get_units): Handle DW_UT_skeleton by
384 calling __libdw_find_split_unit.
385 * libdwP.h (struct Dwarf_CU): Add split Dwarf_CU field.
386 (__libdw_find_split_unit): New function prototype.
387 (str_offsets_base_off): Use cu Dwarf if dbg is NULL.
388 (filepath): Rename to ...
389 (__libdw_filepath): This. Which is the actual function name in
391 (libdw_find_split_unit.c): New file.
392 * libdw_findcu.c (__libdw_intern_next_unit): Initialize split to -1.
394 2018-05-15 Mark Wielaard <mark@klomp.org>
396 * libdwP.h (__libdw_first_die_from_cu_start): Adjust commented out
398 * libdw_findcu.c (__libdw_intern_next_unit): For version 4 DWARF if
399 the cudie has a DW_AT_GNU_dwi_id set the unit_id8 and unit_type to
400 DW_UT_skeleton or DW_UT_split_compile based on whether the cudie has
401 child DIEs and a DW_AT_GNU_dwo_name attribute.
403 2018-05-14 Mark Wielaard <mark@klomp.org>
405 * dwarf.h: Add GNU Debug Fission extensions. DW_AT_GNU_dwo_name,
406 DW_AT_GNU_dwo_id, DW_AT_GNU_ranges_base, DW_AT_GNU_addr_base,
407 DW_AT_GNU_pubnames, DW_AT_GNU_pubtypes. DW_FORM_GNU_addr_index,
408 DW_FORM_GNU_str_index. DW_OP_GNU_addr_index, DW_OP_GNU_const_index.
409 * dwarf_formaddr.c (dwarf_formaddr): Handle DW_FORM_GNU_addr_index
411 (__libdw_cu_addr_base): Check for both DW_AT_GNU_addr_base and
413 * dwarf_formstring.c (dwarf_formstring): Handle DW_FORM_GNU_str_index
415 * dwarf_formudata.c (dwarf_formudata): Recognize DW_AT_GNU_addr_base
416 as addrptr. Recognize DW_AT_GNU_ranges_base as rangelistptr.
417 * dwarf_getlocation.c (__libdw_intern_expression): Handle
418 DW_OP_GNU_addr_index as DW_OP_addrx and DW_OP_GNU_const_index as
420 * libdw_form.c (__libdw_form_val_compute_len): Handle
421 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index taking an uleb128.
423 2018-05-12 Mark Wielaard <mark@klomp.org>
425 * dwarf_begin_elf.c (check_section): Also recognize .dwo section
428 2018-05-11 Mark Wielaard <mark@klomp.org>
430 * dwarf_formudata.c (dwarf_formudata): Handle DW_AT_macros as macptr.
431 * dwarf_getmacros.c (get_table_for_offset): Add DW_MACRO_define_sup,
432 DW_MACRO_undef_sup, DW_MACRO_import_sup, DW_MACRO_define_strx and
433 DW_MACRO_undef_strx. Add str_offsets_base_off to fake CU. Deal with
434 DW_AT_macros. Use libdw_valid_user_form.
436 2018-05-09 Mark Wielaard <mark@klomp.org>
438 * dwarf_formstring.c (__libdw_cu_str_off_base): Moved to...
439 * libdwP.h (__libdw_cu_str_off_base): ...here. Make static inline.
440 (str_offsets_base_off): New internal function that also parses
441 .debug_str_offsets header if necessary.
443 2018-05-11 Mark Wielaard <mark@klomp.org>
445 * dwarf_siblingof.c (dwarf_siblingof): Don't reference cu till it is
446 known the Dwarf_Die is came from is valid.
447 * libdwP.h (__libdw_dieabbrev): Check cu is not NULL.
449 2018-05-08 Mark Wielaard <mark@klomp.org>
451 * dwarf_formref.c (__libdw_formref): Explicitly don't handle
452 DW_FORM_ref_sup4 and DW_FORM_ref_sup8.
453 * dwarf_formref_die.c (dwarf_formref_die): Handle DW_FORM_ref_sup4
454 and DW_FORM_ref_sup8.
455 * dwarf_formstring.c (dwarf_formstring): Handle DW_FORM_strp_sup
456 as DW_FORM_GNU_strp_alt.
458 2018-05-05 Mark Wielaard <mark@klomp.org>
460 * dwarf.h: Add DWARF line content descriptions.
461 * libdwP.h (libdw_valid_user_form): New static function.
462 * dwarf_getsrclines.c (read_srclines): Check and parse version 5
463 DWARF header, dir and file tables separately from older versions
466 2018-04-24 Mark Wielaard <mark@klomp.org>
468 * dwarf_begin_elf.c (dwarf_scnnames): Add ".debug_line_str".
469 * dwarf_error.c (errmsgs): Add DWARF_E_NO_DEBUG_STR and
470 DWARF_E_NO_DEBUG_LINE_STR.
471 * dwarf_formstring.c (dwarf_formstring): Handle DW_FORM_line_strp.
472 Get data from either .debug_str or .debug_line_str.
473 * libdwP.h: Add IDX_debug_line_str, DWARF_E_NO_DEBUG_STR and
474 DWARF_E_NO_DEBUG_LINE_STR.
476 2018-04-03 Mark Wielaard <mark@klomp.org>
478 * dwarf_formudata.c (__libdw_formptr): Take and return const
479 unsigned char pointers.
480 * dwarf_getlocation.c (attr_base_address): Rename to...
481 (__libdw_cu_base_address): this. Take Dwarf_CU, check and set
483 (initial_offset_base): Renamed to...
484 (initial_offset): this. Only provide offset.
485 (getlocations_addr): Move data size check and
486 address base addition into __libdw_read_begin_end_pair_inc. Use
487 __libdw_cu_base_address and initial_offset. Drop Elf_Data NULL
488 check (already done by initial_offset, through __libdw_formptr).
489 (dwarf_getlocations): Use __libdw_cu_base_address and initial_offset.
490 Drop Elf_Data NULL check.
491 * dwarf_ranges.c (__libdw_read_begin_end_pair_inc): Change argument
492 type of readp to Add readend argument. Check data size. Include base
493 in begin and end result.
494 (initial_offset): New static function.
495 (dwarf_ranges): Don't check Elf_Data being NULL (already done by
496 initial_offset, through __libdw_formptr). Use __libdw_cu_base_address
497 and initial_offset. Remove base check and addition (already done by
498 __libdw_read_begin_end_pair_inc.
499 * libdwP.h (Dwarf_CU): Add base_address field.
500 (__libdw_read_begin_end_pair_inc): Change argument type of readp to
501 const. Add readend argument.
502 (__libdw_formptr): Take and return const unsigned char pointers.
503 * libdw_findcu.c (__libdw_intern_next_unit): Initialize Dwarf_CU
506 2018-04-04 Mark Wielaard <mark@klomp.org>
508 * libdw_findcu.c (__libdw_intern_next_unit): Initialize Dwarf_CU
509 addr_base and str_off_base.
511 2018-03-23 Mark Wielaard <mark@klomp.org>
513 * dwarf_begin_elf.c (dwarf_scnnames): Add IDX_debug_str_offsets,
515 * dwarf_error.c (errmsgs): Add DWARF_E_NO_STR_OFFSETS.
516 * dwarf_formstring.c (dwarf_formstring): Handle DW_FORM_strx[1234].
517 (__libdw_cu_str_off_base): New function.
518 * dwarf_formudata.c (dwarf_formudata): Handle IDX_debug_str_offsets
520 * libdwP.h: Add IDX_debug_str_offsets and DWARF_E_NO_STR_OFFSETS.
521 (struct Dwarf_CU): Add str_off_base field.
522 (__libdw_cu_str_off_base): New function declaration.
524 2018-03-22 Mark Wielaard <mark@klomp.org>
526 * dwarf_begin_elf.c (dwarf_scnnames): Add IDX_debug_addr.
527 * dwarf_error.c (errmsgs): Add DWARF_E_NO_DEBUG_ADDR.
528 * dwarf_formaddr.c (dwarf_formaddr): Handle DW_FORM_addrx[1234].
529 (__libdw_cu_addr_base): New function.
530 * dwarf_formudata.c (dwarf_formudata): Handle DW_AT_addr_base as
532 * libdwP.h: Add IDX_debug_addr and DWARF_E_NO_DEBUG_ADDR.
533 (struct Dwarf_CU): Add addr_base field.
534 (__libdw_cu_addr_base): New function definition.
535 * memory-access.h (file_byte_order): New static function.
536 (read_3ubyte_unaligned): New inline function.
538 2018-03-29 Mark Wielaard <mark@klomp.org>
540 * libdw.h (dwarf_decl_file): Extend documentation.
541 (dwarf_linesrc): Likewise.
542 (dwarf_filesrc): Likewise.
544 2018-03-06 Mark Wielaard <mark@klomp.org>
546 * dwarf.h: Add DW_OP_implicit_pointer, DW_OP_addrx, DW_OP_constx,
547 DW_OP_entry_value, DW_OP_const_type, DW_OP_regval_type,
548 DW_OP_deref_type, DW_OP_xderef_type, DW_OP_convert and
550 * dwarf_getlocation.c (__libdw_intern_expression): Handle
551 DW_OP_convert, DW_OP_reinterpret, DW_OP_addrx, DW_OP_constx,
552 DW_OP_regval_type, DW_OP_entry_value, DW_OP_implicit_pointer,
553 DW_OP_deref_type, DW_OP_xderef_type and DW_OP_const_type.
554 * dwarf_getlocation_attr.c (dwarf_getlocation_attr): Handle
555 DW_OP_entry_value, DW_OP_const_type and DW_OP_implicit_pointer.
556 * dwarf_getlocation_die.c (dwarf_getlocation_die): Handle
557 DW_OP_implicit_pointer, DW_OP_convert, DW_OP_reinterpret,
558 DW_OP_const_type, DW_OP_regval_type, DW_OP_deref_type and
560 * dwarf_getlocation_implicit_pointer.c
561 (dwarf_getlocation_implicit_pointer): Handle DW_OP_implicit_pointer.
563 2018-03-01 Mark Wielaard <mark@klomp.org>
565 * dwarf.h: Add DW_AT_GNU_locviews and DW_AT_GNU_entry_view.
566 * dwarf_formudata.c (dwarf_formudata): Handle DW_AT_GNU_locviews
569 2018-02-09 Mark Wielaard <mark@klomp.org>
571 * dwarf_formblock.c (dwarf_formblock): Handle DW_FORM_data16 as a
574 2018-02-09 Mark Wielaard <mark@klomp.org>
576 * dwarf_child.c (__libdw_find_attr): Handle DW_FORM_implicit_const.
577 * dwarf_formsdata.c (dwarf_formsdata): Likewise.
578 * dwarf_formudata.c (dwarf_formudata): Likewise.
579 * dwarf_getabbrev.c (__libdw_getabbrev): Likewise.
580 * dwarf_getattrs.c (dwarf_getattrs): Likewise.
581 * dwarf_hasattr.c (dwarf_hasattr): Likewise.
582 * dwarf_getabbrevattr.c (dwarf_getabbrevattr_data): New function
583 that will also return any data associated with the abbrev. Which
584 currently is only for DW_FORM_implicit_const. Based on...
585 (dwarf_getabbrevattr): ... this function. Which now just calls
586 dwarf_getabbrevattr_data.
587 * libdw.h (dwarf_getabbrevattr_data): Declare new function.
588 * libdw.map (ELFUTILS_0.170): Add dwarf_getabbrevattr_data.
589 * libdwP.h (dwarf_getabbrevattr_data): INTDECL.
590 * memory-access.h (__libdw_get_sleb128_unchecked): New inlined
591 function based on __libdw_get_uleb128_unchecked.
593 2018-02-08 Mark Wielaard <mark@klomp.org>
595 * dwarf.h: Add DWARF5 DW_FORMs.
596 * libdwP.h (__libdw_form_val_compute_len): Handle fix length
597 DW_FORM_implicit_const, DW_FORM_addrx[1234], DW_FORM_strx[1234],
598 DW_FORM_ref_sup[48] and DW_FORM_data16.
599 * libdw_form.c (__libdw_form_val_compute_len): DW_FORM_strp_sup
600 and DW_FORM_line_strp are offset_size. DW_FORM_addrx, DW_FORM_strx,
601 DW_FORM_loclistx and DW_FORM_rnglistx are uleb128.
603 2018-01-30 Mark Wielaard <mark@klomp.org>
605 * Makefile.am (libdw_a_SOURCES): Add dwarf_get_units.c.
606 * dwarf_get_units.c: New file.
607 * libdw.h (dwarf_get_units): New function declaration.
608 * libdw.map (ELFUTILS_0.170): Add dwarf_get_units.
610 2018-01-29 Mark Wielaard <mark@klomp.org>
612 * dwarf.h (DW_UT_*): Add DWARF Unit Header Types.
613 * dwarf_cu_die.c (dwarf_cu_die): Rename arguments. type_signaturep
614 is now called unit_idp. type_offsetp is now called subdie_offsetp.
615 * dwarf_formref_die.c (dwarf_formref_die): Scan both .debug_info
616 and .debug_types sections for type units when type signature ref
618 * dwarf_getaranges.c (dwarf_getaranges): Use __libdw_findcu and
619 __libdw_first_die_off_from_cu instead of trying by hand.
620 * dwarf_getlocation_die.c (dwarf_getlocation_die): Use ISV4TU
621 instead of checking type_offset by hand.
622 * dwarf_getlocation_implicit_pointer.c
623 (dwarf_getlocation_implicit_pointer): Likewise.
624 * dwarf_nextcu.c (dwarf_next_unit): Call __libdw_next_unit.
625 (__libdw_next_unit): New function based on dwarf_next_unit with
626 DWARF5 header support.
627 * libdwP.h (struct Dwarf_CU): Renamed type_offset to subdie_offset
628 and type_sig8 to unit_id8.
629 (ISV4TU): New macro to determine whether a CU is a version 4 type
630 unit (which comes from the .debug_types section).
631 (DIE_OFFSET_FROM_CU_OFFSET): Replaced macro by real function...
632 (__libdw_first_die_from_cu_start): ... that also handles DWARF5
634 (__libdw_first_die_off_from_cu): New function that calls the above
636 (CUDIE): Use __libdw_first_die_off_from_cu.
637 (SUBDIE): New macro that provides the DIE for a CU using the
639 (__libdw_next_unit): New internal function declaration.
640 * libdw_findcu.c (__libdw_intern_next_unit): Use __libdw_next_unit.
641 Accept DWARF version 5 headers. Setup unit_type.
642 (__libdw_findcu): Rename debug_types argument to v4_debug_types
643 argument (to indicate that we are looking in the .debug_types
644 section). Support finding the exact offset (unit header start).
646 2018-01-25 Mark Wielaard <mark@klomp.org>
648 * Makefile.am (libdw_a_SOURCES): Add dwarf_die_addr_die.c.
649 * dwarf_die_addr_die.c: New file.
650 * libdw.h (dwarf_die_addr_die): New function declaration.
651 * libdw.map (ELFUTILS_0.171): New section with dwarf_die_addr_die.
652 * libdwP.h (__libdw_findcu_addr): New internal function declaration.
653 * libdw_findcu.c (__libdw_findcu_addr): New internal function.
655 2018-02-09 Joshua Watt <JPEWhacker@gmail.com>
657 * cfi.c (execute_cfi): Use FALLTHROUGH macro instead of comment.
658 * dwarf_frame_register.c (dwarf_frame_register): Likewise.
660 2018-01-22 Mark Wielaard <mark@klomp.org>
662 * Makefile.am (AM_CPPFLAGS): Add -I libdwelf.
663 * dwarf_begin_elf.c (dwarf_begin_elf): Initialize Dwarf alt_fd to -1.
664 * dwarf_end.c (dwarf_end): Call dwarf_end and close on the alt_dwarf
665 and alt_fd if we allocated them.
666 * dwarf_fromref_die.c (dwarf_formref_die): Call dwarf_getalt.
667 * dwarf_formstring.c (dwarf_formstring): Likewise.
668 * dwarf_getalt.c (__libdw_filepath): New internal function.
669 (find_debug_altlink): New static function.
670 (dwarf_getalt): Check Dwarf alt_dwarf and call find_debug_altlink.
672 * dwarf_setalt.c (dwarf_setalt): Clean up Dwarf alt_dwarf and alt_fd
674 * libdw.h (dwarf_getalt): Extend documentation.
675 (dwarf_setalt): Likewise.
676 * libdwP.h (struct Dwarf): Add alt_fd field.
677 (filepath): Declare new internal function.
679 2018-01-14 Petr Machata <pmachata@gmail.com>
681 * dwarf_formsdata.c (dwarf_formsdata):
682 <DW_FORM_data1>: Cast to signed char.
683 <DW_FORM_data2,4,8>: Use read_*sbyte_unaligned instead of
684 read_*ubyte_unaligned.
686 2017-12-26 Mark Wielaard <mark@klomp.org>
688 * libdwP.h (struct Dwarf_Abbrev): Pack struct. Remove attrcnt,
689 use bitfields for has_children and code.
690 * dwarf_getabbrev.c (__libdw_getabbrev): Don't count attrs.
691 * dwarf_getattrcnt.c (dwarf_getattrcnt): Count attrs.
693 2017-12-26 Mark Wielaard <mark@klomp.org>
695 * memory-access.h (__libdw_get_uleb128_unchecked): New function.
696 (get_uleb128_unchecked): New define.
697 * dwarf_child.c (__libdw_find_attr): Use get_uleb128_unchecked to
698 read attr name and form.
699 * dwarf_getabbrevattr.c (dwarf_getabbrevattr): Likewise.
700 * dwarf_getattrs.c (dwarf_getattrs): Likewise.
701 * dwarf_hasattr.c (dwarf_hasattr): Likewise.
703 2017-12-28 Mark Wielaard <mark@klomp.org>
705 * dwarf_offdie.c (__libdw_offdie): Check sectiondata exists.
707 2017-05-09 Ulf Hermann <ulf.hermann@qt.io>
708 Mark Wielaard <mark@klomp.org>
710 * libdwP.h (__libdw_in_section): Fix check for the upper border of
712 (__libdw_offset_in_section): Likewise.
714 2017-12-20 Mark Wielaard <mark@klomp.org>
716 * libdwP.h (struct Dwarf_CU): Add sec_idx field.
717 (cu_sec_idx): Return cu->sec_idx.
718 * libdw_findcu.c (__libdw_intern_next_unit): Set cu sec_idx to
719 IDX_debug_info or IDX_debug_types.
720 * dwarf_begin_elf.c (valid_p): Set fake_loc_cu->sec_idx to
722 * dwarf_getmacros.c (read_macros): Set fake_cu->sec_idx to
723 IDX_debug_macro or IDX_debug_macinfo.
725 2017-12-12 Mark Wielaard <mark@klomp.org>
727 * dwarf_aggregate_size.c (dwarf_aggregate_size): Don't peel the
728 given DIE. Reserve memory for a new DIE first.
730 2017-12-11 Dima Kogan <dima@secretsauce.net>
732 * dwarf_aggregate_size.c (array_size): Handle multi-dimensional
735 2017-11-03 Mark Wielaard <mark@klomp.org>
737 * dwarf_getlocation.c (__libdw_intern_expression): Handle
738 DW_OP_GNU_variable_value.
739 * dwarf_getlocation_attr.c (dwarf_getlocation_attr): Likewise.
740 * dwarf_getlocation_die.c (dwarf_getlocation_die): Likewise.
742 2017-11-03 Mark Wielaard <mark@klomp.org>
744 * dwarf_getlocation.c (attr_ok): Always accept DW_FORM_exprloc.
745 Update list of acceptable attribute codes based on DWARF5.
747 2017-11-03 Mark Wielaard <mark@klomp.org>
749 * dwarf.h: Add DW_OP_GNU_variable_value.
751 2017-10-03 Mark Wielaard <mark@klomp.org>
753 * libdw.h: Define LIBDW_CIE_ID and use it in dwarf_cfi_cie_p.
755 2017-08-18 Ulf Hermann <ulf.hermann@qt.io>
757 * memory-access.h: Use attribute_packed.
759 2017-02-27 Ulf Hermann <ulf.hermann@qt.io>
761 * libdwP.h: Use attribute_hidden.
762 * libdw_alloc.c: Likewise.
764 2017-02-27 Ulf Hermann <ulf.hermann@qt.io>
766 * Makefile.am: Use fpic_CFLAGS and dso_LDFLAGS.
768 2017-07-26 Mark Wielaard <mark@klomp.org>
770 * dwarf.h: Add DW_MACRO_* and compat defines for DW_MACRO_GNU_*.
771 * dwarf_getmacros.c (get_table_for_offset): Accept either version
772 4 or 5. Use DW_MACRO names instead of DW_MACRO_GNU names.
773 (read_macros): Use table version for fake_cu.
775 2017-07-26 Mark Wielaard <mark@klomp.org>
777 * dwarf_peel_type.c (dwarf_peel_type): Handle DW_TAG_immutable_type,
778 DW_TAG_packed_type and DW_TAG_shared_type.
779 * libdw.h (dwarf_peel_type): Extend documentation.
781 2017-07-26 Mark Wielaard <mark@klomp.org>
783 * dwarf.h: Add DW_DEFAULTED_no, DW_DEFAULTED_in_class and
784 DW_DEFAULTED_out_of_class.
786 2017-07-26 Mark Wielaard <mark@klomp.org>
788 * dwarf.h: Add DW_CC_pass_by_reference and DW_CC_pass_by_reference.
790 2017-07-26 Mark Wielaard <mark@klomp.org>
792 * dwarf_default_lower_bound.c: New file.
793 * Makefile.am (libdw_a_SOURCES): Add dwarf_default_lower_bound.c.
794 * dwarf_aggregate_size.c (array_size): Use dwarf_default_lower_bound.
795 * dwarf_error.c (errmsgs): Add DWARF_E_UNKNOWN_LANGUAGE.
796 * libdw.h: Add dwarf_default_lower_bound.
797 * libdw.map (ELFUTILS_0.170): Add dwarf_default_lower_bound.
798 * libdwP.h: Add DWARF_E_UNKNOWN_LANGUAGE and
799 dwarf_default_lower_bound INTDECL.
801 2017-07-26 Mark Wielaard <mark@klomp.org>
803 * dwarf.h: Add DW_LANG_OpenCL, DW_LANG_Modula3,
804 DW_LANG_C_plus_plus_03, DW_LANG_OCaml, DW_LANG_Rust, DW_LANG_Swift,
805 DW_LANG_Julia, DW_LANG_Dylan, DW_LANG_RenderScript, DW_LANG_BLISS.
806 * dwarf_aggregate_size.c (array_size): Add lower bound for
807 DW_LANG_C_plus_plus_03, DW_LANG_Python, DW_LANG_OpenCL,
808 DW_LANG_Haskell, DW_LANG_OCaml, DW_LANG_Rust, DW_LANG_Swift,
809 DW_LANG_Dylan, DW_LANG_RenderScript, DW_LANG_Modula3,
810 DW_LANG_Julia and DW_LANG_BLISS.
812 2017-07-26 Mark Wielaard <mark@klomp.org>
814 * dwarf.h: Add DW_ATE_UCS and DW_ATE_ASCII.
816 2017-07-25 Mark Wielaard <mark@klomp.org>
818 * dwarf.h: Add DW_TAG_coarray_type, DW_TAG_generic_subrange,
819 DW_TAG_dynamic_type, DW_TAG_call_site, DW_TAG_call_site_parameter,
820 DW_TAG_skeleton_unit, DW_TAG_immutable_type. Add reserved comments
821 for currently unused numbers.
823 2017-07-25 Mark Wielaard <mark@klomp.org>
825 * dwarf.h (DWARF attributes enum): Remove DW_AT_subscr_data,
826 DW_AT_element_list and DW_AT_member. Add DWARF5 attribute constants.
827 (DW_AT_subscr_data, DW_AT_element_list, DW_AT_member): New defines.
829 2017-07-21 Mark Wielaard <mark@klomp.org>
831 * dwarf_line_file.c: New file.
832 * Makefile.am (libdw_a_SOURCES): Add dwarf_line_file.c.
833 * libdw.h (dwarf_line_file): New function declaration.
834 * libdw.map (ELFUTILS_0.170): New. Add dwarf_line_file.
836 2017-02-17 Ulf Hermann <ulf.hermann@qt.io>
838 * Makefile.am: Add libdw_so_LIBS to specify the archives libdw is is
839 made of, libdw_so_DEPS for libraries it depends on (including
840 libeu.a), libdw_so_LDLIBS to specify libraries libdw links against.
841 (libdw.so$(EXEEXT)): Add $(libdw_so_LDLIBS), remove enumeration of
842 library dependencies, use libdw_so_LIBS rather than relying on the
843 order of dependencies specified, add -z,relro.
845 2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
847 * libdw.h: Remove attribute macro declarations and use
848 __noreturn_attribute__ as defined in libelf.h.
850 2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
852 * dwarf_begin_elf.c: Include endian.h.
854 2017-03-30 Mark Wielaard <mjw@redhat.com>
856 * dwarf_peel_type.c (dwarf_peel_type): Call dwarf_attr_integrate on
859 2016-10-22 Mark Wielaard <mjw@redhat.com>
861 * dwarf.h: Correct spelling of DW_LANG_PLI. Add compatibility define.
862 * dwarf_aggregate_size.c (array_size): Use correct spelling of
865 2016-11-02 Mark Wielaard <mjw@redhat.com>
867 * cfi.c (execute_cfi): Add fallthrough comments.
868 * encoded-value.h (encoded_value_size): Add explicit return instead
869 of relying on fallthrough.
870 * dwfl_report_elf.c (__libdwfl_elf_address_range): Add fallthrough
873 2016-10-11 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
875 * dwarf_getpubnames.c: Remove sys/param.h include, add system.h.
876 * libdw_alloc.c: Likewise.
878 2016-07-08 Mark Wielaard <mjw@redhat.com>
880 * libdw.map (ELFUTILS_0.167): New. Add dwelf_strtab_init,
881 dwelf_strtab_add, dwelf_strtab_add_len, dwelf_strtab_finalize,
882 dwelf_strent_off, dwelf_strent_str and dwelf_strtab_free.
884 2016-02-13 Mark Wielaard <mjw@redhat.com>
886 * dwarf_getsrclines.c (read_srclines): Calculate ndirs first, then
889 2015-12-18 Mark Wielaard <mjw@redhat.com>
891 * libdwP.h (struct Dwarf): Remove sectiondata_gzip_mask.
892 (__libdw_free_zdata): Remove.
893 * dwarf_begin_elf.c (inflate_section): Remove.
894 (check_section): Remove __libdw_free_zdata calls. Use elf_compress
895 and elf_compress_gnu to decompress if necessary.
896 (valid_p): Remove __libdw_free_zdata calls.
897 (scngrp_read): Use elf_compress if section is compressed. Remove
898 __libdw_free_zdata calls.
899 * dwarf_end.c (__libdw_free_zdata): Remove.
900 (dwarf_end): Don't call __libdw_free_zdata.
902 2015-10-28 Mark Wielaard <mjw@redhat.com>
904 * libdw.map (ELFUTILS_0.165): New. Add dwelf_scn_gnu_compressed_size.
906 2015-12-02 Mark Wielaard <mjw@redhat.com>
908 * fde.c (intern_fde): Don't leak duplicate FDEs.
910 2015-12-01 Mark Wielaard <mjw@redhat.com>
912 * fde.c (intern_fde): Don't intern an fde that doesn't cover a
915 2015-12-01 Mark Wielaard <mjw@redhat.com>
917 * dwarf_end.c (dwarf_end): Call cu_free on fake_loc_cu if it exists.
919 2015-10-14 Chih-Hung Hsieh <chh@google.com>
921 * dwarf_entry_breakpoints.c (dwarf_entry_breakpoints): Move recursive
922 functions 'add_bkpt', 'entrypc_bkpt', and 'search_range' to file scope.
924 2015-10-14 Chih-Hung Hsieh <chh@google.com>
926 * libdw_visit_scopes.c (__libdw_visit_scopes): Move recursive nested
927 function 'walk_children' to file scope; inline 'recurse' at its call
930 2015-10-19 Mark Wielaard <mjw@redhat.com>
932 * frame-cache.c (__libdw_destroy_frame_cache): Call ebl_closebackend
935 2015-10-16 Dmitry V. Levin <ldv@altlinux.org>
937 * dwarf_getsrclines.c (read_srclines): Initialize state early.
939 2015-10-13 Chih-Hung Hsieh <chh@google.com>
941 * dwarf_getsrclines.c (read_srclines): Move nested functions
942 'advance_pc' and 'add_new_line' to file scope and keep many
943 local state variables within one structure.
945 2015-10-13 Chih-Hung Hsieh <chh@google.com>
947 * dwarf_getscopevar.c (dwarf_getscopevar): Move nested
948 function 'file_matches' to file scope.
950 2015-10-16 Mark Wielaard <mjw@redhat.com>
952 * Makefile.am (libdw.so): Add -lz.
954 2015-10-14 Chih-Hung Hsieh <chh@google.com>
956 * cfi.c (execute_cfi): Move nested functions 'enough_registers'
957 and 'require_cfa_offset' to file scope.
959 2015-10-09 Josh Stone <jistone@redhat.com>
961 * dwarf_begin.c (dwarf_begin): Replace stat64 and fstat64 with stat
964 2015-10-05 Josh Stone <jistone@redhat.com>
966 * Makefile.am (libdw.so): Add AM_V_CCLD and AM_V_at silencers.
968 2015-09-24 Jose E. Marchesi <jose.marchesi@oracle.com>
970 * Makefile.am (AM_CFLAGS): Use -fPIC instead of -fpic to avoid
971 relocation overflows in some platforms.
973 2015-09-23 Mark Wielaard <mjw@redhat.com>
975 * dwarf_error.c (__libdw_seterrno): Mark as internal_function.
976 * dwarf_formref.c (__libdw_formref): Likewise.
977 * libdw_findcu.c (__libdw_findcu): Likewise.
978 * libdw_visit_scopes.c (__libdw_visit_scopes): Likewise.
980 2015-09-22 Mark Wielaard <mjw@redhat.com>
982 * *.c: Remove old-style function definitions.
984 2015-09-15 Mark Wielaard <mjw@redhat.com>
986 * dwarf_peel_type.c (dwarf_peel_type): Don't reassign result pointer.
988 2015-09-09 Chih-Hung Hsieh <chh@google.com>
990 * dwarf_macro_getsrcfiles.c (dwarf_macro_getsrcfiles): Remove
991 redundant NULL tests on parameters declared with __nonnull_attribute__.
992 * dwarf_siblingof.c (dwarf_siblingof): Likewise.
993 * libdw_visit_scopes.c (__libdw_visit_scopes): Likewise.
995 2015-09-04 Chih-Hung Hsieh <chh@google.com>
996 Mark Wielaard <mjw@redhat.com>
998 * dwarf_getlocation.c (getlocations_addr): Replace K&R function
999 definition with ansi-C definition and add const qualifier to
1002 2015-09-04 Chih-Hung Hsieh <chh@google.com>
1004 * libdw_findcu.c (__libdw_intern_next_unit): Replace K&R function
1005 definition with ansi-C definitions.
1006 (__libdw_findcu): Likewise.
1008 2015-08-25 Mark Wielaard <mjw@redhat.com>
1010 * dwarf.h: Add DW_LANG_Haskell.
1012 2015-06-18 Mark Wielaard <mjw@redhat.com>
1014 * dwarf_begin_elf.c (dwarf_begin_elf): Assert page size is big enough
1017 2015-06-18 Mark Wielaard <mjw@redhat.com>
1019 * dwarf_getpubnames.c (get_offsets): Always free mem on error.
1021 2015-06-18 Mark Wielaard <mjw@redhat.com>
1023 * dwarf_getmacros.c (get_macinfo_table): Return NULL when
1024 dwarf_formudata reports an error.
1025 (get_table_for_offset): Likewise.
1027 2015-06-08 Mark Wielaard <mjw@redhat.com>
1029 * dwarf_getsrclines.c (read_srclines): Initialize dirarray early.
1031 2015-06-06 Mark Wielaard <mjw@redhat.com>
1033 * dwarf_getsrclines.c (read_srclines): Initialize filelist early.
1035 2015-05-27 Mark Wielaard <mjw@redhat.com>
1037 * encoded-value.h (read_encoded_value): Check data d_size contains
1038 at least enough data to hold a pointer for DW_EH_PE_indirect.
1040 2015-05-22 Mark Wielaard <mjw@redhat.com>
1042 * dwarf_getsrclines.c (read_srclines): Limit stack usage of lines
1043 with MAX_STACK_LINES, files with MAX_STACK_LINES and dirs with
1044 MAX_STACK_DIRS. Calculate number of dirs needed first, then
1045 create dirarray directly, without needing the next field. Free
1046 not stack allocated lines and files at the end.
1048 2015-05-19 Mark Wielaard <mjw@redhat.com>
1050 * dwarf_getlocation.c (__libdw_intern_expression): Create a stack
1051 allocated array to hold locs. Allocate locs bigger than the array
1052 with malloc and free them when done.
1054 2015-05-11 Jonathan Lebon <jlebon@redhat.com>
1056 * libdwP.h (DWARF_E_COMPRESSED_ERROR): New enumerator.
1057 * dwarf_error.c (errmsgs): Add DWARF_E_COMPRESSED_ERROR message.
1058 * dwarf_begin_elf.c (inflate_section): New static function, lifted
1060 (check_section): ... here. Call inflate_section, set libdw errno to
1061 DWARF_E_COMPRESSED_ERROR if .debug_info section couldn't be inflated.
1063 2015-05-11 Jonathan Lebon <jlebon@redhat.com>
1065 * dwarf_begin_elf.c (check_section): Add compressed flag. Always
1066 check for .zdebug sections. Only wrap decompression in #if USE_ZLIB.
1068 2015-05-06 Mark Wielaard <mjw@redhat.com>
1070 * dwarf_getsrclines.c (read_srclines): Use an int64_t to store and
1071 check the line number.
1073 2015-05-05 Mark Wielaard <mjw@redhat.com>
1075 * dwarf_getaranges.c (dwarf_getaranges): Check there is enough data
1076 left before reading values.
1078 2015-05-04 Anthony G. Basile <blueness@gentoo.org>
1080 * Makefile.am (libdw_so_SOURCES): Append $(argp_LDADD) to link
1083 2015-04-22 Mark Wielaard <mjw@redhat.com>
1085 * memory-access.h (__libdw_max_len_leb128): Take type_len as argument.
1086 (__libdw_max_len_uleb128): New function.
1087 (__libdw_max_len_sleb128): Likewise.
1088 (__libdw_get_uleb128): Use __libdw_max_len_uleb128.
1089 (__libdw_get_sleb128): Use __libdw_max_len_sleb128.
1091 2015-04-21 Mark Wielaard <mjw@redhat.com>
1093 * dwarf_getmacros.c (read_macros): Allocate attributes dynamically
1094 when there are more than 8.
1096 2015-04-01 Petr Machata <pmachata@redhat.com>
1098 * libdwP.h (DWARF_E_NOT_CUDIE): New enumerator.
1099 (is_cudie): New function.
1100 * dwarf_error.c (errmsgs): Add message for DWARF_E_NOT_CUDIE.
1101 * dwarf_getsrcfiles.c (dwarf_getsrcfiles): Call is_cudie instead
1102 of white-listing valid tags.
1103 * dwarf_getsrclines.c (dwarf_getsrclines): Likewise.
1105 2015-03-18 Petr Machata <pmachata@redhat.com>
1107 * Makefile.am (pkginclude_HEADERS): Add known-dwarf.h.
1108 (EXTRA_DIST): Remove known-dwarf.h.
1110 2015-02-09 Mark Wielaard <mjw@redhat.com>
1112 * dwarf.h: Add DW_LANG_Fortran03 and DW_LANG_Fortran08.
1113 * dwarf_aggregate_size.c (array_size): Recognize array lower bound
1114 for new Fortran language codes is 1.
1116 2015-02-09 Mark Wielaard <mjw@redhat.com>
1118 * dwarf.h: Add DW_TAG_atomic_type.
1119 * libdw.h (dwarf_peel_type): Document DW_TAG_atomic_type.
1120 * dwarf_peel_type.c (dwarf_peel_type): Handle DW_TAG_atomic_type.
1122 2015-02-11 Josh Stone <jistone@redhat.com>
1124 * encoded-value.h (read_encoded_value): Initialize value.
1126 2015-02-11 Petr Machata <pmachata@redhat.com>
1128 * dwarf_ranges.c (dwarf_ranges): Do not bail out when neither
1129 DW_AT_entry_pc nor DW_AT_low_pc are available. Instead remember
1130 the fact in *BASEP and bail out later if it hasn't been updated by
1131 __libdw_read_begin_end_pair_inc.
1133 2014-12-24 Mark Wielaard <mjw@redhat.com>
1135 * dwarf_getsrc_die.c (dwarf_getsrc_die): Return the last line record
1136 smaller than or equal to addr, rather than returning immediately on
1139 2015-01-07 Mark Wielaard <mjw@redhat.com>
1141 * cfi.h (struct Dwarf_CFI_s): Add search_table_len.
1142 * dwarf_getcfi_elf.c (getcfi_gnu_eh_frame): Check there is enough
1143 room in the search table for all entries. Store search_table_len.
1144 (getcfi_scn_eh_frame): Likewise.
1145 * encoded-value.h (encoded_value_size): Don't abort, return zero.
1146 (__libdw_cfi_read_address_inc): Check there is enough room to read
1147 values. Pass other byte order to read functions.
1148 (read_encoded_value): Check encoded_value_size. Don't abort, but
1149 set libdw errno and report failure. Check there is enough room to
1151 * fde.c (binary_search_fde): Check encoded value size. Add hdr
1152 data buf and size to dummy_cfi.
1154 2015-01-04 Mark Wielaard <mjw@redhat.com>
1156 * dwarf_siblingof.c (dwarf_siblingof): Check sibling attribute
1157 is after current DIE.
1159 2015-01-04 Mark Wielaard <mjw@redhat.com>
1161 * cfi.c (enough_registers): Check reg < INT32_MAX / sizeof
1162 (dwarf_frame_register).
1164 2015-01-02 Mark Wielaard <mjw@redhat.com>
1166 * dwarf_getcfi_elf.c (parse_eh_frame_hdr): Add size check.
1167 (getcfi_gnu_eh_frame): Remove size check. Check d_buf is not NULL.
1168 (getcfi_scn_eh_frame): Check d_buf is not NULL.
1170 2015-01-02 Mark Wielaard <mjw@redhat.com>
1172 * dwarf_getlocation.c (__libdw_intern_expression): Check dbg is not
1173 NULL for DW_OP_call_ref and DW_OP_GNU_implicit_pointer. For
1174 DW_OP_addr if dbg is NULL then read argument directly.
1176 2015-01-14 Jason P. Leasure <jpleasu@super.org>
1178 * dwarf_formref_die.c (dwarf_formref_die): Offset is cu->type_offset
1181 2014-12-27 Mark Wielaard <mjw@redhat.com>
1183 * dwarf_siblingof.c (dwarf_siblingof): Check sibling attribute offset
1184 still falls inside CU data.
1186 2015-01-11 Mark Wielaard <mjw@redhat.com>
1188 * dwarf_func_inline.c (dwarf_func_inline_instances): Call
1189 __libdw_visit_scopes with NULL imports.
1190 * dwarf_getfuncs.c (dwarf_getfuncs): Likewise.
1191 * dwarf_getscopes.c (pc_record): Likewise.
1192 (dwarf_getscopes): Likewise.
1193 * dwarf_getscopes_die.c (dwarf_getscopes_die): Likewise.
1194 * libdwP.h (__libdw_visit_scopes): Add imports argument.
1195 * libdw_visit_scopes.c (__libdw_visit_scopes): Likewise. Add new
1196 function imports_contains. Push and pop imports around walk_children
1197 when processing DW_TAG_imported_unit.
1199 2014-12-18 Ulrich Drepper <drepper@gmail.com>
1201 * Makefile.am: Suppress output of textrel_check command.
1203 2014-12-16 Mark Wielaard <mjw@redhat.com>
1205 * dwarf_getsrclines.c (read_srclines): Check diridx is valid under
1208 2014-12-16 Mark Wielaard <mjw@redhat.com>
1210 * dwarf_getpubnames.c (dwarf_getpubnames): Make sure there is enough
1211 space to read die offset.
1213 2014-12-16 Mark Wielaard <mjw@redhat.com>
1215 * dwarf_getsrclines.c (read_srclines): Correct overflow check for
1218 2014-12-15 Mark Wielaard <mjw@redhat.com>
1220 * dwarf_getpubnames.c (get_offsets): Make sure whole unit fall inside
1221 section data. Set error to DWARF_E_NO_ENTRY if cnt is zero.
1222 (dwarf_getpubnames): Make sure section data contains string zero
1225 2014-12-16 Mark Wielaard <mjw@redhat.com>
1227 * memory-access.h (__libdw_get_sleb128): Unroll the first step to help
1228 the compiler optimize for the common single-byte case.
1230 2014-12-15 Josh Stone <jistone@redhat.com>
1232 * memory-access.h (__libdw_max_len_leb128): New.
1233 (__libdw_get_uleb128): Use __libdw_max_len_leb128.
1234 (__libdw_get_sleb128): Likewise.
1236 2014-12-14 Mark Wielaard <mjw@redhat.com>
1238 * cfi.c (execute_cfi): Add program bounds checks.
1239 * dwarf_child.c (__libdw_find_attr): Add attrp bounds checks.
1240 * dwarf_formblock.c (dwarf_formblock): Call get_uleb128 with endp.
1241 * dwarf_formref.c (__libdw_formref): Add datap bounds checks.
1242 * dwarf_formsdata.c (dwarf_formsdata): Likewise.
1243 * dwarf_formudata.c (dwarf_formudata): Likewise.
1244 * dwarf_frame_register.c (dwarf_frame_register): Call get_uleb128
1245 with end of data buf.
1246 * dwarf_getabbrev.c (__libdw_getabbrev): Add abbrevp bounds checks.
1247 * dwarf_getabbrevattr.c (dwarf_getabbrevattr): Assume get_uleb128
1248 call gets enough data.
1249 * dwarf_getattrs,c (dwarf_getattrs): Call get_uleb128 with endp.
1250 * dwarf_getlocation.c (store_implicit_value): Call get_uleb128
1252 (__libdw_intern_expression): Call get_uleb128/get_sleb128 with
1254 * dwarf_getmacros.c (get_table_for_offset): Add nforms bounds check.
1255 * dwarf_getsrclines.c (read_srclines): Bounds check linep and call
1256 get_uleb128 with lineendp.
1257 * dwarf_hasattr.c (dwarf_hasattr): Bounds check attrp and call
1258 get_uleb128 with endp.
1259 * dwarf_next_cfi.c (dwarf_next_cfi): Bounds check bytes and call
1260 get_uleb128/get_sleb128 with limit.
1261 * encoded-value.h (read_encoded_value): Assume get_uleb128 and
1262 get_sleb128 get called with enough data.
1263 * fde.c (intern_fde): Call get_uleb128 with instructions_end.
1264 * libdwP.h (__libdw_dieabbrev): Call get_uleb128 with die->cu->endp.
1265 * libdw_form.c (__libdw_form_val_compute_len): Call get_uleb128 with
1267 * memory-access.h (__libdw_get_uleb128): Take an extra endp.
1268 Don't call get_uleb128_step if out of data.
1269 (__libdw_get_sleb128): Likewise for get_sleb128_step.
1271 2014-12-12 Mark Wielaard <mjw@redhat.com>
1273 * libdwP.h (struct Dwarf): Add fake_loc_cu.
1275 (DIE_OFFSET_FROM_CU_OFFSET): Don't use cu_data, use cu_sec_idx.
1276 (__libdw_form_val_compute_len): Drop dbg and endp arguments.
1277 (__libdw_form_val_len): Likewise.
1278 * libdw_form.c (__libdw_form_val_compute_len): Likewise.
1279 * libdw_findcu.c (__libdw_intern_next_unit): Don't use cu_data, use
1280 the already found data buffer directly.
1281 * dwarf_begin_elf.c (valid_p): Setup fake_loc_cu.
1282 * dwarf_end.c (dwarf_end): Free fake_loc_cu.
1283 * dwarf_child.c (__libdw_find_attr): Call __libdw_form_val_len with
1285 * dwarf_getattrs.c (dwarf_getattrs): Likewise.
1286 * dwarf_formblock.c (dwarf_formblock): Add bounds checking.
1287 * dwarf_getlocation_attr.c (attr_form_cu): New function.
1288 (dwarf_getlocation_attr): Use attr_form_cu to set result->cu.
1289 (getlocation): Handle empty blocks immediately.
1290 * dwarf_getlocation_implicit_pointer.c (empty_cu): New static var.
1291 (__libdw_empty_loc_attr): Drop cu argument, use empty_cu.
1292 (dwarf_getlocation_implicit_pointer): Call __libdw_empty_loc_attr with
1294 * dwarf_getmacros.c (read_macros): Also setup startp and endp for
1295 fake_cu. Call __libdw_form_val_len with just fake_cu.
1296 * dwarf_formref_die.c (dwarf_formref_die): Don't use cu_data, get
1297 datap and size directly from cu startp and endp.
1299 2014-12-11 Mark Wielaard <mjw@redhat.com>
1301 * libdw_findcu.c (__libdw_intern_next_unit): Sanity check offset.
1303 2014-12-13 Mark Wielaard <mjw@redhat.com>
1305 * dwarf_getaranges.c (compare_aranges): Make sure Dwarf_Addr
1306 difference doesn't wrap around before returning as int.
1308 2014-12-11 Josh Stone <jistone@redhat.com>
1310 * dwarf_getsrclines.c (struct linelist): Add sequence.
1311 (compare_lines): Take linelists, and break ties by sequence.
1312 (read_srclines): Use linelists for sorting.
1313 (read_srclines::add_new_line): Set sequence.
1315 2014-12-10 Josh Stone <jistone@redhat.com>
1317 * libdwP.h (Dwarf_CU): Add startp and endp boundaries.
1318 * libdw_findcu.c (__libdw_intern_next_unit): Set startp and endp.
1319 * dwarf_child.c (dwarf_child): Use cu->endp.
1320 * dwarf_cuoffset.c (dwarf_cuoffset): Use cu->startp.
1321 * dwarf_dieoffset.c (dwarf_dieoffset): Use cu->startp.
1322 * dwarf_siblingof.c (dwarf_siblingof): Use both.
1324 2014-12-10 Josh Stone <jistone@redhat.com>
1326 * dwarf_hasattr.c (dwarf_hasattr): Just walk abbrev for presence.
1328 2014-12-10 Josh Stone <jistone@redhat.com>
1330 * libdwP.h (__libdw_dieabbrev): New die->abbrev lookup function.
1331 * dwarf_child.c (__libdw_find_attr, dwarf_child): Use it.
1332 * dwarf_getattrs.c (dwarf_getattrs): Likewise.
1333 * dwarf_haschildren.c (dwarf_haschildren): Likewise.
1334 * dwarf_tag.c (dwarf_tag): Likewise.
1336 2014-12-04 Mark Wielaard <mjw@redhat.com>
1338 * libdwP.h (__libdw_form_val_compute_len): Add endp argument.
1339 (__libdw_form_val_len): Likewise and check len doesn't overflow.
1340 * libdw_form.c (__libdw_form_val_compute_len): Likewise.
1341 * dwarf_child.c (__libdw_find_attr): Call __libdw_form_val_len
1343 * dwarf_getattrs.c (dwarf_getattrs): Likewise.
1344 * dwarf_getmacros.c (read_macros): Likewise and check for errors.
1346 2014-12-02 Petr Machata <pmachata@redhat.com>
1348 * dwarf_getmacros.c (token_from_offset, offset_from_token): New
1350 (do_dwarf_getmacros_die): Merge into dwarf_getmacros.
1351 * libdw.h (DWARF_GETMACROS_START): New macro.
1353 2014-11-27 Mark Wielaard <mjw@redhat.com>
1355 * Makefile.am (libdw.so): Use textrel_check.
1357 2014-11-27 Mark Wielaard <mjw@redhat.com>
1359 * dwarf_getcfi_elf.c (getcfi_gnu_eh_frame): Initialize
1360 search_table_entries and search_table_encoding.
1362 2014-11-24 Mark Wielaard <mjw@redhat.com>
1364 * dwarf_getsrclines.c (read_srclines): Check line_range is not zero
1367 2014-11-23 Mark Wielaard <mjw@redhat.com>
1369 * dwarf_attr.c (dwarf_attr): Check __libdw_find_attr return value.
1370 * dwarf_hasattr.c (dwarf_hasattr): Likewise.
1371 * dwarf_siblingof.c (dwarf_siblingof): Likewise.
1373 2014-11-23 Mark Wielaard <mjw@redhat.com>
1375 * dwarf_getabbrev.c (__libdw_getabbrev): Don't assert on bad DWARF.
1376 Set libdw errno and return NULL.
1378 2014-11-24 Mark Wielaard <mjw@redhat.com>
1380 * dwarf.h (DW_LANG_C_plus_plus_11): Added.
1381 (DW_LANG_C11): Likewise.
1382 (DW_LANG_C_plus_plus_14): Likewise.
1383 * dwarf_aggregate_size.c (array_size): Handle DW_LANG_C11,
1384 DW_LANG_C_plus_plus_11, DW_LANG_C_plus_plus_14 and DW_LANG_Go
1386 * dwarf_getfuncs.c (dwarf_getfuncs): Set c_cu to true for
1389 2014-11-26 Mark Wielaard <mjw@redhat.com>
1391 * dwarf.h (DW_AT_noreturn): Added.
1393 2014-11-11 Mark Wielaard <mjw@redhat.com>
1395 * dwarf_getsrclines.c (read_srclines): Do address_size comparison
1396 explicitly as uint8_t.
1397 (__libdw_getsrclines): Add internal_function to declaration.
1399 2014-09-10 Petr Machata <pmachata@redhat.com>
1401 * dwarf_macro_getparamcnt.c: New file.
1402 * dwarf_macro_param.c: New file.
1403 * dwarf_macro_getsrcfiles.c: New file.
1404 * Makefile.am (libdw_a_SOURCES): Add the new files.
1405 * libdwP.h (struct files_lines_s): New structure.
1406 (DWARF_E_INVALID_OPCODE): New enumerator.
1407 (struct Dwarf): New fields macro_ops, files_lines.
1408 (Dwarf_Macro_Op_Proto, Dwarf_Macro_Op_Table): New structures for
1409 keeping macro opcode prototypes in.
1410 (Dwarf_Macro_s): Redefine from scratch.
1411 (__libdw_getsrclines, __libdw_getcompdir, libdw_macro_nforms): New
1412 internal interfaces.
1413 * dwarf_error.c (errmsgs): Add a message for
1414 DWARF_E_INVALID_OPCODE.
1415 * dwarf_end.c (dwarf_end): Destroy struct Dwarf.macro_ops and
1417 * libdw.h (dwarf_getmacros_off, dwarf_macro_getparamcnt)
1418 (dwarf_macro_getsrcfiles, dwarf_macro_param): New public
1420 * dwarf_getmacros.c (dwarf_getmacros_off): New function,
1421 (get_offset_from, macro_op_compare, build_table)
1422 (init_macinfo_table, get_macinfo_table, get_table_for_offset)
1423 (cache_op_table, read_macros, gnu_macros_getmacros_off)
1424 (macro_info_getmacros_off, do_dwarf_getmacros_die): New helper
1426 (dwarf_getmacros): Adjust to dispatch to the new interfaces.
1427 * dwarf_getsrclines.c (read_srclines): New function with guts
1428 taken from dwarf_getsrclines.
1429 (__libdw_getsrclines): Likewise.
1430 (__libdw_getcompdir, files_lines_compare): New functions.
1431 (dwarf_getsrclines): Make it dispatch to the new interfaces.
1432 * dwarf_macro_param1.c (dwarf_macro_param1): Adjust to dispatch to
1434 * dwarf_macro_param2.c (dwarf_macro_param2): Likewise.
1435 * libdw.map (ELFUTILS_0.161): New. Add dwarf_getmacros_off,
1436 dwarf_macro_getsrcfiles, dwarf_macro_getparamcnt, dwarf_macro_param.
1438 2014-10-06 Mark Wielaard <mjw@redhat.com>
1440 * Makefile.am (libdw_a_SOURCES): Add dwarf_peel_type.c.
1441 * dwarf_aggregate_size.c (get_type): Use dwarf_peel_type.
1442 (aggregate_size): Likewise. Add old and new version.
1443 * dwarf_peel_type.c: New file.
1444 * libdw.h (dwarf_peel_type): New function declaration.
1445 * libdwP.h (dwarf_peel_type): New internal declaration.
1446 * libdw.map (ELFUTILS_0.161): New section.
1448 2014-10-15 Petr Machata <pmachata@redhat.com>
1450 * libdwP.h (struct Dwarf_Files_s.cu): Drop field.
1451 * dwarf_getsrclines.c (dwarf_getsrclines): Don't set it.
1453 2014-10-05 Mark Wielaard <mjw@redhat.com>
1455 * dwarf.h: Add DW_AT_GNU_deleted.
1457 2014-10-02 Mark Wielaard <mjw@redhat.com>
1459 * dwarf_aggregate_size.c (aggregate_size): Return CU address_size
1460 for sizeless DW_TAG_pointer_type, DW_TAG_reference_type or
1461 DW_TAG_rvalue_reference_type.
1463 2014-09-12 Petr Machata <pmachata@redhat.com>
1465 * memory-access.h (read_ubyte_unaligned_inc): Allow only 4- and
1466 8-byte quantities. Consequently, rename to...
1467 (read_addr_unaligned_inc): ... this.
1468 (read_sbyte_unaligned_inc, read_ubyte_unaligned): Drop.
1469 (read_sbyte_unaligned): Drop.
1471 2014-09-10 Petr Machata <pmachata@redhat.com>
1473 * dwarf_getlocation.c (attr_ok): Also accept
1474 DW_AT_GNU_call_site_value, DW_AT_GNU_call_site_data_value,
1475 DW_AT_GNU_call_site_target, DW_AT_GNU_call_site_target_clobbered.
1477 2014-08-15 Mark Wielaard <mjw@redhat.com>
1479 * dwarf_cu_die.c: New file.
1480 * Makefile.am (libdw_a_SOURCES): Add dwarf_cu_die.c.
1481 * libdw.h (dwarf_cu_die): New function declaration.
1482 * libdw.map (ELFUTILS_0.160): Add dwarf_cu_die.
1484 2014-08-15 Mark Wielaard <mjw@redhat.com>
1486 * dwarf_cu_getdwarf.c: New file.
1487 * Makefile.am (libdw_a_SOURCES): Add dwarf_cu_getdwarf.c.
1488 * libdw.h (Dwarf_CU): New typedef.
1489 (dwarf_cu_getdwarf): New function declaration.
1490 * libdw.map (ELFUTILS_0.160): New. Add dwarf_cu_getdwarf.
1492 2014-06-18 Mark Wielaard <mjw@redhat.com>
1494 * dwarf.h: Remove DW_TAG_mutable_type.
1496 2014-05-02 Mark Wielaard <mjw@redhat.com>
1498 * libdwP.h (__check_build_id): Removed now unused.
1500 2014-05-01 Mark Wielaard <mjw@redhat.com>
1502 * libdwP.h (struct Dwarf): Remove free_alt.
1503 * dwarf_end.c (dwarf_end): Don't check free_alt, don't end alt_dwarf.
1504 * dwarf_setalt.c (dwarf_setalt): Don't check or set free_alt.
1506 2014-04-30 Mark Wielaard <mjw@redhat.com>
1508 * libdw.map (ELFUTILS_0.159): Add dwelf_elf_gnu_build_id.
1510 2014-04-15 Florian Weimer <fweimer@redhat.com>
1512 * dwarf_begin_elf.c (__check_build_id, try_debugaltlink)
1513 (open_debugaltlink): Move to libdwfl.
1514 (check_section): Do not locate alternate debuginfo.
1516 2014-04-24 Florian Weimer <fweimer@redhat.com>
1518 * libdw.map (ELFUTILS_0.159): Export dwelf_dwarf_gnu_debugaltlink.
1520 2014-04-22 Florian Weimer <fweimer@redhat.com>
1522 * dwarf_getalt.c, dwarf_setalt.c: New files.
1523 * Makefile.am (libdw_a_SOURCES): Add them.
1524 * libdw.h (dwarf_getalt, dwarf_setalt): Add function declarations.
1525 * libdwP.h (dwarf_getalt, dwarf_setalt): Add internal function
1527 * libdw.map (ELFUTILS_0.159): Export the two new functions.
1529 2014-04-15 Florian Weimer <fweimer@redhat.com>
1531 * libdwP.h (enum IDX_gnu_debugaltlink): New.
1532 * dwarf_begin_elf.c (dwarf_scnnames): Increase string size and add
1534 (check_section): Obtain .gnu_debugaltlink section from the
1537 2014-04-11 Mark Wielaard <mjw@redhat.com>
1539 * libdw.map (ELFUTILS_0.159): New. Add dwelf_elf_gnu_debuglink.
1540 * Makefile.am (libdw.so): Depend on libdwelf_pic.a.
1541 (libdwelf_objects): New variable.
1542 (libdw_a_LIBADD): Add libdwelf objects.
1544 2014-04-22 Mark Wielaard <mjw@redhat.com>
1546 * memory-access.h (get_sleb128_step): Remove undefined behavior
1547 of left shifting a signed value. Replace it with a multiplication.
1549 2014-04-13 Mark Wielaard <mjw@redhat.com>
1551 * Makefile.am: Remove !MUDFLAP conditions.
1553 2014-04-09 Mark Wielaard <mjw@redhat.com>
1555 * dwarf_begin_elf.c (check_section): Check for unsigned overflow
1556 before calling malloc to uncompress data.
1558 2014-03-03 Jan Kratochvil <jan.kratochvil@redhat.com>
1560 Fix abort() on missing section headers.
1561 * dwarf_begin_elf.c (check_section): Replace abort call by goto err.
1562 New label err to return NULL.
1564 2014-02-05 Josh Stone <jistone@redhat.com>
1566 * dwarf_decl_file.c (dwarf_decl_file): Read the idx as unsigned.
1567 * dwarf_decl_line.c (__libdw_attr_intval): Read the line/column as
1568 unsigned. Change the range assert to DWARF_E_INVALID_DWARF.
1570 2013-12-30 Mark Wielaard <mjw@redhat.com>
1572 * libdw.map (ELFUTILS_0.158): Add dwfl_core_file_attach and
1573 dwfl_linux_proc_attach.
1575 2013-12-20 Mark Wielaard <mjw@redhat.com>
1577 * libdw.map (ELFUTILS_0.158): Add dwfl_getthread_frames.
1579 2013-12-18 Mark Wielaard <mjw@redhat.com>
1581 * libdw.map (ELFUTILS_0.158): Remove dwfl_module_addrsym_elf and
1582 dwfl_module_getsym_elf. Add dwfl_module_addrinfo and
1583 dwfl_module_getsym_info.
1585 2013-12-16 Mark Wielaard <mjw@redhat.com>
1587 * libdw.map (ELFUTILS_0.158): Add dwfl_module_getsymtab_first_global.
1589 2013-12-10 Josh Stone <jistone@redhat.com>
1591 * memory-access.h (get_uleb128_rest_return): Removed.
1592 (get_sleb128_rest_return): Removed.
1593 (get_uleb128_step): Make this a self-contained block.
1594 (get_sleb128_step): Ditto, and use a bitfield to extend signs.
1595 (get_uleb128): Make this wholly implemented by __libdw_get_uleb128.
1596 (get_sleb128): Make this wholly implemented by __libdw_get_sleb128.
1597 (__libdw_get_uleb128): Simplify and inline for all callers.
1598 (__libdw_get_sleb128): Ditto.
1599 * dwarf_getlocation.c (store_implicit_value): Void the unused uleb128.
1600 * memory-access.c: Delete file.
1601 * Makefile.am (libdw_a_SOURCES): Remove it.
1602 (DEFS): Remove the now unused -DIS_LIBDW.
1604 2013-12-09 Josh Stone <jistone@redhat.com>
1606 * libdw_form.c (__libdw_form_val_compute_len): Renamed function from
1607 __libdw_form_val_len, now handling only non-constant form lengths.
1608 * libdwP.h (__libdw_form_val_len): New inlined function.
1610 2013-12-09 Mark Wielaard <mjw@redhat.com>
1612 * dwarf_getlocation.c (__libdw_intern_expression): Handle empty
1613 location expressions.
1614 * dwarf_getlocation_attr.c (dwarf_getlocation_attr): When no
1615 location found, return empty location expression.
1616 * dwarf_getlocation_implicit_pointer.c
1617 (dwarf_getlocation_implicit_pointer): Likewise.
1618 (__libdw_empty_loc_attr): New internal function.
1619 * libdwP.h (__libdw_empty_loc_attr): Define.
1621 2013-11-27 Mark Wielaard <mjw@redhat.com>
1623 * libdw.map (ELFUTILS_0.158): Add dwfl_module_addrsym_elf and
1624 dwfl_module_getsym_elf.
1626 2013-11-26 Mark Wielaard <mjw@redhat.com>
1628 * libdw.map (ELFUTILS_0.156): Move dwfl_attach_state, dwfl_pid,
1629 dwfl_thread_dwfl, dwfl_thread_tid, dwfl_frame_thread,
1630 dwfl_thread_state_registers, dwfl_thread_state_register_pc,
1631 dwfl_getthreads, dwfl_thread_getframes and dwfl_frame_pc to ...
1632 (ELFUTILS_0.158): ... here.
1634 2013-11-09 Mark Wielaard <mjw@redhat.com>
1636 * dwarf_getaranges.c (dwarf_getaranges): Read segment_size and
1637 check that it is zero.
1639 2013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com>
1641 * cfi.h (struct Dwarf_Frame_s): Make the comment more specific.
1642 * libdw.map (ELFUTILS_0.156): Add dwfl_attach_state, dwfl_pid,
1643 dwfl_thread_dwfl, dwfl_thread_tid, dwfl_frame_thread,
1644 dwfl_thread_state_registers, dwfl_thread_state_register_pc,
1645 dwfl_getthreads, dwfl_thread_getframes and dwfl_frame_pc.
1647 2013-11-01 Michael Forney <mforney@mforney.org>
1649 * Makefile.am (libdwfl_objects): New definition.
1650 (libdw_a_LIBADD): Use libdwfl_objects.
1652 2013-11-01 Michael Forney <mforney@mforney.org>
1654 * Makefile.am: Use READELF.
1656 2013-10-30 Jan Kratochvil <jan.kratochvil@redhat.com>
1658 * libdw.map (ELFUTILS_0.158): New.
1660 2013-10-10 Mark Wielaard <mjw@redhat.com>
1662 * dwarf_getfuncs.c (struct visitor_info): Rename start_offset to
1663 start_addr and rename last_offset to last_addr. Now both void *.
1664 (tree_visitor): Use start_add and die_addr instead of start_offset
1666 (dwarf_getfuncs): Use last_addr instead of last_offset.
1668 2013-10-06 Mark Wielaard <mjw@redhat.com>
1670 * cfi.c (execute_cfi): Make sure DW_CFA_expression and
1671 DW_CFA_val_expression are not used with abi_cfi.
1673 2013-10-03 Josh Stone <jistone@redhat.com>
1675 * dwarf_formref_die.c (dwarf_formref_die): Don't hash the sig8 here.
1676 * libdw_findcu.c (__libdw_intern_next_unit): Since this never revisits
1677 a unit, make sure to always hash the sig8 here, so none are missed.
1679 2013-09-29 Mark Wielaard <mjw@redhat.com>
1681 * dwarf_getlocation.c (store_implicit_value): Cast op->number2 to
1682 uintptr_t before casting to char *.
1683 (__libdw_intern_expression): Cast data to uintptr_t before casting
1685 * dwarf_getlocation_attr.c (dwarf_getlocation_attr): Cast
1686 op->number2 to uintptr_t before casting to char *.
1688 2013-09-24 Josh Stone <jistone@redhat.com>
1690 * libdw_visit_scopes.c (classify_die): Removed.
1691 (may_have_scopes): New function to replace classify_die. There's no
1692 need for full classification; just find tags that may contain scopes.
1693 (__libdw_visit_scopes): Use a direct tag comparison for imported
1694 units, and use may_have_scopes to test if recursion is needed.
1696 2013-09-20 Mark Wielaard <mjw@redhat.com>
1698 * dwarf_getfuncs.c (visitor_info): New struct.
1699 (tree_visitor): New function.
1700 (dwarf_getfuncs): Use __libdw_visit_scopes with tree_visitor.
1701 * libdw.h (dwarf_getfuncs): Expand function documentation.
1703 2013-09-12 Mark Wielaard <mjw@redhat.com>
1705 * fde.c (intern_fde): Free fde and set libdw errno when start
1706 or end could not be read.
1708 2013-08-24 Mark Wielaard <mjw@redhat.com>
1710 * dwarf_getlocation.c (store_implicit_value): Don't take data
1711 as argument, get block data from op number2. Return false when
1712 block data length and op number don't match up.
1713 (__libdw_intern_expression): Store start of block for
1714 DW_OP_implicit_value and DW_OP_GNU_entry_value instead of
1715 relative data offset. Also store block start (including length)
1716 for DW_OP_GNU_const_type. Don't pass data to store_implicit_value.
1717 * dwarf_getlocation_attr.c: New file.
1718 * dwarf_getlocation_die.c: Likewise.
1719 * libdw.h (dwarf_getlocation_die): New function definition.
1720 (dwarf_getlocation_attr): Likewise.
1721 * libdwP.h: Declare internal dwarf_getlocation_die.
1722 * libdw.map (ELFUTILS_0.157): Add dwarf_getlocation_die and
1723 dwarf_getlocation_attr.
1724 * Makefile.am (libdw_a_SOURCES): Add dwarf_getlocation_die.c and
1725 dwarf_getlocation_attr.c.
1727 2013-08-23 Mark Wielaard <mjw@redhat.com>
1729 * dwarf_getlocation.c (attr_ok): Also accept DW_AT_segment.
1730 (attr_base_address): New function.
1731 (initial_offset_base): New function.
1732 (getlocations_addr): New function. Taken from...
1733 (dwarf_getlocation_addr): here. Use new initial_offset_base and
1735 (dwarf_getlocations): New function.
1736 * libdw.h (dwarf_getlocations): New function definition.
1737 * libdw.map (ELFUTILS_0.157): New.
1739 2013-07-02 Mark Wielaard <mjw@redhat.com>
1741 * dwarf_getsrclines.c (dwarf_getsrclines): Add new stack allocation
1742 limit MAX_STACK_ALLOC. After MAX_STACK_ALLOC lines use malloc in
1743 NEW_LINE macro. Free malloced line records if any at the end.
1745 2013-07-02 Mark Wielaard <mjw@redhat.com>
1747 * dwarf_getcfi_elf.c (getcfi_shdr): Check sh_type == SHT_PROGBITS.
1749 2013-06-26 Mark Wielaard <mjw@redhat.com>
1751 * libdw_visit_scopes.c (__libdw_visit_scopes): Don't reject root
1752 DIEs without children. Return an error whenever dwarf_child or
1753 dwarf_siblingof return an error. Don't call recurse and increase
1754 the depth for an imported unit. Walk the children of an imported
1755 unit as if they are logical children of the parent root DIE.
1757 2013-05-03 Mark Wielaard <mjw@redhat.com>
1759 * dwarf_getsrclines.c (dwarf_getsrclines): Only set end_sequence
1762 2013-04-28 Jan Kratochvil <jan.kratochvil@redhat.com>
1764 * libdw.map (ELFUTILS_0.156): New.
1766 2013-04-24 Mark Wielaard <mjw@redhat.com>
1768 * Makefile.am: Use AM_CPPFLAGS instead of INCLUDES.
1770 2013-04-10 Mark Wielaard <mjw@redhat.com>
1772 * dwarf_formref_die.c (dwarf_formref_die): Reference size is only
1773 equal to address size when we have a DW_FORM_ref_addr for DWARF
1776 2013-03-25 Mark Wielaard <mjw@redhat.com>
1778 * dwarf_getsrclines.c (dwarf_getsrclines): Mark highest address as
1781 2013-03-12 Mark Wielaard <mjw@redhat.com>
1783 * dwarf_getsrcfiles.c (dwarf_getsrcfiles): Allow DW_TAG_partial_unit.
1784 * dwarf_getsrclines.c (dwarf_getsrclines): Likewise.
1786 2013-02-15 Mark Wielaard <mjw@redhat.com>
1788 * dwarf_formstring.c (dwarf_formstring): Check dbg_ret->sectiondata,
1789 not dbg->sectiondata.
1791 2013-01-07 Roland McGrath <roland@hack.frob.com>
1794 [ALLOW_UNALIGNED] (read_8ubyte_unaligned_noncvt): New macro.
1795 [!ALLOW_UNALIGNED] (read_8ubyte_unaligned_noncvt): New inline function.
1797 2012-12-18 Mark Wielaard <mjw@redhat.com>
1799 * dwarf_begin_elf.c (valid_p): Call Dwarf_Sig8_Hash_free if invalid.
1800 (check_section): Likewise on error.
1801 (scngrp_read): Likewise.
1802 (dwarf_begin_elf): Likewise.
1804 2012-10-09 Petr Machata <pmachata@redhat.com>
1806 * dwarf_getlocation.c (__libdw_intern_expression): Handle
1807 DW_OP_GNU_parameter_ref, DW_OP_GNU_convert, DW_OP_GNU_reinterpret,
1808 DW_OP_GNU_regval_type, DW_OP_GNU_entry_value,
1809 DW_OP_GNU_deref_type, DW_OP_GNU_const_type.
1811 2012-10-08 Jan Kratochvil <jan.kratochvil@redhat.com>
1813 * cfi.c: New include system.h.
1814 (execute_cfi) (enough_registers): Clear new memory after realloc.
1816 2012-10-08 Jan Kratochvil <jan.kratochvil@redhat.com>
1818 * fde.c (__libdw_find_fde): Change <fde != NULL> to likely. Return
1819 DWARF_E_NO_MATCH if .eh_frame_hdr points to FDE which is too short for
1822 2012-10-08 Jan Kratochvil <jan.kratochvil@redhat.com>
1824 * dwarf_getlocation.c (__libdw_intern_expression) <cfap>: Make new
1825 loclist element DW_OP_call_frame_cfa before decoding the opcodes.
1826 Remove the later DW_OP_call_frame_cfa push to RESULT.
1828 2012-10-08 Jan Kratochvil <jan.kratochvil@redhat.com>
1831 * fde.c (binary_search_fde): Remove always true <address >= start>
1832 conditional. Move L initialization upwards.
1834 2012-08-24 Mark Wielaard <mjw@redhat.com>
1836 * dwarf_begin_elf.c (check_section): Only probe for dwz multi files
1837 when ENABLE_DWZ is defined.
1838 * libdwP.h (__check_build_id): Only declare when ENABLE_DWZ is
1841 2012-08-16 Mark Wielaard <mjw@redhat.com>
1843 * Makefile.am (EXTRA_DIST): Add known-dwarf.h.
1844 * dwarf.h (DW_LANG_Go): Update comment.
1845 (DW_LANG_Mips_Assembler): Likewise.
1847 2012-06-27 Mark Wielaard <mjw@redhat.com>
1849 * dwarf.h: Add DW_FORM_GNU_ref_alt and DW_FORM_GNU_strp_alt.
1850 * dwarf_begin.c (dwarf_begin): Add INTDEF.
1851 * dwarf_begin_elf.c (__check_build_id): New internal_function.
1852 (try_debugaltlink): New function.
1853 (open_debugaltlink): Likewise.
1854 (check_section): Try open_debugaltlink for .gnu_debugaltlink.
1855 * dwarf_end.c (dwarf_end): Free the alternative Dwarf descriptor if
1857 * dwarf_error.c (errmsgs): Add DWARF_E_NO_ALT_DEBUGLINK.
1858 * dwarf_formref.c (__libdw_formref): Using DW_FORM_GNU_ref_alt
1860 * dwarf_formref_die.c (dwarf_formref_die): Handle DW_FORM_GNU_ref_alt.
1861 * dwarf_formstring.c (dwarf_formstring): Handle DW_FORM_GNU_strp_alt.
1862 * dwarf_formudata.c (__libdw_formptr): Adjust __libdw_read_offset
1864 * dwarf_getpubnames.c (get_offsets): Adjust __libdw_read_offset call.
1865 * libdwP.h: Add DWARF_E_NO_ALT_DEBUGLINK.
1866 (struct Dwarf): Add alt_dwarf and free_alt fields.
1867 (__libdw_read_offset): Add dbg_ret argument, use to check with
1868 __libdw_offset_in_section.
1869 (__check_build_id): New function declaration.
1870 (dwarf_begin): Define as INTDECL.
1871 * libdw_form.c (__libdw_form_val_len): Handle DW_FORM_GNU_ref_alt
1872 and DW_FORM_GNU_strp_alt.
1874 2012-07-19 Mark Wielaard <mjw@redhat.com>
1876 * dwarf.h: Add DW_OP_GNU_parameter_ref.
1878 2012-07-24 Mark Wielaard <mjw@redhat.com>
1880 * dwarf.h: Correct spelling of DW_LANG_ObjC.
1881 * dwarf_aggregate_size.c (array_size): Use correct spelling of
1884 2012-07-24 Mark Wielaard <mjw@redhat.com>
1886 * dwarf.h: Add DW_ATE_UTF.
1888 2012-06-27 Mark Wielaard <mjw@redhat.com>
1890 * dwarf.h: Add DW_MACRO_GNU .debug_macro type encodings.
1892 2012-06-26 Mark Wielaard <mjw@redhat.com>
1894 * libdwP.h: Add IDX_debug_macro.
1895 * dwarf.h: Add DW_AT_GNU_macros.
1896 * dwarf_begin_elf.c (dwarf_scnnames): Add .debug_macro.
1897 * dwarf_formudata.c (dwarf_formudata): Recognize DW_AT_GNU_macros.
1899 2012-04-27 Mark Wielaard <mjw@redhat.com>
1901 * libdw/dwarf_highpc.c (dwarf_highpc): Handle DW_AT_high_pc being
1902 a constant offset from DW_AT_low_pc.
1904 2012-03-19 Tom Tromey <tromey@redhat.com>
1906 * libdw_findcu.c (findcu_cb): Move earlier.
1907 (__libdw_intern_next_unit): Add new CU to search tree here...
1908 (__libdw_findcu): ... not here.
1910 2012-01-31 Mark Wielaard <mjw@redhat.com>
1912 * dwarf_formudata.c (dwarf_formudata): Handle DW_FORM_sec_offset.
1914 2011-11-31 Mark Wielaard <mjw@redhat.com>
1916 * Makefile.am (known-dwarf.h): Run gawk on config/known-dwarf.awk.
1918 2011-07-14 Mark Wielaard <mjw@redhat.com>
1920 * libdw.h (dwarf_offdie): Fix documentation to mention .debug_info.
1922 2011-05-16 Jakub Jelinek <jakub@redhat.com>
1924 * dwarf.h (DW_OP_GNU_const_type, DW_OP_GNU_regval_type,
1925 DW_OP_GNU_deref_type, DW_OP_GNU_convert, DW_OP_GNU_reinterpret):
1928 2011-04-26 Mark Wielaard <mjw@redhat.com>
1930 * dwarf_child (dwarf_child): Sanity check end of section against
1931 cu_data () of die->cu.
1933 2011-03-22 Mark Wielaard <mjw@redhat.com>
1935 * dwarf.h: Add DW_TAG_GNU_call_site,
1936 DW_TAG_GNU_call_site_parameter,
1937 DW_AT_GNU_call_site_value,
1938 DW_AT_GNU_call_site_data_value,
1939 DW_AT_GNU_call_site_target,
1940 DW_AT_GNU_call_site_target_clobbered,
1941 DW_AT_GNU_tail_call,
1942 DW_AT_GNU_all_tail_call_sites,
1943 DW_AT_GNU_all_call_sites,
1944 DW_AT_GNU_all_source_call_sites,
1945 and DW_OP_GNU_entry_value.
1947 2011-03-10 Petr Machata <pmachata@redhat.com>
1949 * libdw/dwarf_tag.c (__libdw_findabbrev): Reject requests for
1950 abbreviation with code 0.
1952 2011-03-09 Petr Machata <pmachata@redhat.com>
1954 * libdw/dwarf_child.c (dwarf_child): Check for section overrun.
1956 2011-02-23 Roland McGrath <roland@redhat.com>
1958 * libdwP.h (struct Dwarf) [USE_ZLIB]: New member sectiondata_gzip_mask.
1959 Declare __libdw_free_zdata.
1960 * dwarf_end.c [USE_ZLIB] (__libdw_free_zdata): New function.
1961 (dwarf_end): Call it.
1963 * dwarf_begin_elf.c (valid_p): Likewise.
1964 (check_section, scngrp_read): Likewise.
1965 (check_section) [USE_ZLIB]: Grok .z* flavors of sections.
1967 2010-10-13 Roland McGrath <roland@redhat.com>
1969 * dwarf.h: Add DW_LANG_Go.
1971 2010-10-05 Roland McGrath <roland@redhat.com>
1973 * dwarf_getaranges.c: Use malloc rather than alloca,
1974 since the total number of elements can be quite huge.
1976 2010-07-26 Roland McGrath <roland@redhat.com>
1978 * dwarf_getlocation_implicit_pointer.c: New file.
1979 * Makefile.am (libdw_a_SOURCES): Add it.
1980 * libdw.map (ELFUTILS_0.149): New set.
1981 Add dwarf_getlocation_implicit_pointer.
1982 * libdw.h: Declare it.
1984 * dwarf_offdie.c (do_offdie): Renamed to __libdw_offdie, made global.
1985 (dwarf_offdie, dwarf_offdie_types): Update callers.
1986 * libdwP.h: Declare it.
1988 * dwarf.h: Add DW_OP_GNU_implicit_pointer.
1989 * dwarf_getlocation.c (__libdw_intern_expression): Handle it.
1991 2010-08-24 Roland McGrath <roland@redhat.com>
1993 * libdw.map (ELFUTILS_0.149): New set. Add dwfl_dwarf_line.
1995 2010-07-27 Roland McGrath <roland@redhat.com>
1997 * dwarf_formref_die.c: Fix sig8 hash insertion.
1999 2010-06-23 Roland McGrath <roland@redhat.com>
2001 * cfi.c (dwarf_cfi_validate_fde): Function removed.
2002 * libdw.h: Remove it.
2003 * libdw.map: Likewise.
2005 2010-06-22 Roland McGrath <roland@redhat.com>
2007 * dwarf_getlocation.c (check_constant_offset): data[48] are constant.
2009 * dwarf_getsrclines.c: Fix signed comparison warning in extended
2012 2010-06-21 Roland McGrath <roland@redhat.com>
2014 * dwarf.h: Add DW_TAG_GNU_* constants.
2016 * memory-access.h (get_sleb128_rest_return): Fix sign extension for
2019 2010-06-20 Roland McGrath <roland@redhat.com>
2021 * libdw_findcu.c (__libdw_findcu): Take new flag argument,
2022 to search TUs instead of CUs.
2023 * libdwP.h: Update decl.
2024 (struct Dwarf): New member tu_tree.
2025 * dwarf_end.c (dwarf_end): Clean up tu_tree.
2026 * dwarf_offdie.c (do_offdie): New function, broken out of ...
2027 (dwarf_offdie): ... here.
2028 (dwarf_offdie_types): New function.
2029 * libdw.h: Declare it.
2030 * libdw.map (ELFUTILS_0.148): Add it.
2032 * libdwP.h (CUDIE): Use cu_data.
2033 * dwarf_formblock.c: Likewise.
2034 * dwarf_formref_die.c: Likewise.
2035 * dwarf_diecu.c: Use CUDIE macro.
2036 * dwarf_formaddr.c: Use cu_sec_idx.
2038 2010-06-16 Roland McGrath <roland@redhat.com>
2040 * dwarf_formref_die.c: Use dwarf_offdie only for DW_FORM_ref_addr, so
2041 we don't repeat a CU lookup we've already done. Handle
2042 DW_FORM_ref_sig8 using sig8_hash table and __libdw_intern_next_unit.
2044 * libdw_findcu.c (__libdw_intern_next_unit): New function,
2046 (__libdw_findcu): ... here. Call it.
2047 * libdwP.h: Declare it.
2048 (struct Dwarf): New member next_tu_offset.
2050 * dwarf_sig8_hash.c: New file.
2051 * dwarf_sig8_hash.h: New file.
2052 * Makefile.am (libdw_a_SOURCES, noinst_HEADERS): Add them.
2053 * dwarf_abbrev_hash.c: Include dwarf_sig8_hash.h before
2055 * libdwP.h (struct Dwarf): New member sig8_hash.
2056 * dwarf_begin_elf.c: Call Dwarf_Sig8_Hash_init on it.
2057 * dwarf_end.c: Call Dwarf_Sig8_Hash_free on it.
2059 * dwarf_nextcu.c (dwarf_next_unit): New function, broken out of ...
2060 (dwarf_nextcu): ... here. Call it.
2061 * libdw.h: Declare it.
2062 * libdwP.h: Add INTDECL.
2063 * libdw_findcu.c (__libdw_findcu): Use it instead of dwarf_nextcu.
2064 * libdw.map (ELFUTILS_0.148): New set, add dwarf_next_unit.
2066 * libdwP.h (cu_sec_idx, cu_data): New functions.
2067 Use .debug_types when CU is a TU.
2068 * dwarf_cuoffset.c: Use that instead of assuming IDX_debug_info.
2069 * dwarf_siblingof.c: Likewise.
2070 * dwarf_formstring.c: Likewise.
2071 * dwarf_formudata.c (__libdw_formptr, dwarf_formudata): Likewise.
2072 * dwarf_getlocation.c (dwarf_getlocation): Likewise.
2073 (dwarf_getlocation_addr): Likewise.
2075 * libdwP.h (struct Dwarf_CU): Add new members type_offset, type_sig8.
2076 (DIE_OFFSET_FROM_CU_OFFSET): Take flag argument; if true, compute
2077 .debug_types header size instead of .debug_info header size.
2079 * dwarf_diecu.c: Update caller.
2080 * dwarf_getaranges.c: Likewise.
2081 * dwarf_nextcu.c: Likewise.
2082 * libdw_findcu.c (__libdw_findcu): Initialize new members.
2084 * fde.c (fde_by_offset): Renamed to ...
2085 (__libdw_fde_by_offset): ... this, made global and internal_function.
2086 Don't take ADDRESS argument.
2087 (__libdw_find_fde): Update caller. Do address sanity check here.
2088 * cfi.h: Declare __libdw_fde_by_offset.
2089 * cfi.c (dwarf_cfi_validate_fde): New function.
2090 * libdw.h: Declare it.
2091 * libdw.map (ELFUTILS_0.148): Add it.
2093 * cie.c (intern_new_cie): Canonicalize DW_EH_PE_absptr FDE encoding to
2094 either DW_EH_PE_udata8 or DW_EH_PE_udata4.
2096 * encoded-value.h (read_encoded_value): Handle DW_EH_PE_indirect.
2097 Don't assume DW_EH_PE_aligned refers to native address size.
2099 * cfi.c (execute_cfi): Barf on CIE initial instructions changing the
2102 2010-06-17 Roland McGrath <roland@redhat.com>
2104 * libdwP.h (struct Dwarf_Line_s): Add members isa, discriminator, and
2106 * dwarf_getsrclines.c (dwarf_getsrclines): Move NEW_FILE macro guts
2107 into an inner inline function. Set new fields. Check all fields for
2108 overflow when setting.
2109 * dwarf_lineisa.c: New file.
2110 * dwarf_linediscriminator.c: New file.
2111 * dwarf_lineop_index.c: New file.
2112 * Makefile.am (libdw_a_SOURCES): Add them.
2113 * libdw.map (ELFUTILS_0.148): Add them.
2114 * libdw.h: Declare them.
2116 2010-06-16 Roland McGrath <roland@redhat.com>
2118 * dwarf_next_cfi.c: Fix version 4 return_address_register decoding.
2120 * fde.c (fde_by_offset): Renamed to ...
2121 (__libdw_fde_by_offset): ... this, made global and internal_function.
2122 Don't take ADDRESS argument.
2123 (__libdw_find_fde): Update caller. Do address sanity check here.
2124 * cfi.h: Declare __libdw_fde_by_offset.
2125 * cfi.c (dwarf_cfi_validate_fde): New function.
2126 * libdw.h: Declare it.
2127 * libdw.map (ELFUTILS_0.148): Add it.
2129 * cie.c (intern_new_cie): Canonicalize DW_EH_PE_absptr FDE encoding to
2130 either DW_EH_PE_udata8 or DW_EH_PE_udata4.
2132 * encoded-value.h (read_encoded_value): Handle DW_EH_PE_indirect.
2133 Don't assume DW_EH_PE_aligned refers to native address size.
2135 * cfi.c (execute_cfi): Barf on CIE initial instructions changing the
2138 2010-06-15 Roland McGrath <roland@redhat.com>
2140 * dwarf_formref.c (__libdw_formref): Diagnose DW_FORM_ref_sig8 like
2142 * dwarf_formref_die.c (dwarf_formref_die): Diagnose it the same way
2143 here, since we don't support it yet.
2145 * dwarf_next_cfi.c: Handle version 4 format.
2147 * dwarf_getsrclines.c: Handle version 4 format.
2149 2010-06-01 Roland McGrath <roland@redhat.com>
2151 * libdwP.h: Remove unused IDX_debug_*names, add IDX_debug_types.
2152 * dwarf_begin_elf.c (dwarf_scnnames): Likewise.
2154 * libdwP.h (CIE_VERSION): Remove unused macro.
2156 * dwarf_getsrclines.c: Fix version field test.
2157 * libdwP.h (DWARF_VERSION): Remove useless macro.
2159 * dwarf_formudata.c (__libdw_formptr): Fix DW_FORM_sec_offset handling.
2161 * dwarf_formblock.c (dwarf_formblock): Handle DW_FORM_exprloc.
2163 * libdw_findcu.c (__libdw_findcu): Accept version 4.
2165 2010-05-31 Mark Wielaard <mjw@redhat.com>
2167 * cfi.h (dwarf_cfi_cie_p): Move definition from here, to ..
2168 * libdw.h (dwarf_cfi_cie_p): ... here.
2170 2010-05-31 Mark Wielaard <mjw@redhat.com>
2172 * dwarf.h: Fix DW_LANG_Python constant.
2174 2010-05-28 Eduardo Santiago <santiago@redhat.com>
2176 * dwarf_getlocation.c (dwarf_getlocation): Do attr_ok check first
2179 2010-05-27 Roland McGrath <roland@redhat.com>
2181 * dwarf.h: Add DW_AT_enum_class, DW_AT_linkage_name,
2182 DW_TAG_template_alias, DW_LANG_Python, DW_LNE_set_discriminator.
2184 2010-05-08 Roland McGrath <roland@redhat.com>
2186 * dwarf_getlocation.c (__libdw_intern_expression): Take new argument
2187 REF_SIZE. Use that to handle DW_OP_call_ref correctly.
2188 (getlocation): Update caller.
2189 * dwarf_frame_cfa.c (dwarf_frame_cfa): Likewise.
2190 * dwarf_frame_register.c (dwarf_frame_register): Likewise.
2191 * libdwP.h: Update decl.
2193 2010-04-26 Roland McGrath <roland@redhat.com>
2195 * cfi.h (struct Dwarf_Frame_s): Add cfa_invalid alternative in cfa_rule.
2196 * cfi.c (execute_cfi): Set that instead of doing cfi_assert for
2197 DW_CFA_def_cfa_{offset*,register} when a non-offset rule is in force.
2198 * dwarf_frame_cfa.c (dwarf_frame_cfa): Handle cfa_invalid.
2200 * dwarf_getlocation.c (__libdw_intern_expression): Take new arg CFAP.
2201 Prepend DW_OP_call_frame_cfa if true.
2202 (getlocation): Update caller.
2203 * dwarf_frame_cfa.c (dwarf_frame_cfa): Likewise.
2204 * dwarf_frame_register.c (dwarf_frame_register): Likewise.
2205 * libdwP.h: Update decl.
2207 2010-04-22 Roland McGrath <roland@redhat.com>
2209 * cfi.c (execute_cfi): Never return without cleanup.
2211 (cie_cache_initial_state): Adjust caller to expect that free.
2212 (__libdw_frame_at_address): Likewise.
2214 2010-03-10 Roland McGrath <roland@redhat.com>
2216 * libdw.map (ELFUTILS_0.146): New set. Add dwfl_core_file_report.
2218 2010-02-15 Roland McGrath <roland@redhat.com>
2220 * Makefile.am: Use config/eu.am for common stuff.
2222 2010-02-02 Mark Wielaard <mjw@redhat.com>
2224 * fde.c (intern_fde): Fix length check for sized_augmentation_data.
2226 2010-01-07 Roland McGrath <roland@redhat.com>
2228 * dwarf_getcfi_elf.c (getcfi_phdr): Use elf_getphdrnum.
2230 2010-01-05 Roland McGrath <roland@redhat.com>
2232 * dwarf_aggregate_size.c: New file.
2233 * Makefile.am (libdw_a_SOURCES): Add it.
2234 * libdw.h: Declare it.
2235 * libdwP.h: Add INTDECL.
2236 * libdw.map (ELFUTILS_0.144): New set. Add dwarf_aggregate_size.
2238 * dwarf_srclang.c: Add INTDEF.
2239 * libdwP.h: Add INTDECL.
2241 * dwarf.h: Add some more DW_AT_GNU_* types from gcc.
2243 * dwarf.h: Add DW_AT_GNU_vector, DW_AT_GNU_template_name.
2245 2009-11-21 Roland McGrath <roland@redhat.com>
2247 * dwarf_getlocation.c (check_constant_offset): Return 1 for all
2250 2009-10-15 Roland McGrath <roland@redhat.com>
2252 * libdw_form.c (__libdw_form_val_len): Grok DW_FORM_sec_offset,
2253 DW_FORM_exprloc, DW_FORM_flag_present, and DW_FORM_ref_sig8.
2255 2009-09-17 Roland McGrath <roland@redhat.com>
2257 * dwarf_getlocation.c (dwarf_getlocation_implicit_value): Make OP
2258 argument a pointer to const.
2259 * libdw.h: Update decl.
2261 2009-09-10 Roland McGrath <roland@redhat.com>
2263 * dwarf_getlocation.c (store_implicit_value): New function.
2264 (__libdw_intern_expression): Use it, handle DW_OP_implicit_value.
2265 (dwarf_getlocation_implicit_value): New function.
2266 * libdw.h: Declare it.
2267 * libdw.map (ELFUTILS_0.143): Add it.
2269 2009-09-09 Mark Wielaard <mjw@redhat.com>
2271 * dwarf_getcfi.c (dwarf_getcfi): Clear cfi->ebl.
2273 2009-08-21 Josh Stone <jistone@redhat.com>
2275 * dwarf_hasattr_integrate.c: Integrate DW_AT_specification too.
2277 2009-08-10 Roland McGrath <roland@redhat.com>
2279 * dwarf_getscopevar.c: Use dwarf_diename.
2281 2009-08-09 Roland McGrath <roland@redhat.com>
2283 * libdw.map (ELFUTILS_0.143): New version set,
2284 inherits from ELFUTILS_0.142.
2285 * dwarf_arrayorder.c: Use OLD_VERSION and NEW_VERSION to define an
2286 alias in the ELFUTILS_0.122 version set and the default in the new set.
2287 * dwarf_srclang.c: Likewise.
2288 * dwarf_decl_file.c: Likewise.
2289 * dwarf_decl_line.c: Likewise.
2290 * dwarf_decl_column.c: Likewise.
2291 * dwarf_bytesize.c: Likewise.
2292 * dwarf_bitsize.c: Likewise.
2293 * dwarf_bitoffset.c: Likewise.
2295 2009-08-07 Roland McGrath <roland@redhat.com>
2297 * dwarf_arrayorder.c: Use dwarf_attr_integrate.
2298 * dwarf_srclang.c: Likewise.
2299 * dwarf_decl_file.c: Likewise.
2300 * dwarf_decl_line.c (__libdw_attr_intval): Likewise.
2301 * dwarf_bytesize.c: Likewise.
2302 * dwarf_bitsize.c: Likewise.
2303 * dwarf_bitoffset.c: Likewise.
2305 2009-07-22 Roland McGrath <roland@redhat.com>
2307 * dwarf_frame_cfa.c: Change calling convention.
2308 * libdw.h: Update decl.
2310 * dwarf_frame_register.c: Change calling/return-value convention for
2311 value-only results and undefined/same_value.
2312 * libdw.h: Update decl.
2314 * dwarf_getlocation.c (__libdw_intern_expression): Take new bool
2315 argument, append DW_OP_stack_value if set. Don't take NOPS argument,
2316 return that value instead.
2317 (getlocation): Update caller.
2318 * dwarf_frame_cfa.c: Likewise.
2319 * libdwP.h: Update decl.
2321 2009-07-21 Roland McGrath <roland@redhat.com>
2323 * dwarf_getsrc_file.c: Ignore a CU that just has no DW_AT_stmt_list.
2324 Fix loop iteration after skipping a bogus or useless CU.
2326 * dwarf_entry_breakpoints.c: Handle 0 dwarf_errno () as harmless
2327 absence, not DWARF_E_NO_DEBUG_LINE.
2329 2009-07-20 Roland McGrath <roland@redhat.com>
2331 * dwarf_getlocation.c (__libdw_intern_expression):
2332 Handle DW_OP_stack_value.
2334 2009-07-16 Roland McGrath <roland@redhat.com>
2336 * dwarf_formudata.c (__libdw_formptr): Handle DW_FORM_sec_offset,
2337 reject others when CU's version > 3.
2339 * dwarf_formflag.c: Handle DW_FORM_flag_present.
2341 * dwarf.h: Add DW_OP_{implicit,stack}_value from DWARF 4 draft.
2342 Also DW_TAG_type_unit and DW_TAG_rvalue_reference_type.
2343 Also DW_AT_signature, DW_AT_main_subprogram, DW_AT_data_bit_offset,
2344 and DW_AT_const_expr.
2345 Also DW_FORM_sec_offset, DW_FORM_exprloc, DW_FORM_flag_present,
2346 and DW_FORM_ref_sig8.
2348 2009-07-15 Roland McGrath <roland@redhat.com>
2350 * dwarf_getlocation.c: Grok DW_OP_form_tls_address,
2351 DW_OP_GNU_push_tls_address, and DW_OP_bit_piece.
2353 2009-07-13 Roland McGrath <roland@redhat.com>
2355 * dwarf_getlocation.c: Grok DW_OP_call_frame_cfa.
2357 2009-07-08 Roland McGrath <roland@redhat.com>
2359 * libdw.map (ELFUTILS_0.142): Add dwfl_module_dwarf_cfi,
2362 * libdwP.h (struct Dwarf): Add member `cfi'.
2363 * dwarf_end.c (dwarf_end): Call __libdw_destroy_frame_cache on it.
2364 * dwarf_getcfi.c: New file.
2365 * dwarf_getcfi_elf.c: New file.
2366 * dwarf_cfi_end.c: New file.
2367 * dwarf_cfi_addrframe.c: New file.
2368 * dwarf_frame_cfa.c: New file.
2369 * dwarf_frame_register.c: New file.
2370 * dwarf_frame_return_address_register.c: New file.
2371 * Makefile.am (libdw_a_SOURCES): Add them.
2372 * unwind.h: Declare those functions.
2373 * libdw.map (ELFUTILS_0.142): Export them.
2375 * dwarf_getlocation.c (__libdw_intern_expression): New function,
2377 (getlocation): ... here, call it.
2378 * libdwP.h: Declare it.
2382 * frame-cache.c: New file.
2385 * encoded-value.h: New file.
2386 * Makefile.am (libdw_a_SOURCES, noinst_HEADERS): Add them.
2387 * libdwP.h: Add DWARF_E_INVALID_CFI to errors enum.
2388 * dwarf_error.c (errmsgs): Add element for it.
2390 * dwarf_next_cfi.c: New file.
2391 * Makefile.am (libdw_a_SOURCES): Add it.
2392 * libdw.h (Dwarf_CIE, Dwarf_FDE, Dwarf_CIE_Entry): New types.
2393 Declare dwarf_next_cfi.
2394 * libdw.map (ELFUTILS_0.142): New set, inherits from ELFUTILS_0.136.
2397 * memory-access.h [! ALLOW_UNALIGNED]
2398 (read_2ubyte_unaligned): Renamed to ...
2399 (read_2ubyte_unaligned_1): ... this. Take bool rather than Dwarf *.
2400 (read_2ubyte_unaligned): Define as macro passing dbg->other_byte_order.
2401 (read_2sbyte_unaligned): Likewise.
2402 (read_4ubyte_unaligned): Likewise.
2403 (read_4sbyte_unaligned): Likewise.
2404 (read_8ubyte_unaligned): Likewise.
2405 (read_8sbyte_unaligned): Likewise.
2407 * libdwP.h (IDX_eh_frame): Remove it.
2408 * dwarf_begin_elf.c (dwarf_scnnames): Remove its element.
2410 2009-07-08 Roland McGrath <roland@redhat.com>
2412 * libdwP.h (struct Dwarf_Line_s): Reorder members to pack better.
2414 * dwarf_getlocation.c (check_constant_offset): New function.
2415 (dwarf_getlocation, dwarf_getlocation_addr): Call it to
2416 handle DW_AT_data_member_location of data[48] as constant offset.
2418 2009-06-18 Roland McGrath <roland@redhat.com>
2420 * libdwP.h (__libdw_read_address_inc): Constify.
2421 (__libdw_read_offset_inc): Likewise.
2422 * dwarf_getaranges.c: Likewise.
2423 * dwarf_getlocation.c: Likewise.
2424 * dwarf_getsrclines.c: Likewise.
2425 * dwarf_nextcu.c: Likewise.
2427 2009-05-05 Petr Machata <pmachata@redhat.com>
2429 * libdwP.h (__libdw_formptr): Declare new function.
2430 * dwarf_formudata.c: Implement it here.
2431 * dwarf_getlocation.c (dwarf_getlocation_addr):
2432 Call it instead of hand-rolled offset handling code.
2433 * dwarf_getsrclines.c (dwarf_getsrclines): Likewise.
2434 * dwarf_ranges.c (dwarf_ranges): Likewise.
2436 2009-05-04 Petr Machata <pmachata@redhat.com>
2438 * libdwP.h (__libdw_read_begin_end_pair_inc): Declare new function.
2439 * dwarf_ranges.c: Implement it here.
2440 (dwarf_ranges): Call it.
2441 * dwarf_getlocation.c (dwarf_getlocation_addr): Call it also here.
2443 2009-04-23 Petr Machata <pmachata@redhat.com>
2445 * dwarf_formaddr.c (dwarf_formaddr): Call __libdw_read_* instead
2446 of read_*ubyte_unaligned.
2447 * dwarf_formref_die.c (dwarf_formref_die): Likewise.
2448 * dwarf_formstring.c (dwarf_formstring): Likewise.
2449 * dwarf_formudate.c (dwarf_formudata): Likewise.
2450 * dwarf_getaranges.c (dwarf_getaranges): Likewise.
2451 * dwarf_getlocation.c (dwarf_getlocation_addr): Likewise.
2452 * dwarf_getpubnames.c (get_offsets): Likewise.
2453 * dwarf_nextcu.c (dwarf_nextcu): Likewise.
2455 2009-04-23 Petr Machata <pmachata@redhat.com>
2457 * libdwP.h (__libdw_read_addr_inc, __libdw_read_off_inc,
2458 __libdw_read_addr, __libdw_read_off): Add four new internal
2461 2009-05-07 Roland McGrath <roland@redhat.com>
2463 * dwarf_getmacros.c (dwarf_getmacros): Use absolute section offset in
2464 return value and OFFSET argument, not CU-relative. Only fetch the
2465 attribute data when called with OFFSET of 0.
2467 2009-05-07 Petr Machata <pmachata@redhat.com>
2469 * dwarf_getmacros.c (dwarf_getmacros): Take into account offset in
2470 DW_AT_macro_info attribute of CU DIE.
2472 2009-04-15 Roland McGrath <roland@redhat.com>
2474 * dwarf.h (DW_CIE_ID): Removed.
2475 (DW_CIE_ID_32, DW_CIE_ID_64): New constants replace it.
2477 2009-04-01 Roland McGrath <roland@redhat.com>
2479 * dwarf.h: Add DW_CFA_GNU_negative_offset_extended.
2481 2009-01-28 Roland McGrath <roland@redhat.com>
2483 * libdwP.h (struct Dwarf_Line_s): Move out of struct Dwarf_Lines_s
2484 defn so C++ doesn't scope the name to not match the Dwarf_Line typedef.
2486 * libdwP.h (struct Dwarf_Files_s): Replace dbg field with cu field.
2488 2009-01-26 Roland McGrath <roland@redhat.com>
2490 * dwarf_ranges.c: Return 0 when no ranges or *_pc attrs at all.
2492 2009-01-25 Roland McGrath <roland@redhat.com>
2494 * dwarf_getattrs.c: Correctly skip attribute values when restarting.
2496 2009-01-23 Roland McGrath <roland@redhat.com>
2498 * Makefile.am ($(srcdir)/known-dwarf.h): Target renamed back.
2499 Put these rules under if MAINTAINER_MODE.
2501 2009-01-22 Roland McGrath <roland@redhat.com>
2503 * dwarf.h: Add DW_OP_GNU_encoded_addr.
2505 2009-01-21 Roland McGrath <roland@redhat.com>
2507 * Makefile.am (CLEANFILES): Renamed to ...
2508 (MOSTLYCLEANFILES): ... here.
2509 (CLEANFILES): New variable, add known-dwarf.h.
2511 2009-01-17 Roland McGrath <roland@redhat.com>
2513 * Makefile.am (known-dwarf.h): Target renamed, not in $(srcdir).
2514 Make it unconditional.
2515 (BUILT_SOURCES): Updated.
2517 * dwarf.h: Add description comments for DW_LANG_* values.
2519 * Makefile.am [MAINTAINER_MODE]
2520 ($(srcdir)/known-dwarf.h): New target.
2521 (BUILT_SOURCES): Add it.
2523 * dwarf.h: Add DW_OP_GNU_push_tls_address, DW_OP_GNU_uninit.
2525 2009-01-10 Ulrich Drepper <drepper@redhat.com>
2527 * dwarf_error.c: Always use __thread. Remove all !USE_TLS code.
2529 2009-01-08 Roland McGrath <roland@redhat.com>
2531 * Makefile.am (libdw.so): Don't depend on $(zip_LIBS), just link it in.
2533 2008-01-06 Roland McGrath <roland@redhat.com>
2535 * libdwP.h (struct Dwarf_Abbrev): Change type of 'has_children' to bool.
2537 * dwarf_haschildren.c: Return -1 for error case, not 0.
2539 * Makefile.am (libdw.so): Link in $(zip_LIBS).
2541 2009-01-06 Ulrich Drepper <drepper@redhat.com>
2543 * dwarf.h: Add definition for unwind and call frame information.
2545 * memory-access.h: Define read_ubyte_unaligned, read_sbyte_unaligned,
2546 read_ubyte_unaligned_inc, and read_sbyte_unaligned_inc.
2548 2008-08-15 Roland McGrath <roland@redhat.com>
2550 * libdw.map (ELFUTILS_0.136): New version set, inherits from
2551 ELFUTILS_0.130. Add dwfl_addrsegment, dwfl_report_segment.
2553 2008-01-21 Ulrich Drepper <drepper@redhat.com>
2555 * dwarf_child.c: Minor optimizations.
2556 * dwarf_getattrs.c: Likewise.
2557 * dwarf_getpubnames.c: Likewise.
2558 * dwarf_siblingof.c: Likewise.
2559 * dwarf_tag.c: Likewise.
2561 2008-01-18 Ulrich Drepper <drepper@redhat.com>
2563 * dwarf_getsrclines.c (dwarf_getsrclines): Don't require exact match
2564 of DWARF_VERSION comparison, just fail if the file's version is newer.
2566 2008-01-17 Nick Clifton <nickc@redhat.com>
2568 * dwarf.h (DWARF3_LENGTH_MIN_ESCAPE_CODE): New define.
2569 (DWARF3_LENGTH_MAX_ESCAPE_CODE): New define.
2570 (DWARF3_LENGTH_64_BIT): New define.
2571 * dwarf_getaranges (dwarf_getaranges): Use the new definitions.
2572 * dwarf_getpubnames: Include dwarf.h.
2573 (get_offsets): Use the new definitions.
2574 * dwarf_getsrclines.c (dwarf_getsrclines): Use the new defintions.
2575 * dwarf_nextcu.c: Include dwarf.h. Correct comment.
2576 (dwarf_nextcu): Use the new definitions.
2578 * libdwP.h (DIE_OFFSET_FROM_CU_OFFSET): New macro.
2579 * dwarf_diecu.c (dwarf_diecu): Use the new macro.
2580 * dwarf_getaranges (dwarf_getaranges): Use the new macro.
2581 * dwarf_nextcu.c (dwarf_nextcu): Use the new macro.
2583 * dwarf_getpubnames (get_offsets): Replace assertion with test and
2586 * dwarf_entry_breakpoints.c (dwarf_entry_breakpoints): Use CUDIE.
2588 * dwarf_siblingof (dwarf_siblingof): Detect a NULL return pointer.
2589 Set the address in the return structure to the address of the next
2590 non-sibling die, if there is no sibling and the return pointer is
2591 not the same as the die pointer.
2592 * libdw.h: Expand the description of the dwarf_siblingof prototype.
2594 * dwarf_child.c: Fix typo in comment.
2596 * libdwP.h (DWARF_VERSION): Change to 3.
2598 * dwarf_formref.c (__libdw_formref.c): Handle attributes which do
2599 not have a initialised valp pointer.
2601 * dwarf_getattrs.c (dwarf_getattrs): Return 1 rather than 0 when
2602 the end of the attributes is reached. When the callback fails,
2603 return the address of the failing attribute, not the address of
2605 * libdw.h: Expand the description of the dwarf_getattrs prototype.
2607 * dwarf_child.c (__libdw_find_attr): Use the new definition.
2608 (dwarf_child): Likewise.
2609 * dwarf_tag.c (__libdw_findabbrev): Likewise.
2610 (dwarf_tag): Likewise.
2612 2008-01-08 Roland McGrath <roland@redhat.com>
2614 * Makefile.am (euinclude): Variable removed.
2615 (pkginclude_HEADERS): Set this instead of euinclude_HEADERS.
2616 (libdw.so): Pass -Wl,--enable-new-dtags,-rpath,$(pkglibdir).
2618 2007-10-17 Roland McGrath <roland@redhat.com>
2620 * libdw.h (__deprecated_attribute__): New macro.
2621 (dwarf_formref): Mark it deprecated.
2622 * dwarf_formref.c (__libdw_formref): New function, broken out of ...
2623 (dwarf_formref): ... here. Call it. Remove INTDEF.
2624 * libdwP.h: Remove INTDECL.
2625 Declare __libdw_formref.
2626 * dwarf_siblingof.c (dwarf_siblingof): Call __libdw_formref instead.
2627 * dwarf_formref_die.c: Likewise. Handle DW_FORM_ref_addr here.
2629 * libdw_form.c (__libdw_form_val_len): Fix DW_FORM_ref_addr result,
2630 needs to check CU->version.
2632 * libdwP.h (struct Dwarf_CU): New member `version'.
2633 * libdw_findcu.c (__libdw_findcu): Initialize it.
2635 * dwarf_child.c: Return 1 for null entry as first child.
2637 2007-10-05 Roland McGrath <roland@redhat.com>
2639 * dwarf_begin_elf.c (check_section): Punt on SHT_NOBITS sections.
2641 * libdw.h (__extern_inline): Rename to __libdw_extern_inline.
2642 [__OPTIMIZE__] (dwarf_whatattr, dwarf_whatform): Update uses.
2644 2007-10-03 Roland McGrath <roland@redhat.com>
2646 * libdw.map (ELFUTILS_0.130: Add dwfl_build_id_find_elf
2647 and dwfl_build_id_find_debuginfo.
2649 * libdw.map (ELFUTILS_0.130): New version set, inherits from
2650 ELFUTILS_0.127. Add dwfl_module_build_id, dwfl_module_report_build_id.
2652 2007-10-02 Roland McGrath <roland@redhat.com>
2654 * libdw_visit_scopes.c (classify_die): Return walk for class_type and
2657 2007-08-07 Roland McGrath <roland@redhat.com>
2659 * dwarf_getscopes.c (pc_match): Swallow dwarf_haspc error return when
2660 error code is DWARF_E_NOERROR (0).
2662 * dwarf_getscopes.c (pc_record): Always bail early if DIE->prune.
2663 Fix typo in __libdw_visit_scopes argument.
2665 * dwarf_getscopes.c (pc_match): Check dwarf_haspc error return,
2666 swallow DWARF_E_NO_DEBUG_RANGES but not other errors.
2668 2007-07-03 Roland McGrath <roland@redhat.com>
2670 * libdw.h (__extern_inline): New macro.
2671 [__OPTIMIZE__] (dwarf_whatattr, dwarf_whatform): Use it.
2673 2007-04-16 Roland McGrath <roland@redhat.com>
2675 * libdw.map (ELFUTILS_0.127): Add dwfl_module_address_section.
2677 2007-04-05 Roland McGrath <roland@redhat.com>
2679 * dwarf_getsrcdirs.c: New file.
2680 * Makefile.am (libdw_a_SOURCES): Add it.
2681 * libdw.h: Declare dwarf_getsrcdirs.
2682 * libdw.map (ELFUTILS_0.127): Add it.
2684 * libdwP.h (struct Dwarf_Files_s): New member ndirs.
2685 * dwarf_getsrclines.c (dwarf_getsrclines): Don't clobber NDIRLIST to
2686 zero before we use it to check for DWARF_E_INVALID_DIR_IDX.
2687 Save DIRARRAY in the Dwarf_Files.
2689 * dwarf_ranges.c (dwarf_ranges): Don't sign-extend 32-bit BEGIN
2690 address to check for all-ones base address entry. Check directly.
2691 Reported by Sébastien Dugué <sebastien.dugue@bull.net>.
2693 2007-03-25 Roland McGrath <roland@redhat.com>
2695 * dwarf_begin_elf.c (check_section): Return Dwarf * instead of void.
2696 Return NULL when freeing RESULT on error.
2697 (global_read, scngrp_read): Check return value from check_section,
2698 break out of loop after it has freed RESULT.
2699 (valid_p): Handle null argument.
2701 2007-03-12 Roland McGrath <roland@redhat.com>
2703 * libdw.map (ELFUTILS_0.127): Add dwfl_report_begin_add.
2705 2007-03-04 Roland McGrath <roland@redhat.com>
2707 * libdw.map (ELFUTILS_0.127): New version set, inherits from
2708 ELFUTILS_0.126. Add dwfl_module_addrsym.
2710 2007-02-10 Roland McGrath <roland@redhat.com>
2712 * dwarf.h (DW_OP_fbreg): Comment fix.
2714 2007-02-03 Roland McGrath <roland@redhat.com>
2716 * dwarf_getelf.c (dwarf_getelf): Renamed from dwarf_get_elf.
2717 * libdw.map (ELFUTILS_0.126): New version set, inherits from
2718 ELFUTILS_0.122. Move dwarf_getelf there; it was never truly
2719 exported in the past.
2721 2006-12-17 Roland McGrath <roland@redhat.com>
2723 * dwarf_getlocation.c (dwarf_getlocation_addr): Use zero as base
2724 address when the CU is missing attributes due to buggy GCC.
2726 2006-08-29 Roland McGrath <roland@redhat.com>
2728 * Makefile.am (CLEANFILES): Add libdw.so.$(VERSION).
2730 * libdw.h (dwarf_diecu): Add __nonnull_attribute__.
2731 (dwarf_child): Don't list arg 1 in __nonnull_attribute__.
2733 * libdw_alloc.c (__libdw_allocate): Take new ALIGN argument, make sure
2734 result is aligned. Adjust NEWP->remaining here for this allocation.
2735 * libdwP.h: Update decl.
2736 (libdw_alloc): Update caller.
2738 2006-07-12 Ulrich Drepper <drepper@redhat.com>
2740 * dwarf_child.c: Adjust for internal_function_def removal.
2741 * dwarf_getabbrev.c: Likewise.
2742 * dwarf_tag.c: Likewise.
2743 * libdw_form.c: Likewise.
2744 * memory-access.c: Likewise.
2746 2006-06-28 Roland McGrath <roland@redhat.com>
2748 * libdw.map: Export dwfl_linecu, dwfl_line_comp_dir.
2750 * libdw.map: Bump to 0.122; export dwfl_module_getsymtab and
2753 2006-05-27 Ulrich Drepper <drepper@redhat.com>
2755 * libdw.h: Add extern "C".
2757 2006-05-22 Ulrich Drepper <drepper@redhat.com>
2759 * dwarf_getaranges.c (dwarf_getaranges): Handle files without
2760 aranges information.
2762 2006-05-21 Ulrich Drepper <drepper@redhat.com>
2764 * libdw.h: Add nonnull attributes to dwarf_tag, dwarf_getattrs,
2767 2006-02-28 Roland McGrath <roland@redhat.com>
2769 * dwarf.h: Add missing DW_ATE_*, DW_TAG_*, DW_LANG_*, DW_CFA_*,
2770 DW_OP_* values, to match DWARF 3.0. Add new DW_DS_*, DW_END_*
2771 values from DWARF 3.0.
2773 2006-02-22 Roland McGrath <roland@redhat.com>
2775 * libdw.map: Bump to 0.120; export dwfl_version.
2777 2005-12-22 Roland McGrath <roland@redhat.com>
2779 * libdw.map: Bump to 0.119; export dwfl_linux_proc_maps_report.
2781 2005-12-12 Roland McGrath <roland@redhat.com>
2783 * dwarf_ranges.c: Copy CU base address-finding code from
2786 2005-12-09 Roland McGrath <roland@redhat.com>
2788 * dwarf_getlocation.c (dwarf_getlocation_addr): Add some unlikelys.
2789 Delay CU base lookup until it's needed.
2790 If CU base lookup fails with no error, flag invalid DWARF.
2792 2005-11-25 Roland McGrath <roland@redhat.com>
2794 * libdw.map: Bump to 0.118; export dwfl_module_register_names.
2796 2005-11-15 Roland McGrath <roland@redhat.com>
2798 * Makefile.am [BUILD_STATIC] (AM_CFLAGS): Add -fpic.
2800 2005-11-13 Roland McGrath <roland@redhat.com>
2802 * libdw.map: Bump to 0.117; export dwfl_module_return_value_location.
2804 2005-10-27 Roland McGrath <roland@redhat.com>
2806 * dwarf_entry_breakpoints.c (search_range): Fix binary search code;
2807 don't match end_sequence markers.
2809 * dwarf_getsrclines.c (compare_lines): Sort end_sequence markers
2810 before normal records at the same address.
2811 * dwarf_getsrc_die.c (dwarf_getsrc_die): Don't match an end_sequence
2814 2005-10-26 Roland McGrath <roland@redhat.com>
2816 * dwarf_getfuncs.c (dwarf_getfuncs): Use Dwarf_Die, not Dwarf_Func.
2817 * dwarf_func_file.c: Renamed to ...
2818 * dwarf_decl_file.c: ... here.
2819 * dwarf_func_col.c: Renamed to ...
2820 * dwarf_decl_column.c: ... here.
2821 * dwarf_func_line.c: Renamed to ...
2822 * dwarf_decl_line.c: ... here.
2823 (dwarf_func_line): Renamed to ...
2824 (dwarf_decl_line): ... this. Take a Dwarf_Die * argument.
2825 (__libdw_func_intval): Renamed __libdw_attr_intval.
2826 * dwarf_func_name.c: File removed.
2827 * dwarf_func_lowpc.c: File removed.
2828 * dwarf_func_highpc.c: File removed.
2829 * dwarf_func_entrypc.c: File removed.
2830 * dwarf_func_die.c: File removed.
2831 * Makefile.am (libdw_a_SOURCES): Updated.
2832 * libdw.h: Update decls.
2833 (Dwarf_Func): Type removed.
2834 * libdwP.h: Update decls.
2835 (struct Dwarf_Func_s): Type removed.
2836 * libdw.map: Updated.
2838 * libdwP.h (CUDIE): New macro.
2839 * dwarf_getlocation.c (dwarf_getlocation_addr): Use it.
2840 * dwarf_getscopes_die.c (dwarf_getscopes_die): Likewise.
2841 * dwarf_ranges.c (dwarf_ranges): Likewise.
2843 * dwarf_getloclist.c: Renamed to ...
2844 * dwarf_getlocation.c: ... here.
2845 (getloclist): Renamed to getlocation.
2846 (dwarf_getloclist): Renamed to dwarf_getlocation.
2847 (dwarf_addrloclists): Renamed to dwarf_getlocation_addr.
2848 * Makefile.am (libdw_a_SOURCES): Updated.
2849 * libdw.h (dwarf_getloclist): Renamed to dwarf_getlocation.
2850 (dwarf_addrloclists): Renamed dwarf_getlocation_addr.
2851 (Dwarf_Loc): Renamed Dwarf_Op.
2852 * libdwP.h (struct loc_s): Update use.
2853 * libdw.map: Update map.
2855 * dwarf_entry_breakpoints.c: Use the second line record within the
2856 function, regardless of its source location data.
2858 2005-10-25 Roland McGrath <roland@redhat.com>
2860 * dwarf_entry_breakpoints.c: Fall back to entrypc for contiguous too.
2862 * libdw.map: Add dwarf_entrypc, dwarf_entry_breakpoints.
2864 2005-10-14 Roland McGrath <roland@redhat.com>
2866 * dwarf_diecu.c (dwarf_diecu): New file.
2867 * Makefile.am (libdw_a_SOURCES): Add it.
2868 * libdw.h: Declare dwarf_diecu.
2869 * libdw.map: Export it.
2871 * libdw.map: Bump to 0.116; export dwarf_ranges.
2873 2005-09-20 Roland McGrath <roland@redhat.com>
2875 * dwarf_haspc.c: Use dwarf_ranges.
2876 * dwarf_entry_breakpoints.c: Likewise.
2878 * dwarf_ranges.c: New file.
2879 * Makefile.am (libdw_a_SOURCES): Add it.
2880 * libdw.h: Declare dwarf_ranges.
2881 * libdwP.h: Add INTDECL.
2883 2005-09-14 Roland McGrath <roland@redhat.com>
2885 * dwarf_entry_breakpoints.c (dwarf_entry_breakpoints): Fix braino in
2886 prologue_end marker scanning loop.
2888 2005-09-11 Roland McGrath <roland@redhat.com>
2890 * dwarf.h: Comment typo fix.
2892 2005-09-07 Roland McGrath <roland@redhat.com>
2894 * dwarf_entry_breakpoints.c: New file.
2895 * Makefile.am (libdw_a_SOURCES): Add it.
2896 * libdw.h: Declare dwarf_entry_breakpoints.
2898 * dwarf_entrypc.c: New file.
2899 * Makefile.am (libdw_a_SOURCES): Add it.
2900 * libdw.h: Declare dwarf_entrypc.
2901 * libdwP.h: Add INTDECL.
2903 2005-08-28 Ulrich Drepper <drepper@redhat.com>
2905 * Makefile.am: Use $(LINK) not $(CC) when creating DSO.
2906 (%.os): Use COMPILE.os.
2907 (COMPILE.os): Filter out gconv options.
2909 2005-08-27 Roland McGrath <roland@redhat.com>
2911 * dwarf_getscopes.c (dwarf_getscopes): Rewritten using
2912 __libdw_visit_scopes.
2914 * dwarf_getscopes_die.c: New file.
2915 * Makefile.am (libdw_a_SOURCES): Add it.
2916 * libdw.h: Declare dwarf_getscopes_die.
2917 * libdw.map: Bump to 0.115 and add it.
2919 * libdw_visit_scopes.c (__libdw_visit_scopes): Pass a struct
2920 containing a DIE and its parent pointer, instead of just Dwarf_Die.
2921 Take two functions for both preorder and postorder visitors.
2922 * libdwP.h: Update decl.
2923 (struct Dwarf_Die_Chain): New type.
2924 * dwarf_func_inline.c: Update uses.
2926 * dwarf_diename.c (dwarf_diename): Use dwarf_attr_integrate.
2928 * libdwP.h: Add INTDECL.
2929 * dwarf_func_name.c (dwarf_func_name): Use dwarf_diename.
2931 2005-08-23 Roland McGrath <roland@redhat.com>
2933 * dwarf_attr_integrate.c (dwarf_attr_integrate): Treat
2934 DW_AT_specification the same as DW_AT_abstract_origin.
2936 2005-08-20 Roland McGrath <roland@redhat.com>
2938 * libdw.map: Add dwfl_cumodule, remove dwfl_linecu.
2939 Add dwfl_linux_kernel_report_offline, dwfl_offline_section_address,
2940 and dwfl_report_offline.
2942 2005-08-19 Roland McGrath <roland@redhat.com>
2944 * libdw.map: Bump version to ELFUTILS_0.114 for libdwfl changes.
2945 Add dwfl_module_relocate_address, dwfl_module_relocations,
2946 dwfl_module_relocation_info.
2948 2005-08-18 Roland McGrath <roland@redhat.com>
2950 * dwarf_getscopes.c (dwarf_getscopes): Include the CU itself as
2951 outermost scope in the results.
2953 2005-08-15 Roland McGrath <roland@redhat.com>
2955 * dwarf_func_inline.c: New file.
2956 * Makefile.am (libdw_a_SOURCES): Add it.
2957 * libdw.h: Declare dwarf_func_inline, dwarf_func_inline_instances.
2958 * libdw.map: Add them.
2960 * dwarf_func_die.c: New file.
2961 * Makefile.am (libdw_a_SOURCES): Add it.
2962 * libdw.h: Declare dwarf_func_die.
2963 * libdw.map: Add it. Bump version to ELFUTILS_0.114.
2965 2005-08-10 Ulrich Drepper <drepper@redhat.com>
2967 * dwarf_getsrclines.c (dwarf_getsrclines): Correct fallout of renaming
2968 of DW_LNS_set_epilog_begin.
2970 2005-08-09 Roland McGrath <roland@redhat.com>
2972 * dwarf.h (DW_LNS_set_epilog_begin): Renamed DW_LNS_set_epilogue_begin.
2974 * dwarf_end.c: Add INTDEF.
2975 * dwarf_error.c (dwarf_errmsg): Likewise.
2976 * libdwP.h (dwarf_end, dwarf_errmsg): Add INTDECLs.
2978 2005-08-01 Roland McGrath <roland@redhat.com>
2980 * dwarf_getaranges.c (dwarf_getaranges): Check for bogus offset.
2981 * dwarf_getabbrev.c (__libdw_getabbrev): Likewise.
2983 2005-07-28 Ulrich Drepper <drepper@redhat.com>
2985 * Makefile.am (libdw.so): No need to link with libeu.a anymore.
2986 (libdw_a_LIBADD): Add all files from libdwfl.a.
2988 2005-07-27 Roland McGrath <roland@redhat.com>
2990 * Makefile.am (libdw.so): Link ../libdwfl/libdwfl_pic.a in,
2991 along with ../libebl/libebl.a and ../lib/libeu.a;
2992 depend on ../libelf/libelf.so.
2993 (libdw_so_LDADD): New variable.
2994 * libdw.map: Add dwfl_* symbols formerly in ../libdwfl/libdwfl.map.
2996 * libdw.map: Define an empty base version and move all symbols to
2997 version ELFUTILS_0.111; don't define ELFUTILS_1.0 at all yet.
2999 2005-07-23 Ulrich Drepper <drepper@redhat.com>
3001 * dwarf_error.c: Add internal alias for dwarf_errno.
3002 * libdwP.h: Declare __dwarf_errno_internal.
3003 * dwarf_getloclist.c: Use INTDEF for dwarf_errno.
3005 * dwarf_error.c [USE_TLS]: Actually use __thread in definition of
3008 2005-06-01 Roland McGrath <roland@redhat.com>
3010 * dwarf_getaranges.c (dwarf_getaranges): Sort result array.
3011 * dwarf_getarange_addr.c (dwarf_getarange_addr): Use binary search.
3013 2005-06-08 Roland McGrath <roland@redhat.com>
3015 * memory-access.h (get_uleb128_step, get_uleb128): Remove casts.
3016 (get_sleb128_step, get_sleb128): Likewise.
3017 * dwarf_getattrs.c (dwarf_getattrs): Add consts.
3018 * dwarf_getloclist.c (getloclist): Likewise.
3019 * dwarf_formblock.c (dwarf_formblock): Likewise.
3020 * dwarf_getsrclines.c (dwarf_getsrclines): Likewise.
3021 * dwarf_getabbrevattr.c (dwarf_getabbrevattr): Likewise.
3022 * dwarf_formref.c (dwarf_formref): Likewise.
3023 * dwarf_formsdata.c (dwarf_formsdata): Likewise.
3024 * dwarf_formudata.c (dwarf_formudata): Likewise.
3025 * dwarf_haschildren.c (dwarf_haschildren): Likewise.
3026 * dwarf_child.c (__libdw_find_attr, __libdw_find_attr): Likewise.
3027 * dwarf_tag.c (dwarf_tag): Likewise.
3028 * dwarf_getabbrev.c (__libdw_getabbrev): Likewise.
3029 * memory-access.c (__libdw_get_uleb128, __libdw_get_sleb128): Likewise.
3030 * libdw_form.c (__libdw_form_val_len): Likewise.
3031 * libdwP.h: Update decl.
3033 2005-06-04 Roland McGrath <roland@redhat.com>
3035 * memory-access.h (get_uleb128_rest_return): New macro.
3036 [! IS_LIBDW] (__libdw_get_uleb128): New static, defined using it.
3037 (get_sleb128_rest_return): New macro.
3038 [! IS_LIBDW] (__libdw_get_sleb128): New static, defined using it.
3039 * memory-access.c: New file.
3040 * Makefile.am (libdw_a_SOURCES): Add it.
3041 (DEFS): Add -DIS_LIBDW.
3043 2005-05-31 Roland McGrath <roland@redhat.com>
3045 * dwarf_formref_die.c (dwarf_formref_die): Add CU header offset to
3048 2005-05-30 Roland McGrath <roland@redhat.com>
3050 * dwarf_getloclist.c (dwarf_addrloclists): Use DW_AT_entry_pc for base
3051 address if DW_AT_low_pc is missing. Not to spec, but GCC generates it.
3053 * dwarf_getloclist.c (dwarf_addrloclists): Don't sign-extend 4-byte
3054 BEGIN value. Instead, match base address entries separately for
3057 2005-05-28 Roland McGrath <roland@redhat.com>
3059 * dwarf_getloclist.c (dwarf_addrloclists): Fix decoding to advance
3060 past location expression contents.
3062 2005-05-23 Roland McGrath <roland@redhat.com>
3064 * dwarf_getsrclines.c: Comment typo fix.
3066 * dwarf_haspc.c (dwarf_haspc): Fix CU DIE address calculation.
3067 * dwarf_getloclist.c (dwarf_addrloclists): Likewise.
3069 2005-05-22 Ulrich Drepper <drepper@redhat.com>
3071 * libdwP.h: Only use INTDECL for alias prototypes.
3073 2005-05-19 Roland McGrath <roland@redhat.com>
3075 * dwarf_getloclist.c (attr_ok): Permit DW_AT_static_link too.
3077 * dwarf_getscopevar.c: New file.
3078 * Makefile.am (libdw_a_SOURCES): Add it.
3079 * libdw.h: Declare dwarf_getscopevar.
3081 * dwarf_getsrcfiles.c: Add INTDEF.
3082 * dwarf_haschildren.c: Likewise.
3083 * libdwP.h (dwarf_getsrcfiles, dwarf_haschildren): Add INTDECL.
3085 * dwarf_getscopes.c: New file.
3086 * Makefile.am (libdw_a_SOURCES): Add it.
3087 * libdw.h: Declare dwarf_getscopes.
3088 * libdw.map: Add it.
3090 2005-05-18 Roland McGrath <roland@redhat.com>
3092 * libdwP.h (IDX_debug_ranges): New enum constant.
3093 * dwarf_begin_elf.c (dwarf_scnnames): Add it for ".debug_ranges".
3094 * libdwP.h (DWARF_E_NO_DEBUG_RANGES): New enum constant.
3095 * dwarf_error.c (errmsgs): Add it.
3096 * dwarf_haspc.c: New file.
3097 * libdw.h: Declare dwarf_haspc.
3098 * libdw.map: Add it.
3099 * libdwP.h: Add INTDECL.
3101 * dwarf_attr_integrate.c: New file.
3102 * dwarf_hasattr_integrate.c: New file.
3103 * Makefile.am (libdw_a_SOURCES): Add them.
3104 * libdw.h: Declare dwarf_attr_integrate, dwarf_hasattr_integrate.
3105 * libdw.map: Add them.
3107 * dwarf_hasattr.c: Add INTDEF.
3108 * libdwP.h: Add INTDECL for it.
3110 * dwarf_formref_die.c: New file.
3111 * Makefile.am (libdw_a_SOURCES): Add it.
3112 * libdw.h (dwarf_formref_die): Declare it.
3113 * libdwP.h (dwarf_formref_die): Add INTDECL.
3114 * libdw.map: Add it.
3116 * dwarf_getloclist.c (attr_ok, getloclist): New functions, broken out
3118 (dwarf_getloclist): ... here. Call them.
3119 (dwarf_addrloclists): New function.
3120 * libdw.h: Declare it.
3121 * libdw.map: Add it.
3123 * dwarf_getmacros.c (dwarf_getmacros): Don't bail at
3124 DW_MACINFO_end_file. Recognize type 0 as terminator.
3126 2005-05-05 Roland McGrath <roland@redhat.com>
3128 * dwarf_getsrc_die.c (dwarf_getsrc_die): Use binary search.
3130 * dwarf_getsrclines.c (dwarf_getsrclines): Sort result array, since
3131 the line program does not produce all entries in ascending order.
3133 2005-04-25 Ulrich Drepper <drepper@redhat.com>
3135 * dwarf_getsrc_file.c (dwarf_getsrc_file): Handle multiple
3136 occurences (e.g., inlines) better.
3138 2005-04-24 Ulrich Drepper <drepper@redhat.com>
3140 * libdw.h (DWARF_END_ABBREV): Define.
3141 * dwarf_getabbrev.c (__libdw_getabbrev): Return DWARF_END_ABBREV if
3143 * dwarf_offabbrev.c (dwarf_offabbrev): Return -1 on error, 1 if end
3145 * dwarf_tag.c (__libdw_findabbrev): Also recognize DWARF_END_ABBREV
3146 as error of __libdw_getabbrev.
3148 2005-04-04 Ulrich Drepper <drepper@redhat.com>
3150 * dwarf_getsrc_file.c (dwarf_getsrc_file): Minor optimization.
3152 * dwarf_getsrc_file.c (dwarf_getsrc_file): Always pass number of
3153 results back to caller.
3155 2005-04-04 Roland McGrath <roland@redhat.com>
3157 * dwarf_getsrc_file.c (dwarf_getsrc_file): Use size_t for CUHL.
3159 * dwarf_func_line.c (__libdw_func_intval): Use internal_function in
3162 2005-04-04 Ulrich Drepper <drepper@redhat.com>
3164 * dwarf_getsrc_file.c (dwarf_getsrc_file): Use INTUSE.
3166 * dwarf_getsrc_file.c: New file.
3167 * Makefile.am (libdw_a_SOURCES): Add dwarf_getsrc_file.c.
3168 * libdw.h: Declare dwarf_getsrc_file.
3169 * libdw.map: Add dwarf_getsrc_file.
3171 2005-04-02 Ulrich Drepper <drepper@redhat.com>
3173 * dwarf_func_entrypc.c: New file.
3174 * dwarf_func_col.c: New file.
3175 * dwarf_func_line.c: New file.
3176 * dwarf_func_file.c: New file.
3177 * libdw.h: Add prototypes for new functions.
3178 * libdw.map: Add dwarf_func_entrypc, dwarf_func_col, dwarf_func_line,
3180 * Makefile.am (libdw_a_SOURCES): Add dwarf_func_entrypc.c,
3181 dwarf_func_col.c, dwarf_func_line.c, dwarf_func_file.c.
3182 * libdwP.h (struct Dwarf_Func_s): Add cudie element.
3183 Declare __libdw_func_intval and __dwarf_formsdata_internal.
3184 * dwarf_getfuncs.c: Also fill in cudie in Dwarf_Func object.
3185 * dwarf_formsdata.c: Use INTUSE and INTDEF to avoid PLTs.
3187 * dwarf.h: Add some DWARF3 definitions.
3189 2005-04-01 Ulrich Drepper <drepper@redhat.com>
3191 * dwarf_getfuncs.c: New file.
3192 * dwarf_func_highpc.c: New file.
3193 * dwarf_func_lowpc.c: New file.
3194 * dwarf_func_name.c: New file.
3195 * Makefile.am (libdw_a_SOURCES): Add dwarf_getfuncs.c,
3196 dwarf_func_highpc.c, dwarf_func_lowpc.c, and dwarf_func_name.c.
3197 * libdw.map: Add dwarf_getfuncs, dwarf_func_highpc, dwarf_func_lowpc,
3198 and dwarf_func_name.
3199 * libdw.h: Add prototypes for new functions.
3200 * dwarf_child.c: Use INTUSE and INTDEF to avoid PLTs.
3201 * dwarf_siblingof.c: Likewise.
3202 * dwarf_dieoffset.c: Likewise.
3203 * dwarf_highpc.c: Likewise.
3204 * dwarf_lowpc.c: Likewise.
3205 * libdwP.h: Add prototypes for internal functions.
3206 Define Dwarf_Func_s structure.
3208 2005-03-29 Ulrich Drepper <drepper@redhat.com>
3210 * libdw.h: Add padding in Dwarf_die.
3212 * dwarf_arrayorder.c: Use INTUSE and INTDEF to avoid PLTs.
3213 * dwarf_attr.c: Likewise.
3214 * dwarf_begin.c: Likewise.
3215 * dwarf_begin_elf.c: Likewise.
3216 * dwarf_bitoffset.c: Likewise.
3217 * dwarf_bitsize.c: Likewise.
3218 * dwarf_bytesize.c: Likewise.
3219 * dwarf_diename.c: Likewise.
3220 * dwarf_formaddr.c: Likewise.
3221 * dwarf_formblock.c: Likewise.
3222 * dwarf_formref.c: Likewise.
3223 * dwarf_formstring.c: Likewise.
3224 * dwarf_formudata.c: Likewise.
3225 * dwarf_getarange_addr.c: Likewise.
3226 * dwarf_getarangeinfo.c: Likewise.
3227 * dwarf_getaranges.c: Likewise.
3228 * dwarf_getloclist.c: Likewise.
3229 * dwarf_getmacros.c: Likewise.
3230 * dwarf_getsrc_die.c: Likewise.
3231 * dwarf_getsrcfiles.c: Likewise.
3232 * dwarf_getsrclines.c: Likewise.
3233 * dwarf_highpc.c: Likewise.
3234 * dwarf_lowpc.c: Likewise.
3235 * dwarf_nextcu.c: Likewise.
3236 * dwarf_offdie.c: Likewise.
3237 * dwarf_siblingof.c: Likewise.
3238 * dwarf_srclang.c: Likewise.
3239 * dwarf_tag.c: Likewise.
3240 * libdw_findcu.c: Likewise.
3241 * libdwP.h: Add prototypes for internal functions.
3243 * dwarf_addrdie.c: New file.
3244 * dwarf_macro_opcode.c: New file.
3245 * dwarf_macro_param1.c: New file.
3246 * dwarf_macro_param2.c: New file.
3247 * libdw.h: Add declarations. Move Dwarf_Macro definition to libdwP.h.
3248 * libdwP.h: Remove Dwarf_Macro definition.
3249 * Makefile.am (libdw_a_SOURCES): Add dwarf_addrdie.c,
3250 dwarf_macro_opcode.c, dwarf_macro_param1.c, and dwarf_macro_param2.c.
3251 * libdw.map: Add entries for new functions.
3253 2005-03-21 Ulrich Drepper <drepper@redhat.com>
3255 * libdw.h: Handle broken gcc < 4.
3257 2005-02-15 Ulrich Drepper <drepper@redhat.com>
3259 * Makefile (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2.
3261 * dwarf_begin_elf.c: Fix warnings.
3262 * dwarf_dieoffset.c: Likewise.
3263 * dwarf_end.c: Likewise.
3264 * dwarf_error.c: Likewise.
3265 * dwarf_getpubnames.c: Likewise.
3267 * libdwP.h: Add new error values.
3268 * dwarf_error.c: Support new error values.
3269 * dwarf_getpubnames.c: Check parameter value.
3271 2005-02-05 Ulrich Drepper <drepper@redhat.com>
3273 * Makefile.am: Check for text relocations in constructed DSO.
3275 * Makefile.am [MUDFLAP] (AM_CFLAGS): Add -fmudflap.
3277 2005-02-04 Ulrich Drepper <drepper@redhat.com>
3279 * dwarf_siblingof.c (dwarf_siblingof): Add some buffer boundary
3280 checks to not read over buffer boundaries for ill-formed DWARF data.
3282 2004-09-25 Ulrich Drepper <drepper@redhat.com>
3284 * dwarf_child.c: Make compile with gcc 4.0.
3285 * dwarf_error.c: Likewise.
3286 * dwarf_formblock.c: Likewise.
3287 * dwarf_getabbrev.c: Likewise.
3288 * dwarf_getattrs.c: Likewise.
3289 * dwarf_getsrclines.c: Likewise.
3290 * dwarf_tag.c: Likewise.
3291 * libdw_form.c: Likewise.
3293 2004-01-20 Ulrich Drepper <drepper@redhat.com>
3295 * Makefile.am: Support building with mudflap.
3297 * dwarf_getloclist.c: Fix warnings gcc 3.4 spits out.
3298 * dwarf_getsrclines.c: Likewise.
3299 * dwarf_memory-access.h: Likewise.
3301 2004-01-19 Ulrich Drepper <drepper@redhat.com>
3303 * dwarf_getsrcfiles.c: Third parameter can be NULL.
3305 * libdw.h: Define Dwarf_macro. Declare dwarf_getmacros.
3306 Third parameter of dwarf_getsrcfiles can be NULL.
3308 * libdw.map: Add dwarf_getmacros.
3309 * Makefile.am (libdw_a_SOURCES): Add dwarf_getmacros.
3310 * dwarf_getmacros.c: New file.
3312 2004-01-18 Ulrich Drepper <drepper@redhat.com>
3314 * libdw.h: Second parameter of dwarf_getaranges can be NULL.
3316 * dwarf_nextcu.c: Return -1 if dwarf parameter is NULL.
3318 * dwarf_getsrclines.c:
3319 Use read_2ubyte_unaligned_inc instead of _inc-less variant.
3321 * dwarf_getaranges.c: Allow naranges parameter to be NULL.
3323 * libdwP.h (_): Use elfutils domain.
3325 * dwarf_getsrclines.c (dwarf_getsrclines): Add more branch prediction.
3327 * dwarf_getsrclines.c: Fix typo in comment.
3329 2004-01-17 Ulrich Drepper <drepper@redhat.com>
3331 * Makefile.am: Support building with mudflap.
3333 2004-01-16 Ulrich Drepper <drepper@redhat.com>
3335 * memory-access.h: Add lots of const in case a pointer passed is const.
3337 * dwarf_formflag.c: New file.
3338 * dwarf_getattrs.c: New file.
3339 * dwarf_error.c: Add new error value.
3340 * libdw.h: Add prototypes for new functions. Adjust prototype for
3342 * libdw.map: Add new functions.
3343 * dwarf_getpubnames.c: Change type of return value and fourth parameter
3345 * libdwP.h: Add new error value.
3346 * Makefile.am (libdw_a_SOURCES): Add dwarf_getattrs.c and
3349 * dwarf_getpubnames.c (dwarf_getpubnames): Just fail if dbg is NULL.
3351 2004-01-12 Ulrich Drepper <drepper@redhat.com>
3353 * dwarf_getarange_addr.c: New file
3354 * dwarf_getarangeinfo.c: New file.
3355 * dwarf_getaranges.c: New file.
3356 * dwarf_onerange.c: New file.
3357 * libdw.h: Declare new functions. Define Dwarf_Arange and
3359 * libdw.map: Add new functions.
3360 * libdwP.h: Add new errors. Add aranges member to struct Dwarf.
3361 Define Dwarf_Aranges_s and Dwarf_Arange_s.
3362 * Makefile.am (libdw_a_SOURCES): Add dwarf_getaranges.c,
3363 dwarf_onearange.c, dwarf_getarangeinfo.c, dwarf_getarange_addr.c.
3364 * dwarf_error.c: Add new message.
3366 2004-01-11 Ulrich Drepper <drepper@redhat.com>
3368 * Makefile.am (libdw_a_SOURCES): Add dwarf_lineaddr.c, dwarf_linecol.c,
3369 dwarf_linebeginstatement.c, dwarf_lineendsequence.c, dwarf_lineblock.c,
3370 dwarf_lineprologueend.c, dwarf_lineepiloguebegin.c, dwarf_onesrcline.c.
3371 * dwarf_error.c: Add another message.
3372 * dwarf_getsrc_die.c: Adjust for Dwarf_Files and Dwarf_Lines
3374 * dwarf_filesrc.c: Likewise.
3375 * dwarf_getsrcfiles.c: Likewise.
3376 * dwarf_getsrclines.c: Likewise.
3377 * dwarf_lineaddr.c: New file.
3378 * dwarf_linebeginstatement.c: New file.
3379 * dwarf_lineblock.c: New file.
3380 * dwarf_linecol.c: New file.
3381 * dwarf_lineendsequence.c: New file.
3382 * dwarf_lineepiloguebegin.c: New file.
3383 * dwarf_lineno.c: New file.
3384 * dwarf_lineprologueend.c: New file.
3385 * dwarf_onesrcline.c: New file.
3386 * dwarf_lineno.c: Change interface to store result in object pointed
3387 to by second parameter.
3388 * libdw.h: Add prototypes for new functions. Change dwarf_lineno
3389 prototype. Define Dwarf_Files and Dwarf_Lines.
3390 * libdw.map: Add new functions.
3391 * libdwP.h: Define Dwarf_Files_s and Dwarf_Lines_s.
3392 * libdw_findcu.c: Don't initialize nlines field.
3394 * dwarf_siblingof: Little optimization.
3396 * dwarf_begin.c: Remember that the ELF descriptor must be closed.
3397 * dwarf_end.c: Close ELF descriptor if free_elf is set.
3398 * libdwP.h (struct Dwarf): Add free_elf field.
3400 * Makefile.am (libdw_a_SOURCES): Add dwarf_getstring.c and
3402 * dwarf_getstring.c: New file.
3403 * dwarf_offabbrev.c: New file.
3404 * libdw.map: Add dwarf_getstring and dwarf_offabbrev.
3405 * dwarf_getabbrev.c (__libdw_getabbrev): Add new dbg and result
3406 parameters. Don't allocate memory if not necessary and don't lookup
3407 previous results if no CU given.
3408 (dwarf_getabbrev): Adjust call to __libdw_getabbrev.
3409 * dwarf_tag.c: Adjust call to __libdw_getabbrev.
3410 * libdw.h: Declare dwarf_offabbrev and dwarf_getstring.
3411 * libdwP.h: Change prototype for __libdw_getabbrev.
3413 * dwarf_getabbrevattr.c: Add offsetp parameter. Fill in before
3414 returning if this is wanted.
3416 2004-01-09 Ulrich Drepper <drepper@redhat.com>
3418 * dwarf_nextcu.c: Add new parameter offset_sizep. Initialize it
3419 with offset_size value.
3420 * libdw.h: Adjust dwarf_nextcu prototype.
3421 * libdwP.h (struct Dwarf_CU): Add offset_size member.
3422 * libdw_findcu.c: Adjust dwarf_nextcu call. Initialize offset_size
3423 member of new CU struct.
3424 * dwarf_formstring.c: Depend on offset_size not address_size for
3425 DW_FORM_strp handling.
3426 * dwarf_form.c: Likewise for DW_FORM_strp and DW_FORM_ref_addr.
3428 * dwarf_tag.c (__libdw_findabbrev): Return correct value for
3430 (dwarf_tag): Correctly recognize failed lookup.
3432 * dwarf_end.c (cu_free): Call tdestroy for locs member. Use new
3434 * dwarf_error.c: Add message for DWARF_E_NO_BLOCK.
3435 * dwarf_formblock.c: New file.
3436 * dwarf_getloclist.c: Rewrite to handle a single block.
3437 * libdw.h: Define Dwarf_Block. Rename Dwarf_Loc members. Remove
3438 Dwarf_Locdesc definition. Declare dwarf_formblock. Remove
3439 dwarf_getloclistent declaration.
3440 * libdw.map: Add dwarf_formblock, remove dwarf_getloclistent.
3441 * libdwP.h: Define struct loc_s and DWARF_E_NO_BLOCK.
3442 Add locs member to struct Dwarf_CU.
3443 * libdw_fundcu.c: Initialize locs member of new CU.
3444 * Makefile.am (libdw_a_SOURCES): Add dwarf_formblock.c.
3445 Remove dwarf_getloclistent.c.
3447 2004-01-07 Ulrich Drepper <drepper@redhat.com>
3449 * libdw.h: Use __nonnull__ attribute only for gcc >= 3.3.
3450 * libdwP.h: Likewise.
3452 * dwarf_getloclist.c: New file.
3453 * dwarf_getloclistent.c: New file.
3454 * libdw.h: Define Dwarf_Loc and Dwarf_Locdesc.
3455 Declare dwarf_getloclistent and dwarf_getloclist.
3456 * libdw.map: Add dwarf_getloclistent and dwarf_getloclist.
3457 * libdwP.h: Define DWARF_E_NO_LOCLIST.
3458 * Makefile.am (libdw_a_SOURCES): Add dwarf_getloclistent.c and
3461 * dwarf_error.c: More error messages.
3463 2004-01-06 Ulrich Drepper <drepper@redhat.com>
3465 * dwarf_getsrclines.c: Remove debugging support.
3467 * dwarf_getsrcfiles.c: New file.
3468 * dwarf_filesrc.c: New file.
3469 * libdw.h: Declare these functions. Define Dwarf_File.
3470 * libdwP.c: Adjust Dwarf_File_s definition.
3471 * libdw.map: Add these functions.
3472 * Makefile.am (libdw_a_SOURCES): Add dwarf_getsrcfiles.c and
3474 * dwarf_getsrclines.c: Initialize cu->files.
3476 2004-01-05 Ulrich Drepper <drepper@redhat.com>
3478 * libdw.h: Add more nonnull function attributes.
3480 * dwarf_begin_elf.c (dwarf_begin_elf): Don't initialize mem_tail->next.
3481 * dwarf_end.c (cu_free): New function.
3482 (dwarf_end): Also free CU tree. Correct freeing of memory blocks.
3483 * dwarf_error.c (errmsgs): Add new messages.
3484 * dwarf_getsrc_die.c: New file.
3485 * dwarf_getsrclines.c: New file.
3486 * dwarf_lineno.c: New file.
3487 * dwarf_linesrc.c: New file.
3488 * dwarf_nextcu.c (dwarf_nextcu): Use read_*byte_unaligned_inc
3489 instead of the *_inc-less variants.
3490 * libdw.h: Define Dwarf_Line. Add some function attributes. Declare
3491 dwarf_getsrclines, dwarf_getsrc_die, dwarf_lineno, and dwarf_linesrc.
3492 * libdw.map: Add dwarf_getsrclines, dwarf_getsrc_die, dwarf_lineno,
3494 * libdwP.h: Add more error codes.
3495 (struct Dwarf): Remove mem_tail.next member.
3496 (Dwarf_File): Define type.
3497 (struct Dwarf_Line_s): Define type.
3498 (struct Dwarf_CU): Add lines and nlines members.
3499 (libdw_alloc): Define local variable _tail and use it.
3500 Add some function attributes.
3501 * libdw_alloc.c (__libdw_allocate): Don't initialize next member.
3502 * libdw_findcu.c (__libdw_findcu): Initialize lines and nlines members.
3503 * memory-access.h: Add unlikely for the endian conversion paths.
3504 * Makefile.am (AM_CFLAGS): Add -std parameter.
3505 (libdw_a_SOURCES): Add dwarf_getsrclines, dwarf_getsrc_die,
3506 dwarf_lineno, and dwarf_linesrc.
3508 2003-08-11 Ulrich Drepper <drepper@redhat.com>
3510 * Moved to CVS archive.