Commit Graph

374 Commits

Author SHA1 Message Date
David Anderson
d76395da7d Merge branch 'unattr'
Conflicts:
	libdwarf/ChangeLog
2016-02-06 14:28:35 -08:00
David Anderson
8e1e9c4b5b Now the base hash table size is closer to 100 by default.
The tiny values were only intended to test the table-expansion
logic.
libdwarf/dwarf_tsearchhash.c
2016-02-06 13:49:24 -08:00
David Anderson
e9cf490520 * configure.in: defines HAVE_UNUSED_ATTRIBUTE
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.
2016-02-06 09:20:41 -08:00
David Anderson
6f9106f254 Fixing the formatting of fde/cie.
fdes were not printing properly.
We were testing the wrong thing to determine if
we should print.
dwarfdump/print_frames.c

The code for frames was basically ok.
But clearer now with better comments for eh_frame.
And clearer 'no entry' for fde augmentation bytes.
libdwarf/dwarf_frame.c
libdwarf/dwarf_frame.h
libdwarf/dwarf_frame2.c
2016-02-06 08:16:22 -08:00
David Anderson
9a2f20d354 Cleaning up comments about .eh_frame
and removing un-needed  casts.
Fixing commentary about CIE_id
libdwarf/dwarf_frame2.c

Fixing signed/unsigned comparison.
libdwarf/dwarf_loc2.c

Removing ; after function definition as not
being proper C90/C90
libdwarf/pro_init.c
2016-02-05 16:04:42 -08:00
David Anderson
2d92dd4d6d Improving the print of constant types by trying to figure out
signedness.  Now prints the 'as signed' value as (-1)
for example instead of (as signed = -1) when signedness
is not clear.

dwarfdump/Makefile.in
dwarfdump/dwarfdump.c
dwarfdump/helpertree.c
dwarfdump/helpertree.h
dwarfdump/print_die.c

Remove a blank line.
libdwarf/dwarf_abbrev.c
add a check for
libdwarf/dwarf_macro5.c
2016-01-26 17:45:09 -08:00
David Anderson
d9d40e4d80 Add additional flags to the --enable-wall option.
dwarfdump/configure.in
libdwarf/configure.in

dwarfdump/configure (regenerate)
libdwarf/configure (regenerate)

These fix compiler warnings
dwarfdump/dwarf_tsearchbal.c
dwarfdump/dwarfdump.c
dwarfdump/dwconf.c
dwarfdump/dwconf.h
dwarfdump/esb.c
dwarfdump/globals.h
dwarfdump/print_debugfission.c
dwarfdump/print_die.c
dwarfdump/print_frames.c
dwarfdump/print_sections.c

libdwarf/dwarf_die_deliv.c
libdwarf/dwarf_frame.c
libdwarf/dwarf_frame2.c
libdwarf/dwarf_gdbindex.c
libdwarf/dwarf_gdbindex.h
libdwarf/dwarf_line.c
libdwarf/dwarf_line.h
libdwarf/dwarf_line_table_reader_common.c
libdwarf/dwarf_macro5.c
libdwarf/dwarf_query.c
libdwarf/dwarf_tsearchhash.c
2016-01-21 15:42:58 -08:00
David Anderson
d2b57c4b93 Had a horrible */*
see dwarf_get_macro_context_by_offset()

libdwarf.h.in

Fixed to be  * /*
2016-01-21 09:09:12 -08:00
David Anderson
d3f4810353 libdwarf: Adding dwarf_die_text() as a more
general function to get the string from a string-value DIE.
dwarf_query.c
libdwarf.h.in
libdwarf2.1.mm
libdwarf2.1.pdf
2016-01-20 11:39:23 -08:00
David Anderson
3e442d6a40 Better compiler checking with --enable-wall..
Now all with prototypes.
Local functions now declared static.
One crucial bug in macrocheck.c in calling dwarf_twalk fixed.
dwarfdump/configure
dwarfdump/configure.in
dwarfdump/dwarf_tsearchbal.c delete unused function
dwarfdump/dwarfdump.c
dwarfdump/dwconf.c
dwarfdump/dwgetopt.c
dwarfdump/globals.h
dwarfdump/macrocheck.c
dwarfdump/naming.c
dwarfdump/print_gdbindex.c
dwarfdump/tag_attr.c
dwarfdump/tag_common.c

Better compiler checking with --enable-wall..
Now all with prototypes.
Local functions now declared static.
Some old and new functions documented in mm.
libdwarf/Makefile.in
libdwarf/configure
libdwarf/configure.in
libdwarf/dwarf_macro5.c
libdwarf/dwarf_original_elf_init.c
libdwarf/dwarf_query.c
libdwarf/dwarf_stubs.c
libdwarf/dwarf_util.c
libdwarf/dwgetopt.c
libdwarf/libdwarf.h.in
libdwarf/libdwarf2.1.mm
libdwarf/libdwarf2.1.pdf Regenerated. V 2.39
libdwarf/pro_alloc.c
libdwarf/pro_alloc.h

delete unused function.
tsearch/dwarf_tsearchbal.c

files:
2016-01-20 10:32:39 -08:00
David Anderson
9565964f26 Remove ;; where it was just an accident.
Make header reading idempotent with ifndef/define
dwarfdump/dwarfdump.c
dwarfdump/esb.c  (avoid doing append of empty string).
dwarfdump/esb.h
dwarfdump/globals.h
dwarfdump/naming.h
dwarfdump/print_frames.c
dwarfdump/print_lines.c

Ensure declarations first in a block (avoid C99 isms).
libdwarf/dwarf_form.c
libdwarf/dwarf_frame2.c (check for too-short section)
libdwarf/dwarf_loc.c
libdwarf/dwarf_macro5.c
libdwarf/dwarf_query.c
libdwarf/dwarf_util.c
2016-01-19 16:25:30 -08:00
David Anderson
5dbb08417f Fix indentation and remove trailing whitespace.
dwarfdump/ChangeLog
dwarfdump/print_frames.c
libdwarf/ChangeLog
libdwarf/dwarf_form.c
libdwarf/dwarf_frame2.c
2016-01-19 10:34:47 -08:00
David Anderson
64c45e521d Some statements had trailing ;;
Removed second semicolon.
dwarfdump/print_die.c
dwarfdump/tag_tree.c

libdwarf/dwarf_frame.c
libdwarf/dwarf_line.c
libdwarf/dwarf_line_table_reader_common.c
libdwarf/dwarf_loc.c
libdwarf/dwarf_macro5.c
libdwarf/dwarf_query.c
libdwarf/pro_die.c
2016-01-19 10:27:03 -08:00
David Anderson
2a577bd770 * libdwarf.h.in, dwarf_error.c: New error numbers.
DW_DLE_LINE_STRP_OFFSET_BAD, DW_DLE_STRING_FORM_IMPROPER.
* dwarf_form.c: Added suport for DW_FORM_line_strp into
       dwarf_formstring().
2016-01-19 09:55:04 -08:00
David Anderson
2192c62b5c Additional checks for frame issues in bad objects.
Better reporting of such problems.

modified:   dwarfdump/common.c
modified:   dwarfdump/dwarfdump.c
modified:   dwarfdump/globals.h
modified:   dwarfdump/print_frames.c

modified:   libdwarf/dwarf_frame2.c
2016-01-17 18:53:01 -08:00
David Anderson
bd5407933d libdwarf
* libdwarf2.1.mm: Documented DWARF5 macro operations.
       Version 2.38
     * libdwarf2.1.pdf: Regenerated.
     * libdwarf2p.1.pdf: Regenerated following a trivial
       clarification on cie production made a couple days ago.
2016-01-16 16:03:27 -08:00
David Anderson
c4757724b0 New example for the new macro (.debug_macro) interface set.
Added a (long) example of use of the important macro
interfaces.
	modified:   checkexamples.c

Fixed small botch in one macro declaration: forgot to comment
out the argument names.
	modified:   libdwarf.h.in
A beginning of documenting the new macro functions.
	modified:   libdwarf2.1.mm
2016-01-15 16:21:07 -08:00
David Anderson
25aad438e2 pro_frame.h, pro_frame.c: The code adding a CIE for output
(dwarf_add_frame_cie())
  was simply assuming that the augmentation string passed in was
  in stable storage.  Now it uses strdup() to guarantee there
  no surprises.
2016-01-15 08:05:00 -08:00
David Anderson
93b1b6b602 A 'res ==' changed to be correct 'res =' in one place..
libdwarf/dwarf_query.c
2016-01-14 14:22:31 -08:00
David Anderson
ba0b90f77c Now dwarfdump -m and dwarfdump -kw work meaningfully
on the DWARF5-style .debug_macro section.

dwarfdump/Makefile.in
dwarfdump/dwarfdump.c
dwarfdump/globals.h
dwarfdump/print_die.c
dwarfdump/print_macro.c

libdwarf/dwarf_macro5.c
libdwarf/libdwarf.h.in
2016-01-12 11:37:40 -08:00
David Anderson
b8a73d4614 These dwarfdump files new.
new file:   ../dwarfdump/macrocheck.c
new file:   ../dwarfdump/macrocheck.h

Renamed ChangeLog as ChangeLog2015.
new file:   ChangeLog2015
2016-01-12 11:32:22 -08:00
David Anderson
37d0ff1235 Now we allow --enabled-shared and --disable-nonshared
at the top level and all lower levels.

README
configure
configure.in
dwarfdump/Makefile.in
dwarfdump/configure
dwarfdump/configure.in
dwarfexample/configure
dwarfexample/configure.in
dwarfgen/configure
dwarfgen/configure.in
libdwarf/ChangeLog
2015-12-31 13:51:31 -08:00
David Anderson
11750a2838 A DWARF related section marked SHT_NOBITS (elf section type)
is an error in the elf object.  Now detected.
dwarf_elf_access.c
2015-12-30 13:40:25 -08:00
David Anderson
47fdf4a8b4 Fixed typo in previous commit of dwarf_loc2.c. 2015-12-29 11:02:56 -08:00
David Anderson
2b9e367e85 dwarf_loc2.c: ll_dbg was not set, two places.
dwarf_loc_head_c_dealloc() was not iterating
       through the list of locdescs.  Fixed now.
2015-12-29 11:01:48 -08:00
David Anderson
2e5e4b4d8b Fixing -m and getting good output of dwarf5 macros.
Still no handling of macro import.
dwarfdump/dwarfdump.c
dwarfdump/print_lines.c
dwarfdump/print_macro.c

Fixing handling of DWARF5 macros.
libdwarf/dwarf_line.c
libdwarf/dwarf_macro5.c
libdwarf/dwarf_macro5.h
libdwarf/dwarf_opaque.h
2015-12-20 20:08:17 -08:00
David Anderson
e68baed644 Making the macro printing more correct.
Not yet quite right or complete.
dwarfdump/ChangeLog
dwarfdump/print_macro.c
libdwarf/ChangeLog
libdwarf/dwarf_init_finish.c
libdwarf/dwarf_line.c
libdwarf/dwarf_macro5.c
libdwarf/dwarf_macro5.h
libdwarf/dwarf_opaque.h
libdwarf/dwarf_util.c
libdwarf/dwarf_util.h
2015-12-20 10:36:29 -08:00
David Anderson
ade09dd9fc Removed a pair of global variables in favor of a new global function.
dwarfdump/dwarfdump.c
dwarfdump/globals.h
dwarfdump/print_die.c
dwarfdump/print_lines.c
dwarfdump/print_macro.c
dwarfdump/print_pubnames.c
dwarfdump/print_ranges.c

libdwarf/dwarf_macro5.c Fixed _import handling. Off by one.
libdwarf/dwarf_query.c trailing whitespace removed
2015-12-18 10:09:34 -08:00
David Anderson
06cc0571a5 Small improvement in dwarfdump debug_macro printing (when no .debug_macro
section).
Improved dwarfdump PRINT_CU_INFO() so it works right and has
no side effect.
2015-12-16 08:06:29 -08:00
David Anderson
7a6a2c793f This now does nearly all of DWARF5 macro printing.
dwarfdump/print_macro.c

libdwarf/dwarf_form.c
libdwarf/dwarf_macro5.c
libdwarf/dwarf_macro5.h
libdwarf/dwarf_opaque.h
libdwarf/libdwarf.h.in
2015-12-15 12:57:33 -08:00
David Anderson
4cb9e7a304 Additional DWARF5 macro support.
dwarfdump/print_macro.c

libdwarf/dwarf_error.c
libdwarf/dwarf_macro5.c
libdwarf/dwarf_macro5.h
libdwarf/libdwarf.h.in
2015-12-13 15:26:19 -08:00
David Anderson
7eb69bc2ab Now prints CU die of the macros when 2 or more -v.
Now avoids printing .debug_macro string when there is no section.

dwarfdump/print_macro.c
dwarfdump/print_macros.c

libdwarf:
dwarf_error.c
dwarf_macro5.c
libdwarf.h.in
2015-12-12 15:50:02 -08:00
David Anderson
9c2082211e * naming.h,naming.c: Added get_MACRO_name().
* print_macro.c: Now reads and prints macro5 header.
dwarfdump/naming.c
dwarfdump/naming.h
dwarfdump/print_macro.c

     * dwarf_alloc.c: Remove () around simple return value.
     * dwarf_error.c: Two new error codes for DWARF5 macro section.
     * dwarf5_macro.c,dwarf5_macro.h: Add functions
       to let reader read/print
       .debug_macro section header.  Fixed _dwarf_macro_constructor
       declaration and implementation to return DW_DLV_OK.
     * libdwarf.h.in: Add functions to let reader read/print
       .debug_macro section header.

libdwarf/dwarf_alloc.c
libdwarf/dwarf_error.c
libdwarf/dwarf_macro5.c
libdwarf/dwarf_macro5.h
libdwarf/libdwarf.h.in
2015-12-11 14:06:01 -08:00
David Anderson
7c50dcb6e9 Merge branch 'master' into macro
Merging master support of metaware and checking of
forms into branch.
2015-12-08 17:28:33 -08:00
David Anderson
9f9545d63c New version string.
dwarfdump/common.c
dwarfdump/dwarfdump.c
Added metaware augmentation string handling.
dwarfdump/print_frames.c

Added DW_CFA_metaware and augmentation string "HC" handling.
libdwarf/dwarf.h
libdwarf/dwarf_frame.c
libdwarf/dwarf_frame.h
libdwarf/dwarf_frame2.c
libdwarf/dwarf_util.c
2015-12-08 17:24:33 -08:00
David Anderson
fcccd3a57f Merge branch 'master' into macro
Bringing the error 321 and the checks for invalid FORMs
into macro.
Conflicts:
	dwarfdump/ChangeLog
	libdwarf/ChangeLog
	libdwarf/dwarf_error.c
	libdwarf/libdwarf.h.in
Conflicts fixed.
2015-12-08 13:21:53 -08:00
David Anderson
23e0e5b74a Improved commentary.
libdwarf/ChangeLog
2015-12-08 13:11:10 -08:00
David Anderson
00d6dfd1db Add comments: when doing -f errors in accessing
DIE information result in skipping procedure names,
no error printed.
dwarfdump/print_frames.c

Fix indents and other trivia.
libdwarf/dwarf_die_deliv.c
libdwarf/dwarf_query.c
libdwarf/dwarf_util.c
libdwarf/libdwarf.h.in
2015-12-08 13:09:05 -08:00
David Anderson
c23241b3d6 Removed useless declaration.
dwarfdump/dwarfdump.c

libdwarf:
dwarf_error.c (changed error number for eventual merge with
   macro for DWARF5.
dwarf_init_finish.c (added cast on strncmp call to remove warning).
libdwarf.h.in. Changed error number.
2015-12-08 10:55:39 -08:00
David Anderson
da724a0bc5 Now check FORM codes in abbrevs for sensible values.
Error off if invalid.
dwarf_abbrev.c
dwarf_die_deliv.c
dwarf_error.c
dwarf_opaque.h
dwarf_query.c
dwarf_util.c
dwarf_util.h
libdwarf.h.in
2015-12-08 10:46:23 -08:00
David Anderson
540cf814cb spelling: sentinal -> sentinel
dwarf_macro5.c
dwarf_macro5.h
2015-12-03 12:14:25 -08:00
David Anderson
54e423c859 Merge branch 'master' into macro
Conflicts:
	libdwarf/ChangeLog

Fix botch $dwfzlib in Makefile.in
libdwarf/ChangeLog
libdwarf/Makefile.in
2015-12-02 09:19:25 -08:00
David Anderson
d7dee78123 libdwarf configure bug:
change Makefile.in $dwfzlib to $(dwfzlib) to fix.
2015-12-02 09:15:43 -08:00
David Anderson
7d6f7353f2 Remove trailing whitespace and fix a couple indents.
dwarfdump/print_frames.c
libdwarf/dwarf_alloc.c
libdwarf/dwarf_macro5.c
libdwarf/dwarf_macro5.h
libdwarf/libdwarf.h.in
2015-11-30 19:19:52 -08:00
David Anderson
e3f80a3867 First cut at reading and printing DWARF5 .debug_macro section.
dwarfdump/Makefile.in
dwarfdump/dwarfdump.c
dwarfdump/globals.h
dwarfdump/print_die.c

libdwarf/Makefile.in
libdwarf/dwarf.h
libdwarf/dwarf_alloc.c
libdwarf/dwarf_alloc.h
libdwarf/dwarf_error.c
libdwarf/dwarf_init_finish.c
libdwarf/dwarf_macro5.c
libdwarf/dwarf_macro5.h
libdwarf/libdwarf.h.in
2015-11-30 16:19:59 -08:00
David Anderson
d283d2c523 Documented the functions that were just created
in previous commit to get frame section name.
libdwarf2.1.mm
libdwarf2.1.pdf
2015-11-28 11:29:36 -08:00
David Anderson
67e30ba3ae Ensure we get true section name where it matters,
and comment the other places (where not critical).
dwarfdump/globals.h
dwarfdump/print_frames.c
dwarfdump/print_lines.c
dwarfdump/print_locs.c
dwarfdump/print_macros.c
dwarfdump/print_pubnames.c
dwarfdump/print_static_funcs.c
dwarfdump/print_static_vars.c
dwarfdump/print_types.c
dwarfdump/print_weaknames.c

Enable retrieving true section name from object file.
libdwarf/dwarf_frame.c
libdwarf/libdwarf.h.in
2015-11-28 11:08:32 -08:00
David Anderson
9bd64020d5 Mention the effec of zdebug on offsets
shown by dwarfdump.
dwarfdump/dwarfdump.1

Now we get the real section names from
libdwarf.
dwarfdump/print_aranges.c
dwarfdump/print_die.c
dwarfdump/print_lines.c
dwarfdump/print_ranges.c
dwarfdump/print_strings.c

Add functions to get the true
section names.
libdwarf/dwarf_die_deliv.c
libdwarf/dwarf_line.c
libdwarf/libdwarf.h.in

Document the new functions. Version 2.35
libdwarf/libdwarf2.1.mm

Regenerate.
libdwarf/libdwarf2.1.pdf
2015-11-27 15:44:13 -08:00
David Anderson
940b561d3a Updated dwarfdump version string.
Updated all the configure scripts to support zlib and
reading compressed .zdebug_ DWARF sections.

All works fine without zlib (though reading .zdebug sections
not possible without zlib).

A few lines of code and some internal-to-libdwarf structs
change slightly for .zedebug support.  There is  no
change to public interfaces.
2015-11-26 08:27:17 -08:00
David Anderson
7c417212c4 dwarf.h
Since .zdebug compressed dwarf is becoming
more commonly used, this is preparation for
noticing and decompressing zdebug sections
when zlib is present at build time..

dwarf_elf_access.c
dwarf_init_finish.c
dwarf_opaque.h
dwarf_tied.c
2015-11-25 12:32:56 -08:00