Jan Kratochvil [Wed, 10 Oct 2012 17:32:05 +0000 (19:32 +0200)]
backends/
* Makefile.am (s390_SRCS): Add s390_corenote.c and s390x_corenote.c.
* linux-core-note.c (ALIGN_PR_REG): New definitions.
(struct EBLHOOK(prstatus)): Change field pr_reg to anonymous union with
ALIGN_PR_REG.
(EXTRA_ITEMS): New macro.
* s390_corenote.c: New file.
* s390_init.c (s390x_core_note): New declaration.
(s390_init): Install s390x_core_note and s390_core_note.
* s390x_corenote.c: New file.
src/
* readelf.c (handle_core_items): Limit special repeated items handling
to single-item formats '\n', 'b' and 'B', assert OFFSET 0 there.
tests/
* run-readelf-mixed-corenote.sh: New testcase for readelf -n of s390
and s390x core notes.
* testfile67.bz2: New file.
* testfile68.bz2: New file.
* Makefile.am (EXTRA_DIST): Add testfile67.bz2 and testfile68.bz2 .
Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
Jan Kratochvil [Wed, 10 Oct 2012 07:48:10 +0000 (09:48 +0200)]
backends/
* Makefile.am (INCLUDES): Add libdwfl.
(ppc64_SRCS): Add ppc64_get_func_pc.c.
* ppc64_get_func_pc.c: New file.
* ppc64_init.c (ppc64_init): Install get_func_pc and destr.
libdwfl/
* dwfl_module_addrsym.c (dwfl_module_addrsym) (get_section): New
function from ...
(dwfl_module_addrsym) (same_section): ... here. Call it.
(dwfl_module_addrsym) (found_sym): New function from ...
(dwfl_module_addrsym) (search_table): ... here. Call it. Try second
time with ebl_get_func_pc.
libebl/
* Makefile.am (gen_SOURCES): Add eblgetfuncpc.c.
* ebl-hooks.h (get_func_pc): New entry.
* eblgetfuncpc.c: New file.
* libebl.h (struct Dwfl_Module): New declaration.
(ebl_get_func_pc): New declaration.
* libeblP.h (struct ebl): New field backend.
tests/
* run-addrname-test.sh: New testcase for ppc64 function descriptors.
* testfile66.bz2: New file.
* Makefile.am (EXTRA_DIST): Add testfile66.bz2.
Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
Jan Kratochvil [Wed, 17 Oct 2012 22:11:30 +0000 (00:11 +0200)]
libdwfl/
* argp-std.c (offline_find_elf): New function.
(offline_callbacks): Use it for FIND_ELF.
(struct parse_opt): New.
(parse_opt): New KEY ARGP_KEY_INIT. In other make HOOK struct
parse_opt pointer from former Dwfl pointer. Delay 'e and OPT_COREFILE
processing till ARGP_KEY_SUCCESS. Initialize state->INPUT already from
ARGP_KEY_SUCCESS. Modify the cleanup in ARGP_KEY_ERROR. Make the final state->INPUT initialization optional.
* libdwfl.h (dwfl_standard_argp): Extend the comment for USERDATA.
tests/
* run-addrname-test.sh: New test for PIE relocation.
* testfile70.core.bz2: New file.
* testfile70.exec.bz2: New file.
* Makefile.am (EXTRA_DIST): Add testfile70.core.bz2 and
testfile70.exec.bz2 .
Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
Jan Kratochvil [Wed, 17 Oct 2012 22:11:30 +0000 (00:11 +0200)]
libdwfl/
2012-10-17 Jan Kratochvil <jan.kratochvil@redhat.com>
* argp-std.c (offline_find_elf): New function.
(offline_callbacks): Use it for FIND_ELF.
(struct parse_opt): New.
(parse_opt): New KEY ARGP_KEY_INIT. In other make HOOK struct
parse_opt pointer from former Dwfl pointer. Delay 'e and OPT_COREFILE
processing till ARGP_KEY_SUCCESS. Initialize state->INPUT already from
ARGP_KEY_SUCCESS. Modify the cleanup in ARGP_KEY_ERROR. Make the final state->INPUT initialization optional.
* libdwfl.h (dwfl_standard_argp): Extend the comment for USERDATA.
tests/
2012-10-17 Jan Kratochvil <jan.kratochvil@redhat.com>
* run-addrname-test.sh: New test for PIE relocation.
* testfile70.core.bz2: New file.
* testfile70.exec.bz2: New file.
Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
Jan Kratochvil [Wed, 10 Oct 2012 17:32:05 +0000 (19:32 +0200)]
backends/
2012-10-14 Jan Kratochvil <jan.kratochvil@redhat.com>
Roland McGrath <roland@hack.frob.com>
* Makefile.am (s390_SRCS): Add s390_corenote.c and s390x_corenote.c.
* linux-core-note.c (ALIGN_PR_REG): New definitions.
(struct EBLHOOK(prstatus)): Change field pr_reg to anonymous union with
ALIGN_PR_REG.
(EXTRA_ITEMS): New macro.
* s390_corenote.c: New file.
* s390_init.c (s390x_core_note): New declaration.
(s390_init): Install s390x_core_note and s390_core_note.
* s390x_corenote.c: New file.
src/
2012-10-14 Jan Kratochvil <jan.kratochvil@redhat.com>
* readelf.c (handle_core_items): Limit special repeated items handling
to single-item formats '\n', 'b' and 'B', assert OFFSET 0 there.
tests/
2012-10-14 Jan Kratochvil <jan.kratochvil@redhat.com>
* run-readelf-mixed-corenote.sh: New testcase for readelf -n of s390
and s390x core notes.
* testfile67.bz2: New file.
* testfile68.bz2: New file.
Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
Jan Kratochvil [Wed, 10 Oct 2012 20:27:58 +0000 (22:27 +0200)]
src/
2012-10-12 Jan Kratochvil <jan.kratochvil@redhat.com>
* readelf.c (ITEM_WRAP_COLUMN, REGISTER_WRAP_COLUMN): Merge to ...
(WRAP_COLUMN): ... here.
(print_core_item): Remove parameter format_max. Update function
comment. Replace FORMAT_MAX by the real output width.
(handle_core_item): Remove the FORMAT_MAX values in TYPES, DO_TYPE,
calls of print_core_item, remove variable maxfmt, change
ITEM_WRAP_COLUMN to WRAP_COLUMN.
(handle_core_register): Remove the FORMAT_MAX values in TYPES, BITS,
calls of print_core_item, change REGISTER_WRAP_COLUMN to WRAP_COLUMN.
backends/
2012-10-12 Jan Kratochvil <jan.kratochvil@redhat.com>
* linux-core-note.c (prstatus_items): Rename groups of sigpend and
sighold to signal2 and signal3.
Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
Jan Kratochvil [Wed, 10 Oct 2012 17:32:05 +0000 (19:32 +0200)]
backends/
2012-10-12 Jan Kratochvil <jan.kratochvil@redhat.com>
Roland McGrath <roland@hack.frob.com>
* Makefile.am (s390_SRCS): Add s390_corenote.c and s390x_corenote.c.
* linux-core-note.c (PR_REG_TYPE, ALIGN_PR_REG_TYPE, PR_FPVALID_TYPE)
(ALIGN_PR_FPVALID_TYPE): New definitions.
(struct EBLHOOK(prstatus)): Change field pr_reg to type PR_REG_TYPE and
field pr_fpvalid to type PR_FPVALID_TYPE.
(EXTRA_ITEMS): New macro.
* s390_corenote.c: New file.
* s390_init.c (s390x_core_note): New declaration.
(s390_init): Install s390x_core_note and s390_core_note.
* s390x_corenote.c: New file.
src/
2012-10-12 Jan Kratochvil <jan.kratochvil@redhat.com>
* readelf.c (handle_core_items): New variable wrap, choose
REGISTER_WRAP_COLUMN for "register" group. Use it instead of
ITEM_WRAP_COLUMN. Limit special repeated items handling to
OFFSET 0 and formats '\n', 'b' and 'B'. Initialize COLNO to MAX of
also REGISTER_WRAP_COLUMN.
tests/
2012-10-12 Jan Kratochvil <jan.kratochvil@redhat.com>
* run-readelf-mixed-corenote.sh: New testcase for readelf -n of s390
and s390x core notes.
* testfile67.bz2: New file.
* testfile68.bz2: New file.
Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
Jan Kratochvil [Wed, 10 Oct 2012 20:27:58 +0000 (22:27 +0200)]
src/
2012-10-12 Jan Kratochvil <jan.kratochvil@redhat.com>
* readelf.c (ITEM_WRAP_COLUMN, REGISTER_WRAP_COLUMN): Merge to ...
(WRAP_COLUMN): ... here.
(print_core_item): Remove parameter format_max. Update function
comment. Replace FORMAT_MAX by the real output width.
(handle_core_item): Remove the FORMAT_MAX values in TYPES, DO_TYPE,
calls of print_core_item, remove variable maxfmt, change
ITEM_WRAP_COLUMN to WRAP_COLUMN.
(handle_core_register): Remove the FORMAT_MAX values in TYPES, BITS,
calls of print_core_item, change REGISTER_WRAP_COLUMN to WRAP_COLUMN.
backends/
2012-10-12 Jan Kratochvil <jan.kratochvil@redhat.com>
* linux-core-note.c (prstatus_items): Rename groups of sigpend and
sighold to signal2 and signal3.
Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
Adam Markey [Tue, 9 Oct 2012 09:05:53 +0000 (11:05 +0200)]
Handle partial read or write.
Ran into a situation where pread was returning less data than requested for
remote files on a networked filesystem. This patch modifies the IO wrappers
to request the remaining data as long as no real errors occured.
Signed-off-by: Adam Markey <adam@etinternational.com> Signed-off-by: Mark Wielaard <mjw@redhat.com>
Jan Kratochvil [Wed, 10 Oct 2012 07:48:10 +0000 (09:48 +0200)]
backends/
2012-10-09 Jan Kratochvil <jan.kratochvil@redhat.com>
* Makefile.am (INCLUDES): Add libdwfl.
(ppc64_SRCS): Add ppc64_get_func_pc.c.
* ppc64_get_func_pc.c: New file.
* ppc64_init.c (ppc64_init): Install get_func_pc and destr.
libdwfl/
2012-10-09 Jan Kratochvil <jan.kratochvil@redhat.com>
* dwfl_module_addrsym.c (dwfl_module_addrsym) (get_section): New
function from ...
(dwfl_module_addrsym) (same_section): ... here. Call it.
(dwfl_module_addrsym) (found_sym): New function from ...
(dwfl_module_addrsym) (search_table): ... here. Call it. Try second
time with ebl_get_func_pc.
libebl/
2012-10-09 Jan Kratochvil <jan.kratochvil@redhat.com>
* Makefile.am (gen_SOURCES): Add eblgetfuncpc.c.
* ebl-hooks.h (get_func_pc): New entry.
* eblgetfuncpc.c: New file.
* libebl.h (struct Dwfl_Module): New declaration.
(ebl_get_func_pc): New declaration.
* libeblP.h (struct ebl): New field backend.
tests/
2012-10-09 Jan Kratochvil <jan.kratochvil@redhat.com>
* run-addrname-test.sh: New testcase for ppc64 function descriptors.
* testfile66.bz2: New file.
Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
Jan Kratochvil [Mon, 8 Oct 2012 21:34:35 +0000 (23:34 +0200)]
libdw/
fde.c (__libdw_find_fde): Change <fde != NULL> to likely. Return
DWARF_E_NO_MATCH if .eh_frame_hdr points to FDE which is too short for searched
PC.
Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
Jan Kratochvil [Mon, 8 Oct 2012 21:08:01 +0000 (23:08 +0200)]
dwarf_getlocation.c (__libdw_intern_expression) <cfap>: Make new loclist
element DW_OP_call_frame_cfa before decoding the opcodes. Remove the later
DW_OP_call_frame_cfa push to RESULT.
Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
Petr Machata [Mon, 24 Sep 2012 14:46:52 +0000 (16:46 +0200)]
Test elfutils output of a mixed core note.
This is a test for previous commit. The core file was snipped so that only
headers and note contents are left. NT_ARM_VFP is the note that exercises
the code.
Petr Machata [Wed, 19 Sep 2012 14:52:07 +0000 (16:52 +0200)]
In mixed core notes, don't let handle_core_item repeat.
If a core note contains both registers and items, descsz is 0 to express
that we don't wish to repeat the items. If there is only one item in
such note, a special block of code hits that passes &size to
handle_core_item, which will decrease that size by the amount consumed by
the item. But because size is 0, it underflows and wraps, and the loop
following this block, which handles the common case, overruns the core
note buffer.
Mark Wielaard [Fri, 24 Aug 2012 11:54:52 +0000 (13:54 +0200)]
Don't include dwz support by default.
By default the dwz multi file support is not included. This means any
DW_FORM_GNU_ref_alt or DW_FORM_GNU_strp_alt encountered in libdw will
just produce an error message. A new configure option --enable-dwz is
needed to include it for those we wish to test it. The dwz test is also
disabled by default.
Mark Wielaard [Thu, 16 Aug 2012 22:35:03 +0000 (00:35 +0200)]
Rewrite DWARF string functions using known-dwarf macros.
readelf and tests were using hard coded string tables to produce DWARF
string constants. Use the known-dwarf macros to redefine these and
reduce code. Technique comes from dwarf branch dwarfstrings.c.
Mark Wielaard [Fri, 22 Jun 2012 10:02:45 +0000 (12:02 +0200)]
libdw: Add support for DWZ multifile forms DW_FORM_GNU_ref_alt/strp_alt.
DWZ multifile forms http://www.dwarfstd.org/ShowIssue.php?issue=120604.1
DW_FORM_GNU_ref_alt and DW_FORM_GNU_strp_alt reference an alternative
debuginfo file. dwarf_begin and dwarf_begin_elf will try to use this
automatically. There are no user visible changes to the libdw interface.
dwarf_formref_die, dwarf_formstring and dwarf_formudata can now return
a Dwarf_Die which comes from a CU in the alternative Dwarf descriptor.
__libdw_read_offset was adjusted to take an alternative Dwarf descriptor
into account.