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
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.
* 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.
Makefile.in: Removed source files from the build that
are only useful to IRIX and only in the context of building
an IRIX runtime system.
dwarf_alloc.c: Added constructor/destructor code to
Dwarf_Line_Context allocator.
dwarf_elf_access.c: Added additional #defines so we
have the IA64 defines we need to compile certain
test cases on freebsd.
dwarf_error.c: Two new error codes for Dwarf_Line_Context
checking.
dwarf_line_table_reader_common.c: New file. We can compile
the line reading with and without detailed print lines
for dwarfdump. Now only one body of line reading code
to maintain.
dwarf_line.c: Moved code out to dwarf_line_table_reader_common.c
Refactored to support skeleton line tables (DWARF5)
Eliminated an internal struct, it is no longer needed.
a little better.
Supports experimental two-level line tables too.
dwarf_print_lines.c: Uses dwarf_line_table_reader_common.c
to do much of its work now.
libdwarf.h.in: New interfaces for nicer access to
line table headers.
libdwarf2.1.mm: Partial documentation of the new
libdwarf line table interfaces.
So code can be added there to print more
and better information on the header.
libdwarf:
dwarf_line.c
dwarf_line.h
dwarf_line_table_reader_common.c
dwarf_print_lines.c
Fixed indent and trailing whitespace. Fixed the 'section offset'
code by using the proper value from dss_data..
libdwarf:
dwarf_line.c
dwarf_line.h
dwarf_line2.c
dwarf_line_table_reader_common.c
dwarf_print_lines.c
libdwarf.h.in
extracted from dwarf_line.c. Now compiled into dwarf_line.c
and dwarf_print_lines.c with correct two-level line table
calculations. No more coding the table twice.
* dwarf_line.c,dwarf_print_lines.c: Now #include
dwarf_line_table_reader_common.c
* Makefile.in: Reflects new source depedencies.
* dwarf_line2.c: An internal function interface changed,
so accomodated it here.
* libdwarf.h.in, dwarf_error.c: New error code, DW_DLE_BAD_LINE_TABLE_OPERATION.
line register structs agree on spelling of suffix of each name.
Now dwarf_srclines (and two-level) use the
line register struct instead of a list of local variables.
This in preparation for a revamp of dwarf_print lines
and a simplification of dwarf_print_lines.
and added a Dwarf_CU_Context argument so we can get address
size and segment size when not in the line table.
All this related to two-level line tables.
dwarfdump/print_lines.c
libdwarf/dwarf.h
libdwarf/dwarf_die_deliv.c
libdwarf/dwarf_line.c
libdwarf/dwarf_line.h
libdwarf/dwarf_opaque.h
libdwarf/dwarf_print_lines.c
libdwarf/dwarf_sort_line.c
libdwarf/libdwarf.h.in
dwarf_print_lines.c,dwarf_macro.c: Remove trailing whitespace.
dwarf_ranges.c, dwarf_sort_lines.c: Remove trailing whitespace.
dwarf_query.c, dwarf_pubtypes.c: Remove trailing whitespace.
dwarf_original_elf_init.c,dwarf_loc.c: Remove trailing whitespace.
gennames.c: Fix a printf so the generated dwarf_names.c
does not have a trailing space.
stdout directly.
dwarfdump[2] use this new feature now.
The new interfaces in libdwarf.h to support this are documented.
Some minor botches in libdwarf2.1.mm (bad formatting) fixed.
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;
* dwarf.h: Added some GNU extensions.
* libdwarf.h: Added dwarf_lineoff_b() as
dwarf_lineoff() wrongly returns a signed column number.
Added dwarf_add_lineentry_b() as preparation for creating
DWARF3/4 output.
* dwarf_line.h: Added new struct fields to accomodate
DWARF3/4 isa and discriminator fields.
* dwarf_line.c: Now deals with the VLIW line calculations
in DWARF4. Adds support for computing the discriminator
and isa fields. Adds dwarf_lineoff_b() (and dwarf_lineoff
is now deprecated). Adds dwarf_prologue_end_etc() which
returns some DWARF3/4 line fields.
* dwarf_print_lines.c: Adds handling of DWARF3/4
line operations and fields and prints the details.
* libdwarf2.1.mm: Documents the new functions in dwarf_line.c
Version set to 2.02.
* libdwarf2.1.pdf: Regenerated.
* libdwarf2p.1.mm: Documents the new function
dwaf_add_line_entry_b().
Version set to 1.32.
* libdwarf2p.1.pdf: Regenerated.
* pro_incl.h: Add parentheses so the WRITE_UNALIGNED macro
works correctly in all circumtances.
* pro_opaque.h: Add DEBUG_RANGES and dEBUG_TYPES to the list
of sections we could generate. Define struct Dwarf_P_Line_Inits_s
to hold initialization values for line table data so we can later
make the choices at runtime rather than compile time.
The new struct is a field of the Dwarf_P_Debug struct.
* pro_line.h: Added some DWARF3/4 support and preparations
for emitting DWARF3/4.
* pro_line.c: Define dwarf_add_line_entry_b() for DWARF3/4
line fields, and _dwarf_init_default_line_header_vals()
to provide a default set of values, the defaults match
what was previously done.
Add support for the new DWARF3/4 line table fields.
* pro_section.c: Add the beginnings of support for creating
new DWARF3/4 sections and the new standard opcodes.
Move the field-writing code to small functions making
the line table writing smaller and easier to read.
Added the beginnings of allowing writing DWARF3/4
line table fields. Some if() missing {} were
modified by adding {} to avoid future problems.
* dwarf_arange.c,dwarf_elf_access.c, dwarf_frame3.c,
dwarf_funcs.c,dwarf_global.c,dwarf_init_finish.c,
dwarf_line.c,dwarf_loc.c,dwarf_macro.c,dwarf_print_lines.c,
dwarf_pubtypes.c,dwarf_query.c,dwarf_ranges.c,dwarf_string.c,
dwarf_types.c,dwarf_vars.c, dwarf_weaks.c: Everything loading
a section now checks the result for 'empty' and returns
DW_DLV_NO_ENTRY explicitly. This makes it easier to
do nothing safely when there is no data.
indentation. No interfaces changed. One new and
not very significant (to most people) interface added which
returns a count of abbreviations in an abbreviation section.
Copyrights updated for 2011.