rpm/elfutils/libdw/libdw.h

56 lines
1.6 KiB
C

/* Interfaces for libdw.
Copyright (C) 2002 Red Hat, Inc.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
This program is Open Source software; you can redistribute it and/or
modify it under the terms of the Open Software License version 1.0 as
published by the Open Source Initiative.
You should have received a copy of the Open Software License along
with this program; if not, you may obtain a copy of the Open Software
License version 1.0 from http://www.opensource.org/licenses/osl.php or
by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
3001 King Ranch Road, Ukiah, CA 95482. */
#ifndef _LIBDW_H
#define _LIBDW_H 1
#include <gelf.h>
/* Mode for the session. */
typedef enum
{
DWARF_C_READ, /* Read .. */
DWARF_C_RDWR, /* Read and write .. */
DWARF_C_WRITE, /* Write .. */
}
Dwarf_Cmd;
/* Type for offset in DWARF file. */
typedef GElf_Off Dwarf_Off;
/* Handle for debug sessions. */
typedef struct Dwarf Dwarf;
/* Create a handle for a new debug session. */
extern Dwarf *dwarf_begin (int fildes, Dwarf_Cmd cmd);
/* Create a handle for a new debug session for an ELF file. */
extern Dwarf *dwarf_begin_elf (Elf *elf, Dwarf_Cmd cmd, Elf_Scn *scngrp);
/* Retrieve ELF descriptor used for DWARF access. */
extern Elf *dwarf_get_elf (Dwarf *dwarf);
/* Get the data block for the .debug_info section. */
extern Elf_Data *dwarf_getscn_info (Dwarf *dwarf);
/* Read the header for the DWARF CU header. */
extern int dwarf_nextcu (Dwarf *dwarf, Dwarf_Off off, Dwarf_Off *next_off,
size_t header_size);
#endif /* libdw.h */