2019-11-26 David Anderson * libdwarf2.1.mm: Version 2.85. Found two more \n that did not look right in pdf. Fixed. * libdwarf2.1.pdf: Regenerated 2.85. 2019-11-26 David Anderson * libdwarf2.1.mm: Version 2.84. Documents that dwarf_get_elf() can succeed only if dwarf_elf_init() or dwarf_elf_init_b() was used to initialize the Dwarf_Debug involved. And fixed the formatting printf examples by escaping backslashes with a second backslash. * libdwarf2.1.pdf: Regenerated 2.84. 2019-11-10 David Anderson * dwarf_debuglink.c: Now if paths_returned is a null pointer the code skips the phase of generating a list of paths (assuming the caller will generate a list itself). * dwarf_errmsg_list.h: New error DW_DLE_DWARF_INIT_DBG_NULL. * dwarf_generic_init.c,dwarf_original_elf_init: Now check for a null pointer-to-dbg and return error DW_DLE_DWARF_INIT_DBG_NULL instead of segfaulting. * libdwarf.h.in,generated_libdwarf.h.in: Add the new error code. * libdwarf2.1.mm: Version 2.83. Documents the allowance of a null passed in to dwarf_gnu_debuglink instead of a valid pointer. * libdwarf2.1.pdf: Regenerated 2.83. 2019-11-05 David Anderson * dwarf_names.c,dwarf_names.h,dwarf_names_enum.h, dwarf_names_new.h,generated_libdwarf.h.in,gennames.c: Regenerated by scripts/buildstandardsource.sh New date string and version. 2019-10-28 David Anderson * testdebuglink.sh: If dos2unix is not available to run we now just assume it's not needed. The only place it is actually needed is regression testing on Windows. 2019-10-24 David Anderson * dwarf_alloc.c: Add include of dwarfstring.h. implement a destructor for Dwarf_Error for the void * member of Dwarf_Error_s (pointer to a dwarfstring, really). Implement _dwarf_error_destructor(). * dwarf_alloc.h: Add declaration of _dwarf_error_destructor(). * dwarf_error.c: Add include dwarfstring.h. Implement _dwarf_error_string() so we can add any string we want for an error code so we can have more detailed error messages where we choose to do that. * dwarf_error.h: Add DWARF_ERROR_H idempotency #ifdef etc. Add #ifdef __cplusplus etc. Add er_msg field to struct Dwarf_Error_s. * dwarf_form.c,dwarf_line.c: Include dwarfstring.h and create a more detailed message for a couple of error situationss. See _dwarf_error_string() calls. * dwarf_print_lines.c: Add include dwarfstring.h * dwarfstring.c: Include config.h and test HAVE_STDLIB_H. Add UNUSEDARG and DW_DLV_OK(etc) values. Implement new functions dwarfstring_append_printf_s(), dwarfstring_append_printf_i(), and dwarfstring_append_printf_u(). * dwarfstring.h: Declare the types of the value argument to dwarf_append_printf_i/u as long long/unsigned long long. Declare dwarfstring_append_printf_s(), dwarfstring_append_printf_i(), and dwarfstring_append_printf_u(). * test_dwarfstring.c: check_string() was failing to update errcount (bug). Fixed. Added test5() with tests of the new functions in dwarfstring.h. 2019-10-22 David Anderson * dwarf_util.c: Defines dwarf_package_version(). * libdwarf.h.in: Declares dwarf_package_version(). * libdwarf2.1.mm: Documents dwarf_package_version(). Version 2.82. * libdwarf2.1.pdf: Regenerated * libdwarf_version.h: Updated by scripts/UPDATEDWARFDUMPVERSION.sh. * dwarf_names.c,dwarf_names.h,dwarf_names_enum.h, dwarf_names_new.h,generated_libdwarf.h.in,gennames.c: Regenerated by scripts/buildstandardsource.sh 2019-10-20 David Anderson * dwarf_alloc.c,dwarf_debuglink.c,dwarf_dnames.c, dwarf_dsc.c,dwarf_elf_access.c,dwarf_elf_load_headers.c, dwarf_elfread.c,dwarf_error.c,dwarf_frame.c,dwarf_frame2.c, dwarf_gdbindex.c,dwarf_generic_init.c,dwarf_groups.c, dwarf_harmless.c,dwarf_init_finish.c,dwarf_line.c: Be much more thorough and consistent in checking for standard C headers as set in config.h. Also, add in #include of malloc.h for non-standard compilers not putting malloc prototypes in stdlib.h 2019-10-18 David Anderson * checkexamples.c,dwarf_debuglink.c,dwarf_generic_init.c, dwarf_xu_index.c,test_linkedtopath.c: Fixed indents and removed trailing whitespace. 2019-10-18 David Anderson * runtests.sh: Improving some message test so context makes sense. 2019-10-16 David Anderson * Makefile.am: Accidentally left out generated_libdwarf.h.in . and test_linktopath.sh as things to be in the distribution. * Makefile.in: Regenerated * test_dwarfstring.c: Added missing return statements to avoid a warning. 2019-10-14 David Anderson * dwarf_names.c,dwarf_names.h, dwarf_names_enum.h, dwarf_names_new.h: regenerated with new version string. * libdwarf_version.h: updated version string. 2019-10-14 David Anderson * CMakeLists.txt: Addded dwarf_debuglink.h to sourcefiles. * Added tests of the debuglink stuff. * Makefile.in: regenerated. * baseline.ltp: Added correct test baseline output. * checkexamples.c: Added debuglink call as an example to show how it is used. * dwarf_alloc.c: Reformatted too long lines and more importantly moved the memset to clear the Dwarf_Debug down where lit belonged after clearing de_gnu_global_paths. * dwarf_debuglink.c: Significant rewrite to implement the reading etc of .gnu_debuglink and .note.gnu.build-id sections. * dwarf_debuglink.b: Added ifdef __cplusplus and ifndef DWARF_DEBUGLINK_H. And now handles data from both sections. * dwarf_generic_init.c: Now adds the default debuglink global path "/usr/lib/debug". * dwarf_init_finish.c: Separated declaration of local from its use to allow a debugging printf when and as such is needed. * dwarf_opaque.h: Added de_gnu_global_paths and de_gnu_global_path_count to Dwarf_Debug_s. * dwarf_original_elf_init: Now adds the default debuglink global path "/usr/lib/debug". * dwarf_util.h: split apart a tool-long line. * dwarf_xu_index.c: Corrected the use of ASNAR to be sizeof(*key_in) and added a check to that macro so if something that won't work is requested the attempt is caught as an error. * dwarfstring.h: Added Added ifdef __cplusplus and ifndef DWARFSTRING_H. * generated_libdwarf.h.in: Regenerated. * libdwarf.h.in: The debuglink interface now has the arguments it needs. The dwarf_gnu_buildid() is gone. * libdwarf2.1.mm: Version 2.81. Documents the debuglink and global_path functions dwarf_add_debuglink_global_path() and dwarf_gnu_debuglink() and removes the bogus dwarf_add_file_path(). * libdwarf2.1.pdf: Regenerated. Version 2.81. * test_linkedtopath.c: New test code use for 'make check'. * test_debuglink.sh.c: New test code use for 'make check'. 2019-10-06 David Anderson * dwarf_init_finish.c: Removed trailing whitespace. 2019-10-05 David Anderson * pro_forms.c,pro_frame.c,pro_section.c: All now use dbg->de_copy_word instead of memcpy in the ASNOUT and ASNAR macros so host and target need not have same endianness. * dwarf_xu_index.c: The way the initial index in hashing on the signature is done we must be sensitive to host/object being different endianness for hash keys to be found. 2019-10-05 David Anderson * libdwarf.h.in: Added DW_DLC_ELF_OFFSET_SIZE_64 so dwarfgen can easily generate ELFCLASS64 with offsets 32bits in DWARF. Rearranged the comments on the bit flags in the area so easier to read. * generated_libdwarf.h.in: regenerated. 2019-10-04 David Anderson * dwarf_opaque.h: Revised a comment about de_big_endian_object for clarity. * dwarf_peread.c: Now we translate from DW_ENDIAN_BIG to DW_OBJECT_MSB (similar for little-endian) so the normal libdwarf works right. Lets us read little-endian PE object on a big-endian host properly. * dwarf_init_finish.c: Just reformatting a long line and adding short comments. 2019-10-02 David Anderson * dwarf_names.c,dwarf_names.h,dwarf_names_enum.h, dwarf_names_new.h,libdwarf_version.h: New date string 2019-10-02 David Anderson * dwarf_errmsg_list.h: Added DW_DLE_NULL_ARGS_DWARF_ADD_PATH. * dwarf_util.c: Check arguments and return DW_DLV_ERROR with error DW_DLE_NULL_ARGS_DWARF_ADD_PATH if either of the critical ones is NULL. * libdwarf.h.in: Add the new error * generated_libdwarf.h.in: regenerated. 2019-10-02 David Anderson * dwarf_errmsg_list.h,dwarf_line.c,dwarf_util.c, dwarf_util.h,dwarfstring.c,dwarfstring.h,pro_init.c, pro_line.c,pro_log_extra_flag_strings.c,pro_opaque.h, pro_section.c,test_dwarfstring.c,test_extra_flag_strings.c: Fixed indents and trailing whitespace. 2019-10-01 David Anderson * dwarf_debuglink.c,dwarf_util.c: Removed dwarf_add_file_path() and put it into dwarf_util.c. * libdwarf.h.in: Added warning not to use dwarf_gnu_debuglink() [which is new] as it is not in final form. * libdwarf2.1.mm: Improving the documentation of dwarf_get_macro_details by adding a little bit to the example. * libdwarf2.1.pdf: Regenerated. Version 2.80. 2019-09-22 David Anderson * libdwarf2p.1.mm: Documented the new support of using the 'extras' argument (previously anything it pointed to was ignored) so producer-callers have * libdwarf2p.1.pdf: Regenerated. Rev 1.50. * dwarf_form.c: Now deals with correct use of DW_FORM_data8/4 for DWARF4 and 5. * dwarf_line.c: Minor readability improvements. No change in the code. * dwarf_line_table_reader_common.h: Removed a pointless blank line. * dwarf_util.h: Moved the trailing \ to the left making most lines much more readable with a 70 character wide window. * pro_init.c: Implemented support for using the 'extra' string argument to flexibly set the line-table constants, avoiding any need to change pro_line.h macro content. Removed many lines of code that is now in pro_log_extra_flag_strings.c. (should have been removed 2 days ago). Fixed the FORM for reference/offset attributes to DW_FORM_sec_offset for DWARF4,5. * pro_line.c: Added comments explaining de_line_inits structure for clarity. * pro_log_extra_flag_strings.c: Added address_size to what these can read-in. * pro_opaque.h: Deleted two of a set of 3 blank lines * pro_section.c: Revised the line table opc calculation by using more lines for clarity. * test_extra_flag_strings.c: Added new tests of _dwarf_log_extra_flagstrings(). 2019-09-20 David Anderson * libdwarf2.1.mm: Fixing a couple document errors. * libdwarf2.1.pdf: Regenerated. Version 2.79. * pro_log_extra_flag_strings.c: Correct a typo in the code giving producer users easy access to control data. * test_extra_flag_strings.c: Several additional tests added to test pro_log_extra_flag_strings.c. Try 'make check'. 2019-09-19 David Anderson * CMakeLists.txt: Adding pro_log_extra_flag_strings.c and dwarfstrings.h and dwarfstrings.c test_dwarfstring.c, test_extra_flag_strings source and 'make check' for the testcode. * Makefile.am: Added make check code here too, as well as the new source files. * Makefile.in: regenerated * pro_log_extra_flag_strings.c: Giving producer-code users a way to control frame and line constants without reqiring a change to libdwarf.h.in or other header files. * dwarfstring.h, dwarstring.c: Adding flexible string buffers to libdwarf. * test_dwarfstring.c,test_extra_flag_strings. Added make check test code. * dwarf_errmsg_list.h: New error codes for the new producer code logic on initializations. * dwarf_frame.c: Reformat too-long line. * pro_section.c,pro_opaque.h: Renamed de_offset_size for clarity to de_dwarf_offset_size as the DWARF offset size can be 4 when elf offset size is 8.. * dwarf_names.c,dwarf_names.h,dwarf_names_enum.h, dwarf_names_new.h: Regenerated for updated version string. * generated_libdwarf.h.in: Generated. New error codes. * libdwarf.h.in: New error codes. * pro_arange.c,pro_die.c,pro_expr.c,pro_forms.c, pro_frame.c: Renamed de_offset_size for clarity to de_dwarf_offset_size. * pro_frame.h: made dfp_nbytes, fde_n_inst, dfp_n_bytes larger types. * pro_init.c: included dwarfstring.h. Added code to process any 'extra' argument string. * pro_line.c,pro_opaque.h: Renamed pi_version to pi_linetable_version for clarity. Renamed de_offset_size to de_dwarf_offset_size and added de_elf_offset_size. Added de_big_endian flag. * pro_reloc_stream.c,pro_section.c,pro_types.c: Reflects renamings. 2019-09-16 David Anderson * dwarf_die_deliv.c: Reformatted one line so it was less long. 2019-09-15 David Anderson * libdwarf2.1.mm: Improved comments in examplec. * libdwarf2.1.pdf: Regenerated. v2.78 2019-09-11 David Anderson * dwarf_die_deliv.c: Being more careful about what context to use in dwarf_siblingof: if DIE argument is non-null, take context pointer from it, else use global context from Dwarf_Debug record. 2019-09-10 David Anderson * dwarf_errmsg_list.h,dwarf_generic_init.c,dwarf_opaque.h, dwarf_util.h, libdwarf.h.in: Fix indents and remove trailing whitespace. * generated_libdwarf.h.in: Regenerated. 2019-09-10 David Anderson * dwarf_die_deliv.c(_dwarf_next_cu_header_internal): Two lines assigning NULL to de_cu_context were added in early September and that was a mistake. Removing them in this change. 2019-09-10 David Anderson * dwarf_errmsg_list.h: New error codes DW_DLE_CORRUPT_NOTE_GNU_DEBUGID, DW_DLE_CORRUPT_GNU_DEBUGID_SIZE, and DW_DLE_CORRUPT_GNU_DEBUGID_STRING listed. * dwarf_init_finish.c: Now also deals with section .note.gnu.build-id. * dwarf_opaque.h: Adding de_note_gnu_buildid. * dwarf_util.c: Implements dwarf_gnu_buildid(). * generated_libdwarf.h.in: Regenerated. * libdwarf.h.in: Added DW_DLE_CORRUPT_NOTE_GNU_DEBUGID, DW_DLE_CORRUPT_GNU_DEBUGID_SIZE, and DW_DLE_CORRUPT_GNU_DEBUGID_STRING. Added dwarf_gnu_buildid() declaration. * libdwarf2.1.mm: Documented dwarf_gnu_buildid(). * libdwarf2.1.pdf: Regenerated. Version 2.77. 2019-09-08 David Anderson * dwarf_util.c: a .gnu_debuglink lacking a / in the section content would coredump in libdwarf. No longer crashes. 2019-09-07 David Anderson * checkexamples.c: Remove some useless blank lines. This is not used by libdwarf. * dwarf_alloc.c: Ensure dbg->de_path is freed. * dwarf_die_deliv.h: Delete trailing space. * dwarf_errmsg_list.h: Add DW_DLE_DUPLICATE_GNU_DEBUGLINK and DW_DLE_CORRUPT_GNU_DEBUGLINK error names. * dwarf_generic_init.c: Simplified the code slightly, avoiding some duplication. Ensure dbg->de_path is set where it would not otherwise be set here in initialization. * dwarf_init_finish.c: Ensure .gnu_debuglink will be available to load if it exists in the object. * dwarf_opaque.h: Add de_path to struct Dwarf_Debug_s. * dwarf_util.c: Add includes and define O_BINARY so we can do an open when looking for a file that section .gnu_debuglink refers to. * libdwarf.h.in: Added new error defines mentioned above. * generated_libdwarf.h.in: Regenerated * libdwarf2.1.mm: Added dwarf_add_file_path() documentation. * libdwarf2.1.pdf: Regenerated. Version 2.76. 2019-09-03 David Anderson * dwarf_abbrev.c: Fixed indents and removed trailing whitespace. * pro_line.h: Added a temporary accomodation of the MIN_INST_LENGTH for s390 for dwarfgen. This is a hack and needs a fix to dwarfgen. Reformatted copyright for shorter lines with no change in its text. * pro_frame.c: Added a comment, the code is not properly dealing with generating frame data when the build host is different from the target object the producer is generating. Reformatted copyright for shorter lines with no change in its text. 2019-09-02 David Anderson * checkexample.c: Starting work on an abbreviations-reading example (not yet useful). * dwarf_abbrev.c: Now does simpler, faster, and better attr/form checking. Implements dwarf_get_abbrev_entry_b() which adds any DW_FORM_implicit_const value to the return value set, and avoids hiding corrupt large values from callers. * dwarf_abbrev.h: Adds new fields dab_next* to allow dwarf_abbrev.c to sequence through entries withless overhead. * dwarf_die_deliv.c: Improve error checking on reading values from the abbreviation section. * dwarf_die_deliv.h: Move the fields in Dwarf_Abbrev_list_s so the order reads betterr. Improved the comments. * dwarf_opaque.h: Simplified the argument list of _dwarf_valid_form_we_know(). * dwarf_query.c: Improve the error checking in reading abbreviation section attr/form pairs. * dwarf_util.c(_dwarf_valid_form_we_know): Now reflects the simpler argument list. * libdwarf.h.in: Added declaration of new function dwarf_get_abbrev_entry_b(). * generated_libdwarf.h.in: Updated to match the libdwarf.h.in change. (regenerated) 2019-08-29 David Anderson * dwarf_abbrev.c: Added private function _dwarf_count_abbrev_entries() to eliminate some duplicated code. Added sanity checks for badly corrupted uleb values. * dwarf_abbrev.h: Reformatted LGPL text to fit on lines better. No change to the text. Added explanatory comments about the intent. Added declaration of _dwarf_count_abbrev_entries(). * dwarf_alloc.c: Removed the never-used Dwarf_Fission_Per_CU_s allocation type, marked that index as reserved. * dwarf_base_types.h: Reformatted LGPL text to fit on lines better. No change to the text. * dwarf_die_deliv.c: Reformatted LGPL text to fit on lines better. No change to the text. Removed some pointless/incorrect comments. Refactored the _dwarf_make_CU_Context() code with new called functions doing the major activities. Now deals with DWARF5 everywhere (as well as making it easier to understand split-dwarf support (called 'fission' in libdwarf). Synthesize the correct unit_type for all compilation units with version < 5. Fix mistaken/missing fission support. Now GNU signatures are dealt with internally just like DWARF5 signatures (by reading the CU die up front as necessary). Deals with all the base fields defined in DWARF5. Fixed some small errors hiding real problems in reporting corrupt DWARF. * dwarf_errmsg_list.h: Added error codes DW_DLE_MIXING_SPLIT_DWARF_VERSIONS, DW_DLE_TAG_CORRUPT,DW_DLE_FORM_CORRUPT, DW_DLE_ATTR_CORRUPT, DW_DLE_ABBREV_ATTR_DUPLICATION, DW_DLE_DWP_SIGNATURE_MISMATCH. DW_DLE_CU_UT_TYPE_VALUE. * dwarf_error.c:Reformatted a line. * dwarf_form.c: Removed a pointless multi-line comment. Reformatted a couple too-long lines. * dwarf_loc.c: Simplified static function context_is_cu_not_tu() dramatically. * dwarf_loc2.h: Change reflects context_is_cu_not_tu() simplification. * dwarf_opaque.h: Reformatted LGPL text to fit on lines better. No change to the text. Removed a three line useless comment. Now refer to 'signature' not type_signature to match DWARF5 usage. Added loclists_base and cu_die_has_children to simplify some logic elsewhere. Removed unused *Fission* structs. Added _dwarf_siblingof_internal() declaration. * dwarf_query.c: Renaming some fields to match changes in dwarf_opaque.h * dwarf_ranges.c: Improve resilence in dwarf_get_ranges_a(). * dwarf_tied.c: Rename to match dwarf_opaque.h name changes. * dwarf_util.c: Reformat a couple lines to fit better. Add sanity check for the value of an abbrev TAG. Calls _dwarf_count_abbrev_entries() instead of counting itself. * dwarf_xu_index.c: Fix internal functions by adding an extra argument to _dwarf_get_debugfission_for_offset() so it can work with DWARF4 or DWARF5. * generated_libdwarf.h.in: Regenerated reflecting libdwarf.h.in changes. * libdwarf.h.in: Added the defines for the DW_DLE* error values listed above. * libdwarf2.1.mm: Clarified wording in Address Range Operations section. Other minor clarifications. * libdwarf2.1.pdf: Version 2.74. Regenerated. 2019-06-04 David Anderson * dwarf_alloc.c,dwarf_frame.c,dwarf_groups.c, dwarf_loc.c,dwarf_tied.c,dwarf_tied_test.c, pro_die.c,pro_expr.c,pro_init.c: Removed inttypes.h include as nothing in it is referenced. 2019-05-29 David Anderson * libdwarf_version.h: Updated version string. * dwarf_names.c,dwarf_names.h,dwarf_names_enum.h, dwarf_names_new.h: regenerated. 2019-05-26 David Anderson * dwarf_alloc.c,dwarf_frame.c: Reformat comment lines to shorten them. Include inttypes.h for tsearch.h. * elf_load_headers.c: Remove trailing whitespace. * dwarf_groups.c,dwarf_loc.c,dwarf_tied.c: Reformat comment lines to shorten them. Remove small erroneous comment. * dwarf_machoread.c: Shorten too-long lines. * dwarf_tied_test.c: Reformat comment lines to shorten them. Remove trailing whitespace. * dwarf_tsearch.h: Make idempotent include with ifndef DWARF_TSEARCH_H . Delete a blank line. * dwarf_tsearchhash.c: Add and use DW_PR_DUx and DW_PR_DUu and uintptr_t, refining casts to avoid compiler warnings. * pro_alloc.c,pro_die.c: Reformat comment lines to shorten them. Remove small erroneous comment. * pro_expr.c,pro_init.c: Reformat comment lines to shortent them. Remove small erroneous comment. 2019-05-24 David Anderson * Makefile.am: Delete mention of config.h.in.cmake. * Makefile.in: Regenerate. * dwarf_tied_test.c: Delete the comment on uintptr_t on the intypes.h line. * libdwarf.h.in: Refine commentary a little. * generated_libdwarf.h.in: Regenerated. 2019-05-20 David Anderson * CMakeLists.txt: No longer generates a local-build-dir config.h * config.h.in.cmake: Deleted. 2019-05-20 David Anderson * CMakeLists.txt: Reflects revised cmake option names. Adds compiler warning options when -DWALL selected. * config.h.in.cmake: Reflects the set of defines needed now, such as cmakedefine DWARF_WITH_LIBELF. * dwarf_elf_access.c: Removes some messy HAVE_LIBELF_H etc to dwarf_elf_defines.h so the test/define is reusable * dwarf_elf_defines.h: Now has the messy HAVE_LIBELF_H etc tests. * dwarf_elf_load_headers.c: Removes unwanted include of elf.h * dwarf_elfread.c: Add Windows-related ifdef. A couple if () reformatted slightly. a few casts added to ensure compiler warnings eliminated. * dwarf_frame2.c: Using Dwarf_Unsigned a bit more so the output can use DW_PR_DUx for the printf. * dwarf_incl.h: Small comment change for readability. * dwarf_machoread.c: Add Windows-related ifdef/define/include. Minor if() revision for consistency. Some casts added to avoid compiler warnings and communicate intent. * dwarf_object_detector.c: Added Windows specific ifdef/include and accomodation of HAVE_CUSTOM_LIBELF. * dwarf_object_read_common.c: Added Windows specific ifdef/include and a slight reformatting of argument lists. * dwarf_peread.c: Added Windows specific ifdef/include. Added casts to avoid compiler warnings. * dwarf_query.c: Reformat some if() for consistency. * gennames.c: Added Windows specific ifdef/include. * libdwarf.h.in: Deleted excessive blank lines. Added DW_FTYPE_CUSTOM_ELF 5. * pro_encode_nm.c: Added casts to avoid certain compiler warnings. * pro_incl.h: Made a comment more consistent with other uses of that comment. 2019-05-14 David Anderson * dwarf_pe_descr.h: Several // C++ comments present, now all such comments deleted. 2019-05-13 David Anderson * pro_section.c,pro_frame.c: A bug in a macro shows up only on big-endian systems (causes a compiler warning). This fixes it. 2019-05-07 David Anderson * configure.cmake: Moved into CMakeLists.txt. * Makefile.am: Deleted reference to configure.cmake. * CMakeLists.txt: no longer needs configure.cmake 2019-05-05 David Anderson * dwarf_names.c,dwarf_names.h,dwarf_names_enum.h, dwarf_names_new.h: Updated with latest version string (in a comment). * libdwarf_version.h: New version string. 2019-05-04 David Anderson * dwarf_elf_load_headers.c: A corrupt Elf .shstring section (lacking trailing NUL) is now detected. * dwarf_elfread.h: Removed an unused struct and an unused struct field. 2019-05-02 David Anderson * dwarf_leb.c,dwarf_tied.c,dwarf_tied_decls.h, dwarf_tied_test.c: Removing trailing whitespace and final blank lines. * dwarf_object_detector.c,dwarf_pe_descr.h,dwarf_peread.c: Adding _dw to the names of more Windows things to avoid compilation conflicts with Windows names. 2019-05-01 David Anderson * configure.cmake: Removed some more lines. Mainly leaving options declarations (which will be moved later). * dwarf_incl.h: Fixed a typo in a comment. 2019-05-01 David Anderson * configure.cmake: Removed some lines, placing them in base directory configure.cmake. 2019-04-30 David Anderson * CMakeLists.txt: Added the new files. Revised the testing area the tests can be run and pass. 2019-04-30 David Anderson * libdwarf2.1.mm: Increased font size for better legibility in the pdf on a computer monitor Using the .S mm control. Rev 2.73. The smaller size was readable on paper, but not very readable on a screen. * libdwarf2p.1.mm: Larger font size here too. Rev 1.45. * libdwarf2.1.pdf,libdwarf2p.1.pdf: Regenerated * pdfbld.sh: Fixed the -p option. 2019-04-30 David Anderson * Makefile.am: Altered the lists of headers/source to account for the new 'make check' details. * dwarf_leb.c,dwarf_tied.c: Removed testing-related source. Moved to the respective _test.c * dwarf_leb_test.c,dwarf_tied_decls.h,dwarf_tied_test.c: New files so we isolate test code without ifdefs. * runtests.sh: Now reflects the new test sourcefiles. 2019-04-29 David Anderson * dwarf_names.c,dwarf_names.h,dwarf_names_enum.h, dwarf_names_new.h: Regenerated. Version date update. 2019-04-28 David Anderson * config.h.in.cmake, configure.cmake: Deleted all reference to INT32 and INT64 as no longer needed. 2019-04-26 David Anderson * CMakeLists.txt,config.h.in.cmake,configure.cmake: Revised to work with the updated use of cmake. 2019-04-25 David Anderson * dwarf_pe_descr.h, dwarf_peread.c: All the Windows PE structs have been renamed, adding a trailing _dw, to make them distinct from the standard Windows names. 2019-04-25 David Anderson * dwarf_elfread.c, dwarf_object_read_common.c: Removed trailing whitespace. 2019-04-25 David Anderson * dwarf_peread.c: Change the way an strncpy is handled to avoid a compiler warning as well as create hopefully clearer code. 2019-04-25 David Anderson * dwarf_elf_load_headers.c,dwarf_elfread.c, dwarf_object_read_common.c: Added missing Windows-specific includes. * libdwarf_version.h: Updated version date string. 2019-04-24 David Anderson * dwarf_die_deliv.c(_dwarf_next_cu_internal): Allow a null as the next_cu_offset pointer passed in. * dwarf_elf_load_headers.c: Correct the check for a dwarf-related section. Correct the error code returned in several places. * dwarf_elfread.c:a Correct the error code returned and one return value. * dwarf_errmsg_list.h: Add specific errors relating to nolibelf elf reading. * dwarf_generaic_init.c: Remove trailing whitespace. * dwarf_query.c(dwarf_highpc_b): Allow a couple of pointer args to be null in case clients are uninterested in returning values. * libdwarf.h.in: Added DW_DLE_ELF_SECTION_ERROR, DW_DLE_ELF_STRING_SECTION_ERROR. * libdwarf2.1.mm: Version 2.72. Documented that dwarf_next_cu_header_d() and dwarf_hipc_b() allow specific arguments to be null. * libdwarf2.1.pdf: Regenerated 2019-04-22 David Anderson * dwarf_generic_init.c, dwarf_machoread.c, dwarf_object_detector.c, dwarf_object_read_common.c,dwarf_peread.c: Add test for _MSC_VER for Windows MSVC. 2019-04-22 David Anderson * dwarf_frame.c: Add ifdef/include of stdint.h and inttypes.h and add casts using uintptr_t so we avoid some compiler warnings. * dwarf_groups.c,dwarf_tied.c, pro_alloc.c,pro_die.c,pro_init.c: Add ifdef/include of stdint.h and inttypes.h as the updated dwarf_tsearch.h requires uintptr_t. * dwarf_loc.c,pro_expr.c: Add ifdef/include of stdint.h and inttypes.h so we can use uintptr_t in casts and avoid compiler warnings. * dwarf_tsearchhash.c: Add ifdef/include of stdint.h and inttypes.h for dwarf_tsearch.h so we can use uintptr_t in casts and avoid compiler warnings. 2019-04-21 David Anderson * dwarf_pe_descr.h: Added a comment specifying a MS web page describing how the section data length and content is calculated and handled. * dwarf_peread.c(pe_get_section_info): The understanding of the length of section data was overly simplistic. Now with all the bytes filled in properly in this function. 2019-04-21 David Anderson * dwarf_peread.c: Now getting pe section data returns a meaningful section virtual address. 2019-04-19 David Anderson * CMakeLists.txt: Add new files to the files to build. * Makefile.am: add the new .h and .c files. * dwarf_die_deliv.c(reloc_incomplete): Reformat the long 'if' to make it easier to read. * dwarf_elf_access.c: Remove the full list of relocations header files as no longer needed, include dwarf_elf_defines.h instead. Remove the is_??bit_abs_reloc() predicate functions. Move to dwarf_elf_rel_detector. (renamed the functions). * dwarf_errmsg_list.h: Added DW_DLE_SECTION_SIZE_ERROR, DW_DLE_INTERNAL_NULL_POINTER, DW_DLE_SECTION_STRING_OFFSET_BAD, DW_DLE_SECTION_INDEX_BAD, DW_DLE_INTEGER_TOO_SMALL, DW_DLE_ELF_SECTION_LINK_ERROR,DW_DLE_ELF_SECTION_GROUP_ERROR, DW_DLE_ELF_SECTION_COUNT_MISMATCH, DW_DLE_ELF_STRING_SECTION_MISSING,DW_DLE_SEEK_OFF_END, DW_DLE_READ_OFF_END for use by the nolibelf elf reader. * dwarf_generic_init.c: Now separates archive access (using libelf) from non-archive (using no libelf). * dwarf_init_finish.c: Revamp commentary about _dwarf_load_section. * dwarf_machoread.c: Renamed mo_byteorder to mo_endian for consistency. Added filesize to seek/read (RRMOA macro)for better checking of offset/size. * dwarf_machoread.h: Renamed mo_byteorder to mo_endian. * dwarf_object_detector.c: Added filesize to seek/read (_dwarf_object_read_random()) for better checking of offset/size. * dwarf_object_read_common.c: Added additional checks of seek/read to ensure offset correctness. Seek itself allows seeking past end, which we do not want. * dwarf_object_read_common.h: Added filesize to _dwarf_object_read_random argument list. * dwarf_opaque.h: Removed trailing whitespace. Added _dwarf_elf_nlsetup() declaration for non-libelf. * dwarf_original_elf_init.c: Added ifdef so calls do not get warnings when only non-libelf. * dwarf_peread.c: Renamed pe_byteorder to pe_endian forconsistency. Added filesize arg to _dwarf_object_read_random calls. * dwarf_peread.h: Renamed pe_byteorder to pe_endian for consistency. * dwarf_reading.h: Now RRMOA macro adds filesize argument. * libdwarf.h.in: Added error codes DW_DLE_SECTION_SIZE_ERROR, DW_DLE_INTERNAL_NULL_POINTER,DW_DLE_SECTION_STRING_OFFSET_BAD, DW_DLE_SECTION_INDEX_BAD,DW_DLE_INTEGER_TOO_SMALL, DW_DLE_ELF_SECTION_LINK_ERROR,DW_DLE_ELF_SECTION_GROUP_ERROR, DW_DLE_ELF_SECTION_COUNT_MISMATCH, DW_DLE_ELF_STRING_SECTION_MISSING,DW_DLE_SEEK_OFF_END, DW_DLE_READ_OFF_END * memcpy_swap.h: Returned the function declarations to be a single long line each. * dwarf_elf_rel_detector.h, dwarf_elf_rel_detector.c: Refactored relocation tests determing whether the relocation was 32bit or 64bit. * dwarf_elf_reloc_386.h, dwarf_elf_reloc_aarch64.h,dwarf_elf_reloc_arm.h, dwarf_elf_reloc_mips.h,dwarf_elf_reloc_ppc64.h, dwarf_elf_reloc_ppc.h,dwarf_elf_reloc_sparc.h, dwarf_elf_reloc_x86_64.h: Complete lists of relocation types. These are no longer needed by libdwarf, but for now remain here. They were once needed for builds lacking a sufficiently complete elf.h. * dwarf_elfstructs.h: struct declarations for the standard Elf structs, but using character arrays, not integers. Assures we always have the correct lengths independent of integer sizes. * dwarf_elf_defines.h: A basic set of Elf defines so the producer code has all it needs. Used by the Elf readers (libelf and nolibelf). * dwarf_elfread.h: The internally-used set of structures that hold nolibelf Elf data. The fields are sized to hold 64bit and used for both 32bit and 64bit elf. Some extra fields exist so aspects that differ by 32/64 are recorded by 32/64 specific code so * dwarf_elf_load_headers.c: Actually reads 32 and 64 Elf and inserts the values into the structures declared in dwarf_elfread.h. * dwarf_elfread.c: This does the nolibelf setup and calls dwarf_elf_load_headers.c interfaces to help with setup. 2019-03-08 David Anderson * pro_section.c: Remove trailing whitespace. 2019-03-07 David Anderson * pro_section.c(_dwarf_pro_generate_debuginfo): Now when there are zero bytes to copy we do not call memcpy, as in that case the source pointer will be NULL. 2019-03-06 David Anderson * dwarf_form.c,dwarf_global.c: Removed trailing whitespace. * pro_init.c: Removed trailing whitespace and fixed indents. * pro_forms.c(dwarf_add_AT_any_value_uleb_a): Accidentally leftout dbg = ownerdie->di_dbg, resulting in a memory leak. * pro_frame.c(dwarf_new_fde_a): Accidentally left out setting fde_dbg, resulting in a memory leak. 2019-03-04 David Anderson * dwarf.h: Adding go-specifig type attributes DW_AT_go_kind,DW_AT_go_key,DW_AT_go_elem, DW_AT_go_embedded_field,DW_AT_go_runtime_type. Added error code DW_DLE_RETURN_EMPTY_PUBNAMES_ERROR. * dwarf_errmsg_list.h: Added error code DW_DLE_RETURN_EMPTY_PUBNAMES_ERROR. * dwarf_global.c: Updates new fields in the hidden struct with pubnames(etc) context data and makes it possible to see the CU headers there, even if there are no actual variables listed for a CU (a fake record returned in that case). The change in output records (the fake records) only appear if the caller has requested such by a call to xxxxx Implements dwarf_get_globals_header() so a caller like dwarfdump can print such section headers. Implements dwarf_return_empty_pubnames() which just sets a flag so a caller like dwarfdump can request such empty sections return a useful fake entry. * dwarf_global.h: Adds fields like pu_length, pu_version so pubnames(etc) sections can have their cu header data returned. * dwarf_line.c: Adds explicit calls to dwarf_dealloc in error cases to avoid leaving the allocated memory hanging around until dwarf_finish(). * dwarf_names.c,dwarf_names.h, dwarf_names_enum.h, dwarf_names_new.h: Regenerated to create the new attributes for the Go language. * dwarf_opaque.h: Adds flag de_return_empty_pubnames to Dwarf_Debug_s struct so libdwarf can know when fake records for CUs with no entries are wanted by callers. * libdwarf.h.in: Added error code DW_DLE_RETURN_EMPTY_PUBNAMES_ERROR. Declares dwarf_return_empty_pubnames() and dwarf_get_globals_header() so callers (like dwarfdump) can see and access all pubnames(etc)section CU headers. * libdwarf2.1.mm: Version 2.71. Documents the new functions. Revises the contest structure a little so all the pubnames-like sections are documented as a related group of functions. * libdwarf2.1.pdf: Regenerated. Version 2.71. * libdwarf_version.h: New date string. 2019-02-26 David Anderson * dwarf.h: Added go language specific attributes. * dwarf_line.c(dwarf_srcfiles): Dealloc stmt_list_attr as soon as we lose interest in it instead of waiting for dwarf_finish() to be called. 2019-02-24 David Anderson * libdwarf_version.h: Updated date string. * dwarf_names.c,dwarf_names.h, dwarf_names_enum.h, dwarf_names_new.h: Regenerated with latest date string. 2019-02-18 David Anderson * configure.cmake: Now always defines DWARF_WITH_LIBELF so builds work as always. * dwarf_elf_access.c,dwarf_generic_init.c, dwarf_original_elf_init.c, pro_incl.h,pro_init.c,pro_reloc_stream.c: Now these use DWARF_WITH_LIBELF tests to build properly when libelf is to be used. 2019-02-18 David Anderson * pro_incl.h: Added comments on tests of HAVE_ELF_H and the LIBELF_H macros and the #include of the Elf/libelf headers. 2019-02-18 David Anderson * pro_reloc_stream.h: Was testing ifdef HAVE_ELF_H, which is unnecessary as it does not use any elf.h types. 2019-02-12 David Anderson * dwarf_form.c: Implement dwarf_uncompress_integer_block_a() with the proper return type (int). Use this instead of the old dwarf_uncompress_integer_block(). * libdwarf.h.in: Declare dwarf_uncompress_integer_block_a() and dwarf_uncompress_integer_block_a(). * pro_forms.c: Implment the two new functions. 2019-02-10 David Anderson * dwarf_errmsg_list.h,libdwarf.h.in: Adding DW_DLE_NO_STREAM_RELOC_SUPPORT error code. * pro_alloc.c,pro_arange.c,pro_die.c,pro_dnames.c, pro_error.c,pro_expr.c,pro_finish.c,pro_forms.c, pro_frame.c,pro_funcs.c,pro_init.c,pro_line.c, pro_macinfo.c,pro_pubnames.c,pro_reloc.c, pro_reloc_symbolic.c,pro_section.c,pro_types.c, pro_vars.c,pro_weaks.c: Removed the ifdef HAVE_ELF_H in most places as we can really build everything without elf.h except pro_reloc_stream.c (which retains the big ifdef HAVE_ELF_H on the whole file). Now only a couple files have ifdef HAVE_ELF_H * pro_reloc_stream.h: Hiding the function decls with ifdef HAVE_ELF_H 2019-02-10 David Anderson * dwarf_errmsg_list.h,dwarf_generic_init.c: Removed trailing whitespace on one line. * dwarf_incl.h: Removed blank line and a duplicated include statement. 2019-02-10 David Anderson * pro_alloc.c,pro_arange.c,pro_die.c,pro_dnames.c, pro_error.c,pro_expr.c,pro_finish.c,pro_forms.c, pro_frame.c,pro_funcs.c,pro_incl.h,pro_init.c, pro_line.c,pro_macinfo.c,pro_pubnames.c,pro_reloc.c, pro_reloc_stream.c,pro_reloc_symbolic.c,pro_section.c, pro_types.c,pro_vars.c,pro_weaks.c: Now pro_incl.h is almost entirely just #defines and each .c brings in just the headers it really wants. 2019-02-10 David Anderson * dwarf_names.c,dwarf_names.h,dwarf_names_enum.h, dwarf_names_new.h: Datestring update. * libdwarf_version.h: Updated date string 2019-02-07 David Anderson * dwarf_elf_access.c, pro_alloc.c, pro_arange,c,pro_die.c, pro_dnames.c,pro_error.c,pro_xpr.c,pro_finish.c, pro_forms.c,pro_frame.c, pro_funcs.c,pro_init.c, pro_line.c,pro_macinfo.c,pro_pubnames.c,pro_reloc.c, pro_reloc_stream.c, pro_reloc_symbolic.c,pro_section.c, pro_types.c,pro_vars.c,pro_weaks.c: Ifdef (entire file after include config.h) HAVE_ELF_H so libdwarf compiles without HAVE_ELF_H * pro_encode_nm.c: Get rid nested includes, include just what is needed. * dwarf_generic_init.c: Moved dwarf_set_tied_dbg() here and ifdef HAVE_ELF_H so libdwarf compiles without HAVE_ELF_H * dwarf_original_elf_init.c: ifdef HAVE_ELF_H so we can emit an error if no Elf: DW_DLE_NO_ELF_SUPPORT. * dwarf_errmsg_list.h: Add new error DW_DLE_PRODUCER_CODE_NOT_AVAILABLE to display if an attempt is made to open an elf object when libdwarf built without HAVE_ELF_H. And add DW_DLE_NO_ELF_SUPPORT. * libdwarf.h.in: Add DW_DLE_PRODUCER_CODE_NOT_AVAILABLE and DW_DLE_NO_ELF_SUPPORT. 2019-01-31 David Anderson * dwarf_alloc.c, dwarf_die_deliv.c,dwarf_dnames.c, dwarf_dsc.c, dwarf_elf_access.c,dwarf_frame.c,dwarf_frame2.c, dwarf_gdbindex.c,dwarf_generic_init.c,dwarf_init_finish.c, dwarf_line.c,dwarf_loc.c,dwarf_loc2.h,dwarf_machoread.c, dwarf_macro.c,dwarf_macro5.c,dwarf_opaque.h,dwarf_peread.c, dwarf_tsearchhash.c,dwarf_util.c,dwarf_xu_index.c,pro_alloc.c, pro_arange.c,pro_expr.c,pro_line.c,pro_macinfo.c, pro_section.c,pro_types.c: Fixed 56 bugs found by llvm's scan-build tool. 2019-01-27 David Anderson * dwarf_form.c,dwarf_gdbindex.c,dwarf_object_read_common.c, pro_forms.c,pro_section.c: Remove trailing whitespace. 2019-01-27 David Anderson * dwarf_object_read_common.c,dwarf_object_read_common.h: Now uses the ISO (1990) datatypes off_t and size_t and ssize_t for lseek, read. 2019-01-20 David Anderson * dwarf_base_types.h: Remove Dwarf_ufixed and Dwarf_sfixed and all __int32_t and __uint32_t use. __uint64_t Dwarf_ufixed64 and __int64_t Dwarf_sfixed64 have also been removed. * dwarf_elf_access.c: Remove use of those types here too. * dwarf_form.c: Remove references to those types here too. * dwarf_gdbindex.c, dwarf_gdbindex.h: Replace gdbindex_offset_type headerval[6] by char gfs[4][6] (replacing dependence on the int32 sorts of types. * dwarf_macho_loader.h: Clarified that the uint32_t sorts of things are just comments. * libdwarf.h.in: Fixed a too-long comment line. * libdwarfdefs.h: Removed all the *UINT32* and *uint64* use. * pro_forms.c,pro_opaque, pro_section.c: Removed all the Dwarf_sfixed and ufixed stuff here too. 2019-01-14 David Anderson * dwarf_frame.c: Add support for DW_CFA_MIPS_advance_loc8 (though pointless, really) so we can test all the code paths of advance_loc production. * dwarf_frame2.c: Minor formatting cleanup. * dwarf_line_table_reader_common.h: Now tests for negative line numbers in the table and returns an error with the new error code DW_DLE_LINE_TABLE_LINENO_ERROR (which indicates a corrupted line table). * dwarf_names.c, dwarf_names.h, dwarf_names_enum.h, dwarf_names_new.h: Regenerated. Just an update of the sourcedate comment. * dwarf_opaque.h: Delete a trailing whitespace character. * libdwarf.h.in: Add error DW_DLE_LINE_TABLE_LINENO_ERROR. * pro_expr.c: Remove trailing whitespace. * pro_frame.c( dwarf_add_fde_inst_a): A new simpler more portable implementation of the DW_CFA_advance_loc code. * pro_opaque.h: Delete blank last line. 2019-01-12 David Anderson * dwarf_abbrev.c,dwarf_abbrev.h,dwarf_base_types.h, dwarf_die_deliv.c, dwarf_dsc.c,dwarf_error.c, dwarf_error.h,dwarf_form.c,dwarf_frame.c, dwarf_frame.h,dwarf_frame2.c,dwarf_global.h, dwarf_leb.c,dwarf_line.c,dwarf_line.h, dwarf_line_table_reader_common.h,dwarf_loc.c, dwarf_loc2.h,dwarf_macro5.c,dwarf_macro5.h,dwarf_opaque.h, dwarf_print_lines.c,dwarf_query.c,dwarf_util.c,dwarf_util.h, pro_arange.c,pro_error.c,pro_error.h,pro_expr.c, pro_forms.c,pro_frame.c,pro_frame.h,pro_line.h, pro_opaque.h,pro_reloc_stream.c,pro_section.c, pro_types.c: Removed all instances of use of Dwarf_Word, Dwarf_Sword, __int32_t (and other such). In nearly all cases the use was gratuitous. In a few cases some very old code was problematic (dwarf_frame2.c) and is fixed. 2019-01-10 David Anderson * libdwarf_version.h: New date string. 2019-01-09 David Anderson * dwarf_original_elf_init.c: One of the calls to dwarf_object_init_b() was checking the result code then doing a statment that will crash the caller unless the result code was DW_DLV_OK. 2019-01-05 David Anderson * dwarf_generic_init.c: Removed trailing whitespace. 2019-01-04 David Anderson * dwarf_generic_init.c: After closing de_fd, set de_owns_fd FALSE as an extra guard. 2019-01-04 David Anderson * dwarf_object_detector.c: Ensure the configure can set O_BINARY if necessary so open() will use it. 2019-01-04 David Anderson * dwarf_elf_access.c,dwarf_generic_init.c,dwarf_machoread.c, dwarf_opaque.h,dwarf_peread.c: Simplified and unified the requirement that dwarf_finish() close the fd that dwarf_init_path() opened. 2019-01-04 David Anderson * configure.ac: Version 20190104 * dwarf_elf_access.c: Now records that libdwarf owns its fd in the elf case and arranges to close it when the Dwarf_Debug is being closed. This is the case of dwarf_init_path(). Hopefully will address Coverity CID 190599. * dwarf_object_detector.c: Now that struct stat is not in use delete the sys/types.h and sys/stat.h includes as they are no longer needed. * dwarf_generic_init(dwarf_init_path): When libdwarf owns the fd, call _dwarf_elf_record_owned_fd() to record that information. In the default case (not a known object type) we also now close the fd. * dwarf_opaque.h: Add prototype for _dwarf_elf_record_owned_fd, a new internal function so the fd can be closed by libdwarf only when libdwarf owns it. * libdwarf_version.h: New date string. 2019-01-03 David Anderson * dwarf_object_detector.c: Had a pointless call to stat() which was noticed by Coverity CID 190601 as a possible race condition. Deleted the call. * dwarf_generic_init(dwarf_init_path): Serious bugs introduced yesterday. Coverity CID 190600. the fd is remembered in the Dwarf_Debug being created and will eventually be closed when the Dwarf_Debug is closed. 2019-01-02 David Anderson * dwarf_die_deliv.c(dwarf_get_real_section_name): Uninitialized local char array could lead to unpredictable behavior, so now initialized with a NUL first byte so the array is a legal string. Coverity CID CID 190598. * ChangeLog: Renamed ChangeLog2018. New ChangeLog created. * Makefile.am: Added ChangeLog2018 to files in dist. * gennames.c(GenerateOneSet): Fixing Coverity CID 190603 by removing an unused (unusable) value. * dwarf_machoread.c.The include order is now libdwarfdefs.h then dwarf_base_types.h * dwarf_peread.c: The include order is now libdwarfdefs.h then dwarf_base_types.h Was leaking memory re-malloc into local var localdoas. Coverity CID 190602. * dwarf_generic_init.c(dwarf_init_path): We clarify the use of fd and in case of failure ensure we close the fd if it is open (fd >= 0). * dwarf_object_detector.c(dwarf_object_detector_path): Mistaken 'fix' * libdwarf_version.h: Updated version string.