Commit Graph

374 Commits

Author SHA1 Message Date
David Anderson
32b5bedd0d libdwarf:
* dwarf_tied.c: Code reading tied CU headers only worked by accident
       but is fixed. Reads only  as far as needed in tied for the signature
       being referenced.
2015-11-24 12:23:40 -08:00
David Anderson
12ddfe8190 Amplfied an example and made all the
examples figures so they show up in
the figures list.

checkexamples.c
libdwarf2.1.mm
Version 2.34

regenerated
libdwarf2.1.pdf
2015-11-18 09:57:50 -08:00
David Anderson
d33912b46f With latest experimental two-level line tables.
dwarf.h
2015-11-15 10:32:20 -08:00
David Anderson
398c18eb13 Now allows build separate from source.
NEWS
README
configure
configure.in

Now allows build separate from source.
dwarfdump/ChangeLog
dwarfdump/Makefile.in
dwarfexample/Makefile.in

Now uses configure and allows
build separate from source.
dwarfexample/configure
dwarfexample/configure.in
dwarfgen/Makefile.in

Now allows build separate from source.
libdwarf/Makefile.in
libdwarf/configure
libdwarf/configure.in
2015-11-15 10:14:01 -08:00
David Anderson
6b65d5f0e0 dwarfdump
* print_abbrevs.c(dwarf_get_array_info): Initialize local variable.
     * print_die.c(get_location_list): Initialize local variable.:
     * dwarf_loc.h: Add declaration of _dwarf_loc_block_sanity_check().
     * dwarf_loc.c: Call new function  _dwarf_loc_block_sanity_check
     * dwarf_loc2.c: Implement and call new function
       _dwarf_loc_block_sanity_check to avoid duplicating code.

libdwarf
* dwarf_opaque.h: Delete two useless blank lines.
2015-11-11 15:55:20 -08:00
David Anderson
561de2eef0 libdwarf: Noted removal of undefined function from libdwarf.h.in.
Noted update of libdwarf2.1.mm
   ChangeLog
2015-11-09 10:16:06 -08:00
David Anderson
6a673beb03 removed mention of an unimplemented function.
libdwarf.h.in

Added split dwarf location list documentation.
Rebuilt the pdf. Version 2.33 Nov 8 2015
libdwarf2.1.mm
libdwarf2.1.pdf
2015-11-09 10:12:51 -08:00
David Anderson
c39727f97d libdwarf/checkexamples.c
New examples for the new expression interfaces.
2015-11-09 09:41:02 -08:00
David Anderson
5a0bb4c7bc dwarfdump
* print_die.c: Fixed indents, removed trailing whitespace.
* dwarfdump.c, common.c: Update version string.

libdwarf
 * dwarf_alloc.c: Fixed indents, trailing whitespace.
 * dwarf_loc2.c: Fixed indents, trailing whitespace.
 * dwarf_form.c: Made too-long line into 2 lines.
 * dwarf_loc.h: Removed duplicate Dwarf_Loc_c_s etc declarations.
 * dwarf_util.c(_dwarf_error_mv_s_to_t),dwarf_util.h: New
       function to eliminate duplicative code.:
 * dwarf_query.c): Fix bug in dwarf_get_offset_size().
       Use new _dwarf_error_mv_s_to_t() to get error on correct dbg.
       Fixed indents, trailing whitespace.
 * dwarf_ranges.c: Use new _dwarf_error_mv_s_to_t()
       to get error on correct dbg.
       Fixed indents, trailing whitespace.
2015-11-08 10:26:49 -08:00
David Anderson
8b2ac2b95a * dwarfdump.1: Documented -x line5=.
* dwarfdump.c: Revised -g so it no longer turns on -i.
       Revised the meaning of -g to mean use old loclist interfaces
       (for testing the older interfaces with dwarfdump).
     * print_die.c(get_small_encoding_integer_and_name): a dwarf_dealloc
       referenced err whereas *err was correct.
       Revised loclist output making it look a bit like DWARF5
       even for DWARF2,3,4 output. Reads better, I think.
     * print_locs.c: -l gets a 'no longer supported' message

dwarfdump/dwarfdump.1
dwarfdump/dwarfdump.c
dwarfdump/print_die.c
dwarfdump/print_locs.c

     * dwarf_alloc.c: Added new checks so  user mixing up
       tied dbg with regular dbg won't lead to crashes
       when calling dwarf_dealloc or dwarf_finish().
       Zeroed out some fields to recognize space deallocated.
     * dwarf_die_deliv.c: Added support of split dwarf
       DW_AT_[GNU_]ranges_base
     * dwarf_form.c: Load string from tieddbg when appropriate.
     * dwarf_harmless.c: On free() zero out a field to show that was done.
     * dwarf_loc.c: Correct the handling of split dwarf loclist.
     * dwarf_opaque.h: Add cc_ranges_base_present for split dwarf.
       Add _dwarf_get_ranges_base_attr_from_tied() for split dwarf.
     * dwarf_query.c: Get and remember skeleton compilaton unit
       DW_AT_[GNU_]ranges_base from tied objects for split dwarf.
     * dwarf_ranges.c: If a tied object present, look for ranges
       there, not in split dwarf object.
     * dwarf_util.c: Housekeeping zeros out fields to ensure not
       used after dealloc.

libdwarf/dwarf_alloc.c
libdwarf/dwarf_die_deliv.c
libdwarf/dwarf_form.c
libdwarf/dwarf_harmless.c
libdwarf/dwarf_loc.c
libdwarf/dwarf_loc2.c
libdwarf/dwarf_opaque.h
libdwarf/dwarf_original_elf_init.c
libdwarf/dwarf_query.c
libdwarf/dwarf_ranges.c
libdwarf/dwarf_util.c
2015-11-07 14:42:52 -08:00
David Anderson
aedc235499 dwarfdump/configure
dwarfdump/configure.in
dwarfdump/print_frames.c

* configure.in: Add -O0 to  --enable-wall.
       So if a coredump during debugging gdb will work really well.
* configure: Regenerated.
* print_frames.c: Ommitted a 'return' statement so
       some output duplicated. Added in the missing return.

libdwarf/configure
libdwarf/configure.in
* configure.in: Added -O0 to --enable-wall.
       So if a coredump while debugging gdb will work well.
* configure: Regenerated.
2015-11-01 09:13:33 -08:00
David Anderson
0052aa52f4 Revisions for DWARF5 expression handling complete, one thinks.
Next is testing.

   dwarfdump/Makefile.in
   dwarfdump/configure
   dwarfdump/configure.in
   dwarfdump/dwarfdump.c
   dwarfdump/globals.h
   dwarfdump/print_die.c
   dwarfdump/print_frames.c
   dwarfdump/print_frames.h
   dwarfdump/print_lines.c
   dwarfdump/print_locs.c

   libdwarf/Makefile.in
   libdwarf/dwarf_alloc.c
   libdwarf/dwarf_alloc.h
   libdwarf/dwarf_error.c
   libdwarf/dwarf_frame.c
   libdwarf/dwarf_loc.c
   libdwarf/dwarf_loc.h
   libdwarf/dwarf_loc2.c
   libdwarf/dwarf_opaque.h
   libdwarf/dwarf_query.c
   libdwarf/libdwarf.h.in
2015-11-01 08:30:30 -08:00
David Anderson
223f421cb0 Moved the libdwarf new-interface code for DWARF5
location expressions into its own file.
Compiled by a #include in dwarf_loc.c
libdwarf/dwarf_loc2.c
2015-10-28 10:11:48 -07:00
David Anderson
fb87fd24c4 Updated copyright notice.
libdwarf/dwarf_loc.h
2015-10-27 13:44:23 -07:00
David Anderson
c20ba5c31a Fixing errors from refactoring the location expression operation
reader.

Add a new configure option --enable-wall (regenerate configure).
Revise the interfaces for the not-implemented new
location expression and loclist interfaces.

dwarfdump/print_die.c

libdwarf/Makefile.in
libdwarf/configure
libdwarf/configure.in
libdwarf/dwarf_error.c
libdwarf/dwarf_loc.c
libdwarf/dwarf_loc.h
libdwarf/libdwarf.h.in
2015-10-26 16:20:31 -07:00
David Anderson
4b54aad40f libdwarf for DWARF5 loclists
examples.c: Add commentary to example9.
dwarf_alloc.c: Add DW_DLA_LOC_BLOCK_C and DW_CLA_LOCDESC_C
       allocation descriptions to array.
dwarf_alloc.h: Increase ALLOC_AREA_INDEX_TABLE_MAX to match.
dwarf_base_types.h: Increase MAX_DW_DLA to match.
dwarf_die_deliv.c: Switch some returns from pointer to
       the standard int DW_DLV_OK etc and return pointer through
       an argument.  Identify which CUs are dwo by checking name
       for a .dwo ending. Fix whitespace endings.
dwarf_error.c: Add DW_DLE 309 to 311 errors to descriptions array.
dwarf_form.c: Remove trailing whitespace. Reformat one line
       so it is not so long.
dwarf_line.c: Add {} on if for clarity.
       Fix whitespace endings.
dwarf_line_table_reader.c: Fix whitespace endings.
dwarf_loc.c: Refactor loc. expr. reader into a
       routine that reads one expression, _darf_read_loc_expr_op()..
       Add DWARF5 operators.
       Add preliminary dwo expression support (which will change
       but this is a start).  Old expression interface now
       explicitly supports only DWARF 2,3,4. No DWARF5.
       Add preliminary loclist_c support (it will change).
       Add commentary about the old loclist interface.
dwarf_loc.h: First cut of new interfaces (functional, not
       public structs).
dwarf_opaque.h: Add cc_is_dwo flag to cu context struct.
libdwarf.h.in: Rework some loclist commentary.
       Add first try at new loclist interfaces for DWARF2,3,4,5.
       New error codes for new loclist/dwo code.
libdwarf2.1.mm: Rev 2.32. New wording on old loclist
       interfaces.
2015-10-25 09:41:39 -07:00
David Anderson
ecf8ab4f52 * print_die.c: Added DW_FORM_strp_sup,
same idea as DW_FORM_GNU_strp_alt.

 * dwarf_util.c,dwarf_query.c: Added DW_FORM_strp_sup as
       same idea as DW_FORM_GNU_strp_alt.
2015-10-15 16:20:40 -07:00
David Anderson
4130f07d25 dwarfdump
* 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.
2015-10-15 09:27:28 -07:00
David Anderson
44bb9d15b1 checkexamples.c.
The libdwarf examples reformatted to
pass dicheck.
2015-10-13 16:19:27 -07:00
David Anderson
fcc17a82bf Deleted libdwarf2.1.ps. Regenerated pdf 2015-10-13 10:11:01 -07:00
David Anderson
b156d8ec5b * dwarf_line.c: Refactored so we have only one
piece of code creating file paths from line table data.
       deleted obsolete code that was #if 0.
     * libdwarf.h.in: Fleshed out linecontext
       versions of two-level table readng.
       Revised  a new interface (dwarf_srclines_b) to
       make it possible to do a read of just the line header.
     * libdwarf2.1.mm: Documented new functions.
       Fixed the example code so it is actually correct
regenerated libdwarf2.1.pdf
2015-10-13 10:09:13 -07:00
David Anderson
2a1ee2d9ac Added information on the new line context calls.
libdwarf2.1.mm
2015-10-13 09:55:12 -07:00
David Anderson
a0496b8723 libdwarf: Put the document examples into a file
and fixed and reformatted.
checkexamples.c

Here is the update examples version.
libdwarf2.1.mm
2015-10-13 08:36:32 -07:00
David Anderson
9a868ee5d9 libdw
checkexamples.c
libdwarf2.1.ps
2015-10-13 08:33:40 -07:00
David Anderson
4bd0c554aa libdwarf:: checkexamples.c
contains the examples from libdwarf2.1.mm
so we have eliminated as many mistakes
as possible from the document.
2015-10-12 16:53:59 -07:00
David Anderson
3fe4d2bb58 libdwarf
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.
2015-10-06 16:52:35 -07:00
David Anderson
fe3e40087e libdwarf/dwarf_global.h: Now the last __sgi related macro (else, endif)
have /* __sgi */.
2015-10-01 08:19:41 -07:00
David Anderson
20aa79e719 libdwarf:
dwarf_global.c,dwarf_line.c,dwarf_line.h,dwarf_line2.c,
       dwarf_line_table_reader_common.c,dwarf_sort_line.c,libdwarf.h.in:
       The SGI IRIX only fields in dwarf_line.h ifdef __sgi now.
       And all code referencing them that way too. Balancing
       #endif has /* __sgi */ now for searchability.
       Functions only usable on SGI IRIX only compiled in if __sgi
       macro defined.
libdwarf2.1.mm: Added a comment related to experimental
       two-level line tables.
2015-09-30 16:07:27 -07:00
David Anderson
f8d021008f dwarf_die_deliv.c,dwarf_line.c,dwarf_print_lines.c: Now look for
and adds the extra offset from debug_fission: DW_SECT_LINE.
2015-09-30 07:35:26 -07:00
David Anderson
b25b8835b8 Moved the prefix code into the common source.
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
2015-09-29 12:49:10 -07:00
David Anderson
bb0dce2567 Moved some code from dwarf_line_table_reader_common.c to dwarf_line.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
2015-09-29 11:26:26 -07:00
David Anderson
7e53148332 * dwarf_line_table_reader_common.c: New file is the line table reader
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.
2015-09-28 20:17:50 -07:00
David Anderson
7f6c71bc75 dwarf_line.c,dwarf_line.h,dwarf_print_lines.c: made li_ and lr_
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.
2015-09-28 11:00:07 -07:00
David Anderson
fde8f7b825 Made a small change in the appearance of a two-line-table header.
dwarf_print_lines.c
2015-09-27 09:58:42 -07:00
David Anderson
7eec6b060a Fixed memset call bug in reading prefix of line table.
Tweaked the detailed print of line table data (-l -vvv).
Fixed indent errors and removed trailing spaces.
2015-09-27 08:33:23 -07:00
David Anderson
a37ced05d4 Updated version strings.
dwarfdump/common.c
dwarfdump/dwarfdump.c

Sort of works for two-level line tables.
libdwarf/dwarf_print_lines.c
2015-09-26 09:01:55 -07:00
David Anderson
730a47a519 dwarf_print_lines.c now prints the Locals and Actuals
tables from two-level line tables.
2015-09-25 15:02:52 -07:00
David Anderson
220378fa0b dwarfdump/common.c update date string.
dwarfdump/dwarfdump.c   update date string
dwarfdump/print_lines.c IA is really IS.

libdwarf/dwarf_elf_access.c: Added ifdef/define/endif for relocation types
   for better test coverage in FreeBSD and Ubuntu. That is, let it
   relocate objects without quite the required relocation names on
   the libdwarf/dwarfdump build system.
libdwarf/dwarf_line.c Fixed errors and omissions.
libdwarf/dwarf_line.h
2015-09-24 16:39:03 -07:00
David Anderson
8857cf5fea Now supports experimental two-level line tables,
though -vvv -l (printing internal details) does not
yet work.
Some dead variables deleted and indent mistakes fixed too.
dwarfdump/common.c
dwarfdump/dwarfdump.c
dwarfdump/print_lines.c
libdwarf/dw-linetableheader.txt
libdwarf/dwarf_abbrev.c
libdwarf/dwarf_die_deliv.c
libdwarf/dwarf_form.c
libdwarf/dwarf_init_finish.c
libdwarf/dwarf_line.c
libdwarf/dwarf_loc.c
libdwarf/dwarf_macro.c
libdwarf/dwarf_query.c
libdwarf/dwarf_tied.c
libdwarf/dwarf_xu_index.c
2015-09-23 13:08:30 -07:00
David Anderson
249dac9069 Corrected indentation and a string in line table output.
dwarfdump/print_lines.c

Corrected indentation and an error introduced a couple
days ago in computing the end of the line table for a CU.

libdwarf/dwarf.h
libdwarf/dwarf_elf_access.c
libdwarf/dwarf_form.c
libdwarf/dwarf_line.c
libdwarf/dwarf_line.h
2015-09-22 13:57:48 -07:00
David Anderson
456fe6c3c8 Changed an internal function to have a leading _ in the name
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
2015-09-19 18:21:52 -07:00
David Anderson
8a2ad457fb These files are a partial implementation
(not complete) of two-level line tables,
and experiment in line table design.
dwarfdump/ChangeLog
dwarfdump/print_lines.c
libdwarf/ChangeLog
libdwarf/dwarf.h
libdwarf/dwarf_alloc.c
libdwarf/dwarf_base_types.h
libdwarf/dwarf_init_finish.c
libdwarf/dwarf_line.c
libdwarf/dwarf_line.h
libdwarf/dwarf_line2.c
libdwarf/dwarf_util.c
libdwarf/libdwarf.h.in
2015-09-17 14:53:03 -07:00
David Anderson
9ea518048a libdwarf/dwarf_form.c: Changed a comment to reflect
the DWARF5 draft.  We need not guess.
2015-09-16 13:12:50 -07:00
David Anderson
63e611e815 We were failing
check for off-end-of debug_str_offsets section correctly
and had a dwarf_dealloc where it was not wanted.
libdwarf/dwarf_form.c
libdwarf/dwarf_query.c
2015-09-16 12:52:22 -07:00
David Anderson
b907fd532d Fixed a call to dwarf_dealloc (new in the latest release)
where dwarf_dealloc could be called on a NULL pointer.
libdwarf/dwarf_query.c .

None of my test cases were able to get into the problematic
line of code (was 1 line, now 4 including a value test).
2015-09-15 18:15:47 -07:00
David Anderson
ccc36909ae libdwarf/dwarf_elf_access.c: Added conditional
R_MIPS_64  and  R_MIPS_TLS_TPREL64 defines
as the headers in a freebsd 32bit VM
do not define those and we need them for
testing a couple object files.
2015-09-15 16:01:56 -07:00
David Anderson
07bf8033af Merge branch 'carlos_enciso' into carlos15
Conflicts:
	dwarfdump/ChangeLog
	dwarfdump/common.c
	dwarfdump/print_die.c
	dwarfexample/ChangeLog
	dwarfgen/ChangeLog
	libdwarf/ChangeLog
	libdwarf/dwarf_form.c
	libdwarf/dwarf_xu_index.c
	libdwarf/dwgetopt.h
2015-09-15 09:56:07 -07:00
David Anderson
4ef592a4df A couple new routines failed to return the return code.
A couple places had C99-isms.

dwarfdump/print_die.c
libdwarf/dwarf_form.c
libdwarf/dwarf_xu_index.c
2015-09-15 09:32:06 -07:00
David Anderson
abb74550fe dwarf_form.c,dwarf_global.c,dwarf_line.c,dwarf_macro.c,dwarf_util.c:
Fixed indents and removed trailing whitespace.
2015-09-14 15:46:47 -07:00
David Anderson
33b6d9cb8b Fixed awkward line in .mm. Rev 2.30.
libdwarf2.1.mm
Regenerated libdwarf2.1.pdf
2015-09-14 11:32:57 -07:00