Add a comment about a libdwarf reference to HAVE_ELF_C_READ_MMAP.
That define looks like it belongs in config.h but
does not appear there nor in config.h.in
-- because it is not really necessary.
This incorporates improvements to the checking
and new options. For dwarfdump and dwarfdump2.
It makes formatting of if/for/while more
consistent across the source.
It removes many double-quote characters around strings that
turned out not to be as useful (in the dwarfdump output)
as had been thought.
It adds the ability to handle additional relocations
so more relocatable objects can be handled by libdwarf.
* layout changes (if, for, switch statements)
* new algorithm to setup debug section during initialization
* new header files with relocation definitions for ARM, MIPS,
PPC, PPC64, X86_64.
C
dwarfdump/ChangeLog2012
dwarfdump/dwarfdump.1 : tweaks to match what Linux does for new E and Sv.
dwarfdump/dwarfdump.c : Commentary enhancement.
dwarfdump2/checkutil.cc : Make it work properly, as in dwarfdump.
dwarfdump2/checkutil.h : Make it work like dwarfdump version.
dwarfdump2/dwarfdump.1 : tweaks to match what Linux does for E and Sv
dwarfdump2/dwarfdump.cc : To match dwarfdump output.
dwarfdump2/print_die.cc : To match dwarfdump output.
dwarfdump2/print_reloc.cc : To match dwarfdump output.
dwarfdump2/print_reloc.h : now present as in dwarfdump
libdwarf/dwarf.h : fix copyright date
libdwarf/dwarf_reloc_arm.h : fix copyright date
libdwarf/dwarf_reloc_mips.h : fix copyright date
libdwarf/dwarf_reloc_ppc.h : fix copyright date
libdwarf/dwarf_reloc_ppc64.h : fix copyright date
libdwarf/dwarf_reloc_x86_64.h : fix copyright date
libdwarf/libdwarf.h : fix uncommented argument names to be comments.
libdwarf.h
libdwarf2.1.mm
libdwarf2.1.pdf
DW_OP_GNU_implicit_pointer requires a version stamp
to work correctly. Created a new function
to allow clients to expicitly pass the version stamp.
Most clients can continue to use the old interface.
dwarfdump/dwarfdump.c: #include uri.h so it will compile without error.
dwarfdump/print_reloc.c: Fix printf to be %lx to match argument type.
dwarfdump2/dwarfdump.cc: Using C++ bool here and changing fprintf to cerr.
dwarfdump2/print_die.cc: Obvious trivial changes to get it to compile.
dwarfdump2/print_lines.cc:Obvious trivial changes to get it to comp
ile.
dwarfdump2/tag_tree.cc:#include naming.h
libdwarf/dwarf_elf_access.c: Fix typo in PPC64 #if
libdwarf/dwarf_reloc_arm.h: tweak comments at top.
libdwarf/dwarf_reloc_mips.h: tweak comments at top.
libdwarf/dwarf_reloc_ppc.h: tweak comments at top.
libdwarf/dwarf_reloc_ppc64.h: tweak comments at top.
libdwarf/dwarf_reloc_x86_64.h: tweak comments at top.
# By David Anderson
# Via David Anderson
* 'master' of ssh://caej@git.code.sf.net/p/libdwarf/code:
Minor tweak to libdwarf/CODINGSTYLE
Added small refinements to libdwarf/CODINGSTYLE.
For the new relocation header files, update the copyright year and
remove the references to SGI as the files need to be considered in
that any truly new (as opposed to moved from existing libdwarf file).
===========
dwarfdump/print_die.c line 1279, 1280, 1293,1294: The comments
are pretty useless, since we don't use 'errno' here any longer.
Now the comments look random.
===========
print_lines.c, line 69: I don't understand why line_print_pc
controls printing this particular offset value. Maybe you are right
here, but it's not at all obvious why this is the right thing to do.
Or perhaps just add a comment about why condition the output
on line_print_pc for code readers ?
===========
libdwarf/ reloc .h files with defines, the new header files:
delete the $Header: comment line, it is not relevant
for the new header files, and is in fact irrelevant everywhere,
but let's just ignore the irrelevance for the old files.
===========
libdwarf/libdwarf.h line 2951, 2952:
How about the comment revised as follows
/* These make the LEB encoding routines visible to libdwarf
callers. Added November, 2012. */
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;
also the string names for those values have been moved from Dwarfdump
into Libdwarf and put in separate files: dwarf_reloc_xxx.h, where xxx
is one of: arm, mips, ppc, ppc64 and x86_64.
Check the encoding form used for those attributes that use constant values
and determine if the number of bytes used to represent the attribute data
can be reduced by using unsigned LEB128 encoding. Gives a table with the
current usage, the usage if LEB128 is used and a percentage rate.
Signed-off-by: Carlos Alberto Enciso <carlos.alberto.enciso@gmail.com>
of the section name and use the section type (SHT_RELA) instead, to able
to decode properly object files, that do not use the conventional prefix
.rela for those sections.
The GNU readelf tool, manages to decode those files.
* 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.
error off instead of getting a divide-by-zero error or a libdwarf
crash (and so we don't read off the end of a section given erroneous
input). Has no effect when reading correct dwarf.
config.h.in, configure.in now use a configure-time dependency
on HAVE_STDAFX_H rather than the older built-in ifdef.
So folks using mingw have an easier time.
takes effect.
dwarfdump, dwarfdump2: Modify the dwarfdump.conf reader so we
can do the new includeabi: and address_size: commands in dwarfdump.conf.
Documented the new libdwarf call for address size and regenerated
the pdf.