stack: New option -d, --debugname to lookup DWARF debuginfo name for frame.
New option -i, --inlines to show inlined frames using DWARF debuginfo.
+libelf: New function elf_begin_at_offset.
+
Version 0.158
libdwfl: dwfl_core_file_report has new parameter executable.
bool close_on_fail, bool archive_ok)
internal_function;
+/* Call __libdw_open_file but the ELF file starts in *FDP at START_OFFSET and
+ has length MAXIMUM_SIZE. __libdw_open_file defaults to 0 and ~((size_t) 0)
+ respectively. */
+extern Dwfl_Error __libdw_open_file_at_offset (int *fdp, Elf **elfp,
+ off_t start_offset,
+ size_t maximum_size,
+ bool close_on_fail,
+ bool archive_ok)
+ internal_function;
+
/* Fetch PT_DYNAMIC P_VADDR from ELF and store it to *VADDRP. Return success.
*VADDRP is not modified if the function fails. */
extern bool __libdwfl_dynamic_vaddr_get (Elf *elf, GElf_Addr *vaddrp)
}
Dwfl_Error internal_function
-__libdw_open_file (int *fdp, Elf **elfp, bool close_on_fail, bool archive_ok)
+__libdw_open_file_at_offset (int *fdp, Elf **elfp, off_t start_offset,
+ size_t maximum_size, bool close_on_fail,
+ bool archive_ok)
{
bool close_fd = false;
- Elf *elf = elf_begin (*fdp, ELF_C_READ_MMAP_PRIVATE, NULL);
+ Elf *elf = elf_begin_at_offset (*fdp, ELF_C_READ_MMAP_PRIVATE, NULL,
+ start_offset, maximum_size);
Elf_Kind kind;
Dwfl_Error error = what_kind (*fdp, &elf, &kind, &close_fd);
*elfp = elf;
return error;
}
+
+Dwfl_Error internal_function
+__libdw_open_file (int *fdp, Elf **elfp, bool close_on_fail, bool archive_ok)
+{
+ return __libdw_open_file_at_offset (fdp, elfp, 0, ~((size_t) 0),
+ close_on_fail, archive_ok);
+}
/* Return a descriptor for the file belonging to FILDES. */
Elf *
-elf_begin (fildes, cmd, ref)
- int fildes;
- Elf_Cmd cmd;
- Elf *ref;
+elf_begin_at_offset (int fildes, Elf_Cmd cmd, Elf *ref, off_t start_offset,
+ size_t maximum_size)
{
Elf *retval;
retval = lock_dup_elf ();
else
/* Create descriptor for existing file. */
- retval = read_file (fildes, 0, ~((size_t) 0), cmd, NULL);
+ retval = read_file (fildes, start_offset, maximum_size, cmd, NULL);
break;
case ELF_C_RDWR:
}
else
/* Create descriptor for existing file. */
- retval = read_file (fildes, 0, ~((size_t) 0), cmd, NULL);
+ retval = read_file (fildes, start_offset, maximum_size, cmd, NULL);
break;
case ELF_C_WRITE:
return retval;
}
+INTDEF(elf_begin_at_offset)
+
+Elf *
+elf_begin (fildes, cmd, ref)
+ int fildes;
+ Elf_Cmd cmd;
+ Elf *ref;
+{
+ return elf_begin_at_offset (fildes, cmd, ref, 0, ~((size_t) 0));
+}
INTDEF(elf_begin)
/* Return descriptor for ELF file to work according to CMD. */
extern Elf *elf_begin (int __fildes, Elf_Cmd __cmd, Elf *__ref);
+/* Call elf_begin but the ELF file starts in FILDES at START_OFFSET and
+ has length MAXIMUM_SIZE. elf_begin defaults to 0 and ~((size_t) 0)
+ respectively. */
+extern Elf *elf_begin_at_offset (int fildes, Elf_Cmd __cmd, Elf *__ref,
+ off_t start_offset, size_t maximum_size);
+
/* Create a clone of an existing ELF descriptor. */
extern Elf *elf_clone (Elf *__elf, Elf_Cmd __cmd);
global:
elf_getphdrnum;
} ELFUTILS_1.5;
+
+ELFUTILS_1.7 {
+ global:
+ elf_begin_at_offset;
+} ELFUTILS_1.6;