Commit Graph

610 Commits

Author SHA1 Message Date
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
a7f5fc2b92 Now DWARF2,3,4 macro style printed per-CU
And new checks for wasted space made.
dwarfdump/dwarfdump.c
dwarfdump/globals.h
dwarfdump/macrocheck.c
dwarfdump/macrocheck.h
dwarfdump/print_die.c
dwarfdump/print_macros.c
2016-02-03 11:22:38 -08:00
Carlos Alberto Enciso
af2504cf18 Merge branch 'master' into carlos_enciso
# By David Anderson
# Via David Anderson
* master:
  Update version string dwarfdump/common.c dwarfdump/dwarfdump.c
  Added a proper tsearch find for the dieoffset that will reveal signedness (which we found earier).
  Update version string dwarfdump/common.c dwarfdump/dwarfdump.c
  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.
2016-01-29 10:08:19 +00:00
David Anderson
9b1afa29c5 Update version string
dwarfdump/common.c
dwarfdump/dwarfdump.c

Now uses GOFF= almost uniformly in showning the cu-global
offset of DIEs. Reducing the size of some dwarfdump output
as a result.
dwarfdump/print_die.c
2016-01-28 20:43:05 -08:00
David Anderson
e485c54382 Added a proper tsearch find for the dieoffset that will
reveal signedness (which we found earier).

:   dwarfdump/print_die.c
2016-01-27 13:30:53 -08:00
David Anderson
ead51f90ea Update version string
dwarfdump/common.c
dwarfdump/dwarfdump.c
2016-01-26 17:48:25 -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
Carlos Alberto Enciso
4d96a5bca4 Merge branch 'master' into carlos_enciso
* master:
  Add additional flags to the --enable-wall option. dwarfdump/configure.in libdwarf/configure.in
  These small changes fix compiler warnings. tsearch/dwarf_tsearchbal.c tsearch/dwarf_tsearchhash.c
  Had a horrible   */* see dwarf_get_macro_context_by_offset()
  ChangeLog (fixed the year. This is 2016)
  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
  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

Conflicts:
	dwarfdump/ChangeLog
	dwarfdump/configure
	dwarfdump/configure.in
	dwarfdump/macrocheck.c
	libdwarf/ChangeLog
	libdwarf/configure
	libdwarf/configure.in
2016-01-22 14:52:01 +00: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
083a2bfa1e These small changes fix compiler warnings.
tsearch/dwarf_tsearchbal.c
tsearch/dwarf_tsearchhash.c
2016-01-21 15:42:19 -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
Carlos Alberto Enciso
042892150d Merge branch 'master' into 'carlos_enciso' 2016-01-21 10:18:22 +00:00
David Anderson
9d9e843d79 ChangeLog (fixed the year. This is 2016)
* macrocheck.c: Remove trailing whitespace.
* print_lines.c: Only print line context record
       if we do_print_dwarf is non-zero. The directory index
       was printing as 0 in the line_context record. Was a typo
       in the printf, now fixed.
2016-01-20 14:35:34 -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
Carlos Alberto Enciso
052e1003d4 Merge branch 'master' into carlos_enciso
# By David Anderson
# Via David Anderson
* master:
  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
  Fix indentation and remove trailing whitespace. dwarfdump/ChangeLog dwarfdump/print_frames.c libdwarf/ChangeLog libdwarf/dwarf_form.c libdwarf/dwarf_frame2.c
  Some statements had trailing ;; Removed second semicolon. dwarfdump/print_die.c dwarfdump/tag_tree.c
  * 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().

Conflicts:
	dwarfdump/esb.c
	dwarfdump/esb.h
	dwarfdump/globals.h
	dwarfdump/naming.h
	dwarfdump/print_frames.c
	dwarfdump/print_lines.c
	libdwarf/dwarf_form.c
	libdwarf/dwarf_loc.c
	libdwarf/dwarf_macro5.c
	libdwarf/dwarf_query.c
	libdwarf/dwarf_util.c
2016-01-20 09:15:24 +00: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
Carlos Alberto Enciso
88d7dc4b95 Changes required for the Windows version, after the upgrade to 2016.01.15
* Some C99-isms
* In the function 'esb_append', do nothing in the case of an empty string
* Include the C++ guard in esb.h, globals.h, naming.h
* The MSVC Compiler (2010) generates an error when the ';;' is found
  after some declarations
* The MSVC Compiler (2010) generates an error when adding a 'void *'
* The 'errno' has already an incompatible definition

* The Windows build, uses the tsearch algorithm as a library; the selected
  algorithm is controlled by a definition in the config.h. Also, instead
  of including a specific tsearchXX.c, it includes a generic tsearch.c

* Created a generic function 'dwarf_die_text()' to get the attribute
  value, when its value represents a string, such as DW_AT_name, etc
* For backwards compatibility, 'dwarf_diename()' calls 'dwarf_die_text()'
2016-01-19 16:00:23 +00: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.
20160116
2016-01-15 08:05:00 -08:00
David Anderson
da57eb3c92 Fixed trailing whitespace
and improved checking of abbreviations.

dwarfdump:
common.c
dwarf_tsearchbal.c
dwarfdump.c
macrocheck.c
macrocheck.h
print_abbrevs.c
print_die.c
2016-01-14 14:54:30 -08:00
David Anderson
02e5c1d201 Accidentally lost a pair of casts to unsigned long.
Restored these (which were for debugging, not normal use).
modified:   dwarf_tsearchbal.c
2016-01-14 14:44:04 -08:00
David Anderson
59405849da Fixed date.
ChangeLog
2016-01-14 14:35:51 -08:00
David Anderson
857d942699 New version of ChangeLog for 2016. 2016-01-14 14:35:05 -08:00
David Anderson
695767feab renamed: ChangeLog -> ChangeLog2015
Added a comment.
modified:   dwarf_tsearchbal.c

Fixed some compile warnings.
modified:   tsearch_tester.c
2016-01-14 14:33:52 -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
6f09d84ae6 Was missing return *this a bunch of places.
dwarfgen/irepform.h
2016-01-14 14:19:26 -08:00
David Anderson
7f5065f3b1 Last year ChangeLog is now ChangeLog2015 2016-01-14 14:17:37 -08:00
David Anderson
a05f5e2ae6 Avoid a bad write-to-memory with a better
allocation strategy for abbrev_array. The bad abbrev will
be detected, just not right here in dwarfdump
unless doing checking.
print_abbrevs.c

Fix so we know the correct current_section_id
even after printing macros or lines.
print_die.c
2016-01-12 14:39:43 -08:00
David Anderson
ecb75b7a03 Updating version strings.
dwarfdump/common.c
dwarfdump/dwarfdump.c
2016-01-12 11:55:26 -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
1600b74ab6 last year changelog now named 2015.
ChangeLog2015
2016-01-12 11:21:59 -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
cbf09cf2b7 Deleted leading blank line so now
the bin/sh line is the first line.
BLDTESTDIR
SMBLDLIBDWARF
2015-12-31 11:24:52 -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
9f20a2ea09 Ensure the four
error-reporting globals DIE_[CU_][global_]_offset are
set properly.
dwarfdump/print_aranges.c
dwarfdump/print_die.c
2015-12-16 09:26:38 -08:00