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
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
standard tables: header says lno now,
for line number (row was incorrect).
dwarfdump/dwarfdump.c
dwarfdump/print_die.c
dwarfdump/print_lines.c
New checks for correctness and section overrun.
Fixed duplicate free due to bug in DWARF5 macro
handling.
libdwarf/dwarf_arange.c
libdwarf/dwarf_die_deliv.c
libdwarf/dwarf_elf_access.c
libdwarf/dwarf_errmsg_list.c
libdwarf/dwarf_frame2.c
libdwarf/dwarf_leb.c
libdwarf/dwarf_line.c
libdwarf/dwarf_line.h
libdwarf/dwarf_line_table_reader_common.c
libdwarf/dwarf_macro5.c
libdwarf/dwarf_util.h
libdwarf/libdwarf.h.in
* dwarf_arange.c,dwarf_util.c: first use of READ_UNALIGNED_CK.
* dwarf_errmsg_list.c, libdwarf.h.in: DW_DLE_READ_LITTLEENDIAN_ERROR
and DW_DLE_READ_BIGENDIAN_ERROR are errors possible
in READ_UNALIGNED_CK.
* dwarf_query.c: Using local variables for shorter lines.
* dwarf_util.h: Implement READ_UNALIGNED_CK macros.
* dwarf_die_deliv.c: Now _dwarf_next_die_info_ptr() has
a section end argument.
* dwarf_query.c, dwarf_util.c: Now uses the checked version
of leb reading.
* dwarf_util.h: Now _dwarf_get_size_of_val() has
section_end_ptr argument for checking leb values
do not overrun end of section.
dwarfdump/dwarfdump.c
Ensure dependency on dwarf_errmsg_list.c
libdwarf/Makefile.in
Do much much more testing to ensure we do not
run off the end of section or accept a bogus
leb number.
libdwarf/dwarf_abbrev.c
libdwarf/dwarf_die_deliv.c
libdwarf/dwarf_errmsg_list.c
libdwarf/dwarf_frame.c
libdwarf/dwarf_frame.h
libdwarf/dwarf_frame2.c
libdwarf/dwarf_frame3.c
libdwarf/dwarf_leb.c
libdwarf/dwarf_line.c
libdwarf/dwarf_line.h
libdwarf/dwarf_line_table_reader_common.c
libdwarf/dwarf_opaque.h
libdwarf/dwarf_query.c
libdwarf/dwarf_util.c
libdwarf/dwarf_util.h
libdwarf/libdwarf.h.in
* 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.
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
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
layout change for some macros in dwarf_util.h.
=====================
dwarfdump/dwarfdump.c line 1143: abbrev_flag = TRUE
is the do_all() setting, yet that is not (in general) safe to print
as a section. And the comment following says that.
It is not safe to set abbrev_flag to TRUE. Even valid DWARF
may have garbage in that section in places not referenced by .debug_info.
We just cannot set abbrev_flag TRUE with -a, not safely.
==============================
dwarfdump/dwarfdump.c line 1160,1161: usage_text and
usage_debug_text are file-static, not
visible outside this source file. Get rid of the extern declarations.
Ah. I see why you did that for usage_debug_text,
it is actually a forward-declaration
in this context. Well... I would rather you moved the usage_debug_text
itself up to just after usage_text so the forward-declarations are no longer needed.
Admittedly my reason is not too strong, but it would be my preference
to eliminate those two forward declarations. gcc -Wall -pedantic
does not much like what you did here either :-)
==============================
dwarfdump/dwarfdump.c line 2357. The commit is incorrect now,
we don't quote strings internally in your new work
here. So delete that comment line.
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;