* print_die.c: Fix typo in error message.
* print_frames.c: Do additional checks for incorrect data
when printing frame instructions to avoid dwarfdump crash..
libdwarf
* dwarf_form.c: Directly check expression length against
section length in case expression length very very large.
* dwarf_query.c: _dwarf_calculate_info_section_*() routines
made clearer and the *_start_ptr() instance also now returns
the length (via a pointer arg).
* dwarf_xu_index.c: Check data read from the section so
a wildly large columns count or slots count will be caught
and an error returned.
Moved a couple functions between source files
and made them static. A couple commentary changes.
print_frames.c, though, needed hardening against
corrupt frame data.
dwarfdump/globals.h
dwarfdump/print_aranges.c
dwarfdump/print_die.c
dwarfdump/print_frames.c
dwarfdump/print_sections.c
All data reads from an object ensure the
read is actually in a section.
It is always possible something was overlooked, but
all the reading macros and functions now do checks.
libdwarf/dwarf_arange.c
libdwarf/dwarf_die_deliv.c
libdwarf/dwarf_errmsg_list.c
libdwarf/dwarf_form.c
libdwarf/dwarf_frame.c
libdwarf/dwarf_frame2.c
libdwarf/dwarf_global.c
libdwarf/dwarf_line.c
libdwarf/dwarf_line_table_reader_common.c
libdwarf/dwarf_loc.c
libdwarf/dwarf_loc2.c
libdwarf/dwarf_macro5.c
libdwarf/dwarf_opaque.h
libdwarf/dwarf_print_lines.c
libdwarf/dwarf_query.c
libdwarf/dwarf_ranges.c
libdwarf/dwarf_util.c
libdwarf/dwarf_util.h
libdwarf/dwarf_xu_index.c
libdwarf/libdwarf.h.in
bugxml/data.txt
libdwarf
* dwarf_errmsg_list.c: Added DW_DLE_ZLIB_SECTION_SHORT.
* dwarf_form.c: Now checking for section overrun.
* dwarf_init_finish.c: Now checking zlib reading
for section overrun.
* dwarf_macro5.c: Now checking for section overrun and
also fixing double delete caused by having
_dwarf_get_alloc() space pointing at other _dwarf_get_alloc()
space. Because in case of error the order of free
of such is unpredictable!
* dwarf_macro5.h: Added comment on mc_srcfiles member.
* libdwarf.h.in: Added DW_DLE_ZLIB_SECTION_SHORT.
bugxml/data.txt
Now prints strings so that
control characters do not
cause problems. Easier to read too.
dwarfdump/Makefile.in
dwarfdump/NEWS
dwarfdump/dwarfdump.1
dwarfdump/dwarfdump.c
dwarfdump/globals.h
dwarfdump/print_die.c
dwarfdump/print_frames.c
dwarfdump/print_lines.c
dwarfdump/print_macro.c
dwarfdump/print_macros.c
dwarfdump/sanitized.c
Removed trailing whitespace.
dwarfexample/simplereader.c
New checking for corrupt input.
libdwarf/dwarf_errmsg_list.c
libdwarf/dwarf_form.c
libdwarf/dwarf_line.c
libdwarf/dwarf_opaque.h
libdwarf/dwarf_query.c
libdwarf/dwarf_util.h
libdwarf/libdwarf.h.in
(for testing libdwarf it's no longer so simple).
Support configure --enable-wall.
dwarfexample/Makefile.in
dwarfexample/configure
dwarfexample/configure.in
dwarfexample/simplereader.c
Now works with DW_FORM_GNU_strp_alt and DW_FORM_strp_sup
(as well as it can) even if there is no error argument passed
in to dwarf_formstring (and now dwarf_diename()
and dwarf_die_text() call dwarf_formstring() so all
types of string values are handled).
libdwarf/dwarf_form.c
libdwarf/dwarf_query.c
Dwarf_Error* and with mistakes treating DW_DLV_NO_ENTRY
as if it were DW_DLV_ERROR.
* dwarf_form.c: Only do dwarf_errno(*error) when error is non-null.
* dwarf_macro5.c, dwarf_query.c, dwarf_ranges.c: Avoid the
possibility of
doing dwarf_errno(*error) when error is null.
* dwarf_util.c(_dwarf_error_mv_s_to_t): Added code to
ensure that nothing crash-worthy happens
even if a future internal caller calls it with one or more NULL
arguments.
* libdwarf2.1.mm: Added a few words about Error Handling in general
to clarify earlier wording (earlier wording was not as explicit
as it should have been).
* libdwarf2.1.pdf: Regenerated. Version 2.45
* dwarf_sort_line.c: Though no longer built or used, added
an initializer to a local variable for correctness.
dwarfdump/globals.h
dwarfdump/print_aranges.c
dwarfdump/print_die.c
dwarfdump/print_frames.c
dwarfdump/print_lines.c
dwarfdump/print_macro.c
dwarfdump/print_pubnames.c
print_lines.c,print_macro.c,print_pubnames.c:
Remove the global dieprint_cu_offset, use local vars and pass around instead.
Ensure the traverse() logic when checking type references do not evaluate
references to other sections. Many argument lists got an additional argument or two.
libdwarf/dwarf_form.c
fix a comment
if the gcc '__attribute__ ((name))' compiles ok.
* config.h.in, configure: Regenerated.
* libdwarfdefs.h: Test HAVE_UNUSED_ATTRIBUTE and define
UNUSEDARG appropriately.
* dwarf_alloc.c,dwarf_elf_access.c,dwarf_form.c,dwarf_frame2.c,
dwarf_gdbindex.c,dwarf_global.c,dwarf_init_finish.c,dwarf_line.c,
dwarf_line_table_reader_common.c,dwarf_macro5.c,
dwarf_original_elf_init.c,dwarf_print_lines.c,dwarf_ranges.c,
dwarf_tsearchhash.c,dwarf_util.c,dwarf_xu_index.c,
pro_alloc.c,pro_frame.c,pro_init.c,pro_reloc.c,
pro_reloc_stream.c,pro_section.c: Use UNUSEDARG to suppress
meaningless unused-parameter warnings from gcc.
* print_die.c: Fixed indents, removed trailing whitespace.
* dwarfdump.c, common.c: Update version string.
libdwarf
* dwarf_alloc.c: Fixed indents, trailing whitespace.
* dwarf_loc2.c: Fixed indents, trailing whitespace.
* dwarf_form.c: Made too-long line into 2 lines.
* dwarf_loc.h: Removed duplicate Dwarf_Loc_c_s etc declarations.
* dwarf_util.c(_dwarf_error_mv_s_to_t),dwarf_util.h: New
function to eliminate duplicative code.:
* dwarf_query.c): Fix bug in dwarf_get_offset_size().
Use new _dwarf_error_mv_s_to_t() to get error on correct dbg.
Fixed indents, trailing whitespace.
* dwarf_ranges.c: Use new _dwarf_error_mv_s_to_t()
to get error on correct dbg.
Fixed indents, trailing whitespace.
* dwarfdump.c: Revised -g so it no longer turns on -i.
Revised the meaning of -g to mean use old loclist interfaces
(for testing the older interfaces with dwarfdump).
* print_die.c(get_small_encoding_integer_and_name): a dwarf_dealloc
referenced err whereas *err was correct.
Revised loclist output making it look a bit like DWARF5
even for DWARF2,3,4 output. Reads better, I think.
* print_locs.c: -l gets a 'no longer supported' message
dwarfdump/dwarfdump.1
dwarfdump/dwarfdump.c
dwarfdump/print_die.c
dwarfdump/print_locs.c
* dwarf_alloc.c: Added new checks so user mixing up
tied dbg with regular dbg won't lead to crashes
when calling dwarf_dealloc or dwarf_finish().
Zeroed out some fields to recognize space deallocated.
* dwarf_die_deliv.c: Added support of split dwarf
DW_AT_[GNU_]ranges_base
* dwarf_form.c: Load string from tieddbg when appropriate.
* dwarf_harmless.c: On free() zero out a field to show that was done.
* dwarf_loc.c: Correct the handling of split dwarf loclist.
* dwarf_opaque.h: Add cc_ranges_base_present for split dwarf.
Add _dwarf_get_ranges_base_attr_from_tied() for split dwarf.
* dwarf_query.c: Get and remember skeleton compilaton unit
DW_AT_[GNU_]ranges_base from tied objects for split dwarf.
* dwarf_ranges.c: If a tied object present, look for ranges
there, not in split dwarf object.
* dwarf_util.c: Housekeeping zeros out fields to ensure not
used after dealloc.
libdwarf/dwarf_alloc.c
libdwarf/dwarf_die_deliv.c
libdwarf/dwarf_form.c
libdwarf/dwarf_harmless.c
libdwarf/dwarf_loc.c
libdwarf/dwarf_loc2.c
libdwarf/dwarf_opaque.h
libdwarf/dwarf_original_elf_init.c
libdwarf/dwarf_query.c
libdwarf/dwarf_ranges.c
libdwarf/dwarf_util.c
examples.c: Add commentary to example9.
dwarf_alloc.c: Add DW_DLA_LOC_BLOCK_C and DW_CLA_LOCDESC_C
allocation descriptions to array.
dwarf_alloc.h: Increase ALLOC_AREA_INDEX_TABLE_MAX to match.
dwarf_base_types.h: Increase MAX_DW_DLA to match.
dwarf_die_deliv.c: Switch some returns from pointer to
the standard int DW_DLV_OK etc and return pointer through
an argument. Identify which CUs are dwo by checking name
for a .dwo ending. Fix whitespace endings.
dwarf_error.c: Add DW_DLE 309 to 311 errors to descriptions array.
dwarf_form.c: Remove trailing whitespace. Reformat one line
so it is not so long.
dwarf_line.c: Add {} on if for clarity.
Fix whitespace endings.
dwarf_line_table_reader.c: Fix whitespace endings.
dwarf_loc.c: Refactor loc. expr. reader into a
routine that reads one expression, _darf_read_loc_expr_op()..
Add DWARF5 operators.
Add preliminary dwo expression support (which will change
but this is a start). Old expression interface now
explicitly supports only DWARF 2,3,4. No DWARF5.
Add preliminary loclist_c support (it will change).
Add commentary about the old loclist interface.
dwarf_loc.h: First cut of new interfaces (functional, not
public structs).
dwarf_opaque.h: Add cc_is_dwo flag to cu context struct.
libdwarf.h.in: Rework some loclist commentary.
Add first try at new loclist interfaces for DWARF2,3,4,5.
New error codes for new loclist/dwo code.
libdwarf2.1.mm: Rev 2.32. New wording on old loclist
interfaces.
* dwarfdump.c: Add enum line_flag_type_e so we can test
all the srclines interfaces (4 of them). Expand -x
for that too.
* print_die.c: Support DW_FORM_GNU_strp_alt.
* print_lines.c: Update for old and new srclines
interfaces.
* globals.h: Added the enum line_flag_e variable for
recording -x line5= value.
libdwarf
* checkexamples.c: Fixed data type in the example code.
* dwarf.h: Updated comment about DW_FORM_GNU_strp_alt
* dwarf_elf_access.c: Fixed trailing whitespace and
removed debug printf that got left in.
* dwarf_error.c: Add new TIED file errors.
DW_DLE_NO_TIED_FILE_AVAILABLE, DW_DLE_NO_TIED_STRING_AVAILABLE.
* dwarf_form.c: Added support for DW_FORM_GNU_strp_alt.
* dwarf_init_finish.c: #if 0 routine all_sig8bits_zero().
* dwarf_line.c: Now always notice windows-like c: etc
as start of a full path. Ensure directories with \ are
turned to / in line tables. (for full such transforms
configure with --enable-windowspath ) Remove some debug #ifdef
lines.
Alter the linecontext interface to pass back table count,
not linecount.
* dwarf_line.h: Add commentary and lc_table_count field.
* dwarf_line_table_reader_common.c: Fix indent/trailing whitespace.
Now sets lc_table_count;
* dwarf_opaque.h: Add _dwarf_get_string_from_tied() interface.
* dwarf_print_lines.c: Remove trailing whitespace and some debug printf..
* libdwarf.h.in: New error codes. Fix trailing whitespace. Expand
commentary.
dwarfdump/print_lines.c
Corrected indentation and an error introduced a couple
days ago in computing the end of the line table for a CU.
libdwarf/dwarf.h
libdwarf/dwarf_elf_access.c
libdwarf/dwarf_form.c
libdwarf/dwarf_line.c
libdwarf/dwarf_line.h
are caught so we avoid some coredumps.
Such strings in DWARF are created by 'fuzzing' or
by a bug in a compiler or linker.
libdwarf/dwarf_error.c
libdwarf/dwarf_form.c
libdwarf/dwarf_frame.c
libdwarf/dwarf_frame.h
libdwarf/dwarf_frame2.c
libdwarf/dwarf_global.c
libdwarf/dwarf_line.c
libdwarf/dwarf_macro.c
libdwarf/dwarf_string.c
libdwarf/dwarf_util.c
libdwarf/dwarf_util.h
libdwarf/libdwarf.h.in
code in libdwarf to go to the other, the tied, object
and retrieve .debug_addr data.
dwarfdump/ChangeLog
dwarfdump/dwarfdump.1
dwarfdump/dwarfdump.c
dwarfdump/print_die.c
libdwarf/ChangeLog
libdwarf/Makefile.in
libdwarf/dwarf_alloc.c
libdwarf/dwarf_die_deliv.c
libdwarf/dwarf_error.c
libdwarf/dwarf_form.c
libdwarf/dwarf_opaque.h
libdwarf/dwarf_original_elf_init.c
libdwarf/dwarf_query.c
dwarf_tied.c
libdwarf/libdwarf.h.in
so we get consistent behavior. Specifically allowing the
notion of :: in the option list.
Fixed issues with handling files with both .debug_types and
.debug_info (got spurious warnings with -ky -kd, for example)
on a .dwp object.
Corrected a couple places where we needed to reset a static
variable (renamed the static variable for readability and removed
it from the globals variables).
DebugFission data. There are new attributes (with GNU
forms and standard forms) and DW_OP's too.
Libdwarf reader code refactored so the new sections are
easily handled.
dwarfdump/common.c
dwarfdump/dwarfdump.c
dwarfdump2/ChangeLog
dwarfdump2/common.cc
dwarfdump2/dwarfdump.cc
Changed the implementation of DW_FORM_ref_addr
to properly reflect the V2 vs V3 and later
specifications.
libdwarf/dwarf_addr_finder.c libdwarf/dwarf_die_deliv.c
libdwarf/dwarf_form.c libdwarf/dwarf_query.c
libdwarf/dwarf_util.c libdwarf/dwarf_util.h
libdwarf/pro_forms.c libdwarf/pro_section.c
change to make consistent use of 'if', 'for' and 'while'.
===================
dwarfdump.c lines 73-78 Any time an 'extern foo' appears in a .c or a .cc
file it represents a current or future error that cannot be easily detected
at compile time. Bad.
Instead, put print_attributes_encoding and current_cu_die_for_print_frames
declarations into appropriate .h files (possibly new one or ones?) and
include the header in each .c/.cc where it is needed. That prevents future
spelling errors from causing mysterious runtime failures due to argument
errors: the compiler will catch argument errors.
Now line 56-58 is special in that it refers to some windows thing, not
defined in dwarfdump. So that one perhaps should or must stay as written.
===================
dwarfdump.c line 549: the variable 'bitmap' should be named something else.
bitmap is just too generic, not helpful to the reader. Easier for a
reviewer to see this sort of issue than the author :-)
Possibly local_section_bitmap? Somehow get 'section' in there in that
function-argument-name?
=======
dwarfdump.c: good catch on the indent errors in qsort_compare_compiler(),
I have no idea how I failed to run dicheck on that.
======
dwarfdump.c line 1043. The 'Just for the moment' comment is odd. What
does that mean? Why 'for the moment'? I am not going to try to guess
why you did that, but it has to be somehow wrong?
Either the code or the comment?
========
dwarfdump.c line 1162. The comment says do not do reloc_flag = TRUE
yet you added exactly that! Yikes! I don't know what to do about
this, but something has to change. Comment or statement. Can we detect
non-elf somehow? We probably already do, but...
===================
dwarfdump.c line 1630. Oops. Good catch on removing the mistaken extra
break;