Commit Graph

306 Commits

Author SHA1 Message Date
David Anderson
6fa3f710ee modified: bugxml/data.txt
modified:   bugxml/readbugs.py

Fixed an incorrect length check to prevent a crash.
modified:   dwarfdump/print_frames.c

Set a macro structure field that was left unset.
No longer creates a zero-length malloc field.
modified:   libdwarf/dwarf_macro5.c
2016-05-22 08:46:35 -07:00
David Anderson
9247e66d14 Update version strings.
dwarfdump/common.c
dwarfdump/dwarfdump.c
2016-05-19 13:52:03 -07:00
David Anderson
8f0690dae1 Improve the output with respect to things tested.
More like other configure setups.
dwarfdump/configure.in

Regenerate.
dwarfdump/configure

Fix spelling mistakes, and an erroneous . in column 1.
dwarfdump/dwarfdump.1

CFLAGS is no on HOST_CFLAGS.
libdwarf/Makefile.in

Improve the output with respect to things tested.
More like other configure setups.
libdwarf/configure.in

Regenerate.
libdwarf/configure
2016-05-19 13:47:52 -07:00
David Anderson
ac6673e32f dwarfdump
* print_die.c: Fix typo in error message.
* print_frames.c: Do additional checks for incorrect data
  when printing frame instructions to avoid dwarfdump crash..

libdwarf
    * dwarf_form.c: Directly check expression length against
      section length in case expression length very very large.
    * dwarf_query.c: _dwarf_calculate_info_section_*() routines
      made clearer and the *_start_ptr() instance also now returns
      the length (via a pointer arg).
    * dwarf_xu_index.c: Check data read from the section so
      a wildly large columns count or slots count will be caught
      and an error returned.
2016-05-18 18:50:58 -07:00
David Anderson
63633bc14a All currently known vulnerabilities fixed.
bugxml/data.txt

Fix indents, remove trailing whitespace.
   dwarfdump/print_abbrevs.c
   dwarfdump/print_aranges.c
   dwarfdump/print_frames.c
   dwarfdump/print_sections.c

Ensure we check dwarf functtion status return.
These sources used only at build time.
   dwarfdump/tag_attr.c
   dwarfdump/tag_tree.c
2016-05-12 10:50:44 -07:00
David Anderson
82d8e00785 bugxml/data.txt
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
2016-05-12 07:39:36 -07:00
David Anderson
b74cf7a901 spell noticed a couple misspellings. Fixed.
modified:   dwarfdump/NEWS
2016-05-07 14:58:33 -07:00
David Anderson
3af6d465a9 Small tweaks of the new wording.
dwarfdump/NEWS
2016-05-07 14:56:46 -07:00
David Anderson
b3c1706d48 Update version strings.
dwarfdump/common.c
dwarfdump/dwarfdump.c

Inserted local variable initialization-at-definition.
dwarfdump/print_frames.c

Notice frame data corruption and generate an error.
libdwarf/dwarf_errmsg_list.c
libdwarf/dwarf_frame.c
libdwarf/dwarf_frame.h
libdwarf/dwarf_frame2.c
libdwarf/dwarf_line.c
libdwarf/libdwarf.h.in
2016-05-07 13:50:17 -07:00
David Anderson
73aa80bb84 Avoiding compiler warnings. No change in functionality.
dwarfdump/sanitized.c
2016-05-06 09:00:57 -07:00
David Anderson
eb1472afac New bugr reports.
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
2016-05-06 08:26:36 -07:00
David Anderson
98a3da1e82 Improve some error checks. Fix line printing for
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
2016-05-04 06:45:00 -07:00
David Anderson
ae65ad36b0 update version string
dwarfdump/common.c
dwarfdump/dwarfdump.c
2016-04-30 13:04:41 -07:00
David Anderson
f01360225d Update version string.
dwarfdump/common.c
dwarfdump/dwarfdump.c

Add a new test that chatches an object
file with bad DWARF (corrupted DWARF).
libdwarf/dwarf_frame2.c
2016-04-27 18:25:41 -07:00
David Anderson
76b6fb5846 Remove duplicative print of error number.
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
2016-04-27 13:00:06 -07:00
David Anderson
7b73565d3c Fix a couple indent mistakes.
dwarfdump:
dwarfdump.c
esb.c
2016-04-25 14:34:56 -07:00
David Anderson
08efeebcf3 Remove the unneccessary typedef for 'string'
and just use char*.

Ensure the getopt tests still work.

modified:   dwarfdump/dwarfdump.c
modified:   dwarfdump/dwgetopt.c
modified:   dwarfdump/esb.c
modified:   dwarfdump/esb.h
modified:   dwarfdump/getopttest.c
modified:   dwarfdump/globals.h
modified:   dwarfdump/print_die.c
modified:   dwarfdump/print_frames.c
modified:   dwarfdump/print_lines.c
modified:   dwarfdump/print_strings.c
modified:   dwarfdump/tag_attr.c
modified:   dwarfdump/tag_tree.c

Fixing errnumber->string array and arranging
that we test it during build.

modified:   libdwarf/Makefile.in
renamed:    libdwarf/dwarf_error.c -> libdwarf/dwarf_errmsg_list.c
modified:   libdwarf/dwarf_error.c
2016-04-25 13:01:30 -07:00
Carlos Alberto Enciso
78003aa6c7 Printing using the 'esb' module was broken. It seems to work
because the default internal buffer size (240), was big enough
    to receive the resulting output.

    esb.c, esb.h:
        * Missing prefix 'esb' for 'allocate_more'
        * Initial buffer size reduced to 16.
        * New function 'esb_open_null_device': open 'null' device
        * New function 'esb_close_null_device': close 'null' device
        * New function 'esb_allocate_more_if_needed': allocate more
          space if required, leaving the contents unchanged, so the
          caller, does not need to worry about it.
          There are 2 cases:
          Windows: use the 'null' device to get the required space
          UNIX: use a big buffer (512). But if the result is bigger,
          the original problem will be shown.
        * The function 'esb_append_printf_ap', now takes care of
          increasing the buffer if needed.

     dwarfdump.c: In the case of windows, open and close the 'null'
         device, in order to setup the esb module.
2016-04-21 13:44:38 +01:00
Carlos Alberto Enciso
ab7dbdbcc9 * For a C/C++ build, do not define 'string' as it clashes with the
std::string definition.
    * Minor type in 'traverse_one_die' function.
2016-04-21 10:01:11 +01:00
Carlos Alberto Enciso
7ea30ef8ac Update the log file for previous change (32/64 configuration). 2016-04-21 09:53:26 +01:00
Carlos Alberto Enciso
57d0dafab6 For a WINDOWS version, display the 32/64 bits configuration. 2016-04-21 09:50:54 +01:00
Carlos Alberto Enciso
720e94b7db Use the _WIN32 macro to identify a WINDOWS specific code.
The macro is automatically defined by the VS C/C++ compiler.
2016-04-21 09:47:04 +01:00
Carlos Alberto Enciso
fd6357e0ed Merge branch 'master' into carlos_enciso
# By David Anderson
# Via David Anderson
* master:
  dwarfexample/ChangeLog said 2011 but it is really just 2016 changes. Fixed.
  Fixed a stray Dwarf_Unsigned to be Dwarf_Off in dwarfdump/print_die.c:  dieprint_cu_goffset is the variable.
2016-03-22 08:10:53 +00:00
David Anderson
a39e4bd5a7 Fixed a stray Dwarf_Unsigned to be Dwarf_Off
in dwarfdump/print_die.c:  dieprint_cu_goffset is the variable.
2016-03-17 08:02:12 -07:00
Carlos Alberto Enciso
2edcdc67a4 Minor cosmetic changes. No code changes.
Update release date
dwarfdump/common.c

Incorrect change year
dwarfexample/ChangeLog
2016-03-15 13:41:57 +00:00
David Anderson
0a5438abb4 Improved reporting of abbreviations
dwarfdump/print_abbrevs.c
dwarfdump/print_die.c

libdwarf/dwarf_abbrev.c
libdwarf/dwarf_abbrev.h
libdwarf/dwarf_die_deliv.c
libdwarf/dwarf_die_deliv.h
libdwarf/dwarf_query.c
libdwarf/dwarf_util.c
libdwarf/libdwarf.h.in
libdwarf/libdwarf2.1.mm
libdwarf/libdwarf2.1.pdf
2016-03-12 17:07:20 -08:00
David Anderson
86a5812582 dwarfdump/dwarfdump.c
dwarfdump/globals.h
dwarfdump/print_aranges.c
dwarfdump/print_die.c
dwarfdump/print_frames.c
dwarfdump/print_lines.c
dwarfdump/print_macro.c
dwarfdump/print_pubnames.c
      print_lines.c,print_macro.c,print_pubnames.c:
      Remove the global dieprint_cu_offset, use local vars and pass around instead.
      Ensure the traverse() logic when checking type references do not evaluate
      references to other sections. Many argument lists got an additional argument or two.

libdwarf/dwarf_form.c
fix a comment
2016-03-09 08:42:50 -08:00
David Anderson
ce158c52c5 dwarfdump:
* dwarfdump.c: Update version string. Added CU_low_address so
      CU_base_address is properly used only for the DWARF
      CU 'base address' notion. Print CU_low_address in PRINT_CU_INFO().
* common.c: Update version string
* globals.h: New macro DROP_ERROR_INSTANCE(d,r,e) improves consistency
      where we need to drop a Dwarf_Error instance.
* print_die.c: Support for CU_low_address. Use DROP_ERROR_INSTANCE
      where appropriate.
* print_frames.c: Use DROP_ERROR_INSTANCE
      where appropriate.
2016-03-07 16:41:11 -08:00
David Anderson
45573a89f5 libdwarf: document dwarf_dietype() and the new
function dwarf_offset_list()
checkexamples.c
libdwarf2.1.mm
libdwarf2.1.pdf
2016-03-07 11:33:19 -08:00
Carlos Alberto Enciso
2464b8ac1d * dwarfdump.c:
Missing '_' just for consistency.
    Print any harmless errors only the required in command line

* globals.h:
    Unused declaration.

* print_die.c:
    When displaying a DW_AT_type offset error, uses the standard
    0xdddddddd format.
    Wrap to 80 columns, a long line.
2016-03-03 09:46:02 +00:00
Carlos Alberto Enciso
e85fa29085 Merge branch 'master' into carlos_enciso
* master:
  Tighten up the checking-tree array sizes and add comments about setting those sizes. dwarfdump/tag_attr_ext.list dwarfdump/tag_common.h dwarfdump/tag_tree_ext.list
  Update version strings. Add some already known GNU extension tags to the lists.

Conflicts:
	dwarfdump/common.c
2016-02-18 07:51:26 +00:00
David Anderson
859ed5ce9a Tighten up the checking-tree array sizes and
add comments about setting those sizes.
dwarfdump/tag_attr_ext.list
dwarfdump/tag_common.h
dwarfdump/tag_tree_ext.list

Changes aid in testing.
No change in the tsearch code itself.
tsearch/config.h
tsearch/dwarf_tsearch.c
tsearch/dwarf_tsearch.h
2016-02-17 08:44:47 -08:00
David Anderson
d5ea5660b8 Update version strings. Add some already known
GNU extension tags to the lists.
2016-02-16 16:51:24 -08:00
Carlos Alberto Enciso
a3abd8ea86 * tag_attr_ext.list, tag_tree_ext.list: Some notes explaining
how to update the values for the limits in the tables used
    during the semantic check.

* tag_common.h: Update the semantic tables sizes; it was checking
    a lot of empty entries.

* tag_tree_ext.list: Added valid TAGs for the GNU extensions:
    DW_TAG_GNU_template_parameter_pack,
    DW_TAG_GNU_formal_parameter_pack
2016-02-16 12:38:00 +00:00
Carlos Alberto Enciso
40064bc7b7 * common.c: SN version uses an extra ID version
* tag_tree_ext.list, tag_attr_ext.list: Include support for variadic
    templates (GCC extension) DW_TAG_GNU_template_parameter_pack,
    DW_TAG_GNU_formal_parameter_pack. These extensions are
    generated by LLVM

* tag_tree.c: Incorrect generated comment

* tag_common.h: Update table size for new added tag/attr checks
2016-02-15 15:11:15 +00:00
David Anderson
5654c549d1 Changed a couple [] to [ ]
as apparently cross-compiling fails with []

dwarfdump/configure.in
dwarfdump/configure Regenerated
libdwarf/configure.in
libdwarf/configure Regenerated
2016-02-14 08:28:44 -08:00
David Anderson
3f7aba30b8 dwarfdump.c,globals.h,print_aranges.c,print_die.c,
print_frames.c,print_lines.c,print_locs.c,print_macro.c,
      print_pubnames.c,print_reloc.ckprint_static_funcs.c,
      print_static_vars.c,print_strings.c,print_types.c,
      print_weaknames.c: Removed global Dwarf_Error err
      and provided local Dwarf_Error as needed.

libdwarf2.1.mm: Added dwarf_lineoff_b() documentation.
Fixed a typo in dwarf_formexprloc() documentation.
libdwarf2.1.pdf: Regenerated. Version 2.41
2016-02-13 12:53:11 -08:00
David Anderson
4e8d8c0f10 Add local Dwarf_Error and
rename variables to avoid shadowing confusion.

dwarfdump/configure
dwarfdump/configure.in
dwarfdump/dwarf_tsearchbal.c
dwarfdump/dwarfdump.c
dwarfdump/globals.h
dwarfdump/print_abbrevs.c
dwarfdump/print_aranges.c
dwarfdump/print_debugfission.c
dwarfdump/print_die.c
dwarfdump/print_frames.c
dwarfdump/print_gdbindex.c
dwarfdump/print_lines.c
dwarfdump/print_pubnames.c
dwarfdump/print_ranges.c
dwarfdump/print_sections.c
dwarfdump/tag_attr.c
dwarfdump/tag_tree.c

Add local Dwarf_Error and
rename variables to avoid shadowing confusion.
Make cross-build a littl easier.

libdwarf/Makefile.in
libdwarf/README
libdwarf/common.c
libdwarf/common.h
libdwarf/configure
libdwarf/configure.in
libdwarf/dwarf_die_deliv.c
libdwarf/dwarf_frame2.c
libdwarf/dwarf_line.c
libdwarf/dwarf_line_table_reader_common.c
libdwarf/dwarf_macro5.c
libdwarf/dwarf_print_lines.c
libdwarf/dwarf_ranges.c
libdwarf/gennames.c
2016-02-13 08:37:24 -08:00
David Anderson
3eb0df65d8 Renamed an enum value from 'std' to singledw5 to
better reflect the meaning and avoid 'std'
as 'std' seems to be a keyword
in at least one environment.
dwarfdump/dwarfdump.c
dwarfdump/globals.h
dwarfdump/print_lines.c
2016-02-10 15:15:09 -08:00
David Anderson
c446254e5e Add support for SHF_COMPRESSED
libdwarf/README
libdwarf/dwarf_elf_access.c
libdwarf/dwarf_error.c
libdwarf/dwarf_init_finish.c
libdwarf/dwarf_opaque.h
libdwarf/libdwarf.h.in
libdwarf/libdwarfdefs.h
2016-02-10 09:05:27 -08:00
David Anderson
20f65ca324 A single argument was missing its UNUSEDARG.
dwarfdump/dwarf_tsearchbal.c
tsearch/dwarf_tsearchbal.c
2016-02-07 13:42:44 -08:00
David Anderson
33dd0d8f3c update version string
dwarfdump/common.c
dwarfdump/dwarfdump.c

Document https://github.com/jrfonseca/drmingw/tree/master/src/mgwhelp
and include a little help for mingw users.
libdwarf/README
libdwarf/dwarf_init_finish.c
2016-02-07 06:36:42 -08:00
David Anderson
e0bf1f30f7 Update version strings.
dwarfdump/common.c
dwarfdump/dwarfdump.c
2016-02-06 14:42:44 -08:00
David Anderson
4945a195c3 Removed trailing whitespace.
dwarfdump/print_die.c
dwarfdump/tag_attr.c
dwarfdump/tag_tree.c

libdwarf/dwarf_elf_access.c
libdwarf/dwarf_original_elf_init.c
libdwarf/dwarf_tsearchhash.c
libdwarf/libdwarfdefs.h
2016-02-06 14:38:13 -08:00
David Anderson
d76395da7d Merge branch 'unattr'
Conflicts:
	libdwarf/ChangeLog
2016-02-06 14:28:35 -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
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
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